@donotdev/components 0.3.3 → 0.3.4
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/atomic/PasswordInput/index.d.ts +10 -1
- package/dist/atomic/PasswordInput/index.d.ts.map +1 -1
- package/dist/atomic/PasswordInput/index.js +1 -1
- package/dist/atomic/PinInput/index.d.ts +26 -18
- package/dist/atomic/PinInput/index.d.ts.map +1 -1
- package/dist/atomic/PinInput/index.js +1 -1
- package/dist/atomic/Sheet/index.d.ts +7 -1
- package/dist/atomic/Sheet/index.d.ts.map +1 -1
- package/dist/atomic/Sheet/index.js +1 -1
- package/dist/styles/index.css +114 -22
- package/dist/symbol-index.json +1 -1
- package/guidelines/COMPONENTS.md +2 -2
- package/package.json +1 -1
|
@@ -12,6 +12,15 @@ export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputEl
|
|
|
12
12
|
info?: string;
|
|
13
13
|
/** Whether the field is required - shows asterisk indicator */
|
|
14
14
|
required?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Accessible names of the show / hide toggle; pass translated strings
|
|
17
|
+
* (framework keys: `t('auth:passwordToggle.show')` / `t('auth:passwordToggle.hide')`).
|
|
18
|
+
* @default { show: 'Show password', hide: 'Hide password' }
|
|
19
|
+
*/
|
|
20
|
+
revealAriaLabel?: {
|
|
21
|
+
show: string;
|
|
22
|
+
hide: string;
|
|
23
|
+
};
|
|
15
24
|
}
|
|
16
25
|
/**
|
|
17
26
|
* PasswordInput Component
|
|
@@ -42,6 +51,6 @@ export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputEl
|
|
|
42
51
|
* @param {PasswordInputProps} props - The props for the password input
|
|
43
52
|
* @returns {JSX.Element} The rendered password input
|
|
44
53
|
*/
|
|
45
|
-
declare const PasswordInput: ({ className, visible: controlledVisible, onVisibilityChange, label, info, value, onFocus, onBlur, required, id: idProp, ...props }: PasswordInputProps) => import("react").JSX.Element;
|
|
54
|
+
declare const PasswordInput: ({ className, visible: controlledVisible, onVisibilityChange, label, info, value, onFocus, onBlur, required, id: idProp, revealAriaLabel, ...props }: PasswordInputProps) => import("react").JSX.Element;
|
|
46
55
|
export default PasswordInput;
|
|
47
56
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/PasswordInput/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAKjD,OAAO,qBAAqB,CAAC;AAE7B,4EAA4E;AAC5E,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAC9C,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,CACP;IACC,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/PasswordInput/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAKjD,OAAO,qBAAqB,CAAC;AAE7B,4EAA4E;AAC5E,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAC9C,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,CACP;IACC,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,eAAe,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAClD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,QAAA,MAAM,aAAa,GAAI,qJAapB,kBAAkB,gCA2EpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Eye as L,EyeOff as
|
|
1
|
+
"use client";import{Eye as L,EyeOff as N}from"lucide-react";import{useState as P,useId as x}from"react";import{cn as F}from"../../utils/helpers.js";import{FloatingLabel as H}from"../Label/index.js";import{jsx as e,jsxs as C}from"react/jsx-runtime";var V=({className:u,visible:i,onVisibilityChange:p,label:s,info:c,value:m,onFocus:g,onBlur:f,required:o,id:v,revealAriaLabel:d,...n})=>{let w=x(),a=v??w,[y,I]=P(!1),t=i!==void 0?i:y,r=!!s,h=()=>{let b=!t;i===void 0&&I(b),p?.(b)},l=C("div",{className:"dndev-relative",children:[e("input",{id:a,type:t?"text":"password",value:m,className:F("dndev-input","dndev-password-input-with-toggle",u),"data-bare":r||void 0,onFocus:g,onBlur:f,required:o,...n}),e("button",{type:"button",className:"dndev-password-toggle-button",onClick:h,"aria-label":t?d?.hide??"Hide password":d?.show??"Show password","aria-describedby":n["aria-describedby"],tabIndex:-1,children:t?e(N,{className:"dndev-size-md dndev-password-toggle-icon"}):e(L,{className:"dndev-size-md dndev-password-toggle-icon"})})]});return r?e(H,{htmlFor:a,label:s,info:c,disabled:n.disabled,required:o,children:l}):l},z=V;export{z as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InputHTMLAttributes } from 'react';
|
|
1
|
+
import type { InputHTMLAttributes, Ref } from 'react';
|
|
2
2
|
import './PinInput.css';
|
|
3
3
|
/** Props for the PinInput component -- N-digit PIN / OTP input. */
|
|
4
4
|
export interface PinInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'onChange' | 'maxLength' | 'pattern' | 'inputMode'> {
|
|
@@ -6,7 +6,7 @@ export interface PinInputProps extends Omit<InputHTMLAttributes<HTMLInputElement
|
|
|
6
6
|
value: string;
|
|
7
7
|
/** Called on every change. Receives the full current PIN (may be shorter than length). */
|
|
8
8
|
onChange: (next: string) => void;
|
|
9
|
-
/** Called
|
|
9
|
+
/** Called when the PIN reaches `length` characters (once per distinct complete PIN). */
|
|
10
10
|
onComplete?: (value: string) => void;
|
|
11
11
|
/**
|
|
12
12
|
* Number of digits. Typical values: 4 (PIN), 6 (OTP), 8 (recovery code).
|
|
@@ -28,17 +28,17 @@ export interface PinInputProps extends Omit<InputHTMLAttributes<HTMLInputElement
|
|
|
28
28
|
shake?: boolean;
|
|
29
29
|
/** Restrict input to digits only. Set false for alphanumeric OTPs. @default true */
|
|
30
30
|
numericOnly?: boolean;
|
|
31
|
-
/**
|
|
31
|
+
/** Label rendered above the slots (names the input). */
|
|
32
32
|
label?: string;
|
|
33
33
|
/** Help text: an (i) after the label shows it on hover, focus or tap. Needs `label`. */
|
|
34
34
|
info?: string;
|
|
35
35
|
/** Whether the field is required - shows asterisk indicator */
|
|
36
36
|
required?: boolean;
|
|
37
|
-
/**
|
|
37
|
+
/** Focus the input on mount, and again when it is re-enabled. */
|
|
38
38
|
autoFocus?: boolean;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
40
|
+
* No effect, kept for compatibility: the PIN is one input, announced as a
|
|
41
|
+
* whole through `label` / `aria-label`; the slots are visual only.
|
|
42
42
|
*/
|
|
43
43
|
digitAriaLabel?: (index: number, length: number) => string;
|
|
44
44
|
/**
|
|
@@ -49,22 +49,30 @@ export interface PinInputProps extends Omit<InputHTMLAttributes<HTMLInputElement
|
|
|
49
49
|
show: string;
|
|
50
50
|
hide: string;
|
|
51
51
|
};
|
|
52
|
+
/** The underlying input (React 19 ref prop), e.g. to focus it again after an action */
|
|
53
|
+
ref?: Ref<HTMLInputElement>;
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
54
56
|
* PinInput Component
|
|
55
57
|
*
|
|
56
|
-
* N-
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
58
|
+
* N-character PIN / OTP input, built like `input-otp`: ONE real `<input>`
|
|
59
|
+
* stretched transparently over `length` visual slots. Typing, paste anywhere,
|
|
60
|
+
* Backspace / Delete, selection, arrows, Home / End, IME and OS one-time-code
|
|
61
|
+
* autofill are the browser's own input behaviour; the component only filters
|
|
62
|
+
* the value to valid characters, clamps it to `length`, draws the slots
|
|
63
|
+
* (character, `•` when masked, a caret on the active slot) and calls
|
|
64
|
+
* `onComplete` when the PIN is full. A paste holding `length` or more valid
|
|
65
|
+
* characters replaces the whole PIN; a shorter one is inserted at the caret.
|
|
66
|
+
* Clicking a filled slot selects that character so the next keystroke replaces
|
|
67
|
+
* it; the active slot follows the input's selection (click, select, keyup, focus).
|
|
60
68
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
69
|
+
* Numeric by default (`numericOnly={false}` for alphanumeric codes),
|
|
70
|
+
* `autoComplete="one-time-code"`, slots shrink to fit narrow containers,
|
|
71
|
+
* SSR-safe (no browser access during render). When the parent clears `value`,
|
|
72
|
+
* the input is refocused at the start. Rest props go to the input.
|
|
65
73
|
*
|
|
66
74
|
* @component
|
|
67
|
-
* @version 0.
|
|
75
|
+
* @version 0.2.0
|
|
68
76
|
* @since 0.1.3
|
|
69
77
|
* @author AMBROISE PARK Consulting
|
|
70
78
|
* @example Basic 4-digit PIN
|
|
@@ -76,19 +84,19 @@ export interface PinInputProps extends Omit<InputHTMLAttributes<HTMLInputElement
|
|
|
76
84
|
* autoFocus
|
|
77
85
|
* />
|
|
78
86
|
* ```
|
|
79
|
-
* @example 6-digit OTP
|
|
87
|
+
* @example 6-digit OTP, visible
|
|
80
88
|
* ```tsx
|
|
81
89
|
* <PinInput
|
|
82
90
|
* value={code}
|
|
83
91
|
* onChange={setCode}
|
|
84
92
|
* length={6}
|
|
85
|
-
* mask
|
|
93
|
+
* mask={false}
|
|
86
94
|
* label="Verification code"
|
|
87
95
|
* />
|
|
88
96
|
* ```
|
|
89
97
|
* @param {PinInputProps} props - The props for the PIN input
|
|
90
98
|
* @returns {JSX.Element} The rendered PIN input
|
|
91
99
|
*/
|
|
92
|
-
declare const PinInput: ({ value, onChange, onComplete, length, mask, hideMaskToggle, shake, numericOnly, label, info, required, autoFocus, disabled, className, digitAriaLabel, revealAriaLabel, "aria-label": ariaLabel, ...rest }: PinInputProps) => import("react").JSX.Element;
|
|
100
|
+
declare const PinInput: ({ value, onChange, onComplete, length, mask, hideMaskToggle, shake, numericOnly, label, info, required, autoFocus, disabled, className, digitAriaLabel: _digitAriaLabel, revealAriaLabel, "aria-label": ariaLabel, onClick, onPaste, onSelect, onKeyUp, onFocus, ref: externalRef, ...rest }: PinInputProps) => import("react").JSX.Element;
|
|
93
101
|
export default PinInput;
|
|
94
102
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/PinInput/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/PinInput/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKtD,OAAO,gBAAgB,CAAC;AAExB,mEAAmE;AACnE,MAAM,WAAW,aAAc,SAAQ,IAAI,CACzC,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,CACtE;IACC,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,0FAA0F;IAC1F,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,wFAAwF;IACxF,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oFAAoF;IACpF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3D;;;OAGG;IACH,eAAe,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,uFAAuF;IACvF,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,QAAA,MAAM,QAAQ,GAAI,8RAyBf,aAAa,gCA2Jf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Eye as
|
|
1
|
+
"use client";import{Eye as G,EyeOff as J}from"lucide-react";import{useEffect as E,useId as Q,useRef as A,useState as H}from"react";import{cn as W}from"../../utils/helpers.js";import Y,{FieldInfo as $}from"../Label/index.js";import{jsx as o,jsxs as f}from"react/jsx-runtime";var j=({value:n,onChange:k,onComplete:x,length:i=4,mask:b=!0,hideMaskToggle:S=!1,shake:w=!1,numericOnly:m=!0,label:g,info:v,required:I,autoFocus:L,disabled:a,className:R,digitAriaLabel:tt,revealAriaLabel:M,"aria-label":z,onClick:D,onPaste:F,onSelect:q,onKeyUp:Z,onFocus:B,ref:d,...K})=>{let T=Q(),c=A(null),N=A(n),[O,_]=H(0),[l,U]=H(!1);E(()=>{L&&!a&&c.current?.focus()},[L,a]),E(()=>{n===""&&N.current!==""&&!a&&(c.current?.focus(),c.current?.setSelectionRange(0,0),_(0)),N.current=n},[n,a]);let C=m?/\D/g:/[^A-Za-z0-9]/g,h=t=>{let e=t.replace(C,"").slice(0,i);e!==n&&(k(e),e.length===i&&x?.(e))},V=t=>{c.current=t,typeof d=="function"?d(t):d&&(d.current=t)},u=t=>_(t.selectionStart??0),y=Math.min(O,i-1),X=b&&!S,P=f("div",{className:W("dndev-pin-input",R),"data-shake":w?"true":void 0,children:[f("div",{className:"dndev-pin-input__slots",children:[Array.from({length:i},(t,e)=>o("div",{"aria-hidden":"true",className:"dndev-pin-input__slot","data-active":e===y?"true":void 0,"data-caret":e===y&&e===n.length?"true":void 0,children:n[e]&&(b&&!l?"\u2022":n[e])},e)),o("input",{...K,ref:V,id:T,type:"text",inputMode:m?"numeric":"text",pattern:m?"\\d*":"[A-Za-z0-9]*",maxLength:i,autoComplete:"one-time-code",spellCheck:!1,value:n,disabled:a,required:I,"aria-label":z??(g?void 0:"PIN input"),className:"dndev-pin-input__field",onChange:t=>h(t.target.value),onPaste:t=>{if(F?.(t),t.defaultPrevented)return;t.preventDefault();let e=t.currentTarget,r=t.clipboardData.getData("text");if(r.replace(C,"").length>=i){h(r);return}let p=e.selectionStart??n.length,s=e.selectionEnd??p;h(n.slice(0,p)+r+n.slice(s))},onSelect:t=>{q?.(t),u(t.currentTarget)},onKeyUp:t=>{Z?.(t),u(t.currentTarget)},onFocus:t=>{B?.(t),u(t.currentTarget)},onClick:t=>{D?.(t);let e=t.currentTarget,r=e.getBoundingClientRect();if(r.width){let p=Math.floor((t.clientX-r.left)/r.width*i),s=Math.max(0,Math.min(p,n.length));e.setSelectionRange(s,s<n.length?s+1:s)}u(e)}})]}),X?o("button",{type:"button",className:"dndev-pin-input__reveal",onClick:()=>U(t=>!t),"aria-label":l?M?.hide??"Hide PIN":M?.show??"Show PIN","aria-pressed":l,tabIndex:-1,children:l?o(J,{className:"dndev-size-md"}):o(G,{className:"dndev-size-md"})}):null]});return g?f("div",{className:"dndev-pin-input-field","data-disabled":a?"true":void 0,children:[f("div",{className:"dndev-pin-input-field__label",children:[o(Y,{htmlFor:T,required:I,children:g}),v&&o($,{text:v})]}),P]}):P},ot=j;export{ot as default};
|
|
@@ -42,6 +42,12 @@ export interface SheetProps extends Omit<ComponentProps<typeof DialogPrimitive.C
|
|
|
42
42
|
* @default 'default'
|
|
43
43
|
*/
|
|
44
44
|
size?: 'default' | 'narrow';
|
|
45
|
+
/**
|
|
46
|
+
* Accessible name of the close button; pass a translated string
|
|
47
|
+
* (framework key: `t('dndev:sheet.close')`).
|
|
48
|
+
* @default 'Close sheet'
|
|
49
|
+
*/
|
|
50
|
+
closeLabel?: string;
|
|
45
51
|
}
|
|
46
52
|
/**
|
|
47
53
|
* Accessible sheet (slide-out) component built on Radix UI Dialog.
|
|
@@ -62,7 +68,7 @@ export interface SheetProps extends Omit<ComponentProps<typeof DialogPrimitive.C
|
|
|
62
68
|
* @param {SheetProps} props - The props for the sheet
|
|
63
69
|
* @returns {JSX.Element} The rendered sheet
|
|
64
70
|
*/
|
|
65
|
-
declare const Sheet: ({ trigger, title, description, children, open, onOpenChange, side, showOverlay, footer, variant, className, noSwipe, size, ...contentProps }: SheetProps) => import("react").JSX.Element;
|
|
71
|
+
declare const Sheet: ({ trigger, title, description, children, open, onOpenChange, side, showOverlay, footer, variant, className, noSwipe, size, closeLabel, ...contentProps }: SheetProps) => import("react").JSX.Element;
|
|
66
72
|
export default Sheet;
|
|
67
73
|
export { SURFACE_VARIANT as SHEET_VARIANT } from '../../utils/constants';
|
|
68
74
|
export type { SurfaceVariant as SheetVariant } from '../../utils/constants';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Sheet/index.tsx"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAEH,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAG1D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAGlE,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI7E,iFAAiF;AACjF,MAAM,WAAW,UAAW,SAAQ,IAAI,CACtC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EAC9C,OAAO,GAAG,UAAU,CACrB;IACC,uCAAuC;IACvC,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,+FAA+F;IAC/F,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,mBAAmB;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAC3C,wCAAwC;IACxC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,qIAAqI;IACrI,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,sDAAsD;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Sheet/index.tsx"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAEH,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAG1D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAGlE,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI7E,iFAAiF;AACjF,MAAM,WAAW,UAAW,SAAQ,IAAI,CACtC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EAC9C,OAAO,GAAG,UAAU,CACrB;IACC,uCAAuC;IACvC,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,+FAA+F;IAC/F,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,mBAAmB;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAC3C,wCAAwC;IACxC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,qIAAqI;IACrI,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,sDAAsD;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,KAAK,GAAI,0JAgBZ,UAAU,gCAyGZ,CAAC;AAEF,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,eAAe,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACzE,YAAY,EAAE,cAAc,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"@radix-ui/react-dialog";import{X as
|
|
1
|
+
"use client";import*as e from"@radix-ui/react-dialog";import{X as g}from"lucide-react";import{useRef as O}from"react";import{useSwipeToClose as E}from"../../hooks/index.js";import{SURFACE_VARIANT as U}from"../../utils/constants.js";import{cn as w,getVariantDataAttrs as B}from"../../utils/helpers.js";import u,{BUTTON_VARIANT as P}from"../Button/index.js";import{SURFACE_VARIANT as q}from"../../utils/constants.js";import{Fragment as x,jsx as i,jsxs as a}from"react/jsx-runtime";var I=({trigger:l,title:s,description:d,children:p,open:h,onOpenChange:r,side:o="right",showOverlay:D=!0,footer:m,variant:c,className:N="",noSwipe:t=!1,size:v="default",closeLabel:f="Close sheet",...C})=>{let n=O(null),R=()=>{switch(o){case"top":return"down";case"bottom":return"up";case"left":return"right";case"right":return"left";default:return"down"}},{ref:T,onPointerDown:y,onPointerMove:A,onPointerUp:S,onPointerCancel:b}=E({direction:R(),closeButtonRef:n||void 0,onClose:r?()=>r(!1):void 0,enabled:!t}),V=B({side:o,variant:c!==U.DEFAULT?c:void 0});return a(e.Root,{open:h,onOpenChange:r,children:[l&&i(e.Trigger,{asChild:!0,children:l}),a(e.Portal,{children:[D&&i(e.Overlay,{className:"dndev-overlay"}),a(e.Content,{ref:T,className:w("dndev-surface dndev-sheet-content",N),"data-side":o,"data-size":v==="default"?void 0:v,onPointerDown:t?void 0:y,onPointerMove:t?void 0:A,onPointerUp:t?void 0:S,onPointerCancel:t?void 0:b,...V,...C,children:[(o==="bottom"||o==="top")&&!t&&i("div",{className:"dndev-sheet-drag-handle","aria-hidden":"true"}),s?a("div",{className:"dndev-sheet-header",children:[i(e.Title,{className:"dndev-sheet-title",children:s}),i(e.Description,{className:"dndev-sr-only",children:d||"Sheet content"}),i(e.Close,{ref:n,asChild:!0,children:i(u,{variant:P.GHOST,display:"full",icon:g,className:"dndev-sheet-close","aria-label":f})})]}):a(x,{children:[i(e.Title,{className:"dndev-sr-only",children:"Sheet"}),i(e.Description,{className:"dndev-sr-only",children:d||"Sheet content"}),i("div",{className:"dndev-sheet-header",children:i(e.Close,{ref:n,asChild:!0,children:i(u,{variant:P.GHOST,display:"full",icon:g,className:"dndev-sheet-close","aria-label":f})})})]}),i("div",{className:"dndev-sheet-body",children:p}),m&&i("div",{className:"dndev-sheet-footer",children:m})]})]})]})},X=I;export{q as SHEET_VARIANT,X as default};
|
package/dist/styles/index.css
CHANGED
|
@@ -161,8 +161,10 @@
|
|
|
161
161
|
--font-family: var(--font-sans);
|
|
162
162
|
|
|
163
163
|
/* Sans-serif: Inter (2026 standard). '<Family> Fallback': size-matched local face
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
rendered while the web font is not available (font-display: optional), so text
|
|
165
|
+
keeps its box. Defined by the framework font plan on both bundlers
|
|
166
|
+
(@donotdev/core config/fonts/buildFontPlan.js); a stack leading with a web font
|
|
167
|
+
must list it right after the family (the build fails otherwise). */
|
|
166
168
|
--font-sans:
|
|
167
169
|
Inter, 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
|
168
170
|
'Helvetica Neue', Arial, sans-serif;
|
|
@@ -6659,36 +6661,121 @@ input[type='number'] {
|
|
|
6659
6661
|
|
|
6660
6662
|
/* packages/components/src/atomic/PinInput/PinInput.css */
|
|
6661
6663
|
|
|
6662
|
-
|
|
6664
|
+
/* Label above the slots */
|
|
6665
|
+
.dndev-pin-input-field {
|
|
6663
6666
|
display: flex;
|
|
6667
|
+
flex-direction: column;
|
|
6664
6668
|
gap: var(--gap-sm);
|
|
6669
|
+
min-inline-size: 0;
|
|
6670
|
+
}
|
|
6671
|
+
|
|
6672
|
+
.dndev-pin-input-field__label {
|
|
6673
|
+
display: flex;
|
|
6674
|
+
align-items: center;
|
|
6675
|
+
gap: calc(var(--gap-sm) / 2);
|
|
6676
|
+
}
|
|
6677
|
+
|
|
6678
|
+
.dndev-pin-input-field[data-disabled='true'] .dndev-pin-input-field__label {
|
|
6679
|
+
opacity: var(--opacity-muted);
|
|
6680
|
+
}
|
|
6681
|
+
|
|
6682
|
+
.dndev-pin-input {
|
|
6683
|
+
display: flex;
|
|
6665
6684
|
align-items: center;
|
|
6666
6685
|
justify-content: center;
|
|
6686
|
+
min-inline-size: 0;
|
|
6667
6687
|
direction: ltr; /* digits are always LTR even in RTL locales */
|
|
6668
6688
|
}
|
|
6669
6689
|
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6690
|
+
/* The row shrinks with its container; each slot shrinks from the touch-target
|
|
6691
|
+
size, so 8 slots fit 320px without overflow */
|
|
6692
|
+
.dndev-pin-input__slots {
|
|
6693
|
+
position: relative;
|
|
6694
|
+
display: flex;
|
|
6695
|
+
flex: 0 1 auto;
|
|
6696
|
+
min-inline-size: 0;
|
|
6697
|
+
gap: var(--gap-sm);
|
|
6698
|
+
}
|
|
6699
|
+
|
|
6700
|
+
.dndev-pin-input__slot {
|
|
6701
|
+
display: flex;
|
|
6702
|
+
flex: 0 1 var(--touch-target);
|
|
6703
|
+
align-items: center;
|
|
6704
|
+
justify-content: center;
|
|
6705
|
+
inline-size: var(--touch-target);
|
|
6706
|
+
min-inline-size: 0;
|
|
6707
|
+
block-size: var(--touch-target);
|
|
6708
|
+
border: var(--border-hairline) solid var(--line-2);
|
|
6709
|
+
border-radius: var(--radius-interactive);
|
|
6710
|
+
background-color: var(--interactive, transparent);
|
|
6711
|
+
color: var(--foreground);
|
|
6712
|
+
box-shadow: var(--shadow-sm);
|
|
6713
|
+
font-size: var(--font-size-lg);
|
|
6676
6714
|
font-variant-numeric: tabular-nums;
|
|
6677
|
-
|
|
6678
|
-
|
|
6715
|
+
transition:
|
|
6716
|
+
border-color var(--dur-fast) var(--ease-in-out),
|
|
6717
|
+
box-shadow var(--dur-fast) var(--ease-in-out);
|
|
6718
|
+
}
|
|
6719
|
+
|
|
6720
|
+
.dndev-pin-input__slots:hover .dndev-pin-input__slot {
|
|
6721
|
+
border-color: var(--ring);
|
|
6722
|
+
}
|
|
6723
|
+
|
|
6724
|
+
/* Focus ring on the active slot while the input has focus */
|
|
6725
|
+
.dndev-pin-input__slots:focus-within .dndev-pin-input__slot[data-active] {
|
|
6726
|
+
border-color: var(--ring);
|
|
6727
|
+
box-shadow: var(--shadow-focus);
|
|
6728
|
+
}
|
|
6729
|
+
|
|
6730
|
+
/* Fake caret in the empty active slot */
|
|
6731
|
+
.dndev-pin-input__slots:focus-within .dndev-pin-input__slot[data-caret]::after {
|
|
6732
|
+
content: '';
|
|
6733
|
+
inline-size: var(--border-hairline);
|
|
6734
|
+
block-size: 1em;
|
|
6735
|
+
background-color: var(--foreground);
|
|
6736
|
+
animation: dndev-pin-input-caret 1s steps(2, start) infinite;
|
|
6737
|
+
}
|
|
6738
|
+
|
|
6739
|
+
@keyframes dndev-pin-input-caret {
|
|
6740
|
+
to {
|
|
6741
|
+
visibility: hidden;
|
|
6742
|
+
}
|
|
6743
|
+
}
|
|
6744
|
+
|
|
6745
|
+
/* The real input: covers the slots, invisible, receives every interaction.
|
|
6746
|
+
16px minimum font size: no iOS zoom on focus. */
|
|
6747
|
+
.dndev-pin-input__field {
|
|
6748
|
+
position: absolute;
|
|
6749
|
+
inset: 0;
|
|
6750
|
+
inline-size: 100%;
|
|
6751
|
+
block-size: 100%;
|
|
6752
|
+
margin: 0;
|
|
6753
|
+
padding: 0;
|
|
6754
|
+
border: 0;
|
|
6755
|
+
outline: 0;
|
|
6756
|
+
background: transparent;
|
|
6757
|
+
color: transparent;
|
|
6758
|
+
-webkit-text-fill-color: transparent;
|
|
6759
|
+
caret-color: transparent;
|
|
6760
|
+
font-size: var(--font-size-input);
|
|
6761
|
+
cursor: text;
|
|
6679
6762
|
}
|
|
6680
6763
|
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6764
|
+
.dndev-pin-input__field::-moz-selection {
|
|
6765
|
+
background: transparent;
|
|
6766
|
+
}
|
|
6767
|
+
|
|
6768
|
+
.dndev-pin-input__field::selection {
|
|
6769
|
+
background: transparent;
|
|
6770
|
+
}
|
|
6771
|
+
|
|
6772
|
+
.dndev-pin-input__field:disabled {
|
|
6773
|
+
cursor: not-allowed;
|
|
6774
|
+
}
|
|
6775
|
+
|
|
6776
|
+
.dndev-pin-input__slots:has(.dndev-pin-input__field:disabled)
|
|
6777
|
+
.dndev-pin-input__slot {
|
|
6778
|
+
opacity: var(--opacity-muted);
|
|
6692
6779
|
}
|
|
6693
6780
|
|
|
6694
6781
|
.dndev-pin-input__reveal {
|
|
@@ -6752,6 +6839,11 @@ input[type='number'] {
|
|
|
6752
6839
|
.dndev-pin-input[data-shake='true'] {
|
|
6753
6840
|
animation: none;
|
|
6754
6841
|
}
|
|
6842
|
+
|
|
6843
|
+
.dndev-pin-input__slots:focus-within
|
|
6844
|
+
.dndev-pin-input__slot[data-caret]::after {
|
|
6845
|
+
animation: none;
|
|
6846
|
+
}
|
|
6755
6847
|
}
|
|
6756
6848
|
|
|
6757
6849
|
/* packages/components/src/atomic/Pagination/Pagination.css */
|