@dxos/react-input 0.1.52 → 0.1.53-main.00be1a9
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.
|
@@ -7,20 +7,6 @@ import React2, { forwardRef } from "react";
|
|
|
7
7
|
import { createContextScope } from "@radix-ui/react-context";
|
|
8
8
|
import React from "react";
|
|
9
9
|
import { useId } from "@dxos/react-hooks";
|
|
10
|
-
function _extends() {
|
|
11
|
-
_extends = Object.assign || function(target) {
|
|
12
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
13
|
-
var source = arguments[i];
|
|
14
|
-
for (var key in source) {
|
|
15
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
16
|
-
target[key] = source[key];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return target;
|
|
21
|
-
};
|
|
22
|
-
return _extends.apply(this, arguments);
|
|
23
|
-
}
|
|
24
10
|
var INPUT_NAME = "Input";
|
|
25
11
|
var [createInputContext, createInputScope] = createContextScope(INPUT_NAME, []);
|
|
26
12
|
var [InputProvider, useInputContext] = createInputContext(INPUT_NAME);
|
|
@@ -28,99 +14,78 @@ var InputRoot = ({ __inputScope, id: propsId, descriptionId: propsDescriptionId,
|
|
|
28
14
|
const id = useId("input", propsId);
|
|
29
15
|
const descriptionId = useId("input__description", propsDescriptionId);
|
|
30
16
|
const errorMessageId = useId("input__error-message", propsErrorMessageId);
|
|
31
|
-
return /* @__PURE__ */ React.createElement(InputProvider,
|
|
17
|
+
return /* @__PURE__ */ React.createElement(InputProvider, {
|
|
32
18
|
id,
|
|
33
19
|
descriptionId,
|
|
34
20
|
errorMessageId,
|
|
35
|
-
validationValence
|
|
36
|
-
}, {
|
|
21
|
+
validationValence,
|
|
37
22
|
scope: __inputScope
|
|
38
|
-
}
|
|
23
|
+
}, children);
|
|
39
24
|
};
|
|
40
25
|
InputRoot.displayName = INPUT_NAME;
|
|
41
26
|
|
|
42
27
|
// packages/ui/primitives/react-input/src/InputMeta.tsx
|
|
43
|
-
function _extends2() {
|
|
44
|
-
_extends2 = Object.assign || function(target) {
|
|
45
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
46
|
-
var source = arguments[i];
|
|
47
|
-
for (var key in source) {
|
|
48
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
49
|
-
target[key] = source[key];
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return target;
|
|
54
|
-
};
|
|
55
|
-
return _extends2.apply(this, arguments);
|
|
56
|
-
}
|
|
57
28
|
var Label = /* @__PURE__ */ forwardRef(({ __inputScope, asChild, children, ...props }, forwardedRef) => {
|
|
58
29
|
const { id } = useInputContext(INPUT_NAME, __inputScope);
|
|
59
30
|
const Root = asChild ? Slot : Primitive.label;
|
|
60
|
-
return /* @__PURE__ */ React2.createElement(Root,
|
|
31
|
+
return /* @__PURE__ */ React2.createElement(Root, {
|
|
32
|
+
...props,
|
|
61
33
|
htmlFor: id,
|
|
62
34
|
ref: forwardedRef
|
|
63
|
-
}
|
|
35
|
+
}, children);
|
|
64
36
|
});
|
|
65
37
|
var Description = /* @__PURE__ */ forwardRef(({ __inputScope, asChild, children, ...props }, forwardedRef) => {
|
|
66
38
|
const { descriptionId, validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
67
39
|
const Root = asChild ? Slot : Primitive.span;
|
|
68
|
-
return /* @__PURE__ */ React2.createElement(Root,
|
|
69
|
-
|
|
70
|
-
|
|
40
|
+
return /* @__PURE__ */ React2.createElement(Root, {
|
|
41
|
+
...props,
|
|
42
|
+
...validationValence === "error" && {
|
|
43
|
+
id: descriptionId
|
|
44
|
+
},
|
|
71
45
|
ref: forwardedRef
|
|
72
|
-
}
|
|
46
|
+
}, children);
|
|
73
47
|
});
|
|
74
48
|
var ErrorMessage = /* @__PURE__ */ forwardRef(({ __inputScope, asChild, children, ...props }, forwardedRef) => {
|
|
75
49
|
const { errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
76
50
|
const Root = asChild ? Slot : Primitive.span;
|
|
77
|
-
return /* @__PURE__ */ React2.createElement(Root,
|
|
51
|
+
return /* @__PURE__ */ React2.createElement(Root, {
|
|
52
|
+
...props,
|
|
78
53
|
id: errorMessageId,
|
|
79
54
|
ref: forwardedRef
|
|
80
|
-
}
|
|
55
|
+
}, children);
|
|
81
56
|
});
|
|
82
57
|
var Validation = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
83
58
|
const { __inputScope, asChild, children, ...otherProps } = props;
|
|
84
59
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
85
60
|
if (validationValence === "error") {
|
|
86
|
-
return /* @__PURE__ */ React2.createElement(ErrorMessage,
|
|
61
|
+
return /* @__PURE__ */ React2.createElement(ErrorMessage, {
|
|
62
|
+
...props,
|
|
87
63
|
ref: forwardedRef
|
|
88
|
-
})
|
|
64
|
+
});
|
|
89
65
|
} else {
|
|
90
66
|
const Root = asChild ? Slot : Primitive.span;
|
|
91
|
-
return /* @__PURE__ */ React2.createElement(Root,
|
|
67
|
+
return /* @__PURE__ */ React2.createElement(Root, {
|
|
68
|
+
...otherProps,
|
|
92
69
|
ref: forwardedRef
|
|
93
|
-
}
|
|
70
|
+
}, children);
|
|
94
71
|
}
|
|
95
72
|
});
|
|
96
73
|
var DescriptionAndValidation = /* @__PURE__ */ forwardRef(({ __inputScope, asChild, children, ...props }, forwardedRef) => {
|
|
97
74
|
const { descriptionId, validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
98
75
|
const Root = asChild ? Slot : Primitive.p;
|
|
99
|
-
return /* @__PURE__ */ React2.createElement(Root,
|
|
100
|
-
|
|
101
|
-
|
|
76
|
+
return /* @__PURE__ */ React2.createElement(Root, {
|
|
77
|
+
...props,
|
|
78
|
+
...validationValence !== "error" && {
|
|
79
|
+
id: descriptionId
|
|
80
|
+
},
|
|
102
81
|
ref: forwardedRef
|
|
103
|
-
}
|
|
82
|
+
}, children);
|
|
104
83
|
});
|
|
105
84
|
|
|
106
85
|
// packages/ui/primitives/react-input/src/PinInput.tsx
|
|
107
86
|
import { CodeInput, getSegmentCssWidth } from "rci";
|
|
108
87
|
import React3, { forwardRef as forwardRef2, useCallback } from "react";
|
|
109
88
|
import { useForwardedRef, useIsFocused } from "@dxos/react-hooks";
|
|
110
|
-
function _extends3() {
|
|
111
|
-
_extends3 = Object.assign || function(target) {
|
|
112
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
113
|
-
var source = arguments[i];
|
|
114
|
-
for (var key in source) {
|
|
115
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
116
|
-
target[key] = source[key];
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return target;
|
|
121
|
-
};
|
|
122
|
-
return _extends3.apply(this, arguments);
|
|
123
|
-
}
|
|
124
89
|
var PinInput = /* @__PURE__ */ forwardRef2(({ __inputScope, segmentClassName, inputClassName, segmentPadding = "13px", segmentHeight = "100%", ...props }, forwardedRef) => {
|
|
125
90
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
126
91
|
const width = getSegmentCssWidth(segmentPadding);
|
|
@@ -142,7 +107,7 @@ var PinInput = /* @__PURE__ */ forwardRef2(({ __inputScope, segmentClassName, in
|
|
|
142
107
|
inputFocused,
|
|
143
108
|
validationValence
|
|
144
109
|
]);
|
|
145
|
-
return /* @__PURE__ */ React3.createElement(CodeInput,
|
|
110
|
+
return /* @__PURE__ */ React3.createElement(CodeInput, {
|
|
146
111
|
padding: "8px",
|
|
147
112
|
spacing: "8px",
|
|
148
113
|
fontFamily: "",
|
|
@@ -158,29 +123,15 @@ var PinInput = /* @__PURE__ */ forwardRef2(({ __inputScope, segmentClassName, in
|
|
|
158
123
|
inputRef,
|
|
159
124
|
renderSegment,
|
|
160
125
|
className: inputClassName
|
|
161
|
-
})
|
|
126
|
+
});
|
|
162
127
|
});
|
|
163
128
|
|
|
164
129
|
// packages/ui/primitives/react-input/src/TextInput.tsx
|
|
165
130
|
import { Primitive as Primitive2 } from "@radix-ui/react-primitive";
|
|
166
131
|
import React4, { forwardRef as forwardRef3 } from "react";
|
|
167
|
-
function _extends4() {
|
|
168
|
-
_extends4 = Object.assign || function(target) {
|
|
169
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
170
|
-
var source = arguments[i];
|
|
171
|
-
for (var key in source) {
|
|
172
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
173
|
-
target[key] = source[key];
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return target;
|
|
178
|
-
};
|
|
179
|
-
return _extends4.apply(this, arguments);
|
|
180
|
-
}
|
|
181
132
|
var TextInput = /* @__PURE__ */ forwardRef3(({ __inputScope, ...props }, forwardedRef) => {
|
|
182
133
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
183
|
-
return /* @__PURE__ */ React4.createElement(Primitive2.input,
|
|
134
|
+
return /* @__PURE__ */ React4.createElement(Primitive2.input, {
|
|
184
135
|
...props,
|
|
185
136
|
id,
|
|
186
137
|
"aria-describedby": descriptionId,
|
|
@@ -189,28 +140,14 @@ var TextInput = /* @__PURE__ */ forwardRef3(({ __inputScope, ...props }, forward
|
|
|
189
140
|
"aria-errormessage": errorMessageId
|
|
190
141
|
},
|
|
191
142
|
ref: forwardedRef
|
|
192
|
-
})
|
|
143
|
+
});
|
|
193
144
|
});
|
|
194
145
|
|
|
195
146
|
// packages/ui/primitives/react-input/src/TextArea.tsx
|
|
196
147
|
import React5, { forwardRef as forwardRef4 } from "react";
|
|
197
|
-
function _extends5() {
|
|
198
|
-
_extends5 = Object.assign || function(target) {
|
|
199
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
200
|
-
var source = arguments[i];
|
|
201
|
-
for (var key in source) {
|
|
202
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
203
|
-
target[key] = source[key];
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return target;
|
|
208
|
-
};
|
|
209
|
-
return _extends5.apply(this, arguments);
|
|
210
|
-
}
|
|
211
148
|
var TextArea = /* @__PURE__ */ forwardRef4(({ __inputScope, ...props }, forwardedRef) => {
|
|
212
149
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
213
|
-
return /* @__PURE__ */ React5.createElement("textarea",
|
|
150
|
+
return /* @__PURE__ */ React5.createElement("textarea", {
|
|
214
151
|
...props,
|
|
215
152
|
id,
|
|
216
153
|
"aria-describedby": descriptionId,
|
|
@@ -219,7 +156,7 @@ var TextArea = /* @__PURE__ */ forwardRef4(({ __inputScope, ...props }, forwarde
|
|
|
219
156
|
"aria-errormessage": errorMessageId
|
|
220
157
|
},
|
|
221
158
|
ref: forwardedRef
|
|
222
|
-
})
|
|
159
|
+
});
|
|
223
160
|
});
|
|
224
161
|
export {
|
|
225
162
|
Description,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/InputMeta.tsx", "../../../src/Root.tsx", "../../../src/PinInput.tsx", "../../../src/TextInput.tsx", "../../../src/TextArea.tsx"],
|
|
4
4
|
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { INPUT_NAME, InputScopedProps, useInputContext } from './Root';\n\ntype LabelProps = ComponentPropsWithRef<typeof Primitive.label> & { asChild?: boolean };\n\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ __inputScope, asChild, children, ...props }: InputScopedProps<LabelProps>, forwardedRef) => {\n const { id } = useInputContext(INPUT_NAME, __inputScope);\n const Root = asChild ? Slot : Primitive.label;\n return (\n <Root {...props} htmlFor={id} ref={forwardedRef}>\n {children}\n </Root>\n );\n },\n);\n\ntype DescriptionProps = Omit<ComponentPropsWithRef<typeof Primitive.span>, 'id'> & { asChild?: boolean };\n\nconst Description = forwardRef<HTMLSpanElement, DescriptionProps>(\n ({ __inputScope, asChild, children, ...props }: InputScopedProps<DescriptionProps>, forwardedRef) => {\n const { descriptionId, validationValence } = useInputContext(INPUT_NAME, __inputScope);\n const Root = asChild ? Slot : Primitive.span;\n return (\n <Root {...props} {...(validationValence === 'error' && { id: descriptionId })} ref={forwardedRef}>\n {children}\n </Root>\n );\n },\n);\n\ntype ErrorMessageProps = Omit<ComponentPropsWithRef<typeof Primitive.span>, 'id'> & { asChild?: boolean };\n\nconst ErrorMessage = forwardRef<HTMLSpanElement, ErrorMessageProps>(\n ({ __inputScope, asChild, children, ...props }: InputScopedProps<ErrorMessageProps>, forwardedRef) => {\n const { errorMessageId } = useInputContext(INPUT_NAME, __inputScope);\n const Root = asChild ? Slot : Primitive.span;\n return (\n <Root {...props} id={errorMessageId} ref={forwardedRef}>\n {children}\n </Root>\n );\n },\n);\n\ntype ValidationProps = Omit<ComponentPropsWithRef<typeof Primitive.span>, 'id'> & { asChild?: boolean };\n\nconst Validation = forwardRef<HTMLSpanElement, ValidationProps>(\n (props: InputScopedProps<ValidationProps>, forwardedRef) => {\n const { __inputScope, asChild, children, ...otherProps } = props;\n const { validationValence } = useInputContext(INPUT_NAME, __inputScope);\n if (validationValence === 'error') {\n return <ErrorMessage {...props} ref={forwardedRef} />;\n } else {\n const Root = asChild ? Slot : Primitive.span;\n return (\n <Root {...otherProps} ref={forwardedRef}>\n {children}\n </Root>\n );\n }\n },\n);\n\ntype DescriptionAndValidationProps = ComponentPropsWithRef<typeof Primitive.p> & { asChild?: boolean };\n\nconst DescriptionAndValidation = forwardRef<HTMLParagraphElement, DescriptionAndValidationProps>(\n ({ __inputScope, asChild, children, ...props }: InputScopedProps<DescriptionAndValidationProps>, forwardedRef) => {\n const { descriptionId, validationValence } = useInputContext(INPUT_NAME, __inputScope);\n const Root = asChild ? Slot : Primitive.p;\n return (\n <Root {...props} {...(validationValence !== 'error' && { id: descriptionId })} ref={forwardedRef}>\n {children}\n </Root>\n );\n },\n);\n\nexport { Label, Validation, Description, DescriptionAndValidation, ErrorMessage };\n\nexport type { LabelProps, ValidationProps, DescriptionProps, DescriptionAndValidationProps, ErrorMessageProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { createContextScope, Scope } from '@radix-ui/react-context';\nimport React, { PropsWithChildren } from 'react';\n\nimport { useId } from '@dxos/react-hooks';\n\nconst INPUT_NAME = 'Input';\n\ntype Valence = 'success' | 'info' | 'warning' | 'error' | 'neutral';\n\ntype InputScopedProps<P> = P & { __inputScope?: Scope };\n\ntype InputRootProps = PropsWithChildren<{\n id?: string;\n validationValence?: Valence;\n descriptionId?: string;\n errorMessageId?: string;\n}>;\n\nconst [createInputContext, createInputScope] = createContextScope(INPUT_NAME, []);\n\ntype InputContextValue = {\n id: string;\n descriptionId: string;\n errorMessageId: string;\n validationValence: Valence;\n};\n\nconst [InputProvider, useInputContext] = createInputContext<InputContextValue>(INPUT_NAME);\n\nconst InputRoot = ({\n __inputScope,\n id: propsId,\n descriptionId: propsDescriptionId,\n errorMessageId: propsErrorMessageId,\n validationValence = 'neutral',\n children,\n}: InputScopedProps<InputRootProps>) => {\n const id = useId('input', propsId);\n const descriptionId = useId('input__description', propsDescriptionId);\n const errorMessageId = useId('input__error-message', propsErrorMessageId);\n return (\n <InputProvider {...{ id, descriptionId, errorMessageId, validationValence }} scope={__inputScope}>\n {children}\n </InputProvider>\n );\n};\n\nInputRoot.displayName = INPUT_NAME;\n\nexport { InputRoot, InputRoot as Root, createInputScope, useInputContext, INPUT_NAME };\n\nexport type { Valence, InputRootProps, InputScopedProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CodeInput, getSegmentCssWidth } from 'rci';\nimport React, { ComponentProps, ComponentPropsWithRef, forwardRef, useCallback } from 'react';\n\nimport { useForwardedRef, useIsFocused } from '@dxos/react-hooks';\n\nimport { INPUT_NAME, InputScopedProps, useInputContext, Valence } from './Root';\n\ntype PinInputProps = Omit<\n ComponentPropsWithRef<typeof CodeInput>,\n 'id' | 'className' | 'inputRef' | 'renderSegment'\n> & {\n inputClassName?: string;\n segmentClassName?: (styleProps: { focused: boolean; validationValence: Valence }) => string;\n segmentPadding?: string;\n segmentHeight?: string;\n};\n\nconst PinInput = forwardRef<HTMLInputElement, PinInputProps>(\n (\n {\n __inputScope,\n segmentClassName,\n inputClassName,\n segmentPadding = '13px',\n segmentHeight = '100%',\n ...props\n }: InputScopedProps<PinInputProps>,\n forwardedRef,\n ) => {\n const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);\n const width = getSegmentCssWidth(segmentPadding);\n const inputRef = useForwardedRef(forwardedRef);\n const inputFocused = useIsFocused(inputRef);\n\n const renderSegment = useCallback<ComponentProps<typeof CodeInput>['renderSegment']>(\n ({ state, index }) => (\n <div\n key={index}\n className={segmentClassName?.({\n focused: !!(inputFocused && state),\n validationValence,\n })}\n data-state={state}\n style={{ width, height: segmentHeight }}\n />\n ),\n [segmentClassName, inputFocused, validationValence],\n );\n\n return (\n <CodeInput\n {...{\n padding: '8px',\n spacing: '8px',\n fontFamily: '',\n spellCheck: false,\n length: 6,\n ...props,\n id,\n 'aria-describedby': descriptionId,\n ...(validationValence === 'error' && {\n 'aria-invalid': 'true' as const,\n 'aria-errormessage': errorMessageId,\n }),\n inputRef,\n renderSegment,\n className: inputClassName,\n }}\n />\n );\n },\n);\n\nexport { PinInput };\n\nexport type { PinInputProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport React, { ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { INPUT_NAME, InputScopedProps, useInputContext } from './Root';\n\ntype TextInputProps = Omit<ComponentPropsWithRef<typeof Primitive.input>, 'id'>;\n\nconst TextInput = forwardRef<HTMLInputElement, TextInputProps>(\n ({ __inputScope, ...props }: InputScopedProps<TextInputProps>, forwardedRef) => {\n const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);\n return (\n <Primitive.input\n {...{\n ...props,\n id,\n 'aria-describedby': descriptionId,\n ...(validationValence === 'error' && {\n 'aria-invalid': 'true' as const,\n 'aria-errormessage': errorMessageId,\n }),\n ref: forwardedRef,\n }}\n />\n );\n },\n);\n\nexport { TextInput };\n\nexport type { TextInputProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { INPUT_NAME, InputScopedProps, useInputContext } from './Root';\n\ntype TextAreaProps = Omit<ComponentPropsWithRef<'textarea'>, 'id'>;\n\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n ({ __inputScope, ...props }: InputScopedProps<TextAreaProps>, forwardedRef) => {\n const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);\n return (\n <textarea\n {...{\n ...props,\n id,\n 'aria-describedby': descriptionId,\n ...(validationValence === 'error' && {\n 'aria-invalid': 'true' as const,\n 'aria-errormessage': errorMessageId,\n }),\n ref: forwardedRef,\n }}\n />\n );\n },\n);\n\nexport { TextArea };\n\nexport type { TextAreaProps };\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,iBAAiB;AAC1B,SAASC,YAAY;AACrB,OAAOC,UAAgCC,kBAAkB;;;ACFzD,SAASC,0BAAiC;AAC1C,OAAOC,WAAkC;AAEzC,SAASC,aAAa;
|
|
6
|
-
"names": ["Primitive", "Slot", "React", "forwardRef", "createContextScope", "React", "useId", "INPUT_NAME", "createInputContext", "createInputScope", "InputProvider", "useInputContext", "InputRoot", "__inputScope", "id", "propsId", "descriptionId", "propsDescriptionId", "errorMessageId", "propsErrorMessageId", "validationValence", "children", "
|
|
5
|
+
"mappings": ";AAIA,SAASA,iBAAiB;AAC1B,SAASC,YAAY;AACrB,OAAOC,UAAgCC,kBAAkB;;;ACFzD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OAAOW,UAAgCC,cAAAA,mBAAkB;AAMzD,IAAMC,WAAWC,gBAAAA,YACf,CAAC,EAAEC,cAAc,GAAGC,MAAAA,GAA0CC,iBAAAA;AAC5D,QAAM,EAAEC,IAAIC,mBAAmBC,eAAeC,eAAc,IAAKC,gBAAgBC,YAAYR,YAAAA;AAC7F,SACE,gBAAAS,OAAA,cAACC,YACK;IACF,GAAGT;IACHE;IACA,oBAAoBE;IACpB,GAAID,sBAAsB,WAAW;MACnC,gBAAgB;MAChB,qBAAqBE;IACvB;IACAK,KAAKT;EACP,CAAA;AAGN,CAAA;",
|
|
6
|
+
"names": ["Primitive", "Slot", "React", "forwardRef", "createContextScope", "React", "useId", "INPUT_NAME", "createInputContext", "createInputScope", "createContextScope", "InputProvider", "useInputContext", "InputRoot", "__inputScope", "id", "propsId", "descriptionId", "propsDescriptionId", "errorMessageId", "propsErrorMessageId", "validationValence", "children", "useId", "scope", "displayName", "Label", "forwardRef", "__inputScope", "asChild", "children", "props", "forwardedRef", "id", "useInputContext", "INPUT_NAME", "Root", "Slot", "Primitive", "label", "React", "htmlFor", "ref", "Description", "descriptionId", "validationValence", "span", "ErrorMessage", "errorMessageId", "Validation", "otherProps", "DescriptionAndValidation", "p", "CodeInput", "getSegmentCssWidth", "React", "forwardRef", "useCallback", "useForwardedRef", "useIsFocused", "PinInput", "forwardRef", "__inputScope", "segmentClassName", "inputClassName", "segmentPadding", "segmentHeight", "props", "forwardedRef", "id", "validationValence", "descriptionId", "errorMessageId", "useInputContext", "INPUT_NAME", "width", "getSegmentCssWidth", "inputRef", "useForwardedRef", "inputFocused", "useIsFocused", "renderSegment", "useCallback", "state", "index", "React", "div", "key", "className", "focused", "data-state", "style", "height", "CodeInput", "padding", "spacing", "fontFamily", "spellCheck", "length", "Primitive", "React", "forwardRef", "TextInput", "forwardRef", "__inputScope", "props", "forwardedRef", "id", "validationValence", "descriptionId", "errorMessageId", "useInputContext", "INPUT_NAME", "React", "Primitive", "input", "ref", "React", "forwardRef", "TextArea", "forwardRef", "__inputScope", "props", "forwardedRef", "id", "validationValence", "descriptionId", "errorMessageId", "useInputContext", "INPUT_NAME", "React", "textarea", "ref"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/ui/primitives/react-input/src/Root.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"packages/ui/primitives/react-input/src/Root.tsx":{"bytes":4671,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true}]},"packages/ui/primitives/react-input/src/InputMeta.tsx":{"bytes":10083,"imports":[{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/ui/primitives/react-input/src/Root.tsx","kind":"import-statement","original":"./Root"}]},"packages/ui/primitives/react-input/src/PinInput.tsx":{"bytes":6976,"imports":[{"path":"rci","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"packages/ui/primitives/react-input/src/Root.tsx","kind":"import-statement","original":"./Root"}]},"packages/ui/primitives/react-input/src/TextInput.tsx":{"bytes":3198,"imports":[{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/ui/primitives/react-input/src/Root.tsx","kind":"import-statement","original":"./Root"}]},"packages/ui/primitives/react-input/src/TextArea.tsx":{"bytes":2963,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/ui/primitives/react-input/src/Root.tsx","kind":"import-statement","original":"./Root"}]},"packages/ui/primitives/react-input/src/index.ts":{"bytes":824,"imports":[{"path":"packages/ui/primitives/react-input/src/InputMeta.tsx","kind":"import-statement","original":"./InputMeta"},{"path":"packages/ui/primitives/react-input/src/Root.tsx","kind":"import-statement","original":"./Root"},{"path":"packages/ui/primitives/react-input/src/PinInput.tsx","kind":"import-statement","original":"./PinInput"},{"path":"packages/ui/primitives/react-input/src/TextInput.tsx","kind":"import-statement","original":"./TextInput"},{"path":"packages/ui/primitives/react-input/src/TextArea.tsx","kind":"import-statement","original":"./TextArea"}]}},"outputs":{"packages/ui/primitives/react-input/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14943},"packages/ui/primitives/react-input/dist/lib/browser/index.mjs":{"imports":[{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"rci","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["Description","DescriptionAndValidation","ErrorMessage","INPUT_NAME","InputRoot","Label","PinInput","Root","TextArea","TextInput","Validation","createInputScope","useInputContext"],"entryPoint":"packages/ui/primitives/react-input/src/index.ts","inputs":{"packages/ui/primitives/react-input/src/InputMeta.tsx":{"bytesInOutput":2282},"packages/ui/primitives/react-input/src/Root.tsx":{"bytesInOutput":875},"packages/ui/primitives/react-input/src/index.ts":{"bytesInOutput":0},"packages/ui/primitives/react-input/src/PinInput.tsx":{"bytesInOutput":1462},"packages/ui/primitives/react-input/src/TextInput.tsx":{"bytesInOutput":610},"packages/ui/primitives/react-input/src/TextArea.tsx":{"bytesInOutput":534}},"bytes":6349}}}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -55,20 +55,6 @@ var import_react2 = __toESM(require("react"));
|
|
|
55
55
|
var import_react_context = require("@radix-ui/react-context");
|
|
56
56
|
var import_react = __toESM(require("react"));
|
|
57
57
|
var import_react_hooks = require("@dxos/react-hooks");
|
|
58
|
-
function _extends() {
|
|
59
|
-
_extends = Object.assign || function(target) {
|
|
60
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
61
|
-
var source = arguments[i];
|
|
62
|
-
for (var key in source) {
|
|
63
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
64
|
-
target[key] = source[key];
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return target;
|
|
69
|
-
};
|
|
70
|
-
return _extends.apply(this, arguments);
|
|
71
|
-
}
|
|
72
58
|
var INPUT_NAME = "Input";
|
|
73
59
|
var [createInputContext, createInputScope] = (0, import_react_context.createContextScope)(INPUT_NAME, []);
|
|
74
60
|
var [InputProvider, useInputContext] = createInputContext(INPUT_NAME);
|
|
@@ -76,99 +62,78 @@ var InputRoot = ({ __inputScope, id: propsId, descriptionId: propsDescriptionId,
|
|
|
76
62
|
const id = (0, import_react_hooks.useId)("input", propsId);
|
|
77
63
|
const descriptionId = (0, import_react_hooks.useId)("input__description", propsDescriptionId);
|
|
78
64
|
const errorMessageId = (0, import_react_hooks.useId)("input__error-message", propsErrorMessageId);
|
|
79
|
-
return /* @__PURE__ */ import_react.default.createElement(InputProvider,
|
|
65
|
+
return /* @__PURE__ */ import_react.default.createElement(InputProvider, {
|
|
80
66
|
id,
|
|
81
67
|
descriptionId,
|
|
82
68
|
errorMessageId,
|
|
83
|
-
validationValence
|
|
84
|
-
}, {
|
|
69
|
+
validationValence,
|
|
85
70
|
scope: __inputScope
|
|
86
|
-
}
|
|
71
|
+
}, children);
|
|
87
72
|
};
|
|
88
73
|
InputRoot.displayName = INPUT_NAME;
|
|
89
74
|
|
|
90
75
|
// packages/ui/primitives/react-input/src/InputMeta.tsx
|
|
91
|
-
function _extends2() {
|
|
92
|
-
_extends2 = Object.assign || function(target) {
|
|
93
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
94
|
-
var source = arguments[i];
|
|
95
|
-
for (var key in source) {
|
|
96
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
97
|
-
target[key] = source[key];
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return target;
|
|
102
|
-
};
|
|
103
|
-
return _extends2.apply(this, arguments);
|
|
104
|
-
}
|
|
105
76
|
var Label = /* @__PURE__ */ (0, import_react2.forwardRef)(({ __inputScope, asChild, children, ...props }, forwardedRef) => {
|
|
106
77
|
const { id } = useInputContext(INPUT_NAME, __inputScope);
|
|
107
78
|
const Root = asChild ? import_react_slot.Slot : import_react_primitive.Primitive.label;
|
|
108
|
-
return /* @__PURE__ */ import_react2.default.createElement(Root,
|
|
79
|
+
return /* @__PURE__ */ import_react2.default.createElement(Root, {
|
|
80
|
+
...props,
|
|
109
81
|
htmlFor: id,
|
|
110
82
|
ref: forwardedRef
|
|
111
|
-
}
|
|
83
|
+
}, children);
|
|
112
84
|
});
|
|
113
85
|
var Description = /* @__PURE__ */ (0, import_react2.forwardRef)(({ __inputScope, asChild, children, ...props }, forwardedRef) => {
|
|
114
86
|
const { descriptionId, validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
115
87
|
const Root = asChild ? import_react_slot.Slot : import_react_primitive.Primitive.span;
|
|
116
|
-
return /* @__PURE__ */ import_react2.default.createElement(Root,
|
|
117
|
-
|
|
118
|
-
|
|
88
|
+
return /* @__PURE__ */ import_react2.default.createElement(Root, {
|
|
89
|
+
...props,
|
|
90
|
+
...validationValence === "error" && {
|
|
91
|
+
id: descriptionId
|
|
92
|
+
},
|
|
119
93
|
ref: forwardedRef
|
|
120
|
-
}
|
|
94
|
+
}, children);
|
|
121
95
|
});
|
|
122
96
|
var ErrorMessage = /* @__PURE__ */ (0, import_react2.forwardRef)(({ __inputScope, asChild, children, ...props }, forwardedRef) => {
|
|
123
97
|
const { errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
124
98
|
const Root = asChild ? import_react_slot.Slot : import_react_primitive.Primitive.span;
|
|
125
|
-
return /* @__PURE__ */ import_react2.default.createElement(Root,
|
|
99
|
+
return /* @__PURE__ */ import_react2.default.createElement(Root, {
|
|
100
|
+
...props,
|
|
126
101
|
id: errorMessageId,
|
|
127
102
|
ref: forwardedRef
|
|
128
|
-
}
|
|
103
|
+
}, children);
|
|
129
104
|
});
|
|
130
105
|
var Validation = /* @__PURE__ */ (0, import_react2.forwardRef)((props, forwardedRef) => {
|
|
131
106
|
const { __inputScope, asChild, children, ...otherProps } = props;
|
|
132
107
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
133
108
|
if (validationValence === "error") {
|
|
134
|
-
return /* @__PURE__ */ import_react2.default.createElement(ErrorMessage,
|
|
109
|
+
return /* @__PURE__ */ import_react2.default.createElement(ErrorMessage, {
|
|
110
|
+
...props,
|
|
135
111
|
ref: forwardedRef
|
|
136
|
-
})
|
|
112
|
+
});
|
|
137
113
|
} else {
|
|
138
114
|
const Root = asChild ? import_react_slot.Slot : import_react_primitive.Primitive.span;
|
|
139
|
-
return /* @__PURE__ */ import_react2.default.createElement(Root,
|
|
115
|
+
return /* @__PURE__ */ import_react2.default.createElement(Root, {
|
|
116
|
+
...otherProps,
|
|
140
117
|
ref: forwardedRef
|
|
141
|
-
}
|
|
118
|
+
}, children);
|
|
142
119
|
}
|
|
143
120
|
});
|
|
144
121
|
var DescriptionAndValidation = /* @__PURE__ */ (0, import_react2.forwardRef)(({ __inputScope, asChild, children, ...props }, forwardedRef) => {
|
|
145
122
|
const { descriptionId, validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
146
123
|
const Root = asChild ? import_react_slot.Slot : import_react_primitive.Primitive.p;
|
|
147
|
-
return /* @__PURE__ */ import_react2.default.createElement(Root,
|
|
148
|
-
|
|
149
|
-
|
|
124
|
+
return /* @__PURE__ */ import_react2.default.createElement(Root, {
|
|
125
|
+
...props,
|
|
126
|
+
...validationValence !== "error" && {
|
|
127
|
+
id: descriptionId
|
|
128
|
+
},
|
|
150
129
|
ref: forwardedRef
|
|
151
|
-
}
|
|
130
|
+
}, children);
|
|
152
131
|
});
|
|
153
132
|
|
|
154
133
|
// packages/ui/primitives/react-input/src/PinInput.tsx
|
|
155
134
|
var import_rci = require("rci");
|
|
156
135
|
var import_react3 = __toESM(require("react"));
|
|
157
136
|
var import_react_hooks2 = require("@dxos/react-hooks");
|
|
158
|
-
function _extends3() {
|
|
159
|
-
_extends3 = Object.assign || function(target) {
|
|
160
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
161
|
-
var source = arguments[i];
|
|
162
|
-
for (var key in source) {
|
|
163
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
164
|
-
target[key] = source[key];
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return target;
|
|
169
|
-
};
|
|
170
|
-
return _extends3.apply(this, arguments);
|
|
171
|
-
}
|
|
172
137
|
var PinInput = /* @__PURE__ */ (0, import_react3.forwardRef)(({ __inputScope, segmentClassName, inputClassName, segmentPadding = "13px", segmentHeight = "100%", ...props }, forwardedRef) => {
|
|
173
138
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
174
139
|
const width = (0, import_rci.getSegmentCssWidth)(segmentPadding);
|
|
@@ -190,7 +155,7 @@ var PinInput = /* @__PURE__ */ (0, import_react3.forwardRef)(({ __inputScope, se
|
|
|
190
155
|
inputFocused,
|
|
191
156
|
validationValence
|
|
192
157
|
]);
|
|
193
|
-
return /* @__PURE__ */ import_react3.default.createElement(import_rci.CodeInput,
|
|
158
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_rci.CodeInput, {
|
|
194
159
|
padding: "8px",
|
|
195
160
|
spacing: "8px",
|
|
196
161
|
fontFamily: "",
|
|
@@ -206,29 +171,15 @@ var PinInput = /* @__PURE__ */ (0, import_react3.forwardRef)(({ __inputScope, se
|
|
|
206
171
|
inputRef,
|
|
207
172
|
renderSegment,
|
|
208
173
|
className: inputClassName
|
|
209
|
-
})
|
|
174
|
+
});
|
|
210
175
|
});
|
|
211
176
|
|
|
212
177
|
// packages/ui/primitives/react-input/src/TextInput.tsx
|
|
213
178
|
var import_react_primitive2 = require("@radix-ui/react-primitive");
|
|
214
179
|
var import_react4 = __toESM(require("react"));
|
|
215
|
-
function _extends4() {
|
|
216
|
-
_extends4 = Object.assign || function(target) {
|
|
217
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
218
|
-
var source = arguments[i];
|
|
219
|
-
for (var key in source) {
|
|
220
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
221
|
-
target[key] = source[key];
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
return target;
|
|
226
|
-
};
|
|
227
|
-
return _extends4.apply(this, arguments);
|
|
228
|
-
}
|
|
229
180
|
var TextInput = /* @__PURE__ */ (0, import_react4.forwardRef)(({ __inputScope, ...props }, forwardedRef) => {
|
|
230
181
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
231
|
-
return /* @__PURE__ */ import_react4.default.createElement(import_react_primitive2.Primitive.input,
|
|
182
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react_primitive2.Primitive.input, {
|
|
232
183
|
...props,
|
|
233
184
|
id,
|
|
234
185
|
"aria-describedby": descriptionId,
|
|
@@ -237,28 +188,14 @@ var TextInput = /* @__PURE__ */ (0, import_react4.forwardRef)(({ __inputScope, .
|
|
|
237
188
|
"aria-errormessage": errorMessageId
|
|
238
189
|
},
|
|
239
190
|
ref: forwardedRef
|
|
240
|
-
})
|
|
191
|
+
});
|
|
241
192
|
});
|
|
242
193
|
|
|
243
194
|
// packages/ui/primitives/react-input/src/TextArea.tsx
|
|
244
195
|
var import_react5 = __toESM(require("react"));
|
|
245
|
-
function _extends5() {
|
|
246
|
-
_extends5 = Object.assign || function(target) {
|
|
247
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
248
|
-
var source = arguments[i];
|
|
249
|
-
for (var key in source) {
|
|
250
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
251
|
-
target[key] = source[key];
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
return target;
|
|
256
|
-
};
|
|
257
|
-
return _extends5.apply(this, arguments);
|
|
258
|
-
}
|
|
259
196
|
var TextArea = /* @__PURE__ */ (0, import_react5.forwardRef)(({ __inputScope, ...props }, forwardedRef) => {
|
|
260
197
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
261
|
-
return /* @__PURE__ */ import_react5.default.createElement("textarea",
|
|
198
|
+
return /* @__PURE__ */ import_react5.default.createElement("textarea", {
|
|
262
199
|
...props,
|
|
263
200
|
id,
|
|
264
201
|
"aria-describedby": descriptionId,
|
|
@@ -267,7 +204,7 @@ var TextArea = /* @__PURE__ */ (0, import_react5.forwardRef)(({ __inputScope, ..
|
|
|
267
204
|
"aria-errormessage": errorMessageId
|
|
268
205
|
},
|
|
269
206
|
ref: forwardedRef
|
|
270
|
-
})
|
|
207
|
+
});
|
|
271
208
|
});
|
|
272
209
|
// Annotate the CommonJS export names for ESM import in node:
|
|
273
210
|
0 && (module.exports = {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/index.ts", "../../../src/InputMeta.tsx", "../../../src/Root.tsx", "../../../src/PinInput.tsx", "../../../src/TextInput.tsx", "../../../src/TextArea.tsx"],
|
|
4
4
|
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport * from './InputMeta';\nexport * from './Root';\n\nexport * from './PinInput';\nexport * from './TextInput';\nexport * from './TextArea';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { INPUT_NAME, InputScopedProps, useInputContext } from './Root';\n\ntype LabelProps = ComponentPropsWithRef<typeof Primitive.label> & { asChild?: boolean };\n\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ __inputScope, asChild, children, ...props }: InputScopedProps<LabelProps>, forwardedRef) => {\n const { id } = useInputContext(INPUT_NAME, __inputScope);\n const Root = asChild ? Slot : Primitive.label;\n return (\n <Root {...props} htmlFor={id} ref={forwardedRef}>\n {children}\n </Root>\n );\n },\n);\n\ntype DescriptionProps = Omit<ComponentPropsWithRef<typeof Primitive.span>, 'id'> & { asChild?: boolean };\n\nconst Description = forwardRef<HTMLSpanElement, DescriptionProps>(\n ({ __inputScope, asChild, children, ...props }: InputScopedProps<DescriptionProps>, forwardedRef) => {\n const { descriptionId, validationValence } = useInputContext(INPUT_NAME, __inputScope);\n const Root = asChild ? Slot : Primitive.span;\n return (\n <Root {...props} {...(validationValence === 'error' && { id: descriptionId })} ref={forwardedRef}>\n {children}\n </Root>\n );\n },\n);\n\ntype ErrorMessageProps = Omit<ComponentPropsWithRef<typeof Primitive.span>, 'id'> & { asChild?: boolean };\n\nconst ErrorMessage = forwardRef<HTMLSpanElement, ErrorMessageProps>(\n ({ __inputScope, asChild, children, ...props }: InputScopedProps<ErrorMessageProps>, forwardedRef) => {\n const { errorMessageId } = useInputContext(INPUT_NAME, __inputScope);\n const Root = asChild ? Slot : Primitive.span;\n return (\n <Root {...props} id={errorMessageId} ref={forwardedRef}>\n {children}\n </Root>\n );\n },\n);\n\ntype ValidationProps = Omit<ComponentPropsWithRef<typeof Primitive.span>, 'id'> & { asChild?: boolean };\n\nconst Validation = forwardRef<HTMLSpanElement, ValidationProps>(\n (props: InputScopedProps<ValidationProps>, forwardedRef) => {\n const { __inputScope, asChild, children, ...otherProps } = props;\n const { validationValence } = useInputContext(INPUT_NAME, __inputScope);\n if (validationValence === 'error') {\n return <ErrorMessage {...props} ref={forwardedRef} />;\n } else {\n const Root = asChild ? Slot : Primitive.span;\n return (\n <Root {...otherProps} ref={forwardedRef}>\n {children}\n </Root>\n );\n }\n },\n);\n\ntype DescriptionAndValidationProps = ComponentPropsWithRef<typeof Primitive.p> & { asChild?: boolean };\n\nconst DescriptionAndValidation = forwardRef<HTMLParagraphElement, DescriptionAndValidationProps>(\n ({ __inputScope, asChild, children, ...props }: InputScopedProps<DescriptionAndValidationProps>, forwardedRef) => {\n const { descriptionId, validationValence } = useInputContext(INPUT_NAME, __inputScope);\n const Root = asChild ? Slot : Primitive.p;\n return (\n <Root {...props} {...(validationValence !== 'error' && { id: descriptionId })} ref={forwardedRef}>\n {children}\n </Root>\n );\n },\n);\n\nexport { Label, Validation, Description, DescriptionAndValidation, ErrorMessage };\n\nexport type { LabelProps, ValidationProps, DescriptionProps, DescriptionAndValidationProps, ErrorMessageProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { createContextScope, Scope } from '@radix-ui/react-context';\nimport React, { PropsWithChildren } from 'react';\n\nimport { useId } from '@dxos/react-hooks';\n\nconst INPUT_NAME = 'Input';\n\ntype Valence = 'success' | 'info' | 'warning' | 'error' | 'neutral';\n\ntype InputScopedProps<P> = P & { __inputScope?: Scope };\n\ntype InputRootProps = PropsWithChildren<{\n id?: string;\n validationValence?: Valence;\n descriptionId?: string;\n errorMessageId?: string;\n}>;\n\nconst [createInputContext, createInputScope] = createContextScope(INPUT_NAME, []);\n\ntype InputContextValue = {\n id: string;\n descriptionId: string;\n errorMessageId: string;\n validationValence: Valence;\n};\n\nconst [InputProvider, useInputContext] = createInputContext<InputContextValue>(INPUT_NAME);\n\nconst InputRoot = ({\n __inputScope,\n id: propsId,\n descriptionId: propsDescriptionId,\n errorMessageId: propsErrorMessageId,\n validationValence = 'neutral',\n children,\n}: InputScopedProps<InputRootProps>) => {\n const id = useId('input', propsId);\n const descriptionId = useId('input__description', propsDescriptionId);\n const errorMessageId = useId('input__error-message', propsErrorMessageId);\n return (\n <InputProvider {...{ id, descriptionId, errorMessageId, validationValence }} scope={__inputScope}>\n {children}\n </InputProvider>\n );\n};\n\nInputRoot.displayName = INPUT_NAME;\n\nexport { InputRoot, InputRoot as Root, createInputScope, useInputContext, INPUT_NAME };\n\nexport type { Valence, InputRootProps, InputScopedProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CodeInput, getSegmentCssWidth } from 'rci';\nimport React, { ComponentProps, ComponentPropsWithRef, forwardRef, useCallback } from 'react';\n\nimport { useForwardedRef, useIsFocused } from '@dxos/react-hooks';\n\nimport { INPUT_NAME, InputScopedProps, useInputContext, Valence } from './Root';\n\ntype PinInputProps = Omit<\n ComponentPropsWithRef<typeof CodeInput>,\n 'id' | 'className' | 'inputRef' | 'renderSegment'\n> & {\n inputClassName?: string;\n segmentClassName?: (styleProps: { focused: boolean; validationValence: Valence }) => string;\n segmentPadding?: string;\n segmentHeight?: string;\n};\n\nconst PinInput = forwardRef<HTMLInputElement, PinInputProps>(\n (\n {\n __inputScope,\n segmentClassName,\n inputClassName,\n segmentPadding = '13px',\n segmentHeight = '100%',\n ...props\n }: InputScopedProps<PinInputProps>,\n forwardedRef,\n ) => {\n const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);\n const width = getSegmentCssWidth(segmentPadding);\n const inputRef = useForwardedRef(forwardedRef);\n const inputFocused = useIsFocused(inputRef);\n\n const renderSegment = useCallback<ComponentProps<typeof CodeInput>['renderSegment']>(\n ({ state, index }) => (\n <div\n key={index}\n className={segmentClassName?.({\n focused: !!(inputFocused && state),\n validationValence,\n })}\n data-state={state}\n style={{ width, height: segmentHeight }}\n />\n ),\n [segmentClassName, inputFocused, validationValence],\n );\n\n return (\n <CodeInput\n {...{\n padding: '8px',\n spacing: '8px',\n fontFamily: '',\n spellCheck: false,\n length: 6,\n ...props,\n id,\n 'aria-describedby': descriptionId,\n ...(validationValence === 'error' && {\n 'aria-invalid': 'true' as const,\n 'aria-errormessage': errorMessageId,\n }),\n inputRef,\n renderSegment,\n className: inputClassName,\n }}\n />\n );\n },\n);\n\nexport { PinInput };\n\nexport type { PinInputProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport React, { ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { INPUT_NAME, InputScopedProps, useInputContext } from './Root';\n\ntype TextInputProps = Omit<ComponentPropsWithRef<typeof Primitive.input>, 'id'>;\n\nconst TextInput = forwardRef<HTMLInputElement, TextInputProps>(\n ({ __inputScope, ...props }: InputScopedProps<TextInputProps>, forwardedRef) => {\n const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);\n return (\n <Primitive.input\n {...{\n ...props,\n id,\n 'aria-describedby': descriptionId,\n ...(validationValence === 'error' && {\n 'aria-invalid': 'true' as const,\n 'aria-errormessage': errorMessageId,\n }),\n ref: forwardedRef,\n }}\n />\n );\n },\n);\n\nexport { TextInput };\n\nexport type { TextInputProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { INPUT_NAME, InputScopedProps, useInputContext } from './Root';\n\ntype TextAreaProps = Omit<ComponentPropsWithRef<'textarea'>, 'id'>;\n\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n ({ __inputScope, ...props }: InputScopedProps<TextAreaProps>, forwardedRef) => {\n const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);\n return (\n <textarea\n {...{\n ...props,\n id,\n 'aria-describedby': descriptionId,\n ...(validationValence === 'error' && {\n 'aria-invalid': 'true' as const,\n 'aria-errormessage': errorMessageId,\n }),\n ref: forwardedRef,\n }}\n />\n );\n },\n);\n\nexport { TextArea };\n\nexport type { TextAreaProps };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;ACIA,6BAA0B;AAC1B,wBAAqB;AACrB,IAAAA,gBAAyD;;;ACFzD,2BAA0C;AAC1C,mBAAyC;AAEzC,yBAAsB;
|
|
6
|
-
"names": ["import_react", "INPUT_NAME", "createInputContext", "createInputScope", "createContextScope", "InputProvider", "useInputContext", "InputRoot", "__inputScope", "id", "propsId", "descriptionId", "propsDescriptionId", "errorMessageId", "propsErrorMessageId", "validationValence", "children", "useId", "React", "scope", "displayName", "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;ACIA,6BAA0B;AAC1B,wBAAqB;AACrB,IAAAA,gBAAyD;;;ACFzD,2BAA0C;AAC1C,mBAAyC;AAEzC,yBAAsB;AAEtB,IAAMC,aAAa;AAanB,IAAM,CAACC,oBAAoBC,gBAAAA,QAAoBC,yCAAmBH,YAAY,CAAA,CAAE;AAShF,IAAM,CAACI,eAAeC,eAAAA,IAAmBJ,mBAAsCD,UAAAA;AAE/E,IAAMM,YAAY,CAAC,EACjBC,cACAC,IAAIC,SACJC,eAAeC,oBACfC,gBAAgBC,qBAChBC,oBAAoB,WACpBC,SAAQ,MACyB;AACjC,QAAMP,SAAKQ,0BAAM,SAASP,OAAAA;AAC1B,QAAMC,oBAAgBM,0BAAM,sBAAsBL,kBAAAA;AAClD,QAAMC,qBAAiBI,0BAAM,wBAAwBH,mBAAAA;AACrD,SACE,6BAAAI,QAAA,cAACb,eAAAA;IAAoBI;IAAIE;IAAeE;IAAgBE;IAAqBI,OAAOX;KACjFQ,QAAAA;AAGP;AAEAT,UAAUa,cAAcnB;;;ADvCxB,IAAMoB,QAAQC,8CACZ,CAAC,EAAEC,cAAcC,SAASC,UAAU,GAAGC,MAAAA,GAAuCC,iBAAAA;AAC5E,QAAM,EAAEC,GAAE,IAAKC,gBAAgBC,YAAYP,YAAAA;AAC3C,QAAMQ,OAAOP,UAAUQ,yBAAOC,iCAAUC;AACxC,SACE,8BAAAC,QAAA,cAACJ,MAAAA;IAAM,GAAGL;IAAOU,SAASR;IAAIS,KAAKV;KAChCF,QAAAA;AAGP,CAAA;AAKF,IAAMa,cAAchB,8CAClB,CAAC,EAAEC,cAAcC,SAASC,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,eAAc,IAAKC,gBAAgBC,YAAYR,YAAAA;AAC7F,SACE,8BAAAS,QAAA,cAACC,kCAAUC,OACL;IACF,GAAGV;IACHE;IACA,oBAAoBE;IACpB,GAAID,sBAAsB,WAAW;MACnC,gBAAgB;MAChB,qBAAqBE;IACvB;IACAM,KAAKV;EACP,CAAA;AAGN,CAAA;;;ACxBF,IAAAW,gBAAyD;AAMzD,IAAMC,WAAWC,8CACf,CAAC,EAAEC,cAAc,GAAGC,MAAAA,GAA0CC,iBAAAA;AAC5D,QAAM,EAAEC,IAAIC,mBAAmBC,eAAeC,eAAc,IAAKC,gBAAgBC,YAAYR,YAAAA;AAC7F,SACE,8BAAAS,QAAA,cAACC,YACK;IACF,GAAGT;IACHE;IACA,oBAAoBE;IACpB,GAAID,sBAAsB,WAAW;MACnC,gBAAgB;MAChB,qBAAqBE;IACvB;IACAK,KAAKT;EACP,CAAA;AAGN,CAAA;",
|
|
6
|
+
"names": ["import_react", "INPUT_NAME", "createInputContext", "createInputScope", "createContextScope", "InputProvider", "useInputContext", "InputRoot", "__inputScope", "id", "propsId", "descriptionId", "propsDescriptionId", "errorMessageId", "propsErrorMessageId", "validationValence", "children", "useId", "React", "scope", "displayName", "Label", "forwardRef", "__inputScope", "asChild", "children", "props", "forwardedRef", "id", "useInputContext", "INPUT_NAME", "Root", "Slot", "Primitive", "label", "React", "htmlFor", "ref", "Description", "descriptionId", "validationValence", "span", "ErrorMessage", "errorMessageId", "Validation", "otherProps", "DescriptionAndValidation", "p", "import_react", "import_react_hooks", "PinInput", "forwardRef", "__inputScope", "segmentClassName", "inputClassName", "segmentPadding", "segmentHeight", "props", "forwardedRef", "id", "validationValence", "descriptionId", "errorMessageId", "useInputContext", "INPUT_NAME", "width", "getSegmentCssWidth", "inputRef", "useForwardedRef", "inputFocused", "useIsFocused", "renderSegment", "useCallback", "state", "index", "React", "div", "key", "className", "focused", "data-state", "style", "height", "CodeInput", "padding", "spacing", "fontFamily", "spellCheck", "length", "import_react_primitive", "import_react", "TextInput", "forwardRef", "__inputScope", "props", "forwardedRef", "id", "validationValence", "descriptionId", "errorMessageId", "useInputContext", "INPUT_NAME", "React", "Primitive", "input", "ref", "import_react", "TextArea", "forwardRef", "__inputScope", "props", "forwardedRef", "id", "validationValence", "descriptionId", "errorMessageId", "useInputContext", "INPUT_NAME", "React", "textarea", "ref"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/ui/primitives/react-input/src/Root.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"packages/ui/primitives/react-input/src/Root.tsx":{"bytes":4671,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true}]},"packages/ui/primitives/react-input/src/InputMeta.tsx":{"bytes":10083,"imports":[{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/ui/primitives/react-input/src/Root.tsx","kind":"import-statement","original":"./Root"}]},"packages/ui/primitives/react-input/src/PinInput.tsx":{"bytes":6976,"imports":[{"path":"rci","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"packages/ui/primitives/react-input/src/Root.tsx","kind":"import-statement","original":"./Root"}]},"packages/ui/primitives/react-input/src/TextInput.tsx":{"bytes":3198,"imports":[{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/ui/primitives/react-input/src/Root.tsx","kind":"import-statement","original":"./Root"}]},"packages/ui/primitives/react-input/src/TextArea.tsx":{"bytes":2963,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/ui/primitives/react-input/src/Root.tsx","kind":"import-statement","original":"./Root"}]},"packages/ui/primitives/react-input/src/index.ts":{"bytes":824,"imports":[{"path":"packages/ui/primitives/react-input/src/InputMeta.tsx","kind":"import-statement","original":"./InputMeta"},{"path":"packages/ui/primitives/react-input/src/Root.tsx","kind":"import-statement","original":"./Root"},{"path":"packages/ui/primitives/react-input/src/PinInput.tsx","kind":"import-statement","original":"./PinInput"},{"path":"packages/ui/primitives/react-input/src/TextInput.tsx","kind":"import-statement","original":"./TextInput"},{"path":"packages/ui/primitives/react-input/src/TextArea.tsx","kind":"import-statement","original":"./TextArea"}]}},"outputs":{"packages/ui/primitives/react-input/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14980},"packages/ui/primitives/react-input/dist/lib/node/index.cjs":{"imports":[{"path":"@radix-ui/react-primitive","kind":"require-call","external":true},{"path":"@radix-ui/react-slot","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"@radix-ui/react-context","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"@dxos/react-hooks","kind":"require-call","external":true},{"path":"rci","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"@dxos/react-hooks","kind":"require-call","external":true},{"path":"@radix-ui/react-primitive","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true}],"exports":[],"entryPoint":"packages/ui/primitives/react-input/src/index.ts","inputs":{"packages/ui/primitives/react-input/src/index.ts":{"bytesInOutput":536},"packages/ui/primitives/react-input/src/InputMeta.tsx":{"bytesInOutput":2699},"packages/ui/primitives/react-input/src/Root.tsx":{"bytesInOutput":1020},"packages/ui/primitives/react-input/src/PinInput.tsx":{"bytesInOutput":1550},"packages/ui/primitives/react-input/src/TextInput.tsx":{"bytesInOutput":653},"packages/ui/primitives/react-input/src/TextArea.tsx":{"bytesInOutput":555}},"bytes":9114}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-input",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.53-main.00be1a9",
|
|
4
4
|
"description": "Input primitive components for React.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@radix-ui/react-use-controllable-state": "^1.0.0",
|
|
24
24
|
"lodash.omit": "^4.5.0",
|
|
25
25
|
"rci": "^0.1.0",
|
|
26
|
-
"@dxos/react-hooks": "0.1.
|
|
26
|
+
"@dxos/react-hooks": "0.1.53-main.00be1a9"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/react": "^18.0.21",
|