@baseline-ui/core 3.0.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionGroup.mjs +1 -1
- package/dist/AlertDialog.mjs +1 -1
- package/dist/AudioPlayer.mjs +1 -1
- package/dist/ButtonSelect.mjs +1 -1
- package/dist/Calendar.mjs +1 -1
- package/dist/ColorInput.mjs +1 -1
- package/dist/ColorSwatchPicker.mjs +1 -1
- package/dist/ComboBox.mjs +1 -1
- package/dist/DateField.mjs +1 -1
- package/dist/Dialog.mjs +1 -1
- package/dist/Editor.mjs +1 -1
- package/dist/FileList.mjs +1 -1
- package/dist/GridList.mjs +1 -1
- package/dist/ImageGallery.mjs +1 -1
- package/dist/ListBox.mjs +1 -1
- package/dist/Menu.mjs +1 -1
- package/dist/Modal.mjs +1 -1
- package/dist/Popover.mjs +1 -1
- package/dist/Select.mjs +1 -1
- package/dist/Slider.mjs +1 -1
- package/dist/TagGroup.mjs +1 -1
- package/dist/Toolbar.mjs +1 -1
- package/dist/UNSAFE_ListBox.mjs +1 -1
- package/dist/{chunk-67KFVQDI.mjs → chunk-26T2EPFD.mjs} +1 -1
- package/dist/{chunk-RC7QITNV.mjs → chunk-3NQY5GPQ.mjs} +1 -1
- package/dist/{chunk-XE66LA26.mjs → chunk-42B24XCP.mjs} +1 -1
- package/dist/chunk-4BYKAG4W.mjs +10 -0
- package/dist/{chunk-P6D2O5AA.mjs → chunk-4FTKS25Q.mjs} +1 -1
- package/dist/{chunk-TAGYDKPQ.mjs → chunk-5DOFIGHJ.mjs} +1 -1
- package/dist/{chunk-RPF5NT6H.mjs → chunk-5PIO6M4F.mjs} +1 -1
- package/dist/chunk-75722G3R.mjs +10 -0
- package/dist/{chunk-BED7T5CL.mjs → chunk-7GJMJTRL.mjs} +1 -1
- package/dist/{chunk-P6NVCASY.mjs → chunk-BXSJTXXY.mjs} +1 -1
- package/dist/chunk-DF3BVX5Z.mjs +10 -0
- package/dist/chunk-ECPG4S5O.mjs +11 -0
- package/dist/{chunk-B437YER6.mjs → chunk-EV24JU64.mjs} +1 -1
- package/dist/{chunk-4U2H67UB.mjs → chunk-GZ5ZWXIC.mjs} +1 -1
- package/dist/{chunk-TAROK7TO.mjs → chunk-IDEAEEBP.mjs} +1 -1
- package/dist/{chunk-TT6RUD5H.mjs → chunk-K3S22PMF.mjs} +1 -1
- package/dist/{chunk-WSO6OLPT.mjs → chunk-K4N7GVEI.mjs} +1 -1
- package/dist/{chunk-6ZV4UYEG.mjs → chunk-L3SNGDBH.mjs} +1 -1
- package/dist/{chunk-Q67U2HNE.mjs → chunk-L452ID76.mjs} +1 -1
- package/dist/{chunk-YUOWUIDZ.mjs → chunk-LLAMYDGW.mjs} +1 -1
- package/dist/{chunk-AFGWTUFC.mjs → chunk-LLVFPC5Q.mjs} +1 -1
- package/dist/{chunk-SLAITZUC.mjs → chunk-N4UAXVES.mjs} +1 -1
- package/dist/{chunk-RZSZ72NB.mjs → chunk-PJM4COF5.mjs} +1 -1
- package/dist/{chunk-DOL6RDMF.mjs → chunk-RF4E6MLM.mjs} +1 -1
- package/dist/{chunk-LYPWB7KT.mjs → chunk-TDOAVBKD.mjs} +1 -1
- package/dist/chunk-UVVONIZB.mjs +10 -0
- package/dist/{chunk-VLQ4S7XC.mjs → chunk-WXWGGDTG.mjs} +1 -1
- package/dist/{chunk-RJC3HQDZ.mjs → chunk-X3NOIEDZ.mjs} +1 -1
- package/dist/{chunk-P6CAKOCM.mjs → chunk-Y45SV547.mjs} +1 -1
- package/dist/hooks/useContainerScopedRef.mjs +1 -0
- package/dist/index.d.ts +144 -118
- package/dist/index.js +20 -20
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
- package/sbom.json +6 -6
- package/dist/chunk-7AY6C5M5.mjs +0 -10
- package/dist/chunk-BBS5ZRQE.mjs +0 -10
- package/dist/chunk-BVNYP6BF.mjs +0 -10
- package/dist/chunk-PHDDEIWA.mjs +0 -11
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {j,l,m,k,o,i,h}from'./chunk-75722G3R.mjs';import {a as a$3}from'./chunk-ECPG4S5O.mjs';import {a as a$2}from'./chunk-KCHAWPUN.mjs';import {b}from'./chunk-J3MJZQUJ.mjs';import {a}from'./chunk-F3HQNHR5.mjs';import {e}from'./chunk-B7PSE5KC.mjs';import {a as a$1}from'./chunk-4QEH5CGK.mjs';import z,{useEffect,useContext}from'react';import {jsxs,jsx}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var I="xyd2ss0 _1yep5z6n6 _1yep5z6n7 _1yep5z6n8 _1yep5z6pi _1yep5z6pj _1yep5z6pk _1yep5z6qo _1yep5z6qp _1yep5z6qq _1yep5z6oc _1yep5z6od _1yep5z6oe _1yep5z6ru _1yep5z6rv _1yep5z6rw _1yep5z6u6 _1yep5z6u7 _1yep5z6u8 _1yep5z6vc _1yep5z6vd _1yep5z6ve _1yep5z6t0 _1yep5z6t1 _1yep5z6t2 _1yep5z6wo _1yep5z6wp _1yep5z6wq _1yep5z6xc _1yep5z6xd _1yep5z6xe _1yep5z6y0 _1yep5z6y1 _1yep5z6y2 _1yep5z6yo _1yep5z6yp _1yep5z6yq _1yep5z617v _1yep5z617u _1yep5z6143 _1yep5z617y _1yep5z6124";var P=e=>e!=null&&typeof e=="object"&&!(Symbol.iterator in e);function G(e,o,r){let i=P(o)||P(r),s=o!=null&&!P(o)||r!=null&&!P(r);return e&&s?"Menu: an object `selectionMode` expects `selectedKeys`/`defaultSelectedKeys` to be records keyed by section id.":!e&&i?"Menu: a per-section `selectedKeys`/`defaultSelectedKeys` record requires the object form of `selectionMode`.":null}var Q=z.forwardRef(({defaultOpen:e,onOpenChange:o,isOpen:r,isDisabled:i,contentClassName:s,placement:l$1="bottom start",isNonModal:a$3,shouldFlip:c,shouldUpdatePosition:t,boundaryElement:M,boundaryAxis:p,horizontalBoundaryBehavior:d,crossOffset:_,offset:Z,triggerLabel:x,renderTrigger:v=({buttonProps:u,ref:y})=>jsx(b,{...u,variant:"popover",ref:y,"data-testid":"menu-trigger"}),portalContainer:$,selectionMode:m,selectedKeys:b$1,defaultSelectedKeys:S,onSelectionChange:K,disabledKeys:h,disallowEmptySelection:A,itemClassName:w,optionClassName:C,optionStyle:ee,renderOption:oe,...O},re)=>{let u=a($),y=m!=null&&typeof m=="object",N=z.useMemo(()=>h==null?void 0:new Set(h),[h]),te=z.useMemo(()=>w?(ne,ie)=>a$1(w,a$2(C,ne,ie)):C,[w,C]),k=G(y,b$1,S);if(k)throw new Error(k);return useEffect(()=>{!x&&!v&&console.warn("The `triggerLabel` prop is required when no `renderTrigger` or `children` is provided.");},[v,x]),jsxs(j,{defaultOpen:e,onOpenChange:o,isOpen:r,children:[jsx(W,{isDisabled:i,renderTrigger:v,triggerLabel:x}),jsx(X,{placement:l$1,isNonModal:a$3,shouldFlip:c,shouldUpdatePosition:t,boundaryElement:M,boundaryAxis:p,horizontalBoundaryBehavior:d,crossOffset:_,offset:Z||2,className:"BaselineUI-Menu-Popover",portalContainer:u,children:jsx(l,{...O,disabledKeys:N,...y?{}:{selectionMode:m,selectedKeys:b$1,defaultSelectedKeys:S,onSelectionChange:K,disallowEmptySelection:A},className:a$1(I,s),ref:re,children:V(O.items,u,{onAction:O.onAction,disabledKeys:N,contentClassName:s,optionClassName:te,optionStyle:ee,renderOption:oe,selection:y?{modes:m,selectedKeys:b$1,defaultSelectedKeys:S,onSelectionChange:K,disallowEmptySelection:A}:void 0})})})]})});function V(e,o$1,r){let{onAction:i,disabledKeys:s,contentClassName:l$1,selection:a,...c}=r;return e.map((t,M)=>{if("children"in t){let p=t,d=a?.modes[p.id];return jsx(m,{section:p,componentName:"Menu",isFirstCollectionItem:M===0,showSectionHeader:!!p.title,...c,...d?{selectionMode:d,selectedKeys:a?.selectedKeys?.[p.id],defaultSelectedKeys:a?.defaultSelectedKeys?.[p.id],disabledKeys:s,disallowEmptySelection:a?.disallowEmptySelection,onSelectionChange:_=>{a?.onSelectionChange?.(_,{sectionId:p.id});}}:{}},p.id)}return t.items?jsxs(k,{children:[jsx(o,{item:t,componentName:"Menu",...c}),jsx(X,{className:"BaselineUI-Menu-SubmenuPopover",portalContainer:o$1,children:jsx(l,{className:a$1(I,l$1),onAction:i,disabledKeys:s,children:V(t.items,o$1,r)})})]},t.id):jsx(o,{item:t,componentName:"Menu",...c},t.id)})}var W=z.forwardRef(({renderTrigger:e,triggerLabel:o,isDisabled:r,...i$1},s)=>{let l=useContext(i);return e?.({buttonProps:{...i$1,isDisabled:r,label:typeof o=="function"?o(l?.isOpen||false):o,isOpen:l?.isOpen||false,className:"BaselineUI-Menu-Trigger"},ref:s})});W.displayName="MyTrigger";var X=({children:e$1,...o})=>{let r=useContext(i),[i$1]=e(o,void 0,h);return r?.isOpen?jsx(a$3,{...i$1,state:r,children:e$1}):null};Q.displayName="Menu";export{Q as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a,b as b$1,c as c$1,d}from'./chunk-VHDXSFQC.mjs';import {c}from'./chunk-
|
|
1
|
+
import {a,b as b$1,c as c$1,d}from'./chunk-VHDXSFQC.mjs';import {c}from'./chunk-L3SNGDBH.mjs';import {b}from'./chunk-PAQQ7MQG.mjs';import {b as b$2}from'./chunk-TZ4MVY4E.mjs';import {a as a$1}from'./chunk-4QEH5CGK.mjs';import v,{useMemo}from'react';import {jsx}from'react/jsx-runtime';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b as b$4,a as a$7,c as c$4}from'./chunk-WOVAT6U4.mjs';import {c,d,b as b$5,e as e$1,f as f$2}from'./chunk-FJ2JRD3H.mjs';import {e,c as c$2,f as f$1}from'./chunk-O66FNQSB.mjs';import {a as a$9}from'./chunk-AZRPXTYJ.mjs';import {f,d as d$1}from'./chunk-YVYMYKYN.mjs';import {b as b$3}from'./chunk-246VHB32.mjs';import {a as a$1,c as c$3,b as b$7}from'./chunk-
|
|
1
|
+
import {b as b$4,a as a$7,c as c$4}from'./chunk-WOVAT6U4.mjs';import {c,d,b as b$5,e as e$1,f as f$2}from'./chunk-FJ2JRD3H.mjs';import {e,c as c$2,f as f$1}from'./chunk-O66FNQSB.mjs';import {a as a$9}from'./chunk-AZRPXTYJ.mjs';import {f,d as d$1}from'./chunk-YVYMYKYN.mjs';import {b as b$3}from'./chunk-246VHB32.mjs';import {a as a$1,c as c$3,b as b$7}from'./chunk-L3SNGDBH.mjs';import {b as b$6}from'./chunk-PAQQ7MQG.mjs';import {a as a$6,b as b$1}from'./chunk-KCHAWPUN.mjs';import {a as a$a}from'./chunk-NSC53QWT.mjs';import {a as a$4}from'./chunk-O7XK2WIX.mjs';import {b as b$2}from'./chunk-N2XGJKZG.mjs';import {a}from'./chunk-66CUIXA6.mjs';import {a as a$3}from'./chunk-RSKKEGJZ.mjs';import {a as a$8}from'./chunk-K6X2BHPP.mjs';import {a as a$2}from'./chunk-3FYY26ED.mjs';import {b,c as c$1}from'./chunk-TZ4MVY4E.mjs';import {a as a$5}from'./chunk-4QEH5CGK.mjs';import B,{useRef,createElement,useContext,useEffect}from'react';import {CheckmarkIcon}from'@baseline-ui/icons/24';import {jsxs,jsx,Fragment}from'react/jsx-runtime';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$j}from'./chunk-FTYXFTJV.mjs';import {a as a$l}from'./chunk-
|
|
1
|
+
import {a as a$j}from'./chunk-FTYXFTJV.mjs';import {a as a$l}from'./chunk-GZ5ZWXIC.mjs';import {c as c$4}from'./chunk-L452ID76.mjs';import {c as c$2}from'./chunk-X3NOIEDZ.mjs';import {I,j,f,e,p,F,A,H,i,B,s,C,G,z,h,g,m,q,D,E,t,l,v,y,u,a as a$m,w,d,c as c$6,x,k,b as b$8,o,n,r}from'./chunk-7HZ5JFYX.mjs';import {a as a$6,b as b$7,c as c$5,d as d$1}from'./chunk-EU75HMPG.mjs';import {a as a$o}from'./chunk-NPJX2CEI.mjs';import {a as a$h}from'./chunk-5YYWD7PK.mjs';import {a as a$b}from'./chunk-ECPG4S5O.mjs';import {a as a$c}from'./chunk-5PIO6M4F.mjs';import {b as b$5,e as e$1}from'./chunk-DF3BVX5Z.mjs';import {a as a$d}from'./chunk-NSC53QWT.mjs';import {b as b$2,c as c$3}from'./chunk-GX2IOGYR.mjs';import {b as b$4}from'./chunk-J3MJZQUJ.mjs';import {a as a$g}from'./chunk-O7XK2WIX.mjs';import {a as a$k}from'./chunk-JB3O4ABN.mjs';import {a as a$f}from'./chunk-F6JQN7YM.mjs';import {a as a$9}from'./chunk-F3HQNHR5.mjs';import {a as a$n}from'./chunk-JJPCZOOI.mjs';import {a as a$i}from'./chunk-ZGRRD3TU.mjs';import {b as b$3}from'./chunk-N2XGJKZG.mjs';import {b}from'./chunk-4ZJMZB5B.mjs';import {b as b$6,j as j$1}from'./chunk-4NYPVKDO.mjs';import {a as a$8}from'./chunk-UUBOEBYZ.mjs';import {a as a$e}from'./chunk-VDUFLHKK.mjs';import {a as a$7}from'./chunk-4PYEGHW5.mjs';import {a as a$5}from'./chunk-66CUIXA6.mjs';import {a as a$a}from'./chunk-X3AXUU3H.mjs';import {a as a$1}from'./chunk-YS3Y5KGV.mjs';import {a as a$3}from'./chunk-RSKKEGJZ.mjs';import {a as a$2}from'./chunk-K6X2BHPP.mjs';import {a}from'./chunk-3FYY26ED.mjs';import {b as b$1,c as c$1}from'./chunk-TZ4MVY4E.mjs';import {c}from'./chunk-JDLUGVXG.mjs';import {g as g$1}from'./chunk-AUOQSTS5.mjs';import {a as a$4}from'./chunk-4QEH5CGK.mjs';import No,{useCallback,useMemo,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {TextIcon,PlusIcon,MinusIcon}from'@baseline-ui/icons/20';import {sprinkles}from'@baseline-ui/tokens';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as useContainerScopedRef}from'../chunk-4BYKAG4W.mjs';import'../chunk-XPISSX5R.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -3829,6 +3829,21 @@ interface OverlayProps {
|
|
|
3829
3829
|
isExiting?: boolean;
|
|
3830
3830
|
}
|
|
3831
3831
|
|
|
3832
|
+
interface MenuItemRenderProps extends ItemRenderProps {
|
|
3833
|
+
/**
|
|
3834
|
+
* Whether the item has a submenu.
|
|
3835
|
+
*
|
|
3836
|
+
* @selector [data-has-submenu]
|
|
3837
|
+
*/
|
|
3838
|
+
hasSubmenu: boolean;
|
|
3839
|
+
/**
|
|
3840
|
+
* Whether the item's submenu is open.
|
|
3841
|
+
*
|
|
3842
|
+
* @selector [data-open]
|
|
3843
|
+
*/
|
|
3844
|
+
isOpen: boolean;
|
|
3845
|
+
}
|
|
3846
|
+
|
|
3832
3847
|
interface ProgressBarBaseProps {
|
|
3833
3848
|
/**
|
|
3834
3849
|
* The current value (controlled).
|
|
@@ -5889,6 +5904,13 @@ interface ListOption<T = Record<string, any>> {
|
|
|
5889
5904
|
icon?: React__default.FC<IconProps>;
|
|
5890
5905
|
data?: T;
|
|
5891
5906
|
}
|
|
5907
|
+
/**
|
|
5908
|
+
* Keep keyboardShortcut on the shared item so it survives typed collection rebuilding.
|
|
5909
|
+
*/
|
|
5910
|
+
type CollectionOptionItem = ListOption & {
|
|
5911
|
+
/** A label for the option's trailing slot, such as a keyboard shortcut (`"⌘K"`). */
|
|
5912
|
+
keyboardShortcut?: string;
|
|
5913
|
+
};
|
|
5892
5914
|
interface ListSection<T = Record<string, any>> {
|
|
5893
5915
|
id: string;
|
|
5894
5916
|
title?: string;
|
|
@@ -6831,12 +6853,121 @@ declare const PopoverTrigger: React__default.FC<PopoverTriggerProps>;
|
|
|
6831
6853
|
|
|
6832
6854
|
declare const Popover: React__default.FC<PopoverProps>;
|
|
6833
6855
|
|
|
6834
|
-
|
|
6835
|
-
|
|
6856
|
+
interface ListHandle {
|
|
6857
|
+
/** Scrolls the listbox to the specified item. */
|
|
6858
|
+
scrollIntoView: (id: string, options?: ScrollIntoViewOptions) => void;
|
|
6859
|
+
/** Imperatively focuses the specified key */
|
|
6860
|
+
setFocusedKey: (key: string) => void;
|
|
6861
|
+
}
|
|
6862
|
+
interface CollectionOptionRenderProps<TOption extends ListOption = ListOption, TRenderProps extends ListBoxItemRenderProps = ListBoxItemRenderProps> {
|
|
6863
|
+
/**
|
|
6864
|
+
* The custom render function for the collection's options.
|
|
6865
|
+
*
|
|
6866
|
+
* Replaces the option's entire contents, the default selection indicator
|
|
6867
|
+
* included, so render your own affordance from `options` when you need one.
|
|
6868
|
+
* The hover, focus and disabled styling lives in that default body too —
|
|
6869
|
+
* only selection and keyboard behavior are unaffected. Keep a text label in
|
|
6870
|
+
* the output; it is what names the option to a screen reader.
|
|
6871
|
+
*
|
|
6872
|
+
* Reading component state here works, at the cost of rebuilding every cached option and
|
|
6873
|
+
* section whenever the function's identity changes — see {@link UNSAFE_ListBoxProps.items}
|
|
6874
|
+
* for when that cost applies.
|
|
6875
|
+
*/
|
|
6876
|
+
renderOption?: (item: TOption, options: TRenderProps) => React__default.ReactNode;
|
|
6877
|
+
/**
|
|
6878
|
+
* A CSS class name added to the option's built-in classes.
|
|
6879
|
+
*
|
|
6880
|
+
* Compared by identity, so an inline function or an unmemoized value rebuilds every
|
|
6881
|
+
* cached option and section on each render. A plain string is compared by value.
|
|
6882
|
+
*/
|
|
6883
|
+
optionClassName?: string | ((item: TOption, renderProps: TRenderProps) => string | undefined);
|
|
6884
|
+
/**
|
|
6885
|
+
* The style of the option.
|
|
6886
|
+
*
|
|
6887
|
+
* Compared by identity, so an inline function or object literal rebuilds every cached
|
|
6888
|
+
* option and section on each render — memoize it to avoid that.
|
|
6889
|
+
*/
|
|
6890
|
+
optionStyle?: React__default.CSSProperties | ((item: TOption, renderProps: TRenderProps) => React__default.CSSProperties | undefined);
|
|
6891
|
+
}
|
|
6892
|
+
interface CollectionSectionRenderProps {
|
|
6893
|
+
/**
|
|
6894
|
+
* The custom render function for the listbox sections.
|
|
6895
|
+
*
|
|
6896
|
+
* Reading component state here works, at the cost of rebuilding every cached option and
|
|
6897
|
+
* section whenever the function's identity changes — see {@link UNSAFE_ListBoxProps.items}
|
|
6898
|
+
* for when that cost applies.
|
|
6899
|
+
*
|
|
6900
|
+
* @param section ListSection
|
|
6901
|
+
*/
|
|
6902
|
+
renderSectionHeader?: (section: ListSection) => React__default.ReactNode;
|
|
6903
|
+
/**
|
|
6904
|
+
* The CSS class name for the section.
|
|
6905
|
+
*
|
|
6906
|
+
* Compared by identity, so an inline function or an unmemoized value rebuilds every
|
|
6907
|
+
* cached option and section on each render. A plain string is compared by value.
|
|
6908
|
+
*/
|
|
6909
|
+
sectionClassName?: string | ((section: ListSection) => string | undefined);
|
|
6910
|
+
/**
|
|
6911
|
+
* The style of the section.
|
|
6912
|
+
*
|
|
6913
|
+
* Compared by identity, so an inline function or object literal rebuilds every cached
|
|
6914
|
+
* option and section on each render — memoize it to avoid that.
|
|
6915
|
+
*/
|
|
6916
|
+
sectionStyle?: React__default.CSSProperties | ((section: ListSection) => React__default.CSSProperties | undefined);
|
|
6917
|
+
/**
|
|
6918
|
+
* Whether to show each section title when provided.
|
|
6919
|
+
*
|
|
6920
|
+
* @default false
|
|
6921
|
+
*/
|
|
6922
|
+
showSectionHeader?: boolean;
|
|
6923
|
+
/**
|
|
6924
|
+
* Wether to add initial padding to section titles if shown.
|
|
6925
|
+
*
|
|
6926
|
+
* @default false
|
|
6927
|
+
*/
|
|
6928
|
+
withSectionHeaderPadding?: boolean;
|
|
6929
|
+
}
|
|
6930
|
+
type CollectionRenderProps = CollectionOptionRenderProps & CollectionSectionRenderProps;
|
|
6931
|
+
interface UNSAFE_ListBoxProps extends StylingProps, Omit<AriaListBoxProps<ListItem> & AriaListBoxOptions<ListItem>, "children" | "linkBehavior" | "isVirtualized" | "keyboardDelegate" | "items">, Pick<ListBoxProps$1<ListItem>, "dragAndDropHooks" | "orientation" | "layout" | "dependencies">, CollectionRenderProps {
|
|
6932
|
+
/**
|
|
6933
|
+
* The items to render in the listbox. Items have the following shape:
|
|
6934
|
+
*
|
|
6935
|
+
* ```ts
|
|
6936
|
+
* export type ListOption = {
|
|
6937
|
+
* id: string;
|
|
6938
|
+
* label: string;
|
|
6939
|
+
* description?: string;
|
|
6940
|
+
* icon?: React.FC<IconProps>;
|
|
6941
|
+
* };
|
|
6942
|
+
*
|
|
6943
|
+
* export type ListSection = {
|
|
6944
|
+
* id: string;
|
|
6945
|
+
* title?: string;
|
|
6946
|
+
* type: "section";
|
|
6947
|
+
* children: ListOption[];
|
|
6948
|
+
* };
|
|
6949
|
+
*
|
|
6950
|
+
* type ListItem = ListOption | ListSection;
|
|
6951
|
+
* ```
|
|
6952
|
+
*
|
|
6953
|
+
* Rendered options and sections are cached per item object. Building this array inline
|
|
6954
|
+
* (`items={data.map(...)}`) produces new item objects every render, so nothing is ever
|
|
6955
|
+
* reused and the customisation props cost nothing; memoize it and the cache applies,
|
|
6956
|
+
* which is when their identity starts to matter.
|
|
6957
|
+
*/
|
|
6958
|
+
items?: ListItem[];
|
|
6959
|
+
/** The label for the listbox. */
|
|
6960
|
+
label?: React__default.ReactNode;
|
|
6961
|
+
/** Handle to access the listbox methods. */
|
|
6962
|
+
listBoxHandle?: React__default.RefObject<ListHandle>;
|
|
6963
|
+
}
|
|
6964
|
+
|
|
6965
|
+
type MenuOption = Omit<CollectionOptionItem, "description"> & {
|
|
6836
6966
|
/**
|
|
6837
6967
|
* Nested menu items. When present, this option becomes a submenu trigger that
|
|
6838
|
-
* opens a nested menu instead of acting as a leaf action
|
|
6839
|
-
*
|
|
6968
|
+
* opens a nested menu instead of acting as a leaf action, and spends its
|
|
6969
|
+
* trailing `keyboardShortcut` slot on a chevron. Recursive: a submenu may
|
|
6970
|
+
* itself contain leaf options, sections, or deeper submenus.
|
|
6840
6971
|
*/
|
|
6841
6972
|
items?: MenuItem[];
|
|
6842
6973
|
};
|
|
@@ -6846,12 +6977,17 @@ type MenuSection = Omit<ListSection, "children"> & {
|
|
|
6846
6977
|
type MenuItem = MenuOption | MenuSection;
|
|
6847
6978
|
type MenuPopoverProps = Pick<PopoverContentProps, "isNonModal" | "placement" | "shouldUpdatePosition" | "shouldFlip" | "boundaryElement" | "boundaryAxis" | "horizontalBoundaryBehavior" | "crossOffset" | "offset" | "portalContainer">;
|
|
6848
6979
|
type MenuSelectionKeys = "selectionMode" | "selectedKeys" | "defaultSelectedKeys" | "onSelectionChange";
|
|
6849
|
-
interface MenuPropsBase extends MenuPopoverProps, MenuTriggerProps, Omit<AriaMenuProps<MenuItem>, "children" | MenuSelectionKeys>, Omit<AriaMenuTriggerProps, "type"> {
|
|
6980
|
+
interface MenuPropsBase extends MenuPopoverProps, MenuTriggerProps, CollectionOptionRenderProps<MenuOption, MenuItemRenderProps>, Omit<AriaMenuProps<MenuItem>, "children" | MenuSelectionKeys>, Omit<AriaMenuTriggerProps, "type"> {
|
|
6850
6981
|
/** The `className` property assigned to the root element of the component. */
|
|
6851
6982
|
className?: string;
|
|
6852
6983
|
/** The `className` property assigned to the content element of the component. */
|
|
6853
6984
|
contentClassName?: string;
|
|
6854
|
-
/**
|
|
6985
|
+
/**
|
|
6986
|
+
* The `className` property assigned to the item element of the component.
|
|
6987
|
+
*
|
|
6988
|
+
* @deprecated Use `optionClassName`, which also accepts a function of the item
|
|
6989
|
+
* and its render state. Both are applied when set.
|
|
6990
|
+
*/
|
|
6855
6991
|
itemClassName?: string;
|
|
6856
6992
|
/**
|
|
6857
6993
|
* A list of items to render in the menu. See `MenuItem`.
|
|
@@ -8140,116 +8276,6 @@ declare const Accordion: React__default.ForwardRefExoticComponent<AccordionProps
|
|
|
8140
8276
|
|
|
8141
8277
|
declare const AccordionItem: React__default.ForwardRefExoticComponent<AccordionItemProps & React__default.RefAttributes<HTMLHeadingElement>>;
|
|
8142
8278
|
|
|
8143
|
-
interface ListHandle {
|
|
8144
|
-
/** Scrolls the listbox to the specified item. */
|
|
8145
|
-
scrollIntoView: (id: string, options?: ScrollIntoViewOptions) => void;
|
|
8146
|
-
/** Imperatively focuses the specified key */
|
|
8147
|
-
setFocusedKey: (key: string) => void;
|
|
8148
|
-
}
|
|
8149
|
-
interface CollectionOptionRenderProps {
|
|
8150
|
-
/**
|
|
8151
|
-
* The custom render function for the listbox options.
|
|
8152
|
-
*
|
|
8153
|
-
* Replaces the option's entire contents, including the default selection
|
|
8154
|
-
* indicator — render your own affordance from `options.isSelected` if you
|
|
8155
|
-
* need one. Selection and keyboard behavior are unaffected.
|
|
8156
|
-
*
|
|
8157
|
-
* Reading component state here works, at the cost of rebuilding every cached option and
|
|
8158
|
-
* section whenever the function's identity changes — see {@link UNSAFE_ListBoxProps.items}
|
|
8159
|
-
* for when that cost applies.
|
|
8160
|
-
*
|
|
8161
|
-
* @param item ListOption
|
|
8162
|
-
* @param options ListBoxItemRenderProps
|
|
8163
|
-
*/
|
|
8164
|
-
renderOption?: (item: ListOption, options: ListBoxItemRenderProps) => React__default.ReactNode;
|
|
8165
|
-
/**
|
|
8166
|
-
* A CSS class name added to the option's built-in classes.
|
|
8167
|
-
*
|
|
8168
|
-
* Compared by identity, so an inline function or an unmemoized value rebuilds every
|
|
8169
|
-
* cached option and section on each render. A plain string is compared by value.
|
|
8170
|
-
*/
|
|
8171
|
-
optionClassName?: string | ((item: ListOption, renderProps: ListBoxItemRenderProps) => string | undefined);
|
|
8172
|
-
/**
|
|
8173
|
-
* The style of the option.
|
|
8174
|
-
*
|
|
8175
|
-
* Compared by identity, so an inline function or object literal rebuilds every cached
|
|
8176
|
-
* option and section on each render — memoize it to avoid that.
|
|
8177
|
-
*/
|
|
8178
|
-
optionStyle?: React__default.CSSProperties | ((item: ListOption, renderProps: ListBoxItemRenderProps) => React__default.CSSProperties | undefined);
|
|
8179
|
-
}
|
|
8180
|
-
interface CollectionSectionRenderProps {
|
|
8181
|
-
/**
|
|
8182
|
-
* The custom render function for the listbox sections.
|
|
8183
|
-
*
|
|
8184
|
-
* Reading component state here works, at the cost of rebuilding every cached option and
|
|
8185
|
-
* section whenever the function's identity changes — see {@link UNSAFE_ListBoxProps.items}
|
|
8186
|
-
* for when that cost applies.
|
|
8187
|
-
*
|
|
8188
|
-
* @param section ListSection
|
|
8189
|
-
*/
|
|
8190
|
-
renderSectionHeader?: (section: ListSection) => React__default.ReactNode;
|
|
8191
|
-
/**
|
|
8192
|
-
* The CSS class name for the section.
|
|
8193
|
-
*
|
|
8194
|
-
* Compared by identity, so an inline function or an unmemoized value rebuilds every
|
|
8195
|
-
* cached option and section on each render. A plain string is compared by value.
|
|
8196
|
-
*/
|
|
8197
|
-
sectionClassName?: string | ((section: ListSection) => string | undefined);
|
|
8198
|
-
/**
|
|
8199
|
-
* The style of the section.
|
|
8200
|
-
*
|
|
8201
|
-
* Compared by identity, so an inline function or object literal rebuilds every cached
|
|
8202
|
-
* option and section on each render — memoize it to avoid that.
|
|
8203
|
-
*/
|
|
8204
|
-
sectionStyle?: React__default.CSSProperties | ((section: ListSection) => React__default.CSSProperties | undefined);
|
|
8205
|
-
/**
|
|
8206
|
-
* Whether to show each section title when provided.
|
|
8207
|
-
*
|
|
8208
|
-
* @default false
|
|
8209
|
-
*/
|
|
8210
|
-
showSectionHeader?: boolean;
|
|
8211
|
-
/**
|
|
8212
|
-
* Wether to add initial padding to section titles if shown.
|
|
8213
|
-
*
|
|
8214
|
-
* @default false
|
|
8215
|
-
*/
|
|
8216
|
-
withSectionHeaderPadding?: boolean;
|
|
8217
|
-
}
|
|
8218
|
-
type CollectionRenderProps = CollectionOptionRenderProps & CollectionSectionRenderProps;
|
|
8219
|
-
interface UNSAFE_ListBoxProps extends StylingProps, Omit<AriaListBoxProps<ListItem> & AriaListBoxOptions<ListItem>, "children" | "linkBehavior" | "isVirtualized" | "keyboardDelegate" | "items">, Pick<ListBoxProps$1<ListItem>, "dragAndDropHooks" | "orientation" | "layout" | "dependencies">, CollectionRenderProps {
|
|
8220
|
-
/**
|
|
8221
|
-
* The items to render in the listbox. Items have the following shape:
|
|
8222
|
-
*
|
|
8223
|
-
* ```ts
|
|
8224
|
-
* export type ListOption = {
|
|
8225
|
-
* id: string;
|
|
8226
|
-
* label: string;
|
|
8227
|
-
* description?: string;
|
|
8228
|
-
* icon?: React.FC<IconProps>;
|
|
8229
|
-
* };
|
|
8230
|
-
*
|
|
8231
|
-
* export type ListSection = {
|
|
8232
|
-
* id: string;
|
|
8233
|
-
* title?: string;
|
|
8234
|
-
* type: "section";
|
|
8235
|
-
* children: ListOption[];
|
|
8236
|
-
* };
|
|
8237
|
-
*
|
|
8238
|
-
* type ListItem = ListOption | ListSection;
|
|
8239
|
-
* ```
|
|
8240
|
-
*
|
|
8241
|
-
* Rendered options and sections are cached per item object. Building this array inline
|
|
8242
|
-
* (`items={data.map(...)}`) produces new item objects every render, so nothing is ever
|
|
8243
|
-
* reused and the customisation props cost nothing; memoize it and the cache applies,
|
|
8244
|
-
* which is when their identity starts to matter.
|
|
8245
|
-
*/
|
|
8246
|
-
items?: ListItem[];
|
|
8247
|
-
/** The label for the listbox. */
|
|
8248
|
-
label?: React__default.ReactNode;
|
|
8249
|
-
/** Handle to access the listbox methods. */
|
|
8250
|
-
listBoxHandle?: React__default.RefObject<ListHandle>;
|
|
8251
|
-
}
|
|
8252
|
-
|
|
8253
8279
|
type SelectionMode = "single" | "multiple";
|
|
8254
8280
|
interface SelectProps<M extends SelectionMode = SelectionMode> extends Omit<AriaSelectOptions<ListItem, M> & SelectStateOptions<ListItem, M> & PopoverContentProps, "validationState" | "items" | "children" | "isRequired" | "className" | "style" | "triggerRef" | "validate" | "validationBehavior" | "keyboardDelegate" | "state" | "overlayProps">, Pick<UNSAFE_ListBoxProps, "items" | "optionStyle" | "optionClassName" | "showSectionHeader">, Pick<ColorInputProps, "onTriggerPress">, StylingProps {
|
|
8255
8281
|
/**
|
|
@@ -10569,7 +10595,7 @@ interface ColorSwatchPickerProps extends StylingProps, Pick<RadioGroupProps, "op
|
|
|
10569
10595
|
|
|
10570
10596
|
declare const ColorSwatchPicker: React__default.ForwardRefExoticComponent<ColorSwatchPickerProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
10571
10597
|
|
|
10572
|
-
declare const TimeField: React__default.ForwardRefExoticComponent<StylingProps & Omit<Omit<TimeFieldStateOptions<TimeValue>, "locale"> & AriaTimeFieldProps<TimeValue>, "
|
|
10598
|
+
declare const TimeField: React__default.ForwardRefExoticComponent<StylingProps & Omit<Omit<TimeFieldStateOptions<TimeValue>, "locale"> & AriaTimeFieldProps<TimeValue>, "validationState" | "isRequired" | "validate" | "isInvalid"> & Pick<SharedInputProps, "label" | "variant" | "validationState" | "labelPosition"> & InputMessage & React__default.RefAttributes<HTMLDivElement>>;
|
|
10573
10599
|
|
|
10574
10600
|
type TimeFieldProps = StylingProps & Omit<Omit<TimeFieldStateOptions, "locale"> & AriaTimeFieldProps<TimeValue>, "validationState" | "isInvalid" | "isRequired" | "validate"> & Pick<SharedInputProps, "variant" | "labelPosition" | "validationState" | "label"> & InputMessage;
|
|
10575
10601
|
|
|
@@ -10848,7 +10874,7 @@ type DateFieldProps = StylingProps & Omit<Omit<DateFieldStateOptions, "locale">
|
|
|
10848
10874
|
openCalendarLabel?: string;
|
|
10849
10875
|
};
|
|
10850
10876
|
|
|
10851
|
-
declare const DateField: React__default.ForwardRefExoticComponent<StylingProps & Omit<Omit<DateFieldStateOptions<DateValue>, "locale"> & AriaDateFieldProps<DateValue>, "
|
|
10877
|
+
declare const DateField: React__default.ForwardRefExoticComponent<StylingProps & Omit<Omit<DateFieldStateOptions<DateValue>, "locale"> & AriaDateFieldProps<DateValue>, "validationState" | "isRequired" | "validate" | "isInvalid" | "createCalendar"> & Pick<SharedInputProps, "label" | "variant" | "validationState" | "labelPosition"> & InputMessage & {
|
|
10852
10878
|
pickerType?: DateFieldPickerType;
|
|
10853
10879
|
openCalendarLabel?: string;
|
|
10854
10880
|
} & React__default.RefAttributes<HTMLDivElement>>;
|