@weasel-js/ui 1.0.2 → 1.0.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 (188) hide show
  1. package/dist/chunks/ActionBar-GThu74LC.js.map +1 -1
  2. package/dist/chunks/ActionsBar-9aR5N3lU.js.map +1 -1
  3. package/dist/chunks/Badge-DZQqAV4d.js.map +1 -1
  4. package/dist/chunks/BandEditor-13K91O9M.js +228 -0
  5. package/dist/chunks/BandEditor-13K91O9M.js.map +1 -0
  6. package/dist/chunks/Button-9QNIYugK.js.map +1 -1
  7. package/dist/chunks/Callout-CFqG5xho.js.map +1 -1
  8. package/dist/chunks/Checkbox-KQ5L8APP.js.map +1 -1
  9. package/dist/chunks/ColorField-ykpiD3XU.js.map +1 -1
  10. package/dist/chunks/ComboBox-DpxsFVBy.js.map +1 -1
  11. package/dist/chunks/{CurveEditor-fRctbmoV.js → CurveEditor-CqIt_Xph.js} +3 -3
  12. package/dist/chunks/CurveEditor-CqIt_Xph.js.map +1 -0
  13. package/dist/chunks/DataGrid-BQklXGRl.js.map +1 -1
  14. package/dist/chunks/Dialog-3FCd_gYi.js.map +1 -1
  15. package/dist/chunks/Field-VQwmrIna.js.map +1 -1
  16. package/dist/chunks/{GradientEditor-BL5kg7a_.js → GradientEditor-DeptQpWX.js} +4 -4
  17. package/dist/chunks/GradientEditor-DeptQpWX.js.map +1 -0
  18. package/dist/chunks/Input-DpkwYtUY.js.map +1 -1
  19. package/dist/chunks/Keycaps-CFX7UAj8.js.map +1 -1
  20. package/dist/chunks/NumberField-BbzI0GtU.js.map +1 -1
  21. package/dist/chunks/OptionsBar-CHvH4n4u.js.map +1 -1
  22. package/dist/chunks/Plot2D-CEnhzodm.js.map +1 -1
  23. package/dist/chunks/{PointPlotter-R8hguJPq.js → PointPlotter-DD-bWmRc.js} +2 -2
  24. package/dist/chunks/PointPlotter-DD-bWmRc.js.map +1 -0
  25. package/dist/chunks/Powerline-Dd9Ukhcl.js.map +1 -1
  26. package/dist/chunks/Prefs-lgI4x4jF.js.map +1 -1
  27. package/dist/chunks/RadioGroup-CIpHr3g6.js.map +1 -1
  28. package/dist/chunks/RangeSlider-CaDogGTj.js.map +1 -1
  29. package/dist/chunks/{ResizeHandle-CCQ2y87y.js → ResizeHandle-BOpmtOOj.js} +2 -2
  30. package/dist/chunks/ResizeHandle-BOpmtOOj.js.map +1 -0
  31. package/dist/chunks/Select-BE3Y1NrH.js.map +1 -1
  32. package/dist/chunks/SelectionPanel-Zaw8tYQH.js.map +1 -1
  33. package/dist/chunks/Sidebar-DP_nyJze.js.map +1 -1
  34. package/dist/chunks/SidebarPanel-BpD0ptyg.js.map +1 -1
  35. package/dist/chunks/{Slider-Di2kNqVy.js → Slider-CmPeFJ3x.js} +4 -4
  36. package/dist/chunks/Slider-CmPeFJ3x.js.map +1 -0
  37. package/dist/chunks/StatusBar-DBO0E0Yd.js.map +1 -1
  38. package/dist/chunks/Switch-JyVSSAzC.js.map +1 -1
  39. package/dist/chunks/Tabs-Df0sDomx.js.map +1 -1
  40. package/dist/chunks/Toast-DFw4IrD_.js.map +1 -1
  41. package/dist/chunks/ToggleBar-BP1zFcvg.js.map +1 -1
  42. package/dist/chunks/ToolButton-DpT-mukU.js.map +1 -1
  43. package/dist/chunks/ToolGroup-BTIwd4U4.js.map +1 -1
  44. package/dist/chunks/ToolOptionsBar-JvmY7iNe.js.map +1 -1
  45. package/dist/chunks/ToolPalette-DPn0owno.js.map +1 -1
  46. package/dist/chunks/Tooltip-Clgn4trm.js.map +1 -1
  47. package/dist/chunks/useRovingTabIndex-DBZtq4IH.js.map +1 -1
  48. package/dist/color/oklch.d.ts +12 -0
  49. package/dist/color/oklch.d.ts.map +1 -1
  50. package/dist/components/ActionBar/ActionBar.d.ts +1 -0
  51. package/dist/components/ActionBar/ActionBar.d.ts.map +1 -1
  52. package/dist/components/ActionsBar/ActionsBar.d.ts +15 -0
  53. package/dist/components/ActionsBar/ActionsBar.d.ts.map +1 -1
  54. package/dist/components/Badge/Badge.d.ts +14 -0
  55. package/dist/components/Badge/Badge.d.ts.map +1 -1
  56. package/dist/components/Badge/bases/edgeProfiles.d.ts +8 -0
  57. package/dist/components/Badge/bases/edgeProfiles.d.ts.map +1 -1
  58. package/dist/components/Badge/types.d.ts +11 -0
  59. package/dist/components/Badge/types.d.ts.map +1 -1
  60. package/dist/components/BandEditor/BandEditor.d.ts +56 -0
  61. package/dist/components/BandEditor/BandEditor.d.ts.map +1 -0
  62. package/dist/components/BandEditor/bands.d.ts +45 -0
  63. package/dist/components/BandEditor/bands.d.ts.map +1 -0
  64. package/dist/components/BandEditor/index.d.ts +4 -0
  65. package/dist/components/BandEditor/index.d.ts.map +1 -0
  66. package/dist/components/BandEditor/index.js +2 -0
  67. package/dist/components/BandEditor/scale.d.ts +25 -0
  68. package/dist/components/BandEditor/scale.d.ts.map +1 -0
  69. package/dist/components/Button/Button.d.ts +13 -0
  70. package/dist/components/Button/Button.d.ts.map +1 -1
  71. package/dist/components/Callout/Callout.d.ts +2 -0
  72. package/dist/components/Callout/Callout.d.ts.map +1 -1
  73. package/dist/components/Checkbox/Checkbox.d.ts +4 -0
  74. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  75. package/dist/components/ColorField/ColorField.d.ts +4 -0
  76. package/dist/components/ColorField/ColorField.d.ts.map +1 -1
  77. package/dist/components/ComboBox/ComboBox.d.ts +11 -0
  78. package/dist/components/ComboBox/ComboBox.d.ts.map +1 -1
  79. package/dist/components/CurveEditor/CurveEditor.d.ts +14 -2
  80. package/dist/components/CurveEditor/CurveEditor.d.ts.map +1 -1
  81. package/dist/components/CurveEditor/LayeredCurveEditor.d.ts +15 -0
  82. package/dist/components/CurveEditor/LayeredCurveEditor.d.ts.map +1 -1
  83. package/dist/components/CurveEditor/createFunctionLayer.d.ts +39 -0
  84. package/dist/components/CurveEditor/createFunctionLayer.d.ts.map +1 -1
  85. package/dist/components/CurveEditor/index.js +1 -1
  86. package/dist/components/CurveEditor/layerTypes.d.ts +5 -0
  87. package/dist/components/CurveEditor/layerTypes.d.ts.map +1 -1
  88. package/dist/components/CurveEditor/setCurveOp.d.ts +4 -0
  89. package/dist/components/CurveEditor/setCurveOp.d.ts.map +1 -1
  90. package/dist/components/DataGrid/DataGrid.d.ts +12 -0
  91. package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
  92. package/dist/components/Dialog/Dialog.d.ts +1 -0
  93. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  94. package/dist/components/Field/Field.d.ts +9 -0
  95. package/dist/components/Field/Field.d.ts.map +1 -1
  96. package/dist/components/GradientEditor/GradientEditor.d.ts +4 -0
  97. package/dist/components/GradientEditor/GradientEditor.d.ts.map +1 -1
  98. package/dist/components/GradientEditor/GradientHandles.d.ts +4 -0
  99. package/dist/components/GradientEditor/GradientHandles.d.ts.map +1 -1
  100. package/dist/components/GradientEditor/index.js +1 -1
  101. package/dist/components/Input/Input.d.ts +1 -0
  102. package/dist/components/Input/Input.d.ts.map +1 -1
  103. package/dist/components/Keycaps/Keycap.d.ts +10 -0
  104. package/dist/components/Keycaps/Keycap.d.ts.map +1 -1
  105. package/dist/components/Keycaps/Keycaps.d.ts +2 -0
  106. package/dist/components/Keycaps/Keycaps.d.ts.map +1 -1
  107. package/dist/components/Keycaps/keySpecsFromMods.d.ts +2 -0
  108. package/dist/components/Keycaps/keySpecsFromMods.d.ts.map +1 -1
  109. package/dist/components/NumberField/NumberField.d.ts +9 -0
  110. package/dist/components/NumberField/NumberField.d.ts.map +1 -1
  111. package/dist/components/OptionsBar/OptionsBar.d.ts +12 -0
  112. package/dist/components/OptionsBar/OptionsBar.d.ts.map +1 -1
  113. package/dist/components/Plot2D/Plot2D.d.ts +14 -0
  114. package/dist/components/Plot2D/Plot2D.d.ts.map +1 -1
  115. package/dist/components/Plot2D/geometry.d.ts +10 -0
  116. package/dist/components/Plot2D/geometry.d.ts.map +1 -1
  117. package/dist/components/PointPlotter/PointPlotter.d.ts +3 -2
  118. package/dist/components/PointPlotter/PointPlotter.d.ts.map +1 -1
  119. package/dist/components/PointPlotter/index.js +1 -1
  120. package/dist/components/Powerline/Powerline.d.ts +13 -0
  121. package/dist/components/Powerline/Powerline.d.ts.map +1 -1
  122. package/dist/components/Prefs/PrefsDialog.d.ts +4 -0
  123. package/dist/components/Prefs/PrefsDialog.d.ts.map +1 -1
  124. package/dist/components/Prefs/PrefsForm.d.ts +6 -0
  125. package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
  126. package/dist/components/Prefs/schema.d.ts +17 -0
  127. package/dist/components/Prefs/schema.d.ts.map +1 -1
  128. package/dist/components/RadioGroup/RadioGroup.d.ts +8 -0
  129. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  130. package/dist/components/RangeSlider/RangeSlider.d.ts +1 -0
  131. package/dist/components/RangeSlider/RangeSlider.d.ts.map +1 -1
  132. package/dist/components/ResizeHandle/ResizeHandle.d.ts +7 -3
  133. package/dist/components/ResizeHandle/ResizeHandle.d.ts.map +1 -1
  134. package/dist/components/ResizeHandle/index.js +1 -1
  135. package/dist/components/Select/Select.d.ts +11 -0
  136. package/dist/components/Select/Select.d.ts.map +1 -1
  137. package/dist/components/SelectionPanel/SelectionPanel.d.ts +6 -0
  138. package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
  139. package/dist/components/SelectionPanel/model.d.ts +12 -0
  140. package/dist/components/SelectionPanel/model.d.ts.map +1 -1
  141. package/dist/components/Sidebar/Sidebar.d.ts +1 -0
  142. package/dist/components/Sidebar/Sidebar.d.ts.map +1 -1
  143. package/dist/components/SidebarPanel/SidebarPanel.d.ts +1 -0
  144. package/dist/components/SidebarPanel/SidebarPanel.d.ts.map +1 -1
  145. package/dist/components/Slider/Slider.d.ts +43 -2
  146. package/dist/components/Slider/Slider.d.ts.map +1 -1
  147. package/dist/components/Slider/index.js +1 -1
  148. package/dist/components/StatusBar/StatusBar.d.ts +2 -0
  149. package/dist/components/StatusBar/StatusBar.d.ts.map +1 -1
  150. package/dist/components/Switch/Switch.d.ts +11 -0
  151. package/dist/components/Switch/Switch.d.ts.map +1 -1
  152. package/dist/components/Tabs/Tabs.d.ts +11 -0
  153. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  154. package/dist/components/Toast/Toast.d.ts +2 -0
  155. package/dist/components/Toast/Toast.d.ts.map +1 -1
  156. package/dist/components/Toast/queue.d.ts +7 -0
  157. package/dist/components/Toast/queue.d.ts.map +1 -1
  158. package/dist/components/ToggleBar/ToggleBar.d.ts +16 -0
  159. package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -1
  160. package/dist/components/ToolButton/ToolButton.d.ts +1 -0
  161. package/dist/components/ToolButton/ToolButton.d.ts.map +1 -1
  162. package/dist/components/ToolGroup/ToolGroup.d.ts +1 -0
  163. package/dist/components/ToolGroup/ToolGroup.d.ts.map +1 -1
  164. package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts +1 -0
  165. package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts.map +1 -1
  166. package/dist/components/ToolPalette/ToolPalette.d.ts +9 -0
  167. package/dist/components/ToolPalette/ToolPalette.d.ts.map +1 -1
  168. package/dist/components/Tooltip/Tooltip.d.ts +5 -0
  169. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  170. package/dist/format/number.d.ts +4 -0
  171. package/dist/format/number.d.ts.map +1 -1
  172. package/dist/index.d.ts +1 -0
  173. package/dist/index.d.ts.map +1 -1
  174. package/dist/index.js +12 -11
  175. package/dist/index.js.map +1 -1
  176. package/dist/paintGradientTrack.d.ts +13 -0
  177. package/dist/paintGradientTrack.d.ts.map +1 -1
  178. package/dist/style.css +1 -1
  179. package/dist/useReorderDragList.d.ts +23 -0
  180. package/dist/useReorderDragList.d.ts.map +1 -1
  181. package/dist/useRovingTabIndex.d.ts +5 -0
  182. package/dist/useRovingTabIndex.d.ts.map +1 -1
  183. package/package.json +2 -2
  184. package/dist/chunks/CurveEditor-fRctbmoV.js.map +0 -1
  185. package/dist/chunks/GradientEditor-BL5kg7a_.js.map +0 -1
  186. package/dist/chunks/PointPlotter-R8hguJPq.js.map +0 -1
  187. package/dist/chunks/ResizeHandle-CCQ2y87y.js.map +0 -1
  188. package/dist/chunks/Slider-Di2kNqVy.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ToolPalette-DPn0owno.js","names":[],"sources":["../../src/components/ToolPalette/ToolPalette.module.css","../../src/components/ToolPalette/formatShortcut.ts","../../src/components/ToolPalette/ToolPalette.tsx"],"sourcesContent":[".palette {\n display: flex;\n flex-direction: column;\n gap: 4px;\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: 4px;\n padding: 4px;\n user-select: none;\n}\n.palette.horizontal {\n flex-direction: row;\n}\n\n/* Marker only — `useRovingTabIndex` finds the palette's buttons by this class.\n Carries no styles; deleting it breaks keyboard navigation. */\n.paletteBtn {}\n\n/* Applied to ineligible tool buttons in the active mode. */\n.ineligibleBtn {\n opacity: 0.35;\n cursor: not-allowed;\n}\n\n.separator {\n background: var(--wzl-border);\n}\n.palette:not(.horizontal) .separator {\n height: 1px;\n margin: 2px 0;\n}\n.palette.horizontal .separator {\n width: 1px;\n margin: 0 2px;\n}\n","import { keyGlyph } from '../Keycaps/keyGlyph';\n\nexport interface ShortcutInput {\n key: string | readonly string[];\n mod?: boolean;\n alt?: boolean;\n shift?: boolean | 'optional';\n}\n\n/** Format a shortcut as an array of display chips, one per key — modifier\n * icons (⌘, ↑, ⌥) followed by the key glyph. UIs that want a boxed\n * per-key look render each chip in its own element. `shift: 'optional'` is\n * treated as falsy. */\nexport function formatShortcutParts(b: ShortcutInput | undefined): readonly string[] | undefined {\n if (!b) return undefined;\n const rawKey = Array.isArray(b.key) ? b.key[0] : (b.key as string);\n const parts: string[] = [];\n if (b.mod) parts.push('⌘');\n if (b.shift === true) parts.push('⇧');\n if (b.alt) parts.push('⌥');\n parts.push(keyGlyph(rawKey));\n return parts;\n}\n\n/** Format a shortcut as a single display string. Order: mod, shift, alt,\n * key. Returns `undefined` for `undefined` input so callers can `??` a\n * fallback. When `key` is an array, the first element is used. `shift: 'optional'`\n * is treated as falsy. */\nexport function formatShortcut(b: ShortcutInput | undefined): string | undefined {\n const parts = formatShortcutParts(b);\n return parts ? parts.join('') : undefined;\n}\n","import { Fragment, type ReactNode } from 'react';\nimport { UnknownIcon } from '@weasel-js/core';\nimport type { AnyTool, ToolsApi } from '@weasel-js/core';\nimport { eligibleContribution, type ModeRegistry } from '@weasel-js/modes';\nimport { ToolButton } from '../ToolButton';\nimport { ToolGroup } from '../ToolGroup';\nimport { useRovingTabIndex } from '../../useRovingTabIndex';\nimport s from './ToolPalette.module.css';\nimport { formatShortcut, type ShortcutInput } from './formatShortcut';\n\nconst DEFAULT_GROUP_ORDER = ['select', 'shape', 'draw', 'type', 'view'] as const;\nconst MISC = 'misc';\n\nfunction partitionByGroup(list: AnyTool[]): Map<string, AnyTool[]> {\n const groups = new Map<string, AnyTool[]>();\n for (const tool of list) {\n const g = tool.presentation?.group ?? MISC;\n const bucket = groups.get(g) ?? [];\n bucket.push(tool);\n groups.set(g, bucket);\n }\n return groups;\n}\n\nfunction orderedGroupKeys(\n groups: Map<string, AnyTool[]>,\n groupOrder: readonly string[],\n): string[] {\n const seen = new Set(groups.keys());\n const ordered: string[] = [];\n for (const known of groupOrder) {\n if (seen.has(known)) {\n ordered.push(known);\n seen.delete(known);\n }\n }\n // Unknown groups in insertion order (Map preserves it), misc last.\n for (const key of groups.keys()) {\n if (seen.has(key) && key !== MISC) {\n ordered.push(key);\n seen.delete(key);\n }\n }\n if (seen.has(MISC)) ordered.push(MISC);\n return ordered;\n}\n\nfunction resolveIcon(tool: AnyTool): ReactNode {\n const rawIcon = tool.presentation?.icon;\n if (rawIcon == null) return <UnknownIcon />;\n if (typeof rawIcon === 'function') return rawIcon(undefined);\n return rawIcon;\n}\n\nexport interface ToolPaletteProps {\n tools: ToolsApi;\n orientation?: 'vertical' | 'horizontal';\n className?: string;\n /** Derive the keyboard shortcut for a tool button from the action registry.\n * Called with the tool's id; return `undefined` to suppress a chip. When\n * omitted, falls back to `tool.keybinding` (legacy path). */\n lookupShortcut?: (toolId: string) => ShortcutInput | undefined;\n /**\n * Optional mode registry. When provided, tools whose `capabilities` do not\n * match the current mode are rendered greyed-out, aria-disabled, and their\n * onClick is suppressed. When omitted, all tools are treated as eligible\n * (preserves existing behaviour in consumers that haven't wired a registry).\n */\n modeRegistry?: ModeRegistry;\n /**\n * Presentation-group display order. Groups not listed keep their registry\n * insertion order after the listed ones; `misc` always renders last.\n * Defaults to `['select', 'shape', 'draw', 'type', 'view']`.\n */\n groupOrder?: readonly string[];\n}\n\nexport function ToolPalette(props: ToolPaletteProps) {\n const {\n tools, orientation = 'vertical', className, lookupShortcut, modeRegistry,\n groupOrder = DEFAULT_GROUP_ORDER,\n } = props;\n const list = Object.values(tools.registry);\n const groups = partitionByGroup(list);\n const groupKeys = orderedGroupKeys(groups, groupOrder);\n const cls = [s.palette, orientation === 'horizontal' && s.horizontal, className]\n .filter(Boolean).join(' ');\n\n // Flat, in DOM order — the roving-tabindex hook indexes by this order.\n const ordered = groupKeys.flatMap((k) => groups.get(k)!);\n const eligibility = ordered.map(\n (tool) => (modeRegistry ? eligibleContribution(modeRegistry, tool) : true),\n );\n const activeIndex = ordered.findIndex((t) => t.id === tools.active);\n const roving = useRovingTabIndex({\n items: eligibility.map((enabled) => ({ disabled: !enabled })),\n itemClassName: s.paletteBtn,\n // An ineligible active tool can't hold the tab stop; fall back to the\n // hook's first-enabled default.\n ...(activeIndex >= 0 && eligibility[activeIndex] ? { tabStopIndex: activeIndex } : {}),\n });\n let index = -1;\n\n return (\n <div\n ref={roving.rootRef}\n className={cls}\n role=\"toolbar\"\n aria-label=\"Tools\"\n >\n {groupKeys.map((key, i) => (\n <Fragment key={key}>\n {i > 0 && (\n <div\n className={s.separator}\n role=\"separator\"\n aria-orientation={orientation === 'horizontal' ? 'vertical' : 'horizontal'}\n />\n )}\n <ToolGroup orientation={orientation} groupKey={key}>\n {groups.get(key)!.map((tool) => {\n const i = ++index;\n const label = tool.presentation?.label ?? tool.id;\n const shortcut = tool.presentation?.shortcut\n ?? formatShortcut(lookupShortcut ? lookupShortcut(tool.id) : tool.keybinding);\n const enabled = eligibility[i];\n const modeName = modeRegistry ? modeRegistry.current().id : undefined;\n const resolvedTitle = !enabled && modeName\n ? `${label}${shortcut ? ` (${shortcut})` : ''} — disabled in ${modeName} mode`\n : undefined;\n return (\n <ToolButton\n key={tool.id}\n icon={resolveIcon(tool)}\n label={label}\n shortcut={shortcut}\n active={tools.active === tool.id}\n tabbable={roving.tabIndexFor(i) === 0}\n ariaDisabled={!enabled}\n className={[s.paletteBtn, !enabled && s.ineligibleBtn].filter(Boolean).join(' ')}\n title={resolvedTitle}\n onClick={enabled ? () => tools.setActive(tool.id) : () => {}}\n onKeyDown={roving.onKeyDown(i)}\n />\n );\n })}\n </ToolGroup>\n </Fragment>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;ACaA,SAAgB,EAAoB,GAA6D;AAC/F,KAAI,CAAC,EAAG;CACR,IAAM,IAAS,MAAM,QAAQ,EAAE,IAAI,GAAG,EAAE,IAAI,KAAM,EAAE,KAC9C,IAAkB,EAAE;AAK1B,QAJI,EAAE,OAAK,EAAM,KAAK,IAAI,EACtB,EAAE,UAAU,MAAM,EAAM,KAAK,IAAI,EACjC,EAAE,OAAK,EAAM,KAAK,IAAI,EAC1B,EAAM,KAAK,EAAS,EAAO,CAAC,EACrB;;AAOT,SAAgB,EAAe,GAAkD;CAC/E,IAAM,IAAQ,EAAoB,EAAE;AACpC,QAAO,IAAQ,EAAM,KAAK,GAAG,GAAG,KAAA;;;;ACpBlC,IAAM,IAAsB;CAAC;CAAU;CAAS;CAAQ;CAAQ;CAAO,EACjE,IAAO;AAEb,SAAS,EAAiB,GAAyC;CACjE,IAAM,oBAAS,IAAI,KAAwB;AAC3C,MAAK,IAAM,KAAQ,G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/ToolPalette.module.css","../../src/components/ToolPalette/formatShortcut.ts","../../src/components/ToolPalette/ToolPalette.tsx"],"sourcesContent":[".palette {\n display: flex;\n flex-direction: column;\n gap: 4px;\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: 4px;\n padding: 4px;\n user-select: none;\n}\n.palette.horizontal {\n flex-direction: row;\n}\n\n/* Marker only — `useRovingTabIndex` finds the palette's buttons by this class.\n Carries no styles; deleting it breaks keyboard navigation. */\n.paletteBtn {}\n\n/* Applied to ineligible tool buttons in the active mode. */\n.ineligibleBtn {\n opacity: 0.35;\n cursor: not-allowed;\n}\n\n.separator {\n background: var(--wzl-border);\n}\n.palette:not(.horizontal) .separator {\n height: 1px;\n margin: 2px 0;\n}\n.palette.horizontal .separator {\n width: 1px;\n margin: 0 2px;\n}\n","import { keyGlyph } from '../Keycaps/keyGlyph';\n\nexport interface ShortcutInput {\n key: string | readonly string[];\n mod?: boolean;\n alt?: boolean;\n shift?: boolean | 'optional';\n}\n\n/** Format a shortcut as an array of display chips, one per key — modifier\n * icons (⌘, ↑, ⌥) followed by the key glyph. UIs that want a boxed\n * per-key look render each chip in its own element. `shift: 'optional'` is\n * treated as falsy. */\nexport function formatShortcutParts(b: ShortcutInput | undefined): readonly string[] | undefined {\n if (!b) return undefined;\n const rawKey = Array.isArray(b.key) ? b.key[0] : (b.key as string);\n const parts: string[] = [];\n if (b.mod) parts.push('⌘');\n if (b.shift === true) parts.push('⇧');\n if (b.alt) parts.push('⌥');\n parts.push(keyGlyph(rawKey));\n return parts;\n}\n\n/** Format a shortcut as a single display string. Order: mod, shift, alt,\n * key. Returns `undefined` for `undefined` input so callers can `??` a\n * fallback. When `key` is an array, the first element is used. `shift: 'optional'`\n * is treated as falsy. */\nexport function formatShortcut(b: ShortcutInput | undefined): string | undefined {\n const parts = formatShortcutParts(b);\n return parts ? parts.join('') : undefined;\n}\n","import { Fragment, type ReactNode } from 'react';\nimport { UnknownIcon } from '@weasel-js/core';\nimport type { AnyTool, ToolsApi } from '@weasel-js/core';\nimport { eligibleContribution, type ModeRegistry } from '@weasel-js/modes';\nimport { ToolButton } from '../ToolButton';\nimport { ToolGroup } from '../ToolGroup';\nimport { useRovingTabIndex } from '../../useRovingTabIndex';\nimport s from './ToolPalette.module.css';\nimport { formatShortcut, type ShortcutInput } from './formatShortcut';\n\nconst DEFAULT_GROUP_ORDER = ['select', 'shape', 'draw', 'type', 'view'] as const;\nconst MISC = 'misc';\n\nfunction partitionByGroup(list: AnyTool[]): Map<string, AnyTool[]> {\n const groups = new Map<string, AnyTool[]>();\n for (const tool of list) {\n const g = tool.presentation?.group ?? MISC;\n const bucket = groups.get(g) ?? [];\n bucket.push(tool);\n groups.set(g, bucket);\n }\n return groups;\n}\n\nfunction orderedGroupKeys(\n groups: Map<string, AnyTool[]>,\n groupOrder: readonly string[],\n): string[] {\n const seen = new Set(groups.keys());\n const ordered: string[] = [];\n for (const known of groupOrder) {\n if (seen.has(known)) {\n ordered.push(known);\n seen.delete(known);\n }\n }\n // Unknown groups in insertion order (Map preserves it), misc last.\n for (const key of groups.keys()) {\n if (seen.has(key) && key !== MISC) {\n ordered.push(key);\n seen.delete(key);\n }\n }\n if (seen.has(MISC)) ordered.push(MISC);\n return ordered;\n}\n\nfunction resolveIcon(tool: AnyTool): ReactNode {\n const rawIcon = tool.presentation?.icon;\n if (rawIcon == null) return <UnknownIcon />;\n if (typeof rawIcon === 'function') return rawIcon(undefined);\n return rawIcon;\n}\n\n/** Props for {@link ToolPalette}. */\nexport interface ToolPaletteProps {\n tools: ToolsApi;\n orientation?: 'vertical' | 'horizontal';\n className?: string;\n /** Derive the keyboard shortcut for a tool button from the action registry.\n * Called with the tool's id; return `undefined` to suppress a chip. When\n * omitted, falls back to `tool.keybinding` (legacy path). */\n lookupShortcut?: (toolId: string) => ShortcutInput | undefined;\n /**\n * Optional mode registry. When provided, tools whose `capabilities` do not\n * match the current mode are rendered greyed-out, aria-disabled, and their\n * onClick is suppressed. When omitted, all tools are treated as eligible\n * (preserves existing behaviour in consumers that haven't wired a registry).\n */\n modeRegistry?: ModeRegistry;\n /**\n * Presentation-group display order. Groups not listed keep their registry\n * insertion order after the listed ones; `misc` always renders last.\n * Defaults to `['select', 'shape', 'draw', 'type', 'view']`.\n */\n groupOrder?: readonly string[];\n}\n\n/**\n * Toolbar of the registered tools, split into separator-divided groups by\n * each tool's presentation group and navigable by arrow keys. Clicking a\n * button makes that tool active.\n *\n * Given a `modeRegistry`, tools whose capabilities the current mode does not\n * allow render greyed out and inert rather than disappearing.\n */\nexport function ToolPalette(props: ToolPaletteProps) {\n const {\n tools, orientation = 'vertical', className, lookupShortcut, modeRegistry,\n groupOrder = DEFAULT_GROUP_ORDER,\n } = props;\n const list = Object.values(tools.registry);\n const groups = partitionByGroup(list);\n const groupKeys = orderedGroupKeys(groups, groupOrder);\n const cls = [s.palette, orientation === 'horizontal' && s.horizontal, className]\n .filter(Boolean).join(' ');\n\n // Flat, in DOM order — the roving-tabindex hook indexes by this order.\n const ordered = groupKeys.flatMap((k) => groups.get(k)!);\n const eligibility = ordered.map(\n (tool) => (modeRegistry ? eligibleContribution(modeRegistry, tool) : true),\n );\n const activeIndex = ordered.findIndex((t) => t.id === tools.active);\n const roving = useRovingTabIndex({\n items: eligibility.map((enabled) => ({ disabled: !enabled })),\n itemClassName: s.paletteBtn,\n // An ineligible active tool can't hold the tab stop; fall back to the\n // hook's first-enabled default.\n ...(activeIndex >= 0 && eligibility[activeIndex] ? { tabStopIndex: activeIndex } : {}),\n });\n let index = -1;\n\n return (\n <div\n ref={roving.rootRef}\n className={cls}\n role=\"toolbar\"\n aria-label=\"Tools\"\n >\n {groupKeys.map((key, i) => (\n <Fragment key={key}>\n {i > 0 && (\n <div\n className={s.separator}\n role=\"separator\"\n aria-orientation={orientation === 'horizontal' ? 'vertical' : 'horizontal'}\n />\n )}\n <ToolGroup orientation={orientation} groupKey={key}>\n {groups.get(key)!.map((tool) => {\n const i = ++index;\n const label = tool.presentation?.label ?? tool.id;\n const shortcut = tool.presentation?.shortcut\n ?? formatShortcut(lookupShortcut ? lookupShortcut(tool.id) : tool.keybinding);\n const enabled = eligibility[i];\n const modeName = modeRegistry ? modeRegistry.current().id : undefined;\n const resolvedTitle = !enabled && modeName\n ? `${label}${shortcut ? ` (${shortcut})` : ''} — disabled in ${modeName} mode`\n : undefined;\n return (\n <ToolButton\n key={tool.id}\n icon={resolveIcon(tool)}\n label={label}\n shortcut={shortcut}\n active={tools.active === tool.id}\n tabbable={roving.tabIndexFor(i) === 0}\n ariaDisabled={!enabled}\n className={[s.paletteBtn, !enabled && s.ineligibleBtn].filter(Boolean).join(' ')}\n title={resolvedTitle}\n onClick={enabled ? () => tools.setActive(tool.id) : () => {}}\n onKeyDown={roving.onKeyDown(i)}\n />\n );\n })}\n </ToolGroup>\n </Fragment>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;ACaA,SAAgB,EAAoB,GAA6D;AAC/F,KAAI,CAAC,EAAG;CACR,IAAM,IAAS,MAAM,QAAQ,EAAE,IAAI,GAAG,EAAE,IAAI,KAAM,EAAE,KAC9C,IAAkB,EAAE;AAK1B,QAJI,EAAE,OAAK,EAAM,KAAK,IAAI,EACtB,EAAE,UAAU,MAAM,EAAM,KAAK,IAAI,EACjC,EAAE,OAAK,EAAM,KAAK,IAAI,EAC1B,EAAM,KAAK,EAAS,EAAO,CAAC,EACrB;;AAOT,SAAgB,EAAe,GAAkD;CAC/E,IAAM,IAAQ,EAAoB,EAAE;AACpC,QAAO,IAAQ,EAAM,KAAK,GAAG,GAAG,KAAA;;;;ACpBlC,IAAM,IAAsB;CAAC;CAAU;CAAS;CAAQ;CAAQ;CAAO,EACjE,IAAO;AAEb,SAAS,EAAiB,GAAyC;CACjE,IAAM,oBAAS,IAAI,KAAwB;AAC3C,MAAK,IAAM,KAAQ,GAAM;EACvB,IAAM,IAAI,EAAK,cAAc,SAAS,GAChC,IAAS,EAAO,IAAI,EAAE,IAAI,EAAE;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AAc,GAAa,GAAG,EAAE;EACtF,CAAC,EACE,IAAQ;AAEZ,QACE,kBAAC,OAAD;EACE,KAAK,EAAO;EACZ,WAAW;EACX,MAAK;EACL,cAAW;YAEV,EAAU,KAAK,GAAK,MACnB,kBAAC,GAAD,EAAA,UAAA,CACG,IAAI,KACH,kBAAC,OAAD;GACE,WAAW,EAAE;GACb,MAAK;GACL,oBAAkB,MAAgB,eAAe,aAAa;GAC9D,CAAA,EAEJ,kBAAC,GAAD;GAAwB;GAAa,UAAU;aAC5C,EAAO,IAAI,EAAI,CAAE,KAAK,MAAS;IAC9B,IAAM,IAAI,EAAE,GACN,IAAQ,EAAK,cAAc,SAAS,EAAK,IACzC,IAAW,EAAK,cAAc,YAC/B,EAAe,IAAiB,EAAe,EAAK,GAAG,GAAG,EAAK,WAAW,EACzE,IAAU,EAAY,IACtB,IAAW,IAAe,EAAa,SAAS,CAAC,KAAK,KAAA,GACtD,IAAgB,CAAC,KAAW,IAC9B,GAAG,IAAQ,IAAW,KAAK,EAAS,KAAK,GAAG,iBAAiB,EAAS,SACtE,KAAA;AACJ,WACE,kBAAC,GAAD;KAEE,MAAM,EAAY,EAAK;KAChB;KACG;KACV,QAAQ,EAAM,WAAW,EAAK;KAC9B,UAAU,EAAO,YAAY,EAAE,KAAK;KACpC,cAAc,CAAC;KACf,WAAW,CAAC,EAAE,YAAY,CAAC,KAAW,EAAE,cAAc,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;KAChF,OAAO;KACP,SAAS,UAAgB,EAAM,UAAU,EAAK,GAAG,SAAS;KAC1D,WAAW,EAAO,UAAU,EAAE;KAC9B,EAXK,EAAK,GAWV;KAEJ;GACQ,CAAA,CACH,EAAA,EApCI,EAoCJ,CACX;EACE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip-Clgn4trm.js","names":[],"sources":["../../src/components/Tooltip/Tooltip.module.css","../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":[".tooltip {\n /* Above Dialog overlay (1000) and ToastRegion (1100) — RAC sets no z-index. */\n z-index: 1200;\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);\n color: var(--wzl-fg);\n font-family: var(--wzl-font-ui);\n font-size: 12px;\n line-height: 1.3;\n padding: 4px 8px;\n max-width: 260px;\n transition: opacity var(--wzl-motion-fast);\n}\n\n.tooltip[data-entering],\n.tooltip[data-exiting] {\n opacity: 0;\n}\n\n.arrow svg {\n display: block;\n fill: var(--wzl-surface);\n stroke: var(--wzl-border);\n stroke-width: 1;\n}\n\n.arrow[data-placement='bottom'] svg {\n transform: rotate(180deg);\n}\n\n.arrow[data-placement='left'] svg {\n transform: rotate(-90deg);\n}\n\n.arrow[data-placement='right'] svg {\n transform: rotate(90deg);\n}\n","import type { ReactNode } from 'react';\nimport {\n TooltipTrigger as RACTooltipTrigger,\n Tooltip as RACTooltip,\n OverlayArrow,\n type TooltipProps as RACTooltipProps,\n type TooltipTriggerComponentProps,\n} from 'react-aria-components';\nimport s from './Tooltip.module.css';\n\nexport type TooltipTriggerProps = TooltipTriggerComponentProps;\n\n/**\n * TooltipTrigger with kit defaults: ~600 ms open delay, instant close.\n * Wrap a focusable trigger plus a `<Tooltip>`. Non-RAC triggers (plain\n * `<button>` etc.) must be wrapped in `<Focusable>` from\n * react-aria-components so hover/focus props reach the DOM node.\n *\n * Caveat: while a tooltip is open, react-aria captures the first Escape\n * keydown (document-level, capture phase) to dismiss it — app-level\n * Escape handlers (deselect, cancel gesture) see only the second press.\n */\nexport function TooltipTrigger(props: TooltipTriggerProps) {\n const { delay = 600, closeDelay = 0, ...rest } = props;\n return <RACTooltipTrigger delay={delay} closeDelay={closeDelay} {...rest} />;\n}\n\nexport type TooltipProps = Omit<RACTooltipProps, 'children' | 'className'> & {\n children?: ReactNode;\n className?: string;\n};\n\n/**\n * Tooltip bubble with an arrow pointing at the trigger. Non-interactive\n * content only (ARIA tooltip semantics). Use inside `<TooltipTrigger>`.\n */\nexport function Tooltip(props: TooltipProps) {\n const { children, className, placement = 'top', offset = 8, ...rest } = props;\n return (\n <RACTooltip\n {...rest}\n placement={placement}\n offset={offset}\n className={[s.tooltip, className].filter(Boolean).join(' ')}\n >\n <OverlayArrow className={s.arrow}>\n <svg width={8} height={8} viewBox=\"0 0 8 8\" aria-hidden=\"true\">\n <path d=\"M0 0 L4 4 L8 0\" />\n </svg>\n </OverlayArrow>\n {children}\n </RACTooltip>\n );\n}\n"],"mappings":";;;;;;;;ACsBA,SAAgB,EAAe,GAA4B;CACzD,IAAM,EAAE,WAAQ,KAAK,gBAAa,GAAG,GAAG,MAAS;AACjD,QAAO,kBAAC,GAAD;EAA0B;EAAmB;EAAY,GAAI;EAAQ,CAAA;;AAY9E,SAAgB,EAAQ,GAAqB;CAC3C,IAAM,EAAE,aAAU,cAAW,eAAY,OAAO,YAAS,GAAG,GAAG,MAAS;AACxE,QACE,kBAAC,GAAD;EACE,GAAI;EACO;EACH;EACR,WAAW,CAAC,EAAE,SAAS,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;YAJ7D,CAME,kBAAC,GAAD;GAAc,WAAW,EAAE;aACzB,kBAAC,OAAD;IAAK,OAAO;IAAG,QAAQ;IAAG,SAAQ;IAAU,eAAY;cACtD,kBAAC,QAAD,EAAM,GAAE,kBAAmB,CAAA;IACvB,CAAA;GACO,CAAA,EACd,EACU"}
1
+ {"version":3,"file":"Tooltip-Clgn4trm.js","names":[],"sources":["../../src/components/Tooltip/Tooltip.module.css","../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":[".tooltip {\n /* Above Dialog overlay (1000) and ToastRegion (1100) — RAC sets no z-index. */\n z-index: 1200;\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);\n color: var(--wzl-fg);\n font-family: var(--wzl-font-ui);\n font-size: 12px;\n line-height: 1.3;\n padding: 4px 8px;\n max-width: 260px;\n transition: opacity var(--wzl-motion-fast);\n}\n\n.tooltip[data-entering],\n.tooltip[data-exiting] {\n opacity: 0;\n}\n\n.arrow svg {\n display: block;\n fill: var(--wzl-surface);\n stroke: var(--wzl-border);\n stroke-width: 1;\n}\n\n.arrow[data-placement='bottom'] svg {\n transform: rotate(180deg);\n}\n\n.arrow[data-placement='left'] svg {\n transform: rotate(-90deg);\n}\n\n.arrow[data-placement='right'] svg {\n transform: rotate(90deg);\n}\n","import type { ReactNode } from 'react';\nimport {\n TooltipTrigger as RACTooltipTrigger,\n Tooltip as RACTooltip,\n OverlayArrow,\n type TooltipProps as RACTooltipProps,\n type TooltipTriggerComponentProps,\n} from 'react-aria-components';\nimport s from './Tooltip.module.css';\n\n/**\n * Props for {@link TooltipTrigger} — React Aria's `TooltipTrigger` props\n * unchanged.\n */\nexport type TooltipTriggerProps = TooltipTriggerComponentProps;\n\n/**\n * TooltipTrigger with kit defaults: ~600 ms open delay, instant close.\n * Wrap a focusable trigger plus a `<Tooltip>`. Non-RAC triggers (plain\n * `<button>` etc.) must be wrapped in `<Focusable>` from\n * react-aria-components so hover/focus props reach the DOM node.\n *\n * Caveat: while a tooltip is open, react-aria captures the first Escape\n * keydown (document-level, capture phase) to dismiss it — app-level\n * Escape handlers (deselect, cancel gesture) see only the second press.\n */\nexport function TooltipTrigger(props: TooltipTriggerProps) {\n const { delay = 600, closeDelay = 0, ...rest } = props;\n return <RACTooltipTrigger delay={delay} closeDelay={closeDelay} {...rest} />;\n}\n\n/** Props for {@link Tooltip}, on top of React Aria's `Tooltip` props. */\nexport type TooltipProps = Omit<RACTooltipProps, 'children' | 'className'> & {\n children?: ReactNode;\n className?: string;\n};\n\n/**\n * Tooltip bubble with an arrow pointing at the trigger. Non-interactive\n * content only (ARIA tooltip semantics). Use inside `<TooltipTrigger>`.\n */\nexport function Tooltip(props: TooltipProps) {\n const { children, className, placement = 'top', offset = 8, ...rest } = props;\n return (\n <RACTooltip\n {...rest}\n placement={placement}\n offset={offset}\n className={[s.tooltip, className].filter(Boolean).join(' ')}\n >\n <OverlayArrow className={s.arrow}>\n <svg width={8} height={8} viewBox=\"0 0 8 8\" aria-hidden=\"true\">\n <path d=\"M0 0 L4 4 L8 0\" />\n </svg>\n </OverlayArrow>\n {children}\n </RACTooltip>\n );\n}\n"],"mappings":";;;;;;;;AC0BA,SAAgB,EAAe,GAA4B;CACzD,IAAM,EAAE,WAAQ,KAAK,gBAAa,GAAG,GAAG,MAAS;AACjD,QAAO,kBAAC,GAAD;EAA0B;EAAmB;EAAY,GAAI;EAAQ,CAAA;;AAa9E,SAAgB,EAAQ,GAAqB;CAC3C,IAAM,EAAE,aAAU,cAAW,eAAY,OAAO,YAAS,GAAG,GAAG,MAAS;AACxE,QACE,kBAAC,GAAD;EACE,GAAI;EACO;EACH;EACR,WAAW,CAAC,EAAE,SAAS,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;YAJ7D,CAME,kBAAC,GAAD;GAAc,WAAW,EAAE;aACzB,kBAAC,OAAD;IAAK,OAAO;IAAG,QAAQ;IAAG,SAAQ;IAAU,eAAY;cACtD,kBAAC,QAAD,EAAM,GAAE,kBAAmB,CAAA;IACvB,CAAA;GACO,CAAA,EACd,EACU"}
@@ -1 +1 @@
1
- {"version":3,"file":"useRovingTabIndex-DBZtq4IH.js","names":[],"sources":["../../src/useRovingTabIndex.ts"],"sourcesContent":["import { useRef, type KeyboardEvent as ReactKeyboardEvent, type RefObject } from 'react';\n\n/** The only thing the hook needs to know about a bar's items: which are\n * skipped by arrow navigation. */\nexport type RovingItem = { disabled?: boolean };\n\nexport type UseRovingTabIndexOptions = {\n /** In the same order as the elements carrying `itemClassName`. */\n items: readonly RovingItem[];\n /** Class on the focusable element of each item, inside the container the\n * returned `rootRef` is attached to. Their DOM order must match `items`. */\n itemClassName: string;\n /** Index that carries `tabIndex=0`. Defaults to the first enabled item; a\n * radiogroup-style bar passes its selected index so Tab lands on the\n * current value. */\n tabStopIndex?: number;\n /** Called with the new index as arrow/Home/End focus moves, before focus\n * moves. This is where a selection-follows-focus bar commits the value. */\n onNavigate?: (index: number) => void;\n /** Space/Enter on the item at `index`. When omitted the keypress is left\n * alone, which on a native `<button>` produces an ordinary click. */\n onActivate?: (index: number) => void;\n};\n\nexport type RovingTabIndex<T extends HTMLElement = HTMLDivElement> = {\n /** Attach to the container element that holds the items. */\n rootRef: RefObject<T | null>;\n /** `tabIndex` value for the item at `index`. */\n tabIndexFor: (index: number) => 0 | -1;\n /** `onKeyDown` for the item at `index`. */\n onKeyDown: (index: number) => (e: ReactKeyboardEvent<HTMLElement>) => void;\n};\n\nfunction firstEnabledIndex(items: readonly RovingItem[]): number {\n for (let i = 0; i < items.length; i++) if (!items[i].disabled) return i;\n return -1;\n}\n\nfunction lastEnabledIndex(items: readonly RovingItem[]): number {\n for (let i = items.length - 1; i >= 0; i--) if (!items[i].disabled) return i;\n return -1;\n}\n\nfunction nextEnabledIndex(items: readonly RovingItem[], from: number): number {\n const n = items.length;\n for (let k = 1; k <= n; k++) {\n const i = (from + k + n) % n;\n if (!items[i].disabled) return i;\n }\n return from;\n}\n\nfunction prevEnabledIndex(items: readonly RovingItem[], from: number): number {\n const n = items.length;\n for (let k = 1; k <= n; k++) {\n const i = (from - k + n) % n;\n if (!items[i].disabled) return i;\n }\n return from;\n}\n\n/**\n * Roving tabindex for a bar of items: one item is in the tab order, and the\n * arrow keys move focus among the rest, skipping disabled ones and wrapping\n * at both ends. Home and End go to the first and last enabled item. Both axes\n * navigate, so the same bar works laid out either way.\n *\n * Backs `ActionsBar`, `OptionsBar`, and `ToggleBar`.\n *\n * **When a bar should not use this.** Only when the bar owns its items. A\n * container of arbitrary compound controls — a number field, a select, a\n * color field — must leave the arrow keys alone, because those controls edit\n * their own value with them; taking the arrows over would break the control\n * to navigate between controls. `ToolOptionsBar` is that case and keeps plain\n * DOM tab order. A bar whose items are all simple buttons is the case this\n * hook is for.\n *\n * With every item disabled there is no tab stop and the bar drops out of the\n * tab order entirely.\n */\nexport function useRovingTabIndex<T extends HTMLElement = HTMLDivElement>(\n options: UseRovingTabIndexOptions,\n): RovingTabIndex<T> {\n const { items, itemClassName, onNavigate, onActivate } = options;\n const rootRef = useRef<T | null>(null);\n\n const tabStopIndex = options.tabStopIndex ?? firstEnabledIndex(items);\n\n const focusItem = (index: number): void => {\n const root = rootRef.current;\n if (!root) return;\n const elements = root.querySelectorAll<HTMLElement>(`.${itemClassName}`);\n elements[index]?.focus();\n };\n\n const onKeyDown = (index: number) => (e: ReactKeyboardEvent<HTMLElement>): void => {\n let nextIndex = -1;\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n nextIndex = prevEnabledIndex(items, index);\n break;\n case 'ArrowRight':\n case 'ArrowDown':\n nextIndex = nextEnabledIndex(items, index);\n break;\n case 'Home':\n nextIndex = firstEnabledIndex(items);\n break;\n case 'End':\n nextIndex = lastEnabledIndex(items);\n break;\n case ' ':\n case 'Enter':\n if (onActivate) {\n e.preventDefault();\n onActivate(index);\n }\n return;\n default:\n return;\n }\n if (nextIndex < 0 || nextIndex === index) return;\n e.preventDefault();\n onNavigate?.(nextIndex);\n focusItem(nextIndex);\n };\n\n return {\n rootRef,\n tabIndexFor: (index: number) => (index === tabStopIndex ? 0 : -1),\n onKeyDown,\n };\n}\n"],"mappings":";;AAiCA,SAAS,EAAkB,GAAsC;AAC/D,MAAK,IAAI,IAAI,GAAG,IAAI,EAAM,QAAQ,IAAK,KAAI,CAAC,EAAM,GAAG,SAAU,QAAO;AACtE,QAAO;;AAGT,SAAS,EAAiB,GAAsC;AAC9D,MAAK,IAAI,IAAI,EAAM,SAAS,GAAG,KAAK,GAAG,IAAK,KAAI,CAAC,EAAM,GAAG,SAAU,QAAO;AAC3E,QAAO;;AAGT,SAAS,EAAiB,GAA8B,GAAsB;CAC5E,IAAM,IAAI,EAAM;AAChB,MAAK,IAAI,IAAI,GAAG,KAAK,GAAG,KAAK;EAC3B,IAAM,KAAK,IAAO,IAAI,KAAK;AAC3B,MAAI,CAAC,EAAM,GAAG,SAAU,QAAO;;AAEjC,QAAO;;AAGT,SAAS,EAAiB,GAA8B,GAAsB;CAC5E,IAAM,IAAI,EAAM;AAChB,MAAK,IAAI,IAAI,GAAG,KAAK,GAAG,KAAK;EAC3B,IAAM,KAAK,IAAO,IAAI,KAAK;AAC3B,MAAI,CAAC,EAAM,GAAG,SAAU,QAAO;;AAEjC,QAAO;;AAsBT,SAAgB,EACd,GACmB;CACnB,IAAM,EAAE,UAAO,kBAAe,eAAY,kBAAe,GACnD,IAAU,EAAiB,KAAK,EAEhC,IAAe,EAAQ,gBAAgB,EAAkB,EAAM,EAE/D,KAAa,MAAwB;EACzC,IAAM,IAAO,EAAQ;AAChB,OACY,EAAK,iBAA8B,IAAI,IACxD,CAAS,IAAQ,OAAO;;AAoC1B,QAAO;EACL;EACA,cAAc,MAAmB,MAAU,IAAe,IAAI;EAC9D,YApCiB,OAAmB,MAA6C;GACjF,IAAI,IAAY;AAChB,WAAQ,EAAE,KAAV;IACE,KAAK;IACL,KAAK;AACH,SAAY,EAAiB,GAAO,EAAM;AAC1C;IACF,KAAK;IACL,KAAK;AACH,SAAY,EAAiB,GAAO,EAAM;AAC1C;IACF,KAAK;AACH,SAAY,EAAkB,EAAM;AACpC;IACF,KAAK;AACH,SAAY,EAAiB,EAAM;AACnC;IACF,KAAK;IACL,KAAK;AACH,KAAI,MACF,EAAE,gBAAgB,EAClB,EAAW,EAAM;AAEnB;IACF,QACE;;AAEA,OAAY,KAAK,MAAc,MACnC,EAAE,gBAAgB,EAClB,IAAa,EAAU,EACvB,EAAU,EAAU;;EAOrB"}
1
+ {"version":3,"file":"useRovingTabIndex-DBZtq4IH.js","names":[],"sources":["../../src/useRovingTabIndex.ts"],"sourcesContent":["import { useRef, type KeyboardEvent as ReactKeyboardEvent, type RefObject } from 'react';\n\n/** The only thing the hook needs to know about a bar's items: which are\n * skipped by arrow navigation. */\nexport type RovingItem = { disabled?: boolean };\n\n/** Options for {@link useRovingTabIndex}. */\nexport type UseRovingTabIndexOptions = {\n /** In the same order as the elements carrying `itemClassName`. */\n items: readonly RovingItem[];\n /** Class on the focusable element of each item, inside the container the\n * returned `rootRef` is attached to. Their DOM order must match `items`. */\n itemClassName: string;\n /** Index that carries `tabIndex=0`. Defaults to the first enabled item; a\n * radiogroup-style bar passes its selected index so Tab lands on the\n * current value. */\n tabStopIndex?: number;\n /** Called with the new index as arrow/Home/End focus moves, before focus\n * moves. This is where a selection-follows-focus bar commits the value. */\n onNavigate?: (index: number) => void;\n /** Space/Enter on the item at `index`. When omitted the keypress is left\n * alone, which on a native `<button>` produces an ordinary click. */\n onActivate?: (index: number) => void;\n};\n\n/**\n * What {@link useRovingTabIndex} returns: a container ref plus the per-item\n * `tabIndex` and `onKeyDown` values to spread onto each item.\n */\nexport type RovingTabIndex<T extends HTMLElement = HTMLDivElement> = {\n /** Attach to the container element that holds the items. */\n rootRef: RefObject<T | null>;\n /** `tabIndex` value for the item at `index`. */\n tabIndexFor: (index: number) => 0 | -1;\n /** `onKeyDown` for the item at `index`. */\n onKeyDown: (index: number) => (e: ReactKeyboardEvent<HTMLElement>) => void;\n};\n\nfunction firstEnabledIndex(items: readonly RovingItem[]): number {\n for (let i = 0; i < items.length; i++) if (!items[i].disabled) return i;\n return -1;\n}\n\nfunction lastEnabledIndex(items: readonly RovingItem[]): number {\n for (let i = items.length - 1; i >= 0; i--) if (!items[i].disabled) return i;\n return -1;\n}\n\nfunction nextEnabledIndex(items: readonly RovingItem[], from: number): number {\n const n = items.length;\n for (let k = 1; k <= n; k++) {\n const i = (from + k + n) % n;\n if (!items[i].disabled) return i;\n }\n return from;\n}\n\nfunction prevEnabledIndex(items: readonly RovingItem[], from: number): number {\n const n = items.length;\n for (let k = 1; k <= n; k++) {\n const i = (from - k + n) % n;\n if (!items[i].disabled) return i;\n }\n return from;\n}\n\n/**\n * Roving tabindex for a bar of items: one item is in the tab order, and the\n * arrow keys move focus among the rest, skipping disabled ones and wrapping\n * at both ends. Home and End go to the first and last enabled item. Both axes\n * navigate, so the same bar works laid out either way.\n *\n * Backs `ActionsBar`, `OptionsBar`, and `ToggleBar`.\n *\n * **When a bar should not use this.** Only when the bar owns its items. A\n * container of arbitrary compound controls — a number field, a select, a\n * color field — must leave the arrow keys alone, because those controls edit\n * their own value with them; taking the arrows over would break the control\n * to navigate between controls. `ToolOptionsBar` is that case and keeps plain\n * DOM tab order. A bar whose items are all simple buttons is the case this\n * hook is for.\n *\n * With every item disabled there is no tab stop and the bar drops out of the\n * tab order entirely.\n */\nexport function useRovingTabIndex<T extends HTMLElement = HTMLDivElement>(\n options: UseRovingTabIndexOptions,\n): RovingTabIndex<T> {\n const { items, itemClassName, onNavigate, onActivate } = options;\n const rootRef = useRef<T | null>(null);\n\n const tabStopIndex = options.tabStopIndex ?? firstEnabledIndex(items);\n\n const focusItem = (index: number): void => {\n const root = rootRef.current;\n if (!root) return;\n const elements = root.querySelectorAll<HTMLElement>(`.${itemClassName}`);\n elements[index]?.focus();\n };\n\n const onKeyDown = (index: number) => (e: ReactKeyboardEvent<HTMLElement>): void => {\n let nextIndex = -1;\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n nextIndex = prevEnabledIndex(items, index);\n break;\n case 'ArrowRight':\n case 'ArrowDown':\n nextIndex = nextEnabledIndex(items, index);\n break;\n case 'Home':\n nextIndex = firstEnabledIndex(items);\n break;\n case 'End':\n nextIndex = lastEnabledIndex(items);\n break;\n case ' ':\n case 'Enter':\n if (onActivate) {\n e.preventDefault();\n onActivate(index);\n }\n return;\n default:\n return;\n }\n if (nextIndex < 0 || nextIndex === index) return;\n e.preventDefault();\n onNavigate?.(nextIndex);\n focusItem(nextIndex);\n };\n\n return {\n rootRef,\n tabIndexFor: (index: number) => (index === tabStopIndex ? 0 : -1),\n onKeyDown,\n };\n}\n"],"mappings":";;AAsCA,SAAS,EAAkB,GAAsC;AAC/D,MAAK,IAAI,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MACF,EAAE,gBAAgB,EAClB,EAAW,EAAM;AAEnB;IACF,QACE;;AAEA,OAAY,KAAK,MAAc,MACnC,EAAE,gBAAgB,EAClB,IAAa,EAAU,EACvB,EAAU,EAAU;;EAOrB"}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * A chroma envelope over lightness, as three linear segments: flat at `cBot`
3
+ * below `lRange[0]`, rising to `cPeak` at `midL`, falling to `cTop` at
4
+ * `lRange[1]`, flat beyond. Keeps a color ramp inside gamut at the light and
5
+ * dark ends while staying saturated through the middle.
6
+ */
1
7
  export type ChromaCurve = {
2
8
  lRange: [number, number];
3
9
  midL: number;
@@ -5,10 +11,16 @@ export type ChromaCurve = {
5
11
  cPeak: number;
6
12
  cTop: number;
7
13
  };
14
+ /** A single lightness/chroma sample. */
8
15
  export type ChromaCurvePoint = {
9
16
  L: number;
10
17
  C: number;
11
18
  };
19
+ /**
20
+ * Converts an OKLCH color to a gamut-clipped `#rrggbb` string. Hue is in
21
+ * degrees, unlike the kit's OKLab helpers which take radians.
22
+ */
12
23
  export declare function oklchToHex(L: number, C: number, Hdeg: number): string;
24
+ /** Evaluates a {@link ChromaCurve} at a lightness, clamping outside its range. */
13
25
  export declare function chromaAt(L: number, curve: ChromaCurve): number;
14
26
  //# sourceMappingURL=oklch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oklch.d.ts","sourceRoot":"","sources":["../../src/color/oklch.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMrE;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,CAM9D"}
1
+ {"version":3,"file":"oklch.d.ts","sourceRoot":"","sources":["../../src/color/oklch.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wCAAwC;AACxC,MAAM,MAAM,gBAAgB,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMrE;AAED,kFAAkF;AAClF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,CAM9D"}
@@ -1,4 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
+ /** Props for {@link ActionBar}. */
2
3
  export interface ActionBarProps {
3
4
  /** Group key — only actions with `action.group === group` are rendered. */
4
5
  group: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBar.d.ts","sourceRoot":"","sources":["../../../src/components/ActionBar/ActionBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAc7D,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAClC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAaD;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAkE9C"}
1
+ {"version":3,"file":"ActionBar.d.ts","sourceRoot":"","sources":["../../../src/components/ActionBar/ActionBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAc7D,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAClC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAaD;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAkE9C"}
@@ -1,4 +1,8 @@
1
1
  import { type ReactElement, type ReactNode } from 'react';
2
+ /**
3
+ * One button in an {@link ActionsBar}. `value` is only a React key; the item
4
+ * carries no selected state.
5
+ */
2
6
  export type ActionsBarItem<V extends string | number = string> = {
3
7
  value: V;
4
8
  label?: ReactNode;
@@ -6,8 +10,11 @@ export type ActionsBarItem<V extends string | number = string> = {
6
10
  disabled?: boolean;
7
11
  onAction: () => void;
8
12
  };
13
+ /** Segment height and type scale for an {@link ActionsBar}. */
9
14
  export type ActionsBarSize = 'sm' | 'md';
15
+ /** Visual treatment of an {@link ActionsBar}. */
10
16
  export type ActionsBarVariant = 'default' | 'minimal';
17
+ /** Props for {@link ActionsBar}. */
11
18
  export type ActionsBarProps<V extends string | number = string> = {
12
19
  items: readonly ActionsBarItem<V>[];
13
20
  ariaLabel?: string;
@@ -16,5 +23,13 @@ export type ActionsBarProps<V extends string | number = string> = {
16
23
  size?: ActionsBarSize;
17
24
  variant?: ActionsBarVariant;
18
25
  };
26
+ /**
27
+ * Segmented strip of momentary buttons — each press fires and nothing stays
28
+ * selected. Shares the look and the arrow-key navigation of `ToggleBar` and
29
+ * `OptionsBar`.
30
+ *
31
+ * This is a plain callback bar. For buttons driven by the kit's actions
32
+ * registry, use `ActionBar` instead.
33
+ */
19
34
  export declare function ActionsBar<V extends string | number = string>(props: ActionsBarProps<V>): ReactElement;
20
35
  //# sourceMappingURL=ActionsBar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActionsBar.d.ts","sourceRoot":"","sources":["../../../src/components/ActionsBar/ActionsBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI9E,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,IAAI;IAC/D,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAAC;AAEtD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,IAAI;IAChE,KAAK,EAAE,SAAS,c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EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,YAAY,CA8CtG"}
@@ -44,7 +44,21 @@ type BadgePropsByShape = {
44
44
  shapeParams?: BadgeShapeParams[S];
45
45
  };
46
46
  }[BadgeShape];
47
+ /**
48
+ * Props for {@link Badge}. Discriminated on `shape` so `shapeParams` is typed
49
+ * to the chosen shape's own parameters.
50
+ */
47
51
  export type BadgeProps = BadgePropsByShape;
52
+ /**
53
+ * A small labelled chip. Renders as a `<span>`, or as a `<button>`/`<a>` when
54
+ * given `onClick`/`href` — override with `as`.
55
+ *
56
+ * Beyond the built-in {@link BadgeShape} silhouettes, a badge can be composed:
57
+ * `base` picks the underlying outline and `effects` layer perimeter treatments
58
+ * over it, which stack additively. `bloat` pushes the whole silhouette outward
59
+ * along its normals before effects run, and `crawl` animates perimeter
60
+ * patterns.
61
+ */
48
62
  export declare function Badge(props: BadgeProps): import("react/jsx-runtime").JSX.Element;
49
63
  export {};
50
64
  //# sourceMappingURL=Badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuD,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAEhH,OAAO,EAAU,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAS,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAW,KAAK,UAAU,EAAoB,MAAM,WAAW,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE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,aAAa,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,KAAK,iBAAiB,GAAG;KACtB,CAAC,IAAI,UAAU,GAAG,cAAc,GAAG;QAAE,KAAK,CAAC,EAAE,CAAC,CAAC;QAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;KAAE;CACrF,CAAC,UAAU,CAAC,CAAC;AAEd;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAS3C;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,2CAqQtC"}
@@ -1,6 +1,14 @@
1
+ /**
2
+ * Shapes one vertical edge of a badge base. Given a position down the edge
3
+ * (`t`, 0 at the top to 1 at the bottom) and the configured depth in CSS px,
4
+ * returns the horizontal displacement of that point, positive to the right.
5
+ */
1
6
  export type EdgeProfile = (t: number, depth: number) => number;
7
+ /** The named edge profiles in {@link EDGE_PROFILES}. */
2
8
  export type BuiltInEdgeName = 'flat' | 'chevron' | 'slant' | 'slant-up' | 'round' | 'scallop' | 'concave-chevron';
9
+ /** An edge profile, either by name or as a function. */
3
10
  export type EdgeCap = BuiltInEdgeName | EdgeProfile;
11
+ /** The built-in {@link EdgeProfile} implementations, by name. */
4
12
  export declare const EDGE_PROFILES: Record<BuiltInEdgeName, EdgeProfile>;
5
13
  export declare function resolveEdge(cap: EdgeCap): EdgeProfile;
6
14
  //# sourceMappingURL=edgeProfiles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"edgeProfiles.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/edgeProfiles.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;AAE/D,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,SAAS,GACT,OAAO,GACP,UAAU,GACV,OAAO,GACP,SAAS,GACT,iBAAiB,CAAC;AAEtB,MAAM,MAAM,OAAO,GAAG,eAAe,GAAG,WAAW,CAAC;AAEpD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,eAAe,EAAE,WAAW,CAQ9D,CAAC;AAEF,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CAGrD"}
1
+ {"version":3,"file":"edgeProfiles.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/edgeProfiles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;AAE/D,wDAAwD;AACxD,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,SAAS,GACT,OAAO,GACP,UAAU,GACV,OAAO,GACP,SAAS,GACT,iBAAiB,CAAC;AAEtB,wDAAwD;AACxD,MAAM,MAAM,OAAO,GAAG,eAAe,GAAG,WAAW,CAAC;AAEpD,iEAAiE;AACjE,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,eAAe,EAAE,WAAW,CAQ9D,CAAC;AAEF,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CAGrD"}
@@ -1,7 +1,18 @@
1
1
  import type { ReactNode } from 'react';
2
+ /**
3
+ * Built-in badge silhouettes. `pill`, `plain` and `square` are drawn in CSS;
4
+ * the rest are SVG outlines, several of which route through the compose
5
+ * pipeline (a base shape plus perimeter effects).
6
+ */
2
7
  export type BadgeShape = 'pill' | 'plain' | 'square' | 'notched' | 'perforated' | 'hexagon' | 'starburst' | 'scalloped' | 'shield' | 'ribbon' | 'beavis' | 'sparkler' | 'postage' | 'cloud' | 'house' | 'plaque' | 'crest' | 'urn' | 'coffin' | 'receipt' | 'wood' | 'quatrefoil';
8
+ /**
9
+ * Semantic color of a badge. `custom` paints from the `--badge-edge` custom
10
+ * property instead of a theme token, so a call site can supply its own color.
11
+ */
3
12
  export type BadgeTone = 'accent' | 'info' | 'warn' | 'danger' | 'muted' | 'neutral' | 'custom';
13
+ /** How a badge's tone is applied: outline only, filled, or a soft tinted fill. */
4
14
  export type BadgeVariant = 'outline' | 'solid' | 'subtle';
15
+ /** Badge type scale and padding step. */
5
16
  export type BadgeSize = 'sm' | 'md';
6
17
  export interface ShapeRenderProps<P = Record<string, never>> {
7
18
  variant: BadgeVariant;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,UAAU,GAClB,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,GACtD,SAAS,GACT,WAAW,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAC1D,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GACrD,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,CAAC;AAEnE,MAAM,MAAM,SAAS,GACjB,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE3E,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAC1D,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpC,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IACzD,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,CAAC,CAAC;IACV,0FAA0F;IAC1F,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;I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,CAAC;IAC1C,MAAM,EAAE,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,WAAW,CAAC,CAAC;IACnD,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,CAAC;CACd"}
@@ -0,0 +1,56 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ import { type BandScale } from './scale';
3
+ import { type Band } from './bands';
4
+ export type { Band, BandScale };
5
+ export interface BandEditorProps<T> {
6
+ /** Ascending by `from`. `value[0].from` is normalized to `min` on read. */
7
+ value: Band<T>[];
8
+ /** Live during a drag — wire for preview, do not write to history. */
9
+ onInput?: (next: Band<T>[]) => void;
10
+ /** Committed at gesture end: one call per gesture. */
11
+ onChange: (next: Band<T>[]) => void;
12
+ min: number;
13
+ max: number;
14
+ /** Default `'log'`. */
15
+ scale?: 'linear' | 'log' | BandScale;
16
+ ticks?: {
17
+ at: number;
18
+ label?: ReactNode;
19
+ }[];
20
+ /** Snap a dragged seam to a tick within ~6px. Default true; `alt` defeats it per-drag. */
21
+ snap?: boolean;
22
+ renderBand?: (band: Band<T>, index: number) => ReactNode;
23
+ selectedIndex?: number | null;
24
+ onSelect?: (index: number) => void;
25
+ /** Payload for a band split off an existing one. Default duplicates `from`. */
26
+ splitBand?: (at: number, from: T) => T;
27
+ label?: ReactNode;
28
+ className?: string;
29
+ }
30
+ /**
31
+ * Divides a numeric axis into contiguous bands and lets you drag the seams
32
+ * between them. Each band carries a payload the consumer supplies and
33
+ * renders through `renderBand`; the control itself knows nothing about what
34
+ * a band means.
35
+ *
36
+ * The axis is always fully covered — N bands, N−1 interior seams, no gaps and
37
+ * no overlaps — so editing is editing a sorted list of seam positions. Seams
38
+ * clamp at their neighbours rather than crossing, which means a drag can
39
+ * never destroy a band: removal is only ever the explicit `x` / `Delete`
40
+ * merge. The first band is doubly exceptional, its left edge pinned to `min`
41
+ * and its body immovable, and it has no left neighbour to merge into.
42
+ *
43
+ * | Gesture | Effect |
44
+ * |---|---|
45
+ * | drag a seam | resize the two bands either side |
46
+ * | drag a band body | move both its seams, preserving its span |
47
+ * | click the ruler | split the band under the pointer |
48
+ * | `x` / `Delete` | merge the selected band into its left neighbour |
49
+ * | click a band | select it |
50
+ * | `←` `→` on a focused seam | move it by one step; `shift` for ten |
51
+ *
52
+ * `scale` defaults to `'log'`, because the interesting part of a width axis
53
+ * is usually its narrow end.
54
+ */
55
+ export declare function BandEditor<T>(props: BandEditorProps<T>): ReactElement;
56
+ //# sourceMappingURL=BandEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BandEditor.d.ts","sourceRoot":"","sources":["../../../src/components/BandEditor/BandEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAWL,KAAK,IAAI,EACV,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAEhC,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,2EAA2E;IAC3E,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACjB,sEAAsE;IACtE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC;IACpC,sDAAsD;IACtD,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,uBAAuB;IACvB,KAAK,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;IACrC,KAAK,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,SAAS,CAAA;KAAE,EAAE,CAAC;IAC5C,0FAA0F;IAC1F,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IACzD,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,+EAA+E;IAC/E,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;IACvC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgBD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,YAAY,CAqMrE"}
@@ -0,0 +1,45 @@
1
+ import type { BandScale } from './scale';
2
+ export interface Band<T> {
3
+ /** Domain value where this band starts. The first band's is normalized to `min`. */
4
+ from: number;
5
+ data: T;
6
+ }
7
+ /**
8
+ * A band list covers `[min, max]` exactly: N bands, N−1 interior seams, no
9
+ * gaps and no overlaps. Seam *k* is `bands[k + 1].from`, and lives between
10
+ * `bands[k].from` and the start of the band after next (or `max`).
11
+ *
12
+ * Every function here preserves that. Each returns the array it was given
13
+ * when the edit would be a no-op, so callers can skip a callback with `===`.
14
+ */
15
+ /** Pins the first band's start to `min`; leaves the rest alone. */
16
+ export declare function normalizeBands<T>(value: readonly Band<T>[], min: number): Band<T>[];
17
+ /** `[from, to]` of band `index` in domain space. */
18
+ export declare function bandBounds<T>(bands: readonly Band<T>[], index: number, min: number, max: number): [number, number];
19
+ /** How far seam `index` can travel before it would cross a neighbour. */
20
+ export declare function seamBounds<T>(bands: readonly Band<T>[], index: number, min: number, max: number): [number, number];
21
+ /** Clamps a target position for seam `index` to its neighbours, inclusive. */
22
+ export declare function clampSeamTo<T>(bands: readonly Band<T>[], index: number, to: number, min: number, max: number): number;
23
+ export declare function setSeam<T>(bands: readonly Band<T>[], index: number, to: number): Band<T>[];
24
+ /** Band edges as track positions: `length + 1` values from 0 to 1. */
25
+ export declare function unitEdges<T>(bands: readonly Band<T>[], scale: BandScale, min: number, max: number): number[];
26
+ /**
27
+ * Largest part of `shift` band `index` can take without pushing a neighbour's
28
+ * far edge past it. Zero for the first and last band, whose outer edges are
29
+ * `min` and `max` and do not move.
30
+ */
31
+ export declare function clampBandShift(edges: readonly number[], index: number, shift: number): number;
32
+ /** Moves both edges of band `index`, which is the same as moving two seams. */
33
+ export declare function moveBandEdges<T>(bands: readonly Band<T>[], index: number, from: number, to: number): Band<T>[];
34
+ /**
35
+ * Splits the band containing `at` in two, the new band starting there.
36
+ * A position already on a seam or on `min` / `max` splits nothing.
37
+ */
38
+ export declare function splitBands<T>(bands: readonly Band<T>[], at: number, min: number, max: number, makeData: (at: number, from: T) => T): Band<T>[];
39
+ /**
40
+ * Merges band `index` into its left neighbour, which keeps its payload and
41
+ * absorbs the span. The first band has no left neighbour and cannot be
42
+ * merged away — a partition always has at least one part.
43
+ */
44
+ export declare function mergeBand<T>(bands: readonly Band<T>[], index: number): Band<T>[];
45
+ //# sourceMappingURL=bands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bands.d.ts","sourceRoot":"","sources":["../../../src/components/BandEditor/bands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,MAAM,WAAW,IAAI,CAAC,CAAC;IACrB,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;CACT;AAED;;;;;;;GAOG;AAEH,mEAAmE;AACnE,wBAAgB,cAAc,CAAC,CAAC,E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,EAAE,MAAM,GAAG,MAAM,CAO7F;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,SAAS,IAAI,CAAC,CAAC,CAAC,EAAE,EACzB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT,IAAI,CAAC,CAAC,CAAC,EAAE,CAKX;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1B,KAAK,EAAE,SAAS,IAAI,CAAC,CAAC,CAAC,EAAE,EACzB,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,GACnC,IAAI,CAAC,CAAC,CAAC,EAAE,CAcX;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAGhF"}
@@ -0,0 +1,4 @@
1
+ export { BandEditor } from './BandEditor';
2
+ export type { Band, BandEditorProps, BandScale } from './BandEditor';
3
+ export { linearScale, logScale } from './scale';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BandEditor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { n as e, r as t, t as n } from "../../chunks/BandEditor-13K91O9M.js";
2
+ export { n as BandEditor, e as linearScale, t as logScale };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Maps a domain value onto its position along the track, and back.
3
+ *
4
+ * Deliberately narrow — two functions over an explicit `[min, max]` — rather
5
+ * than a general scale type for the package. `Plot2D`, `CurveEditor` and
6
+ * `@weasel-js/core` each already use "scale" or "domain" to mean something
7
+ * else; generalizing is a job for a second consumer that needs one.
8
+ */
9
+ export interface BandScale {
10
+ /** Domain → position in [0,1]. Must be monotonic increasing. */
11
+ toUnit(value: number, min: number, max: number): number;
12
+ /** Inverse of `toUnit`. */
13
+ fromUnit(unit: number, min: number, max: number): number;
14
+ }
15
+ export declare function clamp01(u: number): number;
16
+ /** Even domain steps take even track steps. */
17
+ export declare const linearScale: BandScale;
18
+ /** Even *ratios* take even track steps. Requires `min > 0`. */
19
+ export declare const logScale: BandScale;
20
+ /**
21
+ * Resolves the `scale` prop, substituting `linearScale` for a `logScale`
22
+ * that `min` would send to `NaN`.
23
+ */
24
+ export declare function resolveScale(scale: 'linear' | 'log' | BandScale | undefined, min: number): BandScale;
25
+ //# sourceMappingURL=scale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../src/components/BandEditor/scale.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,SAAS;IACxB,gEAAgE;IAChE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACxD,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1D;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED,+CAA+C;AAC/C,eAAO,MAAM,WAAW,EAAE,SAGzB,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,EAAE,SAUtB,CAAC;AAQF;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,EAC/C,GAAG,EAAE,MAAM,GACV,SAAS,CAkBX"}
@@ -1,5 +1,7 @@
1
1
  import { type ButtonHTMLAttributes, type ReactNode } from 'react';
2
+ /** Visual weight of a button. Defaults to `secondary`. */
2
3
  export type ButtonVariant = 'primary' | 'secondary' | 'ghost';
4
+ /** Button height and type scale. */
3
5
  export type ButtonSize = 'sm' | 'md';
4
6
  type ButtonBase = {
5
7
  variant?: ButtonVariant;
@@ -23,7 +25,18 @@ type ButtonIconOnly = ButtonBase & {
23
25
  iconOnly: true;
24
26
  ariaLabel: string;
25
27
  };
28
+ /**
29
+ * Props for {@link Button}. Setting `iconOnly` makes `ariaLabel` required,
30
+ * since an icon-only button has no text for a screen reader to announce.
31
+ */
26
32
  export type ButtonProps = ButtonRegular | ButtonIconOnly;
33
+ /**
34
+ * Standard button. `loading` swaps the leading icon for a spinner, marks the
35
+ * button `aria-busy`, and leaves the label in place; it does not disable the
36
+ * button, so pass `disabled` too if the click should be blocked.
37
+ *
38
+ * `ref` forwards to the underlying `<button>`.
39
+ */
27
40
  export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
28
41
  export {};
29
42
  //# sourceMappingURL=Button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAGxF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;AAC9D,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,KAAK,UAAU,GAAG;IAChB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,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,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC;IACzD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC;CAC9D,CAAC;AAEF,KAAK,aAAa,GAAG,UAAU,GAAG;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,cAAc,GAAG,UAAU,GAAG;IACjC,QAAQ,EAAE,IAAI,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AA2BzD;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,2GA2DjB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { type ReactNode, type RefObject } from 'react';
2
2
  import { DialogTrigger, type PopoverProps as RACPopoverProps } from 'react-aria-components';
3
+ /** Accent color of a {@link Callout}'s border and arrow. */
3
4
  export type CalloutTone = 'info' | 'warning' | 'danger';
4
5
  /**
5
6
  * Composition wrapper for press-to-open callouts:
@@ -10,6 +11,7 @@ export type CalloutTone = 'info' | 'warning' | 'danger';
10
11
  * RAC detaches to local open state on the trigger, not the popover.
11
12
  */
12
13
  export { DialogTrigger as CalloutTrigger };
14
+ /** Props for {@link Callout}, on top of React Aria's `Popover` props. */
13
15
  export type CalloutProps = Omit<RACPopoverProps, 'children' | 'className' | 'isNonModal' | 'triggerRef'> & {
14
16
  children?: ReactNode;
15
17
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../../../src/components/Callout/Callout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9F,OAAO,EACL,aAAa,EAKb,KAAK,YAAY,IAAI,eAAe,EACrC,MAAM,uBAAuB,CAAC;AAG/B,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExD;;;;;;;GAOG;AACH,OAAO,EAAE,aAAa,IAAI,cAAc,EAAE,CAAC;AAE3C,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,eAAe,EACf,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,CACvD,GAAG;IACF,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,sDAAsD;IACtD,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,wEAAwE;IACxE,UAAU,CAAC,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IACvC;;;;;OAKG;IACH,UAAU,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACtE,CAAC;AAQF;;;;;GAKG;AACH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AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,2CA2I1C"}
@@ -1,5 +1,9 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type CheckboxProps as RACCheckboxProps } from 'react-aria-components';
3
+ /**
4
+ * Props for {@link Checkbox}, on top of React Aria's `Checkbox` props. The
5
+ * label is passed as children.
6
+ */
3
7
  export type CheckboxProps = Omit<RACCheckboxProps, 'children' | 'className'> & {
4
8
  children?: ReactNode;
5
9
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAC7D,OAAO,EAEL,KAAK,aAAa,IAAI,gBAAgB,EACvC,MAAM,uBAAuB,CAAC;AAG/B,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,WAAW,CAAC,GAAG;IAC7E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ;eARR,SAAS;gBACR,MAAM;oDAyClB,CAAC"}
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAC7D,OAAO,EAEL,KAAK,aAAa,IAAI,gBAAgB,EACvC,MAAM,uBAAuB,CAAC;AAG/B;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,WAAW,CAAC,GAAG;IAC7E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ;eARR,SAAS;gBACR,MAAM;oDAyClB,CAAC"}
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Props for {@link ColorField}. `onInput` fires throughout a gesture and
3
+ * `onChange` once at its end.
4
+ */
1
5
  export interface ColorFieldProps {
2
6
  /** Current color, `#rrggbb` or `#rrggbbaa`. Omit when `mixed`. */
3
7
  value?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ColorField.d.ts","sourceRoot":"","sources":["../../../src/components/ColorField/ColorField.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;8BAI0B;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;uEACmE;IACnE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC;yDACqD;IACrD,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CA4EhD"}
1
+ {"version":3,"file":"ColorField.d.ts","sourceRoot":"","sources":["../../../src/components/ColorField/ColorField.tsx"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;8BAI0B;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;uEACmE;IACnE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC;yDACqD;IACrD,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CA4EhD"}
@@ -1,5 +1,10 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { type ComboBoxProps as RACComboBoxProps, type ListBoxItemProps as RACListBoxItemProps, type ValidationResult } from 'react-aria-components';
3
+ /**
4
+ * One option in a {@link ComboBox}'s `options` list. `textValue` is the
5
+ * plain-text form used for filtering and screen readers, needed only when
6
+ * `label` isn't a bare string.
7
+ */
3
8
  export type ComboBoxOption = {
4
9
  value: string;
5
10
  label: ReactNode;
@@ -7,6 +12,10 @@ export type ComboBoxOption = {
7
12
  isDisabled?: boolean;
8
13
  };
9
14
  type Key = string | number;
15
+ /**
16
+ * Props for {@link ComboBox}, on top of React Aria's `ComboBox` props, with
17
+ * the selection key narrowed to the option value type.
18
+ */
10
19
  export type ComboBoxProps<T extends Key = string> = Omit<RACComboBoxProps<object>, 'children' | 'className' | 'selectedKey' | 'defaultSelectedKey' | 'onSelectionChange'> & {
11
20
  label?: ReactNode;
12
21
  description?: ReactNode;
@@ -28,9 +37,11 @@ export type ComboBoxProps<T extends Key = string> = Omit<RACComboBoxProps<object
28
37
  * is in the input, selection clears (key becomes null).
29
38
  */
30
39
  export declare function ComboBox<T extends Key = string>(props: ComboBoxProps<T>): import("react/jsx-runtime").JSX.Element;
40
+ /** Props for {@link ComboBoxItem}, on top of React Aria's `ListBoxItem` props. */
31
41
  export type ComboBoxItemProps = Omit<RACListBoxItemProps, 'className'> & {
32
42
  className?: string;
33
43
  };
44
+ /** One row in a {@link ComboBox}'s filtered list. */
34
45
  export declare function ComboBoxItem({ className, ...rest }: ComboBoxItemProps): import("react/jsx-runtime").JSX.Element;
35
46
  export {};
36
47
  //# sourceMappingURL=ComboBox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComboBox.d.ts","sourceRoot":"","sources":["../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