@jfrader/ui 0.5.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/dist/accordion-DLul6vIl.js +205 -0
- package/dist/accordion.js +1 -1
- package/dist/{announcement-bar-B58xempt.js → announcement-bar-Dlbq5-9D.js} +1 -1
- package/dist/announcement-bar.js +1 -1
- package/dist/avatar-CaGJHy1N.js +145 -0
- package/dist/{avatar-group-DOQQuV51.js → avatar-group-M1opAQEG.js} +1 -1
- package/dist/avatar-group.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge-CjM5Agqk.js +119 -0
- package/dist/badge.js +1 -1
- package/dist/{bottom-sheet-DPJBFkie.js → bottom-sheet-DjZOPq4k.js} +10 -9
- package/dist/bottom-sheet.js +1 -1
- package/dist/{breadcrumbs-Cfw_hgt2.js → breadcrumbs-BDK_LiwH.js} +10 -3
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-C92uYFJW.js → button-NLY0h6EJ.js} +7 -7
- package/dist/button.js +1 -1
- package/dist/{calendar-B3Svu0X2.js → calendar-BzJdv_SZ.js} +3 -1
- 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 +1 -1
- package/dist/{checkbox-cFquiSdy.js → checkbox-DKSzExj2.js} +16 -15
- package/dist/checkbox.js +1 -1
- package/dist/{chip-group-DTQd_M-G.js → chip-group-DjQ0_6Y9.js} +2 -1
- package/dist/chip-group.js +1 -1
- package/dist/{code-block-ahnRi-g8.js → code-block-B5we2lZa.js} +75 -74
- package/dist/code-block.js +1 -1
- package/dist/{combobox-Bhzvu9ma.js → combobox-DFFqOBCi.js} +114 -109
- 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-ByiA6D3R.js → copy-button-DCSLcYS-.js} +1 -1
- package/dist/copy-button.js +1 -1
- package/dist/{date-picker-5zKSSuFF.js → date-picker-BiPN7yeK.js} +4 -4
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-DQpUeKqV.js +570 -0
- package/dist/date-range-picker.js +1 -1
- package/dist/{dialog-ciiv9H2b.js → dialog-BX1zYMs-.js} +2 -1
- package/dist/dialog.js +1 -1
- package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
- package/dist/divider.js +1 -1
- package/dist/elastic-slider-BG6K019r.js +395 -0
- package/dist/elastic-slider.js +2 -0
- package/dist/{expandable-card-C-qJcZ14.js → expandable-card-rUATve0o.js} +8 -1
- package/dist/expandable-card.js +1 -1
- package/dist/expanding-search-BxOwtdwt.js +238 -0
- package/dist/expanding-search.js +2 -0
- package/dist/file-dropzone-BuXm3Tea.js +457 -0
- package/dist/file-dropzone.js +1 -1
- package/dist/{filter-toolbar-D5KEKTSe.js → filter-toolbar-Cy5Hqur-.js} +4 -2
- package/dist/filter-toolbar.js +1 -1
- package/dist/{hover-card-B-nrCIy2.js → hover-card-CoMJKg1g.js} +7 -7
- package/dist/hover-card.js +1 -1
- package/dist/{image-compare-ciuhPtQZ.js → image-compare-BxY8Ykzt.js} +1 -1
- package/dist/image-compare.js +1 -1
- package/dist/index.js +81 -76
- package/dist/{json-viewer-BcySQfjZ.js → json-viewer-DgWqyU75.js} +7 -3
- package/dist/json-viewer.js +1 -1
- package/dist/mention-input-sq61si9L.js +600 -0
- package/dist/mention-input.js +1 -1
- package/dist/menu-DDKgmK2F.js +295 -0
- package/dist/menu.js +1 -1
- package/dist/{metric-card-Bh9K4fZs.js → metric-card--lVTz5Wn.js} +2 -2
- package/dist/metric-card.js +1 -1
- package/dist/{multi-select-Pce_IYnz.js → multi-select-DG1BCFX7.js} +14 -6
- package/dist/multi-select.js +1 -1
- package/dist/{navigation-sP5fiuQS.js → navigation-CC26JDr-.js} +20 -14
- package/dist/navigation.js +1 -1
- package/dist/{overlay-layer-SeUyyEPD.js → overlay-layer-qEbpEtb8.js} +16 -2
- package/dist/{pagination-DmXZ8E85.js → pagination-BfkeWbmP.js} +23 -22
- package/dist/pagination.js +1 -1
- 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-CbOWBUdA.js → progress-DAQkfhPd.js} +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radio-cards-D2QZENI_.js → radio-cards-Cu9cBssN.js} +35 -34
- package/dist/radio-cards.js +1 -1
- package/dist/{radio-group-E6mMRgo7.js → radio-group-TIK0-iPX.js} +18 -15
- package/dist/radio-group.js +1 -1
- package/dist/{resizable-panels-BhjUVXZZ.js → resizable-panels-DUpQEpwG.js} +3 -2
- package/dist/resizable-panels.js +1 -1
- package/dist/{search-field-IxF0IJXm.js → search-field-DMvho0KQ.js} +2 -2
- package/dist/search-field.js +1 -1
- package/dist/{segmented-control-yO1K1nbi.js → segmented-control-8ZUGnsZm.js} +2 -1
- package/dist/segmented-control.js +1 -1
- package/dist/{select-n_H52W1Z.js → select-D5rhJ8gi.js} +3 -2
- package/dist/select.js +1 -1
- package/dist/{signature-pad-q2SAsrdD.js → signature-pad-_bTeguN9.js} +256 -251
- package/dist/signature-pad.js +1 -1
- package/dist/slider-DVG6-Awh.js +308 -0
- package/dist/slider.js +1 -1
- package/dist/{sortable-data-table-tirqlLY2.js → sortable-data-table-CYKT_Ng7.js} +2 -2
- package/dist/sortable-data-table.js +1 -1
- package/dist/{split-button-Cb3EHs64.js → split-button-BCw4zZom.js} +75 -81
- package/dist/split-button.js +1 -1
- package/dist/{swipe-actions-DiZC57-3.js → swipe-actions-CBuJREU1.js} +4 -2
- package/dist/swipe-actions.js +1 -1
- 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/{text-field-C8TWG-tY.js → text-field-hU72iSVS.js} +15 -13
- package/dist/text-field.js +1 -1
- package/dist/{textarea-BrW0XcG_.js → textarea-3k4Y0QQ3.js} +18 -16
- 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-Db8D49cP.js → time-picker-CPlhW0tr.js} +26 -20
- package/dist/time-picker.js +1 -1
- package/dist/{timeline-k3nURuCP.js → timeline-B0uAAVfT.js} +8 -2
- package/dist/timeline.js +1 -1
- package/dist/{toast-BHxI32ZA.js → toast-B7wo3sX1.js} +98 -79
- package/dist/{toast-stack-DqrAzdg5.js → toast-stack-B40VpS4M.js} +18 -4
- package/dist/toast-stack.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-fcjzpifI.js → toggle-group-B2fpFZwV.js} +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-BvgVTCTN.js +120 -0
- package/dist/tooltip.js +1 -1
- package/dist/{tree-view-C2liIxqy.js → tree-view-j8qLqkb_.js} +5 -1
- package/dist/tree-view.js +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +1 -1
- 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/date-range-picker/date-range-picker.d.ts +1 -1
- 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/expanding-search/expanding-search.d.ts +22 -0
- package/dist/types/components/expanding-search/index.d.ts +1 -0
- package/dist/types/components/menu/menu.d.ts +50 -7
- package/dist/types/components/pagination/pagination.d.ts +1 -1
- package/dist/types/components/radio-cards/radio-cards.d.ts +1 -1
- package/dist/types/components/radio-group/radio-group.d.ts +1 -1
- package/dist/types/components/slider/slider-style.d.ts +14 -0
- package/dist/types/components/slider/slider.d.ts +2 -10
- package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
- package/dist/types/components/split-button/split-button.d.ts +2 -2
- package/dist/types/components/tabs/tabs.d.ts +1 -1
- 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/tooltip/tooltip.d.ts +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/overlay/overlay-layer.d.ts +20 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +9 -2
- package/dist/{use-overlay-floating-DvJifLpF.js → use-overlay-floating-Bx2jBKAA.js} +8 -6
- package/dist/use-slider-interaction-ChL-208h.js +234 -0
- package/package.json +22 -2
- package/dist/accordion-xCI_u0BV.js +0 -198
- package/dist/avatar-BahDVO9t.js +0 -132
- package/dist/badge-B_sLygxU.js +0 -108
- package/dist/card-D-aI2QHx.js +0 -158
- package/dist/carousel-IvPqN-oM.js +0 -472
- package/dist/command-palette-BQ5LleGb.js +0 -384
- package/dist/date-range-picker-B5uFWsm-.js +0 -562
- package/dist/file-dropzone-pR4v7owg.js +0 -457
- package/dist/mention-input-BcQKX2EJ.js +0 -599
- package/dist/menu-xwOOUtWP.js +0 -275
- package/dist/pill-DO2gHzMb.js +0 -56
- package/dist/popover-QHcEvf9c.js +0 -119
- package/dist/slider-t0B5cecO.js +0 -477
- package/dist/switch-qwv8jQnR.js +0 -142
- package/dist/tabs-CAVJndX1.js +0 -203
- package/dist/tooltip-CkeiW9C1.js +0 -113
- package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
+
import { type SxProps } from '../../styling/sx';
|
|
3
|
+
import { type SliderMark, type SliderPart as Part } from '../slider/use-slider-interaction';
|
|
4
|
+
export type ElasticSliderMark = SliderMark;
|
|
5
|
+
export type ElasticSliderSize = 'sm' | 'md';
|
|
6
|
+
export interface ElasticSliderSlotProps {
|
|
7
|
+
label?: Part<'span'>;
|
|
8
|
+
readout?: Part<'span'>;
|
|
9
|
+
description?: Part<'div'>;
|
|
10
|
+
error?: Part<'div'>;
|
|
11
|
+
control?: Part<'div'>;
|
|
12
|
+
rail?: Part<'div'>;
|
|
13
|
+
track?: Part<'div'>;
|
|
14
|
+
fill?: Part<'div'>;
|
|
15
|
+
thumb?: Part<'div'>;
|
|
16
|
+
bubble?: Part<'span'>;
|
|
17
|
+
tick?: Part<'span'> | ((index: number) => Part<'span'>);
|
|
18
|
+
mark?: Part<'button'> | ((index: number) => Part<'button'>);
|
|
19
|
+
start?: Part<'div'>;
|
|
20
|
+
end?: Part<'div'>;
|
|
21
|
+
}
|
|
22
|
+
export interface ElasticSliderProps extends Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'onChange' | 'children'>, SxProps {
|
|
23
|
+
label: ReactNode;
|
|
24
|
+
value?: number;
|
|
25
|
+
defaultValue?: number;
|
|
26
|
+
onValueChange?: (value: number) => void;
|
|
27
|
+
onValueCommit?: (value: number) => void;
|
|
28
|
+
description?: ReactNode;
|
|
29
|
+
error?: ReactNode;
|
|
30
|
+
invalid?: boolean;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
min?: number;
|
|
33
|
+
max?: number;
|
|
34
|
+
step?: number;
|
|
35
|
+
largeStep?: number;
|
|
36
|
+
/** Detents. Normalized to the step lattice; invalid or out-of-domain marks are ignored. */
|
|
37
|
+
marks?: readonly ElasticSliderMark[];
|
|
38
|
+
locale?: Intl.LocalesArgument;
|
|
39
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
40
|
+
formatValue?: (value: number, formatter: Intl.NumberFormat) => string;
|
|
41
|
+
showValue?: boolean;
|
|
42
|
+
start?: ReactNode;
|
|
43
|
+
end?: ReactNode;
|
|
44
|
+
/** Short vibration when a touch drag latches onto a detent, where supported. Off under reduced motion. */
|
|
45
|
+
haptics?: boolean;
|
|
46
|
+
name?: string;
|
|
47
|
+
size?: ElasticSliderSize;
|
|
48
|
+
slotProps?: ElasticSliderSlotProps;
|
|
49
|
+
}
|
|
50
|
+
export declare function ElasticSlider(props: ElasticSliderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare namespace ElasticSlider {
|
|
52
|
+
var displayName: string;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ElasticSlider, type ElasticSliderProps, type ElasticSliderMark, type ElasticSliderSize, type ElasticSliderSlotProps, } from './elastic-slider';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type CSSProperties, type Ref } from 'react';
|
|
2
|
+
import { type SxProps } from '../../styling/sx';
|
|
3
|
+
import { type SearchFieldProps, type SearchFieldSize } from '../search-field';
|
|
4
|
+
export type ExpandingSearchInputProps = Omit<ComponentPropsWithRef<'input'>, 'ref' | 'type' | 'role' | 'size' | 'value' | 'defaultValue' | 'children' | 'disabled' | 'dir' | 'className'>;
|
|
5
|
+
export interface ExpandingSearchProps extends Omit<ComponentPropsWithRef<'div'>, 'children' | 'defaultValue' | 'onChange'>, SxProps, Pick<SearchFieldProps, 'value' | 'defaultValue' | 'onValueChange' | 'label' | 'description' | 'error' | 'clearable' | 'messages' | 'searchIcon' | 'clearIcon' | 'slotProps'> {
|
|
6
|
+
/** Accessible name of the collapsed button; also the input's fallback name. */
|
|
7
|
+
triggerLabel: string;
|
|
8
|
+
open?: boolean;
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
anchor?: 'start' | 'end';
|
|
12
|
+
expandedWidth?: CSSProperties['inlineSize'];
|
|
13
|
+
size?: SearchFieldSize;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Native attributes and events of the search input. */
|
|
16
|
+
inputProps?: ExpandingSearchInputProps;
|
|
17
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
18
|
+
}
|
|
19
|
+
export declare function ExpandingSearch({ ref, inputRef, triggerLabel, open: openProp, defaultOpen, onOpenChange, anchor, expandedWidth, size, disabled, value, defaultValue, onValueChange, label, description, error, clearable, messages, searchIcon, clearIcon, slotProps, inputProps, className, sx, dir, style, onKeyDown, onBlur, ...rootProps }: ExpandingSearchProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare namespace ExpandingSearch {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ExpandingSearch, type ExpandingSearchInputProps, type ExpandingSearchProps } from './expanding-search';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
-
import { type Placement } from '@floating-ui/react';
|
|
3
|
-
import { type Interpolation, type Theme } from '../../styling/css';
|
|
1
|
+
import { type ComponentPropsWithRef, type CSSProperties, type HTMLProps, type MutableRefObject, type ReactNode } from 'react';
|
|
2
|
+
import { type Placement, type UseInteractionsReturn } from '@floating-ui/react';
|
|
3
|
+
import { type Interpolation, type SerializedStyles, type Theme } from '../../styling/css';
|
|
4
4
|
import { type SxProps } from '../../styling/sx';
|
|
5
|
+
import { useOverlayFloating, type OverlayFloatingOptions } from '../../overlay/use-overlay-floating';
|
|
5
6
|
export interface MenuProps {
|
|
6
7
|
open?: boolean;
|
|
7
8
|
defaultOpen?: boolean;
|
|
@@ -21,6 +22,29 @@ export interface MenuItemProps extends Omit<ComponentPropsWithRef<'button'>, 'on
|
|
|
21
22
|
}
|
|
22
23
|
export interface MenuSeparatorProps extends ComponentPropsWithRef<'div'>, SxProps {
|
|
23
24
|
}
|
|
25
|
+
export type MenuItemTone = 'neutral' | 'danger';
|
|
26
|
+
/** Positioning options a family may set on the shared controller; Menu keeps the defaults. */
|
|
27
|
+
export type MenuPositioning = Pick<OverlayFloatingOptions, 'strategy' | 'gap' | 'transform' | 'onAvailableSize'>;
|
|
28
|
+
export interface MenuControllerProps extends MenuProps {
|
|
29
|
+
positioning?: MenuPositioning;
|
|
30
|
+
}
|
|
31
|
+
type OverlayFloating = ReturnType<typeof useOverlayFloating>;
|
|
32
|
+
interface MenuContextValue {
|
|
33
|
+
open: boolean;
|
|
34
|
+
nodeId: string | undefined;
|
|
35
|
+
requestOpen: () => void;
|
|
36
|
+
requestClose: (restoreFocus?: boolean) => void;
|
|
37
|
+
activeIndex: number | null;
|
|
38
|
+
refs: OverlayFloating['refs'];
|
|
39
|
+
floatingContext: OverlayFloating['context'];
|
|
40
|
+
floatingStyles: CSSProperties;
|
|
41
|
+
elementsRef: MutableRefObject<Array<HTMLElement | null>>;
|
|
42
|
+
labelsRef: MutableRefObject<Array<string | null>>;
|
|
43
|
+
disabledIndices: Set<number>;
|
|
44
|
+
getReferenceProps: UseInteractionsReturn['getReferenceProps'];
|
|
45
|
+
getFloatingProps: UseInteractionsReturn['getFloatingProps'];
|
|
46
|
+
getItemProps: UseInteractionsReturn['getItemProps'];
|
|
47
|
+
}
|
|
24
48
|
/**
|
|
25
49
|
* Private seam for component families built on the menu controller (Menu, SplitButton): the
|
|
26
50
|
* family names usage errors, `marker` is the part's data-ui and `styles` its own styles.
|
|
@@ -30,16 +54,35 @@ export interface MenuPartIdentity {
|
|
|
30
54
|
marker: string;
|
|
31
55
|
styles?: Interpolation<Theme>;
|
|
32
56
|
}
|
|
57
|
+
/** Item behavior a family may change: the part name in usage errors, the item role and whether
|
|
58
|
+
* selection closes the menu. */
|
|
59
|
+
export interface MenuItemPartBehavior {
|
|
60
|
+
part?: string;
|
|
61
|
+
itemRole?: 'menuitem' | 'menuitemcheckbox';
|
|
62
|
+
closeOnSelect?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export declare function useMenuContext(family: string, part: string): MenuContextValue;
|
|
65
|
+
/**
|
|
66
|
+
* Runs each consumer handler before the matching interaction handler; a consumer
|
|
67
|
+
* `preventDefault()` vetoes the internal request (open, toggle, navigation).
|
|
68
|
+
*/
|
|
69
|
+
export declare function consumerHandlersFirst(props: HTMLProps<Element>, getProps: (userProps: HTMLProps<Element>) => Record<string, unknown>): Record<string, unknown>;
|
|
33
70
|
/** Own styles of a menu item, for families that layer their own item styles on top. */
|
|
34
|
-
export declare const menuItemStyles:
|
|
71
|
+
export declare const menuItemStyles: SerializedStyles[];
|
|
35
72
|
/** Own styles of a menu separator. */
|
|
36
|
-
export declare const menuSeparatorStyles:
|
|
73
|
+
export declare const menuSeparatorStyles: SerializedStyles;
|
|
74
|
+
/** Command tones for families whose items carry one (SplitButton, ContextMenu). */
|
|
75
|
+
export declare const menuItemToneStyles: Record<MenuItemTone, SerializedStyles>;
|
|
76
|
+
/** The shared menu controller (state, positioning, navigation, dismissal, focus return). */
|
|
77
|
+
export declare function MenuController(props: MenuControllerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
37
78
|
declare function MenuRoot(props: MenuProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
38
79
|
export declare function MenuTriggerPart({ family, marker, styles, ref, className, sx, ...props }: MenuTriggerProps & MenuPartIdentity): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
39
80
|
declare function MenuTrigger(props: MenuTriggerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
40
|
-
export declare function MenuContentPart({ family, marker, styles, ref, style, children, className, sx, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...rest }: MenuContentProps & MenuPartIdentity
|
|
81
|
+
export declare function MenuContentPart({ family, marker, styles, ref, style, children, className, sx, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, defaultLabelledBy, ...rest }: MenuContentProps & MenuPartIdentity & {
|
|
82
|
+
defaultLabelledBy?: string;
|
|
83
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
41
84
|
declare function MenuContent(props: MenuContentProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
42
|
-
export declare function MenuItemPart({ family, marker, styles, ref, onSelect, disabled, onClick, className, sx, ...rest }: MenuItemProps & MenuPartIdentity): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
85
|
+
export declare function MenuItemPart({ family, marker, styles, ref, onSelect, disabled, part, itemRole, closeOnSelect, onClick, className, sx, ...rest }: MenuItemProps & MenuPartIdentity & MenuItemPartBehavior): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
43
86
|
declare function MenuItem(props: MenuItemProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
44
87
|
export declare function MenuSeparatorPart({ marker, styles, ref, className, sx, ...props }: MenuSeparatorProps & Omit<MenuPartIdentity, 'family'>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
45
88
|
declare function MenuSeparator(props: MenuSeparatorProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -12,7 +12,7 @@ export interface PaginationProps extends Omit<ComponentPropsWithRef<'nav'>, 'onC
|
|
|
12
12
|
nextLabel?: string;
|
|
13
13
|
locale?: string;
|
|
14
14
|
}
|
|
15
|
-
export declare function Pagination({ ref, page, totalPages, onPageChange, siblingCount, label, previousLabel, nextLabel, locale, className, sx, ...rest }: PaginationProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function Pagination({ ref, page, totalPages, onPageChange, siblingCount, label, previousLabel, nextLabel, locale, className, sx, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...rest }: PaginationProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
16
|
export declare namespace Pagination {
|
|
17
17
|
var displayName: string;
|
|
18
18
|
}
|
|
@@ -31,7 +31,7 @@ export interface RadioCardsItemProps extends Omit<ComponentPropsWithRef<'input'>
|
|
|
31
31
|
export type RadioCardsLabelProps = ComponentPropsWithRef<'span'> & SxProps;
|
|
32
32
|
export type RadioCardsDescriptionProps = ComponentPropsWithRef<'span'> & SxProps;
|
|
33
33
|
declare function RadioCardsRoot({ ref, value: valueProp, defaultValue, onValueChange, name: nameProp, required, disabled, invalid, error, layout, minColumnWidth, size, className, sx, style, children, onKeyDown, 'aria-labelledby': labelledBy, 'aria-describedby': describedBy, 'aria-invalid': ariaInvalid, ...rest }: RadioCardsProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
34
|
-
declare function RadioCardsItem({ ref, value, label, description, meta, icon, disabledReason, disabled: disabledProp, required: requiredProp, onChange, slotProps, className, sx, 'aria-label': ariaLabel, 'aria-labelledby': labelledBy, 'aria-describedby': describedBy, 'aria-invalid': ariaInvalid, ...rest }: RadioCardsItemProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare function RadioCardsItem({ ref, value, label, description, meta, icon, disabledReason, dir, disabled: disabledProp, required: requiredProp, onChange, slotProps, className, sx, 'aria-label': ariaLabel, 'aria-labelledby': labelledBy, 'aria-describedby': describedBy, 'aria-invalid': ariaInvalid, ...rest }: RadioCardsItemProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
35
35
|
declare function RadioCardsLabel(props: RadioCardsLabelProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
36
36
|
declare function RadioCardsDescription(props: RadioCardsDescriptionProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
37
37
|
export declare const RadioCards: typeof RadioCardsRoot & {
|
|
@@ -26,7 +26,7 @@ export interface RadioGroupRadioProps extends Omit<ComponentPropsWithRef<'input'
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
declare function RadioGroupRoot({ ref, value: valueProp, defaultValue, onValueChange, name: nameProp, disabled, orientation, className, sx, ...rest }: RadioGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
29
|
-
declare function RadioGroupRadio({ ref, value, label, description, disabled: disabledProp, onChange, slotProps, className, sx, 'aria-labelledby': ariaLabelledByProp, 'aria-describedby': ariaDescribedByProp, ...rest }: RadioGroupRadioProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare function RadioGroupRadio({ ref, value, label, description, disabled: disabledProp, onChange, slotProps, className, sx, dir, 'aria-labelledby': ariaLabelledByProp, 'aria-describedby': ariaDescribedByProp, ...rest }: RadioGroupRadioProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
30
30
|
export declare const RadioGroup: typeof RadioGroupRoot & {
|
|
31
31
|
Radio: typeof RadioGroupRadio;
|
|
32
32
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const sliderRootStyle: import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const sliderHeaderStyle: import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const sliderLabelStyle: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const sliderReadoutStyle: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const sliderDescriptionStyle: import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const sliderErrorStyle: import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const sliderRowStyle: import("@emotion/react").SerializedStyles;
|
|
8
|
+
export declare const sliderControlStyle: import("@emotion/react").SerializedStyles;
|
|
9
|
+
export declare const sliderSizeStyles: {
|
|
10
|
+
sm: import("@emotion/react").SerializedStyles;
|
|
11
|
+
md: import("@emotion/react").SerializedStyles;
|
|
12
|
+
};
|
|
13
|
+
export declare const sliderMarksStyle: import("@emotion/react").SerializedStyles;
|
|
14
|
+
export declare const sliderMarkStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
-
import { type Interpolation, type Theme } from '../../styling/css';
|
|
3
2
|
import { type SxProps } from '../../styling/sx';
|
|
4
|
-
|
|
5
|
-
export type SliderMark
|
|
6
|
-
value: number;
|
|
7
|
-
label?: ReactNode;
|
|
8
|
-
};
|
|
3
|
+
import { type SliderMark, type SliderPart as Part } from './use-slider-interaction';
|
|
4
|
+
export type { SliderMark, SliderValue } from './use-slider-interaction';
|
|
9
5
|
export type SliderSize = 'sm' | 'md';
|
|
10
|
-
type Part<E extends 'div' | 'span' | 'button'> = ComponentPropsWithRef<E> & {
|
|
11
|
-
css?: Interpolation<Theme>;
|
|
12
|
-
};
|
|
13
6
|
export interface SliderSlotProps {
|
|
14
7
|
label?: Part<'span'>;
|
|
15
8
|
readout?: Part<'span'>;
|
|
@@ -67,4 +60,3 @@ export declare function Slider(props: SliderProps): import("@emotion/react/jsx-r
|
|
|
67
60
|
export declare namespace Slider {
|
|
68
61
|
var displayName: string;
|
|
69
62
|
}
|
|
70
|
-
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type KeyboardEvent, type PointerEvent, type ReactNode, type RefCallback, type RefObject } from 'react';
|
|
2
|
+
import type { Interpolation, Theme } from '../../styling/css';
|
|
3
|
+
export type SliderValue = number | readonly [number, number];
|
|
4
|
+
export type SliderMark = number | {
|
|
5
|
+
value: number;
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export type SliderPart<E extends 'div' | 'span' | 'button'> = ComponentPropsWithRef<E> & {
|
|
9
|
+
css?: Interpolation<Theme>;
|
|
10
|
+
};
|
|
11
|
+
/** Pointer position for one gesture sample, in domain units plus the geometry to convert them. */
|
|
12
|
+
export interface SliderPointerSample {
|
|
13
|
+
/** Unclamped domain value under the pointer (grab offset applied). */
|
|
14
|
+
raw: number;
|
|
15
|
+
/** Bounds the dragged thumb may take. */
|
|
16
|
+
low: number;
|
|
17
|
+
high: number;
|
|
18
|
+
/** CSS pixels per domain unit along the control. */
|
|
19
|
+
pxPerUnit: number;
|
|
20
|
+
rtl: boolean;
|
|
21
|
+
pointerType: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function joinIds(...values: (string | false | undefined)[]): string | undefined;
|
|
24
|
+
export declare function hasContent(node: ReactNode): boolean;
|
|
25
|
+
export declare function indexedPart<E extends 'div' | 'span' | 'button'>(part: SliderPart<E> | ((index: number) => SliderPart<E>) | undefined, index: number): SliderPart<E> | undefined;
|
|
26
|
+
export declare function useSliderFormat(locale: Intl.LocalesArgument, formatOptions: Intl.NumberFormatOptions | undefined, formatValue: ((value: number, formatter: Intl.NumberFormat) => string) | undefined): {
|
|
27
|
+
formatter: Intl.NumberFormat;
|
|
28
|
+
format: (n: number) => string;
|
|
29
|
+
};
|
|
30
|
+
export interface SliderInteractionOptions {
|
|
31
|
+
/** Public component name used in configuration errors. */
|
|
32
|
+
component: string;
|
|
33
|
+
range: boolean;
|
|
34
|
+
value: SliderValue | undefined;
|
|
35
|
+
defaultValue: SliderValue | undefined;
|
|
36
|
+
min: number;
|
|
37
|
+
max: number;
|
|
38
|
+
step: number;
|
|
39
|
+
largeStep: number | undefined;
|
|
40
|
+
minStepsBetweenThumbs: number;
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
onValueChange: (next: SliderValue) => void;
|
|
43
|
+
onValueCommit: (next: SliderValue) => void;
|
|
44
|
+
/** Visual feedback hook: runs for every accepted pointer sample, before the value request. */
|
|
45
|
+
onPointerSample?: (sample: SliderPointerSample) => void;
|
|
46
|
+
/** Maps a pointer sample to the raw domain target (e.g. magnetic detents). Defaults to `raw`. */
|
|
47
|
+
resolvePointer?: (sample: SliderPointerSample) => number;
|
|
48
|
+
/** Runs once when a gesture ends: completed (pointerup) or cancelled (cancel, lost capture, disable, reset). */
|
|
49
|
+
onGestureEnd?: (completed: boolean) => void;
|
|
50
|
+
}
|
|
51
|
+
export interface SliderInteraction {
|
|
52
|
+
id: string;
|
|
53
|
+
controlRef: RefObject<HTMLDivElement | null>;
|
|
54
|
+
current: SliderValue;
|
|
55
|
+
values: number[] | readonly [number, number];
|
|
56
|
+
active: number | null;
|
|
57
|
+
bounds: (index: number) => number[];
|
|
58
|
+
percent: (n: number) => number;
|
|
59
|
+
normalizeMarks: (marks: readonly SliderMark[]) => {
|
|
60
|
+
value: number;
|
|
61
|
+
label?: ReactNode;
|
|
62
|
+
}[];
|
|
63
|
+
/** Handlers for the pointer-capture control; consumer slot handlers run first and may veto. */
|
|
64
|
+
controlHandlers: (part: SliderPart<'div'> | undefined) => {
|
|
65
|
+
ref: RefCallback<HTMLDivElement>;
|
|
66
|
+
onPointerDown: (e: PointerEvent<HTMLDivElement>) => void;
|
|
67
|
+
onPointerMove: (e: PointerEvent<HTMLDivElement>) => void;
|
|
68
|
+
onPointerUp: (e: PointerEvent<HTMLDivElement>) => void;
|
|
69
|
+
onPointerCancel: (e: PointerEvent<HTMLDivElement>) => void;
|
|
70
|
+
onLostPointerCapture: (e: PointerEvent<HTMLDivElement>) => void;
|
|
71
|
+
};
|
|
72
|
+
/** Root `onKeyDown` tail: routes movement keys from a thumb inside this control. */
|
|
73
|
+
handleRootKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void;
|
|
74
|
+
/** Activation of a mark shortcut: one change + commit for a changed request, nothing otherwise. */
|
|
75
|
+
selectMark: (markValue: number) => void;
|
|
76
|
+
/** Remembers the last focused thumb for equidistant range presses. */
|
|
77
|
+
noteFocus: (index: number) => void;
|
|
78
|
+
}
|
|
79
|
+
export declare function useSliderInteraction(options: SliderInteractionOptions): SliderInteraction;
|
|
@@ -2,8 +2,8 @@ import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
|
2
2
|
import { type Placement } from '@floating-ui/react';
|
|
3
3
|
import { type SxProps } from '../../styling/sx';
|
|
4
4
|
import { type ButtonProps, type ButtonSize, type ButtonTone, type ButtonVariant } from '../button';
|
|
5
|
-
import { type MenuContentProps, type MenuItemProps, type MenuSeparatorProps } from '../menu/menu';
|
|
6
|
-
export type SplitButtonItemTone =
|
|
5
|
+
import { type MenuItemTone, type MenuContentProps, type MenuItemProps, type MenuSeparatorProps } from '../menu/menu';
|
|
6
|
+
export type SplitButtonItemTone = MenuItemTone;
|
|
7
7
|
export interface SplitButtonProps extends Omit<ComponentPropsWithRef<'div'>, 'role'>, SxProps {
|
|
8
8
|
/** Appearance of the Action; the Trigger uses the matching subdued fill. */
|
|
9
9
|
variant?: ButtonVariant;
|
|
@@ -18,7 +18,7 @@ export interface TabsPanelProps extends ComponentPropsWithRef<'div'>, SxProps {
|
|
|
18
18
|
}
|
|
19
19
|
declare function TabsRoot({ ref, value: valueProp, defaultValue, onValueChange, orientation, activation, className, sx, ...rest }: TabsProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
20
20
|
declare function TabsList({ ref, onKeyDown, className, sx, ...rest }: TabsListProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
21
|
-
declare function TabsTab({ ref, value, disabled, onClick, onFocus, className, sx, ...rest }: TabsTabProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function TabsTab({ ref, value, disabled, onClick, onFocus, onPointerDown, className, sx, ...rest }: TabsTabProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
22
22
|
declare function TabsPanel({ ref, value, tabIndex, 'aria-labelledby': ariaLabelledByProp, className, sx, ...rest }: TabsPanelProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
23
|
export declare const Tabs: typeof TabsRoot & {
|
|
24
24
|
List: typeof TabsList;
|
|
@@ -12,7 +12,7 @@ export interface TextFieldProps extends Omit<ComponentPropsWithRef<'input'>, 'si
|
|
|
12
12
|
onValueChange?: (value: string) => void;
|
|
13
13
|
slotProps?: FieldSlotProps<TextFieldPartProps>;
|
|
14
14
|
}
|
|
15
|
-
export declare function TextField({ ref, label, description, error, size, onChange, onValueChange, slotProps, className, sx, required, id: idProp, 'aria-describedby': ariaDescribedByProp, 'aria-invalid': ariaInvalidProp, ...rest }: TextFieldProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function TextField({ ref, label, description, error, size, onChange, onValueChange, slotProps, className, sx, required, id: idProp, dir, 'aria-describedby': ariaDescribedByProp, 'aria-invalid': ariaInvalidProp, ...rest }: TextFieldProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
16
16
|
export declare namespace TextField {
|
|
17
17
|
var displayName: string;
|
|
18
18
|
}
|
|
@@ -15,7 +15,7 @@ export interface TextareaProps extends ComponentPropsWithRef<'textarea'>, SxProp
|
|
|
15
15
|
onValueChange?: (value: string) => void;
|
|
16
16
|
slotProps?: FieldSlotProps<TextareaPartProps>;
|
|
17
17
|
}
|
|
18
|
-
export declare function Textarea({ ref, label, description, error, size, resize, autoResize, rows, onChange, onValueChange, slotProps, className, sx, required, id: idProp, 'aria-describedby': ariaDescribedByProp, 'aria-invalid': ariaInvalidProp, ...rest }: TextareaProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function Textarea({ ref, label, description, error, size, resize, autoResize, rows, onChange, onValueChange, slotProps, className, sx, dir, required, id: idProp, 'aria-describedby': ariaDescribedByProp, 'aria-invalid': ariaInvalidProp, ...rest }: TextareaProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
19
19
|
export declare namespace Textarea {
|
|
20
20
|
var displayName: string;
|
|
21
21
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ThemeSwitch, type ThemeSwitchProps, type ThemeSwitchValue, type ThemeSwitchTransition, type ThemeSwitchChangeDetails, } from './theme-switch';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type SwitchPartProps, type SwitchProps } from '../switch';
|
|
3
|
+
export type ThemeSwitchValue = 'light' | 'dark';
|
|
4
|
+
export type ThemeSwitchTransition = 'reveal' | 'eclipse' | 'split' | 'rise';
|
|
5
|
+
export interface ThemeSwitchChangeDetails {
|
|
6
|
+
transition: ThemeSwitchTransition;
|
|
7
|
+
trigger: HTMLInputElement;
|
|
8
|
+
reducedMotion: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ThemeSwitchProps extends Omit<SwitchProps, 'value' | 'defaultValue' | 'checked' | 'defaultChecked' | 'onCheckedChange' | 'children' | 'slotProps'> {
|
|
11
|
+
value?: ThemeSwitchValue;
|
|
12
|
+
defaultValue?: ThemeSwitchValue;
|
|
13
|
+
onValueChange?: (next: ThemeSwitchValue, details: ThemeSwitchChangeDetails) => void;
|
|
14
|
+
label: ReactNode;
|
|
15
|
+
iconOnly?: boolean;
|
|
16
|
+
lightIcon?: ReactNode;
|
|
17
|
+
darkIcon?: ReactNode;
|
|
18
|
+
transition?: ThemeSwitchTransition;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
slotProps?: SwitchProps['slotProps'] & {
|
|
21
|
+
iconFrame?: SwitchPartProps;
|
|
22
|
+
lightIcon?: SwitchPartProps;
|
|
23
|
+
darkIcon?: SwitchPartProps;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/** Composes Switch: Space toggles dark appearance; the accessible name stays stable.
|
|
27
|
+
* The consumer applies the requested theme. The ref reaches Switch's native input.
|
|
28
|
+
* The decorative icon frame is a hidden label for the input, so clicking the glyph toggles too.
|
|
29
|
+
*/
|
|
30
|
+
export declare function ThemeSwitch({ value: valueProp, defaultValue, onValueChange, label, iconOnly, lightIcon, darkIcon, transition, loading, className, sx, slotProps, onChange, onClick, dir, id: idProp, ...rest }: ThemeSwitchProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare namespace ThemeSwitch {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
@@ -18,7 +18,7 @@ export interface TooltipContentProps extends ComponentPropsWithRef<'div'>, SxPro
|
|
|
18
18
|
}
|
|
19
19
|
declare function TooltipRoot(props: TooltipProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
20
20
|
declare function TooltipTrigger({ ref, 'aria-describedby': ariaDescribedByProp, className, sx, ...rest }: TooltipTriggerProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
21
|
-
declare function TooltipContent(
|
|
21
|
+
declare function TooltipContent(props: TooltipContentProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
22
22
|
export declare const Tooltip: typeof TooltipRoot & {
|
|
23
23
|
Trigger: typeof TooltipTrigger;
|
|
24
24
|
Content: typeof TooltipContent;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,7 +15,9 @@ export * from './components/chip-group';
|
|
|
15
15
|
export * from './components/code-block';
|
|
16
16
|
export * from './components/command-palette';
|
|
17
17
|
export * from './components/combobox';
|
|
18
|
+
export * from './components/comment-thread';
|
|
18
19
|
export * from './components/container';
|
|
20
|
+
export * from './components/context-menu';
|
|
19
21
|
export * from './components/copy-button';
|
|
20
22
|
export * from './components/countdown';
|
|
21
23
|
export * from './components/date-picker';
|
|
@@ -23,8 +25,10 @@ export * from './components/date-range-picker';
|
|
|
23
25
|
export * from './components/dialog';
|
|
24
26
|
export * from './components/divider';
|
|
25
27
|
export * from './components/drawer';
|
|
28
|
+
export * from './components/elastic-slider';
|
|
26
29
|
export * from './components/empty-state';
|
|
27
30
|
export * from './components/expandable-card';
|
|
31
|
+
export * from './components/expanding-search';
|
|
28
32
|
export * from './components/file-dropzone';
|
|
29
33
|
export * from './components/filter-toolbar';
|
|
30
34
|
export * from './components/flex';
|
|
@@ -67,6 +71,7 @@ export * from './components/text-field';
|
|
|
67
71
|
export * from './components/textarea';
|
|
68
72
|
export { ThemeProvider, useTheme, type ThemeProviderProps } from './components/theme-provider/theme-provider';
|
|
69
73
|
export * from './components/theme-root';
|
|
74
|
+
export * from './components/theme-switch';
|
|
70
75
|
export * from './components/time-picker';
|
|
71
76
|
export * from './components/timeline';
|
|
72
77
|
export * from './components/toast';
|
|
@@ -21,6 +21,26 @@ export declare function OverlayLayer({ children }: {
|
|
|
21
21
|
export declare namespace OverlayLayer {
|
|
22
22
|
var displayName: string;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* A layer for a menu. Its node joins the tree under the enclosing layer like any other, but the
|
|
26
|
+
* menu's own hooks see no parent node: useRole and useListNavigation read a parent node as a parent
|
|
27
|
+
* menu (a menuitem trigger, cross-axis open/close keys). The menu's content re-provides the node
|
|
28
|
+
* through `LayerContent`, so layers opened inside it nest under it.
|
|
29
|
+
*/
|
|
30
|
+
export declare function MenuLayer({ children }: {
|
|
31
|
+
children: (nodeId: string | undefined) => ReactNode;
|
|
32
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare namespace MenuLayer {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
/** Makes `nodeId` the parent of layers rendered inside `children`. */
|
|
37
|
+
export declare function LayerContent({ nodeId, children }: {
|
|
38
|
+
nodeId: string | undefined;
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare namespace LayerContent {
|
|
42
|
+
var displayName: string;
|
|
43
|
+
}
|
|
24
44
|
/**
|
|
25
45
|
* Root boundary for an overlay that does not take part in layer nesting. Inside a layer it gets
|
|
26
46
|
* its own empty tree and no parent node, so it never reads the enclosing layer as its parent.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type OpenChangeReason, type Placement, type UseFloatingReturn } from '@floating-ui/react';
|
|
1
|
+
import { type OpenChangeReason, type Placement, type Strategy, type UseFloatingReturn } from '@floating-ui/react';
|
|
2
2
|
export interface OverlayFloatingOptions {
|
|
3
3
|
open: boolean;
|
|
4
4
|
onOpenChange: (open: boolean, event?: Event, reason?: OpenChangeReason) => void;
|
|
@@ -9,6 +9,13 @@ export interface OverlayFloatingOptions {
|
|
|
9
9
|
boundary?: Element | null;
|
|
10
10
|
/** Receives the space left for the surface inside the boundary after each positioning pass. */
|
|
11
11
|
onAvailableSize?: (size: OverlayAvailableSize) => void;
|
|
12
|
+
/** CSS positioning strategy. Defaults to `absolute`. */
|
|
13
|
+
strategy?: Strategy;
|
|
14
|
+
/** Gap between the anchor and the surface, in px. Defaults to `ANCHOR_GAP`. */
|
|
15
|
+
gap?: number;
|
|
16
|
+
/** Position with `transform` (default) or with `left`/`top`, which leaves `transform` and
|
|
17
|
+
* `scale` free for the surface's own animation. */
|
|
18
|
+
transform?: boolean;
|
|
12
19
|
}
|
|
13
20
|
export interface OverlayAvailableSize {
|
|
14
21
|
width: number;
|
|
@@ -18,4 +25,4 @@ export interface OverlayAvailableSize {
|
|
|
18
25
|
* Shared positioning for Popover, Tooltip and Menu. `autoUpdate` only runs while both
|
|
19
26
|
* elements are mounted, so a closed (unmounted) surface does no positioning work.
|
|
20
27
|
*/
|
|
21
|
-
export declare function useOverlayFloating({ open, onOpenChange, placement, nodeId, boundary, onAvailableSize, }: OverlayFloatingOptions): UseFloatingReturn<HTMLButtonElement>;
|
|
28
|
+
export declare function useOverlayFloating({ open, onOpenChange, placement, nodeId, boundary, onAvailableSize, strategy, gap, transform, }: OverlayFloatingOptions): UseFloatingReturn<HTMLButtonElement>;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { autoUpdate as e, flip as t, offset as n, shift as r, size as i, useFloating as a } from "@floating-ui/react";
|
|
3
3
|
//#region src/overlay/use-overlay-floating.ts
|
|
4
4
|
var o = 8, s = 8;
|
|
5
|
-
function c({ open: c, onOpenChange: l, placement: u, nodeId: d, boundary: f, onAvailableSize: p }) {
|
|
6
|
-
let
|
|
5
|
+
function c({ open: c, onOpenChange: l, placement: u, nodeId: d, boundary: f, onAvailableSize: p, strategy: m, gap: h = o, transform: g }) {
|
|
6
|
+
let _ = {
|
|
7
7
|
padding: s,
|
|
8
8
|
...f ? { boundary: f } : {}
|
|
9
9
|
};
|
|
@@ -12,12 +12,14 @@ function c({ open: c, onOpenChange: l, placement: u, nodeId: d, boundary: f, onA
|
|
|
12
12
|
onOpenChange: l,
|
|
13
13
|
placement: u,
|
|
14
14
|
nodeId: d,
|
|
15
|
+
strategy: m,
|
|
16
|
+
transform: g,
|
|
15
17
|
middleware: [
|
|
16
|
-
n(
|
|
17
|
-
t(
|
|
18
|
-
r(
|
|
18
|
+
n(h),
|
|
19
|
+
t(_),
|
|
20
|
+
r(_),
|
|
19
21
|
p && i({
|
|
20
|
-
...
|
|
22
|
+
..._,
|
|
21
23
|
apply: ({ availableWidth: e, availableHeight: t }) => p({
|
|
22
24
|
width: e,
|
|
23
25
|
height: t
|