@basic-ui/material 0.1.6 → 0.1.7
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/build/cjs/index.js +12 -9
- package/build/cjs/index.js.map +1 -1
- package/build/esm/BottomSheet/BottomSheet.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +1 -1
- package/build/esm/Button/Button.d.ts +1 -1
- package/build/esm/CheckBox/CheckBox.d.ts +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +1 -1
- package/build/esm/Combobox/Combobox.d.ts +7 -7
- package/build/esm/Dialog/Dialog.d.ts +1 -1
- package/build/esm/Dialog/DialogBackdrop.d.ts +1 -1
- package/build/esm/Dialog/DialogSurface.d.ts +1 -1
- package/build/esm/List/List.d.ts +2 -1
- package/build/esm/List/List.js +3 -2
- package/build/esm/List/List.js.map +1 -1
- package/build/esm/ListItem/ListItem.d.ts +2 -1
- package/build/esm/ListItem/ListItem.js +3 -2
- package/build/esm/ListItem/ListItem.js.map +1 -1
- package/build/esm/Menu/Menu.d.ts +4 -4
- package/build/esm/RadioButton/RadioGroup.d.ts +1 -1
- package/build/esm/Select/Select.d.ts +1 -1
- package/build/esm/Select/Select.js +1 -1
- package/build/esm/Select/Select.js.map +1 -1
- package/build/esm/Select/defaultRender.d.ts +1 -1
- package/build/esm/Select/defaultRender.js +1 -1
- package/build/esm/Select/defaultRender.js.map +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +1 -1
- package/build/esm/SelectItem/SelectItem.js +4 -3
- package/build/esm/SelectItem/SelectItem.js.map +1 -1
- package/build/esm/Snackbar/Snackbar.d.ts +1 -1
- package/build/esm/Switch/Switch.d.ts +1 -1
- package/build/esm/Tab/Tab.d.ts +1 -1
- package/build/esm/Tab/TabList.d.ts +1 -1
- package/build/esm/Tab/TabPanel.d.ts +1 -1
- package/build/esm/TabIndicator/TabIndicator.d.ts +1 -1
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/esm/TextField/TextField.d.ts +1 -1
- package/build/esm/Tooltip/Tooltip.d.ts +1 -1
- package/build/tsconfig.tsbuildinfo +1886 -1886
- package/package.json +2 -3
- package/src/List/List.tsx +3 -1
- package/src/ListItem/ListItem.tsx +3 -1
- package/src/Menu/Menu.story.tsx +27 -3
- package/src/Select/Select.story.tsx +45 -2
- package/src/Select/Select.tsx +3 -4
- package/src/Select/defaultRender.ts +2 -2
- package/src/SelectItem/SelectItem.tsx +6 -4
|
@@ -2,10 +2,11 @@ import type * as React from 'react';
|
|
|
2
2
|
import { BoxProps } from '../Box';
|
|
3
3
|
export interface ListItemProps extends BoxProps {
|
|
4
4
|
as?: React.ElementType<any>;
|
|
5
|
+
innerAs?: React.ElementType<any>;
|
|
5
6
|
children?: React.ReactNode;
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
selected?: boolean;
|
|
8
9
|
color?: string;
|
|
9
10
|
rippleColor?: string;
|
|
10
11
|
}
|
|
11
|
-
export declare const ListItem: React.ForwardRefExoticComponent<Pick<ListItemProps, "
|
|
12
|
+
export declare const ListItem: React.ForwardRefExoticComponent<Pick<ListItemProps, "children" | "p" | "slot" | "style" | "title" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "backgroundImage" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxShadow" | "color" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "textAlign" | "textShadow" | "top" | "translate" | "verticalAlign" | "width" | "zIndex" | "background" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "gridColumnGap" | "gridGap" | "gridRowGap" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "variant" | "size" | "hidden" | "as" | "sx" | "__css" | "tx" | "theme" | "borderX" | "borderY" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "disabled" | "rippleColor" | "innerAs" | "selected"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -10,6 +10,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
10
10
|
export const ListItem = /*#__PURE__*/forwardRef(function ListItem(props, forwardedRef) {
|
|
11
11
|
const {
|
|
12
12
|
as = 'div',
|
|
13
|
+
innerAs,
|
|
13
14
|
children,
|
|
14
15
|
selected: selectedProp = false,
|
|
15
16
|
'aria-selected': ariaSelectedProp = false,
|
|
@@ -18,7 +19,7 @@ export const ListItem = /*#__PURE__*/forwardRef(function ListItem(props, forward
|
|
|
18
19
|
rippleColor,
|
|
19
20
|
__css
|
|
20
21
|
} = props,
|
|
21
|
-
otherProps = _objectWithoutPropertiesLoose(props, ["as", "children", "selected", "aria-selected", "disabled", "color", "rippleColor", "__css"]);
|
|
22
|
+
otherProps = _objectWithoutPropertiesLoose(props, ["as", "innerAs", "children", "selected", "aria-selected", "disabled", "color", "rippleColor", "__css"]);
|
|
22
23
|
|
|
23
24
|
const selected = ariaSelectedProp || selectedProp;
|
|
24
25
|
const color = colorProp ? colorProp : selected ? 'primary' : 'on.surface';
|
|
@@ -30,7 +31,7 @@ export const ListItem = /*#__PURE__*/forwardRef(function ListItem(props, forward
|
|
|
30
31
|
},
|
|
31
32
|
children: /*#__PURE__*/_jsx(RippleBox, _extends({
|
|
32
33
|
ref: forwardedRef,
|
|
33
|
-
as: as,
|
|
34
|
+
as: innerAs || as,
|
|
34
35
|
theme: theme,
|
|
35
36
|
display: "flex",
|
|
36
37
|
"data-disabled": disabled ? '' : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ListItem/ListItem.tsx"],"names":["forwardRef","RippleBox","useTheme","ListItemProvider","get","alpha","ListItem","props","forwardedRef","as","children","selected","selectedProp","ariaSelectedProp","disabled","color","colorProp","rippleColor","__css","otherProps","theme","undefined","px","py","backgroundColor","outline","textDecoration","WebkitTapHighlightColor"],"mappings":";;AAAA,SAASA,UAAT,QAA2B,OAA3B;AAIA,SAASC,SAAT,QAA0B,WAA1B;AACA,SAASC,QAAT,QAAyB,UAAzB;AACA,SAASC,gBAAT,QAAiC,WAAjC;AACA,SAASC,GAAT,QAAoB,oBAApB;AACA,SAASC,KAAT,QAAsB,UAAtB;;
|
|
1
|
+
{"version":3,"sources":["../../../src/ListItem/ListItem.tsx"],"names":["forwardRef","RippleBox","useTheme","ListItemProvider","get","alpha","ListItem","props","forwardedRef","as","innerAs","children","selected","selectedProp","ariaSelectedProp","disabled","color","colorProp","rippleColor","__css","otherProps","theme","undefined","px","py","backgroundColor","outline","textDecoration","WebkitTapHighlightColor"],"mappings":";;AAAA,SAASA,UAAT,QAA2B,OAA3B;AAIA,SAASC,SAAT,QAA0B,WAA1B;AACA,SAASC,QAAT,QAAyB,UAAzB;AACA,SAASC,gBAAT,QAAiC,WAAjC;AACA,SAASC,GAAT,QAAoB,oBAApB;AACA,SAASC,KAAT,QAAsB,UAAtB;;AAYA,OAAO,MAAMC,QAAQ,gBAAGN,UAAU,CAChC,SAASM,QAAT,CAAkBC,KAAlB,EAAyBC,YAAzB,EAAuC;AACrC,QAAM;AACJC,IAAAA,EAAE,GAAG,KADD;AAEJC,IAAAA,OAFI;AAGJC,IAAAA,QAHI;AAIJC,IAAAA,QAAQ,EAAEC,YAAY,GAAG,KAJrB;AAKJ,qBAAiBC,gBAAgB,GAAG,KALhC;AAMJC,IAAAA,QAAQ,GAAG,KANP;AAOJC,IAAAA,KAAK,EAAEC,SAPH;AAQJC,IAAAA,WARI;AASJC,IAAAA;AATI,MAWFZ,KAXJ;AAAA,QAUKa,UAVL,iCAWIb,KAXJ;;AAYA,QAAMK,QAAQ,GAAGE,gBAAgB,IAAID,YAArC;AACA,QAAMG,KAAK,GAAGC,SAAS,GAAGA,SAAH,GAAeL,QAAQ,GAAG,SAAH,GAAe,YAA7D;AACA,QAAMS,KAAK,GAAGnB,QAAQ,EAAtB;AAEA,sBACE,KAAC,gBAAD;AAAkB,IAAA,KAAK,EAAE;AAAEc,MAAAA,KAAF;AAASD,MAAAA;AAAT,KAAzB;AAAA,2BACE,KAAC,SAAD;AACE,MAAA,GAAG,EAAEP,YADP;AAEE,MAAA,EAAE,EAAEE,OAAO,IAAID,EAFjB;AAGE,MAAA,KAAK,EAAEY,KAHT;AAIE,MAAA,OAAO,EAAC,MAJV;AAKE,uBAAeN,QAAQ,GAAG,EAAH,GAAQO,SALjC;AAME,MAAA,WAAW,EAAEJ,WAAW,IAAIF,KAN9B;AAOE,MAAA,WAAW,EAAEJ,QAAQ,GAAG,IAAH,GAAU,CAPjC;AAQE,MAAA,YAAY,EAAEA,QAAQ,GAAG,IAAH,GAAU,IARlC;AASE,MAAA,YAAY,EAAEA,QAAQ,GAAG,IAAH,GAAU,IATlC;AAUE,uBAAeA,QAAQ,GAAG,MAAH,GAAYU,SAVrC;AAWE,MAAA,QAAQ,EAAEP;AAXZ,OAYMK,UAZN;AAaE,MAAA,KAAK;AACHG,QAAAA,EAAE,EAAE,CADD;AAEHC,QAAAA,EAAE,WAFC;AAGHC,QAAAA,eAAe,EAAE,aAHd;AAIHT,QAAAA,KAAK,EAAED,QAAQ,GAAGV,KAAK,CAACW,KAAD,EAAQ,GAAR,CAAR,GAAuBX,KAAK,CAACW,KAAD,EAAQ,IAAR,CAJxC;AAKH,kBAAU;AACRU,UAAAA,OAAO,EAAE;AADD,SALP;AAQHC,QAAAA,cAAc,EAAE,MARb;AASHC,QAAAA,uBAAuB,EAAE;AATtB,SAUAxB,GAAG,CAACiB,KAAD,EAAQ,gBAAR,CAVH,EAWAF,KAXA,CAbP;AAAA,gBA2BGR;AA3BH;AADF,IADF;AAiCD,CAnD+B,CAA3B","sourcesContent":["import { forwardRef } from 'react';\nimport type * as React from 'react';\nimport { BoxProps } from '../Box';\nimport { rem } from 'polished';\nimport { RippleBox } from '../Ripple';\nimport { useTheme } from '../theme';\nimport { ListItemProvider } from './context';\nimport { get } from '@styled-system/css';\nimport { alpha } from '../color';\n\nexport interface ListItemProps extends BoxProps {\n as?: React.ElementType<any>;\n innerAs?: React.ElementType<any>;\n children?: React.ReactNode;\n disabled?: boolean;\n selected?: boolean;\n color?: string;\n rippleColor?: string;\n}\n\nexport const ListItem = forwardRef<HTMLDivElement, ListItemProps>(\n function ListItem(props, forwardedRef) {\n const {\n as = 'div',\n innerAs,\n children,\n selected: selectedProp = false,\n 'aria-selected': ariaSelectedProp = false,\n disabled = false,\n color: colorProp,\n rippleColor,\n __css,\n ...otherProps\n } = props;\n const selected = ariaSelectedProp || selectedProp;\n const color = colorProp ? colorProp : selected ? 'primary' : 'on.surface';\n const theme = useTheme();\n\n return (\n <ListItemProvider value={{ color, disabled }}>\n <RippleBox\n ref={forwardedRef}\n as={innerAs || as}\n theme={theme}\n display=\"flex\"\n data-disabled={disabled ? '' : undefined}\n rippleColor={rippleColor || color}\n baseOpacity={selected ? 0.12 : 0}\n hoverOpacity={selected ? 0.16 : 0.04}\n focusOpacity={selected ? 0.24 : 0.12}\n aria-selected={selected ? 'true' : undefined}\n disabled={disabled}\n {...otherProps}\n __css={{\n px: 3,\n py: rem(12),\n backgroundColor: 'transparent',\n color: disabled ? alpha(color, 0.6) : alpha(color, 0.87),\n ':focus': {\n outline: 'none',\n },\n textDecoration: 'none',\n WebkitTapHighlightColor: 'transparent',\n ...get(theme, 'text.subtitle1'),\n ...__css,\n }}\n >\n {children}\n </RippleBox>\n </ListItemProvider>\n );\n }\n);\n"],"file":"ListItem.js"}
|
package/build/esm/Menu/Menu.d.ts
CHANGED
|
@@ -5,12 +5,12 @@ import { ButtonProps } from '../Button';
|
|
|
5
5
|
import { BoxProps } from '../Box';
|
|
6
6
|
import { PaperProps } from '../Paper';
|
|
7
7
|
export declare type MenuListProps = MenuListPropsCore & PaperProps & BoxProps<HTMLUListElement, React.HTMLAttributes<HTMLUListElement>>;
|
|
8
|
-
export declare const MenuList: React.ForwardRefExoticComponent<Pick<MenuListProps, "
|
|
8
|
+
export declare const MenuList: React.ForwardRefExoticComponent<Pick<MenuListProps, "children" | "p" | "slot" | "style" | "title" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "backgroundImage" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxShadow" | "color" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "textAlign" | "textShadow" | "top" | "translate" | "verticalAlign" | "width" | "zIndex" | "background" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "gridColumnGap" | "gridGap" | "gridRowGap" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "variant" | "size" | "elevation" | "hidden" | "as" | "sx" | "__css" | "tx" | "theme" | "borderX" | "borderY" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "outlined" | "backgroundOverlay" | "key" | "innerAs" | "defaultActiveItemValue"> & React.RefAttributes<HTMLUListElement>>;
|
|
9
9
|
export declare type MenuItemProps = MenuItemPropsCore & ListItemProps;
|
|
10
|
-
export declare const MenuItem: React.ForwardRefExoticComponent<Pick<MenuItemProps, "
|
|
10
|
+
export declare const MenuItem: React.ForwardRefExoticComponent<Pick<MenuItemProps, "value" | "children" | "p" | "slot" | "style" | "title" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "backgroundImage" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxShadow" | "color" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "textAlign" | "textShadow" | "top" | "translate" | "verticalAlign" | "width" | "zIndex" | "background" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "gridColumnGap" | "gridGap" | "gridRowGap" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "variant" | "size" | "hidden" | "as" | "sx" | "__css" | "tx" | "theme" | "borderX" | "borderY" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "disabled" | "rippleColor" | "innerAs" | "selected"> & React.RefAttributes<HTMLLIElement>>;
|
|
11
11
|
export declare type MenuButtonProps = ButtonProps & MenuButtonPropsCore;
|
|
12
|
-
export declare const MenuButton: React.ForwardRefExoticComponent<Pick<MenuButtonProps, "
|
|
12
|
+
export declare const MenuButton: React.ForwardRefExoticComponent<Pick<MenuButtonProps, "value" | "children" | "form" | "p" | "slot" | "style" | "title" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "backgroundImage" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxShadow" | "color" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "textAlign" | "textShadow" | "top" | "translate" | "verticalAlign" | "width" | "zIndex" | "background" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "gridColumnGap" | "gridGap" | "gridRowGap" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "variant" | "size" | "elevation" | "hidden" | "as" | "sx" | "__css" | "tx" | "theme" | "borderX" | "borderY" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "innerAs"> & React.RefAttributes<HTMLButtonElement>>;
|
|
13
13
|
export declare type MenuPopoverProps = BoxProps & MenuPopoverPropsCore;
|
|
14
|
-
export declare const MenuPopover: React.ForwardRefExoticComponent<Pick<MenuPopoverProps, "
|
|
14
|
+
export declare const MenuPopover: React.ForwardRefExoticComponent<Pick<MenuPopoverProps, "children" | "p" | "slot" | "style" | "title" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "backgroundImage" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxShadow" | "color" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "textAlign" | "textShadow" | "top" | "translate" | "verticalAlign" | "width" | "zIndex" | "background" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "gridColumnGap" | "gridGap" | "gridRowGap" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "variant" | "size" | "hidden" | "as" | "sx" | "__css" | "tx" | "theme" | "borderX" | "borderY" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "placement" | "innerAs" | "strategy" | "modifiers" | "usePortal" | "portalSelector" | "skidding" | "distance" | "offsetFn" | "arrowPadding"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
export declare type MenuProps = MenuPropsCore;
|
|
16
16
|
export { Menu } from '@basic-ui/core';
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
import { BoxProps } from '../Box';
|
|
3
3
|
import { RadioGroupProps as RadioGroupCoreProps } from '@basic-ui/core';
|
|
4
4
|
export declare type RadioGroupProps = Omit<BoxProps, 'onChange' | 'value' | 'defaultValue'> & RadioGroupCoreProps;
|
|
5
|
-
export declare const RadioGroup: import("react").ForwardRefExoticComponent<Pick<RadioGroupProps, "
|
|
5
|
+
export declare const RadioGroup: import("react").ForwardRefExoticComponent<Pick<RadioGroupProps, "value" | "children" | "p" | "slot" | "style" | "title" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "backgroundImage" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxShadow" | "color" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "textAlign" | "textShadow" | "top" | "translate" | "verticalAlign" | "width" | "zIndex" | "background" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "gridColumnGap" | "gridGap" | "gridRowGap" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "variant" | "size" | "hidden" | "as" | "sx" | "__css" | "tx" | "theme" | "borderX" | "borderY" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "name" | "innerAs"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -12,7 +12,7 @@ export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectE
|
|
|
12
12
|
theme?: Theme;
|
|
13
13
|
error?: boolean | string;
|
|
14
14
|
onChange?: (e: React.ChangeEvent<HTMLSelectElement>, value: string) => void;
|
|
15
|
-
renderValue?: (value?: string) => string;
|
|
15
|
+
renderValue?: (value?: string) => string | undefined;
|
|
16
16
|
leadingIcon?: React.ReactNode;
|
|
17
17
|
}
|
|
18
18
|
export declare const Select: ForwardRefExoticComponent<SelectProps & RefAttributes<HTMLButtonElement | HTMLSelectElement>>;
|
|
@@ -74,8 +74,8 @@ export const Select = /*#__PURE__*/forwardRef(function Select(props, forwardedRe
|
|
|
74
74
|
const id = idProp || fallbackId;
|
|
75
75
|
const inputId = "".concat(id, "-text-field");
|
|
76
76
|
const helperTextId = helperText ? "".concat(id, "-helper-text") : undefined;
|
|
77
|
-
const labelIsFloating = hasFocus || open || typeof value === 'string' && value.length > 0;
|
|
78
77
|
const renderValue = renderValueProp || makeDefaultRender(children);
|
|
78
|
+
const labelIsFloating = hasFocus || open || renderValue(value) !== undefined;
|
|
79
79
|
const Comp = native ? SelectComp : SelectButton;
|
|
80
80
|
useEffect(() => {
|
|
81
81
|
// right after mounting, if the default value in the select element
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Select/Select.tsx"],"names":["forwardRef","useState","useRef","useEffect","wrapEvent","useId","assignMultipleRefs","useControlledState","useTheme","Select","SelectComp","SelectButton","FilledContainer","HelperText","OutlinedContainer","SelectProvider","Menu","MenuPopover","MenuList","SelectIcon","makeDefaultRender","Box","IconContainer","componentMap","outlined","filled","props","forwardedRef","id","idProp","variant","color","value","valueProp","defaultValue","disabled","error","label","placeholder","helperText","helperTextProp","onChange","onChangeProp","onFocus","onBlur","native","children","renderValue","renderValueProp","leadingIcon","otherProps","setState","e","v","hasFocus","setHasFocus","buttonRef","open","setOpen","fallbackId","theme","Container","handleFocus","handleBlur","handleToggle","isOpen","handleOnChange","target","dataset","hasError","Boolean","inputId","helperTextId","undefined","labelIsFloating","length","Comp","current","onSelect","minWidth","offsetWidth","borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"],"mappings":";;AAAA,SACEA,UADF,EAEEC,QAFF,EAGEC,MAHF,EAMEC,SANF,Q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SAAS,CAAEqB,OAAb,qBAAE,mBAAoBG;AADzB,eAFT;AAKE,cAAA,IAAI,EAAC,SALP;AAME,cAAA,KAAK,EACHlD,OAAO,KAAK,QAAZ,GACI;AACE,mDAAmC;AACjCmD,kBAAAA,sBAAsB,EAAE,CADS;AAEjCC,kBAAAA,uBAAuB,EAAE;AAFQ,iBADrC;AAKE,sDAAsC;AACpCC,kBAAAA,mBAAmB,EAAE,CADe;AAEpCC,kBAAAA,oBAAoB,EAAE;AAFc;AALxC,eADJ,GAWI,EAlBR;AAAA,wBAqBGtC;AArBH;AADF,YAxBJ;AAAA,UAZF,eA+DE,KAAC,UAAD;AAAY,UAAA,IAAI,EAAEW;AAAlB,UA/DF;AAAA,QADF,eAmEE,KAAC,UAAD;AACE,QAAA,QAAQ,EAAEtB,QADZ;AAEE,QAAA,EAAE,EAAEqC,YAFN;AAGE,QAAA,QAAQ,EAAEjC,UAHZ;AAIE,QAAA,KAAK,EAAE8B;AAJT,QAnEF;AAAA;AADF,IADF;AA8ED,CAjK+B,CAAzB","sourcesContent":["import {\n forwardRef,\n useState,\n useRef,\n ForwardRefExoticComponent,\n RefAttributes,\n useEffect,\n} from 'react';\n\nimport type * as React from 'react';\nimport {\n wrapEvent,\n useId,\n assignMultipleRefs,\n useControlledState,\n} from '@basic-ui/core';\nimport { useTheme, Theme } from '../theme';\nimport {\n Select as SelectComp,\n SelectButton,\n SelectProps as BaseSelectProps,\n} from './styledComponents';\nimport { FilledContainer } from '../TextField/FilledContainer';\nimport { HelperText } from '../TextField/HelperText';\nimport { OutlinedContainer } from '../TextField/OutlinedContainer';\nimport { SelectProvider } from './context';\nimport { Menu, MenuPopover, MenuList } from '../Menu';\nimport { SelectIcon } from './SelectIcon';\nimport { makeDefaultRender } from './defaultRender';\nimport { Box } from '../Box';\nimport { IconContainer } from '../TextField/IconContainer';\n\nconst componentMap = {\n outlined: OutlinedContainer,\n filled: FilledContainer,\n};\n\nexport interface SelectProps\n extends Omit<\n React.SelectHTMLAttributes<HTMLSelectElement>,\n 'value' | 'defaultValue' | 'onChange'\n > {\n variant?: 'outlined' | 'filled';\n color?: 'primary' | 'secondary';\n label?: React.ReactNode;\n helperText?: string;\n defaultValue?: string;\n value?: string;\n native?: boolean;\n theme?: Theme;\n error?: boolean | string;\n onChange?: (e: React.ChangeEvent<HTMLSelectElement>, value: string) => void;\n renderValue?: (value?: string) => string;\n leadingIcon?: React.ReactNode;\n}\n\nexport const Select = forwardRef<\n HTMLSelectElement | HTMLButtonElement,\n SelectProps\n>(function Select(props, forwardedRef) {\n const {\n id: idProp,\n variant = 'outlined',\n color = 'primary',\n value: valueProp,\n defaultValue = '',\n disabled,\n error = false,\n label = null,\n placeholder,\n helperText: helperTextProp,\n onChange: onChangeProp,\n onFocus,\n onBlur,\n native = false,\n children,\n renderValue: renderValueProp,\n leadingIcon = null,\n ...otherProps\n } = props;\n const [value, onChange] = useControlledState(\n valueProp,\n onChangeProp,\n defaultValue,\n (setState) => (e, v) => {\n setState(v);\n }\n );\n const [hasFocus, setHasFocus] = useState(false);\n const buttonRef = useRef<HTMLButtonElement | HTMLSelectElement>();\n const [open, setOpen] = useState(false);\n const fallbackId = useId();\n const theme = useTheme();\n\n const Container = componentMap[variant] || OutlinedContainer;\n\n const handleFocus = () => {\n setHasFocus(true);\n };\n\n const handleBlur = () => {\n setHasFocus(false);\n };\n\n const handleToggle = (e: unknown, isOpen: boolean) => {\n setOpen(isOpen);\n };\n\n const handleOnChange = (e: any) => {\n onChange &&\n onChange(e as any, native ? e.target.value : e.target.dataset.value);\n };\n\n const hasError = Boolean(error);\n const helperText = typeof error === 'string' ? error : helperTextProp;\n\n const id = idProp || fallbackId;\n const inputId = `${id}-text-field`;\n const helperTextId = helperText ? `${id}-helper-text` : undefined;\n\n const labelIsFloating =\n hasFocus || open || (typeof value === 'string' && value.length > 0);\n\n const renderValue = renderValueProp || makeDefaultRender(children);\n\n const Comp: ForwardRefExoticComponent<\n BaseSelectProps & RefAttributes<HTMLSelectElement | HTMLButtonElement>\n > = native ? SelectComp : (SelectButton as any);\n\n useEffect(() => {\n // right after mounting, if the default value in the select element\n // is different than the value we have stored in state we need to\n // update our state to reflect that.\n if (native && buttonRef.current && buttonRef.current.value !== value) {\n onChange && onChange({} as any, buttonRef.current.value);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <SelectProvider value={{ native, onSelect: handleOnChange, value }}>\n <Box display=\"inline-flex\" flexDirection=\"column\" width=\"100%\">\n <Container\n theme={theme}\n label={label}\n color={color}\n labelIsFloating={labelIsFloating}\n inputId={inputId}\n hasFocus={hasFocus}\n disabled={disabled}\n forceActive={open}\n error={hasError}\n leadingIcon={Boolean(leadingIcon)}\n >\n <Menu onChange={handleToggle} open={open}>\n {leadingIcon && (\n <IconContainer position=\"start\">{leadingIcon}</IconContainer>\n )}\n <Comp\n ref={assignMultipleRefs(forwardedRef, buttonRef)}\n variant={variant}\n id={inputId}\n onFocus={wrapEvent(onFocus, handleFocus)}\n onBlur={wrapEvent(onBlur, handleBlur)}\n onChange={native ? handleOnChange : undefined}\n value={native ? value : undefined}\n theme={theme}\n placeholder={placeholder}\n disabled={disabled}\n aria-disabled={disabled ? 'true' : undefined}\n aria-describedby={helperTextId}\n hasLabel={!!label}\n leadingIcon={Boolean(leadingIcon)}\n {...otherProps}\n >\n {native ? children : renderValue(value)}\n </Comp>\n {!native && (\n <MenuPopover usePortal>\n <MenuList\n defaultActiveItemValue={value}\n style={{\n minWidth: buttonRef?.current?.offsetWidth,\n }}\n role=\"listbox\"\n __css={\n variant === 'filled'\n ? {\n \"[data-popper-placement='top'] &\": {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n },\n \"[data-popper-placement='bottom'] &\": {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n },\n }\n : {}\n }\n >\n {children}\n </MenuList>\n </MenuPopover>\n )}\n </Menu>\n <SelectIcon open={open} />\n </Container>\n\n <HelperText\n disabled={disabled}\n id={helperTextId}\n leftSide={helperText}\n error={hasError}\n />\n </Box>\n </SelectProvider>\n );\n});\n"],"file":"Select.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/Select/Select.tsx"],"names":["forwardRef","useState","useRef","useEffect","wrapEvent","useId","assignMultipleRefs","useControlledState","useTheme","Select","SelectComp","SelectButton","FilledContainer","HelperText","OutlinedContainer","SelectProvider","Menu","MenuPopover","MenuList","SelectIcon","makeDefaultRender","Box","IconContainer","componentMap","outlined","filled","props","forwardedRef","id","idProp","variant","color","value","valueProp","defaultValue","disabled","error","label","placeholder","helperText","helperTextProp","onChange","onChangeProp","onFocus","onBlur","native","children","renderValue","renderValueProp","leadingIcon","otherProps","setState","e","v","hasFocus","setHasFocus","buttonRef","open","setOpen","fallbackId","theme","Container","handleFocus","handleBlur","handleToggle","isOpen","handleOnChange","target","dataset","hasError","Boolean","inputId","helperTextId","undefined","labelIsFloating","Comp","current","onSelect","minWidth","offsetWidth","borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"],"mappings":";;AAAA,SACEA,UADF,EAEEC,QAFF,EAGEC,MAHF,EAMEC,SANF,QAOO,OAPP;AAUA,SACEC,SADF,EAEEC,KAFF,EAGEC,kBAHF,EAIEC,kBAJF,QAKO,gBALP;AAMA,SAASC,QAAT,QAAgC,UAAhC;AACA,SACEC,MAAM,IAAIC,UADZ,EAEEC,YAFF,QAIO,oBAJP;AAKA,SAASC,eAAT,QAAgC,8BAAhC;AACA,SAASC,UAAT,QAA2B,yBAA3B;AACA,SAASC,iBAAT,QAAkC,gCAAlC;AACA,SAASC,cAAT,QAA+B,WAA/B;AACA,SAASC,IAAT,EAAeC,WAAf,EAA4BC,QAA5B,QAA4C,SAA5C;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,iBAAT,QAAkC,iBAAlC;AACA,SAASC,GAAT,QAAoB,QAApB;AACA,SAASC,aAAT,QAA8B,4BAA9B;;;AAEA,MAAMC,YAAY,GAAG;AACnBC,EA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EjC,UAHZ;AAIE,QAAA,KAAK,EAAE8B;AAJT,QAnEF;AAAA;AADF,IADF;AA8ED,CAhK+B,CAAzB","sourcesContent":["import {\n forwardRef,\n useState,\n useRef,\n ForwardRefExoticComponent,\n RefAttributes,\n useEffect,\n} from 'react';\n\nimport type * as React from 'react';\nimport {\n wrapEvent,\n useId,\n assignMultipleRefs,\n useControlledState,\n} from '@basic-ui/core';\nimport { useTheme, Theme } from '../theme';\nimport {\n Select as SelectComp,\n SelectButton,\n SelectProps as BaseSelectProps,\n} from './styledComponents';\nimport { FilledContainer } from '../TextField/FilledContainer';\nimport { HelperText } from '../TextField/HelperText';\nimport { OutlinedContainer } from '../TextField/OutlinedContainer';\nimport { SelectProvider } from './context';\nimport { Menu, MenuPopover, MenuList } from '../Menu';\nimport { SelectIcon } from './SelectIcon';\nimport { makeDefaultRender } from './defaultRender';\nimport { Box } from '../Box';\nimport { IconContainer } from '../TextField/IconContainer';\n\nconst componentMap = {\n outlined: OutlinedContainer,\n filled: FilledContainer,\n};\n\nexport interface SelectProps\n extends Omit<\n React.SelectHTMLAttributes<HTMLSelectElement>,\n 'value' | 'defaultValue' | 'onChange'\n > {\n variant?: 'outlined' | 'filled';\n color?: 'primary' | 'secondary';\n label?: React.ReactNode;\n helperText?: string;\n defaultValue?: string;\n value?: string;\n native?: boolean;\n theme?: Theme;\n error?: boolean | string;\n onChange?: (e: React.ChangeEvent<HTMLSelectElement>, value: string) => void;\n renderValue?: (value?: string) => string | undefined;\n leadingIcon?: React.ReactNode;\n}\n\nexport const Select = forwardRef<\n HTMLSelectElement | HTMLButtonElement,\n SelectProps\n>(function Select(props, forwardedRef) {\n const {\n id: idProp,\n variant = 'outlined',\n color = 'primary',\n value: valueProp,\n defaultValue = '',\n disabled,\n error = false,\n label = null,\n placeholder,\n helperText: helperTextProp,\n onChange: onChangeProp,\n onFocus,\n onBlur,\n native = false,\n children,\n renderValue: renderValueProp,\n leadingIcon = null,\n ...otherProps\n } = props;\n const [value, onChange] = useControlledState(\n valueProp,\n onChangeProp,\n defaultValue,\n (setState) => (e, v) => {\n setState(v);\n }\n );\n const [hasFocus, setHasFocus] = useState(false);\n const buttonRef = useRef<HTMLButtonElement | HTMLSelectElement>();\n const [open, setOpen] = useState(false);\n const fallbackId = useId();\n const theme = useTheme();\n\n const Container = componentMap[variant] || OutlinedContainer;\n\n const handleFocus = () => {\n setHasFocus(true);\n };\n\n const handleBlur = () => {\n setHasFocus(false);\n };\n\n const handleToggle = (e: unknown, isOpen: boolean) => {\n setOpen(isOpen);\n };\n\n const handleOnChange = (e: any) => {\n onChange &&\n onChange(e as any, native ? e.target.value : e.target.dataset.value);\n };\n\n const hasError = Boolean(error);\n const helperText = typeof error === 'string' ? error : helperTextProp;\n\n const id = idProp || fallbackId;\n const inputId = `${id}-text-field`;\n const helperTextId = helperText ? `${id}-helper-text` : undefined;\n\n const renderValue = renderValueProp || makeDefaultRender(children);\n\n const labelIsFloating = hasFocus || open || renderValue(value) !== undefined;\n\n const Comp: ForwardRefExoticComponent<\n BaseSelectProps & RefAttributes<HTMLSelectElement | HTMLButtonElement>\n > = native ? SelectComp : (SelectButton as any);\n\n useEffect(() => {\n // right after mounting, if the default value in the select element\n // is different than the value we have stored in state we need to\n // update our state to reflect that.\n if (native && buttonRef.current && buttonRef.current.value !== value) {\n onChange && onChange({} as any, buttonRef.current.value);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <SelectProvider value={{ native, onSelect: handleOnChange, value }}>\n <Box display=\"inline-flex\" flexDirection=\"column\" width=\"100%\">\n <Container\n theme={theme}\n label={label}\n color={color}\n labelIsFloating={labelIsFloating}\n inputId={inputId}\n hasFocus={hasFocus}\n disabled={disabled}\n forceActive={open}\n error={hasError}\n leadingIcon={Boolean(leadingIcon)}\n >\n <Menu onChange={handleToggle} open={open}>\n {leadingIcon && (\n <IconContainer position=\"start\">{leadingIcon}</IconContainer>\n )}\n <Comp\n ref={assignMultipleRefs(forwardedRef, buttonRef)}\n variant={variant}\n id={inputId}\n onFocus={wrapEvent(onFocus, handleFocus)}\n onBlur={wrapEvent(onBlur, handleBlur)}\n onChange={native ? handleOnChange : undefined}\n value={native ? value : undefined}\n theme={theme}\n placeholder={placeholder}\n disabled={disabled}\n aria-disabled={disabled ? 'true' : undefined}\n aria-describedby={helperTextId}\n hasLabel={!!label}\n leadingIcon={Boolean(leadingIcon)}\n {...otherProps}\n >\n {native ? children : renderValue(value)}\n </Comp>\n {!native && (\n <MenuPopover usePortal>\n <MenuList\n defaultActiveItemValue={value}\n style={{\n minWidth: buttonRef?.current?.offsetWidth,\n }}\n role=\"listbox\"\n __css={\n variant === 'filled'\n ? {\n \"[data-popper-placement='top'] &\": {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n },\n \"[data-popper-placement='bottom'] &\": {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n },\n }\n : {}\n }\n >\n {children}\n </MenuList>\n </MenuPopover>\n )}\n </Menu>\n <SelectIcon open={open} />\n </Container>\n\n <HelperText\n disabled={disabled}\n id={helperTextId}\n leftSide={helperText}\n error={hasError}\n />\n </Box>\n </SelectProvider>\n );\n});\n"],"file":"Select.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const makeDefaultRender: (children?: React.ReactNode) => (val?: string | undefined) => string;
|
|
1
|
+
export declare const makeDefaultRender: (children?: React.ReactNode) => (val?: string | undefined) => string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Select/defaultRender.ts"],"names":["Children","isValidElement","makeDefaultRender","children","val","undefined","allChildren","toArray","i","length","child","String","props","value"],"mappings":"AAAA,SAASA,QAAT,EAAmBC,cAAnB,QAAyC,OAAzC;AAEA,OAAO,MAAMC,iBAAiB,GAAIC,QAAD,IAC/BC,GAD+D,
|
|
1
|
+
{"version":3,"sources":["../../../src/Select/defaultRender.ts"],"names":["Children","isValidElement","makeDefaultRender","children","val","undefined","allChildren","toArray","i","length","child","String","props","value"],"mappings":"AAAA,SAASA,QAAT,EAAmBC,cAAnB,QAAyC,OAAzC;AAEA,OAAO,MAAMC,iBAAiB,GAAIC,QAAD,IAC/BC,GAD+D,IAExC;AACvB,MAAID,QAAQ,IAAIC,GAAG,KAAKC,SAAxB,EAAmC;AACjC,UAAMC,WAAW,GAAGN,QAAQ,CAACO,OAAT,CAAiBJ,QAAjB,CAApB;;AACA,SAAK,IAAIK,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGF,WAAW,CAACG,MAAhC,EAAwCD,CAAC,EAAzC,EAA6C;AAC3C,YAAME,KAAK,GAAGJ,WAAW,CAACE,CAAD,CAAzB;;AACA,wBAAIP,cAAc,CAACS,KAAD,CAAlB,EAA2B;AACzB,YAAIC,MAAM,CAACD,KAAK,CAACE,KAAN,CAAYC,KAAb,CAAN,KAA8BT,GAAlC,EAAuC;AACrC,iBAAOM,KAAK,CAACE,KAAN,CAAYT,QAAnB;AACD;AACF;AACF;AACF;;AACD,SAAOC,GAAG,IAAIC,SAAd;AACD,CAfM","sourcesContent":["import { Children, isValidElement } from 'react';\n\nexport const makeDefaultRender = (children?: React.ReactNode) => (\n val?: string\n): string | undefined => {\n if (children && val !== undefined) {\n const allChildren = Children.toArray(children);\n for (let i = 0; i < allChildren.length; i++) {\n const child = allChildren[i];\n if (isValidElement(child)) {\n if (String(child.props.value) === val) {\n return child.props.children;\n }\n }\n }\n }\n return val || undefined;\n};\n"],"file":"defaultRender.js"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { MenuItemProps } from '../Menu';
|
|
3
3
|
export declare type SelectItemProps = MenuItemProps;
|
|
4
|
-
export declare const SelectItem: import("react").ForwardRefExoticComponent<Pick<MenuItemProps, "
|
|
4
|
+
export declare const SelectItem: import("react").ForwardRefExoticComponent<Pick<MenuItemProps, "value" | "children" | "p" | "slot" | "style" | "title" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "backgroundImage" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxShadow" | "color" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "textAlign" | "textShadow" | "top" | "translate" | "verticalAlign" | "width" | "zIndex" | "background" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "gridColumnGap" | "gridGap" | "gridRowGap" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "variant" | "size" | "hidden" | "as" | "sx" | "__css" | "tx" | "theme" | "borderX" | "borderY" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "disabled" | "rippleColor" | "innerAs" | "selected"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
@@ -5,6 +5,7 @@ import { MenuItem } from '../Menu';
|
|
|
5
5
|
import { useSelectContext } from '../Select/context';
|
|
6
6
|
import { wrapEvent } from '@basic-ui/core';
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const ZERO_WIDTH_SPACE = '\u200b';
|
|
8
9
|
export const SelectItem = /*#__PURE__*/forwardRef(function SelectItem(props, forwardedRef) {
|
|
9
10
|
const {
|
|
10
11
|
as: Comp = MenuItem,
|
|
@@ -20,7 +21,7 @@ export const SelectItem = /*#__PURE__*/forwardRef(function SelectItem(props, for
|
|
|
20
21
|
onSelect,
|
|
21
22
|
value: selectedValue
|
|
22
23
|
} = useSelectContext();
|
|
23
|
-
const value = valueProp !== undefined ? String(valueProp) : children;
|
|
24
|
+
const value = valueProp !== undefined && valueProp !== null ? String(valueProp) : children;
|
|
24
25
|
|
|
25
26
|
if (native) {
|
|
26
27
|
return /*#__PURE__*/_jsx("option", _extends({
|
|
@@ -32,7 +33,7 @@ export const SelectItem = /*#__PURE__*/forwardRef(function SelectItem(props, for
|
|
|
32
33
|
}));
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
if (
|
|
36
|
+
if (children === undefined && disabled) {
|
|
36
37
|
return null;
|
|
37
38
|
}
|
|
38
39
|
|
|
@@ -46,7 +47,7 @@ export const SelectItem = /*#__PURE__*/forwardRef(function SelectItem(props, for
|
|
|
46
47
|
role: "option",
|
|
47
48
|
selected: selected
|
|
48
49
|
}, otherProps, {
|
|
49
|
-
children: children
|
|
50
|
+
children: children || ZERO_WIDTH_SPACE
|
|
50
51
|
}));
|
|
51
52
|
});
|
|
52
53
|
//# sourceMappingURL=SelectItem.js.map
|