@dxos/react-input 0.8.4-main.67995b8 → 0.8.4-main.6fa680abb7

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.
@@ -29,8 +29,8 @@ InputRoot.displayName = INPUT_NAME;
29
29
  // src/InputMeta.tsx
30
30
  var Label = /* @__PURE__ */ forwardRef(({ __inputScope, asChild, children, ...props }, forwardedRef) => {
31
31
  const { id } = useInputContext(INPUT_NAME, __inputScope);
32
- const Root = asChild ? Slot : Primitive.label;
33
- return /* @__PURE__ */ React2.createElement(Root, {
32
+ const Comp = asChild ? Slot : Primitive.label;
33
+ return /* @__PURE__ */ React2.createElement(Comp, {
34
34
  ...props,
35
35
  htmlFor: id,
36
36
  ref: forwardedRef
@@ -38,8 +38,8 @@ var Label = /* @__PURE__ */ forwardRef(({ __inputScope, asChild, children, ...pr
38
38
  });
39
39
  var Description = /* @__PURE__ */ forwardRef(({ __inputScope, asChild, children, ...props }, forwardedRef) => {
40
40
  const { descriptionId, validationValence } = useInputContext(INPUT_NAME, __inputScope);
41
- const Root = asChild ? Slot : Primitive.span;
42
- return /* @__PURE__ */ React2.createElement(Root, {
41
+ const Comp = asChild ? Slot : Primitive.span;
42
+ return /* @__PURE__ */ React2.createElement(Comp, {
43
43
  ...props,
44
44
  ...validationValence === "error" && {
45
45
  id: descriptionId
@@ -49,8 +49,8 @@ var Description = /* @__PURE__ */ forwardRef(({ __inputScope, asChild, children,
49
49
  });
50
50
  var ErrorMessage = /* @__PURE__ */ forwardRef(({ __inputScope, asChild, children, ...props }, forwardedRef) => {
51
51
  const { errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
52
- const Root = asChild ? Slot : Primitive.span;
53
- return /* @__PURE__ */ React2.createElement(Root, {
52
+ const Comp = asChild ? Slot : Primitive.span;
53
+ return /* @__PURE__ */ React2.createElement(Comp, {
54
54
  ...props,
55
55
  id: errorMessageId,
56
56
  ref: forwardedRef
@@ -65,8 +65,8 @@ var Validation = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
65
65
  ref: forwardedRef
66
66
  });
67
67
  } else {
68
- const Root = asChild ? Slot : Primitive.span;
69
- return /* @__PURE__ */ React2.createElement(Root, {
68
+ const Comp = asChild ? Slot : Primitive.span;
69
+ return /* @__PURE__ */ React2.createElement(Comp, {
70
70
  ...otherProps,
71
71
  ref: forwardedRef
72
72
  }, children);
@@ -74,8 +74,8 @@ var Validation = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
74
74
  });
75
75
  var DescriptionAndValidation = /* @__PURE__ */ forwardRef(({ __inputScope, asChild, children, ...props }, forwardedRef) => {
76
76
  const { descriptionId, validationValence } = useInputContext(INPUT_NAME, __inputScope);
77
- const Root = asChild ? Slot : Primitive.p;
78
- return /* @__PURE__ */ React2.createElement(Root, {
77
+ const Comp = asChild ? Slot : Primitive.p;
78
+ return /* @__PURE__ */ React2.createElement(Comp, {
79
79
  ...props,
80
80
  ...validationValence !== "error" && {
81
81
  id: descriptionId
@@ -85,47 +85,170 @@ var DescriptionAndValidation = /* @__PURE__ */ forwardRef(({ __inputScope, asChi
85
85
  });
86
86
 
87
87
  // src/PinInput.tsx
88
- import { CodeInput, getSegmentCssWidth } from "rci";
89
- import React3, { forwardRef as forwardRef2, useCallback } from "react";
88
+ import React3, { forwardRef as forwardRef2, useCallback, useEffect, useMemo, useState } from "react";
90
89
  import { useForwardedRef, useIsFocused } from "@dxos/react-hooks";
91
- var PinInput = /* @__PURE__ */ forwardRef2(({ __inputScope, segmentClassName, inputClassName, segmentPadding = "8px", segmentHeight = "100%", ...props }, forwardedRef) => {
90
+ var PinInput = /* @__PURE__ */ forwardRef2(({ __inputScope, className, disabled, segmentClassName, length = 6, pattern, value: controlledValue, onChange, onPaste, ...props }, forwardedRef) => {
92
91
  const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
93
- const width = getSegmentCssWidth(segmentPadding);
94
92
  const inputRef = useForwardedRef(forwardedRef);
95
93
  const inputFocused = useIsFocused(inputRef);
96
- const renderSegment = useCallback(({ state, index }) => /* @__PURE__ */ React3.createElement("div", {
97
- key: index,
98
- className: segmentClassName?.({
99
- focused: !!(inputFocused && state),
100
- validationValence
101
- }),
102
- "data-state": state,
103
- style: {
104
- width,
105
- height: segmentHeight
94
+ const [internalValue, setInternalValue] = useState("");
95
+ const [cursorPosition, setCursorPosition] = useState(0);
96
+ const value = controlledValue != null ? String(controlledValue) : internalValue;
97
+ const charPattern = useMemo(() => {
98
+ if (!pattern) {
99
+ return void 0;
100
+ }
101
+ try {
102
+ const base = pattern.replace(/[*+?]$|\{\d+,?\d*\}$/g, "");
103
+ return new RegExp(`^${base}$`);
104
+ } catch {
105
+ return void 0;
106
106
  }
107
- }), [
108
- segmentClassName,
109
- inputFocused,
110
- validationValence
107
+ }, [
108
+ pattern
111
109
  ]);
112
- return /* @__PURE__ */ React3.createElement(CodeInput, {
113
- padding: "8px",
114
- spacing: "8px",
115
- fontFamily: "",
116
- spellCheck: false,
117
- length: 6,
118
- ...props,
110
+ const filterValue = useCallback((input) => {
111
+ if (!charPattern) {
112
+ return input;
113
+ }
114
+ return input.split("").filter((char) => charPattern.test(char)).join("");
115
+ }, [
116
+ charPattern
117
+ ]);
118
+ const syncCursor = useCallback(() => {
119
+ const pos = inputRef.current?.selectionStart ?? value.length;
120
+ setCursorPosition(Math.min(pos, value.length));
121
+ }, [
122
+ inputRef,
123
+ value.length
124
+ ]);
125
+ useEffect(() => {
126
+ setCursorPosition((prev) => Math.min(prev, value.length));
127
+ }, [
128
+ value.length
129
+ ]);
130
+ const handleChange = useCallback((event) => {
131
+ const newValue = filterValue(event.target.value).slice(0, length);
132
+ if (controlledValue == null) {
133
+ setInternalValue(newValue);
134
+ }
135
+ setCursorPosition(event.target.selectionStart ?? newValue.length);
136
+ onChange?.(event);
137
+ }, [
138
+ length,
139
+ controlledValue,
140
+ onChange,
141
+ filterValue
142
+ ]);
143
+ const handlePaste = useCallback((event) => {
144
+ onPaste?.(event);
145
+ if (event.defaultPrevented) {
146
+ return;
147
+ }
148
+ event.preventDefault();
149
+ const pasted = filterValue(event.clipboardData.getData("text/plain")).slice(0, length);
150
+ const input = inputRef.current;
151
+ if (!input) {
152
+ return;
153
+ }
154
+ const nativeInputValueSetter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
155
+ nativeInputValueSetter?.call(input, pasted);
156
+ input.dispatchEvent(new Event("input", {
157
+ bubbles: true
158
+ }));
159
+ }, [
160
+ length,
161
+ inputRef,
162
+ onPaste,
163
+ filterValue
164
+ ]);
165
+ const handleKeyDown = useCallback((event) => {
166
+ if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
167
+ requestAnimationFrame(syncCursor);
168
+ } else if (event.key === "Backspace" && value.length === 0) {
169
+ event.preventDefault();
170
+ } else if (event.key.length === 1 && !event.metaKey && !event.ctrlKey && !event.altKey) {
171
+ if (charPattern && !charPattern.test(event.key)) {
172
+ event.preventDefault();
173
+ props.onKeyDown?.(event);
174
+ return;
175
+ }
176
+ const input = inputRef.current;
177
+ const pos = input?.selectionStart ?? value.length;
178
+ if (pos < value.length && input) {
179
+ event.preventDefault();
180
+ const newValue = value.slice(0, pos) + event.key + value.slice(pos + 1);
181
+ const newPos = Math.min(pos + 1, length);
182
+ if (controlledValue == null) {
183
+ setInternalValue(newValue);
184
+ }
185
+ setCursorPosition(newPos);
186
+ const nativeInputValueSetter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
187
+ nativeInputValueSetter?.call(input, newValue);
188
+ input.setSelectionRange(newPos, newPos);
189
+ onChange?.({
190
+ target: input,
191
+ currentTarget: input
192
+ });
193
+ }
194
+ }
195
+ props.onKeyDown?.(event);
196
+ }, [
197
+ value,
198
+ length,
199
+ props.onKeyDown,
200
+ syncCursor,
201
+ inputRef,
202
+ charPattern,
203
+ controlledValue,
204
+ onChange
205
+ ]);
206
+ const handleSelect = useCallback(() => {
207
+ syncCursor();
208
+ }, [
209
+ syncCursor
210
+ ]);
211
+ const activeIndex = Math.min(cursorPosition, value.length < length ? value.length : length - 1);
212
+ return /* @__PURE__ */ React3.createElement("div", {
213
+ className: `relative inline-flex items-center gap-2 ${className ?? ""}`
214
+ }, /* @__PURE__ */ React3.createElement("input", {
215
+ ref: inputRef,
119
216
  id,
217
+ type: "text",
218
+ value,
219
+ onChange: handleChange,
220
+ onPaste: handlePaste,
221
+ onKeyDown: handleKeyDown,
222
+ onSelect: handleSelect,
223
+ maxLength: length,
224
+ disabled,
225
+ spellCheck: false,
120
226
  "aria-describedby": descriptionId,
121
227
  ...validationValence === "error" && {
122
228
  "aria-invalid": "true",
123
229
  "aria-errormessage": errorMessageId
124
230
  },
125
- inputRef,
126
- renderSegment,
127
- className: inputClassName
128
- });
231
+ ...props,
232
+ pattern,
233
+ className: "absolute inset-0 opacity-0 w-full h-full",
234
+ style: {
235
+ caretColor: "transparent",
236
+ ...props.style
237
+ }
238
+ }), Array.from({
239
+ length
240
+ }, (_, index) => {
241
+ const char = value[index] || "\xA0";
242
+ const isCursor = !!(inputFocused && index === activeIndex);
243
+ return /* @__PURE__ */ React3.createElement("div", {
244
+ key: index,
245
+ className: segmentClassName,
246
+ ...isCursor && {
247
+ "data-focused": ""
248
+ },
249
+ "aria-hidden": "true"
250
+ }, char);
251
+ }));
129
252
  });
130
253
 
131
254
  // src/TextInput.tsx
@@ -168,7 +291,6 @@ export {
168
291
  InputRoot,
169
292
  Label,
170
293
  PinInput,
171
- InputRoot as Root,
172
294
  TextArea,
173
295
  TextInput,
174
296
  Validation,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/InputMeta.tsx", "../../../src/Root.tsx", "../../../src/PinInput.tsx", "../../../src/TextInput.tsx", "../../../src/TextArea.tsx"],
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, { type ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { INPUT_NAME, type 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, type Scope } from '@radix-ui/react-context';\nimport React, { type 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, { type ComponentProps, type ComponentPropsWithRef, forwardRef, useCallback } from 'react';\n\nimport { useForwardedRef, useIsFocused } from '@dxos/react-hooks';\n\nimport { INPUT_NAME, type InputScopedProps, useInputContext, type 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 = '8px',\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, { type ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { INPUT_NAME, type 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, { type ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { INPUT_NAME, type 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,UAAqCC,kBAAkB;;;ACF9D,SAASC,0BAAsC;AAC/C,OAA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A,mBAAkB;AAM9D,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"]
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, { type ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { INPUT_NAME, type 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 Comp = asChild ? Slot : Primitive.label;\n return (\n <Comp {...props} htmlFor={id} ref={forwardedRef}>\n {children}\n </Comp>\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 Comp = asChild ? Slot : Primitive.span;\n return (\n <Comp {...props} {...(validationValence === 'error' && { id: descriptionId })} ref={forwardedRef}>\n {children}\n </Comp>\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 Comp = asChild ? Slot : Primitive.span;\n return (\n <Comp {...props} id={errorMessageId} ref={forwardedRef}>\n {children}\n </Comp>\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 Comp = asChild ? Slot : Primitive.span;\n return (\n <Comp {...otherProps} ref={forwardedRef}>\n {children}\n </Comp>\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 Comp = asChild ? Slot : Primitive.p;\n return (\n <Comp {...props} {...(validationValence !== 'error' && { id: descriptionId })} ref={forwardedRef}>\n {children}\n </Comp>\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 { type Scope, createContextScope } from '@radix-ui/react-context';\nimport React, { type 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, createInputScope, useInputContext, INPUT_NAME };\n\nexport type { Valence, InputRootProps, InputScopedProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, {\n type ChangeEvent,\n type ClipboardEvent,\n type ComponentPropsWithRef,\n type KeyboardEvent,\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { useForwardedRef, useIsFocused } from '@dxos/react-hooks';\n\nimport { INPUT_NAME, type InputScopedProps, useInputContext } from './Root';\n\ntype PinInputProps = Omit<ComponentPropsWithRef<'input'>, 'type' | 'maxLength'> & {\n /** Class name applied to each segment div. */\n segmentClassName?: string;\n /** Number of code segments. */\n length?: number;\n};\n\nconst PinInput = forwardRef<HTMLInputElement, PinInputProps>(\n (\n {\n __inputScope,\n className,\n disabled,\n segmentClassName,\n length = 6,\n pattern,\n value: controlledValue,\n onChange,\n onPaste,\n ...props\n }: InputScopedProps<PinInputProps>,\n forwardedRef,\n ) => {\n const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);\n const inputRef = useForwardedRef(forwardedRef);\n const inputFocused = useIsFocused(inputRef);\n const [internalValue, setInternalValue] = useState('');\n const [cursorPosition, setCursorPosition] = useState(0);\n\n const value = controlledValue != null ? String(controlledValue) : internalValue;\n\n // Derive a per-character filter from the `pattern` prop (e.g., `\\\\d*` → test each char against `\\\\d`).\n const charPattern = useMemo(() => {\n if (!pattern) {\n return undefined;\n }\n try {\n // Strip quantifiers (*, +, {n}) to get the base character class.\n const base = pattern.replace(/[*+?]$|\\{\\d+,?\\d*\\}$/g, '');\n return new RegExp(`^${base}$`);\n } catch {\n return undefined;\n }\n }, [pattern]);\n\n /** Filter a string to only characters matching the pattern. */\n const filterValue = useCallback(\n (input: string) => {\n if (!charPattern) {\n return input;\n }\n return input\n .split('')\n .filter((char) => charPattern.test(char))\n .join('');\n },\n [charPattern],\n );\n\n // Sync cursor position from the hidden input's selection.\n const syncCursor = useCallback(() => {\n const pos = inputRef.current?.selectionStart ?? value.length;\n setCursorPosition(Math.min(pos, value.length));\n }, [inputRef, value.length]);\n\n // Keep cursor in sync after value changes.\n useEffect(() => {\n setCursorPosition((prev) => Math.min(prev, value.length));\n }, [value.length]);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const newValue = filterValue(event.target.value).slice(0, length);\n if (controlledValue == null) {\n setInternalValue(newValue);\n }\n setCursorPosition(event.target.selectionStart ?? newValue.length);\n onChange?.(event);\n },\n [length, controlledValue, onChange, filterValue],\n );\n\n const handlePaste = useCallback(\n (event: ClipboardEvent<HTMLInputElement>) => {\n onPaste?.(event);\n if (event.defaultPrevented) {\n return;\n }\n event.preventDefault();\n const pasted = filterValue(event.clipboardData.getData('text/plain')).slice(0, length);\n const input = inputRef.current;\n if (!input) {\n return;\n }\n // Use native setter to trigger React's synthetic onChange.\n const nativeInputValueSetter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set;\n nativeInputValueSetter?.call(input, pasted);\n input.dispatchEvent(new Event('input', { bubbles: true }));\n },\n [length, inputRef, onPaste, filterValue],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\n // Let the native input handle cursor movement, then sync.\n requestAnimationFrame(syncCursor);\n } else if (event.key === 'Backspace' && value.length === 0) {\n event.preventDefault();\n } else if (event.key.length === 1 && !event.metaKey && !event.ctrlKey && !event.altKey) {\n // Reject characters that don't match the allow pattern.\n if (charPattern && !charPattern.test(event.key)) {\n event.preventDefault();\n props.onKeyDown?.(event);\n return;\n }\n // Overwrite mode: replace character at cursor position instead of inserting.\n const input = inputRef.current;\n const pos = input?.selectionStart ?? value.length;\n if (pos < value.length && input) {\n event.preventDefault();\n const newValue = value.slice(0, pos) + event.key + value.slice(pos + 1);\n const newPos = Math.min(pos + 1, length);\n // Update state and cursor synchronously to avoid flicker.\n if (controlledValue == null) {\n setInternalValue(newValue);\n }\n setCursorPosition(newPos);\n // Sync the native input to match.\n const nativeInputValueSetter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set;\n nativeInputValueSetter?.call(input, newValue);\n input.setSelectionRange(newPos, newPos);\n // Notify consumer via onChange with a synthetic-like event.\n onChange?.({ target: input, currentTarget: input } as ChangeEvent<HTMLInputElement>);\n }\n }\n props.onKeyDown?.(event);\n },\n [value, length, props.onKeyDown, syncCursor, inputRef, charPattern, controlledValue, onChange],\n );\n\n const handleSelect = useCallback(() => {\n syncCursor();\n }, [syncCursor]);\n\n const activeIndex = Math.min(cursorPosition, value.length < length ? value.length : length - 1);\n\n return (\n <div className={`relative inline-flex items-center gap-2 ${className ?? ''}`}>\n <input\n ref={inputRef}\n id={id}\n type='text'\n value={value}\n onChange={handleChange}\n onPaste={handlePaste}\n onKeyDown={handleKeyDown}\n onSelect={handleSelect}\n maxLength={length}\n disabled={disabled}\n spellCheck={false}\n aria-describedby={descriptionId}\n {...(validationValence === 'error' && {\n 'aria-invalid': 'true' as const,\n 'aria-errormessage': errorMessageId,\n })}\n {...props}\n pattern={pattern}\n className='absolute inset-0 opacity-0 w-full h-full'\n style={{\n caretColor: 'transparent',\n ...props.style,\n }}\n />\n {Array.from({ length }, (_, index) => {\n const char = value[index] || '\\u00A0';\n const isCursor = !!(inputFocused && index === activeIndex);\n return (\n <div key={index} className={segmentClassName} {...(isCursor && { 'data-focused': '' })} aria-hidden='true'>\n {char}\n </div>\n );\n })}\n </div>\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, { type ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { INPUT_NAME, type 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, { type ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { INPUT_NAME, type 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,UAAqCC,kBAAkB;;;ACF9D,SAAqBC,0BAA0B;AAC/C,OAAOC,WAAuC;AAE9C,SAASC,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putContext", "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", "Comp", "Slot", "Primitive", "label", "React", "htmlFor", "ref", "Description", "descriptionId", "validationValence", "span", "ErrorMessage", "errorMessageId", "Validation", "otherProps", "DescriptionAndValidation", "p", "React", "forwardRef", "useCallback", "useEffect", "useMemo", "useState", "useForwardedRef", "useIsFocused", "PinInput", "forwardRef", "__inputScope", "className", "disabled", "segmentClassName", "length", "pattern", "value", "controlledValue", "onChange", "onPaste", "props", "forwardedRef", "id", "validationValence", "descriptionId", "errorMessageId", "useInputContext", "INPUT_NAME", "inputRef", "useForwardedRef", "inputFocused", "useIsFocused", "internalValue", "setInternalValue", "useState", "cursorPosition", "setCursorPosition", "String", "charPattern", "useMemo", "undefined", "base", "replace", "RegExp", "filterValue", "useCallback", "input", "split", "filter", "char", "test", "join", "syncCursor", "pos", "current", "selectionStart", "Math", "min", "useEffect", "prev", "handleChange", "event", "newValue", "target", "slice", "handlePaste", "defaultPrevented", "preventDefault", "pasted", "clipboardData", "getData", "nativeInputValueSetter", "Object", "getOwnPropertyDescriptor", "HTMLInputElement", "prototype", "set", "call", "dispatchEvent", "Event", "bubbles", "handleKeyDown", "key", "requestAnimationFrame", "metaKey", "ctrlKey", "altKey", "onKeyDown", "newPos", "setSelectionRange", "currentTarget", "handleSelect", "activeIndex", "React", "div", "ref", "type", "onSelect", "maxLength", "spellCheck", "aria-describedby", "style", "caretColor", "Array", "from", "_", "index", "isCursor", "aria-hidden", "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":{"src/Root.tsx":{"bytes":4670,"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}],"format":"esm"},"src/InputMeta.tsx":{"bytes":10082,"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":"src/Root.tsx","kind":"import-statement","original":"./Root"}],"format":"esm"},"src/PinInput.tsx":{"bytes":6990,"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":"src/Root.tsx","kind":"import-statement","original":"./Root"}],"format":"esm"},"src/TextInput.tsx":{"bytes":3197,"imports":[{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/Root.tsx","kind":"import-statement","original":"./Root"}],"format":"esm"},"src/TextArea.tsx":{"bytes":2962,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/Root.tsx","kind":"import-statement","original":"./Root"}],"format":"esm"},"src/index.ts":{"bytes":811,"imports":[{"path":"src/InputMeta.tsx","kind":"import-statement","original":"./InputMeta"},{"path":"src/Root.tsx","kind":"import-statement","original":"./Root"},{"path":"src/PinInput.tsx","kind":"import-statement","original":"./PinInput"},{"path":"src/TextInput.tsx","kind":"import-statement","original":"./TextInput"},{"path":"src/TextArea.tsx","kind":"import-statement","original":"./TextArea"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15009},"dist/lib/node-esm/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":"src/index.ts","inputs":{"src/InputMeta.tsx":{"bytesInOutput":2282},"src/Root.tsx":{"bytesInOutput":875},"src/index.ts":{"bytesInOutput":0},"src/PinInput.tsx":{"bytesInOutput":1427},"src/TextInput.tsx":{"bytesInOutput":610},"src/TextArea.tsx":{"bytesInOutput":534}},"bytes":6197}}}
1
+ {"inputs":{"src/Root.tsx":{"bytes":4601,"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}],"format":"esm"},"src/InputMeta.tsx":{"bytes":10088,"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":"src/Root.tsx","kind":"import-statement","original":"./Root"}],"format":"esm"},"src/PinInput.tsx":{"bytes":24086,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/Root.tsx","kind":"import-statement","original":"./Root"}],"format":"esm"},"src/TextInput.tsx":{"bytes":3203,"imports":[{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/Root.tsx","kind":"import-statement","original":"./Root"}],"format":"esm"},"src/TextArea.tsx":{"bytes":2968,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/Root.tsx","kind":"import-statement","original":"./Root"}],"format":"esm"},"src/index.ts":{"bytes":817,"imports":[{"path":"src/InputMeta.tsx","kind":"import-statement","original":"./InputMeta"},{"path":"src/Root.tsx","kind":"import-statement","original":"./Root"},{"path":"src/PinInput.tsx","kind":"import-statement","original":"./PinInput"},{"path":"src/TextInput.tsx","kind":"import-statement","original":"./TextInput"},{"path":"src/TextArea.tsx","kind":"import-statement","original":"./TextArea"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23730},"dist/lib/node-esm/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":"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","TextArea","TextInput","Validation","createInputScope","useInputContext"],"entryPoint":"src/index.ts","inputs":{"src/InputMeta.tsx":{"bytesInOutput":2282},"src/Root.tsx":{"bytesInOutput":875},"src/index.ts":{"bytesInOutput":0},"src/PinInput.tsx":{"bytesInOutput":5237},"src/TextInput.tsx":{"bytesInOutput":610},"src/TextArea.tsx":{"bytesInOutput":534}},"bytes":9986}}}
@@ -1,14 +1,9 @@
1
- import { CodeInput } from 'rci';
2
1
  import React, { type ComponentPropsWithRef } from 'react';
3
- import { type Valence } from './Root';
4
- type PinInputProps = Omit<ComponentPropsWithRef<typeof CodeInput>, 'id' | 'className' | 'inputRef' | 'renderSegment'> & {
5
- inputClassName?: string;
6
- segmentClassName?: (styleProps: {
7
- focused: boolean;
8
- validationValence: Valence;
9
- }) => string;
10
- segmentPadding?: string;
11
- segmentHeight?: string;
2
+ type PinInputProps = Omit<ComponentPropsWithRef<'input'>, 'type' | 'maxLength'> & {
3
+ /** Class name applied to each segment div. */
4
+ segmentClassName?: string;
5
+ /** Number of code segments. */
6
+ length?: number;
12
7
  };
13
8
  declare const PinInput: React.ForwardRefExoticComponent<Omit<PinInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
14
9
  export { PinInput };
@@ -1 +1 @@
1
- {"version":3,"file":"PinInput.d.ts","sourceRoot":"","sources":["../../../src/PinInput.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAsB,MAAM,KAAK,CAAC;AACpD,OAAO,KAAK,EAAE,EAAuB,KAAK,qBAAqB,EAA2B,MAAM,OAAO,CAAC;AAIxG,OAAO,EAAsD,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE1F,KAAK,aAAa,GAAG,IAAI,CACvB,qBAAqB,CAAC,OAAO,SAAS,CAAC,EACvC,IAAI,GAAG,WAAW,GAAG,UAAU,GAAG,eAAe,CAClD,GAAG;IACF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,iBAAiB,EAAE,OAAO,CAAA;KAAE,KAAK,MAAM,CAAC;IAC5F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,QAAA,MAAM,QAAQ,qGAsDb,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"PinInput.d.ts","sourceRoot":"","sources":["../../../src/PinInput.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAGZ,KAAK,qBAAqB,EAO3B,MAAM,OAAO,CAAC;AAMf,KAAK,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,GAAG;IAChF,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,QAAA,MAAM,QAAQ,qGAmLb,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
@@ -23,6 +23,6 @@ declare const InputRoot: {
23
23
  ({ __inputScope, id: propsId, descriptionId: propsDescriptionId, errorMessageId: propsErrorMessageId, validationValence, children, }: InputScopedProps<InputRootProps>): React.JSX.Element;
24
24
  displayName: string;
25
25
  };
26
- export { InputRoot, InputRoot as Root, createInputScope, useInputContext, INPUT_NAME };
26
+ export { InputRoot, createInputScope, useInputContext, INPUT_NAME };
27
27
  export type { Valence, InputRootProps, InputScopedProps };
28
28
  //# sourceMappingURL=Root.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../../../src/Root.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAItD,QAAA,MAAM,UAAU,UAAU,CAAC;AAE3B,KAAK,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAEpE,KAAK,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,YAAY,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAExD,KAAK,cAAc,GAAG,iBAAiB,CAAC;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,a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