@rcarls/rc-webcomponents 0.3.2 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/solid.d.ts CHANGED
@@ -25,6 +25,102 @@ export type RCDisclosureToggleDetail = {
25
25
  open: boolean;
26
26
  };
27
27
 
28
+ /** Public API surface of `<rc-button>`. */
29
+ export type RCButtonRef = HTMLElement & {
30
+ disabled: boolean;
31
+ pending: boolean;
32
+ progress: boolean;
33
+ progressValue: number | undefined;
34
+ toggle: boolean;
35
+ selected: boolean;
36
+ defaultSelected: boolean;
37
+ iconOnly: boolean;
38
+ fullWidth: boolean;
39
+ };
40
+
41
+ /** Public API surface of `<rc-card>`. */
42
+ export type RCCardRef = HTMLElement & {
43
+ selected: boolean;
44
+ disabled: boolean;
45
+ interactive: boolean;
46
+ actionTarget: string;
47
+ };
48
+
49
+ export type RCSwitchChangeDetail = {
50
+ checked: boolean;
51
+ };
52
+
53
+ export type RCSwitchRef = HTMLElement & {
54
+ checked: boolean;
55
+ defaultChecked: boolean;
56
+ disabled: boolean;
57
+ icons: boolean;
58
+ showOnlySelectedIcon: boolean;
59
+ };
60
+
61
+ export type RCSegmentedButtonChangeDetail = {
62
+ value: string;
63
+ };
64
+
65
+ export type RCSegmentedButtonRef = HTMLElement & {
66
+ value: string;
67
+ defaultValue: string;
68
+ disabled: boolean;
69
+ orientation: 'horizontal' | 'vertical';
70
+ };
71
+
72
+ export type RCChipVariant = 'assist' | 'filter' | 'input' | 'suggestion';
73
+
74
+ export type RCChipChangeDetail = {
75
+ selected: boolean;
76
+ };
77
+
78
+ export type RCChipRemoveDetail = {
79
+ chip: HTMLElement;
80
+ };
81
+
82
+ export type RCButtonToggleDetail = {
83
+ selected: boolean;
84
+ };
85
+
86
+ export type RCChipRef = HTMLElement & {
87
+ variant: RCChipVariant;
88
+ selected: boolean;
89
+ defaultSelected: boolean;
90
+ disabled: boolean;
91
+ readonly: boolean;
92
+ removable: boolean;
93
+ };
94
+
95
+ export type RCSnackbarQueuePolicy = 'queue' | 'replace';
96
+ export type RCSnackbarCloseReason = 'action' | 'api' | 'timeout' | 'replace' | 'clear';
97
+
98
+ export type RCSnackbarShowOptions = {
99
+ message: string;
100
+ actionLabel?: string;
101
+ duration?: number;
102
+ };
103
+
104
+ export type RCSnackbarActionDetail = {
105
+ message: string;
106
+ };
107
+
108
+ export type RCSnackbarCloseDetail = {
109
+ reason: RCSnackbarCloseReason;
110
+ message: string;
111
+ };
112
+
113
+ export type RCSnackbarRef = HTMLElement & {
114
+ open: boolean;
115
+ message: string;
116
+ actionLabel: string;
117
+ duration: number;
118
+ queuePolicy: RCSnackbarQueuePolicy;
119
+ show(message: string | RCSnackbarShowOptions): void;
120
+ close(reason?: RCSnackbarCloseReason): void;
121
+ clear(): void;
122
+ };
123
+
28
124
  /** Public API surface of `<rc-accordion>`. */
29
125
  export type RCAccordionRef = HTMLElement & {
30
126
  multiple: boolean;
@@ -92,9 +188,7 @@ export type RCListboxActionChangeDetail<Action extends string = string> = RCSele
92
188
  action: Action;
93
189
  };
94
190
 
95
- export type RCListboxChangeDetail =
96
- | RCListboxSelectChangeDetail
97
- | RCListboxActionChangeDetail;
191
+ export type RCListboxChangeDetail = RCListboxSelectChangeDetail | RCListboxActionChangeDetail;
98
192
 
99
193
  export type RCSelectRef = HTMLElement & {
100
194
  open: boolean;
@@ -121,6 +215,17 @@ export type RCComboboxCreateDetail = {
121
215
  };
122
216
 
123
217
  /** Public API surface of `<rc-dialog>`. */
218
+ export type RCDialogResizeOrigin =
219
+ | ''
220
+ | 'top'
221
+ | 'right'
222
+ | 'bottom'
223
+ | 'left'
224
+ | 'top-left'
225
+ | 'top-right'
226
+ | 'bottom-left'
227
+ | 'bottom-right';
228
+
124
229
  export type RCDialogRef = HTMLElement & {
125
230
  open: boolean | undefined;
126
231
  defaultOpen: boolean;
@@ -129,6 +234,8 @@ export type RCDialogRef = HTMLElement & {
129
234
  moveBounds: 'viewport' | 'parent';
130
235
  moveStep: number;
131
236
  resize: 'none' | 'both' | 'horizontal' | 'vertical';
237
+ resizeOrigin: RCDialogResizeOrigin;
238
+ resizeHandle: string;
132
239
  resizeThreshold: number;
133
240
  resizeStep: number;
134
241
  closedBy: 'any' | 'closerequest' | 'none' | '';
@@ -140,6 +247,26 @@ export type RCDialogRef = HTMLElement & {
140
247
  requestClose(returnValue?: string): void;
141
248
  };
142
249
 
250
+ /** Detail shape for `rc-bottom-sheet-snap`. */
251
+ export type RCBottomSheetSnapDetail = {
252
+ /** Index into the resolved snap-point list selected as the target. */
253
+ index: number;
254
+
255
+ /** Target height, in pixels. */
256
+ height: number;
257
+
258
+ /** Whether the snap came from a drag release or a `snapTo()` call. */
259
+ trigger: 'drag' | 'api';
260
+ };
261
+
262
+ /** Public API surface of `<rc-bottom-sheet>`. */
263
+ export type RCBottomSheetRef = RCDialogRef & {
264
+ snapPoints: string;
265
+ swipeDismiss: boolean;
266
+ swipeVelocity: number;
267
+ snapTo(index: number, behavior?: 'animated' | 'instant'): void;
268
+ };
269
+
143
270
  export type RCDialogToggleDetail = {
144
271
  open: boolean;
145
272
  returnValue: string;
@@ -190,6 +317,32 @@ export type RCMenuButtonToggleDetail = {
190
317
  open: boolean;
191
318
  };
192
319
 
320
+ /** Public API surface of `<rc-fab-menu>`. */
321
+ export type RCFabMenuRef = RCMenuButtonRef & {
322
+ position: 'bottom-end' | 'bottom-start' | 'top-end' | 'top-start';
323
+ };
324
+
325
+ export type RCFabMenuToggleDetail = RCMenuButtonToggleDetail;
326
+
327
+ /** Public API surface of `<rc-navigation-bar>`. */
328
+ export type RCNavigationBarRef = HTMLElement & {
329
+ activeSelector: string;
330
+ indicatorTarget: string;
331
+ };
332
+
333
+ /** Public API surface of `<rc-navigation-rail>`. */
334
+ export type RCNavigationRailRef = RCNavigationBarRef & {
335
+ expanded: boolean;
336
+ defaultExpanded: boolean;
337
+ expand(): void;
338
+ collapse(): void;
339
+ toggleExpanded(): void;
340
+ };
341
+
342
+ export type RCNavigationRailToggleDetail = {
343
+ expanded: boolean;
344
+ };
345
+
193
346
  /** Public API surface of `<rc-menubar>`. */
194
347
  export type RCMenubarRef = HTMLElement & {
195
348
  label: string;
@@ -206,11 +359,17 @@ export type RCToolbarRef = HTMLElement & {
206
359
  export type RCSplitterRef = HTMLElement & {
207
360
  label: string;
208
361
  orientation: 'horizontal' | 'vertical';
209
- mode: 'length' | 'percent';
362
+ mode: 'length' | 'percent' | 'fixed';
210
363
  step: number;
364
+ min: number;
365
+ max: number | undefined;
211
366
  value: number;
212
367
  defaultValue: number | undefined;
213
368
  fixed: boolean;
369
+ collapsible: boolean;
370
+ snapPoints: string;
371
+ swipeVelocity: number;
372
+ snapTo(index: number, behavior?: 'animated' | 'instant'): void;
214
373
  };
215
374
 
216
375
  export type RCTextareaRef = HTMLElement & {
@@ -384,17 +543,32 @@ export type RCAppBarScrollDetail = {
384
543
 
385
544
  /** Public API surface of `<rc-search-bar>`. */
386
545
  export type RCSearchBarRef = HTMLElement & {
546
+ variant: 'bar' | 'view';
547
+ open: boolean;
548
+ defaultOpen: boolean;
387
549
  value: string;
388
550
  defaultValue: string | undefined;
389
551
  debounce: number;
390
552
  clearLabel: string;
391
553
  placeholder: string | undefined;
554
+ showView(): void;
555
+ closeView(): void;
556
+ toggleView(): void;
392
557
  };
393
558
 
394
559
  export type RCSearchBarInputDetail = {
395
560
  value: string;
396
561
  };
397
562
 
563
+ export type RCSearchBarToggleDetail = {
564
+ open: boolean;
565
+ };
566
+
567
+ export type RCSearchBarSuggestionSelectDetail = {
568
+ value: string;
569
+ label: string;
570
+ };
571
+
398
572
  export type RCSplitterChangeDetail = {
399
573
  value: number;
400
574
  valueText: string;
@@ -426,6 +600,80 @@ declare module 'solid-js' {
426
600
  'on:rc-disclosure-toggle'?: (e: CustomEvent<RCDisclosureToggleDetail>) => void;
427
601
  };
428
602
 
603
+ 'rc-button': JSX.HTMLAttributes<RCButtonRef> & {
604
+ disabled?: boolean | string;
605
+ pending?: boolean | string;
606
+ progress?: boolean | string;
607
+ 'progress-value'?: number | string;
608
+ toggle?: boolean | string;
609
+ selected?: boolean | string;
610
+ defaultSelected?: boolean | string;
611
+ 'default-selected'?: boolean | string;
612
+ 'icon-only'?: boolean | string;
613
+ 'full-width'?: boolean | string;
614
+ 'prop:selected'?: boolean | undefined;
615
+ 'prop:defaultSelected'?: boolean | undefined;
616
+ 'on:rc-button-toggle'?: (e: CustomEvent<RCButtonToggleDetail>) => void;
617
+ };
618
+
619
+ 'rc-card': JSX.HTMLAttributes<RCCardRef> & {
620
+ selected?: boolean | string;
621
+ disabled?: boolean | string;
622
+ interactive?: boolean | string;
623
+ 'action-target'?: string;
624
+ };
625
+
626
+ 'rc-switch': JSX.HTMLAttributes<RCSwitchRef> & {
627
+ checked?: boolean | string;
628
+ defaultChecked?: boolean | string;
629
+ 'default-checked'?: boolean | string;
630
+ disabled?: boolean | string;
631
+ icons?: boolean | string;
632
+ 'show-only-selected-icon'?: boolean | string;
633
+ 'prop:checked'?: boolean | undefined;
634
+ 'prop:defaultChecked'?: boolean | undefined;
635
+ 'on:rc-switch-change'?: (e: CustomEvent<RCSwitchChangeDetail>) => void;
636
+ };
637
+
638
+ 'rc-segmented-button': JSX.HTMLAttributes<RCSegmentedButtonRef> & {
639
+ value?: string;
640
+ defaultValue?: string;
641
+ 'default-value'?: string;
642
+ disabled?: boolean | string;
643
+ orientation?: 'horizontal' | 'vertical';
644
+ 'prop:value'?: string | undefined;
645
+ 'prop:defaultValue'?: string | undefined;
646
+ 'on:rc-segmented-button-change'?: (e: CustomEvent<RCSegmentedButtonChangeDetail>) => void;
647
+ };
648
+
649
+ 'rc-chip': JSX.HTMLAttributes<RCChipRef> & {
650
+ variant?: RCChipVariant;
651
+ selected?: boolean | string;
652
+ defaultSelected?: boolean | string;
653
+ 'default-selected'?: boolean | string;
654
+ disabled?: boolean | string;
655
+ readonly?: boolean | string;
656
+ removable?: boolean | string;
657
+ 'prop:selected'?: boolean | undefined;
658
+ 'prop:defaultSelected'?: boolean | undefined;
659
+ 'on:rc-chip-change'?: (e: CustomEvent<RCChipChangeDetail>) => void;
660
+ 'on:rc-chip-remove'?: (e: CustomEvent<RCChipRemoveDetail>) => void;
661
+ };
662
+
663
+ 'rc-snackbar': JSX.HTMLAttributes<RCSnackbarRef> & {
664
+ open?: boolean | string;
665
+ message?: string;
666
+ actionLabel?: string;
667
+ 'action-label'?: string;
668
+ duration?: number | string;
669
+ queuePolicy?: RCSnackbarQueuePolicy;
670
+ 'queue-policy'?: RCSnackbarQueuePolicy;
671
+ 'prop:open'?: boolean | undefined;
672
+ 'prop:duration'?: number | undefined;
673
+ 'on:rc-snackbar-action'?: (e: CustomEvent<RCSnackbarActionDetail>) => void;
674
+ 'on:rc-snackbar-close'?: (e: CustomEvent<RCSnackbarCloseDetail>) => void;
675
+ };
676
+
429
677
  'rc-listbox': JSX.HTMLAttributes<RCListboxRef> & {
430
678
  multiple?: boolean | string;
431
679
  checkmark?: boolean | string;
@@ -462,7 +710,7 @@ declare module 'solid-js' {
462
710
  disabled?: boolean | string;
463
711
  placeholder?: string;
464
712
  display?: 'auto' | 'chips' | 'compact';
465
- allowcreate?: boolean | string;
713
+ 'allow-create'?: boolean | string;
466
714
  'filter-strategy'?: 'prefix' | 'contains';
467
715
  value?: RCSelectValue;
468
716
  defaultValue?: RCSelectValue;
@@ -470,6 +718,7 @@ declare module 'solid-js' {
470
718
  'prop:value'?: RCSelectValue | undefined;
471
719
  'prop:defaultValue'?: RCSelectValue | undefined;
472
720
  'prop:options'?: RCSelectOption[] | undefined;
721
+ 'prop:allowCreate'?: boolean | undefined;
473
722
  'on:rc-select-change'?: (e: CustomEvent<RCSelectChangeDetail>) => void;
474
723
  'on:rc-select-open'?: (e: CustomEvent) => void;
475
724
  'on:rc-select-close'?: (e: CustomEvent) => void;
@@ -481,11 +730,15 @@ declare module 'solid-js' {
481
730
  defaultOpen?: boolean | string;
482
731
  'prop:open'?: boolean | undefined;
483
732
  'prop:defaultOpen'?: boolean | undefined;
733
+ 'prop:modal'?: boolean | undefined;
734
+ 'prop:lightDismiss'?: boolean | undefined;
484
735
  movable?: boolean | string;
485
736
  'move-handle'?: string;
486
737
  'move-bounds'?: 'viewport' | 'parent';
487
738
  'move-step'?: number | string;
488
739
  resize?: 'none' | 'both' | 'horizontal' | 'vertical';
740
+ 'resize-origin'?: RCDialogResizeOrigin;
741
+ 'resize-handle'?: string;
489
742
  'resize-threshold'?: number | string;
490
743
  'resize-step'?: number | string;
491
744
  'closed-by'?: 'any' | 'closerequest' | 'none';
@@ -497,6 +750,31 @@ declare module 'solid-js' {
497
750
  'on:rc-dialog-cancel'?: (e: CustomEvent) => void;
498
751
  };
499
752
 
753
+ 'rc-bottom-sheet': JSX.HTMLAttributes<RCBottomSheetRef> & {
754
+ open?: boolean | string;
755
+ defaultOpen?: boolean | string;
756
+ 'prop:open'?: boolean | undefined;
757
+ 'prop:defaultOpen'?: boolean | undefined;
758
+ 'prop:modal'?: boolean | undefined;
759
+ 'prop:lightDismiss'?: boolean | undefined;
760
+ 'prop:swipeDismiss'?: boolean | undefined;
761
+ 'light-dismiss'?: boolean | string;
762
+ resize?: 'none' | 'both' | 'horizontal' | 'vertical';
763
+ 'resize-origin'?: RCDialogResizeOrigin;
764
+ 'resize-handle'?: string;
765
+ 'resize-threshold'?: number | string;
766
+ 'resize-step'?: number | string;
767
+ 'snap-points'?: string;
768
+ 'swipe-dismiss'?: boolean | string;
769
+ 'swipe-velocity'?: number | string;
770
+ 'on:rc-dialog-open'?: (e: CustomEvent) => void;
771
+ 'on:rc-dialog-toggle'?: (e: CustomEvent<RCDialogToggleDetail>) => void;
772
+ 'on:rc-dialog-close'?: (e: CustomEvent<RCDialogCloseDetail>) => void;
773
+ 'on:rc-dialog-request-close'?: (e: CustomEvent<RCDialogCloseDetail>) => void;
774
+ 'on:rc-dialog-cancel'?: (e: CustomEvent) => void;
775
+ 'on:rc-bottom-sheet-snap'?: (e: CustomEvent<RCBottomSheetSnapDetail>) => void;
776
+ };
777
+
500
778
  'rc-menu': JSX.HTMLAttributes<RCMenuRef> & {
501
779
  label?: string;
502
780
  'on:rc-menu-activate'?: (e: CustomEvent<RCMenuActivateDetail>) => void;
@@ -513,6 +791,31 @@ declare module 'solid-js' {
513
791
  'on:rc-menu-button-toggle'?: (e: CustomEvent<RCMenuButtonToggleDetail>) => void;
514
792
  };
515
793
 
794
+ 'rc-fab-menu': JSX.HTMLAttributes<RCFabMenuRef> & {
795
+ open?: boolean | string;
796
+ defaultOpen?: boolean | string;
797
+ 'prop:open'?: boolean | undefined;
798
+ 'prop:defaultOpen'?: boolean | undefined;
799
+ placement?: RCMenuButtonPlacement;
800
+ position?: 'bottom-end' | 'bottom-start' | 'top-end' | 'top-start' | string;
801
+ 'on:rc-fab-menu-toggle'?: (e: CustomEvent<RCFabMenuToggleDetail>) => void;
802
+ };
803
+
804
+ 'rc-navigation-bar': JSX.HTMLAttributes<RCNavigationBarRef> & {
805
+ activeSelector?: string;
806
+ indicatorTarget?: string;
807
+ };
808
+
809
+ 'rc-navigation-rail': JSX.HTMLAttributes<RCNavigationRailRef> & {
810
+ expanded?: boolean | string;
811
+ defaultExpanded?: boolean | string;
812
+ activeSelector?: string;
813
+ indicatorTarget?: string;
814
+ 'prop:expanded'?: boolean | undefined;
815
+ 'prop:defaultExpanded'?: boolean | undefined;
816
+ 'on:rc-navigation-rail-toggle'?: (e: CustomEvent<RCNavigationRailToggleDetail>) => void;
817
+ };
818
+
516
819
  'rc-menubar': JSX.HTMLAttributes<RCMenubarRef> & {
517
820
  label?: string;
518
821
  orientation?: 'horizontal' | 'vertical';
@@ -573,14 +876,19 @@ declare module 'solid-js' {
573
876
  'rc-splitter': JSX.HTMLAttributes<RCSplitterRef> & {
574
877
  label?: string;
575
878
  orientation?: 'horizontal' | 'vertical';
576
- mode?: 'length' | 'percent';
879
+ mode?: 'length' | 'percent' | 'fixed';
577
880
  step?: number | string;
881
+ min?: number | string;
882
+ max?: number | string;
578
883
  value?: number | string;
579
884
  defaultValue?: number | string;
580
885
  'default-value'?: number | string;
581
886
  'prop:value'?: number | undefined;
582
887
  'prop:defaultValue'?: number | undefined;
583
888
  fixed?: boolean | string;
889
+ collapsible?: boolean | string;
890
+ 'snap-points'?: string;
891
+ 'swipe-velocity'?: number | string;
584
892
  'on:rc-splitter-change'?: (e: CustomEvent<RCSplitterChangeDetail>) => void;
585
893
  };
586
894
 
@@ -622,6 +930,11 @@ declare module 'solid-js' {
622
930
  };
623
931
 
624
932
  'rc-search-bar': JSX.HTMLAttributes<RCSearchBarRef> & {
933
+ variant?: 'bar' | 'view';
934
+ open?: boolean | string;
935
+ defaultOpen?: boolean | string;
936
+ 'prop:open'?: boolean | undefined;
937
+ 'prop:defaultOpen'?: boolean | undefined;
625
938
  debounce?: number | string;
626
939
  'clear-label'?: string;
627
940
  placeholder?: string;
@@ -630,6 +943,10 @@ declare module 'solid-js' {
630
943
  'prop:defaultValue'?: string | undefined;
631
944
  'on:rc-search-bar-input'?: (e: CustomEvent<RCSearchBarInputDetail>) => void;
632
945
  'on:rc-search-bar-clear'?: (e: CustomEvent) => void;
946
+ 'on:rc-search-bar-toggle'?: (e: CustomEvent<RCSearchBarToggleDetail>) => void;
947
+ 'on:rc-search-bar-suggestion-select'?: (
948
+ e: CustomEvent<RCSearchBarSuggestionSelectDetail>,
949
+ ) => void;
633
950
  };
634
951
 
635
952
  'rc-virtual-canvas': JSX.HTMLAttributes<RCVirtualCanvasRef> & {
package/themes/base.css CHANGED
@@ -42,7 +42,19 @@
42
42
  --rc-focus-ring: auto;
43
43
  --rc-focus-ring-offset: 0;
44
44
  --rc-disabled-opacity: 0.5;
45
- --rc-motion-duration: 120ms;
45
+ --rc-motion-effects-duration-fast: 80ms;
46
+ --rc-motion-effects-easing-fast: ease-out;
47
+ --rc-motion-effects-duration-default: 120ms;
48
+ --rc-motion-effects-easing-default: ease-out;
49
+ --rc-motion-effects-duration-slow: 200ms;
50
+ --rc-motion-effects-easing-slow: ease-out;
51
+ --rc-motion-spatial-duration-fast: 180ms;
52
+ --rc-motion-spatial-easing-fast: cubic-bezier(0.2, 0, 0, 1);
53
+ --rc-motion-spatial-duration-default: 300ms;
54
+ --rc-motion-spatial-easing-default: cubic-bezier(0.2, 0, 0, 1);
55
+ --rc-motion-spatial-duration-slow: 450ms;
56
+ --rc-motion-spatial-easing-slow: cubic-bezier(0.2, 0, 0, 1);
57
+ --rc-motion-duration: var(--rc-motion-effects-duration-default);
46
58
 
47
59
  --rc-border: var(--rc-border-width) var(--rc-border-style) var(--rc-border-color);
48
60
  }