@namroodinc/liquid-editorial 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/README.md +47 -5
  2. package/UPGRADING.md +150 -0
  3. package/dist/chunks/Avatar-BTKqaJLP.cjs +2 -0
  4. package/dist/chunks/Avatar-BTKqaJLP.cjs.map +1 -0
  5. package/dist/chunks/Avatar-C1q2AUD-.js +149 -0
  6. package/dist/chunks/Avatar-C1q2AUD-.js.map +1 -0
  7. package/dist/chunks/{Board-CcIF7jS0.js → Board-BYPzybjf.js} +2 -2
  8. package/dist/chunks/{Board-CcIF7jS0.js.map → Board-BYPzybjf.js.map} +1 -1
  9. package/dist/chunks/{Board-BPA6mVhf.cjs → Board-Ct1t69ot.cjs} +2 -2
  10. package/dist/chunks/{Board-BPA6mVhf.cjs.map → Board-Ct1t69ot.cjs.map} +1 -1
  11. package/dist/chunks/ColourField-DDGuWWNH.cjs +2 -0
  12. package/dist/chunks/ColourField-DDGuWWNH.cjs.map +1 -0
  13. package/dist/chunks/{ColourField-Doew1hLw.js → ColourField-Do0rHk-Y.js} +120 -163
  14. package/dist/chunks/ColourField-Do0rHk-Y.js.map +1 -0
  15. package/dist/chunks/{DatePicker-DmeWUsOS.js → DatePicker-B8L-oodC.js} +3 -2
  16. package/dist/chunks/{DatePicker-DmeWUsOS.js.map → DatePicker-B8L-oodC.js.map} +1 -1
  17. package/dist/chunks/{DatePicker-C0-609Zx.cjs → DatePicker-hjpY6Sti.cjs} +2 -2
  18. package/dist/chunks/{DatePicker-C0-609Zx.cjs.map → DatePicker-hjpY6Sti.cjs.map} +1 -1
  19. package/dist/chunks/{FormEditor-DTnFO4oS.js → FormEditor-CwQN8tRw.js} +4 -3
  20. package/dist/chunks/{FormEditor-DTnFO4oS.js.map → FormEditor-CwQN8tRw.js.map} +1 -1
  21. package/dist/chunks/FormEditor-a3kHVLQB.cjs +2 -0
  22. package/dist/chunks/FormEditor-a3kHVLQB.cjs.map +1 -0
  23. package/dist/chunks/Icon-BZjGAu8D.js +84 -0
  24. package/dist/chunks/Icon-BZjGAu8D.js.map +1 -0
  25. package/dist/chunks/Icon-D7GrTtqc.cjs +2 -0
  26. package/dist/chunks/Icon-D7GrTtqc.cjs.map +1 -0
  27. package/dist/chunks/colour-BmtxDlWF.cjs +2 -0
  28. package/dist/chunks/colour-BmtxDlWF.cjs.map +1 -0
  29. package/dist/chunks/colour-CYEF4Q_n.js +48 -0
  30. package/dist/chunks/colour-CYEF4Q_n.js.map +1 -0
  31. package/dist/chunks/isComposing-8bRWyiLF.js +8 -0
  32. package/dist/chunks/isComposing-8bRWyiLF.js.map +1 -0
  33. package/dist/chunks/isComposing-BrBcAANm.cjs +2 -0
  34. package/dist/chunks/isComposing-BrBcAANm.cjs.map +1 -0
  35. package/dist/chunks/transitionDuration-B4UnScFc.cjs +2 -0
  36. package/dist/chunks/transitionDuration-B4UnScFc.cjs.map +1 -0
  37. package/dist/chunks/transitionDuration-BIBA3V7G.js +8 -0
  38. package/dist/chunks/transitionDuration-BIBA3V7G.js.map +1 -0
  39. package/dist/chunks/useModalDialog-Cgus9408.cjs +2 -0
  40. package/dist/chunks/useModalDialog-Cgus9408.cjs.map +1 -0
  41. package/dist/chunks/useModalDialog-Dh-_6A0j.js +85 -0
  42. package/dist/chunks/useModalDialog-Dh-_6A0j.js.map +1 -0
  43. package/dist/chunks/useTooltip-CCf79zE9.cjs +2 -0
  44. package/dist/chunks/useTooltip-CCf79zE9.cjs.map +1 -0
  45. package/dist/chunks/useTooltip-D6cJji8v.js +73 -0
  46. package/dist/chunks/useTooltip-D6cJji8v.js.map +1 -0
  47. package/dist/components/AssetCard/index.cjs +1 -1
  48. package/dist/components/AssetCard/index.cjs.map +1 -1
  49. package/dist/components/AssetCard/index.d.cts +11 -1
  50. package/dist/components/AssetCard/index.d.cts.map +1 -1
  51. package/dist/components/AssetCard/index.d.ts +11 -1
  52. package/dist/components/AssetCard/index.d.ts.map +1 -1
  53. package/dist/components/AssetCard/index.js +93 -57
  54. package/dist/components/AssetCard/index.js.map +1 -1
  55. package/dist/components/AssetCard/style.css +22 -5
  56. package/dist/components/AssetGrid/index.cjs +1 -1
  57. package/dist/components/AssetGrid/index.js +1 -1
  58. package/dist/components/AssetGrid/style.css +2 -1
  59. package/dist/components/Avatar/colour.d.cts +6 -0
  60. package/dist/components/Avatar/colour.d.cts.map +1 -0
  61. package/dist/components/Avatar/colour.d.ts +6 -0
  62. package/dist/components/Avatar/colour.d.ts.map +1 -0
  63. package/dist/components/Avatar/index.cjs +1 -2
  64. package/dist/components/Avatar/index.d.cts +16 -9
  65. package/dist/components/Avatar/index.d.cts.map +1 -1
  66. package/dist/components/Avatar/index.d.ts +16 -9
  67. package/dist/components/Avatar/index.d.ts.map +1 -1
  68. package/dist/components/Avatar/index.js +1 -43
  69. package/dist/components/Avatar/style.css +65 -16
  70. package/dist/components/Board/index.cjs +1 -1
  71. package/dist/components/Board/index.js +1 -1
  72. package/dist/components/Button/index.cjs +1 -1
  73. package/dist/components/Button/index.js +1 -1
  74. package/dist/components/ColourField/index.cjs +1 -1
  75. package/dist/components/ColourField/index.d.cts.map +1 -1
  76. package/dist/components/ColourField/index.d.ts.map +1 -1
  77. package/dist/components/ColourField/index.js +1 -1
  78. package/dist/components/DatePicker/index.cjs +1 -1
  79. package/dist/components/DatePicker/index.d.cts.map +1 -1
  80. package/dist/components/DatePicker/index.d.ts.map +1 -1
  81. package/dist/components/DatePicker/index.js +1 -1
  82. package/dist/components/Drawer/index.cjs +1 -1
  83. package/dist/components/Drawer/index.cjs.map +1 -1
  84. package/dist/components/Drawer/index.d.cts.map +1 -1
  85. package/dist/components/Drawer/index.d.ts.map +1 -1
  86. package/dist/components/Drawer/index.js +37 -36
  87. package/dist/components/Drawer/index.js.map +1 -1
  88. package/dist/components/EditLayout/index.cjs +1 -1
  89. package/dist/components/EditLayout/index.js +1 -1
  90. package/dist/components/EntryPicker/index.cjs +1 -1
  91. package/dist/components/EntryPicker/index.js +1 -1
  92. package/dist/components/FormEditor/index.cjs +1 -1
  93. package/dist/components/FormEditor/index.js +1 -1
  94. package/dist/components/Grid/style.css +8 -6
  95. package/dist/components/Icon/icons.d.cts +3 -0
  96. package/dist/components/Icon/icons.d.cts.map +1 -1
  97. package/dist/components/Icon/icons.d.ts +3 -0
  98. package/dist/components/Icon/icons.d.ts.map +1 -1
  99. package/dist/components/Icon/index.cjs +1 -1
  100. package/dist/components/Icon/index.js +1 -1
  101. package/dist/components/Menu/index.cjs +1 -1
  102. package/dist/components/Menu/index.cjs.map +1 -1
  103. package/dist/components/Menu/index.d.cts.map +1 -1
  104. package/dist/components/Menu/index.d.ts.map +1 -1
  105. package/dist/components/Menu/index.js +2 -1
  106. package/dist/components/Menu/index.js.map +1 -1
  107. package/dist/components/Modal/index.cjs +1 -1
  108. package/dist/components/Modal/index.js +1 -1
  109. package/dist/components/Popover/index.cjs +1 -1
  110. package/dist/components/Popover/index.cjs.map +1 -1
  111. package/dist/components/Popover/index.d.cts +2 -2
  112. package/dist/components/Popover/index.d.cts.map +1 -1
  113. package/dist/components/Popover/index.d.ts +2 -2
  114. package/dist/components/Popover/index.d.ts.map +1 -1
  115. package/dist/components/Popover/index.js +69 -53
  116. package/dist/components/Popover/index.js.map +1 -1
  117. package/dist/components/Popover/style.css +33 -1
  118. package/dist/components/Popover/useTooltip.d.cts +33 -0
  119. package/dist/components/Popover/useTooltip.d.cts.map +1 -0
  120. package/dist/components/Popover/useTooltip.d.ts +33 -0
  121. package/dist/components/Popover/useTooltip.d.ts.map +1 -0
  122. package/dist/components/SearchField/index.cjs +1 -1
  123. package/dist/components/SearchField/index.js +1 -1
  124. package/dist/components/Select/index.cjs +1 -1
  125. package/dist/components/Select/index.cjs.map +1 -1
  126. package/dist/components/Select/index.d.cts.map +1 -1
  127. package/dist/components/Select/index.d.ts.map +1 -1
  128. package/dist/components/Select/index.js +2 -1
  129. package/dist/components/Select/index.js.map +1 -1
  130. package/dist/components/SideNav/index.cjs +1 -1
  131. package/dist/components/SideNav/index.js +1 -1
  132. package/dist/components/SortableList/index.cjs +1 -1
  133. package/dist/components/SortableList/index.js +1 -1
  134. package/dist/components/Stepper/index.cjs +1 -1
  135. package/dist/components/Stepper/index.js +1 -1
  136. package/dist/components/SubNav/index.cjs +1 -1
  137. package/dist/components/SubNav/index.js +1 -1
  138. package/dist/components/Table/index.cjs +1 -1
  139. package/dist/components/Table/index.js +1 -1
  140. package/dist/components/Time/index.cjs +1 -1
  141. package/dist/components/Time/index.cjs.map +1 -1
  142. package/dist/components/Time/index.d.cts.map +1 -1
  143. package/dist/components/Time/index.d.ts.map +1 -1
  144. package/dist/components/Time/index.js +25 -42
  145. package/dist/components/Time/index.js.map +1 -1
  146. package/dist/components/Time/style.css +1 -3
  147. package/dist/components/Toast/index.cjs +1 -1
  148. package/dist/components/Toast/index.js +1 -1
  149. package/dist/components/TopNav/index.cjs +1 -1
  150. package/dist/components/TopNav/index.js +1 -1
  151. package/dist/index.cjs +1 -1
  152. package/dist/index.js +7 -7
  153. package/dist/internal/isComposing.d.cts +3 -0
  154. package/dist/internal/isComposing.d.cts.map +1 -0
  155. package/dist/internal/isComposing.d.ts +3 -0
  156. package/dist/internal/isComposing.d.ts.map +1 -0
  157. package/dist/internal/transitionDuration.d.cts +3 -0
  158. package/dist/internal/transitionDuration.d.cts.map +1 -0
  159. package/dist/internal/transitionDuration.d.ts +3 -0
  160. package/dist/internal/transitionDuration.d.ts.map +1 -0
  161. package/dist/internal/useModalDialog.d.cts.map +1 -1
  162. package/dist/internal/useModalDialog.d.ts.map +1 -1
  163. package/dist/styles.css +1 -1
  164. package/package.json +1 -1
  165. package/dist/chunks/ColourField-BQ4a5tAV.cjs +0 -2
  166. package/dist/chunks/ColourField-BQ4a5tAV.cjs.map +0 -1
  167. package/dist/chunks/ColourField-Doew1hLw.js.map +0 -1
  168. package/dist/chunks/FormEditor-DfQLJnsO.cjs +0 -2
  169. package/dist/chunks/FormEditor-DfQLJnsO.cjs.map +0 -1
  170. package/dist/chunks/Icon-D1kx7-1c.js +0 -81
  171. package/dist/chunks/Icon-D1kx7-1c.js.map +0 -1
  172. package/dist/chunks/Icon-D38lQXNe.cjs +0 -2
  173. package/dist/chunks/Icon-D38lQXNe.cjs.map +0 -1
  174. package/dist/chunks/useModalDialog-BVaG--b3.js +0 -87
  175. package/dist/chunks/useModalDialog-BVaG--b3.js.map +0 -1
  176. package/dist/chunks/useModalDialog-Ctu270Dp.cjs +0 -2
  177. package/dist/chunks/useModalDialog-Ctu270Dp.cjs.map +0 -1
  178. package/dist/components/Avatar/index.cjs.map +0 -1
  179. package/dist/components/Avatar/index.js.map +0 -1
@@ -11,16 +11,48 @@
11
11
  }
12
12
 
13
13
  .ds-popover {
14
+ box-sizing: border-box;
14
15
  position: fixed;
15
16
  visibility: hidden;
16
17
  z-index: 60;
17
18
  inline-size: max-content;
18
- max-inline-size: calc(100vw - var(--space-4));
19
+ max-inline-size: max(0px, calc(100vw - 16px));
19
20
  max-block-size: var(--popover-max-block-size, none);
20
21
  overflow: auto;
21
22
  overscroll-behavior: contain;
23
+ opacity: 1;
24
+ transition: opacity var(--duration-fast) var(--ease-standard);
22
25
 
23
26
  /* Set here, not inherited, so a panel carrying a scoped theme matches it. */
24
27
  color: var(--color-text);
25
28
  }
29
+
30
+ .ds-popover[data-state="closed"] {
31
+ opacity: 0;
32
+ pointer-events: none;
33
+ }
34
+
35
+ @starting-style {
36
+ .ds-popover[data-state="open"] {
37
+ opacity: 0;
38
+ }
39
+ }
40
+
41
+ /* Shared hover/focus tooltip surface; components add their own type treatment. */
42
+ .ds-tooltip {
43
+ color: var(--color-text);
44
+ font-size: var(--font-size-xs);
45
+ }
46
+
47
+ /* Padding sits inside the hover target so the pointer can rest on the whole surface. */
48
+ .ds-tooltip__content {
49
+ display: block;
50
+ padding: var(--space-2) var(--space-3);
51
+ }
52
+
53
+ @media (prefers-reduced-motion: reduce) {
54
+ .ds-popover {
55
+ transition-duration: 0s;
56
+ }
57
+ }
26
58
  }
@@ -0,0 +1,33 @@
1
+ import { type FocusEventHandler, type MouseEventHandler, type ReactNode } from "react";
2
+ import { type PopoverPlacement } from ".";
3
+ interface TooltipTriggerHandlers<T extends Element> {
4
+ onMouseEnter?: MouseEventHandler<T>;
5
+ onMouseLeave?: MouseEventHandler<T>;
6
+ onFocus?: FocusEventHandler<T>;
7
+ onBlur?: FocusEventHandler<T>;
8
+ }
9
+ interface TooltipOptions {
10
+ placement?: PopoverPlacement;
11
+ /** Added beside the shared tooltip surface classes. */
12
+ className?: string;
13
+ }
14
+ /**
15
+ * Hover and focus tooltip shared by Avatar and Time. It survives a short pointer
16
+ * move onto its text, stays while keyboard focus remains, and closes on Escape
17
+ * anywhere. `false`, `null` or empty content disables it.
18
+ */
19
+ export declare function useTooltip<T extends HTMLElement>(content: ReactNode, { placement, className }?: TooltipOptions): {
20
+ anchorRef: import("react").RefObject<T | null>;
21
+ /** Add to the trigger's `aria-describedby` alongside any caller description. */
22
+ description: string | undefined;
23
+ /** The trigger's hover and focus handlers, composed with the caller's. */
24
+ triggerProps: (handlers?: TooltipTriggerHandlers<T>) => {
25
+ onMouseEnter: (event: import("react").MouseEvent<T, MouseEvent>) => void;
26
+ onMouseLeave: (event: import("react").MouseEvent<T, MouseEvent>) => void;
27
+ onFocus: (event: import("react").FocusEvent<T, Element>) => void;
28
+ onBlur: (event: import("react").FocusEvent<T, Element>) => void;
29
+ };
30
+ panel: import("react").JSX.Element | null;
31
+ };
32
+ export {};
33
+ //# sourceMappingURL=useTooltip.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTooltip.d.cts","sourceRoot":"","sources":["../../../src/components/Popover/useTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAW,KAAK,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAKnD,UAAU,sBAAsB,CAAC,CAAC,SAAS,OAAO;IAChD,YAAY,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;CAC/B;AAED,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiCD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,WAAW,EAC9C,OAAO,EAAE,SAAS,EAClB,EAAE,SAAS,EAAE,SAAS,EAAE,GAAE,cAAmB;;IA6D3C,gFAAgF;;IAEhF,0EAA0E;8BACjD,sBAAsB,CAAC,CAAC,CAAC;;;;;;;EA0BrD"}
@@ -0,0 +1,33 @@
1
+ import { type FocusEventHandler, type MouseEventHandler, type ReactNode } from "react";
2
+ import { type PopoverPlacement } from ".";
3
+ interface TooltipTriggerHandlers<T extends Element> {
4
+ onMouseEnter?: MouseEventHandler<T>;
5
+ onMouseLeave?: MouseEventHandler<T>;
6
+ onFocus?: FocusEventHandler<T>;
7
+ onBlur?: FocusEventHandler<T>;
8
+ }
9
+ interface TooltipOptions {
10
+ placement?: PopoverPlacement;
11
+ /** Added beside the shared tooltip surface classes. */
12
+ className?: string;
13
+ }
14
+ /**
15
+ * Hover and focus tooltip shared by Avatar and Time. It survives a short pointer
16
+ * move onto its text, stays while keyboard focus remains, and closes on Escape
17
+ * anywhere. `false`, `null` or empty content disables it.
18
+ */
19
+ export declare function useTooltip<T extends HTMLElement>(content: ReactNode, { placement, className }?: TooltipOptions): {
20
+ anchorRef: import("react").RefObject<T | null>;
21
+ /** Add to the trigger's `aria-describedby` alongside any caller description. */
22
+ description: string | undefined;
23
+ /** The trigger's hover and focus handlers, composed with the caller's. */
24
+ triggerProps: (handlers?: TooltipTriggerHandlers<T>) => {
25
+ onMouseEnter: (event: import("react").MouseEvent<T, MouseEvent>) => void;
26
+ onMouseLeave: (event: import("react").MouseEvent<T, MouseEvent>) => void;
27
+ onFocus: (event: import("react").FocusEvent<T, Element>) => void;
28
+ onBlur: (event: import("react").FocusEvent<T, Element>) => void;
29
+ };
30
+ panel: import("react").JSX.Element | null;
31
+ };
32
+ export {};
33
+ //# sourceMappingURL=useTooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/useTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAW,KAAK,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAKnD,UAAU,sBAAsB,CAAC,CAAC,SAAS,OAAO;IAChD,YAAY,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;CAC/B;AAED,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiCD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,WAAW,EAC9C,OAAO,EAAE,SAAS,EAClB,EAAE,SAAS,EAAE,SAAS,EAAE,GAAE,cAAmB;;IA6D3C,gFAAgF;;IAEhF,0EAA0E;8BACjD,sBAAsB,CAAC,CAAC,CAAC;;;;;;;EA0BrD"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D38lQXNe.cjs"),t=require("../Button/index.cjs");;/* empty css */const n=require("../FieldAffix/index.cjs");let r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(function({size:a=`md`,isDisabled:o=!1,onClear:s,className:c,placeholder:l=`Search`,value:u,disabled:d,onKeyDown:f,...p},m){let h=(0,r.useRef)(null),g=u!==void 0&&String(u).length>0;return(0,i.jsx)(n.FieldAffix,{className:c,lead:(0,i.jsx)(e.t,{name:`search`,size:16}),isTrailInteractive:!0,trail:g&&s?(0,i.jsx)(t.Button,{variant:`simple`,size:`xs`,isIconOnly:!0,iconStart:`x`,"aria-label":`Clear search`,isDisabled:o||d,onClick:()=>{s(),h.current?.focus()}}):void 0,children:(0,i.jsx)(`input`,{ref:e=>{h.current=e,typeof m==`function`?m(e):m&&(m.current=e)},type:`search`,value:u,placeholder:l,disabled:o||d,"data-size":a,className:`ds-field-skin ds-search__input`,onKeyDown:e=>{e.key===`Escape`&&s&&s(),f?.(e)},...p})})});exports.SearchField=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D7GrTtqc.cjs"),t=require("../Button/index.cjs");;/* empty css */const n=require("../FieldAffix/index.cjs");let r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(function({size:a=`md`,isDisabled:o=!1,onClear:s,className:c,placeholder:l=`Search`,value:u,disabled:d,onKeyDown:f,...p},m){let h=(0,r.useRef)(null),g=u!==void 0&&String(u).length>0;return(0,i.jsx)(n.FieldAffix,{className:c,lead:(0,i.jsx)(e.t,{name:`search`,size:16}),isTrailInteractive:!0,trail:g&&s?(0,i.jsx)(t.Button,{variant:`simple`,size:`xs`,isIconOnly:!0,iconStart:`x`,"aria-label":`Clear search`,isDisabled:o||d,onClick:()=>{s(),h.current?.focus()}}):void 0,children:(0,i.jsx)(`input`,{ref:e=>{h.current=e,typeof m==`function`?m(e):m&&(m.current=e)},type:`search`,value:u,placeholder:l,disabled:o||d,"data-size":a,className:`ds-field-skin ds-search__input`,onKeyDown:e=>{e.key===`Escape`&&s&&s(),f?.(e)},...p})})});exports.SearchField=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../chunks/Icon-D1kx7-1c.js";
1
+ import { t as e } from "../../chunks/Icon-BZjGAu8D.js";
2
2
  import { Button as t } from "../Button/index.js";
3
3
  /* empty css */
4
4
  import { FieldAffix as n } from "../FieldAffix/index.js";
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D38lQXNe.cjs"),t=require("../Button/index.cjs");;/* empty css */const n=require("../Popover/index.cjs");let r=require("react"),i=require("react/jsx-runtime");function a(...e){return e.filter(Boolean).join(` `)}var o=(0,r.forwardRef)(function({options:o,value:s,defaultValue:c,onValueChange:l,placeholder:u=`Select an option`,size:d=`md`,isDisabled:f=!1,isInvalid:p=!1,"aria-invalid":m,required:h,menuPlacement:g=`bottom`,className:_,disabled:v,onClick:y,onKeyDown:b,...x},S){let[C,w]=(0,r.useState)(c??``),T=s??C,[E,D]=(0,r.useState)(!1),[O,k]=(0,r.useState)(0),A=(0,r.useRef)(null),j=(0,r.useRef)(null),M=(0,r.useRef)(null),N=(0,r.useId)(),P=f||v,F=E&&!P,I=o.find(e=>e.value===T),L=o.filter(e=>!e.isDisabled),R=(0,r.useCallback)(e=>{s===void 0&&w(e),l?.(e),D(!1)},[l,s]);(0,r.useEffect)(()=>{if(!F)return;let e=o.findIndex(e=>e.value===T&&!e.isDisabled);k(e<0?o.indexOf(L[0]):e);let t=e=>{let t=e.target;!A.current?.contains(t)&&!M.current?.contains(t)&&D(!1)};return document.addEventListener(`mousedown`,t),()=>document.removeEventListener(`mousedown`,t)},[F]),(0,r.useEffect)(()=>{F&&(M.current?.querySelectorAll(`[role='option']`)[O])?.scrollIntoView({block:`nearest`})},[O,F]);let z=e=>{let t=o.map((e,t)=>({option:e,index:t})).filter(e=>!e.option.isDisabled);if(t.length===0)return;let n=t[(t.findIndex(e=>e.index===O)+e+t.length)%t.length];k(n.index)},B=e=>{switch(e.key){case`Escape`:e.preventDefault(),D(!1),j.current?.focus();break;case`Tab`:D(!1);break;case`ArrowDown`:case`ArrowUp`:e.preventDefault(),z(e.key===`ArrowDown`?1:-1);break;case`Home`:case`End`:{e.preventDefault();let t=e.key===`Home`?L[0]:L[L.length-1];t&&k(o.indexOf(t));break}case`Enter`:case` `:{e.preventDefault();let t=o[O];t&&!t.isDisabled&&R(t.value);break}}},V=e=>{P||(F?B(e):[`ArrowDown`,`ArrowUp`,`Enter`,` `].includes(e.key)&&(e.preventDefault(),D(!0)))};return(0,i.jsxs)(`div`,{className:`ds-select-root`,ref:A,children:[(0,i.jsxs)(t.Button,{ref:e=>{j.current=e,typeof S==`function`?S(e):S&&(S.current=e)},size:d,role:`combobox`,"aria-required":h||void 0,"aria-haspopup":`listbox`,"aria-expanded":F,"aria-controls":F?N:void 0,"aria-activedescendant":F&&o[O]&&!o[O].isDisabled?`${N}-option-${O}`:void 0,"aria-invalid":p||m||void 0,isDisabled:P,"data-placeholder":I?void 0:``,className:a(`ds-field-skin`,`ds-select`,_),onClick:e=>{y?.(e),e.defaultPrevented||D(e=>!e)},onKeyDown:e=>{b?.(e),e.defaultPrevented||V(e)},...x,children:[(0,i.jsx)(`span`,{className:`ds-select__value`,children:I?I.label:u}),(0,i.jsx)(e.t,{name:`chevron-down`,size:16,className:`ds-select__chevron`})]}),(0,i.jsx)(n.Popover,{anchorRef:j,isOpen:F,placement:g,matchAnchorWidth:!0,panelRef:M,id:N,role:`listbox`,"aria-label":x[`aria-labelledby`]?void 0:x[`aria-label`]??u,"aria-labelledby":x[`aria-labelledby`],className:`ds-surface-raised ds-select__menu`,children:(0,i.jsx)(`div`,{onKeyDown:V,onPointerDown:e=>e.preventDefault(),children:o.map((n,r)=>(0,i.jsxs)(t.Button,{variant:r===O?`active`:`simple`,size:`sm`,isDisabled:n.isDisabled,tabIndex:-1,id:`${N}-option-${r}`,role:`option`,"aria-selected":n.value===T,"aria-disabled":n.isDisabled||void 0,"data-active":r===O||void 0,className:`ds-select__option`,onMouseEnter:()=>!n.isDisabled&&k(r),onClick:()=>{n.isDisabled||(R(n.value),j.current?.focus())},children:[(0,i.jsxs)(`span`,{className:`ds-select__option-body`,children:[(0,i.jsx)(`span`,{className:`ds-select__option-label`,children:n.label}),n.description&&(0,i.jsx)(`span`,{className:`ds-select__option-description`,children:n.description})]}),n.value===T&&(0,i.jsx)(e.t,{name:`check`,size:16})]},n.value))})})]})});exports.Select=o;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D7GrTtqc.cjs"),t=require("../Button/index.cjs");;/* empty css */const n=require("../Popover/index.cjs");let r=require("react"),i=require("react/jsx-runtime");function a(...e){return e.filter(Boolean).join(` `)}var o=(0,r.forwardRef)(function({options:o,value:s,defaultValue:c,onValueChange:l,placeholder:u=`Select an option`,size:d=`md`,isDisabled:f=!1,isInvalid:p=!1,"aria-invalid":m,required:h,menuPlacement:g=`bottom`,className:_,disabled:v,onClick:y,onKeyDown:b,...x},S){let[C,w]=(0,r.useState)(c??``),T=s??C,[E,D]=(0,r.useState)(!1),[O,k]=(0,r.useState)(0),A=(0,r.useRef)(null),j=(0,r.useRef)(null),M=(0,r.useRef)(null),N=(0,r.useId)(),P=f||v,F=E&&!P,I=o.find(e=>e.value===T),L=o.filter(e=>!e.isDisabled),R=(0,r.useCallback)(e=>{s===void 0&&w(e),l?.(e),D(!1)},[l,s]);(0,r.useEffect)(()=>{if(!F)return;let e=o.findIndex(e=>e.value===T&&!e.isDisabled);k(e<0?o.indexOf(L[0]):e);let t=e=>{let t=e.target;!A.current?.contains(t)&&!M.current?.contains(t)&&D(!1)};return document.addEventListener(`mousedown`,t),()=>document.removeEventListener(`mousedown`,t)},[F]),(0,r.useEffect)(()=>{F&&(M.current?.querySelectorAll(`[role='option']`)[O])?.scrollIntoView({block:`nearest`})},[O,F]);let z=e=>{let t=o.map((e,t)=>({option:e,index:t})).filter(e=>!e.option.isDisabled);if(t.length===0)return;let n=t[(t.findIndex(e=>e.index===O)+e+t.length)%t.length];k(n.index)},B=e=>{switch(e.key){case`Escape`:e.preventDefault(),D(!1),j.current?.focus();break;case`Tab`:D(!1);break;case`ArrowDown`:case`ArrowUp`:e.preventDefault(),z(e.key===`ArrowDown`?1:-1);break;case`Home`:case`End`:{e.preventDefault();let t=e.key===`Home`?L[0]:L[L.length-1];t&&k(o.indexOf(t));break}case`Enter`:case` `:{e.preventDefault();let t=o[O];t&&!t.isDisabled&&R(t.value);break}}},V=e=>{P||(F?B(e):[`ArrowDown`,`ArrowUp`,`Enter`,` `].includes(e.key)&&(e.preventDefault(),D(!0)))};return(0,i.jsxs)(`div`,{className:`ds-select-root`,ref:A,children:[(0,i.jsxs)(t.Button,{ref:e=>{j.current=e,typeof S==`function`?S(e):S&&(S.current=e)},size:d,role:`combobox`,"aria-required":h||void 0,"aria-haspopup":`listbox`,"aria-expanded":F,"aria-controls":F?N:void 0,"aria-activedescendant":F&&o[O]&&!o[O].isDisabled?`${N}-option-${O}`:void 0,"aria-invalid":p||m||void 0,isDisabled:P,"data-placeholder":I?void 0:``,className:a(`ds-field-skin`,`ds-select`,_),onClick:e=>{y?.(e),e.defaultPrevented||D(e=>!e)},onKeyDown:e=>{b?.(e),e.defaultPrevented||V(e)},...x,children:[(0,i.jsx)(`span`,{className:`ds-select__value`,children:I?I.label:u}),(0,i.jsx)(e.t,{name:`chevron-down`,size:16,className:`ds-select__chevron`})]}),(0,i.jsx)(n.Popover,{anchorRef:j,isOpen:F,align:`start`,placement:g,matchAnchorWidth:!0,panelRef:M,id:N,role:`listbox`,"aria-label":x[`aria-labelledby`]?void 0:x[`aria-label`]??u,"aria-labelledby":x[`aria-labelledby`],className:`ds-surface-raised ds-select__menu`,children:(0,i.jsx)(`div`,{onKeyDown:V,onPointerDown:e=>e.preventDefault(),children:o.map((n,r)=>(0,i.jsxs)(t.Button,{variant:r===O?`active`:`simple`,size:`sm`,isDisabled:n.isDisabled,tabIndex:-1,id:`${N}-option-${r}`,role:`option`,"aria-selected":n.value===T,"aria-disabled":n.isDisabled||void 0,"data-active":r===O||void 0,className:`ds-select__option`,onMouseEnter:()=>!n.isDisabled&&k(r),onClick:()=>{n.isDisabled||(R(n.value),j.current?.focus())},children:[(0,i.jsxs)(`span`,{className:`ds-select__option-body`,children:[(0,i.jsx)(`span`,{className:`ds-select__option-label`,children:n.label}),n.description&&(0,i.jsx)(`span`,{className:`ds-select__option-description`,children:n.description})]}),n.value===T&&(0,i.jsx)(e.t,{name:`check`,size:16})]},n.value))})})]})});exports.Select=o;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["forwardRef","useState","useRef","useId","useCallback","Button","Icon","Popover","require_Icon","require_components_Button_index","require_components_Popover_index","react","react_jsx_runtime","cx","parts","Select","ariaInvalid","rest","internal","setInternal","defaultValue","current","value","isOpen","setOpen","activeIndex","setActiveIndex","rootRef","triggerRef","listRef","listId","effectiveDisabled","isDisabled","disabled","isVisible","selected","options","option","enabled","commit","next","onValueChange","index","onPointerDown","target","event","step","order","o","delta","handleListKeyDown","pick","handleKeyDown","node","ref","required","isInvalid","className","onClick","open","onKeyDown","placeholder","menuPlacement"],"sources":["../../../src/components/Select/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport { Popover, type PopoverPlacement } from \"../Popover\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface SelectOption {\n value: string;\n label: string;\n /** Secondary line under the label. */\n description?: string;\n isDisabled?: boolean;\n}\n\nexport interface SelectProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"value\" | \"defaultValue\" | \"onChange\"\n> {\n required?: boolean;\n options: SelectOption[];\n /** Controlled value. Leave undefined to let the select hold its own. */\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n placeholder?: string;\n size?: FieldSize;\n isDisabled?: boolean;\n isInvalid?: boolean;\n /** Preferred side of the menu; flips when space requires it. */\n menuPlacement?: PopoverPlacement;\n}\n\n/**\n * One value out of a known list. Wears the field skin, opens a listbox: arrows\n * walk the options, Enter commits, Escape closes without changing anything.\n */\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder = \"Select an option\",\n size = \"md\",\n isDisabled = false,\n isInvalid = false,\n \"aria-invalid\": ariaInvalid,\n required,\n menuPlacement = \"bottom\",\n className,\n disabled,\n onClick,\n onKeyDown,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultValue ?? \"\");\n const current = value ?? internal;\n const [isOpen, setOpen] = useState(false);\n const [activeIndex, setActiveIndex] = useState(0);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const listRef = useRef<HTMLDivElement | null>(null);\n const listId = useId();\n const effectiveDisabled = isDisabled || disabled;\n const isVisible = isOpen && !effectiveDisabled;\n\n const selected = options.find((option) => option.value === current);\n const enabled = options.filter((option) => !option.isDisabled);\n\n const commit = useCallback(\n (next: string) => {\n if (value === undefined) {\n setInternal(next);\n }\n onValueChange?.(next);\n setOpen(false);\n },\n [onValueChange, value],\n );\n\n useEffect(() => {\n if (!isVisible) {\n return;\n }\n const index = options.findIndex((option) => option.value === current && !option.isDisabled);\n setActiveIndex(index < 0 ? options.indexOf(enabled[0]!) : index);\n const onPointerDown = (event: MouseEvent) => {\n const target = event.target as Node;\n if (!rootRef.current?.contains(target) && !listRef.current?.contains(target)) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", onPointerDown);\n return () => document.removeEventListener(\"mousedown\", onPointerDown);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isVisible]);\n\n useEffect(() => {\n if (!isVisible) {\n return;\n }\n const activeOption =\n listRef.current?.querySelectorAll<HTMLElement>(\"[role='option']\")[activeIndex];\n activeOption?.scrollIntoView({ block: \"nearest\" });\n }, [activeIndex, isVisible]);\n\n const step = (delta: number) => {\n const order = options\n .map((option, index) => ({ option, index }))\n .filter((o) => !o.option.isDisabled);\n if (order.length === 0) {\n return;\n }\n const at = order.findIndex((o) => o.index === activeIndex);\n const next = order[(at + delta + order.length) % order.length]!;\n setActiveIndex(next.index);\n };\n\n const handleListKeyDown = (event: React.KeyboardEvent) => {\n switch (event.key) {\n case \"Escape\":\n // Claims Escape so an enclosing Drawer stays open.\n event.preventDefault();\n setOpen(false);\n triggerRef.current?.focus();\n break;\n case \"Tab\":\n setOpen(false);\n break;\n case \"ArrowDown\":\n case \"ArrowUp\":\n event.preventDefault();\n step(event.key === \"ArrowDown\" ? 1 : -1);\n break;\n case \"Home\":\n case \"End\": {\n event.preventDefault();\n const pick = event.key === \"Home\" ? enabled[0] : enabled[enabled.length - 1];\n if (pick) {\n setActiveIndex(options.indexOf(pick));\n }\n break;\n }\n case \"Enter\":\n case \" \": {\n event.preventDefault();\n const option = options[activeIndex];\n if (option && !option.isDisabled) {\n commit(option.value);\n }\n break;\n }\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (effectiveDisabled) {\n return;\n }\n if (isVisible) {\n handleListKeyDown(event);\n } else if ([\"ArrowDown\", \"ArrowUp\", \"Enter\", \" \"].includes(event.key)) {\n event.preventDefault();\n setOpen(true);\n }\n };\n\n return (\n <div\n className=\"ds-select-root\"\n ref={rootRef}\n >\n <Button\n ref={(node) => {\n triggerRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n size={size}\n role=\"combobox\"\n aria-required={required || undefined}\n aria-haspopup=\"listbox\"\n aria-expanded={isVisible}\n aria-controls={isVisible ? listId : undefined}\n aria-activedescendant={\n isVisible && options[activeIndex] && !options[activeIndex].isDisabled\n ? `${listId}-option-${activeIndex}`\n : undefined\n }\n aria-invalid={isInvalid || ariaInvalid || undefined}\n isDisabled={effectiveDisabled}\n data-placeholder={selected ? undefined : \"\"}\n className={cx(\"ds-field-skin\", \"ds-select\", className)}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n setOpen((open) => !open);\n }\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) {\n handleKeyDown(event);\n }\n }}\n {...rest}\n >\n <span className=\"ds-select__value\">{selected ? selected.label : placeholder}</span>\n <Icon\n name=\"chevron-down\"\n size={16}\n className=\"ds-select__chevron\"\n />\n </Button>\n <Popover\n anchorRef={triggerRef}\n isOpen={isVisible}\n placement={menuPlacement}\n matchAnchorWidth\n panelRef={listRef}\n id={listId}\n role=\"listbox\"\n aria-label={rest[\"aria-labelledby\"] ? undefined : (rest[\"aria-label\"] ?? placeholder)}\n aria-labelledby={rest[\"aria-labelledby\"]}\n className=\"ds-surface-raised ds-select__menu\"\n >\n <div\n onKeyDown={handleKeyDown}\n onPointerDown={(event) => event.preventDefault()}\n >\n {options.map((option, index) => (\n <Button\n key={option.value}\n variant={index === activeIndex ? \"active\" : \"simple\"}\n size=\"sm\"\n isDisabled={option.isDisabled}\n tabIndex={-1}\n id={`${listId}-option-${index}`}\n role=\"option\"\n aria-selected={option.value === current}\n aria-disabled={option.isDisabled || undefined}\n data-active={index === activeIndex || undefined}\n className=\"ds-select__option\"\n onMouseEnter={() => !option.isDisabled && setActiveIndex(index)}\n onClick={() => {\n if (!option.isDisabled) {\n commit(option.value);\n triggerRef.current?.focus();\n }\n }}\n >\n <span className=\"ds-select__option-body\">\n <span className=\"ds-select__option-label\">{option.label}</span>\n {option.description && (\n <span className=\"ds-select__option-description\">{option.description}</span>\n )}\n </span>\n {option.value === current && (\n <Icon\n name=\"check\"\n size={16}\n />\n )}\n </Button>\n ))}\n </div>\n </Popover>\n </div>\n );\n});\n"],"mappings":"A,+RAgBA,SAASa,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAgCA,IAAaC,GAAA,EAASf,EAAAA,WAAAA,CAA2C,SAC/D,CACE,UACA,QACA,eACA,gBACA,cAAc,mBACd,OAAO,KACP,aAAa,GACb,YAAY,GACZ,eAAgBgB,EAChB,WACA,gBAAgB,SAChB,YACA,WACA,UACA,YACA,GAAGC,GAEL,EACA,CACA,GAAM,CAACC,EAAUC,IAAA,EAAelB,EAAAA,SAAAA,CAASmB,GAAgB,EAAE,EACrDC,EAAUC,GAASJ,EACnB,CAACK,EAAQC,IAAA,EAAWvB,EAAAA,SAAAA,CAAS,EAAK,EAClC,CAACwB,EAAaC,IAAA,EAAkBzB,EAAAA,SAAAA,CAAS,CAAC,EAC1C0B,GAAA,EAAUzB,EAAAA,OAAAA,CAA8B,IAAI,EAC5C0B,GAAA,EAAa1B,EAAAA,OAAAA,CAAiC,IAAI,EAClD2B,GAAA,EAAU3B,EAAAA,OAAAA,CAA8B,IAAI,EAC5C4B,GAAA,EAAS3B,EAAAA,MAAAA,CAAM,EACf4B,EAAoBC,GAAcC,EAClCC,EAAYX,GAAU,CAACQ,EAEvBI,EAAWC,EAAQ,KAAM,GAAWC,EAAO,QAAUhB,CAAO,EAC5DiB,EAAUF,EAAQ,OAAQ,GAAW,CAACC,EAAO,UAAU,EAEvDE,GAAA,EAASnC,EAAAA,YAAAA,CACZ,GAAiB,CACZkB,IAAU,IAAA,IACZH,EAAYqB,CAAI,EAElBC,IAAgBD,CAAI,EACpBhB,EAAQ,EAAK,CACf,EACA,CAACiB,EAAenB,CAAK,CACvB,GAEA,EAAAX,EAAA,UAAA,KAAgB,CACd,GAAI,CAACuB,EACH,OAEF,IAAMQ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AAD,CACE,KAAK,QACL,KAAM,EACP,CAAA,CAEG,CA/BD,EAAA+B,EAAO,KA+BN,CACT,CACE,CAAA,CACE,CAAA,CACN,C,EAET,CAAC,E"}
1
+ {"version":3,"file":"index.cjs","names":["forwardRef","useState","useRef","useId","useCallback","Button","Icon","Popover","require_Icon","require_components_Button_index","require_components_Popover_index","react","react_jsx_runtime","cx","parts","Select","ariaInvalid","rest","internal","setInternal","defaultValue","current","value","isOpen","setOpen","activeIndex","setActiveIndex","rootRef","triggerRef","listRef","listId","effectiveDisabled","isDisabled","disabled","isVisible","selected","options","option","enabled","commit","next","onValueChange","index","onPointerDown","target","event","step","order","o","delta","handleListKeyDown","pick","handleKeyDown","node","ref","required","isInvalid","className","onClick","open","onKeyDown","placeholder","menuPlacement"],"sources":["../../../src/components/Select/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport { Popover, type PopoverPlacement } from \"../Popover\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface SelectOption {\n value: string;\n label: string;\n /** Secondary line under the label. */\n description?: string;\n isDisabled?: boolean;\n}\n\nexport interface SelectProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"value\" | \"defaultValue\" | \"onChange\"\n> {\n required?: boolean;\n options: SelectOption[];\n /** Controlled value. Leave undefined to let the select hold its own. */\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n placeholder?: string;\n size?: FieldSize;\n isDisabled?: boolean;\n isInvalid?: boolean;\n /** Preferred side of the menu; flips when space requires it. */\n menuPlacement?: PopoverPlacement;\n}\n\n/**\n * One value out of a known list. Wears the field skin, opens a listbox: arrows\n * walk the options, Enter commits, Escape closes without changing anything.\n */\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder = \"Select an option\",\n size = \"md\",\n isDisabled = false,\n isInvalid = false,\n \"aria-invalid\": ariaInvalid,\n required,\n menuPlacement = \"bottom\",\n className,\n disabled,\n onClick,\n onKeyDown,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultValue ?? \"\");\n const current = value ?? internal;\n const [isOpen, setOpen] = useState(false);\n const [activeIndex, setActiveIndex] = useState(0);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const listRef = useRef<HTMLDivElement | null>(null);\n const listId = useId();\n const effectiveDisabled = isDisabled || disabled;\n const isVisible = isOpen && !effectiveDisabled;\n\n const selected = options.find((option) => option.value === current);\n const enabled = options.filter((option) => !option.isDisabled);\n\n const commit = useCallback(\n (next: string) => {\n if (value === undefined) {\n setInternal(next);\n }\n onValueChange?.(next);\n setOpen(false);\n },\n [onValueChange, value],\n );\n\n useEffect(() => {\n if (!isVisible) {\n return;\n }\n const index = options.findIndex((option) => option.value === current && !option.isDisabled);\n setActiveIndex(index < 0 ? options.indexOf(enabled[0]!) : index);\n const onPointerDown = (event: MouseEvent) => {\n const target = event.target as Node;\n if (!rootRef.current?.contains(target) && !listRef.current?.contains(target)) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", onPointerDown);\n return () => document.removeEventListener(\"mousedown\", onPointerDown);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isVisible]);\n\n useEffect(() => {\n if (!isVisible) {\n return;\n }\n const activeOption =\n listRef.current?.querySelectorAll<HTMLElement>(\"[role='option']\")[activeIndex];\n activeOption?.scrollIntoView({ block: \"nearest\" });\n }, [activeIndex, isVisible]);\n\n const step = (delta: number) => {\n const order = options\n .map((option, index) => ({ option, index }))\n .filter((o) => !o.option.isDisabled);\n if (order.length === 0) {\n return;\n }\n const at = order.findIndex((o) => o.index === activeIndex);\n const next = order[(at + delta + order.length) % order.length]!;\n setActiveIndex(next.index);\n };\n\n const handleListKeyDown = (event: React.KeyboardEvent) => {\n switch (event.key) {\n case \"Escape\":\n // Claims Escape so an enclosing Drawer stays open.\n event.preventDefault();\n setOpen(false);\n triggerRef.current?.focus();\n break;\n case \"Tab\":\n setOpen(false);\n break;\n case \"ArrowDown\":\n case \"ArrowUp\":\n event.preventDefault();\n step(event.key === \"ArrowDown\" ? 1 : -1);\n break;\n case \"Home\":\n case \"End\": {\n event.preventDefault();\n const pick = event.key === \"Home\" ? enabled[0] : enabled[enabled.length - 1];\n if (pick) {\n setActiveIndex(options.indexOf(pick));\n }\n break;\n }\n case \"Enter\":\n case \" \": {\n event.preventDefault();\n const option = options[activeIndex];\n if (option && !option.isDisabled) {\n commit(option.value);\n }\n break;\n }\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (effectiveDisabled) {\n return;\n }\n if (isVisible) {\n handleListKeyDown(event);\n } else if ([\"ArrowDown\", \"ArrowUp\", \"Enter\", \" \"].includes(event.key)) {\n event.preventDefault();\n setOpen(true);\n }\n };\n\n return (\n <div\n className=\"ds-select-root\"\n ref={rootRef}\n >\n <Button\n ref={(node) => {\n triggerRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n size={size}\n role=\"combobox\"\n aria-required={required || undefined}\n aria-haspopup=\"listbox\"\n aria-expanded={isVisible}\n aria-controls={isVisible ? listId : undefined}\n aria-activedescendant={\n isVisible && options[activeIndex] && !options[activeIndex].isDisabled\n ? `${listId}-option-${activeIndex}`\n : undefined\n }\n aria-invalid={isInvalid || ariaInvalid || undefined}\n isDisabled={effectiveDisabled}\n data-placeholder={selected ? undefined : \"\"}\n className={cx(\"ds-field-skin\", \"ds-select\", className)}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n setOpen((open) => !open);\n }\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) {\n handleKeyDown(event);\n }\n }}\n {...rest}\n >\n <span className=\"ds-select__value\">{selected ? selected.label : placeholder}</span>\n <Icon\n name=\"chevron-down\"\n size={16}\n className=\"ds-select__chevron\"\n />\n </Button>\n <Popover\n anchorRef={triggerRef}\n isOpen={isVisible}\n align=\"start\"\n placement={menuPlacement}\n matchAnchorWidth\n panelRef={listRef}\n id={listId}\n role=\"listbox\"\n aria-label={rest[\"aria-labelledby\"] ? undefined : (rest[\"aria-label\"] ?? placeholder)}\n aria-labelledby={rest[\"aria-labelledby\"]}\n className=\"ds-surface-raised ds-select__menu\"\n >\n <div\n onKeyDown={handleKeyDown}\n onPointerDown={(event) => event.preventDefault()}\n >\n {options.map((option, index) => (\n <Button\n key={option.value}\n variant={index === activeIndex ? \"active\" : \"simple\"}\n size=\"sm\"\n isDisabled={option.isDisabled}\n tabIndex={-1}\n id={`${listId}-option-${index}`}\n role=\"option\"\n aria-selected={option.value === current}\n aria-disabled={option.isDisabled || undefined}\n data-active={index === activeIndex || undefined}\n className=\"ds-select__option\"\n onMouseEnter={() => !option.isDisabled && setActiveIndex(index)}\n onClick={() => {\n if (!option.isDisabled) {\n commit(option.value);\n triggerRef.current?.focus();\n }\n }}\n >\n <span className=\"ds-select__option-body\">\n <span className=\"ds-select__option-label\">{option.label}</span>\n {option.description && (\n <span className=\"ds-select__option-description\">{option.description}</span>\n )}\n </span>\n {option.value === current && (\n <Icon\n name=\"check\"\n size={16}\n />\n )}\n </Button>\n ))}\n </div>\n </Popover>\n </div>\n );\n});\n"],"mappings":"A,+RAgBA,SAASa,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAgCA,IAAaC,GAAA,EAASf,EAAAA,WAAAA,CAA2C,SAC/D,CACE,UACA,QACA,eACA,gBACA,cAAc,mBACd,OAAO,KACP,aAAa,GACb,YAAY,GACZ,eAAgBgB,EAChB,WACA,gBAAg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AU,oCAEV,UAAA,EAAAL,EAAA,IAAA,CAAC,MAAD,CACE,UAAWwC,EACX,cAAgB,GAAUP,EAAM,eAAe,EAE9C,SAAAT,EAAQ,KAAK,EAAQ,KACpB,EAAAxB,EAAA,KAAA,CAACP,EAAAA,OAAD,CAEE,QAASqC,IAAUjB,EAAc,SAAW,SAC5C,KAAK,KACL,WAAYY,EAAO,WACnB,SAAU,GACV,GAAI,GAAGP,EAAO,UAAUY,IACxB,KAAK,SACL,gBAAeL,EAAO,QAAUhB,EAChC,gBAAegB,EAAO,YAAc,IAAA,GACpC,cAAaK,IAAUjB,GAAe,IAAA,GACtC,UAAU,oBACV,iBAAoB,CAACY,EAAO,YAAcX,EAAegB,CAAK,EAC9D,YAAe,CACRL,EAAO,aACVE,EAAOF,EAAO,KAAK,EACnBT,EAAW,SAAS,MAAM,EAE9B,EAlBF,SAAA,EAoBE,EAAAhB,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,yBAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,0BAA2B,SAAAyB,EAAO,KAAY,CAAA,EAC7DA,EAAO,cACN,EAAAzB,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,gCAAiC,SAAAyB,EAAO,WAAkB,CAAA,CAExE,CACL,CAAA,EAAAA,EAAO,QAAUhB,IAChB,EAAAT,EAAA,IAAA,CAACN,EAAAA,EAAD,CACE,KAAK,QACL,KAAM,EACP,CAAA,CAEG,CA/BD,EAAA+B,EAAO,KA+BN,CACT,CACE,CAAA,CACE,CAAA,CACN,C,EAET,CAAC,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,oBAAoB,EAC1B,MAAM,OAAO,CAAC;AAGf,OAAO,EAAW,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,M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AAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gEAAgE;IAChE,aAAa,CAAC,EAAE,gBAAgB,CAAC;CAClC;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,2GA+OjB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../chunks/Icon-D1kx7-1c.js";
1
+ import { t as e } from "../../chunks/Icon-BZjGAu8D.js";
2
2
  import { Button as t } from "../Button/index.js";
3
3
  /* empty css */
4
4
  import { Popover as n } from "../Popover/index.js";
@@ -103,6 +103,7 @@ var f = r(function({ options: r, value: f, defaultValue: p, onValueChange: m, pl
103
103
  }), /* @__PURE__ */ l(n, {
104
104
  anchorRef: I,
105
105
  isOpen: B,
106
+ align: "start",
106
107
  placement: x,
107
108
  matchAnchorWidth: !0,
108
109
  panelRef: L,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Icon","cx","parts","Select","forwardRef","ariaInvalid","rest","internal","setInternal","useState","defaultValue","current","value","isOpen","setOpen","activeIndex","setActiveIndex","rootRef","useRef","triggerRef","listRef","listId","useId","effectiveDisabled","isDisabled","disabled","isVisible","selected","options","option","enabled","commit","useCallback","next","onValueChange","useEffect","index","onPointerDown","target","event","step","order","o","delta","handleListKeyDown","pick","handleKeyDown","Button","node","ref","required","isInvalid","className","onClick","open","onKeyDown","placeholder","Popover","menuPlacement"],"sources":["../../../src/components/Select/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport { Popover, type PopoverPlacement } from \"../Popover\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface SelectOption {\n value: string;\n label: string;\n /** Secondary line under the label. */\n description?: string;\n isDisabled?: boolean;\n}\n\nexport interface SelectProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"value\" | \"defaultValue\" | \"onChange\"\n> {\n required?: boolean;\n options: SelectOption[];\n /** Controlled value. Leave undefined to let the select hold its own. */\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n placeholder?: string;\n size?: FieldSize;\n isDisabled?: boolean;\n isInvalid?: boolean;\n /** Preferred side of the menu; flips when space requires it. */\n menuPlacement?: PopoverPlacement;\n}\n\n/**\n * One value out of a known list. Wears the field skin, opens a listbox: arrows\n * walk the options, Enter commits, Escape closes without changing anything.\n */\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder = \"Select an option\",\n size = \"md\",\n isDisabled = false,\n isInvalid = false,\n \"aria-invalid\": ariaInvalid,\n required,\n menuPlacement = \"bottom\",\n className,\n disabled,\n onClick,\n onKeyDown,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultValue ?? \"\");\n const current = value ?? internal;\n const [isOpen, setOpen] = useState(false);\n const [activeIndex, setActiveIndex] = useState(0);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const listRef = useRef<HTMLDivElement | null>(null);\n const listId = useId();\n const effectiveDisabled = isDisabled || disabled;\n const isVisible = isOpen && !effectiveDisabled;\n\n const selected = options.find((option) => option.value === current);\n const enabled = options.filter((option) => !option.isDisabled);\n\n const commit = useCallback(\n (next: string) => {\n if (value === undefined) {\n setInternal(next);\n }\n onValueChange?.(next);\n setOpen(false);\n },\n [onValueChange, value],\n );\n\n useEffect(() => {\n if (!isVisible) {\n return;\n }\n const index = options.findIndex((option) => option.value === current && !option.isDisabled);\n setActiveIndex(index < 0 ? options.indexOf(enabled[0]!) : index);\n const onPointerDown = (event: MouseEvent) => {\n const target = event.target as Node;\n if (!rootRef.current?.contains(target) && !listRef.current?.contains(target)) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", onPointerDown);\n return () => document.removeEventListener(\"mousedown\", onPointerDown);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isVisible]);\n\n useEffect(() => {\n if (!isVisible) {\n return;\n }\n const activeOption =\n listRef.current?.querySelectorAll<HTMLElement>(\"[role='option']\")[activeIndex];\n activeOption?.scrollIntoView({ block: \"nearest\" });\n }, [activeIndex, isVisible]);\n\n const step = (delta: number) => {\n const order = options\n .map((option, index) => ({ option, index }))\n .filter((o) => !o.option.isDisabled);\n if (order.length === 0) {\n return;\n }\n const at = order.findIndex((o) => o.index === activeIndex);\n const next = order[(at + delta + order.length) % order.length]!;\n setActiveIndex(next.index);\n };\n\n const handleListKeyDown = (event: React.KeyboardEvent) => {\n switch (event.key) {\n case \"Escape\":\n // Claims Escape so an enclosing Drawer stays open.\n event.preventDefault();\n setOpen(false);\n triggerRef.current?.focus();\n break;\n case \"Tab\":\n setOpen(false);\n break;\n case \"ArrowDown\":\n case \"ArrowUp\":\n event.preventDefault();\n step(event.key === \"ArrowDown\" ? 1 : -1);\n break;\n case \"Home\":\n case \"End\": {\n event.preventDefault();\n const pick = event.key === \"Home\" ? enabled[0] : enabled[enabled.length - 1];\n if (pick) {\n setActiveIndex(options.indexOf(pick));\n }\n break;\n }\n case \"Enter\":\n case \" \": {\n event.preventDefault();\n const option = options[activeIndex];\n if (option && !option.isDisabled) {\n commit(option.value);\n }\n break;\n }\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (effectiveDisabled) {\n return;\n }\n if (isVisible) {\n handleListKeyDown(event);\n } else if ([\"ArrowDown\", \"ArrowUp\", \"Enter\", \" \"].includes(event.key)) {\n event.preventDefault();\n setOpen(true);\n }\n };\n\n return (\n <div\n className=\"ds-select-root\"\n ref={rootRef}\n >\n <Button\n ref={(node) => {\n triggerRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n size={size}\n role=\"combobox\"\n aria-required={required || undefined}\n aria-haspopup=\"listbox\"\n aria-expanded={isVisible}\n aria-controls={isVisible ? listId : undefined}\n aria-activedescendant={\n isVisible && options[activeIndex] && !options[activeIndex].isDisabled\n ? `${listId}-option-${activeIndex}`\n : undefined\n }\n aria-invalid={isInvalid || ariaInvalid || undefined}\n isDisabled={effectiveDisabled}\n data-placeholder={selected ? undefined : \"\"}\n className={cx(\"ds-field-skin\", \"ds-select\", className)}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n setOpen((open) => !open);\n }\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) {\n handleKeyDown(event);\n }\n }}\n {...rest}\n >\n <span className=\"ds-select__value\">{selected ? selected.label : placeholder}</span>\n <Icon\n name=\"chevron-down\"\n size={16}\n className=\"ds-select__chevron\"\n />\n </Button>\n <Popover\n anchorRef={triggerRef}\n isOpen={isVisible}\n placement={menuPlacement}\n matchAnchorWidth\n panelRef={listRef}\n id={listId}\n role=\"listbox\"\n aria-label={rest[\"aria-labelledby\"] ? undefined : (rest[\"aria-label\"] ?? placeholder)}\n aria-labelledby={rest[\"aria-labelledby\"]}\n className=\"ds-surface-raised ds-select__menu\"\n >\n <div\n onKeyDown={handleKeyDown}\n onPointerDown={(event) => event.preventDefault()}\n >\n {options.map((option, index) => (\n <Button\n key={option.value}\n variant={index === activeIndex ? \"active\" : \"simple\"}\n size=\"sm\"\n isDisabled={option.isDisabled}\n tabIndex={-1}\n id={`${listId}-option-${index}`}\n role=\"option\"\n aria-selected={option.value === current}\n aria-disabled={option.isDisabled || undefined}\n data-active={index === activeIndex || undefined}\n className=\"ds-select__option\"\n onMouseEnter={() => !option.isDisabled && setActiveIndex(index)}\n onClick={() => {\n if (!option.isDisabled) {\n commit(option.value);\n triggerRef.current?.focus();\n }\n }}\n >\n <span className=\"ds-select__option-body\">\n <span className=\"ds-select__option-label\">{option.label}</span>\n {option.description && (\n <span className=\"ds-select__option-description\">{option.description}</span>\n )}\n </span>\n {option.value === current && (\n <Icon\n name=\"check\"\n size={16}\n />\n )}\n </Button>\n ))}\n </div>\n </Popover>\n </div>\n );\n});\n"],"mappings":";;;;;;;AAgBA,SAASC,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAgCA,IAAaC,IAASC,EAA2C,SAC/D,EACE,YACA,UACA,iBACA,kBACA,iBAAc,oBACd,UAAO,MACP,gBAAa,IACb,eAAY,IACZ,gBAAgBC,GAChB,aACA,mBAAgB,UAChB,cACA,aACA,YACA,cACA,GAAGC,KAEL,GACA;CACA,IAAM,CAACC,GAAUC,KAAeC,EAASC,KAAgB,EAAE,GACrDC,IAAUC,KAASL,GACnB,CAACM,GAAQC,KAAWL,EAAS,EAAK,GAClC,CAACM,GAAaC,KAAkBP,EAAS,CAAC,GAC1CQ,IAAUC,EAA8B,IAAI,GAC5CC,IAAaD,EAAiC,IAAI,GAClDE,IAAUF,EAA8B,IAAI,GAC5CG,IAASC,EAAM,GACfC,IAAoBC,KAAcC,GAClCC,IAAYb,KAAU,CAACU,GAEvBI,IAAWC,EAAQ,MAAM,MAAWC,EAAO,UAAUlB,CAAO,GAC5DmB,IAAUF,EAAQ,QAAQ,MAAW,CAACC,EAAO,UAAU,GAEvDE,IAASC,GACZ,MAAiB;EAKhB,AAJIpB,MAAU,KAAA,KACZJ,EAAYyB,CAAI,GAElBC,IAAgBD,CAAI,GACpBnB,EAAQ,EAAK;CACf,GACA,CAACoB,GAAetB,CAAK,CACvB;CAmBA,AAjBAuB,QAAgB;EACd,IAAI,CAACT,GACH;EAEF,IAAMU,IAAQR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AA,GAClF,kBAACxD,GAAD;IACE,MAAK;IACL,MAAM;IACN,WAAU;GACX,CAAA,CACK;EACR,CAAA,GAAA,kBAACyD,GAAD;GACE,WAAWtC;GACX,QAAQO;GACR,WAAWgC;GACX,kBAAA;GACA,UAAUtC;GACV,IAAIC;GACJ,MAAK;GACL,cAAYf,EAAK,qBAAqB,KAAA,IAAaA,EAAK,iBAAiBkD;GACzE,mBAAiBlD,EAAK;GACtB,WAAU;GAEV,UAAA,kBAAC,OAAD;IACE,WAAWwC;IACX,gBAAgB,MAAUP,EAAM,eAAe;IAE9C,UAAAX,EAAQ,KAAK,GAAQ,MACpB,kBAACmB,GAAD;KAEE,SAASX,MAAUrB,IAAc,WAAW;KAC5C,MAAK;KACL,YAAYc,EAAO;KACnB,UAAU;KACV,IAAI,GAAGR,EAAO,UAAUe;KACxB,MAAK;KACL,iBAAeP,EAAO,UAAUlB;KAChC,iBAAekB,EAAO,cAAc,KAAA;KACpC,eAAaO,MAAUrB,KAAe,KAAA;KACtC,WAAU;KACV,oBAAoB,CAACc,EAAO,cAAcb,EAAeoB,CAAK;KAC9D,eAAe;MACb,AAAKP,EAAO,eACVE,EAAOF,EAAO,KAAK,GACnBV,EAAW,SAAS,MAAM;KAE9B;KAlBF,UAAA,CAoBE,kBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA,CACE,kBAAC,QAAD;OAAM,WAAU;OAA2B,UAAAU,EAAO;MAAY,CAAA,GAC7DA,EAAO,eACN,kBAAC,QAAD;OAAM,WAAU;OAAiC,UAAAA,EAAO;MAAkB,CAAA,CAExE;KACL,CAAA,GAAAA,EAAO,UAAUlB,KAChB,kBAACX,GAAD;MACE,MAAK;MACL,MAAM;KACP,CAAA,CAEG;IA/BD,GAAA6B,EAAO,KA+BN,CACT;GACE,CAAA;EACE,CAAA,CACN;;AAET,CAAC"}
1
+ {"version":3,"file":"index.js","names":["Icon","cx","parts","Select","forwardRef","ariaInvalid","rest","internal","setInternal","useState","defaultValue","current","value","isOpen","setOpen","activeIndex","setActiveIndex","rootRef","useRef","triggerRef","listRef","listId","useId","effectiveDisabled","isDisabled","disabled","isVisible","selected","options","option","enabled","commit","useCallback","next","onValueChange","useEffect","index","onPointerDown","target","event","step","order","o","delta","handleListKeyDown","pick","handleKeyDown","Button","node","ref","required","isInvalid","className","onClick","open","onKeyDown","placeholder","Popover","menuPlacement"],"sources":["../../../src/components/Select/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport { Popover, type PopoverPlacement } from \"../Popover\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface SelectOption {\n value: string;\n label: string;\n /** Secondary line under the label. */\n description?: string;\n isDisabled?: boolean;\n}\n\nexport interface SelectProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"value\" | \"defaultValue\" | \"onChange\"\n> {\n required?: boolean;\n options: SelectOption[];\n /** Controlled value. Leave undefined to let the select hold its own. */\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n placeholder?: string;\n size?: FieldSize;\n isDisabled?: boolean;\n isInvalid?: boolean;\n /** Preferred side of the menu; flips when space requires it. */\n menuPlacement?: PopoverPlacement;\n}\n\n/**\n * One value out of a known list. Wears the field skin, opens a listbox: arrows\n * walk the options, Enter commits, Escape closes without changing anything.\n */\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder = \"Select an option\",\n size = \"md\",\n isDisabled = false,\n isInvalid = false,\n \"aria-invalid\": ariaInvalid,\n required,\n menuPlacement = \"bottom\",\n className,\n disabled,\n onClick,\n onKeyDown,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultValue ?? \"\");\n const current = value ?? internal;\n const [isOpen, setOpen] = useState(false);\n const [activeIndex, setActiveIndex] = useState(0);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const listRef = useRef<HTMLDivElement | null>(null);\n const listId = useId();\n const effectiveDisabled = isDisabled || disabled;\n const isVisible = isOpen && !effectiveDisabled;\n\n const selected = options.find((option) => option.value === current);\n const enabled = options.filter((option) => !option.isDisabled);\n\n const commit = useCallback(\n (next: string) => {\n if (value === undefined) {\n setInternal(next);\n }\n onValueChange?.(next);\n setOpen(false);\n },\n [onValueChange, value],\n );\n\n useEffect(() => {\n if (!isVisible) {\n return;\n }\n const index = options.findIndex((option) => option.value === current && !option.isDisabled);\n setActiveIndex(index < 0 ? options.indexOf(enabled[0]!) : index);\n const onPointerDown = (event: MouseEvent) => {\n const target = event.target as Node;\n if (!rootRef.current?.contains(target) && !listRef.current?.contains(target)) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", onPointerDown);\n return () => document.removeEventListener(\"mousedown\", onPointerDown);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isVisible]);\n\n useEffect(() => {\n if (!isVisible) {\n return;\n }\n const activeOption =\n listRef.current?.querySelectorAll<HTMLElement>(\"[role='option']\")[activeIndex];\n activeOption?.scrollIntoView({ block: \"nearest\" });\n }, [activeIndex, isVisible]);\n\n const step = (delta: number) => {\n const order = options\n .map((option, index) => ({ option, index }))\n .filter((o) => !o.option.isDisabled);\n if (order.length === 0) {\n return;\n }\n const at = order.findIndex((o) => o.index === activeIndex);\n const next = order[(at + delta + order.length) % order.length]!;\n setActiveIndex(next.index);\n };\n\n const handleListKeyDown = (event: React.KeyboardEvent) => {\n switch (event.key) {\n case \"Escape\":\n // Claims Escape so an enclosing Drawer stays open.\n event.preventDefault();\n setOpen(false);\n triggerRef.current?.focus();\n break;\n case \"Tab\":\n setOpen(false);\n break;\n case \"ArrowDown\":\n case \"ArrowUp\":\n event.preventDefault();\n step(event.key === \"ArrowDown\" ? 1 : -1);\n break;\n case \"Home\":\n case \"End\": {\n event.preventDefault();\n const pick = event.key === \"Home\" ? enabled[0] : enabled[enabled.length - 1];\n if (pick) {\n setActiveIndex(options.indexOf(pick));\n }\n break;\n }\n case \"Enter\":\n case \" \": {\n event.preventDefault();\n const option = options[activeIndex];\n if (option && !option.isDisabled) {\n commit(option.value);\n }\n break;\n }\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (effectiveDisabled) {\n return;\n }\n if (isVisible) {\n handleListKeyDown(event);\n } else if ([\"ArrowDown\", \"ArrowUp\", \"Enter\", \" \"].includes(event.key)) {\n event.preventDefault();\n setOpen(true);\n }\n };\n\n return (\n <div\n className=\"ds-select-root\"\n ref={rootRef}\n >\n <Button\n ref={(node) => {\n triggerRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n size={size}\n role=\"combobox\"\n aria-required={required || undefined}\n aria-haspopup=\"listbox\"\n aria-expanded={isVisible}\n aria-controls={isVisible ? listId : undefined}\n aria-activedescendant={\n isVisible && options[activeIndex] && !options[activeIndex].isDisabled\n ? `${listId}-option-${activeIndex}`\n : undefined\n }\n aria-invalid={isInvalid || ariaInvalid || undefined}\n isDisabled={effectiveDisabled}\n data-placeholder={selected ? undefined : \"\"}\n className={cx(\"ds-field-skin\", \"ds-select\", className)}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n setOpen((open) => !open);\n }\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) {\n handleKeyDown(event);\n }\n }}\n {...rest}\n >\n <span className=\"ds-select__value\">{selected ? selected.label : placeholder}</span>\n <Icon\n name=\"chevron-down\"\n size={16}\n className=\"ds-select__chevron\"\n />\n </Button>\n <Popover\n anchorRef={triggerRef}\n isOpen={isVisible}\n align=\"start\"\n placement={menuPlacement}\n matchAnchorWidth\n panelRef={listRef}\n id={listId}\n role=\"listbox\"\n aria-label={rest[\"aria-labelledby\"] ? undefined : (rest[\"aria-label\"] ?? placeholder)}\n aria-labelledby={rest[\"aria-labelledby\"]}\n className=\"ds-surface-raised ds-select__menu\"\n >\n <div\n onKeyDown={handleKeyDown}\n onPointerDown={(event) => event.preventDefault()}\n >\n {options.map((option, index) => (\n <Button\n key={option.value}\n variant={index === activeIndex ? \"active\" : \"simple\"}\n size=\"sm\"\n isDisabled={option.isDisabled}\n tabIndex={-1}\n id={`${listId}-option-${index}`}\n role=\"option\"\n aria-selected={option.value === current}\n aria-disabled={option.isDisabled || undefined}\n data-active={index === activeIndex || undefined}\n className=\"ds-select__option\"\n onMouseEnter={() => !option.isDisabled && setActiveIndex(index)}\n onClick={() => {\n if (!option.isDisabled) {\n commit(option.value);\n triggerRef.current?.focus();\n }\n }}\n >\n <span className=\"ds-select__option-body\">\n <span className=\"ds-select__option-label\">{option.label}</span>\n {option.description && (\n <span className=\"ds-select__option-description\">{option.description}</span>\n )}\n </span>\n {option.value === current && (\n <Icon\n name=\"check\"\n size={16}\n />\n )}\n </Button>\n ))}\n </div>\n </Popover>\n </div>\n );\n});\n"],"mappings":";;;;;;;AAgBA,SAASC,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAgCA,IAAaC,IAASC,EAA2C,SAC/D,EACE,YACA,UACA,iBACA,kBACA,iBAAc,oBACd,UAAO,MACP,gBAAa,IACb,eAAY,IACZ,gBAAgBC,GAChB,aACA,mBAAgB,UAChB,cACA,aACA,YACA,cACA,GAAGC,KAEL,GACA;CACA,IAAM,CAACC,GAAUC,KAAeC,EAASC,KAAgB,EAAE,GACrDC,IAAUC,KAASL,GACnB,CAACM,GAAQC,KAAWL,EAAS,EAAK,GAClC,CAACM,GAAaC,KAAkBP,EAAS,CAAC,GAC1CQ,IAAUC,EAA8B,IAAI,GAC5CC,IAAaD,EAAiC,IAAI,GAClDE,IAAUF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AAM,WAAU;MAAhB,UAAA,CACE,kBAAC,QAAD;OAAM,WAAU;OAA2B,UAAAU,EAAO;MAAY,CAAA,GAC7DA,EAAO,eACN,kBAAC,QAAD;OAAM,WAAU;OAAiC,UAAAA,EAAO;MAAkB,CAAA,CAExE;KACL,CAAA,GAAAA,EAAO,UAAUlB,KAChB,kBAACX,GAAD;MACE,MAAK;MACL,MAAM;KACP,CAAA,CAEG;IA/BD,GAAA6B,EAAO,KA+BN,CACT;GACE,CAAA;EACE,CAAA,CACN;;AAET,CAAC"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D38lQXNe.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.createContext)({isCollapsed:!1});function a(){return(0,n.useContext)(i).isCollapsed}var o=(0,n.forwardRef)(function({isCollapsed:e,defaultCollapsed:t=!1,onCollapsedChange:a,label:o=`Main`,className:c,children:l,...u},d){let[f,p]=(0,n.useState)(t),m=e??f,h=(0,n.useCallback)(()=>{let t=!m;e===void 0&&p(t),a?.(t)},[e,m,a]),g=(0,n.useMemo)(()=>({isCollapsed:m}),[m]);return(0,r.jsx)(i.Provider,{value:g,children:(0,r.jsx)(s.Provider,{value:h,children:(0,r.jsx)(`nav`,{ref:d,"aria-label":o,"data-collapsed":m||void 0,className:[`ds-sidenav`,c].filter(Boolean).join(` `),...u,children:l})})})}),s=(0,n.createContext)(()=>{}),c=(0,n.forwardRef)(function({title:e,mark:a,isCollapsible:o=!0,className:c,children:l,...u},d){let{isCollapsed:f}=(0,n.useContext)(i),p=(0,n.useContext)(s);return(0,r.jsxs)(`div`,{ref:d,className:[`ds-sidenav__header`,c].filter(Boolean).join(` `),...u,children:[a&&(0,r.jsx)(`span`,{className:`ds-sidenav__mark`,children:a}),!f&&(e||l)&&(0,r.jsx)(`span`,{className:`ds-sidenav__title`,children:e??l}),o&&(0,r.jsx)(t.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:f?`chevrons-right`:`chevrons-left`,className:`ds-sidenav__toggle`,"aria-label":f?`Expand navigation`:`Collapse navigation`,"aria-expanded":!f,title:f?`Expand navigation`:`Collapse navigation`,onClick:p})]})}),l=(0,n.forwardRef)(function({label:e,className:t,children:a,...o},s){let{isCollapsed:c}=(0,n.useContext)(i);return(0,r.jsxs)(`div`,{ref:s,className:[`ds-sidenav__section`,t].filter(Boolean).join(` `),"aria-label":e,role:e?`group`:void 0,...o,children:[e&&!c&&(0,r.jsx)(`span`,{className:`ds-sidenav__section-label`,children:e}),(0,r.jsx)(`ul`,{className:`ds-sidenav__list`,children:a})]})}),u=(0,n.forwardRef)(function({icon:t,label:a,isActive:o,badge:s,className:c,...l},u){let{isCollapsed:d}=(0,n.useContext)(i);return(0,r.jsx)(`li`,{className:`ds-sidenav__row`,children:(0,r.jsxs)(`a`,{ref:u,className:[`ds-sidenav__item`,c].filter(Boolean).join(` `),"data-active":o||void 0,"aria-current":o?`page`:void 0,title:d?a:void 0,...l,children:[(0,r.jsx)(e.t,{name:t}),!d&&(0,r.jsx)(`span`,{className:`ds-sidenav__label`,children:a}),!d&&s&&(0,r.jsx)(`span`,{className:`ds-sidenav__badge`,children:s}),d&&(0,r.jsx)(`span`,{className:`ds-sidenav__sr`,children:a})]})})}),d=(0,n.forwardRef)(function({className:e,children:t,...n},i){return(0,r.jsx)(`div`,{ref:i,className:[`ds-sidenav__footer`,e].filter(Boolean).join(` `),...n,children:t})});exports.SideNav=o,exports.SideNavFooter=d,exports.SideNavHeader=c,exports.SideNavItem=u,exports.SideNavSection=l,exports.useSideNavCollapsed=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D7GrTtqc.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.createContext)({isCollapsed:!1});function a(){return(0,n.useContext)(i).isCollapsed}var o=(0,n.forwardRef)(function({isCollapsed:e,defaultCollapsed:t=!1,onCollapsedChange:a,label:o=`Main`,className:c,children:l,...u},d){let[f,p]=(0,n.useState)(t),m=e??f,h=(0,n.useCallback)(()=>{let t=!m;e===void 0&&p(t),a?.(t)},[e,m,a]),g=(0,n.useMemo)(()=>({isCollapsed:m}),[m]);return(0,r.jsx)(i.Provider,{value:g,children:(0,r.jsx)(s.Provider,{value:h,children:(0,r.jsx)(`nav`,{ref:d,"aria-label":o,"data-collapsed":m||void 0,className:[`ds-sidenav`,c].filter(Boolean).join(` `),...u,children:l})})})}),s=(0,n.createContext)(()=>{}),c=(0,n.forwardRef)(function({title:e,mark:a,isCollapsible:o=!0,className:c,children:l,...u},d){let{isCollapsed:f}=(0,n.useContext)(i),p=(0,n.useContext)(s);return(0,r.jsxs)(`div`,{ref:d,className:[`ds-sidenav__header`,c].filter(Boolean).join(` `),...u,children:[a&&(0,r.jsx)(`span`,{className:`ds-sidenav__mark`,children:a}),!f&&(e||l)&&(0,r.jsx)(`span`,{className:`ds-sidenav__title`,children:e??l}),o&&(0,r.jsx)(t.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:f?`chevrons-right`:`chevrons-left`,className:`ds-sidenav__toggle`,"aria-label":f?`Expand navigation`:`Collapse navigation`,"aria-expanded":!f,title:f?`Expand navigation`:`Collapse navigation`,onClick:p})]})}),l=(0,n.forwardRef)(function({label:e,className:t,children:a,...o},s){let{isCollapsed:c}=(0,n.useContext)(i);return(0,r.jsxs)(`div`,{ref:s,className:[`ds-sidenav__section`,t].filter(Boolean).join(` `),"aria-label":e,role:e?`group`:void 0,...o,children:[e&&!c&&(0,r.jsx)(`span`,{className:`ds-sidenav__section-label`,children:e}),(0,r.jsx)(`ul`,{className:`ds-sidenav__list`,children:a})]})}),u=(0,n.forwardRef)(function({icon:t,label:a,isActive:o,badge:s,className:c,...l},u){let{isCollapsed:d}=(0,n.useContext)(i);return(0,r.jsx)(`li`,{className:`ds-sidenav__row`,children:(0,r.jsxs)(`a`,{ref:u,className:[`ds-sidenav__item`,c].filter(Boolean).join(` `),"data-active":o||void 0,"aria-current":o?`page`:void 0,title:d?a:void 0,...l,children:[(0,r.jsx)(e.t,{name:t}),!d&&(0,r.jsx)(`span`,{className:`ds-sidenav__label`,children:a}),!d&&s&&(0,r.jsx)(`span`,{className:`ds-sidenav__badge`,children:s}),d&&(0,r.jsx)(`span`,{className:`ds-sidenav__sr`,children:a})]})})}),d=(0,n.forwardRef)(function({className:e,children:t,...n},i){return(0,r.jsx)(`div`,{ref:i,className:[`ds-sidenav__footer`,e].filter(Boolean).join(` `),...n,children:t})});exports.SideNav=o,exports.SideNavFooter=d,exports.SideNavHeader=c,exports.SideNavItem=u,exports.SideNavSection=l,exports.useSideNavCollapsed=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../chunks/Icon-D1kx7-1c.js";
1
+ import { t as e } from "../../chunks/Icon-BZjGAu8D.js";
2
2
  import { Button as t } from "../Button/index.js";
3
3
  import { createContext as n, forwardRef as r, useCallback as i, useContext as a, useMemo as o, useState as s } from "react";
4
4
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D38lQXNe.cjs"),t=require("../Button/index.cjs"),n=require("../../chunks/mergeRefs-Bc3qS0Tt.cjs");let r=require("react"),i=require("react/jsx-runtime"),a=require("@dnd-kit/core"),o=require("@dnd-kit/modifiers"),s=require("@dnd-kit/sortable"),c=require("@dnd-kit/utilities");function l(e){return(0,r.isValidElement)(e)&&typeof e.props.id==`string`}var u=(0,r.createContext)({isDisabled:!1,hasOverlay:!1});function d(e){e?.setAttribute(`inert`,``)}function f(){let{active:e,activeNodeRect:t,measureDroppableContainers:n}=(0,a.useDndContext)(),i=e?.id,o=t?.width,s=t?.height,c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(i==null||o===void 0){c.current=null;return}let e=`${o}x${s}`;c.current!==null&&c.current!==e&&n([]),c.current=e},[i,o,s,n]),null}var p=(0,r.forwardRef)(function({items:t,onReorder:n,isDisabled:c=!1,onDragStart:p,onDragEnd:m,onDragCancel:h,renderDragOverlay:g,className:_,children:v,...y},b){let x=(0,r.useId)(),[S,C]=(0,r.useState)(null),[w,T]=(0,r.useState)(t),[E,D]=(0,r.useState)(t);t!==E&&t.join(`\0`)!==E.join(`\0`)&&(D(t),T(t));let O=(0,a.useSensors)((0,a.useSensor)(a.PointerSensor,{activationConstraint:{distance:4}}),(0,a.useSensor)(a.KeyboardSensor,{coordinateGetter:s.sortableKeyboardCoordinates})),k=(0,r.useCallback)(e=>{let t=String(e.active.id);C(t),p?.(t)},[p]);(0,r.useEffect)(()=>{if(!S)return;let e=e=>{e.code===`Escape`&&e.preventDefault()};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[S]);let A=(0,r.useCallback)(e=>{C(null);let{active:t,over:r}=e;if(m?.(String(t.id)),c||!r||t.id===r.id)return;let i=w.indexOf(String(t.id)),a=w.indexOf(String(r.id));if(i<0||a<0)return;let o=(0,s.arrayMove)(w,i,a);T(o),n?.(o)},[w,n,c,m]),j=r.Children.toArray(v),M=new Map(j.filter(l).map(e=>[e.props.id,e])),N=[...w.flatMap(e=>M.get(e)??[]),...j.filter(e=>!l(e)||!w.includes(e.props.id))],P=g!==void 0,F=(0,r.useMemo)(()=>({isDisabled:c,hasOverlay:P}),[c,P]);return(0,i.jsxs)(a.DndContext,{id:`ds-sortable-list-${x}`,sensors:O,collisionDetection:a.closestCenter,modifiers:[o.restrictToVerticalAxis],onDragStart:k,onDragEnd:A,onDragCancel:e=>{C(null),h?.(String(e.active.id))},children:[(0,i.jsx)(f,{}),(0,i.jsx)(s.SortableContext,{items:w,strategy:s.verticalListSortingStrategy,children:(0,i.jsx)(u.Provider,{value:F,children:(0,i.jsx)(`ul`,{ref:b,className:[`ds-sortable-list`,_].filter(Boolean).join(` `),...y,children:N})})}),g&&(0,i.jsx)(a.DragOverlay,{className:`ds-sortable-overlay`,style:{height:`auto`},children:S?(0,i.jsxs)(`div`,{className:`ds-sortable-item`,"data-overlay":!0,"aria-hidden":`true`,ref:d,children:[(0,i.jsx)(`span`,{className:`ds-sortable-item__handle`,"aria-hidden":`true`,children:(0,i.jsx)(e.t,{name:`grip-vertical`})}),(0,i.jsx)(`div`,{className:`ds-sortable-item__content`,children:g(S)})]}):null})]})}),m=(0,r.forwardRef)(function({id:e,label:a,action:o,isDisabled:l=!1,className:d,children:f,...p},m){let h=(0,r.useContext)(u),g=l||h.isDisabled,{attributes:_,listeners:v,setNodeRef:y,transform:b,transition:x,isDragging:S}=(0,s.useSortable)({id:e,disabled:g});return(0,i.jsxs)(`li`,{ref:n.t(y,m),style:{transform:c.CSS.Translate.toString(b),transition:x},className:[`ds-sortable-item`,d].filter(Boolean).join(` `),"data-dragging":S?h.hasOverlay?`placeholder`:`lifted`:void 0,...p,children:[(0,i.jsx)(t.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:`grip-vertical`,className:`ds-sortable-item__handle`,"aria-label":a?`Move ${a}`:`Move item`,isDisabled:g,isFocusableWhenDisabled:!0,..._,...v}),(0,i.jsx)(`div`,{className:`ds-sortable-item__content`,children:f}),o&&(0,i.jsx)(`div`,{className:`ds-sortable-item__action`,children:o})]})});exports.SortableList=p,exports.SortableListItem=m;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D7GrTtqc.cjs"),t=require("../Button/index.cjs"),n=require("../../chunks/mergeRefs-Bc3qS0Tt.cjs");let r=require("react"),i=require("react/jsx-runtime"),a=require("@dnd-kit/core"),o=require("@dnd-kit/modifiers"),s=require("@dnd-kit/sortable"),c=require("@dnd-kit/utilities");function l(e){return(0,r.isValidElement)(e)&&typeof e.props.id==`string`}var u=(0,r.createContext)({isDisabled:!1,hasOverlay:!1});function d(e){e?.setAttribute(`inert`,``)}function f(){let{active:e,activeNodeRect:t,measureDroppableContainers:n}=(0,a.useDndContext)(),i=e?.id,o=t?.width,s=t?.height,c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(i==null||o===void 0){c.current=null;return}let e=`${o}x${s}`;c.current!==null&&c.current!==e&&n([]),c.current=e},[i,o,s,n]),null}var p=(0,r.forwardRef)(function({items:t,onReorder:n,isDisabled:c=!1,onDragStart:p,onDragEnd:m,onDragCancel:h,renderDragOverlay:g,className:_,children:v,...y},b){let x=(0,r.useId)(),[S,C]=(0,r.useState)(null),[w,T]=(0,r.useState)(t),[E,D]=(0,r.useState)(t);t!==E&&t.join(`\0`)!==E.join(`\0`)&&(D(t),T(t));let O=(0,a.useSensors)((0,a.useSensor)(a.PointerSensor,{activationConstraint:{distance:4}}),(0,a.useSensor)(a.KeyboardSensor,{coordinateGetter:s.sortableKeyboardCoordinates})),k=(0,r.useCallback)(e=>{let t=String(e.active.id);C(t),p?.(t)},[p]);(0,r.useEffect)(()=>{if(!S)return;let e=e=>{e.code===`Escape`&&e.preventDefault()};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[S]);let A=(0,r.useCallback)(e=>{C(null);let{active:t,over:r}=e;if(m?.(String(t.id)),c||!r||t.id===r.id)return;let i=w.indexOf(String(t.id)),a=w.indexOf(String(r.id));if(i<0||a<0)return;let o=(0,s.arrayMove)(w,i,a);T(o),n?.(o)},[w,n,c,m]),j=r.Children.toArray(v),M=new Map(j.filter(l).map(e=>[e.props.id,e])),N=[...w.flatMap(e=>M.get(e)??[]),...j.filter(e=>!l(e)||!w.includes(e.props.id))],P=g!==void 0,F=(0,r.useMemo)(()=>({isDisabled:c,hasOverlay:P}),[c,P]);return(0,i.jsxs)(a.DndContext,{id:`ds-sortable-list-${x}`,sensors:O,collisionDetection:a.closestCenter,modifiers:[o.restrictToVerticalAxis],onDragStart:k,onDragEnd:A,onDragCancel:e=>{C(null),h?.(String(e.active.id))},children:[(0,i.jsx)(f,{}),(0,i.jsx)(s.SortableContext,{items:w,strategy:s.verticalListSortingStrategy,children:(0,i.jsx)(u.Provider,{value:F,children:(0,i.jsx)(`ul`,{ref:b,className:[`ds-sortable-list`,_].filter(Boolean).join(` `),...y,children:N})})}),g&&(0,i.jsx)(a.DragOverlay,{className:`ds-sortable-overlay`,style:{height:`auto`},children:S?(0,i.jsxs)(`div`,{className:`ds-sortable-item`,"data-overlay":!0,"aria-hidden":`true`,ref:d,children:[(0,i.jsx)(`span`,{className:`ds-sortable-item__handle`,"aria-hidden":`true`,children:(0,i.jsx)(e.t,{name:`grip-vertical`})}),(0,i.jsx)(`div`,{className:`ds-sortable-item__content`,children:g(S)})]}):null})]})}),m=(0,r.forwardRef)(function({id:e,label:a,action:o,isDisabled:l=!1,className:d,children:f,...p},m){let h=(0,r.useContext)(u),g=l||h.isDisabled,{attributes:_,listeners:v,setNodeRef:y,transform:b,transition:x,isDragging:S}=(0,s.useSortable)({id:e,disabled:g});return(0,i.jsxs)(`li`,{ref:n.t(y,m),style:{transform:c.CSS.Translate.toString(b),transition:x},className:[`ds-sortable-item`,d].filter(Boolean).join(` `),"data-dragging":S?h.hasOverlay?`placeholder`:`lifted`:void 0,...p,children:[(0,i.jsx)(t.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:`grip-vertical`,className:`ds-sortable-item__handle`,"aria-label":a?`Move ${a}`:`Move item`,isDisabled:g,isFocusableWhenDisabled:!0,..._,...v}),(0,i.jsx)(`div`,{className:`ds-sortable-item__content`,children:f}),o&&(0,i.jsx)(`div`,{className:`ds-sortable-item__action`,children:o})]})});exports.SortableList=p,exports.SortableListItem=m;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../chunks/Icon-D1kx7-1c.js";
1
+ import { t as e } from "../../chunks/Icon-BZjGAu8D.js";
2
2
  import { Button as t } from "../Button/index.js";
3
3
  import { t as n } from "../../chunks/mergeRefs-DGM402mE.js";
4
4
  import { Children as r, createContext as i, forwardRef as a, isValidElement as o, useCallback as s, useContext as c, useEffect as l, useId as u, useMemo as d, useRef as f, useState as p } from "react";
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D38lQXNe.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");function i(e,t){return e<t?`complete`:e===t?`current`:`upcoming`}var a=(0,n.forwardRef)(function({steps:a,activeStep:o,size:s=`md`,label:c=`Progress`,onStepChange:l,className:u,...d},f){let p=(0,n.useId)();return(0,r.jsx)(`nav`,{ref:f,"aria-label":c,"data-size":s,className:[`ds-stepper`,u].filter(Boolean).join(` `),...d,children:(0,r.jsx)(`ol`,{className:`ds-stepper__list`,children:a.map((n,a)=>{let s=i(a,o),c=!!l&&s!==`upcoming`,u=(0,r.jsxs)(r.Fragment,{children:[s===`complete`?(0,r.jsx)(e.t,{name:`check`,size:16,"aria-hidden":`true`}):a+1,(0,r.jsx)(`span`,{id:`${p}-${a}-status`,className:`ds-stepper__sr`,children:s})]});return(0,r.jsxs)(`li`,{className:`ds-stepper__step`,"data-status":s,"aria-current":s===`current`?`step`:void 0,children:[(0,r.jsxs)(`span`,{className:`ds-stepper__track`,"aria-hidden":`true`,children:[(0,r.jsx)(`span`,{className:`ds-stepper__connector`,"data-side":`start`}),(0,r.jsx)(`span`,{className:`ds-stepper__connector`,"data-side":`end`})]}),c?(0,r.jsx)(t.Button,{className:`ds-stepper__marker`,variant:s===`complete`?`primary`:`active`,size:`sm`,isIconOnly:!0,"aria-labelledby":`${p}-${a}-label`,"aria-describedby":`${p}-${a}-status`,onClick:()=>l?.(a,n.id),children:u}):(0,r.jsx)(`span`,{className:`ds-stepper__marker`,children:u}),(0,r.jsxs)(`span`,{className:`ds-stepper__text`,children:[(0,r.jsx)(`span`,{id:`${p}-${a}-label`,className:`ds-stepper__label`,children:n.label}),n.description&&(0,r.jsx)(`span`,{className:`ds-stepper__description`,children:n.description})]})]},n.id)})})})});exports.Stepper=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D7GrTtqc.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");function i(e,t){return e<t?`complete`:e===t?`current`:`upcoming`}var a=(0,n.forwardRef)(function({steps:a,activeStep:o,size:s=`md`,label:c=`Progress`,onStepChange:l,className:u,...d},f){let p=(0,n.useId)();return(0,r.jsx)(`nav`,{ref:f,"aria-label":c,"data-size":s,className:[`ds-stepper`,u].filter(Boolean).join(` `),...d,children:(0,r.jsx)(`ol`,{className:`ds-stepper__list`,children:a.map((n,a)=>{let s=i(a,o),c=!!l&&s!==`upcoming`,u=(0,r.jsxs)(r.Fragment,{children:[s===`complete`?(0,r.jsx)(e.t,{name:`check`,size:16,"aria-hidden":`true`}):a+1,(0,r.jsx)(`span`,{id:`${p}-${a}-status`,className:`ds-stepper__sr`,children:s})]});return(0,r.jsxs)(`li`,{className:`ds-stepper__step`,"data-status":s,"aria-current":s===`current`?`step`:void 0,children:[(0,r.jsxs)(`span`,{className:`ds-stepper__track`,"aria-hidden":`true`,children:[(0,r.jsx)(`span`,{className:`ds-stepper__connector`,"data-side":`start`}),(0,r.jsx)(`span`,{className:`ds-stepper__connector`,"data-side":`end`})]}),c?(0,r.jsx)(t.Button,{className:`ds-stepper__marker`,variant:s===`complete`?`primary`:`active`,size:`sm`,isIconOnly:!0,"aria-labelledby":`${p}-${a}-label`,"aria-describedby":`${p}-${a}-status`,onClick:()=>l?.(a,n.id),children:u}):(0,r.jsx)(`span`,{className:`ds-stepper__marker`,children:u}),(0,r.jsxs)(`span`,{className:`ds-stepper__text`,children:[(0,r.jsx)(`span`,{id:`${p}-${a}-label`,className:`ds-stepper__label`,children:n.label}),n.description&&(0,r.jsx)(`span`,{className:`ds-stepper__description`,children:n.description})]})]},n.id)})})})});exports.Stepper=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../chunks/Icon-D1kx7-1c.js";
1
+ import { t as e } from "../../chunks/Icon-BZjGAu8D.js";
2
2
  import { Button as t } from "../Button/index.js";
3
3
  import { forwardRef as n, useId as r } from "react";
4
4
  import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D38lQXNe.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.forwardRef)(function({label:e,actions:t,className:n,children:i,...a},o){return(0,r.jsxs)(`nav`,{ref:o,"aria-label":e,className:[`ds-subnav`,n].filter(Boolean).join(` `),...a,children:[(0,r.jsx)(`ul`,{className:`ds-subnav__list`,children:i}),t&&(0,r.jsx)(`div`,{className:`ds-subnav__actions`,children:t})]})}),a=(0,n.forwardRef)(function({label:t,icon:n,isActive:i,count:a,className:o,...s},c){return(0,r.jsx)(`li`,{className:`ds-subnav__row`,children:(0,r.jsxs)(`a`,{ref:c,className:[`ds-subnav__item`,o].filter(Boolean).join(` `),"data-active":i||void 0,"aria-current":i?`page`:void 0,...s,children:[n&&(0,r.jsx)(e.t,{name:n}),t,a!==void 0&&(0,r.jsx)(`span`,{className:`ds-subnav__count`,children:a})]})})}),o=(0,n.forwardRef)(function({label:e,icon:n,isActive:i,count:a,disabled:o,className:s,...c},l){return(0,r.jsx)(`li`,{className:`ds-subnav__row`,children:(0,r.jsxs)(t.Button,{ref:l,variant:`simple`,iconStart:n,isDisabled:o,className:[`ds-subnav__item`,s].filter(Boolean).join(` `),"data-active":i||void 0,"aria-pressed":i,...c,children:[e,a!==void 0&&(0,r.jsx)(`span`,{className:`ds-subnav__count`,children:a})]})})});exports.SubNav=i,exports.SubNavButton=o,exports.SubNavItem=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D7GrTtqc.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.forwardRef)(function({label:e,actions:t,className:n,children:i,...a},o){return(0,r.jsxs)(`nav`,{ref:o,"aria-label":e,className:[`ds-subnav`,n].filter(Boolean).join(` `),...a,children:[(0,r.jsx)(`ul`,{className:`ds-subnav__list`,children:i}),t&&(0,r.jsx)(`div`,{className:`ds-subnav__actions`,children:t})]})}),a=(0,n.forwardRef)(function({label:t,icon:n,isActive:i,count:a,className:o,...s},c){return(0,r.jsx)(`li`,{className:`ds-subnav__row`,children:(0,r.jsxs)(`a`,{ref:c,className:[`ds-subnav__item`,o].filter(Boolean).join(` `),"data-active":i||void 0,"aria-current":i?`page`:void 0,...s,children:[n&&(0,r.jsx)(e.t,{name:n}),t,a!==void 0&&(0,r.jsx)(`span`,{className:`ds-subnav__count`,children:a})]})})}),o=(0,n.forwardRef)(function({label:e,icon:n,isActive:i,count:a,disabled:o,className:s,...c},l){return(0,r.jsx)(`li`,{className:`ds-subnav__row`,children:(0,r.jsxs)(t.Button,{ref:l,variant:`simple`,iconStart:n,isDisabled:o,className:[`ds-subnav__item`,s].filter(Boolean).join(` `),"data-active":i||void 0,"aria-pressed":i,...c,children:[e,a!==void 0&&(0,r.jsx)(`span`,{className:`ds-subnav__count`,children:a})]})})});exports.SubNav=i,exports.SubNavButton=o,exports.SubNavItem=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../chunks/Icon-D1kx7-1c.js";
1
+ import { t as e } from "../../chunks/Icon-BZjGAu8D.js";
2
2
  import { Button as t } from "../Button/index.js";
3
3
  import { forwardRef as n } from "react";
4
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D38lQXNe.cjs");let t=require("react"),n=require("react/jsx-runtime");function r(...e){return e.filter(Boolean).join(` `)}var i=(0,t.forwardRef)(function({className:e,children:t,...i},a){return(0,n.jsx)(`div`,{ref:a,className:r(`ds-table-frame`,e),...i,children:t})}),a=(0,t.forwardRef)(function({start:e,end:t,className:i,...a},o){return(0,n.jsxs)(`div`,{ref:o,className:r(`ds-table-toolbar`,i),...a,children:[(0,n.jsx)(`div`,{className:`ds-table-toolbar__group`,children:e}),(0,n.jsx)(`div`,{className:`ds-table-toolbar__group`,children:t})]})});function o(e){return t.Children.toArray(e).some(e=>(0,t.isValidElement)(e)&&(e.type!==t.Fragment||o(e.props.children)))}var s=(0,t.createContext)({emptyMessage:`No data found.`}),c=(0,t.forwardRef)(function({emptyMessage:e=`No data found.`,isEmpty:t,className:i,children:a,...o},c){return(0,n.jsx)(s.Provider,{value:{emptyMessage:e,isEmpty:t},children:(0,n.jsx)(`div`,{className:`ds-table-frame__scroll`,children:(0,n.jsx)(`table`,{...o,ref:c,className:r(`ds-table`,i),children:a})})})}),l=(0,t.forwardRef)(function({className:e,...t},r){return(0,n.jsx)(`thead`,{ref:r,className:e,...t})}),u=(0,t.forwardRef)(function({className:e,children:r,...i},a){let{emptyMessage:c,isEmpty:l}=(0,t.useContext)(s);return(0,n.jsx)(`tbody`,{ref:a,className:e,...i,children:l??!o(r)?(0,n.jsx)(d,{children:(0,n.jsx)(p,{colSpan:1e3,className:`ds-table__empty-cell`,children:(0,n.jsx)(m,{title:c,role:`status`})})}):r})}),d=(0,t.forwardRef)(function({isSelected:e=!1,isInteractive:t=!1,className:r,...i},a){return(0,n.jsx)(`tr`,{ref:a,"data-selected":e||void 0,"data-interactive":t||void 0,tabIndex:t?0:void 0,className:r,...i})}),f=(0,t.forwardRef)(function({align:e=`start`,width:t=`auto`,className:r,...i},a){return(0,n.jsx)(`th`,{ref:a,scope:`col`,"data-align":e,"data-width":t,className:r,...i})}),p=(0,t.forwardRef)(function({align:e=`start`,width:t=`auto`,emphasis:r=`default`,className:i,...a},o){return(0,n.jsx)(`td`,{ref:o,"data-align":e,"data-width":t,"data-emphasis":r==="default"?void 0:r,className:i,...a})}),m=(0,t.forwardRef)(function({icon:t=`info`,title:i=`No data found.`,description:a,action:o,className:s,...c},l){return(0,n.jsxs)(`div`,{ref:l,className:r(`ds-table-empty`,s),...c,children:[(0,n.jsx)(e.t,{name:t,size:24}),(0,n.jsx)(`span`,{style:{color:`var(--color-text)`,fontWeight:`var(--font-weight-bold)`},children:i}),a&&(0,n.jsx)(`span`,{children:a}),o]})});exports.Table=c,exports.TableBody=u,exports.TableCell=p,exports.TableEmpty=m,exports.TableFrame=i,exports.TableHead=l,exports.TableHeaderCell=f,exports.TableRow=d,exports.TableToolbar=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-D7GrTtqc.cjs");let t=require("react"),n=require("react/jsx-runtime");function r(...e){return e.filter(Boolean).join(` `)}var i=(0,t.forwardRef)(function({className:e,children:t,...i},a){return(0,n.jsx)(`div`,{ref:a,className:r(`ds-table-frame`,e),...i,children:t})}),a=(0,t.forwardRef)(function({start:e,end:t,className:i,...a},o){return(0,n.jsxs)(`div`,{ref:o,className:r(`ds-table-toolbar`,i),...a,children:[(0,n.jsx)(`div`,{className:`ds-table-toolbar__group`,children:e}),(0,n.jsx)(`div`,{className:`ds-table-toolbar__group`,children:t})]})});function o(e){return t.Children.toArray(e).some(e=>(0,t.isValidElement)(e)&&(e.type!==t.Fragment||o(e.props.children)))}var s=(0,t.createContext)({emptyMessage:`No data found.`}),c=(0,t.forwardRef)(function({emptyMessage:e=`No data found.`,isEmpty:t,className:i,children:a,...o},c){return(0,n.jsx)(s.Provider,{value:{emptyMessage:e,isEmpty:t},children:(0,n.jsx)(`div`,{className:`ds-table-frame__scroll`,children:(0,n.jsx)(`table`,{...o,ref:c,className:r(`ds-table`,i),children:a})})})}),l=(0,t.forwardRef)(function({className:e,...t},r){return(0,n.jsx)(`thead`,{ref:r,className:e,...t})}),u=(0,t.forwardRef)(function({className:e,children:r,...i},a){let{emptyMessage:c,isEmpty:l}=(0,t.useContext)(s);return(0,n.jsx)(`tbody`,{ref:a,className:e,...i,children:l??!o(r)?(0,n.jsx)(d,{children:(0,n.jsx)(p,{colSpan:1e3,className:`ds-table__empty-cell`,children:(0,n.jsx)(m,{title:c,role:`status`})})}):r})}),d=(0,t.forwardRef)(function({isSelected:e=!1,isInteractive:t=!1,className:r,...i},a){return(0,n.jsx)(`tr`,{ref:a,"data-selected":e||void 0,"data-interactive":t||void 0,tabIndex:t?0:void 0,className:r,...i})}),f=(0,t.forwardRef)(function({align:e=`start`,width:t=`auto`,className:r,...i},a){return(0,n.jsx)(`th`,{ref:a,scope:`col`,"data-align":e,"data-width":t,className:r,...i})}),p=(0,t.forwardRef)(function({align:e=`start`,width:t=`auto`,emphasis:r=`default`,className:i,...a},o){return(0,n.jsx)(`td`,{ref:o,"data-align":e,"data-width":t,"data-emphasis":r==="default"?void 0:r,className:i,...a})}),m=(0,t.forwardRef)(function({icon:t=`info`,title:i=`No data found.`,description:a,action:o,className:s,...c},l){return(0,n.jsxs)(`div`,{ref:l,className:r(`ds-table-empty`,s),...c,children:[(0,n.jsx)(e.t,{name:t,size:24}),(0,n.jsx)(`span`,{style:{color:`var(--color-text)`,fontWeight:`var(--font-weight-bold)`},children:i}),a&&(0,n.jsx)(`span`,{children:a}),o]})});exports.Table=c,exports.TableBody=u,exports.TableCell=p,exports.TableEmpty=m,exports.TableFrame=i,exports.TableHead=l,exports.TableHeaderCell=f,exports.TableRow=d,exports.TableToolbar=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../chunks/Icon-D1kx7-1c.js";
1
+ import { t as e } from "../../chunks/Icon-BZjGAu8D.js";
2
2
  import { Children as t, Fragment as n, createContext as r, forwardRef as i, isValidElement as a, useContext as o } from "react";
3
3
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
4
4
  //#region src/components/Table/index.tsx
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Popover/index.cjs");let t=require("react"),n=require("react/jsx-runtime");function r(...e){return e.filter(Boolean).join(` `)}var i=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],a=6e4,o=60*a,s=24*o,c=7*s;function l(e){return String(e).padStart(2,`0`)}function u(e,t={}){let{hasYear:n=!0}=t,r=`${e.getDate()} ${i[e.getMonth()]}`;return n?`${r} ${e.getFullYear()}`:r}function d(e,t={}){let{hasTimeZone:n=!0}=t,r=`${u(e)}, ${l(e.getHours())}:${l(e.getMinutes())}`;if(!n)return r;let i=new Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(e).find(e=>e.type===`timeZoneName`)?.value;return i?`${r} ${i}`:r}function f(e,t=new Date){let n=t.getTime()-e.getTime();if(n<0)return u(e,{hasYear:e.getFullYear()!==t.getFullYear()});if(n<a)return`Just now`;if(n<o)return`${Math.floor(n/a)}m ago`;if(n<s)return`${Math.floor(n/o)}h ago`;if(n<c){let e=Math.floor(n/s);return`${e} ${e===1?`day`:`days`} ago`}return u(e,{hasYear:e.getFullYear()!==t.getFullYear()})}var p=(0,t.forwardRef)(function({value:i,format:a=`auto`,hasTooltip:o=!0,hasTimeZone:s=!0,now:c,refreshInterval:l=3e4,className:p,tabIndex:m,title:h,onMouseEnter:g,onMouseLeave:_,onFocus:v,onBlur:y,onKeyDown:b,"aria-describedby":x,...S},C){let w=i instanceof Date?i:new Date(i),T=(0,t.useRef)(null),[E,D]=(0,t.useState)(!1),O=(0,t.useId)(),[,k]=(0,t.useState)(0);if((0,t.useEffect)(()=>{if(a===`absolute`||c)return;let e=window.setInterval(()=>k(e=>e+1),l);return()=>window.clearInterval(e)},[a,c,l]),Number.isNaN(w.getTime()))return null;let A=a===`absolute`?u(w):f(w,c??new Date),j=d(w,{hasTimeZone:s}),M=o&&A!==j;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`time`,{ref:e=>{T.current=e,typeof C==`function`?C(e):C&&(C.current=e)},dateTime:w.toISOString(),suppressHydrationWarning:!0,className:r(`ds-time`,!M&&`ds-time--plain`,p),tabIndex:m??(M?0:void 0),"aria-describedby":[x,M&&E&&O].filter(Boolean).join(` `)||void 0,title:h??(M?void 0:j),onMouseEnter:e=>{g?.(e),M&&!e.defaultPrevented&&D(!0)},onMouseLeave:e=>{_?.(e),M&&!e.defaultPrevented&&D(!1)},onFocus:e=>{v?.(e),M&&!e.defaultPrevented&&D(!0)},onBlur:e=>{y?.(e),M&&!e.defaultPrevented&&D(!1)},onKeyDown:e=>{b?.(e),M&&!e.defaultPrevented&&e.key===`Escape`&&D(!1)},...S,children:A}),M&&(0,n.jsx)(e.Popover,{anchorRef:T,isOpen:E,id:O,role:`tooltip`,className:`ds-surface-raised ds-time-tooltip`,children:j})]})});exports.Time=p,exports.formatAbsoluteDate=u,exports.formatAbsoluteTime=d,exports.formatRelativeTime=f;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/mergeRefs-Bc3qS0Tt.cjs"),t=require("../../chunks/useTooltip-CCf79zE9.cjs");let n=require("react"),r=require("react/jsx-runtime");function i(...e){return e.filter(Boolean).join(` `)}var a=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],o=6e4,s=60*o,c=24*s,l=7*c;function u(e){return String(e).padStart(2,`0`)}function d(e,t={}){let{hasYear:n=!0}=t,r=`${e.getDate()} ${a[e.getMonth()]}`;return n?`${r} ${e.getFullYear()}`:r}function f(e,t={}){let{hasTimeZone:n=!0}=t,r=`${d(e)}, ${u(e.getHours())}:${u(e.getMinutes())}`;if(!n)return r;let i=new Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(e).find(e=>e.type===`timeZoneName`)?.value;return i?`${r} ${i}`:r}function p(e,t=new Date){let n=t.getTime()-e.getTime();if(n<0)return d(e,{hasYear:e.getFullYear()!==t.getFullYear()});if(n<o)return`Just now`;if(n<s)return`${Math.floor(n/o)}m ago`;if(n<c)return`${Math.floor(n/s)}h ago`;if(n<l){let e=Math.floor(n/c);return`${e} ${e===1?`day`:`days`} ago`}return d(e,{hasYear:e.getFullYear()!==t.getFullYear()})}var m=(0,n.forwardRef)(function({value:a,format:o=`auto`,hasTooltip:s=!0,hasTimeZone:c=!0,now:l,refreshInterval:u=3e4,className:m,tabIndex:h,title:g,onMouseEnter:_,onMouseLeave:v,onFocus:y,onBlur:b,"aria-describedby":x,...S},C){let w=a instanceof Date?a:new Date(a),T=!Number.isNaN(w.getTime()),[,E]=(0,n.useState)(0);(0,n.useEffect)(()=>{if(o===`absolute`||l)return;let e=window.setInterval(()=>E(e=>e+1),u);return()=>window.clearInterval(e)},[o,l,u]);let D=T?o===`absolute`?d(w):p(w,l??new Date):``,O=T?f(w,{hasTimeZone:c}):``,k=T&&s&&D!==O,{anchorRef:A,description:j,triggerProps:M,panel:N}=t.t(k&&O,{className:`ds-time-tooltip`}),P=(0,n.useMemo)(()=>e.t(A,C),[A,C]);return T?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`time`,{ref:P,dateTime:w.toISOString(),suppressHydrationWarning:!0,className:i(`ds-time`,!k&&`ds-time--plain`,m),tabIndex:h??(k?0:void 0),"aria-describedby":[x,j].filter(Boolean).join(` `)||void 0,title:g??(k?void 0:O),...M({onMouseEnter:_,onMouseLeave:v,onFocus:y,onBlur:b}),...S,children:D}),N]}):null});exports.Time=m,exports.formatAbsoluteDate=d,exports.formatAbsoluteTime=f,exports.formatRelativeTime=p;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["forwardRef","useRef","useState","useId","_Fragment","Popover","require_components_Popover_index","react","react_jsx_runtime","cx","parts","MONTHS","MINUTE","HOUR","DAY","WEEK","pad","value","formatAbsoluteDate","options","stem","date","hasYear","formatAbsoluteTime","stamp","hasTimeZone","zone","part","formatRelativeTime","delta","now","days","Time","describedBy","rest","anchorRef","isOpen","setIsOpen","tooltipId","setTick","format","id","t","refreshInterval","label","isTipped","hasTooltip","node","ref","className","tabIndex","title","onMouseEnter","event","onMouseLeave","onFocus","onBlur","onKeyDown"],"sources":["../../../src/components/Time/index.tsx"],"sourcesContent":["import { forwardRef, useEffect, useId, useRef, useState, type HTMLAttributes } from \"react\";\nimport { Popover } from \"../Popover\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\nconst MINUTE = 60_000;\nconst HOUR = 60 * MINUTE;\nconst DAY = 24 * HOUR;\nconst WEEK = 7 * DAY;\n\nfunction pad(value: number) {\n return String(value).padStart(2, \"0\");\n}\n\n/** Day before month, one order everywhere: `12 Jun 2026`. */\nexport function formatAbsoluteDate(date: Date, options: { hasYear?: boolean } = {}) {\n const { hasYear = true } = options;\n const stem = `${date.getDate()} ${MONTHS[date.getMonth()]}`;\n return hasYear ? `${stem} ${date.getFullYear()}` : stem;\n}\n\n/** The tooltip form: `6 Aug 2026, 11:05`, with the reader's zone appended. */\nexport function formatAbsoluteTime(date: Date, options: { hasTimeZone?: boolean } = {}) {\n const { hasTimeZone = true } = options;\n const stamp = `${formatAbsoluteDate(date)}, ${pad(date.getHours())}:${pad(date.getMinutes())}`;\n if (!hasTimeZone) {\n return stamp;\n }\n const zone = new Intl.DateTimeFormat(undefined, { timeZoneName: \"short\" })\n .formatToParts(date)\n .find((part) => part.type === \"timeZoneName\")?.value;\n return zone ? `${stamp} ${zone}` : stamp;\n}\n\n/**\n * Relative up to a week, absolute after. Future dates are always absolute — a\n * scheduled publish reads `12 Jun`, never `in 3 days`.\n */\nexport function formatRelativeTime(date: Date, now: Date = new Date()) {\n const delta = now.getTime() - date.getTime();\n if (delta < 0) {\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n }\n if (delta < MINUTE) {\n return \"Just now\";\n }\n if (delta < HOUR) {\n return `${Math.floor(delta / MINUTE)}m ago`;\n }\n if (delta < DAY) {\n return `${Math.floor(delta / HOUR)}h ago`;\n }\n if (delta < WEEK) {\n const days = Math.floor(delta / DAY);\n return `${days} ${days === 1 ? \"day\" : \"days\"} ago`;\n }\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n}\n\nexport type TimeFormat = \"auto\" | \"relative\" | \"absolute\";\n\nexport interface TimeProps extends Omit<HTMLAttributes<HTMLElement>, \"children\"> {\n /** The instant to print — Date, epoch ms, or an ISO string. */\n value: Date | string | number;\n /** `auto` ages the value; `absolute` always prints the date. */\n format?: TimeFormat;\n /** Show the absolute stamp on hover and focus. */\n hasTooltip?: boolean;\n /** Append the reader's time zone to the tooltip. */\n hasTimeZone?: boolean;\n /** Pin \"now\" — useful for tests and stories. */\n now?: Date;\n /** Re-render interval in ms while the value is still relative. */\n refreshInterval?: number;\n}\n\n/**\n * A machine-readable `<time>` that ages itself. One form per cell: relative or\n * absolute, never both side by side.\n */\nexport const Time = forwardRef<HTMLTimeElement, TimeProps>(function Time(\n {\n value,\n format = \"auto\",\n hasTooltip = true,\n hasTimeZone = true,\n now,\n refreshInterval = 30_000,\n className,\n tabIndex,\n title,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n onKeyDown,\n \"aria-describedby\": describedBy,\n ...rest\n },\n ref,\n) {\n const date = value instanceof Date ? value : new Date(value);\n const anchorRef = useRef<HTMLTimeElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n const tooltipId = useId();\n const [, setTick] = useState(0);\n\n useEffect(() => {\n if (format === \"absolute\" || now) {\n return;\n }\n const id = window.setInterval(() => setTick((t) => t + 1), refreshInterval);\n return () => window.clearInterval(id);\n }, [format, now, refreshInterval]);\n\n if (Number.isNaN(date.getTime())) {\n return null;\n }\n\n const reference = now ?? new Date();\n const label =\n format === \"absolute\" ? formatAbsoluteDate(date) : formatRelativeTime(date, reference);\n const stamp = formatAbsoluteTime(date, { hasTimeZone });\n const isTipped = hasTooltip && label !== stamp;\n\n return (\n <>\n <time\n ref={(node) => {\n anchorRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n dateTime={date.toISOString()}\n suppressHydrationWarning\n className={cx(\"ds-time\", !isTipped && \"ds-time--plain\", className)}\n tabIndex={tabIndex ?? (isTipped ? 0 : undefined)}\n aria-describedby={\n [describedBy, isTipped && isOpen && tooltipId].filter(Boolean).join(\" \") || undefined\n }\n title={title ?? (isTipped ? undefined : stamp)}\n onMouseEnter={(event) => {\n onMouseEnter?.(event);\n if (isTipped && !event.defaultPrevented) {\n setIsOpen(true);\n }\n }}\n onMouseLeave={(event) => {\n onMouseLeave?.(event);\n if (isTipped && !event.defaultPrevented) {\n setIsOpen(false);\n }\n }}\n onFocus={(event) => {\n onFocus?.(event);\n if (isTipped && !event.defaultPrevented) {\n setIsOpen(true);\n }\n }}\n onBlur={(event) => {\n onBlur?.(event);\n if (isTipped && !event.defaultPrevented) {\n setIsOpen(false);\n }\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (isTipped && !event.defaultPrevented && event.key === \"Escape\") {\n setIsOpen(false);\n }\n }}\n {...rest}\n >\n {label}\n </time>\n {isTipped && (\n <Popover\n anchorRef={anchorRef}\n isOpen={isOpen}\n id={tooltipId}\n role=\"tooltip\"\n className=\"ds-surface-raised ds-time-tooltip\"\n >\n {stamp}\n </Popover>\n )}\n </>\n );\n});\n"],"mappings":"A,iKAIA,SAASS,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAEA,IAAMC,EAAS,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,KAAK,EAE5FC,EAAS,IACTC,EAAO,GAAKD,EACZE,EAAM,GAAKD,EACXE,EAAO,E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AAU1B,EAAK,YAAY,EAC3B,yBAAA,GACA,UAAWZ,EAAG,UAAW,CAACoC,GAAY,iBAAkBI,CAAS,EACjE,SAAUC,IAAaL,EAAW,EAAI,IAAA,IACtC,mBACE,CAACZ,EAAaY,GAAYT,GAAUE,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,GAAK,IAAA,GAE9E,MAAOa,IAAUN,EAAW,IAAA,GAAYrB,GACxC,aAAe,GAAU,CACvB4B,IAAeC,CAAK,EAChBR,GAAY,CAACQ,EAAM,kBACrBhB,EAAU,EAAI,CAElB,EACA,aAAe,GAAU,CACvBiB,IAAeD,CAAK,EAChBR,GAAY,CAACQ,EAAM,kBACrBhB,EAAU,EAAK,CAEnB,EACA,QAAU,GAAU,CAClBkB,IAAUF,CAAK,EACXR,GAAY,CAACQ,EAAM,kBACrBhB,EAAU,EAAI,CAElB,EACA,OAAS,GAAU,CACjBmB,IAASH,CAAK,EACVR,GAAY,CAACQ,EAAM,kBACrBhB,EAAU,EAAK,CAEnB,EACA,UAAY,GAAU,CACpBoB,IAAYJ,CAAK,EACbR,GAAY,CAACQ,EAAM,kBAAoBA,EAAM,MAAQ,UACvDhB,EAAU,EAAK,CAEnB,EACA,GAAIH,EAEH,SAAAU,CACG,CAAA,EACLC,IACC,EAAArC,EAAA,IAAA,CAACH,EAAAA,QAAD,CACa,YACH,SACR,GAAIiC,EACJ,KAAK,UACL,UAAU,oCAET,SAAAd,CACM,CAAA,CAEX,CAAA,CAAA,CAEN,CAAC,E"}
1
+ {"version":3,"file":"index.cjs","names":["forwardRef","useState","useTooltip","useMemo","mergeRefs","_Fragment","require_mergeRefs","require_useTooltip","react","react_jsx_runtime","cx","parts","MONTHS","MINUTE","HOUR","DAY","WEEK","pad","value","formatAbsoluteDate","options","stem","date","hasYear","formatAbsoluteTime","stamp","hasTimeZone","zone","part","formatRelativeTime","delta","now","days","Time","describedBy","rest","isValid","setTick","format","id","t","refreshInterval","label","isTipped","hasTooltip","timeRef","anchorRef","ref","className","tabIndex","description","title","triggerProps","panel"],"sources":["../../../src/components/Time/index.tsx"],"sourcesContent":["import { forwardRef, useEffect, useMemo, useState, type HTMLAttributes } from \"react\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { useTooltip } from \"../Popover/useTooltip\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\nconst MINUTE = 60_000;\nconst HOUR = 60 * MINUTE;\nconst DAY = 24 * HOUR;\nconst WEEK = 7 * DAY;\n\nfunction pad(value: number) {\n return String(value).padStart(2, \"0\");\n}\n\n/** Day before month, one order everywhere: `12 Jun 2026`. */\nexport function formatAbsoluteDate(date: Date, options: { hasYear?: boolean } = {}) {\n const { hasYear = true } = options;\n const stem = `${date.getDate()} ${MONTHS[date.getMonth()]}`;\n return hasYear ? `${stem} ${date.getFullYear()}` : stem;\n}\n\n/** The tooltip form: `6 Aug 2026, 11:05`, with the reader's zone appended. */\nexport function formatAbsoluteTime(date: Date, options: { hasTimeZone?: boolean } = {}) {\n const { hasTimeZone = true } = options;\n const stamp = `${formatAbsoluteDate(date)}, ${pad(date.getHours())}:${pad(date.getMinutes())}`;\n if (!hasTimeZone) {\n return stamp;\n }\n const zone = new Intl.DateTimeFormat(undefined, { timeZoneName: \"short\" })\n .formatToParts(date)\n .find((part) => part.type === \"timeZoneName\")?.value;\n return zone ? `${stamp} ${zone}` : stamp;\n}\n\n/**\n * Relative up to a week, absolute after. Future dates are always absolute — a\n * scheduled publish reads `12 Jun`, never `in 3 days`.\n */\nexport function formatRelativeTime(date: Date, now: Date = new Date()) {\n const delta = now.getTime() - date.getTime();\n if (delta < 0) {\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n }\n if (delta < MINUTE) {\n return \"Just now\";\n }\n if (delta < HOUR) {\n return `${Math.floor(delta / MINUTE)}m ago`;\n }\n if (delta < DAY) {\n return `${Math.floor(delta / HOUR)}h ago`;\n }\n if (delta < WEEK) {\n const days = Math.floor(delta / DAY);\n return `${days} ${days === 1 ? \"day\" : \"days\"} ago`;\n }\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n}\n\nexport type TimeFormat = \"auto\" | \"relative\" | \"absolute\";\n\nexport interface TimeProps extends Omit<HTMLAttributes<HTMLElement>, \"children\"> {\n /** The instant to print — Date, epoch ms, or an ISO string. */\n value: Date | string | number;\n /** `auto` ages the value; `absolute` always prints the date. */\n format?: TimeFormat;\n /** Show the absolute stamp on hover and focus. */\n hasTooltip?: boolean;\n /** Append the reader's time zone to the tooltip. */\n hasTimeZone?: boolean;\n /** Pin \"now\" — useful for tests and stories. */\n now?: Date;\n /** Re-render interval in ms while the value is still relative. */\n refreshInterval?: number;\n}\n\n/**\n * A machine-readable `<time>` that ages itself. One form per cell: relative or\n * absolute, never both side by side.\n */\nexport const Time = forwardRef<HTMLTimeElement, TimeProps>(function Time(\n {\n value,\n format = \"auto\",\n hasTooltip = true,\n hasTimeZone = true,\n now,\n refreshInterval = 30_000,\n className,\n tabIndex,\n title,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n \"aria-describedby\": describedBy,\n ...rest\n },\n ref,\n) {\n const date = value instanceof Date ? value : new Date(value);\n const isValid = !Number.isNaN(date.getTime());\n const [, setTick] = useState(0);\n\n useEffect(() => {\n if (format === \"absolute\" || now) {\n return;\n }\n const id = window.setInterval(() => setTick((t) => t + 1), refreshInterval);\n return () => window.clearInterval(id);\n }, [format, now, refreshInterval]);\n\n const reference = now ?? new Date();\n const label = !isValid\n ? \"\"\n : format === \"absolute\"\n ? formatAbsoluteDate(date)\n : formatRelativeTime(date, reference);\n const stamp = isValid ? formatAbsoluteTime(date, { hasTimeZone }) : \"\";\n const isTipped = isValid && hasTooltip && label !== stamp;\n const { anchorRef, description, triggerProps, panel } = useTooltip<HTMLTimeElement>(\n isTipped && stamp,\n { className: \"ds-time-tooltip\" },\n );\n const timeRef = useMemo(() => mergeRefs(anchorRef, ref), [anchorRef, ref]);\n\n if (!isValid) {\n return null;\n }\n\n return (\n <>\n <time\n ref={timeRef}\n dateTime={date.toISOString()}\n suppressHydrationWarning\n className={cx(\"ds-time\", !isTipped && \"ds-time--plain\", className)}\n tabIndex={tabIndex ?? (isTipped ? 0 : undefined)}\n aria-describedby={[describedBy, description].filter(Boolean).join(\" \") || undefined}\n title={title ?? (isTipped ? undefined : stamp)}\n {...triggerProps({ onMouseEnter, onMouseLeave, onFocus, onBlur })}\n {...rest}\n >\n {label}\n </time>\n {panel}\n </>\n );\n});\n"],"mappings":"A,kOAKA,SAASU,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAEA,IAAMC,EAAS,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,KAAK,EAE5FC,EAAS,IACTC,EAAO,GAAKD,EACZE,EAAM,GAAKD,EACXE,EAAO,EAAID,EAEjB,SAASE,EAAI,EAAe,CAC1B,OAAO,OAAOC,CAAK,CAAC,CAAC,SAAS,EAAG,GAAG,CACtC,CAGA,SAAgBC,EAAmB,EAAY,EAAiC,CAAC,EAAG,CAClF,GAAM,CAAE,UAAU,IAASC,EACrBC,EAAO,GAAGC,EAAK,QAAQ,EAAE,GAAGV,EAAOU,EAAK,SAAS,KACvD,OAAOC,EAAU,GAAGF,EAAK,GAAGC,EAAK,YAAY,IAAMD,CACrD,CAGA,SAAgBG,EAAmB,EAAY,EAAqC,CAAC,EAAG,CACtF,GAAM,CAAE,cAAc,IAASJ,EACzBK,EAAQ,GAAGN,EAAmBG,CAAI,EAAE,IAAIL,EAAIK,EAAK,SAAS,CAAC,EAAE,GAAGL,EAAIK,E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