@epilot/zenith-react 0.2.0-next.6 → 0.2.0

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 (178) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_zenith-runtime-family_accordion.js +1 -1
  3. package/dist/_virtual/_zenith-runtime-family_alert-dialog.js +1 -1
  4. package/dist/_virtual/_zenith-runtime-family_avatar.js +1 -1
  5. package/dist/_virtual/_zenith-runtime-family_button.js +1 -1
  6. package/dist/_virtual/_zenith-runtime-family_checkbox.js +1 -1
  7. package/dist/_virtual/_zenith-runtime-family_csp-provider.js +1 -1
  8. package/dist/_virtual/_zenith-runtime-family_dialog.js +1 -1
  9. package/dist/_virtual/_zenith-runtime-family_direction-provider.js +1 -1
  10. package/dist/_virtual/_zenith-runtime-family_menu.js +1 -1
  11. package/dist/_virtual/_zenith-runtime-family_merge-props.js +1 -1
  12. package/dist/_virtual/_zenith-runtime-family_popover.js +1 -1
  13. package/dist/_virtual/_zenith-runtime-family_radio-group.js +1 -1
  14. package/dist/_virtual/_zenith-runtime-family_radio.js +1 -1
  15. package/dist/_virtual/_zenith-runtime-family_scroll-area.js +1 -1
  16. package/dist/_virtual/_zenith-runtime-family_select.js +1 -1
  17. package/dist/_virtual/_zenith-runtime-family_separator.js +1 -1
  18. package/dist/_virtual/_zenith-runtime-family_switch.js +1 -1
  19. package/dist/_virtual/_zenith-runtime-family_tabs.js +1 -1
  20. package/dist/_virtual/_zenith-runtime-family_toast.js +1 -1
  21. package/dist/_virtual/_zenith-runtime-family_toggle-group.js +1 -1
  22. package/dist/_virtual/_zenith-runtime-family_toggle.js +1 -1
  23. package/dist/_virtual/_zenith-runtime-family_tooltip.js +1 -1
  24. package/dist/_virtual/_zenith-runtime-family_use-render.js +1 -1
  25. package/dist/components/accordion/accordion.js +1 -1
  26. package/dist/components/accordion/accordion.js.map +1 -1
  27. package/dist/components/alert-dialog/alert-dialog.js +1 -1
  28. package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
  29. package/dist/components/appearance-boundary/appearance-boundary.js +1 -1
  30. package/dist/components/appearance-boundary/appearance-boundary.js.map +1 -1
  31. package/dist/components/avatar/avatar-group.js +1 -1
  32. package/dist/components/avatar/avatar-group.js.map +1 -1
  33. package/dist/components/avatar/avatar.js +1 -1
  34. package/dist/components/avatar/avatar.js.map +1 -1
  35. package/dist/components/badge/badge.js +1 -1
  36. package/dist/components/badge/badge.js.map +1 -1
  37. package/dist/components/breadcrumb/breadcrumb.js +1 -1
  38. package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
  39. package/dist/components/button/button.js +1 -1
  40. package/dist/components/button/button.js.map +1 -1
  41. package/dist/components/button-group/button-group.js +1 -1
  42. package/dist/components/button-group/button-group.js.map +1 -1
  43. package/dist/components/callout/callout.js +1 -1
  44. package/dist/components/callout/callout.js.map +1 -1
  45. package/dist/components/card/card.js +1 -1
  46. package/dist/components/card/card.js.map +1 -1
  47. package/dist/components/checkbox/checkbox.js +41 -39
  48. package/dist/components/checkbox/checkbox.js.map +1 -1
  49. package/dist/components/code-block/code-block.js +1 -1
  50. package/dist/components/code-block/code-block.js.map +1 -1
  51. package/dist/components/code-editor/code-editor.js +1 -1
  52. package/dist/components/code-editor/code-editor.js.map +1 -1
  53. package/dist/components/collapsible-sidebar/collapsible-sidebar.js +1 -1
  54. package/dist/components/collapsible-sidebar/collapsible-sidebar.js.map +1 -1
  55. package/dist/components/command/command.js +1 -1
  56. package/dist/components/command/command.js.map +1 -1
  57. package/dist/components/data-table/data-table-body.js +1 -1
  58. package/dist/components/data-table/data-table-body.js.map +1 -1
  59. package/dist/components/data-table/data-table-column-header.js +1 -1
  60. package/dist/components/data-table/data-table-column-header.js.map +1 -1
  61. package/dist/components/data-table/data-table-column-order.js +1 -1
  62. package/dist/components/data-table/data-table-column-order.js.map +1 -1
  63. package/dist/components/data-table/data-table-column-visibility.js +1 -1
  64. package/dist/components/data-table/data-table-column-visibility.js.map +1 -1
  65. package/dist/components/data-table/data-table-content.js +1 -1
  66. package/dist/components/data-table/data-table-content.js.map +1 -1
  67. package/dist/components/data-table/data-table-error.js +1 -1
  68. package/dist/components/data-table/data-table-error.js.map +1 -1
  69. package/dist/components/data-table/data-table-footer.js +1 -1
  70. package/dist/components/data-table/data-table-footer.js.map +1 -1
  71. package/dist/components/data-table/data-table-header-draggable.js +1 -1
  72. package/dist/components/data-table/data-table-header-draggable.js.map +1 -1
  73. package/dist/components/data-table/data-table-header.js +1 -1
  74. package/dist/components/data-table/data-table-header.js.map +1 -1
  75. package/dist/components/data-table/data-table-loading.js +1 -1
  76. package/dist/components/data-table/data-table-loading.js.map +1 -1
  77. package/dist/components/data-table/data-table-resize-handle.js +1 -1
  78. package/dist/components/data-table/data-table-resize-handle.js.map +1 -1
  79. package/dist/components/data-table/data-table-row.js +1 -1
  80. package/dist/components/data-table/data-table-row.js.map +1 -1
  81. package/dist/components/data-table/data-table-toolbar.js +1 -1
  82. package/dist/components/data-table/data-table-toolbar.js.map +1 -1
  83. package/dist/components/data-table/data-table.js +1 -1
  84. package/dist/components/data-table/data-table.js.map +1 -1
  85. package/dist/components/date-range-picker/date-range-picker.js +1 -1
  86. package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
  87. package/dist/components/date-range-picker/range-calendar.js +1 -1
  88. package/dist/components/date-range-picker/range-calendar.js.map +1 -1
  89. package/dist/components/date-time-picker/calendar.js +1 -1
  90. package/dist/components/date-time-picker/calendar.js.map +1 -1
  91. package/dist/components/date-time-picker/date-time-picker-input.js +1 -1
  92. package/dist/components/date-time-picker/date-time-picker-input.js.map +1 -1
  93. package/dist/components/date-time-picker/date-time-picker-panel.js +1 -1
  94. package/dist/components/date-time-picker/date-time-picker-panel.js.map +1 -1
  95. package/dist/components/date-time-picker/date-time-picker.js +1 -1
  96. package/dist/components/date-time-picker/date-time-picker.js.map +1 -1
  97. package/dist/components/date-time-picker/time-picker.js +1 -1
  98. package/dist/components/date-time-picker/time-picker.js.map +1 -1
  99. package/dist/components/density-provider/density-provider.js +1 -1
  100. package/dist/components/dialog/dialog.js +1 -1
  101. package/dist/components/dialog/dialog.js.map +1 -1
  102. package/dist/components/drawer/drawer.js +1 -1
  103. package/dist/components/drawer/drawer.js.map +1 -1
  104. package/dist/components/dropdown-menu/dropdown-menu.js +1 -1
  105. package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
  106. package/dist/components/field/field-combobox.js +1 -1
  107. package/dist/components/field/field-combobox.js.map +1 -1
  108. package/dist/components/field/field-select.js +1 -1
  109. package/dist/components/field/field-select.js.map +1 -1
  110. package/dist/components/field/field.js +1 -1
  111. package/dist/components/field/field.js.map +1 -1
  112. package/dist/components/label/label.js +1 -1
  113. package/dist/components/label/label.js.map +1 -1
  114. package/dist/components/list/list.js +1 -1
  115. package/dist/components/list/list.js.map +1 -1
  116. package/dist/components/option-card/option-card.js +1 -1
  117. package/dist/components/option-card/option-card.js.map +1 -1
  118. package/dist/components/pill/pill.js +1 -1
  119. package/dist/components/pill/pill.js.map +1 -1
  120. package/dist/components/popover/popover.js +1 -1
  121. package/dist/components/popover/popover.js.map +1 -1
  122. package/dist/components/radio/radio.js +15 -12
  123. package/dist/components/radio/radio.js.map +1 -1
  124. package/dist/components/scroll-area/scroll-area.js +1 -1
  125. package/dist/components/scroll-area/scroll-area.js.map +1 -1
  126. package/dist/components/scroll-area/scrollbar-styles.js +1 -1
  127. package/dist/components/scroll-area/scrollbar-styles.js.map +1 -1
  128. package/dist/components/scroll-overflow/scroll-overflow.js +1 -1
  129. package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
  130. package/dist/components/segmented-control/segmented-control.js +1 -1
  131. package/dist/components/segmented-control/segmented-control.js.map +1 -1
  132. package/dist/components/select/select.js +178 -176
  133. package/dist/components/select/select.js.map +1 -1
  134. package/dist/components/separator/separator.js +1 -1
  135. package/dist/components/separator/separator.js.map +1 -1
  136. package/dist/components/skeleton/skeleton.js +1 -1
  137. package/dist/components/skeleton/skeleton.js.map +1 -1
  138. package/dist/components/slot/compose-as-child.js +1 -1
  139. package/dist/components/slot/compose-as-child.js.map +1 -1
  140. package/dist/components/spinner/spinner.js +1 -1
  141. package/dist/components/spinner/spinner.js.map +1 -1
  142. package/dist/components/surface/surface.js +1 -1
  143. package/dist/components/surface/surface.js.map +1 -1
  144. package/dist/components/switch/switch.js +59 -57
  145. package/dist/components/switch/switch.js.map +1 -1
  146. package/dist/components/table/table-pagination.js +1 -1
  147. package/dist/components/table/table-pagination.js.map +1 -1
  148. package/dist/components/table/table.js +1 -1
  149. package/dist/components/table/table.js.map +1 -1
  150. package/dist/components/tabs/tabs.js +1 -1
  151. package/dist/components/tabs/tabs.js.map +1 -1
  152. package/dist/components/text/text.js +1 -1
  153. package/dist/components/text/text.js.map +1 -1
  154. package/dist/components/toast/toast.js +1 -1
  155. package/dist/components/toast/toast.js.map +1 -1
  156. package/dist/components/toggle/toggle-group.js +1 -1
  157. package/dist/components/toggle/toggle-group.js.map +1 -1
  158. package/dist/components/toggle/toggle.js +1 -1
  159. package/dist/components/toggle/toggle.js.map +1 -1
  160. package/dist/components/tooltip/tooltip.js +1 -1
  161. package/dist/components/tooltip/tooltip.js.map +1 -1
  162. package/dist/index.js +1 -1
  163. package/dist/lib/clear-button.js +1 -1
  164. package/dist/lib/clear-button.js.map +1 -1
  165. package/dist/lib/hidden-input-box.js +26 -0
  166. package/dist/lib/hidden-input-box.js.map +1 -0
  167. package/dist/packages/tokens/dist/delivery/index.js +1 -1
  168. package/dist/packages/tokens/dist/delivery/index.js.map +1 -1
  169. package/dist/packages/tokens/dist/install.js +1 -1
  170. package/dist/packages/tokens/dist/install.js.map +1 -1
  171. package/dist/renderer/served.js +1 -1
  172. package/dist/renderer/served.js.map +1 -1
  173. package/dist/styles/host-reset.js.map +1 -1
  174. package/dist/styles/make-styles.js +1 -1
  175. package/dist/styles/make-styles.js.map +1 -1
  176. package/dist/styles/text-box.js.map +1 -1
  177. package/dist/tokens.json +1 -1
  178. package/package.json +3 -4
@@ -1 +1 @@
1
- {"version":3,"file":"avatar-group.js","sources":["../../../src/components/avatar/avatar-group.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1/core\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\nimport {\n Avatar,\n AvatarGroupContext,\n type AvatarColor,\n type AvatarSize,\n} from \"./avatar\"\n\nconst useStyles = makeZenithStyles({\n root: {\n display: \"flex\",\n alignItems: \"center\",\n },\n item: {\n position: \"relative\",\n marginLeft: \"-0.5rem\",\n transitionProperty: \"transform\",\n transitionDuration: \"200ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \":first-child\": { marginLeft: \"0\" },\n },\n itemBeforeActive: {\n transform: \"translateX(-0.75rem)\",\n },\n itemAfterActive: {\n transform: \"translateX(0.75rem)\",\n },\n itemActive: {\n zIndex: 10,\n },\n overflow: {\n ...boxModel,\n position: \"relative\",\n zIndex: 0,\n ...shorthands.border(\"0\", \"solid\", \"transparent\"),\n cursor: \"pointer\",\n },\n overflowPanel: {\n ...boxModel,\n position: \"absolute\",\n top: \"100%\",\n left: \"0\",\n zIndex: 20,\n width: \"max-content\",\n maxWidth: \"20rem\",\n padding: tokens.spacingElement2,\n backgroundColor: tokens.body,\n borderRadius: tokens.radiusMd,\n boxShadow: \"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)\",\n },\n overflowList: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: tokens.spacingElement1,\n },\n overflowItem: {\n display: \"flex\",\n alignItems: \"center\",\n gap: tokens.spacingElement2,\n },\n overflowName: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n color: tokens.grayA11,\n },\n})\n\nexport type AvatarGroupProps = Omit<React.ComponentProps<\"div\">, \"color\"> & {\n max?: number\n size?: AvatarSize\n}\n\nexport const AvatarGroup = React.forwardRef<HTMLDivElement, AvatarGroupProps>(\n function AvatarGroup({ max, size, className, children, ...props }, ref) {\n const styles = useStyles()\n const items = React.Children.toArray(children).filter(React.isValidElement)\n const visible = typeof max === \"number\" ? items.slice(0, max) : items\n const overflow = items.length - visible.length\n const [active, setActive] = React.useState<number | null>(null)\n const [open, setOpen] = React.useState(false)\n\n return (\n <AvatarGroupContext.Provider value={{ size }}>\n <div\n ref={ref}\n data-slot=\"avatar-group\"\n {...{ [SLOT_ATTR]: \"avatar-group\" }}\n className={mergeClasses(styles.root, className)}\n {...props}\n >\n {visible.map((child, index) => (\n <div\n key={index}\n data-slot=\"avatar-group-item\"\n {...{ [SLOT_ATTR]: \"avatar-group-item\" }}\n onPointerEnter={() => setActive(index)}\n onPointerLeave={() =>\n setActive((current) => (current === index ? null : current))\n }\n onFocus={() => setActive(index)}\n onBlur={() =>\n setActive((current) => (current === index ? null : current))\n }\n className={mergeClasses(\n styles.item,\n active !== null && index < active && styles.itemBeforeActive,\n active !== null && index > active && styles.itemAfterActive,\n active === index && styles.itemActive\n )}\n >\n {child}\n </div>\n ))}\n {overflow > 0 && (\n <div\n data-slot=\"avatar-group-overflow-wrapper\"\n {...{ [SLOT_ATTR]: \"avatar-group-overflow-wrapper\" }}\n className={styles.item}\n >\n <Avatar\n size={size}\n color={\"gray\" as AvatarColor}\n initials={`+${overflow}`}\n aria-label={`${overflow} more`}\n role=\"button\"\n tabIndex={0}\n onClick={() => setOpen((current) => !current)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault()\n setOpen((current) => !current)\n }\n }}\n className={styles.overflow}\n />\n {open && (\n <div\n data-slot=\"avatar-group-overflow\"\n {...{ [SLOT_ATTR]: \"avatar-group-overflow\" }}\n className={styles.overflowPanel}\n >\n <ul className={styles.overflowList}>\n {items.map((item, index) => (\n <li key={index} className={styles.overflowItem}>\n {item}\n {React.isValidElement<{ alt?: string }>(item) &&\n item.props.alt && (\n <span className={styles.overflowName}>\n {item.props.alt}\n </span>\n )}\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n )}\n </div>\n </AvatarGroupContext.Provider>\n )\n }\n)\n"],"names":["useStyles","makeZenithStyles","boxModel","shorthands","tokens.spacingElement2","tokens.body","tokens.radiusMd","tokens.spacingElement1","tokens.textSm","tokens.leadingSm","tokens.grayA11","AvatarGroup","React","max","size","className","children","props","ref","styles","items","visible","overflow","active","setActive","open","setOpen","AvatarGroupContext","jsxs","SLOT_ATTR","mergeClasses","child","index","jsx","current","Avatar","event","item"],"mappings":";;;;;;;AAeA,MAAMA,IAAYC,EAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,EAAA;AAAA,EAEd,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,oBAAoB;AAAA,IACpB,oBAAoB;AAAA,IACpB,0BAA0B;AAAA,IAC1B,gBAAgB,EAAE,YAAY,IAAA;AAAA,EAAI;AAAA,EAEpC,kBAAkB;AAAA,IAChB,WAAW;AAAA,EAAA;AAAA,EAEb,iBAAiB;AAAA,IACf,WAAW;AAAA,EAAA;AAAA,EAEb,YAAY;AAAA,IACV,QAAQ;AAAA,EAAA;AAAA,EAEV,UAAU;AAAA,IACR,GAAGC;AAAA,IACH,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,GAAGC,EAAW,OAAO,KAAK,SAAS,aAAa;AAAA,IAChD,QAAQ;AAAA,EAAA;AAAA,EAEV,eAAe;AAAA,IACb,GAAGD;AAAA,IACH,UAAU;AAAA,IACV,KAAK;AAAA,IACL,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,UAAU;AAAA,IACV,SAASE;AAAAA,IACT,iBAAiBC;AAAAA,IACjB,cAAcC;AAAA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B,gBAAAJ,EAAC,MAAA,EAAe,WAAWT,EAAO,cAC/B,UAAA;AAAA,sBAAAkB;AAAA,sBACAzB,EAAM,eAAiCyB,CAAI,KAC1CA,EAAK,MAAM,OACT,gBAAAJ,EAAC,QAAA,EAAK,WAAWd,EAAO,cACrB,UAAAkB,EAAK,MAAM,IAAA,CACd;AAAA,oBAAA,EAAA,GANGL,CAQT,CACD,EAAA,CACH;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA,GAGN;AAAA,EAEJ;AACF;"}
1
+ {"version":3,"file":"avatar-group.js","sources":["../../../src/components/avatar/avatar-group.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\nimport {\n Avatar,\n AvatarGroupContext,\n type AvatarColor,\n type AvatarSize,\n} from \"./avatar\"\n\nconst useStyles = makeZenithStyles({\n root: {\n display: \"flex\",\n alignItems: \"center\",\n },\n item: {\n position: \"relative\",\n marginLeft: \"-0.5rem\",\n transitionProperty: \"transform\",\n transitionDuration: \"200ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \":first-child\": { marginLeft: \"0\" },\n },\n itemBeforeActive: {\n transform: \"translateX(-0.75rem)\",\n },\n itemAfterActive: {\n transform: \"translateX(0.75rem)\",\n },\n itemActive: {\n zIndex: 10,\n },\n overflow: {\n ...boxModel,\n position: \"relative\",\n zIndex: 0,\n ...shorthands.border(\"0\", \"solid\", \"transparent\"),\n cursor: \"pointer\",\n },\n overflowPanel: {\n ...boxModel,\n position: \"absolute\",\n top: \"100%\",\n left: \"0\",\n zIndex: 20,\n width: \"max-content\",\n maxWidth: \"20rem\",\n padding: tokens.spacingElement2,\n backgroundColor: tokens.body,\n borderRadius: tokens.radiusMd,\n boxShadow: \"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)\",\n },\n overflowList: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: tokens.spacingElement1,\n },\n overflowItem: {\n display: \"flex\",\n alignItems: \"center\",\n gap: tokens.spacingElement2,\n },\n overflowName: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n color: tokens.grayA11,\n },\n})\n\nexport type AvatarGroupProps = Omit<React.ComponentProps<\"div\">, \"color\"> & {\n max?: number\n size?: AvatarSize\n}\n\nexport const AvatarGroup = React.forwardRef<HTMLDivElement, AvatarGroupProps>(\n function AvatarGroup({ max, size, className, children, ...props }, ref) {\n const styles = useStyles()\n const items = React.Children.toArray(children).filter(React.isValidElement)\n const visible = typeof max === \"number\" ? items.slice(0, max) : items\n const overflow = items.length - visible.length\n const [active, setActive] = React.useState<number | null>(null)\n const [open, setOpen] = React.useState(false)\n\n return (\n <AvatarGroupContext.Provider value={{ size }}>\n <div\n ref={ref}\n data-slot=\"avatar-group\"\n {...{ [SLOT_ATTR]: \"avatar-group\" }}\n className={mergeClasses(styles.root, className)}\n {...props}\n >\n {visible.map((child, index) => (\n <div\n key={index}\n data-slot=\"avatar-group-item\"\n {...{ [SLOT_ATTR]: \"avatar-group-item\" }}\n onPointerEnter={() => setActive(index)}\n onPointerLeave={() =>\n setActive((current) => (current === index ? null : current))\n }\n onFocus={() => setActive(index)}\n onBlur={() =>\n setActive((current) => (current === index ? null : current))\n }\n className={mergeClasses(\n styles.item,\n active !== null && index < active && styles.itemBeforeActive,\n active !== null && index > active && styles.itemAfterActive,\n active === index && styles.itemActive\n )}\n >\n {child}\n </div>\n ))}\n {overflow > 0 && (\n <div\n data-slot=\"avatar-group-overflow-wrapper\"\n {...{ [SLOT_ATTR]: \"avatar-group-overflow-wrapper\" }}\n className={styles.item}\n >\n <Avatar\n size={size}\n color={\"gray\" as AvatarColor}\n initials={`+${overflow}`}\n aria-label={`${overflow} more`}\n role=\"button\"\n tabIndex={0}\n onClick={() => setOpen((current) => !current)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault()\n setOpen((current) => !current)\n }\n }}\n className={styles.overflow}\n />\n {open && (\n <div\n data-slot=\"avatar-group-overflow\"\n {...{ [SLOT_ATTR]: \"avatar-group-overflow\" }}\n className={styles.overflowPanel}\n >\n <ul className={styles.overflowList}>\n {items.map((item, index) => (\n <li key={index} className={styles.overflowItem}>\n {item}\n {React.isValidElement<{ alt?: string }>(item) &&\n item.props.alt && (\n <span className={styles.overflowName}>\n {item.props.alt}\n </span>\n )}\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n )}\n </div>\n </AvatarGroupContext.Provider>\n )\n }\n)\n"],"names":["useStyles","makeZenithStyles","boxModel","shorthands","tokens.spacingElement2","tokens.body","tokens.radiusMd","tokens.spacingElement1","tokens.textSm","tokens.leadingSm","tokens.grayA11","AvatarGroup","React","max","size","className","children","props","ref","styles","items","visible","overflow","active","setActive","open","setOpen","AvatarGroupContext","jsxs","SLOT_ATTR","mergeClasses","child","index","jsx","current","Avatar","event","item"],"mappings":";;;;;;;AAeA,MAAMA,IAAYC,EAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,EAAA;AAAA,EAEd,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,oBAAoB;AAAA,IACpB,oBAAoB;AAAA,IACpB,0BAA0B;AAAA,IAC1B,gBAAgB,EAAE,YAAY,IAAA;AAAA,EAAI;AAAA,EAEpC,kBAAkB;AAAA,IAChB,WAAW;AAAA,EAAA;AAAA,EAEb,iBAAiB;AAAA,IACf,WAAW;AAAA,EAAA;AAAA,EAEb,YAAY;AAAA,IACV,QAAQ;AAA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,SACzCA,EAAM,eAAA,GACNV,EAAQ,CAACQ,MAAY,CAACA,CAAO;AAAA,oBAEjC;AAAA,oBACA,WAAWf,EAAO;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAEnBM,KACC,gBAAAQ;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,aAAU;AAAA,oBACJ,CAACJ,CAAS,GAAG;AAAA,oBACnB,WAAWV,EAAO;AAAA,oBAElB,UAAA,gBAAAc,EAAC,MAAA,EAAG,WAAWd,EAAO,cACnB,UAAAC,EAAM,IAAI,CAACiB,GAAML,MAChB,gBAAAJ,EAAC,MAAA,EAAe,WAAWT,EAAO,cAC/B,UAAA;AAAA,sBAAAkB;AAAA,sBACAzB,EAAM,eAAiCyB,CAAI,KAC1CA,EAAK,MAAM,OACT,gBAAAJ,EAAC,QAAA,EAAK,WAAWd,EAAO,cACrB,UAAAkB,EAAK,MAAM,IAAA,CACd;AAAA,oBAAA,EAAA,GANGL,CAQT,CACD,EAAA,CACH;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA,GAGN;AAAA,EAEJ;AACF;"}
@@ -1,7 +1,7 @@
1
1
  import { jsxs as A, jsx as u } from "react/jsx-runtime";
2
2
  import * as d from "react";
3
3
  import { Avatar as i } from "../../_virtual/_zenith-runtime-family_avatar.js";
4
- import { SLOT_ATTR as l, mergeClasses as y } from "@epilot/zenith-runtime/v1/core.js";
4
+ import { SLOT_ATTR as l, mergeClasses as y } from "@epilot/zenith-runtime/v1";
5
5
  import { makeZenithStyles as x } from "../../styles/make-styles.js";
6
6
  import { boxModel as a } from "../../styles/host-reset.js";
7
7
  import { useZenithPaletteTokensFor as C } from "../../tokens/use-palette-tokens.js";
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.js","sources":["../../../src/components/avatar/avatar.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Avatar as AvatarPrimitive } from \"@base-ui/react/avatar\"\nimport { mergeClasses } from \"@epilot/zenith-runtime/v1/core\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport { useZenithPaletteTokensFor } from \"../../tokens/use-palette-tokens\"\nimport * as tokens from \"../../tokens\"\n\nexport type AvatarColor =\n | \"gray\"\n | \"blue\"\n | \"sky\"\n | \"cyan\"\n | \"teal\"\n | \"mint\"\n | \"green\"\n | \"lime\"\n | \"yellow\"\n | \"orange\"\n | \"bronze\"\n | \"red\"\n | \"pink\"\n | \"purple\"\n | \"indigo\"\nexport type AvatarSize = \"sm\" | \"base\" | \"lg\"\n\nconst AUTO_COLORS: AvatarColor[] = [\n \"blue\",\n \"sky\",\n \"cyan\",\n \"teal\",\n \"mint\",\n \"green\",\n \"lime\",\n \"orange\",\n \"bronze\",\n \"pink\",\n \"purple\",\n \"indigo\",\n]\n\nconst colorForSeed = (seed: string): AvatarColor => {\n let hash = 0\n for (let i = 0; i < seed.length; i++) {\n hash = (hash * 31 + seed.charCodeAt(i)) >>> 0\n }\n return AUTO_COLORS[hash % AUTO_COLORS.length]\n}\n\nconst colorVars: Record<AvatarColor, React.CSSProperties> = {\n gray: {\n \"--avatar-background\": tokens.gray3,\n \"--avatar-foreground\": tokens.grayA12,\n } as React.CSSProperties,\n blue: {\n \"--avatar-background\": tokens.blue3,\n \"--avatar-foreground\": tokens.blueA12,\n } as React.CSSProperties,\n sky: {\n \"--avatar-background\": tokens.sky3,\n \"--avatar-foreground\": tokens.skyA12,\n } as React.CSSProperties,\n cyan: {\n \"--avatar-background\": tokens.cyan3,\n \"--avatar-foreground\": tokens.cyanA12,\n } as React.CSSProperties,\n teal: {\n \"--avatar-background\": tokens.teal3,\n \"--avatar-foreground\": tokens.tealA12,\n } as React.CSSProperties,\n mint: {\n \"--avatar-background\": tokens.mint3,\n \"--avatar-foreground\": tokens.mintA12,\n } as React.CSSProperties,\n green: {\n \"--avatar-background\": tokens.green3,\n \"--avatar-foreground\": tokens.greenA12,\n } as React.CSSProperties,\n lime: {\n \"--avatar-background\": tokens.lime3,\n \"--avatar-foreground\": tokens.limeA12,\n } as React.CSSProperties,\n yellow: {\n \"--avatar-background\": tokens.yellow3,\n \"--avatar-foreground\": tokens.yellowA12,\n } as React.CSSProperties,\n orange: {\n \"--avatar-background\": tokens.orange3,\n \"--avatar-foreground\": tokens.orangeA12,\n } as React.CSSProperties,\n bronze: {\n \"--avatar-background\": tokens.bronze3,\n \"--avatar-foreground\": tokens.bronzeA12,\n } as React.CSSProperties,\n red: {\n \"--avatar-background\": tokens.red3,\n \"--avatar-foreground\": tokens.redA12,\n } as React.CSSProperties,\n pink: {\n \"--avatar-background\": tokens.pink3,\n \"--avatar-foreground\": tokens.pinkA12,\n } as React.CSSProperties,\n purple: {\n \"--avatar-background\": tokens.purple3,\n \"--avatar-foreground\": tokens.purpleA12,\n } as React.CSSProperties,\n indigo: {\n \"--avatar-background\": tokens.indigo3,\n \"--avatar-foreground\": tokens.indigoA12,\n } as React.CSSProperties,\n}\n\nconst AvatarGroupContext = React.createContext<{ size?: AvatarSize } | null>(\n null\n)\n\nconst useStyles = makeZenithStyles({\n root: {\n ...boxModel,\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n borderRadius: \"9999px\",\n backgroundColor: \"var(--avatar-background)\",\n color: \"var(--avatar-foreground)\",\n fontWeight: tokens.fontWeightMedium,\n textTransform: \"uppercase\",\n },\n sm: {\n ...boxModel,\n width: \"1.5rem\",\n height: \"1.5rem\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n },\n base: {\n ...boxModel,\n width: \"2rem\",\n height: \"2rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n },\n lg: {\n ...boxModel,\n width: \"2.5rem\",\n height: \"2.5rem\",\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n },\n image: {\n ...boxModel,\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n },\n fallback: {\n ...boxModel,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n height: \"100%\",\n },\n})\n\nexport type AvatarProps = Omit<\n React.ComponentPropsWithoutRef<\"span\"> & React.RefAttributes<HTMLSpanElement>,\n \"className\" | \"color\" | \"children\"\n> & {\n className?: string\n /**\n * @deprecated Has no effect. The root's only children are the image and its fallback, so on\n * Radix this tried to turn one of them into the avatar. Remove it.\n */\n asChild?: boolean\n src?: string\n /** Accessible name for the image, and the seed for the automatic colour. */\n alt?: string\n /** Shown when no `src` loads. Also seeds the automatic colour when `alt` is absent. */\n initials?: string\n /**\n * Leave this unset and the colour is derived by hashing `alt`, falling back to\n * `initials` — so the same person keeps the same colour everywhere, and two\n * people rarely collide. Set it only to override that.\n */\n color?: AvatarColor\n /** @default \"base\" */\n size?: AvatarSize\n}\n\nexport const Avatar = React.forwardRef<HTMLSpanElement, AvatarProps>(\n function Avatar(\n {\n className,\n src,\n alt,\n initials,\n color,\n size,\n style,\n asChild: _asChild,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const group = React.useContext(AvatarGroupContext)\n const resolvedSize = size ?? group?.size ?? \"base\"\n const resolvedColor = color ?? colorForSeed(alt ?? initials ?? \"\")\n\n // Was a module-scope call, so merely IMPORTING Avatar installed 63 kB of palette CSS whether one\n // ever rendered. Now it is per-instance and keyed on the resolved family, installed at commit\n // time (WP2B2) via a hook called unconditionally every render. Every auto colour is decorative,\n // so a seeded avatar still installs the sheet; an explicit `color=\"gray\"` no longer does, and\n // neither does an import that never renders.\n useZenithPaletteTokensFor(resolvedColor)\n\n return (\n <AvatarPrimitive.Root\n ref={ref}\n data-slot=\"avatar\"\n {...{ [SLOT_ATTR]: \"avatar\" }}\n className={mergeClasses(styles.root, styles[resolvedSize], className)}\n style={{ ...colorVars[resolvedColor], ...style }}\n {...props}\n >\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n {...{ [SLOT_ATTR]: \"avatar-image\" }}\n src={src}\n alt={alt}\n className={styles.image}\n />\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n {...{ [SLOT_ATTR]: \"avatar-fallback\" }}\n className={styles.fallback}\n aria-hidden=\"true\"\n >\n {initials}\n </AvatarPrimitive.Fallback>\n </AvatarPrimitive.Root>\n )\n }\n)\n\nexport { AvatarGroupContext }\n"],"names":["AUTO_COLORS","colorForSeed","seed","hash","i","colorVars","tokens.gray3","tokens.grayA12","tokens.blue3","tokens.blueA12","tokens.sky3","tokens.skyA12","tokens.cyan3","tokens.cyanA12","tokens.teal3","tokens.tealA12","tokens.mint3","tokens.mintA12","tokens.green3","tokens.greenA12","tokens.lime3","tokens.limeA12","tokens.yellow3","tokens.yellowA12","tokens.orange3","tokens.orangeA12","tokens.bronze3","tokens.bronzeA12","tokens.red3","tokens.redA12","tokens.pink3","tokens.pinkA12","tokens.purple3","tokens.purpleA12","tokens.indigo3","tokens.indigoA12","AvatarGroupContext","React","useStyles","makeZenithStyles","boxModel","tokens.fontWeightMedium","tokens.textXs","tokens.leadingXs","tokens.textSm","tokens.leadingSm","tokens.textBase","tokens.leadingBase","Avatar","className","src","alt","initials","color","size","style","_asChild","props","ref","styles","group","resolvedSize","resolvedColor","useZenithPaletteTokensFor","jsxs","AvatarPrimitive","SLOT_ATTR","mergeClasses","jsx"],"mappings":";;;;;;;;AA4BA,MAAMA,IAA6B;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,KAAe,CAACC,MAA8B;AAClD,MAAIC,IAAO;AACX,WAASC,IAAI,GAAGA,IAAIF,EAAK,QAAQE;AAC/B,IAAAD,IAAQA,IAAO,KAAKD,EAAK,WAAWE,C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C3CyB,IAAeP,MAAQM,KAAA,gBAAAA,EAAO,SAAQ,QACtCE,IAAgBT,KAASpD,GAAakD,KAAOC,KAAY,EAAE;AAOjE,WAAAW,EAA0BD,CAAa,GAGrC,gBAAAE;AAAA,MAACC,EAAgB;AAAA,MAAhB;AAAA,QACC,KAAAP;AAAA,QACA,aAAU;AAAA,QACJ,CAACQ,CAAS,GAAG;AAAA,QACnB,WAAWC,EAAaR,EAAO,MAAMA,EAAOE,CAAY,GAAGZ,CAAS;AAAA,QACpE,OAAO,EAAE,GAAG5C,GAAUyD,CAAa,GAAG,GAAGP,EAAA;AAAA,QACxC,GAAGE;AAAA,QAEJ,UAAA;AAAA,UAAA,gBAAAW;AAAA,YAACH,EAAgB;AAAA,YAAhB;AAAA,cACC,aAAU;AAAA,cACJ,CAACC,CAAS,GAAG;AAAA,cACnB,KAAAhB;AAAA,cACA,KAAAC;AAAA,cACA,WAAWQ,EAAO;AAAA,YAAA;AAAA,UAAA;AAAA,UAEpB,gBAAAS;AAAA,YAACH,EAAgB;AAAA,YAAhB;AAAA,cACC,aAAU;AAAA,cACJ,CAACC,CAAS,GAAG;AAAA,cACnB,WAAWP,EAAO;AAAA,cAClB,eAAY;AAAA,cAEX,UAAAP;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
1
+ {"version":3,"file":"avatar.js","sources":["../../../src/components/avatar/avatar.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Avatar as AvatarPrimitive } from \"@base-ui/react/avatar\"\nimport { mergeClasses } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport { useZenithPaletteTokensFor } from \"../../tokens/use-palette-tokens\"\nimport * as tokens from \"../../tokens\"\n\nexport type AvatarColor =\n | \"gray\"\n | \"blue\"\n | \"sky\"\n | \"cyan\"\n | \"teal\"\n | \"mint\"\n | \"green\"\n | \"lime\"\n | \"yellow\"\n | \"orange\"\n | \"bronze\"\n | \"red\"\n | \"pink\"\n | \"purple\"\n | \"indigo\"\nexport type AvatarSize = \"sm\" | \"base\" | \"lg\"\n\nconst AUTO_COLORS: AvatarColor[] = [\n \"blue\",\n \"sky\",\n \"cyan\",\n \"teal\",\n \"mint\",\n \"green\",\n \"lime\",\n \"orange\",\n \"bronze\",\n \"pink\",\n \"purple\",\n \"indigo\",\n]\n\nconst colorForSeed = (seed: string): AvatarColor => {\n let hash = 0\n for (let i = 0; i < seed.length; i++) {\n hash = (hash * 31 + seed.charCodeAt(i)) >>> 0\n }\n return AUTO_COLORS[hash % AUTO_COLORS.length]\n}\n\nconst colorVars: Record<AvatarColor, React.CSSProperties> = {\n gray: {\n \"--avatar-background\": tokens.gray3,\n \"--avatar-foreground\": tokens.grayA12,\n } as React.CSSProperties,\n blue: {\n \"--avatar-background\": tokens.blue3,\n \"--avatar-foreground\": tokens.blueA12,\n } as React.CSSProperties,\n sky: {\n \"--avatar-background\": tokens.sky3,\n \"--avatar-foreground\": tokens.skyA12,\n } as React.CSSProperties,\n cyan: {\n \"--avatar-background\": tokens.cyan3,\n \"--avatar-foreground\": tokens.cyanA12,\n } as React.CSSProperties,\n teal: {\n \"--avatar-background\": tokens.teal3,\n \"--avatar-foreground\": tokens.tealA12,\n } as React.CSSProperties,\n mint: {\n \"--avatar-background\": tokens.mint3,\n \"--avatar-foreground\": tokens.mintA12,\n } as React.CSSProperties,\n green: {\n \"--avatar-background\": tokens.green3,\n \"--avatar-foreground\": tokens.greenA12,\n } as React.CSSProperties,\n lime: {\n \"--avatar-background\": tokens.lime3,\n \"--avatar-foreground\": tokens.limeA12,\n } as React.CSSProperties,\n yellow: {\n \"--avatar-background\": tokens.yellow3,\n \"--avatar-foreground\": tokens.yellowA12,\n } as React.CSSProperties,\n orange: {\n \"--avatar-background\": tokens.orange3,\n \"--avatar-foreground\": tokens.orangeA12,\n } as React.CSSProperties,\n bronze: {\n \"--avatar-background\": tokens.bronze3,\n \"--avatar-foreground\": tokens.bronzeA12,\n } as React.CSSProperties,\n red: {\n \"--avatar-background\": tokens.red3,\n \"--avatar-foreground\": tokens.redA12,\n } as React.CSSProperties,\n pink: {\n \"--avatar-background\": tokens.pink3,\n \"--avatar-foreground\": tokens.pinkA12,\n } as React.CSSProperties,\n purple: {\n \"--avatar-background\": tokens.purple3,\n \"--avatar-foreground\": tokens.purpleA12,\n } as React.CSSProperties,\n indigo: {\n \"--avatar-background\": tokens.indigo3,\n \"--avatar-foreground\": tokens.indigoA12,\n } as React.CSSProperties,\n}\n\nconst AvatarGroupContext = React.createContext<{ size?: AvatarSize } | null>(\n null\n)\n\nconst useStyles = makeZenithStyles({\n root: {\n ...boxModel,\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n borderRadius: \"9999px\",\n backgroundColor: \"var(--avatar-background)\",\n color: \"var(--avatar-foreground)\",\n fontWeight: tokens.fontWeightMedium,\n textTransform: \"uppercase\",\n },\n sm: {\n ...boxModel,\n width: \"1.5rem\",\n height: \"1.5rem\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n },\n base: {\n ...boxModel,\n width: \"2rem\",\n height: \"2rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n },\n lg: {\n ...boxModel,\n width: \"2.5rem\",\n height: \"2.5rem\",\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n },\n image: {\n ...boxModel,\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n },\n fallback: {\n ...boxModel,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n height: \"100%\",\n },\n})\n\nexport type AvatarProps = Omit<\n React.ComponentPropsWithoutRef<\"span\"> & React.RefAttributes<HTMLSpanElement>,\n \"className\" | \"color\" | \"children\"\n> & {\n className?: string\n /**\n * @deprecated Has no effect. The root's only children are the image and its fallback, so on\n * Radix this tried to turn one of them into the avatar. Remove it.\n */\n asChild?: boolean\n src?: string\n /** Accessible name for the image, and the seed for the automatic colour. */\n alt?: string\n /** Shown when no `src` loads. Also seeds the automatic colour when `alt` is absent. */\n initials?: string\n /**\n * Leave this unset and the colour is derived by hashing `alt`, falling back to\n * `initials` — so the same person keeps the same colour everywhere, and two\n * people rarely collide. Set it only to override that.\n */\n color?: AvatarColor\n /** @default \"base\" */\n size?: AvatarSize\n}\n\nexport const Avatar = React.forwardRef<HTMLSpanElement, AvatarProps>(\n function Avatar(\n {\n className,\n src,\n alt,\n initials,\n color,\n size,\n style,\n asChild: _asChild,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const group = React.useContext(AvatarGroupContext)\n const resolvedSize = size ?? group?.size ?? \"base\"\n const resolvedColor = color ?? colorForSeed(alt ?? initials ?? \"\")\n\n // Was a module-scope call, so merely IMPORTING Avatar installed 63 kB of palette CSS whether one\n // ever rendered. Now it is per-instance and keyed on the resolved family, installed at commit\n // time (WP2B2) via a hook called unconditionally every render. Every auto colour is decorative,\n // so a seeded avatar still installs the sheet; an explicit `color=\"gray\"` no longer does, and\n // neither does an import that never renders.\n useZenithPaletteTokensFor(resolvedColor)\n\n return (\n <AvatarPrimitive.Root\n ref={ref}\n data-slot=\"avatar\"\n {...{ [SLOT_ATTR]: \"avatar\" }}\n className={mergeClasses(styles.root, styles[resolvedSize], className)}\n style={{ ...colorVars[resolvedColor], ...style }}\n {...props}\n >\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n {...{ [SLOT_ATTR]: \"avatar-image\" }}\n src={src}\n alt={alt}\n className={styles.image}\n />\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n {...{ [SLOT_ATTR]: \"avatar-fallback\" }}\n className={styles.fallback}\n aria-hidden=\"true\"\n >\n {initials}\n </AvatarPrimitive.Fallback>\n </AvatarPrimitive.Root>\n )\n }\n)\n\nexport { AvatarGroupContext }\n"],"names":["AUTO_COLORS","colorForSeed","seed","hash","i","colorVars","tokens.gray3","tokens.grayA12","tokens.blue3","tokens.blueA12","tokens.sky3","tokens.skyA12","tokens.cyan3","tokens.cyanA12","tokens.teal3","tokens.tealA12","tokens.mint3","tokens.mintA12","tokens.green3","tokens.greenA12","tokens.lime3","tokens.limeA12","tokens.yellow3","tokens.yellowA12","tokens.orange3","tokens.orangeA12","tokens.bronze3","tokens.bronzeA12","tokens.red3","tokens.redA12","tokens.pink3","tokens.pinkA12","tokens.purple3","tokens.purpleA12","tokens.indigo3","tokens.indigoA12","AvatarGroupContext","React","useStyles","makeZenithStyles","boxModel","tokens.fontWeightMedium","tokens.textXs","tokens.leadingXs","tokens.textSm","tokens.leadingSm","tokens.textBase","tokens.leadingBase","Avatar","className","src","alt","initials","color","size","style","_asChild","props","ref","styles","group","resolvedSize","resolvedColor","useZenithPaletteTokensFor","jsxs","AvatarPrimitive","SLOT_ATTR","mergeClasses","jsx"],"mappings":";;;;;;;;AA4BA,MAAMA,IAA6B;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,KAAe,CAACC,MAA8B;AAClD,MAAIC,IAAO;AACX,WAASC,IAAI,GAAGA,IAAIF,EAAK,QAAQE;AAC/B,IAAAD,IAAQA,IAAO,KAAKD,EAAK,WAAWE,CAAC,MAAO;AAE9C,SAAOJ,EAAYG,IAAOH,EAAY,MAAM;AAC9C,GAEMK,KAAsD;AAAA,EAC1D,MAAM;AAAA,IACJ,uBAAuBC;AAAAA,IACvB,uBAAuBC;AAAAA,EAAO;AAAA,EAEhC,MAAM;AAAA,IACJ,uBAAuBC;AAAAA,IACvB,uBAAuBC;AAAAA,EAAO;AAAA,EAEhC,KAAK;AAAA,IACH,uBAAuBC;AAAAA,IACvB,u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AAOE,CAAY,GAAGZ,CAAS;AAAA,QACpE,OAAO,EAAE,GAAG5C,GAAUyD,CAAa,GAAG,GAAGP,EAAA;AAAA,QACxC,GAAGE;AAAA,QAEJ,UAAA;AAAA,UAAA,gBAAAW;AAAA,YAACH,EAAgB;AAAA,YAAhB;AAAA,cACC,aAAU;AAAA,cACJ,CAACC,CAAS,GAAG;AAAA,cACnB,KAAAhB;AAAA,cACA,KAAAC;AAAA,cACA,WAAWQ,EAAO;AAAA,YAAA;AAAA,UAAA;AAAA,UAEpB,gBAAAS;AAAA,YAACH,EAAgB;AAAA,YAAhB;AAAA,cACC,aAAU;AAAA,cACJ,CAACC,CAAS,GAAG;AAAA,cACnB,WAAWP,EAAO;AAAA,cAClB,eAAY;AAAA,cAEX,UAAAP;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as b } from "react/jsx-runtime";
2
2
  import * as S from "react";
3
- import { mergeClasses as y, SLOT_ATTR as v, shorthands as x } from "@epilot/zenith-runtime/v1/core.js";
3
+ import { mergeClasses as y, SLOT_ATTR as v, shorthands as x } from "@epilot/zenith-runtime/v1";
4
4
  import { makeZenithStyles as w } from "../../styles/make-styles.js";
5
5
  import { boxModel as o } from "../../styles/host-reset.js";
6
6
  import { radiusMd as $, spacingElement3 as z, spacingElement1 as i, textBase as C, radiusSm as R, spacingElement2 as O, textSm as T, textXs as k, errorA8 as A, accentA8 as B, fontWeightNormal as N } from "../../tokens/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"badge.js","sources":["../../../src/components/badge/badge.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1/core\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport { NS, PALETTE_NS } from \"../../tokens\"\nimport { isCoreFamily } from \"../../tokens/install\"\nimport { useZenithPaletteTokensFor } from \"../../tokens/use-palette-tokens\"\nimport * as tokens from \"../../tokens\"\n\n/**\n * REFERENCE COMPONENT — the colour-matrix collapse. Read this before writing another component\n * that takes a `color` prop.\n */\n\nconst COLORS = [\n \"accent\",\n \"neutral\",\n \"gray\",\n \"success\",\n \"warning\",\n \"error\",\n \"info\",\n \"blue\",\n \"sky\",\n \"mint\",\n \"lime\",\n \"green\",\n \"teal\",\n \"cyan\",\n \"indigo\",\n \"purple\",\n \"pink\",\n \"red\",\n \"orange\",\n \"yellow\",\n \"bronze\",\n] as const\n\nexport type BadgeColor = (typeof COLORS)[number]\nexport type BadgeVariant = \"soft\" | \"solid\" | \"surface\"\nexport type BadgeSize = \"sm\" | \"base\" | \"lg\"\n\n/** The three slots a variant can paint. Set inline; read by the atoms below. */\nconst BG = \"--zenith-badge-bg\"\nconst FG = \"--zenith-badge-fg\"\nconst BD = \"--zenith-badge-bd\"\n\nconst resolveColor = (color: BadgeColor): string =>\n color === \"neutral\" ? \"gray\" : color\n\n/**\n * The namespace fix. `resolveColor` runs FIRST so `neutral` is classified as `gray` (core) rather\n * than as the literal string \"neutral\" (which is in neither sheet's family list) — same order\n * `semantic`/`primitive` already apply it in.\n */\nconst namespaceFor = (family: string): string =>\n isCoreFamily(family) ? NS : PALETTE_NS\n\nconst semantic = (color: BadgeColor, slot: string): string => {\n const family = resolveColor(color)\n return `var(--zenith-${namespaceFor(family)}-${family}-${slot})`\n}\nconst primitive = (color: BadgeColor, step: string): string => {\n const family = resolveColor(color)\n return `var(--zenith-${namespaceFor(family)}-${family}-${step})`\n}\n\n/**\n * Which token each variant pulls into each slot. This replaces the 60-entry compound matrix: it is\n * data about three variants, not about 60 combinations.\n */\nconst VARIANT_SLOTS: Record<\n BadgeVariant,\n (color: BadgeColor) => Record<string, string>\n> = {\n soft: (c) => ({\n [BG]: semantic(c, \"soft\"),\n [FG]: semantic(c, \"default\"),\n [BD]: \"transparent\",\n }),\n solid: (c) => ({\n [BG]: semantic(c, \"solid\"),\n [FG]: semantic(c, \"contrast\"),\n [BD]: \"transparent\",\n }),\n surface: (c) => ({\n [BG]: semantic(c, \"surface\"),\n [FG]: semantic(c, \"default\"),\n [BD]: primitive(c, \"a6\"),\n }),\n}\n\nconst useStyles = makeZenithStyles({\n root: {\n ...boxModel,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"fit-content\",\n whiteSpace: \"nowrap\",\n flexShrink: 0,\n overflow: \"hidden\",\n fontWeight: tokens.fontWeightNormal,\n // NEVER write a CSS shorthand in a Griffel style object. Atoms are one declaration each, so a\n // shorthand cannot be resolved against a longhand — `border` and a later `borderColor` would\n // both survive with the winner decided by insertion order. Griffel warns at runtime, which\n // means the mistake ships silently in production where nobody reads the console.\n // `shorthands.*` expands to the individual longhands.\n ...shorthands.border(\"1px\", \"solid\", `var(${BD})`),\n // The whole point: one rule each, colour supplied per instance.\n backgroundColor: `var(${BG})`,\n color: `var(${FG})`,\n transitionProperty: \"color, box-shadow\",\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n // v1 `aria-invalid:outline-error-a8`. Declared after the focus ring so an invalid focused\n // badge paints the error ring, matching v1's variant ordering.\n \"&[aria-invalid]\": {\n outlineColor: tokens.errorA8,\n },\n \"& > svg\": { pointerEvents: \"none\" },\n },\n sm: {\n ...boxModel,\n fontSize: tokens.textXs,\n lineHeight: \"1rem\",\n letterSpacing: \"0.04px\",\n gap: tokens.spacingElement1,\n paddingInline: tokens.spacingElement1,\n minWidth: \"1rem\",\n borderRadius: \"3px\",\n \"& > svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n base: {\n ...boxModel,\n fontSize: tokens.textSm,\n lineHeight: \"1.25rem\",\n gap: tokens.spacingElement1,\n paddingInline: tokens.spacingElement2,\n minWidth: \"1.25rem\",\n borderRadius: tokens.radiusSm,\n \"& > svg\": { width: \"1rem\", height: \"1rem\" },\n },\n lg: {\n ...boxModel,\n fontSize: tokens.textBase,\n lineHeight: \"1.5rem\",\n gap: tokens.spacingElement1,\n paddingInline: tokens.spacingElement3,\n minWidth: \"1.5rem\",\n borderRadius: tokens.radiusMd,\n \"& > svg\": { width: \"1rem\", height: \"1rem\" },\n },\n})\n\nexport type BadgeProps = Omit<React.ComponentProps<\"span\">, \"color\"> & {\n color?: BadgeColor\n /**\n * Named `variant`, not `style`. v1 called this `style`, which shadows the HTML `style` attribute\n * and made a badge unable to take both a visual treatment and an inline style. Retrocompat is\n * not a requirement here, so the collision is fixed rather than inherited.\n */\n variant?: BadgeVariant\n size?: BadgeSize\n}\n\nexport const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n function Badge(\n {\n className,\n color = \"accent\",\n variant = \"soft\",\n size = \"base\",\n style,\n ...props\n },\n ref\n ) {\n // A decorative family can still arrive from an expression the build cannot see, so this has to\n // be re-evaluated every commit (WP2B2 — the hook closes over this render's resolved value) —\n // but it is the resolved family that decides, and a core one needs no palette sheet.\n useZenithPaletteTokensFor(color)\n\n const styles = useStyles()\n\n return (\n <span\n ref={ref}\n data-slot=\"badge\"\n {...{ [SLOT_ATTR]: \"badge\" }}\n className={mergeClasses(styles.root, styles[size], className)}\n style={\n { ...VARIANT_SLOTS[variant](color), ...style } as React.CSSProperties\n }\n {...props}\n />\n )\n }\n)\n\nexport { COLORS as BADGE_COLORS }\n"],"names":["COLORS","BG","FG","BD","resolveColor","color","namespaceFor","family","isCoreFamily","NS","PALETTE_NS","semantic","slot","primitive","step","VARIANT_SLOTS","c","useStyles","makeZenithStyles","boxModel","tokens.fontWeightNormal","shorthands","tokens.accentA8","tokens.errorA8","tokens.textXs","tokens.spacingElement1","tokens.textSm","tokens.spacingElement2","tokens.radiusSm","tokens.textBase","tokens.spacingElement3","tokens.radiusMd","Badge","React","className","variant","size","style","props","ref","useZenithPaletteTokensFor","styles","jsx","SL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AcC;AAAAA,IACd,WAAW,EAAE,OAAO,QAAQ,QAAQ,OAAA;AAAA,EAAO;AAE/C,CAAC,GAaYC,IAAQC,EAAM;AAAA,EACzB,SACE;AAAA,IACE,WAAAC;AAAA,IACA,OAAA7B,IAAQ;AAAA,IACR,SAAA8B,IAAU;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,GACA;AAIA,IAAAC,EAA0BnC,CAAK;AAE/B,UAAMoC,IAASxB,EAAA;AAEf,WACE,gBAAAyB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAH;AAAA,QACA,aAAU;AAAA,QACJ,CAACI,CAAS,GAAG;AAAA,QACnB,WAAWC,EAAaH,EAAO,MAAMA,EAAOL,CAAI,GAAGF,CAAS;AAAA,QAC5D,OACE,EAAE,GAAGnB,EAAcoB,CAAO,EAAE9B,CAAK,GAAG,GAAGgC,EAAA;AAAA,QAExC,GAAGC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
1
+ {"version":3,"file":"badge.js","sources":["../../../src/components/badge/badge.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport { NS, PALETTE_NS } from \"../../tokens\"\nimport { isCoreFamily } from \"../../tokens/install\"\nimport { useZenithPaletteTokensFor } from \"../../tokens/use-palette-tokens\"\nimport * as tokens from \"../../tokens\"\n\n/**\n * REFERENCE COMPONENT — the colour-matrix collapse. Read this before writing another component\n * that takes a `color` prop.\n */\n\nconst COLORS = [\n \"accent\",\n \"neutral\",\n \"gray\",\n \"success\",\n \"warning\",\n \"error\",\n \"info\",\n \"blue\",\n \"sky\",\n \"mint\",\n \"lime\",\n \"green\",\n \"teal\",\n \"cyan\",\n \"indigo\",\n \"purple\",\n \"pink\",\n \"red\",\n \"orange\",\n \"yellow\",\n \"bronze\",\n] as const\n\nexport type BadgeColor = (typeof COLORS)[number]\nexport type BadgeVariant = \"soft\" | \"solid\" | \"surface\"\nexport type BadgeSize = \"sm\" | \"base\" | \"lg\"\n\n/** The three slots a variant can paint. Set inline; read by the atoms below. */\nconst BG = \"--zenith-badge-bg\"\nconst FG = \"--zenith-badge-fg\"\nconst BD = \"--zenith-badge-bd\"\n\nconst resolveColor = (color: BadgeColor): string =>\n color === \"neutral\" ? \"gray\" : color\n\n/**\n * The namespace fix. `resolveColor` runs FIRST so `neutral` is classified as `gray` (core) rather\n * than as the literal string \"neutral\" (which is in neither sheet's family list) — same order\n * `semantic`/`primitive` already apply it in.\n */\nconst namespaceFor = (family: string): string =>\n isCoreFamily(family) ? NS : PALETTE_NS\n\nconst semantic = (color: BadgeColor, slot: string): string => {\n const family = resolveColor(color)\n return `var(--zenith-${namespaceFor(family)}-${family}-${slot})`\n}\nconst primitive = (color: BadgeColor, step: string): string => {\n const family = resolveColor(color)\n return `var(--zenith-${namespaceFor(family)}-${family}-${step})`\n}\n\n/**\n * Which token each variant pulls into each slot. This replaces the 60-entry compound matrix: it is\n * data about three variants, not about 60 combinations.\n */\nconst VARIANT_SLOTS: Record<\n BadgeVariant,\n (color: BadgeColor) => Record<string, string>\n> = {\n soft: (c) => ({\n [BG]: semantic(c, \"soft\"),\n [FG]: semantic(c, \"default\"),\n [BD]: \"transparent\",\n }),\n solid: (c) => ({\n [BG]: semantic(c, \"solid\"),\n [FG]: semantic(c, \"contrast\"),\n [BD]: \"transparent\",\n }),\n surface: (c) => ({\n [BG]: semantic(c, \"surface\"),\n [FG]: semantic(c, \"default\"),\n [BD]: primitive(c, \"a6\"),\n }),\n}\n\nconst useStyles = makeZenithStyles({\n root: {\n ...boxModel,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"fit-content\",\n whiteSpace: \"nowrap\",\n flexShrink: 0,\n overflow: \"hidden\",\n fontWeight: tokens.fontWeightNormal,\n // NEVER write a CSS shorthand in a Griffel style object. Atoms are one declaration each, so a\n // shorthand cannot be resolved against a longhand — `border` and a later `borderColor` would\n // both survive with the winner decided by insertion order. Griffel warns at runtime, which\n // means the mistake ships silently in production where nobody reads the console.\n // `shorthands.*` expands to the individual longhands.\n ...shorthands.border(\"1px\", \"solid\", `var(${BD})`),\n // The whole point: one rule each, colour supplied per instance.\n backgroundColor: `var(${BG})`,\n color: `var(${FG})`,\n transitionProperty: \"color, box-shadow\",\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n // v1 `aria-invalid:outline-error-a8`. Declared after the focus ring so an invalid focused\n // badge paints the error ring, matching v1's variant ordering.\n \"&[aria-invalid]\": {\n outlineColor: tokens.errorA8,\n },\n \"& > svg\": { pointerEvents: \"none\" },\n },\n sm: {\n ...boxModel,\n fontSize: tokens.textXs,\n lineHeight: \"1rem\",\n letterSpacing: \"0.04px\",\n gap: tokens.spacingElement1,\n paddingInline: tokens.spacingElement1,\n minWidth: \"1rem\",\n borderRadius: \"3px\",\n \"& > svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n base: {\n ...boxModel,\n fontSize: tokens.textSm,\n lineHeight: \"1.25rem\",\n gap: tokens.spacingElement1,\n paddingInline: tokens.spacingElement2,\n minWidth: \"1.25rem\",\n borderRadius: tokens.radiusSm,\n \"& > svg\": { width: \"1rem\", height: \"1rem\" },\n },\n lg: {\n ...boxModel,\n fontSize: tokens.textBase,\n lineHeight: \"1.5rem\",\n gap: tokens.spacingElement1,\n paddingInline: tokens.spacingElement3,\n minWidth: \"1.5rem\",\n borderRadius: tokens.radiusMd,\n \"& > svg\": { width: \"1rem\", height: \"1rem\" },\n },\n})\n\nexport type BadgeProps = Omit<React.ComponentProps<\"span\">, \"color\"> & {\n color?: BadgeColor\n /**\n * Named `variant`, not `style`. v1 called this `style`, which shadows the HTML `style` attribute\n * and made a badge unable to take both a visual treatment and an inline style. Retrocompat is\n * not a requirement here, so the collision is fixed rather than inherited.\n */\n variant?: BadgeVariant\n size?: BadgeSize\n}\n\nexport const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n function Badge(\n {\n className,\n color = \"accent\",\n variant = \"soft\",\n size = \"base\",\n style,\n ...props\n },\n ref\n ) {\n // A decorative family can still arrive from an expression the build cannot see, so this has to\n // be re-evaluated every commit (WP2B2 — the hook closes over this render's resolved value) —\n // but it is the resolved family that decides, and a core one needs no palette sheet.\n useZenithPaletteTokensFor(color)\n\n const styles = useStyles()\n\n return (\n <span\n ref={ref}\n data-slot=\"badge\"\n {...{ [SLOT_ATTR]: \"badge\" }}\n className={mergeClasses(styles.root, styles[size], className)}\n style={\n { ...VARIANT_SLOTS[variant](color), ...style } as React.CSSProperties\n }\n {...props}\n />\n )\n }\n)\n\nexport { COLORS as BADGE_COLORS }\n"],"names":["COLORS","BG","FG","BD","resolveColor","color","namespaceFor","family","isCoreFamily","NS","PALETTE_NS","semantic","slot","primitive","step","VARIANT_SLOTS","c","useStyles","makeZenithStyles","boxModel","tokens.fontWeightNormal","shorthands","tokens.accentA8","tokens.errorA8","tokens.textXs","tokens.spacingElement1","tokens.textSm","tokens.spacingElement2","tokens.radiusSm","tokens.textBase","tokens.spacingElement3","tokens.radiusMd","Badge","React","className","variant","size","style","props","ref","useZenithPaletteTokensFor","styles","jsx","SLOT_ATTR","mergeClasses"],"mappings":";;;;;;;;;;AAiBA,MAAMA,IAAS;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAOMC,IAAK,qBACLC,IAAK,qBACLC,IAAK,qBAEL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WACE,gBAAAyB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAH;AAAA,QACA,aAAU;AAAA,QACJ,CAACI,CAAS,GAAG;AAAA,QACnB,WAAWC,EAAaH,EAAO,MAAMA,EAAOL,CAAI,GAAGF,CAAS;AAAA,QAC5D,OACE,EAAE,GAAGnB,EAAcoB,CAAO,EAAE9B,CAAK,GAAG,GAAGgC,EAAA;AAAA,QAExC,GAAGC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as o, jsxs as W } from "react/jsx-runtime";
2
2
  import * as i from "react";
3
- import { mergeClasses as p, SLOT_ATTR as s, shorthands as l } from "@epilot/zenith-runtime/v1/core.js";
3
+ import { mergeClasses as p, SLOT_ATTR as s, shorthands as l } from "@epilot/zenith-runtime/v1";
4
4
  import { makeZenithStyles as w } from "../../styles/make-styles.js";
5
5
  import { boxModel as k } from "../../styles/host-reset.js";
6
6
  import { grayDefault as v, fontWeightSemibold as S, accentA8 as A, grayLight as C, leadingBase as L, textBase as D, spacingElement1 as I, spacingElement2 as R } from "../../tokens/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.js","sources":["../../../src/components/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1/core\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\nimport { ComposeAsChild } from \"../slot/compose-as-child\"\n\n/** Breadcrumb — Card's compound pattern applied to the nav / ol / li structure. */\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime (MDX call\n// sites do this), which `React.Children.only` rejects. Radix's Slot normalised that.\nfunction onlyChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children)\n return (elements.length === 1 ? elements[0] : children) as React.ReactElement\n}\n\nexport type BreadcrumbProps = React.ComponentProps<\"nav\"> & {\n separator?: React.ReactNode\n /**\n * Accessible name of the navigation landmark, read by screen readers. Pass a translated string\n * for any locale other than English. Defaults to \"Breadcrumb\".\n */\n \"aria-label\"?: string\n}\n\nconst useStyles = makeZenithStyles({\n // A truncating crumb can only shrink if every box above it may shrink below its content too. The\n // nav is the box a flex row (a view header) actually sizes, so it carries the rule; plain trails\n // keep their content size.\n root: {\n [`&:has([${SLOT_ATTR}=\"breadcrumb-item\"][data-truncate])`]: {\n minWidth: 0,\n },\n },\n list: {\n ...boxModel,\n // A layout row, not a numbered list: reset the browser's markers and indent so the trail does\n // not depend on the host shipping a CSS reset.\n listStyleType: \"none\",\n ...shorthands.margin(0),\n ...shorthands.padding(0),\n display: \"flex\",\n alignItems: \"center\",\n // gap-2\n ...shorthands.gap(tokens.spacingElement2),\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n minWidth: 0,\n },\n separator: {\n color: tokens.grayLight,\n },\n item: {\n display: \"inline-flex\",\n alignItems: \"center\",\n // gap-1\n ...shorthands.gap(tokens.spacingElement1),\n },\n itemTruncate: {\n ...boxModel,\n minWidth: 0,\n },\n truncate: {\n ...shorthands.overflow(\"hidden\"),\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n link: {\n // A browser underlines a bare `<a>`; the underline is a hover affordance here.\n textDecorationLine: \"none\",\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.grayLight,\n transitionProperty:\n \"color, background-color, border-color, text-decoration-color, fill, stroke\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n cursor: \"pointer\",\n \":hover\": {\n color: tokens.grayDefault,\n textDecorationLine: \"underline\",\n },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n },\n page: {\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.grayDefault,\n },\n})\n\nexport const Breadcrumb = React.forwardRef<HTMLElement, BreadcrumbProps>(\n function Breadcrumb(\n {\n separator = \"/\",\n \"aria-label\": ariaLabel = \"Breadcrumb\",\n className,\n children,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const items = React.Children.toArray(children).filter(React.isValidElement)\n\n return (\n <nav\n ref={ref}\n data-slot=\"breadcrumb\"\n {...{ [SLOT_ATTR]: \"breadcrumb\" }}\n aria-label={ariaLabel}\n className={mergeClasses(styles.root, className)}\n {...props}\n >\n <ol className={styles.list}>\n {items.map((child, index) => (\n <React.Fragment key={index}>\n {index > 0 && (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={styles.separator}\n >\n {separator}\n </li>\n )}\n {child}\n </React.Fragment>\n ))}\n </ol>\n </nav>\n )\n }\n)\n\nexport type BreadcrumbItemProps = Omit<React.ComponentProps<\"a\">, \"href\"> & {\n href?: string\n isCurrent?: boolean\n /**\n * Render the child instead of the built-in `a`, keeping the link styling and slot markers. This\n * is how a consumer supplies a router link. The child must be one real element, not a Fragment.\n */\n asChild?: boolean\n /**\n * Keep the crumb on one line and cut it with an ellipsis when the trail runs out of room, with\n * the full text as its `title`. Pass `title` yourself when the children are not plain text.\n */\n truncate?: boolean\n}\n\nexport const BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n BreadcrumbItemProps\n>(function BreadcrumbItem(\n {\n href,\n isCurrent = false,\n className,\n children,\n asChild = false,\n truncate = false,\n title,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const isLink = !!href\n\n const truncateClass = truncate ? styles.truncate : undefined\n const fullText =\n title ??\n (truncate && (typeof children === \"string\" || typeof children === \"number\")\n ? String(children)\n : undefined)\n\n const linkProps = {\n \"data-slot\": \"breadcrumb-link\",\n [SLOT_ATTR]: \"breadcrumb-link\",\n ...(href ? { href } : {}),\n ...(fullText !== undefined ? { title: fullText } : {}),\n ...(isCurrent ? { \"aria-current\": \"page\" as const } : {}),\n ...props,\n }\n const linkClassName = mergeClasses(styles.link, truncateClass, className)\n\n const content = asChild ? (\n <ComposeAsChild {...linkProps} className={linkClassName}>\n {onlyChild(children)}\n </ComposeAsChild>\n ) : isLink ? (\n <a {...linkProps} className={linkClassName}>\n {children}\n </a>\n ) : (\n <span\n data-slot=\"breadcrumb-page\"\n {...{ [SLOT_ATTR]: \"breadcrumb-page\" }}\n className={mergeClasses(styles.page, truncateClass, className)}\n {...(fullText !== undefined ? { title: fullText } : {})}\n {...(isCurrent ? { \"aria-current\": \"page\" as const } : {})}\n >\n {children}\n </span>\n )\n\n return (\n <li\n ref={ref}\n data-slot=\"breadcrumb-item\"\n {...{ [SLOT_ATTR]: \"breadcrumb-item\" }}\n {...(truncate ? { \"data-truncate\": \"\" } : {})}\n className={mergeClasses(styles.item, truncate && styles.itemTruncate)}\n >\n {content}\n </li>\n )\n})\n"],"names":["onlyChild","children","elements","React","useStyles","makeZenithStyles","SLOT_ATTR","boxModel","shorthands","tokens.spacingElement2","tokens.textBase","tokens.leadingBase","tokens.grayLight","tokens.spacingElement1","tokens.fontWeightSemibold","tokens.grayDefault","tokens.accentA8","Breadcrumb","separator","ariaLabel","className","props","ref","styles","items","jsx","mergeClasses","child","index","jsxs","BreadcrumbItem","href","isCurrent","asChild","truncate","title","isLink","truncateClass","fullText","linkProps","linkClassName","content","ComposeAsChild"],"mappings":";;;;;;;AAcA,SAASA,EAAUC,GAA2B;AAC5C,QAAMC,IAAWC,EAAM,SAAS,QAAQF,CAAQ;AAChD,SAAQC,EAAS,WAAW,IAAIA,EAAS,CAAC,IAAID;AAChD;AAWA,MAAMG,IAAYC,EAAiB;AAAA;AAAA;AAAA;AAAA,EAIjC,MAAM;AAAA,IACJ,CAAC,UAAUC,CAAS,qCAAqC,GAAG;AAAA,MAC1D,UAAU;AAAA,IAAA;AAAA,EACZ;AAAA,EAEF,MAAM;AAAA,IACJ,GAAGC;AAAA;AAAA;AAAA,IAGH,eAAe;AAAA,IACf,GAAGC,EAAW,OAAO,CAAC;AAAA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,GAAGX;AAAA,EAAA,GAECmB,IAAgBd,EAAaH,EAAO,MAAMc,GAAejB,CAAS,GAElEqB,IAAUR,IACd,gBAAAR,EAACiB,GAAA,EAAgB,GAAGH,GAAW,WAAWC,GACvC,UAAAxC,EAAUC,CAAQ,GACrB,IACEmC,sBACD,KAAA,EAAG,GAAGG,GAAW,WAAWC,GAC1B,UAAAvC,GACH,IAEA,gBAAAwB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACJ,CAACnB,CAAS,GAAG;AAAA,MACnB,WAAWoB,EAAaH,EAAO,MAAMc,GAAejB,CAAS;AAAA,MAC5D,GAAIkB,MAAa,SAAY,EAAE,OAAOA,EAAA,IAAa,CAAA;AAAA,MACnD,GAAIN,IAAY,EAAE,gBAAgB,OAAA,IAAoB,CAAA;AAAA,MAEtD,UAAA/B;AAAA,IAAA;AAAA,EAAA;AAIL,SACE,gBAAAwB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,aAAU;AAAA,MACJ,CAAChB,CAAS,GAAG;AAAA,MAClB,GAAI4B,IAAW,EAAE,iBAAiB,GAAA,IAAO,CAAA;AAAA,MAC1C,WAAWR,EAAaH,EAAO,MAAMW,KAAYX,EAAO,YAAY;AAAA,MAEnE,UAAAkB;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
1
+ {"version":3,"file":"breadcrumb.js","sources":["../../../src/components/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\nimport { ComposeAsChild } from \"../slot/compose-as-child\"\n\n/** Breadcrumb — Card's compound pattern applied to the nav / ol / li structure. */\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime (MDX call\n// sites do this), which `React.Children.only` rejects. Radix's Slot normalised that.\nfunction onlyChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children)\n return (elements.length === 1 ? elements[0] : children) as React.ReactElement\n}\n\nexport type BreadcrumbProps = React.ComponentProps<\"nav\"> & {\n separator?: React.ReactNode\n /**\n * Accessible name of the navigation landmark, read by screen readers. Pass a translated string\n * for any locale other than English. Defaults to \"Breadcrumb\".\n */\n \"aria-label\"?: string\n}\n\nconst useStyles = makeZenithStyles({\n // A truncating crumb can only shrink if every box above it may shrink below its content too. The\n // nav is the box a flex row (a view header) actually sizes, so it carries the rule; plain trails\n // keep their content size.\n root: {\n [`&:has([${SLOT_ATTR}=\"breadcrumb-item\"][data-truncate])`]: {\n minWidth: 0,\n },\n },\n list: {\n ...boxModel,\n // A layout row, not a numbered list: reset the browser's markers and indent so the trail does\n // not depend on the host shipping a CSS reset.\n listStyleType: \"none\",\n ...shorthands.margin(0),\n ...shorthands.padding(0),\n display: \"flex\",\n alignItems: \"center\",\n // gap-2\n ...shorthands.gap(tokens.spacingElement2),\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n minWidth: 0,\n },\n separator: {\n color: tokens.grayLight,\n },\n item: {\n display: \"inline-flex\",\n alignItems: \"center\",\n // gap-1\n ...shorthands.gap(tokens.spacingElement1),\n },\n itemTruncate: {\n ...boxModel,\n minWidth: 0,\n },\n truncate: {\n ...shorthands.overflow(\"hidden\"),\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n link: {\n // A browser underlines a bare `<a>`; the underline is a hover affordance here.\n textDecorationLine: \"none\",\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.grayLight,\n transitionProperty:\n \"color, background-color, border-color, text-decoration-color, fill, stroke\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n cursor: \"pointer\",\n \":hover\": {\n color: tokens.grayDefault,\n textDecorationLine: \"underline\",\n },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.accentA8,\n },\n },\n page: {\n fontWeight: tokens.fontWeightSemibold,\n color: tokens.grayDefault,\n },\n})\n\nexport const Breadcrumb = React.forwardRef<HTMLElement, BreadcrumbProps>(\n function Breadcrumb(\n {\n separator = \"/\",\n \"aria-label\": ariaLabel = \"Breadcrumb\",\n className,\n children,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const items = React.Children.toArray(children).filter(React.isValidElement)\n\n return (\n <nav\n ref={ref}\n data-slot=\"breadcrumb\"\n {...{ [SLOT_ATTR]: \"breadcrumb\" }}\n aria-label={ariaLabel}\n className={mergeClasses(styles.root, className)}\n {...props}\n >\n <ol className={styles.list}>\n {items.map((child, index) => (\n <React.Fragment key={index}>\n {index > 0 && (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={styles.separator}\n >\n {separator}\n </li>\n )}\n {child}\n </React.Fragment>\n ))}\n </ol>\n </nav>\n )\n }\n)\n\nexport type BreadcrumbItemProps = Omit<React.ComponentProps<\"a\">, \"href\"> & {\n href?: string\n isCurrent?: boolean\n /**\n * Render the child instead of the built-in `a`, keeping the link styling and slot markers. This\n * is how a consumer supplies a router link. The child must be one real element, not a Fragment.\n */\n asChild?: boolean\n /**\n * Keep the crumb on one line and cut it with an ellipsis when the trail runs out of room, with\n * the full text as its `title`. Pass `title` yourself when the children are not plain text.\n */\n truncate?: boolean\n}\n\nexport const BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n BreadcrumbItemProps\n>(function BreadcrumbItem(\n {\n href,\n isCurrent = false,\n className,\n children,\n asChild = false,\n truncate = false,\n title,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const isLink = !!href\n\n const truncateClass = truncate ? styles.truncate : undefined\n const fullText =\n title ??\n (truncate && (typeof children === \"string\" || typeof children === \"number\")\n ? String(children)\n : undefined)\n\n const linkProps = {\n \"data-slot\": \"breadcrumb-link\",\n [SLOT_ATTR]: \"breadcrumb-link\",\n ...(href ? { href } : {}),\n ...(fullText !== undefined ? { title: fullText } : {}),\n ...(isCurrent ? { \"aria-current\": \"page\" as const } : {}),\n ...props,\n }\n const linkClassName = mergeClasses(styles.link, truncateClass, className)\n\n const content = asChild ? (\n <ComposeAsChild {...linkProps} className={linkClassName}>\n {onlyChild(children)}\n </ComposeAsChild>\n ) : isLink ? (\n <a {...linkProps} className={linkClassName}>\n {children}\n </a>\n ) : (\n <span\n data-slot=\"breadcrumb-page\"\n {...{ [SLOT_ATTR]: \"breadcrumb-page\" }}\n className={mergeClasses(styles.page, truncateClass, className)}\n {...(fullText !== undefined ? { title: fullText } : {})}\n {...(isCurrent ? { \"aria-current\": \"page\" as const } : {})}\n >\n {children}\n </span>\n )\n\n return (\n <li\n ref={ref}\n data-slot=\"breadcrumb-item\"\n {...{ [SLOT_ATTR]: \"breadcrumb-item\" }}\n {...(truncate ? { \"data-truncate\": \"\" } : {})}\n className={mergeClasses(styles.item, truncate && styles.itemTruncate)}\n >\n {content}\n </li>\n )\n})\n"],"names":["onlyChild","children","elements","React","useStyles","makeZenithStyles","SLOT_ATTR","boxModel","shorthands","tokens.spacingElement2","tokens.textBase","tokens.leadingBase","tokens.grayLight","tokens.spacingElement1","tokens.fontWeightSemibold","tokens.grayDefault","tokens.accentA8","Breadcrumb","separator","ariaLabel","className","props","ref","styles","items","jsx","mergeClasses","child","index","jsxs","BreadcrumbItem","href","isCurrent","asChild","truncate","title","isLink","truncateClass","fullText","linkProps","linkClassName","content","ComposeAsChild"],"mappings":";;;;;;;AAcA,SAASA,EAAUC,GAA2B;AAC5C,QAAMC,IAAWC,EAAM,SAAS,QAAQF,CAAQ;AAChD,SAAQC,EAAS,WAAW,IAAIA,EAAS,CAAC,IAAID;AAChD;AAWA,MAAMG,IAAYC,EAAiB;AAAA;AAAA;AAAA;AAAA,EAIjC,MAAM;AAAA,IACJ,CAAC,UAAUC,CAAS,qCAAqC,GAAG;AAAA,MAC1D,UAAU;AAAA,IA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tB,GAAIO,MAAa,SAAY,EAAE,OAAOA,EAAA,IAAa,CAAA;AAAA,IACnD,GAAIN,IAAY,EAAE,gBAAgB,OAAA,IAAoB,CAAA;AAAA,IACtD,GAAGX;AAAA,EAAA,GAECmB,IAAgBd,EAAaH,EAAO,MAAMc,GAAejB,CAAS,GAElEqB,IAAUR,IACd,gBAAAR,EAACiB,GAAA,EAAgB,GAAGH,GAAW,WAAWC,GACvC,UAAAxC,EAAUC,CAAQ,GACrB,IACEmC,sBACD,KAAA,EAAG,GAAGG,GAAW,WAAWC,GAC1B,UAAAvC,GACH,IAEA,gBAAAwB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACJ,CAACnB,CAAS,GAAG;AAAA,MACnB,WAAWoB,EAAaH,EAAO,MAAMc,GAAejB,CAAS;AAAA,MAC5D,GAAIkB,MAAa,SAAY,EAAE,OAAOA,EAAA,IAAa,CAAA;AAAA,MACnD,GAAIN,IAAY,EAAE,gBAAgB,OAAA,IAAoB,CAAA;AAAA,MAEtD,UAAA/B;AAAA,IAAA;AAAA,EAAA;AAIL,SACE,gBAAAwB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,aAAU;AAAA,MACJ,CAAChB,CAAS,GAAG;AAAA,MAClB,GAAI4B,IAAW,EAAE,iBAAiB,GAAA,IAAO,CAAA;AAAA,MAC1C,WAAWR,EAAaH,EAAO,MAAMW,KAAYX,EAAO,YAAY;AAAA,MAEnE,UAAAkB;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as g } from "react/jsx-runtime";
2
2
  import * as n from "react";
3
- import { mergeClasses as R, SLOT_ATTR as S, shorthands as l } from "@epilot/zenith-runtime/v1/core.js";
3
+ import { mergeClasses as R, SLOT_ATTR as S, shorthands as l } from "@epilot/zenith-runtime/v1";
4
4
  import { makeZenithStyles as I } from "../../styles/make-styles.js";
5
5
  import { boxModel as a, nativeControl as L } from "../../styles/host-reset.js";
6
6
  import { capTrim as O } from "../../styles/text-box.js";
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1/core\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport { capTrim } from \"../../styles/text-box\"\nimport * as tokens from \"../../tokens\"\nimport { Button as ButtonPrimitive } from \"@base-ui/react/button\"\nimport { useRender } from \"@base-ui/react/use-render\"\n\n// `useRender` runs on every render to keep hook order stable; without an `asChild` child it is\n// disabled and this placeholder is never rendered.\nconst NO_SLOT_CHILD = <span />\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime (MDX call\n// sites do this). Radix's Slot normalised that, so the `asChild` shim has to as well.\nfunction onlySlotChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children).filter(React.isValidElement)\n return elements.length === 1 ? elements[0] : undefined\n}\n\nconst useStyles = makeZenithStyles({\n root: {\n ...nativeControl,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontWeight: tokens.fontWeightSemibold,\n whiteSpace: \"nowrap\",\n transitionProperty: \"all\",\n cursor: \"pointer\",\n flexShrink: 0,\n // Disabled keeps pointer events so a Tooltip can still explain why, but shows none of the\n // hover or press feedback (every variant guards those with `:not(:disabled)`) and no pointer.\n \":disabled\": { opacity: 0.5, cursor: \"not-allowed\" },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.focusRing,\n },\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \"& svg\": {\n flexShrink: 0,\n pointerEvents: \"none\",\n color: \"currentColor\",\n },\n },\n label: capTrim,\n primary: {\n backgroundColor: tokens.accentSolid,\n color: tokens.accentContrast,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSolidHover },\n \":active:not(:disabled)\": { backgroundColor: tokens.accentSolidHover },\n },\n secondary: {\n backgroundColor: tokens.accentSoft,\n color: tokens.accentOnSoft,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSoftHover },\n },\n tertiary: {\n backgroundColor: \"transparent\",\n color: tokens.accentA11,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSoft },\n },\n ghost: {\n backgroundColor: \"transparent\",\n color: tokens.grayA12,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSoft },\n },\n primaryDestructive: {\n backgroundColor: tokens.errorSolid,\n color: tokens.errorContrast,\n \":hover:not(:disabled)\": { backgroundColor: tokens.errorSolidHover },\n \":active:not(:disabled)\": { backgroundColor: tokens.errorSolidHover },\n },\n secondaryDestructive: {\n backgroundColor: tokens.errorSoft,\n color: tokens.errorOnSoft,\n \":hover:not(:disabled)\": { backgroundColor: tokens.errorSoftHover },\n },\n tertiaryDestructive: {\n backgroundColor: \"transparent\",\n color: tokens.errorA11,\n \":hover:not(:disabled)\": { backgroundColor: tokens.errorSoft },\n },\n xs: {\n ...boxModel,\n ...shorthands.paddingInline(\"0.5rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n // Cap trimming removes the line-height's leading from direct text. Keep the established\n // 24px control geometry explicitly instead of relying on that incidental text height.\n minHeight: \"1.5rem\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n gap: \"4px\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n sm: {\n ...boxModel,\n ...shorthands.paddingInline(tokens.spacingElement3),\n ...shorthands.paddingBlock(\"0.25rem\"),\n // As above, the fixed 28px size is part of Button's contract, independent of its label box.\n minHeight: \"1.75rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n gap: \"0.375rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n base: {\n ...boxModel,\n // Density-bound (DENSITY-SPEC.md §2.4, WP9B1-ACCEPTANCE-WP9B2A): padding-inline is the\n // compact/comfortable lever; min-height is floored by the fixed line-height + padding-block\n // below and cannot shrink, so it is bound too (compact === normal, comfortable raised via an\n // explicit minHeight above the natural content box, same mechanism `lg` already uses).\n ...shorthands.paddingInline(tokens.buttonBasePaddingInline),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: tokens.buttonBaseMinHeight,\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n lg: {\n ...boxModel,\n ...shorthands.paddingInline(\"1.25rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"2.5rem\",\n fontSize: tokens.textLg,\n lineHeight: tokens.leadingLg,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n iconXs: {\n ...boxModel,\n width: \"1.5rem\",\n height: \"1.5rem\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n iconSm: {\n ...boxModel,\n width: \"1.75rem\",\n height: \"1.75rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n icon: {\n ...boxModel,\n // Density-bound: a fixed square, no line-height floor (unlike `base`), so compact/comfortable\n // both move freely (DENSITY-SPEC.md §2.4).\n width: tokens.buttonIconSize,\n height: tokens.buttonIconSize,\n \"& svg\": { width: \"1.125rem\", height: \"1.125rem\" },\n },\n iconLg: {\n ...boxModel,\n width: \"2.5rem\",\n height: \"2.5rem\",\n \"& svg\": { width: \"1.5rem\", height: \"1.5rem\" },\n },\n normal: { borderRadius: tokens.radiusLg },\n rounded: { borderRadius: \"9999px\" },\n})\n\ntype FlatButtonChild = {\n node: React.ReactNode\n keyPath: string\n}\n\n/**\n * Fragments do not create boxes, so flatten them to the same leaf order the flex container sees.\n * React.Children.toArray handles nested arrays and gives keyed elements a stable local key; the\n * parent fragment path keeps equal keys from separate fragment scopes distinct.\n */\nfunction flattenButtonChildren(\n children: React.ReactNode,\n parentPath = \"button\"\n): FlatButtonChild[] {\n return React.Children.toArray(children).flatMap((node, index) => {\n const localKey =\n React.isValidElement(node) && node.key !== null\n ? String(node.key)\n : String(index)\n const keyPath = `${parentPath}/${localKey}`\n\n if (\n React.isValidElement<{ children?: React.ReactNode }>(node) &&\n node.type === React.Fragment\n ) {\n return flattenButtonChildren(node.props.children, keyPath)\n }\n\n return [{ node, keyPath }]\n })\n}\n\n/**\n * A flex container's direct text becomes an anonymous flex item, which `text-box` cannot select.\n * Recreate exactly those contiguous text runs as real label boxes. Consumer elements stay direct\n * children and whitespace-only runs stay raw, preserving today's element order and flex gaps.\n */\nfunction wrapButtonTextRuns(\n children: React.ReactNode,\n labelClassName: string\n): React.ReactNode[] {\n const output: React.ReactNode[] = []\n let textRun: FlatButtonChild[] = []\n\n const flushTextRun = () => {\n if (!textRun.length) return\n\n const whitespaceOnly = textRun.every(\n ({ node }) => typeof node === \"string\" && node.trim() === \"\"\n )\n if (whitespaceOnly) {\n output.push(...textRun.map(({ node }) => node))\n } else {\n output.push(\n <span\n key={`button-label:${textRun[0].keyPath}`}\n data-slot=\"button-label\"\n className={labelClassName}\n >\n {textRun.map(({ node }) => node)}\n </span>\n )\n }\n textRun = []\n }\n\n for (const child of flattenButtonChildren(children)) {\n if (typeof child.node === \"string\" || typeof child.node === \"number\") {\n textRun.push(child)\n continue\n }\n\n flushTextRun()\n output.push(\n React.isValidElement(child.node)\n ? React.cloneElement(child.node, { key: child.keyPath })\n : child.node\n )\n }\n flushTextRun()\n\n return output\n}\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"tertiary\" | \"ghost\"\nexport type ButtonSize =\n \"xs\" | \"sm\" | \"base\" | \"lg\" | \"icon-xs\" | \"icon-sm\" | \"icon\" | \"icon-lg\"\nexport type ButtonShape = \"normal\" | \"rounded\"\n\nexport type ButtonProps = Omit<\n React.ComponentProps<\"button\">,\n \"variant\" | \"size\" | \"shape\" | \"destructive\" | \"className\" | \"render\"\n> & {\n variant?: ButtonVariant\n size?: ButtonSize\n shape?: ButtonShape\n destructive?: boolean\n className?: string\n /**\n * Render the single child element instead of a `button`, keeping Button's styling and slot\n * markers. The child keeps its own semantics: a link stays a link. Without exactly one child\n * element, Button renders its `button`.\n */\n asChild?: boolean\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n variant = \"primary\",\n size = \"base\",\n shape = \"rounded\",\n destructive = false,\n className,\n asChild = false,\n children,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const variantSlot:\n | ButtonVariant\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\" =\n destructive && variant !== \"ghost\"\n ? (`${variant}Destructive` as\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\")\n : variant\n const sizeSlot:\n \"xs\" | \"sm\" | \"base\" | \"lg\" | \"iconXs\" | \"iconSm\" | \"icon\" | \"iconLg\" = (\n {\n xs: \"xs\",\n sm: \"sm\",\n base: \"base\",\n lg: \"lg\",\n \"icon-xs\": \"iconXs\",\n \"icon-sm\": \"iconSm\",\n icon: \"icon\",\n \"icon-lg\": \"iconLg\",\n } as const\n )[size]\n\n const rootClassName = mergeClasses(\n styles.root,\n styles[variantSlot],\n styles[sizeSlot],\n styles[shape],\n className\n )\n const slotChild = asChild ? onlySlotChild(children) : undefined\n\n // `asChild` decorates an element the caller owns, so it stays a plain prop merge as Radix's\n // Slot was. Base UI's button would give that element `role=\"button\"`, a tabindex and\n // Space-to-click, turning a link into a button for assistive technology.\n const slotted = useRender({\n render: slotChild ?? NO_SLOT_CHILD,\n props: {\n \"data-slot\": \"button\",\n [SLOT_ATTR]: \"button\",\n className: rootClassName,\n ...props,\n },\n ref,\n enabled: slotChild !== undefined,\n })\n if (slotted) return slotted\n\n return (\n <ButtonPrimitive\n ref={ref}\n data-slot=\"button\"\n {...{ [SLOT_ATTR]: \"button\" }}\n className={rootClassName}\n // Base UI's button defaults to `type=\"button\"`; a bare `<button>` submits its form, as this\n // component always did. A caller's or an overlay trigger's `type` still wins.\n type=\"submit\"\n {...props}\n >\n {wrapButtonTextRuns(children, styles.label)}\n </ButtonPrimitive>\n )\n }\n)\n"],"names":["NO_SLOT_CHILD","onlySlotChild","children","elements","React","useStyles","makeZenithStyles","nativeControl","tokens.fontWeightSemibold","tokens.focusRing","capTrim","tokens.accentSolid","tokens.accentContrast","tokens.accentSolidHover","tokens.accentSoft","tokens.accentOnSoft","tokens.accentSoftHover","tokens.accentA11","tokens.grayA12","tokens.errorSolid","tokens.errorContrast","tokens.errorSolidHover","tokens.errorSoft","tokens.errorOnSoft","tokens.errorSoftHover","tokens.errorA11","boxModel","shorthands","tokens.textXs","tokens.leadingXs","tokens.spacingElement3","tokens.textSm","tokens.leadingSm","tokens.buttonBasePaddingInline","tokens.buttonBaseMinHeight","tokens.textBase","tokens.leadingBase","tokens.textLg","tokens.leadingLg","tokens.buttonIconSize","tokens.radiusLg","flattenButtonChildren","parentPath","node","index","localKey","keyPath","wrapButtonTextRuns","labelClassName","output","textRun","flushTextRun","jsx","child","Button","variant","size","shape","destructive","className","asChild","props","ref","styles","variantSlot","sizeSlot","rootClassName","mergeClasses","slotChild","slotted","useRender","SLOT_ATTR","ButtonPrimitive"],"mappings":";;;;;;;;;AAcA,MAAMA,uBAAiB,QAAA,EAAK;AAI5B,SAASC,GAAcC,GAA2B;AAChD,QAAMC,IAAWC,EAAM,SAAS,QAAQF,CAAQ,EAAE,OAAOE,EAAM,cAAc;AAC7E,SAAOD,EAAS,WAAW,IAAIA,EAAS,CAAC,IAAI;AAC/C;AAEA,MAAME,KAAYC,EAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,GAAGC;AAAA,IACH,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAYC;AAAAA,IACZ,YAAY;AAAA,IACZ,oBAAoB;AAAA,IACpB,Q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OE,CAAQ;AAAA,MACfF,EAAON,CAAK;AAAA,MACZE;AAAA,IAAA,GAEIS,IAAYR,IAAU3D,GAAcC,CAAQ,IAAI,QAKhDmE,IAAUC,GAAU;AAAA,MACxB,QAAQF,KAAapE;AAAA,MACrB,OAAO;AAAA,QACL,aAAa;AAAA,QACb,CAACuE,CAAS,GAAG;AAAA,QACb,WAAWL;AAAA,QACX,GAAGL;AAAA,MAAA;AAAA,MAEL,KAAAC;AAAA,MACA,SAASM,MAAc;AAAA,IAAA,CACxB;AACD,WAAIC,KAGF,gBAAAjB;AAAA,MAACoB;AAAAA,MAAA;AAAA,QACC,KAAAV;AAAA,QACA,aAAU;AAAA,QACJ,CAACS,CAAS,GAAG;AAAA,QACnB,WAAWL;AAAA,QAGX,MAAK;AAAA,QACJ,GAAGL;AAAA,QAEH,UAAAd,GAAmB7C,GAAU6D,EAAO,KAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EAGhD;AACF;"}
1
+ {"version":3,"file":"button.js","sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport { capTrim } from \"../../styles/text-box\"\nimport * as tokens from \"../../tokens\"\nimport { Button as ButtonPrimitive } from \"@base-ui/react/button\"\nimport { useRender } from \"@base-ui/react/use-render\"\n\n// `useRender` runs on every render to keep hook order stable; without an `asChild` child it is\n// disabled and this placeholder is never rendered.\nconst NO_SLOT_CHILD = <span />\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime (MDX call\n// sites do this). Radix's Slot normalised that, so the `asChild` shim has to as well.\nfunction onlySlotChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children).filter(React.isValidElement)\n return elements.length === 1 ? elements[0] : undefined\n}\n\nconst useStyles = makeZenithStyles({\n root: {\n ...nativeControl,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontWeight: tokens.fontWeightSemibold,\n whiteSpace: \"nowrap\",\n transitionProperty: \"all\",\n cursor: \"pointer\",\n flexShrink: 0,\n // Disabled keeps pointer events so a Tooltip can still explain why, but shows none of the\n // hover or press feedback (every variant guards those with `:not(:disabled)`) and no pointer.\n \":disabled\": { opacity: 0.5, cursor: \"not-allowed\" },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.focusRing,\n },\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \"& svg\": {\n flexShrink: 0,\n pointerEvents: \"none\",\n color: \"currentColor\",\n },\n },\n label: capTrim,\n primary: {\n backgroundColor: tokens.accentSolid,\n color: tokens.accentContrast,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSolidHover },\n \":active:not(:disabled)\": { backgroundColor: tokens.accentSolidHover },\n },\n secondary: {\n backgroundColor: tokens.accentSoft,\n color: tokens.accentOnSoft,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSoftHover },\n },\n tertiary: {\n backgroundColor: \"transparent\",\n color: tokens.accentA11,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSoft },\n },\n ghost: {\n backgroundColor: \"transparent\",\n color: tokens.grayA12,\n \":hover:not(:disabled)\": { backgroundColor: tokens.accentSoft },\n },\n primaryDestructive: {\n backgroundColor: tokens.errorSolid,\n color: tokens.errorContrast,\n \":hover:not(:disabled)\": { backgroundColor: tokens.errorSolidHover },\n \":active:not(:disabled)\": { backgroundColor: tokens.errorSolidHover },\n },\n secondaryDestructive: {\n backgroundColor: tokens.errorSoft,\n color: tokens.errorOnSoft,\n \":hover:not(:disabled)\": { backgroundColor: tokens.errorSoftHover },\n },\n tertiaryDestructive: {\n backgroundColor: \"transparent\",\n color: tokens.errorA11,\n \":hover:not(:disabled)\": { backgroundColor: tokens.errorSoft },\n },\n xs: {\n ...boxModel,\n ...shorthands.paddingInline(\"0.5rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n // Cap trimming removes the line-height's leading from direct text. Keep the established\n // 24px control geometry explicitly instead of relying on that incidental text height.\n minHeight: \"1.5rem\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n gap: \"4px\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n sm: {\n ...boxModel,\n ...shorthands.paddingInline(tokens.spacingElement3),\n ...shorthands.paddingBlock(\"0.25rem\"),\n // As above, the fixed 28px size is part of Button's contract, independent of its label box.\n minHeight: \"1.75rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n gap: \"0.375rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n base: {\n ...boxModel,\n // Density-bound (DENSITY-SPEC.md §2.4, WP9B1-ACCEPTANCE-WP9B2A): padding-inline is the\n // compact/comfortable lever; min-height is floored by the fixed line-height + padding-block\n // below and cannot shrink, so it is bound too (compact === normal, comfortable raised via an\n // explicit minHeight above the natural content box, same mechanism `lg` already uses).\n ...shorthands.paddingInline(tokens.buttonBasePaddingInline),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: tokens.buttonBaseMinHeight,\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n lg: {\n ...boxModel,\n ...shorthands.paddingInline(\"1.25rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"2.5rem\",\n fontSize: tokens.textLg,\n lineHeight: tokens.leadingLg,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n iconXs: {\n ...boxModel,\n width: \"1.5rem\",\n height: \"1.5rem\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n iconSm: {\n ...boxModel,\n width: \"1.75rem\",\n height: \"1.75rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n icon: {\n ...boxModel,\n // Density-bound: a fixed square, no line-height floor (unlike `base`), so compact/comfortable\n // both move freely (DENSITY-SPEC.md §2.4).\n width: tokens.buttonIconSize,\n height: tokens.buttonIconSize,\n \"& svg\": { width: \"1.125rem\", height: \"1.125rem\" },\n },\n iconLg: {\n ...boxModel,\n width: \"2.5rem\",\n height: \"2.5rem\",\n \"& svg\": { width: \"1.5rem\", height: \"1.5rem\" },\n },\n normal: { borderRadius: tokens.radiusLg },\n rounded: { borderRadius: \"9999px\" },\n})\n\ntype FlatButtonChild = {\n node: React.ReactNode\n keyPath: string\n}\n\n/**\n * Fragments do not create boxes, so flatten them to the same leaf order the flex container sees.\n * React.Children.toArray handles nested arrays and gives keyed elements a stable local key; the\n * parent fragment path keeps equal keys from separate fragment scopes distinct.\n */\nfunction flattenButtonChildren(\n children: React.ReactNode,\n parentPath = \"button\"\n): FlatButtonChild[] {\n return React.Children.toArray(children).flatMap((node, index) => {\n const localKey =\n React.isValidElement(node) && node.key !== null\n ? String(node.key)\n : String(index)\n const keyPath = `${parentPath}/${localKey}`\n\n if (\n React.isValidElement<{ children?: React.ReactNode }>(node) &&\n node.type === React.Fragment\n ) {\n return flattenButtonChildren(node.props.children, keyPath)\n }\n\n return [{ node, keyPath }]\n })\n}\n\n/**\n * A flex container's direct text becomes an anonymous flex item, which `text-box` cannot select.\n * Recreate exactly those contiguous text runs as real label boxes. Consumer elements stay direct\n * children and whitespace-only runs stay raw, preserving today's element order and flex gaps.\n */\nfunction wrapButtonTextRuns(\n children: React.ReactNode,\n labelClassName: string\n): React.ReactNode[] {\n const output: React.ReactNode[] = []\n let textRun: FlatButtonChild[] = []\n\n const flushTextRun = () => {\n if (!textRun.length) return\n\n const whitespaceOnly = textRun.every(\n ({ node }) => typeof node === \"string\" && node.trim() === \"\"\n )\n if (whitespaceOnly) {\n output.push(...textRun.map(({ node }) => node))\n } else {\n output.push(\n <span\n key={`button-label:${textRun[0].keyPath}`}\n data-slot=\"button-label\"\n className={labelClassName}\n >\n {textRun.map(({ node }) => node)}\n </span>\n )\n }\n textRun = []\n }\n\n for (const child of flattenButtonChildren(children)) {\n if (typeof child.node === \"string\" || typeof child.node === \"number\") {\n textRun.push(child)\n continue\n }\n\n flushTextRun()\n output.push(\n React.isValidElement(child.node)\n ? React.cloneElement(child.node, { key: child.keyPath })\n : child.node\n )\n }\n flushTextRun()\n\n return output\n}\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"tertiary\" | \"ghost\"\nexport type ButtonSize =\n \"xs\" | \"sm\" | \"base\" | \"lg\" | \"icon-xs\" | \"icon-sm\" | \"icon\" | \"icon-lg\"\nexport type ButtonShape = \"normal\" | \"rounded\"\n\nexport type ButtonProps = Omit<\n React.ComponentProps<\"button\">,\n \"variant\" | \"size\" | \"shape\" | \"destructive\" | \"className\" | \"render\"\n> & {\n variant?: ButtonVariant\n size?: ButtonSize\n shape?: ButtonShape\n destructive?: boolean\n className?: string\n /**\n * Render the single child element instead of a `button`, keeping Button's styling and slot\n * markers. The child keeps its own semantics: a link stays a link. Without exactly one child\n * element, Button renders its `button`.\n */\n asChild?: boolean\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n variant = \"primary\",\n size = \"base\",\n shape = \"rounded\",\n destructive = false,\n className,\n asChild = false,\n children,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const variantSlot:\n | ButtonVariant\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\" =\n destructive && variant !== \"ghost\"\n ? (`${variant}Destructive` as\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\")\n : variant\n const sizeSlot:\n \"xs\" | \"sm\" | \"base\" | \"lg\" | \"iconXs\" | \"iconSm\" | \"icon\" | \"iconLg\" = (\n {\n xs: \"xs\",\n sm: \"sm\",\n base: \"base\",\n lg: \"lg\",\n \"icon-xs\": \"iconXs\",\n \"icon-sm\": \"iconSm\",\n icon: \"icon\",\n \"icon-lg\": \"iconLg\",\n } as const\n )[size]\n\n const rootClassName = mergeClasses(\n styles.root,\n styles[variantSlot],\n styles[sizeSlot],\n styles[shape],\n className\n )\n const slotChild = asChild ? onlySlotChild(children) : undefined\n\n // `asChild` decorates an element the caller owns, so it stays a plain prop merge as Radix's\n // Slot was. Base UI's button would give that element `role=\"button\"`, a tabindex and\n // Space-to-click, turning a link into a button for assistive technology.\n const slotted = useRender({\n render: slotChild ?? NO_SLOT_CHILD,\n props: {\n \"data-slot\": \"button\",\n [SLOT_ATTR]: \"button\",\n className: rootClassName,\n ...props,\n },\n ref,\n enabled: slotChild !== undefined,\n })\n if (slotted) return slotted\n\n return (\n <ButtonPrimitive\n ref={ref}\n data-slot=\"button\"\n {...{ [SLOT_ATTR]: \"button\" }}\n className={rootClassName}\n // Base UI's button defaults to `type=\"button\"`; a bare `<button>` submits its form, as this\n // component always did. A caller's or an overlay trigger's `type` still wins.\n type=\"submit\"\n {...props}\n >\n {wrapButtonTextRuns(children, styles.label)}\n </ButtonPrimitive>\n )\n }\n)\n"],"names":["NO_SLOT_CHILD","onlySlotChild","children","elements","React","useStyles","makeZenithStyles","nativeControl","tokens.fontWeightSemibold","tokens.focusRing","capTrim","tokens.accentSolid","tokens.accentContrast","tokens.accentSolidHover","tokens.accentSoft","tokens.accentOnSoft","tokens.accentSoftHover","tokens.accentA11","tokens.grayA12","tokens.errorSolid","tokens.errorContrast","tokens.errorSolidHover","tokens.errorSoft","tokens.errorOnSoft","tokens.errorSoftHover","tokens.errorA11","boxModel","shorthands","tokens.textXs","tokens.leadingXs","tokens.spacingElement3","tokens.textSm","tokens.leadingSm","tokens.buttonBasePaddingInline","tokens.buttonBaseMinHeight","tokens.textBase","tokens.leadingBase","tokens.textLg","tokens.leadingLg","tokens.buttonIconSize","tokens.radiusLg","flattenButtonChildren","parentPath","node","index","localKey","keyPath","wrapButtonTextRuns","labelClassName","output","textRun","flushTextRun","jsx","child","Button","variant","size","shape","destructive","className","asChild","props","ref","styles","variantSlot","sizeSlot","rootClassName","mergeClasses","slotChild","slotted","useRender","SLOT_ATTR","ButtonPrimitive"],"mappings":";;;;;;;;;AAcA,MAAMA,uBAAiB,QAAA,EAAK;AAI5B,SAASC,GAAcC,GAA2B;AAChD,QAAMC,IAAWC,EAAM,SAAS,QAAQF,CAAQ,EAAE,OAAOE,EAAM,cAAc;AAC7E,SAAOD,EAAS,WAAW,IAAIA,EAAS,CAAC,IAAI;AAC/C;AAEA,MAAME,KAAYC,EAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,GAAGC;AAAA,IACH,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAYC;AAAAA,IACZ,YAAY;AAAA,IACZ,oBAAoB;AAAA,IACpB,QAAQ;AAAA,IACR,YAAY;AAAA;AAAA;AAAA,IAGZ,aAAa,EAAE,SAAS,KAAK,QAAQ,cAAA;AAAA,IACrC,kBAAkB;AAAA,MAChB,cAAc;AAAA,MACd,cAAc;AAAA,MACd,eAAe;AAAA,MACf,cAAcC;AAAAA,IAAO;AAAA,IAEvB,2CAA2C;AAAA,MACzC,oBAAoB;AAAA,IAAA;AAAA,IAEtB,SAAS;AAAA,MACP,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,EACT;AAAA,EAEF,OAAOC;AAAA,EACP,SAAS;AAAA,IACP,iBAAiBC;AAAAA,IACjB,OAAOC;AAAAA,IACP,yBAAyB,EAAE,iBAAiBC,EAAO;AAAA,IACnD,0BAA0B,EAAE,iBAAiBA,EAAO;AAAA,EAAiB;AAAA,EAEvE,WAAW;AAAA,IACT,iBAAiBC;AAAAA,IACjB,OAAOC;AAAAA,IACP,yBAAyB,EAAE,iBAAiBC,EAAO;AAAA,EAAgB;AAAA,EAErE,UAAU;AAAA,IACR,iBAAiB;AAAA,IACjB,OAAOC;AAAAA,IACP,yBAAyB,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SAAAmD,IAAU;AAAA,IACV,MAAAC,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,aAAAC,IAAc;AAAA,IACd,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAAA1D;AAAA,IACA,GAAG2D;AAAA,EAAA,GAELC,GACA;AACA,UAAMC,IAAS1D,GAAA,GACT2D,IAKJN,KAAeH,MAAY,UACtB,GAAGA,CAAO,gBAIXA,GACAU,IAEJ;AAAA,MACE,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,WAAW;AAAA,MACX,MAAM;AAAA,MACN,WAAW;AAAA,IAAA,EAEbT,CAAI,GAEAU,IAAgBC;AAAA,MACpBJ,EAAO;AAAA,MACPA,EAAOC,CAAW;AAAA,MAClBD,EAAOE,CAAQ;AAAA,MACfF,EAAON,CAAK;AAAA,MACZE;AAAA,IAAA,GAEIS,IAAYR,IAAU3D,GAAcC,CAAQ,IAAI,QAKhDmE,IAAUC,GAAU;AAAA,MACxB,QAAQF,KAAapE;AAAA,MACrB,OAAO;AAAA,QACL,aAAa;AAAA,QACb,CAACuE,CAAS,GAAG;AAAA,QACb,WAAWL;AAAA,QACX,GAAGL;AAAA,MAAA;AAAA,MAEL,KAAAC;AAAA,MACA,SAASM,MAAc;AAAA,IAAA,CACxB;AACD,WAAIC,KAGF,gBAAAjB;AAAA,MAACoB;AAAAA,MAAA;AAAA,QACC,KAAAV;AAAA,QACA,aAAU;AAAA,QACJ,CAACS,CAAS,GAAG;AAAA,QACnB,WAAWL;AAAA,QAGX,MAAK;AAAA,QACJ,GAAGL;AAAA,QAEH,UAAAd,GAAmB7C,GAAU6D,EAAO,KAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EAGhD;AACF;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
2
  import * as p from "react";
3
- import { mergeClasses as u, SLOT_ATTR as s, shorthands as o } from "@epilot/zenith-runtime/v1/core.js";
3
+ import { mergeClasses as u, SLOT_ATTR as s, shorthands as o } from "@epilot/zenith-runtime/v1";
4
4
  import { makeZenithStyles as m } from "../../styles/make-styles.js";
5
5
  import { boxModel as n } from "../../styles/host-reset.js";
6
6
  import { fontWeightMedium as f, leadingSm as h, textSm as b, grayA4 as x, spacingElement3 as R, spacingGroup2 as S, grayA5 as v, radiusMd as B, spacingElement2 as g } from "../../tokens/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"button-group.js","sources":["../../../src/components/button-group/button-group.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1/core\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\nimport { Separator, type SeparatorProps } from \"../separator/separator\"\n\n/**\n * ButtonGroup — compound component family for grouping buttons, text, and separators. One\n * `makeZenithStyles` call for the whole family, one slot per sub-component (following `card.tsx`).\n */\n\nexport type ButtonGroupOrientation = \"horizontal\" | \"vertical\"\n\nconst useStyles = makeZenithStyles({\n root: {\n ...boxModel,\n display: \"flex\",\n width: \"fit-content\",\n alignItems: \"stretch\",\n \"& > *:focus-visible\": {\n zIndex: 10,\n position: \"relative\",\n },\n [`&:has(> [${SLOT_ATTR}=\"button-group\"])`]: {\n ...shorthands.gap(tokens.spacingElement2),\n },\n },\n horizontal: {\n \"& > *:not(:first-child)\": {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderLeftWidth: 0,\n },\n \"& > *:not(:last-child)\": {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n },\n vertical: {\n flexDirection: \"column\",\n \"& > *:not(:first-child)\": {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTopWidth: 0,\n },\n \"& > *:not(:last-child)\": {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n },\n },\n text: {\n ...boxModel,\n backgroundColor: tokens.grayA4,\n display: \"flex\",\n alignItems: \"center\",\n ...shorthands.gap(tokens.spacingElement2),\n ...shorthands.borderRadius(tokens.radiusMd),\n ...shorthands.border(\"1px\", \"solid\", tokens.grayA5),\n ...shorthands.padding(tokens.spacingElement3, tokens.spacingGroup2),\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n fontWeight: tokens.fontWeightMedium,\n // Tailwind `shadow-xs` — literal per CONVENTIONS B7\n boxShadow: \"0 1px 2px 0 #0000000d\",\n \"& svg\": {\n pointerEvents: \"none\",\n width: \"1rem\",\n height: \"1rem\",\n },\n },\n separator: {\n ...shorthands.margin(0),\n position: \"relative\",\n alignSelf: \"stretch\",\n backgroundColor: \"transparent\",\n },\n separatorVertical: {\n ...boxModel,\n height: \"1px\",\n },\n})\n\nexport type ButtonGroupProps = React.ComponentProps<\"div\"> & {\n orientation?: ButtonGroupOrientation\n}\n\nexport const ButtonGroup = React.forwardRef<HTMLDivElement, ButtonGroupProps>(\n function ButtonGroup(\n { className, orientation = \"horizontal\", ...props },\n ref\n ) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n role=\"group\"\n data-slot=\"button-group\"\n {...{ [SLOT_ATTR]: \"button-group\" }}\n data-orientation={orientation}\n className={mergeClasses(styles.root, styles[orientation], className)}\n {...props}\n />\n )\n }\n)\n\nexport type ButtonGroupTextProps = React.ComponentProps<\"div\">\n\nexport const ButtonGroupText = React.forwardRef<\n HTMLDivElement,\n ButtonGroupTextProps\n>(function ButtonGroupText({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"button-group-text\"\n {...{ [SLOT_ATTR]: \"button-group-text\" }}\n className={mergeClasses(styles.text, className)}\n {...props}\n />\n )\n})\n\nexport type ButtonGroupSeparatorProps = SeparatorProps\n\nexport const ButtonGroupSeparator = React.forwardRef<\n HTMLDivElement,\n ButtonGroupSeparatorProps\n>(function ButtonGroupSeparator(\n { className, orientation = \"vertical\", ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <Separator\n ref={ref}\n data-slot=\"button-group-separator\"\n {...{ [SLOT_ATTR]: \"button-group-separator\" }}\n orientation={orientation}\n className={mergeClasses(\n styles.separator,\n orientation === \"vertical\" && styles.separatorVertical,\n className\n )}\n {...props}\n />\n )\n})\n"],"names":["useStyles","makeZenithStyles","boxModel","SLOT_ATTR","shorthands","tokens.spacingElement2","tokens.grayA4","tokens.radiusMd","tokens.grayA5","tokens.spacingElement3","tokens.spacingGroup2","tokens.textSm","tokens.leadingSm","tokens.fontWeightMedium","ButtonGroup","React","className","orientation","props","ref","styles","jsx","mergeClasses","ButtonGroupText","ButtonGroupSeparator","Separator"],"mappings":";;;;;;;AAiBA,MAAMA,IAAYC,EAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,GAAGC;AAAA,IACH,SAAS;AAAA,IACT,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,uBAAuB;AAAA,MACrB,QAAQ;AAAA,MACR,UAAU;AAAA,IAAA;AAAA,IAEZ,CAAC,YAAYC,CAAS,mBAAmB,GAAG;AAAA,MAC1C,GAAGC,EAAW,IAAIC,CAAsB;AAAA,IAAA;AAAA,EAC1C;AAAA,EAEF,YAAY;AAAA,IACV,2BAA2B;AAAA,MACzB,qBAAqB;AAAA,MACrB,wBAAwB;AAAA,MACxB,iBAAiB;AAAA,IAAA;AAAA,IAEnB,0BAA0B;AAAA,MACxB,sBAAsB;AAAA,MACtB,yBAAyB;AAAA,IAAA;AAAA,EAC3B;AAAA,EAEF,UAAU;AAAA,IACR,eAAe;AAAA,IACf,2BAA2B;AAAA,MACzB,qBAAqB;AAAA,MACrB,sBAAsB;AAAA,MACtB,gBAAgB;AAAA,IAAA;AAAA,IAElB,0BAA0B;AAAA,MACxB,wBAAwB;AAAA,MACxB,yBAAyB;AAAA,IAAA;AAAA,EAC3B;AAAA,EAEF,MAAM;AAAA,IACJ,GAAGH;AA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AAG;AAAA,MACnB,WAAWmB,EAAaF,EAAO,MAAMJ,CAAS;AAAA,MAC7C,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC,GAIYM,IAAuBT,EAAM,WAGxC,SACA,EAAE,WAAAC,GAAW,aAAAC,IAAc,YAAY,GAAGC,EAAA,GAC1CC,GACA;AACA,QAAMC,IAASpB,EAAA;AAEf,SACE,gBAAAqB;AAAA,IAACI;AAAA,IAAA;AAAA,MACC,KAAAN;AAAA,MACA,aAAU;AAAA,MACJ,CAAChB,CAAS,GAAG;AAAA,MACnB,aAAAc;AAAA,MACA,WAAWK;AAAA,QACTF,EAAO;AAAA,QACPH,MAAgB,cAAcG,EAAO;AAAA,QACrCJ;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
1
+ {"version":3,"file":"button-group.js","sources":["../../../src/components/button-group/button-group.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\nimport { Separator, type SeparatorProps } from \"../separator/separator\"\n\n/**\n * ButtonGroup — compound component family for grouping buttons, text, and separators. One\n * `makeZenithStyles` call for the whole family, one slot per sub-component (following `card.tsx`).\n */\n\nexport type ButtonGroupOrientation = \"horizontal\" | \"vertical\"\n\nconst useStyles = makeZenithStyles({\n root: {\n ...boxModel,\n display: \"flex\",\n width: \"fit-content\",\n alignItems: \"stretch\",\n \"& > *:focus-visible\": {\n zIndex: 10,\n position: \"relative\",\n },\n [`&:has(> [${SLOT_ATTR}=\"button-group\"])`]: {\n ...shorthands.gap(tokens.spacingElement2),\n },\n },\n horizontal: {\n \"& > *:not(:first-child)\": {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderLeftWidth: 0,\n },\n \"& > *:not(:last-child)\": {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n },\n vertical: {\n flexDirection: \"column\",\n \"& > *:not(:first-child)\": {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTopWidth: 0,\n },\n \"& > *:not(:last-child)\": {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n },\n },\n text: {\n ...boxModel,\n backgroundColor: tokens.grayA4,\n display: \"flex\",\n alignItems: \"center\",\n ...shorthands.gap(tokens.spacingElement2),\n ...shorthands.borderRadius(tokens.radiusMd),\n ...shorthands.border(\"1px\", \"solid\", tokens.grayA5),\n ...shorthands.padding(tokens.spacingElement3, tokens.spacingGroup2),\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n fontWeight: tokens.fontWeightMedium,\n // Tailwind `shadow-xs` — literal per CONVENTIONS B7\n boxShadow: \"0 1px 2px 0 #0000000d\",\n \"& svg\": {\n pointerEvents: \"none\",\n width: \"1rem\",\n height: \"1rem\",\n },\n },\n separator: {\n ...shorthands.margin(0),\n position: \"relative\",\n alignSelf: \"stretch\",\n backgroundColor: \"transparent\",\n },\n separatorVertical: {\n ...boxModel,\n height: \"1px\",\n },\n})\n\nexport type ButtonGroupProps = React.ComponentProps<\"div\"> & {\n orientation?: ButtonGroupOrientation\n}\n\nexport const ButtonGroup = React.forwardRef<HTMLDivElement, ButtonGroupProps>(\n function ButtonGroup(\n { className, orientation = \"horizontal\", ...props },\n ref\n ) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n role=\"group\"\n data-slot=\"button-group\"\n {...{ [SLOT_ATTR]: \"button-group\" }}\n data-orientation={orientation}\n className={mergeClasses(styles.root, styles[orientation], className)}\n {...props}\n />\n )\n }\n)\n\nexport type ButtonGroupTextProps = React.ComponentProps<\"div\">\n\nexport const ButtonGroupText = React.forwardRef<\n HTMLDivElement,\n ButtonGroupTextProps\n>(function ButtonGroupText({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"button-group-text\"\n {...{ [SLOT_ATTR]: \"button-group-text\" }}\n className={mergeClasses(styles.text, className)}\n {...props}\n />\n )\n})\n\nexport type ButtonGroupSeparatorProps = SeparatorProps\n\nexport const ButtonGroupSeparator = React.forwardRef<\n HTMLDivElement,\n ButtonGroupSeparatorProps\n>(function ButtonGroupSeparator(\n { className, orientation = \"vertical\", ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <Separator\n ref={ref}\n data-slot=\"button-group-separator\"\n {...{ [SLOT_ATTR]: \"button-group-separator\" }}\n orientation={orientation}\n className={mergeClasses(\n styles.separator,\n orientation === \"vertical\" && styles.separatorVertical,\n className\n )}\n {...props}\n />\n )\n})\n"],"names":["useStyles","makeZenithStyles","boxModel","SLOT_ATTR","shorthands","tokens.spacingElement2","tokens.grayA4","tokens.radiusMd","tokens.grayA5","tokens.spacingElement3","tokens.spacingGroup2","tokens.textSm","tokens.leadingSm","tokens.fontWeightMedium","ButtonGroup","React","className","orientation","props","ref","styles","jsx","mergeClasses","ButtonGroupText","ButtonGroupSeparator","Separator"],"mappings":";;;;;;;AAiBA,MAAMA,IAAYC,EAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,GAAGC;AAAA,IACH,SAAS;AAAA,IACT,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,uBAAuB;AAAA,MACrB,QAAQ;AAAA,MACR,UAAU;AAAA,IAAA;AAAA,IAEZ,CAAC,YAAYC,CAAS,mBAAmB,GAAG;AAAA,MAC1C,GAAGC,EAAW,IAAIC,CAAsB;AAAA,IAAA;AAAA,EAC1C;AAAA,EAEF,YAAY;AAAA,IACV,2BAA2B;AAAA,MACzB,qBAAqB;AAAA,MACrB,wBAAwB;AAAA,MACxB,iBAAiB;AAAA,IAAA;AAAA,IAEnB,0BAA0B;AAAA,MACxB,sBAAsB;AAAA,MACtB,yBAAyB;AAAA,IAAA;AAAA,EAC3B;AAAA,EAEF,UAAU;AAAA,IACR,eAAe;AAA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F,GAIaK,IAAkBR,EAAM,WAGnC,SAAyB,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,GAAK;AACvD,QAAMC,IAASpB,EAAA;AAEf,SACE,gBAAAqB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,aAAU;AAAA,MACJ,CAAChB,CAAS,GAAG;AAAA,MACnB,WAAWmB,EAAaF,EAAO,MAAMJ,CAAS;AAAA,MAC7C,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC,GAIYM,IAAuBT,EAAM,WAGxC,SACA,EAAE,WAAAC,GAAW,aAAAC,IAAc,YAAY,GAAGC,EAAA,GAC1CC,GACA;AACA,QAAMC,IAASpB,EAAA;AAEf,SACE,gBAAAqB;AAAA,IAACI;AAAA,IAAA;AAAA,MACC,KAAAN;AAAA,MACA,aAAU;AAAA,MACJ,CAAChB,CAAS,GAAG;AAAA,MACnB,aAAAc;AAAA,MACA,WAAWK;AAAA,QACTF,EAAO;AAAA,QACPH,MAAgB,cAAcG,EAAO;AAAA,QACrCJ;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as n, jsxs as V } from "react/jsx-runtime";
2
2
  import * as a from "react";
3
- import { mergeClasses as h, SLOT_ATTR as C, shorthands as v } from "@epilot/zenith-runtime/v1/core.js";
3
+ import { mergeClasses as h, SLOT_ATTR as C, shorthands as v } from "@epilot/zenith-runtime/v1";
4
4
  import { makeZenithStyles as E } from "../../styles/make-styles.js";
5
5
  import { boxModel as c } from "../../styles/host-reset.js";
6
6
  import { spacingGroup2 as x, spacingLayout1 as S, spacingElement2 as I, spacingLayout2 as N, leadingSm as R, textSm as L, fontWeightSemibold as $, leadingBase as j, textBase as z, spacingElement3 as u, spacingElement1 as G, surfaceRadiusContainer as H } from "../../tokens/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"callout.js","sources":["../../../src/components/callout/callout.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1/core\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport { NS } from \"../../tokens\"\nimport * as tokens from \"../../tokens\"\nimport { ClearButton } from \"../../lib/clear-button\"\nimport { CloseIcon } from \"../../lib/icons\"\n\n/**\n * Callout — Badge's colour collapse applied to Card's compound pattern, in one makeZenithStyles\n * call. v1 hardcodes two variants per family as class strings (`bg-accent-soft text-accent-a12`,\n * ...).\n */\n\nconst InfoIcon = React.forwardRef<SVGSVGElement, React.ComponentProps<\"svg\">>(\n function InfoIcon(props, ref) {\n return (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M12.0003 16.75C12.2129 16.75 12.391 16.6781 12.5345 16.5343C12.6782 16.3906 12.75 16.2125 12.75 16V11.75C12.75 11.5375 12.6781 11.3593 12.5343 11.2155C12.3904 11.0718 12.2122 11 11.9997 11C11.7871 11 11.609 11.0718 11.4655 11.2155C11.3218 11.3593 11.25 11.5375 11.25 11.75V16C11.25 16.2125 11.3219 16.3906 11.4658 16.5343C11.6096 16.6781 11.7878 16.75 12.0003 16.75ZM12 9.2885C12.2288 9.2885 12.4207 9.21108 12.5755 9.05625C12.7303 8.90142 12.8077 8.70958 12.8077 8.48075C12.8077 8.25192 12.7303 8.06008 12.5755 7.90525C12.4207 7.75058 12.2288 7.67325 12 7.67325C11.7712 7.67325 11.5793 7.75058 11.4245 7.90525C11.2697 8.06008 11.1923 8.25192 11.1923 8.48075C11.1923 8.70958 11.2697 8.90142 11.4245 9.05625C11.5793 9.21108 11.7712 9.2885 12 9.2885ZM12.0017 21.5C10.6877 21.5 9.45267 21.2507 8.2965 20.752C7.14033 20.2533 6.13467 19.5766 5.2795 18.7218C4.42433 17.8669 3.74725 16.8617 3.24825 15.706C2.74942 14.5503 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45267 3.248 8.2965C3.74667 7.14033 4.42342 6.13467 5.27825 5.2795C6.13308 4.42433 7.13833 3.74725 8.294 3.24825C9.44967 2.74942 10.6844 2.5 11.9982 2.5C13.3122 2.5 14.5473 2.74933 15.7035 3.248C16.8597 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.13308 20.2528 7.13833 20.7518 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9982C21.5 13.3122 21.2507 14.5473 20.752 15.7035C20.2533 16.8597 19.5766 17.8653 18.7218 18.7205C17.8669 19.5757 16.8617 20.2528 15.706 20.7518C14.5503 21.2506 13.3156 21.5 12.0017 21.5Z\" />\n </svg>\n )\n }\n)\n\nconst WarningIcon = React.forwardRef<\n SVGSVGElement,\n React.ComponentProps<\"svg\">\n>(function WarningIcon(props, ref) {\n return (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M3.4255 20.5C3.256 20.5 3.10375 20.4586 2.96875 20.3757C2.83375 20.2929 2.72883 20.1837 2.654 20.048C2.576 19.9133 2.53308 19.7675 2.52525 19.6105C2.51742 19.4535 2.55975 19.298 2.65225 19.144L11.213 4.356C11.3057 4.202 11.4215 4.08817 11.5605 4.0145C11.6997 3.94083 11.8462 3.904 12 3.904C12.1538 3.904 12.3003 3.94083 12.4395 4.0145C12.5785 4.08817 12.6943 4.202 12.787 4.356L21.3477 19.144C21.4402 19.298 21.4826 19.4535 21.4747 19.6105C21.4669 19.7675 21.424 19.9133 21.346 20.048C21.2712 20.1837 21.1663 20.2929 21.0313 20.3757C20.8963 20.4586 20.744 20.5 20.5745 20.5H3.4255ZM12 17.8077C12.2288 17.8077 12.4207 17.7303 12.5755 17.5755C12.7303 17.4207 12.8078 17.2288 12.8078 17C12.8078 16.7712 12.7303 16.5793 12.5755 16.4245C12.4207 16.2697 12.2288 16.1923 12 16.1923C11.7712 16.1923 11.5793 16.2697 11.4245 16.4245C11.2697 16.5793 11.1923 16.7712 11.1923 17C11.1923 17.2288 11.2697 17.4207 11.4245 17.5755C11.5793 17.7303 11.7712 17.8077 12 17.8077ZM12.0003 15.1923C12.2129 15.1923 12.391 15.1204 12.5345 14.9768C12.6782 14.8329 12.75 14.6548 12.75 14.4423V10.9423C12.75 10.7298 12.6781 10.5517 12.5342 10.408C12.3904 10.2642 12.2122 10.1923 11.9997 10.1923C11.7871 10.1923 11.609 10.2642 11.4655 10.408C11.3218 10.5517 11.25 10.7298 11.25 10.9423V14.4423C11.25 14.6548 11.3219 14.8329 11.4658 14.9768C11.6096 15.1204 11.7878 15.1923 12.0003 15.1923Z\" />\n </svg>\n )\n})\n\nconst CheckIcon = React.forwardRef<SVGSVGElement, React.ComponentProps<\"svg\">>(\n function CheckIcon(props, ref) {\n return (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M10.5808 14.1463L8.25775 11.823C8.11925 11.6847 7.94517 11.6138 7.7355 11.6105C7.526 11.6073 7.34875 11.6782 7.20375 11.823C7.05892 11.968 6.9865 12.1437 6.9865 12.35C6.9865 12.5563 7.05892 12.732 7.20375 12.877L9.948 15.6212C10.1288 15.8019 10.3398 15.8922 10.5808 15.8922C10.8218 15.8922 11.0327 15.8019 11.2135 15.6212L16.777 10.0577C16.9153 9.91925 16.9862 9.74517 16.9895 9.5355C16.9927 9.326 16.9218 9.14875 16.777 9.00375C16.632 8.85892 16.4563 8.7865 16.25 8.7865C16.0437 8.7865 15.868 8.85892 15.723 9.00375L10.5808 14.1463ZM12.0017 21.5C10.6877 21.5 9.45267 21.2507 8.2965 20.752C7.14033 20.2533 6.13467 19.5766 5.2795 18.7218C4.42433 17.8669 3.74725 16.8617 3.24825 15.706C2.74942 14.5503 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45267 3.248 8.2965C3.74667 7.14033 4.42342 6.13467 5.27825 5.2795C6.13308 4.42433 7.13833 3.74725 8.294 3.24825C9.44967 2.74942 10.6844 2.5 11.9982 2.5C13.3122 2.5 14.5473 2.74933 15.7035 3.248C16.8597 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.13308 20.2528 7.13833 20.7518 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9982C21.5 13.3122 21.2507 14.5473 20.752 15.7035C20.2533 16.8597 19.5766 17.8653 18.7218 18.7205C17.8669 19.5757 16.8617 20.2528 15.706 20.7518C14.5503 21.2506 13.3156 21.5 12.0017 21.5Z\" />\n </svg>\n )\n }\n)\n\nconst ErrorIcon = React.forwardRef<SVGSVGElement, React.ComponentProps<\"svg\">>(\n function ErrorIcon(props, ref) {\n return (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M12 16.7307C12.2288 16.7307 12.4207 16.6533 12.5755 16.4985C12.7303 16.3437 12.8077 16.1518 12.8077 15.923C12.8077 15.6942 12.7303 15.5023 12.5755 15.3475C12.4207 15.1928 12.2288 15.1155 12 15.1155C11.7712 15.1155 11.5793 15.1928 11.4245 15.3475C11.2697 15.5023 11.1923 15.6942 11.1923 15.923C11.1923 16.1518 11.2697 16.3437 11.4245 16.4985C11.5793 16.6533 11.7712 16.7307 12 16.7307ZM12.0003 13.077C12.2129 13.077 12.391 13.0051 12.5345 12.8613C12.6782 12.7176 12.75 12.5395 12.75 12.327V7.827C12.75 7.6145 12.6781 7.43633 12.5343 7.2925C12.3904 7.14883 12.2122 7.077 11.9997 7.077C11.7871 7.077 11.609 7.14883 11.4655 7.2925C11.3218 7.43633 11.25 7.6145 11.25 7.827V12.327C11.25 12.5395 11.3219 12.7176 11.4658 12.8613C11.6096 13.0051 11.7878 13.077 12.0003 13.077ZM12.0017 21.5C10.6877 21.5 9.45267 21.2507 8.2965 20.752C7.14033 20.2533 6.13467 19.5766 5.2795 18.7218C4.42433 17.8669 3.74725 16.8617 3.24825 15.706C2.74942 14.5503 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45267 3.248 8.2965C3.74667 7.14033 4.42342 6.13467 5.27825 5.2795C6.13308 4.42433 7.13833 3.74725 8.294 3.24825C9.44967 2.74942 10.6844 2.5 11.9982 2.5C13.3122 2.5 14.5473 2.74933 15.7035 3.248C16.8597 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.13308 20.2528 7.13833 20.7518 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9982C21.5 13.3122 21.2507 14.5473 20.752 15.7035C20.2533 16.8597 19.5766 17.8653 18.7218 18.7205C17.8669 19.5757 16.8617 20.2528 15.706 20.7518C14.5503 21.2506 13.3156 21.5 12.0017 21.5Z\" />\n </svg>\n )\n }\n)\n\nexport type CalloutVariant =\n \"info\" | \"gray\" | \"success\" | \"warning\" | \"destructive\"\n\ntype CalloutContextValue = {\n variant: CalloutVariant\n hideIcon: boolean\n}\n\nconst CalloutContext = React.createContext<CalloutContextValue>({\n variant: \"info\",\n hideIcon: false,\n})\n\n/**\n * The two slots a variant paints. Set inline; read by the root's atoms. Every variant is the same\n * style shape (soft background, default-graded text), so the five entries are data about five\n * families, not five class strings.\n */\nconst BG = \"--zenith-callout-bg\"\nconst FG = \"--zenith-callout-fg\"\n\nconst semantic = (family: string, slot: string): string =>\n `var(--zenith-${NS}-${family}-${slot})`\n\nconst VARIANT_SLOTS: Record<CalloutVariant, () => Record<string, string>> = {\n info: () => ({\n [BG]: semantic(\"accent\", \"soft\"),\n [FG]: semantic(\"accent\", \"default\"),\n }),\n gray: () => ({\n [BG]: semantic(\"gray\", \"soft\"),\n [FG]: semantic(\"gray\", \"default\"),\n }),\n success: () => ({\n [BG]: semantic(\"success\", \"soft\"),\n [FG]: semantic(\"success\", \"default\"),\n }),\n warning: () => ({\n [BG]: semantic(\"warning\", \"soft\"),\n [FG]: semantic(\"warning\", \"default\"),\n }),\n destructive: () => ({\n [BG]: semantic(\"error\", \"soft\"),\n [FG]: semantic(\"error\", \"default\"),\n }),\n}\n\nconst useStyles = makeZenithStyles({\n root: {\n ...boxModel,\n position: \"relative\",\n width: \"100%\",\n // The container radius, the same as Card so the two agree side by side (#25).\n ...shorthands.borderRadius(tokens.surfaceRadiusContainer),\n // p-3 — no token for 0.75rem.\n paddingTop: tokens.spacingElement3,\n paddingRight: tokens.spacingElement3,\n paddingBottom: tokens.spacingElement3,\n paddingLeft: tokens.spacingElement3,\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n backgroundColor: `var(${BG})`,\n color: `var(${FG})`,\n // `items-center`: present in every state, like v1's base string.\n alignItems: \"center\",\n // v1's `data-[hide-icon=false]:` block — the icon grid kicks in only when an icon renders.\n \"&[data-hide-icon='false']\": {\n display: \"grid\",\n gridTemplateColumns: \"0 1fr auto\",\n // gap-y-0.5 — no token for 0.125rem.\n rowGap: \"0.125rem\",\n // `has-[>svg]` and `has-data-[slot=callout-icon]` collapse to the same re-laid-out grid.\n \"&:has(>svg)\": {\n gridTemplateColumns: \"1rem 1fr\",\n // gap-x-3 — no token for 0.75rem.\n columnGap: tokens.spacingElement3,\n },\n [`&:has([${SLOT_ATTR}=\"callout-icon\"])`]: {\n gridTemplateColumns: \"1rem 1fr\",\n columnGap: tokens.spacingElement3,\n },\n },\n // v1 `[&>[data-slot=callout-icon]]` — SLOT_ATTR, never data-slot (CONVENTIONS rule 4).\n [`& > [${SLOT_ATTR}=\"callout-icon\"]`]: {\n // size-5 — no token for 1.25rem.\n width: \"1.25rem\",\n height: \"1.25rem\",\n flexShrink: 0,\n },\n },\n dismissible: {\n ...boxModel,\n // pr-10 — no token for 2.5rem.\n paddingRight: \"2.5rem\",\n },\n title: {\n ...boxModel,\n gridColumnStart: 2,\n ...shorthands.overflow(\"hidden\"),\n display: \"-webkit-box\",\n WebkitBoxOrient: \"vertical\",\n WebkitLineClamp: 1,\n // min-h-4\n minHeight: tokens.spacingGroup2,\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n fontWeight: tokens.fontWeightSemibold,\n },\n description: {\n gridColumnStart: 2,\n display: \"grid\",\n justifyItems: \"start\",\n ...shorthands.gap(tokens.spacingElement1),\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n \"& p\": {\n // leading-relaxed — no token for a 1.625 line-height.\n lineHeight: 1.625,\n },\n },\n action: {\n ...boxModel,\n display: \"flex\",\n width: \"100%\",\n gridColumnEnd: \"span 3\",\n // mt-2\n marginTop: tokens.spacingElement2,\n },\n actionStart: {\n justifyContent: \"flex-start\",\n },\n actionStartIcon: {\n justifyContent: \"flex-start\",\n // ml-8\n marginLeft: tokens.spacingLayout2,\n },\n actionEnd: {\n justifyContent: \"flex-end\",\n },\n dismiss: {\n ...boxModel,\n position: \"absolute\",\n // top-2 right-2\n top: tokens.spacingElement2,\n right: tokens.spacingElement2,\n // size-6 — the ClearButton itself supplies centering, rounding, hover and focus.\n width: tokens.spacingLayout1,\n height: tokens.spacingLayout1,\n },\n dismissIcon: {\n ...boxModel,\n // size-4\n width: tokens.spacingGroup2,\n height: tokens.spacingGroup2,\n },\n})\n\nexport type CalloutProps = React.ComponentProps<\"div\"> & {\n variant?: CalloutVariant\n hideIcon?: boolean\n customIcon?: React.ReactNode\n /** Shows a top-right close button that dismisses the callout. */\n dismissible?: boolean\n /** Called when the close button is clicked, after the callout hides itself. */\n onDismiss?: () => void\n}\n\nexport const Callout = React.forwardRef<HTMLDivElement, CalloutProps>(\n function Callout(\n {\n className,\n variant = \"info\",\n hideIcon = false,\n customIcon,\n dismissible = false,\n onDismiss,\n style,\n children,\n ...props\n },\n ref\n ) {\n const [open, setOpen] = React.useState(true)\n const styles = useStyles()\n\n if (!open) {\n return null\n }\n\n const handleDismiss = () => {\n setOpen(false)\n onDismiss?.()\n }\n\n return (\n <CalloutContext.Provider value={{ variant, hideIcon }}>\n <div\n ref={ref}\n data-callout-variant={variant}\n data-slot=\"callout\"\n data-hide-icon={hideIcon ? \"true\" : \"false\"}\n data-dismissible={dismissible ? \"true\" : \"false\"}\n role=\"alert\"\n {...{ [SLOT_ATTR]: \"callout\" }}\n className={mergeClasses(\n styles.root,\n dismissible && styles.dismissible,\n className\n )}\n style={\n { ...VARIANT_SLOTS[variant](), ...style } as React.CSSProperties\n }\n {...props}\n >\n {!hideIcon && <CalloutIcon customIcon={customIcon} />}\n {children}\n {dismissible && (\n <ClearButton\n label=\"Dismiss\"\n onClick={handleDismiss}\n className={styles.dismiss}\n >\n <CloseIcon className={styles.dismissIcon} />\n </ClearButton>\n )}\n </div>\n </CalloutContext.Provider>\n )\n }\n)\n\nexport type CalloutTitleProps = React.ComponentProps<\"div\">\n\nexport const CalloutTitle = React.forwardRef<HTMLDivElement, CalloutTitleProps>(\n function CalloutTitle({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"callout-title\"\n {...{ [SLOT_ATTR]: \"callout-title\" }}\n className={mergeClasses(styles.title, className)}\n {...props}\n />\n )\n }\n)\n\nexport type CalloutDescriptionProps = React.ComponentProps<\"div\">\n\nexport const CalloutDescription = React.forwardRef<\n HTMLDivElement,\n CalloutDescriptionProps\n>(function CalloutDescription({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"callout-description\"\n {...{ [SLOT_ATTR]: \"callout-description\" }}\n className={mergeClasses(styles.description, className)}\n {...props}\n />\n )\n})\n\nexport type CalloutActionProps = React.ComponentProps<\"div\"> & {\n align?: \"start\" | \"end\"\n}\n\nexport const CalloutAction = React.forwardRef<\n HTMLDivElement,\n CalloutActionProps\n>(function CalloutAction({ className, align = \"start\", ...props }, ref) {\n const { hideIcon } = React.useContext(CalloutContext)\n const styles = useStyles()\n\n const alignment =\n align === \"end\"\n ? styles.actionEnd\n : hideIcon\n ? styles.actionStart\n : styles.actionStartIcon\n\n return (\n <div\n ref={ref}\n data-slot=\"callout-action\"\n data-align={align}\n {...{ [SLOT_ATTR]: \"callout-action\" }}\n className={mergeClasses(styles.action, alignment, className)}\n {...props}\n />\n )\n})\n\ntype CalloutVariantIconProps = React.ComponentProps<\"svg\"> & {\n customIcon?: React.ReactNode\n}\n\nconst CalloutVariantIcon = React.forwardRef<\n SVGSVGElement,\n CalloutVariantIconProps\n>(function CalloutVariantIcon({ customIcon, ...props }, ref) {\n const { variant } = React.useContext(CalloutContext)\n\n if (customIcon) {\n return customIcon\n }\n\n switch (variant) {\n case \"info\":\n return <InfoIcon ref={ref} {...props} />\n case \"success\":\n return <CheckIcon ref={ref} {...props} />\n case \"warning\":\n return <WarningIcon ref={ref} {...props} />\n case \"destructive\":\n return <ErrorIcon ref={ref} {...props} />\n }\n\n // gray has no default icon; v1 renders nothing for it.\n return null\n})\n\nexport type CalloutIconProps = React.ComponentProps<\"svg\"> & {\n customIcon?: React.ReactNode\n}\n\nconst CalloutIcon = React.forwardRef<SVGSVGElement, CalloutIconProps>(\n function CalloutIcon({ className, customIcon, ...props }, ref) {\n return (\n <CalloutVariantIcon\n ref={ref}\n data-slot=\"callout-icon\"\n {...{ [SLOT_ATTR]: \"callout-icon\" }}\n customIcon={customIcon}\n className={className}\n {...props}\n />\n )\n }\n)\n"],"names":["InfoIcon","React","props","ref","jsx","WarningIcon","CheckIcon","ErrorIcon","CalloutContext","BG","FG","semantic","family","slot","NS","VARIANT_SLOTS","useStyles","makeZenithStyles","boxModel","shorthands","tokens.surfaceRadiusContainer","tokens.spacingElement3","tokens.textSm","tokens.leadingSm","SLOT_ATTR","tokens.spacingGroup2","tokens.textBase","tokens.leadingBase","tokens.fontWeightSemibold","tokens.spacingElement1","tokens.spacingElement2","tokens.spacingLayout2","tokens.spacingLayout1","Callout","className","variant","hideIcon","customIcon","dismissible","onDismiss","style","children","open","setOpen","styles","handleDismiss","jsxs","mergeClasses","CalloutIcon","ClearButton","CloseIcon","Callout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file":"callout.js","sources":["../../../src/components/callout/callout.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport { NS } from \"../../tokens\"\nimport * as tokens from \"../../tokens\"\nimport { ClearButton } from \"../../lib/clear-button\"\nimport { CloseIcon } from \"../../lib/icons\"\n\n/**\n * Callout — Badge's colour collapse applied to Card's compound pattern, in one makeZenithStyles\n * call. v1 hardcodes two variants per family as class strings (`bg-accent-soft text-accent-a12`,\n * ...).\n */\n\nconst InfoIcon = React.forwardRef<SVGSVGElement, React.ComponentProps<\"svg\">>(\n function InfoIcon(props, ref) {\n return (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M12.0003 16.75C12.2129 16.75 12.391 16.6781 12.5345 16.5343C12.6782 16.3906 12.75 16.2125 12.75 16V11.75C12.75 11.5375 12.6781 11.3593 12.5343 11.2155C12.3904 11.0718 12.2122 11 11.9997 11C11.7871 11 11.609 11.0718 11.4655 11.2155C11.3218 11.3593 11.25 11.5375 11.25 11.75V16C11.25 16.2125 11.3219 16.3906 11.4658 16.5343C11.6096 16.6781 11.7878 16.75 12.0003 16.75ZM12 9.2885C12.2288 9.2885 12.4207 9.21108 12.5755 9.05625C12.7303 8.90142 12.8077 8.70958 12.8077 8.48075C12.8077 8.25192 12.7303 8.06008 12.5755 7.90525C12.4207 7.75058 12.2288 7.67325 12 7.67325C11.7712 7.67325 11.5793 7.75058 11.4245 7.90525C11.2697 8.06008 11.1923 8.25192 11.1923 8.48075C11.1923 8.70958 11.2697 8.90142 11.4245 9.05625C11.5793 9.21108 11.7712 9.2885 12 9.2885ZM12.0017 21.5C10.6877 21.5 9.45267 21.2507 8.2965 20.752C7.14033 20.2533 6.13467 19.5766 5.2795 18.7218C4.42433 17.8669 3.74725 16.8617 3.24825 15.706C2.74942 14.5503 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45267 3.248 8.2965C3.74667 7.14033 4.42342 6.13467 5.27825 5.2795C6.13308 4.42433 7.13833 3.74725 8.294 3.24825C9.44967 2.74942 10.6844 2.5 11.9982 2.5C13.3122 2.5 14.5473 2.74933 15.7035 3.248C16.8597 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.13308 20.2528 7.13833 20.7518 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9982C21.5 13.3122 21.2507 14.5473 20.752 15.7035C20.2533 16.8597 19.5766 17.8653 18.7218 18.7205C17.8669 19.5757 16.8617 20.2528 15.706 20.7518C14.5503 21.2506 13.3156 21.5 12.0017 21.5Z\" />\n </svg>\n )\n }\n)\n\nconst WarningIcon = React.forwardRef<\n SVGSVGElement,\n React.ComponentProps<\"svg\">\n>(function WarningIcon(props, ref) {\n return (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M3.4255 20.5C3.256 20.5 3.10375 20.4586 2.96875 20.3757C2.83375 20.2929 2.72883 20.1837 2.654 20.048C2.576 19.9133 2.53308 19.7675 2.52525 19.6105C2.51742 19.4535 2.55975 19.298 2.65225 19.144L11.213 4.356C11.3057 4.202 11.4215 4.08817 11.5605 4.0145C11.6997 3.94083 11.8462 3.904 12 3.904C12.1538 3.904 12.3003 3.94083 12.4395 4.0145C12.5785 4.08817 12.6943 4.202 12.787 4.356L21.3477 19.144C21.4402 19.298 21.4826 19.4535 21.4747 19.6105C21.4669 19.7675 21.424 19.9133 21.346 20.048C21.2712 20.1837 21.1663 20.2929 21.0313 20.3757C20.8963 20.4586 20.744 20.5 20.5745 20.5H3.4255ZM12 17.8077C12.2288 17.8077 12.4207 17.7303 12.5755 17.5755C12.7303 17.4207 12.8078 17.2288 12.8078 17C12.8078 16.7712 12.7303 16.5793 12.5755 16.4245C12.4207 16.2697 12.2288 16.1923 12 16.1923C11.7712 16.1923 11.5793 16.2697 11.4245 16.4245C11.2697 16.5793 11.1923 16.7712 11.1923 17C11.1923 17.2288 11.2697 17.4207 11.4245 17.5755C11.5793 17.7303 11.7712 17.8077 12 17.8077ZM12.0003 15.1923C12.2129 15.1923 12.391 15.1204 12.5345 14.9768C12.6782 14.8329 12.75 14.6548 12.75 14.4423V10.9423C12.75 10.7298 12.6781 10.5517 12.5342 10.408C12.3904 10.2642 12.2122 10.1923 11.9997 10.1923C11.7871 10.1923 11.609 10.2642 11.4655 10.408C11.3218 10.5517 11.25 10.7298 11.25 10.9423V14.4423C11.25 14.6548 11.3219 14.8329 11.4658 14.9768C11.6096 15.1204 11.7878 15.1923 12.0003 15.1923Z\" />\n </svg>\n )\n})\n\nconst CheckIcon = React.forwardRef<SVGSVGElement, React.ComponentProps<\"svg\">>(\n function CheckIcon(props, ref) {\n return (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M10.5808 14.1463L8.25775 11.823C8.11925 11.6847 7.94517 11.6138 7.7355 11.6105C7.526 11.6073 7.34875 11.6782 7.20375 11.823C7.05892 11.968 6.9865 12.1437 6.9865 12.35C6.9865 12.5563 7.05892 12.732 7.20375 12.877L9.948 15.6212C10.1288 15.8019 10.3398 15.8922 10.5808 15.8922C10.8218 15.8922 11.0327 15.8019 11.2135 15.6212L16.777 10.0577C16.9153 9.91925 16.9862 9.74517 16.9895 9.5355C16.9927 9.326 16.9218 9.14875 16.777 9.00375C16.632 8.85892 16.4563 8.7865 16.25 8.7865C16.0437 8.7865 15.868 8.85892 15.723 9.00375L10.5808 14.1463ZM12.0017 21.5C10.6877 21.5 9.45267 21.2507 8.2965 20.752C7.14033 20.2533 6.13467 19.5766 5.2795 18.7218C4.42433 17.8669 3.74725 16.8617 3.24825 15.706C2.74942 14.5503 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45267 3.248 8.2965C3.74667 7.14033 4.42342 6.13467 5.27825 5.2795C6.13308 4.42433 7.13833 3.74725 8.294 3.24825C9.44967 2.74942 10.6844 2.5 11.9982 2.5C13.3122 2.5 14.5473 2.74933 15.7035 3.248C16.8597 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.13308 20.2528 7.13833 20.7518 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9982C21.5 13.3122 21.2507 14.5473 20.752 15.7035C20.2533 16.8597 19.5766 17.8653 18.7218 18.7205C17.8669 19.5757 16.8617 20.2528 15.706 20.7518C14.5503 21.2506 13.3156 21.5 12.0017 21.5Z\" />\n </svg>\n )\n }\n)\n\nconst ErrorIcon = React.forwardRef<SVGSVGElement, React.ComponentProps<\"svg\">>(\n function ErrorIcon(props, ref) {\n return (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M12 16.7307C12.2288 16.7307 12.4207 16.6533 12.5755 16.4985C12.7303 16.3437 12.8077 16.1518 12.8077 15.923C12.8077 15.6942 12.7303 15.5023 12.5755 15.3475C12.4207 15.1928 12.2288 15.1155 12 15.1155C11.7712 15.1155 11.5793 15.1928 11.4245 15.3475C11.2697 15.5023 11.1923 15.6942 11.1923 15.923C11.1923 16.1518 11.2697 16.3437 11.4245 16.4985C11.5793 16.6533 11.7712 16.7307 12 16.7307ZM12.0003 13.077C12.2129 13.077 12.391 13.0051 12.5345 12.8613C12.6782 12.7176 12.75 12.5395 12.75 12.327V7.827C12.75 7.6145 12.6781 7.43633 12.5343 7.2925C12.3904 7.14883 12.2122 7.077 11.9997 7.077C11.7871 7.077 11.609 7.14883 11.4655 7.2925C11.3218 7.43633 11.25 7.6145 11.25 7.827V12.327C11.25 12.5395 11.3219 12.7176 11.4658 12.8613C11.6096 13.0051 11.7878 13.077 12.0003 13.077ZM12.0017 21.5C10.6877 21.5 9.45267 21.2507 8.2965 20.752C7.14033 20.2533 6.13467 19.5766 5.2795 18.7218C4.42433 17.8669 3.74725 16.8617 3.24825 15.706C2.74942 14.5503 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45267 3.248 8.2965C3.74667 7.14033 4.42342 6.13467 5.27825 5.2795C6.13308 4.42433 7.13833 3.74725 8.294 3.24825C9.44967 2.74942 10.6844 2.5 11.9982 2.5C13.3122 2.5 14.5473 2.74933 15.7035 3.248C16.8597 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.13308 20.2528 7.13833 20.7518 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9982C21.5 13.3122 21.2507 14.5473 20.752 15.7035C20.2533 16.8597 19.5766 17.8653 18.7218 18.7205C17.8669 19.5757 16.8617 20.2528 15.706 20.7518C14.5503 21.2506 13.3156 21.5 12.0017 21.5Z\" />\n </svg>\n )\n }\n)\n\nexport type CalloutVariant =\n \"info\" | \"gray\" | \"success\" | \"warning\" | \"destructive\"\n\ntype CalloutContextValue = {\n variant: CalloutVariant\n hideIcon: boolean\n}\n\nconst CalloutContext = React.createContext<CalloutContextValue>({\n variant: \"info\",\n hideIcon: false,\n})\n\n/**\n * The two slots a variant paints. Set inline; read by the root's atoms. Every variant is the same\n * style shape (soft background, default-graded text), so the five entries are data about five\n * families, not five class strings.\n */\nconst BG = \"--zenith-callout-bg\"\nconst FG = \"--zenith-callout-fg\"\n\nconst semantic = (family: string, slot: string): string =>\n `var(--zenith-${NS}-${family}-${slot})`\n\nconst VARIANT_SLOTS: Record<CalloutVariant, () => Record<string, string>> = {\n info: () => ({\n [BG]: semantic(\"accent\", \"soft\"),\n [FG]: semantic(\"accent\", \"default\"),\n }),\n gray: () => ({\n [BG]: semantic(\"gray\", \"soft\"),\n [FG]: semantic(\"gray\", \"default\"),\n }),\n success: () => ({\n [BG]: semantic(\"success\", \"soft\"),\n [FG]: semantic(\"success\", \"default\"),\n }),\n warning: () => ({\n [BG]: semantic(\"warning\", \"soft\"),\n [FG]: semantic(\"warning\", \"default\"),\n }),\n destructive: () => ({\n [BG]: semantic(\"error\", \"soft\"),\n [FG]: semantic(\"error\", \"default\"),\n }),\n}\n\nconst useStyles = makeZenithStyles({\n root: {\n ...boxModel,\n position: \"relative\",\n width: \"100%\",\n // The container radius, the same as Card so the two agree side by side (#25).\n ...shorthands.borderRadius(tokens.surfaceRadiusContainer),\n // p-3 — no token for 0.75rem.\n paddingTop: tokens.spacingElement3,\n paddingRight: tokens.spacingElement3,\n paddingBottom: tokens.spacingElement3,\n paddingLeft: tokens.spacingElement3,\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n backgroundColor: `var(${BG})`,\n color: `var(${FG})`,\n // `items-center`: present in every state, like v1's base string.\n alignItems: \"center\",\n // v1's `data-[hide-icon=false]:` block — the icon grid kicks in only when an icon renders.\n \"&[data-hide-icon='false']\": {\n display: \"grid\",\n gridTemplateColumns: \"0 1fr auto\",\n // gap-y-0.5 — no token for 0.125rem.\n rowGap: \"0.125rem\",\n // `has-[>svg]` and `has-data-[slot=callout-icon]` collapse to the same re-laid-out grid.\n \"&:has(>svg)\": {\n gridTemplateColumns: \"1rem 1fr\",\n // gap-x-3 — no token for 0.75rem.\n columnGap: tokens.spacingElement3,\n },\n [`&:has([${SLOT_ATTR}=\"callout-icon\"])`]: {\n gridTemplateColumns: \"1rem 1fr\",\n columnGap: tokens.spacingElement3,\n },\n },\n // v1 `[&>[data-slot=callout-icon]]` — SLOT_ATTR, never data-slot (CONVENTIONS rule 4).\n [`& > [${SLOT_ATTR}=\"callout-icon\"]`]: {\n // size-5 — no token for 1.25rem.\n width: \"1.25rem\",\n height: \"1.25rem\",\n flexShrink: 0,\n },\n },\n dismissible: {\n ...boxModel,\n // pr-10 — no token for 2.5rem.\n paddingRight: \"2.5rem\",\n },\n title: {\n ...boxModel,\n gridColumnStart: 2,\n ...shorthands.overflow(\"hidden\"),\n display: \"-webkit-box\",\n WebkitBoxOrient: \"vertical\",\n WebkitLineClamp: 1,\n // min-h-4\n minHeight: tokens.spacingGroup2,\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n fontWeight: tokens.fontWeightSemibold,\n },\n description: {\n gridColumnStart: 2,\n display: \"grid\",\n justifyItems: \"start\",\n ...shorthands.gap(tokens.spacingElement1),\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n \"& p\": {\n // leading-relaxed — no token for a 1.625 line-height.\n lineHeight: 1.625,\n },\n },\n action: {\n ...boxModel,\n display: \"flex\",\n width: \"100%\",\n gridColumnEnd: \"span 3\",\n // mt-2\n marginTop: tokens.spacingElement2,\n },\n actionStart: {\n justifyContent: \"flex-start\",\n },\n actionStartIcon: {\n justifyContent: \"flex-start\",\n // ml-8\n marginLeft: tokens.spacingLayout2,\n },\n actionEnd: {\n justifyContent: \"flex-end\",\n },\n dismiss: {\n ...boxModel,\n position: \"absolute\",\n // top-2 right-2\n top: tokens.spacingElement2,\n right: tokens.spacingElement2,\n // size-6 — the ClearButton itself supplies centering, rounding, hover and focus.\n width: tokens.spacingLayout1,\n height: tokens.spacingLayout1,\n },\n dismissIcon: {\n ...boxModel,\n // size-4\n width: tokens.spacingGroup2,\n height: tokens.spacingGroup2,\n },\n})\n\nexport type CalloutProps = React.ComponentProps<\"div\"> & {\n variant?: CalloutVariant\n hideIcon?: boolean\n customIcon?: React.ReactNode\n /** Shows a top-right close button that dismisses the callout. */\n dismissible?: boolean\n /** Called when the close button is clicked, after the callout hides itself. */\n onDismiss?: () => void\n}\n\nexport const Callout = React.forwardRef<HTMLDivElement, CalloutProps>(\n function Callout(\n {\n className,\n variant = \"info\",\n hideIcon = false,\n customIcon,\n dismissible = false,\n onDismiss,\n style,\n children,\n ...props\n },\n ref\n ) {\n const [open, setOpen] = React.useState(true)\n const styles = useStyles()\n\n if (!open) {\n return null\n }\n\n const handleDismiss = () => {\n setOpen(false)\n onDismiss?.()\n }\n\n return (\n <CalloutContext.Provider value={{ variant, hideIcon }}>\n <div\n ref={ref}\n data-callout-variant={variant}\n data-slot=\"callout\"\n data-hide-icon={hideIcon ? \"true\" : \"false\"}\n data-dismissible={dismissible ? \"true\" : \"false\"}\n role=\"alert\"\n {...{ [SLOT_ATTR]: \"callout\" }}\n className={mergeClasses(\n styles.root,\n dismissible && styles.dismissible,\n className\n )}\n style={\n { ...VARIANT_SLOTS[variant](), ...style } as React.CSSProperties\n }\n {...props}\n >\n {!hideIcon && <CalloutIcon customIcon={customIcon} />}\n {children}\n {dismissible && (\n <ClearButton\n label=\"Dismiss\"\n onClick={handleDismiss}\n className={styles.dismiss}\n >\n <CloseIcon className={styles.dismissIcon} />\n </ClearButton>\n )}\n </div>\n </CalloutContext.Provider>\n )\n }\n)\n\nexport type CalloutTitleProps = React.ComponentProps<\"div\">\n\nexport const CalloutTitle = React.forwardRef<HTMLDivElement, CalloutTitleProps>(\n function CalloutTitle({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"callout-title\"\n {...{ [SLOT_ATTR]: \"callout-title\" }}\n className={mergeClasses(styles.title, className)}\n {...props}\n />\n )\n }\n)\n\nexport type CalloutDescriptionProps = React.ComponentProps<\"div\">\n\nexport const CalloutDescription = React.forwardRef<\n HTMLDivElement,\n CalloutDescriptionProps\n>(function CalloutDescription({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"callout-description\"\n {...{ [SLOT_ATTR]: \"callout-description\" }}\n className={mergeClasses(styles.description, className)}\n {...props}\n />\n )\n})\n\nexport type CalloutActionProps = React.ComponentProps<\"div\"> & {\n align?: \"start\" | \"end\"\n}\n\nexport const CalloutAction = React.forwardRef<\n HTMLDivElement,\n CalloutActionProps\n>(function CalloutAction({ className, align = \"start\", ...props }, ref) {\n const { hideIcon } = React.useContext(CalloutContext)\n const styles = useStyles()\n\n const alignment =\n align === \"end\"\n ? styles.actionEnd\n : hideIcon\n ? styles.actionStart\n : styles.actionStartIcon\n\n return (\n <div\n ref={ref}\n data-slot=\"callout-action\"\n data-align={align}\n {...{ [SLOT_ATTR]: \"callout-action\" }}\n className={mergeClasses(styles.action, alignment, className)}\n {...props}\n />\n )\n})\n\ntype CalloutVariantIconProps = React.ComponentProps<\"svg\"> & {\n customIcon?: React.ReactNode\n}\n\nconst CalloutVariantIcon = React.forwardRef<\n SVGSVGElement,\n CalloutVariantIconProps\n>(function CalloutVariantIcon({ customIcon, ...props }, ref) {\n const { variant } = React.useContext(CalloutContext)\n\n if (customIcon) {\n return customIcon\n }\n\n switch (variant) {\n case \"info\":\n return <InfoIcon ref={ref} {...props} />\n case \"success\":\n return <CheckIcon ref={ref} {...props} />\n case \"warning\":\n return <WarningIcon ref={ref} {...props} />\n case \"destructive\":\n return <ErrorIcon ref={ref} {...props} />\n }\n\n // gray has no default icon; v1 renders nothing for it.\n return null\n})\n\nexport type CalloutIconProps = React.ComponentProps<\"svg\"> & {\n customIcon?: React.ReactNode\n}\n\nconst CalloutIcon = React.forwardRef<SVGSVGElement, CalloutIconProps>(\n function CalloutIcon({ className, customIcon, ...props }, ref) {\n return (\n <CalloutVariantIcon\n ref={ref}\n data-slot=\"callout-icon\"\n {...{ [SLOT_ATTR]: \"callout-icon\" }}\n customIcon={customIcon}\n className={className}\n {...props}\n />\n )\n }\n)\n"],"names":["InfoIcon","React","props","ref","jsx","WarningIcon","CheckIcon","ErrorIcon","CalloutContext","BG","FG","semantic","family","slot","NS","VARIANT_SLOTS","useStyles","makeZenithStyles","boxModel","shorthands","tokens.surfaceRadiusContainer","tokens.spacingElement3","tokens.textSm","tokens.leadingSm","SLOT_ATTR","tokens.spacingGroup2","tokens.textBase","tokens.leadingBase","tokens.fontWeightSemibold","tokens.spacingElement1","tokens.spacingElement2","tokens.spacingLayout2","tokens.spacingLayout1","Callout","className","variant","hideIcon","customIcon","dismissible","onDismiss","style","children","open","setOpen","styles","handleDismiss","jsxs","mergeClasses","Callout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GV;AACF;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import * as i from "react";
3
- import { mergeClasses as s, SLOT_ATTR as d, shorthands as f } from "@epilot/zenith-runtime/v1/core.js";
3
+ import { mergeClasses as s, SLOT_ATTR as d, shorthands as f } from "@epilot/zenith-runtime/v1";
4
4
  import { makeZenithStyles as m } from "../../styles/make-styles.js";
5
5
  import { boxModel as p } from "../../styles/host-reset.js";
6
6
  import { spacingGroup2 as e, leadingSm as g, textSm as u, grayA11 as C, fontWeightSemibold as h, shadowContainer as R, surfaceContainer as y, spacingElement2 as b, borderContainer as w, borderWidthContainer as S, surfaceRadiusContainer as T } from "../../tokens/index.js";