@rcarls/rc-webcomponents 0.2.0 → 0.3.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 CHANGED
@@ -1,8 +1,8 @@
1
1
  # `@rcarls/rc-webcomponents`
2
2
 
3
- Aggregate package for the `@rcarls` web component collection. Import this package
4
- when an application wants one dependency that re-exports the component classes
5
- and can define every custom element at once.
3
+ Aggregate package that re-exports and defines the `rc-webcomponents` collection.
4
+
5
+ Docs: [https://richardcarls.github.io/rc-webcomponents/](https://richardcarls.github.io/rc-webcomponents/).
6
6
 
7
7
  ## Installation
8
8
 
@@ -31,6 +31,7 @@ import {
31
31
  RCCombobox,
32
32
  RCDialog,
33
33
  RCListbox,
34
+ RcMarkdownEditor,
34
35
  RCMenu,
35
36
  RCMenuButton,
36
37
  RCMenubar,
@@ -38,24 +39,43 @@ import {
38
39
  RCSplitter,
39
40
  RCTextarea,
40
41
  RCToolbar,
42
+ RCVirtualCanvas,
41
43
  } from '@rcarls/rc-webcomponents';
42
44
  ```
43
45
 
46
+ ## Base Theme Tokens
47
+
48
+ The optional base theme defines shared semantic tokens with CSS System Color
49
+ fallbacks:
50
+
51
+ ```css
52
+ @import '@rcarls/rc-webcomponents/themes/base.css';
53
+ ```
54
+
44
55
  ## Included Packages
45
56
 
46
57
  | Package | Purpose |
47
58
  | --- | --- |
48
- | `rc-app-bar` | Headless app bar with exact-center composition and scroll behaviors. |
49
- | `rc-combobox` | Editable ARIA combobox. |
50
- | `rc-dialog` | Native `<dialog>` enhancement wrapper. |
51
- | `rc-listbox` | Light-DOM ARIA listbox. |
52
- | `rc-menu` | ARIA menu popup. |
53
- | `rc-menu-button` | Trigger button for ARIA menus. |
54
- | `rc-menubar` | ARIA menubar controller. |
55
- | `rc-select` | Select-only ARIA combobox. |
56
- | `rc-splitter` | Resizable splitter panes. |
57
- | `rc-textarea` | Enhanced plain-text editor. |
58
- | `rc-toolbar` | ARIA toolbar with roving tabindex. |
59
+ | `rc-app-bar` | App bar modeled after Material 3 Top app bar. |
60
+ | `rc-accordion` | Accordion coordinator for native `<details>` panels. |
61
+ | `rc-combobox` | Editable combobox with filtering and optional allow-create behavior. |
62
+ | `rc-dialog` | Draggable, resizable wrapper for a native `<dialog>`. |
63
+ | `rc-disclosure` | Disclosure wrapper for native `<details>`/`<summary>`. |
64
+ | `rc-fab` | Sticky floating action button modeled after Material 3 FAB. |
65
+ | `rc-listbox` | Listbox that keeps option DOM in light DOM. |
66
+ | `rc-markdown-editor` | Rich/source Markdown editor backed by `rc-textarea`. |
67
+ | `rc-menu` | Menu popup for command surfaces. |
68
+ | `rc-menu-button` | Trigger button that opens an `rc-menu` popup. |
69
+ | `rc-menubar` | Menubar coordinator for `rc-menu-button` children. |
70
+ | `rc-range-slider` | Two-thumb range slider backed by native range inputs. |
71
+ | `rc-search-bar` | Search field wrapper for native `<input type="search">`. |
72
+ | `rc-select` | Select-only combobox backed by a native `<select>`. |
73
+ | `rc-slider` | Single-thumb slider backed by native `<input type="range">`. |
74
+ | `rc-splitter` | Resizable pane splitter with pointer and keyboard controls. |
75
+ | `rc-textarea` | Textarea wrapper with line decorations and plugin hooks. |
76
+ | `rc-toolbar` | Toolbar that groups controls into one tab stop. |
77
+ | `rc-transfer-list` | Transfer list enhancing native `<select multiple>`. |
78
+ | `rc-virtual-canvas` | Scrollable virtual canvas for large coordinate-space content. |
59
79
 
60
80
  ## Notes
61
81
 
@@ -17,6 +17,7 @@ import "@rcarls/rc-markdown-editor/define";
17
17
  import "@rcarls/rc-textarea/define";
18
18
  import "@rcarls/rc-toolbar/define";
19
19
  import "@rcarls/rc-transfer-list/define";
20
+ import "@rcarls/rc-virtual-canvas/define";
20
21
  export * from "@rcarls/rc-accordion";
21
22
  export * from "@rcarls/rc-app-bar";
22
23
  export * from "@rcarls/rc-combobox";
@@ -36,4 +37,5 @@ export * from "@rcarls/rc-splitter";
36
37
  export * from "@rcarls/rc-textarea";
37
38
  export * from "@rcarls/rc-toolbar";
38
39
  export * from "@rcarls/rc-transfer-list";
40
+ export * from "@rcarls/rc-virtual-canvas";
39
41
  //# sourceMappingURL=rc-webcomponents-define.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rc-webcomponents-define.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"rc-webcomponents-define.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -17,4 +17,5 @@ export * from "@rcarls/rc-splitter";
17
17
  export * from "@rcarls/rc-textarea";
18
18
  export * from "@rcarls/rc-toolbar";
19
19
  export * from "@rcarls/rc-transfer-list";
20
+ export * from "@rcarls/rc-virtual-canvas";
20
21
  //# sourceMappingURL=rc-webcomponents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rc-webcomponents.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"rc-webcomponents.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
@@ -17,3 +17,4 @@ export * from '@rcarls/rc-splitter';
17
17
  export * from '@rcarls/rc-textarea';
18
18
  export * from '@rcarls/rc-toolbar';
19
19
  export * from '@rcarls/rc-transfer-list';
20
+ export * from '@rcarls/rc-virtual-canvas';
package/package.json CHANGED
@@ -3,19 +3,21 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.2.0",
7
- "description": "Aggregate package all @rcarls WAI-ARIA compliant headless web components",
6
+ "version": "0.3.0",
7
+ "description": "Aggregate package that re-exports and defines the rc-webcomponents collection.",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/richardcarls/rc-webcomponents.git",
11
11
  "directory": "packages/rc-webcomponents"
12
12
  },
13
- "homepage": "https://github.com/richardcarls/rc-webcomponents#readme",
13
+ "homepage": "https://richardcarls.github.io/rc-webcomponents/",
14
14
  "license": "MIT",
15
15
  "type": "module",
16
16
  "files": [
17
17
  "dist",
18
- "src/solid.d.ts"
18
+ "src/solid.d.ts",
19
+ "src/react.d.ts",
20
+ "themes"
19
21
  ],
20
22
  "module": "./dist/rc-webcomponents.js",
21
23
  "exports": {
@@ -34,36 +36,40 @@
34
36
  "./solid": {
35
37
  "types": "./src/solid.d.ts"
36
38
  },
37
- "./themes/base.css": "../../themes/base.css"
39
+ "./react": {
40
+ "types": "./src/react.d.ts"
41
+ },
42
+ "./themes/base.css": "./themes/base.css"
38
43
  },
39
44
  "types": "./dist/types/index.d.ts",
40
45
  "sideEffects": [
41
- "./dist/rc-webcomponents-define.js"
46
+ "./dist/rc-webcomponents-define.js",
47
+ "./themes/*.css"
42
48
  ],
43
49
  "scripts": {
44
- "build": "tsc && vite build",
45
- "yalc:publish": "yalc publish --push"
50
+ "build": "tsc && vite build"
46
51
  },
47
52
  "dependencies": {
48
- "@rcarls/rc-accordion": "workspace:^",
49
- "@rcarls/rc-app-bar": "workspace:^",
50
- "@rcarls/rc-combobox": "workspace:^",
51
- "@rcarls/rc-dialog": "workspace:^",
52
- "@rcarls/rc-disclosure": "workspace:^",
53
- "@rcarls/rc-fab": "workspace:^",
54
- "@rcarls/rc-listbox": "workspace:^",
55
- "@rcarls/rc-markdown-editor": "workspace:^",
56
- "@rcarls/rc-menu": "workspace:^",
57
- "@rcarls/rc-menu-button": "workspace:^",
58
- "@rcarls/rc-menubar": "workspace:^",
59
- "@rcarls/rc-range-slider": "workspace:^",
60
- "@rcarls/rc-search-bar": "workspace:^",
61
- "@rcarls/rc-select": "workspace:^",
62
- "@rcarls/rc-slider": "workspace:^",
63
- "@rcarls/rc-splitter": "workspace:^",
64
- "@rcarls/rc-textarea": "workspace:^",
65
- "@rcarls/rc-toolbar": "workspace:^",
66
- "@rcarls/rc-transfer-list": "workspace:^"
53
+ "@rcarls/rc-accordion": "workspace:*",
54
+ "@rcarls/rc-app-bar": "workspace:*",
55
+ "@rcarls/rc-combobox": "workspace:*",
56
+ "@rcarls/rc-dialog": "workspace:*",
57
+ "@rcarls/rc-disclosure": "workspace:*",
58
+ "@rcarls/rc-fab": "workspace:*",
59
+ "@rcarls/rc-listbox": "workspace:*",
60
+ "@rcarls/rc-markdown-editor": "workspace:*",
61
+ "@rcarls/rc-menu": "workspace:*",
62
+ "@rcarls/rc-menu-button": "workspace:*",
63
+ "@rcarls/rc-menubar": "workspace:*",
64
+ "@rcarls/rc-range-slider": "workspace:*",
65
+ "@rcarls/rc-search-bar": "workspace:*",
66
+ "@rcarls/rc-select": "workspace:*",
67
+ "@rcarls/rc-slider": "workspace:*",
68
+ "@rcarls/rc-splitter": "workspace:*",
69
+ "@rcarls/rc-textarea": "workspace:*",
70
+ "@rcarls/rc-toolbar": "workspace:*",
71
+ "@rcarls/rc-transfer-list": "workspace:*",
72
+ "@rcarls/rc-virtual-canvas": "workspace:*"
67
73
  },
68
74
  "peerDependencies": {
69
75
  "lit": "^3.0.0"
package/src/react.d.ts ADDED
@@ -0,0 +1,618 @@
1
+ /**
2
+ * React JSX type augmentation for rc-webcomponents.
3
+ *
4
+ * Add a triple-slash reference once in your React project (e.g. vite-env.d.ts):
5
+ *
6
+ * /// <reference types="@rcarls/rc-webcomponents/react" />
7
+ *
8
+ * Ref types use HTMLElement intersections — not LitElement — so TypeScript
9
+ * resolves correctly without requiring `lit` in your tsconfig paths.
10
+ *
11
+ * Import ref and event detail types directly for use with useRef and
12
+ * addEventListener:
13
+ *
14
+ * import type { RCComboboxRef, RCComboboxCreateDetail } from '@rcarls/rc-webcomponents/react';
15
+ *
16
+ * const ref = useRef<RCComboboxRef>(null);
17
+ * el.addEventListener('rc-combobox-create', (e: CustomEvent<RCComboboxCreateDetail>) => { ... });
18
+ */
19
+
20
+ import type { RCTextareaPlugin } from '@rcarls/rc-textarea';
21
+
22
+ // ── Shared value types ───────────────────────────────────────────────────────
23
+
24
+ export type RCSelectOption = {
25
+ kind?: 'option';
26
+ value: string;
27
+ label: string;
28
+ disabled?: boolean;
29
+ data?: unknown;
30
+ };
31
+
32
+ export type RCListboxActionOption<Action extends string = string> = {
33
+ kind: 'action';
34
+ action: Action;
35
+ value: string;
36
+ label: string;
37
+ disabled?: boolean;
38
+ data?: unknown;
39
+ };
40
+
41
+ export type RCListboxOption = RCSelectOption | RCListboxActionOption;
42
+
43
+ export type RCSelectValue = string | string[];
44
+
45
+ // ── Event detail types ───────────────────────────────────────────────────────
46
+
47
+ export type RCDisclosureToggleDetail = {
48
+ open: boolean;
49
+ };
50
+
51
+ export type RCSelectChangeDetail = {
52
+ value: RCSelectValue;
53
+ selectedValues: string[];
54
+ selectedOptions: RCSelectOption[];
55
+ };
56
+
57
+ export type RCListboxSelectChangeDetail = RCSelectChangeDetail & {
58
+ reason: 'select';
59
+ selected: boolean;
60
+ optionValue: string;
61
+ option: RCSelectOption;
62
+ };
63
+
64
+ export type RCListboxActionChangeDetail<Action extends string = string> = RCSelectChangeDetail & {
65
+ reason: 'action';
66
+ selected: false;
67
+ optionValue: string;
68
+ option: RCListboxActionOption<Action>;
69
+ action: Action;
70
+ };
71
+
72
+ export type RCListboxChangeDetail =
73
+ | RCListboxSelectChangeDetail
74
+ | RCListboxActionChangeDetail;
75
+
76
+ export type RCComboboxCreateDetail = {
77
+ text: string;
78
+ };
79
+
80
+ export type RCDialogToggleDetail = {
81
+ open: boolean;
82
+ returnValue: string;
83
+ };
84
+
85
+ export type RCDialogCloseDetail = {
86
+ returnValue: string;
87
+ };
88
+
89
+ export type RCMenuActivateDetail = {
90
+ item: HTMLElement;
91
+ value: string;
92
+ text: string;
93
+ };
94
+
95
+ export type RCMenuCloseDetail = {
96
+ reason: 'escape';
97
+ };
98
+
99
+ export type RCMenuButtonToggleDetail = {
100
+ open: boolean;
101
+ };
102
+
103
+ export type RCSliderChangeDetail = {
104
+ value: number;
105
+ };
106
+
107
+ export type RCRangeSliderChangeDetail = {
108
+ value: [number, number];
109
+ };
110
+
111
+ export type RCTransferListOption = {
112
+ value: string;
113
+ label: string;
114
+ disabled?: boolean;
115
+ };
116
+
117
+ export type RCTransferListChangeDetail = {
118
+ selected: RCTransferListOption[];
119
+ };
120
+
121
+ export type RCSplitterChangeDetail = {
122
+ value: number;
123
+ valueText: string;
124
+ };
125
+
126
+ export type RCMarkdownEditorFormats = {
127
+ bold?: boolean;
128
+ italic?: boolean;
129
+ underline?: boolean;
130
+ strikethrough?: boolean;
131
+ code?: boolean;
132
+ link?: boolean;
133
+ heading?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | null;
134
+ blockquote?: boolean;
135
+ bulletList?: boolean;
136
+ orderedList?: boolean;
137
+ codeBlock?: boolean;
138
+ codeLanguage?: string | null;
139
+ };
140
+
141
+ export type RCMarkdownEditorChangeDetail = {
142
+ value: string;
143
+ };
144
+
145
+ export type RCMarkdownEditorModeChangeDetail = {
146
+ mode: 'rich' | 'source';
147
+ };
148
+
149
+ export type RCVirtualCanvasViewRect = Readonly<{
150
+ x: number;
151
+ y: number;
152
+ width: number;
153
+ height: number;
154
+ }>;
155
+
156
+ export type RCVirtualCanvasRenderDetail = {
157
+ time: DOMHighResTimeStamp;
158
+ reason: 'animation-frame' | 'viewport-change' | 'manual';
159
+ viewRect: RCVirtualCanvasViewRect;
160
+ contentRect: RCVirtualCanvasViewRect;
161
+ };
162
+
163
+ export type RCVirtualCanvasPointerDetail = {
164
+ type: string;
165
+ clientX: number;
166
+ clientY: number;
167
+ contentX: number;
168
+ contentY: number;
169
+ viewRect: RCVirtualCanvasViewRect;
170
+ button: number;
171
+ buttons: number;
172
+ altKey: boolean;
173
+ ctrlKey: boolean;
174
+ shiftKey: boolean;
175
+ metaKey: boolean;
176
+ sourceEvent: PointerEvent | MouseEvent;
177
+ };
178
+
179
+ export type RCAppBarScrollDetail = {
180
+ scrolled: boolean;
181
+ };
182
+
183
+ export type RCSearchBarInputDetail = {
184
+ value: string;
185
+ };
186
+
187
+ export type RCTextareaChangeDetail = {
188
+ value: string;
189
+ };
190
+
191
+ export type RCTextareaSelectDetail = {
192
+ selectionStart: number;
193
+ selectionEnd: number;
194
+ };
195
+
196
+ // ── Ref types ────────────────────────────────────────────────────────────────
197
+
198
+ /** Public API surface of `<rc-disclosure>`. */
199
+ export type RCDisclosureRef = HTMLElement & {
200
+ open: boolean;
201
+ fragment: boolean;
202
+ };
203
+
204
+ /** Public API surface of `<rc-accordion>`. */
205
+ export type RCAccordionRef = HTMLElement & {
206
+ multiple: boolean;
207
+ };
208
+
209
+ /** Public API surface of `<rc-listbox>`. */
210
+ export type RCListboxRef = HTMLElement & {
211
+ multiple: boolean;
212
+ checkmark: boolean;
213
+ filterStrategy: 'prefix' | 'contains' | ((label: string, query: string) => boolean);
214
+ value: RCSelectValue;
215
+ defaultValue: RCSelectValue | undefined;
216
+ options: RCListboxOption[];
217
+ readonly allOptions: ReadonlyArray<RCListboxOption>;
218
+ readonly filteredOptions: ReadonlyArray<RCListboxOption>;
219
+ readonly selectedValues: string[];
220
+ readonly navigableItems: Element[];
221
+ toggleOption(value: string): void;
222
+ clearSelection(): void;
223
+ filterOptions(text: string): void;
224
+ clearFilter(): void;
225
+ setCreateOption(label: string | null): void;
226
+ setSelectedValues(values: string[]): void;
227
+ appendOption(opt: RCListboxOption): void;
228
+ };
229
+
230
+ /** Public API surface of `<rc-select>`. */
231
+ export type RCSelectRef = HTMLElement & {
232
+ open: boolean;
233
+ multiple: boolean;
234
+ disabled: boolean;
235
+ placeholder: string;
236
+ display: 'auto' | 'chips' | 'compact';
237
+ value: RCSelectValue;
238
+ defaultValue: RCSelectValue | undefined;
239
+ options: RCSelectOption[] | undefined;
240
+ readonly selectedValues: string[];
241
+ openPopup(): void;
242
+ closePopup(returnFocus?: boolean): void;
243
+ };
244
+
245
+ /** Public API surface of `<rc-combobox>`. */
246
+ export type RCComboboxRef = RCSelectRef & {
247
+ allowCreate: boolean;
248
+ filterStrategy: 'prefix' | 'contains' | ((label: string, query: string) => boolean);
249
+ };
250
+
251
+ /** Public API surface of `<rc-dialog>`. */
252
+ export type RCDialogRef = HTMLElement & {
253
+ open: boolean | undefined;
254
+ defaultOpen: boolean;
255
+ movable: boolean;
256
+ moveHandle: string;
257
+ moveBounds: 'viewport' | 'parent';
258
+ moveStep: number;
259
+ resize: 'none' | 'both' | 'horizontal' | 'vertical';
260
+ resizeThreshold: number;
261
+ resizeStep: number;
262
+ closedBy: 'any' | 'closerequest' | 'none' | '';
263
+ lightDismiss: boolean;
264
+ readonly returnValue: string;
265
+ showModal(): void;
266
+ show(): void;
267
+ close(returnValue?: string): void;
268
+ requestClose(returnValue?: string): void;
269
+ };
270
+
271
+ /** Public API surface of `<rc-menu>`. */
272
+ export type RCMenuRef = HTMLElement & {
273
+ label: string;
274
+ };
275
+
276
+ /** Public API surface of `<rc-menu-button>`. */
277
+ export type RCMenuButtonPlacement =
278
+ | 'top'
279
+ | 'top-start'
280
+ | 'top-end'
281
+ | 'bottom'
282
+ | 'bottom-start'
283
+ | 'bottom-end'
284
+ | 'left'
285
+ | 'left-start'
286
+ | 'left-end'
287
+ | 'right'
288
+ | 'right-start'
289
+ | 'right-end';
290
+
291
+ export type RCMenuButtonRef = HTMLElement & {
292
+ open: boolean | undefined;
293
+ defaultOpen: boolean;
294
+ orientation: 'horizontal' | 'vertical' | undefined;
295
+ placement: RCMenuButtonPlacement;
296
+ };
297
+
298
+ /** Public API surface of `<rc-menubar>`. */
299
+ export type RCMenubarRef = HTMLElement & {
300
+ label: string;
301
+ orientation: 'horizontal' | 'vertical';
302
+ };
303
+
304
+ /** Public API surface of `<rc-toolbar>`. */
305
+ export type RCToolbarRef = HTMLElement & {
306
+ label: string;
307
+ orientation: string;
308
+ };
309
+
310
+ /** Public API surface of `<rc-splitter>`. */
311
+ export type RCSplitterRef = HTMLElement & {
312
+ label: string;
313
+ orientation: 'horizontal' | 'vertical';
314
+ mode: 'length' | 'percent';
315
+ step: number;
316
+ value: number;
317
+ defaultValue: number | undefined;
318
+ fixed: boolean;
319
+ };
320
+
321
+ /** Public API surface of `<rc-slider>`. */
322
+ export type RCSliderRef = HTMLElement & {
323
+ min: number;
324
+ max: number;
325
+ step: number;
326
+ value: number;
327
+ defaultValue: number | undefined;
328
+ disabled: boolean;
329
+ readonly: boolean;
330
+ display: 'float' | 'inline-start' | 'inline-end' | null;
331
+ valueText: string;
332
+ orientation: 'horizontal' | 'vertical';
333
+ };
334
+
335
+ /** Public API surface of `<rc-range-slider>`. */
336
+ export type RCRangeSliderRef = HTMLElement & {
337
+ min: number;
338
+ max: number;
339
+ step: number;
340
+ value: [number, number];
341
+ defaultValue: [number, number] | undefined;
342
+ disabled: boolean;
343
+ lowLabel: string;
344
+ highLabel: string;
345
+ lowValueText: string;
346
+ highValueText: string;
347
+ display: 'float' | 'inline-start' | 'inline-end' | null;
348
+ orientation: 'horizontal' | 'vertical';
349
+ };
350
+
351
+ /** Public API surface of `<rc-transfer-list>`. */
352
+ export type RCTransferListRef = HTMLElement & {
353
+ multiple: boolean;
354
+ compact: boolean;
355
+ availableLabel: string;
356
+ selectedLabel: string;
357
+ available: RCTransferListOption[];
358
+ selected: RCTransferListOption[];
359
+ defaultSelected: RCTransferListOption[] | undefined;
360
+ addSelected(): void;
361
+ addAll(): void;
362
+ removeSelected(): void;
363
+ clearSelected(): void;
364
+ moveSelected(delta: number): void;
365
+ };
366
+
367
+ /** Public API surface of `<rc-textarea>`. */
368
+ export type RCTextareaRef = HTMLElement & {
369
+ value: string;
370
+ defaultValue: string | undefined;
371
+ plugin: RCTextareaPlugin | null;
372
+ lineNumbers: boolean;
373
+ listNumbers: boolean;
374
+ gutter: boolean;
375
+ wordWrap: boolean;
376
+ autoGrow: boolean;
377
+ readOnly: boolean;
378
+ label: string | null;
379
+ usePlugin(plugin: RCTextareaPlugin): void;
380
+ removePlugin(): void;
381
+ wrapSelection(prefix: string, suffix: string): void;
382
+ replaceSelection(text: string): void;
383
+ };
384
+
385
+ /** Public API surface of `<rc-markdown-editor>`. */
386
+ export type RCMarkdownEditorRef = HTMLElement & {
387
+ value: string;
388
+ defaultValue: string;
389
+ toolbar: boolean;
390
+ sourceMode: boolean;
391
+ defaultSourceMode: boolean;
392
+ readOnly: boolean;
393
+ };
394
+
395
+ /** Public API surface of `<rc-virtual-canvas>`. */
396
+ export type RCVirtualCanvasRef = HTMLElement & {
397
+ contentWidth: number;
398
+ contentHeight: number;
399
+ autoResizeCanvas: boolean;
400
+ renderMode: 'continuous' | 'viewport-change' | 'manual';
401
+ imageRendering: 'auto' | 'crisp-edges' | 'pixelated';
402
+ readonly canvasScaleX: number;
403
+ readonly canvasScaleY: number;
404
+ getViewRect(): RCVirtualCanvasViewRect;
405
+ scrollToContent(x: number, y: number, options?: ScrollToOptions): void;
406
+ centerOnContent(x: number, y: number, options?: ScrollToOptions): void;
407
+ clientToContent(clientX: number, clientY: number): Readonly<{ x: number; y: number }>;
408
+ contentToClient(x: number, y: number): Readonly<{ x: number; y: number }>;
409
+ requestRender(reason?: 'animation-frame' | 'viewport-change' | 'manual'): void;
410
+ };
411
+
412
+ /** Public API surface of `<rc-app-bar>`. */
413
+ export type RCAppBarRef = HTMLElement & {
414
+ variant: 'compact' | 'expanded';
415
+ scrollBehavior: 'pinned' | 'collapse' | 'hide';
416
+ scrolled: boolean | undefined;
417
+ scrollTarget: Element | Document | Window | string | null;
418
+ scrollThreshold: number;
419
+ };
420
+
421
+ /** Public API surface of `<rc-search-bar>`. */
422
+ export type RCSearchBarRef = HTMLElement & {
423
+ value: string;
424
+ defaultValue: string | undefined;
425
+ debounce: number;
426
+ clearLabel: string;
427
+ placeholder: string | undefined;
428
+ };
429
+
430
+ // ── React JSX declarations ───────────────────────────────────────────────────
431
+
432
+ declare module 'react' {
433
+ namespace JSX {
434
+ interface IntrinsicElements {
435
+ 'rc-disclosure': React.DetailedHTMLProps<React.HTMLAttributes<RCDisclosureRef>, RCDisclosureRef> & {
436
+ open?: boolean;
437
+ fragment?: boolean;
438
+ };
439
+
440
+ 'rc-accordion': React.DetailedHTMLProps<React.HTMLAttributes<RCAccordionRef>, RCAccordionRef> & {
441
+ name?: string;
442
+ multiple?: boolean;
443
+ };
444
+
445
+ 'rc-listbox': React.DetailedHTMLProps<React.HTMLAttributes<RCListboxRef>, RCListboxRef> & {
446
+ multiple?: boolean;
447
+ checkmark?: boolean;
448
+ 'filter-strategy'?: 'prefix' | 'contains';
449
+ value?: RCSelectValue;
450
+ 'default-value'?: RCSelectValue;
451
+ options?: RCListboxOption[];
452
+ };
453
+
454
+ 'rc-select': React.DetailedHTMLProps<React.HTMLAttributes<RCSelectRef>, RCSelectRef> & {
455
+ open?: boolean;
456
+ multiple?: boolean;
457
+ disabled?: boolean;
458
+ placeholder?: string;
459
+ display?: 'auto' | 'chips' | 'compact';
460
+ value?: RCSelectValue;
461
+ 'default-value'?: RCSelectValue;
462
+ options?: RCSelectOption[];
463
+ };
464
+
465
+ 'rc-combobox': React.DetailedHTMLProps<React.HTMLAttributes<RCComboboxRef>, RCComboboxRef> & {
466
+ open?: boolean;
467
+ multiple?: boolean;
468
+ disabled?: boolean;
469
+ placeholder?: string;
470
+ display?: 'auto' | 'chips' | 'compact';
471
+ 'allow-create'?: boolean;
472
+ 'filter-strategy'?: 'prefix' | 'contains';
473
+ value?: RCSelectValue;
474
+ 'default-value'?: RCSelectValue;
475
+ options?: RCSelectOption[];
476
+ };
477
+
478
+ 'rc-dialog': React.DetailedHTMLProps<React.HTMLAttributes<RCDialogRef>, RCDialogRef> & {
479
+ open?: boolean;
480
+ 'default-open'?: boolean;
481
+ movable?: boolean;
482
+ 'move-handle'?: string;
483
+ 'move-bounds'?: 'viewport' | 'parent';
484
+ 'move-step'?: number | string;
485
+ resize?: 'none' | 'both' | 'horizontal' | 'vertical';
486
+ 'resize-threshold'?: number | string;
487
+ 'resize-step'?: number | string;
488
+ 'closed-by'?: 'any' | 'closerequest' | 'none';
489
+ 'light-dismiss'?: boolean;
490
+ };
491
+
492
+ 'rc-menu': React.DetailedHTMLProps<React.HTMLAttributes<RCMenuRef>, RCMenuRef> & {
493
+ label?: string;
494
+ };
495
+
496
+ 'rc-menu-button': React.DetailedHTMLProps<React.HTMLAttributes<RCMenuButtonRef>, RCMenuButtonRef> & {
497
+ open?: boolean;
498
+ 'default-open'?: boolean;
499
+ orientation?: 'horizontal' | 'vertical';
500
+ placement?: RCMenuButtonPlacement;
501
+ };
502
+
503
+ 'rc-menubar': React.DetailedHTMLProps<React.HTMLAttributes<RCMenubarRef>, RCMenubarRef> & {
504
+ label?: string;
505
+ orientation?: 'horizontal' | 'vertical';
506
+ };
507
+
508
+ 'rc-toolbar': React.DetailedHTMLProps<React.HTMLAttributes<RCToolbarRef>, RCToolbarRef> & {
509
+ label?: string;
510
+ orientation?: string;
511
+ };
512
+
513
+ 'rc-slider': React.DetailedHTMLProps<React.HTMLAttributes<RCSliderRef>, RCSliderRef> & {
514
+ min?: number | string;
515
+ max?: number | string;
516
+ step?: number | string;
517
+ value?: number | string;
518
+ 'default-value'?: number | string;
519
+ disabled?: boolean;
520
+ readonly?: boolean;
521
+ display?: 'float' | 'inline-start' | 'inline-end';
522
+ 'value-text'?: string;
523
+ orientation?: 'horizontal' | 'vertical';
524
+ };
525
+
526
+ 'rc-range-slider': React.DetailedHTMLProps<React.HTMLAttributes<RCRangeSliderRef>, RCRangeSliderRef> & {
527
+ min?: number | string;
528
+ max?: number | string;
529
+ step?: number | string;
530
+ value?: [number, number];
531
+ 'default-value'?: [number, number];
532
+ disabled?: boolean;
533
+ 'low-label'?: string;
534
+ 'high-label'?: string;
535
+ 'low-value-text'?: string;
536
+ 'high-value-text'?: string;
537
+ display?: 'float' | 'inline-start' | 'inline-end';
538
+ orientation?: 'horizontal' | 'vertical';
539
+ };
540
+
541
+ 'rc-transfer-list': React.DetailedHTMLProps<React.HTMLAttributes<RCTransferListRef>, RCTransferListRef> & {
542
+ multiple?: boolean;
543
+ compact?: boolean;
544
+ 'available-label'?: string;
545
+ 'selected-label'?: string;
546
+ available?: RCTransferListOption[];
547
+ selected?: RCTransferListOption[];
548
+ 'default-selected'?: RCTransferListOption[];
549
+ };
550
+
551
+ 'rc-splitter': React.DetailedHTMLProps<React.HTMLAttributes<RCSplitterRef>, RCSplitterRef> & {
552
+ label?: string;
553
+ orientation?: 'horizontal' | 'vertical';
554
+ mode?: 'length' | 'percent';
555
+ step?: number | string;
556
+ value?: number | string;
557
+ 'default-value'?: number | string;
558
+ fixed?: boolean;
559
+ };
560
+
561
+ 'rc-editor-toolbar': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
562
+ label?: string;
563
+ };
564
+
565
+ 'rc-markdown-editor': React.DetailedHTMLProps<React.HTMLAttributes<RCMarkdownEditorRef>, RCMarkdownEditorRef> & {
566
+ value?: string;
567
+ 'default-value'?: string;
568
+ toolbar?: boolean;
569
+ 'source-mode'?: boolean;
570
+ 'default-source-mode'?: boolean;
571
+ 'read-only'?: boolean;
572
+ };
573
+
574
+ 'rc-fab': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
575
+ position?: 'bottom-end' | 'bottom-start' | 'top-end' | 'top-start';
576
+ 'scroll-reveal'?: boolean;
577
+ };
578
+
579
+ 'rc-app-bar': React.DetailedHTMLProps<React.HTMLAttributes<RCAppBarRef>, RCAppBarRef> & {
580
+ variant?: 'compact' | 'expanded';
581
+ 'scroll-behavior'?: 'pinned' | 'collapse' | 'hide';
582
+ 'scroll-target'?: string;
583
+ 'scroll-threshold'?: number | string;
584
+ scrollTarget?: Element | Document | Window | string | null;
585
+ };
586
+
587
+ 'rc-search-bar': React.DetailedHTMLProps<React.HTMLAttributes<RCSearchBarRef>, RCSearchBarRef> & {
588
+ debounce?: number | string;
589
+ 'clear-label'?: string;
590
+ placeholder?: string;
591
+ 'default-value'?: string;
592
+ value?: string;
593
+ };
594
+
595
+ 'rc-virtual-canvas': React.DetailedHTMLProps<React.HTMLAttributes<RCVirtualCanvasRef>, RCVirtualCanvasRef> & {
596
+ 'content-width'?: number | string;
597
+ 'content-height'?: number | string;
598
+ 'auto-resize-canvas'?: boolean;
599
+ 'render-mode'?: 'continuous' | 'viewport-change' | 'manual';
600
+ 'image-rendering'?: 'auto' | 'crisp-edges' | 'pixelated';
601
+ };
602
+
603
+ 'rc-textarea': React.DetailedHTMLProps<React.HTMLAttributes<RCTextareaRef>, RCTextareaRef> & {
604
+ value?: string;
605
+ 'default-value'?: string;
606
+ plugin?: RCTextareaPlugin | null;
607
+ 'line-numbers'?: boolean;
608
+ 'list-numbers'?: boolean;
609
+ gutter?: boolean;
610
+ 'word-wrap'?: boolean;
611
+ 'auto-grow'?: boolean;
612
+ 'read-only'?: boolean;
613
+ /** @deprecated Set `aria-label` on the slotted `<textarea>` or use a `<label for>` pair instead. */
614
+ label?: string;
615
+ };
616
+ }
617
+ }
618
+ }
package/src/solid.d.ts CHANGED
@@ -15,8 +15,6 @@
15
15
 
16
16
  import type { RCTextareaPlugin } from '@rcarls/rc-textarea';
17
17
 
18
- // ---- Ref types --------------------------------------------------------------
19
-
20
18
  /** Public API surface of `<rc-disclosure>`. */
21
19
  export type RCDisclosureRef = HTMLElement & {
22
20
  open: boolean;
@@ -28,17 +26,20 @@ export type RCDisclosureToggleDetail = {
28
26
  };
29
27
 
30
28
  /** Public API surface of `<rc-accordion>`. */
31
- export type RCAccordionRef = HTMLElement;
29
+ export type RCAccordionRef = HTMLElement & {
30
+ multiple: boolean;
31
+ };
32
32
 
33
33
  /** Public API surface of `<rc-listbox>`. */
34
34
  export type RCListboxRef = HTMLElement & {
35
35
  multiple: boolean;
36
+ checkmark: boolean;
36
37
  filterStrategy: 'prefix' | 'contains' | ((label: string, query: string) => boolean);
37
38
  value: RCSelectValue;
38
39
  defaultValue: RCSelectValue | undefined;
39
- options: RCSelectOption[];
40
- readonly allOptions: ReadonlyArray<{ value: string; label: string; disabled?: boolean }>;
41
- readonly filteredOptions: ReadonlyArray<{ value: string; label: string; disabled?: boolean }>;
40
+ options: RCListboxOption[];
41
+ readonly allOptions: ReadonlyArray<RCListboxOption>;
42
+ readonly filteredOptions: ReadonlyArray<RCListboxOption>;
42
43
  readonly selectedValues: string[];
43
44
  readonly navigableItems: Element[];
44
45
  toggleOption(value: string): void;
@@ -50,11 +51,24 @@ export type RCListboxRef = HTMLElement & {
50
51
 
51
52
  /** Public API surface of `<rc-select>`. */
52
53
  export type RCSelectOption = {
54
+ kind?: 'option';
55
+ value: string;
56
+ label: string;
57
+ disabled?: boolean;
58
+ data?: unknown;
59
+ };
60
+
61
+ export type RCListboxActionOption<Action extends string = string> = {
62
+ kind: 'action';
63
+ action: Action;
53
64
  value: string;
54
65
  label: string;
55
66
  disabled?: boolean;
67
+ data?: unknown;
56
68
  };
57
69
 
70
+ export type RCListboxOption = RCSelectOption | RCListboxActionOption;
71
+
58
72
  export type RCSelectValue = string | string[];
59
73
 
60
74
  export type RCSelectChangeDetail = {
@@ -63,12 +77,25 @@ export type RCSelectChangeDetail = {
63
77
  selectedOptions: RCSelectOption[];
64
78
  };
65
79
 
66
- export type RCListboxChangeDetail = RCSelectChangeDetail & {
80
+ export type RCListboxSelectChangeDetail = RCSelectChangeDetail & {
81
+ reason: 'select';
67
82
  selected: boolean;
68
83
  optionValue: string;
69
- option: RCSelectOption | null;
84
+ option: RCSelectOption;
85
+ };
86
+
87
+ export type RCListboxActionChangeDetail<Action extends string = string> = RCSelectChangeDetail & {
88
+ reason: 'action';
89
+ selected: false;
90
+ optionValue: string;
91
+ option: RCListboxActionOption<Action>;
92
+ action: Action;
70
93
  };
71
94
 
95
+ export type RCListboxChangeDetail =
96
+ | RCListboxSelectChangeDetail
97
+ | RCListboxActionChangeDetail;
98
+
72
99
  export type RCSelectRef = HTMLElement & {
73
100
  open: boolean;
74
101
  multiple: boolean;
@@ -89,6 +116,10 @@ export type RCComboboxRef = RCSelectRef & {
89
116
  filterStrategy: 'prefix' | 'contains' | ((label: string, query: string) => boolean);
90
117
  };
91
118
 
119
+ export type RCComboboxCreateDetail = {
120
+ text: string;
121
+ };
122
+
92
123
  /** Public API surface of `<rc-dialog>`. */
93
124
  export type RCDialogRef = HTMLElement & {
94
125
  open: boolean | undefined;
@@ -114,6 +145,10 @@ export type RCDialogToggleDetail = {
114
145
  returnValue: string;
115
146
  };
116
147
 
148
+ export type RCDialogCloseDetail = {
149
+ returnValue: string;
150
+ };
151
+
117
152
  /** Public API surface of `<rc-menu>`. */
118
153
  export type RCMenuRef = HTMLElement & {
119
154
  label: string;
@@ -125,15 +160,41 @@ export type RCMenuActivateDetail = {
125
160
  text: string;
126
161
  };
127
162
 
163
+ export type RCMenuCloseDetail = {
164
+ reason: 'escape';
165
+ };
166
+
128
167
  /** Public API surface of `<rc-menu-button>`. */
168
+ export type RCMenuButtonPlacement =
169
+ | 'top'
170
+ | 'top-start'
171
+ | 'top-end'
172
+ | 'bottom'
173
+ | 'bottom-start'
174
+ | 'bottom-end'
175
+ | 'left'
176
+ | 'left-start'
177
+ | 'left-end'
178
+ | 'right'
179
+ | 'right-start'
180
+ | 'right-end';
181
+
129
182
  export type RCMenuButtonRef = HTMLElement & {
130
183
  open: boolean | undefined;
131
184
  defaultOpen: boolean;
132
185
  orientation: 'horizontal' | 'vertical' | undefined;
186
+ placement: RCMenuButtonPlacement;
187
+ };
188
+
189
+ export type RCMenuButtonToggleDetail = {
190
+ open: boolean;
133
191
  };
134
192
 
135
193
  /** Public API surface of `<rc-menubar>`. */
136
- export type RCMenubarRef = HTMLElement;
194
+ export type RCMenubarRef = HTMLElement & {
195
+ label: string;
196
+ orientation: 'horizontal' | 'vertical';
197
+ };
137
198
 
138
199
  /** Public API surface of `<rc-toolbar>`. */
139
200
  export type RCToolbarRef = HTMLElement & {
@@ -169,11 +230,82 @@ export type RCTextareaRef = HTMLElement & {
169
230
  replaceSelection(text: string): void;
170
231
  };
171
232
 
172
- export type RCTextEditorRef = RCTextareaRef & {
233
+ export type RCMarkdownEditorRef = HTMLElement & {
234
+ value: string;
235
+ defaultValue: string;
173
236
  toolbar: boolean;
174
- markdown: boolean;
175
- preview: boolean;
176
- defaultPreview: boolean;
237
+ sourceMode: boolean;
238
+ defaultSourceMode: boolean;
239
+ readOnly: boolean;
240
+ };
241
+
242
+ export type RCMarkdownEditorFormats = {
243
+ bold?: boolean;
244
+ italic?: boolean;
245
+ underline?: boolean;
246
+ strikethrough?: boolean;
247
+ code?: boolean;
248
+ link?: boolean;
249
+ heading?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | null;
250
+ blockquote?: boolean;
251
+ bulletList?: boolean;
252
+ orderedList?: boolean;
253
+ codeBlock?: boolean;
254
+ codeLanguage?: string | null;
255
+ };
256
+
257
+ export type RCMarkdownEditorChangeDetail = {
258
+ value: string;
259
+ };
260
+
261
+ export type RCMarkdownEditorModeChangeDetail = {
262
+ mode: 'rich' | 'source';
263
+ };
264
+
265
+ export type RCVirtualCanvasViewRect = Readonly<{
266
+ x: number;
267
+ y: number;
268
+ width: number;
269
+ height: number;
270
+ }>;
271
+
272
+ export type RCVirtualCanvasRenderDetail = {
273
+ time: DOMHighResTimeStamp;
274
+ reason: 'animation-frame' | 'viewport-change' | 'manual';
275
+ viewRect: RCVirtualCanvasViewRect;
276
+ contentRect: RCVirtualCanvasViewRect;
277
+ };
278
+
279
+ export type RCVirtualCanvasPointerDetail = {
280
+ type: string;
281
+ clientX: number;
282
+ clientY: number;
283
+ contentX: number;
284
+ contentY: number;
285
+ viewRect: RCVirtualCanvasViewRect;
286
+ button: number;
287
+ buttons: number;
288
+ altKey: boolean;
289
+ ctrlKey: boolean;
290
+ shiftKey: boolean;
291
+ metaKey: boolean;
292
+ sourceEvent: PointerEvent | MouseEvent;
293
+ };
294
+
295
+ export type RCVirtualCanvasRef = HTMLElement & {
296
+ contentWidth: number;
297
+ contentHeight: number;
298
+ autoResizeCanvas: boolean;
299
+ renderMode: 'continuous' | 'viewport-change' | 'manual';
300
+ imageRendering: 'auto' | 'crisp-edges' | 'pixelated';
301
+ readonly canvasScaleX: number;
302
+ readonly canvasScaleY: number;
303
+ getViewRect(): RCVirtualCanvasViewRect;
304
+ scrollToContent(x: number, y: number, options?: ScrollToOptions): void;
305
+ centerOnContent(x: number, y: number, options?: ScrollToOptions): void;
306
+ clientToContent(clientX: number, clientY: number): Readonly<{ x: number; y: number }>;
307
+ contentToClient(x: number, y: number): Readonly<{ x: number; y: number }>;
308
+ requestRender(reason?: 'animation-frame' | 'viewport-change' | 'manual'): void;
177
309
  };
178
310
 
179
311
  export type RCSliderRef = HTMLElement & {
@@ -189,6 +321,10 @@ export type RCSliderRef = HTMLElement & {
189
321
  orientation: 'horizontal' | 'vertical';
190
322
  };
191
323
 
324
+ export type RCSliderChangeDetail = {
325
+ value: number;
326
+ };
327
+
192
328
  export type RCRangeSliderRef = HTMLElement & {
193
329
  min: number;
194
330
  max: number;
@@ -204,6 +340,10 @@ export type RCRangeSliderRef = HTMLElement & {
204
340
  orientation: 'horizontal' | 'vertical';
205
341
  };
206
342
 
343
+ export type RCRangeSliderChangeDetail = {
344
+ value: [number, number];
345
+ };
346
+
207
347
  export type RCTransferListOption = {
208
348
  value: string;
209
349
  label: string;
@@ -212,6 +352,7 @@ export type RCTransferListOption = {
212
352
 
213
353
  export type RCTransferListRef = HTMLElement & {
214
354
  multiple: boolean;
355
+ compact: boolean;
215
356
  availableLabel: string;
216
357
  selectedLabel: string;
217
358
  available: RCTransferListOption[];
@@ -224,6 +365,10 @@ export type RCTransferListRef = HTMLElement & {
224
365
  moveSelected(delta: number): void;
225
366
  };
226
367
 
368
+ export type RCTransferListChangeDetail = {
369
+ selected: RCTransferListOption[];
370
+ };
371
+
227
372
  /** Public API surface of `<rc-app-bar>`. */
228
373
  export type RCAppBarRef = HTMLElement & {
229
374
  variant: 'compact' | 'expanded';
@@ -250,7 +395,21 @@ export type RCSearchBarInputDetail = {
250
395
  value: string;
251
396
  };
252
397
 
253
- // ---- JSX augmentation -------------------------------------------------------
398
+ export type RCSplitterChangeDetail = {
399
+ value: number;
400
+ valueText: string;
401
+ };
402
+
403
+ export type RCTextareaChangeDetail = {
404
+ value: string;
405
+ };
406
+
407
+ export type RCTextareaSelectDetail = {
408
+ selectionStart: number;
409
+ selectionEnd: number;
410
+ };
411
+
412
+ /** SolidJS JSX declarations for rc-webcomponents elements. */
254
413
 
255
414
  declare module 'solid-js' {
256
415
  namespace JSX {
@@ -263,18 +422,20 @@ declare module 'solid-js' {
263
422
 
264
423
  'rc-accordion': JSX.HTMLAttributes<RCAccordionRef> & {
265
424
  name?: string;
425
+ multiple?: boolean | string;
266
426
  'on:rc-disclosure-toggle'?: (e: CustomEvent<RCDisclosureToggleDetail>) => void;
267
427
  };
268
428
 
269
429
  'rc-listbox': JSX.HTMLAttributes<RCListboxRef> & {
270
430
  multiple?: boolean | string;
431
+ checkmark?: boolean | string;
271
432
  'filter-strategy'?: 'prefix' | 'contains';
272
433
  value?: RCSelectValue;
273
434
  defaultValue?: RCSelectValue;
274
- options?: RCSelectOption[];
435
+ options?: RCListboxOption[];
275
436
  'prop:value'?: RCSelectValue | undefined;
276
437
  'prop:defaultValue'?: RCSelectValue | undefined;
277
- 'prop:options'?: RCSelectOption[] | undefined;
438
+ 'prop:options'?: RCListboxOption[] | undefined;
278
439
  'on:rc-listbox-change'?: (e: CustomEvent<RCListboxChangeDetail>) => void;
279
440
  };
280
441
 
@@ -312,7 +473,7 @@ declare module 'solid-js' {
312
473
  'on:rc-select-change'?: (e: CustomEvent<RCSelectChangeDetail>) => void;
313
474
  'on:rc-select-open'?: (e: CustomEvent) => void;
314
475
  'on:rc-select-close'?: (e: CustomEvent) => void;
315
- 'on:rc-combobox-create'?: (e: CustomEvent<{ text: string }>) => void;
476
+ 'on:rc-combobox-create'?: (e: CustomEvent<RCComboboxCreateDetail>) => void;
316
477
  };
317
478
 
318
479
  'rc-dialog': JSX.HTMLAttributes<RCDialogRef> & {
@@ -331,15 +492,15 @@ declare module 'solid-js' {
331
492
  'light-dismiss'?: boolean | string;
332
493
  'on:rc-dialog-open'?: (e: CustomEvent) => void;
333
494
  'on:rc-dialog-toggle'?: (e: CustomEvent<RCDialogToggleDetail>) => void;
334
- 'on:rc-dialog-close'?: (e: CustomEvent<{ returnValue: string }>) => void;
335
- 'on:rc-dialog-request-close'?: (e: CustomEvent<{ returnValue: string }>) => void;
495
+ 'on:rc-dialog-close'?: (e: CustomEvent<RCDialogCloseDetail>) => void;
496
+ 'on:rc-dialog-request-close'?: (e: CustomEvent<RCDialogCloseDetail>) => void;
336
497
  'on:rc-dialog-cancel'?: (e: CustomEvent) => void;
337
498
  };
338
499
 
339
500
  'rc-menu': JSX.HTMLAttributes<RCMenuRef> & {
340
501
  label?: string;
341
502
  'on:rc-menu-activate'?: (e: CustomEvent<RCMenuActivateDetail>) => void;
342
- 'on:rc-menu-close'?: (e: CustomEvent<{ reason: 'escape' }>) => void;
503
+ 'on:rc-menu-close'?: (e: CustomEvent<RCMenuCloseDetail>) => void;
343
504
  };
344
505
 
345
506
  'rc-menu-button': JSX.HTMLAttributes<RCMenuButtonRef> & {
@@ -348,10 +509,14 @@ declare module 'solid-js' {
348
509
  'prop:open'?: boolean | undefined;
349
510
  'prop:defaultOpen'?: boolean | undefined;
350
511
  orientation?: 'horizontal' | 'vertical';
351
- 'on:rc-menu-button-toggle'?: (e: CustomEvent<{ open: boolean }>) => void;
512
+ placement?: RCMenuButtonPlacement;
513
+ 'on:rc-menu-button-toggle'?: (e: CustomEvent<RCMenuButtonToggleDetail>) => void;
352
514
  };
353
515
 
354
- 'rc-menubar': JSX.HTMLAttributes<RCMenubarRef>;
516
+ 'rc-menubar': JSX.HTMLAttributes<RCMenubarRef> & {
517
+ label?: string;
518
+ orientation?: 'horizontal' | 'vertical';
519
+ };
355
520
 
356
521
  'rc-toolbar': JSX.HTMLAttributes<RCToolbarRef> & {
357
522
  label?: string;
@@ -372,8 +537,8 @@ declare module 'solid-js' {
372
537
  display?: 'float' | 'inline-start' | 'inline-end';
373
538
  'value-text'?: string;
374
539
  orientation?: 'horizontal' | 'vertical';
375
- 'on:rc-slider-input'?: (e: CustomEvent<{ value: number }>) => void;
376
- 'on:rc-slider-change'?: (e: CustomEvent<{ value: number }>) => void;
540
+ 'on:rc-slider-input'?: (e: CustomEvent<RCSliderChangeDetail>) => void;
541
+ 'on:rc-slider-change'?: (e: CustomEvent<RCSliderChangeDetail>) => void;
377
542
  };
378
543
 
379
544
  'rc-range-slider': JSX.HTMLAttributes<RCRangeSliderRef> & {
@@ -389,18 +554,20 @@ declare module 'solid-js' {
389
554
  'high-value-text'?: string;
390
555
  display?: 'float' | 'inline-start' | 'inline-end';
391
556
  orientation?: 'horizontal' | 'vertical';
392
- 'on:rc-range-slider-input'?: (e: CustomEvent<{ value: [number, number] }>) => void;
393
- 'on:rc-range-slider-change'?: (e: CustomEvent<{ value: [number, number] }>) => void;
557
+ 'on:rc-range-slider-input'?: (e: CustomEvent<RCRangeSliderChangeDetail>) => void;
558
+ 'on:rc-range-slider-change'?: (e: CustomEvent<RCRangeSliderChangeDetail>) => void;
394
559
  };
395
560
 
396
561
  'rc-transfer-list': JSX.HTMLAttributes<RCTransferListRef> & {
397
562
  multiple?: boolean | string;
563
+ compact?: boolean | string;
398
564
  'available-label'?: string;
399
565
  'selected-label'?: string;
566
+ 'prop:compact'?: boolean | undefined;
400
567
  'prop:available'?: RCTransferListOption[] | undefined;
401
568
  'prop:selected'?: RCTransferListOption[] | undefined;
402
569
  'prop:defaultSelected'?: RCTransferListOption[] | undefined;
403
- 'on:rc-transfer-list-change'?: (e: CustomEvent<{ selected: RCTransferListOption[] }>) => void;
570
+ 'on:rc-transfer-list-change'?: (e: CustomEvent<RCTransferListChangeDetail>) => void;
404
571
  };
405
572
 
406
573
  'rc-splitter': JSX.HTMLAttributes<RCSplitterRef> & {
@@ -414,7 +581,7 @@ declare module 'solid-js' {
414
581
  'prop:value'?: number | undefined;
415
582
  'prop:defaultValue'?: number | undefined;
416
583
  fixed?: boolean | string;
417
- 'on:rc-splitter-change'?: (e: CustomEvent<{ value: number; valueText: string }>) => void;
584
+ 'on:rc-splitter-change'?: (e: CustomEvent<RCSplitterChangeDetail>) => void;
418
585
  };
419
586
 
420
587
  'rc-editor-toolbar': JSX.HTMLAttributes<HTMLElement> & {
@@ -422,34 +589,26 @@ declare module 'solid-js' {
422
589
  'on:rc-toolbar-action'?: (e: CustomEvent<{ action: string }>) => void;
423
590
  };
424
591
 
425
- 'rc-text-editor': JSX.HTMLAttributes<RCTextEditorRef> & {
592
+ 'rc-markdown-editor': JSX.HTMLAttributes<RCMarkdownEditorRef> & {
426
593
  value?: string;
427
594
  defaultValue?: string;
428
- plugin?: RCTextareaPlugin | null;
595
+ 'default-value'?: string;
429
596
  'prop:value'?: string | undefined;
430
597
  'prop:defaultValue'?: string | undefined;
431
- 'prop:plugin'?: RCTextareaPlugin | null;
432
598
  toolbar?: boolean | string;
433
- markdown?: boolean | string;
434
- preview?: boolean | string;
435
- 'default-preview'?: boolean | string;
436
- 'prop:preview'?: boolean | undefined;
437
- 'prop:defaultPreview'?: boolean | undefined;
438
- 'line-numbers'?: boolean | string;
439
- 'list-numbers'?: boolean | string;
440
- gutter?: boolean | string;
441
- 'word-wrap'?: boolean | string;
442
- 'auto-grow'?: boolean | string;
599
+ 'source-mode'?: boolean | string;
600
+ 'default-source-mode'?: boolean | string;
601
+ 'prop:sourceMode'?: boolean | undefined;
602
+ 'prop:defaultSourceMode'?: boolean | undefined;
443
603
  'read-only'?: boolean | string;
444
- label?: string;
445
- 'on:rc-textarea-change'?: (e: CustomEvent<{ value: string }>) => void;
446
- 'on:rc-preview-change'?: (e: CustomEvent<{ preview: boolean }>) => void;
604
+ 'on:rc-change'?: (e: CustomEvent<RCMarkdownEditorChangeDetail>) => void;
605
+ 'on:rc-mode-change'?: (e: CustomEvent<RCMarkdownEditorModeChangeDetail>) => void;
606
+ 'on:rc-formatting-change'?: (e: CustomEvent<RCMarkdownEditorFormats>) => void;
447
607
  };
448
608
 
449
609
  'rc-fab': JSX.HTMLAttributes<HTMLElement> & {
450
- variant?: 'regular' | 'extended';
451
- label?: string;
452
- disabled?: boolean | string;
610
+ position?: 'bottom-end' | 'bottom-start' | 'top-end' | 'top-start' | string;
611
+ 'scroll-reveal'?: boolean | string;
453
612
  };
454
613
 
455
614
  'rc-app-bar': JSX.HTMLAttributes<RCAppBarRef> & {
@@ -473,6 +632,16 @@ declare module 'solid-js' {
473
632
  'on:rc-search-bar-clear'?: (e: CustomEvent) => void;
474
633
  };
475
634
 
635
+ 'rc-virtual-canvas': JSX.HTMLAttributes<RCVirtualCanvasRef> & {
636
+ contentWidth?: number | string;
637
+ contentHeight?: number | string;
638
+ 'auto-resize-canvas'?: boolean | string;
639
+ 'render-mode'?: 'continuous' | 'viewport-change' | 'manual';
640
+ 'image-rendering'?: 'auto' | 'crisp-edges' | 'pixelated';
641
+ 'on:rc-virtual-canvas-render'?: (e: CustomEvent<RCVirtualCanvasRenderDetail>) => void;
642
+ 'on:rc-virtual-canvas-pointer'?: (e: CustomEvent<RCVirtualCanvasPointerDetail>) => void;
643
+ };
644
+
476
645
  'rc-textarea': JSX.HTMLAttributes<RCTextareaRef> & {
477
646
  value?: string;
478
647
  defaultValue?: string;
@@ -487,10 +656,10 @@ declare module 'solid-js' {
487
656
  'auto-grow'?: boolean | string;
488
657
  'read-only'?: boolean | string;
489
658
  label?: string;
490
- 'on:rc-textarea-change'?: (e: CustomEvent<{ value: string }>) => void;
659
+ 'on:rc-textarea-change'?: (e: CustomEvent<RCTextareaChangeDetail>) => void;
491
660
  'on:rc-textarea-focus'?: (e: CustomEvent) => void;
492
661
  'on:rc-textarea-blur'?: (e: CustomEvent) => void;
493
- 'on:rc-textarea-select'?: (e: CustomEvent<{ selectionStart: number; selectionEnd: number }>) => void;
662
+ 'on:rc-textarea-select'?: (e: CustomEvent<RCTextareaSelectDetail>) => void;
494
663
  };
495
664
  }
496
665
  }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Defines the rc-webcomponents semantic token set. All tokens fall back to
3
+ * CSS System Colors, so this file is optional. Import it or override these
4
+ * tokens at the application theme boundary.
5
+ */
6
+ :root {
7
+ --rc-surface: Canvas;
8
+ --rc-field: Field;
9
+ --rc-button-bg: ButtonFace;
10
+
11
+ --rc-field-text: FieldText;
12
+ --rc-button-text: ButtonText;
13
+ --rc-highlight-text: HighlightText;
14
+ --rc-text-disabled: GrayText;
15
+
16
+ --rc-highlight: Highlight;
17
+ --rc-accent: Highlight;
18
+
19
+ --rc-border-color: ButtonBorder;
20
+ --rc-border-width: 1px;
21
+ --rc-border-style: solid;
22
+ --rc-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
23
+
24
+ --rc-font-family: inherit;
25
+ --rc-font-size: 1em;
26
+ --rc-font-weight: 400;
27
+ --rc-line-height: normal;
28
+
29
+ --rc-control-block-size: 2.25em;
30
+ --rc-control-padding-block: 0.25em;
31
+ --rc-control-padding-inline: 0.5em;
32
+ --rc-control-gap: 0.25em;
33
+
34
+ --rc-item-padding-block: 0.3em;
35
+ --rc-item-padding-inline: 0.75em;
36
+ --rc-item-gap: 0.4em;
37
+
38
+ --rc-radius-sm: 0.125em;
39
+ --rc-radius-md: 0.25em;
40
+ --rc-control-radius: var(--rc-radius-sm);
41
+
42
+ --rc-focus-ring: auto;
43
+ --rc-focus-ring-offset: 0;
44
+ --rc-disabled-opacity: 0.5;
45
+ --rc-motion-duration: 120ms;
46
+
47
+ --rc-border: var(--rc-border-width) var(--rc-border-style) var(--rc-border-color);
48
+ }
49
+
50
+ @supports (color: AccentColor) {
51
+ :root {
52
+ --rc-accent: AccentColor;
53
+ }
54
+ }