@jfrader/ui 0.4.0 → 0.5.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/README.md +2 -0
- package/dist/accordion-DLul6vIl.js +205 -0
- package/dist/accordion.js +1 -1
- package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
- package/dist/alert.js +1 -1
- package/dist/announcement-bar-Dlbq5-9D.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-CaGJHy1N.js +145 -0
- package/dist/avatar-group-M1opAQEG.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/avatar.js +1 -1
- package/dist/badge-CjM5Agqk.js +119 -0
- package/dist/badge.js +1 -1
- package/dist/bottom-sheet-DjZOPq4k.js +674 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-BDK_LiwH.js} +11 -4
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-NLY0h6EJ.js} +8 -8
- package/dist/button.js +1 -1
- package/dist/calendar-BzJdv_SZ.js +449 -0
- package/dist/calendar.js +1 -1
- package/dist/card-Ca4KQKYQ.js +154 -0
- package/dist/card.js +1 -1
- package/dist/carousel-B7OrvD6J.js +474 -0
- package/dist/carousel.js +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-DKSzExj2.js} +17 -16
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DjQ0_6Y9.js +290 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-B5we2lZa.js +293 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-DFFqOBCi.js +339 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BmQu2w4H.js +391 -0
- package/dist/command-palette.js +1 -1
- package/dist/comment-thread-ASaXDcGo.js +1410 -0
- package/dist/comment-thread.js +2 -0
- package/dist/context-menu-__1c2Dk9.js +370 -0
- package/dist/context-menu.js +2 -0
- package/dist/copy-button-DCSLcYS-.js +252 -0
- package/dist/copy-button.js +2 -0
- package/dist/countdown-Dp_TD1VP.js +293 -0
- package/dist/countdown.js +2 -0
- package/dist/date-picker-BiPN7yeK.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-DQpUeKqV.js +570 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-BX1zYMs-.js} +21 -20
- package/dist/dialog.js +1 -1
- package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
- package/dist/divider.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/elastic-slider-BG6K019r.js +395 -0
- package/dist/elastic-slider.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-rUATve0o.js +347 -0
- package/dist/expandable-card.js +2 -0
- package/dist/expanding-search-BxOwtdwt.js +238 -0
- package/dist/expanding-search.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-BuXm3Tea.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-Cy5Hqur-.js +314 -0
- package/dist/filter-toolbar.js +2 -0
- package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
- package/dist/hold-to-confirm.js +2 -0
- package/dist/hover-card-CoMJKg1g.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-BxY8Ykzt.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +84 -38
- package/dist/inline-edit-C0eeml65.js +535 -0
- package/dist/inline-edit.js +2 -0
- package/dist/input-control-DmMuAuPS.js +34 -0
- package/dist/json-viewer-DgWqyU75.js +802 -0
- package/dist/json-viewer.js +2 -0
- package/dist/listbox-style-WX-RASp1.js +59 -0
- package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
- package/dist/mention-input-sq61si9L.js +600 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-DDKgmK2F.js +295 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card--lVTz5Wn.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-DG1BCFX7.js +598 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-CC26JDr-.js} +24 -18
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-qEbpEtb8.js +78 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-BfkeWbmP.js} +24 -23
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- package/dist/pill-BaS-uIbn.js +58 -0
- package/dist/pill.js +1 -1
- package/dist/popover-CErIw2q3.js +125 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-BpJswTG4.js → progress-DAQkfhPd.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/radio-cards-Cu9cBssN.js +456 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-TIK0-iPX.js} +22 -19
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-DUpQEpwG.js +520 -0
- package/dist/resizable-panels.js +2 -0
- package/dist/scroll-area-CcZyiSOQ.js +371 -0
- package/dist/scroll-area.js +2 -0
- package/dist/search-field-DMvho0KQ.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-8ZUGnsZm.js +327 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-D5rhJ8gi.js +293 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-_bTeguN9.js +645 -0
- package/dist/signature-pad.js +2 -0
- package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/slider-DVG6-Awh.js +308 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-CYKT_Ng7.js +365 -0
- package/dist/sortable-data-table.js +2 -0
- package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
- package/dist/spinner.js +1 -1
- package/dist/split-button-BCw4zZom.js +262 -0
- package/dist/split-button.js +2 -0
- package/dist/stepper-CruHbXxX.js +480 -0
- package/dist/stepper.js +2 -0
- package/dist/swipe-actions-CBuJREU1.js +420 -0
- package/dist/swipe-actions.js +2 -0
- package/dist/switch-C1WrKrf-.js +145 -0
- package/dist/switch.js +1 -1
- package/dist/tabs-XluwRjgg.js +210 -0
- package/dist/tabs.js +1 -1
- package/dist/tag-input-DSRCyrX2.js +418 -0
- package/dist/tag-input.js +2 -0
- package/dist/{text-field-D60ok14S.js → text-field-hU72iSVS.js} +20 -17
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-3k4Y0QQ3.js} +23 -20
- package/dist/textarea.js +1 -1
- package/dist/theme-root.js +1 -1
- package/dist/theme-switch-C505TtU8.js +166 -0
- package/dist/theme-switch.js +2 -0
- package/dist/time-picker-CPlhW0tr.js +311 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-B0uAAVfT.js +624 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-B7wo3sX1.js +371 -0
- package/dist/toast-stack-B40VpS4M.js +197 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-B2fpFZwV.js} +5 -5
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-BvgVTCTN.js +120 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-j8qLqkb_.js +364 -0
- package/dist/tree-view.js +2 -0
- package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
- package/dist/types/components/announcement-bar/index.d.ts +2 -0
- package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
- package/dist/types/components/avatar-group/index.d.ts +2 -0
- package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
- package/dist/types/components/bottom-sheet/index.d.ts +2 -0
- package/dist/types/components/calendar/calendar.d.ts +25 -1
- package/dist/types/components/calendar/index.d.ts +1 -1
- package/dist/types/components/carousel/carousel.d.ts +73 -0
- package/dist/types/components/carousel/index.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/chip-group/chip-group.d.ts +54 -0
- package/dist/types/components/chip-group/index.d.ts +1 -0
- package/dist/types/components/code-block/code-block.d.ts +58 -0
- package/dist/types/components/code-block/index.d.ts +1 -0
- package/dist/types/components/code-block/shiki.d.ts +3 -0
- package/dist/types/components/combobox/combobox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +2 -2
- package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
- package/dist/types/components/comment-thread/index.d.ts +1 -0
- package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
- package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
- package/dist/types/components/context-menu/context-menu.d.ts +55 -0
- package/dist/types/components/context-menu/index.d.ts +2 -0
- package/dist/types/components/copy-button/copy-button.d.ts +49 -0
- package/dist/types/components/copy-button/index.d.ts +2 -0
- package/dist/types/components/countdown/countdown.d.ts +37 -0
- package/dist/types/components/countdown/index.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +1 -1
- package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
- package/dist/types/components/date-range-picker/index.d.ts +2 -0
- package/dist/types/components/drawer/drawer.d.ts +59 -0
- package/dist/types/components/drawer/index.d.ts +2 -0
- package/dist/types/components/elastic-slider/elastic-slider.d.ts +53 -0
- package/dist/types/components/elastic-slider/index.d.ts +1 -0
- package/dist/types/components/empty-state/empty-state.d.ts +36 -0
- package/dist/types/components/empty-state/index.d.ts +2 -0
- package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
- package/dist/types/components/expandable-card/index.d.ts +2 -0
- package/dist/types/components/expanding-search/expanding-search.d.ts +22 -0
- package/dist/types/components/expanding-search/index.d.ts +1 -0
- package/dist/types/components/field/field-anatomy.d.ts +4 -2
- package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
- package/dist/types/components/file-dropzone/index.d.ts +2 -0
- package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
- package/dist/types/components/filter-toolbar/index.d.ts +1 -0
- package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
- package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
- package/dist/types/components/hover-card/hover-card.d.ts +97 -0
- package/dist/types/components/hover-card/index.d.ts +2 -0
- package/dist/types/components/image-compare/image-compare.d.ts +54 -0
- package/dist/types/components/image-compare/index.d.ts +1 -0
- package/dist/types/components/inline-edit/index.d.ts +2 -0
- package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
- package/dist/types/components/json-viewer/index.d.ts +2 -0
- package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
- package/dist/types/components/mention-input/index.d.ts +2 -0
- package/dist/types/components/mention-input/mention-input.d.ts +87 -0
- package/dist/types/components/menu/menu.d.ts +68 -7
- package/dist/types/components/metric-card/index.d.ts +1 -0
- package/dist/types/components/metric-card/metric-card.d.ts +37 -0
- package/dist/types/components/multi-select/index.d.ts +2 -0
- package/dist/types/components/multi-select/multi-select.d.ts +73 -0
- package/dist/types/components/pagination/pagination.d.ts +1 -1
- package/dist/types/components/password-field/index.d.ts +2 -0
- package/dist/types/components/password-field/password-field.d.ts +34 -0
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/radio-cards/index.d.ts +1 -0
- package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
- package/dist/types/components/radio-group/radio-group.d.ts +1 -1
- package/dist/types/components/resizable-panels/index.d.ts +2 -0
- package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
- package/dist/types/components/scroll-area/index.d.ts +2 -0
- package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
- package/dist/types/components/search-field/index.d.ts +1 -0
- package/dist/types/components/search-field/search-field.d.ts +31 -0
- package/dist/types/components/segmented-control/index.d.ts +2 -0
- package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
- package/dist/types/components/select/select.d.ts +1 -1
- package/dist/types/components/signature-pad/index.d.ts +2 -0
- package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
- package/dist/types/components/slider/index.d.ts +1 -0
- package/dist/types/components/slider/slider-style.d.ts +14 -0
- package/dist/types/components/slider/slider.d.ts +62 -0
- package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
- package/dist/types/components/sortable-data-table/index.d.ts +1 -0
- package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
- package/dist/types/components/split-button/index.d.ts +2 -0
- package/dist/types/components/split-button/split-button.d.ts +55 -0
- package/dist/types/components/stepper/index.d.ts +2 -0
- package/dist/types/components/stepper/stepper.d.ts +85 -0
- package/dist/types/components/swipe-actions/index.d.ts +2 -0
- package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
- package/dist/types/components/tabs/tabs.d.ts +1 -1
- package/dist/types/components/tag-input/index.d.ts +2 -0
- package/dist/types/components/tag-input/tag-input.d.ts +66 -0
- package/dist/types/components/text-field/text-field.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +1 -1
- package/dist/types/components/theme-switch/index.d.ts +1 -0
- package/dist/types/components/theme-switch/theme-switch.d.ts +33 -0
- package/dist/types/components/time-picker/index.d.ts +2 -0
- package/dist/types/components/time-picker/time-picker.d.ts +48 -0
- package/dist/types/components/timeline/index.d.ts +2 -0
- package/dist/types/components/timeline/timeline.d.ts +66 -0
- package/dist/types/components/toast/toast.d.ts +37 -2
- package/dist/types/components/toast-stack/index.d.ts +2 -0
- package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
- package/dist/types/components/tooltip/tooltip.d.ts +2 -2
- package/dist/types/components/tree-view/index.d.ts +1 -0
- package/dist/types/components/tree-view/tree-view.d.ts +47 -0
- package/dist/types/components/usage-meter/index.d.ts +2 -0
- package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
- package/dist/types/index.d.ts +45 -0
- package/dist/types/overlay/overlay-layer.d.ts +53 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +19 -2
- package/dist/types/styling/media.d.ts +1 -0
- package/dist/types/styling/theme.d.ts +12 -0
- package/dist/types/utils/use-controlled-state.d.ts +2 -1
- package/dist/usage-meter-qyQ3rYVv.js +463 -0
- package/dist/usage-meter.js +2 -0
- package/dist/use-controlled-state-DpeVQZNR.js +20 -0
- package/dist/use-latest-callback-cj1OOQL6.js +11 -0
- package/dist/use-overlay-floating-Bx2jBKAA.js +33 -0
- package/dist/use-slider-interaction-ChL-208h.js +234 -0
- package/package.json +195 -3
- package/dist/accordion-Bd-j04hW.js +0 -198
- package/dist/avatar-BahDVO9t.js +0 -132
- package/dist/badge-B_sLygxU.js +0 -108
- package/dist/calendar-C9Yad_-w.js +0 -394
- package/dist/card-D-aI2QHx.js +0 -158
- package/dist/collection-registry-BTYi6zGh.js +0 -98
- package/dist/combobox-DiMC2g_u.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-C29Uo4Tx.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-CGPTNRnF.js +0 -216
- package/dist/pill-DO2gHzMb.js +0 -56
- package/dist/popover-CdRXjQqI.js +0 -113
- package/dist/select-BgG7WgSh.js +0 -286
- package/dist/switch-Dr-qjmT4.js +0 -142
- package/dist/tabs-CK_g1RKa.js +0 -203
- package/dist/toast-CjmELMZZ.js +0 -283
- package/dist/tooltip-CaL3rKbV.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-Bit-f0FU.js +0 -31
- package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
|
@@ -2,6 +2,16 @@ import { type ComponentPropsWithRef } from 'react';
|
|
|
2
2
|
import { type SxProps } from '../../styling/sx';
|
|
3
3
|
/** Day of the week as counted by `Date#getUTCDay`: 0 is Sunday, 6 is Saturday. */
|
|
4
4
|
export type CalendarWeekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
|
+
/** Inclusive interval of 'YYYY-MM-DD' dates, start ≤ end. */
|
|
6
|
+
export interface CalendarRange {
|
|
7
|
+
start: string;
|
|
8
|
+
end: string;
|
|
9
|
+
}
|
|
10
|
+
/** Descriptions read on the first and last day of `selectionRange`. */
|
|
11
|
+
export interface CalendarRangeLabels {
|
|
12
|
+
start: string;
|
|
13
|
+
end: string;
|
|
14
|
+
}
|
|
5
15
|
export interface CalendarProps extends Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'onChange'>, SxProps {
|
|
6
16
|
/** Selected date, 'YYYY-MM-DD'. */
|
|
7
17
|
value?: string;
|
|
@@ -19,11 +29,25 @@ export interface CalendarProps extends Omit<ComponentPropsWithRef<'div'>, 'defau
|
|
|
19
29
|
locale?: string;
|
|
20
30
|
/** Defaults to the locale's week start. */
|
|
21
31
|
firstDayOfWeek?: CalendarWeekday;
|
|
32
|
+
/** 'YYYY-MM-DD' marked as today. Defaults to the local civil date at render time. */
|
|
33
|
+
today?: string;
|
|
34
|
+
/** Range mode: the selected interval (null for none). Replaces `value` as the selection. */
|
|
35
|
+
selectionRange?: CalendarRange | null;
|
|
36
|
+
/** Tentative interval, decorated but not selected. */
|
|
37
|
+
previewRange?: CalendarRange | null;
|
|
38
|
+
/** Parent-owned roving tab stop; null or a date outside the shown month leaves no day tab stop. */
|
|
39
|
+
tabStopDate?: string | null;
|
|
40
|
+
/** Every native day activation (click, Enter, Space), including the selected day. */
|
|
41
|
+
onDayActivate?: (date: string) => void;
|
|
42
|
+
/** A day received focus, or a keyboard move chose its destination (possibly in another month). */
|
|
43
|
+
onFocusedDateChange?: (date: string) => void;
|
|
44
|
+
/** Range mode: endpoint descriptions for screen readers. */
|
|
45
|
+
rangeLabels?: CalendarRangeLabels;
|
|
22
46
|
}
|
|
23
47
|
/** The header renders its own month buttons and label. */
|
|
24
48
|
export type CalendarHeaderProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & SxProps;
|
|
25
49
|
export type CalendarGridProps = ComponentPropsWithRef<'table'> & SxProps;
|
|
26
|
-
declare function CalendarRoot({ ref, value: valueProp, defaultValue, onValueChange, visibleMonth: visibleMonthProp, defaultVisibleMonth, onVisibleMonthChange, min: minProp, max: maxProp, locale: localeProp, firstDayOfWeek: firstDayOfWeekProp, className, sx, ...rest }: CalendarProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
50
|
+
declare function CalendarRoot({ ref, value: valueProp, defaultValue, onValueChange, visibleMonth: visibleMonthProp, defaultVisibleMonth, onVisibleMonthChange, min: minProp, max: maxProp, locale: localeProp, firstDayOfWeek: firstDayOfWeekProp, today: todayProp, selectionRange, previewRange, tabStopDate, onDayActivate: onDayActivateProp, onFocusedDateChange: onFocusedDateChangeProp, rangeLabels, className, sx, children, ...rest }: CalendarProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
27
51
|
declare function CalendarHeader({ ref, className, sx, ...props }: CalendarHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
28
52
|
declare function CalendarGrid({ ref, onKeyDown, 'aria-labelledby': ariaLabelledByProp, 'aria-label': ariaLabelProp, className, sx, ...rest }: CalendarGridProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
29
53
|
export declare const Calendar: typeof CalendarRoot & {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Calendar } from './calendar';
|
|
2
|
-
export type { CalendarGridProps, CalendarHeaderProps, CalendarProps, CalendarWeekday } from './calendar';
|
|
2
|
+
export type { CalendarGridProps, CalendarHeaderProps, CalendarProps, CalendarRange, CalendarRangeLabels, CalendarWeekday, } from './calendar';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
|
+
import { type SxProps } from '../../styling/sx';
|
|
4
|
+
import { type ButtonProps } from '../button';
|
|
5
|
+
export type CarouselActivation = 'auto' | 'manual';
|
|
6
|
+
export interface CarouselLabels {
|
|
7
|
+
/** Name of the slide viewport. */
|
|
8
|
+
slides: string;
|
|
9
|
+
/** Name of the slide picker tablist. */
|
|
10
|
+
chooseSlide: string;
|
|
11
|
+
previous: string;
|
|
12
|
+
next: string;
|
|
13
|
+
startRotation: string;
|
|
14
|
+
stopRotation: string;
|
|
15
|
+
/** Shown when there are no slides. */
|
|
16
|
+
empty: string;
|
|
17
|
+
/** The root's aria-roledescription. */
|
|
18
|
+
carouselRole: string;
|
|
19
|
+
/** Default slide name; `index` is zero-based. */
|
|
20
|
+
slideCount: (index: number, count: number) => string;
|
|
21
|
+
}
|
|
22
|
+
type StyleSlot = {
|
|
23
|
+
css?: Interpolation<Theme>;
|
|
24
|
+
};
|
|
25
|
+
type PartSlot = Omit<ComponentPropsWithRef<'div'>, 'children' | 'role' | 'id' | 'tabIndex' | 'hidden' | 'inert'> & StyleSlot;
|
|
26
|
+
type SlideSlot = Omit<PartSlot, 'ref' | 'aria-hidden'>;
|
|
27
|
+
type IndicatorSlot = Omit<ComponentPropsWithRef<'button'>, 'ref' | 'children' | 'role' | 'id' | 'type' | 'tabIndex' | 'disabled' | 'aria-selected' | 'aria-controls' | 'aria-disabled' | 'aria-label'> & StyleSlot;
|
|
28
|
+
type ButtonSlot = Omit<ButtonProps, 'children' | 'type' | 'disabled' | 'aria-disabled' | 'render' | 'sx'>;
|
|
29
|
+
export interface CarouselSlotProps {
|
|
30
|
+
rotationButton?: ButtonSlot;
|
|
31
|
+
viewport?: PartSlot;
|
|
32
|
+
track?: PartSlot;
|
|
33
|
+
slide?: SlideSlot;
|
|
34
|
+
controls?: PartSlot;
|
|
35
|
+
tabList?: PartSlot;
|
|
36
|
+
indicator?: IndicatorSlot;
|
|
37
|
+
previousButton?: ButtonSlot;
|
|
38
|
+
nextButton?: ButtonSlot;
|
|
39
|
+
status?: PartSlot;
|
|
40
|
+
empty?: PartSlot;
|
|
41
|
+
}
|
|
42
|
+
export interface CarouselProps extends Omit<ComponentPropsWithRef<'section'>, 'defaultValue' | 'onChange'>, SxProps {
|
|
43
|
+
/** One renderable child per slide; give each a stable key. */
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
/** Active slide index (controlled). */
|
|
46
|
+
value?: number;
|
|
47
|
+
defaultValue?: number;
|
|
48
|
+
onValueChange?: (index: number) => void;
|
|
49
|
+
/** Inline size of each slide, clamped to the carousel's width. */
|
|
50
|
+
slideSize?: CSSProperties['inlineSize'];
|
|
51
|
+
/** Accessible slide name; `index` is zero-based. Defaults to `labels.slideCount`. */
|
|
52
|
+
getSlideLabel?: (index: number, count: number) => string;
|
|
53
|
+
activation?: CarouselActivation;
|
|
54
|
+
/** Rotation delay in milliseconds. Without a positive finite value there is no rotation. */
|
|
55
|
+
interval?: number;
|
|
56
|
+
/** Seeds the uncontrolled playing state on mount. */
|
|
57
|
+
autoPlay?: boolean;
|
|
58
|
+
/** Requested rotation state (controlled). Safety pauses apply on top of it. */
|
|
59
|
+
playingValue?: boolean;
|
|
60
|
+
/** Seeds the uncontrolled playing state; takes precedence over `autoPlay`. */
|
|
61
|
+
defaultPlayingValue?: boolean;
|
|
62
|
+
onPlayingValueChange?: (playing: boolean) => void;
|
|
63
|
+
locale?: Intl.LocalesArgument;
|
|
64
|
+
labels?: Partial<CarouselLabels>;
|
|
65
|
+
/** Blocks navigation and rotation; the active slide's content stays operable. */
|
|
66
|
+
disabled?: boolean;
|
|
67
|
+
slotProps?: CarouselSlotProps;
|
|
68
|
+
}
|
|
69
|
+
export declare function Carousel({ ref, children, value: valueProp, defaultValue, onValueChange, slideSize, getSlideLabel: getSlideLabelProp, activation, interval, autoPlay, playingValue, defaultPlayingValue, onPlayingValueChange, locale, labels: labelProps, disabled, slotProps, className, sx, style, role, 'aria-roledescription': roleDescription, onFocus, onBlur, onPointerEnter, onPointerLeave, ...rest }: CarouselProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
70
|
+
export declare namespace Carousel {
|
|
71
|
+
var displayName: string;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
@@ -19,7 +19,7 @@ export interface CheckboxProps extends Omit<ComponentPropsWithRef<'input'>, 'siz
|
|
|
19
19
|
description?: CheckboxPartProps;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
export declare function Checkbox({ ref, label, description, indeterminate, size, onChange, onCheckedChange, slotProps, className, sx, 'aria-labelledby': ariaLabelledByProp, 'aria-describedby': ariaDescribedByProp, ...rest }: CheckboxProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function Checkbox({ ref, label, description, indeterminate, size, onChange, onCheckedChange, slotProps, className, sx, dir, 'aria-labelledby': ariaLabelledByProp, 'aria-describedby': ariaDescribedByProp, ...rest }: CheckboxProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
23
|
export declare namespace Checkbox {
|
|
24
24
|
var displayName: string;
|
|
25
25
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
|
+
import { type SxProps } from '../../styling/sx';
|
|
4
|
+
export interface ChipGroupOption {
|
|
5
|
+
value: string;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
type StyledSlot<T extends 'div' | 'span' | 'button'> = Omit<ComponentPropsWithRef<T>, 'children' | 'role' | 'tabIndex' | 'disabled' | 'aria-disabled' | 'aria-pressed' | 'aria-expanded' | 'aria-controls'> & {
|
|
10
|
+
css?: Interpolation<Theme>;
|
|
11
|
+
};
|
|
12
|
+
export interface ChipGroupSlotProps {
|
|
13
|
+
frame?: StyledSlot<'div'>;
|
|
14
|
+
row?: StyledSlot<'div'>;
|
|
15
|
+
chip?: StyledSlot<'button'> | ((option: ChipGroupOption) => StyledSlot<'button'>);
|
|
16
|
+
label?: StyledSlot<'span'>;
|
|
17
|
+
check?: StyledSlot<'span'>;
|
|
18
|
+
overflow?: StyledSlot<'button'>;
|
|
19
|
+
}
|
|
20
|
+
interface ChipGroupBaseProps extends Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'onChange' | 'children'>, SxProps {
|
|
21
|
+
options: readonly ChipGroupOption[];
|
|
22
|
+
label?: string;
|
|
23
|
+
allowEmpty?: boolean;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
size?: 'sm' | 'md';
|
|
26
|
+
maxVisible?: number;
|
|
27
|
+
expanded?: boolean;
|
|
28
|
+
defaultExpanded?: boolean;
|
|
29
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
30
|
+
locale?: Intl.LocalesArgument;
|
|
31
|
+
moreLabel?: (formattedCount: string, count: number) => string;
|
|
32
|
+
lessLabel?: string;
|
|
33
|
+
slotProps?: ChipGroupSlotProps;
|
|
34
|
+
}
|
|
35
|
+
export interface ChipGroupSingleProps extends ChipGroupBaseProps {
|
|
36
|
+
type: 'single';
|
|
37
|
+
value?: string;
|
|
38
|
+
defaultValue?: string;
|
|
39
|
+
onValueChange?: (value: string) => void;
|
|
40
|
+
}
|
|
41
|
+
export interface ChipGroupMultipleProps extends ChipGroupBaseProps {
|
|
42
|
+
type?: 'multiple';
|
|
43
|
+
value?: readonly string[];
|
|
44
|
+
defaultValue?: readonly string[];
|
|
45
|
+
onValueChange?: (value: string[]) => void;
|
|
46
|
+
}
|
|
47
|
+
export type ChipGroupProps = ChipGroupSingleProps | ChipGroupMultipleProps;
|
|
48
|
+
/** Clearable pressed-button filters. Arrows (horizontal RTL-aware), Home/End move focus only;
|
|
49
|
+
* Enter/Space toggle. Multiple values are emitted in option order, not activation order. */
|
|
50
|
+
export declare function ChipGroup({ ref, options, type, value: valueProp, defaultValue, onValueChange, label, allowEmpty, disabled, size, maxVisible, expanded: expandedProp, defaultExpanded, onExpandedChange, locale, moreLabel, lessLabel, slotProps, className, sx, onKeyDown, onBlur, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...rest }: ChipGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare namespace ChipGroup {
|
|
52
|
+
var displayName: string;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChipGroup, type ChipGroupProps, type ChipGroupOption, type ChipGroupSingleProps, type ChipGroupMultipleProps, type ChipGroupSlotProps, } from './chip-group';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type Ref } from 'react';
|
|
2
|
+
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
|
+
import { type SxProps } from '../../styling/sx';
|
|
4
|
+
import { type CopyButtonProps } from '../copy-button';
|
|
5
|
+
export interface CodeBlockSlotPartProps {
|
|
6
|
+
className?: string;
|
|
7
|
+
css?: Interpolation<Theme>;
|
|
8
|
+
}
|
|
9
|
+
export interface CodeBlockSlotProps {
|
|
10
|
+
header?: CodeBlockSlotPartProps;
|
|
11
|
+
label?: CodeBlockSlotPartProps;
|
|
12
|
+
language?: CodeBlockSlotPartProps;
|
|
13
|
+
sourceFrame?: CodeBlockSlotPartProps;
|
|
14
|
+
gutter?: CodeBlockSlotPartProps;
|
|
15
|
+
pre?: CodeBlockSlotPartProps;
|
|
16
|
+
code?: CodeBlockSlotPartProps;
|
|
17
|
+
toggle?: CodeBlockSlotPartProps;
|
|
18
|
+
}
|
|
19
|
+
export interface CodeHighlightToken {
|
|
20
|
+
content: string;
|
|
21
|
+
/** Any CSS color; token references (`vars.color.syntax*`) follow the theme. */
|
|
22
|
+
color?: string;
|
|
23
|
+
fontStyle?: 'normal' | 'italic';
|
|
24
|
+
}
|
|
25
|
+
/** One token list per source line, without line terminators. */
|
|
26
|
+
export type CodeHighlightLines = readonly (readonly CodeHighlightToken[])[];
|
|
27
|
+
export interface CodeHighlightRequest {
|
|
28
|
+
code: string;
|
|
29
|
+
language?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Tokenizes `code`; `null` (e.g. an unsupported language) keeps plain text. */
|
|
32
|
+
export type CodeHighlightLoader = (request: CodeHighlightRequest) => CodeHighlightLines | null | PromiseLike<CodeHighlightLines | null>;
|
|
33
|
+
export interface CodeBlockProps extends Omit<ComponentPropsWithRef<'section'>, 'children' | 'onChange'>, SxProps {
|
|
34
|
+
code: string;
|
|
35
|
+
filename?: string;
|
|
36
|
+
language?: string;
|
|
37
|
+
label?: string;
|
|
38
|
+
sourceLabel?: string;
|
|
39
|
+
maxLines?: number;
|
|
40
|
+
open?: boolean;
|
|
41
|
+
defaultOpen?: boolean;
|
|
42
|
+
onOpenChange?: (open: boolean) => void;
|
|
43
|
+
lineNumbers?: boolean;
|
|
44
|
+
locale?: Intl.LocalesArgument;
|
|
45
|
+
getExpandLabel?: (count: number, formatted: string) => string;
|
|
46
|
+
collapseLabel?: string;
|
|
47
|
+
copyable?: boolean;
|
|
48
|
+
copyButtonProps?: Partial<Omit<CopyButtonProps, 'text' | 'ref'>>;
|
|
49
|
+
preRef?: Ref<HTMLPreElement>;
|
|
50
|
+
/** Syntax highlighting loader, read when `code` or `language` changes. */
|
|
51
|
+
highlight?: CodeHighlightLoader;
|
|
52
|
+
slotProps?: CodeBlockSlotProps;
|
|
53
|
+
css?: Interpolation<Theme>;
|
|
54
|
+
}
|
|
55
|
+
export declare function CodeBlock({ ref, code, filename, language, label, sourceLabel, maxLines, open, defaultOpen, onOpenChange, lineNumbers, locale, getExpandLabel, collapseLabel, copyable, copyButtonProps, preRef, highlight, slotProps, className, sx, 'aria-label': ariaLabel, 'aria-labelledby': labelledBy, ...rest }: CodeBlockProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
56
|
+
export declare namespace CodeBlock {
|
|
57
|
+
var displayName: string;
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CodeBlock, type CodeBlockProps, type CodeBlockSlotProps, type CodeBlockSlotPartProps, type CodeHighlightLines, type CodeHighlightLoader, type CodeHighlightRequest, type CodeHighlightToken, } from './code-block';
|
|
@@ -35,7 +35,7 @@ export interface ComboboxItemProps extends ComponentPropsWithRef<'div'>, SxProps
|
|
|
35
35
|
}
|
|
36
36
|
export interface ComboboxEmptyProps extends ComponentPropsWithRef<'div'>, SxProps {
|
|
37
37
|
}
|
|
38
|
-
declare function ComboboxRoot(
|
|
38
|
+
declare function ComboboxRoot(props: ComboboxProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
39
39
|
declare function ComboboxInput({ ref, inputValue, defaultInputValue, label, description, error, size, slotProps, className, sx, id: idProp, onChange, onKeyDown, onBlur, disabled, ...rest }: ComboboxInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
40
40
|
declare function ComboboxList({ ref, id: idProp, style, onMouseDown, children, className, sx, ...rest }: ComboboxListProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
41
41
|
declare function ComboboxItem({ ref, value, disabled, onClick, children, className, sx, ...rest }: ComboboxItemProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -35,14 +35,14 @@ export interface CommandPaletteItemProps extends Omit<ComponentPropsWithRef<'div
|
|
|
35
35
|
/** Extra text the filter matches against (synonyms, aliases). */
|
|
36
36
|
keywords?: string;
|
|
37
37
|
}
|
|
38
|
-
declare function CommandPaletteRoot(
|
|
38
|
+
declare function CommandPaletteRoot(props: CommandPaletteProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
39
39
|
declare function CommandPaletteTrigger({ ref, onClick, className, sx, ...rest }: CommandPaletteTriggerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
40
40
|
declare function CommandPaletteContent({ ref, className, sx, ...props }: CommandPaletteContentProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
41
41
|
declare function CommandPaletteInput({ ref, onChange, onKeyDown, className, sx, ...rest }: CommandPaletteInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
42
42
|
declare function CommandPaletteList({ ref, onMouseDown, children, className, sx, ...rest }: CommandPaletteListProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
43
43
|
declare function CommandPaletteEmpty({ ref, children, className, sx, ...rest }: CommandPaletteEmptyProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
44
44
|
declare function CommandPaletteGroup({ ref, label, children, 'aria-labelledby': externalLabelledBy, className, sx, ...rest }: CommandPaletteGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
45
|
-
declare function CommandPaletteItem({ ref, value, onSelect, keywords, onClick, children, className, sx, ...rest }: CommandPaletteItemProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
45
|
+
declare function CommandPaletteItem({ ref, value, onSelect, keywords, 'aria-disabled': ariaDisabled, onClick, children, className, sx, ...rest }: CommandPaletteItemProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
46
46
|
export declare const CommandPalette: typeof CommandPaletteRoot & {
|
|
47
47
|
Trigger: typeof CommandPaletteTrigger;
|
|
48
48
|
Content: typeof CommandPaletteContent;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
+
import { type SxProps } from '../../styling/sx';
|
|
3
|
+
import { type ThreadAuthor, type ThreadComment, type ThreadReaction } from './thread-core';
|
|
4
|
+
import { type ThreadButtonProps, type ThreadPartProps, type ThreadReactionLabels, type ThreadSize, type ThreadTextareaProps } from './thread-parts';
|
|
5
|
+
export type { ThreadComment } from './thread-core';
|
|
6
|
+
export type CommentAuthor = ThreadAuthor;
|
|
7
|
+
export type CommentReaction = ThreadReaction;
|
|
8
|
+
export type CommentThreadSize = ThreadSize;
|
|
9
|
+
export type CommentThreadHeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
10
|
+
export type CommentThreadPartProps = ThreadPartProps;
|
|
11
|
+
/** What a proposed tree changes; `parentId` is where a reply actually attached after `maxDepth`. */
|
|
12
|
+
export type CommentThreadEvent = {
|
|
13
|
+
type: 'reply';
|
|
14
|
+
comment: ThreadComment;
|
|
15
|
+
parentId: string | null;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'edit';
|
|
18
|
+
id: string;
|
|
19
|
+
body: string;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'delete';
|
|
22
|
+
id: string;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'react';
|
|
25
|
+
id: string;
|
|
26
|
+
emoji: string;
|
|
27
|
+
added: boolean;
|
|
28
|
+
};
|
|
29
|
+
export interface CommentThreadLabels extends ThreadReactionLabels {
|
|
30
|
+
/** Region name when there is no `title`, `aria-label` or `aria-labelledby`. */
|
|
31
|
+
thread: string;
|
|
32
|
+
/** Accessible name of the new-comment field. */
|
|
33
|
+
composer: string;
|
|
34
|
+
placeholder: string;
|
|
35
|
+
resolve: string;
|
|
36
|
+
resolved: string;
|
|
37
|
+
reopen: string;
|
|
38
|
+
empty: string;
|
|
39
|
+
reply: string;
|
|
40
|
+
edit: string;
|
|
41
|
+
delete: string;
|
|
42
|
+
cancel: string;
|
|
43
|
+
send: string;
|
|
44
|
+
save: string;
|
|
45
|
+
edited: string;
|
|
46
|
+
/** Accessible name of the edit field. */
|
|
47
|
+
editComment: string;
|
|
48
|
+
/** Prompt that names the inline delete confirmation. */
|
|
49
|
+
deleteConfirm: string;
|
|
50
|
+
deletedText: string;
|
|
51
|
+
/** Name of a deleted comment's article. */
|
|
52
|
+
deletedComment: string;
|
|
53
|
+
hideReplies: string;
|
|
54
|
+
cancelReply: string;
|
|
55
|
+
/** Name of the mention suggestions list. */
|
|
56
|
+
mentions: string;
|
|
57
|
+
invalidTime: string;
|
|
58
|
+
/** Accessible name of a reply field. */
|
|
59
|
+
replyingTo: (name: string) => string;
|
|
60
|
+
showReplies: (count: number) => string;
|
|
61
|
+
commentCount: (count: number) => string;
|
|
62
|
+
peopleCount: (count: number) => string;
|
|
63
|
+
/** Announced when comments from others arrive. */
|
|
64
|
+
newComments: (count: number) => string;
|
|
65
|
+
}
|
|
66
|
+
type CommentThreadPart = 'header' | 'title' | 'list' | 'item' | 'article' | 'time' | 'body' | 'replies' | 'actions' | 'reaction' | 'composer' | 'resolved' | 'status';
|
|
67
|
+
export type CommentThreadSlotProps = Partial<Record<CommentThreadPart, CommentThreadPartProps>> & {
|
|
68
|
+
/** Extra Textarea props for every composer and editor; handlers are composed with the thread's. */
|
|
69
|
+
textarea?: ThreadTextareaProps;
|
|
70
|
+
/** Extra Button props for every Send/Save button; `onClick` runs first and may `preventDefault()`. */
|
|
71
|
+
send?: ThreadButtonProps;
|
|
72
|
+
};
|
|
73
|
+
export interface CommentThreadProps extends Omit<ComponentPropsWithRef<'section'>, 'defaultValue' | 'onChange' | 'children' | 'title'>, SxProps {
|
|
74
|
+
/** Comment tree (controlled). Treated as immutable. */
|
|
75
|
+
value?: readonly ThreadComment[];
|
|
76
|
+
defaultValue?: readonly ThreadComment[];
|
|
77
|
+
/** The full proposed tree plus what changed. */
|
|
78
|
+
onValueChange?: (next: ThreadComment[], event: CommentThreadEvent) => void;
|
|
79
|
+
/** Whose comments are editable; authorization stays on the server. */
|
|
80
|
+
currentUser: CommentAuthor;
|
|
81
|
+
/** Mention candidates; defaults to every author plus `currentUser`. Deduped by id. */
|
|
82
|
+
people?: readonly CommentAuthor[];
|
|
83
|
+
resolvedValue?: boolean;
|
|
84
|
+
defaultResolvedValue?: boolean;
|
|
85
|
+
onResolvedValueChange?: (resolved: boolean) => void;
|
|
86
|
+
/** Ids whose replies are shown (controlled). */
|
|
87
|
+
expandedValue?: readonly string[];
|
|
88
|
+
/** Defaults to every comment that has replies at first render. */
|
|
89
|
+
defaultExpandedValue?: readonly string[];
|
|
90
|
+
onExpandedValueChange?: (ids: string[]) => void;
|
|
91
|
+
title?: ReactNode;
|
|
92
|
+
headingLevel?: CommentThreadHeadingLevel;
|
|
93
|
+
/** Emoji offered by the picker, deduped; `[]` removes the picker. */
|
|
94
|
+
reactions?: readonly string[];
|
|
95
|
+
/** Maximum reply edges below a root comment; deeper replies attach to the deepest allowed ancestor. */
|
|
96
|
+
maxDepth?: number;
|
|
97
|
+
/** Reference instant in epoch ms for relative times. Pass the same value on server and client. */
|
|
98
|
+
now: number;
|
|
99
|
+
locale?: Intl.LocalesArgument;
|
|
100
|
+
/** IANA zone for full dates. */
|
|
101
|
+
timeZone?: string;
|
|
102
|
+
/** Id for a newly submitted comment; called once per accepted submit interaction. */
|
|
103
|
+
getNewId?: () => string;
|
|
104
|
+
placeholder?: string;
|
|
105
|
+
/** Accessible name of the new-comment field; defaults to `labels.composer`. */
|
|
106
|
+
composerLabel?: string;
|
|
107
|
+
/** Blocks every mutation. */
|
|
108
|
+
disabled?: boolean;
|
|
109
|
+
/** Hides mutation controls; reply disclosure still works. */
|
|
110
|
+
readOnly?: boolean;
|
|
111
|
+
size?: CommentThreadSize;
|
|
112
|
+
labels?: Partial<CommentThreadLabels>;
|
|
113
|
+
slotProps?: CommentThreadSlotProps;
|
|
114
|
+
}
|
|
115
|
+
export declare function CommentThread({ ref, value, defaultValue, onValueChange, currentUser, people: peopleProp, resolvedValue, defaultResolvedValue, onResolvedValueChange, expandedValue, defaultExpandedValue, onExpandedValueChange, title, headingLevel, reactions: offeredProp, maxDepth: maxDepthProp, now, locale, timeZone, getNewId, placeholder, composerLabel, disabled, readOnly, size, labels: labelProps, slotProps, className, sx, onFocus, onBlur, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, ...rest }: CommentThreadProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
116
|
+
export declare namespace CommentThread {
|
|
117
|
+
var displayName: string;
|
|
118
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CommentThread, type CommentAuthor, type CommentReaction, type CommentThreadEvent, type CommentThreadHeadingLevel, type CommentThreadLabels, type CommentThreadPartProps, type CommentThreadProps, type CommentThreadSize, type CommentThreadSlotProps, type ThreadComment, } from './comment-thread';
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export interface ThreadAuthor {
|
|
2
|
+
/** Stable identity: ownership, reactions and mention candidates compare it. */
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
/** Portrait URL; initials are shown without it. */
|
|
6
|
+
avatar?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ThreadReaction {
|
|
9
|
+
emoji: string;
|
|
10
|
+
/** Ids of the people who reacted. */
|
|
11
|
+
users: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
/** Epoch ms, a Date, or an ISO date-time with `Z` or an explicit offset. */
|
|
14
|
+
export type ThreadTimestamp = Date | string | number;
|
|
15
|
+
export interface ThreadMessage {
|
|
16
|
+
/** Unique, stable identity across updates. */
|
|
17
|
+
id: string;
|
|
18
|
+
author: ThreadAuthor;
|
|
19
|
+
/** Plain text, rendered as escaped text with its line breaks. */
|
|
20
|
+
body: string;
|
|
21
|
+
createdAt: ThreadTimestamp;
|
|
22
|
+
edited?: boolean;
|
|
23
|
+
deleted?: boolean;
|
|
24
|
+
reactions?: readonly ThreadReaction[];
|
|
25
|
+
}
|
|
26
|
+
export interface ThreadComment extends ThreadMessage {
|
|
27
|
+
replies?: readonly ThreadComment[];
|
|
28
|
+
}
|
|
29
|
+
export interface ThreadEntry {
|
|
30
|
+
comment: ThreadComment;
|
|
31
|
+
parentId: string | null;
|
|
32
|
+
/** Reply edges below a root comment; roots are 0. */
|
|
33
|
+
depth: number;
|
|
34
|
+
}
|
|
35
|
+
export interface ThreadIndex {
|
|
36
|
+
entries: ReadonlyMap<string, ThreadEntry>;
|
|
37
|
+
/** Ids in reading (depth-first) order. */
|
|
38
|
+
order: readonly string[];
|
|
39
|
+
duplicates: readonly string[];
|
|
40
|
+
/** True when a comment appears among its own replies; the repeat is skipped. */
|
|
41
|
+
cyclic: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface ThreadFormatters {
|
|
44
|
+
relative: Intl.RelativeTimeFormat;
|
|
45
|
+
full: Intl.DateTimeFormat;
|
|
46
|
+
number: Intl.NumberFormat;
|
|
47
|
+
plural: Intl.PluralRules;
|
|
48
|
+
/** Joins names ("Ada and Grace"). */
|
|
49
|
+
people: Intl.ListFormat;
|
|
50
|
+
/** Joins short facts ("4 comments, 2 people"). */
|
|
51
|
+
facts: Intl.ListFormat;
|
|
52
|
+
}
|
|
53
|
+
export declare const DEFAULT_TIME_ZONE = "UTC";
|
|
54
|
+
export declare const validEpoch: (epoch: number) => boolean;
|
|
55
|
+
export declare function toEpoch(value: ThreadTimestamp): number | null;
|
|
56
|
+
/** Signed relative text ("5 minutes ago", "in 2 days", "now") from the caller-owned clock. */
|
|
57
|
+
export declare function relativeTime(epoch: number, now: number, format: Intl.RelativeTimeFormat): string;
|
|
58
|
+
/** Formatters for the requested locale and zone; unusable values fall back and are reported. */
|
|
59
|
+
export declare function resolveFormatters(owner: string, locale: Intl.LocalesArgument, timeZone: string): {
|
|
60
|
+
formatters: ThreadFormatters;
|
|
61
|
+
problems: string[];
|
|
62
|
+
};
|
|
63
|
+
/** "1 reply" / "3 replies" through the locale's plural rules and digits. */
|
|
64
|
+
export declare const formatCount: (format: ThreadFormatters, count: number, one: string, other: string) => string;
|
|
65
|
+
/** Every comment by id with its parent and depth; repeated ids keep their first occurrence. */
|
|
66
|
+
export declare function indexThread(roots: readonly ThreadComment[]): ThreadIndex;
|
|
67
|
+
/**
|
|
68
|
+
* Replaces (or, for `null`, removes) the first comment with `id`, copying only the path to it.
|
|
69
|
+
* Returns the same array when nothing changed, so callers can skip no-op events.
|
|
70
|
+
*/
|
|
71
|
+
export declare function updateComment(comments: readonly ThreadComment[], id: string, update: (comment: ThreadComment) => ThreadComment | null, path?: ReadonlySet<ThreadComment>): readonly ThreadComment[];
|
|
72
|
+
/**
|
|
73
|
+
* The comment a reply to `parentId` attaches to: the parent itself while the reply stays within
|
|
74
|
+
* `maxDepth` reply edges, otherwise its ancestor at depth `maxDepth - 1`; `null` adds a root
|
|
75
|
+
* comment (always for `maxDepth` 0). `undefined` when the parent is unknown.
|
|
76
|
+
*/
|
|
77
|
+
export declare function resolveReplyParent(index: ThreadIndex, parentId: string | null, maxDepth: number): string | null | undefined;
|
|
78
|
+
export declare function appendComment(comments: readonly ThreadComment[], parentId: string | null, comment: ThreadComment): readonly ThreadComment[];
|
|
79
|
+
/** New body for a live comment; unchanged or deleted comments are left alone. */
|
|
80
|
+
export declare function editComment(comments: readonly ThreadComment[], id: string, body: string): readonly ThreadComment[];
|
|
81
|
+
/**
|
|
82
|
+
* A leaf disappears; a comment with replies becomes a tombstone that keeps its id, author, time
|
|
83
|
+
* and replies but drops its body and reactions.
|
|
84
|
+
*/
|
|
85
|
+
export declare function deleteComment(comments: readonly ThreadComment[], id: string): readonly ThreadComment[];
|
|
86
|
+
/** Adds or removes `userId` from the `emoji` reaction; empty reactions are dropped. */
|
|
87
|
+
export declare function toggleReaction(reactions: readonly ThreadReaction[], emoji: string, userId: string): {
|
|
88
|
+
reactions: ThreadReaction[];
|
|
89
|
+
added: boolean;
|
|
90
|
+
};
|
|
91
|
+
export declare function reactToComment(comments: readonly ThreadComment[], id: string, emoji: string, userId: string): {
|
|
92
|
+
comments: readonly ThreadComment[];
|
|
93
|
+
added: boolean;
|
|
94
|
+
};
|
|
95
|
+
/** First occurrence of each value, keyed by `key`. */
|
|
96
|
+
export declare function uniqueBy<T>(items: readonly T[], key: (item: T) => string): T[];
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { type KeyboardEvent, type ReactNode } from 'react';
|
|
2
|
+
import { type Interpolation, type SerializedStyles, type Theme } from '../../styling/css';
|
|
3
|
+
import { type ButtonProps } from '../button';
|
|
4
|
+
import { type TextareaProps } from '../textarea';
|
|
5
|
+
import { type ThreadAuthor, type ThreadFormatters, type ThreadReaction } from './thread-core';
|
|
6
|
+
export type ThreadSize = 'sm' | 'md';
|
|
7
|
+
export interface ThreadPartProps {
|
|
8
|
+
className?: string;
|
|
9
|
+
css?: Interpolation<Theme>;
|
|
10
|
+
}
|
|
11
|
+
/** Textarea props a consumer may add; the thread owns value, change and mention wiring. */
|
|
12
|
+
export type ThreadTextareaProps = Omit<TextareaProps, 'value' | 'defaultValue' | 'onValueChange' | 'label' | 'children'>;
|
|
13
|
+
/** Button props a consumer may add to a submit button; the thread owns its label and state. */
|
|
14
|
+
export type ThreadButtonProps = Omit<ButtonProps, 'children' | 'loading' | 'type' | 'render'>;
|
|
15
|
+
export declare const isComposing: (event: KeyboardEvent<HTMLElement>) => boolean;
|
|
16
|
+
export interface ThreadTimeProps {
|
|
17
|
+
epoch: number | null;
|
|
18
|
+
/** Caller-owned clock; `null` shows the full date instead of a relative one. */
|
|
19
|
+
now: number | null;
|
|
20
|
+
formatters: ThreadFormatters;
|
|
21
|
+
invalidLabel: string;
|
|
22
|
+
id: string;
|
|
23
|
+
/** Id of the hidden full date, for the message's `aria-describedby`. */
|
|
24
|
+
fullId: string;
|
|
25
|
+
ui: string;
|
|
26
|
+
part?: ThreadPartProps;
|
|
27
|
+
}
|
|
28
|
+
export declare function ThreadTime({ epoch, now, formatters, invalidLabel, id, fullId, ui: owner, part }: ThreadTimeProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
29
|
+
export interface ThreadMessageViewProps {
|
|
30
|
+
ui: string;
|
|
31
|
+
author: ThreadAuthor;
|
|
32
|
+
/** Replaces the author/time name, e.g. for a deleted message. */
|
|
33
|
+
label?: string;
|
|
34
|
+
epoch: number | null;
|
|
35
|
+
now: number | null;
|
|
36
|
+
formatters: ThreadFormatters;
|
|
37
|
+
invalidTimeLabel: string;
|
|
38
|
+
/** Text after the time, e.g. "(edited)". */
|
|
39
|
+
meta?: ReactNode;
|
|
40
|
+
size: ThreadSize;
|
|
41
|
+
baseId: string;
|
|
42
|
+
messageId: string;
|
|
43
|
+
/** Body, editor and footer rows. */
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
slots?: {
|
|
46
|
+
article?: ThreadPartProps;
|
|
47
|
+
time?: ThreadPartProps;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export declare function ThreadMessageView({ ui: owner, author, label, epoch, now, formatters, invalidTimeLabel, meta, size, baseId, messageId, children, slots, }: ThreadMessageViewProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
51
|
+
export interface ThreadReactionLabels {
|
|
52
|
+
addReaction: string;
|
|
53
|
+
closeReactions: string;
|
|
54
|
+
reactions: string;
|
|
55
|
+
reactWith: (emoji: string) => string;
|
|
56
|
+
reactionCount: (emoji: string, count: number, mine: boolean) => string;
|
|
57
|
+
}
|
|
58
|
+
export interface ThreadReactionsProps {
|
|
59
|
+
ui: string;
|
|
60
|
+
reactions: readonly ThreadReaction[];
|
|
61
|
+
/** Emoji offered by the picker; empty hides the picker. */
|
|
62
|
+
offered: readonly string[];
|
|
63
|
+
currentUserId: string;
|
|
64
|
+
formatters: ThreadFormatters;
|
|
65
|
+
labels: ThreadReactionLabels;
|
|
66
|
+
/** Mutations hidden: chips render as text. */
|
|
67
|
+
readOnly: boolean;
|
|
68
|
+
disabled: boolean;
|
|
69
|
+
pickerOpen: boolean;
|
|
70
|
+
onPickerOpenChange: (open: boolean) => void;
|
|
71
|
+
onToggle: (emoji: string) => void;
|
|
72
|
+
pickerId: string;
|
|
73
|
+
part?: ThreadPartProps;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Picker keyboard: Left/Right (mirrored in RTL) wrap across the emoji, Home/End jump; Escape and
|
|
77
|
+
* a chosen emoji close it and return focus to the add button. Pressing outside leaves it open.
|
|
78
|
+
*/
|
|
79
|
+
export declare function ThreadReactions({ ui: owner, reactions, offered, currentUserId, formatters, labels, readOnly, disabled, pickerOpen, onPickerOpenChange, onToggle, pickerId, part, }: ThreadReactionsProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
80
|
+
export interface ThreadComposerProps {
|
|
81
|
+
ui: string;
|
|
82
|
+
draft: string;
|
|
83
|
+
onDraftChange: (draft: string) => void;
|
|
84
|
+
/** Called with the trimmed text for a non-empty, non-pending submit. */
|
|
85
|
+
onSubmit: (text: string, container: HTMLElement) => void;
|
|
86
|
+
/** The cancel button, and Escape (with no suggestions open) unless `cancelOnEscape` is false. */
|
|
87
|
+
onCancel?: (container: HTMLElement) => void;
|
|
88
|
+
cancelOnEscape?: boolean;
|
|
89
|
+
/** Shows the cancel button. */
|
|
90
|
+
cancelable: boolean;
|
|
91
|
+
label: string;
|
|
92
|
+
placeholder?: string;
|
|
93
|
+
submitLabel: string;
|
|
94
|
+
cancelLabel: string;
|
|
95
|
+
mentionsLabel: string;
|
|
96
|
+
people: readonly ThreadAuthor[];
|
|
97
|
+
locale: Intl.LocalesArgument;
|
|
98
|
+
disabled: boolean;
|
|
99
|
+
/** A submit is waiting for its parent to accept it; further submits are ignored. */
|
|
100
|
+
pending: boolean;
|
|
101
|
+
/** Focus the field on mount; only set when a user action opened this composer. */
|
|
102
|
+
autoFocus?: boolean;
|
|
103
|
+
size: ThreadSize;
|
|
104
|
+
/** Decorative portrait shown at inline-start. */
|
|
105
|
+
author?: ThreadAuthor;
|
|
106
|
+
textareaProps?: ThreadTextareaProps;
|
|
107
|
+
submitProps?: ThreadButtonProps;
|
|
108
|
+
part?: ThreadPartProps;
|
|
109
|
+
/** Distinguishes composers inside one thread (`data-composer`). */
|
|
110
|
+
kind: string;
|
|
111
|
+
}
|
|
112
|
+
/** Per-size layout variables read by the parts; the owning root applies them. */
|
|
113
|
+
export declare const threadSizeStyles: Record<ThreadSize, SerializedStyles>;
|
|
114
|
+
export declare function ThreadComposer({ ui: owner, draft, onDraftChange, onSubmit, onCancel, cancelOnEscape, cancelable, label, placeholder, submitLabel, cancelLabel, mentionsLabel, people, locale, disabled, pending, autoFocus, size, author, textareaProps, submitProps, part, kind, }: ThreadComposerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|