@donotdev/components 0.3.3 → 0.3.5
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/advanced/ImageGallery/ImageGallery.d.ts +16 -4
- package/dist/advanced/ImageGallery/ImageGallery.d.ts.map +1 -1
- package/dist/advanced/ImageGallery/ImageGallery.js +1 -1
- package/dist/advanced/ImageGallery/snapStrip.d.ts +6 -0
- package/dist/advanced/ImageGallery/snapStrip.d.ts.map +1 -1
- package/dist/advanced/ImageGallery/snapStrip.js +1 -1
- package/dist/atomic/Accordion/AccordionPrimitive.d.ts +7 -0
- package/dist/atomic/Accordion/AccordionPrimitive.d.ts.map +1 -1
- package/dist/atomic/Accordion/AccordionPrimitive.js +1 -1
- package/dist/atomic/Accordion/index.d.ts +18 -2
- package/dist/atomic/Accordion/index.d.ts.map +1 -1
- package/dist/atomic/Accordion/index.js +1 -1
- package/dist/atomic/ActionBar/index.d.ts +66 -0
- package/dist/atomic/ActionBar/index.d.ts.map +1 -0
- package/dist/atomic/ActionBar/index.js +1 -0
- package/dist/atomic/Button/IconBadge.d.ts +18 -0
- package/dist/atomic/Button/IconBadge.d.ts.map +1 -0
- package/dist/atomic/Button/IconBadge.js +1 -0
- package/dist/atomic/Button/index.d.ts +10 -7
- package/dist/atomic/Button/index.d.ts.map +1 -1
- package/dist/atomic/Button/index.js +1 -1
- package/dist/atomic/Card/cover.d.ts +11 -3
- package/dist/atomic/Card/cover.d.ts.map +1 -1
- package/dist/atomic/Card/cover.js +1 -1
- package/dist/atomic/Card/index.d.ts +16 -1
- package/dist/atomic/Card/index.d.ts.map +1 -1
- package/dist/atomic/Card/index.js +1 -1
- package/dist/atomic/Collapsible/CollapsiblePrimitive.d.ts +6 -0
- package/dist/atomic/Collapsible/CollapsiblePrimitive.d.ts.map +1 -1
- package/dist/atomic/Collapsible/CollapsiblePrimitive.js +1 -1
- package/dist/atomic/Collapsible/index.d.ts +3 -1
- package/dist/atomic/Collapsible/index.d.ts.map +1 -1
- package/dist/atomic/Collapsible/index.js +1 -1
- package/dist/atomic/Floating/index.d.ts +67 -0
- package/dist/atomic/Floating/index.d.ts.map +1 -0
- package/dist/atomic/Floating/index.js +1 -0
- package/dist/atomic/Grid/index.d.ts +12 -0
- package/dist/atomic/Grid/index.d.ts.map +1 -1
- package/dist/atomic/Grid/index.js +1 -1
- package/dist/atomic/List/index.d.ts +10 -1
- package/dist/atomic/List/index.d.ts.map +1 -1
- package/dist/atomic/List/index.js +1 -1
- 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/QuantityStepper/index.d.ts +42 -4
- package/dist/atomic/QuantityStepper/index.d.ts.map +1 -1
- package/dist/atomic/QuantityStepper/index.js +1 -1
- package/dist/atomic/Section/index.d.ts +15 -1
- package/dist/atomic/Section/index.d.ts.map +1 -1
- package/dist/atomic/Section/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/atomic/Text/index.d.ts +15 -2
- package/dist/atomic/Text/index.d.ts.map +1 -1
- package/dist/atomic/Text/index.js +2 -2
- package/dist/atomic/Tooltip/TooltipPrimitive.d.ts +5 -0
- package/dist/atomic/Tooltip/TooltipPrimitive.d.ts.map +1 -1
- package/dist/atomic/Tooltip/TooltipPrimitive.js +1 -1
- package/dist/atomic/index.d.ts +4 -2
- package/dist/atomic/index.d.ts.map +1 -1
- package/dist/atomic/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles/index.css +689 -119
- package/dist/symbol-index.json +1 -1
- package/dist/utils/flights.d.ts +30 -0
- package/dist/utils/flights.d.ts.map +1 -0
- package/dist/utils/flights.js +1 -0
- package/dist/utils/flyTo.d.ts +45 -0
- package/dist/utils/flyTo.d.ts.map +1 -0
- package/dist/utils/flyTo.js +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/responsiveImage.d.ts +64 -9
- package/dist/utils/responsiveImage.d.ts.map +1 -1
- package/dist/utils/responsiveImage.js +1 -1
- package/guidelines/API_REFERENCE.md +5 -2
- package/guidelines/COMPONENTS.md +15 -11
- package/guidelines/QUANTITY_STEPPER.md +25 -3
- package/package.json +1 -1
- package/dist/atomic/PortalButton/index.d.ts +0 -32
- package/dist/atomic/PortalButton/index.d.ts.map +0 -1
- package/dist/atomic/PortalButton/index.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Collapsible/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,OAAO,mBAAmB,CAAC;AAE3B,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,0BAA0B;IAC1B,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,wCAAwC;IACxC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACrC,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Collapsible/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,OAAO,mBAAmB,CAAC;AAE3B,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,0BAA0B;IAC1B,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,wCAAwC;IACxC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACrC,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,WAAW,CAAC,EACnB,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,QAAgB,EAChB,SAAwB,EACxB,SAAS,GACV,EAAE,gBAAgB,+BA2ElB;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{CirclePlus as
|
|
1
|
+
"use client";import{CirclePlus as N,CircleMinus as O,ChevronDown as c}from"lucide-react";import{Fragment as P,isValidElement as T,useState as I}from"react";import{CollapsiblePrimitive as w,CollapsibleTrigger as a,CollapsibleContent as y}from"./CollapsiblePrimitive.js";import{cn as R}from"../../utils/helpers.js";import S from"../Stack/index.js";import{jsx as l,jsxs as p}from"react/jsx-runtime";function k({trigger:e,children:b,open:o,onOpenChange:r,defaultOpen:s,disabled:m,showIcon:u=!1,iconStyle:t="plus-minus",className:d}){let[C,f]=I(()=>s||!1),n=o!==void 0,v=n?o:C,g=n?r:i=>{f(i),r?.(i)},h=()=>e?u?l(a,{asChild:!0,children:p(S,{as:"button",direction:"row",align:"center",justify:"between",className:"dndev-collapsible-trigger dndev-collapsible-trigger--button",children:[e,t==="chevron"?l(c,{className:"dndev-collapsible-icon dndev-collapsible-chevron","aria-hidden":"true"}):l(t==="chevron"?c:v?O:N,{className:"dndev-collapsible-icon","aria-hidden":"true"})]})}):T(e)&&e.type!==P?l(a,{asChild:!0,children:e}):l(a,{className:"dndev-collapsible-trigger dndev-collapsible-trigger--button",children:e}):null;return p(w,{open:n?o:void 0,onOpenChange:g,defaultOpen:n?void 0:s,disabled:m,className:R("dndev-collapsible",d),children:[h(),l(y,{className:d,children:b})]})}var V=k;export{V as default};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Floating component
|
|
3
|
+
* @description Container for one small control (a back link, a help button) that stays on
|
|
4
|
+
* screen while the page scrolls, at a corner of the page content area.
|
|
5
|
+
*
|
|
6
|
+
* @version 0.2.0
|
|
7
|
+
* @since 0.3.5
|
|
8
|
+
* @author AMBROISE PARK Consulting
|
|
9
|
+
*/
|
|
10
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
11
|
+
import './Floating.css';
|
|
12
|
+
/** Corner of the page content area the control sits in (logical: `start` / `end` follow RTL). */
|
|
13
|
+
export type FloatingPlacement = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
14
|
+
/** Props for Floating. Other div attributes (`className`, `aria-*`, `id`, ...) go to the container. */
|
|
15
|
+
export interface FloatingProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
/** The control, composed by the app (Button, Link...). */
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Corner the control sits in.
|
|
20
|
+
* @default 'top-start'
|
|
21
|
+
*/
|
|
22
|
+
placement?: FloatingPlacement;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Container for one small control that stays on screen while the page scrolls. It is as
|
|
26
|
+
* wide as its content; the rest of the page stays clickable. Layer `--z-header`, as
|
|
27
|
+
* ActionBar: above the page, below sheets, modals, floating menus and toasts. No motion.
|
|
28
|
+
* Not a landmark: give the control its own accessible name (visible text or `aria-label`).
|
|
29
|
+
*
|
|
30
|
+
* Top placements (`top-start`, `top-end`): in the page flow, `position: sticky`.
|
|
31
|
+
* - Place it first in the page (first child of `PageContainer`, before the first `Section`).
|
|
32
|
+
* - At rest: `--gap-md` above (below the header) and `--gap-md` below, then the page content:
|
|
33
|
+
* a ghost `Section` right after it drops its own top padding (Section.css), so the gap
|
|
34
|
+
* above the control and the gap to the Section's first line are both `--gap-md`, at every
|
|
35
|
+
* width. It takes its own space: nothing sits under it.
|
|
36
|
+
* - While scrolling: sticks `--gap-md` below the top of the scroll container (the layout
|
|
37
|
+
* `<main>`, under the header), until the end of its parent (the page).
|
|
38
|
+
* - Inline: the Section content gutter (`--section-gutter`: `--gap-md`, `--gap-lg` from 1024px); inside
|
|
39
|
+
* `PageContainer`, which already pads `--gap-md`, only the rest. Logical: RTL-aware.
|
|
40
|
+
* - SSR: rendered in place, in the server HTML; hydrates without a mismatch, shifts nothing.
|
|
41
|
+
*
|
|
42
|
+
* Bottom placements (`bottom-start`, `bottom-end`): `position: fixed`, portalled to `<body>`
|
|
43
|
+
* (a `contain: layout` or scrolling ancestor such as the layout `<main>` would otherwise
|
|
44
|
+
* capture `position: fixed`); they take no space, so leave room at the end of the page.
|
|
45
|
+
* - Block: `--gap-md` above the bottom edge, above the bottom safe area (iOS home indicator,
|
|
46
|
+
* with `viewport-fit=cover`) and above a shown `ActionBar` (`--action-bar-height`).
|
|
47
|
+
* - Inline: the Section gutter, after the sidebar on the start side (`--sidebar-width`),
|
|
48
|
+
* never inside the side safe areas.
|
|
49
|
+
* - SSR: renders nothing on the server and on the hydration render (the portal needs
|
|
50
|
+
* `document`); mounts right after hydration. Fixed, so its arrival shifts no layout.
|
|
51
|
+
*
|
|
52
|
+
* @component
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* <PageContainer>
|
|
56
|
+
* <Floating placement="top-start">
|
|
57
|
+
* <Button variant="outline" onClick={() => navigate('/catalogue')}>
|
|
58
|
+
* {t('catalogue.back')}
|
|
59
|
+
* </Button>
|
|
60
|
+
* </Floating>
|
|
61
|
+
* <Section>...</Section>
|
|
62
|
+
* </PageContainer>
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
declare function Floating({ children, placement, className, ...props }: FloatingProps): import("react").JSX.Element;
|
|
66
|
+
export default Floating;
|
|
67
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Floating/index.tsx"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvD,OAAO,gBAAgB,CAAC;AAExB,iGAAiG;AACjG,MAAM,MAAM,iBAAiB,GAC3B,WAAW,GAAG,SAAS,GAAG,cAAc,GAAG,YAAY,CAAC;AAE1D,uGAAuG;AACvG,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,cAAc,CAAC;IACnE,0DAA0D;IAC1D,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,iBAAS,QAAQ,CAAC,EAChB,QAAQ,EACR,SAAuB,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,aAAa,+BAcf;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{cn as a}from"../../utils/helpers.js";import{PortalPrimitive as l}from"../Portal/PortalPrimitive.js";import{jsx as e}from"react/jsx-runtime";function p({children:r,placement:t="top-start",className:i,...n}){let o=e("div",{...n,className:a("dndev-floating-control",i),"data-placement":t,children:r});return t==="top-start"||t==="top-end"?o:e(l,{asChild:!0,children:o})}var c=p;export{c as default};
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
*/
|
|
42
42
|
import { type ElementType, type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
43
43
|
import type { TextAlign } from '../../utils/constants';
|
|
44
|
+
import type { CSSPropertiesWithVars } from '../../utils/cssVars';
|
|
44
45
|
import './Grid.css';
|
|
45
46
|
/**
|
|
46
47
|
* Responsive columns array: [mobile, tablet, laptop, desktop]
|
|
@@ -56,6 +57,17 @@ export type ResponsiveTemplate = [string, string, string, string];
|
|
|
56
57
|
* Unified column type: equal columns (number) or custom template (string), static or responsive
|
|
57
58
|
*/
|
|
58
59
|
export type GridCols = number | string | ResponsiveCols | ResponsiveTemplate;
|
|
60
|
+
/**
|
|
61
|
+
* Turns a `GridCols` value into the inline style (column custom properties or
|
|
62
|
+
* template) and the `data-responsive*` flags that `Grid.css` reads. Shared by
|
|
63
|
+
* `Grid` and by components with a `gridCols` prop (Accordion), so one
|
|
64
|
+
* implementation maps the value to CSS.
|
|
65
|
+
*/
|
|
66
|
+
export declare function getGridColsProps(cols: GridCols): {
|
|
67
|
+
style: CSSPropertiesWithVars;
|
|
68
|
+
responsive: boolean;
|
|
69
|
+
responsiveTpl: boolean;
|
|
70
|
+
};
|
|
59
71
|
/**
|
|
60
72
|
* Grid-specific props (layout directives)
|
|
61
73
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Grid/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAGL,KAAK,WAAW,EA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IACH,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;IAE/C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;IAEjD;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC;IAEpC,cAAc;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,YAAY,GACjE,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAAC;AAErD;;;;;GAKG;AACH,QAAA,MAAM,IAAI,uHA2DT,CAAC;AAIF,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAElE,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createElement as
|
|
1
|
+
import{createElement as G,forwardRef as R}from"react";import{GAP_VARIANT as h}from"../../styles/componentConstants.js";import{cn as P}from"../../utils/helpers.js";import{default as k}from"./GridArea.js";function b(e){return Array.isArray(e)&&typeof e[0]=="number"}function x(e){return Array.isArray(e)&&typeof e[0]=="string"}function S(e){let i=b(e),o=x(e),t={};if(o)t["--grid-tpl-mobile"]=e[0],t["--grid-tpl-tablet"]=e[1],t["--grid-tpl-laptop"]=e[2],t["--grid-tpl-desktop"]=e[3];else if(typeof e=="string")t.gridTemplateColumns=e;else{let[p,d,r,a]=i?e:[e,e,e,e];t["--grid-cols-mobile"]=p,t["--grid-cols-tablet"]=d,t["--grid-cols-laptop"]=r,t["--grid-cols-desktop"]=a}return{style:t,responsive:i,responsiveTpl:o}}var g=R(({as:e="div",cols:i=1,gap:o=h.MEDIUM,align:t="stretch",justify:p="stretch",textAlign:d,areas:r,className:a,style:y,children:f,...u},c)=>{let v=e,{style:T,responsive:A,responsiveTpl:C}=S(i),m=Array.isArray(r),s={display:"grid",width:"100%",...y,...T};if(m){let n=l=>l.trim().startsWith('"')?l:`"${l}"`;s["--grid-areas-mobile"]=n(r[0]),s["--grid-areas-tablet"]=n(r[1]),s["--grid-areas-laptop"]=n(r[2]),s["--grid-areas-desktop"]=n(r[3])}else typeof r=="string"&&(s.gridTemplateAreas=r.trim().startsWith('"')?r:`"${r}"`);return G(v,{ref:c,className:P("dndev-grid-component",a),"data-gap":o,"data-align":t,"data-justify":p,"data-text-align":d||void 0,"data-responsive":A?"true":void 0,"data-responsive-tpl":C?"true":void 0,"data-responsive-areas":m?"true":void 0,style:s,...u},f)});g.displayName="Grid";var V=g;export{k as GridArea,V as default,S as getGridColsProps};
|
|
@@ -18,12 +18,21 @@ export interface ListItem {
|
|
|
18
18
|
/** Optional additional CSS classes for this item */
|
|
19
19
|
className?: string;
|
|
20
20
|
}
|
|
21
|
+
/** Marker style of a List. `'none'` hides every drawn marker (numbers, bullets) and keeps the list semantics. */
|
|
22
|
+
export type ListMarker = 'none';
|
|
21
23
|
/** Props for the List component -- bullet, numbered, or feature lists. */
|
|
22
24
|
export interface ListProps extends HTMLAttributes<HTMLUListElement | HTMLOListElement> {
|
|
23
25
|
/** Array of items (strings or objects) */
|
|
24
26
|
items?: (string | ReactNode | ListItem)[];
|
|
25
27
|
/** Whether to render as ordered list (numbers) */
|
|
26
28
|
ordered?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Hide the markers. `'none'` draws no number or bullet (e.g. steps already numbered by
|
|
31
|
+
* a caption) and sets `role="list"`, since Safari/VoiceOver drops list semantics when
|
|
32
|
+
* markers are hidden (https://webkit.org/b/170179). Absent: numbers when `ordered`, bullets otherwise.
|
|
33
|
+
* @example <List ordered marker="none" items={steps} />
|
|
34
|
+
*/
|
|
35
|
+
marker?: ListMarker;
|
|
27
36
|
/**
|
|
28
37
|
* Default icon for all string items.
|
|
29
38
|
* Individual ListItem.icon takes precedence.
|
|
@@ -68,7 +77,7 @@ export interface ListProps extends HTMLAttributes<HTMLUListElement | HTMLOListEl
|
|
|
68
77
|
* @param {ListProps} props - The props for the list
|
|
69
78
|
* @returns {JSX.Element} The rendered list component
|
|
70
79
|
*/
|
|
71
|
-
declare const List: ({ items, ordered, icon, gap, density, className, ...props }: ListProps) => import("react").JSX.Element;
|
|
80
|
+
declare const List: ({ items, ordered, marker, icon, gap, density, className, ...props }: ListProps) => import("react").JSX.Element;
|
|
72
81
|
export { GAP_VARIANT };
|
|
73
82
|
/** Union of available gap variant values. */
|
|
74
83
|
export type GapVariant = (typeof GAP_VARIANT)[keyof typeof GAP_VARIANT];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/List/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D,OAAO,YAAY,CAAC;AAEpB,iCAAiC;AACjC,MAAM,WAAW,QAAQ;IACvB,uCAAuC;IACvC,OAAO,EAAE,SAAS,CAAC;IACnB,gCAAgC;IAChC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,0EAA0E;AAC1E,MAAM,WAAW,SAAU,SAAQ,cAAc,CAC/C,gBAAgB,GAAG,gBAAgB,CACpC;IACC,0CAA0C;IAC1C,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC,EAAE,CAAC;IAC1C,kDAAkD;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAA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YAAY,CAAC;IACxD,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,IAAI,GAAI,qEASX,SAAS,gCA0DX,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,6CAA6C;AAC7C,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAExE,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{GAP_VARIANT as
|
|
1
|
+
import{GAP_VARIANT as u}from"../../styles/componentConstants.js";import{cn as l}from"../../utils/helpers.js";import{jsx as t,jsxs as d}from"react/jsx-runtime";var y=({items:p=[],ordered:o=!1,marker:r,icon:n,gap:c=u.TIGHT,density:m="default",className:f,...N})=>t(o?"ol":"ul",{className:l("dndev-list",f),"data-ordered":o?"true":void 0,"data-marker":r,role:r==="none"?"list":void 0,"data-gap":c,"data-density":m,...N,children:p.map((e,a)=>{if(typeof e=="string"||typeof e=="number")return n?d("li",{className:"dndev-list-item",children:[t("span",{className:"dndev-list-item-icon",children:n}),t("span",{className:"dndev-list-item-content",children:e})]},a):t("li",{className:"dndev-list-item","data-plain":"true",children:e},a);if(!e||typeof e!="object"||!("content"in e))return t("li",{className:"dndev-list-item","data-plain":"true",children:e},a);let s=e,i=s.icon??n;return d("li",{className:l("dndev-list-item",s.className),"data-plain":i?void 0:"true",children:[i&&t("span",{className:"dndev-list-item-icon",children:i}),t("span",{className:"dndev-list-item-content",children:s.content})]},a)})});var I=y;export{u as GAP_VARIANT,I as default};
|
|
@@ -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};
|
|
@@ -1,11 +1,39 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'react';
|
|
1
|
+
import type { HTMLAttributes, RefObject } from 'react';
|
|
2
2
|
import './QuantityStepper.css';
|
|
3
3
|
/** Props for the QuantityStepper component -- [ − qty + ] quantity control. */
|
|
4
4
|
export interface QuantityStepperProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'onChange'> {
|
|
5
5
|
/** Controlled quantity. Zero may be used as the initial, not-yet-added value. */
|
|
6
6
|
value: number;
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Enables native text editing; receives validated quantities on commit, not on each
|
|
9
|
+
* keystroke. Takes precedence over legacy callbacks. Return the write's promise to cancel
|
|
10
|
+
* the add's flight (`flyFrom` / `flyTo`) when it rejects. Handle the error in the caller:
|
|
11
|
+
* the stepper only uses the rejection to cancel the flight (it attaches a handler, so a
|
|
12
|
+
* returned promise never reports an unhandled rejection).
|
|
13
|
+
*/
|
|
14
|
+
onChange?: (value: number) => void | Promise<unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* Element flown onto `flyTo` on an add (card packshot, gallery image). Read at commit
|
|
17
|
+
* time, so a fresh ref per render works. Flight only with `flyTo` too, in editable
|
|
18
|
+
* (`onChange`) mode.
|
|
19
|
+
*/
|
|
20
|
+
flyFrom?: RefObject<Element | null>;
|
|
21
|
+
/**
|
|
22
|
+
* Landing target of the add's flight: a `flyTarget()` name (e.g. `'cart'`) or an element.
|
|
23
|
+
* Flight only with `flyFrom` too, and only in editable (`onChange`) mode: legacy callbacks
|
|
24
|
+
* write on every press-and-hold tick, so the count (and a target Button `badge`) would
|
|
25
|
+
* move during the hold; they never fly. The flight starts when the add is committed (a
|
|
26
|
+
* click, the release of a hold, a typed or keyed higher value), before `onChange`, so a
|
|
27
|
+
* Button `badge` inside the target holds the new count until the image lands, then pops.
|
|
28
|
+
* Uses `flyTo` (no flight under reduced motion, or with an unrendered source or an
|
|
29
|
+
* off-screen target).
|
|
30
|
+
*/
|
|
31
|
+
flyTo?: string | Element;
|
|
32
|
+
/**
|
|
33
|
+
* Fly on every committed increase. Off: only on the first add (0 → first lot). Decreases
|
|
34
|
+
* never fly. @default false
|
|
35
|
+
*/
|
|
36
|
+
flyEveryAdd?: boolean;
|
|
9
37
|
/** First positive quantity (safe integer). @default 1 */
|
|
10
38
|
min?: number;
|
|
11
39
|
/** Lot size (positive safe integer); valid quantities are min + k * step. @default 1 */
|
|
@@ -16,6 +44,14 @@ export interface QuantityStepperProps extends Omit<HTMLAttributes<HTMLDivElement
|
|
|
16
44
|
allowZero?: boolean;
|
|
17
45
|
/** Shows only a square + at zero (inline end), reserving the block size; expanding animates the inline size. @default false */
|
|
18
46
|
collapseWhenZero?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Visible text of the collapsed control (with `collapseWhenZero`), e.g. "Add". At zero the
|
|
49
|
+
* control is then one "+ label" button over the expanded footprint (fullWidth: the full
|
|
50
|
+
* width) instead of the square +; the first + crossfades it into [ − qty + ] with no size
|
|
51
|
+
* change. Keep it one short word (it ellipsizes); `incrementLabel` stays the accessible
|
|
52
|
+
* name, so include this text in it (WCAG 2.5.3). Ignored with `vertical`.
|
|
53
|
+
*/
|
|
54
|
+
addLabel?: string;
|
|
19
55
|
/** Stack the controls: plus, quantity, minus (also DOM and tab order). @default false */
|
|
20
56
|
vertical?: boolean;
|
|
21
57
|
/** Called by −. Omit to disable − (at the minimum). */
|
|
@@ -48,6 +84,8 @@ export interface QuantityStepperProps extends Omit<HTMLAttributes<HTMLDivElement
|
|
|
48
84
|
* the value. Legacy mode uses direction callbacks; additive onChange mode owns lot
|
|
49
85
|
* normalization and offers an uncontrolled text spinbutton committed on blur/Enter.
|
|
50
86
|
* onChange takes precedence over the legacy direction and value-click callbacks.
|
|
87
|
+
* In onChange mode, `flyFrom` + `flyTo` fly an image onto the cart on a committed add (one
|
|
88
|
+
* flight per commit: a hold of any length flies once, on release).
|
|
51
89
|
*
|
|
52
90
|
* @component
|
|
53
91
|
* @example
|
|
@@ -62,6 +100,6 @@ export interface QuantityStepperProps extends Omit<HTMLAttributes<HTMLDivElement
|
|
|
62
100
|
* />
|
|
63
101
|
* ```
|
|
64
102
|
*/
|
|
65
|
-
declare const QuantityStepper: ({ value, onDecrement, onIncrement, onValueClick, onChange, min, step, max, allowZero, collapseWhenZero, vertical, disabled, fullWidth, decrementLabel, incrementLabel, valueLabel, className, onBlur, ...props }: QuantityStepperProps) => import("react").JSX.Element;
|
|
103
|
+
declare const QuantityStepper: ({ value, onDecrement, onIncrement, onValueClick, onChange, flyFrom, flyTo, flyEveryAdd, min, step, max, allowZero, collapseWhenZero, addLabel, vertical, disabled, fullWidth, decrementLabel, incrementLabel, valueLabel, className, onBlur, ...props }: QuantityStepperProps) => import("react").JSX.Element;
|
|
66
104
|
export default QuantityStepper;
|
|
67
105
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/QuantityStepper/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAA4B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/QuantityStepper/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAA4B,SAAS,EAAE,MAAM,OAAO,CAAC;AAOjF,OAAO,uBAAuB,CAAC;AAM/B,+EAA+E;AAC/E,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACrG,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtD;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IACpC;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yDAAyD;IACzD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+HAA+H;IAC/H,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAC;IACrB,2BAA2B;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,2BAA2B;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAUD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,eAAe,GAAI,yPAwBtB,oBAAoB,gCAqQtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useEffect as H,useRef as p,useState as
|
|
1
|
+
"use client";import{useEffect as H,useRef as p,useState as ue}from"react";import{Minus as oe,Plus as $}from"lucide-react";import{flyTo as se}from"../../utils/flyTo.js";import{cn as ce}from"../../utils/helpers.js";import{moveQuantity as S,normalizeQuantity as w,quantityRules as le}from"./quantity.js";import{jsx as l,jsxs as G}from"react/jsx-runtime";var de=400,A=150;function g(t,d){t&&(t.value=String(d),t.setAttribute("aria-valuenow",String(d)),t.removeAttribute("aria-invalid"))}var fe=({value:t,onDecrement:d,onIncrement:T,onValueClick:q,onChange:b,flyFrom:J,flyTo:N,flyEveryAdd:X=!1,min:y=1,step:R=1,max:I,allowZero:m=!1,collapseWhenZero:v=!1,addLabel:B,vertical:M=!1,disabled:u=!1,fullWidth:Z=!1,decrementLabel:ee,incrementLabel:te,valueLabel:C,className:ne,onBlur:re,...Q})=>{let f=p(null),P=p(null),L=p(null),[K,O]=ue(!1),a=v&&t===0,h=v&&B!==void 0&&!M,n=b?le(y,R,I,m):void 0;if(n&&(!Number.isSafeInteger(t)||t<0||t!==0&&(t<n.min||t>n.max||(t-n.min)%n.step!==0)))throw new RangeError("QuantityStepper value must be zero or a complete lot within its bounds.");H(()=>{g(f.current,t)},[t,y,R,I,m,b!==void 0]),H(()=>{let e=L.current,r=e?.ownerDocument.activeElement;a&&r&&e?.contains(r)&&r!==P.current&&P.current?.focus()},[a]);let o=p(null),E=p(!1),x=p({onIncrement:T,onDecrement:d});x.current={onIncrement:T,onDecrement:d},H(()=>{u&&o.current&&(clearTimeout(o.current.timer),o.current=null)},[u]),H(()=>()=>{o.current&&clearTimeout(o.current.timer)},[]);let k=e=>{if(g(f.current,t),u||e===t||!b)return;let r=J?.current,s=r&&N!==void 0&&e>t&&(X||t===0)?se(r,N):null,i=b(e);i instanceof Promise&&i.catch(()=>s?.cancel())},_=e=>{if(!n||u||a||e.value===String(t))return;let r=w(e.value,n);g(e,t),r!==void 0&&k(r)},ie=e=>{n&&e.button===0&&!e.currentTarget.disabled&&e.preventDefault()},U=()=>{let e=f.current?.value;return!n||e===void 0||e===String(t)?t:w(e,n)??t},z=e=>{!n||u||k(S(U(),e,1,n))},ae=(e,r)=>{if(ie(r),r.button!==0||r.currentTarget.disabled||u)return;o.current&&clearTimeout(o.current.timer),h&&a&&r.currentTarget.setPointerCapture?.(r.pointerId),E.current=!1;let s=()=>{let i=o.current;if(i){if(n){let c=S(i.draft,e,1,n);if(c===i.draft)return;i.draft=c,g(f.current,c),L.current?.removeAttribute("data-collapsed")}else{let c=e===1?x.current.onIncrement:x.current.onDecrement;if(!c)return;c()}E.current=!0,i.ticks+=1,i.timer=setTimeout(s,i.ticks<5?A:i.ticks<15?A/2:A/4)}};o.current={timer:setTimeout(s,de),draft:U(),ticks:0}},D=()=>{let e=o.current;e&&(clearTimeout(e.timer),o.current=null,n&&e.ticks>0&&k(e.draft))},F=e=>({onPointerDown:r=>ae(e,r),onPointerUp:D,onPointerLeave:D,onPointerCancel:D,onContextMenu:r=>r.preventDefault()}),W=()=>{let e=E.current;return E.current=!1,e},j=l("button",{type:"button",className:"dndev-quantity-stepper-decrement","aria-label":ee,"aria-hidden":a||void 0,tabIndex:a?-1:void 0,disabled:u||(n?(!K||a)&&t<=(m?0:y):!d),...F(-1),onClick:e=>{W()?e.currentTarget.focus():n?(z(-1),e.currentTarget.focus()):d?.()},children:l(oe,{"aria-hidden":"true",focusable:"false"})},"minus"),V=G("button",{ref:P,type:"button",className:"dndev-quantity-stepper-increment","aria-label":te,disabled:u||(n?!K&&t>=n.max:!T),...F(1),onClick:e=>{W()?e.currentTarget.focus():n?(z(1),e.currentTarget.focus()):T?.()},children:[l($,{"aria-hidden":"true",focusable:"false"}),h&&G("span",{className:"dndev-quantity-stepper-add","aria-hidden":"true",children:[l($,{"aria-hidden":"true",focusable:"false"}),l("span",{className:"dndev-quantity-stepper-add-text",children:B})]})]},"plus"),Y=b?l("input",{ref:f,className:"dndev-quantity-stepper-value",type:"text",inputMode:"numeric",enterKeyHint:"done",autoComplete:"off",spellCheck:!1,pattern:"[0-9]*",role:"spinbutton","aria-label":C??Q["aria-label"],"aria-valuemin":m||t===0?0:y,"aria-valuemax":n?.max,"aria-valuenow":t,"aria-hidden":a||void 0,tabIndex:a?-1:void 0,disabled:u,defaultValue:t,onFocus:e=>{O(!0),e.currentTarget.select()},onInput:e=>{if(!n||u||a)return;let r=e.currentTarget,s=r.value.trim(),i=Number(s),c=/^\d+$/.test(s)&&Number.isSafeInteger(i);c?r.setAttribute("aria-valuenow",String(i)):r.removeAttribute("aria-valuenow"),c&&(i===0?m||t===0:i>=n.min&&i<=n.max&&(i-n.min)%n.step===0)?r.removeAttribute("aria-invalid"):r.setAttribute("aria-invalid","true")},onKeyDown:e=>{if(e.nativeEvent.isComposing||e.altKey||e.ctrlKey||e.metaKey||!n)return;let r=e.currentTarget;if(e.key==="Escape")e.preventDefault(),g(r,t);else if(e.key==="Enter")e.preventDefault(),_(r);else if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();let s=r.value===String(t)?t:w(r.value,n)??t,i=e.key==="Home"?m?0:y:e.key==="End"?n.max:S(s,e.key==="ArrowDown"||e.key==="PageDown"?-1:1,e.key.startsWith("Page")?10:1,n);k(i)}}},"quantity"):q?l("button",{type:"button",className:"dndev-quantity-stepper-value","aria-label":C,"aria-hidden":a||void 0,tabIndex:a?-1:void 0,disabled:u,onClick:q,children:t},"quantity"):l("output",{className:"dndev-quantity-stepper-value","aria-live":"polite","aria-hidden":a||void 0,children:t},"quantity");return l("div",{...Q,ref:L,role:"group",onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(O(!1),f.current&&_(f.current)),re?.(e)},className:ce("dndev-quantity-stepper",ne),"data-full-width":Z||void 0,"data-disabled":u||void 0,"data-collapsed":a||void 0,"data-add-label":h||void 0,"data-vertical":M||void 0,children:M?[V,Y,j]:[j,Y,V]})},Ee=fe;export{Ee as default};
|
|
@@ -32,6 +32,15 @@ export interface SectionOwnProps {
|
|
|
32
32
|
* @default 'h2'
|
|
33
33
|
*/
|
|
34
34
|
titleAs?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
35
|
+
/**
|
|
36
|
+
* Controls at the end of the title row, beside the heading (never inside the
|
|
37
|
+
* collapsible trigger; clicking them does not toggle the section). On a narrow
|
|
38
|
+
* row they wrap under the heading, aligned to the start. Without `title`, the
|
|
39
|
+
* row holds only the actions. Absent: no wrapper, markup unchanged.
|
|
40
|
+
*
|
|
41
|
+
* @example <Section title="Routines" actions={<Link href="/routines">See all</Link>}>...</Section>
|
|
42
|
+
*/
|
|
43
|
+
actions?: ReactNode;
|
|
35
44
|
/** Show separator above section @default false */
|
|
36
45
|
separator?: boolean;
|
|
37
46
|
/** Tone system for visual rhythm */
|
|
@@ -75,7 +84,9 @@ export interface SectionOwnProps {
|
|
|
75
84
|
*/
|
|
76
85
|
bleed?: boolean;
|
|
77
86
|
/**
|
|
78
|
-
* Whether the section is collapsible
|
|
87
|
+
* Whether the section is collapsible. The title heading wraps a `<button>`
|
|
88
|
+
* trigger (keyboard: Tab, Enter, Space; `aria-expanded`). Closed content
|
|
89
|
+
* stays in the server HTML (crawlable), hidden with `display: none`; opening fades in.
|
|
79
90
|
* @default false
|
|
80
91
|
*/
|
|
81
92
|
collapsible?: boolean;
|
|
@@ -119,6 +130,9 @@ export type SectionProps<T extends ElementType = 'section'> = SectionOwnProps &
|
|
|
119
130
|
*
|
|
120
131
|
* **Bleed:** `bleed` breaks out of PageContainer to span full viewport width.
|
|
121
132
|
*
|
|
133
|
+
* **Nested:** a Section inside another Section's content is flush (no own padding, width or centring; a `tone` other than `ghost` keeps its padding).
|
|
134
|
+
* **Consecutive:** a `ghost` Section directly after a `ghost` Section has no top padding, so the two share one gap (`--gap-lg`) instead of doubling it; a toned Section keeps its padding on both sides.
|
|
135
|
+
*
|
|
122
136
|
* @component
|
|
123
137
|
* @example
|
|
124
138
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atomic/Section/index.tsx"],"names":[],"mappings":"AA2CA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAQ,KAAK,IAAI,EAAE,KAAK,SA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,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAEhD;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAEvC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,WAAW,GAAG,SAAS,IAAI,eAAe,GAC3E,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,MAAM,eAAe,CAAC,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,QAAA,MAAM,OAAO,8HAsIZ,CAAC;AAIF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{CirclePlus as
|
|
1
|
+
"use client";import{CirclePlus as _,CircleMinus as k}from"lucide-react";import{createElement as M,forwardRef as j,useState as V}from"react";import{GAP_VARIANT as L}from"../../styles/componentConstants.js";import{TONE as U}from"../../utils/constants.js";import{cn as q}from"../../utils/helpers.js";import{CollapsiblePrimitive as z,CollapsibleTrigger as B,CollapsibleContent as F}from"../Collapsible/CollapsiblePrimitive.js";import J from"../Grid/index.js";import K,{SEPARATOR_VARIANT as Q}from"../Separator/index.js";import X from"../Stack/index.js";import v from"../Text/index.js";import{Fragment as g,jsx as e,jsxs as n}from"react/jsx-runtime";var de={STANDARD:"standard",DOCS:"docs",NARROW:"narrow"},u=j(function({as:O="section",children:a,title:o,titleAs:s="h2",actions:r,separator:y=!1,tone:b=U.GHOST,textAlign:S="center",align:d,justify:A,bleed:E=!1,gridCols:l,gridGap:R,collapsible:t=!1,open:c,onOpenChange:x,defaultOpen:p=!1,contentWidth:P,className:w,...m},W){let D=O,[G,I]=V(()=>t?p:!1),i=t&&c!==void 0,f=i?c:G,C=i?x:I,T=l?e(J,{cols:l,gap:R||L.MEDIUM,align:d,children:a}):a,h=o&&(t?e(v,{as:s,level:"h2",className:"dndev-section-title",children:e(B,{asChild:!0,children:n(X,{as:"button",direction:"row",align:"center",justify:"between",className:"dndev-section-title-trigger",children:[o,f?e(k,{className:"dndev-section-icon","aria-hidden":"true"}):e(_,{className:"dndev-section-icon","aria-hidden":"true"})]})})}):e(v,{as:s,level:"h2",className:"dndev-section-title",children:o})),N=r?n("div",{className:"dndev-section-header","data-collapsible":t&&o?"true":void 0,children:[h,e("div",{className:"dndev-section-actions",children:r})]}):h,H=t?n(z,{...i?{open:f,onOpenChange:C}:{defaultOpen:p,onOpenChange:C},children:[N,e(F,{children:T})]}):n(g,{children:[N,T]});return M(D,{ref:W,"aria-label":m["aria-label"],className:q("dndev-section-full-width",E&&"dndev-section-bleed",w),"data-tone":b,"data-text-align":S,...m},n(g,{children:[y&&e(K,{variant:Q.ACCENT}),e("div",{className:"dndev-section-content","data-content-width":P||void 0,"data-align":d||void 0,"data-justify":A||void 0,children:H})]}))});u.displayName="Section";var le=u;export{de as CONTENT_WIDTH,le 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';
|