@rfdtech/components 1.4.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/README.md +457 -153
  2. package/dist/components/app-switcher/AppSwitcher.d.ts +1 -1
  3. package/dist/components/app-switcher/AppSwitcher.d.ts.map +1 -1
  4. package/dist/components/app-switcher/index.d.ts +1 -5
  5. package/dist/components/app-switcher/index.d.ts.map +1 -1
  6. package/dist/components/badge/Badge.d.ts +4 -0
  7. package/dist/components/badge/Badge.d.ts.map +1 -0
  8. package/dist/components/badge/Badge.test.d.ts +2 -0
  9. package/dist/components/badge/Badge.test.d.ts.map +1 -0
  10. package/dist/components/badge/index.d.ts +3 -0
  11. package/dist/components/badge/index.d.ts.map +1 -0
  12. package/dist/components/breadcrumb/Breadcrumb.d.ts +10 -0
  13. package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -0
  14. package/dist/components/breadcrumb/Breadcrumb.test.d.ts +2 -0
  15. package/dist/components/breadcrumb/Breadcrumb.test.d.ts.map +1 -0
  16. package/dist/components/breadcrumb/index.d.ts +3 -0
  17. package/dist/components/breadcrumb/index.d.ts.map +1 -0
  18. package/dist/components/bulk-import-modal/BulkImportModal.d.ts.map +1 -1
  19. package/dist/components/bulk-import-modal/hooks/useBulkImportFlow.d.ts.map +1 -1
  20. package/dist/components/bulk-import-modal/internal/FieldMappingSelect.d.ts +0 -1
  21. package/dist/components/bulk-import-modal/internal/FieldMappingSelect.d.ts.map +1 -1
  22. package/dist/components/bulk-import-modal/steps/ValidateDataStep.d.ts +2 -1
  23. package/dist/components/bulk-import-modal/steps/ValidateDataStep.d.ts.map +1 -1
  24. package/dist/components/button/Button.d.ts +4 -0
  25. package/dist/components/button/Button.d.ts.map +1 -0
  26. package/dist/components/button/Button.test.d.ts +2 -0
  27. package/dist/components/button/Button.test.d.ts.map +1 -0
  28. package/dist/components/button/Spinner.d.ts +8 -0
  29. package/dist/components/button/Spinner.d.ts.map +1 -0
  30. package/dist/components/button/index.d.ts +3 -0
  31. package/dist/components/button/index.d.ts.map +1 -0
  32. package/dist/components/checkbox/Checkbox.d.ts +4 -0
  33. package/dist/components/checkbox/Checkbox.d.ts.map +1 -0
  34. package/dist/components/checkbox/Checkbox.test.d.ts +2 -0
  35. package/dist/components/checkbox/Checkbox.test.d.ts.map +1 -0
  36. package/dist/components/checkbox/index.d.ts +3 -0
  37. package/dist/components/checkbox/index.d.ts.map +1 -0
  38. package/dist/components/command/Command.d.ts +18 -0
  39. package/dist/components/command/Command.d.ts.map +1 -0
  40. package/dist/components/command/Command.test.d.ts +2 -0
  41. package/dist/components/command/Command.test.d.ts.map +1 -0
  42. package/dist/components/command/CommandDialogContext.d.ts +10 -0
  43. package/dist/components/command/CommandDialogContext.d.ts.map +1 -0
  44. package/dist/components/command/hooks/parseCommandShortcut.d.ts +11 -0
  45. package/dist/components/command/hooks/parseCommandShortcut.d.ts.map +1 -0
  46. package/dist/components/command/hooks/useCommandShortcut.d.ts +8 -0
  47. package/dist/components/command/hooks/useCommandShortcut.d.ts.map +1 -0
  48. package/dist/components/command/index.d.ts +6 -0
  49. package/dist/components/command/index.d.ts.map +1 -0
  50. package/dist/components/dialog/Dialog.d.ts +12 -0
  51. package/dist/components/dialog/Dialog.d.ts.map +1 -0
  52. package/dist/components/dialog/Dialog.test.d.ts +2 -0
  53. package/dist/components/dialog/Dialog.test.d.ts.map +1 -0
  54. package/dist/components/dialog/index.d.ts +3 -0
  55. package/dist/components/dialog/index.d.ts.map +1 -0
  56. package/dist/components/dropdown/Dropdown.d.ts +4 -0
  57. package/dist/components/dropdown/Dropdown.d.ts.map +1 -0
  58. package/dist/components/dropdown/Dropdown.test.d.ts +2 -0
  59. package/dist/components/dropdown/Dropdown.test.d.ts.map +1 -0
  60. package/dist/components/dropdown/index.d.ts +3 -0
  61. package/dist/components/dropdown/index.d.ts.map +1 -0
  62. package/dist/components/modal/Modal.d.ts +15 -0
  63. package/dist/components/modal/Modal.d.ts.map +1 -0
  64. package/dist/components/modal/Modal.test.d.ts +2 -0
  65. package/dist/components/modal/Modal.test.d.ts.map +1 -0
  66. package/dist/components/modal/index.d.ts +3 -0
  67. package/dist/components/modal/index.d.ts.map +1 -0
  68. package/dist/components/popover/Popover.d.ts +10 -0
  69. package/dist/components/popover/Popover.d.ts.map +1 -0
  70. package/dist/components/popover/Popover.test.d.ts +2 -0
  71. package/dist/components/popover/Popover.test.d.ts.map +1 -0
  72. package/dist/components/popover/index.d.ts +3 -0
  73. package/dist/components/popover/index.d.ts.map +1 -0
  74. package/dist/components/progress-bar/ProgressBar.d.ts +4 -0
  75. package/dist/components/progress-bar/ProgressBar.d.ts.map +1 -0
  76. package/dist/components/progress-bar/ProgressBar.test.d.ts +2 -0
  77. package/dist/components/progress-bar/ProgressBar.test.d.ts.map +1 -0
  78. package/dist/components/progress-bar/index.d.ts +3 -0
  79. package/dist/components/progress-bar/index.d.ts.map +1 -0
  80. package/dist/components/radio-group/Radio.d.ts +3 -0
  81. package/dist/components/radio-group/Radio.d.ts.map +1 -0
  82. package/dist/components/radio-group/RadioGroup.d.ts +4 -0
  83. package/dist/components/radio-group/RadioGroup.d.ts.map +1 -0
  84. package/dist/components/radio-group/RadioGroup.test.d.ts +2 -0
  85. package/dist/components/radio-group/RadioGroup.test.d.ts.map +1 -0
  86. package/dist/components/radio-group/RadioGroupContext.d.ts +12 -0
  87. package/dist/components/radio-group/RadioGroupContext.d.ts.map +1 -0
  88. package/dist/components/radio-group/index.d.ts +4 -0
  89. package/dist/components/radio-group/index.d.ts.map +1 -0
  90. package/dist/components/sheet/Sheet.d.ts +15 -0
  91. package/dist/components/sheet/Sheet.d.ts.map +1 -0
  92. package/dist/components/sheet/Sheet.test.d.ts +2 -0
  93. package/dist/components/sheet/Sheet.test.d.ts.map +1 -0
  94. package/dist/components/sheet/index.d.ts +3 -0
  95. package/dist/components/sheet/index.d.ts.map +1 -0
  96. package/dist/components/sidebar/Sidebar.d.ts +17 -0
  97. package/dist/components/sidebar/Sidebar.d.ts.map +1 -0
  98. package/dist/components/sidebar/Sidebar.test.d.ts +2 -0
  99. package/dist/components/sidebar/Sidebar.test.d.ts.map +1 -0
  100. package/dist/components/sidebar/SidebarContext.d.ts +15 -0
  101. package/dist/components/sidebar/SidebarContext.d.ts.map +1 -0
  102. package/dist/components/sidebar/hooks/useSidebarMedia.d.ts +2 -0
  103. package/dist/components/sidebar/hooks/useSidebarMedia.d.ts.map +1 -0
  104. package/dist/components/sidebar/index.d.ts +3 -0
  105. package/dist/components/sidebar/index.d.ts.map +1 -0
  106. package/dist/components/tabs/Tabs.d.ts +7 -0
  107. package/dist/components/tabs/Tabs.d.ts.map +1 -0
  108. package/dist/components/tabs/Tabs.test.d.ts +2 -0
  109. package/dist/components/tabs/Tabs.test.d.ts.map +1 -0
  110. package/dist/components/tabs/TabsContext.d.ts +12 -0
  111. package/dist/components/tabs/TabsContext.d.ts.map +1 -0
  112. package/dist/components/tabs/hooks/useTabsLineIndicator.d.ts +8 -0
  113. package/dist/components/tabs/hooks/useTabsLineIndicator.d.ts.map +1 -0
  114. package/dist/components/tabs/index.d.ts +3 -0
  115. package/dist/components/tabs/index.d.ts.map +1 -0
  116. package/dist/hooks/createBrowserSearchParamAdapter.d.ts +3 -0
  117. package/dist/hooks/createBrowserSearchParamAdapter.d.ts.map +1 -0
  118. package/dist/hooks/createSearchParamAdapter.d.ts +10 -0
  119. package/dist/hooks/createSearchParamAdapter.d.ts.map +1 -0
  120. package/dist/hooks/index.d.ts +9 -0
  121. package/dist/hooks/index.d.ts.map +1 -0
  122. package/dist/hooks/overlaySearchParamData.d.ts +6 -0
  123. package/dist/hooks/overlaySearchParamData.d.ts.map +1 -0
  124. package/dist/hooks/overlaySearchParamData.test.d.ts +2 -0
  125. package/dist/hooks/overlaySearchParamData.test.d.ts.map +1 -0
  126. package/dist/hooks/useDialogSearchParam.d.ts +3 -0
  127. package/dist/hooks/useDialogSearchParam.d.ts.map +1 -0
  128. package/dist/hooks/useModalSearchParam.d.ts +3 -0
  129. package/dist/hooks/useModalSearchParam.d.ts.map +1 -0
  130. package/dist/hooks/useSearchParamOverlay.d.ts +3 -0
  131. package/dist/hooks/useSearchParamOverlay.d.ts.map +1 -0
  132. package/dist/hooks/useSearchParamOverlay.test.d.ts +2 -0
  133. package/dist/hooks/useSearchParamOverlay.test.d.ts.map +1 -0
  134. package/dist/index.cjs +112 -32
  135. package/dist/index.css +1 -1
  136. package/dist/index.d.ts +15 -0
  137. package/dist/index.d.ts.map +1 -1
  138. package/dist/index.js +8469 -6331
  139. package/dist/types/app-switcher.d.ts +7 -46
  140. package/dist/types/app-switcher.d.ts.map +1 -1
  141. package/dist/types/badge.d.ts +14 -0
  142. package/dist/types/badge.d.ts.map +1 -0
  143. package/dist/types/breadcrumb.d.ts +61 -0
  144. package/dist/types/breadcrumb.d.ts.map +1 -0
  145. package/dist/types/bulk-import-modal.d.ts +1 -0
  146. package/dist/types/bulk-import-modal.d.ts.map +1 -1
  147. package/dist/types/button.d.ts +17 -0
  148. package/dist/types/button.d.ts.map +1 -0
  149. package/dist/types/checkbox.d.ts +23 -0
  150. package/dist/types/checkbox.d.ts.map +1 -0
  151. package/dist/types/command.d.ts +88 -0
  152. package/dist/types/command.d.ts.map +1 -0
  153. package/dist/types/dialog.d.ts +28 -0
  154. package/dist/types/dialog.d.ts.map +1 -0
  155. package/dist/types/dropdown.d.ts +24 -0
  156. package/dist/types/dropdown.d.ts.map +1 -0
  157. package/dist/types/modal.d.ts +47 -0
  158. package/dist/types/modal.d.ts.map +1 -0
  159. package/dist/types/popover.d.ts +8 -0
  160. package/dist/types/popover.d.ts.map +1 -0
  161. package/dist/types/progress-bar.d.ts +20 -0
  162. package/dist/types/progress-bar.d.ts.map +1 -0
  163. package/dist/types/radio-group.d.ts +37 -0
  164. package/dist/types/radio-group.d.ts.map +1 -0
  165. package/dist/types/search-param-overlay.d.ts +27 -0
  166. package/dist/types/search-param-overlay.d.ts.map +1 -0
  167. package/dist/types/sheet.d.ts +49 -0
  168. package/dist/types/sheet.d.ts.map +1 -0
  169. package/dist/types/sidebar.d.ts +122 -0
  170. package/dist/types/sidebar.d.ts.map +1 -0
  171. package/dist/types/tabs.d.ts +35 -0
  172. package/dist/types/tabs.d.ts.map +1 -0
  173. package/dist/utils/cn.d.ts +2 -0
  174. package/dist/utils/cn.d.ts.map +1 -0
  175. package/package.json +5 -1
  176. package/dist/components/app-switcher/api/fetchMeApps.d.ts +0 -6
  177. package/dist/components/app-switcher/api/fetchMeApps.d.ts.map +0 -1
  178. package/dist/components/app-switcher/api/fetchMeApps.test.d.ts +0 -2
  179. package/dist/components/app-switcher/api/fetchMeApps.test.d.ts.map +0 -1
  180. package/dist/components/app-switcher/api/mapMeAppToAppItem.d.ts +0 -4
  181. package/dist/components/app-switcher/api/mapMeAppToAppItem.d.ts.map +0 -1
  182. package/dist/components/app-switcher/api/mapMeAppToAppItem.test.d.ts +0 -2
  183. package/dist/components/app-switcher/api/mapMeAppToAppItem.test.d.ts.map +0 -1
  184. package/dist/components/app-switcher/api/meAppsClient.d.ts +0 -3
  185. package/dist/components/app-switcher/api/meAppsClient.d.ts.map +0 -1
  186. package/dist/components/app-switcher/api/meAppsClient.test.d.ts +0 -2
  187. package/dist/components/app-switcher/api/meAppsClient.test.d.ts.map +0 -1
  188. package/dist/components/app-switcher/hooks/useMeApps.d.ts +0 -3
  189. package/dist/components/app-switcher/hooks/useMeApps.d.ts.map +0 -1
  190. package/dist/components/app-switcher/hooks/useMeApps.test.d.ts +0 -2
  191. package/dist/components/app-switcher/hooks/useMeApps.test.d.ts.map +0 -1
  192. package/dist/test/fixtures.d.ts +0 -4
  193. package/dist/test/fixtures.d.ts.map +0 -1
package/README.md CHANGED
@@ -65,194 +65,106 @@ npm install @rfdtech/components
65
65
 
66
66
  Requires React 18+. npm 7+ auto-installs `react` and `react-dom` as peer dependencies. Radix UI and other runtime packages are included as dependencies of `@rfdtech/components`.
67
67
 
68
- ## AppSwitcher
69
-
70
- Google Apps–style 9-dot launcher for switching between GSL systems. Drop it into your header to let users jump between products.
71
68
 
72
- ### Usage
69
+ ## Hooks
73
70
 
74
- **Remote fetch** loads systems from `GET {baseUrl}/v1/me/apps` with a bearer token:
71
+ Shared hooks for URL-driven overlay state and router integration. See the [Hooks](/docs/hooks) docs page for full API reference.
75
72
 
76
73
  ```tsx
77
- import { AppSwitcher } from "@rfdtech/components";
78
-
79
- function Header({ baseUrl, accessToken }: { baseUrl: string; accessToken: string }) {
80
- return (
81
- <AppSwitcher
82
- baseUrl={baseUrl}
83
- accessToken={accessToken}
84
- title="System directory"
85
- onAppSelect={(app) => console.log(app.name, app.metadata)}
86
- />
87
- );
88
- }
89
- ```
90
-
91
- Expected API response:
92
-
93
- ```json
94
- {
95
- "success": true,
96
- "message": "Available systems retrieved.",
97
- "data": {
98
- "apps": [
99
- {
100
- "system_id": "gov-portal",
101
- "system_name": "Governance Portal",
102
- "system_code": "GOV-123456",
103
- "frontend_url": "http://178.105.154.224:3001",
104
- "role": "registrar",
105
- "permissions": ["cases:review"]
106
- }
107
- ]
108
- },
109
- "meta": { "count": 1 }
110
- }
111
- ```
74
+ import {
75
+ Dialog,
76
+ DialogContent,
77
+ useDialogSearchParam,
78
+ useModalSearchParam,
79
+ } from "@rfdtech/components";
112
80
 
113
- **Static apps** pass a list directly instead of fetching:
81
+ const { open, data, onOpenChange, openWith } = useDialogSearchParam<{
82
+ userId: string;
83
+ }>("edit-profile");
114
84
 
115
- ```tsx
116
- const apps = [
117
- {
118
- id: "mail",
119
- name: "Mail",
120
- icon: "https://example.com/mail.png",
121
- href: "https://mail.example.com",
122
- },
123
- ];
85
+ openWith({ userId: "42" });
124
86
 
125
- <AppSwitcher apps={apps} title="System directory" />
87
+ <Dialog open={open} onOpenChange={onOpenChange}>
88
+ <DialogContent>Edit user {data?.userId}</DialogContent>
89
+ </Dialog>
126
90
  ```
127
91
 
128
- ### Props
129
-
130
- | Prop | Type | Default | Description |
131
- |------|------|---------|-------------|
132
- | `apps` | `AppItem[]` | — | Static apps to show in the grid |
133
- | `baseUrl` | `string` | required* | API base URL, e.g. `https://api.example.com` |
134
- | `accessToken` | `string` | required* | Bearer access token |
135
- | `columns` | `number` | `3` | Number of grid columns |
136
- | `open` | `boolean` | — | Controlled open state |
137
- | `onOpenChange` | `(open: boolean) => void` | — | Open state callback |
138
- | `onAppSelect` | `(app: AppItem) => void` | — | Called when an app is selected |
139
- | `triggerLabel` | `string` | `"Open app switcher"` | Accessible label for trigger |
140
- | `trigger` | `ReactNode` | 9-dot icon | Custom trigger element |
141
- | `title` | `string` | — | Panel header title |
142
- | `footer` | `ReactNode` | — | Footer content below the grid |
143
- | `placement` | `"bottom-end" \| "bottom-start" \| "bottom"` | `"bottom-end"` | Panel position |
144
- | `closeOnSelect` | `boolean` | `true` | Close panel after selection |
145
- | `className` | `string` | — | Root CSS class |
146
- | `style` | `CSSProperties` | — | Root inline styles |
92
+ Exports: `useSearchParamOverlay`, `useDialogSearchParam`, `useModalSearchParam`, `createSearchParamAdapter`, `createBrowserSearchParamAdapter`, `readOverlayData`, `writeOverlayData`, `clearOverlayData`, `getDataPrefix`. Types: `SearchParamOverlayState`, `SearchParamOverlayData`, `SearchParamAdapter`, `UseSearchParamOverlayOptions`, `UseSearchParamOverlayReturn`.
147
93
 
148
- \* Required when `apps` is not provided.
149
94
 
150
- ### Types
95
+ ## AppSwitcher
151
96
 
152
- All types are exported from `@rfdtech/components`.
97
+ 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.
153
98
 
154
- ```ts
155
- interface AppItem {
156
- id: string;
157
- name: string;
158
- icon: ReactNode | string;
159
- href?: string;
160
- onClick?: (app: AppItem) => void;
161
- disabled?: boolean;
162
- badge?: string;
163
- metadata?: MeApp;
164
- }
99
+ See the [AppSwitcher](/docs/app-switcher) docs page for props and exported types.
165
100
 
166
- interface MeApp {
167
- system_id: string;
168
- system_name: string;
169
- system_code: string;
170
- frontend_url: string;
171
- role: string;
172
- permissions: string[];
173
- }
101
+ ```tsx
102
+ import { AppSwitcher, type AppItem } from "@rfdtech/components";
174
103
 
175
- interface MeAppsResponse {
176
- success: boolean;
177
- message: string;
178
- data: { apps: MeApp[] };
179
- meta: { count: number };
104
+ function Header({ apps, loading }: { apps: AppItem[]; loading: boolean }) {
105
+ return (
106
+ <AppSwitcher
107
+ apps={apps}
108
+ loading={loading}
109
+ title="System directory"
110
+ onAppSelect={(app) => console.log(app.name)}
111
+ />
112
+ );
180
113
  }
181
114
  ```
182
115
 
183
- Also exported: `AppSwitcherProps`, `UseMeAppsOptions`, `UseMeAppsReturn`, `UseAppSwitcherOptions`, `UseAppSwitcherReturn`.
116
+ Props: `apps`, `loading`, `loadingLabel`, `columns`, `open`, `onOpenChange`, `onAppSelect`, `triggerLabel`, `trigger`, `title`, `footer`, `placement`, `closeOnSelect`, `className`, `style`. Exported types: `AppSwitcherProps`, `AppItem`, `UseAppSwitcherOptions`, `UseAppSwitcherReturn`.
184
117
 
185
- ### Hooks
118
+ Also exported: `AppSwitcherItem`, `GridIcon`, `SystemAppIcon`, `useAppSwitcher`.
186
119
 
187
- **`useMeApps`** — fetch and map systems from `/v1/me/apps`:
188
120
 
189
- ```tsx
190
- import { useMeApps } from "@rfdtech/components";
121
+ ## Badge
122
+
123
+ Compact inline label for status, counts, and metadata with semantic color variants. See the [Badge](/docs/badge) docs page for props and exported types.
191
124
 
192
- const { apps, loading, error, refetch } = useMeApps({
193
- baseUrl: "https://api.example.com",
194
- accessToken: "<token>",
195
- });
125
+ ```tsx
126
+ import { Badge } from "@rfdtech/components";
127
+
128
+ <Badge variant="success">Active</Badge>
129
+ <Badge variant="warning">Pending</Badge>
130
+ <Badge variant="error">Failed</Badge>
131
+ <Badge variant="outline" size="md">
132
+ Draft
133
+ </Badge>
196
134
  ```
197
135
 
198
- **`useAppSwitcher`** headless open/close state for custom UI:
136
+ Props: `variant`, `size`, `classNames`, `className`, and standard `span` attributes. Exported types: `BadgeProps`, `BadgeClassNames`, `BadgeVariant`, `BadgeSize`.
199
137
 
200
- ```tsx
201
- import { useAppSwitcher } from "@rfdtech/components";
202
138
 
203
- const { open, toggle, close, triggerRef, panelRef } = useAppSwitcher();
204
- ```
139
+ ## Breadcrumb
205
140
 
206
- ### Utilities
141
+ Compound breadcrumb primitives for hierarchical page trails. See the [Breadcrumb](/docs/breadcrumb) docs page for props and exported types.
207
142
 
208
143
  ```tsx
209
144
  import {
210
- buildMeAppsUrl,
211
- createMeAppsRequestInit,
212
- fetchMeApps,
213
- mapMeAppToAppItem,
214
- mapMeAppsToAppItems,
215
- MeAppsFetchError,
145
+ Breadcrumb,
146
+ BreadcrumbItem,
147
+ BreadcrumbLink,
148
+ BreadcrumbList,
149
+ BreadcrumbPage,
150
+ BreadcrumbSeparator,
216
151
  } from "@rfdtech/components";
217
152
 
218
- const url = buildMeAppsUrl("https://api.example.com");
219
- const init = createMeAppsRequestInit("<token>");
220
- const response = await fetchMeApps(url, init);
221
- const apps = mapMeAppsToAppItems(response.data.apps);
153
+ <Breadcrumb>
154
+ <BreadcrumbList>
155
+ <BreadcrumbItem>
156
+ <BreadcrumbLink href="/">Home</BreadcrumbLink>
157
+ </BreadcrumbItem>
158
+ <BreadcrumbSeparator />
159
+ <BreadcrumbItem>
160
+ <BreadcrumbPage>Profile</BreadcrumbPage>
161
+ </BreadcrumbItem>
162
+ </BreadcrumbList>
163
+ </Breadcrumb>
222
164
  ```
223
165
 
224
- | Export | Description |
225
- |--------|-------------|
226
- | `buildMeAppsUrl(baseUrl)` | Builds `{baseUrl}/v1/me/apps`, or `/v1/me/apps` when `baseUrl` is empty |
227
- | `createMeAppsRequestInit(accessToken)` | Returns fetch options with `Authorization: Bearer ...` |
228
- | `fetchMeApps(url, init?)` | Fetches and validates the API response; throws `MeAppsFetchError` on failure |
229
- | `mapMeAppToAppItem(app)` | Maps one `MeApp` to an `AppItem` |
230
- | `mapMeAppsToAppItems(apps)` | Maps an array of `MeApp` values to `AppItem[]` |
231
- | `MeAppsFetchError` | Error thrown when the HTTP request fails or `success` is `false` |
166
+ Exported parts: `Breadcrumb`, `BreadcrumbList`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbPage`, `BreadcrumbSeparator`, `BreadcrumbEllipsis`. Exported types: `BreadcrumbProps`, `BreadcrumbLinkProps`, `BreadcrumbPageProps`, and related `*ClassNames` interfaces.
232
167
 
233
- ### Subcomponents
234
-
235
- Also exported for custom layouts:
236
-
237
- - `AppSwitcherItem` — single app grid cell
238
- - `GridIcon` — default 9-dot trigger icon
239
- - `SystemAppIcon` — initials avatar for API-fetched apps
240
-
241
- ### Theming
242
-
243
- Override shared tokens on `.gsl-app-switcher` (see [Shared theming](#shared-theming)). `--gsl-focus` aliases to `--gsl-primary`.
244
-
245
- ```css
246
- .my-switcher {
247
- --gsl-primary: #dc2626;
248
- --gsl-hover: #f1f3f4;
249
- --gsl-columns: 4;
250
- }
251
- ```
252
-
253
- ### CORS
254
-
255
- When fetching from a remote `baseUrl` in the browser, the API must allow the host application's origin. Configure CORS on your backend or proxy `/v1` through your dev server during local development.
256
168
 
257
169
  ## BulkImportModal
258
170
 
@@ -402,6 +314,398 @@ To change the gutter size, override `--gsl-bulk-import-gutter` on `.gsl-bulk-imp
402
314
  }
403
315
  ```
404
316
 
317
+
318
+ ## Button
319
+
320
+ 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.
321
+
322
+ ```tsx
323
+ import { Button } from "@rfdtech/components";
324
+
325
+ <Button variant="primary" onClick={() => save()}>
326
+ Save
327
+ </Button>
328
+
329
+ <Button loading loadingLabel="Saving">
330
+ Save
331
+ </Button>
332
+
333
+ <Button disabled>Unavailable</Button>
334
+
335
+ <Button
336
+ variant="outline"
337
+ classNames={{ root: "min-w-32", label: "font-semibold" }}
338
+ >
339
+ Custom
340
+ </Button>
341
+ ```
342
+
343
+ Props: `variant`, `size`, `loading`, `loadingLabel`, `classNames`, and standard `button` attributes. Exported types: `ButtonProps`, `ButtonClassNames`, `ButtonVariant`, `ButtonSize`.
344
+
345
+
346
+ ## Checkbox
347
+
348
+ Accessible checkbox with optional label and part-level `classNames`. See the [Checkbox](/docs/checkbox) docs page for props and exported types.
349
+
350
+ ```tsx
351
+ import { Checkbox } from "@rfdtech/components";
352
+
353
+ <Checkbox
354
+ label="Accept terms and conditions"
355
+ checked={accepted}
356
+ onCheckedChange={setAccepted}
357
+ />
358
+
359
+ <Checkbox
360
+ aria-label="Select row"
361
+ checked={selected}
362
+ onCheckedChange={setSelected}
363
+ />
364
+ ```
365
+
366
+ Props: `checked`, `defaultChecked`, `onCheckedChange`, `label`, `disabled`, `required`, `name`, `value`, `id`, `aria-label`, `classNames`, `className`. Exported types: `CheckboxProps`, `CheckboxClassNames`.
367
+
368
+
369
+ ## Command
370
+
371
+ 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.
372
+
373
+ ```tsx
374
+ import {
375
+ Command,
376
+ CommandDialog,
377
+ CommandEmpty,
378
+ CommandGroup,
379
+ CommandInput,
380
+ CommandItem,
381
+ CommandList,
382
+ CommandShortcut,
383
+ useCommandShortcut,
384
+ } from "@rfdtech/components";
385
+
386
+ <Command label="Field picker">
387
+ <CommandInput placeholder="Search fields..." />
388
+ <CommandList>
389
+ <CommandEmpty>No results.</CommandEmpty>
390
+ <CommandGroup heading="Fields">
391
+ <CommandItem value="email" onSelect={() => setField("email")}>
392
+ Email
393
+ </CommandItem>
394
+ </CommandGroup>
395
+ </CommandList>
396
+ </Command>
397
+
398
+ <CommandDialog open={open} onOpenChange={setOpen} shortcut label="Command menu">
399
+ <CommandInput placeholder="Type a command..." />
400
+ <CommandList>
401
+ <CommandItem onSelect={() => go("/dashboard")}>Dashboard</CommandItem>
402
+ <CommandItem onSelect={signOut}>
403
+ Sign out
404
+ <CommandShortcut><span>⌘</span><span>Q</span></CommandShortcut>
405
+ </CommandItem>
406
+ </CommandList>
407
+ </CommandDialog>
408
+ ```
409
+
410
+ Exports: `Command`, `CommandDialog`, `CommandInput`, `CommandList`, `CommandEmpty`, `CommandGroup`, `CommandItem`, `CommandSeparator`, `CommandLoading`, `CommandShortcut`, `useCommandShortcut`. Exported types: `CommandProps`, `CommandDialogProps`, `CommandItemProps`, `CommandShortcutProps`, `UseCommandShortcutOptions`, and related `*ClassNames` types.
411
+
412
+
413
+ ## RadioGroup
414
+
415
+ 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.
416
+
417
+ ```tsx
418
+ import { Radio, RadioGroup } from "@rfdtech/components";
419
+
420
+ <RadioGroup variant="card" value={plan} onValueChange={setPlan}>
421
+ <Radio
422
+ value="starter"
423
+ label="Starter"
424
+ description="For individuals getting started."
425
+ />
426
+ <Radio
427
+ value="team"
428
+ label="Team"
429
+ description="Collaborate with up to 10 members."
430
+ />
431
+ </RadioGroup>
432
+ ```
433
+
434
+ 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`.
435
+
436
+
437
+ ## Dropdown
438
+
439
+ Select-style dropdown for choosing one option from a list. See the [Dropdown](/docs/dropdown) docs page for props and exported types.
440
+
441
+ ```tsx
442
+ import { Dropdown } from "@rfdtech/components";
443
+
444
+ <Dropdown
445
+ aria-label="Field"
446
+ value={value}
447
+ onValueChange={setValue}
448
+ options={[
449
+ { value: "email", label: "Email" },
450
+ { value: "name", label: "Full name" },
451
+ ]}
452
+ placeholder="Select..."
453
+ clearable
454
+ />
455
+ ```
456
+
457
+ Props: `value`, `onValueChange`, `options`, `placeholder`, `clearable`, `disabled`, `aria-label`, `classNames`, `className`. Exported types: `DropdownProps`, `DropdownOption`, `DropdownClassNames`.
458
+
459
+
460
+ ## Dialog
461
+
462
+ Compound dialog primitives for modal overlays. See the [Dialog](/docs/dialog) docs page for props and exported types.
463
+
464
+ ```tsx
465
+ import {
466
+ Button,
467
+ Dialog,
468
+ DialogContent,
469
+ DialogDescription,
470
+ DialogOverlay,
471
+ DialogPortal,
472
+ DialogTitle,
473
+ DialogTrigger,
474
+ } from "@rfdtech/components";
475
+
476
+ <Dialog open={open} onOpenChange={setOpen}>
477
+ <DialogTrigger asChild>
478
+ <Button variant="secondary">Edit profile</Button>
479
+ </DialogTrigger>
480
+ <DialogPortal>
481
+ <DialogOverlay />
482
+ <DialogContent showCloseButton>
483
+ <DialogTitle>Edit profile</DialogTitle>
484
+ <DialogDescription>Make changes here.</DialogDescription>
485
+ </DialogContent>
486
+ </DialogPortal>
487
+ </Dialog>
488
+ ```
489
+
490
+ 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.
491
+
492
+
493
+ ## Modal
494
+
495
+ Compound modal primitives for near full-viewport overlays with header, body, and footer slots. See the [Modal](/docs/modal) docs page for props and exported types.
496
+
497
+ ```tsx
498
+ import {
499
+ Button,
500
+ Modal,
501
+ ModalBody,
502
+ ModalContent,
503
+ ModalDescription,
504
+ ModalFooter,
505
+ ModalHeader,
506
+ ModalOverlay,
507
+ ModalPortal,
508
+ ModalTitle,
509
+ ModalTrigger,
510
+ } from "@rfdtech/components";
511
+
512
+ <Modal open={open} onOpenChange={setOpen}>
513
+ <ModalTrigger asChild>
514
+ <Button variant="secondary">Review changes</Button>
515
+ </ModalTrigger>
516
+ <ModalPortal>
517
+ <ModalOverlay />
518
+ <ModalContent showCloseButton>
519
+ <ModalHeader>
520
+ <ModalTitle>Review changes</ModalTitle>
521
+ <ModalDescription>Confirm before publishing.</ModalDescription>
522
+ </ModalHeader>
523
+ <ModalBody>{children}</ModalBody>
524
+ <ModalFooter>
525
+ <Button variant="ghost" onClick={() => setOpen(false)}>Cancel</Button>
526
+ <Button onClick={() => setOpen(false)}>Publish</Button>
527
+ </ModalFooter>
528
+ </ModalContent>
529
+ </ModalPortal>
530
+ </Modal>
531
+ ```
532
+
533
+ Props: `Modal` — `open`, `defaultOpen`, `onOpenChange`. `ModalContent` — `showCloseButton`, `classNames`, `className`. Layout parts (`ModalHeader`, `ModalBody`, `ModalFooter`) support part-level `classNames`. Exported types: `ModalOverlayProps`, `ModalContentProps`, `ModalHeaderProps`, `ModalTitleProps`, `ModalDescriptionProps`, `ModalBodyProps`, `ModalFooterProps`, and related `*ClassNames` interfaces.
534
+
535
+
536
+ ## Popover
537
+
538
+ Compound popover primitives for floating panels. See the [Popover](/docs/popover) docs page for props and exported types.
539
+
540
+ ```tsx
541
+ import {
542
+ Button,
543
+ Popover,
544
+ PopoverClose,
545
+ PopoverContent,
546
+ PopoverTrigger,
547
+ } from "@rfdtech/components";
548
+
549
+ <Popover>
550
+ <PopoverTrigger asChild>
551
+ <Button variant="secondary">Actions</Button>
552
+ </PopoverTrigger>
553
+ <PopoverContent
554
+ side="bottom"
555
+ align="end"
556
+ sideOffset={4}
557
+ className="gsl-popover--menu"
558
+ >
559
+ <div className="gsl-popover__menu" role="menu">
560
+ <PopoverClose asChild>
561
+ <button type="button" className="gsl-popover__menu-item" role="menuitem">
562
+ Edit
563
+ </button>
564
+ </PopoverClose>
565
+ <PopoverClose asChild>
566
+ <button
567
+ type="button"
568
+ className="gsl-popover__menu-item gsl-popover__menu-item--destructive"
569
+ role="menuitem"
570
+ >
571
+ Delete
572
+ </button>
573
+ </PopoverClose>
574
+ </div>
575
+ </PopoverContent>
576
+ </Popover>
577
+ ```
578
+
579
+ Exports: `Popover`, `PopoverTrigger`, `PopoverContent`, `PopoverPortal`, `PopoverAnchor`, `PopoverClose`. Exported types: `PopoverContentProps`, `PopoverContentClassNames`.
580
+
581
+
582
+ ## ProgressBar
583
+
584
+ Accessible progress indicator for task completion and loading states. See the [ProgressBar](/docs/progress-bar) docs page for props and exported types.
585
+
586
+ ```tsx
587
+ import { ProgressBar } from "@rfdtech/components";
588
+
589
+ <ProgressBar value={60} label="Upload progress" showValue />
590
+ <ProgressBar value={100} variant="success" />
591
+ <ProgressBar indeterminate label="Loading" size="md" />
592
+ ```
593
+
594
+ Props: `value`, `max`, `variant`, `size`, `indeterminate`, `label`, `showValue`, `classNames`, `className`, and standard `div` attributes. Exported types: `ProgressBarProps`, `ProgressBarClassNames`, `ProgressBarVariant`, `ProgressBarSize`.
595
+
596
+
597
+ ## Sidebar
598
+
599
+ 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.
600
+
601
+ ```tsx
602
+ import {
603
+ Sidebar,
604
+ SidebarCollapse,
605
+ SidebarContent,
606
+ SidebarGroup,
607
+ SidebarGroupLabel,
608
+ SidebarHeader,
609
+ SidebarItem,
610
+ SidebarLink,
611
+ SidebarNav,
612
+ SidebarOverlay,
613
+ SidebarProvider,
614
+ SidebarTrigger,
615
+ } from "@rfdtech/components";
616
+
617
+ <SidebarProvider>
618
+ <SidebarTrigger>Open menu</SidebarTrigger>
619
+ <SidebarOverlay />
620
+ <Sidebar>
621
+ <SidebarHeader>
622
+ <div className="gsl-sidebar__header-brand">
623
+ <span className="gsl-sidebar__header-title">GSL Admin</span>
624
+ </div>
625
+ <SidebarCollapse />
626
+ </SidebarHeader>
627
+ <SidebarContent>
628
+ <SidebarNav aria-label="Main">
629
+ <SidebarGroup>
630
+ <SidebarGroupLabel>General</SidebarGroupLabel>
631
+ <SidebarItem>
632
+ <SidebarLink href="/dashboard" icon={<DashboardIcon />} active={path === "/dashboard"}>
633
+ Dashboard
634
+ </SidebarLink>
635
+ </SidebarItem>
636
+ </SidebarGroup>
637
+ </SidebarNav>
638
+ </SidebarContent>
639
+ </Sidebar>
640
+ <main>{children}</main>
641
+ </SidebarProvider>
642
+ ```
643
+
644
+ 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.
645
+
646
+
647
+ ## Sheet
648
+
649
+ Compound sheet primitives for edge-sliding panels. See the [Sheet](/docs/sheet) docs page for props and exported types.
650
+
651
+ ```tsx
652
+ import {
653
+ Button,
654
+ Sheet,
655
+ SheetBody,
656
+ SheetContent,
657
+ SheetDescription,
658
+ SheetFooter,
659
+ SheetHeader,
660
+ SheetOverlay,
661
+ SheetPortal,
662
+ SheetTitle,
663
+ SheetTrigger,
664
+ } from "@rfdtech/components";
665
+
666
+ <Sheet open={open} onOpenChange={setOpen}>
667
+ <SheetTrigger asChild>
668
+ <Button variant="secondary">Open filters</Button>
669
+ </SheetTrigger>
670
+ <SheetPortal>
671
+ <SheetOverlay />
672
+ <SheetContent side="right" showCloseButton>
673
+ <SheetHeader>
674
+ <SheetTitle>Filters</SheetTitle>
675
+ <SheetDescription>Refine the results below.</SheetDescription>
676
+ </SheetHeader>
677
+ <SheetBody>{children}</SheetBody>
678
+ <SheetFooter>
679
+ <Button variant="ghost" onClick={() => setOpen(false)}>Reset</Button>
680
+ <Button onClick={() => setOpen(false)}>Apply</Button>
681
+ </SheetFooter>
682
+ </SheetContent>
683
+ </SheetPortal>
684
+ </Sheet>
685
+ ```
686
+
687
+ 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.
688
+
689
+
690
+ ## Tabs
691
+
692
+ Compound tabs primitives for switching between related panels. See the [Tabs](/docs/tabs) docs page for props and exported types.
693
+
694
+ ```tsx
695
+ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@rfdtech/components";
696
+
697
+ <Tabs defaultValue="account" variant="line">
698
+ <TabsList>
699
+ <TabsTrigger value="account">Account</TabsTrigger>
700
+ <TabsTrigger value="security">Security</TabsTrigger>
701
+ </TabsList>
702
+ <TabsContent value="account">Account settings</TabsContent>
703
+ <TabsContent value="security">Security settings</TabsContent>
704
+ </Tabs>
705
+ ```
706
+
707
+ 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`.
708
+
405
709
  ## Development
406
710
 
407
711
  ```bash
@@ -1,4 +1,4 @@
1
1
  import type { AppSwitcherProps } from "../../types/app-switcher";
2
2
  import "./styles/app-switcher.css";
3
- export declare function AppSwitcher({ apps: appsProp, baseUrl, accessToken, open: controlledOpen, onOpenChange, onAppSelect, columns, triggerLabel, trigger, title, footer, className, style, placement, closeOnSelect, }: AppSwitcherProps): import("react").JSX.Element;
3
+ export declare function AppSwitcher({ apps, loading, loadingLabel, open: controlledOpen, onOpenChange, onAppSelect, columns, triggerLabel, trigger, title, footer, className, style, placement, closeOnSelect, }: AppSwitcherProps): import("react").JSX.Element;
4
4
  //# sourceMappingURL=AppSwitcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppSwitcher.d.ts","sourceRoot":"","sources":["../../../src/components/app-switcher/AppSwitcher.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG1E,OAAO,2BAA2B,CAAC;AAcnC,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EAAE,QAAQ,EACd,OAAO,EACP,WAAW,EACX,IAAI,EAAE,cAAc,EACpB,YAAY,EACZ,WAAW,EACX,OAAW,EACX,YAAkC,EAClC,OAAO,EACP,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,SAAwB,EACxB,aAAoB,GACrB,EAAE,gBAAgB,+BAwGlB"}
1
+ {"version":3,"file":"AppSwitcher.d.ts","sourceRoot":"","sources":["../../../src/components/app-switcher/AppSwitcher.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG1E,OAAO,2BAA2B,CAAC;AAcnC,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,OAAe,EACf,YAAmC,EACnC,IAAI,EAAE,cAAc,EACpB,YAAY,EACZ,WAAW,EACX,OAAW,EACX,YAAkC,EAClC,OAAO,EACP,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,SAAwB,EACxB,aAAoB,GACrB,EAAE,gBAAgB,+BAoGlB"}
@@ -2,10 +2,6 @@ export { AppSwitcher } from "./AppSwitcher";
2
2
  export { AppSwitcherItem } from "./AppSwitcherItem";
3
3
  export { GridIcon } from "./GridIcon";
4
4
  export { SystemAppIcon } from "./SystemAppIcon";
5
- export { fetchMeApps, MeAppsFetchError } from "./api/fetchMeApps";
6
- export { buildMeAppsUrl, createMeAppsRequestInit, } from "./api/meAppsClient";
7
- export { mapMeAppToAppItem, mapMeAppsToAppItems, } from "./api/mapMeAppToAppItem";
8
5
  export { useAppSwitcher } from "./hooks/useAppSwitcher";
9
- export { useMeApps } from "./hooks/useMeApps";
10
- export type { AppItem, AppSwitcherProps, MeApp, MeAppsResponse, UseMeAppsOptions, UseMeAppsReturn, UseAppSwitcherOptions, UseAppSwitcherReturn, } from "../../types/app-switcher";
6
+ export type { AppItem, AppSwitcherProps, UseAppSwitcherOptions, UseAppSwitcherReturn, } from "../../types/app-switcher";
11
7
  //# sourceMappingURL=index.d.ts.map