@mirohq/design-system-input 0.0.1-input.0 → 0.0.1

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/main.js CHANGED
@@ -4,36 +4,406 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
- var designSystemBaseInput = require('@mirohq/design-system-base-input');
8
- var designSystemIconButton = require('@mirohq/design-system-icon-button');
9
- var designSystemIcons = require('@mirohq/design-system-icons');
10
7
  var designSystemUtils = require('@mirohq/design-system-utils');
8
+ var designSystemBaseIcon = require('@mirohq/design-system-base-icon');
11
9
  var designSystemStitches = require('@mirohq/design-system-stitches');
10
+ var designSystemPrimitive = require('@mirohq/design-system-primitive');
11
+ var designSystemTooltip = require('@mirohq/design-system-tooltip');
12
+ var designSystemBaseButton = require('@mirohq/design-system-base-button');
13
+ var designSystemStyles = require('@mirohq/design-system-styles');
14
+ var designSystemIcons = require('@mirohq/design-system-icons');
15
+ var interactions = require('@react-aria/interactions');
16
+ var designSystemBaseInput = require('@mirohq/design-system-base-input');
17
+ var utils = require('@react-aria/utils');
12
18
 
13
19
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
20
 
15
21
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
22
 
17
- const StyledBaseInput = designSystemStitches.styled(designSystemBaseInput.BaseInput, {
23
+ const StyledIconSlot = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
24
+ order: 1,
25
+ alignContent: "center",
26
+ display: "flex",
27
+ justifyContent: "center",
28
+ color: "$icon-neutrals-subtle",
29
+ "& svg, & img": {
30
+ pointerEvents: "none"
31
+ },
32
+ variants: {
33
+ disabled: {
34
+ true: {
35
+ "& svg": {
36
+ color: "$icon-neutrals-disabled"
37
+ }
38
+ }
39
+ }
40
+ }
41
+ });
42
+
43
+ const InputContext = React.createContext({
44
+ actionButtonRef: { current: null },
45
+ inputRef: { current: null },
46
+ setFocused: () => {
47
+ },
48
+ setHovered: () => {
49
+ },
50
+ setActive: () => {
51
+ }
52
+ });
53
+ const InputProvider = ({
54
+ children,
55
+ disabled,
56
+ ariaDisabled,
57
+ readOnly,
58
+ ...restProps
59
+ }) => {
60
+ const actionButtonRef = React.useRef(null);
61
+ const inputRef = React.useRef(null);
62
+ const [focused, setFocused] = React.useState(false);
63
+ const [hovered, setHovered] = React.useState(false);
64
+ const [active, setActive] = React.useState(false);
65
+ const editable = !designSystemUtils.booleanify(disabled) && !designSystemUtils.booleanify(ariaDisabled) && !designSystemUtils.booleanify(readOnly);
66
+ return /* @__PURE__ */ jsxRuntime.jsx(
67
+ InputContext.Provider,
68
+ {
69
+ value: {
70
+ ...restProps,
71
+ setFocused,
72
+ setHovered,
73
+ setActive,
74
+ active,
75
+ hovered,
76
+ focused,
77
+ disabled,
78
+ ariaDisabled,
79
+ readOnly,
80
+ editable,
81
+ inputRef,
82
+ actionButtonRef
83
+ },
84
+ children
85
+ }
86
+ );
87
+ };
88
+ const useInputContext = () => React.useContext(InputContext);
89
+
90
+ const IconSlot = React__default["default"].forwardRef(({ children, ...restProps }, forwardRef) => {
91
+ const { ariaDisabled, disabled } = useInputContext();
92
+ const formattedChildren = designSystemUtils.addPropsToChildren(children, designSystemBaseIcon.isIconComponent, {
93
+ size: "small",
94
+ weight: "thin",
95
+ "aria-hidden": true
96
+ });
97
+ return /* @__PURE__ */ jsxRuntime.jsx(
98
+ StyledIconSlot,
99
+ {
100
+ ...restProps,
101
+ disabled: designSystemUtils.booleanify(disabled != null ? disabled : ariaDisabled),
102
+ ref: forwardRef,
103
+ children: formattedChildren
104
+ }
105
+ );
106
+ });
107
+
108
+ const StyledActionButton = designSystemStitches.styled(designSystemBaseButton.BaseButton, {
109
+ backgroundColor: "transparent",
110
+ color: "$icon-neutrals-subtle",
111
+ display: "flex",
112
+ justifyContent: "center",
113
+ order: 3,
114
+ padding: "6px",
115
+ square: "$7",
116
+ "& svg:not([data-icon-component]), & img:not([data-icon-component])": {
117
+ square: "$icon-200",
118
+ "--svg-stroke-width": "$stroke-width$thin"
119
+ },
120
+ ...designSystemStyles.focus.css({
121
+ boxShadow: "$focus-small"
122
+ }),
123
+ "&:hover": {
124
+ backgroundColor: "$background-neutrals-subtle-hover"
125
+ },
126
+ "&:active, &[data-pressed]": {
127
+ backgroundColor: "$background-neutrals-subtle-active"
128
+ },
129
+ variants: {
130
+ readOnlyAppearance: {
131
+ true: {
132
+ "& svg[data-icon-component], & img[data-icon-component]": {
133
+ color: "$icon-neutrals-subtle"
134
+ }
135
+ }
136
+ },
137
+ disableAppearance: {
138
+ true: {
139
+ color: "$icon-neutrals-disabled"
140
+ }
141
+ }
142
+ }
143
+ });
144
+
145
+ const ActionButton = React__default["default"].forwardRef(({ "aria-label": ariaLabel, label, children, ...restProps }, forwardRef) => {
146
+ const {
147
+ valid,
148
+ hovered,
149
+ editable,
150
+ active,
151
+ ariaDisabled,
152
+ disabled,
153
+ readOnly,
154
+ actionButtonRef
155
+ } = useInputContext();
156
+ const showInputSlot = valid === void 0 || designSystemUtils.booleanify(hovered) || designSystemUtils.booleanify(active);
157
+ let formattedChildren = children;
158
+ formattedChildren = designSystemUtils.addPropsToChildren(children, designSystemBaseIcon.isIconComponent, {
159
+ "aria-hidden": true
160
+ });
161
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: showInputSlot && /* @__PURE__ */ jsxRuntime.jsxs(designSystemTooltip.Tooltip, { children: [
162
+ /* @__PURE__ */ jsxRuntime.jsx(designSystemTooltip.Tooltip.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
163
+ StyledActionButton,
164
+ {
165
+ ...restProps,
166
+ "aria-label": ariaLabel != null ? ariaLabel : label,
167
+ disabled: !designSystemUtils.booleanify(editable),
168
+ disableAppearance: designSystemUtils.booleanify(disabled) || designSystemUtils.booleanify(ariaDisabled),
169
+ readOnlyAppearance: readOnly,
170
+ ref: designSystemUtils.mergeRefs([forwardRef, actionButtonRef]),
171
+ children: formattedChildren
172
+ }
173
+ ) }),
174
+ /* @__PURE__ */ jsxRuntime.jsx(designSystemTooltip.Tooltip.Content, { children: label })
175
+ ] }) });
176
+ });
177
+
178
+ const ClearAction = ({
179
+ clearable,
180
+ clearLabel,
181
+ onClear,
182
+ inputRef,
183
+ value
184
+ }) => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: clearable && /* @__PURE__ */ jsxRuntime.jsx(
185
+ ActionButton,
186
+ {
187
+ label: clearLabel,
188
+ onPress: () => {
189
+ var _a;
190
+ onClear == null ? void 0 : onClear(value != null ? value : (_a = inputRef.current) == null ? void 0 : _a.value);
191
+ if (value === void 0 && inputRef.current !== null) {
192
+ inputRef.current.value = "";
193
+ }
194
+ },
195
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconCross, {})
196
+ }
197
+ ) });
198
+
199
+ const StyledIconExclamationPointCircle = designSystemStitches.styled(
200
+ designSystemIcons.IconExclamationPointCircle,
201
+ {
202
+ color: "$icon-danger"
203
+ }
204
+ );
205
+ const StyledIconCheckMark = designSystemStitches.styled(designSystemIcons.IconCheckMark, {
206
+ color: "$icon-success"
207
+ });
208
+ const StyledValidityBox = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
209
+ order: 3,
210
+ display: "flex",
211
+ alignItems: "center",
212
+ padding: "6px"
213
+ });
214
+ const StyledBaseInput = designSystemStitches.styled("div", {
215
+ alignItems: "center",
216
+ background: "$background-neutrals-container",
217
+ border: "1px solid $border-neutrals",
218
+ borderRadius: "$50",
219
+ display: "inline-flex",
220
+ height: "max-content",
221
+ justifyContent: "flex-end",
222
+ position: "relative",
223
+ verticalAlign: "middle",
224
+ boxSizing: "border-box",
225
+ width: "100%",
18
226
  variants: {
227
+ ...designSystemBaseInput.styles.variants,
19
228
  size: {
20
- medium: {
229
+ large: {
21
230
  height: "$10",
22
- padding: "$100"
231
+ padding: "0 $100 ",
232
+ ["& ".concat(StyledIconSlot)]: {
233
+ paddingRight: "$50"
234
+ },
235
+ ["& ".concat(StyledActionButton, ", & ").concat(StyledValidityBox)]: {
236
+ marginLeft: "$50"
237
+ },
238
+ ["& ".concat(StyledValidityBox)]: {
239
+ paddingRight: "6px"
240
+ }
23
241
  },
24
- large: {
242
+ "x-large": {
25
243
  height: "$12",
26
- padding: "$150"
244
+ padding: "0 $150",
245
+ ["& ".concat(StyledIconSlot)]: {
246
+ paddingRight: "$100"
247
+ },
248
+ ["& ".concat(StyledActionButton, ", & ").concat(StyledValidityBox)]: {
249
+ marginLeft: "$100"
250
+ },
251
+ ["& ".concat(StyledValidityBox)]: {
252
+ paddingRight: "6px"
253
+ }
27
254
  }
28
255
  }
29
256
  },
257
+ compoundVariants: designSystemBaseInput.styles.compoundVariants,
30
258
  defaultVariants: {
31
- size: "medium"
259
+ size: "large"
260
+ }
261
+ });
262
+
263
+ const disabledAndReadonlySelectors = ':read-only, :disabled, [aria-disabled="true"], [data-disabled]';
264
+ const StyledInput = designSystemStitches.styled(designSystemPrimitive.Primitive.input, {
265
+ all: "unset",
266
+ background: "transparent",
267
+ color: "$text-neutrals",
268
+ width: "100%",
269
+ borderRadius: "$50",
270
+ order: 2,
271
+ padding: "0 $50",
272
+ height: "100%",
273
+ "&::placeholder": {
274
+ fontStyle: "italic"
275
+ },
276
+ ["&:not(".concat(disabledAndReadonlySelectors, ")::placeholder")]: {
277
+ color: "$text-neutrals-subtle"
278
+ },
279
+ "&:read-only": {
280
+ color: "$text-neutrals-subtle"
281
+ },
282
+ "&:disabled, &[aria-disabled=true], &[data-disabled]": {
283
+ caretColor: "transparent",
284
+ "&, &::placeholder": {
285
+ color: "$text-neutrals-disabled"
286
+ },
287
+ "&:selection": {
288
+ background: "transparent"
289
+ }
290
+ }
291
+ });
292
+
293
+ const keyboardEventHandler = (e) => {
294
+ if (e.key !== "Tab") {
295
+ e.preventDefault();
32
296
  }
297
+ };
298
+ const Input$1 = React__default["default"].forwardRef((props, forwardRef) => {
299
+ const { ariaDisabled, disabled, readOnly, setFocused, inputRef } = useInputContext();
300
+ let elementProps = props;
301
+ if (designSystemUtils.booleanify(ariaDisabled)) {
302
+ elementProps = designSystemUtils.removeEventProps(props, [
303
+ "onFocus",
304
+ "onBlur",
305
+ "onPointerMove"
306
+ ]);
307
+ elementProps.onKeyDown = keyboardEventHandler;
308
+ elementProps.onKeyUp = keyboardEventHandler;
309
+ }
310
+ const onBlurEventHandler = () => {
311
+ setFocused == null ? void 0 : setFocused(false);
312
+ };
313
+ const onFocusEventHandler = () => {
314
+ setFocused == null ? void 0 : setFocused(true);
315
+ };
316
+ elementProps = utils.mergeProps(elementProps, {
317
+ onBlur: onBlurEventHandler,
318
+ onFocus: onFocusEventHandler
319
+ });
320
+ return /* @__PURE__ */ jsxRuntime.jsx(
321
+ StyledInput,
322
+ {
323
+ ...elementProps,
324
+ "aria-disabled": ariaDisabled,
325
+ disabled,
326
+ readOnly,
327
+ ref: designSystemUtils.mergeRefs([inputRef, forwardRef])
328
+ }
329
+ );
330
+ });
331
+
332
+ const Root = React__default["default"].forwardRef(({ children, ...restProps }, forwardRef) => {
333
+ const {
334
+ valid,
335
+ ariaDisabled,
336
+ disabled,
337
+ readOnly,
338
+ focused,
339
+ active,
340
+ setHovered,
341
+ setActive,
342
+ inputRef,
343
+ actionButtonRef
344
+ } = useInputContext();
345
+ const ref = React.useRef(null);
346
+ const { hoverProps, isHovered: hovered } = interactions.useHover({
347
+ onHoverChange: setHovered
348
+ });
349
+ const ariaDisabledOrDisabled = designSystemUtils.booleanify(ariaDisabled) || designSystemUtils.booleanify(disabled);
350
+ const showValidityIcon = !ariaDisabledOrDisabled && !designSystemUtils.booleanify(readOnly) && !designSystemUtils.booleanify(hovered) && !designSystemUtils.booleanify(focused) && !designSystemUtils.booleanify(active) && (valid === true || valid === false);
351
+ const ValidIcon = valid === true ? StyledIconCheckMark : StyledIconExclamationPointCircle;
352
+ return /* @__PURE__ */ jsxRuntime.jsxs(
353
+ StyledBaseInput,
354
+ {
355
+ ...restProps,
356
+ ...hoverProps,
357
+ ref: designSystemUtils.mergeRefs([ref, forwardRef]),
358
+ hovered,
359
+ focused,
360
+ valid,
361
+ disabled: designSystemUtils.booleanify(disabled),
362
+ ariaDisabled: designSystemUtils.booleanify(ariaDisabled),
363
+ readOnly: designSystemUtils.booleanify(readOnly),
364
+ "data-invalid": valid === false ? "" : void 0,
365
+ "data-valid": valid === true ? "" : void 0,
366
+ onFocus: () => {
367
+ setActive(true);
368
+ },
369
+ onBlur: () => {
370
+ setTimeout(() => {
371
+ var _a;
372
+ if ((ref == null ? void 0 : ref.current) != null && !((_a = ref == null ? void 0 : ref.current) == null ? void 0 : _a.contains(document.activeElement))) {
373
+ setActive(false);
374
+ }
375
+ }, 0);
376
+ },
377
+ onClick: ({ target }) => {
378
+ var _a;
379
+ const shouldFocusInput = target !== actionButtonRef.current;
380
+ if (shouldFocusInput) {
381
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
382
+ }
383
+ },
384
+ children: [
385
+ children,
386
+ showValidityIcon && /* @__PURE__ */ jsxRuntime.jsx(StyledValidityBox, { children: /* @__PURE__ */ jsxRuntime.jsx(ValidIcon, { size: "small" }) })
387
+ ]
388
+ }
389
+ );
33
390
  });
391
+ const BaseInput = React__default["default"].forwardRef(
392
+ ({ "aria-disabled": ariaDisabled, disabled, valid, readOnly, ...restProps }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(
393
+ InputProvider,
394
+ {
395
+ valid,
396
+ disabled,
397
+ ariaDisabled,
398
+ readOnly,
399
+ children: /* @__PURE__ */ jsxRuntime.jsx(Root, { ...restProps, ref: forwardRef })
400
+ }
401
+ )
402
+ );
403
+ BaseInput.Input = Input$1;
34
404
 
35
- const InputText = React__default["default"].forwardRef(
36
- ({ value, css, ...restProps }, forwardRef) => {
405
+ const Input = React__default["default"].forwardRef(
406
+ ({ value, ...restProps }, forwardRef) => {
37
407
  const inputRef = React.useRef(null);
38
408
  const {
39
409
  clearable = false,
@@ -41,38 +411,54 @@ const InputText = React__default["default"].forwardRef(
41
411
  clearLabel,
42
412
  ...elementProps
43
413
  } = restProps;
44
- const inputCss = clearable ? {
45
- ...css != null ? css : {},
46
- paddingInlineEnd: "$500"
47
- } : {};
48
- return /* @__PURE__ */ jsxRuntime.jsx(
49
- StyledBaseInput,
414
+ const {
415
+ valid,
416
+ "aria-disabled": ariaDisabled,
417
+ readOnly,
418
+ disabled,
419
+ hovered,
420
+ focused,
421
+ size,
422
+ children,
423
+ ...inputProps
424
+ } = elementProps;
425
+ return /* @__PURE__ */ jsxRuntime.jsxs(
426
+ BaseInput,
50
427
  {
51
- ...elementProps,
52
- value,
53
- ref: designSystemUtils.mergeRefs([inputRef, forwardRef]),
54
- css: inputCss,
55
- children: clearable && /* @__PURE__ */ jsxRuntime.jsx(designSystemBaseInput.BaseInput.InputSlot, { children: /* @__PURE__ */ jsxRuntime.jsx(
56
- designSystemIconButton.IconButton,
57
- {
58
- size: "medium",
59
- label: clearLabel,
60
- onPress: () => {
61
- var _a;
62
- onClear == null ? void 0 : onClear((_a = inputRef.current) == null ? void 0 : _a.value);
63
- if (value === void 0 && inputRef.current !== null) {
64
- inputRef.current.value = "";
65
- }
66
- },
67
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconCross, {})
68
- }
69
- ) })
428
+ disabled,
429
+ valid,
430
+ "aria-disabled": ariaDisabled,
431
+ readOnly,
432
+ hovered,
433
+ focused,
434
+ size,
435
+ children: [
436
+ /* @__PURE__ */ jsxRuntime.jsx(
437
+ BaseInput.Input,
438
+ {
439
+ ...inputProps,
440
+ value,
441
+ ref: designSystemUtils.mergeRefs([inputRef, forwardRef])
442
+ }
443
+ ),
444
+ children,
445
+ /* @__PURE__ */ jsxRuntime.jsx(
446
+ ClearAction,
447
+ {
448
+ clearable,
449
+ clearLabel,
450
+ onClear,
451
+ inputRef,
452
+ value
453
+ }
454
+ )
455
+ ]
70
456
  }
71
457
  );
72
458
  }
73
459
  );
74
-
75
- const Input = InputText;
460
+ Input.ActionButton = ActionButton;
461
+ Input.IconSlot = IconSlot;
76
462
 
77
463
  const InputPassword = React__default["default"].forwardRef(
78
464
  ({
@@ -83,49 +469,182 @@ const InputPassword = React__default["default"].forwardRef(
83
469
  onHide,
84
470
  hideLabel,
85
471
  revealLabel,
86
- css,
87
472
  ...restProps
88
473
  }, forwardRef) => {
89
474
  const inputRef = React.useRef(null);
90
475
  const [revealState, setRevealState] = React.useState(defaultReveal != null ? defaultReveal : false);
91
476
  const revealInternal = reveal != null ? reveal : revealState;
92
- return /* @__PURE__ */ jsxRuntime.jsx(
93
- StyledBaseInput,
477
+ const {
478
+ valid,
479
+ "aria-disabled": ariaDisabled,
480
+ readOnly,
481
+ disabled,
482
+ hovered,
483
+ focused,
484
+ size,
485
+ ...inputProps
486
+ } = restProps;
487
+ return /* @__PURE__ */ jsxRuntime.jsxs(
488
+ BaseInput,
94
489
  {
95
- ...restProps,
96
- type: revealInternal ? "text" : "password",
97
- value,
98
- ref: designSystemUtils.mergeRefs([inputRef, forwardRef]),
99
- css: {
100
- ...css != null ? css : {},
101
- paddingInlineEnd: "$500"
102
- },
103
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystemBaseInput.BaseInput.InputSlot, { children: /* @__PURE__ */ jsxRuntime.jsx(
104
- designSystemIconButton.IconButton,
105
- {
106
- size: "medium",
107
- onPress: () => {
108
- var _a;
109
- const valueInternal = value != null ? value : (_a = inputRef.current) == null ? void 0 : _a.value;
110
- if (revealInternal) {
111
- onHide == null ? void 0 : onHide(valueInternal);
112
- } else {
113
- onReveal == null ? void 0 : onReveal(valueInternal);
114
- }
115
- if (value === void 0) {
116
- setRevealState((reveal2) => !reveal2);
117
- }
118
- },
119
- label: revealInternal ? hideLabel : revealLabel,
120
- children: revealInternal ? /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconEyeOpen, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconEyeOpenSlash, {})
121
- }
122
- ) })
490
+ disabled,
491
+ valid,
492
+ "aria-disabled": ariaDisabled,
493
+ readOnly,
494
+ hovered,
495
+ focused,
496
+ size,
497
+ children: [
498
+ /* @__PURE__ */ jsxRuntime.jsx(
499
+ BaseInput.Input,
500
+ {
501
+ ...inputProps,
502
+ type: revealInternal ? "text" : "password",
503
+ value,
504
+ ref: designSystemUtils.mergeRefs([inputRef, forwardRef])
505
+ }
506
+ ),
507
+ /* @__PURE__ */ jsxRuntime.jsx(IconSlot, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconLockClosed, {}) }),
508
+ /* @__PURE__ */ jsxRuntime.jsx(
509
+ ActionButton,
510
+ {
511
+ label: revealInternal ? hideLabel : revealLabel,
512
+ onPress: () => {
513
+ var _a;
514
+ const valueInternal = value != null ? value : (_a = inputRef.current) == null ? void 0 : _a.value;
515
+ if (revealInternal) {
516
+ onHide == null ? void 0 : onHide(valueInternal);
517
+ } else {
518
+ onReveal == null ? void 0 : onReveal(valueInternal);
519
+ }
520
+ if (value === void 0) {
521
+ setRevealState((reveal2) => !reveal2);
522
+ }
523
+ },
524
+ children: revealInternal ? /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconEyeOpen, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconEyeClosed, {})
525
+ }
526
+ )
527
+ ]
123
528
  }
124
529
  );
125
530
  }
126
531
  );
127
532
 
533
+ const InputEmail = React__default["default"].forwardRef(({ value, ...restProps }, forwardRef) => {
534
+ const inputRef = React.useRef(null);
535
+ const {
536
+ clearable = false,
537
+ onClear,
538
+ clearLabel,
539
+ ...elementProps
540
+ } = restProps;
541
+ const {
542
+ valid,
543
+ "aria-disabled": ariaDisabled,
544
+ readOnly,
545
+ disabled,
546
+ hovered,
547
+ focused,
548
+ size,
549
+ children,
550
+ ...inputProps
551
+ } = elementProps;
552
+ return /* @__PURE__ */ jsxRuntime.jsxs(
553
+ BaseInput,
554
+ {
555
+ disabled,
556
+ valid,
557
+ "aria-disabled": ariaDisabled,
558
+ readOnly,
559
+ hovered,
560
+ focused,
561
+ size,
562
+ children: [
563
+ /* @__PURE__ */ jsxRuntime.jsx(
564
+ BaseInput.Input,
565
+ {
566
+ type: "email",
567
+ ...inputProps,
568
+ value,
569
+ ref: designSystemUtils.mergeRefs([inputRef, forwardRef])
570
+ }
571
+ ),
572
+ children,
573
+ /* @__PURE__ */ jsxRuntime.jsx(
574
+ ClearAction,
575
+ {
576
+ clearable,
577
+ clearLabel,
578
+ onClear,
579
+ inputRef,
580
+ value
581
+ }
582
+ ),
583
+ /* @__PURE__ */ jsxRuntime.jsx(IconSlot, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconEnvelope, {}) })
584
+ ]
585
+ }
586
+ );
587
+ });
588
+ InputEmail.ActionButton = ActionButton;
589
+
590
+ const InputSearch = React__default["default"].forwardRef(({ value, ...restProps }, forwardRef) => {
591
+ const inputRef = React.useRef(null);
592
+ const {
593
+ clearable = false,
594
+ onClear,
595
+ clearLabel,
596
+ ...elementProps
597
+ } = restProps;
598
+ const {
599
+ valid,
600
+ "aria-disabled": ariaDisabled,
601
+ readOnly,
602
+ disabled,
603
+ hovered,
604
+ focused,
605
+ size,
606
+ children,
607
+ ...inputProps
608
+ } = elementProps;
609
+ return /* @__PURE__ */ jsxRuntime.jsxs(
610
+ BaseInput,
611
+ {
612
+ disabled,
613
+ valid,
614
+ "aria-disabled": ariaDisabled,
615
+ readOnly,
616
+ hovered,
617
+ focused,
618
+ size,
619
+ children: [
620
+ /* @__PURE__ */ jsxRuntime.jsx(
621
+ BaseInput.Input,
622
+ {
623
+ ...inputProps,
624
+ value,
625
+ ref: designSystemUtils.mergeRefs([inputRef, forwardRef])
626
+ }
627
+ ),
628
+ children,
629
+ /* @__PURE__ */ jsxRuntime.jsx(
630
+ ClearAction,
631
+ {
632
+ clearable,
633
+ clearLabel,
634
+ onClear,
635
+ inputRef,
636
+ value
637
+ }
638
+ ),
639
+ /* @__PURE__ */ jsxRuntime.jsx(IconSlot, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconMagnifyingGlass, {}) })
640
+ ]
641
+ }
642
+ );
643
+ });
644
+ InputSearch.ActionButton = ActionButton;
645
+
128
646
  exports.Input = Input;
647
+ exports.InputEmail = InputEmail;
129
648
  exports.InputPassword = InputPassword;
130
- exports.InputText = InputText;
649
+ exports.InputSearch = InputSearch;
131
650
  //# sourceMappingURL=main.js.map