@rfdtech/components 1.21.0 → 2.0.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/README.md +244 -74
- package/dist/adapters/context-adapter.d.ts +18 -0
- package/dist/adapters/context-adapter.d.ts.map +1 -0
- package/dist/adapters/next-adapter.d.ts +23 -0
- package/dist/adapters/next-adapter.d.ts.map +1 -0
- package/dist/adapters/react-router-adapter.d.ts +9 -0
- package/dist/adapters/react-router-adapter.d.ts.map +1 -0
- package/dist/adapters/registry.d.ts +19 -0
- package/dist/adapters/registry.d.ts.map +1 -0
- package/dist/components/app-header/AppHeader.d.ts +3 -2
- package/dist/components/app-header/AppHeader.d.ts.map +1 -1
- package/dist/components/app-header/AppHeaderNotificationItem.d.ts +3 -0
- package/dist/components/app-header/AppHeaderNotificationItem.d.ts.map +1 -0
- package/dist/components/app-header/AppHeaderProfile.d.ts +5 -0
- package/dist/components/app-header/AppHeaderProfile.d.ts.map +1 -1
- package/dist/components/app-header/index.d.ts +4 -2
- package/dist/components/app-header/index.d.ts.map +1 -1
- package/dist/components/app-layout/AppLayout.d.ts +6 -0
- package/dist/components/app-layout/AppLayout.d.ts.map +1 -1
- package/dist/components/app-layout/AppLayoutInner.d.ts +1 -0
- package/dist/components/app-layout/AppLayoutInner.d.ts.map +1 -1
- package/dist/components/app-switcher/AppIconTile.d.ts +10 -0
- package/dist/components/app-switcher/AppIconTile.d.ts.map +1 -0
- package/dist/components/app-switcher/AppSwitcher.d.ts +1 -1
- package/dist/components/app-switcher/AppSwitcher.d.ts.map +1 -1
- package/dist/components/app-switcher/AppSwitcherItem.d.ts.map +1 -1
- package/dist/components/app-switcher/IconPatterns.d.ts +8 -0
- package/dist/components/app-switcher/IconPatterns.d.ts.map +1 -0
- package/dist/components/app-switcher/SystemAppIcon.d.ts.map +1 -1
- package/dist/components/app-switcher/index.d.ts +2 -0
- package/dist/components/app-switcher/index.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.d.ts.map +1 -1
- package/dist/components/bulk-import-modal/BulkImportModal.d.ts.map +1 -1
- package/dist/components/bulk-import-modal/steps/ValidateDataStep.d.ts.map +1 -1
- package/dist/components/button/Button.d.ts +1 -1
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Spinner.d.ts.map +1 -1
- package/dist/components/combobox/Combobox.d.ts +4 -0
- package/dist/components/combobox/Combobox.d.ts.map +1 -0
- package/dist/components/combobox/Combobox.test.d.ts +2 -0
- package/dist/components/combobox/Combobox.test.d.ts.map +1 -0
- package/dist/components/combobox/index.d.ts +3 -0
- package/dist/components/combobox/index.d.ts.map +1 -0
- package/dist/components/country-selector/CountrySelector.d.ts +7 -0
- package/dist/components/country-selector/CountrySelector.d.ts.map +1 -1
- package/dist/components/country-selector/index.d.ts +1 -0
- package/dist/components/country-selector/index.d.ts.map +1 -1
- package/dist/components/date-range-selector/DateRangeSelector.d.ts +2 -2
- package/dist/components/date-range-selector/DateRangeSelector.d.ts.map +1 -1
- package/dist/components/date-range-selector/index.d.ts +1 -1
- package/dist/components/date-range-selector/index.d.ts.map +1 -1
- package/dist/components/date-selector/DateSelector.d.ts.map +1 -1
- package/dist/components/dropdown/Dropdown.d.ts +1 -1
- package/dist/components/dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/export-button/ExportButton.d.ts +3 -0
- package/dist/components/export-button/ExportButton.d.ts.map +1 -0
- package/dist/components/export-button/ExportButton.test.d.ts +2 -0
- package/dist/components/export-button/ExportButton.test.d.ts.map +1 -0
- package/dist/components/export-button/index.d.ts +3 -0
- package/dist/components/export-button/index.d.ts.map +1 -0
- package/dist/components/launchpad/Launchpad.d.ts +4 -0
- package/dist/components/launchpad/Launchpad.d.ts.map +1 -0
- package/dist/components/launchpad/Launchpad.test.d.ts +2 -0
- package/dist/components/launchpad/Launchpad.test.d.ts.map +1 -0
- package/dist/components/launchpad/LaunchpadGridIcon.d.ts +2 -0
- package/dist/components/launchpad/LaunchpadGridIcon.d.ts.map +1 -0
- package/dist/components/launchpad/LaunchpadIconTile.d.ts +10 -0
- package/dist/components/launchpad/LaunchpadIconTile.d.ts.map +1 -0
- package/dist/components/launchpad/LaunchpadItem.d.ts +8 -0
- package/dist/components/launchpad/LaunchpadItem.d.ts.map +1 -0
- package/dist/components/launchpad/LaunchpadOverlays.d.ts +3 -0
- package/dist/components/launchpad/LaunchpadOverlays.d.ts.map +1 -0
- package/dist/components/launchpad/SystemLaunchpadIcon.d.ts +5 -0
- package/dist/components/launchpad/SystemLaunchpadIcon.d.ts.map +1 -0
- package/dist/components/launchpad/hooks/useLaunchpad.d.ts +3 -0
- package/dist/components/launchpad/hooks/useLaunchpad.d.ts.map +1 -0
- package/dist/components/launchpad/index.d.ts +10 -0
- package/dist/components/launchpad/index.d.ts.map +1 -0
- package/dist/components/metric-card/MetricCard.d.ts.map +1 -1
- package/dist/components/metric-card/index.d.ts +1 -1
- package/dist/components/metric-card/index.d.ts.map +1 -1
- package/dist/components/network-operator/NetworkOperator.d.ts +4 -0
- package/dist/components/network-operator/NetworkOperator.d.ts.map +1 -1
- package/dist/components/network-operator/index.d.ts +1 -0
- package/dist/components/network-operator/index.d.ts.map +1 -1
- package/dist/components/notice/Notice.d.ts +4 -0
- package/dist/components/notice/Notice.d.ts.map +1 -0
- package/dist/components/notice/Notice.test.d.ts +2 -0
- package/dist/components/notice/Notice.test.d.ts.map +1 -0
- package/dist/components/notice/index.d.ts +3 -0
- package/dist/components/notice/index.d.ts.map +1 -0
- package/dist/components/phone-number-input/PhoneNumberInput.d.ts.map +1 -1
- package/dist/components/popup/Popup.d.ts +15 -0
- package/dist/components/popup/Popup.d.ts.map +1 -0
- package/dist/components/popup/Popup.test.d.ts +2 -0
- package/dist/components/popup/Popup.test.d.ts.map +1 -0
- package/dist/components/popup/index.d.ts +3 -0
- package/dist/components/popup/index.d.ts.map +1 -0
- package/dist/components/profile-popover/ProfilePopover.d.ts +4 -0
- package/dist/components/profile-popover/ProfilePopover.d.ts.map +1 -0
- package/dist/components/profile-popover/ProfilePopover.test.d.ts +2 -0
- package/dist/components/profile-popover/ProfilePopover.test.d.ts.map +1 -0
- package/dist/components/profile-popover/index.d.ts +3 -0
- package/dist/components/profile-popover/index.d.ts.map +1 -0
- package/dist/components/role-select/RoleSelect.d.ts +4 -0
- package/dist/components/role-select/RoleSelect.d.ts.map +1 -0
- package/dist/components/role-select/RoleSelect.test.d.ts +2 -0
- package/dist/components/role-select/RoleSelect.test.d.ts.map +1 -0
- package/dist/components/role-select/index.d.ts +3 -0
- package/dist/components/role-select/index.d.ts.map +1 -0
- package/dist/components/section-header/SectionHeader.d.ts +7 -0
- package/dist/components/section-header/SectionHeader.d.ts.map +1 -0
- package/dist/components/section-header/SectionHeader.test.d.ts +2 -0
- package/dist/components/section-header/SectionHeader.test.d.ts.map +1 -0
- package/dist/components/section-header/index.d.ts +3 -0
- package/dist/components/section-header/index.d.ts.map +1 -0
- package/dist/components/sidebar/Sidebar.d.ts +3 -3
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/SidebarContext.d.ts +6 -0
- package/dist/components/sidebar/SidebarContext.d.ts.map +1 -1
- package/dist/components/sidebar/index.d.ts +1 -1
- package/dist/components/sidebar/index.d.ts.map +1 -1
- package/dist/components/stepper/Stepper.d.ts +12 -0
- package/dist/components/stepper/Stepper.d.ts.map +1 -0
- package/dist/components/stepper/Stepper.test.d.ts +2 -0
- package/dist/components/stepper/Stepper.test.d.ts.map +1 -0
- package/dist/components/stepper/StepperContext.d.ts +4 -0
- package/dist/components/stepper/StepperContext.d.ts.map +1 -0
- package/dist/components/stepper/index.d.ts +3 -0
- package/dist/components/stepper/index.d.ts.map +1 -0
- package/dist/components/switch/Switch.d.ts +4 -0
- package/dist/components/switch/Switch.d.ts.map +1 -0
- package/dist/components/switch/Switch.test.d.ts +2 -0
- package/dist/components/switch/Switch.test.d.ts.map +1 -0
- package/dist/components/switch/index.d.ts +3 -0
- package/dist/components/switch/index.d.ts.map +1 -0
- package/dist/components/table/Table.d.ts +3 -6
- package/dist/components/table/Table.d.ts.map +1 -1
- package/dist/components/table/TableHeader.d.ts +3 -10
- package/dist/components/table/TableHeader.d.ts.map +1 -1
- package/dist/components/table/TablePagination.d.ts.map +1 -1
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/hooks/useTabsLineIndicator.d.ts.map +1 -1
- package/dist/components/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/components/theme/cletTheme.d.ts +11 -0
- package/dist/components/theme/cletTheme.d.ts.map +1 -0
- package/dist/components/theme/cletTheme.test-d.d.ts +2 -0
- package/dist/components/theme/cletTheme.test-d.d.ts.map +1 -0
- package/dist/components/theme/cletTheme.test.d.ts +2 -0
- package/dist/components/theme/cletTheme.test.d.ts.map +1 -0
- package/dist/components/theme/index.d.ts +3 -1
- package/dist/components/theme/index.d.ts.map +1 -1
- package/dist/components/timeline/Timeline.d.ts +8 -0
- package/dist/components/timeline/Timeline.d.ts.map +1 -0
- package/dist/components/timeline/Timeline.test.d.ts +2 -0
- package/dist/components/timeline/Timeline.test.d.ts.map +1 -0
- package/dist/components/timeline/index.d.ts +3 -0
- package/dist/components/timeline/index.d.ts.map +1 -0
- package/dist/components/upload-field/UploadField.d.ts +5 -0
- package/dist/components/upload-field/UploadField.d.ts.map +1 -1
- package/dist/components/upload-field/index.d.ts +2 -2
- package/dist/components/upload-field/index.d.ts.map +1 -1
- package/dist/contexts/router-adapter-context.d.ts +27 -0
- package/dist/contexts/router-adapter-context.d.ts.map +1 -0
- package/dist/generated/components.theme.d.ts +313 -0
- package/dist/generated/components.theme.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useHasMounted.d.ts +10 -0
- package/dist/hooks/useHasMounted.d.ts.map +1 -0
- package/dist/hooks/useTableFilter.d.ts.map +1 -1
- package/dist/hooks/useTablePagination.d.ts.map +1 -1
- package/dist/hooks/useTableState.d.ts +1 -1
- package/dist/hooks/useTableState.d.ts.map +1 -1
- package/dist/index.cjs +85 -55
- package/dist/index.css +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19423 -31378
- package/dist/mcp/cli.js +75 -0
- package/dist/mcp/docs.js +122 -0
- package/dist/mcp/generated/components.json +3593 -0
- package/dist/mcp/generated/examples.json +1233 -0
- package/dist/mcp/generated/index.meta.json +252 -0
- package/dist/mcp/generated/rules.json +629 -0
- package/dist/mcp/generated/search.json +1618 -0
- package/dist/mcp/generated/tokens.json +1022 -0
- package/dist/mcp/index.js +337 -0
- package/dist/mcp/indexer.js +370 -0
- package/dist/mcp/installers/claude.js +37 -0
- package/dist/mcp/installers/codex.js +24 -0
- package/dist/mcp/installers/cursor.js +33 -0
- package/dist/mcp/installers/doctor.js +36 -0
- package/dist/mcp/installers/opencode.js +36 -0
- package/dist/mcp/installers/setup.js +34 -0
- package/dist/mcp/installers/util.js +41 -0
- package/dist/mcp/paths.js +63 -0
- package/dist/mcp/skill/SKILL.md +36 -0
- package/dist/mcp/skill/image-to-components.md +49 -0
- package/dist/next-index.d.ts +44 -0
- package/dist/next-index.d.ts.map +1 -0
- package/dist/next.cjs +282 -0
- package/dist/next.css +1 -0
- package/dist/next.d.ts +29 -0
- package/dist/next.js +37774 -0
- package/dist/types/app-header.d.ts +70 -10
- package/dist/types/app-header.d.ts.map +1 -1
- package/dist/types/app-switcher.d.ts +10 -1
- package/dist/types/app-switcher.d.ts.map +1 -1
- package/dist/types/avatar.d.ts +9 -0
- package/dist/types/avatar.d.ts.map +1 -1
- package/dist/types/combobox.d.ts +43 -0
- package/dist/types/combobox.d.ts.map +1 -0
- package/dist/types/country-selector.d.ts +4 -0
- package/dist/types/country-selector.d.ts.map +1 -1
- package/dist/types/date-range-selector.d.ts +11 -0
- package/dist/types/date-range-selector.d.ts.map +1 -1
- package/dist/types/dropdown.d.ts +8 -0
- package/dist/types/dropdown.d.ts.map +1 -1
- package/dist/types/export-button.d.ts +24 -0
- package/dist/types/export-button.d.ts.map +1 -0
- package/dist/types/launchpad.d.ts +79 -0
- package/dist/types/launchpad.d.ts.map +1 -0
- package/dist/types/metric-card.d.ts +7 -0
- package/dist/types/metric-card.d.ts.map +1 -1
- package/dist/types/network-operator.d.ts +8 -0
- package/dist/types/network-operator.d.ts.map +1 -1
- package/dist/types/notice.d.ts +24 -0
- package/dist/types/notice.d.ts.map +1 -0
- package/dist/types/popup.d.ts +43 -0
- package/dist/types/popup.d.ts.map +1 -0
- package/dist/types/profile-popover.d.ts +97 -0
- package/dist/types/profile-popover.d.ts.map +1 -0
- package/dist/types/role-select.d.ts +28 -0
- package/dist/types/role-select.d.ts.map +1 -0
- package/dist/types/router-adapter.d.ts +46 -0
- package/dist/types/router-adapter.d.ts.map +1 -0
- package/dist/types/section-header.d.ts +26 -0
- package/dist/types/section-header.d.ts.map +1 -0
- package/dist/types/sidebar.d.ts +16 -0
- package/dist/types/sidebar.d.ts.map +1 -1
- package/dist/types/stepper.d.ts +45 -0
- package/dist/types/stepper.d.ts.map +1 -0
- package/dist/types/switch.d.ts +24 -0
- package/dist/types/switch.d.ts.map +1 -0
- package/dist/types/table.d.ts +90 -1
- package/dist/types/table.d.ts.map +1 -1
- package/dist/types/tabs.d.ts +1 -1
- package/dist/types/tabs.d.ts.map +1 -1
- package/dist/types/theme.d.ts +28 -8
- package/dist/types/theme.d.ts.map +1 -1
- package/dist/types/timeline.d.ts +52 -0
- package/dist/types/timeline.d.ts.map +1 -0
- package/dist/types/upload-field.d.ts +23 -0
- package/dist/types/upload-field.d.ts.map +1 -1
- package/dist/utils/export.d.ts +15 -0
- package/dist/utils/export.d.ts.map +1 -0
- package/dist/utils/stringToColor.d.ts +25 -0
- package/dist/utils/stringToColor.d.ts.map +1 -1
- package/package.json +43 -7
- package/scripts/postinstall.mjs +40 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Clet Components
|
|
2
2
|
|
|
3
|
-
Shared React component library for
|
|
3
|
+
Shared React component library for Clet projects. The `--gsl-*` CSS tokens, `.gsl-*` class names, and the `@rfdtech/components` package name are kept unchanged for backward compatibility; every color token also has an equivalent `--clet-*` alias (see [Customize tokens](#7-customize-tokens)).
|
|
4
4
|
|
|
5
5
|
Requires React 18+ and a bundler that processes CSS (Vite, Webpack, etc.).
|
|
6
6
|
|
|
@@ -26,7 +26,7 @@ Add this once to your app entry (`main.tsx` or `App.tsx`):
|
|
|
26
26
|
import "@rfdtech/components/style.css";
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
Components load CSS automatically from the JS bundle (the JS bundle includes `import './index.css'`), but the explicit import above ensures reliable production styling. After upgrading, clear Vite's dependency cache if styles look stale: `rm -rf node_modules/.vite`.
|
|
29
|
+
Components load CSS automatically from the JS bundle (the JS bundle includes `import './index.css'`), but the explicit import above ensures reliable production styling. After upgrading, clear Vite's dependency cache if styles look stale: `rm -rf node_modules/.vite`. alright
|
|
30
30
|
|
|
31
31
|
### 3. Wrap with ThemeProvider
|
|
32
32
|
|
|
@@ -53,10 +53,10 @@ If your project uses Tailwind v4, all `--gsl-*` design tokens are automatically
|
|
|
53
53
|
The `@theme` block ships inside `style.css`. The consumer's Tailwind build processes it and generates these utility classes:
|
|
54
54
|
|
|
55
55
|
| Utility | Resolves to |
|
|
56
|
-
|
|
56
|
+
| --------- | ------------- |
|
|
57
57
|
| `bg-primary` / `text-primary` | `var(--gsl-primary)` |
|
|
58
58
|
| `bg-primary-foreground` / `text-primary-foreground` | `var(--gsl-on-primary)` |
|
|
59
|
-
| `bg-background` / `text-foreground` | `var(--gsl-
|
|
59
|
+
| `bg-background` / `text-foreground` | `var(--gsl-main-bg)` / `var(--gsl-text)` |
|
|
60
60
|
| `bg-secondary` / `text-secondary-foreground` | `var(--gsl-surface-dark)` / `var(--gsl-text-secondary)` |
|
|
61
61
|
| `bg-muted` / `text-muted-foreground` | `var(--gsl-surface-subtle)` / `var(--gsl-text-secondary)` |
|
|
62
62
|
| `bg-accent` / `text-accent-foreground` | `var(--gsl-hover)` / `var(--gsl-text)` |
|
|
@@ -72,39 +72,129 @@ The `@theme` block ships inside `style.css`. The consumer's Tailwind build proce
|
|
|
72
72
|
|
|
73
73
|
**Non-Tailwind consumers** are unaffected. Browsers silently ignore `@theme` as an unknown at-rule. All `--gsl-*` tokens continue to work as CSS custom properties.
|
|
74
74
|
|
|
75
|
-
###
|
|
75
|
+
### 6. AI-assisted development (automatic)
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
`npm install` also wires up an MCP server + skill doc for any AI coding tool it detects in your project — **Claude Code**, **Cursor**, **Codex**, and **OpenCode** — so agents search real components, pull authoritative prop types, and follow the library's design rules instead of inventing APIs. This runs via this package's own `postinstall` script (`scripts/postinstall.mjs`) — no separate command, no action needed. It's idempotent and safe to re-run. Set `RFDUI_SKIP_SETUP=1` to opt out (e.g. in CI). See [`mcp/README.md`](./mcp/README.md) for the `rfdui` CLI (`setup`, `doctor`, `search`, `update`) if you want to run it manually or check its status.
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
**If your package manager blocked the install script**, run setup manually — `npx rfdui setup` always works regardless of package manager or script-blocking config. Otherwise, to let it run automatically on the next install:
|
|
80
|
+
|
|
81
|
+
- **pnpm** (v8+) blocks lifecycle scripts from dependencies by default and prints `Ignored build scripts: @rfdtech/components` after install. Approve it, then reinstall:
|
|
82
|
+
```bash
|
|
83
|
+
pnpm approve-builds @rfdtech/components # or: pnpm approve-builds (interactive picker)
|
|
84
|
+
pnpm install
|
|
85
|
+
```
|
|
86
|
+
This writes `@rfdtech/components: true` under `allowBuilds` in `pnpm-workspace.yaml` (pnpm 11+; older pnpm uses `onlyBuiltDependencies` instead — same idea, different key).
|
|
87
|
+
- **npm** runs `postinstall` by default — nothing to approve. If it didn't run, your project or user `.npmrc` likely sets `ignore-scripts=true` (common in locked-down CI), or you ran `npm install --ignore-scripts`. Either drop that flag/setting for a local install, or just run `npx rfdui setup` manually — that always works even with scripts globally disabled.
|
|
88
|
+
|
|
89
|
+
### 7. Next.js App Router
|
|
90
|
+
|
|
91
|
+
The library ships a `/next` subpath for Next.js App Router. All components and hooks work with Next.js by wrapping your app in `RouterAdapterProvider`:
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
// app/providers.tsx
|
|
95
|
+
"use client";
|
|
96
|
+
import { RouterAdapterProvider, useNextRouterAdapter } from "@rfdtech/components/next";
|
|
97
|
+
|
|
98
|
+
export function Providers({ children }) {
|
|
99
|
+
const adapter = useNextRouterAdapter();
|
|
100
|
+
return <RouterAdapterProvider value={adapter}>{children}</RouterAdapterProvider>;
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Then use components from `@rfdtech/components/next`:
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
import { useTableState, SidebarLink } from "@rfdtech/components/next";
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
See the [RouterAdapter](/docs/router-adapter) docs page for full setup.
|
|
111
|
+
|
|
112
|
+
### 7. Customize tokens
|
|
113
|
+
|
|
114
|
+
Components read `--gsl-*` CSS variables. Every color token also has a
|
|
115
|
+
`--clet-*` alias with the exact same value — **prefer `--clet-*` in new
|
|
116
|
+
override code**; `--gsl-*` keeps working unchanged for existing overrides
|
|
117
|
+
(each `--gsl-*` color token is now defined as `var(--clet-*)`, so overriding
|
|
118
|
+
either name works — `--clet-*` is just the newer, preferred spelling).
|
|
119
|
+
Non-color tokens (radius, shadow, font, spacing) only have a `--gsl-*` name;
|
|
120
|
+
there is no `--clet-*` equivalent for those. Override any token by
|
|
121
|
+
declaring a new value on the same selectors the library uses.
|
|
122
|
+
|
|
123
|
+
**Step 1 — Import the library CSS** so its defaults are loaded:
|
|
124
|
+
|
|
125
|
+
```ts title="src/main.tsx"
|
|
126
|
+
import "@rfdtech/components/style.css";
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Step 2 — Create a theme override file** and import it AFTER the
|
|
130
|
+
library CSS. CSS source order matters: later rules with the same
|
|
131
|
+
specificity win.
|
|
132
|
+
|
|
133
|
+
```ts title="src/main.tsx"
|
|
134
|
+
import "@rfdtech/components/style.css";
|
|
135
|
+
import "./styles/theme.css"; // imported after
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Step 3 — Override the tokens.** The library writes its defaults on
|
|
139
|
+
these selectors:
|
|
140
|
+
|
|
141
|
+
| Selector | When it matches |
|
|
142
|
+
|----------|-----------------|
|
|
143
|
+
| `:root` | No theme attribute is set (no `ThemeProvider` mounted) |
|
|
144
|
+
| `:root[data-gsl-theme="light"]` | Light mode on `<html>` — `ThemeProvider` writes the attribute here |
|
|
145
|
+
| `:root[data-gsl-theme="dark"]` | Dark mode on `<html>` |
|
|
146
|
+
| `.gsl-theme` | A consumer wrapper `<div class="gsl-theme">` |
|
|
147
|
+
| `.gsl-theme[data-gsl-theme="light"]` | Wrapper + light attribute |
|
|
148
|
+
| `.gsl-theme[data-gsl-theme="dark"]` | Wrapper + dark attribute |
|
|
149
|
+
|
|
150
|
+
A bare `:root { ... }` only matches the first row, so the library's
|
|
151
|
+
default keeps winning on rows 2–6 once `ThemeProvider` mounts. To
|
|
152
|
+
cover all of them, list every selector in one rule and hardcode the
|
|
153
|
+
values (don't chain `var(--something)` — just write the color):
|
|
154
|
+
|
|
155
|
+
```css title="src/styles/theme.css"
|
|
156
|
+
:root,
|
|
157
|
+
:root[data-gsl-theme="light"],
|
|
158
|
+
.gsl-theme[data-gsl-theme="light"],
|
|
159
|
+
:root[data-gsl-theme="dark"],
|
|
160
|
+
.gsl-theme[data-gsl-theme="dark"] {
|
|
161
|
+
--clet-primary: #1d4ed8;
|
|
162
|
+
--clet-primary-light: #eff6ff;
|
|
163
|
+
--clet-focus: #1d4ed8;
|
|
164
|
+
--clet-on-primary: #ffffff;
|
|
83
165
|
}
|
|
84
166
|
```
|
|
85
167
|
|
|
168
|
+
That one block overrides the primary color in light mode, dark mode,
|
|
169
|
+
and the unthemed fallback. The same shape works for any other color
|
|
170
|
+
token — list every selector, hardcode the value, and use its `--clet-*`
|
|
171
|
+
name (or the equivalent `--gsl-*` name — both work identically).
|
|
172
|
+
|
|
86
173
|
## Design tokens
|
|
87
174
|
|
|
88
|
-
Quick reference of commonly used tokens and their light-mode defaults
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
| `--
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
175
|
+
Quick reference of commonly used color tokens and their light-mode defaults.
|
|
176
|
+
Each has both a `--clet-*` (preferred) and `--gsl-*` (legacy, still works)
|
|
177
|
+
name for the same value:
|
|
178
|
+
|
|
179
|
+
| Token (`--clet-*` / `--gsl-*`) | Light default | Use |
|
|
180
|
+
| ------- | --------------- | ----- |
|
|
181
|
+
| `primary` | `#083755` | Buttons, focus rings, accents |
|
|
182
|
+
| `primary-light` | `#e7ebee` | Selected rows, hover fills |
|
|
183
|
+
| `secondary` | `#c8a24b` | Gold accent (e.g. active `SidebarLink`) |
|
|
184
|
+
| `bg` | `#ffffff` | Surfaces |
|
|
185
|
+
| `main-bg` | `#fafafa` | Page/app-layout background |
|
|
186
|
+
| `text` | `#3c4043` | Body text |
|
|
187
|
+
| `text-secondary` | `#5f6368` | Labels, muted UI |
|
|
188
|
+
| `border` | `#dadce0` | Borders |
|
|
189
|
+
| `hover` | `#f1f3f4` | Row/cell hover |
|
|
190
|
+
| `error` / `error-bg` | `#dc2626` / `#fef2f2` | Errors |
|
|
191
|
+
| `success` | `#16a34a` | Success states |
|
|
192
|
+
| `warning` | `#eab308` | Warnings |
|
|
102
193
|
|
|
103
194
|
`BulkImportModal` also accepts legacy aliases (`--gsl-bulk-import-primary`, etc.) that map to the shared tokens.
|
|
104
195
|
|
|
105
196
|
See the [Theme](/docs/theme) docs page for the full token reference (radius, shadows, z-index, fonts) and controlled mode.
|
|
106
197
|
|
|
107
|
-
|
|
108
198
|
## Hooks
|
|
109
199
|
|
|
110
200
|
Shared hooks for URL-driven overlay state and router integration. See the [Hooks](/docs/hooks) docs page for full API reference.
|
|
@@ -130,10 +220,9 @@ openWith({ userId: "42" });
|
|
|
130
220
|
|
|
131
221
|
Exports: `useSearchParamOverlay`, `useDialogSearchParam`, `useModalSearchParam`, `createSearchParamAdapter`, `createBrowserSearchParamAdapter`, `readOverlayData`, `writeOverlayData`, `clearOverlayData`, `getDataPrefix`. Types: `SearchParamOverlayState`, `SearchParamOverlayData`, `SearchParamAdapter`, `UseSearchParamOverlayOptions`, `UseSearchParamOverlayReturn`.
|
|
132
222
|
|
|
133
|
-
|
|
134
223
|
## AppHeader
|
|
135
224
|
|
|
136
|
-
Compound header bar with `AppHeader`, `AppHeaderSearch`, `AppHeaderActions`,
|
|
225
|
+
Compound header bar with `AppHeader`, `AppHeaderSearch`, `AppHeaderActions`, and `AppHeaderNotifications`. Nest search on the left and group switcher, notifications, and profile inside `AppHeaderActions` on the right. The profile trigger is [`ProfilePopover`](/docs/profile-popover) itself (pass `user`/`variant` for the compact header-style trigger) — there's no separate `AppHeaderProfile` component.
|
|
137
226
|
|
|
138
227
|
See the [AppHeader](/docs/app-header) docs page for props and exported types.
|
|
139
228
|
|
|
@@ -143,7 +232,8 @@ import {
|
|
|
143
232
|
AppHeaderActions,
|
|
144
233
|
AppHeaderSearch,
|
|
145
234
|
AppHeaderNotifications,
|
|
146
|
-
|
|
235
|
+
AppHeaderNotificationItem,
|
|
236
|
+
ProfilePopover,
|
|
147
237
|
AppSwitcher,
|
|
148
238
|
} from "@rfdtech/components";
|
|
149
239
|
|
|
@@ -153,21 +243,20 @@ import {
|
|
|
153
243
|
<AppSwitcher apps={apps} />
|
|
154
244
|
<AppHeaderNotifications loading={loading}>
|
|
155
245
|
{notifications.map((n) => (
|
|
156
|
-
<
|
|
157
|
-
<div className="gsl-notif-popover__body-text">{n.text}</div>
|
|
158
|
-
<div className="gsl-notif-popover__body-time">{n.time}</div>
|
|
159
|
-
</div>
|
|
246
|
+
<AppHeaderNotificationItem key={n.id} text={n.text} time={n.time} unread={n.unread} />
|
|
160
247
|
))}
|
|
161
248
|
</AppHeaderNotifications>
|
|
162
|
-
<
|
|
163
|
-
|
|
164
|
-
|
|
249
|
+
<ProfilePopover
|
|
250
|
+
user={{ name: "Kwame", role: "Admin", initials: "KA" }}
|
|
251
|
+
variant="avatar"
|
|
252
|
+
items={[{ label: "Settings", onClick: () => navigate("/settings") }]}
|
|
253
|
+
onSignOut={signOut}
|
|
254
|
+
/>
|
|
165
255
|
</AppHeaderActions>
|
|
166
256
|
</AppHeader>
|
|
167
257
|
```
|
|
168
258
|
|
|
169
|
-
Props: `AppHeader` — `className`, `children`. `AppHeaderActions` — `className`, `children`. Exported types: `AppHeaderProps`, `AppHeaderActionsProps`, `AppHeaderSearchProps`, `AppHeaderSearchDataGroup`, `AppHeaderSearchItem`, `AppHeaderNotificationsProps`, `
|
|
170
|
-
|
|
259
|
+
Props: `AppHeader` — `className`, `children`. `AppHeaderActions` — `className`, `children`. Exported types: `AppHeaderProps`, `AppHeaderActionsProps`, `AppHeaderSearchProps`, `AppHeaderSearchDataGroup`, `AppHeaderSearchItem`, `AppHeaderNotificationsProps`, `AppHeaderNotificationItemProps`. See [ProfilePopover](/docs/profile-popover) for `ProfilePopoverProps` and `AppUser`.
|
|
171
260
|
|
|
172
261
|
## AppLayout
|
|
173
262
|
|
|
@@ -189,7 +278,6 @@ import { AppLayout, AppSidebar, AppBody } from "@rfdtech/components";
|
|
|
189
278
|
|
|
190
279
|
Props: `AppLayout` — `children`, `className`. `AppSidebar` — `children`, `className`. `AppBody` — `children`, `className`. Exported types: `AppLayoutProps`, `AppSidebarProps`, `AppBodyProps`.
|
|
191
280
|
|
|
192
|
-
|
|
193
281
|
## AppSwitcher
|
|
194
282
|
|
|
195
283
|
Google Apps–style 9-dot launcher for switching between GSL systems. Drop it into your header to let users jump between products. Pass `apps` directly from your own data layer; use `loading` while data is being fetched.
|
|
@@ -215,7 +303,6 @@ Props: `apps`, `loading`, `loadingLabel`, `columns`, `open`, `onOpenChange`, `on
|
|
|
215
303
|
|
|
216
304
|
Also exported: `AppSwitcherItem`, `GridIcon`, `SystemAppIcon`, `useAppSwitcher`.
|
|
217
305
|
|
|
218
|
-
|
|
219
306
|
## Badge
|
|
220
307
|
|
|
221
308
|
Compact inline label for status, counts, and metadata with semantic color variants. See the [Badge](/docs/badge) docs page for props and exported types.
|
|
@@ -233,7 +320,6 @@ import { Badge } from "@rfdtech/components";
|
|
|
233
320
|
|
|
234
321
|
Props: `variant`, `size`, `classNames`, `className`, and standard `span` attributes. Exported types: `BadgeProps`, `BadgeClassNames`, `BadgeVariant`, `BadgeSize`.
|
|
235
322
|
|
|
236
|
-
|
|
237
323
|
## Breadcrumb
|
|
238
324
|
|
|
239
325
|
Compound breadcrumb primitives for hierarchical page trails. See the [Breadcrumb](/docs/breadcrumb) docs page for props and exported types.
|
|
@@ -263,7 +349,6 @@ import {
|
|
|
263
349
|
|
|
264
350
|
Exported parts: `Breadcrumb`, `BreadcrumbList`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbPage`, `BreadcrumbSeparator`, `BreadcrumbEllipsis`. Exported types: `BreadcrumbProps`, `BreadcrumbLinkProps`, `BreadcrumbPageProps`, and related `*ClassNames` interfaces.
|
|
265
351
|
|
|
266
|
-
|
|
267
352
|
## BulkImportModal
|
|
268
353
|
|
|
269
354
|
Four-step modal wizard for importing spreadsheet data (.xlsx, .xls, .csv). Parsing and validation run entirely in the browser.
|
|
@@ -307,7 +392,7 @@ The first worksheet is used for multi-sheet workbooks. Discarded rows are exclud
|
|
|
307
392
|
### Props
|
|
308
393
|
|
|
309
394
|
| Prop | Type | Default | Description |
|
|
310
|
-
|
|
395
|
+
| ------ | ------ | --------- | ------------- |
|
|
311
396
|
| `open` | `boolean` | required | Controlled open state |
|
|
312
397
|
| `onOpenChange` | `(open: boolean) => void` | required | Open state callback |
|
|
313
398
|
| `fields` | `BulkImportField[]` | required | Target field schema for column matching |
|
|
@@ -418,7 +503,6 @@ To change the gutter size, override `--gsl-bulk-import-gutter` on `.gsl-bulk-imp
|
|
|
418
503
|
}
|
|
419
504
|
```
|
|
420
505
|
|
|
421
|
-
|
|
422
506
|
## Button
|
|
423
507
|
|
|
424
508
|
Shared button with primary, secondary, outline, and ghost variants, plus loading and disabled states. See the [Button](/docs/button) docs page for props and exported types.
|
|
@@ -446,7 +530,6 @@ import { Button } from "@rfdtech/components";
|
|
|
446
530
|
|
|
447
531
|
Props: `variant`, `size`, `loading`, `loadingLabel`, `classNames`, and standard `button` attributes. Exported types: `ButtonProps`, `ButtonClassNames`, `ButtonVariant`, `ButtonSize`.
|
|
448
532
|
|
|
449
|
-
|
|
450
533
|
## Card
|
|
451
534
|
|
|
452
535
|
Surface card wrapper with optional header and design tokens for padding and background. Uses `--gsl-surface-card` for background and `--gsl-card-padding` for inner spacing. See the [Card](/docs/card) docs page for props and exported types.
|
|
@@ -461,7 +544,6 @@ import { Card } from "@rfdtech/components";
|
|
|
461
544
|
|
|
462
545
|
Props: `header`, `children`, `classNames`, `className`, plus standard `div` attributes. Exported types: `CardProps`, `CardClassNames`.
|
|
463
546
|
|
|
464
|
-
|
|
465
547
|
## Checkbox
|
|
466
548
|
|
|
467
549
|
Accessible checkbox with optional label and part-level `classNames`. See the [Checkbox](/docs/checkbox) docs page for props and exported types.
|
|
@@ -484,10 +566,23 @@ import { Checkbox } from "@rfdtech/components";
|
|
|
484
566
|
|
|
485
567
|
Props: `checked`, `defaultChecked`, `onCheckedChange`, `label`, `disabled`, `required`, `name`, `value`, `id`, `aria-label`, `classNames`, `className`. Exported types: `CheckboxProps`, `CheckboxClassNames`.
|
|
486
568
|
|
|
569
|
+
## Combobox
|
|
487
570
|
|
|
488
|
-
|
|
571
|
+
Searchable option list built on `cmdk`, opened from a trigger button — supports single selection, multi-selection with checkboxes, and a per-option leading icon. Unlike `Dropdown` (Radix `Select`-based), it has search built in. See the [Combobox](/docs/combobox) docs page for props and exported types.
|
|
489
572
|
|
|
490
|
-
|
|
573
|
+
```tsx
|
|
574
|
+
import { Combobox } from "@rfdtech/components";
|
|
575
|
+
|
|
576
|
+
<Combobox aria-label="Field" options={options} value={value} onValueChange={setValue} clearable />
|
|
577
|
+
|
|
578
|
+
<Combobox aria-label="Field" options={options} value={values} onValueChange={setValues} multiple />
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
Props: `options`, `multiple`, `value`, `onValueChange`, `placeholder`, `searchPlaceholder`, `disabled`, `invalid`, `clearable`, `emptyMessage`, `aria-label`, `classNames`, `className`, `name`. Exported types: `ComboboxProps`, `ComboboxOption`, `ComboboxClassNames`.
|
|
582
|
+
|
|
583
|
+
## CountrySelector (Deprecated)
|
|
584
|
+
|
|
585
|
+
**Deprecated** — use [`Combobox`](#combobox) for general country selection, or [`PhoneNumberInput`](#phonenumberinput)'s own built-in country picker for phone numbers. Country selector dropdown with flag emoji, country name, search filtering, and keyboard navigation. Built on `@radix-ui/react-popover`. See the [CountrySelector](/docs/country-selector) docs page for props and exported types.
|
|
491
586
|
|
|
492
587
|
```tsx
|
|
493
588
|
import { CountrySelector } from "@rfdtech/components";
|
|
@@ -499,7 +594,6 @@ import { CountrySelector } from "@rfdtech/components";
|
|
|
499
594
|
|
|
500
595
|
Props: `value`, `defaultValue`, `onChange`, `placeholder`, `invalid`, `disabled`, `classNames`, `className`. Exported types: `CountrySelectorProps`, `CountrySelectorClassNames`.
|
|
501
596
|
|
|
502
|
-
|
|
503
597
|
## DateRangeSelector
|
|
504
598
|
|
|
505
599
|
Date range picker with a single trigger showing the selected range, a calendar popover for two-click range selection, and auto-swap to keep start before end. See the [DateRangeSelector](/docs/date-range-selector) docs page for props and exported types.
|
|
@@ -516,7 +610,6 @@ import { DateRangeSelector } from "@rfdtech/components";
|
|
|
516
610
|
|
|
517
611
|
Props: `value`, `defaultValue`, `onChange`, `placeholder`, `formatOptions`, `invalid`, `disabled`, `min`, `max`, `classNames`, `className`. Exported types: `DateRangeSelectorProps`, `DateRangeSelectorClassNames`, `DateRangeValue`.
|
|
518
612
|
|
|
519
|
-
|
|
520
613
|
## DateSelector
|
|
521
614
|
|
|
522
615
|
Date picker for choosing a single date from a calendar grid. Built on `@radix-ui/react-popover`. See the [DateSelector](/docs/date-selector) docs page for props and exported types.
|
|
@@ -535,7 +628,6 @@ import { DateSelector } from "@rfdtech/components";
|
|
|
535
628
|
|
|
536
629
|
Props: `value`, `defaultValue`, `onChange`, `placeholder`, `formatOptions`, `invalid`, `disabled`, `min`, `max`, `classNames`, `className`. Exported types: `DateSelectorProps`, `DateSelectorClassNames`.
|
|
537
630
|
|
|
538
|
-
|
|
539
631
|
## Command
|
|
540
632
|
|
|
541
633
|
Compound command menu primitives for searchable, keyboard-navigable action lists. Supports inline pickers and modal palettes via `CommandDialog`. See the [Command](/docs/command) docs page for props and exported types.
|
|
@@ -583,7 +675,6 @@ const { open, onOpenChange, openWith } = useDialogSearchParam("command-menu");
|
|
|
583
675
|
|
|
584
676
|
Exports: `Command`, `CommandDialog`, `CommandInput`, `CommandList`, `CommandEmpty`, `CommandGroup`, `CommandItem`, `CommandSeparator`, `CommandLoading`, `CommandShortcut`, `useCommandShortcut`. Exported types: `CommandProps`, `CommandDialogProps`, `CommandItemProps`, `CommandShortcutProps`, `UseCommandShortcutOptions`, and related `*ClassNames` types.
|
|
585
677
|
|
|
586
|
-
|
|
587
678
|
## RadioGroup
|
|
588
679
|
|
|
589
680
|
Single-choice radio group with optional labels and descriptions on each `Radio` item. Use `variant="card"` for bordered choice cards. See the [RadioGroup](/docs/radio-group) docs page for props and exported types.
|
|
@@ -607,7 +698,6 @@ import { Radio, RadioGroup } from "@rfdtech/components";
|
|
|
607
698
|
|
|
608
699
|
Props: `RadioGroup` — `value`, `defaultValue`, `onValueChange`, `name`, `disabled`, `required`, `orientation`, `variant`, `classNames`, `className`, `children`. `Radio` — `value`, `label`, `description`, `disabled`, `id`, `aria-label`, `classNames`, `className`. Exported types: `RadioGroupProps`, `RadioProps`, `RadioGroupClassNames`, `RadioClassNames`, `RadioGroupVariant`.
|
|
609
700
|
|
|
610
|
-
|
|
611
701
|
## Dropdown
|
|
612
702
|
|
|
613
703
|
Select-style dropdown for choosing one option from a list. See the [Dropdown](/docs/dropdown) docs page for props and exported types.
|
|
@@ -630,7 +720,6 @@ import { Dropdown } from "@rfdtech/components";
|
|
|
630
720
|
|
|
631
721
|
Props: `value`, `onValueChange`, `options`, `placeholder`, `clearable`, `disabled`, `aria-label`, `classNames`, `className`. Exported types: `DropdownProps`, `DropdownOption`, `DropdownClassNames`.
|
|
632
722
|
|
|
633
|
-
|
|
634
723
|
## Form
|
|
635
724
|
|
|
636
725
|
Field, Input, and Textarea primitives for accessible form layouts. See the [Form](/docs/form) docs page for props and exported types.
|
|
@@ -656,7 +745,6 @@ import {
|
|
|
656
745
|
|
|
657
746
|
Exports: `Field`, `FieldLabel`, `FieldDescription`, `FieldError`, `FieldControl`, `Input`, `Textarea`. Types: `FieldProps`, `FieldClassNames`, `InputProps`, `TextareaProps`.
|
|
658
747
|
|
|
659
|
-
|
|
660
748
|
## FormField
|
|
661
749
|
|
|
662
750
|
react-hook-form adapters with Zod validation support. See the [FormField](/docs/form-field) docs page for props and exported types.
|
|
@@ -713,7 +801,6 @@ const form = useForm<FormValues>({
|
|
|
713
801
|
|
|
714
802
|
Exports: `Form`, `FormField`, `useFormField`. Types: `FormProps`, `FormFieldProps`, `UseFormFieldReturn`.
|
|
715
803
|
|
|
716
|
-
|
|
717
804
|
## Dialog
|
|
718
805
|
|
|
719
806
|
Compound dialog primitives for modal overlays. See the [Dialog](/docs/dialog) docs page for props and exported types.
|
|
@@ -753,7 +840,6 @@ const { open, data, onOpenChange, openWith } = useDialogSearchParam<{
|
|
|
753
840
|
|
|
754
841
|
Props: `Dialog` — `open`, `defaultOpen`, `onOpenChange`. `DialogContent` — `showCloseButton`, `classNames`, `className`. Styled parts also support part-level `classNames`. Exported types: `DialogOverlayProps`, `DialogContentProps`, `DialogTitleProps`, `DialogDescriptionProps`, and related `*ClassNames` interfaces.
|
|
755
842
|
|
|
756
|
-
|
|
757
843
|
## Draggable
|
|
758
844
|
|
|
759
845
|
Repositionable panel primitive with optional handle and bounded pointer dragging. See the [Draggable](/docs/draggable) docs page for props and exported types.
|
|
@@ -771,7 +857,6 @@ import { Draggable, DraggableHandle } from "@rfdtech/components";
|
|
|
771
857
|
|
|
772
858
|
Exports: `Draggable`, `DraggableHandle`, `useDraggable`, `clampPosition`. Types: `DraggableProps`, `DraggableHandleProps`, `DraggablePosition`, `DraggableBounds`, `DraggableAxis`, `UseDraggableOptions`, `UseDraggableReturn`.
|
|
773
859
|
|
|
774
|
-
|
|
775
860
|
## MetricCard
|
|
776
861
|
|
|
777
862
|
Compact dashboard card for displaying a metric value, label, trend indicator, and optional icon or description. Variants (`default`, `primary`, `success`, `warning`, `error`) only affect the trend color — background and text stay neutral. Use the `color` prop for custom accent colors.
|
|
@@ -792,7 +877,6 @@ import { MetricCard } from "@rfdtech/components";
|
|
|
792
877
|
|
|
793
878
|
Props: `label`, `value`, `icon`, `description`, `trend`, `trendValue`, `variant`, `color`, `classNames`, `className`, plus standard `div` attributes. Exported types: `MetricCardProps`, `MetricCardClassNames`, `MetricCardVariant`, `MetricTrend`.
|
|
794
879
|
|
|
795
|
-
|
|
796
880
|
## Modal
|
|
797
881
|
|
|
798
882
|
Centered modal with four size variants (`sm`, `md`, `lg`, `xl`), popover-style border, and optional close-prevention. Size tokens are independently customizable via `--gsl-modal-max-width-*`. See the [Modal](/docs/modal) docs page for props and exported types.
|
|
@@ -836,7 +920,6 @@ const { open, onOpenChange, openWith } = useModalSearchParam("review-changes");
|
|
|
836
920
|
|
|
837
921
|
Props: `Modal` — `open`, `defaultOpen`, `onOpenChange`. `ModalContent` — `showCloseButton`, `size`, `preventClose`, `preventCloseTitle`, `preventCloseDescription`, `onOpenChange`, `classNames`, `className`. Layout parts (`ModalHeader`, `ModalBody`, `ModalFooter`) support part-level `classNames`. Exported types: `ModalSize`, `ModalOverlayProps`, `ModalContentProps`, `ModalHeaderProps`, `ModalTitleProps`, `ModalDescriptionProps`, `ModalBodyProps`, `ModalFooterProps`, and related `*ClassNames` interfaces.
|
|
838
922
|
|
|
839
|
-
|
|
840
923
|
## NetworkOperator
|
|
841
924
|
|
|
842
925
|
Network operator selector with operator image thumbnails (MTN, Vodafone, AirtelTigo, Glo), search filtering, and keyboard navigation. Built on `@radix-ui/react-popover`. See the [NetworkOperator](/docs/network-operator) docs page for props and exported types.
|
|
@@ -851,6 +934,23 @@ import { NetworkOperator } from "@rfdtech/components";
|
|
|
851
934
|
|
|
852
935
|
Props: `value`, `defaultValue`, `onChange`, `options`, `placeholder`, `invalid`, `disabled`, `classNames`, `className`. Exported types: `NetworkOperatorProps`, `NetworkOperatorOption`, `NetworkOperatorClassNames`.
|
|
853
936
|
|
|
937
|
+
## Notice
|
|
938
|
+
|
|
939
|
+
Boxed, persistent callout for scoped context, policy explanations, or a standing status message — unlike `Toast`, it renders inline and doesn't auto-dismiss. See the [Notice](/docs/notice) docs page for props and exported types.
|
|
940
|
+
|
|
941
|
+
```tsx
|
|
942
|
+
import { Notice } from "@rfdtech/components";
|
|
943
|
+
|
|
944
|
+
<Notice variant="warning" leftBorder dashed title="Your scope for this composer">
|
|
945
|
+
<ul>
|
|
946
|
+
<li>Templates: Admissions Directorate only · Audience: 4 pre-approved groups.</li>
|
|
947
|
+
</ul>
|
|
948
|
+
</Notice>
|
|
949
|
+
|
|
950
|
+
<Notice variant="success">This will send directly.</Notice>
|
|
951
|
+
```
|
|
952
|
+
|
|
953
|
+
Props: `variant`, `color`, `title`, `icon`, `leftBorder`, `dashed`, `classNames`, `className`, `children`. Exported types: `NoticeProps`, `NoticeClassNames`, `NoticeVariant`.
|
|
854
954
|
|
|
855
955
|
## OtpInput
|
|
856
956
|
|
|
@@ -866,7 +966,6 @@ import { OtpInput } from "@rfdtech/components";
|
|
|
866
966
|
|
|
867
967
|
Props: `length`, `value`, `onChange`, `onComplete`, `invalid`, `disabled`, `name`, `classNames`, `className`. Exported types: `OtpInputProps`, `OtpInputClassNames`.
|
|
868
968
|
|
|
869
|
-
|
|
870
969
|
## PhoneNumberInput
|
|
871
970
|
|
|
872
971
|
Phone number input with a country code selector (flag + dial code prefix) that auto-detects the country from the number prefix as the user types. Built on `@radix-ui/react-popover`. See the [PhoneNumberInput](/docs/phone-number-input) docs page for props and exported types.
|
|
@@ -881,7 +980,6 @@ import { PhoneNumberInput } from "@rfdtech/components";
|
|
|
881
980
|
|
|
882
981
|
Props: `value`, `defaultValue`, `onChange`, `invalid`, `disabled`, `classNames`, `className`. Exported types: `PhoneNumberInputProps`, `PhoneNumberInputClassNames`.
|
|
883
982
|
|
|
884
|
-
|
|
885
983
|
## Popover
|
|
886
984
|
|
|
887
985
|
Compound popover primitives for floating panels. See the [Popover](/docs/popover) docs page for props and exported types.
|
|
@@ -927,7 +1025,6 @@ import {
|
|
|
927
1025
|
|
|
928
1026
|
Exports: `Popover`, `PopoverTrigger`, `PopoverContent`, `PopoverPortal`, `PopoverAnchor`, `PopoverClose`. Exported types: `PopoverContentProps`, `PopoverContentClassNames`.
|
|
929
1027
|
|
|
930
|
-
|
|
931
1028
|
## ProgressBar
|
|
932
1029
|
|
|
933
1030
|
Accessible progress indicator for task completion and loading states. See the [ProgressBar](/docs/progress-bar) docs page for props and exported types.
|
|
@@ -942,10 +1039,22 @@ import { ProgressBar } from "@rfdtech/components";
|
|
|
942
1039
|
|
|
943
1040
|
Props: `value`, `max`, `variant`, `size`, `indeterminate`, `label`, `showValue`, `classNames`, `className`, and standard `div` attributes. Exported types: `ProgressBarProps`, `ProgressBarClassNames`, `ProgressBarVariant`, `ProgressBarSize`.
|
|
944
1041
|
|
|
1042
|
+
## RouterAdapter
|
|
1043
|
+
|
|
1044
|
+
Framework-agnostic router abstraction for Next.js and react-router compatibility.
|
|
1045
|
+
|
|
1046
|
+
Seven files that previously imported `react-router-dom` directly (`useTableFilter`, `useTablePagination`, `useTableState`, `TableSearch`, `TableFilter`, `TablePagination`, `SidebarLink`, `AppLayoutInner`) now consume `RouterAdapter` from context. The library ships two entry points:
|
|
1047
|
+
|
|
1048
|
+
- `@rfdtech/components` — default, backward compatible (react-router-dom)
|
|
1049
|
+
- `@rfdtech/components/next` — Next.js App Router support via `<RouterAdapterProvider>`
|
|
1050
|
+
|
|
1051
|
+
See the [RouterAdapter](/docs/router-adapter) docs page for setup instructions.
|
|
1052
|
+
|
|
1053
|
+
Exports: `RouterAdapterProvider`, `setRouterAdapter`, `getRouterAdapter`. Types: `RouterAdapterValue`, `RouterSearchParams`, `RouterLinkComponent`.
|
|
945
1054
|
|
|
946
1055
|
## Sidebar
|
|
947
1056
|
|
|
948
|
-
Compound sidebar primitives for app shells and section navigation. Desktop uses a sticky card-style rail with optional collapse; mobile uses an offcanvas drawer with trigger and overlay. See the [Sidebar](/docs/sidebar) docs page for props and exported types.
|
|
1057
|
+
Compound sidebar primitives for app shells and section navigation. Desktop uses a sticky card-style rail with optional collapse; mobile uses an offcanvas drawer with trigger and overlay. `SidebarGroup` supports a `collapsible` flag that turns the group label into a button toggle with an animated open/close for the group's content. See the [Sidebar](/docs/sidebar) docs page for props and exported types.
|
|
949
1058
|
|
|
950
1059
|
```tsx
|
|
951
1060
|
import {
|
|
@@ -992,7 +1101,6 @@ import {
|
|
|
992
1101
|
|
|
993
1102
|
Exports: `SidebarProvider`, `useSidebar`, `Sidebar`, `SidebarBadge`, `SidebarCollapse`, `SidebarTrigger`, `SidebarOverlay`, `SidebarHeader`, `SidebarContent`, `SidebarFooter`, `SidebarNav`, `SidebarGroup`, `SidebarGroupLabel`, `SidebarItem`, `SidebarLink`. Exported types: `SidebarProviderProps`, `SidebarProps`, `SidebarLinkProps`, `SidebarBadgeProps`, `SidebarCollapseProps`, and related `*ClassNames` types.
|
|
994
1103
|
|
|
995
|
-
|
|
996
1104
|
## Sheet
|
|
997
1105
|
|
|
998
1106
|
Compound sheet primitives for edge-sliding panels. See the [Sheet](/docs/sheet) docs page for props and exported types.
|
|
@@ -1035,7 +1143,6 @@ import {
|
|
|
1035
1143
|
|
|
1036
1144
|
Props: `Sheet` — `open`, `defaultOpen`, `onOpenChange`. `SheetContent` — `side`, `showCloseButton`, `classNames`, `className`. Layout parts support part-level `classNames`. Exported types: `SheetSide`, `SheetOverlayProps`, `SheetContentProps`, `SheetHeaderProps`, `SheetTitleProps`, `SheetDescriptionProps`, `SheetBodyProps`, `SheetFooterProps`, and related `*ClassNames` interfaces.
|
|
1037
1145
|
|
|
1038
|
-
|
|
1039
1146
|
## Sortable
|
|
1040
1147
|
|
|
1041
1148
|
Reorderable list primitive with optional drag handles and keyboard support. See the [Sortable](/docs/sortable) docs page for props and exported types.
|
|
@@ -1065,6 +1172,47 @@ const [items, setItems] = useState(["alpha", "beta", "gamma"]);
|
|
|
1065
1172
|
|
|
1066
1173
|
Exports: `Sortable`, `SortableList`, `SortableItem`, `SortableHandle`, `reorderItems`. Types: `SortableProps`, `SortableListProps`, `SortableItemProps`, `SortableHandleProps`, `SortableId`, `SortableStrategy`, `SortableClassNames`.
|
|
1067
1174
|
|
|
1175
|
+
## Stepper
|
|
1176
|
+
|
|
1177
|
+
Horizontal step indicator for multi-step flows. `Stepper` holds the active step value and derives each `Step`'s `complete` / `active` / `upcoming` state. Each step renders a numbered circle that flips to a check when done, with a connector line that fills between completed steps. Add a `StepLabel` for the step's text. See the [Stepper](/docs/stepper) docs page for props and exported types.
|
|
1178
|
+
|
|
1179
|
+
```tsx
|
|
1180
|
+
import { useState } from "react";
|
|
1181
|
+
import { Step, StepLabel, Stepper } from "@rfdtech/components";
|
|
1182
|
+
|
|
1183
|
+
const [step, setStep] = useState(3);
|
|
1184
|
+
|
|
1185
|
+
<Stepper value={step} clickable onValueChange={setStep}>
|
|
1186
|
+
<Step value={1}>
|
|
1187
|
+
<StepLabel>Upload Document</StepLabel>
|
|
1188
|
+
</Step>
|
|
1189
|
+
<Step value={2}>
|
|
1190
|
+
<StepLabel>Select header row</StepLabel>
|
|
1191
|
+
</Step>
|
|
1192
|
+
<Step value={3}>
|
|
1193
|
+
<StepLabel>Match Columns</StepLabel>
|
|
1194
|
+
</Step>
|
|
1195
|
+
<Step value={4}>
|
|
1196
|
+
<StepLabel>Validate data</StepLabel>
|
|
1197
|
+
</Step>
|
|
1198
|
+
</Stepper>
|
|
1199
|
+
```
|
|
1200
|
+
|
|
1201
|
+
Exports: `Stepper`, `Step`, `StepLabel`. Also available as `Stepper.Step`, `Stepper.StepLabel` for compound-style imports. Props: `Stepper` — `value`, `clickable`, `onValueChange`, `classNames`, `className`, `children`. `Step` — `value`, `disabled`, `classNames`, `className`, `children`. `StepLabel` — `classNames`, `className`, `children`. Exported types: `StepperProps`, `StepProps`, `StepLabelProps`, `StepperClassNames`, `StepClassNames`, `StepLabelClassNames`, `StepperContextValue`, `StepState`, `StepInternalProps`. Retheme via `--gsl-stepper-accent` (defaults to `--gsl-primary`) and related `--gsl-stepper-*` custom properties.
|
|
1202
|
+
|
|
1203
|
+
## Switch
|
|
1204
|
+
|
|
1205
|
+
Binary on/off toggle built on `@radix-ui/react-switch`, with an optional label ("Switch + Text"). See the [Switch](/docs/switch) docs page for props and exported types.
|
|
1206
|
+
|
|
1207
|
+
```tsx
|
|
1208
|
+
import { Switch } from "@rfdtech/components";
|
|
1209
|
+
|
|
1210
|
+
<Switch aria-label="Notifications" checked={enabled} onCheckedChange={setEnabled} />
|
|
1211
|
+
|
|
1212
|
+
<Switch label="Email alerts" checked={enabled} onCheckedChange={setEnabled} />
|
|
1213
|
+
```
|
|
1214
|
+
|
|
1215
|
+
Props: `checked`, `defaultChecked`, `onCheckedChange`, `label`, `labelPosition`, `disabled`, `invalid`, `required`, `name`, `value`, `id`, `aria-label`, `classNames`, `className`. Exported types: `SwitchProps`, `SwitchClassNames`.
|
|
1068
1216
|
|
|
1069
1217
|
## Table
|
|
1070
1218
|
|
|
@@ -1113,7 +1261,6 @@ const [selected, setSelected] = useState<Set<string | number>>(new Set());
|
|
|
1113
1261
|
|
|
1114
1262
|
Props: `paramPrefix`, `classNames`, `className`. Exports: `Table`, `TableHeader`, `TableSearch`, `TableFilter`, `TableContent`, `TableBulkActions`, `TableFooter`, `TablePagination`. Types: `TableProps`, `TableHeaderProps`, `TableContentProps`, `TableFooterProps`, `TableSearchProps`, `TableFilterProps`, `TableBulkActionsProps`, `TableBulkAction`, `TableBulkActionsClassNames`, `TableClassNames`, `PaginationControlsProps`, `TableColumn`.
|
|
1115
1263
|
|
|
1116
|
-
|
|
1117
1264
|
## Tabs
|
|
1118
1265
|
|
|
1119
1266
|
Compound tabs primitives for switching between related panels. See the [Tabs](/docs/tabs) docs page for props and exported types.
|
|
@@ -1131,8 +1278,36 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@rfdtech/components";
|
|
|
1131
1278
|
</Tabs>
|
|
1132
1279
|
```
|
|
1133
1280
|
|
|
1134
|
-
Exports: `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent`. Props: `Tabs` — `value`, `defaultValue`, `onValueChange`, `orientation`, `activationMode`, `variant`, `classNames`, `className`, `children`. `TabsTrigger` — `value`, `disabled`, `classNames`, `className`. Exported types: `TabsProps`, `TabsListProps`, `TabsTriggerProps`, `TabsContentProps`, `TabsVariant`, `TabsClassNames`, `TabsListClassNames`, `TabsTriggerClassNames`, `TabsContentClassNames`.
|
|
1281
|
+
Exports: `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent`. Props: `Tabs` — `value`, `defaultValue`, `onValueChange`, `orientation`, `activationMode`, `variant` (`"default"`, `"line"`, `"pill"`), `classNames`, `className`, `children`. `TabsTrigger` — `value`, `disabled`, `classNames`, `className`. Exported types: `TabsProps`, `TabsListProps`, `TabsTriggerProps`, `TabsContentProps`, `TabsVariant`, `TabsClassNames`, `TabsListClassNames`, `TabsTriggerClassNames`, `TabsContentClassNames`.
|
|
1282
|
+
|
|
1283
|
+
## Timeline
|
|
1284
|
+
|
|
1285
|
+
Composable vertical timeline with `Timeline` and `TimelineItem` primitives. Dot color variants for past, current, warning, and error events with optional `color` override. Sub-components `TimelineTitle`, `TimelineData`, and `TimelineFooter` provide styled content slots. Connector animations with staggered draw-in. See the [Timeline](/docs/timeline) docs page for props and exported types.
|
|
1286
|
+
|
|
1287
|
+
```tsx
|
|
1288
|
+
import {
|
|
1289
|
+
Timeline,
|
|
1290
|
+
TimelineData,
|
|
1291
|
+
TimelineFooter,
|
|
1292
|
+
TimelineItem,
|
|
1293
|
+
TimelineTitle,
|
|
1294
|
+
} from "@rfdtech/components";
|
|
1295
|
+
import { Check, AlertTriangle } from "lucide-react";
|
|
1296
|
+
|
|
1297
|
+
<Timeline>
|
|
1298
|
+
<TimelineItem status="complete" icon={<Check size={10} strokeWidth={3} />}>
|
|
1299
|
+
<TimelineTitle>Case reported</TimelineTitle>
|
|
1300
|
+
<TimelineData>12 Jun 2026</TimelineData>
|
|
1301
|
+
<TimelineFooter>HR Officer intake</TimelineFooter>
|
|
1302
|
+
</TimelineItem>
|
|
1303
|
+
<TimelineItem status="warning" icon={<AlertTriangle size={10} strokeWidth={3} />}>
|
|
1304
|
+
<TimelineTitle>Response overdue</TimelineTitle>
|
|
1305
|
+
<TimelineData>Since 3 Jul 2026</TimelineData>
|
|
1306
|
+
</TimelineItem>
|
|
1307
|
+
</Timeline>
|
|
1308
|
+
```
|
|
1135
1309
|
|
|
1310
|
+
Exports: `Timeline`, `TimelineItem`, `TimelineTitle`, `TimelineData`, `TimelineFooter`. Exported types: `TimelineProps`, `TimelineItemProps`, `TimelineTitleProps`, `TimelineDataProps`, `TimelineFooterProps`, `TimelineClassNames`, `TimelineItemClassNames`, `TimelineTitleClassNames`, `TimelineDataClassNames`, `TimelineFooterClassNames`, `TimelineItemMode`.
|
|
1136
1311
|
|
|
1137
1312
|
## Toast
|
|
1138
1313
|
|
|
@@ -1159,7 +1334,6 @@ toast({
|
|
|
1159
1334
|
|
|
1160
1335
|
Exports: `ToastProvider`, `Toaster`, `useToast`. Types: `ToastOptions`, `ToastVariant`, `ToastProviderProps`, `ToasterProps`, `UseToastReturn`, `ToastClassNames`, `ToastAction`, `ToastReturn`.
|
|
1161
1336
|
|
|
1162
|
-
|
|
1163
1337
|
## Tooltip
|
|
1164
1338
|
|
|
1165
1339
|
Pure-CSS hover tooltip with directional arrow (top, right, bottom, left). Used internally by SidebarLink on the collapsed icon rail. See the [Tooltip](/docs/tooltip) docs page for props and exported types.
|
|
@@ -1176,7 +1350,6 @@ import { Tooltip } from "@rfdtech/components";
|
|
|
1176
1350
|
|
|
1177
1351
|
Props: `content`, `side`, `classNames`, `className`. Exported types: `TooltipProps`, `TooltipClassNames`.
|
|
1178
1352
|
|
|
1179
|
-
|
|
1180
1353
|
## UploadField
|
|
1181
1354
|
|
|
1182
1355
|
File upload with dashed-border dropzone, cloud upload icon, auto-generated file type/size support text, file cards with type icons, and a primary action button. See the [UploadField](/docs/upload-field) docs page for props and exported types.
|
|
@@ -1193,10 +1366,7 @@ import { UploadField } from "@rfdtech/components";
|
|
|
1193
1366
|
<UploadField accept="image/*" maxSize={5 * 1024 * 1024} />
|
|
1194
1367
|
```
|
|
1195
1368
|
|
|
1196
|
-
Props: `accept`, `multiple`, `maxSize`, `value`, `onChange`, `invalid`, `disabled`, `name`, `classNames`, `className`. Exported types: `UploadFieldProps`, `UploadFieldClassNames`.
|
|
1197
|
-
|
|
1198
|
-
Props: `accept`, `multiple`, `maxSize`, `value`, `onChange`, `invalid`, `disabled`, `placeholder`, `classNames`, `className`. Exported types: `UploadFieldProps`, `UploadFieldClassNames`.
|
|
1199
|
-
|
|
1369
|
+
Props: `accept`, `multiple`, `maxSize`, `value`, `onChange`, `invalid`, `disabled`, `name`, `fileStatuses`, `onCancel`, `onRetry`, `classNames`, `className`. Exported types: `UploadFieldProps`, `UploadFieldClassNames`, `UploadFieldFileStatus`, `UploadFieldFileStatusKind`. Also exports `FileFormatIcon` for rendering the same file-type icon standalone.
|
|
1200
1370
|
|
|
1201
1371
|
## Development
|
|
1202
1372
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RouterAdapterValue } from "../types/router-adapter";
|
|
2
|
+
/**
|
|
3
|
+
* Router adapter that reads from `RouterAdapterContext` only.
|
|
4
|
+
* Throws if no provider is present.
|
|
5
|
+
*
|
|
6
|
+
* This adapter has zero dependency on `react-router-dom`.
|
|
7
|
+
* It is used by the `@rfdtech/components/next` entry point.
|
|
8
|
+
*
|
|
9
|
+
* Consumers must wrap their app in `<RouterAdapterProvider>`:
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <RouterAdapterProvider value={adapter}>
|
|
13
|
+
* <App />
|
|
14
|
+
* </RouterAdapterProvider>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function useContextRouterAdapter(): RouterAdapterValue;
|
|
18
|
+
//# sourceMappingURL=context-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/context-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,IAAI,kBAAkB,CAY5D"}
|