@basic-ui/material 0.1.11 → 0.1.14
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 +33 -28
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Alert/Alert.d.ts +1 -1
- package/build/esm/AppBar/AppBar.d.ts +1 -1
- package/build/esm/AppBar/AppBarButton.d.ts +1 -1
- package/build/esm/Badge/Badge.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheet.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +1 -1
- package/build/esm/Button/BaseButton.d.ts +1 -1
- package/build/esm/Button/Button.d.ts +1 -1
- package/build/esm/Button/FilledButton.d.ts +1 -1
- package/build/esm/Button/FloatingActionButton.d.ts +7 -0
- package/build/esm/Button/FloatingActionButton.js +8 -0
- package/build/esm/Button/FloatingActionButton.js.map +1 -0
- package/build/esm/Button/OutlinedButton.d.ts +1 -1
- package/build/esm/Button/TransparentButton.d.ts +1 -1
- package/build/esm/CheckBox/CheckBox.d.ts +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.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/ColorMode/ColorModeProvider.js +10 -3
- package/build/esm/ColorMode/ColorModeProvider.js.map +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/Dialog/useDialogAnimation.js +1 -1
- package/build/esm/Dialog/useDialogAnimation.js.map +1 -1
- package/build/esm/Divider/Divider.d.ts +1 -1
- package/build/esm/LineRipple/LineRipple.d.ts +1 -1
- package/build/esm/Link/Link.d.ts +1 -1
- package/build/esm/List/List.d.ts +1 -1
- package/build/esm/ListItem/ListItem.d.ts +1 -1
- package/build/esm/Menu/Menu.d.ts +4 -4
- package/build/esm/Paper/Paper.d.ts +1 -1
- package/build/esm/RadioButton/RadioGroup.d.ts +1 -1
- package/build/esm/Ripple/keyframes.js +0 -2
- package/build/esm/Ripple/keyframes.js.map +1 -1
- package/build/esm/Ripple/useRipple.js +1 -1
- package/build/esm/Ripple/useRipple.js.map +1 -1
- package/build/esm/Select/SelectIcon.d.ts +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlLabel.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlText.d.ts +1 -1
- package/build/esm/Skeleton/DelayAppearance.d.ts +1 -1
- package/build/esm/Skeleton/Skeleton.d.ts +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/Table.d.ts +1 -1
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/esm/Table/TableRow.d.ts +1 -1
- package/build/esm/Text/Text.d.ts +1 -1
- package/build/esm/TextField/FilledContainer.d.ts +1 -1
- package/build/esm/TextField/HelperText.d.ts +1 -1
- package/build/esm/TextField/Input.d.ts +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +1 -1
- package/build/esm/TextField/TextField.d.ts +1 -1
- package/build/esm/ThemeExplorer/ColorPicker.d.ts +8 -0
- package/build/esm/ThemeExplorer/ColorPicker.js +76 -0
- package/build/esm/ThemeExplorer/ColorPicker.js.map +1 -0
- package/build/esm/ThemeExplorer/TextFieldColorPicker.d.ts +9 -0
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js +100 -0
- package/build/esm/ThemeExplorer/TextFieldColorPicker.js.map +1 -0
- package/build/esm/ThemeExplorer/ThemeColors.d.ts +5 -0
- package/build/esm/ThemeExplorer/ThemeColors.js +80 -0
- package/build/esm/ThemeExplorer/ThemeColors.js.map +1 -0
- package/build/esm/ThemeExplorer/components.d.ts +31 -0
- package/build/esm/ThemeExplorer/components.js +184 -0
- package/build/esm/ThemeExplorer/components.js.map +1 -0
- package/build/esm/ThemeExplorer/makeColorScheme.d.ts +66 -0
- package/build/esm/ThemeExplorer/makeColorScheme.js +66 -0
- package/build/esm/ThemeExplorer/makeColorScheme.js.map +1 -0
- package/build/esm/ThemeExplorer/useDeferredColor.d.ts +3 -0
- package/build/esm/ThemeExplorer/useDeferredColor.js +11 -0
- package/build/esm/ThemeExplorer/useDeferredColor.js.map +1 -0
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.d.ts +1 -0
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js +11 -0
- package/build/esm/ThemeExplorer/useLocalStorageCachedState.js.map +1 -0
- package/build/esm/Tooltip/Tooltip.d.ts +1 -1
- package/build/esm/hooks/useAnimation.js +22 -21
- package/build/esm/hooks/useAnimation.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +54 -54
- package/package.json +3 -3
- package/src/Alert/Alert.story.tsx +5 -6
- package/src/AppBar/AppBar.story.tsx +11 -20
- package/src/BottomSheet/BottomSheet.story.tsx +5 -6
- package/src/Button/Button.story.tsx +14 -14
- package/src/Button/SpinnerButton.story.tsx +6 -6
- package/src/CheckBox/CheckBox.story.tsx +7 -6
- package/src/Chip/Chip.story.tsx +5 -7
- package/src/ColorMode/ColorModeProvider.tsx +9 -3
- package/src/Combobox/Combobox.story.tsx +12 -10
- package/src/Dialog/Dialog.story.tsx +7 -8
- package/src/Dialog/useDialogAnimation.tsx +1 -1
- package/src/Divider/Divider.story.tsx +6 -5
- package/src/FloatingLabel/FloatingLabel.story.tsx +10 -9
- package/src/LineRipple/LineRipple.story.tsx +5 -4
- package/src/Link/Link.story.tsx +3 -4
- package/src/ListItem/ListItem.story.tsx +6 -5
- package/src/Menu/Menu.story.tsx +8 -7
- package/src/NotchedOutline/NotchedOutline.story.tsx +5 -4
- package/src/Paper/Paper.story.tsx +5 -4
- package/src/ProgressSpinner/ProgressSpinner.story.tsx +5 -4
- package/src/RadioButton/RadioButton.story.tsx +12 -10
- package/src/Ripple/Ripple.story.tsx +5 -4
- package/src/Ripple/keyframes.ts +0 -2
- package/src/Ripple/useRipple.ts +3 -1
- package/src/Select/Select.story.tsx +8 -7
- package/src/Skeleton/Skeleton.story.tsx +7 -6
- package/src/Snackbar/Snackbar.story.tsx +7 -6
- package/src/Switch/Switch.story.tsx +5 -4
- package/src/Tab/Tab.story.tsx +7 -5
- package/src/Table/Table.story.tsx +5 -4
- package/src/Text/Text.story.tsx +5 -4
- package/src/TextField/TextField.story.tsx +7 -6
- package/src/Tooltip/Tooltip.story.tsx +5 -4
- package/src/hooks/useAnimation.ts +42 -32
|
@@ -14,4 +14,4 @@ export interface OutlinedContainerProps extends BoxProps {
|
|
|
14
14
|
forceActive?: boolean;
|
|
15
15
|
leadingIcon?: boolean;
|
|
16
16
|
}
|
|
17
|
-
export declare const OutlinedContainer: React.ForwardRefExoticComponent<Pick<OutlinedContainerProps, "children" | "label" | "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" | "
|
|
17
|
+
export declare const OutlinedContainer: React.ForwardRefExoticComponent<Pick<OutlinedContainerProps, "children" | "label" | "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" | "hidden" | "as" | "sx" | "__css" | "variant" | "tx" | "theme" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "size" | "bg" | "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" | "error" | "disabled" | "labelIsFloating" | "hasFocus" | "inputId" | "forceActive" | "leadingIcon"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -16,4 +16,4 @@ export declare type TextFieldProps = Omit<InputProps, 'value' | 'defaultValue'>
|
|
|
16
16
|
leadingIcon?: React.ReactNode;
|
|
17
17
|
trailingIcon?: React.ReactNode;
|
|
18
18
|
};
|
|
19
|
-
export declare const TextField: React.ForwardRefExoticComponent<Pick<TextFieldProps, "
|
|
19
|
+
export declare const TextField: React.ForwardRefExoticComponent<Pick<TextFieldProps, "children" | "form" | "label" | "p" | "slot" | "style" | "title" | "pattern" | "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" | "hidden" | "as" | "sx" | "__css" | "variant" | "tx" | "theme" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "size" | "bg" | "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" | "list" | "step" | "error" | "disabled" | "type" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "name" | "readOnly" | "required" | "src" | "value" | "containerProps" | "leadingIcon" | "helperText" | "hasLabel" | "multiline" | "trailingIcon" | "hideCharacterCounter"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Color, ColorPickerProps as BaseColorPickerProps } from '@basic-ui/color-picker';
|
|
2
|
+
import { BoxProps } from '../Box';
|
|
3
|
+
import { VFC } from 'react';
|
|
4
|
+
export declare type ColorPickerProps = (Omit<BoxProps, 'color' | 'onChange'> & BaseColorPickerProps) & {
|
|
5
|
+
color: Color;
|
|
6
|
+
onChange: (color: Color) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const ColorPicker: VFC<ColorPickerProps>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
import { ColorPicker as _BaseColorPicker, Hue as _Hue, HueCursor as _HueCursor, Saturation as _Saturation, SaturationCursor as _SaturationCursor } from '@basic-ui/color-picker';
|
|
4
|
+
import { Box } from '../Box';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const BaseColorPicker = _BaseColorPicker;
|
|
8
|
+
const Hue = _Hue;
|
|
9
|
+
const HueCursor = _HueCursor;
|
|
10
|
+
const Saturation = _Saturation;
|
|
11
|
+
const SaturationCursor = _SaturationCursor;
|
|
12
|
+
export const ColorPicker = (_ref) => {
|
|
13
|
+
let {
|
|
14
|
+
color,
|
|
15
|
+
onChange,
|
|
16
|
+
width = 450,
|
|
17
|
+
height = 225
|
|
18
|
+
} = _ref,
|
|
19
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, ["color", "onChange", "width", "height"]);
|
|
20
|
+
|
|
21
|
+
return /*#__PURE__*/_jsxs(BaseColorPicker, _extends({
|
|
22
|
+
as: Box,
|
|
23
|
+
width: width,
|
|
24
|
+
height: height,
|
|
25
|
+
onChange: onChange,
|
|
26
|
+
color: color
|
|
27
|
+
}, otherProps, {
|
|
28
|
+
children: [/*#__PURE__*/_jsx(Saturation, {
|
|
29
|
+
as: Box,
|
|
30
|
+
sx: {
|
|
31
|
+
position: 'relative',
|
|
32
|
+
touchAction: 'none',
|
|
33
|
+
userSelect: 'none',
|
|
34
|
+
width: '100%',
|
|
35
|
+
backgroundImage: 'linear-gradient(transparent, black), linear-gradient(to right, white, transparent)'
|
|
36
|
+
},
|
|
37
|
+
children: /*#__PURE__*/_jsx(SaturationCursor, {
|
|
38
|
+
as: Box,
|
|
39
|
+
sx: {
|
|
40
|
+
position: 'absolute',
|
|
41
|
+
width: '20px',
|
|
42
|
+
height: '20px',
|
|
43
|
+
border: '2px solid #ffffff',
|
|
44
|
+
borderRadius: '50%',
|
|
45
|
+
boxShadow: '0 0 15px 0 rgba(0, 0, 0, 0.15)',
|
|
46
|
+
boxSizing: 'border-box',
|
|
47
|
+
transform: 'translate(-10px, -10px)'
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
}), /*#__PURE__*/_jsx(Hue, {
|
|
51
|
+
as: Box,
|
|
52
|
+
sx: {
|
|
53
|
+
position: 'relative',
|
|
54
|
+
touchAction: 'none',
|
|
55
|
+
userSelect: 'none',
|
|
56
|
+
width: '100%',
|
|
57
|
+
height: '12px',
|
|
58
|
+
backgroundImage: "linear-gradient(to right, rgb(255, 0, 0), rgb(255, 255, 0), rgb(0, 255, 0), rgb(0, 255, 255), rgb(0, 0, 255), rgb(255, 0, 255), rgb(255, 0, 0))"
|
|
59
|
+
},
|
|
60
|
+
children: /*#__PURE__*/_jsx(HueCursor, {
|
|
61
|
+
as: Box,
|
|
62
|
+
sx: {
|
|
63
|
+
position: 'absolute',
|
|
64
|
+
width: '20px',
|
|
65
|
+
height: '20px',
|
|
66
|
+
border: '2px solid #ffffff',
|
|
67
|
+
borderRadius: '50%',
|
|
68
|
+
boxShadow: 'rgba(0, 0, 0, 0.2) 0px 0px 0px 0.5px',
|
|
69
|
+
boxSizing: 'border-box',
|
|
70
|
+
transform: 'translate(-10px, -4px)'
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
})]
|
|
74
|
+
}));
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=ColorPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ThemeExplorer/ColorPicker.tsx"],"names":["ColorPicker","_BaseColorPicker","Hue","_Hue","HueCursor","_HueCursor","Saturation","_Saturation","SaturationCursor","_SaturationCursor","Box","BaseColorPicker","color","onChange","width","height","otherProps","position","touchAction","userSelect","backgroundImage","border","borderRadius","boxShadow","boxSizing","transform"],"mappings":";;AAAA,SAEEA,WAAW,IAAIC,gBAFjB,EAGEC,GAAG,IAAIC,IAHT,EAIEC,SAAS,IAAIC,UAJf,EAKEC,UAAU,IAAIC,WALhB,EAMEC,gBAAgB,IAAIC,iBANtB,QAYO,wBAZP;AAaA,SAASC,GAAT,QAA8B,QAA9B;;;AASA,MAAMC,eAEL,GAAGV,gBAFJ;AAGA,MAAMC,GAA6B,GAAGC,IAAtC;AACA,MAAMC,SAAyC,GAAGC,UAAlD;AACA,MAAMC,UAA2C,GAAGC,WAApD;AACA,MAAMC,gBAEL,GAAGC,iBAFJ;AAIA,OAAO,MAAMT,WAAkC,GAAG,UAM5C;AAAA,MAN6C;AACjDY,IAAAA,KADiD;AAEjDC,IAAAA,QAFiD;AAGjDC,IAAAA,KAAK,GAA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EFH,UAAAA,KAAK,EAAE,MAFL;AAGFC,UAAAA,MAAM,EAAE,MAHN;AAIFM,UAAAA,MAAM,EAAE,mBAJN;AAKFC,UAAAA,YAAY,EAAE,KALZ;AAMFC,UAAAA,SAAS,EAAE,sCANT;AAOFC,UAAAA,SAAS,EAAE,YAPT;AAQFC,UAAAA,SAAS,EAAE;AART;AAFN;AAXF,MAjCF;AAAA,KADF;AA6DD,CApEM","sourcesContent":["import {\n Color,\n ColorPicker as _BaseColorPicker,\n Hue as _Hue,\n HueCursor as _HueCursor,\n Saturation as _Saturation,\n SaturationCursor as _SaturationCursor,\n ColorPickerProps as BaseColorPickerProps,\n HueProps,\n HueCursorProps,\n SaturationProps,\n SaturationCursorProps,\n} from '@basic-ui/color-picker';\nimport { Box, BoxProps } from '../Box';\nimport { VFC } from 'react';\n\nexport type ColorPickerProps = (Omit<BoxProps, 'color' | 'onChange'> &\n BaseColorPickerProps) & {\n color: Color;\n onChange: (color: Color) => void;\n};\n\nconst BaseColorPicker: VFC<\n Omit<BoxProps, 'color' | 'onChange'> & BaseColorPickerProps\n> = _BaseColorPicker as any;\nconst Hue: VFC<BoxProps & HueProps> = _Hue as any;\nconst HueCursor: VFC<BoxProps & HueCursorProps> = _HueCursor as any;\nconst Saturation: VFC<BoxProps & SaturationProps> = _Saturation as any;\nconst SaturationCursor: VFC<\n BoxProps & SaturationCursorProps\n> = _SaturationCursor as any;\n\nexport const ColorPicker: VFC<ColorPickerProps> = ({\n color,\n onChange,\n width = 450,\n height = 225,\n ...otherProps\n}) => {\n return (\n <BaseColorPicker\n as={Box}\n width={width}\n height={height}\n onChange={onChange}\n color={color}\n {...otherProps}\n >\n <Saturation\n as={Box}\n sx={{\n position: 'relative',\n touchAction: 'none',\n userSelect: 'none',\n width: '100%',\n backgroundImage:\n 'linear-gradient(transparent, black), linear-gradient(to right, white, transparent)',\n }}\n >\n <SaturationCursor\n as={Box}\n sx={{\n position: 'absolute',\n width: '20px',\n height: '20px',\n border: '2px solid #ffffff',\n borderRadius: '50%',\n boxShadow: '0 0 15px 0 rgba(0, 0, 0, 0.15)',\n boxSizing: 'border-box',\n transform: 'translate(-10px, -10px)',\n }}\n />\n </Saturation>\n <Hue\n as={Box}\n sx={{\n position: 'relative',\n touchAction: 'none',\n userSelect: 'none',\n width: '100%',\n height: '12px',\n backgroundImage: `linear-gradient(to right, rgb(255, 0, 0), rgb(255, 255, 0), rgb(0, 255, 0), rgb(0, 255, 255), rgb(0, 0, 255), rgb(255, 0, 255), rgb(255, 0, 0))`,\n }}\n >\n <HueCursor\n as={Box}\n sx={{\n position: 'absolute',\n width: '20px',\n height: '20px',\n border: '2px solid #ffffff',\n borderRadius: '50%',\n boxShadow: 'rgba(0, 0, 0, 0.2) 0px 0px 0px 0.5px',\n boxSizing: 'border-box',\n transform: 'translate(-10px, -4px)',\n }}\n />\n </Hue>\n </BaseColorPicker>\n );\n};\n"],"file":"ColorPicker.js"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Color } from '@basic-ui/color-picker';
|
|
3
|
+
import { TextFieldProps } from '../';
|
|
4
|
+
export interface TextFieldColorPickerProps extends Omit<TextFieldProps, 'value' | 'defaultValue' | 'onChange'> {
|
|
5
|
+
value?: Color;
|
|
6
|
+
defaultValue?: Color;
|
|
7
|
+
onChange?: (color: Color) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const TextFieldColorPicker: import("react").NamedExoticComponent<TextFieldColorPickerProps>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
import { toColor } from '@basic-ui/color-picker';
|
|
4
|
+
import { Popper, useControlledState, useOnClickOutside } from '@basic-ui/core';
|
|
5
|
+
import { alpha, Box, TextField, Button } from '../';
|
|
6
|
+
import { useRef, useState, memo, useCallback } from 'react';
|
|
7
|
+
import { ColorPicker } from './ColorPicker';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
+
export const TextFieldColorPicker = /*#__PURE__*/memo(props => {
|
|
12
|
+
const {
|
|
13
|
+
value: valueProp,
|
|
14
|
+
defaultValue = toColor('hex', '#33ff33'),
|
|
15
|
+
onChange: onChangeProp,
|
|
16
|
+
disabled
|
|
17
|
+
} = props,
|
|
18
|
+
otherProps = _objectWithoutPropertiesLoose(props, ["value", "defaultValue", "onChange", "disabled"]);
|
|
19
|
+
|
|
20
|
+
const [popoverOpen, setPopoverOpen] = useState(false);
|
|
21
|
+
const [text, setText] = useState((valueProp == null ? void 0 : valueProp.hex) || defaultValue.hex);
|
|
22
|
+
const [value, _onChange] = useControlledState(valueProp, onChangeProp, defaultValue, setState => v => {
|
|
23
|
+
setState(v);
|
|
24
|
+
setText(v.hex);
|
|
25
|
+
});
|
|
26
|
+
const onChange = useCallback(color => {
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
28
|
+
_onChange(color);
|
|
29
|
+
|
|
30
|
+
setText(color.hex.replace('#', ''));
|
|
31
|
+
}, [_onChange]);
|
|
32
|
+
const popoverRef = useRef(null);
|
|
33
|
+
const buttonRef = useRef(null);
|
|
34
|
+
useOnClickOutside(popoverRef, e => {
|
|
35
|
+
if (e.target === (buttonRef == null ? void 0 : buttonRef.current)) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
setPopoverOpen(false);
|
|
40
|
+
});
|
|
41
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
42
|
+
children: [/*#__PURE__*/_jsx(TextField, _extends({
|
|
43
|
+
disabled: disabled,
|
|
44
|
+
value: text.replace('#', ''),
|
|
45
|
+
leadingIcon: '#',
|
|
46
|
+
trailingIcon: /*#__PURE__*/_jsx(Button, {
|
|
47
|
+
style: {
|
|
48
|
+
backgroundColor: value.hex
|
|
49
|
+
},
|
|
50
|
+
color: "on.surface",
|
|
51
|
+
ref: buttonRef,
|
|
52
|
+
onClick: () => setPopoverOpen(open => !open),
|
|
53
|
+
disabled: disabled,
|
|
54
|
+
sx: {
|
|
55
|
+
pointerEvents: 'all',
|
|
56
|
+
cursor: 'pointer',
|
|
57
|
+
width: 32,
|
|
58
|
+
height: 32,
|
|
59
|
+
borderRadius: '4px',
|
|
60
|
+
borderWidth: '1px',
|
|
61
|
+
borderColor: alpha('on.surface', 0.38),
|
|
62
|
+
borderStyle: 'solid',
|
|
63
|
+
outlineColor: 'transparent'
|
|
64
|
+
}
|
|
65
|
+
}),
|
|
66
|
+
maxLength: 6,
|
|
67
|
+
hideCharacterCounter: true,
|
|
68
|
+
onChange: e => {
|
|
69
|
+
if (e.target.value.match(/^[a-fA-F0-9]{6}$/)) {
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
71
|
+
onChange(toColor('hex', '#' + e.target.value));
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
setText(e.target.value);
|
|
76
|
+
}
|
|
77
|
+
}, otherProps)), popoverOpen && /*#__PURE__*/_jsx(Popper, {
|
|
78
|
+
anchorEl: buttonRef,
|
|
79
|
+
placement: "bottom-end",
|
|
80
|
+
style: {
|
|
81
|
+
zIndex: 2
|
|
82
|
+
},
|
|
83
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
84
|
+
ref: popoverRef,
|
|
85
|
+
py: 2,
|
|
86
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
87
|
+
boxShadow: 4,
|
|
88
|
+
children: /*#__PURE__*/_jsx(ColorPicker, {
|
|
89
|
+
color: value // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
90
|
+
,
|
|
91
|
+
onChange: onChange,
|
|
92
|
+
width: 220,
|
|
93
|
+
height: 220
|
|
94
|
+
})
|
|
95
|
+
}), /*#__PURE__*/_jsx(Box, {})]
|
|
96
|
+
})
|
|
97
|
+
})]
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
//# sourceMappingURL=TextFieldColorPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ThemeExplorer/TextFieldColorPicker.tsx"],"names":["toColor","Popper","useControlledState","useOnClickOutside","alpha","Box","TextField","Button","useRef","useState","memo","useCallback","ColorPicker","TextFieldColorPicker","props","value","valueProp","defaultValue","onChange","onChangeProp","disabled","otherProps","popoverOpen","setPopoverOpen","text","setText","hex","_onChange","setState","v","color","replace","popoverRef","buttonRef","e","target","current","backgroundColor","open","pointerEvents","cursor","width","height","borderRadius","borderWidth","borderColor","borderStyle","outlineColor","match","zIndex"],"mappings":";;AAAA,SAAgBA,OAAhB,QAA+B,wBAA/B;AACA,SAASC,MAAT,EAAiBC,kBAAjB,EAAqCC,iBAArC,QAA8D,gBAA9D;AACA,SAASC,KAAT,EAAgBC,GAAhB,EAAqBC,SAArB,EAAgCC,MAAhC,QAA8D,KAA9D;AACA,SAASC,MAAT,EAAiBC,QAAjB,EAA2BC,IAA3B,EAAiCC,WAAjC,QAAoD,OAApD;AACA,SAASC,WAAT,QAA4B,eAA5B;;;;AASA,OAAO,MAAMC,oBAAoB,gBAAGH,IAAI,CAA6BI,KAAD,IAAW;AAC7E,QAAM;AACJC,IAAAA,KAAK,EAAEC,SADH;AAEJC,IAAAA,YAAY,GAAGjB,OAAO,CAAC,KAAD,EAAQ,SAAR,CAFlB;AAGJkB,IAAAA,QAAQ,EAAEC,YAHN;AAIJC,IAAAA;AAJI,MAMFN,KANJ;AAAA,QAKKO,UALL,iCAMIP,KANJ;;AAQA,QAAM,CAACQ,WAAD,EAAcC,cAAd,IAAgCd,QAAQ,CAAC,KAAD,CAA9C;AACA,QAAM,CAACe,IAAD,EAAOC,OAAP,IAAkBhB,QAAQ,CAAC,CAAAO,SAAS,Q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FF;AAGE,YAAA,QAAQ,EAAEG,QAHZ;AAIE,YAAA,KAAK,EAAE,GAJT;AAKE,YAAA,MAAM,EAAE;AALV;AADF,UADF,eAUE,KAAC,GAAD,KAVF;AAAA;AALF,MAtCJ;AAAA,IADF;AA4DD,CAnGuC,CAAjC","sourcesContent":["import { Color, toColor } from '@basic-ui/color-picker';\nimport { Popper, useControlledState, useOnClickOutside } from '@basic-ui/core';\nimport { alpha, Box, TextField, Button, TextFieldProps } from '../';\nimport { useRef, useState, memo, useCallback } from 'react';\nimport { ColorPicker } from './ColorPicker';\n\nexport interface TextFieldColorPickerProps\n extends Omit<TextFieldProps, 'value' | 'defaultValue' | 'onChange'> {\n value?: Color;\n defaultValue?: Color;\n onChange?: (color: Color) => void;\n}\n\nexport const TextFieldColorPicker = memo<TextFieldColorPickerProps>((props) => {\n const {\n value: valueProp,\n defaultValue = toColor('hex', '#33ff33'),\n onChange: onChangeProp,\n disabled,\n ...otherProps\n } = props;\n\n const [popoverOpen, setPopoverOpen] = useState(false);\n const [text, setText] = useState(valueProp?.hex || defaultValue.hex);\n const [value, _onChange] = useControlledState<Color, any, []>(\n valueProp,\n onChangeProp as any,\n defaultValue,\n (setState) => (v: any) => {\n setState(v);\n setText(v.hex);\n }\n );\n\n const onChange = useCallback(\n (color: Color) => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n _onChange!(color);\n setText(color.hex.replace('#', ''));\n },\n [_onChange]\n );\n\n const popoverRef = useRef<HTMLDivElement>(null);\n const buttonRef = useRef<HTMLButtonElement>(null);\n useOnClickOutside(popoverRef, (e) => {\n if (e.target === buttonRef?.current) {\n return;\n }\n setPopoverOpen(false);\n });\n\n return (\n <>\n <TextField\n disabled={disabled}\n value={text.replace('#', '')}\n leadingIcon={'#'}\n trailingIcon={\n <Button\n style={{ backgroundColor: value.hex }}\n color=\"on.surface\"\n ref={buttonRef}\n onClick={() => setPopoverOpen((open) => !open)}\n disabled={disabled}\n sx={{\n pointerEvents: 'all',\n cursor: 'pointer',\n width: 32,\n height: 32,\n borderRadius: '4px',\n borderWidth: '1px',\n borderColor: alpha('on.surface', 0.38),\n borderStyle: 'solid',\n outlineColor: 'transparent',\n }}\n />\n }\n maxLength={6}\n hideCharacterCounter\n onChange={(e) => {\n if (e.target.value.match(/^[a-fA-F0-9]{6}$/)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n onChange!(toColor('hex', '#' + e.target.value));\n return;\n }\n setText(e.target.value);\n }}\n {...otherProps}\n />\n {popoverOpen && (\n <Popper\n anchorEl={buttonRef}\n placement=\"bottom-end\"\n style={{ zIndex: 2 }}\n >\n <Box ref={popoverRef} py={2}>\n <Box boxShadow={4}>\n <ColorPicker\n color={value}\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n onChange={onChange!}\n width={220}\n height={220}\n />\n </Box>\n <Box></Box>\n </Box>\n </Popper>\n )}\n </>\n );\n});\n"],"file":"TextFieldColorPicker.js"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { Box } from '..';
|
|
3
|
+
import { ColorRow } from './components';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export const ThemeColors = /*#__PURE__*/memo(({
|
|
7
|
+
scheme
|
|
8
|
+
}) => {
|
|
9
|
+
function makeColorArrayForToken(token) {
|
|
10
|
+
return [{
|
|
11
|
+
token: "".concat(token),
|
|
12
|
+
bg: scheme[token],
|
|
13
|
+
color: scheme.on[token]
|
|
14
|
+
}, {
|
|
15
|
+
token: "on.".concat(token),
|
|
16
|
+
bg: scheme.on[token],
|
|
17
|
+
color: scheme[token]
|
|
18
|
+
}, {
|
|
19
|
+
token: "".concat(token, "-container"),
|
|
20
|
+
bg: scheme["".concat(token, "-container")],
|
|
21
|
+
color: scheme.on["".concat(token, "-container")]
|
|
22
|
+
}, {
|
|
23
|
+
token: "on.".concat(token, "-container"),
|
|
24
|
+
bg: scheme.on["".concat(token, "-container")],
|
|
25
|
+
color: scheme["".concat(token, "-container")]
|
|
26
|
+
}];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
30
|
+
width: "600",
|
|
31
|
+
display: "flex",
|
|
32
|
+
flexDirection: "column",
|
|
33
|
+
sx: {
|
|
34
|
+
gap: 2
|
|
35
|
+
},
|
|
36
|
+
children: [/*#__PURE__*/_jsx(ColorRow, {
|
|
37
|
+
colors: makeColorArrayForToken('primary'),
|
|
38
|
+
height: 118
|
|
39
|
+
}), /*#__PURE__*/_jsx(ColorRow, {
|
|
40
|
+
colors: makeColorArrayForToken('secondary')
|
|
41
|
+
}), /*#__PURE__*/_jsx(ColorRow, {
|
|
42
|
+
colors: makeColorArrayForToken('tertiary')
|
|
43
|
+
}), /*#__PURE__*/_jsx(ColorRow, {
|
|
44
|
+
colors: makeColorArrayForToken('error')
|
|
45
|
+
}), /*#__PURE__*/_jsx(ColorRow, {
|
|
46
|
+
colors: [{
|
|
47
|
+
token: "background",
|
|
48
|
+
bg: scheme.background,
|
|
49
|
+
color: scheme.on.background
|
|
50
|
+
}, {
|
|
51
|
+
token: "on.background",
|
|
52
|
+
bg: scheme.on.background,
|
|
53
|
+
color: scheme.background
|
|
54
|
+
}, {
|
|
55
|
+
token: "surface",
|
|
56
|
+
bg: scheme.surface,
|
|
57
|
+
color: scheme.on.surface
|
|
58
|
+
}, {
|
|
59
|
+
token: "on.surface",
|
|
60
|
+
bg: scheme.on.surface,
|
|
61
|
+
color: scheme.surface
|
|
62
|
+
}]
|
|
63
|
+
}), /*#__PURE__*/_jsx(ColorRow, {
|
|
64
|
+
colors: [{
|
|
65
|
+
token: "surface-variant",
|
|
66
|
+
bg: scheme['surface-variant'],
|
|
67
|
+
color: scheme.on['surface-variant']
|
|
68
|
+
}, {
|
|
69
|
+
token: "on.surface-variant",
|
|
70
|
+
bg: scheme.on['surface-variant'],
|
|
71
|
+
color: scheme['surface-variant']
|
|
72
|
+
}, {
|
|
73
|
+
token: "outline",
|
|
74
|
+
bg: scheme.outline,
|
|
75
|
+
color: scheme.on.outline
|
|
76
|
+
}]
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=ThemeColors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/ThemeExplorer/ThemeColors.tsx"],"names":["React","memo","Box","ColorRow","ThemeColors","scheme","makeColorArrayForToken","token","bg","color","on","gap","background","surface","outline"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,IAAhB,QAA4B,OAA5B;AACA,SAASC,GAAT,QAAoB,IAApB;AACA,SAASC,QAAT,QAAyB,cAAzB;;;AAGA,OAAO,MAAMC,WAAW,gBAAGH,IAAI,CAC7B,CAAC;AACCI,EAAAA;AADD,CAAD,KAIM;AACJ,WAASC,sBAAT,CAAgCC,KAAhC,EAA+C;AAC7C,WAAO,CACL;AACEA,MAAAA,KAAK,YAAKA,KAAL,CADP;AAEEC,MAAAA,EAAE,EAAEH,MAAM,CAACE,KAAD,CAFZ;AAGEE,MAAAA,KAAK,EAAEJ,MAAM,CAACK,EAAP,CAAUH,KAAV;AAHT,KADK,EAML;AACEA,MAAAA,KAAK,eAAQA,KAAR,CADP;AAEEC,MAAAA,EAAE,EAAEH,MAAM,CAACK,EAAP,CAAUH,KAAV,CAFN;AAGEE,MAAAA,KAAK,EAAEJ,MAAM,CAACE,KAAD;AAHf,KANK,EAWL;AACEA,MAAAA,KAAK,YAAKA,KAAL,eADP;AAEEC,MAAAA,EAAE,EAAEH,MAAM,WAAIE,KAAJ,gBAFZ;AAGEE,MAAAA,KAAK,EAAEJ,MAAM,CAACK,EAAP,WAAaH,KAAb;AAHT,KAXK,EAgBL;AACEA,MAAAA,KAAK,eAAQA,KAAR,eADP;AAEEC,MAAAA,EAAE,EAAEH,MAAM,CAACK,EAAP,WAAaH,KAA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BM;AADV,MALF,eA6BE,KAAC,QAAD;AACE,MAAA,MAAM,EAAE,CACN;AACEN,QAAAA,KAAK,mBADP;AAEEC,QAAAA,EAAE,EAAEH,MAAM,CAAC,iBAAD,CAFZ;AAGEI,QAAAA,KAAK,EAAEJ,MAAM,CAACK,EAAP,CAAU,iBAAV;AAHT,OADM,EAMN;AACEH,QAAAA,KAAK,sBADP;AAEEC,QAAAA,EAAE,EAAEH,MAAM,CAACK,EAAP,CAAU,iBAAV,CAFN;AAGED,QAAAA,KAAK,EAAEJ,MAAM,CAAC,iBAAD;AAHf,OANM,EAWN;AACEE,QAAAA,KAAK,WADP;AAEEC,QAAAA,EAAE,EAAEH,MAAM,CAACS,OAFb;AAGEL,QAAAA,KAAK,EAAEJ,MAAM,CAACK,EAAP,CAAUI;AAHnB,OAXM;AADV,MA7BF;AAAA,IADF;AAmDD,CAjF4B,CAAxB","sourcesContent":["import React, { memo } from 'react';\nimport { Box } from '..';\nimport { ColorRow } from './components';\nimport { makeColorScheme } from './makeColorScheme';\n\nexport const ThemeColors = memo(\n ({\n scheme,\n }: {\n scheme: Omit<ReturnType<typeof makeColorScheme>, 'modes'>;\n }) => {\n function makeColorArrayForToken(token: string) {\n return [\n {\n token: `${token}`,\n bg: scheme[token],\n color: scheme.on[token],\n },\n {\n token: `on.${token}`,\n bg: scheme.on[token],\n color: scheme[token],\n },\n {\n token: `${token}-container`,\n bg: scheme[`${token}-container`],\n color: scheme.on[`${token}-container`],\n },\n {\n token: `on.${token}-container`,\n bg: scheme.on[`${token}-container`],\n color: scheme[`${token}-container`],\n },\n ];\n }\n return (\n <Box width=\"600\" display=\"flex\" flexDirection=\"column\" sx={{ gap: 2 }}>\n <ColorRow colors={makeColorArrayForToken('primary')} height={118} />\n <ColorRow colors={makeColorArrayForToken('secondary')} />\n <ColorRow colors={makeColorArrayForToken('tertiary')} />\n <ColorRow colors={makeColorArrayForToken('error')} />\n <ColorRow\n colors={[\n {\n token: `background`,\n bg: scheme.background,\n color: scheme.on.background,\n },\n {\n token: `on.background`,\n bg: scheme.on.background,\n color: scheme.background,\n },\n {\n token: `surface`,\n bg: scheme.surface,\n color: scheme.on.surface,\n },\n {\n token: `on.surface`,\n bg: scheme.on.surface,\n color: scheme.surface,\n },\n ]}\n />\n <ColorRow\n colors={[\n {\n token: `surface-variant`,\n bg: scheme['surface-variant'],\n color: scheme.on['surface-variant'],\n },\n {\n token: `on.surface-variant`,\n bg: scheme.on['surface-variant'],\n color: scheme['surface-variant'],\n },\n {\n token: `outline`,\n bg: scheme.outline,\n color: scheme.on.outline,\n },\n ]}\n />\n </Box>\n );\n }\n);\n"],"file":"ThemeColors.js"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
import { TonalPalette } from '@material/material-color-utilities';
|
|
3
|
+
export declare const ColorItem: React.MemoExoticComponent<(props: {
|
|
4
|
+
token: string;
|
|
5
|
+
style: CSSProperties;
|
|
6
|
+
height: number;
|
|
7
|
+
width: string;
|
|
8
|
+
}) => JSX.Element>;
|
|
9
|
+
export declare const ColorRow: React.MemoExoticComponent<(props: {
|
|
10
|
+
colors: {
|
|
11
|
+
token: string;
|
|
12
|
+
bg: string;
|
|
13
|
+
color: string;
|
|
14
|
+
}[];
|
|
15
|
+
height?: number;
|
|
16
|
+
}) => JSX.Element>;
|
|
17
|
+
export declare const TonalColorItem: React.MemoExoticComponent<(props: {
|
|
18
|
+
color: string;
|
|
19
|
+
level: number;
|
|
20
|
+
}) => JSX.Element>;
|
|
21
|
+
export declare const TonalColorsFromToken: React.MemoExoticComponent<(props: {
|
|
22
|
+
token: string;
|
|
23
|
+
}) => JSX.Element>;
|
|
24
|
+
export declare const TonalColors: React.MemoExoticComponent<(props: {
|
|
25
|
+
palette: TonalPalette;
|
|
26
|
+
}) => JSX.Element>;
|
|
27
|
+
export declare function makeColorArrayForToken(token: string): {
|
|
28
|
+
token: string;
|
|
29
|
+
bg: string;
|
|
30
|
+
color: string;
|
|
31
|
+
}[];
|