rl-react-components 0.0.0-stage → 2.4.1

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 (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +90 -2
  3. package/dist/components/Button/Button.d.ts +8 -0
  4. package/dist/components/Button/index.d.ts +2 -0
  5. package/dist/components/Card/Card.d.ts +28 -0
  6. package/dist/components/Card/index.d.ts +2 -0
  7. package/dist/components/Container/Container.d.ts +12 -0
  8. package/dist/components/Container/index.d.ts +2 -0
  9. package/dist/components/Markdown/Markdown.d.ts +11 -0
  10. package/dist/components/Markdown/index.d.ts +2 -0
  11. package/dist/components/MarkdownEditor/MarkdownEditor.d.ts +24 -0
  12. package/dist/components/MarkdownEditor/index.d.ts +2 -0
  13. package/dist/components/MatrixContainer/MatrixContainer.d.ts +54 -0
  14. package/dist/components/MatrixContainer/index.d.ts +4 -0
  15. package/dist/components/MatrixContainer/matrixConfig.d.ts +49 -0
  16. package/dist/components/OrbitalDots/OrbitalDots.d.ts +52 -0
  17. package/dist/components/OrbitalDots/index.d.ts +4 -0
  18. package/dist/components/OrbitalDots/orbitalDotsConfig.d.ts +54 -0
  19. package/dist/components/PageHero/PageHero.d.ts +10 -0
  20. package/dist/components/PageHero/index.d.ts +2 -0
  21. package/dist/components/PageTransition/PageTransition.d.ts +17 -0
  22. package/dist/components/PageTransition/index.d.ts +2 -0
  23. package/dist/components/Section/Section.d.ts +13 -0
  24. package/dist/components/Section/index.d.ts +2 -0
  25. package/dist/components/Select/Select.d.ts +11 -0
  26. package/dist/components/Select/index.d.ts +2 -0
  27. package/dist/components/ShimmerImage/ShimmerImage.d.ts +11 -0
  28. package/dist/components/ShimmerImage/index.d.ts +2 -0
  29. package/dist/components/SideNav/SideNav.d.ts +43 -0
  30. package/dist/components/SideNav/index.d.ts +2 -0
  31. package/dist/components/Tag/Tag.d.ts +24 -0
  32. package/dist/components/Tag/index.d.ts +2 -0
  33. package/dist/components/TagFilter/TagFilter.d.ts +10 -0
  34. package/dist/components/TagFilter/index.d.ts +2 -0
  35. package/dist/components/Text/Text.d.ts +37 -0
  36. package/dist/components/Text/index.d.ts +2 -0
  37. package/dist/components/TextArea/TextArea.d.ts +5 -0
  38. package/dist/components/TextArea/index.d.ts +2 -0
  39. package/dist/components/TextInput/TextInput.d.ts +7 -0
  40. package/dist/components/TextInput/index.d.ts +2 -0
  41. package/dist/components/Toast/ToastProvider.d.ts +13 -0
  42. package/dist/components/Toast/index.d.ts +2 -0
  43. package/dist/hooks/useDragReorder.d.ts +20 -0
  44. package/dist/hooks/useRotatingMessage.d.ts +10 -0
  45. package/dist/index.d.ts +40 -0
  46. package/dist/index.js +1142 -0
  47. package/dist/styles.css +2 -0
  48. package/package.json +99 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Renato Lins
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 CHANGED
@@ -1,3 +1,91 @@
1
- # Temporary Holding Version
1
+ # rl-react-components
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ React 19 components and hooks built on one design system: layout, navigation, form fields, tags,
4
+ cards, Markdown, toasts and canvas effects. Dark and light modes, TypeScript types, and no text of
5
+ their own: every word a visitor reads comes in as a prop, in any language.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install rl-react-components
11
+ ```
12
+
13
+ React and React DOM 19 are the only peer dependencies.
14
+
15
+ ## Usage
16
+
17
+ Import the stylesheet once, at the root of the app, then use the components anywhere below it:
18
+
19
+ ```tsx
20
+ import 'rl-react-components/styles.css';
21
+ import { Button, TextInput, ToastProvider, useToast } from 'rl-react-components';
22
+
23
+ function NewsletterForm() {
24
+ const { addToast } = useToast();
25
+
26
+ return (
27
+ <form
28
+ onSubmit={(event) => {
29
+ event.preventDefault();
30
+ addToast('You are subscribed.');
31
+ }}
32
+ >
33
+ <TextInput label="Email" type="email" required />
34
+ <Button type="submit">Subscribe</Button>
35
+ </form>
36
+ );
37
+ }
38
+
39
+ export default function App() {
40
+ return (
41
+ <ToastProvider dismissLabel="Dismiss notification">
42
+ <NewsletterForm />
43
+ </ToastProvider>
44
+ );
45
+ }
46
+ ```
47
+
48
+ The components need no CSS reset: each sets the box model, margins and fonts it relies on.
49
+
50
+ ## Light mode
51
+
52
+ Dark is the default. Put `data-theme="light"` on `<html>` to switch the page, or on any element to
53
+ switch just that part:
54
+
55
+ ```ts
56
+ document.documentElement.dataset.theme = 'light';
57
+ ```
58
+
59
+ Every colour is a CSS custom property (`--color-accent`, `--color-bg` and so on), so an app can
60
+ override any of them in its own CSS.
61
+
62
+ ## What is inside
63
+
64
+ | Group | Components and hooks |
65
+ | -------------- | ---------------------------------------------------- |
66
+ | Text | `Text` |
67
+ | Layout | `Container`, `Section`, `PageHero`, `PageTransition` |
68
+ | Navigation | `SideNav` |
69
+ | Forms | `Button`, `TextInput`, `TextArea`, `Select` |
70
+ | Tags | `Tag`, `TagFilter` |
71
+ | Content | `Card`, `Markdown`, `MarkdownEditor`, `ShimmerImage` |
72
+ | Feedback | `ToastProvider`, `useToast` |
73
+ | Canvas effects | `MatrixContainer`, `OrbitalDots` |
74
+ | Hooks | `useDragReorder`, `useRotatingMessage` |
75
+
76
+ ## Documentation
77
+
78
+ - [Components](https://github.com/renatolinsdigital/react-shared-components/blob/master/docs/components.md):
79
+ what each one does, with a link to its props and examples.
80
+ - [Getting started](https://github.com/renatolinsdigital/react-shared-components/blob/master/docs/getting-started.md):
81
+ routers, server rendering and upgrading.
82
+ - [Theming](https://github.com/renatolinsdigital/react-shared-components/blob/master/docs/theming.md):
83
+ the colour tokens and how to override them.
84
+ - [Accessibility](https://github.com/renatolinsdigital/react-shared-components/blob/master/docs/accessibility.md):
85
+ what the components handle, and what the app supplies.
86
+
87
+ Questions and bug reports: [GitHub issues](https://github.com/renatolinsdigital/react-shared-components/issues).
88
+
89
+ ## License
90
+
91
+ MIT
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
+ variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
4
+ size?: 'small' | 'medium' | 'large';
5
+ fullWidth?: boolean;
6
+ children: React.ReactNode;
7
+ }
8
+ export default function Button({ variant, size, fullWidth, children, className, ...props }: ButtonProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './Button';
2
+ export type { ButtonProps } from './Button';
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ export interface CardProps {
3
+ title: React.ReactNode;
4
+ /** A line or two under the title. */
5
+ description?: React.ReactNode;
6
+ /** Shown in an accent tile at the top. Decorative: the tile is hidden from screen readers. */
7
+ icon?: React.ReactNode;
8
+ /** A short label at the top, such as a category. */
9
+ eyebrow?: React.ReactNode;
10
+ /** Makes the whole card a link, with a hover lift, a glow that follows the pointer and an arrow. */
11
+ href?: string;
12
+ target?: string;
13
+ rel?: string;
14
+ /** Renders the title as a heading of this level instead of plain text. */
15
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
16
+ /**
17
+ * The element or component to render. Default: 'a' with `href`, else 'div'. Pass a router's
18
+ * link component to navigate without a page load: it receives `href` and the rest.
19
+ */
20
+ as?: React.ElementType;
21
+ /** Content under the description. Nothing interactive in a link card: links cannot nest. */
22
+ children?: React.ReactNode;
23
+ className?: string;
24
+ style?: React.CSSProperties;
25
+ id?: string;
26
+ }
27
+ /** A surface with an optional icon and eyebrow, a title and a description; a link with `href`. */
28
+ export default function Card({ title, description, icon, eyebrow, href, target, rel, headingLevel, as, children, className, style, id, }: CardProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './Card';
2
+ export type { CardProps } from './Card';
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export interface ContainerProps {
3
+ children: React.ReactNode;
4
+ /**
5
+ * The breakpoint whose width caps the container: `sm` 640px, `md` 768px, `lg` 1024px,
6
+ * `xl` 1280px, `xxl` 1600px.
7
+ */
8
+ size?: 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
9
+ className?: string;
10
+ as?: React.ElementType;
11
+ }
12
+ export default function Container({ children, size, className, as: Tag, }: ContainerProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './Container';
2
+ export type { ContainerProps } from './Container';
@@ -0,0 +1,11 @@
1
+ export interface MarkdownProps {
2
+ /** Markdown source. GitHub-flavoured tables and ~~strikethrough~~ are supported. */
3
+ children: string;
4
+ className?: string;
5
+ }
6
+ /**
7
+ * Renders Markdown as React elements. Raw HTML in the source is shown as text and unsafe
8
+ * link protocols such as `javascript:` are dropped, so content typed into the dashboard
9
+ * cannot inject scripts into the page.
10
+ */
11
+ export default function Markdown({ children, className }: MarkdownProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './Markdown';
2
+ export type { MarkdownProps } from './Markdown';
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ export type MarkdownAction = 'bold' | 'italic' | 'strikethrough' | 'heading1' | 'heading2' | 'heading3' | 'link' | 'image' | 'code' | 'bulletList' | 'numberedList' | 'quote' | 'codeBlock' | 'horizontalRule';
3
+ /** The editor's own text, so the caller can give it in the page's language. */
4
+ export interface MarkdownEditorLabels {
5
+ /** The tooltip and accessible name of each toolbar button. */
6
+ actions: Record<MarkdownAction, string>;
7
+ preview: string;
8
+ /** Inserted when a wrapping action (bold, link) runs with nothing selected. */
9
+ sampleText: string;
10
+ /**
11
+ * Read by screen readers with the text area, to say how to leave it, such as "Tab indents.
12
+ * Press Escape, then Tab, to leave the editor."
13
+ */
14
+ tabHint?: string;
15
+ }
16
+ export interface MarkdownEditorProps {
17
+ value: string;
18
+ onChange: (value: string) => void;
19
+ labels: MarkdownEditorLabels;
20
+ /** Shown above the editor and tied to its text area, which has no other name. */
21
+ label: string;
22
+ placeholder?: string;
23
+ }
24
+ export default function MarkdownEditor({ value, onChange, labels, label, placeholder, }: MarkdownEditorProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './MarkdownEditor';
2
+ export type { MarkdownAction, MarkdownEditorLabels, MarkdownEditorProps } from './MarkdownEditor';
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ import type { MatrixConfig } from './matrixConfig';
3
+ export interface MatrixContainerProps {
4
+ /** Content rendered above the matrix canvas */
5
+ children?: React.ReactNode;
6
+ /**
7
+ * Partial config override, merged over MATRIX_CONFIG at mount and then kept
8
+ * live: later changes apply to the running animation in place, without
9
+ * tearing down the canvas or the ResizeObserver. A key dropped from it falls
10
+ * back to its default. Start from MATRIX_PRESETS or MATRIX_THEME_CONFIG, or
11
+ * write one. Pass a stable object (defined outside the component or via
12
+ * useMemo) so unrelated parent re-renders do not trigger redundant merges.
13
+ */
14
+ config?: Partial<MatrixConfig>;
15
+ /**
16
+ * CSS opacity applied to the canvas element itself (0 to 1).
17
+ * Multiplies with the per-glyph opacity values in config.
18
+ * Useful for dimming the entire effect without touching the config.
19
+ * Default: 1
20
+ */
21
+ canvasOpacity?: number;
22
+ /**
23
+ * Stops the rain on its current frame, and starts it again when false. Gives the app a way to
24
+ * offer a pause control. The rain also holds still while the reader prefers reduced motion.
25
+ * Default: false
26
+ */
27
+ paused?: boolean;
28
+ /** Merged onto the wrapper element alongside the internal `.wrapper` class */
29
+ className?: string;
30
+ style?: React.CSSProperties;
31
+ id?: string;
32
+ /**
33
+ * HTML element to render as the wrapper.
34
+ * Use 'section', 'footer', 'aside', etc. to preserve semantic HTML.
35
+ * Default: 'div'
36
+ */
37
+ as?: React.ElementType;
38
+ }
39
+ /**
40
+ * MatrixContainer
41
+ *
42
+ * A wrapper element that renders the animated katakana matrix-rain canvas
43
+ * permanently in its background. All content passed as `children` is
44
+ * rendered on top of the canvas via a `position: relative; z-index: 1` layer.
45
+ *
46
+ * The canvas auto-sizes to fill the wrapper via ResizeObserver and cleans up
47
+ * on unmount (cancelAnimationFrame + ResizeObserver.disconnect). It is
48
+ * decorative, so it is hidden from assistive technology. While `paused` is set,
49
+ * or the reader prefers reduced motion, it draws one still frame instead.
50
+ *
51
+ * @see README.md for full algorithm and config documentation.
52
+ */
53
+ declare const MatrixContainer: React.ForwardRefExoticComponent<MatrixContainerProps & React.RefAttributes<HTMLElement>>;
54
+ export default MatrixContainer;
@@ -0,0 +1,4 @@
1
+ export { default } from './MatrixContainer';
2
+ export type { MatrixContainerProps } from './MatrixContainer';
3
+ export { MATRIX_CONFIG, MATRIX_PRESETS, MATRIX_THEME_CONFIG } from './matrixConfig';
4
+ export type { MatrixConfig, MatrixPresetName } from './matrixConfig';
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Matrix rain effect: configuration
3
+ *
4
+ * All visual parameters for the falling-glyph animation. A `config` prop on
5
+ * <MatrixContainer> overrides any of them, and changes to it apply live.
6
+ * The defaults and the presets follow the standalone matrix-container repo.
7
+ */
8
+ export interface MatrixConfig {
9
+ /** Font size in px, which is also the width and height of a grid cell */
10
+ fontSize: number;
11
+ /**
12
+ * Probability (0 to 1) that a column is active and has a falling stream.
13
+ * 0.25 means one column in four. Lower reads sparser, airier.
14
+ */
15
+ columnDensity: number;
16
+ /** Number of rows in the fading tail behind the head glyph */
17
+ trailLength: number;
18
+ /**
19
+ * Milliseconds between each one-row advancement. Higher means a slower
20
+ * fall: at 50 ms and 20 px rows, a stream crosses 800 px in 2 s.
21
+ */
22
+ tickMs: number;
23
+ /** The glyph colour as an RGB triple with no alpha, such as '0, 255, 0' */
24
+ color: string;
25
+ /** Opacity of the leading (brightest) glyph, 0 to 1 */
26
+ headOpacity: number;
27
+ /** Maximum opacity of the glyph immediately behind the head, 0 to 1 */
28
+ trailOpacityMax: number;
29
+ /** Glyph pool; one is picked at random for every cell drawn */
30
+ chars: string[];
31
+ }
32
+ export declare const MATRIX_CONFIG: MatrixConfig;
33
+ /** The names of the looks in `MATRIX_PRESETS`, each a kind of rain. */
34
+ export type MatrixPresetName = 'drizzle' | 'downpour' | 'storm';
35
+ /**
36
+ * Ready-made looks, merged over the defaults like any other `config`, and
37
+ * named for the rain they draw. Spread one and add to it:
38
+ * `{ ...MATRIX_PRESETS.drizzle, color: '0, 220, 255' }`. Each sets its own
39
+ * trail opacity, so the head stays the brightest glyph.
40
+ */
41
+ export declare const MATRIX_PRESETS: Record<MatrixPresetName, Partial<MatrixConfig>>;
42
+ /**
43
+ * Mist: a quiet backdrop for each colour mode, for rain that sits behind text, for a
44
+ * caller that knows the active mode. Smaller, denser and much fainter than the
45
+ * defaults. Dark mode takes a lime softened toward green; light mode a deeper
46
+ * green, drawn stronger, because dark glyphs on a light page read much fainter
47
+ * than light ones on black at the same opacity.
48
+ */
49
+ export declare const MATRIX_THEME_CONFIG: Record<'dark' | 'light', Partial<MatrixConfig>>;
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import type { OrbitalDotsConfig } from './orbitalDotsConfig';
3
+ export interface OrbitalDotsProps {
4
+ /** Content rendered above the canvas. */
5
+ children?: React.ReactNode;
6
+ /**
7
+ * Partial config override, merged with ORBITAL_DOTS_CONFIG at mount.
8
+ * Pass a stable reference (defined outside the component or via useMemo)
9
+ * to avoid unnecessary remounts when the parent re-renders.
10
+ */
11
+ config?: Partial<OrbitalDotsConfig>;
12
+ /**
13
+ * CSS opacity on the <canvas> element (0 to 1).
14
+ * Useful for dimming the entire effect without touching the config.
15
+ * Default: 1
16
+ */
17
+ canvasOpacity?: number;
18
+ /**
19
+ * Stops the dots on their current frame, and starts them again when false. Gives the app a way
20
+ * to offer a pause control. The dots also hold still while the reader prefers reduced motion.
21
+ * Default: false
22
+ */
23
+ paused?: boolean;
24
+ /** Merged onto the wrapper element alongside the internal `.wrapper` class. */
25
+ className?: string;
26
+ style?: React.CSSProperties;
27
+ id?: string;
28
+ /**
29
+ * HTML element to render as the wrapper.
30
+ * Default: 'div'
31
+ */
32
+ as?: React.ElementType;
33
+ }
34
+ /**
35
+ * OrbitalDots
36
+ *
37
+ * A wrapper element that renders an animated particle-network canvas in its
38
+ * background: drifting glowing dots, proximity-based connector lines, an
39
+ * optional dashed orbit ring, and floating code-syntax symbols.
40
+ *
41
+ * All content passed as `children` is rendered on top of the canvas via a
42
+ * `position: relative; z-index: 1` layer.
43
+ *
44
+ * The canvas auto-sizes to fill the wrapper via ResizeObserver and cleans up
45
+ * on unmount (cancelAnimationFrame + ResizeObserver.disconnect). It is
46
+ * decorative, so it is hidden from assistive technology. While `paused` is set,
47
+ * or the reader prefers reduced motion, it draws one still frame instead.
48
+ *
49
+ * @see README.md for full algorithm and config documentation.
50
+ */
51
+ declare const OrbitalDots: React.ForwardRefExoticComponent<OrbitalDotsProps & React.RefAttributes<HTMLElement>>;
52
+ export default OrbitalDots;
@@ -0,0 +1,4 @@
1
+ export { default } from './OrbitalDots';
2
+ export type { OrbitalDotsProps } from './OrbitalDots';
3
+ export { ORBITAL_DOTS_CONFIG } from './orbitalDotsConfig';
4
+ export type { OrbitalDotsConfig } from './orbitalDotsConfig';
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Default configuration for the OrbitalDots canvas effect.
3
+ *
4
+ * All values can be partially overridden via the `config` prop on <OrbitalDots>.
5
+ * Config is captured once at mount: remount the component to apply new values.
6
+ */
7
+ export interface OrbitalDotsConfig {
8
+ /** Number of floating dot nodes. More dots = denser network. */
9
+ dotCount: number;
10
+ /** Maximum pixel distance between two dots before a connector line is drawn. */
11
+ maxLineDistance: number;
12
+ /** Minimum radius (px) of a dot. */
13
+ dotMinRadius: number;
14
+ /** Maximum radius (px) of a dot. */
15
+ dotMaxRadius: number;
16
+ /**
17
+ * Base velocity multiplier. Each dot's vx/vy is initialised as a random unit
18
+ * vector scaled by this value. Higher = faster drift.
19
+ */
20
+ speed: number;
21
+ /** Maximum opacity of a connector line (at zero distance). Falls off linearly to 0. */
22
+ lineOpacity: number;
23
+ /** Opacity range for dots: each dot gets a random value in [dotOpacityMin, 1]. */
24
+ dotOpacityMin: number;
25
+ /** Shadow glow spread in pixels applied to all dots. */
26
+ glowBlur: number;
27
+ /** Whether to draw the dashed orbit ring in the canvas centre. */
28
+ showOrbitRing: boolean;
29
+ /**
30
+ * Radius of the orbit ring as a fraction of min(canvasWidth, canvasHeight).
31
+ * e.g. 0.28 = 28% of the shortest edge.
32
+ */
33
+ orbitRingRadius: number;
34
+ /** Whether to render floating code symbols around the canvas. */
35
+ showSymbols: boolean;
36
+ /** Array of symbol strings to scatter around the canvas. */
37
+ symbols: string[];
38
+ /**
39
+ * Font size of the symbols, expressed as a fraction of min(width, height).
40
+ * e.g. 0.035 = 3.5% of the shortest canvas dimension.
41
+ */
42
+ symbolFontScale: number;
43
+ /**
44
+ * Milliseconds between draw frames. Lower = smoother but heavier.
45
+ * Matches MatrixContainer's `tickMs` convention.
46
+ */
47
+ tickMs: number;
48
+ /**
49
+ * Dot and line colour as an RGB triple string: `'R,G,B'`.
50
+ * Matches the MatrixContainer `color` convention.
51
+ */
52
+ color: string;
53
+ }
54
+ export declare const ORBITAL_DOTS_CONFIG: OrbitalDotsConfig;
@@ -0,0 +1,10 @@
1
+ export interface PageHeroProps {
2
+ eyebrow: string;
3
+ title: string;
4
+ subtitle: string;
5
+ /** Number shown in the corner badge, such as the total number of posts. */
6
+ count: number;
7
+ countLabel: string;
8
+ }
9
+ /** Intro block at the top of a listing page: eyebrow, title, subtitle and a counter badge. */
10
+ export default function PageHero({ eyebrow, title, subtitle, count, countLabel }: PageHeroProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './PageHero';
2
+ export type { PageHeroProps } from './PageHero';
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ export interface PageTransitionProps {
3
+ children: React.ReactNode;
4
+ /**
5
+ * A change fades the content out and back in. Pass the current route's pathname to fade on
6
+ * every navigation; leave it out to fade in once, on mount.
7
+ */
8
+ transitionKey?: string;
9
+ /**
10
+ * Fade the content in when the component mounts. Default: true. Pass false on a
11
+ * server-rendered page: the first content then shows at once, in the server HTML too, and
12
+ * only a change of `transitionKey` fades.
13
+ */
14
+ appear?: boolean;
15
+ }
16
+ /** Fades its content in on mount, and again whenever `transitionKey` changes. */
17
+ export default function PageTransition({ children, transitionKey, appear, }: PageTransitionProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './PageTransition';
2
+ export type { PageTransitionProps } from './PageTransition';
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export interface SectionProps {
3
+ children: React.ReactNode;
4
+ variant?: 'dark' | 'elevated';
5
+ noPadding?: boolean;
6
+ className?: string;
7
+ id?: string;
8
+ /** The id of the section's heading. A named section is a landmark a screen reader can jump to. */
9
+ 'aria-labelledby'?: string;
10
+ /** The section's name, for a section with no heading to point at. */
11
+ 'aria-label'?: string;
12
+ }
13
+ export default function Section({ children, variant, noPadding, className, id, 'aria-labelledby': ariaLabelledBy, 'aria-label': ariaLabel, }: SectionProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './Section';
2
+ export type { SectionProps } from './Section';
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
3
+ label?: string;
4
+ /** The text of the empty first option, such as "Select...". */
5
+ placeholder: string;
6
+ options: {
7
+ value: string;
8
+ label: string;
9
+ }[];
10
+ }
11
+ export default function Select({ label, placeholder, options, className, id, ...props }: SelectProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './Select';
2
+ export type { SelectProps } from './Select';
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export interface ShimmerImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'src' | 'alt' | 'onLoad'> {
3
+ src: string;
4
+ /** Describes the picture. Pass an empty string for a decorative one. */
5
+ alt: string;
6
+ }
7
+ /**
8
+ * An `<img>` that fills its positioned parent, shows a shimmer while the file loads and fades the
9
+ * picture in once it has decoded. `className` lands on the `<img>`.
10
+ */
11
+ export default function ShimmerImage({ src, alt, className, ...imageProps }: ShimmerImageProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './ShimmerImage';
2
+ export type { ShimmerImageProps } from './ShimmerImage';
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ export interface SideNavItem {
3
+ /** The link's text. */
4
+ label: React.ReactNode;
5
+ href: string;
6
+ /** Shown before the label. Decorative: hidden from screen readers. */
7
+ icon?: React.ReactNode;
8
+ }
9
+ export interface SideNavGroup {
10
+ /** Shown above the group's links, and names them as a list for screen readers. */
11
+ title: React.ReactNode;
12
+ /** Shown before the title. Decorative: hidden from screen readers. */
13
+ icon?: React.ReactNode;
14
+ items: SideNavItem[];
15
+ }
16
+ export interface SideNavProps {
17
+ /** Names the navigation landmark for screen readers, such as "Documentation". */
18
+ label: string;
19
+ /** Links and groups of links, in order. A group is any entry with `items`. */
20
+ items: (SideNavItem | SideNavGroup)[];
21
+ /** The `href` of the link to highlight, such as the current path or `'#section'`. */
22
+ activeHref?: string | null;
23
+ /**
24
+ * What the highlighted link's `aria-current` says: `'page'` for links to pages, `'location'`
25
+ * for links to sections of one page.
26
+ */
27
+ ariaCurrent?: 'page' | 'location';
28
+ /**
29
+ * Scrolls the nearest element around the menu that scrolls on its own, such as a sticky
30
+ * sidebar, so the current link stays in view as `activeHref` changes. It never scrolls the page.
31
+ */
32
+ keepActiveInView?: boolean;
33
+ /**
34
+ * The link element or component. Default: 'a'. Pass a router's link component to navigate
35
+ * without a page load: it receives `href`, `className`, `aria-current`, `onClick` and children.
36
+ */
37
+ as?: React.ElementType;
38
+ /** Called when a link is clicked, before it navigates, such as to close a drawer. */
39
+ onItemClick?: (item: SideNavItem, event: React.MouseEvent<HTMLAnchorElement>) => void;
40
+ className?: string;
41
+ }
42
+ /** A vertical menu of links, loose or in titled groups, each with an optional icon. */
43
+ export default function SideNav({ label, items, activeHref, ariaCurrent, keepActiveInView, as: Link, onItemClick, className, }: SideNavProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './SideNav';
2
+ export type { SideNavGroup, SideNavItem, SideNavProps } from './SideNav';
@@ -0,0 +1,24 @@
1
+ interface TagBaseProps {
2
+ label: string;
3
+ active?: boolean;
4
+ }
5
+ /**
6
+ * A tag is pressed as a whole or removed with its own button, never both: buttons cannot nest. The
7
+ * remove button shows only `×`, so it cannot be offered without the name a screen reader reads.
8
+ */
9
+ export type TagProps = TagBaseProps & ({
10
+ onClick?: never;
11
+ onRemove?: never;
12
+ removeLabel?: never;
13
+ } | {
14
+ onClick: () => void;
15
+ onRemove?: never;
16
+ removeLabel?: never;
17
+ } | {
18
+ onClick?: never;
19
+ onRemove: () => void;
20
+ /** The accessible name of the remove button, such as "Remove Branding". */
21
+ removeLabel: string;
22
+ });
23
+ export default function Tag({ label, active, onClick, onRemove, removeLabel }: TagProps): import("react").JSX.Element;
24
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default } from './Tag';
2
+ export type { TagProps } from './Tag';
@@ -0,0 +1,10 @@
1
+ export interface TagFilterProps {
2
+ tags: string[];
3
+ activeTag: string | null;
4
+ onTagClick: (tag: string | null) => void;
5
+ /** The text of the chip that clears the filter, such as "All". */
6
+ allLabel: string;
7
+ /** Names the row as a group for screen readers, such as "Filter posts by topic". */
8
+ groupLabel?: string;
9
+ }
10
+ export default function TagFilter({ tags, activeTag, onTagClick, allLabel, groupLabel, }: TagFilterProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './TagFilter';
2
+ export type { TagFilterProps } from './TagFilter';