@ngrok/mantle 0.84.2 → 0.84.3
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/agent.json +1 -1
- package/dist/input.d.ts +14 -6
- package/dist/input.js +1 -1
- package/dist/llms.txt +1 -1
- package/package.json +1 -1
package/dist/agent.json
CHANGED
package/dist/input.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import { o as WithValidation, r as Validation } from "./field-7QeiTFwl.js";
|
|
|
2
2
|
import { a as AutoComplete, c as WithInputType, i as InputProps, n as InputCapture, o as InputType, r as InputCaptureProps, s as WithAutoComplete, t as Input } from "./input-DpnC3Xgj.js";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
4
|
//#region src/components/input/password-input.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The props for the `PasswordInput` component.
|
|
7
|
+
*/
|
|
5
8
|
type PasswordInputProps = Omit<ComponentProps<"input">, "autoComplete" | "type"> & WithValidation & WithAutoComplete & {
|
|
6
9
|
/**
|
|
7
10
|
* Called with the next visibility when the user clicks the toggle. In
|
|
@@ -26,14 +29,16 @@ type PasswordInputProps = Omit<ComponentProps<"input">, "autoComplete" | "type">
|
|
|
26
29
|
* accurately and may want to verify visually before submitting.
|
|
27
30
|
*
|
|
28
31
|
* **When not to use**
|
|
29
|
-
* - For values that are never sensitive
|
|
32
|
+
* - For values that are never sensitive: use a plain {@link https://mantle.ngrok.com/components/forms/input Input}.
|
|
30
33
|
* - For controls where the toggle would be confusing (e.g. masked input
|
|
31
34
|
* formatting like phone numbers).
|
|
32
35
|
*
|
|
33
36
|
* **Visibility state.** The toggle is uncontrolled by default. Pass
|
|
34
|
-
* `showValue` to control the visibility from the outside
|
|
35
|
-
*
|
|
36
|
-
* to
|
|
37
|
+
* `showValue` to control the visibility from the outside, for example when
|
|
38
|
+
* one control reveals several password fields. Pass `onValueVisibilityChange`
|
|
39
|
+
* to receive the next visibility when the user clicks the built-in toggle.
|
|
40
|
+
* The eye icon animates on every visibility change, from the built-in toggle
|
|
41
|
+
* or from `showValue`, unless the user prefers reduced motion.
|
|
37
42
|
*
|
|
38
43
|
* **Accessibility.** Always pair with a {@link https://mantle.ngrok.com/components/forms/label Label}.
|
|
39
44
|
* The toggle is a focusable `aria-pressed` button named "Show value". Its
|
|
@@ -47,11 +52,14 @@ type PasswordInputProps = Omit<ComponentProps<"input">, "autoComplete" | "type">
|
|
|
47
52
|
* | Data Attribute | Value | Description |
|
|
48
53
|
* | --- | --- | --- |
|
|
49
54
|
* | `data-slot` | `"password-input"` | The chrome around the input. |
|
|
55
|
+
* | `data-slot` | `"input-capture"` | The `<input>` element. |
|
|
50
56
|
* | `data-slot` | `"password-input-toggle"` | The visibility toggle button. |
|
|
57
|
+
* | `data-disabled` | present when disabled | On the chrome. Style with `data-disabled:`. |
|
|
58
|
+
* | `data-validation` | `"error"` \| `"success"` \| `"warning"` | On the chrome and the `<input>`. Omitted when unset. |
|
|
51
59
|
*
|
|
52
60
|
* **Browser password managers.** When revealed, the input switches to
|
|
53
|
-
* `type="text"
|
|
54
|
-
* which is the intended security
|
|
61
|
+
* `type="text"`. Some password managers may pause autofill in this state,
|
|
62
|
+
* which is the intended security trade-off.
|
|
55
63
|
*
|
|
56
64
|
* @see https://mantle.ngrok.com/components/forms/password-input
|
|
57
65
|
*
|
package/dist/input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./icon-CGKaq_tV.js";import{n
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./icon-CGKaq_tV.js";import{n,t as r}from"./input-BhykQSvJ.js";import{t as i}from"./use-prefers-reduced-motion-DHYDQk1h.js";import{t as a}from"./input-DQyN6gN0.js";import{useId as o,useRef as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{EyeIcon as d}from"@phosphor-icons/react/Eye";import{EyeClosedIcon as f}from"@phosphor-icons/react/EyeClosed";const p=({disabled:a,id:p,onValueVisibilityChange:m,ref:h,showValue:g,..._})=>{let v=o(),y=p??v,b=g!=null,[x,S]=c(!1),C=b?g:x,w=C?`text`:`password`,T=C?d:f,E=s(null),D=s(C);return e(()=>{if(D.current===C)return;D.current=C;let e=E.current;e==null||i()||e.animate([{transform:`scaleY(0)`},{transform:`scaleY(1)`}],{duration:200,easing:`ease-out`})},[C]),u(r,{"data-slot":`password-input`,disabled:a,id:y,type:w,ref:h,..._,children:[l(n,{}),l(`button`,{type:`button`,disabled:a,"data-slot":`password-input-toggle`,"aria-label":`Show value`,"aria-pressed":C,"aria-controls":y,className:`text-body hover:text-strong focus-visible:ring-focus-accent ml-1 cursor-pointer rounded-xs bg-inherit p-0 focus-visible:ring-2 focus-visible:outline-hidden`,onClick:()=>{let e=!C;b||S(e),m?.(e)},children:l(t,{ref:E,svg:l(T,{"aria-hidden":!0})})})]})};export{r as Input,n as InputCapture,p as PasswordInput,a as isInput};
|
package/dist/llms.txt
CHANGED