@redis-ui/components 51.26.0 → 51.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.cjs +17 -8
- package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.js +17 -8
- package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.types.d.ts +5 -1
- package/dist/CodeBlock/CodeBlock.cjs +29 -14
- package/dist/CodeBlock/CodeBlock.js +29 -14
- package/dist/CodeBlock/CodeBlock.style.d.ts +4 -3
- package/dist/CodeBlock/CodeBlock.types.cjs +7 -0
- package/dist/CodeBlock/CodeBlock.types.d.ts +4 -0
- package/dist/CodeBlock/CodeBlock.types.js +7 -1
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.cjs +29 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.cjs +34 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.d.ts +25 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.constants.js +32 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.d.ts +6 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.js +29 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.types.d.ts +10 -0
- package/dist/CodeBlock/components/HighlightedCode/HighlightedCode.types.js +1 -0
- package/dist/Inputs/Input/Input.cjs +9 -2
- package/dist/Inputs/Input/Input.d.ts +4 -1
- package/dist/Inputs/Input/Input.js +9 -2
- package/dist/Inputs/Input/Input.types.d.ts +5 -1
- package/dist/Inputs/PasswordInput/components/Compose/Compose.types.d.ts +1 -1
- package/dist/Inputs/TextArea/TextArea.cjs +16 -6
- package/dist/Inputs/TextArea/TextArea.d.ts +3 -1
- package/dist/Inputs/TextArea/TextArea.js +16 -6
- package/dist/Inputs/TextArea/TextArea.types.d.ts +4 -1
- package/dist/Inputs/TextArea/components/CopyButton/CopyButton.cjs +7 -0
- package/dist/Inputs/TextArea/components/CopyButton/CopyButton.d.ts +2 -0
- package/dist/Inputs/TextArea/components/CopyButton/CopyButton.js +7 -0
- package/dist/Inputs/TextArea/components/CopyButton/CopyButton.style.cjs +17 -0
- package/dist/Inputs/TextArea/components/CopyButton/CopyButton.style.d.ts +1 -0
- package/dist/Inputs/TextArea/components/CopyButton/CopyButton.style.js +15 -0
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.cjs +3 -1
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.js +4 -2
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.style.cjs +8 -1
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.style.js +8 -1
- package/dist/Inputs/components/Compose/CommonCompose.cjs +23 -18
- package/dist/Inputs/components/Compose/CommonCompose.d.ts +1 -1
- package/dist/Inputs/components/Compose/CommonCompose.js +24 -19
- package/dist/Inputs/components/Compose/CommonCompose.types.d.ts +2 -0
- package/dist/Inputs/components/Compose/Compose.style.cjs +7 -0
- package/dist/Inputs/components/Compose/Compose.style.js +7 -0
- package/dist/Inputs/components/Compose/NumericCompose.types.d.ts +1 -1
- package/dist/Inputs/components/CopyButton/CopyButton.cjs +15 -0
- package/dist/Inputs/components/CopyButton/CopyButton.d.ts +2 -0
- package/dist/Inputs/components/CopyButton/CopyButton.js +15 -0
- package/dist/Inputs/components/CopyButton/CopyButton.style.cjs +17 -0
- package/dist/Inputs/components/CopyButton/CopyButton.style.d.ts +1 -0
- package/dist/Inputs/components/CopyButton/CopyButton.style.js +15 -0
- package/dist/Inputs/components/CopyButton/CopyButton.types.d.ts +6 -0
- package/dist/Inputs/components/CopyButton/CopyButton.types.js +1 -0
- package/dist/Inputs/components/InputTag/InputTag.cjs +3 -1
- package/dist/Inputs/components/InputTag/InputTag.js +4 -2
- package/dist/Inputs/components/InputTag/InputTag.style.cjs +1 -1
- package/dist/Inputs/components/InputTag/InputTag.style.js +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.js +2 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.cjs +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.cjs +7 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +7 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.cjs +12 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.js +12 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.cjs +17 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +12 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.cjs +6 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +6 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.cjs +6 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +6 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.cjs +13 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.cjs +12 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.cjs +10 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +10 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.cjs +14 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +14 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.cjs +9 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +9 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/typeof.cjs +16 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js +11 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.cjs +11 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +11 -0
- package/dist/node_modules/character-entities-legacy/index.cjs +116 -0
- package/dist/node_modules/character-entities-legacy/index.js +116 -0
- package/dist/node_modules/character-reference-invalid/index.cjs +38 -0
- package/dist/node_modules/character-reference-invalid/index.js +38 -0
- package/dist/node_modules/comma-separated-tokens/index.cjs +43 -0
- package/dist/node_modules/comma-separated-tokens/index.js +43 -0
- package/dist/node_modules/decode-named-character-reference/index.dom.cjs +15 -0
- package/dist/node_modules/decode-named-character-reference/index.dom.js +15 -0
- package/dist/node_modules/hast-util-parse-selector/lib/index.cjs +76 -0
- package/dist/node_modules/hast-util-parse-selector/lib/index.js +76 -0
- package/dist/node_modules/hastscript/lib/create-h.cjs +262 -0
- package/dist/node_modules/hastscript/lib/create-h.js +262 -0
- package/dist/node_modules/hastscript/lib/index.cjs +21 -0
- package/dist/node_modules/hastscript/lib/index.js +21 -0
- package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs +49 -0
- package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.js +49 -0
- package/dist/node_modules/is-alphabetical/index.cjs +14 -0
- package/dist/node_modules/is-alphabetical/index.js +14 -0
- package/dist/node_modules/is-alphanumerical/index.cjs +15 -0
- package/dist/node_modules/is-alphanumerical/index.js +15 -0
- package/dist/node_modules/is-decimal/index.cjs +14 -0
- package/dist/node_modules/is-decimal/index.js +14 -0
- package/dist/node_modules/is-hexadecimal/index.cjs +14 -0
- package/dist/node_modules/is-hexadecimal/index.js +14 -0
- package/dist/node_modules/parse-entities/lib/index.cjs +232 -0
- package/dist/node_modules/parse-entities/lib/index.js +232 -0
- package/dist/node_modules/property-information/index.cjs +27 -0
- package/dist/node_modules/property-information/index.js +26 -0
- package/dist/node_modules/property-information/lib/aria.cjs +60 -0
- package/dist/node_modules/property-information/lib/aria.js +61 -0
- package/dist/node_modules/property-information/lib/find.cjs +81 -0
- package/dist/node_modules/property-information/lib/find.js +81 -0
- package/dist/node_modules/property-information/lib/html.cjs +326 -0
- package/dist/node_modules/property-information/lib/html.js +326 -0
- package/dist/node_modules/property-information/lib/normalize.cjs +15 -0
- package/dist/node_modules/property-information/lib/normalize.js +15 -0
- package/dist/node_modules/property-information/lib/svg.cjs +564 -0
- package/dist/node_modules/property-information/lib/svg.js +564 -0
- package/dist/node_modules/property-information/lib/util/case-insensitive-transform.cjs +15 -0
- package/dist/node_modules/property-information/lib/util/case-insensitive-transform.js +15 -0
- package/dist/node_modules/property-information/lib/util/case-sensitive-transform.cjs +14 -0
- package/dist/node_modules/property-information/lib/util/case-sensitive-transform.js +14 -0
- package/dist/node_modules/property-information/lib/util/create.cjs +53 -0
- package/dist/node_modules/property-information/lib/util/create.js +53 -0
- package/dist/node_modules/property-information/lib/util/defined-info.cjs +49 -0
- package/dist/node_modules/property-information/lib/util/defined-info.js +49 -0
- package/dist/node_modules/property-information/lib/util/info.cjs +33 -0
- package/dist/node_modules/property-information/lib/util/info.js +33 -0
- package/dist/node_modules/property-information/lib/util/merge.cjs +26 -0
- package/dist/node_modules/property-information/lib/util/merge.js +26 -0
- package/dist/node_modules/property-information/lib/util/schema.cjs +27 -0
- package/dist/node_modules/property-information/lib/util/schema.js +27 -0
- package/dist/node_modules/property-information/lib/util/types.cjs +35 -0
- package/dist/node_modules/property-information/lib/util/types.js +24 -0
- package/dist/node_modules/property-information/lib/xlink.cjs +18 -0
- package/dist/node_modules/property-information/lib/xlink.js +19 -0
- package/dist/node_modules/property-information/lib/xml.cjs +14 -0
- package/dist/node_modules/property-information/lib/xml.js +15 -0
- package/dist/node_modules/property-information/lib/xmlns.cjs +14 -0
- package/dist/node_modules/property-information/lib/xmlns.js +14 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.cjs +6 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.js +6 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.cjs +183 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.js +181 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.cjs +308 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.js +306 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/bash.cjs +4 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/bash.js +5 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/json.cjs +4 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/json.js +5 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/python.cjs +4 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/python.js +5 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/typescript.cjs +4 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/languages/prism/typescript.js +5 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/prism-light.cjs +12 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/prism-light.js +12 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vs.cjs +121 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vs.js +121 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.cjs +147 -0
- package/dist/node_modules/react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.js +147 -0
- package/dist/node_modules/refractor/lang/bash.cjs +190 -0
- package/dist/node_modules/refractor/lang/bash.js +190 -0
- package/dist/node_modules/refractor/lang/clike.cjs +37 -0
- package/dist/node_modules/refractor/lang/clike.js +37 -0
- package/dist/node_modules/refractor/lang/javascript.cjs +122 -0
- package/dist/node_modules/refractor/lang/javascript.js +122 -0
- package/dist/node_modules/refractor/lang/json.cjs +36 -0
- package/dist/node_modules/refractor/lang/json.js +36 -0
- package/dist/node_modules/refractor/lang/python.cjs +71 -0
- package/dist/node_modules/refractor/lang/python.js +71 -0
- package/dist/node_modules/refractor/lang/typescript.cjs +55 -0
- package/dist/node_modules/refractor/lang/typescript.js +55 -0
- package/dist/node_modules/refractor/lib/core.cjs +214 -0
- package/dist/node_modules/refractor/lib/core.js +214 -0
- package/dist/node_modules/refractor/lib/prism-core.cjs +595 -0
- package/dist/node_modules/refractor/lib/prism-core.js +595 -0
- package/dist/node_modules/space-separated-tokens/index.cjs +15 -0
- package/dist/node_modules/space-separated-tokens/index.js +15 -0
- package/package.json +4 -2
- package/skills/redis-ui-components/references/CodeBlock.md +23 -5
- package/skills/redis-ui-components/references/CopyToClipboardButton.md +23 -1
- package/skills/redis-ui-components/references/Input.md +39 -2
- package/skills/redis-ui-components/references/SearchInput.md +1 -1
- package/skills/redis-ui-components/references/TextArea.md +19 -1
|
@@ -2,10 +2,11 @@ const require_Compose_style = require("./components/Compose/Compose.style.cjs");
|
|
|
2
2
|
const require_Compose = require("./components/Compose/Compose.cjs");
|
|
3
3
|
const require_TextAreaTag = require("./components/TextAreaTag/TextAreaTag.cjs");
|
|
4
4
|
const require_StatusIndicator_style = require("./components/StatusIndicator/StatusIndicator.style.cjs");
|
|
5
|
+
const require_CopyButton = require("./components/CopyButton/CopyButton.cjs");
|
|
5
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
7
|
let react = require("react");
|
|
7
8
|
//#region src/Inputs/TextArea/TextArea.tsx
|
|
8
|
-
var TextArea = Object.assign((0, react.forwardRef)(({ id, className, style, readOnly, variant, error, valid, value, defaultValue, onChange, height, ...restProps }, ref) => {
|
|
9
|
+
var TextArea = Object.assign((0, react.forwardRef)(({ id, className, style, readOnly, variant, error, valid, value, defaultValue, onChange, height, showCopyButton = false, copyButtonProps, ...restProps }, ref) => {
|
|
9
10
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TextArea.Compose, {
|
|
10
11
|
id,
|
|
11
12
|
className,
|
|
@@ -19,16 +20,25 @@ var TextArea = Object.assign((0, react.forwardRef)(({ id, className, style, read
|
|
|
19
20
|
defaultValue,
|
|
20
21
|
onChange,
|
|
21
22
|
readonlyProps: restProps,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
boxedReadonly: showCopyButton,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextArea.Tag, {
|
|
26
|
+
ref,
|
|
27
|
+
...restProps
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextArea.CopyButton, {
|
|
30
|
+
...copyButtonProps,
|
|
31
|
+
showCopyButton
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextArea.StatusIndicator, {})
|
|
34
|
+
]
|
|
26
35
|
});
|
|
27
36
|
}), {
|
|
28
37
|
StatusIndicator: require_StatusIndicator_style.TextAreaStatusIndicator,
|
|
29
38
|
Compose: require_Compose.Compose,
|
|
30
39
|
Tag: require_TextAreaTag.default,
|
|
31
|
-
ReadonlyValue: require_Compose_style.ReadonlyValue
|
|
40
|
+
ReadonlyValue: require_Compose_style.ReadonlyValue,
|
|
41
|
+
CopyButton: require_CopyButton.CopyButton
|
|
32
42
|
});
|
|
33
43
|
//#endregion
|
|
34
44
|
exports.default = TextArea;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { RestTextAreaProps } from './TextArea.types';
|
|
2
2
|
declare const TextArea: import("react").ForwardRefExoticComponent<Omit<import("../components/Compose/TextCompose.types").TextInputComposeProps, "parser" | "formatter"> & {
|
|
3
3
|
height?: string;
|
|
4
|
-
} & {
|
|
4
|
+
} & import("../components/CopyButton/CopyButton.types").CopyButtonProps & {
|
|
5
5
|
readOnly?: boolean;
|
|
6
|
+
copyButtonProps?: import("../components/CopyButton/CopyButton.types").RestCopyButtonProps;
|
|
6
7
|
} & RestTextAreaProps & import("react").RefAttributes<HTMLTextAreaElement>> & {
|
|
7
8
|
StatusIndicator: import("styled-components").StyledComponent<({ className, style, size, ...restProps }: import("@redis-ui/icons").MonochromeIconProps & Pick<import("react").HTMLAttributes<unknown>, "className" | "style">) => import("react/jsx-runtime").JSX.Element | null, any, {}, never>;
|
|
8
9
|
Compose: ({ readonlyRender, ...restProps }: import("./components/Compose/Compose.types").TextAreaComposeProps & import("./components/Compose/Compose.types").RestTextAreaComposeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,5 +11,6 @@ declare const TextArea: import("react").ForwardRefExoticComponent<Omit<import(".
|
|
|
10
11
|
ReadonlyValue: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../..").TypographyBodyProps & import("react").RefAttributes<HTMLElement>>, any, {
|
|
11
12
|
readOnly: boolean;
|
|
12
13
|
}, "readOnly">;
|
|
14
|
+
CopyButton: ({ showCopyButton, ...restProps }: import("../components/CopyButton/CopyButton.types").RestCopyButtonProps & import("../components/CopyButton/CopyButton.types").CopyButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
15
|
};
|
|
14
16
|
export default TextArea;
|
|
@@ -2,10 +2,11 @@ import { ReadonlyValue } from "./components/Compose/Compose.style.js";
|
|
|
2
2
|
import { Compose } from "./components/Compose/Compose.js";
|
|
3
3
|
import TextAreaTag from "./components/TextAreaTag/TextAreaTag.js";
|
|
4
4
|
import { TextAreaStatusIndicator } from "./components/StatusIndicator/StatusIndicator.style.js";
|
|
5
|
+
import { CopyButton } from "./components/CopyButton/CopyButton.js";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { forwardRef } from "react";
|
|
7
8
|
//#region src/Inputs/TextArea/TextArea.tsx
|
|
8
|
-
var TextArea = Object.assign(forwardRef(({ id, className, style, readOnly, variant, error, valid, value, defaultValue, onChange, height, ...restProps }, ref) => {
|
|
9
|
+
var TextArea = Object.assign(forwardRef(({ id, className, style, readOnly, variant, error, valid, value, defaultValue, onChange, height, showCopyButton = false, copyButtonProps, ...restProps }, ref) => {
|
|
9
10
|
return /* @__PURE__ */ jsxs(TextArea.Compose, {
|
|
10
11
|
id,
|
|
11
12
|
className,
|
|
@@ -19,16 +20,25 @@ var TextArea = Object.assign(forwardRef(({ id, className, style, readOnly, varia
|
|
|
19
20
|
defaultValue,
|
|
20
21
|
onChange,
|
|
21
22
|
readonlyProps: restProps,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
boxedReadonly: showCopyButton,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsx(TextArea.Tag, {
|
|
26
|
+
ref,
|
|
27
|
+
...restProps
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ jsx(TextArea.CopyButton, {
|
|
30
|
+
...copyButtonProps,
|
|
31
|
+
showCopyButton
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ jsx(TextArea.StatusIndicator, {})
|
|
34
|
+
]
|
|
26
35
|
});
|
|
27
36
|
}), {
|
|
28
37
|
StatusIndicator: TextAreaStatusIndicator,
|
|
29
38
|
Compose,
|
|
30
39
|
Tag: TextAreaTag,
|
|
31
|
-
ReadonlyValue
|
|
40
|
+
ReadonlyValue,
|
|
41
|
+
CopyButton
|
|
32
42
|
});
|
|
33
43
|
//#endregion
|
|
34
44
|
export { TextArea as default };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { TextareaHTMLAttributes } from 'react';
|
|
2
2
|
import { TextAreaComposeProps } from './components/Compose/Compose.types';
|
|
3
|
-
|
|
3
|
+
import { CopyButtonProps, RestCopyButtonProps } from '../components/CopyButton/CopyButton.types';
|
|
4
|
+
export type TextAreaProps = TextAreaComposeProps & CopyButtonProps & {
|
|
4
5
|
readOnly?: boolean;
|
|
6
|
+
/** Props of the copy button rendered when `showCopyButton` is set, for example `aria-label` or `onCopy`. */
|
|
7
|
+
copyButtonProps?: RestCopyButtonProps;
|
|
5
8
|
};
|
|
6
9
|
export type RestTextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'children' | 'defaultValue' | 'value' | 'onChange'>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const require_CopyButton = require("../../../components/CopyButton/CopyButton.cjs");
|
|
2
|
+
const require_CopyButton_style = require("./CopyButton.style.cjs");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
//#region src/Inputs/TextArea/components/CopyButton/CopyButton.tsx
|
|
5
|
+
var CopyButton = ({ showCopyButton = true, ...restProps }) => showCopyButton ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CopyButton_style.CopyButtonContainer, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CopyButton.CopyButton, { ...restProps }) }) : null;
|
|
6
|
+
//#endregion
|
|
7
|
+
exports.CopyButton = CopyButton;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CopyButton as CopyButton$1 } from "../../../components/CopyButton/CopyButton.js";
|
|
2
|
+
import { CopyButtonContainer } from "./CopyButton.style.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/Inputs/TextArea/components/CopyButton/CopyButton.tsx
|
|
5
|
+
var CopyButton = ({ showCopyButton = true, ...restProps }) => showCopyButton ? /* @__PURE__ */ jsx(CopyButtonContainer, { children: /* @__PURE__ */ jsx(CopyButton$1, { ...restProps }) }) : null;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { CopyButton };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const require_runtime = require("../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_Compose_style = require("../Compose/Compose.style.cjs");
|
|
3
|
+
let styled_components = require("styled-components");
|
|
4
|
+
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
5
|
+
let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
|
|
6
|
+
//#region src/Inputs/TextArea/components/CopyButton/CopyButton.style.ts
|
|
7
|
+
var CopyButtonContainer = styled_components.default.span.withConfig({
|
|
8
|
+
displayName: "CopyButtonstyle__CopyButtonContainer",
|
|
9
|
+
componentId: "RedisUI__sc-uj32r0-0"
|
|
10
|
+
})([
|
|
11
|
+
"position:absolute;display:flex;inset:",
|
|
12
|
+
";",
|
|
13
|
+
":is([data-status='error'],[data-status='success']) &{inset:",
|
|
14
|
+
";}"
|
|
15
|
+
], () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.input.textarea.copyButton.inset, require_Compose_style.TextAreaCompose, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.input.textarea.copyButton.statusInset);
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.CopyButtonContainer = CopyButtonContainer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CopyButtonContainer: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TextAreaCompose } from "../Compose/Compose.style.js";
|
|
2
|
+
import _styled from "styled-components";
|
|
3
|
+
import { useTheme } from "@redis-ui/styles";
|
|
4
|
+
//#region src/Inputs/TextArea/components/CopyButton/CopyButton.style.ts
|
|
5
|
+
var CopyButtonContainer = _styled.span.withConfig({
|
|
6
|
+
displayName: "CopyButtonstyle__CopyButtonContainer",
|
|
7
|
+
componentId: "RedisUI__sc-uj32r0-0"
|
|
8
|
+
})([
|
|
9
|
+
"position:absolute;display:flex;inset:",
|
|
10
|
+
";",
|
|
11
|
+
":is([data-status='error'],[data-status='success']) &{inset:",
|
|
12
|
+
";}"
|
|
13
|
+
], () => useTheme().components.input.textarea.copyButton.inset, TextAreaCompose, () => useTheme().components.input.textarea.copyButton.statusInset);
|
|
14
|
+
//#endregion
|
|
15
|
+
export { CopyButtonContainer };
|
|
@@ -9,6 +9,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
9
9
|
//#region src/Inputs/TextArea/components/TextAreaTag/TextAreaTag.tsx
|
|
10
10
|
var TextAreaTag = (0, require("react").forwardRef)(({ id, autoComplete = "off", disabled, "aria-describedby": ariaDescribedby, ...restProps }, ref) => {
|
|
11
11
|
const fieldDisabled = require_Field_context.useFieldDisabled(disabled);
|
|
12
|
+
const fieldReadonly = require_FormField_context.useFieldReadonly();
|
|
12
13
|
const sharedId = require_SharedId_context.useSharedId(id);
|
|
13
14
|
const inputValueProps = require_InputValue_context.useInputValueProps(restProps, ref);
|
|
14
15
|
const status = require_FormField_context.useFieldStatus();
|
|
@@ -32,7 +33,8 @@ var TextAreaTag = (0, require("react").forwardRef)(({ id, autoComplete = "off",
|
|
|
32
33
|
}) : null;
|
|
33
34
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TextAreaTag_style.TextAreaTag, {
|
|
34
35
|
id: sharedId,
|
|
35
|
-
disabled: fieldDisabled,
|
|
36
|
+
disabled: !fieldReadonly && fieldDisabled,
|
|
37
|
+
readOnly: fieldReadonly,
|
|
36
38
|
autoComplete,
|
|
37
39
|
...requiredProps,
|
|
38
40
|
...restProps,
|
|
@@ -3,13 +3,14 @@ import { VisuallyHidden } from "../../../../packages/components/node_modules/@ra
|
|
|
3
3
|
import { useSharedId } from "../../../../Helpers/contexts/SharedId.context.js";
|
|
4
4
|
import { useErrorContent, useFieldDisabled } from "../../../components/Context/Field.context.js";
|
|
5
5
|
import { useInputValueProps } from "../../../components/Context/InputValue.context.js";
|
|
6
|
-
import { useFieldAdditionTextId, useFieldRequired, useFieldStatus } from "../../../../FormField/FormField.context.js";
|
|
6
|
+
import { useFieldAdditionTextId, useFieldReadonly, useFieldRequired, useFieldStatus } from "../../../../FormField/FormField.context.js";
|
|
7
7
|
import { TextAreaTag as TextAreaTag$1 } from "./TextAreaTag.style.js";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { forwardRef } from "react";
|
|
10
10
|
//#region src/Inputs/TextArea/components/TextAreaTag/TextAreaTag.tsx
|
|
11
11
|
var TextAreaTag = forwardRef(({ id, autoComplete = "off", disabled, "aria-describedby": ariaDescribedby, ...restProps }, ref) => {
|
|
12
12
|
const fieldDisabled = useFieldDisabled(disabled);
|
|
13
|
+
const fieldReadonly = useFieldReadonly();
|
|
13
14
|
const sharedId = useSharedId(id);
|
|
14
15
|
const inputValueProps = useInputValueProps(restProps, ref);
|
|
15
16
|
const status = useFieldStatus();
|
|
@@ -33,7 +34,8 @@ var TextAreaTag = forwardRef(({ id, autoComplete = "off", disabled, "aria-descri
|
|
|
33
34
|
}) : null;
|
|
34
35
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(TextAreaTag$1, {
|
|
35
36
|
id: sharedId,
|
|
36
|
-
disabled: fieldDisabled,
|
|
37
|
+
disabled: !fieldReadonly && fieldDisabled,
|
|
38
|
+
readOnly: fieldReadonly,
|
|
37
39
|
autoComplete,
|
|
38
40
|
...requiredProps,
|
|
39
41
|
...restProps,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const require_runtime = require("../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
const require_InputTag_style = require("../../../components/InputTag/InputTag.style.cjs");
|
|
3
3
|
const require_Compose_style = require("../Compose/Compose.style.cjs");
|
|
4
|
+
const require_CopyButton_style = require("../CopyButton/CopyButton.style.cjs");
|
|
4
5
|
let styled_components = require("styled-components");
|
|
5
6
|
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
6
7
|
let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
|
|
@@ -13,7 +14,13 @@ var TextAreaTag = styled_components.default.textarea.withConfig({
|
|
|
13
14
|
";height:100%;box-sizing:border-box;background-color:transparent;resize:none;cursor:auto;padding:",
|
|
14
15
|
";",
|
|
15
16
|
":is([data-status='error'],[data-status='success']) &{padding:",
|
|
17
|
+
";}",
|
|
18
|
+
":has(",
|
|
19
|
+
") &{padding:",
|
|
20
|
+
";}",
|
|
21
|
+
":is([data-status='error'],[data-status='success']):has(",
|
|
22
|
+
") &{padding:",
|
|
16
23
|
";}"
|
|
17
|
-
], require_InputTag_style.InputStyle, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.input.textarea.padding, require_Compose_style.TextAreaCompose, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.input.textarea.statusPadding);
|
|
24
|
+
], require_InputTag_style.InputStyle, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.input.textarea.padding, require_Compose_style.TextAreaCompose, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.input.textarea.statusPadding, require_Compose_style.TextAreaCompose, require_CopyButton_style.CopyButtonContainer, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.input.textarea.copyButton.padding, require_Compose_style.TextAreaCompose, require_CopyButton_style.CopyButtonContainer, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.input.textarea.copyButton.statusPadding);
|
|
18
25
|
//#endregion
|
|
19
26
|
exports.TextAreaTag = TextAreaTag;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InputStyle } from "../../../components/InputTag/InputTag.style.js";
|
|
2
2
|
import { TextAreaCompose } from "../Compose/Compose.style.js";
|
|
3
|
+
import { CopyButtonContainer } from "../CopyButton/CopyButton.style.js";
|
|
3
4
|
import _styled from "styled-components";
|
|
4
5
|
import { useTheme } from "@redis-ui/styles";
|
|
5
6
|
//#region src/Inputs/TextArea/components/TextAreaTag/TextAreaTag.style.ts
|
|
@@ -11,7 +12,13 @@ var TextAreaTag = _styled.textarea.withConfig({
|
|
|
11
12
|
";height:100%;box-sizing:border-box;background-color:transparent;resize:none;cursor:auto;padding:",
|
|
12
13
|
";",
|
|
13
14
|
":is([data-status='error'],[data-status='success']) &{padding:",
|
|
15
|
+
";}",
|
|
16
|
+
":has(",
|
|
17
|
+
") &{padding:",
|
|
18
|
+
";}",
|
|
19
|
+
":is([data-status='error'],[data-status='success']):has(",
|
|
20
|
+
") &{padding:",
|
|
14
21
|
";}"
|
|
15
|
-
], InputStyle, () => useTheme().components.input.textarea.padding, TextAreaCompose, () => useTheme().components.input.textarea.statusPadding);
|
|
22
|
+
], InputStyle, () => useTheme().components.input.textarea.padding, TextAreaCompose, () => useTheme().components.input.textarea.statusPadding, TextAreaCompose, CopyButtonContainer, () => useTheme().components.input.textarea.copyButton.padding, TextAreaCompose, CopyButtonContainer, () => useTheme().components.input.textarea.copyButton.statusPadding);
|
|
16
23
|
//#endregion
|
|
17
24
|
export { TextAreaTag };
|
|
@@ -11,30 +11,35 @@ var DefaultReadonlyRender = ({ value, ...restProps }) => /* @__PURE__ */ (0, rea
|
|
|
11
11
|
...restProps,
|
|
12
12
|
children: value
|
|
13
13
|
});
|
|
14
|
-
var CommonInputCompose = ({ id, readOnly, readonlyRender = DefaultReadonlyRender, readonlyProps, variant = "outline", error, valid, children, onPointerUp, ...restProps }) => {
|
|
14
|
+
var CommonInputCompose = ({ id, readOnly, readonlyRender = DefaultReadonlyRender, readonlyProps, boxedReadonly = false, variant = "outline", error, valid, children, onPointerUp, ...restProps }) => {
|
|
15
|
+
const fieldReadonly = require_FormField_context.useFieldReadonly(readOnly);
|
|
15
16
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SharedId_context.SharedIdTransProvider, {
|
|
16
17
|
customId: id,
|
|
17
|
-
children:
|
|
18
|
+
children: fieldReadonly && !boxedReadonly ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ReadonlyRenderWrapper.ReadonlyRenderWrapper, {
|
|
18
19
|
...readonlyProps,
|
|
19
20
|
...restProps,
|
|
20
21
|
render: readonlyRender,
|
|
21
22
|
"$data-children": children
|
|
22
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
23
|
-
value:
|
|
24
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
25
|
-
value: error
|
|
26
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormField_context.FieldReadonlyTransProvider, {
|
|
24
|
+
value: fieldReadonly,
|
|
25
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Field_context.FieldDisabledTransProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormField_context.FieldStatusTransProvider, {
|
|
26
|
+
value: error && "error" || valid && "success" || "none",
|
|
27
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormField_context.FieldRequiredTransProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormField_context.FieldAdditionTextIdTransProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Field_context.ErrorContentProvider, {
|
|
28
|
+
value: error ?? "",
|
|
29
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Compose_style.CommonInputCompose, {
|
|
30
|
+
$variant: variant,
|
|
31
|
+
...restProps,
|
|
32
|
+
"data-editable": "",
|
|
33
|
+
"data-readonly": fieldReadonly ? "" : void 0,
|
|
34
|
+
onPointerUp: require_react_utils.combineHandlers((e) => {
|
|
35
|
+
const target = e.target;
|
|
36
|
+
if (target.tagName !== "INPUT" && target.tagName !== "TEXTAREA") (e.currentTarget.querySelector(`input${require_InputTag_style.InputTag}`) ?? e.currentTarget.querySelector("textarea"))?.focus();
|
|
37
|
+
}, onPointerUp),
|
|
38
|
+
children
|
|
39
|
+
})
|
|
40
|
+
}) }) })
|
|
41
|
+
}) })
|
|
42
|
+
})
|
|
38
43
|
});
|
|
39
44
|
};
|
|
40
45
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReadonlyRenderProps } from '../ReadonlyRender/ReadonlyRender.types';
|
|
2
2
|
import { CommonInputComposeProps, RestCommonInputComposeProps } from './CommonCompose.types';
|
|
3
3
|
export declare const DefaultReadonlyRender: ({ value, ...restProps }: ReadonlyRenderProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare const CommonInputCompose: ({ id, readOnly, readonlyRender, readonlyProps, variant, error, valid, children, onPointerUp, ...restProps }: CommonInputComposeProps & RestCommonInputComposeProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const CommonInputCompose: ({ id, readOnly, readonlyRender, readonlyProps, boxedReadonly, variant, error, valid, children, onPointerUp, ...restProps }: CommonInputComposeProps & RestCommonInputComposeProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default CommonInputCompose;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { combineHandlers } from "../../../Helpers/react.utils.js";
|
|
2
2
|
import { SharedIdTransProvider } from "../../../Helpers/contexts/SharedId.context.js";
|
|
3
3
|
import { ErrorContentProvider, FieldDisabledTransProvider } from "../Context/Field.context.js";
|
|
4
|
-
import { FieldAdditionTextIdTransProvider, FieldRequiredTransProvider, FieldStatusTransProvider, useFieldReadonly } from "../../../FormField/FormField.context.js";
|
|
4
|
+
import { FieldAdditionTextIdTransProvider, FieldReadonlyTransProvider, FieldRequiredTransProvider, FieldStatusTransProvider, useFieldReadonly } from "../../../FormField/FormField.context.js";
|
|
5
5
|
import { InputTag } from "../InputTag/InputTag.style.js";
|
|
6
6
|
import { CommonInputCompose as CommonInputCompose$1, ReadonlyValue } from "./Compose.style.js";
|
|
7
7
|
import { ReadonlyRenderWrapper } from "../ReadonlyRender/ReadonlyRenderWrapper.js";
|
|
@@ -11,30 +11,35 @@ var DefaultReadonlyRender = ({ value, ...restProps }) => /* @__PURE__ */ jsx(Rea
|
|
|
11
11
|
...restProps,
|
|
12
12
|
children: value
|
|
13
13
|
});
|
|
14
|
-
var CommonInputCompose = ({ id, readOnly, readonlyRender = DefaultReadonlyRender, readonlyProps, variant = "outline", error, valid, children, onPointerUp, ...restProps }) => {
|
|
14
|
+
var CommonInputCompose = ({ id, readOnly, readonlyRender = DefaultReadonlyRender, readonlyProps, boxedReadonly = false, variant = "outline", error, valid, children, onPointerUp, ...restProps }) => {
|
|
15
|
+
const fieldReadonly = useFieldReadonly(readOnly);
|
|
15
16
|
return /* @__PURE__ */ jsx(SharedIdTransProvider, {
|
|
16
17
|
customId: id,
|
|
17
|
-
children:
|
|
18
|
+
children: fieldReadonly && !boxedReadonly ? /* @__PURE__ */ jsx(ReadonlyRenderWrapper, {
|
|
18
19
|
...readonlyProps,
|
|
19
20
|
...restProps,
|
|
20
21
|
render: readonlyRender,
|
|
21
22
|
"$data-children": children
|
|
22
|
-
}) : /* @__PURE__ */ jsx(
|
|
23
|
-
value:
|
|
24
|
-
children: /* @__PURE__ */ jsx(
|
|
25
|
-
value: error
|
|
26
|
-
children: /* @__PURE__ */ jsx(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
}) : /* @__PURE__ */ jsx(FieldReadonlyTransProvider, {
|
|
24
|
+
value: fieldReadonly,
|
|
25
|
+
children: /* @__PURE__ */ jsx(FieldDisabledTransProvider, { children: /* @__PURE__ */ jsx(FieldStatusTransProvider, {
|
|
26
|
+
value: error && "error" || valid && "success" || "none",
|
|
27
|
+
children: /* @__PURE__ */ jsx(FieldRequiredTransProvider, { children: /* @__PURE__ */ jsx(FieldAdditionTextIdTransProvider, { children: /* @__PURE__ */ jsx(ErrorContentProvider, {
|
|
28
|
+
value: error ?? "",
|
|
29
|
+
children: /* @__PURE__ */ jsx(CommonInputCompose$1, {
|
|
30
|
+
$variant: variant,
|
|
31
|
+
...restProps,
|
|
32
|
+
"data-editable": "",
|
|
33
|
+
"data-readonly": fieldReadonly ? "" : void 0,
|
|
34
|
+
onPointerUp: combineHandlers((e) => {
|
|
35
|
+
const target = e.target;
|
|
36
|
+
if (target.tagName !== "INPUT" && target.tagName !== "TEXTAREA") (e.currentTarget.querySelector(`input${InputTag}`) ?? e.currentTarget.querySelector("textarea"))?.focus();
|
|
37
|
+
}, onPointerUp),
|
|
38
|
+
children
|
|
39
|
+
})
|
|
40
|
+
}) }) })
|
|
41
|
+
}) })
|
|
42
|
+
})
|
|
38
43
|
});
|
|
39
44
|
};
|
|
40
45
|
//#endregion
|
|
@@ -11,5 +11,7 @@ export type CommonInputComposeProps = {
|
|
|
11
11
|
};
|
|
12
12
|
export type RestCommonInputComposeProps = Omit<ComposeElementProps, 'defaultValue' | 'onChange'> & {
|
|
13
13
|
readonlyRender?: ReadOnlyRenderComponent;
|
|
14
|
+
/** Keeps the field box when read-only, with a non-editable but selectable value, instead of `readonlyRender`. */
|
|
15
|
+
boxedReadonly?: boolean;
|
|
14
16
|
readonlyProps?: HTMLAttributes<HTMLElement>;
|
|
15
17
|
};
|
|
@@ -59,6 +59,13 @@ var getStateStyle = (theme) => {
|
|
|
59
59
|
})};
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
&[data-readonly] {
|
|
63
|
+
${require_css_utils.styleFromTokens({
|
|
64
|
+
tokenMaps: [bgColor, textColor],
|
|
65
|
+
tokens: statesStyle.boxedReadonly
|
|
66
|
+
})};
|
|
67
|
+
}
|
|
68
|
+
|
|
62
69
|
&:has(:is(input, textarea):disabled) {
|
|
63
70
|
${require_css_utils.styleFromTokens({
|
|
64
71
|
tokenMaps: maps,
|
|
@@ -57,6 +57,13 @@ var getStateStyle = (theme) => {
|
|
|
57
57
|
})};
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
&[data-readonly] {
|
|
61
|
+
${styleFromTokens({
|
|
62
|
+
tokenMaps: [bgColor, textColor],
|
|
63
|
+
tokens: statesStyle.boxedReadonly
|
|
64
|
+
})};
|
|
65
|
+
}
|
|
66
|
+
|
|
60
67
|
&:has(:is(input, textarea):disabled) {
|
|
61
68
|
${styleFromTokens({
|
|
62
69
|
tokenMaps: maps,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CommonInputComposeProps, RestCommonInputComposeProps } from './CommonCompose.types';
|
|
2
2
|
import { NumericInputValueProviderProps } from '../Context/NumericInputValueProvider';
|
|
3
3
|
export type NumericInputComposeProps = CommonInputComposeProps & Omit<NumericInputValueProviderProps, 'children'>;
|
|
4
|
-
export type RestNumericInputComposeProps = RestCommonInputComposeProps
|
|
4
|
+
export type RestNumericInputComposeProps = Omit<RestCommonInputComposeProps, 'boxedReadonly'>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const require_react_utils = require("../../../Helpers/react.utils.cjs");
|
|
2
|
+
const require_InputValue_context = require("../Context/InputValue.context.cjs");
|
|
3
|
+
const require_CopyButton_style = require("./CopyButton.style.cjs");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
//#region src/Inputs/components/CopyButton/CopyButton.tsx
|
|
6
|
+
var CopyButton = ({ showCopyButton = true, textToCopy, onMouseDown, ...restProps }) => {
|
|
7
|
+
const { value } = require_InputValue_context.useInputValueApi();
|
|
8
|
+
return showCopyButton ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CopyButton_style.CopyButton, {
|
|
9
|
+
textToCopy: textToCopy ?? value ?? "",
|
|
10
|
+
...restProps,
|
|
11
|
+
onMouseDown: require_react_utils.combineHandlers((e) => e.preventDefault(), onMouseDown)
|
|
12
|
+
}) : null;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.CopyButton = CopyButton;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { combineHandlers } from "../../../Helpers/react.utils.js";
|
|
2
|
+
import { useInputValueApi } from "../Context/InputValue.context.js";
|
|
3
|
+
import { CopyButton as CopyButton$1 } from "./CopyButton.style.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/Inputs/components/CopyButton/CopyButton.tsx
|
|
6
|
+
var CopyButton = ({ showCopyButton = true, textToCopy, onMouseDown, ...restProps }) => {
|
|
7
|
+
const { value } = useInputValueApi();
|
|
8
|
+
return showCopyButton ? /* @__PURE__ */ jsx(CopyButton$1, {
|
|
9
|
+
textToCopy: textToCopy ?? value ?? "",
|
|
10
|
+
...restProps,
|
|
11
|
+
onMouseDown: combineHandlers((e) => e.preventDefault(), onMouseDown)
|
|
12
|
+
}) : null;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { CopyButton };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_CopyToClipboardButton = require("../../../Button/CopyToClipboardButton/CopyToClipboardButton.cjs");
|
|
3
|
+
let styled_components = require("styled-components");
|
|
4
|
+
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
5
|
+
let _redislabsdev_redis_ui_styles = require("@redis-ui/styles");
|
|
6
|
+
//#region src/Inputs/components/CopyButton/CopyButton.style.ts
|
|
7
|
+
var CopyButton = (0, styled_components.default)(require_CopyToClipboardButton.default).withConfig({
|
|
8
|
+
displayName: "CopyButtonstyle__CopyButton",
|
|
9
|
+
componentId: "RedisUI__sc-eedjzk-0"
|
|
10
|
+
})([
|
|
11
|
+
"flex:none;&&:is(:hover,:active):not(:disabled){background-color:transparent;}&&:is(:hover,:active):not(:disabled,[data-copied]){color:",
|
|
12
|
+
";}& svg{width:",
|
|
13
|
+
";height:",
|
|
14
|
+
";}"
|
|
15
|
+
], () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.input.copyButton.hoverIconColor, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.input.copyButton.iconSize, () => (0, _redislabsdev_redis_ui_styles.useTheme)().components.input.copyButton.iconSize);
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.CopyButton = CopyButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CopyButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../..").CopyToClipboardButtonProps & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import CopyToClipboardButton from "../../../Button/CopyToClipboardButton/CopyToClipboardButton.js";
|
|
2
|
+
import _styled from "styled-components";
|
|
3
|
+
import { useTheme } from "@redis-ui/styles";
|
|
4
|
+
//#region src/Inputs/components/CopyButton/CopyButton.style.ts
|
|
5
|
+
var CopyButton = _styled(CopyToClipboardButton).withConfig({
|
|
6
|
+
displayName: "CopyButtonstyle__CopyButton",
|
|
7
|
+
componentId: "RedisUI__sc-eedjzk-0"
|
|
8
|
+
})([
|
|
9
|
+
"flex:none;&&:is(:hover,:active):not(:disabled){background-color:transparent;}&&:is(:hover,:active):not(:disabled,[data-copied]){color:",
|
|
10
|
+
";}& svg{width:",
|
|
11
|
+
";height:",
|
|
12
|
+
";}"
|
|
13
|
+
], () => useTheme().components.input.copyButton.hoverIconColor, () => useTheme().components.input.copyButton.iconSize, () => useTheme().components.input.copyButton.iconSize);
|
|
14
|
+
//#endregion
|
|
15
|
+
export { CopyButton };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CopyToClipboardButtonProps } from '../../../Button/CopyToClipboardButton/CopyToClipboardButton.types';
|
|
2
|
+
export type CopyButtonProps = {
|
|
3
|
+
/** Renders a copy button inside the field that copies the current value. */
|
|
4
|
+
showCopyButton?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type RestCopyButtonProps = Partial<Omit<CopyToClipboardButtonProps, 'variant'>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,6 +9,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
9
9
|
//#region src/Inputs/components/InputTag/InputTag.tsx
|
|
10
10
|
var InputTag = (0, require("react").forwardRef)(({ autoSize, id, type = "text", autoComplete = "off", disabled, "aria-describedby": ariaDescribedby, ...restProps }, ref) => {
|
|
11
11
|
const fieldDisabled = require_Field_context.useFieldDisabled(disabled);
|
|
12
|
+
const fieldReadonly = require_FormField_context.useFieldReadonly();
|
|
12
13
|
const sharedId = require_SharedId_context.useSharedId(id);
|
|
13
14
|
const inputValueProps = require_InputValue_context.useInputValueProps(restProps, ref);
|
|
14
15
|
const status = require_FormField_context.useFieldStatus();
|
|
@@ -27,7 +28,8 @@ var InputTag = (0, require("react").forwardRef)(({ autoSize, id, type = "text",
|
|
|
27
28
|
const inputProps = {
|
|
28
29
|
id: sharedId,
|
|
29
30
|
type,
|
|
30
|
-
disabled: fieldDisabled,
|
|
31
|
+
disabled: !fieldReadonly && fieldDisabled,
|
|
32
|
+
readOnly: fieldReadonly,
|
|
31
33
|
autoComplete,
|
|
32
34
|
...required ? { "aria-required": true } : null,
|
|
33
35
|
...restProps,
|
|
@@ -3,13 +3,14 @@ import { VisuallyHidden } from "../../../packages/components/node_modules/@radix
|
|
|
3
3
|
import { useSharedId } from "../../../Helpers/contexts/SharedId.context.js";
|
|
4
4
|
import { useErrorContent, useFieldDisabled } from "../Context/Field.context.js";
|
|
5
5
|
import { useInputValueProps } from "../Context/InputValue.context.js";
|
|
6
|
-
import { useFieldAdditionTextId, useFieldRequired, useFieldStatus } from "../../../FormField/FormField.context.js";
|
|
6
|
+
import { useFieldAdditionTextId, useFieldReadonly, useFieldRequired, useFieldStatus } from "../../../FormField/FormField.context.js";
|
|
7
7
|
import { AutoSizeInputTag, InputTag as InputTag$1 } from "./InputTag.style.js";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { forwardRef } from "react";
|
|
10
10
|
//#region src/Inputs/components/InputTag/InputTag.tsx
|
|
11
11
|
var InputTag = forwardRef(({ autoSize, id, type = "text", autoComplete = "off", disabled, "aria-describedby": ariaDescribedby, ...restProps }, ref) => {
|
|
12
12
|
const fieldDisabled = useFieldDisabled(disabled);
|
|
13
|
+
const fieldReadonly = useFieldReadonly();
|
|
13
14
|
const sharedId = useSharedId(id);
|
|
14
15
|
const inputValueProps = useInputValueProps(restProps, ref);
|
|
15
16
|
const status = useFieldStatus();
|
|
@@ -28,7 +29,8 @@ var InputTag = forwardRef(({ autoSize, id, type = "text", autoComplete = "off",
|
|
|
28
29
|
const inputProps = {
|
|
29
30
|
id: sharedId,
|
|
30
31
|
type,
|
|
31
|
-
disabled: fieldDisabled,
|
|
32
|
+
disabled: !fieldReadonly && fieldDisabled,
|
|
33
|
+
readOnly: fieldReadonly,
|
|
32
34
|
autoComplete,
|
|
33
35
|
...required ? { "aria-required": true } : null,
|
|
34
36
|
...restProps,
|
|
@@ -55,7 +55,7 @@ var InputTag = styled_components.default.input.withConfig({
|
|
|
55
55
|
componentId: "RedisUI__sc-15tql6o-0"
|
|
56
56
|
})([
|
|
57
57
|
"",
|
|
58
|
-
";align-self:stretch;padding:0
|
|
58
|
+
";align-self:stretch;padding:0;&[readonly]{text-overflow:ellipsis;}&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}&[type='number']{-moz-appearance:textfield;}&[type='password']:not(:placeholder-shown){font-family:",
|
|
59
59
|
";font-size:",
|
|
60
60
|
";@supports not (-moz-appearance:none){font-size-adjust:",
|
|
61
61
|
";}}"
|
|
@@ -53,7 +53,7 @@ var InputTag = _styled.input.withConfig({
|
|
|
53
53
|
componentId: "RedisUI__sc-15tql6o-0"
|
|
54
54
|
})([
|
|
55
55
|
"",
|
|
56
|
-
";align-self:stretch;padding:0
|
|
56
|
+
";align-self:stretch;padding:0;&[readonly]{text-overflow:ellipsis;}&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}&[type='number']{-moz-appearance:textfield;}&[type='password']:not(:placeholder-shown){font-family:",
|
|
57
57
|
";font-size:",
|
|
58
58
|
";@supports not (-moz-appearance:none){font-size-adjust:",
|
|
59
59
|
";}}"
|
package/dist/index.cjs
CHANGED
|
@@ -288,6 +288,7 @@ Object.defineProperty(exports, "cardVariants", {
|
|
|
288
288
|
}
|
|
289
289
|
});
|
|
290
290
|
exports.childrenToString = require_react_utils.childrenToString;
|
|
291
|
+
exports.codeBlockLanguages = require_CodeBlock_types.codeBlockLanguages;
|
|
291
292
|
exports.codeBlockOverflows = require_CodeBlock_types.codeBlockOverflows;
|
|
292
293
|
exports.codeBlockSizes = require_CodeBlock_types.codeBlockSizes;
|
|
293
294
|
exports.combineHandlers = require_react_utils.combineHandlers;
|