@epilot/zenith-react 0.2.0-next.0 → 0.2.0-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/components/accordion/accordion.js +57 -48
  2. package/dist/components/accordion/accordion.js.map +1 -1
  3. package/dist/components/alert-dialog/alert-dialog.js +120 -92
  4. package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
  5. package/dist/components/avatar/avatar-group.js +38 -35
  6. package/dist/components/avatar/avatar-group.js.map +1 -1
  7. package/dist/components/avatar/avatar.js +78 -71
  8. package/dist/components/avatar/avatar.js.map +1 -1
  9. package/dist/components/badge/badge.js +60 -55
  10. package/dist/components/badge/badge.js.map +1 -1
  11. package/dist/components/breadcrumb/breadcrumb.js +99 -54
  12. package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
  13. package/dist/components/button/button.js +87 -77
  14. package/dist/components/button/button.js.map +1 -1
  15. package/dist/components/button-group/button-group.js +36 -32
  16. package/dist/components/button-group/button-group.js.map +1 -1
  17. package/dist/components/callout/callout.js +105 -98
  18. package/dist/components/callout/callout.js.map +1 -1
  19. package/dist/components/card/card.js +62 -52
  20. package/dist/components/card/card.js.map +1 -1
  21. package/dist/components/checkbox/checkbox.js +22 -19
  22. package/dist/components/checkbox/checkbox.js.map +1 -1
  23. package/dist/components/code-block/code-block.js +135 -123
  24. package/dist/components/code-block/code-block.js.map +1 -1
  25. package/dist/components/code-editor/code-editor.js +276 -260
  26. package/dist/components/code-editor/code-editor.js.map +1 -1
  27. package/dist/components/collapsible-sidebar/collapsible-sidebar.js +62 -56
  28. package/dist/components/collapsible-sidebar/collapsible-sidebar.js.map +1 -1
  29. package/dist/components/command/command.js +116 -105
  30. package/dist/components/command/command.js.map +1 -1
  31. package/dist/components/data-table/data-table-body.js +38 -34
  32. package/dist/components/data-table/data-table-body.js.map +1 -1
  33. package/dist/components/data-table/data-table-column-header.js +30 -26
  34. package/dist/components/data-table/data-table-column-header.js.map +1 -1
  35. package/dist/components/data-table/data-table-column-order.js +79 -73
  36. package/dist/components/data-table/data-table-column-order.js.map +1 -1
  37. package/dist/components/data-table/data-table-column-visibility.js +25 -22
  38. package/dist/components/data-table/data-table-column-visibility.js.map +1 -1
  39. package/dist/components/data-table/data-table-content.js +47 -44
  40. package/dist/components/data-table/data-table-content.js.map +1 -1
  41. package/dist/components/data-table/data-table-error.js +36 -32
  42. package/dist/components/data-table/data-table-error.js.map +1 -1
  43. package/dist/components/data-table/data-table-footer.js +10 -8
  44. package/dist/components/data-table/data-table-footer.js.map +1 -1
  45. package/dist/components/data-table/data-table-header-draggable.js +40 -36
  46. package/dist/components/data-table/data-table-header-draggable.js.map +1 -1
  47. package/dist/components/data-table/data-table-header.js +113 -99
  48. package/dist/components/data-table/data-table-header.js.map +1 -1
  49. package/dist/components/data-table/data-table-loading.js +21 -18
  50. package/dist/components/data-table/data-table-loading.js.map +1 -1
  51. package/dist/components/data-table/data-table-resize-handle.js +13 -11
  52. package/dist/components/data-table/data-table-resize-handle.js.map +1 -1
  53. package/dist/components/data-table/data-table-row.js +71 -59
  54. package/dist/components/data-table/data-table-row.js.map +1 -1
  55. package/dist/components/data-table/data-table-toolbar.js +9 -7
  56. package/dist/components/data-table/data-table-toolbar.js.map +1 -1
  57. package/dist/components/data-table/data-table.js +48 -46
  58. package/dist/components/data-table/data-table.js.map +1 -1
  59. package/dist/components/date-range-picker/date-range-picker.js +173 -164
  60. package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
  61. package/dist/components/date-range-picker/range-calendar.js +36 -34
  62. package/dist/components/date-range-picker/range-calendar.js.map +1 -1
  63. package/dist/components/date-time-picker/calendar.js +290 -272
  64. package/dist/components/date-time-picker/calendar.js.map +1 -1
  65. package/dist/components/date-time-picker/date-time-picker-input.js +22 -20
  66. package/dist/components/date-time-picker/date-time-picker-input.js.map +1 -1
  67. package/dist/components/date-time-picker/date-time-picker-panel.js +126 -120
  68. package/dist/components/date-time-picker/date-time-picker-panel.js.map +1 -1
  69. package/dist/components/date-time-picker/date-time-picker.js +42 -40
  70. package/dist/components/date-time-picker/date-time-picker.js.map +1 -1
  71. package/dist/components/date-time-picker/time-picker.js +95 -87
  72. package/dist/components/date-time-picker/time-picker.js.map +1 -1
  73. package/dist/components/dialog/dialog.js +115 -95
  74. package/dist/components/dialog/dialog.js.map +1 -1
  75. package/dist/components/drawer/drawer.js +144 -109
  76. package/dist/components/drawer/drawer.js.map +1 -1
  77. package/dist/components/dropdown-menu/dropdown-menu.js +141 -112
  78. package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
  79. package/dist/components/field/field-combobox.js +196 -176
  80. package/dist/components/field/field-combobox.js.map +1 -1
  81. package/dist/components/field/field.js +137 -126
  82. package/dist/components/field/field.js.map +1 -1
  83. package/dist/components/list/list.js +237 -219
  84. package/dist/components/list/list.js.map +1 -1
  85. package/dist/components/option-card/option-card.js +129 -116
  86. package/dist/components/option-card/option-card.js.map +1 -1
  87. package/dist/components/pill/pill.js +55 -51
  88. package/dist/components/pill/pill.js.map +1 -1
  89. package/dist/components/popover/popover.js +53 -36
  90. package/dist/components/popover/popover.js.map +1 -1
  91. package/dist/components/radio/radio.js +38 -34
  92. package/dist/components/radio/radio.js.map +1 -1
  93. package/dist/components/scroll-area/scroll-area.js +38 -35
  94. package/dist/components/scroll-area/scroll-area.js.map +1 -1
  95. package/dist/components/scroll-overflow/scroll-overflow.js +166 -151
  96. package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
  97. package/dist/components/segmented-control/segmented-control.js +93 -85
  98. package/dist/components/segmented-control/segmented-control.js.map +1 -1
  99. package/dist/components/select/select.js +149 -128
  100. package/dist/components/select/select.js.map +1 -1
  101. package/dist/components/separator/separator.js +19 -16
  102. package/dist/components/separator/separator.js.map +1 -1
  103. package/dist/components/skeleton/skeleton.js +34 -30
  104. package/dist/components/skeleton/skeleton.js.map +1 -1
  105. package/dist/components/spinner/spinner.js +22 -17
  106. package/dist/components/spinner/spinner.js.map +1 -1
  107. package/dist/components/surface/surface.js +25 -22
  108. package/dist/components/surface/surface.js.map +1 -1
  109. package/dist/components/switch/switch.js +66 -57
  110. package/dist/components/switch/switch.js.map +1 -1
  111. package/dist/components/table/table-pagination.js +139 -129
  112. package/dist/components/table/table-pagination.js.map +1 -1
  113. package/dist/components/table/table.js +104 -90
  114. package/dist/components/table/table.js.map +1 -1
  115. package/dist/components/tabs/tabs.js +206 -128
  116. package/dist/components/tabs/tabs.js.map +1 -1
  117. package/dist/components/toast/toast.js +112 -100
  118. package/dist/components/toast/toast.js.map +1 -1
  119. package/dist/components/toggle/toggle.js +32 -30
  120. package/dist/components/toggle/toggle.js.map +1 -1
  121. package/dist/components/tooltip/tooltip.js +59 -46
  122. package/dist/components/tooltip/tooltip.js.map +1 -1
  123. package/dist/index.d.ts +12 -0
  124. package/dist/lib/clear-button.js +18 -17
  125. package/dist/lib/clear-button.js.map +1 -1
  126. package/dist/styles/host-reset.js +47 -0
  127. package/dist/styles/host-reset.js.map +1 -0
  128. package/dist/styles/overlay-layer.js +5 -0
  129. package/dist/styles/overlay-layer.js.map +1 -0
  130. package/dist/tokens.json +1 -1
  131. package/package.json +8 -6
  132. package/scripts/migration-diagnostics.mjs +42 -7
  133. package/scripts/migration-sweep.mjs +9 -1
@@ -1 +1 @@
1
- {"version":3,"file":"toggle.js","sources":["../../../src/components/toggle/toggle.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport * as tokens from \"../../tokens\"\n\nexport type ToggleVariant = \"default\" | \"destructive\"\nexport type ToggleSize = \"sm\" | \"base\" | \"lg\"\n\nexport const useToggleStyles = makeZenithStyles({\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...shorthands.gap(tokens.spacingElement1),\n flexShrink: 0,\n cursor: \"pointer\",\n fontWeight: tokens.fontWeightSemibold,\n transitionProperty: \"all\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n ...shorthands.borderStyle(\"none\"),\n ...shorthands.borderWidth(0),\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineOffset: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.focusRing,\n },\n \":disabled, &[data-disabled]\": {\n pointerEvents: \"none\",\n opacity: 0.5,\n },\n \"& svg\": {\n flexShrink: 0,\n pointerEvents: \"none\",\n color: \"currentColor\",\n },\n },\n // Variants\n default: {\n backgroundColor: \"transparent\",\n color: tokens.accentLight,\n \":hover\": {\n backgroundColor: tokens.accentSoft,\n },\n \"&[data-state='on']\": {\n backgroundColor: tokens.accentA3,\n color: tokens.accentOnSoft,\n },\n \"&[data-state='on']:hover\": {\n backgroundColor: tokens.accentA4,\n },\n },\n destructive: {\n backgroundColor: \"transparent\",\n color: tokens.errorLight,\n \":hover\": {\n backgroundColor: tokens.errorSoft,\n },\n \"&[data-state='on']\": {\n backgroundColor: tokens.errorA3,\n color: tokens.errorOnSoft,\n },\n \"&[data-state='on']:hover\": {\n backgroundColor: tokens.errorA4,\n },\n },\n // Sizes\n sm: {\n height: \"1.5rem\",\n minWidth: \"1.5rem\",\n ...shorthands.borderRadius(tokens.radiusLg),\n ...shorthands.paddingInline(\"0.375rem\"),\n \"& svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n base: {\n height: \"2rem\",\n minWidth: \"2rem\",\n ...shorthands.borderRadius(tokens.radiusXl),\n ...shorthands.paddingInline(tokens.spacingElement2),\n \"& svg\": {\n width: \"1rem\",\n height: \"1rem\",\n },\n },\n lg: {\n height: \"2.5rem\",\n minWidth: \"2.5rem\",\n ...shorthands.borderRadius(tokens.radius2xl),\n ...shorthands.paddingInline(\"0.625rem\"),\n \"& svg\": {\n width: \"1.25rem\",\n height: \"1.25rem\",\n },\n },\n})\n\nexport type ToggleProps = React.ComponentProps<typeof TogglePrimitive.Root> & {\n variant?: ToggleVariant\n size?: ToggleSize\n}\n\nexport const Toggle = React.forwardRef<\n React.ComponentRef<typeof TogglePrimitive.Root>,\n ToggleProps\n>(function Toggle(\n { className, variant = \"default\", size = \"base\", ...props },\n ref\n) {\n const styles = useToggleStyles()\n\n return (\n <TogglePrimitive.Root\n ref={ref}\n data-slot=\"toggle\"\n {...{ [SLOT_ATTR]: \"toggle\" }}\n className={mergeClasses(\n styles.root,\n styles[variant],\n styles[size],\n className\n )}\n {...props}\n />\n )\n})\n"],"names":["useToggleStyles","makeZenithStyles","shorthands","tokens.spacingElement1","tokens.fontWeightSemibold","tokens.focusRing","tokens.accentLight","tokens.accentSoft","tokens.accentA3","tokens.accentOnSoft","tokens.accentA4","tokens.errorLight","tokens.errorSoft","tokens.errorA3","tokens.errorOnSoft","tokens.errorA4","tokens.radiusLg","tokens.radiusXl","tokens.spacingElement2","tokens.radius2xl","Toggle","React","className","variant","size","props","ref","styles","jsx","TogglePrimitive.Root","SLOT_ATTR","mergeClasses"],"mappings":";;;;;;AAWO,MAAMA,IAAkBC,EAAiB;AAAA,EAC9C,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,GAAGC,EAAW,IAAIC,CAAsB;AAAA,IACxC,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,YAAYC;AAAAA,IACZ,oBAAoB;AAAA,IACpB,oBAAoB;AAAA,IACpB,0BAA0B;AAAA,IAC1B,2CAA2C;AAAA,MACzC,oBAAoB;AAAA,IAAA;AAAA,IAEtB,GAAGF,EAAW,YAAY,MAAM;AAAA,IAChC,GAAGA,EAAW,YAAY,CAAC;AAAA,IAC3B,kBAAkB;AAAA,MAChB,cAAc;AAAA,MACd,eAAe;AAAA,MACf,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AA,IAC3C,GAAGjB,EAAW,cAAc,UAAU;AAAA,IACtC,SAAS;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,EACV;AAEJ,CAAC,GAOYkB,IAASC,EAAM,WAG1B,SACA,EAAE,WAAAC,GAAW,SAAAC,IAAU,WAAW,MAAAC,IAAO,QAAQ,GAAGC,EAAA,GACpDC,GACA;AACA,QAAMC,IAAS3B,EAAA;AAEf,SACE,gBAAA4B;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,aAAU;AAAA,MACJ,CAACI,CAAS,GAAG;AAAA,MACnB,WAAWC;AAAA,QACTJ,EAAO;AAAA,QACPA,EAAOJ,CAAO;AAAA,QACdI,EAAOH,CAAI;AAAA,QACXF;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
1
+ {"version":3,"file":"toggle.js","sources":["../../../src/components/toggle/toggle.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { nativeControl } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\n\nexport type ToggleVariant = \"default\" | \"destructive\"\nexport type ToggleSize = \"sm\" | \"base\" | \"lg\"\n\nexport const useToggleStyles = makeZenithStyles({\n root: {\n ...nativeControl,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...shorthands.gap(tokens.spacingElement1),\n flexShrink: 0,\n cursor: \"pointer\",\n fontWeight: tokens.fontWeightSemibold,\n transitionProperty: \"all\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n ...shorthands.borderStyle(\"none\"),\n ...shorthands.borderWidth(0),\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineOffset: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.focusRing,\n },\n \":disabled, &[data-disabled]\": {\n pointerEvents: \"none\",\n opacity: 0.5,\n },\n \"& svg\": {\n flexShrink: 0,\n pointerEvents: \"none\",\n color: \"currentColor\",\n },\n },\n // Variants\n default: {\n backgroundColor: \"transparent\",\n color: tokens.accentLight,\n \":hover\": {\n backgroundColor: tokens.accentSoft,\n },\n \"&[data-state='on']\": {\n backgroundColor: tokens.accentA3,\n color: tokens.accentOnSoft,\n },\n \"&[data-state='on']:hover\": {\n backgroundColor: tokens.accentA4,\n },\n },\n destructive: {\n backgroundColor: \"transparent\",\n color: tokens.errorLight,\n \":hover\": {\n backgroundColor: tokens.errorSoft,\n },\n \"&[data-state='on']\": {\n backgroundColor: tokens.errorA3,\n color: tokens.errorOnSoft,\n },\n \"&[data-state='on']:hover\": {\n backgroundColor: tokens.errorA4,\n },\n },\n // Sizes\n sm: {\n height: \"1.5rem\",\n minWidth: \"1.5rem\",\n ...shorthands.borderRadius(tokens.radiusLg),\n ...shorthands.paddingInline(\"0.375rem\"),\n \"& svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n base: {\n height: \"2rem\",\n minWidth: \"2rem\",\n ...shorthands.borderRadius(tokens.radiusXl),\n ...shorthands.paddingInline(tokens.spacingElement2),\n \"& svg\": {\n width: \"1rem\",\n height: \"1rem\",\n },\n },\n lg: {\n height: \"2.5rem\",\n minWidth: \"2.5rem\",\n ...shorthands.borderRadius(tokens.radius2xl),\n ...shorthands.paddingInline(\"0.625rem\"),\n \"& svg\": {\n width: \"1.25rem\",\n height: \"1.25rem\",\n },\n },\n})\n\nexport type ToggleProps = React.ComponentProps<typeof TogglePrimitive.Root> & {\n variant?: ToggleVariant\n size?: ToggleSize\n}\n\nexport const Toggle = React.forwardRef<\n React.ComponentRef<typeof TogglePrimitive.Root>,\n ToggleProps\n>(function Toggle(\n { className, variant = \"default\", size = \"base\", ...props },\n ref\n) {\n const styles = useToggleStyles()\n\n return (\n <TogglePrimitive.Root\n ref={ref}\n data-slot=\"toggle\"\n {...{ [SLOT_ATTR]: \"toggle\" }}\n className={mergeClasses(\n styles.root,\n styles[variant],\n styles[size],\n className\n )}\n {...props}\n />\n )\n})\n"],"names":["useToggleStyles","makeZenithStyles","nativeControl","shorthands","tokens.spacingElement1","tokens.fontWeightSemibold","tokens.focusRing","tokens.accentLight","tokens.accentSoft","tokens.accentA3","tokens.accentOnSoft","tokens.accentA4","tokens.errorLight","tokens.errorSoft","tokens.errorA3","tokens.errorOnSoft","tokens.errorA4","tokens.radiusLg","tokens.radiusXl","tokens.spacingElement2","tokens.radius2xl","Toggle","React","className","variant","size","props","ref","styles","jsx","TogglePrimitive.Root","SLOT_ATTR","mergeClasses"],"mappings":";;;;;;;AAYO,MAAMA,IAAkBC,EAAiB;AAAA,EAC9C,MAAM;AAAA,IACJ,GAAGC;AAAA,IACH,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,GAAGC,EAAW,IAAIC,CAAsB;AAAA,IACxC,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,YAAYC;AAAAA,IACZ,oBAAoB;AAAA,IACpB,oBAAoB;AAAA,IACpB,0BAA0B;AAAA,IAC1B,2CAA2C;AAAA,MACzC,oBAAoB;AAAA,IAAA;AAAA,IAEtB,GAAGF,EAAW,YAAY,MAAM;AAAA,IAChC,GAAGA,EAAW,YAAY,CAAC;AAAA,IAC3B,kBAAkB;AAAA,MAChB,cAAc;AAAA,MACd,eAAe;AAAA,MACf,cAAc;AAAA,MACd,cAAcG;AAAAA,IAAO;AAAA,IAEvB,+BAA+B;AAAA,MAC7B,eAAe;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,IAEX,SAAS;AAAA,MACP,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,OAAO;AAAA,IAAA;AAAA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AW,MAAAC,IAAO,QAAQ,GAAGC,EAAA,GACpDC,GACA;AACA,QAAMC,IAAS5B,EAAA;AAEf,SACE,gBAAA6B;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,aAAU;AAAA,MACJ,CAACI,CAAS,GAAG;AAAA,MACnB,WAAWC;AAAA,QACTJ,EAAO;AAAA,QACPA,EAAOJ,CAAO;AAAA,QACdI,EAAOH,CAAI;AAAA,QACXF;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
@@ -1,31 +1,39 @@
1
- import { jsx as r, jsxs as T } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as b } from "react/jsx-runtime";
2
2
  import * as e from "react";
3
- import { Root as x, Content as v, Arrow as b, Portal as w, Provider as h, Trigger as R } from "../../vendor/.bun/@radix-ui_react-tooltip@1.2.8_2b23df507bdda662/vendor/@radix-ui/react-tooltip/dist/index.js";
4
- import { SLOT_ATTR as s, mergeClasses as C, shorthands as l } from "@epilot/zenith-runtime/v1";
5
- import { useAppearanceAttributes as N } from "../appearance-boundary/appearance-boundary.js";
6
- import { useDensity as A } from "../density-provider/density-provider.js";
7
- import { makeZenithStyles as P } from "../../styles/make-styles.js";
8
- import { error12 as d, gray12 as p, spacingElement1 as n, error1 as k, errorA12 as z, gray1 as S, textXs as X, spacingElement2 as Y, radiusLg as _ } from "../../tokens/index.js";
9
- const $ = P({
3
+ import { Root as w, Content as h, Arrow as R, Portal as C, Provider as N, Trigger as A } from "../../vendor/.bun/@radix-ui_react-tooltip@1.2.8_2b23df507bdda662/vendor/@radix-ui/react-tooltip/dist/index.js";
4
+ import { SLOT_ATTR as s, mergeClasses as g, shorthands as p } from "@epilot/zenith-runtime/v1";
5
+ import { useAppearanceAttributes as P } from "../appearance-boundary/appearance-boundary.js";
6
+ import { useDensity as X } from "../density-provider/density-provider.js";
7
+ import { makeZenithStyles as Y } from "../../styles/make-styles.js";
8
+ import { boxModel as f, nativeControl as _ } from "../../styles/host-reset.js";
9
+ import { OVERLAY_Z_INDEX as k } from "../../styles/overlay-layer.js";
10
+ import { error12 as u, gray12 as m, spacingElement1 as n, error1 as z, errorA12 as S, gray1 as D, textXs as E, spacingElement2 as $, radiusLg as I } from "../../tokens/index.js";
11
+ const y = Y({
12
+ // For the bare native `<button>` a Trigger/Close renders. Not applied under `asChild`, where the
13
+ // child owns its own element and two atom sets would race for the same properties.
14
+ nativeTrigger: {
15
+ ..._
16
+ },
10
17
  popup: {
18
+ ...f,
11
19
  width: "fit-content",
12
20
  transformOrigin: "var(--radix-tooltip-content-transform-origin)",
13
- ...l.borderRadius(_),
14
- ...l.padding(Y),
21
+ ...p.borderRadius(I),
22
+ ...p.padding($),
15
23
  // v1 shadow-md; elevation has no token in this package.
16
24
  boxShadow: "0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a",
17
- fontSize: X,
25
+ fontSize: E,
18
26
  // v1 leading-none; no line-height token exists.
19
27
  lineHeight: "1",
20
28
  textWrap: "balance",
21
- zIndex: 50,
29
+ zIndex: k,
22
30
  "&[data-variant='default']": {
23
- backgroundColor: p,
24
- color: S
31
+ backgroundColor: m,
32
+ color: D
25
33
  },
26
34
  "&[data-variant='destructive']": {
27
- backgroundColor: z,
28
- color: k
35
+ backgroundColor: S,
36
+ color: z
29
37
  },
30
38
  "&[data-state='open']": {
31
39
  animationName: {
@@ -81,49 +89,54 @@ const $ = P({
81
89
  }
82
90
  },
83
91
  arrow: {
92
+ ...f,
84
93
  position: "relative",
85
94
  zIndex: 50,
86
95
  width: "0.625rem",
87
96
  height: "0.625rem",
88
97
  transform: "translateY(calc(-50% - 2px)) rotate(45deg)",
89
- ...l.borderRadius("2px"),
98
+ ...p.borderRadius("2px"),
90
99
  "&[data-variant='default']": {
91
- backgroundColor: p,
92
- fill: p
100
+ backgroundColor: m,
101
+ fill: m
93
102
  },
94
103
  "&[data-variant='destructive']": {
95
- backgroundColor: d,
96
- fill: d
104
+ backgroundColor: u,
105
+ fill: u
97
106
  }
98
107
  }
99
- }), H = e.forwardRef(function({ delayDuration: t = 0, ...o }, a) {
108
+ }), q = e.forwardRef(function({ delayDuration: t = 0, ...o }, a) {
100
109
  return /* @__PURE__ */ r(
101
- h,
110
+ N,
102
111
  {
103
112
  delayDuration: t,
104
113
  "data-slot": "tooltip-provider",
105
114
  ...o
106
115
  }
107
116
  );
108
- }), W = e.forwardRef(
117
+ }), B = e.forwardRef(
109
118
  function(t, o) {
110
- return /* @__PURE__ */ r(x, { "data-slot": "tooltip", ...t });
119
+ return /* @__PURE__ */ r(w, { "data-slot": "tooltip", ...t });
111
120
  }
112
- ), Z = e.forwardRef(function({ className: t, ...o }, a) {
121
+ ), G = e.forwardRef(function({ className: t, ...o }, a) {
122
+ const l = y();
113
123
  return /* @__PURE__ */ r(
114
- R,
124
+ A,
115
125
  {
116
126
  ref: a,
117
127
  "data-slot": "tooltip-trigger",
118
128
  [s]: "tooltip-trigger",
119
- className: t,
129
+ className: g(
130
+ !o.asChild && l.nativeTrigger,
131
+ t
132
+ ),
120
133
  ...o
121
134
  }
122
135
  );
123
- }), q = e.forwardRef(
136
+ }), J = e.forwardRef(
124
137
  function(t, o) {
125
138
  return /* @__PURE__ */ r(
126
- w,
139
+ C,
127
140
  {
128
141
  "data-slot": "tooltip-portal",
129
142
  [s]: "tooltip-portal",
@@ -131,23 +144,23 @@ const $ = P({
131
144
  }
132
145
  );
133
146
  }
134
- ), B = e.forwardRef(function({ className: t, hideArrow: o = !1, variant: a = "default", children: f, ...u }, g) {
135
- const c = $(), m = A(), y = N();
136
- return /* @__PURE__ */ T(
137
- v,
147
+ ), K = e.forwardRef(function({ className: t, hideArrow: o = !1, variant: a = "default", children: l, ...T }, v) {
148
+ const c = y(), d = X(), x = P();
149
+ return /* @__PURE__ */ b(
150
+ h,
138
151
  {
139
- ref: g,
152
+ ref: v,
140
153
  "data-slot": "tooltip-content",
141
154
  [s]: "tooltip-content",
142
- ...m !== void 0 ? { "data-density": m } : {},
143
- ...y,
155
+ ...d !== void 0 ? { "data-density": d } : {},
156
+ ...x,
144
157
  "data-variant": a,
145
- className: C(c.popup, t),
146
- ...u,
158
+ className: g(c.popup, t),
159
+ ...T,
147
160
  children: [
148
- f,
161
+ l,
149
162
  !o && /* @__PURE__ */ r(
150
- b,
163
+ R,
151
164
  {
152
165
  "data-slot": "tooltip-arrow",
153
166
  [s]: "tooltip-arrow",
@@ -160,10 +173,10 @@ const $ = P({
160
173
  );
161
174
  });
162
175
  export {
163
- W as Tooltip,
164
- B as TooltipContent,
165
- q as TooltipPortal,
166
- H as TooltipProvider,
167
- Z as TooltipTrigger
176
+ B as Tooltip,
177
+ K as TooltipContent,
178
+ J as TooltipPortal,
179
+ q as TooltipProvider,
180
+ G as TooltipTrigger
168
181
  };
169
182
  //# sourceMappingURL=tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","sources":["../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { useAppearanceAttributes } from \"../appearance-boundary/appearance-boundary\"\nimport { useDensity } from \"../density-provider/density-provider\"\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport * as tokens from \"../../tokens\"\n\nconst useStyles = makeZenithStyles({\n popup: {\n width: \"fit-content\",\n transformOrigin: \"var(--radix-tooltip-content-transform-origin)\",\n ...shorthands.borderRadius(tokens.radiusLg),\n ...shorthands.padding(tokens.spacingElement2),\n // v1 shadow-md; elevation has no token in this package.\n boxShadow: \"0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a\",\n fontSize: tokens.textXs,\n // v1 leading-none; no line-height token exists.\n lineHeight: \"1\",\n textWrap: \"balance\",\n zIndex: 50,\n \"&[data-variant='default']\": {\n backgroundColor: tokens.gray12,\n color: tokens.gray1,\n },\n \"&[data-variant='destructive']\": {\n backgroundColor: tokens.errorA12,\n color: tokens.error1,\n },\n \"&[data-state='open']\": {\n animationName: {\n from: { opacity: 0, transform: \"scale(0.95)\" },\n to: { opacity: 1, transform: \"scale(1)\" },\n },\n animationDuration: \"150ms\",\n animationTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n },\n \"&[data-state='open'][data-side='bottom']\": {\n animationName: {\n from: {\n opacity: 0,\n transform: `translateY(-${tokens.spacingElement1}) scale(0.95)`,\n },\n to: { opacity: 1, transform: \"translateY(0) scale(1)\" },\n },\n },\n \"&[data-state='open'][data-side='left']\": {\n animationName: {\n from: {\n opacity: 0,\n transform: `translateX(${tokens.spacingElement1}) scale(0.95)`,\n },\n to: { opacity: 1, transform: \"translateX(0) scale(1)\" },\n },\n },\n \"&[data-state='open'][data-side='right']\": {\n animationName: {\n from: {\n opacity: 0,\n transform: `translateX(-${tokens.spacingElement1}) scale(0.95)`,\n },\n to: { opacity: 1, transform: \"translateX(0) scale(1)\" },\n },\n },\n \"&[data-state='open'][data-side='top']\": {\n animationName: {\n from: {\n opacity: 0,\n transform: `translateY(${tokens.spacingElement1}) scale(0.95)`,\n },\n to: { opacity: 1, transform: \"translateY(0) scale(1)\" },\n },\n },\n \"&[data-state='closed']\": {\n animationName: {\n from: { opacity: 1, transform: \"scale(1)\" },\n to: { opacity: 0, transform: \"scale(0.95)\" },\n },\n animationDuration: \"0ms\",\n animationTimingFunction: \"cubic-bezier(0.4, 0, 1, 1)\",\n },\n },\n arrow: {\n position: \"relative\",\n zIndex: 50,\n width: \"0.625rem\",\n height: \"0.625rem\",\n transform: \"translateY(calc(-50% - 2px)) rotate(45deg)\",\n ...shorthands.borderRadius(\"2px\"),\n \"&[data-variant='default']\": {\n backgroundColor: tokens.gray12,\n fill: tokens.gray12,\n },\n \"&[data-variant='destructive']\": {\n backgroundColor: tokens.error12,\n fill: tokens.error12,\n },\n },\n})\n\nexport type TooltipProviderProps = React.ComponentProps<\n typeof TooltipPrimitive.Provider\n>\n\nexport const TooltipProvider = React.forwardRef<\n HTMLElement,\n TooltipProviderProps\n>(function TooltipProvider({ delayDuration = 0, ...props }, _ref) {\n return (\n <TooltipPrimitive.Provider\n delayDuration={delayDuration}\n data-slot=\"tooltip-provider\"\n {...props}\n />\n )\n})\n\nexport type TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root>\n\nexport const Tooltip = React.forwardRef<HTMLElement, TooltipProps>(\n function Tooltip(props, _ref) {\n return <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n }\n)\n\nexport type TooltipTriggerProps = React.ComponentProps<\n typeof TooltipPrimitive.Trigger\n>\n\nexport const TooltipTrigger = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Trigger>,\n TooltipTriggerProps\n>(function TooltipTrigger({ className, ...props }, ref) {\n return (\n <TooltipPrimitive.Trigger\n ref={ref}\n data-slot=\"tooltip-trigger\"\n {...{ [SLOT_ATTR]: \"tooltip-trigger\" }}\n className={className}\n {...props}\n />\n )\n})\n\nexport type TooltipPortalProps = React.ComponentProps<\n typeof TooltipPrimitive.Portal\n>\n\nexport const TooltipPortal = React.forwardRef<HTMLElement, TooltipPortalProps>(\n function TooltipPortal(props, _ref) {\n return (\n <TooltipPrimitive.Portal\n data-slot=\"tooltip-portal\"\n {...{ [SLOT_ATTR]: \"tooltip-portal\" }}\n {...props}\n />\n )\n }\n)\n\nexport type TooltipContentProps = React.ComponentProps<\n typeof TooltipPrimitive.Content\n> & {\n hideArrow?: boolean\n variant?: \"default\" | \"destructive\"\n}\n\nexport const TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n TooltipContentProps\n>(function TooltipContent(\n { className, hideArrow = false, variant = \"default\", children, ...props },\n ref\n) {\n const styles = useStyles()\n // DENSITY-SPEC.md §4.4 — portal content boundary; see dialog.tsx's identical comment. Tooltip\n // content rarely nests density-consuming children, but the mechanism is applied uniformly across\n // every portal-content component rather than special-cased per component.\n const override = useDensity()\n // SPEC.md §2 rule 3 — the same portal asymmetry, for the appearance pair: re-stamp the\n // nearest explicit AppearanceBoundary's mode+surface, or neither attribute when there is\n // none, leaving live shell inheritance in place.\n const appearance = useAppearanceAttributes()\n\n return (\n <TooltipPrimitive.Content\n ref={ref}\n data-slot=\"tooltip-content\"\n {...{ [SLOT_ATTR]: \"tooltip-content\" }}\n {...(override !== undefined ? { \"data-density\": override } : {})}\n {...appearance}\n data-variant={variant}\n className={mergeClasses(styles.popup, className)}\n {...props}\n >\n {children}\n {!hideArrow && (\n <TooltipPrimitive.Arrow\n data-slot=\"tooltip-arrow\"\n {...{ [SLOT_ATTR]: \"tooltip-arrow\" }}\n data-variant={variant}\n className={styles.arrow}\n />\n )}\n </TooltipPrimitive.Content>\n )\n})\n"],"names":["useStyles","makeZenithStyles","shorthands","tokens.radiusLg","tokens.spacingElement2","tokens.textXs","tokens.gray12","tokens.gray1","tokens.errorA12","tokens.error1","tokens.spacingElement1","tokens.error12","TooltipProvider","React","delayDuration","props","_ref","jsx","TooltipPrimitive.Provider","Tooltip","TooltipPrimitive.Root","TooltipTrigger","className","ref","TooltipPrimitive.Trigger","SLOT_ATTR","TooltipPortal","TooltipPrimitive.Portal","TooltipContent","hideArrow","variant","children","styles","override","useDensity","appearance","useAppearanceAttributes","jsxs","TooltipPrimitive.Content","mergeClasses","TooltipPrimitive.Arrow"],"mappings":";;;;;;;;AAWA,MAAMA,IAAYC,EAAiB;AAAA,EACjC,OAAO;AAAA,IACL,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,GAAGC,EAAW,aAAaC,CAAe;AAAA,IAC1C,GAAGD,EAAW,QAAQE,CAAsB;AAAA;AAAA,IAE5C,WAAW;AAAA,IACX,UAAUC;AAAAA;AAAAA,IAEV,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,6BAA6B;AAAA,MAC3B,iBAAiBC;AAAAA,MACjB,OAAOC;AAAAA,IAAO;AAAA,IAEhB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SAAAC,IAAU,WAAW,UAAAC,GAAU,GAAGhB,EAAA,GAClEQ,GACA;AACA,QAAMS,IAAShC,EAAA,GAITiC,IAAWC,EAAA,GAIXC,IAAaC,EAAA;AAEnB,SACE,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,KAAAf;AAAA,MACA,aAAU;AAAA,MACJ,CAACE,CAAS,GAAG;AAAA,MAClB,GAAIQ,MAAa,SAAY,EAAE,gBAAgBA,EAAA,IAAa,CAAA;AAAA,MAC5D,GAAGE;AAAA,MACJ,gBAAcL;AAAA,MACd,WAAWS,EAAaP,EAAO,OAAOV,CAAS;AAAA,MAC9C,GAAGP;AAAA,MAEH,UAAA;AAAA,QAAAgB;AAAA,QACA,CAACF,KACA,gBAAAZ;AAAA,UAACuB;AAAAA,UAAA;AAAA,YACC,aAAU;AAAA,YACJ,CAACf,CAAS,GAAG;AAAA,YACnB,gBAAcK;AAAA,YACd,WAAWE,EAAO;AAAA,UAAA;AAAA,QAAA;AAAA,MACpB;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
1
+ {"version":3,"file":"tooltip.js","sources":["../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { useAppearanceAttributes } from \"../appearance-boundary/appearance-boundary\"\nimport { useDensity } from \"../density-provider/density-provider\"\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport { OVERLAY_Z_INDEX } from \"../../styles/overlay-layer\"\nimport * as tokens from \"../../tokens\"\n\nconst useStyles = makeZenithStyles({\n // For the bare native `<button>` a Trigger/Close renders. Not applied under `asChild`, where the\n // child owns its own element and two atom sets would race for the same properties.\n nativeTrigger: {\n ...nativeControl,\n },\n popup: {\n ...boxModel,\n width: \"fit-content\",\n transformOrigin: \"var(--radix-tooltip-content-transform-origin)\",\n ...shorthands.borderRadius(tokens.radiusLg),\n ...shorthands.padding(tokens.spacingElement2),\n // v1 shadow-md; elevation has no token in this package.\n boxShadow: \"0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a\",\n fontSize: tokens.textXs,\n // v1 leading-none; no line-height token exists.\n lineHeight: \"1\",\n textWrap: \"balance\",\n zIndex: OVERLAY_Z_INDEX,\n \"&[data-variant='default']\": {\n backgroundColor: tokens.gray12,\n color: tokens.gray1,\n },\n \"&[data-variant='destructive']\": {\n backgroundColor: tokens.errorA12,\n color: tokens.error1,\n },\n \"&[data-state='open']\": {\n animationName: {\n from: { opacity: 0, transform: \"scale(0.95)\" },\n to: { opacity: 1, transform: \"scale(1)\" },\n },\n animationDuration: \"150ms\",\n animationTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n },\n \"&[data-state='open'][data-side='bottom']\": {\n animationName: {\n from: {\n opacity: 0,\n transform: `translateY(-${tokens.spacingElement1}) scale(0.95)`,\n },\n to: { opacity: 1, transform: \"translateY(0) scale(1)\" },\n },\n },\n \"&[data-state='open'][data-side='left']\": {\n animationName: {\n from: {\n opacity: 0,\n transform: `translateX(${tokens.spacingElement1}) scale(0.95)`,\n },\n to: { opacity: 1, transform: \"translateX(0) scale(1)\" },\n },\n },\n \"&[data-state='open'][data-side='right']\": {\n animationName: {\n from: {\n opacity: 0,\n transform: `translateX(-${tokens.spacingElement1}) scale(0.95)`,\n },\n to: { opacity: 1, transform: \"translateX(0) scale(1)\" },\n },\n },\n \"&[data-state='open'][data-side='top']\": {\n animationName: {\n from: {\n opacity: 0,\n transform: `translateY(${tokens.spacingElement1}) scale(0.95)`,\n },\n to: { opacity: 1, transform: \"translateY(0) scale(1)\" },\n },\n },\n \"&[data-state='closed']\": {\n animationName: {\n from: { opacity: 1, transform: \"scale(1)\" },\n to: { opacity: 0, transform: \"scale(0.95)\" },\n },\n animationDuration: \"0ms\",\n animationTimingFunction: \"cubic-bezier(0.4, 0, 1, 1)\",\n },\n },\n arrow: {\n ...boxModel,\n position: \"relative\",\n zIndex: 50,\n width: \"0.625rem\",\n height: \"0.625rem\",\n transform: \"translateY(calc(-50% - 2px)) rotate(45deg)\",\n ...shorthands.borderRadius(\"2px\"),\n \"&[data-variant='default']\": {\n backgroundColor: tokens.gray12,\n fill: tokens.gray12,\n },\n \"&[data-variant='destructive']\": {\n backgroundColor: tokens.error12,\n fill: tokens.error12,\n },\n },\n})\n\nexport type TooltipProviderProps = React.ComponentProps<\n typeof TooltipPrimitive.Provider\n>\n\nexport const TooltipProvider = React.forwardRef<\n HTMLElement,\n TooltipProviderProps\n>(function TooltipProvider({ delayDuration = 0, ...props }, _ref) {\n return (\n <TooltipPrimitive.Provider\n delayDuration={delayDuration}\n data-slot=\"tooltip-provider\"\n {...props}\n />\n )\n})\n\nexport type TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root>\n\nexport const Tooltip = React.forwardRef<HTMLElement, TooltipProps>(\n function Tooltip(props, _ref) {\n return <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n }\n)\n\nexport type TooltipTriggerProps = React.ComponentProps<\n typeof TooltipPrimitive.Trigger\n>\n\nexport const TooltipTrigger = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Trigger>,\n TooltipTriggerProps\n>(function TooltipTrigger({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <TooltipPrimitive.Trigger\n ref={ref}\n data-slot=\"tooltip-trigger\"\n {...{ [SLOT_ATTR]: \"tooltip-trigger\" }}\n className={mergeClasses(\n !props.asChild && styles.nativeTrigger,\n className\n )}\n {...props}\n />\n )\n})\n\nexport type TooltipPortalProps = React.ComponentProps<\n typeof TooltipPrimitive.Portal\n>\n\nexport const TooltipPortal = React.forwardRef<HTMLElement, TooltipPortalProps>(\n function TooltipPortal(props, _ref) {\n return (\n <TooltipPrimitive.Portal\n data-slot=\"tooltip-portal\"\n {...{ [SLOT_ATTR]: \"tooltip-portal\" }}\n {...props}\n />\n )\n }\n)\n\nexport type TooltipContentProps = React.ComponentProps<\n typeof TooltipPrimitive.Content\n> & {\n hideArrow?: boolean\n variant?: \"default\" | \"destructive\"\n}\n\nexport const TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n TooltipContentProps\n>(function TooltipContent(\n { className, hideArrow = false, variant = \"default\", children, ...props },\n ref\n) {\n const styles = useStyles()\n // DENSITY-SPEC.md §4.4 — portal content boundary; see dialog.tsx's identical comment. Tooltip\n // content rarely nests density-consuming children, but the mechanism is applied uniformly across\n // every portal-content component rather than special-cased per component.\n const override = useDensity()\n // SPEC.md §2 rule 3 — the same portal asymmetry, for the appearance pair: re-stamp the\n // nearest explicit AppearanceBoundary's mode+surface, or neither attribute when there is\n // none, leaving live shell inheritance in place.\n const appearance = useAppearanceAttributes()\n\n return (\n <TooltipPrimitive.Content\n ref={ref}\n data-slot=\"tooltip-content\"\n {...{ [SLOT_ATTR]: \"tooltip-content\" }}\n {...(override !== undefined ? { \"data-density\": override } : {})}\n {...appearance}\n data-variant={variant}\n className={mergeClasses(styles.popup, className)}\n {...props}\n >\n {children}\n {!hideArrow && (\n <TooltipPrimitive.Arrow\n data-slot=\"tooltip-arrow\"\n {...{ [SLOT_ATTR]: \"tooltip-arrow\" }}\n data-variant={variant}\n className={styles.arrow}\n />\n )}\n </TooltipPrimitive.Content>\n )\n})\n"],"names":["useStyles","makeZenithStyles","nativeControl","boxModel","shorthands","tokens.radiusLg","tokens.spacingElement2","tokens.textXs","OVERLAY_Z_INDEX","tokens.gray12","tokens.gray1","tokens.errorA12","tokens.error1","tokens.spacingElement1","tokens.error12","TooltipProvider","React","delayDuration","props","_ref","jsx","TooltipPrimitive.Provider","Tooltip","TooltipPrimitive.Root","TooltipTrigger","className","ref","styles","TooltipPrimitive.Trigger","SLOT_ATTR","mergeClasses","TooltipPortal","TooltipPrimitive.Portal","TooltipContent","hideArrow","variant","children","override","useDensity","appear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AAA;AAAA,MACpB;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
package/dist/index.d.ts CHANGED
@@ -3606,6 +3606,11 @@ declare const Badge: React.ForwardRefExoticComponent<Omit<BadgeProps, "ref"> & R
3606
3606
  /** Breadcrumb — Card's compound pattern applied to the nav / ol / li structure. */
3607
3607
  type BreadcrumbProps = React.ComponentProps<"nav"> & {
3608
3608
  separator?: React.ReactNode;
3609
+ /**
3610
+ * Accessible name of the navigation landmark, read by screen readers. Pass a translated string
3611
+ * for any locale other than English. Defaults to "Breadcrumb".
3612
+ */
3613
+ "aria-label"?: string;
3609
3614
  };
3610
3615
  declare const Breadcrumb: React.ForwardRefExoticComponent<Omit<BreadcrumbProps, "ref"> & React.RefAttributes<HTMLElement>>;
3611
3616
  type BreadcrumbItemProps = Omit<React.ComponentProps<"a">, "href"> & {
@@ -3617,6 +3622,11 @@ type BreadcrumbItemProps = Omit<React.ComponentProps<"a">, "href"> & {
3617
3622
  * was on Base UI and restored once it moved back to Radix.
3618
3623
  */
3619
3624
  asChild?: boolean;
3625
+ /**
3626
+ * Keep the crumb on one line and cut it with an ellipsis when the trail runs out of room, with
3627
+ * the full text as its `title`. Pass `title` yourself when the children are not plain text.
3628
+ */
3629
+ truncate?: boolean;
3620
3630
  };
3621
3631
  declare const BreadcrumbItem: React.ForwardRefExoticComponent<Omit<BreadcrumbItemProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
3622
3632
 
@@ -4152,6 +4162,8 @@ type TabsListProps = React.ComponentProps<typeof List$1>;
4152
4162
  declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsListProps$1 & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4153
4163
  type TabsTriggerProps = React.ComponentProps<typeof Trigger$6> & {
4154
4164
  variant?: TabsTriggerVariant;
4165
+ /** The tab's label. Plain text (a string, number, or array of them) reserves its semibold width so selection never shifts layout; rich children such as icons or elements are not reserved. */
4166
+ children?: React.ReactNode;
4155
4167
  };
4156
4168
  declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
4157
4169
  type TabsContentProps = React.ComponentProps<typeof Content$8>;
@@ -1,10 +1,11 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import { mergeClasses as a, SLOT_ATTR as c } from "@epilot/zenith-runtime/v1";
4
- import { makeZenithStyles as m } from "../styles/make-styles.js";
5
- import { accentA8 as u } from "../tokens/index.js";
6
- import { CloseIcon as f } from "./icons.js";
7
- const p = m({
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import * as a from "react";
3
+ import { mergeClasses as c, SLOT_ATTR as m } from "@epilot/zenith-runtime/v1";
4
+ import { nativeControlReset as u } from "../styles/host-reset.js";
5
+ import { makeZenithResetStyles as f, makeZenithStyles as p } from "../styles/make-styles.js";
6
+ import { accentA8 as d } from "../tokens/index.js";
7
+ import { CloseIcon as b } from "./icons.js";
8
+ const h = f(u), C = p({
8
9
  root: {
9
10
  display: "inline-flex",
10
11
  alignItems: "center",
@@ -21,7 +22,7 @@ const p = m({
21
22
  outlineWidth: "2px",
22
23
  outlineStyle: "solid",
23
24
  outlineOffset: "1px",
24
- outlineColor: u
25
+ outlineColor: d
25
26
  }
26
27
  },
27
28
  icon: {
@@ -29,23 +30,23 @@ const p = m({
29
30
  width: "0.75rem",
30
31
  height: "0.75rem"
31
32
  }
32
- }), g = s.forwardRef(function({ className: e, label: r = "Remove", children: n, ...i }, l) {
33
- const o = p();
34
- return /* @__PURE__ */ t(
33
+ }), T = a.forwardRef(function({ className: o, label: r = "Remove", children: n, ...s }, i) {
34
+ const l = h(), t = C();
35
+ return /* @__PURE__ */ e(
35
36
  "button",
36
37
  {
37
- ref: l,
38
+ ref: i,
38
39
  type: "button",
39
40
  "data-slot": "clear-button",
40
- [c]: "clear-button",
41
+ [m]: "clear-button",
41
42
  "aria-label": r,
42
- className: a(o.root, e),
43
- ...i,
44
- children: n ?? /* @__PURE__ */ t(f, { className: o.icon })
43
+ className: c(l, t.root, o),
44
+ ...s,
45
+ children: n ?? /* @__PURE__ */ e(b, { className: t.icon })
45
46
  }
46
47
  );
47
48
  });
48
49
  export {
49
- g as ClearButton
50
+ T as ClearButton
50
51
  };
51
52
  //# sourceMappingURL=clear-button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clear-button.js","sources":["../../src/lib/clear-button.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../renderer/contract\"\nimport { makeZenithStyles } from \"../styles/make-styles\"\nimport * as tokens from \"../tokens\"\nimport { CloseIcon } from \"./icons\"\n\n/** ClearButton — v1's shared dismiss button ported to Griffel atoms. */\n\nconst useStyles = makeZenithStyles({\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n // rounded-full — no token for a fully rounded radius.\n borderRadius: \"9999px\",\n flexShrink: 0,\n cursor: \"pointer\",\n \":hover\": {\n // v1's `hover:bg-current/10` — a literal because no token expresses a currentColor tint.\n backgroundColor: \"color-mix(in srgb, currentColor 10%, transparent)\",\n },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"1px\",\n outlineColor: tokens.accentA8,\n },\n },\n icon: {\n // size-3 — the CloseIcon fallback.\n width: \"0.75rem\",\n height: \"0.75rem\",\n },\n})\n\nexport type ClearButtonProps = React.ComponentProps<\"button\"> & {\n label?: string\n}\n\nexport const ClearButton = React.forwardRef<\n HTMLButtonElement,\n ClearButtonProps\n>(function ClearButton(\n { className, label = \"Remove\", children, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <button\n ref={ref}\n type=\"button\"\n data-slot=\"clear-button\"\n {...{ [SLOT_ATTR]: \"clear-button\" }}\n aria-label={label}\n className={mergeClasses(styles.root, className)}\n {...props}\n >\n {children ?? <CloseIcon className={styles.icon} />}\n </button>\n )\n})\n"],"names":["useStyles","makeZenithStyles","tokens.accentA8","ClearButton","React","className","label","children","props","ref","styles","jsx","SLOT_ATTR","mergeClasses","CloseIcon"],"mappings":";;;;;;AAWA,MAAMA,IAAYC,EAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA;AAAA,IAEhB,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,UAAU;AAAA;AAAA,MAER,iBAAiB;AAAA,IAAA;AAAA,IAEnB,kBAAkB;AAAA,MAChB,cAAc;AAAA,MACd,cAAc;AAAA,MACd,eAAe;AAAA,MACf,cAAcC;AAAAA,IAAO;AAAA,EACvB;AAAA,EAEF,MAAM;AAAA;AAAA,IAEJ,OAAO;AAAA,IACP,QAAQ;AAAA,EAAA;AAEZ,CAAC,GAMYC,IAAcC,EAAM,WAG/B,SACA,EAAE,WAAAC,GAAW,OAAAC,IAAQ,UAAU,UAAAC,GAAU,GAAGC,EAAA,GAC5CC,GACA;AACA,QAAMC,IAASV,EAAA;AAEf,SACE,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,MAAK;AAAA,MACL,aAAU;AAAA,MACJ,CAACG,CAAS,GAAG;AAAA,MACnB,cAAYN;AAAA,MACZ,WAAWO,EAAaH,EAAO,MAAML,CAAS;AAAA,MAC7C,GAAGG;AAAA,MAEH,UAAAD,KAAY,gBAAAI,EAACG,GAAA,EAAU,WAAWJ,EAAO,KAAA,CAAM;AAAA,IAAA;AAAA,EAAA;AAGtD,CAAC;"}
1
+ {"version":3,"file":"clear-button.js","sources":["../../src/lib/clear-button.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../renderer/contract\"\nimport { nativeControlReset } from \"../styles/host-reset\"\nimport { makeZenithResetStyles, makeZenithStyles } from \"../styles/make-styles\"\nimport * as tokens from \"../tokens\"\nimport { CloseIcon } from \"./icons\"\n\n/** ClearButton — v1's shared dismiss button ported to Griffel atoms. */\n\nconst useReset = makeZenithResetStyles(nativeControlReset)\n\nconst useStyles = makeZenithStyles({\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n // rounded-full — no token for a fully rounded radius.\n borderRadius: \"9999px\",\n flexShrink: 0,\n cursor: \"pointer\",\n \":hover\": {\n // v1's `hover:bg-current/10` — a literal because no token expresses a currentColor tint.\n backgroundColor: \"color-mix(in srgb, currentColor 10%, transparent)\",\n },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"1px\",\n outlineColor: tokens.accentA8,\n },\n },\n icon: {\n // size-3 — the CloseIcon fallback.\n width: \"0.75rem\",\n height: \"0.75rem\",\n },\n})\n\nexport type ClearButtonProps = React.ComponentProps<\"button\"> & {\n label?: string\n}\n\nexport const ClearButton = React.forwardRef<\n HTMLButtonElement,\n ClearButtonProps\n>(function ClearButton(\n { className, label = \"Remove\", children, ...props },\n ref\n) {\n const reset = useReset()\n const styles = useStyles()\n\n return (\n <button\n ref={ref}\n type=\"button\"\n data-slot=\"clear-button\"\n {...{ [SLOT_ATTR]: \"clear-button\" }}\n aria-label={label}\n className={mergeClasses(reset, styles.root, className)}\n {...props}\n >\n {children ?? <CloseIcon className={styles.icon} />}\n </button>\n )\n})\n"],"names":["useReset","makeZenithResetStyles","nativeControlReset","useStyles","makeZenithStyles","tokens.accentA8","ClearButton","React","className","label","children","props","ref","reset","styles","jsx","SLOT_ATTR","mergeClasses","CloseIcon"],"mappings":";;;;;;;AAYA,MAAMA,IAAWC,EAAsBC,CAAkB,GAEnDC,IAAYC,EAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA;AAAA,IAEhB,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,UAAU;AAAA;AAAA,MAER,iBAAiB;AAAA,IAAA;AAAA,IAEnB,kBAAkB;AAAA,MAChB,cAAc;AAAA,MACd,cAAc;AAAA,MACd,eAAe;AAAA,MACf,cAAcC;AAAAA,IAAO;AAAA,EACvB;AAAA,EAEF,MAAM;AAAA;AAAA,IAEJ,OAAO;AAAA,IACP,QAAQ;AAAA,EAAA;AAEZ,CAAC,GAMYC,IAAcC,EAAM,WAG/B,SACA,EAAE,WAAAC,GAAW,OAAAC,IAAQ,UAAU,UAAAC,GAAU,GAAGC,EAAA,GAC5CC,GACA;AACA,QAAMC,IAAQb,EAAA,GACRc,IAASX,EAAA;AAEf,SACE,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,MAAK;AAAA,MACL,aAAU;AAAA,MACJ,CAACI,CAAS,GAAG;AAAA,MACnB,cAAYP;AAAA,MACZ,WAAWQ,EAAaJ,GAAOC,EAAO,MAAMN,CAAS;AAAA,MACpD,GAAGG;AAAA,MAEH,UAAAD,KAAY,gBAAAK,EAACG,GAAA,EAAU,WAAWJ,EAAO,KAAA,CAAM;AAAA,IAAA;AAAA,EAAA;AAGtD,CAAC;"}
@@ -0,0 +1,47 @@
1
+ const t = {
2
+ boxSizing: "border-box"
3
+ }, i = {
4
+ fontFamily: "inherit",
5
+ fontSize: "inherit",
6
+ fontWeight: "inherit",
7
+ lineHeight: "inherit",
8
+ letterSpacing: "inherit"
9
+ }, n = {
10
+ boxSizing: "border-box",
11
+ // Longhands written out, not `shorthands.*()`, so this stays a plain literal type: a fragment
12
+ // typed as the whole GriffelStyle union made every spread site expensive for the type checker.
13
+ marginTop: 0,
14
+ marginRight: 0,
15
+ marginBottom: 0,
16
+ marginLeft: 0,
17
+ paddingTop: 0,
18
+ paddingRight: 0,
19
+ paddingBottom: 0,
20
+ paddingLeft: 0,
21
+ borderTopWidth: 0,
22
+ borderRightWidth: 0,
23
+ borderBottomWidth: 0,
24
+ borderLeftWidth: 0,
25
+ backgroundColor: "transparent",
26
+ color: "inherit",
27
+ ...i
28
+ }, o = {
29
+ boxSizing: "border-box",
30
+ margin: 0,
31
+ padding: 0,
32
+ borderWidth: 0,
33
+ backgroundColor: "transparent",
34
+ color: "inherit",
35
+ fontFamily: "inherit",
36
+ fontSize: "inherit",
37
+ fontWeight: "inherit",
38
+ lineHeight: "inherit",
39
+ letterSpacing: "inherit"
40
+ };
41
+ export {
42
+ t as boxModel,
43
+ i as inheritFont,
44
+ n as nativeControl,
45
+ o as nativeControlReset
46
+ };
47
+ //# sourceMappingURL=host-reset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-reset.js","sources":["../../src/styles/host-reset.ts"],"sourcesContent":["import {\n type GriffelResetStyle,\n type GriffelStyle,\n} from \"@epilot/zenith-runtime/v1\"\n\n/**\n * Zenith ships no CSS, and a component must look the same whether or not the host page carries a\n * reset (Tailwind preflight, normalize, none). These fragments are what a Zenith-owned element\n * states for itself instead of inheriting from one. They are spread FIRST into a slot, so anything\n * the slot goes on to say wins. `gate:host-reset` proves the result.\n *\n * Nothing here is a selector: each fragment lands on an element Zenith renders, never on one the\n * host owns.\n */\n\n/** A box that adds padding or a border to a set size must say how it is measured. */\nexport const boxModel = {\n boxSizing: \"border-box\",\n} as const satisfies GriffelStyle\n\n/** The font a form control would otherwise replace with the browser's own. */\nexport const inheritFont = {\n fontFamily: \"inherit\",\n fontSize: \"inherit\",\n fontWeight: \"inherit\",\n lineHeight: \"inherit\",\n letterSpacing: \"inherit\",\n} as const satisfies GriffelStyle\n\n/**\n * A native `<button>`/`<input>`/`<textarea>` with the browser's chrome removed: no border, no\n * padding, no margin, no fill, the page's colour and font.\n */\nexport const nativeControl = {\n boxSizing: \"border-box\",\n // Longhands written out, not `shorthands.*()`, so this stays a plain literal type: a fragment\n // typed as the whole GriffelStyle union made every spread site expensive for the type checker.\n marginTop: 0,\n marginRight: 0,\n marginBottom: 0,\n marginLeft: 0,\n paddingTop: 0,\n paddingRight: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n borderTopWidth: 0,\n borderRightWidth: 0,\n borderBottomWidth: 0,\n borderLeftWidth: 0,\n backgroundColor: \"transparent\",\n color: \"inherit\",\n ...inheritFont,\n} as const satisfies GriffelStyle\n\n/**\n * `nativeControl` as ONE monolithic reset class (see `makeZenithResetStyles`) instead of a dozen\n * atoms, for an element that renders many times on a page.\n */\nexport const nativeControlReset = {\n boxSizing: \"border-box\",\n margin: 0,\n padding: 0,\n borderWidth: 0,\n backgroundColor: \"transparent\",\n color: \"inherit\",\n fontFamily: \"inherit\",\n fontSize: \"inherit\",\n fontWeight: \"inherit\",\n lineHeight: \"inherit\",\n letterSpacing: \"inherit\",\n} as const satisfies GriffelResetStyle\n"],"names":["boxModel","inheritFont","nativeControl","nativeControlReset"],"mappings":"AAgBO,MAAMA,IAAW;AAAA,EACtB,WAAW;AACb,GAGaC,IAAc;AAAA,EACzB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,eAAe;AACjB,GAMaC,IAAgB;AAAA,EAC3B,WAAW;AAAA;AAAA;AAAA,EAGX,WAAW;AAAA,EACX,aAAa;AAAA,EACb,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,eAAe;AAAA,EACf,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,GAAGD;AACL,GAMaE,IAAqB;AAAA,EAChC,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,eAAe;AACjB;"}
@@ -0,0 +1,5 @@
1
+ const o = 1300;
2
+ export {
3
+ o as OVERLAY_Z_INDEX
4
+ };
5
+ //# sourceMappingURL=overlay-layer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-layer.js","sources":["../../src/styles/overlay-layer.ts"],"sourcesContent":["/**\n * The z-index every portalled overlay stacks at: Dialog, AlertDialog, Drawer, Popover, Tooltip,\n * DropdownMenu and the Selects. One shared value, not tiers: Radix appends each portal to `body`\n * when it opens, so with equal z-index the later-opened overlay paints on top, and a menu opened\n * from inside a Drawer lands above it. Package-internal; v1's z-1300 overlay tier.\n */\nexport const OVERLAY_Z_INDEX = 1300\n"],"names":["OVERLAY_Z_INDEX"],"mappings":"AAMO,MAAMA,IAAkB;"}
package/dist/tokens.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$comment": "GENERATED. Design token values for consumers that do not render this package's React components. Compile these into your own CSS under your own names at your own build time; do not reference this package's runtime custom properties, whose names are content-hashed and change with their values. `themes.light`/`themes.dark` are mode-resolved; `densities.compact`/`densities.normal`/`densities.comfortable` resolve the component layer's geometry tokens (WP9A-ACCEPTANCE-WP9B1) and carry no mode of their own — do not read a value out of `themes` for a key that only exists under `densities`, or the reverse. This file is copied verbatim to this package's public `tokens.json` export (`package.json`'s `build` script, `cp src/generated/values.generated.json dist/tokens.json`).",
3
3
  "package": "@epilot/zenith-react",
4
- "version": "0.2.0-next.0",
4
+ "version": "0.2.0-next.3",
5
5
  "themes": {
6
6
  "light": {
7
7
  "accent-1": "#fcfdfe",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/zenith-react",
3
- "version": "0.2.0-next.0",
3
+ "version": "0.2.0-next.3",
4
4
  "description": "Zenith React components, styled with Griffel and designed for isolated micro-frontend delivery",
5
5
  "type": "module",
6
6
  "repository": {
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "scripts": {
50
50
  "prepack": "bun run build",
51
- "build": "rm -rf dist && bun run tokens && bun scripts/emit-runtime-contract.ts && tsc --project tsconfig.build.json && vite build && node scripts/bundle-dts.mjs && cp src/tokens/values.generated.json dist/tokens.json",
51
+ "build": "rm -rf dist && bun run tokens && bun scripts/emit-runtime-contract.ts && tsc --project tsconfig.build.json && vite build && node scripts/bundle-dts.mjs && cp src/tokens/values.generated.json dist/tokens.json && node scripts/assert-token-layout.mjs",
52
52
  "tokens": "bun ../tokens/scripts/build.ts",
53
53
  "test": "vitest run",
54
54
  "react18:test": "vitest run --config vitest.react18.config.ts",
@@ -63,10 +63,12 @@
63
63
  "gate:a11y": "node scripts/a11y-browser-check.mjs",
64
64
  "gate:palette-namespace": "node scripts/palette-namespace-check.mjs",
65
65
  "gate:appearance-boundary": "node gates/appearance-boundary/build-and-run.mjs",
66
+ "gate:host-reset": "node gates/host-reset/build-and-run.mjs",
66
67
  "gate:surface-composition": "node gates/surface-composition/build-and-run.mjs",
67
- "gates": "bun run gate:vr && bun run gate:isolation && bun run gate:token-value-skew && bun run gate:class-salt-skew && bun run gate:cascade && bun run gate:lifecycle-commit-phase && bun run gate:dts-self-contained && bun run gate:a11y && bun run gate:palette-namespace && bun run gate:appearance-boundary && bun run gate:surface-composition && bun run gate:one-bare-specifier",
68
+ "gate:table-rules": "node gates/table-rules/build-and-run.mjs",
69
+ "gates": "bun run gate:vr && bun run gate:isolation && bun run gate:token-value-skew && bun run gate:class-salt-skew && bun run gate:cascade && bun run gate:lifecycle-commit-phase && bun run gate:dts-self-contained && bun run gate:a11y && bun run gate:palette-namespace && bun run gate:appearance-boundary && bun run gate:surface-composition && bun run gate:one-bare-specifier && bun run gate:host-reset && bun run gate:table-rules",
68
70
  "migration:sweep": "bun scripts/migration-sweep.mjs",
69
- "test:migration-sweep": "bun test scripts/migration-diagnostics.test.mjs scripts/migration-diagnostics-core.test.mjs scripts/migration-sweep-packed-cli.test.mjs scripts/build-diagnostic-identity.test.mjs",
71
+ "test:migration-sweep": "bun test scripts/migration-diagnostics.test.mjs scripts/migration-diagnostics-core.test.mjs scripts/migration-sweep-packed-cli.test.mjs scripts/migration-sweep-cli-guard.test.mjs scripts/build-diagnostic-identity.test.mjs",
70
72
  "gate:one-bare-specifier": "node gates/one-bare-specifier.mjs",
71
73
  "gate:dts-self-contained": "node gates/dts-self-contained.mjs",
72
74
  "verify:release": "bun ../../scripts/verify-release.ts",
@@ -83,7 +85,7 @@
83
85
  "@dnd-kit/core": "6.3.1",
84
86
  "@dnd-kit/sortable": "10.0.0",
85
87
  "@dnd-kit/utilities": "3.2.2",
86
- "@epilot/zenith-tokens": "0.2.0-next.0",
88
+ "@epilot/zenith-tokens": "0.2.0-next.3",
87
89
  "@radix-ui/react-accordion": "1.2.12",
88
90
  "@radix-ui/react-alert-dialog": "1.1.15",
89
91
  "@radix-ui/react-avatar": "1.1.10",
@@ -121,7 +123,7 @@
121
123
  "rollup-plugin-dts": "^6.5.1",
122
124
  "sonner": "2.0.7",
123
125
  "typescript": "^5.6.3",
124
- "vite": "^6.4.3",
126
+ "vite": "^6.4.4",
125
127
  "vitest": "^4.1.11"
126
128
  },
127
129
  "typesVersions": {
@@ -34,20 +34,55 @@ function sha256(content) {
34
34
  return createHash("sha256").update(content).digest("hex")
35
35
  }
36
36
 
37
+ /**
38
+ * Where a built package keeps its generated token modules. The published build bundles
39
+ * `@epilot/zenith-tokens` with preserved modules, so they ship under the tokens package's own dist
40
+ * path, and `dist/tokens/` holds only namespace stubs. `dist/tokens` is the pre-0.2 layout, used
41
+ * only when the shipped directory does not exist at all: falling back per file would read a stub
42
+ * and blame a stale build for a module that is simply missing. `scripts/assert-token-layout.mjs`
43
+ * fails the build if the bundler stops emitting the modules here.
44
+ */
45
+ export const SHIPPED_TOKEN_DIR = "dist/packages/tokens/dist/generated"
46
+ const LEGACY_TOKEN_DIR = "dist/tokens"
47
+
48
+ function tokenDir(packageDir) {
49
+ return existsSync(join(packageDir, SHIPPED_TOKEN_DIR))
50
+ ? SHIPPED_TOKEN_DIR
51
+ : LEGACY_TOKEN_DIR
52
+ }
53
+
54
+ /** Returns `{ full, relativePath }` for a built package's generated token module, or throws. */
55
+ export function resolveGeneratedTokenFile(packageDir, file) {
56
+ const relativePath = `${tokenDir(packageDir)}/${file}`
57
+ const full = join(packageDir, relativePath)
58
+ if (existsSync(full)) return { full, relativePath }
59
+ throw new Error(
60
+ `Missing generated token file: ${relativePath} under ${packageDir}. The package is not built, or its build no longer emits this module there — run \`bun run build\` there first.`
61
+ )
62
+ }
63
+
64
+ /**
65
+ * The generated token module, then the `dist/tokens` stub of the same name when the shipped layout
66
+ * also has one. The build tree-shakes literals the bundled module does not use into the stub
67
+ * (palette's NS), so the identity check reads both. Throws like resolveGeneratedTokenFile.
68
+ */
69
+ export function generatedTokenFiles(packageDir, file) {
70
+ const found = resolveGeneratedTokenFile(packageDir, file)
71
+ const stub = join(packageDir, LEGACY_TOKEN_DIR, file)
72
+ return found.full !== stub && existsSync(stub)
73
+ ? [found, { full: stub, relativePath: `${LEGACY_TOKEN_DIR}/${file}` }]
74
+ : [found]
75
+ }
76
+
37
77
  function readGeneratedFamilies(packageDir, file) {
38
- const full = join(packageDir, "dist/tokens", file)
39
- if (!existsSync(full)) {
40
- throw new Error(
41
- `Missing generated token file: dist/tokens/${file} under ${packageDir}. The package is not built — run \`bun run build\` there first.`
42
- )
43
- }
78
+ const { full, relativePath } = resolveGeneratedTokenFile(packageDir, file)
44
79
  const content = readFileSync(full, "utf8")
45
80
  const families = new Set(
46
81
  [...content.matchAll(/--zenith-[a-z0-9]+-([a-z]+)-/g)].map((m) => m[1])
47
82
  )
48
83
  if (families.size === 0) {
49
84
  throw new Error(
50
- `Generated token file dist/tokens/${file} under ${packageDir} contains no recognizable family declarations. ` +
85
+ `Generated token file ${relativePath} under ${packageDir} contains no recognizable family declarations. ` +
51
86
  "It exists but is empty or malformed (does not match the expected --zenith-<hash>-<family>- pattern) — " +
52
87
  "the package build is likely stale or broken. Re-run `bun run build` there, do not proceed with an empty family set."
53
88
  )
@@ -3,7 +3,9 @@
3
3
  * survive every other gate (see migration-diagnostics.mjs for the rule catalogue and the analysis-
4
4
  * boundary documentation; this file is argv parsing and output formatting only).
5
5
  */
6
+ import { realpathSync } from "node:fs"
6
7
  import { resolve } from "node:path"
8
+ import { fileURLToPath } from "node:url"
7
9
  import {
8
10
  analyzeTarget,
9
11
  resolveConsumerTypeScript,
@@ -189,7 +191,13 @@ export async function runCli(argv) {
189
191
  return hasHardFailure ? 1 : 0
190
192
  }
191
193
 
192
- if (import.meta.url === `file://${process.argv[1]}`) {
194
+ // Compare resolved paths: under symlinked node_modules (worktrees, pnpm) argv[1] is the invoked
195
+ // path while import.meta.url is the resolved one, and a string compare silently skipped the run.
196
+ const isMain =
197
+ process.argv[1] !== undefined &&
198
+ realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1])
199
+
200
+ if (isMain) {
193
201
  const code = await runCli(process.argv.slice(2))
194
202
  process.exit(code)
195
203
  }