Skip to content

Commit f1f05ec

Browse files
committed
change: doc formatting
1 parent 7621d41 commit f1f05ec

File tree

12 files changed

+449
-537
lines changed

12 files changed

+449
-537
lines changed

docs/ARCHITECTURE.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ export default defineConfig({
8282
fileName: (format) => `rds.${format}.js`,
8383
},
8484
rollupOptions: {
85-
external: [/* all dependencies externalized */],
85+
external: [
86+
/* all dependencies externalized */
87+
],
8688
output: {
8789
globals: {
8890
react: 'React',
@@ -97,12 +99,12 @@ export default defineConfig({
9799

98100
### Build Outputs
99101

100-
| Output | Format | Use Case |
101-
|--------|--------|----------|
102-
| `dist/rds.es.js` | ES Modules | Modern bundlers (Vite, webpack 5+) |
103-
| `dist/rds.umd.js` | UMD | Browser `<script>` tags, older bundlers |
104-
| `dist/main.d.ts` | TypeScript | Type definitions |
105-
| `dist/style.css` | CSS | Compiled styles |
102+
| Output | Format | Use Case |
103+
| ----------------- | ---------- | --------------------------------------- |
104+
| `dist/rds.es.js` | ES Modules | Modern bundlers (Vite, webpack 5+) |
105+
| `dist/rds.umd.js` | UMD | Browser `<script>` tags, older bundlers |
106+
| `dist/main.d.ts` | TypeScript | Type definitions |
107+
| `dist/style.css` | CSS | Compiled styles |
106108

107109
### Bundle Size Limits
108110

@@ -133,6 +135,7 @@ npm run create-lists
133135
### CSS Processing
134136

135137
PostCSS pipeline with:
138+
136139
1. **Tailwind CSS** - Utility-first styles
137140
2. **PostCSS Nesting** - CSS nesting support
138141
3. **Autoprefixer** - Browser prefixes
@@ -231,6 +234,7 @@ export const Card = Object.assign(CardWrapper, {
231234
```
232235

233236
**Usage:**
237+
234238
```tsx
235239
<Card>
236240
<Card.Figure src="/image.jpg" />
@@ -244,6 +248,7 @@ export const Card = Object.assign(CardWrapper, {
244248
### TypeScript Patterns
245249

246250
**Props Interface Pattern:**
251+
247252
```typescript
248253
export interface ButtonProps extends React.ComponentPropsWithoutRef<'button'> {
249254
color?: 'red' | 'grey' | 'dark-grey' | 'black' | 'white'
@@ -254,6 +259,7 @@ export interface ButtonProps extends React.ComponentPropsWithoutRef<'button'> {
254259
```
255260

256261
**Discriminated Union Pattern:**
262+
257263
```typescript
258264
// Button with title
259265
interface ButtonTitleProps extends BaseButtonProps {
@@ -305,26 +311,26 @@ import { Link } from 'next/link'
305311

306312
### Key Runtime Dependencies
307313

308-
| Package | Version | Purpose |
309-
|---------|---------|---------|
310-
| `formik` | 2.4.9 | Form state management |
311-
| `yup` | 1.7.1 | Schema validation |
312-
| `date-fns` | 4.1.0 | Date utilities |
313-
| `react-select` | 5.10.2 | Enhanced select dropdown |
314-
| `react-player` | 3.4.0 | Video player |
315-
| `dompurify` | 3.3.1 | HTML sanitization |
316-
| `@react-google-maps/api` | 2.20.8 | Google Maps |
314+
| Package | Version | Purpose |
315+
| ------------------------ | ------- | ------------------------ |
316+
| `formik` | 2.4.9 | Form state management |
317+
| `yup` | 1.7.1 | Schema validation |
318+
| `date-fns` | 4.1.0 | Date utilities |
319+
| `react-select` | 5.10.2 | Enhanced select dropdown |
320+
| `react-player` | 3.4.0 | Video player |
321+
| `dompurify` | 3.3.1 | HTML sanitization |
322+
| `@react-google-maps/api` | 2.20.8 | Google Maps |
317323

318324
### Styling Dependencies
319325

320-
| Package | Purpose |
321-
|---------|---------|
322-
| `tailwindcss` | Utility CSS framework |
323-
| `rds-tailwind-theme` | Carleton custom theme preset |
324-
| `@tailwindcss/forms` | Form element styles |
325-
| `@tailwindcss/typography` | Prose styles |
326-
| `@tailwindcss/aspect-ratio` | Aspect ratio utilities |
327-
| `@tailwindcss/container-queries` | Container queries |
326+
| Package | Purpose |
327+
| -------------------------------- | ---------------------------- |
328+
| `tailwindcss` | Utility CSS framework |
329+
| `rds-tailwind-theme` | Carleton custom theme preset |
330+
| `@tailwindcss/forms` | Form element styles |
331+
| `@tailwindcss/typography` | Prose styles |
332+
| `@tailwindcss/aspect-ratio` | Aspect ratio utilities |
333+
| `@tailwindcss/container-queries` | Container queries |
328334

329335
## Configuration Files
330336

docs/COMPONENTS.md

Lines changed: 28 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ List item component with similar structure to Card.
218218
```tsx
219219
import { Listing } from '@carletonuniversity/rds'
220220

221-
<Listing>
221+
;<Listing>
222222
<Listing.Figure>
223223
<img src="/thumb.jpg" alt="" />
224224
</Listing.Figure>
@@ -253,10 +253,7 @@ Descriptive text blocks, often used for definition lists.
253253
```tsx
254254
import { Description } from '@carletonuniversity/rds'
255255

256-
<Description
257-
title="Term"
258-
content="Definition or explanation of the term."
259-
/>
256+
;<Description title="Term" content="Definition or explanation of the term." />
260257
```
261258

262259
---
@@ -268,7 +265,7 @@ Expandable/collapsible content section.
268265
```tsx
269266
import { Details } from '@carletonuniversity/rds'
270267

271-
<Details summary="Click to expand">
268+
;<Details summary="Click to expand">
272269
<p>Hidden content revealed when expanded.</p>
273270
</Details>
274271
```
@@ -335,7 +332,7 @@ Data table with sorting support.
335332
```tsx
336333
import { Table } from '@carletonuniversity/rds'
337334

338-
<Table>
335+
;<Table>
339336
<Table.Header>
340337
<Table.Row>
341338
<Table.HeaderCell>Name</Table.HeaderCell>
@@ -362,11 +359,7 @@ Page navigation component.
362359
```tsx
363360
import { Pagination } from '@carletonuniversity/rds'
364361

365-
<Pagination
366-
currentPage={1}
367-
totalPages={10}
368-
onPageChange={(page) => setCurrentPage(page)}
369-
/>
362+
;<Pagination currentPage={1} totalPages={10} onPageChange={(page) => setCurrentPage(page)} />
370363
```
371364

372365
---
@@ -378,10 +371,7 @@ Date selection calendar.
378371
```tsx
379372
import { Calendar } from '@carletonuniversity/rds'
380373

381-
<Calendar
382-
selectedDate={selectedDate}
383-
onDateSelect={(date) => setSelectedDate(date)}
384-
/>
374+
;<Calendar selectedDate={selectedDate} onDateSelect={(date) => setSelectedDate(date)} />
385375
```
386376

387377
---
@@ -395,7 +385,7 @@ Full-screen hero banner with video/image support.
395385
```tsx
396386
import { Splash } from '@carletonuniversity/rds'
397387

398-
<Splash>
388+
;<Splash>
399389
<Splash.Background>
400390
<Splash.Video src="/hero-video.mp4" />
401391
{/* or */}
@@ -449,11 +439,7 @@ Full-width image section.
449439
```tsx
450440
import { WideImage } from '@carletonuniversity/rds'
451441

452-
<WideImage
453-
src="/wide-image.jpg"
454-
alt="Description"
455-
caption="Image caption"
456-
/>
442+
;<WideImage src="/wide-image.jpg" alt="Description" caption="Image caption" />
457443
```
458444

459445
---
@@ -465,7 +451,7 @@ Page header with title and metadata.
465451
```tsx
466452
import { PageHeader } from '@carletonuniversity/rds'
467453

468-
<PageHeader
454+
;<PageHeader
469455
title="Page Title"
470456
subtitle="Page subtitle"
471457
breadcrumbs={[
@@ -486,10 +472,7 @@ Minimal footer with copyright.
486472
```tsx
487473
import { FooterBasic } from '@carletonuniversity/rds'
488474

489-
<FooterBasic
490-
copyrightYear={2024}
491-
organization="Carleton University"
492-
/>
475+
;<FooterBasic copyrightYear={2024} organization="Carleton University" />
493476
```
494477

495478
### FooterStandard
@@ -499,10 +482,7 @@ Standard footer with navigation links.
499482
```tsx
500483
import { FooterStandard } from '@carletonuniversity/rds'
501484

502-
<FooterStandard
503-
links={footerLinks}
504-
socialLinks={socialLinks}
505-
/>
485+
;<FooterStandard links={footerLinks} socialLinks={socialLinks} />
506486
```
507487

508488
### FooterAthletics
@@ -528,7 +508,7 @@ Complex navigation component with responsive support.
528508
```tsx
529509
import { Nav } from '@carletonuniversity/rds'
530510

531-
<Nav>
511+
;<Nav>
532512
<Nav.Top>
533513
<Nav.Logo src="/logo.svg" alt="Logo" />
534514
<Nav.Buttons>
@@ -596,11 +576,7 @@ Styled blockquotes.
596576
```tsx
597577
import { Quote } from '@carletonuniversity/rds'
598578
599-
<Quote
600-
text="This is a quoted statement."
601-
author="John Doe"
602-
citation="Source Publication"
603-
/>
579+
;<Quote text="This is a quoted statement." author="John Doe" citation="Source Publication" />
604580
```
605581

606582
---
@@ -612,12 +588,7 @@ Testimonial/review blocks.
612588
```tsx
613589
import { Testimonial } from '@carletonuniversity/rds'
614590
615-
<Testimonial
616-
quote="Great experience working with RDS!"
617-
author="Jane Smith"
618-
role="Developer"
619-
image="/jane.jpg"
620-
/>
591+
;<Testimonial quote="Great experience working with RDS!" author="Jane Smith" role="Developer" image="/jane.jpg" />
621592
```
622593

623594
---
@@ -629,7 +600,7 @@ Event timeline visualization.
629600
```tsx
630601
import { Timeline } from '@carletonuniversity/rds'
631602
632-
<Timeline
603+
;<Timeline
633604
items={[
634605
{ date: '2024-01', title: 'Project Started', description: '...' },
635606
{ date: '2024-03', title: 'Beta Release', description: '...' },
@@ -647,7 +618,7 @@ Filter sidebar for search results.
647618
```tsx
648619
import { FilterPanel } from '@carletonuniversity/rds'
649620
650-
<FilterPanel
621+
;<FilterPanel
651622
filters={[
652623
{
653624
name: 'category',
@@ -673,7 +644,7 @@ Notification toasts.
673644
```tsx
674645
import { Toast } from '@carletonuniversity/rds'
675646
676-
<Toast
647+
;<Toast
677648
type="success"
678649
message="Action completed successfully!"
679650
isVisible={showToast}
@@ -690,7 +661,7 @@ Highlighted callout boxes.
690661
```tsx
691662
import { CallOut } from '@carletonuniversity/rds'
692663
693-
<CallOut type="info" title="Note">
664+
;<CallOut type="info" title="Note">
694665
Important information for the user.
695666
</CallOut>
696667
```
@@ -719,11 +690,7 @@ Images with captions.
719690
```tsx
720691
import { Figure } from '@carletonuniversity/rds'
721692
722-
<Figure
723-
src="/image.jpg"
724-
alt="Image description"
725-
caption="Figure 1: Image caption"
726-
/>
693+
;<Figure src="/image.jpg" alt="Image description" caption="Figure 1: Image caption" />
727694
```
728695

729696
---
@@ -755,7 +722,7 @@ Grid layout for multiple images.
755722
```tsx
756723
import { ImageGrid } from '@carletonuniversity/rds'
757724
758-
<ImageGrid
725+
;<ImageGrid
759726
images={[
760727
{ src: '/img1.jpg', alt: 'Image 1' },
761728
{ src: '/img2.jpg', alt: 'Image 2' },
@@ -774,7 +741,7 @@ Image carousel/slider.
774741
```tsx
775742
import { ImageSlider } from '@carletonuniversity/rds'
776743
777-
<ImageSlider
744+
;<ImageSlider
778745
images={[
779746
{ src: '/slide1.jpg', alt: 'Slide 1' },
780747
{ src: '/slide2.jpg', alt: 'Slide 2' },
@@ -801,10 +768,13 @@ import {
801768
} from '@carletonuniversity/rds'
802769
803770
// Use while data is loading
804-
{isLoading ? <CardNewsLoader /> : <Card>...</Card>}
771+
{
772+
isLoading ? <CardNewsLoader /> : <Card>...</Card>
773+
}
805774
```
806775

807776
**Available Loaders:**
777+
808778
- `CardEventLoader`, `CardIconLoader`, `CardNewsLoader`, `CardPageLoader`, `CardPeopleLoader`, `CardVideoLoader`
809779
- `ListingEventLoader`, `ListingIconLoader`, `ListingNewsLoader`, `ListingPageLoader`, `ListingPeopleLoader`, `ListingDescriptionLoader`
810780
- `CalendarLoader`, `DescriptionLoader`, `DescriptionLoaderAccordion`
@@ -823,10 +793,7 @@ import {
823793
```tsx
824794
import { Forbidden403 } from '@carletonuniversity/rds'
825795
826-
<Forbidden403
827-
message="You don't have permission to access this page."
828-
homeLink="/"
829-
/>
796+
;<Forbidden403 message="You don't have permission to access this page." homeLink="/" />
830797
```
831798

832799
### NotFound404
@@ -836,11 +803,7 @@ import { Forbidden403 } from '@carletonuniversity/rds'
836803
```tsx
837804
import { NotFound404 } from '@carletonuniversity/rds'
838805
839-
<NotFound404
840-
message="The page you're looking for doesn't exist."
841-
homeLink="/"
842-
searchLink="/search"
843-
/>
806+
;<NotFound404 message="The page you're looking for doesn't exist." homeLink="/" searchLink="/search" />
844807
```
845808

846809
---
@@ -890,6 +853,7 @@ ComponentName/
890853
### Testing Components
891854

892855
Each component should have:
856+
893857
1. Storybook stories covering all variants
894858
2. Cypress tests for interactive behavior
895859
3. Accessibility checks via Storybook a11y addon

0 commit comments

Comments
 (0)