Socket
Socket
Sign inDemoInstall

@chakra-ui/editable

Package Overview
Dependencies
Maintainers
3
Versions
456
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/editable - npm Package Compare versions

Comparing version 2.0.16 to 2.0.17

dist/chunk-6EW6LXRD.mjs

162

dist/index.d.ts

@@ -1,151 +0,11 @@

import * as _chakra_ui_system from '@chakra-ui/system';
import { ThemingProps, HTMLChakraProps, SystemStyleObject } from '@chakra-ui/system';
import * as _chakra_ui_react_types from '@chakra-ui/react-types';
import { PropGetter } from '@chakra-ui/react-types';
interface UseEditableProps {
/**
* The value of the Editable in both edit & preview mode
*/
value?: string;
/**
* The initial value of the Editable in both edit & preview mode
*/
defaultValue?: string;
/**
* If `true`, the Editable will be disabled.
*/
isDisabled?: boolean;
/**
* If `true`, the Editable will start with edit mode by default.
*/
startWithEditView?: boolean;
/**
* If `true`, the read only view, has a `tabIndex` set to `0`
* so it can receive focus via the keyboard or click.
* @default true
*/
isPreviewFocusable?: boolean;
/**
* If `true`, it'll update the value onBlur and turn off the edit mode.
* @default true
*/
submitOnBlur?: boolean;
/**
* Callback invoked when user changes input.
*/
onChange?: (nextValue: string) => void;
/**
* Callback invoked when user cancels input with the `Esc` key.
* It provides the last confirmed value as argument.
*/
onCancel?: (previousValue: string) => void;
/**
* Callback invoked when user confirms value with `enter` key or by blurring input.
*/
onSubmit?: (nextValue: string) => void;
/**
* Callback invoked once the user enters edit mode.
*/
onEdit?: () => void;
/**
* If `true`, the input's text will be highlighted on focus.
* @default true
*/
selectAllOnFocus?: boolean;
/**
* The placeholder text when the value is empty.
*/
placeholder?: string;
}
/**
* React hook for managing the inline renaming of some text.
*
* @see Docs https://chakra-ui.com/editable
*/
declare function useEditable(props?: UseEditableProps): {
isEditing: boolean;
isDisabled: boolean | undefined;
isValueEmpty: boolean;
value: string;
onEdit: () => void;
onCancel: () => void;
onSubmit: () => void;
getPreviewProps: PropGetter<Record<string, unknown>, _chakra_ui_react_types.DOMAttributes<_chakra_ui_react_types.DOMElement>>;
getInputProps: PropGetter<Record<string, unknown>, _chakra_ui_react_types.DOMAttributes<_chakra_ui_react_types.DOMElement>>;
getTextareaProps: PropGetter<Record<string, unknown>, _chakra_ui_react_types.DOMAttributes<_chakra_ui_react_types.DOMElement>>;
getEditButtonProps: PropGetter<Record<string, unknown>, _chakra_ui_react_types.DOMAttributes<_chakra_ui_react_types.DOMElement>>;
getSubmitButtonProps: PropGetter<Record<string, unknown>, _chakra_ui_react_types.DOMAttributes<_chakra_ui_react_types.DOMElement>>;
getCancelButtonProps: PropGetter<Record<string, unknown>, _chakra_ui_react_types.DOMAttributes<_chakra_ui_react_types.DOMElement>>;
htmlProps: {};
};
declare type UseEditableReturn = ReturnType<typeof useEditable>;
declare type RenderProps = Pick<UseEditableReturn, "isEditing" | "onSubmit" | "onCancel" | "onEdit">;
declare type MaybeRenderProp<P> = React.ReactNode | ((props: P) => React.ReactNode);
interface BaseEditableProps extends Omit<HTMLChakraProps<"div">, "onChange" | "value" | "defaultValue" | "onSubmit"> {
}
interface EditableProps extends UseEditableProps, Omit<BaseEditableProps, "children">, ThemingProps<"Editable"> {
children?: MaybeRenderProp<RenderProps>;
}
/**
* Editable
*
* The wrapper that provides context and logic for all editable
* components. It renders a `div`
*
* @see Docs https://chakra-ui.com/docs/components/editable
*/
declare const Editable: _chakra_ui_system.ComponentWithAs<"div", EditableProps>;
interface EditableInputProps extends HTMLChakraProps<"input"> {
}
/**
* EditableInput
*
* The input used in the `edit` mode
*/
declare const EditableInput: _chakra_ui_system.ComponentWithAs<"input", EditableInputProps>;
interface EditableTextareaProps extends HTMLChakraProps<"textarea"> {
}
/**
* EditableTextarea
*
* The textarea used in the `edit` mode
*/
declare const EditableTextarea: _chakra_ui_system.ComponentWithAs<"textarea", EditableTextareaProps>;
interface EditablePreviewProps extends HTMLChakraProps<"div"> {
}
/**
* EditablePreview
*
* The `span` used to display the final value, in the `preview` mode
*/
declare const EditablePreview: _chakra_ui_system.ComponentWithAs<"span", EditablePreviewProps>;
/**
* React hook use to create controls for the editable component
*/
declare function useEditableControls(): {
isEditing: boolean;
getEditButtonProps: _chakra_ui_react_types.PropGetter<Record<string, unknown>, _chakra_ui_react_types.DOMAttributes<_chakra_ui_react_types.DOMElement>>;
getCancelButtonProps: _chakra_ui_react_types.PropGetter<Record<string, unknown>, _chakra_ui_react_types.DOMAttributes<_chakra_ui_react_types.DOMElement>>;
getSubmitButtonProps: _chakra_ui_react_types.PropGetter<Record<string, unknown>, _chakra_ui_react_types.DOMAttributes<_chakra_ui_react_types.DOMElement>>;
};
/**
* React hook use to gain access to the editable state and actions.
*/
declare function useEditableState(): {
isEditing: boolean;
onSubmit: () => void;
onCancel: () => void;
onEdit: () => void;
isDisabled: boolean | undefined;
};
declare const useEditableStyles: () => Record<string, SystemStyleObject>;
export { Editable, EditableInput, EditableInputProps, EditablePreview, EditablePreviewProps, EditableProps, EditableTextarea, EditableTextareaProps, UseEditableProps, UseEditableReturn, useEditable, useEditableControls, useEditableState, useEditableStyles };
export { Editable, EditableProps } from './editable.js';
export { EditableInput, EditableInputProps } from './editable-input.js';
export { EditableTextarea, EditableTextareaProps } from './editable-textarea.js';
export { EditablePreview, EditablePreviewProps } from './editable-preview.js';
export { UseEditableProps, UseEditableReturn, useEditable } from './use-editable.js';
export { useEditableControls } from './use-editable-controls.js';
export { useEditableState } from './use-editable-state.js';
export { useEditableStyles } from './editable-context.js';
import '@chakra-ui/system';
import '@chakra-ui/react-types';
import 'react';
{
"name": "@chakra-ui/editable",
"version": "2.0.16",
"version": "2.0.17",
"description": "React component used to build inline-editable components",

@@ -20,3 +20,3 @@ "keywords": [

"license": "MIT",
"main": "dist/index.cjs.js",
"main": "dist/index.js",
"files": [

@@ -37,11 +37,11 @@ "dist"

"dependencies": {
"@chakra-ui/react-use-safe-layout-effect": "2.0.3",
"@chakra-ui/react-use-update-effect": "2.0.5",
"@chakra-ui/react-use-merge-refs": "2.0.5",
"@chakra-ui/react-use-controllable-state": "2.0.6",
"@chakra-ui/react-use-focus-on-pointer-down": "2.0.4",
"@chakra-ui/react-use-callback-ref": "2.0.5",
"@chakra-ui/react-context": "2.0.5",
"@chakra-ui/react-types": "2.0.5",
"@chakra-ui/shared-utils": "2.0.3"
"@chakra-ui/react-use-safe-layout-effect": "2.0.4",
"@chakra-ui/react-use-update-effect": "2.0.6",
"@chakra-ui/react-use-merge-refs": "2.0.6",
"@chakra-ui/react-use-controllable-state": "2.0.7",
"@chakra-ui/react-use-focus-on-pointer-down": "2.0.5",
"@chakra-ui/react-use-callback-ref": "2.0.6",
"@chakra-ui/react-context": "2.0.6",
"@chakra-ui/react-types": "2.0.6",
"@chakra-ui/shared-utils": "2.0.4"
},

@@ -51,4 +51,4 @@ "devDependencies": {

"clean-package": "2.1.1",
"@chakra-ui/system": "2.3.4",
"@chakra-ui/layout": "2.1.11"
"@chakra-ui/system": "2.3.6",
"@chakra-ui/layout": "2.1.12"
},

@@ -59,9 +59,18 @@ "peerDependencies": {

},
"module": "dist/index.esm.js",
"clean-package": "../../../clean-package.config.json",
"tsup": {
"clean": true,
"target": "es2019",
"format": [
"cjs",
"esm"
]
},
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js",
"types": "./dist/index.d.ts"
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},

@@ -71,8 +80,8 @@ "./package.json": "./package.json"

"scripts": {
"build": "JSX=1 tsup src/index.ts --dts",
"build": "tsup src --dts",
"dev": "pnpm build:fast -- --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"build:fast": "JSX=1 tsup src/index.ts"
"build:fast": "tsup src"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc