@zag-js/pin-input 1.34.1 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,543 +1,10 @@
1
- import { createAnatomy } from '@zag-js/anatomy';
2
- import { raf, dispatchInputValueEvent, queryAll, isHTMLElement, isComposingEvent, isModifierKey, getEventKey, getNativeEvent, getBeforeInputValue, dataAttr, ariaAttr, visuallyHiddenStyle } from '@zag-js/dom-query';
3
- import { setValueAtIndex, isEqual, createSplitProps, invariant } from '@zag-js/utils';
4
- import { setup } from '@zag-js/core';
5
- import { createProps } from '@zag-js/types';
6
-
7
- // src/pin-input.anatomy.ts
8
- var anatomy = createAnatomy("pinInput").parts("root", "label", "input", "control");
9
- var parts = anatomy.build();
10
- var getRootId = (ctx) => ctx.ids?.root ?? `pin-input:${ctx.id}`;
11
- var getInputId = (ctx, id) => ctx.ids?.input?.(id) ?? `pin-input:${ctx.id}:${id}`;
12
- var getHiddenInputId = (ctx) => ctx.ids?.hiddenInput ?? `pin-input:${ctx.id}:hidden`;
13
- var getLabelId = (ctx) => ctx.ids?.label ?? `pin-input:${ctx.id}:label`;
14
- var getControlId = (ctx) => ctx.ids?.control ?? `pin-input:${ctx.id}:control`;
15
- var getRootEl = (ctx) => ctx.getById(getRootId(ctx));
16
- var getInputEls = (ctx) => {
17
- const ownerId = CSS.escape(getRootId(ctx));
18
- const selector = `input[data-ownedby=${ownerId}]`;
19
- return queryAll(getRootEl(ctx), selector);
1
+ // src/index.ts
2
+ import { anatomy } from "./pin-input.anatomy.mjs";
3
+ import { connect } from "./pin-input.connect.mjs";
4
+ import { machine } from "./pin-input.machine.mjs";
5
+ export * from "./pin-input.props.mjs";
6
+ export {
7
+ anatomy,
8
+ connect,
9
+ machine
20
10
  };
21
- var getInputElAtIndex = (ctx, index) => getInputEls(ctx)[index];
22
- var getFirstInputEl = (ctx) => getInputEls(ctx)[0];
23
- var getHiddenInputEl = (ctx) => ctx.getById(getHiddenInputId(ctx));
24
- var setInputValue = (inputEl, value) => {
25
- inputEl.value = value;
26
- inputEl.setAttribute("value", value);
27
- };
28
-
29
- // src/pin-input.utils.ts
30
- var REGEX = {
31
- numeric: /^[0-9]+$/,
32
- alphabetic: /^[A-Za-z]+$/,
33
- alphanumeric: /^[a-zA-Z0-9]+$/i
34
- };
35
- function isValidType(type, value) {
36
- if (!type) return true;
37
- return !!REGEX[type]?.test(value);
38
- }
39
- function isValidValue(value, type, pattern) {
40
- if (!pattern) return isValidType(type, value);
41
- const regex = new RegExp(pattern, "g");
42
- return regex.test(value);
43
- }
44
-
45
- // src/pin-input.connect.ts
46
- function connect(service, normalize) {
47
- const { send, context, computed, prop, scope } = service;
48
- const complete = computed("isValueComplete");
49
- const disabled = !!prop("disabled");
50
- const readOnly = !!prop("readOnly");
51
- const invalid = !!prop("invalid");
52
- const required = !!prop("required");
53
- const translations = prop("translations");
54
- const focusedIndex = context.get("focusedIndex");
55
- function focus() {
56
- getFirstInputEl(scope)?.focus();
57
- }
58
- return {
59
- focus,
60
- count: context.get("count"),
61
- items: Array.from({ length: context.get("count") }).map((_, i) => i),
62
- value: context.get("value"),
63
- valueAsString: computed("valueAsString"),
64
- complete,
65
- setValue(value) {
66
- if (!Array.isArray(value)) {
67
- invariant("[pin-input/setValue] value must be an array");
68
- }
69
- send({ type: "VALUE.SET", value });
70
- },
71
- clearValue() {
72
- send({ type: "VALUE.CLEAR" });
73
- },
74
- setValueAtIndex(index, value) {
75
- send({ type: "VALUE.SET", value, index });
76
- },
77
- getRootProps() {
78
- return normalize.element({
79
- dir: prop("dir"),
80
- ...parts.root.attrs,
81
- id: getRootId(scope),
82
- "data-invalid": dataAttr(invalid),
83
- "data-disabled": dataAttr(disabled),
84
- "data-complete": dataAttr(complete),
85
- "data-readonly": dataAttr(readOnly)
86
- });
87
- },
88
- getLabelProps() {
89
- return normalize.label({
90
- ...parts.label.attrs,
91
- dir: prop("dir"),
92
- htmlFor: getHiddenInputId(scope),
93
- id: getLabelId(scope),
94
- "data-invalid": dataAttr(invalid),
95
- "data-disabled": dataAttr(disabled),
96
- "data-complete": dataAttr(complete),
97
- "data-required": dataAttr(required),
98
- "data-readonly": dataAttr(readOnly),
99
- onClick(event) {
100
- event.preventDefault();
101
- focus();
102
- }
103
- });
104
- },
105
- getHiddenInputProps() {
106
- return normalize.input({
107
- "aria-hidden": true,
108
- type: "text",
109
- tabIndex: -1,
110
- id: getHiddenInputId(scope),
111
- readOnly,
112
- disabled,
113
- required,
114
- name: prop("name"),
115
- form: prop("form"),
116
- style: visuallyHiddenStyle,
117
- maxLength: computed("valueLength"),
118
- defaultValue: computed("valueAsString")
119
- });
120
- },
121
- getControlProps() {
122
- return normalize.element({
123
- ...parts.control.attrs,
124
- dir: prop("dir"),
125
- id: getControlId(scope)
126
- });
127
- },
128
- getInputProps(props2) {
129
- const { index } = props2;
130
- const inputType = prop("type") === "numeric" ? "tel" : "text";
131
- return normalize.input({
132
- ...parts.input.attrs,
133
- dir: prop("dir"),
134
- disabled,
135
- "data-disabled": dataAttr(disabled),
136
- "data-complete": dataAttr(complete),
137
- id: getInputId(scope, index.toString()),
138
- "data-index": index,
139
- "data-ownedby": getRootId(scope),
140
- "aria-label": translations?.inputLabel?.(index, computed("valueLength")),
141
- inputMode: prop("otp") || prop("type") === "numeric" ? "numeric" : "text",
142
- "aria-invalid": ariaAttr(invalid),
143
- "data-invalid": dataAttr(invalid),
144
- type: prop("mask") ? "password" : inputType,
145
- defaultValue: context.get("value")[index] || "",
146
- readOnly,
147
- autoCapitalize: "none",
148
- autoComplete: prop("otp") ? "one-time-code" : "off",
149
- placeholder: focusedIndex === index ? "" : prop("placeholder"),
150
- onPaste(event) {
151
- const pastedValue = event.clipboardData?.getData("text/plain");
152
- if (!pastedValue) return;
153
- const isValid = isValidValue(pastedValue, prop("type"), prop("pattern"));
154
- if (!isValid) {
155
- send({ type: "VALUE.INVALID", value: pastedValue });
156
- event.preventDefault();
157
- return;
158
- }
159
- event.preventDefault();
160
- send({ type: "INPUT.PASTE", value: pastedValue });
161
- },
162
- onBeforeInput(event) {
163
- try {
164
- const value = getBeforeInputValue(event);
165
- const isValid = isValidValue(value, prop("type"), prop("pattern"));
166
- if (!isValid) {
167
- send({ type: "VALUE.INVALID", value });
168
- event.preventDefault();
169
- }
170
- if (value.length > 1) {
171
- event.currentTarget.setSelectionRange(0, 1, "forward");
172
- }
173
- } catch {
174
- }
175
- },
176
- onChange(event) {
177
- const evt = getNativeEvent(event);
178
- const { value } = event.currentTarget;
179
- if (evt.inputType === "insertFromPaste") {
180
- event.currentTarget.value = value[0] || "";
181
- return;
182
- }
183
- if (value.length > 2) {
184
- send({ type: "INPUT.PASTE", value });
185
- event.currentTarget.value = value[0];
186
- event.preventDefault();
187
- return;
188
- }
189
- if (evt.inputType === "deleteContentBackward") {
190
- send({ type: "INPUT.BACKSPACE" });
191
- return;
192
- }
193
- send({ type: "INPUT.CHANGE", value, index });
194
- },
195
- onKeyDown(event) {
196
- if (event.defaultPrevented) return;
197
- if (isComposingEvent(event)) return;
198
- if (isModifierKey(event)) return;
199
- const keyMap = {
200
- Backspace() {
201
- send({ type: "INPUT.BACKSPACE" });
202
- },
203
- Delete() {
204
- send({ type: "INPUT.DELETE" });
205
- },
206
- ArrowLeft() {
207
- send({ type: "INPUT.ARROW_LEFT" });
208
- },
209
- ArrowRight() {
210
- send({ type: "INPUT.ARROW_RIGHT" });
211
- },
212
- Enter() {
213
- send({ type: "INPUT.ENTER" });
214
- }
215
- };
216
- const exec = keyMap[getEventKey(event, {
217
- dir: prop("dir"),
218
- orientation: "horizontal"
219
- })];
220
- if (exec) {
221
- exec(event);
222
- event.preventDefault();
223
- }
224
- },
225
- onFocus() {
226
- send({ type: "INPUT.FOCUS", index });
227
- },
228
- onBlur(event) {
229
- const target = event.relatedTarget;
230
- if (isHTMLElement(target) && target.dataset.ownedby === getRootId(scope)) return;
231
- send({ type: "INPUT.BLUR", index });
232
- }
233
- });
234
- }
235
- };
236
- }
237
- var { choose, createMachine } = setup();
238
- var machine = createMachine({
239
- props({ props: props2 }) {
240
- return {
241
- placeholder: "\u25CB",
242
- otp: false,
243
- type: "numeric",
244
- defaultValue: props2.count ? fill([], props2.count) : [],
245
- ...props2,
246
- translations: {
247
- inputLabel: (index, length) => `pin code ${index + 1} of ${length}`,
248
- ...props2.translations
249
- }
250
- };
251
- },
252
- initialState() {
253
- return "idle";
254
- },
255
- context({ prop, bindable }) {
256
- return {
257
- value: bindable(() => ({
258
- value: prop("value"),
259
- defaultValue: prop("defaultValue"),
260
- isEqual,
261
- onChange(value) {
262
- prop("onValueChange")?.({ value, valueAsString: value.join("") });
263
- }
264
- })),
265
- focusedIndex: bindable(() => ({
266
- sync: true,
267
- defaultValue: -1
268
- })),
269
- // TODO: Move this to `props` in next major version
270
- count: bindable(() => ({
271
- defaultValue: prop("count")
272
- }))
273
- };
274
- },
275
- computed: {
276
- _value: ({ context }) => fill(context.get("value"), context.get("count")),
277
- valueLength: ({ computed }) => computed("_value").length,
278
- filledValueLength: ({ computed }) => computed("_value").filter((v) => v?.trim() !== "").length,
279
- isValueComplete: ({ computed }) => computed("valueLength") === computed("filledValueLength"),
280
- valueAsString: ({ computed }) => computed("_value").join(""),
281
- focusedValue: ({ computed, context }) => computed("_value")[context.get("focusedIndex")] || ""
282
- },
283
- entry: choose([
284
- {
285
- guard: "autoFocus",
286
- actions: ["setInputCount", "setFocusIndexToFirst"]
287
- },
288
- { actions: ["setInputCount"] }
289
- ]),
290
- watch({ action, track, context, computed }) {
291
- track([() => context.get("focusedIndex")], () => {
292
- action(["focusInput", "selectInputIfNeeded"]);
293
- });
294
- track([() => context.get("value").join(",")], () => {
295
- action(["syncInputElements", "dispatchInputEvent"]);
296
- });
297
- track([() => computed("isValueComplete")], () => {
298
- action(["invokeOnComplete", "blurFocusedInputIfNeeded"]);
299
- });
300
- },
301
- on: {
302
- "VALUE.SET": [
303
- {
304
- guard: "hasIndex",
305
- actions: ["setValueAtIndex"]
306
- },
307
- { actions: ["setValue"] }
308
- ],
309
- "VALUE.CLEAR": {
310
- actions: ["clearValue", "setFocusIndexToFirst"]
311
- }
312
- },
313
- states: {
314
- idle: {
315
- on: {
316
- "INPUT.FOCUS": {
317
- target: "focused",
318
- actions: ["setFocusedIndex"]
319
- }
320
- }
321
- },
322
- focused: {
323
- on: {
324
- "INPUT.CHANGE": {
325
- actions: ["setFocusedValue", "syncInputValue", "setNextFocusedIndex"]
326
- },
327
- "INPUT.PASTE": {
328
- actions: ["setPastedValue", "setLastValueFocusIndex"]
329
- },
330
- "INPUT.FOCUS": {
331
- actions: ["setFocusedIndex"]
332
- },
333
- "INPUT.BLUR": {
334
- target: "idle",
335
- actions: ["clearFocusedIndex"]
336
- },
337
- "INPUT.DELETE": {
338
- guard: "hasValue",
339
- actions: ["clearFocusedValue"]
340
- },
341
- "INPUT.ARROW_LEFT": {
342
- actions: ["setPrevFocusedIndex"]
343
- },
344
- "INPUT.ARROW_RIGHT": {
345
- actions: ["setNextFocusedIndex"]
346
- },
347
- "INPUT.BACKSPACE": [
348
- {
349
- guard: "hasValue",
350
- actions: ["clearFocusedValue"]
351
- },
352
- {
353
- actions: ["setPrevFocusedIndex", "clearFocusedValue"]
354
- }
355
- ],
356
- "INPUT.ENTER": {
357
- guard: "isValueComplete",
358
- actions: ["requestFormSubmit"]
359
- },
360
- "VALUE.INVALID": {
361
- actions: ["invokeOnInvalid"]
362
- }
363
- }
364
- }
365
- },
366
- implementations: {
367
- guards: {
368
- autoFocus: ({ prop }) => !!prop("autoFocus"),
369
- hasValue: ({ context }) => context.get("value")[context.get("focusedIndex")] !== "",
370
- isValueComplete: ({ computed }) => computed("isValueComplete"),
371
- hasIndex: ({ event }) => event.index !== void 0
372
- },
373
- actions: {
374
- dispatchInputEvent({ computed, scope }) {
375
- const inputEl = getHiddenInputEl(scope);
376
- dispatchInputValueEvent(inputEl, { value: computed("valueAsString") });
377
- },
378
- setInputCount({ scope, context, prop }) {
379
- if (prop("count")) return;
380
- const inputEls = getInputEls(scope);
381
- context.set("count", inputEls.length);
382
- },
383
- focusInput({ context, scope }) {
384
- const focusedIndex = context.get("focusedIndex");
385
- if (focusedIndex === -1) return;
386
- getInputElAtIndex(scope, focusedIndex)?.focus({ preventScroll: true });
387
- },
388
- selectInputIfNeeded({ context, prop, scope }) {
389
- const focusedIndex = context.get("focusedIndex");
390
- if (!prop("selectOnFocus") || focusedIndex === -1) return;
391
- raf(() => {
392
- getInputElAtIndex(scope, focusedIndex)?.select();
393
- });
394
- },
395
- invokeOnComplete({ computed, prop }) {
396
- if (!computed("isValueComplete")) return;
397
- prop("onValueComplete")?.({
398
- value: computed("_value"),
399
- valueAsString: computed("valueAsString")
400
- });
401
- },
402
- invokeOnInvalid({ context, event, prop }) {
403
- prop("onValueInvalid")?.({
404
- value: event.value,
405
- index: context.get("focusedIndex")
406
- });
407
- },
408
- clearFocusedIndex({ context }) {
409
- context.set("focusedIndex", -1);
410
- },
411
- setFocusedIndex({ context, event }) {
412
- context.set("focusedIndex", event.index);
413
- },
414
- setValue({ context, event }) {
415
- const value = fill(event.value, context.get("count"));
416
- context.set("value", value);
417
- },
418
- setFocusedValue({ context, event, computed, flush }) {
419
- const focusedValue = computed("focusedValue");
420
- const focusedIndex = context.get("focusedIndex");
421
- const value = getNextValue(focusedValue, event.value);
422
- flush(() => {
423
- context.set("value", setValueAtIndex(computed("_value"), focusedIndex, value));
424
- });
425
- },
426
- revertInputValue({ context, computed, scope }) {
427
- const inputEl = getInputElAtIndex(scope, context.get("focusedIndex"));
428
- setInputValue(inputEl, computed("focusedValue"));
429
- },
430
- syncInputValue({ context, event, scope }) {
431
- const value = context.get("value");
432
- const inputEl = getInputElAtIndex(scope, event.index);
433
- setInputValue(inputEl, value[event.index]);
434
- },
435
- syncInputElements({ context, scope }) {
436
- const inputEls = getInputEls(scope);
437
- const value = context.get("value");
438
- inputEls.forEach((inputEl, index) => {
439
- setInputValue(inputEl, value[index]);
440
- });
441
- },
442
- setPastedValue({ context, event, computed, flush }) {
443
- raf(() => {
444
- const valueAsString = computed("valueAsString");
445
- const focusedIndex = context.get("focusedIndex");
446
- const valueLength = computed("valueLength");
447
- const filledValueLength = computed("filledValueLength");
448
- const startIndex = Math.min(focusedIndex, filledValueLength);
449
- const left = startIndex > 0 ? valueAsString.substring(0, focusedIndex) : "";
450
- const right = event.value.substring(0, valueLength - startIndex);
451
- const value = fill(`${left}${right}`.split(""), valueLength);
452
- flush(() => {
453
- context.set("value", value);
454
- });
455
- });
456
- },
457
- setValueAtIndex({ context, event, computed }) {
458
- const nextValue = getNextValue(computed("focusedValue"), event.value);
459
- context.set("value", setValueAtIndex(computed("_value"), event.index, nextValue));
460
- },
461
- clearValue({ context }) {
462
- const nextValue = Array.from({ length: context.get("count") }).fill("");
463
- queueMicrotask(() => {
464
- context.set("value", nextValue);
465
- });
466
- },
467
- clearFocusedValue({ context, computed }) {
468
- const focusedIndex = context.get("focusedIndex");
469
- if (focusedIndex === -1) return;
470
- context.set("value", setValueAtIndex(computed("_value"), focusedIndex, ""));
471
- },
472
- setFocusIndexToFirst({ context }) {
473
- context.set("focusedIndex", 0);
474
- },
475
- setNextFocusedIndex({ context, computed }) {
476
- context.set("focusedIndex", Math.min(context.get("focusedIndex") + 1, computed("valueLength") - 1));
477
- },
478
- setPrevFocusedIndex({ context }) {
479
- context.set("focusedIndex", Math.max(context.get("focusedIndex") - 1, 0));
480
- },
481
- setLastValueFocusIndex({ context, computed }) {
482
- raf(() => {
483
- context.set("focusedIndex", Math.min(computed("filledValueLength"), computed("valueLength") - 1));
484
- });
485
- },
486
- blurFocusedInputIfNeeded({ context, prop, scope }) {
487
- if (!prop("blurOnComplete")) return;
488
- raf(() => {
489
- getInputElAtIndex(scope, context.get("focusedIndex"))?.blur();
490
- });
491
- },
492
- requestFormSubmit({ computed, prop, scope }) {
493
- if (!prop("name") || !computed("isValueComplete")) return;
494
- const inputEl = getHiddenInputEl(scope);
495
- inputEl?.form?.requestSubmit();
496
- }
497
- }
498
- }
499
- });
500
- function getNextValue(current, next) {
501
- let nextValue = next;
502
- if (current[0] === next[0]) {
503
- nextValue = next[1];
504
- } else if (current[0] === next[1]) {
505
- nextValue = next[0];
506
- }
507
- const chars = nextValue.split("");
508
- nextValue = chars[chars.length - 1];
509
- return nextValue ?? "";
510
- }
511
- function fill(value, count) {
512
- return Array.from({ length: count }).fill("").map((v, i) => value[i] || v);
513
- }
514
- var props = createProps()([
515
- "autoFocus",
516
- "blurOnComplete",
517
- "count",
518
- "defaultValue",
519
- "dir",
520
- "disabled",
521
- "form",
522
- "getRootNode",
523
- "id",
524
- "ids",
525
- "invalid",
526
- "mask",
527
- "name",
528
- "onValueChange",
529
- "onValueComplete",
530
- "onValueInvalid",
531
- "otp",
532
- "pattern",
533
- "placeholder",
534
- "readOnly",
535
- "required",
536
- "selectOnFocus",
537
- "translations",
538
- "type",
539
- "value"
540
- ]);
541
- var splitProps = createSplitProps(props);
542
-
543
- export { anatomy, connect, machine, props, splitProps };
@@ -0,0 +1,6 @@
1
+ import * as _zag_js_anatomy from '@zag-js/anatomy';
2
+
3
+ declare const anatomy: _zag_js_anatomy.AnatomyInstance<"root" | "label" | "input" | "control">;
4
+ declare const parts: Record<"root" | "label" | "input" | "control", _zag_js_anatomy.AnatomyPart>;
5
+
6
+ export { anatomy, parts };
@@ -0,0 +1,6 @@
1
+ import * as _zag_js_anatomy from '@zag-js/anatomy';
2
+
3
+ declare const anatomy: _zag_js_anatomy.AnatomyInstance<"root" | "label" | "input" | "control">;
4
+ declare const parts: Record<"root" | "label" | "input" | "control", _zag_js_anatomy.AnatomyPart>;
5
+
6
+ export { anatomy, parts };
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/pin-input.anatomy.ts
21
+ var pin_input_anatomy_exports = {};
22
+ __export(pin_input_anatomy_exports, {
23
+ anatomy: () => anatomy,
24
+ parts: () => parts
25
+ });
26
+ module.exports = __toCommonJS(pin_input_anatomy_exports);
27
+ var import_anatomy = require("@zag-js/anatomy");
28
+ var anatomy = (0, import_anatomy.createAnatomy)("pinInput").parts("root", "label", "input", "control");
29
+ var parts = anatomy.build();
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ anatomy,
33
+ parts
34
+ });
@@ -0,0 +1,8 @@
1
+ // src/pin-input.anatomy.ts
2
+ import { createAnatomy } from "@zag-js/anatomy";
3
+ var anatomy = createAnatomy("pinInput").parts("root", "label", "input", "control");
4
+ var parts = anatomy.build();
5
+ export {
6
+ anatomy,
7
+ parts
8
+ };
@@ -0,0 +1,7 @@
1
+ import { Service } from '@zag-js/core';
2
+ import { PropTypes, NormalizeProps } from '@zag-js/types';
3
+ import { PinInputSchema, PinInputApi } from './pin-input.types.mjs';
4
+
5
+ declare function connect<T extends PropTypes>(service: Service<PinInputSchema>, normalize: NormalizeProps<T>): PinInputApi<T>;
6
+
7
+ export { connect };
@@ -0,0 +1,7 @@
1
+ import { Service } from '@zag-js/core';
2
+ import { PropTypes, NormalizeProps } from '@zag-js/types';
3
+ import { PinInputSchema, PinInputApi } from './pin-input.types.js';
4
+
5
+ declare function connect<T extends PropTypes>(service: Service<PinInputSchema>, normalize: NormalizeProps<T>): PinInputApi<T>;
6
+
7
+ export { connect };