@activecollab/components 2.0.469 → 2.0.471

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 (116) hide show
  1. package/dist/cjs/components/DatePicker/DatePicker.js +4 -2
  2. package/dist/cjs/components/DatePicker/DatePicker.js.map +1 -1
  3. package/dist/cjs/components/GlobalStyle.js +1 -1
  4. package/dist/cjs/components/GlobalStyle.js.map +1 -1
  5. package/dist/cjs/components/Menu/Menu.js +66 -13
  6. package/dist/cjs/components/Menu/Menu.js.map +1 -1
  7. package/dist/cjs/components/PillButton/PillButton.js +75 -0
  8. package/dist/cjs/components/PillButton/PillButton.js.map +1 -0
  9. package/dist/cjs/components/PillButton/Styles.js +59 -0
  10. package/dist/cjs/components/PillButton/Styles.js.map +1 -0
  11. package/dist/cjs/components/PillButton/index.js +17 -0
  12. package/dist/cjs/components/PillButton/index.js.map +1 -0
  13. package/dist/cjs/components/PillGroup/PillGroup.js +42 -0
  14. package/dist/cjs/components/PillGroup/PillGroup.js.map +1 -0
  15. package/dist/cjs/components/PillGroup/Styles.js +21 -0
  16. package/dist/cjs/components/PillGroup/Styles.js.map +1 -0
  17. package/dist/cjs/components/PillGroup/index.js +17 -0
  18. package/dist/cjs/components/PillGroup/index.js.map +1 -0
  19. package/dist/cjs/components/Select/Select.js +5 -3
  20. package/dist/cjs/components/Select/Select.js.map +1 -1
  21. package/dist/cjs/components/SelectDate/SelectDate.js +4 -2
  22. package/dist/cjs/components/SelectDate/SelectDate.js.map +1 -1
  23. package/dist/cjs/components/StackedCard/StackedCard.js.map +1 -1
  24. package/dist/cjs/components/StackedCard/Styles.js.map +1 -1
  25. package/dist/cjs/components/StackedCard/resizePolicy.js +141 -60
  26. package/dist/cjs/components/StackedCard/resizePolicy.js.map +1 -1
  27. package/dist/cjs/components/StackedCard/resizePolicy.test.js +362 -15
  28. package/dist/cjs/components/StackedCard/resizePolicy.test.js.map +1 -1
  29. package/dist/cjs/components/StackedCard/useStackedCardResize.js +35 -14
  30. package/dist/cjs/components/StackedCard/useStackedCardResize.js.map +1 -1
  31. package/dist/cjs/components/Tooltip/Tooltip.js +37 -8
  32. package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
  33. package/dist/cjs/components/Window/Window.js +4 -2
  34. package/dist/cjs/components/Window/Window.js.map +1 -1
  35. package/dist/cjs/components/index.js +22 -0
  36. package/dist/cjs/components/index.js.map +1 -1
  37. package/dist/cjs/helpers/Portal/Portal.js +5 -1
  38. package/dist/cjs/helpers/Portal/Portal.js.map +1 -1
  39. package/dist/esm/components/DatePicker/DatePicker.d.ts +2 -0
  40. package/dist/esm/components/DatePicker/DatePicker.d.ts.map +1 -1
  41. package/dist/esm/components/DatePicker/DatePicker.js +4 -2
  42. package/dist/esm/components/DatePicker/DatePicker.js.map +1 -1
  43. package/dist/esm/components/GlobalStyle.d.ts.map +1 -1
  44. package/dist/esm/components/GlobalStyle.js +1 -1
  45. package/dist/esm/components/GlobalStyle.js.map +1 -1
  46. package/dist/esm/components/Menu/Menu.d.ts +2 -0
  47. package/dist/esm/components/Menu/Menu.d.ts.map +1 -1
  48. package/dist/esm/components/Menu/Menu.js +64 -13
  49. package/dist/esm/components/Menu/Menu.js.map +1 -1
  50. package/dist/esm/components/PillButton/PillButton.d.ts +33 -0
  51. package/dist/esm/components/PillButton/PillButton.d.ts.map +1 -0
  52. package/dist/esm/components/PillButton/PillButton.js +66 -0
  53. package/dist/esm/components/PillButton/PillButton.js.map +1 -0
  54. package/dist/esm/components/PillButton/Styles.d.ts +15 -0
  55. package/dist/esm/components/PillButton/Styles.d.ts.map +1 -0
  56. package/dist/esm/components/PillButton/Styles.js +34 -0
  57. package/dist/esm/components/PillButton/Styles.js.map +1 -0
  58. package/dist/esm/components/PillButton/index.d.ts +2 -0
  59. package/dist/esm/components/PillButton/index.d.ts.map +1 -0
  60. package/dist/esm/components/PillButton/index.js +2 -0
  61. package/dist/esm/components/PillButton/index.js.map +1 -0
  62. package/dist/esm/components/PillGroup/PillGroup.d.ts +19 -0
  63. package/dist/esm/components/PillGroup/PillGroup.d.ts.map +1 -0
  64. package/dist/esm/components/PillGroup/PillGroup.js +33 -0
  65. package/dist/esm/components/PillGroup/PillGroup.js.map +1 -0
  66. package/dist/esm/components/PillGroup/Styles.d.ts +5 -0
  67. package/dist/esm/components/PillGroup/Styles.d.ts.map +1 -0
  68. package/dist/esm/components/PillGroup/Styles.js +10 -0
  69. package/dist/esm/components/PillGroup/Styles.js.map +1 -0
  70. package/dist/esm/components/PillGroup/index.d.ts +2 -0
  71. package/dist/esm/components/PillGroup/index.d.ts.map +1 -0
  72. package/dist/esm/components/PillGroup/index.js +2 -0
  73. package/dist/esm/components/PillGroup/index.js.map +1 -0
  74. package/dist/esm/components/Select/Select.d.ts +2 -0
  75. package/dist/esm/components/Select/Select.d.ts.map +1 -1
  76. package/dist/esm/components/Select/Select.js +5 -3
  77. package/dist/esm/components/Select/Select.js.map +1 -1
  78. package/dist/esm/components/SelectDate/SelectDate.d.ts +2 -0
  79. package/dist/esm/components/SelectDate/SelectDate.d.ts.map +1 -1
  80. package/dist/esm/components/SelectDate/SelectDate.js +4 -2
  81. package/dist/esm/components/SelectDate/SelectDate.js.map +1 -1
  82. package/dist/esm/components/StackedCard/StackedCard.d.ts +5 -5
  83. package/dist/esm/components/StackedCard/StackedCard.d.ts.map +1 -1
  84. package/dist/esm/components/StackedCard/StackedCard.js.map +1 -1
  85. package/dist/esm/components/StackedCard/Styles.d.ts +2 -2
  86. package/dist/esm/components/StackedCard/Styles.d.ts.map +1 -1
  87. package/dist/esm/components/StackedCard/Styles.js.map +1 -1
  88. package/dist/esm/components/StackedCard/resizePolicy.d.ts +85 -40
  89. package/dist/esm/components/StackedCard/resizePolicy.d.ts.map +1 -1
  90. package/dist/esm/components/StackedCard/resizePolicy.js +139 -60
  91. package/dist/esm/components/StackedCard/resizePolicy.js.map +1 -1
  92. package/dist/esm/components/StackedCard/resizePolicy.test.js +359 -16
  93. package/dist/esm/components/StackedCard/resizePolicy.test.js.map +1 -1
  94. package/dist/esm/components/StackedCard/useStackedCardResize.d.ts +25 -13
  95. package/dist/esm/components/StackedCard/useStackedCardResize.d.ts.map +1 -1
  96. package/dist/esm/components/StackedCard/useStackedCardResize.js +35 -14
  97. package/dist/esm/components/StackedCard/useStackedCardResize.js.map +1 -1
  98. package/dist/esm/components/Tooltip/Tooltip.d.ts.map +1 -1
  99. package/dist/esm/components/Tooltip/Tooltip.js +36 -9
  100. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  101. package/dist/esm/components/Window/Window.d.ts +2 -0
  102. package/dist/esm/components/Window/Window.d.ts.map +1 -1
  103. package/dist/esm/components/Window/Window.js +4 -2
  104. package/dist/esm/components/Window/Window.js.map +1 -1
  105. package/dist/esm/components/index.d.ts +2 -0
  106. package/dist/esm/components/index.d.ts.map +1 -1
  107. package/dist/esm/components/index.js +2 -0
  108. package/dist/esm/components/index.js.map +1 -1
  109. package/dist/esm/helpers/Portal/Portal.d.ts.map +1 -1
  110. package/dist/esm/helpers/Portal/Portal.js +5 -1
  111. package/dist/esm/helpers/Portal/Portal.js.map +1 -1
  112. package/dist/index.js +1274 -923
  113. package/dist/index.js.map +1 -1
  114. package/dist/index.min.js +1 -1
  115. package/dist/index.min.js.map +1 -1
  116. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_constants","_BoxSizingStyle","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SELECTION_RING","SCRIM","SCRIM_STRONG","SCRIM_FG","CONTROL","concat","STACKED_CARD_CONTROL_CLASS","revealControls","css","StyledStackedCardStack","exports","styled","div","withConfig","displayName","componentId","BoxSizingStyle","StyledStackedCardRow","_ref","$direction","_ref2","_ref3","_ref4","$role","$bleed","STACKED_CARD_ROLE_PADDING","_ref5","$background","_ref6","STACKED_CARD_FIXED_ATTR","StyledStackedCardCoverMedia","_ref7","$aspectRatio","StyledStackedCardCoverFill","StyledStackedCardCoverCenter","StyledStackedCardCoverTopRight","StyledStackedCardCollapsedStrip","button","StyledStackedCardStripExpand","span","StyledStackedCardPlayBadge","StyledStackedCardCoverButton","StyledStackedCardResizeHandle","_ref8","$axis","hoverStyle","StyledStackedCard","STACKED_CARD_WIDTH","STACKED_CARD_RADIUS","_ref9","$forceHover","_ref0","$priorityColor","_ref1","$selected","_ref10","$disabled","_ref11","$pending","_ref12","$isDragSource","_ref13","$isDragPreview","_ref14","$entered"],"sources":["../../../../src/components/StackedCard/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport {\n STACKED_CARD_CONTROL_CLASS,\n STACKED_CARD_FIXED_ATTR,\n STACKED_CARD_RADIUS,\n STACKED_CARD_ROLE_PADDING,\n STACKED_CARD_WIDTH,\n StackedCardRowDirection,\n StackedCardRowRole,\n} from \"./constants\";\nimport { StackedCardResizeAxis } from \"./resizePolicy\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\n\n/**\n * Theming hooks.\n *\n * Every colour a StackedCard part needs is read through a `--sc-*` custom\n * property with a built-in fallback, so the component looks right standing on\n * its own and a host surface can still retint it by declaring the variable on\n * any ancestor. No rgba/hex is baked into a rule; data colours (a swatch value,\n * a priority colour) are always passed in by the caller.\n */\nconst SELECTION_RING = \"var(--sc-selection-ring, var(--color-primary-500))\";\nconst SCRIM = \"var(--sc-scrim, rgba(0, 0, 0, 0.55))\";\nconst SCRIM_STRONG = \"var(--sc-scrim-strong, rgba(0, 0, 0, 0.72))\";\nconst SCRIM_FG = \"var(--sc-scrim-fg, #ffffff)\";\n\n/** Selector for anything carrying the control class. */\nconst CONTROL = `.${STACKED_CARD_CONTROL_CLASS}`;\n\n/**\n * The one reveal rule the whole subsystem shares: controls are hidden until the\n * card (or the cover) is hovered OR holds focus. The focus path is what keeps\n * them reachable by keyboard instead of mouse-only.\n */\nconst revealControls = css`\n ${CONTROL} {\n opacity: 0;\n transition: opacity 120ms ease;\n }\n\n &:hover ${CONTROL}, &:focus-within ${CONTROL} {\n opacity: 1;\n }\n`;\n\n/* ------------------------------------------------------------------ */\n/* Stack — the vertical column. A card is a Stack of rows. */\n/* ------------------------------------------------------------------ */\n\nexport const StyledStackedCardStack = styled.div`\n ${BoxSizingStyle}\n\n position: relative;\n display: flex;\n flex-direction: column;\n`;\nStyledStackedCardStack.displayName = \"StyledStackedCardStack\";\n\n/* ------------------------------------------------------------------ */\n/* Row — the only layout primitive, differentiated by `role`. */\n/* ------------------------------------------------------------------ */\n\ninterface IStyledRowProps {\n $role: StackedCardRowRole;\n $bleed?: boolean;\n $direction: StackedCardRowDirection;\n $background?: string;\n}\n\nexport const StyledStackedCardRow = styled.div<IStyledRowProps>`\n ${BoxSizingStyle}\n\n position: relative;\n display: flex;\n flex-direction: ${({ $direction }) => $direction};\n align-items: ${({ $direction }) =>\n $direction === \"column\" ? \"stretch\" : \"center\"};\n gap: ${({ $direction }) => ($direction === \"column\" ? \"4px\" : \"8px\")};\n\n /* bleed overrides any role and runs the row edge to edge. */\n padding: ${({ $role, $bleed }) =>\n $bleed ? \"0\" : STACKED_CARD_ROLE_PADDING[$role]};\n\n ${({ $background }) =>\n $background &&\n css`\n background: ${$background};\n `}\n\n /* Distribution (row direction only): fixed-width children keep their width,\n the rest share what remains evenly; drop an empty spacer to push items. */\n ${({ $direction }) =>\n $direction === \"row\" &&\n css`\n > * {\n flex: 1 1 0;\n min-width: 0;\n }\n\n > [${STACKED_CARD_FIXED_ATTR}] {\n flex: 0 0 auto;\n }\n `}\n`;\nStyledStackedCardRow.displayName = \"StyledStackedCardRow\";\n\n/* ------------------------------------------------------------------ */\n/* Cover — a bleed row that holds media. */\n/* ------------------------------------------------------------------ */\n\n/**\n * The media box reserves its height with `aspect-ratio` so the image (or the\n * skeleton standing in for it) never reflows the card when it arrives.\n */\nexport const StyledStackedCardCoverMedia = styled.div<{ $aspectRatio: string }>`\n position: relative;\n width: 100%;\n aspect-ratio: ${({ $aspectRatio }) => $aspectRatio};\n overflow: hidden;\n\n ${revealControls}\n`;\nStyledStackedCardCoverMedia.displayName = \"StyledStackedCardCoverMedia\";\n\n/* The fill (an <img>, an inline <svg> wrapper, or a solid-colour box) is laid\n over the reserved box and made to cover it. */\nexport const StyledStackedCardCoverFill = styled.div`\n position: absolute;\n inset: 0;\n\n > * {\n width: 100%;\n height: 100%;\n }\n\n > img {\n display: block;\n object-fit: cover;\n }\n\n /* Media must never be natively draggable. An <img> is a browser drag source\n by default, so grabbing the cover would start an image drag and swallow the\n mousemove/mouseup the HOST's drag depends on — the card would stay put and\n then jump on the next pointer move. The host owns dragging; the cover must\n not compete with it. */\n > img,\n > svg {\n -webkit-user-drag: none;\n user-select: none;\n pointer-events: none;\n }\n`;\nStyledStackedCardCoverFill.displayName = \"StyledStackedCardCoverFill\";\n\nexport const StyledStackedCardCoverCenter = styled.div`\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\nStyledStackedCardCoverCenter.displayName = \"StyledStackedCardCoverCenter\";\n\nexport const StyledStackedCardCoverTopRight = styled.div`\n position: absolute;\n top: 8px;\n right: 8px;\n display: flex;\n gap: 6px;\n`;\nStyledStackedCardCoverTopRight.displayName = \"StyledStackedCardCoverTopRight\";\n\n/**\n * Collapsed cover — the media box gives way to a thin strip. The strip IS the\n * expand affordance: the whole bar is a button and a chevron hint is revealed\n * on hover or focus. It reserves no height of its own; the caller's\n * `collapsedStrip` (an ~8px colour bar, a favicon + domain row) sets how tall\n * it reads.\n */\nexport const StyledStackedCardCollapsedStrip = styled.button`\n ${BoxSizingStyle}\n\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 16px;\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n text-align: left;\n\n ${CONTROL} {\n opacity: 0;\n transition: opacity 120ms ease;\n }\n\n &:hover ${CONTROL}, &:focus-visible ${CONTROL} {\n opacity: 1;\n }\n\n &:focus-visible {\n outline: 2px solid ${SELECTION_RING};\n outline-offset: -2px;\n }\n`;\nStyledStackedCardCollapsedStrip.displayName = \"StyledStackedCardCollapsedStrip\";\n\n/* The expand chevron sits at the right, vertically centred, so it reads the\n same whether the strip is a hairline colour bar or a taller favicon row. */\nexport const StyledStackedCardStripExpand = styled.span`\n position: absolute;\n top: 50%;\n right: 8px;\n transform: translateY(-50%);\n display: inline-flex;\n width: 16px;\n height: 16px;\n color: var(--color-theme-600);\n\n svg {\n width: 14px;\n height: 14px;\n }\n`;\nStyledStackedCardStripExpand.displayName = \"StyledStackedCardStripExpand\";\n\n/* ------------------------------------------------------------------ */\n/* Cover chrome — scrim-backed controls that sit over media */\n/* ------------------------------------------------------------------ */\n\n/** Centered media control (a play button). The caller drops the glyph inside. */\nexport const StyledStackedCardPlayBadge = styled.span`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border-radius: 12px;\n background: ${SCRIM};\n color: ${SCRIM_FG};\n\n svg {\n fill: currentColor;\n width: 20px;\n height: 20px;\n margin-left: 2px;\n }\n`;\nStyledStackedCardPlayBadge.displayName = \"StyledStackedCardPlayBadge\";\n\n/** Top-right cover-management button (collapse, remove …). */\nexport const StyledStackedCardCoverButton = styled.button`\n ${BoxSizingStyle}\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 30px;\n height: 30px;\n padding: 0;\n border: 0;\n border-radius: 8px;\n cursor: pointer;\n color: ${SCRIM_FG};\n background: ${SCRIM};\n\n svg {\n width: 16px;\n height: 16px;\n display: block;\n }\n\n &:hover {\n background: ${SCRIM_STRONG};\n }\n`;\nStyledStackedCardCoverButton.displayName = \"StyledStackedCardCoverButton\";\n\n/* ------------------------------------------------------------------ */\n/* Resize (opt-in): handle on hover, the card only reports deltas */\n/* ------------------------------------------------------------------ */\n\n/* The grip is a focusable separator, so it needs a focus ring of its own — a\n keyboard user has no pointer to tell them where they are. */\nexport const StyledStackedCardResizeHandle = styled.span<{\n $axis: StackedCardResizeAxis;\n}>`\n position: absolute;\n right: 2px;\n bottom: 2px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n border-radius: 4px;\n cursor: ${({ $axis }) => ($axis === \"width\" ? \"ew-resize\" : \"nwse-resize\")};\n color: var(--color-theme-600);\n z-index: 2;\n\n &:hover {\n color: var(--color-theme-900);\n }\n\n &:focus-visible {\n outline: 2px solid ${SELECTION_RING};\n outline-offset: 1px;\n color: var(--color-theme-900);\n }\n\n svg {\n display: block;\n }\n`;\nStyledStackedCardResizeHandle.displayName = \"StyledStackedCardResizeHandle\";\n\n/* ------------------------------------------------------------------ */\n/* The shell */\n/* ------------------------------------------------------------------ */\n\nexport interface IStyledStackedCardProps {\n $selected?: boolean;\n $disabled?: boolean;\n $pending?: boolean;\n $isDragSource?: boolean;\n $isDragPreview?: boolean;\n $entered?: boolean;\n $forceHover?: boolean;\n $priorityColor?: string;\n}\n\nconst hoverStyle = css`\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);\n border-color: var(--color-theme-500);\n`;\n\nexport const StyledStackedCard = styled.div<IStyledStackedCardProps>`\n ${BoxSizingStyle}\n\n position: relative;\n display: flex;\n flex-direction: column;\n width: ${STACKED_CARD_WIDTH}px;\n border-radius: ${STACKED_CARD_RADIUS}px;\n background-color: var(--page-paper-main);\n border: 1px solid var(--border-primary);\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n overflow: hidden;\n transition: box-shadow 150ms ease, border-color 150ms ease;\n\n ${revealControls}\n\n &:hover {\n ${hoverStyle}\n }\n\n &:focus-visible {\n outline: none;\n ${hoverStyle}\n box-shadow: 0 0 0 2px ${SELECTION_RING};\n }\n\n /* Forced hover — for docs, snapshots and \"this is what hover looks like\"\n demos. The doubled ampersand gives it the specificity to beat the cover's\n own reveal rule. */\n ${({ $forceHover }) =>\n $forceHover &&\n css`\n ${hoverStyle}\n && ${CONTROL} {\n opacity: 1;\n }\n `}\n\n ${({ $priorityColor }) =>\n $priorityColor &&\n css`\n &::before {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 4px;\n background: ${$priorityColor};\n z-index: 2;\n }\n `}\n\n /* Selection outranks hover: a selected card must keep its ring while the\n pointer is over it — which, right after the click that selected it, is\n always. The doubled ampersand buys the specificity to beat the hover rule\n above (same reason the entered state below does it). */\n ${({ $selected }) =>\n $selected &&\n css`\n && {\n border-color: ${SELECTION_RING};\n box-shadow: 0 0 0 2px ${SELECTION_RING};\n }\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n opacity: 0.5;\n pointer-events: none;\n `}\n\n /* Pending / optimistic — created or moved, not yet confirmed by the server.\n Dimmed, non-interactive and NOT draggable, but distinct from disabled: a\n transient in-flight state, not a policy. */\n ${({ $pending }) =>\n $pending &&\n css`\n opacity: 0.6;\n pointer-events: none;\n cursor: progress;\n `}\n\n /* Drag SOURCE — full-size outline placeholder. Content is hidden but keeps\n its box (visibility, not display) so the card holds identical dimensions\n and the surrounding cards never move. */\n ${({ $isDragSource }) =>\n $isDragSource &&\n css`\n background: transparent;\n border: 1px dashed var(--color-theme-500);\n box-shadow: none;\n\n &:hover {\n box-shadow: none;\n border-color: var(--color-theme-500);\n }\n\n > * {\n visibility: hidden;\n }\n `}\n\n /* Drag PREVIEW — the 1:1 copy the host floats in its drag layer. Elevated\n shadow ONLY: no rotate, no scale, no translate. */\n ${({ $isDragPreview }) =>\n $isDragPreview &&\n css`\n box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);\n cursor: grabbing;\n `}\n\n /* Entered (focus model) — focus has moved inside, onto an inner control. */\n ${({ $entered }) =>\n $entered &&\n css`\n && {\n border-color: ${SELECTION_RING};\n box-shadow: inset 0 0 0 2px ${SELECTION_RING},\n 0 0 0 2px ${SELECTION_RING};\n }\n `}\n`;\nStyledStackedCard.displayName = \"StyledStackedCard\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,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ponents","_interopRequireWildcard","require","_constants","_BoxSizingStyle","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SELECTION_RING","SCRIM","SCRIM_STRONG","SCRIM_FG","CONTROL","concat","STACKED_CARD_CONTROL_CLASS","revealControls","css","StyledStackedCardStack","exports","styled","div","withConfig","displayName","componentId","BoxSizingStyle","StyledStackedCardRow","_ref","$direction","_ref2","_ref3","_ref4","$role","$bleed","STACKED_CARD_ROLE_PADDING","_ref5","$background","_ref6","STACKED_CARD_FIXED_ATTR","StyledStackedCardCoverMedia","_ref7","$aspectRatio","StyledStackedCardCoverFill","StyledStackedCardCoverCenter","StyledStackedCardCoverTopRight","StyledStackedCardCollapsedStrip","button","StyledStackedCardStripExpand","span","StyledStackedCardPlayBadge","StyledStackedCardCoverButton","StyledStackedCardResizeHandle","_ref8","$axis","hoverStyle","StyledStackedCard","STACKED_CARD_WIDTH","STACKED_CARD_RADIUS","_ref9","$forceHover","_ref0","$priorityColor","_ref1","$selected","_ref10","$disabled","_ref11","$pending","_ref12","$isDragSource","_ref13","$isDragPreview","_ref14","$entered"],"sources":["../../../../src/components/StackedCard/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport {\n STACKED_CARD_CONTROL_CLASS,\n STACKED_CARD_FIXED_ATTR,\n STACKED_CARD_RADIUS,\n STACKED_CARD_ROLE_PADDING,\n STACKED_CARD_WIDTH,\n StackedCardRowDirection,\n StackedCardRowRole,\n} from \"./constants\";\nimport { ResizeAxis } from \"./resizePolicy\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\n\n/**\n * Theming hooks.\n *\n * Every colour a StackedCard part needs is read through a `--sc-*` custom\n * property with a built-in fallback, so the component looks right standing on\n * its own and a host surface can still retint it by declaring the variable on\n * any ancestor. No rgba/hex is baked into a rule; data colours (a swatch value,\n * a priority colour) are always passed in by the caller.\n */\nconst SELECTION_RING = \"var(--sc-selection-ring, var(--color-primary-500))\";\nconst SCRIM = \"var(--sc-scrim, rgba(0, 0, 0, 0.55))\";\nconst SCRIM_STRONG = \"var(--sc-scrim-strong, rgba(0, 0, 0, 0.72))\";\nconst SCRIM_FG = \"var(--sc-scrim-fg, #ffffff)\";\n\n/** Selector for anything carrying the control class. */\nconst CONTROL = `.${STACKED_CARD_CONTROL_CLASS}`;\n\n/**\n * The one reveal rule the whole subsystem shares: controls are hidden until the\n * card (or the cover) is hovered OR holds focus. The focus path is what keeps\n * them reachable by keyboard instead of mouse-only.\n */\nconst revealControls = css`\n ${CONTROL} {\n opacity: 0;\n transition: opacity 120ms ease;\n }\n\n &:hover ${CONTROL}, &:focus-within ${CONTROL} {\n opacity: 1;\n }\n`;\n\n/* ------------------------------------------------------------------ */\n/* Stack — the vertical column. A card is a Stack of rows. */\n/* ------------------------------------------------------------------ */\n\nexport const StyledStackedCardStack = styled.div`\n ${BoxSizingStyle}\n\n position: relative;\n display: flex;\n flex-direction: column;\n`;\nStyledStackedCardStack.displayName = \"StyledStackedCardStack\";\n\n/* ------------------------------------------------------------------ */\n/* Row — the only layout primitive, differentiated by `role`. */\n/* ------------------------------------------------------------------ */\n\ninterface IStyledRowProps {\n $role: StackedCardRowRole;\n $bleed?: boolean;\n $direction: StackedCardRowDirection;\n $background?: string;\n}\n\nexport const StyledStackedCardRow = styled.div<IStyledRowProps>`\n ${BoxSizingStyle}\n\n position: relative;\n display: flex;\n flex-direction: ${({ $direction }) => $direction};\n align-items: ${({ $direction }) =>\n $direction === \"column\" ? \"stretch\" : \"center\"};\n gap: ${({ $direction }) => ($direction === \"column\" ? \"4px\" : \"8px\")};\n\n /* bleed overrides any role and runs the row edge to edge. */\n padding: ${({ $role, $bleed }) =>\n $bleed ? \"0\" : STACKED_CARD_ROLE_PADDING[$role]};\n\n ${({ $background }) =>\n $background &&\n css`\n background: ${$background};\n `}\n\n /* Distribution (row direction only): fixed-width children keep their width,\n the rest share what remains evenly; drop an empty spacer to push items. */\n ${({ $direction }) =>\n $direction === \"row\" &&\n css`\n > * {\n flex: 1 1 0;\n min-width: 0;\n }\n\n > [${STACKED_CARD_FIXED_ATTR}] {\n flex: 0 0 auto;\n }\n `}\n`;\nStyledStackedCardRow.displayName = \"StyledStackedCardRow\";\n\n/* ------------------------------------------------------------------ */\n/* Cover — a bleed row that holds media. */\n/* ------------------------------------------------------------------ */\n\n/**\n * The media box reserves its height with `aspect-ratio` so the image (or the\n * skeleton standing in for it) never reflows the card when it arrives.\n */\nexport const StyledStackedCardCoverMedia = styled.div<{ $aspectRatio: string }>`\n position: relative;\n width: 100%;\n aspect-ratio: ${({ $aspectRatio }) => $aspectRatio};\n overflow: hidden;\n\n ${revealControls}\n`;\nStyledStackedCardCoverMedia.displayName = \"StyledStackedCardCoverMedia\";\n\n/* The fill (an <img>, an inline <svg> wrapper, or a solid-colour box) is laid\n over the reserved box and made to cover it. */\nexport const StyledStackedCardCoverFill = styled.div`\n position: absolute;\n inset: 0;\n\n > * {\n width: 100%;\n height: 100%;\n }\n\n > img {\n display: block;\n object-fit: cover;\n }\n\n /* Media must never be natively draggable. An <img> is a browser drag source\n by default, so grabbing the cover would start an image drag and swallow the\n mousemove/mouseup the HOST's drag depends on — the card would stay put and\n then jump on the next pointer move. The host owns dragging; the cover must\n not compete with it. */\n > img,\n > svg {\n -webkit-user-drag: none;\n user-select: none;\n pointer-events: none;\n }\n`;\nStyledStackedCardCoverFill.displayName = \"StyledStackedCardCoverFill\";\n\nexport const StyledStackedCardCoverCenter = styled.div`\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\nStyledStackedCardCoverCenter.displayName = \"StyledStackedCardCoverCenter\";\n\nexport const StyledStackedCardCoverTopRight = styled.div`\n position: absolute;\n top: 8px;\n right: 8px;\n display: flex;\n gap: 6px;\n`;\nStyledStackedCardCoverTopRight.displayName = \"StyledStackedCardCoverTopRight\";\n\n/**\n * Collapsed cover — the media box gives way to a thin strip. The strip IS the\n * expand affordance: the whole bar is a button and a chevron hint is revealed\n * on hover or focus. It reserves no height of its own; the caller's\n * `collapsedStrip` (an ~8px colour bar, a favicon + domain row) sets how tall\n * it reads.\n */\nexport const StyledStackedCardCollapsedStrip = styled.button`\n ${BoxSizingStyle}\n\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 16px;\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n text-align: left;\n\n ${CONTROL} {\n opacity: 0;\n transition: opacity 120ms ease;\n }\n\n &:hover ${CONTROL}, &:focus-visible ${CONTROL} {\n opacity: 1;\n }\n\n &:focus-visible {\n outline: 2px solid ${SELECTION_RING};\n outline-offset: -2px;\n }\n`;\nStyledStackedCardCollapsedStrip.displayName = \"StyledStackedCardCollapsedStrip\";\n\n/* The expand chevron sits at the right, vertically centred, so it reads the\n same whether the strip is a hairline colour bar or a taller favicon row. */\nexport const StyledStackedCardStripExpand = styled.span`\n position: absolute;\n top: 50%;\n right: 8px;\n transform: translateY(-50%);\n display: inline-flex;\n width: 16px;\n height: 16px;\n color: var(--color-theme-600);\n\n svg {\n width: 14px;\n height: 14px;\n }\n`;\nStyledStackedCardStripExpand.displayName = \"StyledStackedCardStripExpand\";\n\n/* ------------------------------------------------------------------ */\n/* Cover chrome — scrim-backed controls that sit over media */\n/* ------------------------------------------------------------------ */\n\n/** Centered media control (a play button). The caller drops the glyph inside. */\nexport const StyledStackedCardPlayBadge = styled.span`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border-radius: 12px;\n background: ${SCRIM};\n color: ${SCRIM_FG};\n\n svg {\n fill: currentColor;\n width: 20px;\n height: 20px;\n margin-left: 2px;\n }\n`;\nStyledStackedCardPlayBadge.displayName = \"StyledStackedCardPlayBadge\";\n\n/** Top-right cover-management button (collapse, remove …). */\nexport const StyledStackedCardCoverButton = styled.button`\n ${BoxSizingStyle}\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 30px;\n height: 30px;\n padding: 0;\n border: 0;\n border-radius: 8px;\n cursor: pointer;\n color: ${SCRIM_FG};\n background: ${SCRIM};\n\n svg {\n width: 16px;\n height: 16px;\n display: block;\n }\n\n &:hover {\n background: ${SCRIM_STRONG};\n }\n`;\nStyledStackedCardCoverButton.displayName = \"StyledStackedCardCoverButton\";\n\n/* ------------------------------------------------------------------ */\n/* Resize (opt-in): handle on hover, the card only reports deltas */\n/* ------------------------------------------------------------------ */\n\n/* The grip is a focusable separator, so it needs a focus ring of its own — a\n keyboard user has no pointer to tell them where they are. */\nexport const StyledStackedCardResizeHandle = styled.span<{\n $axis: ResizeAxis;\n}>`\n position: absolute;\n right: 2px;\n bottom: 2px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n border-radius: 4px;\n cursor: ${({ $axis }) => ($axis === \"width\" ? \"ew-resize\" : \"nwse-resize\")};\n color: var(--color-theme-600);\n z-index: 2;\n\n &:hover {\n color: var(--color-theme-900);\n }\n\n &:focus-visible {\n outline: 2px solid ${SELECTION_RING};\n outline-offset: 1px;\n color: var(--color-theme-900);\n }\n\n svg {\n display: block;\n }\n`;\nStyledStackedCardResizeHandle.displayName = \"StyledStackedCardResizeHandle\";\n\n/* ------------------------------------------------------------------ */\n/* The shell */\n/* ------------------------------------------------------------------ */\n\nexport interface IStyledStackedCardProps {\n $selected?: boolean;\n $disabled?: boolean;\n $pending?: boolean;\n $isDragSource?: boolean;\n $isDragPreview?: boolean;\n $entered?: boolean;\n $forceHover?: boolean;\n $priorityColor?: string;\n}\n\nconst hoverStyle = css`\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);\n border-color: var(--color-theme-500);\n`;\n\nexport const StyledStackedCard = styled.div<IStyledStackedCardProps>`\n ${BoxSizingStyle}\n\n position: relative;\n display: flex;\n flex-direction: column;\n width: ${STACKED_CARD_WIDTH}px;\n border-radius: ${STACKED_CARD_RADIUS}px;\n background-color: var(--page-paper-main);\n border: 1px solid var(--border-primary);\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n overflow: hidden;\n transition: box-shadow 150ms ease, border-color 150ms ease;\n\n ${revealControls}\n\n &:hover {\n ${hoverStyle}\n }\n\n &:focus-visible {\n outline: none;\n ${hoverStyle}\n box-shadow: 0 0 0 2px ${SELECTION_RING};\n }\n\n /* Forced hover — for docs, snapshots and \"this is what hover looks like\"\n demos. The doubled ampersand gives it the specificity to beat the cover's\n own reveal rule. */\n ${({ $forceHover }) =>\n $forceHover &&\n css`\n ${hoverStyle}\n && ${CONTROL} {\n opacity: 1;\n }\n `}\n\n ${({ $priorityColor }) =>\n $priorityColor &&\n css`\n &::before {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 4px;\n background: ${$priorityColor};\n z-index: 2;\n }\n `}\n\n /* Selection outranks hover: a selected card must keep its ring while the\n pointer is over it — which, right after the click that selected it, is\n always. The doubled ampersand buys the specificity to beat the hover rule\n above (same reason the entered state below does it). */\n ${({ $selected }) =>\n $selected &&\n css`\n && {\n border-color: ${SELECTION_RING};\n box-shadow: 0 0 0 2px ${SELECTION_RING};\n }\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n opacity: 0.5;\n pointer-events: none;\n `}\n\n /* Pending / optimistic — created or moved, not yet confirmed by the server.\n Dimmed, non-interactive and NOT draggable, but distinct from disabled: a\n transient in-flight state, not a policy. */\n ${({ $pending }) =>\n $pending &&\n css`\n opacity: 0.6;\n pointer-events: none;\n cursor: progress;\n `}\n\n /* Drag SOURCE — full-size outline placeholder. Content is hidden but keeps\n its box (visibility, not display) so the card holds identical dimensions\n and the surrounding cards never move. */\n ${({ $isDragSource }) =>\n $isDragSource &&\n css`\n background: transparent;\n border: 1px dashed var(--color-theme-500);\n box-shadow: none;\n\n &:hover {\n box-shadow: none;\n border-color: var(--color-theme-500);\n }\n\n > * {\n visibility: hidden;\n }\n `}\n\n /* Drag PREVIEW — the 1:1 copy the host floats in its drag layer. Elevated\n shadow ONLY: no rotate, no scale, no translate. */\n ${({ $isDragPreview }) =>\n $isDragPreview &&\n css`\n box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);\n cursor: grabbing;\n `}\n\n /* Entered (focus model) — focus has moved inside, onto an inner control. */\n ${({ $entered }) =>\n $entered &&\n css`\n && {\n border-color: ${SELECTION_RING};\n box-shadow: inset 0 0 0 2px ${SELECTION_RING},\n 0 0 0 2px ${SELECTION_RING};\n }\n `}\n`;\nStyledStackedCard.displayName = \"StyledStackedCard\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAUA,IAAAE,eAAA,GAAAF,OAAA;AAAmD,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,wBAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GA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,UAAAqD,MAAA;EAAA,IAAGC,cAAc,GAAAD,MAAA,CAAdC,cAAc;EAAA,OACjBA,cAAc,QACdtD,qBAAG,+DAGF;AAAA,GAGD,UAAAuD,MAAA;EAAA,IAAGC,QAAQ,GAAAD,MAAA,CAARC,QAAQ;EAAA,OACXA,QAAQ,QACRxD,qBAAG,6EAEiBR,cAAc,EACAA,cAAc,EAC9BA,cAAc,CAE/B;AAAA,EACJ;AACD8C,iBAAiB,CAAChC,WAAW,GAAG,mBAAmB","ignoreList":[]}
@@ -3,22 +3,24 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.snap = exports.measurePercent = exports.makeStart = exports.keyboardResize = exports.isResizeKey = exports.effectiveBounds = exports.clamp = exports.applyResize = exports.SHIFT_STEP_MULTIPLIER = exports.RESIZE_KEYS = exports.DEFAULT_KEYBOARD_STEP = void 0;
6
+ exports.snap = exports.measurePercent = exports.makeStart = exports.keyboardResize = exports.isResizeKey = exports.effectiveBounds = exports.clamp = exports.applyResize = exports.anchorSigns = exports.SHIFT_STEP_MULTIPLIER = exports.RESIZE_KEYS = exports.RESIZE_ANCHORS = exports.DEFAULT_RESIZE_ANCHOR = exports.DEFAULT_KEYBOARD_STEP = void 0;
7
7
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
8
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
9
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
10
10
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
11
11
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
12
  /**
13
- * StackedCard resize policy — pure math.
13
+ * Resize policy — pure math, shared by every resizable element.
14
14
  *
15
- * The card reports intent; the HOST applies a resize policy (spec §7). This
16
- * module is that policy, packaged as pure functions so the SAME code path
17
- * serves the pointer drag and the keyboard resize. Nothing here touches the
18
- * DOM, React or the card's content: it takes a start size, a delta and a
19
- * policy, and returns a clamped size. `useStackedCardResize` wires events to
20
- * it; the card's intrinsic content minimum is measured by the host and passed
21
- * in as `contentMin`, so this module knows nothing about heroes or footers.
15
+ * The element reports intent; the HOST applies a resize policy (StackedCard
16
+ * spec §7). This module is that policy, packaged as pure functions so the SAME
17
+ * code path serves the pointer drag and the keyboard resize, a card's single
18
+ * bottom-right grip and a shape's eight handles. Nothing here touches the DOM,
19
+ * React or the element's content: it takes a start box, a delta, a policy and
20
+ * the handle being dragged, and returns a clamped box — size AND position.
21
+ * `useStackedCardResize` wires events to it; an element's intrinsic content
22
+ * minimum is measured by the host and passed in as `contentMin`, so this module
23
+ * knows nothing about heroes or footers.
22
24
  *
23
25
  * The policy has four parts:
24
26
  * - bounds — optional min/max per axis; unset means unbounded.
@@ -27,12 +29,34 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
27
29
  * distorts at a bound.
28
30
  * - step — optional grid snap; proportion wins over the grid.
29
31
  * - content min — the effective min is max(policyMin, contentMin) per axis,
30
- * so a card can never be crushed below what its content needs.
32
+ * so an element can never be crushed below what its content
33
+ * needs.
34
+ *
35
+ * The anchor is the handle being dragged. The edge or corner OPPOSITE to it
36
+ * never moves — not while the pointer travels, and not when a bound stops the
37
+ * resize — which is what makes a resize feel like a resize rather than a nudge.
38
+ * A `left` handle moves the position by exactly the amount the width grew; a
39
+ * `right` handle leaves it alone. An edge handle touches one axis only.
31
40
  */
32
41
 
33
- /** The card's intrinsic minimum, measured from its real content. */
42
+ /** A resized element: its size and where its top-left corner now sits. */
34
43
 
35
- /** The size captured at the start of a gesture (pointer down or a key press). */
44
+ /** The element's intrinsic minimum, measured from its real content. */
45
+
46
+ /**
47
+ * The handle being dragged, named after the edge or corner it sits on. The
48
+ * opposite edge or corner is held in place.
49
+ */
50
+
51
+ var RESIZE_ANCHORS = exports.RESIZE_ANCHORS = ["top-left", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left"];
52
+
53
+ /** A card's single grip: the top-left corner stays put. */
54
+ var DEFAULT_RESIZE_ANCHOR = exports.DEFAULT_RESIZE_ANCHOR = "bottom-right";
55
+
56
+ /**
57
+ * The box captured at the start of a gesture (pointer down or a key press).
58
+ * A host that only tracks a size leaves the position at the origin.
59
+ */
36
60
 
37
61
  /**
38
62
  * `width` locks the vertical axis: an auto-height card takes a width and lets
@@ -58,10 +82,13 @@ var clamp = exports.clamp = function clamp(v, lo, hi) {
58
82
  var snap = exports.snap = function snap(v, step) {
59
83
  return step && step > 0 ? Math.round(v / step) * step : v;
60
84
  };
61
- var makeStart = exports.makeStart = function makeStart(size, contentMin) {
85
+ var makeStart = exports.makeStart = function makeStart(box, contentMin) {
86
+ var _box$x, _box$y;
62
87
  return {
63
- w: size.w,
64
- h: size.h,
88
+ w: box.w,
89
+ h: box.h,
90
+ x: (_box$x = box.x) !== null && _box$x !== void 0 ? _box$x : 0,
91
+ y: (_box$y = box.y) !== null && _box$y !== void 0 ? _box$y : 0,
65
92
  contentMin
66
93
  };
67
94
  };
@@ -89,18 +116,48 @@ var effectiveBounds = exports.effectiveBounds = function effectiveBounds(policy,
89
116
  var hasFloor = function hasFloor(policyMin, contentMin) {
90
117
  return policyMin !== undefined || contentMin > 0;
91
118
  };
119
+ /**
120
+ * Which way each axis grows for a handle: +1 when the handle is on the far
121
+ * edge (right/bottom), −1 when it is on the near edge (left/top), 0 when the
122
+ * handle does not touch that axis at all.
123
+ */
124
+ var anchorSigns = exports.anchorSigns = function anchorSigns(anchor) {
125
+ return {
126
+ sx: anchor.includes("left") ? -1 : anchor.includes("right") ? 1 : 0,
127
+ sy: anchor.includes("top") ? -1 : anchor.includes("bottom") ? 1 : 0
128
+ };
129
+ };
130
+
131
+ /**
132
+ * Snap the MOVING edge of one axis to the grid and return the length that
133
+ * leaves the anchored edge exactly where it was. A far-edge handle snaps
134
+ * `origin + length`; a near-edge handle snaps `origin + startLength − length`.
135
+ * With no step this is the identity.
136
+ */
137
+ var snapMovingEdge = function snapMovingEdge(origin, startLength, length, sign, step) {
138
+ if (!step || sign === 0) return length;
139
+ return sign > 0 ? snap(origin + length, step) - origin : origin + startLength - snap(origin + startLength - length, step);
140
+ };
141
+
142
+ /** The position that keeps the anchored edge of one axis in place. */
143
+ var anchoredOrigin = function anchoredOrigin(origin, startLength, length, sign) {
144
+ return sign < 0 ? origin + startLength - length : origin;
145
+ };
92
146
 
93
147
  /**
94
- * Apply a delta to the start size under the policy — the single path for both
95
- * inputs.
148
+ * Apply a delta to the start box under the policy — the single path for both
149
+ * inputs and for every handle.
96
150
  *
97
151
  * `constrain` is the transient Shift-to-constrain lock: a free-form policy
98
152
  * behaves proportionally for that one gesture; a proportional policy is already
99
153
  * locked and ignores it. `axis: "width"` drops the gesture's vertical component;
100
154
  * the height then holds still in free-form mode, and still follows the ratio in
101
- * proportional mode (that is what proportional means).
155
+ * proportional mode (that is what proportional means). `anchor` is the handle
156
+ * being dragged: the opposite edge or corner is held, so the returned position
157
+ * moves only when a near-edge handle (left/top) grew or shrank the box.
102
158
  */
103
159
  var applyResize = exports.applyResize = function applyResize(start, delta, policy) {
160
+ var _opts$anchor;
104
161
  var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
105
162
  var _effectiveBounds = effectiveBounds(policy, start.contentMin),
106
163
  wMin = _effectiveBounds.wMin,
@@ -108,8 +165,12 @@ var applyResize = exports.applyResize = function applyResize(start, delta, polic
108
165
  wMax = _effectiveBounds.wMax,
109
166
  hMax = _effectiveBounds.hMax;
110
167
  var widthOnly = opts.axis === "width";
111
- var dx = delta.dx;
112
- var dy = widthOnly ? 0 : delta.dy;
168
+ var _anchorSigns = anchorSigns((_opts$anchor = opts.anchor) !== null && _opts$anchor !== void 0 ? _opts$anchor : DEFAULT_RESIZE_ANCHOR),
169
+ sx = _anchorSigns.sx,
170
+ anchorSy = _anchorSigns.sy;
171
+ var sy = widthOnly ? 0 : anchorSy;
172
+ var dx = sx * delta.dx;
173
+ var dy = sy * delta.dy;
113
174
 
114
175
  // A ratio needs two non-zero sides to be a ratio at all; a width-only card
115
176
  // parks a placeholder height, so fall back to free-form rather than dividing
@@ -119,70 +180,96 @@ var applyResize = exports.applyResize = function applyResize(start, delta, polic
119
180
  var h;
120
181
  if (proportional) {
121
182
  // one scale drives both axes; the corner's dominant direction wins, so a
122
- // vertical drag is as effective as a horizontal one
123
- var sW = (start.w + dx) / start.w;
124
- var sH = (start.h + dy) / start.h;
125
- var scale = Math.abs(sW - 1) >= Math.abs(sH - 1) ? sW : sH;
126
-
127
- // step: proportion wins over the grid. Snap through the SCALE (driven off
128
- // the width edge) so both axes move together and the ratio survives; the
129
- // grid yields whenever honouring it would cost the ratio.
183
+ // vertical drag is as effective as a horizontal one. An edge handle has
184
+ // only its own axis to drive with.
185
+ var sW = sx === 0 ? 1 : (start.w + dx) / start.w;
186
+ var sH = sy === 0 ? 1 : (start.h + dy) / start.h;
187
+ var drivenByWidth = sx !== 0 && (sy === 0 || Math.abs(sW - 1) >= Math.abs(sH - 1));
188
+ var scale = drivenByWidth ? sW : sH;
189
+
190
+ // step: proportion wins over the grid. Snap through the SCALE, driven off
191
+ // the moving edge of the driving axis, so both axes move together and the
192
+ // ratio survives; the grid yields whenever honouring it would cost the
193
+ // ratio.
130
194
  if (policy.step) {
131
- scale = snap(start.w * scale, policy.step) / start.w;
195
+ scale = drivenByWidth ? snapMovingEdge(start.x, start.w, start.w * scale, sx, policy.step) / start.w : snapMovingEdge(start.y, start.h, start.h * scale, sy, policy.step) / start.h;
132
196
  }
133
197
 
134
198
  // Then clamp the scale so both axes stay in bounds (the binding constraint):
135
199
  // the ratio can never break at a bound — whichever edge is limiting stops
136
- // both. The clamp comes last on purpose: a bound is a hard stop, so the card
137
- // sits exactly on it rather than at the nearest grid line inside it.
200
+ // both. The clamp comes last on purpose: a bound is a hard stop, so the
201
+ // element sits exactly on it rather than at the nearest grid line inside it.
138
202
  var scaleMin = Math.max(wMin / start.w, hMin / start.h);
139
203
  var scaleMax = Math.min(wMax / start.w, hMax / start.h);
140
204
  scale = clamp(scale, scaleMin, Math.max(scaleMin, scaleMax));
141
205
  w = start.w * scale;
142
206
  h = start.h * scale;
143
207
  } else {
144
- w = clamp(snap(start.w + dx, policy.step), wMin, wMax);
145
- h = widthOnly ? start.h : clamp(snap(start.h + dy, policy.step), hMin, hMax);
208
+ // An axis the handle does not touch holds its start value exactly — it is
209
+ // neither snapped nor clamped, because nothing about it changed.
210
+ w = sx === 0 ? start.w : clamp(snapMovingEdge(start.x, start.w, start.w + dx, sx, policy.step), wMin, wMax);
211
+ h = sy === 0 ? start.h : clamp(snapMovingEdge(start.y, start.h, start.h + dy, sy, policy.step), hMin, hMax);
146
212
  }
213
+
214
+ // Round the size first and derive the position from the rounded size, so
215
+ // the anchored edge lands on exactly the coordinate it started at.
216
+ w = Math.round(w);
217
+ h = Math.round(h);
147
218
  return {
148
- w: Math.round(w),
149
- h: Math.round(h)
219
+ w,
220
+ h,
221
+ x: anchoredOrigin(start.x, start.w, w, sx),
222
+ y: anchoredOrigin(start.y, start.h, h, sy)
150
223
  };
151
224
  };
152
225
 
153
226
  /**
154
- * Translate a resize key into the next size, reusing `applyResize` so the
155
- * keyboard clamps exactly like the pointer. Arrows nudge by the step (Shift ×4);
156
- * Home/End jump to the min/max of the allowed range, leaving any axis without
157
- * that bound where it is. Returns null for a key the handle does not own, and
158
- * for a vertical key on a width-only card.
227
+ * Translate a resize key into the next box, reusing `applyResize` so the
228
+ * keyboard clamps exactly like the pointer. Arrows move the HANDLE by the step
229
+ * (Shift ×4) — so on a left handle ArrowLeft grows the element and ArrowRight
230
+ * shrinks it — and Home/End jump the handle to the min/max of the allowed
231
+ * range, leaving any axis without that bound where it is. Returns null for a
232
+ * key the handle does not own: a key on an axis the handle does not touch, or a
233
+ * vertical key on a width-only card.
159
234
  */
160
- var keyboardResize = exports.keyboardResize = function keyboardResize(key, size, policy, contentMin) {
235
+ var keyboardResize = exports.keyboardResize = function keyboardResize(key, box, policy, contentMin) {
236
+ var _opts$anchor2;
161
237
  var opts = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
162
238
  var widthOnly = opts.axis === "width";
163
- if (widthOnly && (key === "ArrowUp" || key === "ArrowDown")) return null;
239
+ var anchor = (_opts$anchor2 = opts.anchor) !== null && _opts$anchor2 !== void 0 ? _opts$anchor2 : DEFAULT_RESIZE_ANCHOR;
240
+ var _anchorSigns2 = anchorSigns(anchor),
241
+ sx = _anchorSigns2.sx,
242
+ anchorSy = _anchorSigns2.sy;
243
+ var sy = widthOnly ? 0 : anchorSy;
244
+ var horizontalKey = key === "ArrowLeft" || key === "ArrowRight";
245
+ var verticalKey = key === "ArrowUp" || key === "ArrowDown";
246
+ if (horizontalKey && sx === 0 || verticalKey && sy === 0) return null;
164
247
  var base = policy.step && policy.step > 0 ? policy.step : DEFAULT_KEYBOARD_STEP;
165
248
  var step = base * (opts.shiftKey ? SHIFT_STEP_MULTIPLIER : 1);
166
- var start = makeStart(size, contentMin);
249
+ var start = makeStart(box, contentMin);
167
250
  var b = effectiveBounds(policy, contentMin);
251
+ var resizeOpts = {
252
+ axis: opts.axis,
253
+ anchor
254
+ };
168
255
  var apply = function apply(delta) {
169
- return applyResize(start, delta, policy, {
170
- axis: opts.axis
171
- });
256
+ return applyResize(start, delta, policy, resizeOpts);
172
257
  };
173
258
 
174
259
  /**
175
260
  * Home and End are absolute jumps to a bound, not nudges, so they ignore the
176
261
  * grid: landing 4px off the minimum because that is where the nearest grid
177
262
  * line fell would mean the keyboard could never reach the bound the pointer
178
- * stops at.
263
+ * stops at. The jump is expressed as handle travel, so a near-edge handle
264
+ * moves the opposite way to reach the same size.
179
265
  */
180
- var jump = function jump(delta) {
181
- return applyResize(start, delta, _objectSpread(_objectSpread({}, policy), {}, {
266
+ var jump = function jump(growW, growH) {
267
+ return applyResize(start, {
268
+ dx: sx * growW,
269
+ dy: sy * growH
270
+ }, _objectSpread(_objectSpread({}, policy), {}, {
182
271
  step: 0
183
- }), {
184
- axis: opts.axis
185
- });
272
+ }), resizeOpts);
186
273
  };
187
274
  switch (key) {
188
275
  case "ArrowRight":
@@ -207,16 +294,10 @@ var keyboardResize = exports.keyboardResize = function keyboardResize(key, size,
207
294
  });
208
295
  case "Home":
209
296
  // jump to the min corner; an axis with no floor of its own stays put
210
- return jump({
211
- dx: hasFloor(policy.minW, contentMin.w) ? b.wMin - size.w : 0,
212
- dy: !widthOnly && hasFloor(policy.minH, contentMin.h) ? b.hMin - size.h : 0
213
- });
297
+ return jump(sx !== 0 && hasFloor(policy.minW, contentMin.w) ? b.wMin - box.w : 0, sy !== 0 && hasFloor(policy.minH, contentMin.h) ? b.hMin - box.h : 0);
214
298
  case "End":
215
299
  // jump to the max corner; an unbounded axis simply doesn't move
216
- return jump({
217
- dx: Number.isFinite(b.wMax) ? b.wMax - size.w : 0,
218
- dy: !widthOnly && Number.isFinite(b.hMax) ? b.hMax - size.h : 0
219
- });
300
+ return jump(sx !== 0 && Number.isFinite(b.wMax) ? b.wMax - box.w : 0, sy !== 0 && Number.isFinite(b.hMax) ? b.hMax - box.h : 0);
220
301
  default:
221
302
  return null;
222
303
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resizePolicy.js","names":["DEFAULT_KEYBOARD_STEP","exports","SHIFT_STEP_MULTIPLIER","RESIZE_KEYS","isResizeKey","key","includes","clamp","v","lo","hi","Math","min","Number","POSITIVE_INFINITY","max","snap","step","round","makeStart","size","contentMin","w","h","effectiveBounds","policy","_policy$minW","_policy$minH","_policy$maxW","_policy$maxH","wMin","minW","hMin","minH","wMax","maxW","hMax","maxH","hasFloor","policyMin","undefined","applyResize","start","delta","opts","arguments","length","_effectiveBounds","widthOnly","axis","dx","dy","proportional","constrain","sW","sH","scale","abs","scaleMin","scaleMax","keyboardResize","base","shiftKey","b","apply","jump","_objectSpread","isFinite","measurePercent","_effectiveBounds2"],"sources":["../../../../src/components/StackedCard/resizePolicy.ts"],"sourcesContent":["/**\n * StackedCard resize policy — pure math.\n *\n * The card reports intent; the HOST applies a resize policy (spec §7). This\n * module is that policy, packaged as pure functions so the SAME code path\n * serves the pointer drag and the keyboard resize. Nothing here touches the\n * DOM, React or the card's content: it takes a start size, a delta and a\n * policy, and returns a clamped size. `useStackedCardResize` wires events to\n * it; the card's intrinsic content minimum is measured by the host and passed\n * in as `contentMin`, so this module knows nothing about heroes or footers.\n *\n * The policy has four parts:\n * - bounds — optional min/max per axis; unset means unbounded.\n * - proportional — lock the aspect ratio captured at the start of the gesture;\n * the scale is clamped by the BINDING axis so the ratio never\n * distorts at a bound.\n * - step — optional grid snap; proportion wins over the grid.\n * - content min — the effective min is max(policyMin, contentMin) per axis,\n * so a card can never be crushed below what its content needs.\n */\n\nexport interface StackedCardSize {\n w: number;\n h: number;\n}\n\n/** The card's intrinsic minimum, measured from its real content. */\nexport interface StackedCardContentMin {\n w: number;\n h: number;\n}\n\nexport interface StackedCardResizePolicy {\n minW?: number;\n maxW?: number;\n minH?: number;\n maxH?: number;\n /** Lock the aspect ratio for the whole gesture. */\n proportional: boolean;\n /** Grid snap increment in px; omitted / 0 means continuous. */\n step?: number;\n}\n\n/** The size captured at the start of a gesture (pointer down or a key press). */\nexport interface StackedCardResizeStart {\n w: number;\n h: number;\n contentMin: StackedCardContentMin;\n}\n\nexport interface StackedCardResizeDelta {\n dx: number;\n dy: number;\n}\n\nexport interface StackedCardResizeBounds {\n wMin: number;\n wMax: number;\n hMin: number;\n hMax: number;\n}\n\n/**\n * `width` locks the vertical axis: an auto-height card takes a width and lets\n * its rows set the height, so the gesture's vertical component is ignored.\n */\nexport type StackedCardResizeAxis = \"both\" | \"width\";\n\n/** Which input drove a resize event. Hosts log undo entries per source. */\nexport type StackedCardResizeSource = \"pointer\" | \"keyboard\";\n\n/** Keyboard resize nudges by the policy step, or this when no step is set. */\nexport const DEFAULT_KEYBOARD_STEP = 8;\n\n/** Shift + arrow resizes by a larger increment (the familiar coarse nudge). */\nexport const SHIFT_STEP_MULTIPLIER = 4;\n\n/** Keys the separator handles; everything else falls through to the browser. */\nexport const RESIZE_KEYS: ReadonlyArray<string> = [\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n];\n\nexport const isResizeKey = (key: string): boolean => RESIZE_KEYS.includes(key);\n\nexport const clamp = (v: number, lo: number, hi?: number): number =>\n Math.min(hi ?? Number.POSITIVE_INFINITY, Math.max(lo, v));\n\nexport const snap = (v: number, step?: number): number =>\n step && step > 0 ? Math.round(v / step) * step : v;\n\nexport const makeStart = (\n size: StackedCardSize,\n contentMin: StackedCardContentMin\n): StackedCardResizeStart => ({\n w: size.w,\n h: size.h,\n contentMin,\n});\n\n/**\n * The effective bounds a size is clamped to: the policy min floored by the\n * content min, and the policy max (unbounded when unset). Independent of any\n * live gesture, so a host can also use it for the aria value and Home/End.\n */\nexport const effectiveBounds = (\n policy: StackedCardResizePolicy,\n contentMin: StackedCardContentMin\n): StackedCardResizeBounds => ({\n wMin: Math.max(policy.minW ?? 0, contentMin.w),\n hMin: Math.max(policy.minH ?? 0, contentMin.h),\n wMax: policy.maxW ?? Number.POSITIVE_INFINITY,\n hMax: policy.maxH ?? Number.POSITIVE_INFINITY,\n});\n\n/**\n * Whether an axis has a floor anyone asked for. `effectiveBounds` reports 0 for\n * an unset minimum — correct as a clamp, but not something Home should jump to:\n * an axis nobody gave a minimum must not collapse to nothing.\n */\nconst hasFloor = (policyMin: number | undefined, contentMin: number): boolean =>\n policyMin !== undefined || contentMin > 0;\n\n/**\n * Apply a delta to the start size under the policy — the single path for both\n * inputs.\n *\n * `constrain` is the transient Shift-to-constrain lock: a free-form policy\n * behaves proportionally for that one gesture; a proportional policy is already\n * locked and ignores it. `axis: \"width\"` drops the gesture's vertical component;\n * the height then holds still in free-form mode, and still follows the ratio in\n * proportional mode (that is what proportional means).\n */\nexport const applyResize = (\n start: StackedCardResizeStart,\n delta: StackedCardResizeDelta,\n policy: StackedCardResizePolicy,\n opts: { constrain?: boolean; axis?: StackedCardResizeAxis } = {}\n): StackedCardSize => {\n const { wMin, hMin, wMax, hMax } = effectiveBounds(policy, start.contentMin);\n const widthOnly = opts.axis === \"width\";\n const dx = delta.dx;\n const dy = widthOnly ? 0 : delta.dy;\n\n // A ratio needs two non-zero sides to be a ratio at all; a width-only card\n // parks a placeholder height, so fall back to free-form rather than dividing\n // by zero.\n const proportional =\n (policy.proportional || opts.constrain === true) &&\n start.w > 0 &&\n start.h > 0;\n\n let w: number;\n let h: number;\n\n if (proportional) {\n // one scale drives both axes; the corner's dominant direction wins, so a\n // vertical drag is as effective as a horizontal one\n const sW = (start.w + dx) / start.w;\n const sH = (start.h + dy) / start.h;\n let scale = Math.abs(sW - 1) >= Math.abs(sH - 1) ? sW : sH;\n\n // step: proportion wins over the grid. Snap through the SCALE (driven off\n // the width edge) so both axes move together and the ratio survives; the\n // grid yields whenever honouring it would cost the ratio.\n if (policy.step) {\n scale = snap(start.w * scale, policy.step) / start.w;\n }\n\n // Then clamp the scale so both axes stay in bounds (the binding constraint):\n // the ratio can never break at a bound — whichever edge is limiting stops\n // both. The clamp comes last on purpose: a bound is a hard stop, so the card\n // sits exactly on it rather than at the nearest grid line inside it.\n const scaleMin = Math.max(wMin / start.w, hMin / start.h);\n const scaleMax = Math.min(wMax / start.w, hMax / start.h);\n scale = clamp(scale, scaleMin, Math.max(scaleMin, scaleMax));\n\n w = start.w * scale;\n h = start.h * scale;\n } else {\n w = clamp(snap(start.w + dx, policy.step), wMin, wMax);\n h = widthOnly\n ? start.h\n : clamp(snap(start.h + dy, policy.step), hMin, hMax);\n }\n\n return { w: Math.round(w), h: Math.round(h) };\n};\n\n/**\n * Translate a resize key into the next size, reusing `applyResize` so the\n * keyboard clamps exactly like the pointer. Arrows nudge by the step (Shift ×4);\n * Home/End jump to the min/max of the allowed range, leaving any axis without\n * that bound where it is. Returns null for a key the handle does not own, and\n * for a vertical key on a width-only card.\n */\nexport const keyboardResize = (\n key: string,\n size: StackedCardSize,\n policy: StackedCardResizePolicy,\n contentMin: StackedCardContentMin,\n opts: { shiftKey?: boolean; axis?: StackedCardResizeAxis } = {}\n): StackedCardSize | null => {\n const widthOnly = opts.axis === \"width\";\n if (widthOnly && (key === \"ArrowUp\" || key === \"ArrowDown\")) return null;\n\n const base =\n policy.step && policy.step > 0 ? policy.step : DEFAULT_KEYBOARD_STEP;\n const step = base * (opts.shiftKey ? SHIFT_STEP_MULTIPLIER : 1);\n const start = makeStart(size, contentMin);\n const b = effectiveBounds(policy, contentMin);\n const apply = (delta: StackedCardResizeDelta): StackedCardSize =>\n applyResize(start, delta, policy, { axis: opts.axis });\n\n /**\n * Home and End are absolute jumps to a bound, not nudges, so they ignore the\n * grid: landing 4px off the minimum because that is where the nearest grid\n * line fell would mean the keyboard could never reach the bound the pointer\n * stops at.\n */\n const jump = (delta: StackedCardResizeDelta): StackedCardSize =>\n applyResize(start, delta, { ...policy, step: 0 }, { axis: opts.axis });\n\n switch (key) {\n case \"ArrowRight\":\n return apply({ dx: step, dy: 0 });\n case \"ArrowLeft\":\n return apply({ dx: -step, dy: 0 });\n case \"ArrowDown\":\n return apply({ dx: 0, dy: step });\n case \"ArrowUp\":\n return apply({ dx: 0, dy: -step });\n case \"Home\":\n // jump to the min corner; an axis with no floor of its own stays put\n return jump({\n dx: hasFloor(policy.minW, contentMin.w) ? b.wMin - size.w : 0,\n dy:\n !widthOnly && hasFloor(policy.minH, contentMin.h)\n ? b.hMin - size.h\n : 0,\n });\n case \"End\":\n // jump to the max corner; an unbounded axis simply doesn't move\n return jump({\n dx: Number.isFinite(b.wMax) ? b.wMax - size.w : 0,\n dy: !widthOnly && Number.isFinite(b.hMax) ? b.hMax - size.h : 0,\n });\n default:\n return null;\n }\n};\n\n/**\n * The handle's `aria-valuenow`: the current size as a percent (0–100) of its\n * allowed range. The corner resizes both axes, but the value must be a single\n * number, so it reports the WIDTH axis — the one axis the fixed-box and the\n * width-only cards share. Returns 0 when the range isn't finite (no max bound).\n */\nexport const measurePercent = (\n size: StackedCardSize,\n policy: StackedCardResizePolicy,\n contentMin: StackedCardContentMin\n): number => {\n const { wMin, wMax } = effectiveBounds(policy, contentMin);\n if (!Number.isFinite(wMax) || wMax <= wMin) return 0;\n return Math.round(clamp(((size.w - wMin) / (wMax - wMin)) * 100, 0, 100));\n};\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;;AAiBA;;AAmBA;AACA;AACA;AACA;;AAGA;;AAGA;AACO,IAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,CAAC;;AAEtC;AACO,IAAME,qBAAqB,GAAAD,OAAA,CAAAC,qBAAA,GAAG,CAAC;;AAEtC;AACO,IAAMC,WAAkC,GAAAF,OAAA,CAAAE,WAAA,GAAG,CAChD,WAAW,EACX,YAAY,EACZ,SAAS,EACT,WAAW,EACX,MAAM,EACN,KAAK,CACN;AAEM,IAAMC,WAAW,GAAAH,OAAA,CAAAG,WAAA,GAAG,SAAdA,WAAWA,CAAIC,GAAW;EAAA,OAAcF,WAAW,CAACG,QAAQ,CAACD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AAC/B,IAAI,GAAGZ,IAAI,CAACG,CAAC,GACf;MACR,CAAC,CAAC;IACJ,KAAK,KAAK;MACR;MACA,OAAO0C,IAAI,CAAC;QACVf,EAAE,EAAErC,MAAM,CAACsD,QAAQ,CAACJ,CAAC,CAAC7B,IAAI,CAAC,GAAG6B,CAAC,CAAC7B,IAAI,GAAGd,IAAI,CAACE,CAAC,GAAG,CAAC;QACjD6B,EAAE,EAAE,CAACH,SAAS,IAAInC,MAAM,CAACsD,QAAQ,CAACJ,CAAC,CAAC3B,IAAI,CAAC,GAAG2B,CAAC,CAAC3B,IAAI,GAAGhB,IAAI,CAACG,CAAC,GAAG;MAChE,CAAC,CAAC;IACJ;MACE,OAAO,IAAI;EACf;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACO,IAAM6C,cAAc,GAAAnE,OAAA,CAAAmE,cAAA,GAAG,SAAjBA,cAAcA,CACzBhD,IAAqB,EACrBK,MAA+B,EAC/BJ,UAAiC,EACtB;EACX,IAAAgD,iBAAA,GAAuB7C,eAAe,CAACC,MAAM,EAAEJ,UAAU,CAAC;IAAlDS,IAAI,GAAAuC,iBAAA,CAAJvC,IAAI;IAAEI,IAAI,GAAAmC,iBAAA,CAAJnC,IAAI;EAClB,IAAI,CAACrB,MAAM,CAACsD,QAAQ,CAACjC,IAAI,CAAC,IAAIA,IAAI,IAAIJ,IAAI,EAAE,OAAO,CAAC;EACpD,OAAOnB,IAAI,CAACO,KAAK,CAACX,KAAK,CAAE,CAACa,IAAI,CAACE,CAAC,GAAGQ,IAAI,KAAKI,IAAI,GAAGJ,IAAI,CAAC,GAAI,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAC3E,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"resizePolicy.js","names":["RESIZE_ANCHORS","exports","DEFAULT_RESIZE_ANCHOR","DEFAULT_KEYBOARD_STEP","SHIFT_STEP_MULTIPLIER","RESIZE_KEYS","isResizeKey","key","includes","clamp","v","lo","hi","Math","min","Number","POSITIVE_INFINITY","max","snap","step","round","makeStart","box","contentMin","_box$x","_box$y","w","h","x","y","effectiveBounds","policy","_policy$minW","_policy$minH","_policy$maxW","_policy$maxH","wMin","minW","hMin","minH","wMax","maxW","hMax","maxH","hasFloor","policyMin","undefined","anchorSigns","anchor","sx","sy","snapMovingEdge","origin","startLength","length","sign","anchoredOrigin","applyResize","start","delta","_opts$anchor","opts","arguments","_effectiveBounds","widthOnly","axis","_anchorSigns","anchorSy","dx","dy","proportional","constrain","sW","sH","drivenByWidth","abs","scale","scaleMin","scaleMax","keyboardResize","_opts$anchor2","_anchorSigns2","horizontalKey","verticalKey","base","shiftKey","b","resizeOpts","apply","jump","growW","growH","_objectSpread","isFinite","measurePercent","size","_effectiveBounds2"],"sources":["../../../../src/components/StackedCard/resizePolicy.ts"],"sourcesContent":["/**\n * Resize policy — pure math, shared by every resizable element.\n *\n * The element reports intent; the HOST applies a resize policy (StackedCard\n * spec §7). This module is that policy, packaged as pure functions so the SAME\n * code path serves the pointer drag and the keyboard resize, a card's single\n * bottom-right grip and a shape's eight handles. Nothing here touches the DOM,\n * React or the element's content: it takes a start box, a delta, a policy and\n * the handle being dragged, and returns a clamped box — size AND position.\n * `useStackedCardResize` wires events to it; an element's intrinsic content\n * minimum is measured by the host and passed in as `contentMin`, so this module\n * knows nothing about heroes or footers.\n *\n * The policy has four parts:\n * - bounds — optional min/max per axis; unset means unbounded.\n * - proportional — lock the aspect ratio captured at the start of the gesture;\n * the scale is clamped by the BINDING axis so the ratio never\n * distorts at a bound.\n * - step — optional grid snap; proportion wins over the grid.\n * - content min — the effective min is max(policyMin, contentMin) per axis,\n * so an element can never be crushed below what its content\n * needs.\n *\n * The anchor is the handle being dragged. The edge or corner OPPOSITE to it\n * never moves — not while the pointer travels, and not when a bound stops the\n * resize — which is what makes a resize feel like a resize rather than a nudge.\n * A `left` handle moves the position by exactly the amount the width grew; a\n * `right` handle leaves it alone. An edge handle touches one axis only.\n */\n\nexport interface ResizeSize {\n w: number;\n h: number;\n}\n\nexport interface ResizePosition {\n x: number;\n y: number;\n}\n\n/** A resized element: its size and where its top-left corner now sits. */\nexport interface ResizeBox extends ResizeSize, ResizePosition {}\n\n/** The element's intrinsic minimum, measured from its real content. */\nexport interface ResizeContentMin {\n w: number;\n h: number;\n}\n\nexport interface ResizePolicy {\n minW?: number;\n maxW?: number;\n minH?: number;\n maxH?: number;\n /** Lock the aspect ratio for the whole gesture. */\n proportional: boolean;\n /** Grid snap increment in px; omitted / 0 means continuous. */\n step?: number;\n}\n\n/**\n * The handle being dragged, named after the edge or corner it sits on. The\n * opposite edge or corner is held in place.\n */\nexport type ResizeAnchor =\n | \"top-left\"\n | \"top\"\n | \"top-right\"\n | \"right\"\n | \"bottom-right\"\n | \"bottom\"\n | \"bottom-left\"\n | \"left\";\n\nexport const RESIZE_ANCHORS: ReadonlyArray<ResizeAnchor> = [\n \"top-left\",\n \"top\",\n \"top-right\",\n \"right\",\n \"bottom-right\",\n \"bottom\",\n \"bottom-left\",\n \"left\",\n];\n\n/** A card's single grip: the top-left corner stays put. */\nexport const DEFAULT_RESIZE_ANCHOR: ResizeAnchor = \"bottom-right\";\n\n/**\n * The box captured at the start of a gesture (pointer down or a key press).\n * A host that only tracks a size leaves the position at the origin.\n */\nexport interface ResizeStart extends ResizeBox {\n contentMin: ResizeContentMin;\n}\n\nexport interface ResizeDelta {\n dx: number;\n dy: number;\n}\n\nexport interface ResizeBounds {\n wMin: number;\n wMax: number;\n hMin: number;\n hMax: number;\n}\n\n/**\n * `width` locks the vertical axis: an auto-height card takes a width and lets\n * its rows set the height, so the gesture's vertical component is ignored.\n */\nexport type ResizeAxis = \"both\" | \"width\";\n\n/** Which input drove a resize event. Hosts log undo entries per source. */\nexport type ResizeSource = \"pointer\" | \"keyboard\";\n\nexport interface ResizeOptions {\n /** Shift-to-constrain: one gesture behaves proportionally. */\n constrain?: boolean;\n axis?: ResizeAxis;\n /** The handle being dragged. Defaults to a card's bottom-right grip. */\n anchor?: ResizeAnchor;\n}\n\n/** Keyboard resize nudges by the policy step, or this when no step is set. */\nexport const DEFAULT_KEYBOARD_STEP = 8;\n\n/** Shift + arrow resizes by a larger increment (the familiar coarse nudge). */\nexport const SHIFT_STEP_MULTIPLIER = 4;\n\n/** Keys the separator handles; everything else falls through to the browser. */\nexport const RESIZE_KEYS: ReadonlyArray<string> = [\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n];\n\nexport const isResizeKey = (key: string): boolean => RESIZE_KEYS.includes(key);\n\nexport const clamp = (v: number, lo: number, hi?: number): number =>\n Math.min(hi ?? Number.POSITIVE_INFINITY, Math.max(lo, v));\n\nexport const snap = (v: number, step?: number): number =>\n step && step > 0 ? Math.round(v / step) * step : v;\n\nexport const makeStart = (\n box: ResizeSize & Partial<ResizePosition>,\n contentMin: ResizeContentMin\n): ResizeStart => ({\n w: box.w,\n h: box.h,\n x: box.x ?? 0,\n y: box.y ?? 0,\n contentMin,\n});\n\n/**\n * The effective bounds a size is clamped to: the policy min floored by the\n * content min, and the policy max (unbounded when unset). Independent of any\n * live gesture, so a host can also use it for the aria value and Home/End.\n */\nexport const effectiveBounds = (\n policy: ResizePolicy,\n contentMin: ResizeContentMin\n): ResizeBounds => ({\n wMin: Math.max(policy.minW ?? 0, contentMin.w),\n hMin: Math.max(policy.minH ?? 0, contentMin.h),\n wMax: policy.maxW ?? Number.POSITIVE_INFINITY,\n hMax: policy.maxH ?? Number.POSITIVE_INFINITY,\n});\n\n/**\n * Whether an axis has a floor anyone asked for. `effectiveBounds` reports 0 for\n * an unset minimum — correct as a clamp, but not something Home should jump to:\n * an axis nobody gave a minimum must not collapse to nothing.\n */\nconst hasFloor = (policyMin: number | undefined, contentMin: number): boolean =>\n policyMin !== undefined || contentMin > 0;\n\ntype AxisSign = -1 | 0 | 1;\n\n/**\n * Which way each axis grows for a handle: +1 when the handle is on the far\n * edge (right/bottom), −1 when it is on the near edge (left/top), 0 when the\n * handle does not touch that axis at all.\n */\nexport const anchorSigns = (\n anchor: ResizeAnchor\n): { sx: AxisSign; sy: AxisSign } => ({\n sx: anchor.includes(\"left\") ? -1 : anchor.includes(\"right\") ? 1 : 0,\n sy: anchor.includes(\"top\") ? -1 : anchor.includes(\"bottom\") ? 1 : 0,\n});\n\n/**\n * Snap the MOVING edge of one axis to the grid and return the length that\n * leaves the anchored edge exactly where it was. A far-edge handle snaps\n * `origin + length`; a near-edge handle snaps `origin + startLength − length`.\n * With no step this is the identity.\n */\nconst snapMovingEdge = (\n origin: number,\n startLength: number,\n length: number,\n sign: AxisSign,\n step?: number\n): number => {\n if (!step || sign === 0) return length;\n return sign > 0\n ? snap(origin + length, step) - origin\n : origin + startLength - snap(origin + startLength - length, step);\n};\n\n/** The position that keeps the anchored edge of one axis in place. */\nconst anchoredOrigin = (\n origin: number,\n startLength: number,\n length: number,\n sign: AxisSign\n): number => (sign < 0 ? origin + startLength - length : origin);\n\n/**\n * Apply a delta to the start box under the policy — the single path for both\n * inputs and for every handle.\n *\n * `constrain` is the transient Shift-to-constrain lock: a free-form policy\n * behaves proportionally for that one gesture; a proportional policy is already\n * locked and ignores it. `axis: \"width\"` drops the gesture's vertical component;\n * the height then holds still in free-form mode, and still follows the ratio in\n * proportional mode (that is what proportional means). `anchor` is the handle\n * being dragged: the opposite edge or corner is held, so the returned position\n * moves only when a near-edge handle (left/top) grew or shrank the box.\n */\nexport const applyResize = (\n start: ResizeStart,\n delta: ResizeDelta,\n policy: ResizePolicy,\n opts: ResizeOptions = {}\n): ResizeBox => {\n const { wMin, hMin, wMax, hMax } = effectiveBounds(policy, start.contentMin);\n const widthOnly = opts.axis === \"width\";\n const { sx, sy: anchorSy } = anchorSigns(\n opts.anchor ?? DEFAULT_RESIZE_ANCHOR\n );\n const sy: AxisSign = widthOnly ? 0 : anchorSy;\n const dx = sx * delta.dx;\n const dy = sy * delta.dy;\n\n // A ratio needs two non-zero sides to be a ratio at all; a width-only card\n // parks a placeholder height, so fall back to free-form rather than dividing\n // by zero.\n const proportional =\n (policy.proportional || opts.constrain === true) &&\n start.w > 0 &&\n start.h > 0;\n\n let w: number;\n let h: number;\n\n if (proportional) {\n // one scale drives both axes; the corner's dominant direction wins, so a\n // vertical drag is as effective as a horizontal one. An edge handle has\n // only its own axis to drive with.\n const sW = sx === 0 ? 1 : (start.w + dx) / start.w;\n const sH = sy === 0 ? 1 : (start.h + dy) / start.h;\n const drivenByWidth =\n sx !== 0 && (sy === 0 || Math.abs(sW - 1) >= Math.abs(sH - 1));\n let scale = drivenByWidth ? sW : sH;\n\n // step: proportion wins over the grid. Snap through the SCALE, driven off\n // the moving edge of the driving axis, so both axes move together and the\n // ratio survives; the grid yields whenever honouring it would cost the\n // ratio.\n if (policy.step) {\n scale = drivenByWidth\n ? snapMovingEdge(start.x, start.w, start.w * scale, sx, policy.step) /\n start.w\n : snapMovingEdge(start.y, start.h, start.h * scale, sy, policy.step) /\n start.h;\n }\n\n // Then clamp the scale so both axes stay in bounds (the binding constraint):\n // the ratio can never break at a bound — whichever edge is limiting stops\n // both. The clamp comes last on purpose: a bound is a hard stop, so the\n // element sits exactly on it rather than at the nearest grid line inside it.\n const scaleMin = Math.max(wMin / start.w, hMin / start.h);\n const scaleMax = Math.min(wMax / start.w, hMax / start.h);\n scale = clamp(scale, scaleMin, Math.max(scaleMin, scaleMax));\n\n w = start.w * scale;\n h = start.h * scale;\n } else {\n // An axis the handle does not touch holds its start value exactly — it is\n // neither snapped nor clamped, because nothing about it changed.\n w =\n sx === 0\n ? start.w\n : clamp(\n snapMovingEdge(start.x, start.w, start.w + dx, sx, policy.step),\n wMin,\n wMax\n );\n h =\n sy === 0\n ? start.h\n : clamp(\n snapMovingEdge(start.y, start.h, start.h + dy, sy, policy.step),\n hMin,\n hMax\n );\n }\n\n // Round the size first and derive the position from the rounded size, so\n // the anchored edge lands on exactly the coordinate it started at.\n w = Math.round(w);\n h = Math.round(h);\n\n return {\n w,\n h,\n x: anchoredOrigin(start.x, start.w, w, sx),\n y: anchoredOrigin(start.y, start.h, h, sy),\n };\n};\n\n/**\n * Translate a resize key into the next box, reusing `applyResize` so the\n * keyboard clamps exactly like the pointer. Arrows move the HANDLE by the step\n * (Shift ×4) — so on a left handle ArrowLeft grows the element and ArrowRight\n * shrinks it — and Home/End jump the handle to the min/max of the allowed\n * range, leaving any axis without that bound where it is. Returns null for a\n * key the handle does not own: a key on an axis the handle does not touch, or a\n * vertical key on a width-only card.\n */\nexport const keyboardResize = (\n key: string,\n box: ResizeSize & Partial<ResizePosition>,\n policy: ResizePolicy,\n contentMin: ResizeContentMin,\n opts: { shiftKey?: boolean; axis?: ResizeAxis; anchor?: ResizeAnchor } = {}\n): ResizeBox | null => {\n const widthOnly = opts.axis === \"width\";\n const anchor = opts.anchor ?? DEFAULT_RESIZE_ANCHOR;\n const { sx, sy: anchorSy } = anchorSigns(anchor);\n const sy: AxisSign = widthOnly ? 0 : anchorSy;\n const horizontalKey = key === \"ArrowLeft\" || key === \"ArrowRight\";\n const verticalKey = key === \"ArrowUp\" || key === \"ArrowDown\";\n if ((horizontalKey && sx === 0) || (verticalKey && sy === 0)) return null;\n\n const base =\n policy.step && policy.step > 0 ? policy.step : DEFAULT_KEYBOARD_STEP;\n const step = base * (opts.shiftKey ? SHIFT_STEP_MULTIPLIER : 1);\n const start = makeStart(box, contentMin);\n const b = effectiveBounds(policy, contentMin);\n const resizeOpts: ResizeOptions = { axis: opts.axis, anchor };\n const apply = (delta: ResizeDelta): ResizeBox =>\n applyResize(start, delta, policy, resizeOpts);\n\n /**\n * Home and End are absolute jumps to a bound, not nudges, so they ignore the\n * grid: landing 4px off the minimum because that is where the nearest grid\n * line fell would mean the keyboard could never reach the bound the pointer\n * stops at. The jump is expressed as handle travel, so a near-edge handle\n * moves the opposite way to reach the same size.\n */\n const jump = (growW: number, growH: number): ResizeBox =>\n applyResize(\n start,\n { dx: sx * growW, dy: sy * growH },\n { ...policy, step: 0 },\n resizeOpts\n );\n\n switch (key) {\n case \"ArrowRight\":\n return apply({ dx: step, dy: 0 });\n case \"ArrowLeft\":\n return apply({ dx: -step, dy: 0 });\n case \"ArrowDown\":\n return apply({ dx: 0, dy: step });\n case \"ArrowUp\":\n return apply({ dx: 0, dy: -step });\n case \"Home\":\n // jump to the min corner; an axis with no floor of its own stays put\n return jump(\n sx !== 0 && hasFloor(policy.minW, contentMin.w) ? b.wMin - box.w : 0,\n sy !== 0 && hasFloor(policy.minH, contentMin.h) ? b.hMin - box.h : 0\n );\n case \"End\":\n // jump to the max corner; an unbounded axis simply doesn't move\n return jump(\n sx !== 0 && Number.isFinite(b.wMax) ? b.wMax - box.w : 0,\n sy !== 0 && Number.isFinite(b.hMax) ? b.hMax - box.h : 0\n );\n default:\n return null;\n }\n};\n\n/**\n * The handle's `aria-valuenow`: the current size as a percent (0–100) of its\n * allowed range. The corner resizes both axes, but the value must be a single\n * number, so it reports the WIDTH axis — the one axis the fixed-box and the\n * width-only cards share. Returns 0 when the range isn't finite (no max bound).\n */\nexport const measurePercent = (\n size: ResizeSize,\n policy: ResizePolicy,\n contentMin: ResizeContentMin\n): number => {\n const { wMin, wMax } = effectiveBounds(policy, contentMin);\n if (!Number.isFinite(wMax) || wMax <= wMin) return 0;\n return Math.round(clamp(((size.w - wMin) / (wMax - wMin)) * 100, 0, 100));\n};\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;;AAGA;;AAiBA;AACA;AACA;AACA;;AAWO,IAAMA,cAA2C,GAAAC,OAAA,CAAAD,cAAA,GAAG,CACzD,UAAU,EACV,KAAK,EACL,WAAW,EACX,OAAO,EACP,cAAc,EACd,QAAQ,EACR,aAAa,EACb,MAAM,CACP;;AAED;AACO,IAAME,qBAAmC,GAAAD,OAAA,CAAAC,qBAAA,G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