@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.
Files changed (88) hide show
  1. package/dist/advanced/ImageGallery/ImageGallery.d.ts +16 -4
  2. package/dist/advanced/ImageGallery/ImageGallery.d.ts.map +1 -1
  3. package/dist/advanced/ImageGallery/ImageGallery.js +1 -1
  4. package/dist/advanced/ImageGallery/snapStrip.d.ts +6 -0
  5. package/dist/advanced/ImageGallery/snapStrip.d.ts.map +1 -1
  6. package/dist/advanced/ImageGallery/snapStrip.js +1 -1
  7. package/dist/atomic/Accordion/AccordionPrimitive.d.ts +7 -0
  8. package/dist/atomic/Accordion/AccordionPrimitive.d.ts.map +1 -1
  9. package/dist/atomic/Accordion/AccordionPrimitive.js +1 -1
  10. package/dist/atomic/Accordion/index.d.ts +18 -2
  11. package/dist/atomic/Accordion/index.d.ts.map +1 -1
  12. package/dist/atomic/Accordion/index.js +1 -1
  13. package/dist/atomic/ActionBar/index.d.ts +66 -0
  14. package/dist/atomic/ActionBar/index.d.ts.map +1 -0
  15. package/dist/atomic/ActionBar/index.js +1 -0
  16. package/dist/atomic/Button/IconBadge.d.ts +18 -0
  17. package/dist/atomic/Button/IconBadge.d.ts.map +1 -0
  18. package/dist/atomic/Button/IconBadge.js +1 -0
  19. package/dist/atomic/Button/index.d.ts +10 -7
  20. package/dist/atomic/Button/index.d.ts.map +1 -1
  21. package/dist/atomic/Button/index.js +1 -1
  22. package/dist/atomic/Card/cover.d.ts +11 -3
  23. package/dist/atomic/Card/cover.d.ts.map +1 -1
  24. package/dist/atomic/Card/cover.js +1 -1
  25. package/dist/atomic/Card/index.d.ts +16 -1
  26. package/dist/atomic/Card/index.d.ts.map +1 -1
  27. package/dist/atomic/Card/index.js +1 -1
  28. package/dist/atomic/Collapsible/CollapsiblePrimitive.d.ts +6 -0
  29. package/dist/atomic/Collapsible/CollapsiblePrimitive.d.ts.map +1 -1
  30. package/dist/atomic/Collapsible/CollapsiblePrimitive.js +1 -1
  31. package/dist/atomic/Collapsible/index.d.ts +3 -1
  32. package/dist/atomic/Collapsible/index.d.ts.map +1 -1
  33. package/dist/atomic/Collapsible/index.js +1 -1
  34. package/dist/atomic/Floating/index.d.ts +67 -0
  35. package/dist/atomic/Floating/index.d.ts.map +1 -0
  36. package/dist/atomic/Floating/index.js +1 -0
  37. package/dist/atomic/Grid/index.d.ts +12 -0
  38. package/dist/atomic/Grid/index.d.ts.map +1 -1
  39. package/dist/atomic/Grid/index.js +1 -1
  40. package/dist/atomic/List/index.d.ts +10 -1
  41. package/dist/atomic/List/index.d.ts.map +1 -1
  42. package/dist/atomic/List/index.js +1 -1
  43. package/dist/atomic/PasswordInput/index.d.ts +10 -1
  44. package/dist/atomic/PasswordInput/index.d.ts.map +1 -1
  45. package/dist/atomic/PasswordInput/index.js +1 -1
  46. package/dist/atomic/PinInput/index.d.ts +26 -18
  47. package/dist/atomic/PinInput/index.d.ts.map +1 -1
  48. package/dist/atomic/PinInput/index.js +1 -1
  49. package/dist/atomic/QuantityStepper/index.d.ts +42 -4
  50. package/dist/atomic/QuantityStepper/index.d.ts.map +1 -1
  51. package/dist/atomic/QuantityStepper/index.js +1 -1
  52. package/dist/atomic/Section/index.d.ts +15 -1
  53. package/dist/atomic/Section/index.d.ts.map +1 -1
  54. package/dist/atomic/Section/index.js +1 -1
  55. package/dist/atomic/Sheet/index.d.ts +7 -1
  56. package/dist/atomic/Sheet/index.d.ts.map +1 -1
  57. package/dist/atomic/Sheet/index.js +1 -1
  58. package/dist/atomic/Text/index.d.ts +15 -2
  59. package/dist/atomic/Text/index.d.ts.map +1 -1
  60. package/dist/atomic/Text/index.js +2 -2
  61. package/dist/atomic/Tooltip/TooltipPrimitive.d.ts +5 -0
  62. package/dist/atomic/Tooltip/TooltipPrimitive.d.ts.map +1 -1
  63. package/dist/atomic/Tooltip/TooltipPrimitive.js +1 -1
  64. package/dist/atomic/index.d.ts +4 -2
  65. package/dist/atomic/index.d.ts.map +1 -1
  66. package/dist/atomic/index.js +1 -1
  67. package/dist/index.js +1 -1
  68. package/dist/styles/index.css +689 -119
  69. package/dist/symbol-index.json +1 -1
  70. package/dist/utils/flights.d.ts +30 -0
  71. package/dist/utils/flights.d.ts.map +1 -0
  72. package/dist/utils/flights.js +1 -0
  73. package/dist/utils/flyTo.d.ts +45 -0
  74. package/dist/utils/flyTo.d.ts.map +1 -0
  75. package/dist/utils/flyTo.js +1 -0
  76. package/dist/utils/index.d.ts +1 -0
  77. package/dist/utils/index.d.ts.map +1 -1
  78. package/dist/utils/index.js +1 -1
  79. package/dist/utils/responsiveImage.d.ts +64 -9
  80. package/dist/utils/responsiveImage.d.ts.map +1 -1
  81. package/dist/utils/responsiveImage.js +1 -1
  82. package/guidelines/API_REFERENCE.md +5 -2
  83. package/guidelines/COMPONENTS.md +15 -11
  84. package/guidelines/QUANTITY_STEPPER.md +25 -3
  85. package/package.json +1 -1
  86. package/dist/atomic/PortalButton/index.d.ts +0 -32
  87. package/dist/atomic/PortalButton/index.d.ts.map +0 -1
  88. 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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AW,EACX,QAAQ,EACR,QAAgB,EAChB,SAAwB,EACxB,SAAS,GACV,EAAE,gBAAgB,+BA2ElB;AAED,eAAe,WAAW,CAAC"}
@@ -1 +1 @@
1
- "use client";import{CirclePlus as O,CircleMinus as P,ChevronDown as c}from"lucide-react";import{Fragment as T,isValidElement as I,useState as w}from"react";import{CollapsiblePrimitive as y,CollapsibleTrigger as a,CollapsibleContent as R}from"./CollapsiblePrimitive.js";import{cn as p}from"../../utils/helpers.js";import S from"../Stack/index.js";import{jsx as l,jsxs as b}from"react/jsx-runtime";function k({trigger:e,children:m,open:o,onOpenChange:t,defaultOpen:r,disabled:u,showIcon:C=!1,iconStyle:s="plus-minus",className:d}){let[f,v]=w(()=>r||!1),n=o!==void 0,g=n?o:f,h=n?t:i=>{v(i),t?.(i)},N=()=>e?C?l(a,{asChild:!0,children:b(S,{as:"button",direction:"row",align:"center",justify:"between",className:"dndev-collapsible-trigger dndev-collapsible-trigger--button",children:[e,s==="chevron"?l(c,{className:"dndev-collapsible-icon dndev-collapsible-chevron","aria-hidden":"true"}):l(s==="chevron"?c:g?P:O,{className:"dndev-collapsible-icon","aria-hidden":"true"})]})}):I(e)&&e.type!==T?l(a,{asChild:!0,children:e}):l(a,{className:"dndev-collapsible-trigger dndev-collapsible-trigger--button",children:e}):null;return b(y,{open:n?o:void 0,onOpenChange:h,defaultOpen:n?void 0:r,disabled:u,className:p("dndev-collapsible",d),children:[N(),l(R,{className:p("dndev-collapsible-content",d),children:m})]})}var V=k;export{V as default};
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,EAChB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,YAAY,CAAC;AAEpB;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,cAAc,GAAG,kBAAkB,CAAC;AAY7E;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IAEjB;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAEhB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAE5C;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAA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x}from"react";import{GAP_VARIANT as b}from"../../styles/componentConstants.js";import{cn as P}from"../../utils/helpers.js";import{default as M}from"./GridArea.js";function E(s){return Array.isArray(s)&&typeof s[0]=="number"}function w(s){return Array.isArray(s)&&typeof s[0]=="string"}var a=x(({as:s="div",cols:r=1,gap:l=b.MEDIUM,align:m="stretch",justify:g="stretch",textAlign:f,areas:i,className:y,style:u,children:c,...A},R)=>{let T=s,o=E(r),p=w(r),v=typeof r=="string",d=Array.isArray(i),e={display:"grid",width:"100%",...u};if(p){let t=r;e["--grid-tpl-mobile"]=t[0],e["--grid-tpl-tablet"]=t[1],e["--grid-tpl-laptop"]=t[2],e["--grid-tpl-desktop"]=t[3]}else if(v)e.gridTemplateColumns=r;else{let[t,n,G,C]=o?r:[r,r,r,r];e["--grid-cols-mobile"]=t,e["--grid-cols-tablet"]=n,e["--grid-cols-laptop"]=G,e["--grid-cols-desktop"]=C}if(d){let t=n=>n.trim().startsWith('"')?n:`"${n}"`;e["--grid-areas-mobile"]=t(i[0]),e["--grid-areas-tablet"]=t(i[1]),e["--grid-areas-laptop"]=t(i[2]),e["--grid-areas-desktop"]=t(i[3])}else typeof i=="string"&&(e.gridTemplateAreas=i.trim().startsWith('"')?i:`"${i}"`);return h(T,{ref:R,className:P("dndev-grid-component",y),"data-gap":l,"data-align":m,"data-justify":g,"data-text-align":f||void 0,"data-responsive":o?"true":void 0,"data-responsive-tpl":p?"true":void 0,"data-responsive-areas":d?"true":void 0,style:e,...A},c)});a.displayName="Grid";var O=a;export{M as GridArea,O as default};
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,SAAS,CAAC;I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IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,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 f}from"../../styles/componentConstants.js";import{cn as r}from"../../utils/helpers.js";import{jsx as t,jsxs as l}from"react/jsx-runtime";var y=({items:c=[],ordered:o=!1,icon:a,gap:d=f.TIGHT,density:p="default",className:m,...N})=>t(o?"ol":"ul",{className:r("dndev-list",m),"data-ordered":o?"true":void 0,"data-gap":d,"data-density":p,...N,children:c.map((e,s)=>{if(typeof e=="string"||typeof e=="number")return a?l("li",{className:"dndev-list-item",children:[t("span",{className:"dndev-list-item-icon",children:a}),t("span",{className:"dndev-list-item-content",children:e})]},s):t("li",{className:"dndev-list-item",children:e},s);if(!e||typeof e!="object"||!("content"in e))return t("li",{className:"dndev-list-item",children:e},s);let n=e,i=n.icon??a;return l("li",{className:r("dndev-list-item",n.className),children:[i&&t("span",{className:"dndev-list-item-icon",children:i}),t("span",{className:"dndev-list-item-content",children:n.content})]},s)})});var v=y;export{f as GAP_VARIANT,v as default};
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;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,QAAA,MAAM,aAAa,GAAI,oIAYpB,kBAAkB,gCAuEpB,CAAC;AAEF,eAAe,aAAa,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 h}from"lucide-react";import{useState as N,useId as P}from"react";import{cn as x}from"../../utils/helpers.js";import{FloatingLabel as F}from"../Label/index.js";import{jsx as e,jsxs as V}from"react/jsx-runtime";var H=({className:b,visible:i,onVisibilityChange:u,label:s,info:p,value:c,onFocus:m,onBlur:f,required:o,id:g,...n})=>{let v=P(),d=g??v,[w,y]=N(!1),t=i!==void 0?i:w,a=!!s,I=()=>{let l=!t;i===void 0&&y(l),u?.(l)},r=V("div",{className:"dndev-relative",children:[e("input",{id:d,type:t?"text":"password",value:c,className:x("dndev-input","dndev-password-input-with-toggle",b),"data-bare":a||void 0,onFocus:m,onBlur:f,required:o,...n}),e("button",{type:"button",className:"dndev-password-toggle-button",onClick:I,"aria-label":t?"Hide password":"Show password","aria-describedby":n["aria-describedby"],tabIndex:-1,children:t?e(h,{className:"dndev-size-md dndev-password-toggle-icon"}):e(L,{className:"dndev-size-md dndev-password-toggle-icon"})})]});return a?e(F,{htmlFor:d,label:s,info:p,disabled:n.disabled,required:o,children:r}):r},q=H;export{q as default};
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 once when the user has entered the final digit. */
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
- /** Floating label rendered above the group. */
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
- /** Auto-focus the first box on mount. */
37
+ /** Focus the input on mount, and again when it is re-enabled. */
38
38
  autoFocus?: boolean;
39
39
  /**
40
- * Template for per-digit ARIA label. Receives 1-based index + length.
41
- * Default: `Digit {n} of {length}` — override to localize.
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-digit PIN / OTP input. Renders `length` single-character boxes with
57
- * auto-advance on entry, backspace focus retreat, SMS paste handling,
58
- * and an optional `onComplete` callback that fires when the user
59
- * enters the final digit.
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
- * Opinionated: numeric by default (set `numericOnly={false}` for
62
- * alphanumeric OTPs), uses `autoComplete="one-time-code"` for iOS/Android
63
- * SMS autofill, respects RTL via logical CSS properties, and ships a
64
- * shake animation hook via `data-shake` on the container.
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.1.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 with mask
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":"AAgBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAKjD,OAAO,gBAAgB,CAAC;AAExB,mEAAmE;AACnE,MAAM,WAAW,aAAc,SAAQ,IAAI,CACzC,mBAAmB,CAAC,gBA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A,MAAM,QAAQ,GAAI,8RAyBf,aAAa,gCA2Jf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- "use client";import{Eye as q,EyeOff as S}from"lucide-react";import{useEffect as M,useId as j,useRef as B,useState as O}from"react";import{cn as A}from"../../utils/helpers.js";import{FloatingLabel as V}from"../Label/index.js";import{jsx as u,jsxs as G}from"react/jsx-runtime";var Z=({value:s,onChange:l,onComplete:d,length:r=4,mask:g=!0,hideMaskToggle:T=!1,shake:D=!1,numericOnly:f=!0,label:p,info:E,required:b,autoFocus:N,disabled:a,className:P,digitAriaLabel:v,revealAriaLabel:y,"aria-label":_,...H})=>{let I=j(),n=B([]),[c,F]=O(!1),R=g&&!c;n.current.length!==r&&(n.current=Array.from({length:r},(t,e)=>n.current[e]??null)),M(()=>{N&&!a&&n.current[0]?.focus()},[]),M(()=>{s.length===0&&!a&&n.current[0]?.focus()},[s,a]);let h=t=>t?f?/^\d$/.test(t):/^[A-Za-z0-9]$/.test(t):!1,k=t=>{let e=t.slice(0,r);l(e),e.length===r&&d&&d(e)},w=(t,e)=>{if(e.length>1){let m=Array.from(e).filter(h).join("").slice(0,r);if(m.length){k(m);let K=Math.min(m.length,r-1);n.current[K]?.focus()}return}if(e&&!h(e))return;let i=s.padEnd(r," ").split("");i[t]=e||" ";let o=i.join("").replace(/ /g,"").slice(0,r);k(o),e&&t<r-1&&n.current[t+1]?.focus()},C=(t,e)=>{if(e.key==="Backspace"){let i=s.split("");!i[t]&&t>0?(e.preventDefault(),n.current[t-1]?.focus(),l(s.slice(0,t-1))):i[t]&&(e.preventDefault(),l(s.slice(0,t)))}else e.key==="ArrowLeft"&&t>0?(e.preventDefault(),n.current[t-1]?.focus()):e.key==="ArrowRight"&&t<r-1&&(e.preventDefault(),n.current[t+1]?.focus())},$=g&&!T,z=()=>F(t=>!t),L=G("div",{className:A("dndev-pin-input",P),"data-shake":D?"true":void 0,role:"group","aria-label":_??p??"PIN input",children:[Array.from({length:r}).map((t,e)=>{let i=s[e]??"";return u("input",{id:e===0?I:void 0,ref:o=>{n.current[e]=o},type:"text",inputMode:f?"numeric":"text",pattern:f?"[0-9]*":void 0,maxLength:e===0?r:1,autoComplete:e===0?"one-time-code":"off",value:i,disabled:a,required:b&&e===0,"aria-label":v?v(e+1,r):`Digit ${e+1} of ${r}`,className:A("dndev-input dndev-pin-input__box",R&&"dndev-pin-input__box--masked"),onChange:o=>w(e,o.target.value),onKeyDown:o=>C(e,o),onFocus:o=>{o.currentTarget.value&&o.currentTarget.select()},...H},e)}),$?u("button",{type:"button",className:"dndev-pin-input__reveal",onClick:z,"aria-label":c?y?.hide??"Hide PIN":y?.show??"Show PIN","aria-pressed":c,tabIndex:-1,children:c?u(S,{className:"dndev-size-md"}):u(q,{className:"dndev-size-md"})}):null]});return p?u(V,{htmlFor:I,label:p,info:E,disabled:a,required:b,children:L}):L},X=Z;export{X as default};
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
- /** Enables native text editing; receives validated quantities on commit, not on each keystroke. Takes precedence over legacy callbacks. */
8
- onChange?: (value: number) => void;
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;AAMtE,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,2IAA2I;IAC3I,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,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,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,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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 Z}from"react";import{Minus as tt,Plus as et}from"lucide-react";import{cn as nt}from"../../utils/helpers.js";import{moveQuantity as P,normalizeQuantity as S,quantityRules as rt}from"./quantity.js";import{jsx as c}from"react/jsx-runtime";var it=400,h=150;function y(e,l){e&&(e.value=String(l),e.setAttribute("aria-valuenow",String(l)),e.removeAttribute("aria-invalid"))}var ut=({value:e,onDecrement:l,onIncrement:g,onValueClick:w,onChange:T,min:b=1,step:A=1,max:q,allowZero:m=!1,collapseWhenZero:F=!1,vertical:v=!1,disabled:a=!1,fullWidth:V=!1,decrementLabel:Y,incrementLabel:$,valueLabel:N,className:G,onBlur:J,...B})=>{let d=p(null),M=p(null),L=p(null),[C,I]=Z(!1),u=F&&e===0,n=T?rt(b,A,q,m):void 0;if(n&&(!Number.isSafeInteger(e)||e<0||e!==0&&(e<n.min||e>n.max||(e-n.min)%n.step!==0)))throw new RangeError("QuantityStepper value must be zero or a complete lot within its bounds.");H(()=>{y(d.current,e)},[e,b,A,q,m,T!==void 0]),H(()=>{let t=L.current,r=t?.ownerDocument.activeElement;u&&r&&t?.contains(r)&&r!==M.current&&M.current?.focus()},[u]);let o=p(null),E=p(!1),x=p({onIncrement:g,onDecrement:l});x.current={onIncrement:g,onDecrement:l},H(()=>{a&&o.current&&(clearTimeout(o.current.timer),o.current=null)},[a]),H(()=>()=>{o.current&&clearTimeout(o.current.timer)},[]);let k=t=>{y(d.current,e),!a&&t!==e&&T?.(t)},R=t=>{if(!n||a||u||t.value===String(e))return;let r=S(t.value,n);y(t,e),r!==void 0&&k(r)},X=t=>{n&&t.button===0&&!t.currentTarget.disabled&&t.preventDefault()},Q=()=>{let t=d.current?.value;return!n||t===void 0||t===String(e)?e:S(t,n)??e},K=t=>{!n||a||k(P(Q(),t,1,n))},j=(t,r)=>{if(X(r),r.button!==0||r.currentTarget.disabled||a)return;o.current&&clearTimeout(o.current.timer),E.current=!1;let f=()=>{let i=o.current;if(i){if(n){let s=P(i.draft,t,1,n);if(s===i.draft)return;i.draft=s,y(d.current,s),L.current?.removeAttribute("data-collapsed")}else{let s=t===1?x.current.onIncrement:x.current.onDecrement;if(!s)return;s()}E.current=!0,i.ticks+=1,i.timer=setTimeout(f,i.ticks<5?h:i.ticks<15?h/2:h/4)}};o.current={timer:setTimeout(f,it),draft:Q(),ticks:0}},D=()=>{let t=o.current;t&&(clearTimeout(t.timer),o.current=null,n&&t.ticks>0&&k(t.draft))},_=t=>({onPointerDown:r=>j(t,r),onPointerUp:D,onPointerLeave:D,onPointerCancel:D,onContextMenu:r=>r.preventDefault()}),O=()=>{let t=E.current;return E.current=!1,t},U=c("button",{type:"button",className:"dndev-quantity-stepper-decrement","aria-label":Y,"aria-hidden":u||void 0,tabIndex:u?-1:void 0,disabled:a||(n?(!C||u)&&e<=(m?0:b):!l),..._(-1),onClick:t=>{O()?t.currentTarget.focus():n?(K(-1),t.currentTarget.focus()):l?.()},children:c(tt,{"aria-hidden":"true",focusable:"false"})},"minus"),W=c("button",{ref:M,type:"button",className:"dndev-quantity-stepper-increment","aria-label":$,disabled:a||(n?!C&&e>=n.max:!g),..._(1),onClick:t=>{O()?t.currentTarget.focus():n?(K(1),t.currentTarget.focus()):g?.()},children:c(et,{"aria-hidden":"true",focusable:"false"})},"plus"),z=T?c("input",{ref:d,className:"dndev-quantity-stepper-value",type:"text",inputMode:"numeric",enterKeyHint:"done",autoComplete:"off",spellCheck:!1,pattern:"[0-9]*",role:"spinbutton","aria-label":N??B["aria-label"],"aria-valuemin":m||e===0?0:b,"aria-valuemax":n?.max,"aria-valuenow":e,"aria-hidden":u||void 0,tabIndex:u?-1:void 0,disabled:a,defaultValue:e,onFocus:t=>{I(!0),t.currentTarget.select()},onInput:t=>{if(!n||a||u)return;let r=t.currentTarget,f=r.value.trim(),i=Number(f),s=/^\d+$/.test(f)&&Number.isSafeInteger(i);s?r.setAttribute("aria-valuenow",String(i)):r.removeAttribute("aria-valuenow"),s&&(i===0?m||e===0:i>=n.min&&i<=n.max&&(i-n.min)%n.step===0)?r.removeAttribute("aria-invalid"):r.setAttribute("aria-invalid","true")},onKeyDown:t=>{if(t.nativeEvent.isComposing||t.altKey||t.ctrlKey||t.metaKey||!n)return;let r=t.currentTarget;if(t.key==="Escape")t.preventDefault(),y(r,e);else if(t.key==="Enter")t.preventDefault(),R(r);else if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();let f=r.value===String(e)?e:S(r.value,n)??e,i=t.key==="Home"?m?0:b:t.key==="End"?n.max:P(f,t.key==="ArrowDown"||t.key==="PageDown"?-1:1,t.key.startsWith("Page")?10:1,n);k(i)}}},"quantity"):w?c("button",{type:"button",className:"dndev-quantity-stepper-value","aria-label":N,"aria-hidden":u||void 0,tabIndex:u?-1:void 0,disabled:a,onClick:w,children:e},"quantity"):c("output",{className:"dndev-quantity-stepper-value","aria-live":"polite","aria-hidden":u||void 0,children:e},"quantity");return c("div",{...B,ref:L,role:"group",onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||(I(!1),d.current&&R(d.current)),J?.(t)},className:nt("dndev-quantity-stepper",G),"data-full-width":V||void 0,"data-disabled":a||void 0,"data-collapsed":u||void 0,"data-vertical":v||void 0,children:v?[W,z,U]:[U,z,W]})},dt=ut;export{dt as default};
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,W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AAC,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 I,CircleMinus as H}from"lucide-react";import{createElement as _,forwardRef as k,useState as M}from"react";import{GAP_VARIANT as j}from"../../styles/componentConstants.js";import{TONE as V}from"../../utils/constants.js";import{cn as L}from"../../utils/helpers.js";import{CollapsiblePrimitive as U,CollapsibleTrigger as q,CollapsibleContent as z}from"../Collapsible/CollapsiblePrimitive.js";import B from"../Grid/index.js";import F,{SEPARATOR_VARIANT as J}from"../Separator/index.js";import K from"../Stack/index.js";import h from"../Text/index.js";import{Fragment as N,jsx as e,jsxs as n}from"react/jsx-runtime";var se={STANDARD:"standard",DOCS:"docs",NARROW:"narrow"},g=k(function({as:v="section",children:a,title:o,titleAs:s="h2",separator:O=!1,tone:u=V.GHOST,textAlign:y="center",align:r,justify:b,bleed:S=!1,gridCols:l,gridGap:A,collapsible:t=!1,open:d,onOpenChange:x,defaultOpen:c=!1,contentWidth:E,className:P,...p},R){let w=v,[W,D]=M(()=>t?c:!1),i=t&&d!==void 0,m=i?d:W,f=i?x:D,C=l?e(B,{cols:l,gap:A||j.MEDIUM,align:r,children:a}):a,T=o&&(t?e(q,{asChild:!0,children:n(K,{as:"div",direction:"row",align:"center",justify:"between",className:"dndev-section-title-trigger",children:[e(h,{as:s,level:"h2",className:"dndev-section-title",children:o}),m?e(H,{className:"dndev-section-icon","aria-hidden":"true"}):e(I,{className:"dndev-section-icon","aria-hidden":"true"})]})}):e(h,{as:s,level:"h2",className:"dndev-section-title",children:o})),G=t?n(U,{...i?{open:m,onOpenChange:f}:{defaultOpen:c,onOpenChange:f},children:[T,e(z,{className:"dndev-collapsible-content",children:C})]}):n(N,{children:[T,C]});return _(w,{ref:R,"aria-label":p["aria-label"],className:L("dndev-section-full-width",S&&"dndev-section-bleed",P),"data-tone":u,"data-text-align":y,...p},n(N,{children:[O&&e(F,{variant:J.ACCENT}),e("div",{className:"dndev-section-content","data-content-width":E||void 0,"data-align":r||void 0,"data-justify":b||void 0,children:G})]}))});g.displayName="Section";var re=g;export{se as CONTENT_WIDTH,re as default};
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';