@epilot/zenith-react 0.2.0-next.4 → 0.2.0-next.6
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.
- package/README.md +12 -1
- package/codemods/README.md +18 -4
- package/codemods/format.ts +86 -0
- package/codemods/migrate/from-base-elements.ts +8 -2
- package/codemods/migrate/from-volt.ts +8 -2
- package/codemods/radix-to-base-ui.ts +300 -12
- package/dist/_virtual/_zenith-runtime-family_accordion.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_alert-dialog.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_avatar.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_button.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_checkbox.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_csp-provider.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_dialog.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_direction-provider.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_menu.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_merge-props.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_popover.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_radio-group.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_radio.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_scroll-area.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_select.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_separator.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_switch.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_tabs.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_toast.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_toggle-group.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_toggle.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_tooltip.js +1 -1
- package/dist/_virtual/_zenith-runtime-family_use-render.js +1 -1
- package/dist/components/accordion/accordion.js +1 -1
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.js +1 -1
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/appearance-boundary/appearance-boundary.js +1 -1
- package/dist/components/appearance-boundary/appearance-boundary.js.map +1 -1
- package/dist/components/avatar/avatar-group.js +1 -1
- package/dist/components/avatar/avatar-group.js.map +1 -1
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.js +1 -1
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/callout/callout.js +1 -1
- package/dist/components/callout/callout.js.map +1 -1
- package/dist/components/card/card.js +1 -1
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/code-block/code-block.js +1 -1
- package/dist/components/code-block/code-block.js.map +1 -1
- package/dist/components/code-editor/code-editor.js +1 -1
- package/dist/components/code-editor/code-editor.js.map +1 -1
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js +1 -1
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js.map +1 -1
- package/dist/components/command/command.js +1 -1
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/data-table/data-table-body.js +1 -1
- package/dist/components/data-table/data-table-body.js.map +1 -1
- package/dist/components/data-table/data-table-column-header.js +1 -1
- package/dist/components/data-table/data-table-column-header.js.map +1 -1
- package/dist/components/data-table/data-table-column-order.js +1 -1
- package/dist/components/data-table/data-table-column-order.js.map +1 -1
- package/dist/components/data-table/data-table-column-visibility.js +1 -1
- package/dist/components/data-table/data-table-column-visibility.js.map +1 -1
- package/dist/components/data-table/data-table-content.js +1 -1
- package/dist/components/data-table/data-table-content.js.map +1 -1
- package/dist/components/data-table/data-table-error.js +1 -1
- package/dist/components/data-table/data-table-error.js.map +1 -1
- package/dist/components/data-table/data-table-footer.js +1 -1
- package/dist/components/data-table/data-table-footer.js.map +1 -1
- package/dist/components/data-table/data-table-header-draggable.js +1 -1
- package/dist/components/data-table/data-table-header-draggable.js.map +1 -1
- package/dist/components/data-table/data-table-header.js +1 -1
- package/dist/components/data-table/data-table-header.js.map +1 -1
- package/dist/components/data-table/data-table-loading.js +1 -1
- package/dist/components/data-table/data-table-loading.js.map +1 -1
- package/dist/components/data-table/data-table-resize-handle.js +1 -1
- package/dist/components/data-table/data-table-resize-handle.js.map +1 -1
- package/dist/components/data-table/data-table-row.js +1 -1
- package/dist/components/data-table/data-table-row.js.map +1 -1
- package/dist/components/data-table/data-table-toolbar.js +1 -1
- package/dist/components/data-table/data-table-toolbar.js.map +1 -1
- package/dist/components/data-table/data-table.js +1 -1
- package/dist/components/data-table/data-table.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/date-range-picker/range-calendar.js +1 -1
- package/dist/components/date-range-picker/range-calendar.js.map +1 -1
- package/dist/components/date-time-picker/calendar.js +1 -1
- package/dist/components/date-time-picker/calendar.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-input.js +1 -1
- package/dist/components/date-time-picker/date-time-picker-input.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-panel.js +1 -1
- package/dist/components/date-time-picker/date-time-picker-panel.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker.js +1 -1
- package/dist/components/date-time-picker/date-time-picker.js.map +1 -1
- package/dist/components/date-time-picker/time-picker.js +1 -1
- package/dist/components/date-time-picker/time-picker.js.map +1 -1
- package/dist/components/density-provider/density-provider.js +1 -1
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/drawer/drawer.js +1 -1
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/field/field-combobox.js +190 -181
- package/dist/components/field/field-combobox.js.map +1 -1
- package/dist/components/field/field-select.js +37 -22
- package/dist/components/field/field-select.js.map +1 -1
- package/dist/components/field/field.js +1 -1
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/label/label.js +1 -1
- package/dist/components/label/label.js.map +1 -1
- package/dist/components/list/list.js +1 -1
- package/dist/components/list/list.js.map +1 -1
- package/dist/components/option-card/option-card.js +1 -1
- package/dist/components/option-card/option-card.js.map +1 -1
- package/dist/components/pill/pill.js +1 -1
- package/dist/components/pill/pill.js.map +1 -1
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +1 -1
- package/dist/components/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/scroll-area/scrollbar-styles.js +1 -1
- package/dist/components/scroll-area/scrollbar-styles.js.map +1 -1
- package/dist/components/scroll-overflow/scroll-overflow.js +22 -22
- package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +133 -122
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.js +1 -1
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/separator/separator.js +1 -1
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/skeleton/skeleton.js +1 -1
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/slot/compose-as-child.js +1 -1
- package/dist/components/slot/compose-as-child.js.map +1 -1
- package/dist/components/spinner/spinner.js +1 -1
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/surface/surface.js +1 -1
- package/dist/components/surface/surface.js.map +1 -1
- package/dist/components/switch/switch.js +1 -1
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/table-pagination.js +1 -1
- package/dist/components/table/table-pagination.js.map +1 -1
- package/dist/components/table/table.js +1 -1
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/text/text.js +1 -1
- package/dist/components/text/text.js.map +1 -1
- package/dist/components/toast/toast.js +1 -1
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toggle/toggle-group.js +1 -1
- package/dist/components/toggle/toggle-group.js.map +1 -1
- package/dist/components/toggle/toggle.js +29 -26
- package/dist/components/toggle/toggle.js.map +1 -1
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/clear-button.js +1 -1
- package/dist/lib/clear-button.js.map +1 -1
- package/dist/packages/tokens/dist/delivery/index.js +1 -1
- package/dist/packages/tokens/dist/delivery/index.js.map +1 -1
- package/dist/packages/tokens/dist/install.js +1 -1
- package/dist/packages/tokens/dist/install.js.map +1 -1
- package/dist/renderer/served.js +19 -14
- package/dist/renderer/served.js.map +1 -1
- package/dist/styles/host-reset.js.map +1 -1
- package/dist/styles/make-styles.js +1 -1
- package/dist/styles/make-styles.js.map +1 -1
- package/dist/styles/text-box.js.map +1 -1
- package/dist/tokens.json +1 -1
- package/package.json +5 -3
- package/scripts/migration-diagnostics-core.mjs +284 -0
- package/scripts/migration-sweep.mjs +10 -10
- package/testing/setup.cjs +87 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sources":["../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { Tooltip as TooltipPrimitive } from \"@base-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 positioner: {\n zIndex: OVERLAY_Z_INDEX,\n },\n // Radix's `hideWhenDetached`: hide the content once its trigger is scrolled out of view.\n hideWhenDetached: {\n \"&[data-anchor-hidden]\": {\n visibility: \"hidden\",\n pointerEvents: \"none\",\n },\n },\n // No enter or exit motion: the Radix version keyed its keyframes on `data-state='open'`, a value\n // Radix's tooltip never sets (it sets `delayed-open` or `instant-open`), so it never animated.\n popup: {\n ...boxModel,\n width: \"fit-content\",\n transformOrigin: \"var(--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 },\n // Base UI places the arrow on the cross axis only; the anchored edge is set per side here. The\n // diamond's centre sits 2px inside the content's edge, where Radix's arrow wrapper put it.\n arrow: {\n ...boxModel,\n zIndex: 50,\n width: \"0.625rem\",\n height: \"0.625rem\",\n ...shorthands.borderRadius(\"2px\"),\n \"&[data-side='top']\": {\n top: \"100%\",\n transform: \"translateY(calc(-50% - 2px)) rotate(45deg)\",\n },\n \"&[data-side='bottom']\": {\n top: 0,\n transform: \"translateY(calc(-50% + 2px)) rotate(45deg)\",\n },\n \"&[data-side='left']\": {\n left: \"100%\",\n transform: \"translateX(calc(-50% - 2px)) rotate(45deg)\",\n },\n \"&[data-side='right']\": {\n left: 0,\n transform: \"translateX(calc(-50% + 2px)) rotate(45deg)\",\n },\n // Radix hid the arrow when it could not point at the trigger's centre.\n \"&[data-uncentered]\": {\n visibility: \"hidden\",\n },\n \"&[data-variant='default']\": {\n backgroundColor: tokens.gray12,\n },\n \"&[data-variant='destructive']\": {\n backgroundColor: tokens.error12,\n },\n },\n})\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\n/**\n * Radix's `asChild` over Base UI's `render`: the single child element becomes the part and keeps\n * its own children, since Base UI lets the rendered element's props win the merge.\n */\nfunction slotProps(asChild: boolean, children: React.ReactNode) {\n const child = asChild ? onlySlotChild(children) : undefined\n return child ? { render: child } : { children }\n}\n\n/**\n * A part's props as they were under Radix: its native element's own (DOM attributes, React's\n * handler types, a `CSSProperties` style, a string `className`, `ref`) plus `asChild`. Base UI's\n * prop types widen `style` and `className` to functions of the part's state, wrap every handler's\n * event in `BaseUIEvent` and add props of their own; none of that reaches the public surface.\n */\ntype NativePartProps<Tag extends \"button\" | \"div\"> =\n React.ComponentProps<Tag> & {\n /** Renders the single child element as this part, merging its props and behaviour onto it. */\n asChild?: boolean\n }\n\nfunction useMergedRef<T>(a: React.Ref<T> | undefined, b: React.Ref<T>) {\n return React.useCallback(\n (node: T | null) => {\n for (const ref of [a, b]) {\n if (typeof ref === \"function\") ref(node)\n else if (ref) (ref as React.MutableRefObject<T | null>).current = node\n }\n },\n [a, b]\n )\n}\n\n/**\n * What `onOpenChange` receives as its second argument: Base UI's change details, declared in\n * Zenith. Base UI's own type would put its internals in the published declarations, which\n * TypeScript 4 consumers cannot parse. `event` narrows with `reason`, as it does in Base UI.\n */\ntype TooltipOpenChangeDetails = (\n | { reason: \"trigger-hover\"; event: MouseEvent }\n | { reason: \"trigger-focus\"; event: FocusEvent }\n | {\n reason: \"trigger-press\"\n event: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent\n }\n | { reason: \"outside-press\"; event: MouseEvent | PointerEvent | TouchEvent }\n | { reason: \"escape-key\"; event: KeyboardEvent }\n | { reason: \"disabled\"; event: Event }\n | { reason: \"imperative-action\"; event: Event }\n | { reason: \"none\"; event: Event }\n) & {\n /** Keeps the tooltip in its current state. */\n cancel: () => void\n /** Lets the event propagate where the tooltip would otherwise stop it. */\n allowPropagation: () => void\n isCanceled: boolean\n isPropagationAllowed: boolean\n /** The element that caused the change, if any. */\n trigger: Element | undefined\n /** Keeps the tooltip's elements mounted after it closes. */\n preventUnmountOnClose: () => void\n}\n\n/** Base UI's details of the imperative close, reported as the Escape that caused it. */\nfunction escapeDetails(\n details: TooltipOpenChangeDetails,\n event: KeyboardEvent\n): TooltipOpenChangeDetails {\n return {\n reason: \"escape-key\",\n event,\n cancel: () => details.cancel(),\n allowPropagation: () => details.allowPropagation(),\n get isCanceled() {\n return details.isCanceled\n },\n get isPropagationAllowed() {\n return details.isPropagationAllowed\n },\n trigger: details.trigger,\n preventUnmountOnClose: () => details.preventUnmountOnClose(),\n }\n}\n\n// The open tooltips' popups, in the order they opened. Escape goes to the last one, as it went to\n// Radix's topmost layer.\nconst openPopups: HTMLElement[] = []\n\n// Radix's provider-level `disableHoverableContent`, which Base UI only takes per tooltip, and the\n// skip delay a tooltip with its own `delayDuration` carries into its own Base UI provider.\nconst TooltipProviderContext = React.createContext<{\n skipDelayDuration?: number\n disableHoverableContent?: boolean\n}>({})\n\nexport type TooltipProviderProps = {\n children: React.ReactNode\n /** How long the pointer rests on a trigger before its tooltip opens, in ms. Defaults to 0. */\n delayDuration?: number\n /** How soon after one tooltip closes the next one opens without a delay, in ms. Defaults to 300. */\n skipDelayDuration?: number\n /** Closes tooltips as soon as the pointer leaves the trigger, even towards the content. */\n disableHoverableContent?: boolean\n}\n\nexport const TooltipProvider = React.forwardRef<\n HTMLElement,\n TooltipProviderProps\n>(function TooltipProvider(\n {\n children,\n delayDuration = 0,\n skipDelayDuration = 300,\n disableHoverableContent,\n },\n _ref\n) {\n const value = React.useMemo(\n () => ({ skipDelayDuration, disableHoverableContent }),\n [skipDelayDuration, disableHoverableContent]\n )\n\n return (\n <TooltipProviderContext.Provider value={value}>\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delay={delayDuration}\n timeout={skipDelayDuration}\n >\n {children}\n </TooltipPrimitive.Provider>\n </TooltipProviderContext.Provider>\n )\n})\n\n// What the trigger and the content share through the root: the open state, the id of the element\n// that describes the trigger (the content, or its label) for `aria-describedby`, and the close the\n// content's Escape listener calls.\ntype TooltipContextValue = {\n open: boolean\n generatedId: string\n descriptionId: string\n setDescriptionId: (id: string | undefined) => void\n closeOnEscape: (event: KeyboardEvent) => void\n}\n\nconst TooltipContext = React.createContext<TooltipContextValue | null>(null)\n\nexport type TooltipProps = {\n children?: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n /**\n * Called when the tooltip opens or closes. `eventDetails.reason` says why (`trigger-hover`,\n * `trigger-focus`, `trigger-press`, `escape-key`, `outside-press`) and `eventDetails.cancel()`\n * keeps the tooltip in its current state.\n */\n onOpenChange?: (open: boolean, eventDetails: TooltipOpenChangeDetails) => void\n /** This tooltip's hover delay in ms, overriding the provider's. */\n delayDuration?: number\n /** Closes this tooltip as soon as the pointer leaves the trigger, even towards the content. */\n disableHoverableContent?: boolean\n}\n\nexport const Tooltip = React.forwardRef<HTMLElement, TooltipProps>(\n function Tooltip(\n {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n delayDuration,\n disableHoverableContent,\n },\n _ref\n ) {\n const provider = React.useContext(TooltipProviderContext)\n // Base UI is always controlled from here, so the trigger's `aria-describedby` follows the\n // same open state Base UI renders.\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen)\n const open = openProp ?? uncontrolledOpen\n const generatedId = React.useId()\n const [descriptionId, setDescriptionId] = React.useState<string>()\n const actionsRef = React.useRef<TooltipPrimitive.Root.Actions>(null)\n // Set while the content's Escape listener closes the tooltip, so `onOpenChange` reports it.\n const escapeRef = React.useRef<KeyboardEvent | null>(null)\n const closeOnEscape = React.useCallback((event: KeyboardEvent) => {\n escapeRef.current = event\n try {\n actionsRef.current?.close()\n } finally {\n escapeRef.current = null\n }\n }, [])\n\n const context = React.useMemo(\n () => ({\n open,\n generatedId,\n descriptionId: descriptionId ?? generatedId,\n setDescriptionId,\n closeOnEscape,\n }),\n [open, generatedId, descriptionId, closeOnEscape]\n )\n\n const root = (\n <TooltipContext.Provider value={context}>\n <TooltipPrimitive.Root\n data-slot=\"tooltip\"\n open={open}\n actionsRef={actionsRef}\n onOpenChange={(nextOpen, baseDetails) => {\n const escape = escapeRef.current\n const eventDetails = escape\n ? escapeDetails(baseDetails, escape)\n : baseDetails\n // An Escape that arrives prevented was taken already: by this tooltip's own listener,\n // or by a layer above it. Base UI dismisses regardless, so one Escape would close two.\n if (\n !escape &&\n eventDetails.reason === \"escape-key\" &&\n eventDetails.event.defaultPrevented\n ) {\n baseDetails.cancel()\n return\n }\n onOpenChange?.(nextOpen, eventDetails)\n if (!baseDetails.isCanceled) setUncontrolledOpen(nextOpen)\n }}\n disableHoverablePopup={\n disableHoverableContent ?? provider.disableHoverableContent\n }\n >\n {children}\n </TooltipPrimitive.Root>\n </TooltipContext.Provider>\n )\n\n // Base UI ignores a trigger's own delay while its provider's is 0, and Zenith's provider\n // defaults to 0, so a tooltip with its own delay gets a provider of its own. It leaves the\n // surrounding provider's skip-delay group, which Radix kept it in.\n return delayDuration === undefined ? (\n root\n ) : (\n <TooltipPrimitive.Provider\n delay={delayDuration}\n timeout={provider.skipDelayDuration ?? 300}\n >\n {root}\n </TooltipPrimitive.Provider>\n )\n }\n)\n\nfunction useTooltipContext(part: string) {\n const context = React.useContext(TooltipContext)\n if (!context) throw new Error(`\\`${part}\\` must be used within \\`Tooltip\\``)\n return context\n}\n\nexport type TooltipTriggerProps = NativePartProps<\"button\">\n\nexport const TooltipTrigger = React.forwardRef<\n HTMLButtonElement,\n TooltipTriggerProps\n>(function TooltipTrigger(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n const tooltip = useTooltipContext(\"TooltipTrigger\")\n\n return (\n <TooltipPrimitive.Trigger\n ref={ref}\n data-slot=\"tooltip-trigger\"\n {...{ [SLOT_ATTR]: \"tooltip-trigger\" }}\n // Base UI links nothing; Radix described the trigger by the content while it was open.\n aria-describedby={tooltip.open ? tooltip.descriptionId : undefined}\n className={mergeClasses(!asChild && styles.nativeTrigger, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\n// Lets TooltipContent supply Base UI's required Portal itself when no TooltipPortal wraps it, as\n// Radix rendered content without one.\nconst TooltipPortalPresenceContext = React.createContext(false)\n\nexport type TooltipPortalProps = {\n children?: React.ReactNode\n /** The element the content portals into; `document.body` when omitted or null. */\n container?: Element | DocumentFragment | null\n /** Keeps the content mounted while the tooltip is closed. */\n forceMount?: true\n}\n\nexport const TooltipPortal = React.forwardRef<HTMLElement, TooltipPortalProps>(\n function TooltipPortal({ container, forceMount, ...props }, ref) {\n return (\n <TooltipPortalPresenceContext.Provider value={true}>\n <TooltipPrimitive.Portal\n // Base UI types the ref as its portal div, which any HTMLElement ref can hold.\n ref={ref as React.Ref<HTMLDivElement>}\n data-slot=\"tooltip-portal\"\n {...{ [SLOT_ATTR]: \"tooltip-portal\" }}\n // Radix took any Element or DocumentFragment, null meaning the body. Base UI hands a\n // node straight to createPortal, which takes either, but reads null as \"wait for one\".\n container={(container ?? undefined) as HTMLElement | undefined}\n keepMounted={forceMount}\n {...props}\n />\n </TooltipPortalPresenceContext.Provider>\n )\n }\n)\n\ntype Side = \"top\" | \"right\" | \"bottom\" | \"left\"\n\nexport type TooltipContentProps = NativePartProps<\"div\"> & {\n /** The side of the trigger the content opens on. Flips when it would not fit. Defaults to top. */\n side?: Side\n /** Distance from the trigger in px, on top of the arrow's own height. Defaults to 0. */\n sideOffset?: number\n /** Alignment against the trigger. Defaults to center. */\n align?: \"start\" | \"center\" | \"end\"\n /** Offset from the `start` or `end` alignment in px. Defaults to 0. */\n alignOffset?: number\n /** Distance between the arrow and the content's corners in px. Defaults to 0. */\n arrowPadding?: number\n /** Flips and shifts the content to keep it in view. Defaults to true. */\n avoidCollisions?: boolean\n /** Elements the content must stay inside, besides the viewport. */\n collisionBoundary?: Element | null | Array<Element | null>\n /** Distance in px from the boundary edges before the content avoids them. Defaults to 0. */\n collisionPadding?: number | Partial<Record<Side, number>>\n /** `partial` keeps the content attached to its trigger; `always` keeps it in the boundary. */\n sticky?: \"partial\" | \"always\"\n /** Hides the content once its trigger is scrolled out of view. */\n hideWhenDetached?: boolean\n /** Accepted for compatibility; the position follows layout changes either way. */\n updatePositionStrategy?: \"optimized\" | \"always\"\n /**\n * Keeps the content mounted while the tooltip is closed. Inside TooltipPortal, the portal's\n * `forceMount` decides.\n */\n forceMount?: true\n /** Hides the arrow that points at the trigger. */\n hideArrow?: boolean\n variant?: \"default\" | \"destructive\"\n}\n\n// Radix's collision handling: flip to the opposite side or alignment, never to the other axis.\nconst AVOID_COLLISIONS = {\n side: \"flip\",\n align: \"flip\",\n fallbackAxisSide: \"none\",\n} as const\nconst IGNORE_COLLISIONS = {\n side: \"none\",\n align: \"none\",\n fallbackAxisSide: \"none\",\n} as const\n\nexport const TooltipContent = React.forwardRef<\n HTMLDivElement,\n TooltipContentProps\n>(function TooltipContent(\n {\n asChild = false,\n className,\n children,\n hideArrow = false,\n variant = \"default\",\n side = \"top\",\n sideOffset = 0,\n align = \"center\",\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding = 0,\n sticky = \"partial\",\n hideWhenDetached = false,\n updatePositionStrategy: _updatePositionStrategy,\n forceMount,\n id: idProp,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const tooltip = useTooltipContext(\"TooltipContent\")\n const hasPortal = React.useContext(TooltipPortalPresenceContext)\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 const arrowRef = React.useRef<HTMLDivElement>(null)\n const [popup, setPopup] = React.useState<HTMLDivElement | null>(null)\n const popupRef = useMergedRef(ref, setPopup)\n\n // Radix's tooltip was the topmost layer while open, so Escape closed it before anything under it:\n // a Dialog or a Radix menu it sits in, or a control. Base UI's listens later, after a Dialog has\n // taken the key. Taking it on the window in the capture phase, before Radix's layers and Zenith's\n // Base UI roots see it, and preventing it makes them leave it alone.\n const { open, closeOnEscape } = tooltip\n React.useEffect(() => {\n if (!open || !popup) return\n const element = popup\n openPopups.push(element)\n const view = element.ownerDocument.defaultView ?? window\n function onKeyDown(event: KeyboardEvent) {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing)\n return\n if (openPopups[openPopups.length - 1] !== element) return\n // Only an Escape from under the tooltip, earlier in the document. From inside it (a layer\n // nested in the content, or the content itself) Base UI's own handler runs first; from later\n // in the document, a layer opened over the tooltip takes its own.\n const target = event.target\n if (\n !(target instanceof Node) ||\n element.contains(target) ||\n !(\n element.compareDocumentPosition(target) &\n Node.DOCUMENT_POSITION_PRECEDING\n )\n )\n return\n event.preventDefault()\n closeOnEscape(event)\n }\n view.addEventListener(\"keydown\", onKeyDown, true)\n return () => {\n view.removeEventListener(\"keydown\", onKeyDown, true)\n openPopups.splice(openPopups.indexOf(element), 1)\n }\n }, [open, popup, closeOnEscape])\n\n // The trigger's `aria-describedby` points here, so a caller's own id has to reach it. Radix\n // described the trigger by `aria-label` when one was given; a hidden node carries it, because\n // not every accessibility engine reads the `aria-label` of a describing element.\n const popupId = idProp ?? tooltip.generatedId\n const ariaLabel = props[\"aria-label\"]\n const labelId = `${popupId}-label`\n const descriptionId = ariaLabel ? labelId : popupId\n const { setDescriptionId } = tooltip\n React.useEffect(() => {\n setDescriptionId(descriptionId)\n return () => setDescriptionId(undefined)\n }, [descriptionId, setDescriptionId])\n\n const label = ariaLabel && (\n <span id={labelId} hidden>\n {ariaLabel}\n </span>\n )\n\n const arrow = !hideArrow && (\n <TooltipPrimitive.Arrow\n ref={arrowRef}\n data-slot=\"tooltip-arrow\"\n {...{ [SLOT_ATTR]: \"tooltip-arrow\" }}\n data-variant={variant}\n className={styles.arrow}\n />\n )\n const child = asChild ? onlySlotChild(children) : undefined\n // The child keeps its own children, so the label and the arrow join them there.\n const content = child\n ? {\n render: React.cloneElement(\n child,\n undefined,\n (child.props as { children?: React.ReactNode }).children,\n label,\n arrow\n ),\n }\n : {\n children: (\n <>\n {children}\n {label}\n {arrow}\n </>\n ),\n }\n\n const positioner = (\n <TooltipPrimitive.Positioner\n className={mergeClasses(\n styles.positioner,\n hideWhenDetached && styles.hideWhenDetached\n )}\n positionMethod=\"fixed\"\n side={side}\n // Radix moved the content away by the arrow's own height on top of `sideOffset`.\n sideOffset={() => sideOffset + (arrowRef.current?.offsetHeight ?? 0)}\n align={align}\n // Radix applied the offset to `start` and `end` only; Base UI also shifts centred content.\n alignOffset={align === \"center\" ? 0 : alignOffset}\n arrowPadding={arrowPadding}\n // Radix's default is the viewport alone, not every clipping ancestor.\n collisionBoundary={\n Array.isArray(collisionBoundary)\n ? collisionBoundary.filter((boundary) => boundary !== null)\n : collisionBoundary === null\n ? []\n : collisionBoundary\n }\n collisionPadding={collisionPadding}\n sticky={sticky === \"always\"}\n collisionAvoidance={\n avoidCollisions ? AVOID_COLLISIONS : IGNORE_COLLISIONS\n }\n >\n <TooltipPrimitive.Popup\n ref={popupRef}\n id={popupId}\n // Base UI renders no role; Radix exposed the content as role=\"tooltip\".\n role=\"tooltip\"\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 {...content}\n />\n </TooltipPrimitive.Positioner>\n )\n\n // Base UI's Positioner requires a Portal ancestor; Radix rendered inline without one.\n return hasPortal ? (\n positioner\n ) : (\n <TooltipPrimitive.Portal keepMounted={forceMount}>\n {positioner}\n </TooltipPrimitive.Portal>\n )\n})\n"],"names":["useStyles","makeZenithStyles","nativeControl","OVERLAY_Z_INDEX","boxModel","shorthands","tokens.radiusLg","tokens.spacingElement2","tokens.textXs","tokens.gray12","tokens.gray1","tokens.errorA12","tokens.error1","tokens.error12","onlySlotChild","children","elements","React","slotProps","asChild","child","useMergedRef","a","b","node","ref","escapeDetails","details","event","openPopups","TooltipProviderContext","TooltipProvider","delayDuration","skipDelayDuration","disableHoverableContent","_ref","value","jsx","TooltipPrimitive","TooltipContext","Tooltip","openProp","defaultOpen","onOpenChange","provider","uncontrolledOpen","setUncontrolledOpen","open","generatedId","descriptionId","setDescriptionId","actionsRef","escapeRef","closeOnEscape","_a","context","root","nextOpen","baseDetails","escape","eventDetails","useTooltipContext","part","TooltipTrigger","className","props","styles","tooltip","SLOT_ATTR","mergeClasses","TooltipPortalPresenceContext","TooltipPortal","container","forceMount","AVOID_COLLISIONS","IGNORE_COLLISIONS","TooltipContent","hideArrow","variant","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","_updatePositionStrategy","idProp","hasPortal","override","useDensity","appearance","useAppearanceAttributes","arrowRef","popup","setPopup","popupRef","element","view","onKeyDown","target","popupId","ariaLabel","labelId","label","arrow","content","jsxs","Fragment","positio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AQC,MAAW;AAAA,MACnB,oBACEH,IAAkBV,KAAmBC;AAAA,MAGvC,UAAA,gBAAAtC;AAAA,QAACC,EAAiB;AAAA,QAAjB;AAAA,UACC,KAAK6D;AAAA,UACL,IAAIK;AAAA,UAEJ,MAAK;AAAA,UACL,aAAU;AAAA,UACJ,CAACpC,CAAS,GAAG;AAAA,UAClB,GAAIwB,MAAa,SAAY,EAAE,gBAAgBA,EAAA,IAAa,CAAA;AAAA,UAC5D,GAAGE;AAAA,UACJ,gBAAchB;AAAA,UACd,WAAWT,EAAaH,EAAO,OAAOF,CAAS;AAAA,UAC9C,GAAGC;AAAA,UACH,GAAG4C;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAKJ,SAAOlB,IACLqB,IAEA,gBAAA3E,EAACC,EAAiB,QAAjB,EAAwB,aAAamC,GACnC,UAAAuC,GACH;AAEJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"tooltip.js","sources":["../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1/core\"\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 positioner: {\n zIndex: OVERLAY_Z_INDEX,\n },\n // Radix's `hideWhenDetached`: hide the content once its trigger is scrolled out of view.\n hideWhenDetached: {\n \"&[data-anchor-hidden]\": {\n visibility: \"hidden\",\n pointerEvents: \"none\",\n },\n },\n // No enter or exit motion: the Radix version keyed its keyframes on `data-state='open'`, a value\n // Radix's tooltip never sets (it sets `delayed-open` or `instant-open`), so it never animated.\n popup: {\n ...boxModel,\n width: \"fit-content\",\n transformOrigin: \"var(--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 },\n // Base UI places the arrow on the cross axis only; the anchored edge is set per side here. The\n // diamond's centre sits 2px inside the content's edge, where Radix's arrow wrapper put it.\n arrow: {\n ...boxModel,\n zIndex: 50,\n width: \"0.625rem\",\n height: \"0.625rem\",\n ...shorthands.borderRadius(\"2px\"),\n \"&[data-side='top']\": {\n top: \"100%\",\n transform: \"translateY(calc(-50% - 2px)) rotate(45deg)\",\n },\n \"&[data-side='bottom']\": {\n top: 0,\n transform: \"translateY(calc(-50% + 2px)) rotate(45deg)\",\n },\n \"&[data-side='left']\": {\n left: \"100%\",\n transform: \"translateX(calc(-50% - 2px)) rotate(45deg)\",\n },\n \"&[data-side='right']\": {\n left: 0,\n transform: \"translateX(calc(-50% + 2px)) rotate(45deg)\",\n },\n // Radix hid the arrow when it could not point at the trigger's centre.\n \"&[data-uncentered]\": {\n visibility: \"hidden\",\n },\n \"&[data-variant='default']\": {\n backgroundColor: tokens.gray12,\n },\n \"&[data-variant='destructive']\": {\n backgroundColor: tokens.error12,\n },\n },\n})\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\n/**\n * Radix's `asChild` over Base UI's `render`: the single child element becomes the part and keeps\n * its own children, since Base UI lets the rendered element's props win the merge.\n */\nfunction slotProps(asChild: boolean, children: React.ReactNode) {\n const child = asChild ? onlySlotChild(children) : undefined\n return child ? { render: child } : { children }\n}\n\n/**\n * A part's props as they were under Radix: its native element's own (DOM attributes, React's\n * handler types, a `CSSProperties` style, a string `className`, `ref`) plus `asChild`. Base UI's\n * prop types widen `style` and `className` to functions of the part's state, wrap every handler's\n * event in `BaseUIEvent` and add props of their own; none of that reaches the public surface.\n */\ntype NativePartProps<Tag extends \"button\" | \"div\"> =\n React.ComponentProps<Tag> & {\n /** Renders the single child element as this part, merging its props and behaviour onto it. */\n asChild?: boolean\n }\n\nfunction useMergedRef<T>(a: React.Ref<T> | undefined, b: React.Ref<T>) {\n return React.useCallback(\n (node: T | null) => {\n for (const ref of [a, b]) {\n if (typeof ref === \"function\") ref(node)\n else if (ref) (ref as React.MutableRefObject<T | null>).current = node\n }\n },\n [a, b]\n )\n}\n\n/**\n * What `onOpenChange` receives as its second argument: Base UI's change details, declared in\n * Zenith. Base UI's own type would put its internals in the published declarations, which\n * TypeScript 4 consumers cannot parse. `event` narrows with `reason`, as it does in Base UI.\n */\ntype TooltipOpenChangeDetails = (\n | { reason: \"trigger-hover\"; event: MouseEvent }\n | { reason: \"trigger-focus\"; event: FocusEvent }\n | {\n reason: \"trigger-press\"\n event: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent\n }\n | { reason: \"outside-press\"; event: MouseEvent | PointerEvent | TouchEvent }\n | { reason: \"escape-key\"; event: KeyboardEvent }\n | { reason: \"disabled\"; event: Event }\n | { reason: \"imperative-action\"; event: Event }\n | { reason: \"none\"; event: Event }\n) & {\n /** Keeps the tooltip in its current state. */\n cancel: () => void\n /** Lets the event propagate where the tooltip would otherwise stop it. */\n allowPropagation: () => void\n isCanceled: boolean\n isPropagationAllowed: boolean\n /** The element that caused the change, if any. */\n trigger: Element | undefined\n /** Keeps the tooltip's elements mounted after it closes. */\n preventUnmountOnClose: () => void\n}\n\n/** Base UI's details of the imperative close, reported as the Escape that caused it. */\nfunction escapeDetails(\n details: TooltipOpenChangeDetails,\n event: KeyboardEvent\n): TooltipOpenChangeDetails {\n return {\n reason: \"escape-key\",\n event,\n cancel: () => details.cancel(),\n allowPropagation: () => details.allowPropagation(),\n get isCanceled() {\n return details.isCanceled\n },\n get isPropagationAllowed() {\n return details.isPropagationAllowed\n },\n trigger: details.trigger,\n preventUnmountOnClose: () => details.preventUnmountOnClose(),\n }\n}\n\n// The open tooltips' popups, in the order they opened. Escape goes to the last one, as it went to\n// Radix's topmost layer.\nconst openPopups: HTMLElement[] = []\n\n// Radix's provider-level `disableHoverableContent`, which Base UI only takes per tooltip, and the\n// skip delay a tooltip with its own `delayDuration` carries into its own Base UI provider.\nconst TooltipProviderContext = React.createContext<{\n skipDelayDuration?: number\n disableHoverableContent?: boolean\n}>({})\n\nexport type TooltipProviderProps = {\n children: React.ReactNode\n /** How long the pointer rests on a trigger before its tooltip opens, in ms. Defaults to 0. */\n delayDuration?: number\n /** How soon after one tooltip closes the next one opens without a delay, in ms. Defaults to 300. */\n skipDelayDuration?: number\n /** Closes tooltips as soon as the pointer leaves the trigger, even towards the content. */\n disableHoverableContent?: boolean\n}\n\nexport const TooltipProvider = React.forwardRef<\n HTMLElement,\n TooltipProviderProps\n>(function TooltipProvider(\n {\n children,\n delayDuration = 0,\n skipDelayDuration = 300,\n disableHoverableContent,\n },\n _ref\n) {\n const value = React.useMemo(\n () => ({ skipDelayDuration, disableHoverableContent }),\n [skipDelayDuration, disableHoverableContent]\n )\n\n return (\n <TooltipProviderContext.Provider value={value}>\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delay={delayDuration}\n timeout={skipDelayDuration}\n >\n {children}\n </TooltipPrimitive.Provider>\n </TooltipProviderContext.Provider>\n )\n})\n\n// What the trigger and the content share through the root: the open state, the id of the element\n// that describes the trigger (the content, or its label) for `aria-describedby`, and the close the\n// content's Escape listener calls.\ntype TooltipContextValue = {\n open: boolean\n generatedId: string\n descriptionId: string\n setDescriptionId: (id: string | undefined) => void\n closeOnEscape: (event: KeyboardEvent) => void\n}\n\nconst TooltipContext = React.createContext<TooltipContextValue | null>(null)\n\nexport type TooltipProps = {\n children?: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n /**\n * Called when the tooltip opens or closes. `eventDetails.reason` says why (`trigger-hover`,\n * `trigger-focus`, `trigger-press`, `escape-key`, `outside-press`) and `eventDetails.cancel()`\n * keeps the tooltip in its current state.\n */\n onOpenChange?: (open: boolean, eventDetails: TooltipOpenChangeDetails) => void\n /** This tooltip's hover delay in ms, overriding the provider's. */\n delayDuration?: number\n /** Closes this tooltip as soon as the pointer leaves the trigger, even towards the content. */\n disableHoverableContent?: boolean\n}\n\nexport const Tooltip = React.forwardRef<HTMLElement, TooltipProps>(\n function Tooltip(\n {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n delayDuration,\n disableHoverableContent,\n },\n _ref\n ) {\n const provider = React.useContext(TooltipProviderContext)\n // Base UI is always controlled from here, so the trigger's `aria-describedby` follows the\n // same open state Base UI renders.\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen)\n const open = openProp ?? uncontrolledOpen\n const generatedId = React.useId()\n const [descriptionId, setDescriptionId] = React.useState<string>()\n const actionsRef = React.useRef<TooltipPrimitive.Root.Actions>(null)\n // Set while the content's Escape listener closes the tooltip, so `onOpenChange` reports it.\n const escapeRef = React.useRef<KeyboardEvent | null>(null)\n const closeOnEscape = React.useCallback((event: KeyboardEvent) => {\n escapeRef.current = event\n try {\n actionsRef.current?.close()\n } finally {\n escapeRef.current = null\n }\n }, [])\n\n const context = React.useMemo(\n () => ({\n open,\n generatedId,\n descriptionId: descriptionId ?? generatedId,\n setDescriptionId,\n closeOnEscape,\n }),\n [open, generatedId, descriptionId, closeOnEscape]\n )\n\n const root = (\n <TooltipContext.Provider value={context}>\n <TooltipPrimitive.Root\n data-slot=\"tooltip\"\n open={open}\n actionsRef={actionsRef}\n onOpenChange={(nextOpen, baseDetails) => {\n const escape = escapeRef.current\n const eventDetails = escape\n ? escapeDetails(baseDetails, escape)\n : baseDetails\n // An Escape that arrives prevented was taken already: by this tooltip's own listener,\n // or by a layer above it. Base UI dismisses regardless, so one Escape would close two.\n if (\n !escape &&\n eventDetails.reason === \"escape-key\" &&\n eventDetails.event.defaultPrevented\n ) {\n baseDetails.cancel()\n return\n }\n onOpenChange?.(nextOpen, eventDetails)\n if (!baseDetails.isCanceled) setUncontrolledOpen(nextOpen)\n }}\n disableHoverablePopup={\n disableHoverableContent ?? provider.disableHoverableContent\n }\n >\n {children}\n </TooltipPrimitive.Root>\n </TooltipContext.Provider>\n )\n\n // Base UI ignores a trigger's own delay while its provider's is 0, and Zenith's provider\n // defaults to 0, so a tooltip with its own delay gets a provider of its own. It leaves the\n // surrounding provider's skip-delay group, which Radix kept it in.\n return delayDuration === undefined ? (\n root\n ) : (\n <TooltipPrimitive.Provider\n delay={delayDuration}\n timeout={provider.skipDelayDuration ?? 300}\n >\n {root}\n </TooltipPrimitive.Provider>\n )\n }\n)\n\nfunction useTooltipContext(part: string) {\n const context = React.useContext(TooltipContext)\n if (!context) throw new Error(`\\`${part}\\` must be used within \\`Tooltip\\``)\n return context\n}\n\nexport type TooltipTriggerProps = NativePartProps<\"button\">\n\nexport const TooltipTrigger = React.forwardRef<\n HTMLButtonElement,\n TooltipTriggerProps\n>(function TooltipTrigger(\n { asChild = false, children, className, ...props },\n ref\n) {\n const styles = useStyles()\n const tooltip = useTooltipContext(\"TooltipTrigger\")\n\n return (\n <TooltipPrimitive.Trigger\n ref={ref}\n data-slot=\"tooltip-trigger\"\n {...{ [SLOT_ATTR]: \"tooltip-trigger\" }}\n // Base UI links nothing; Radix described the trigger by the content while it was open.\n aria-describedby={tooltip.open ? tooltip.descriptionId : undefined}\n className={mergeClasses(!asChild && styles.nativeTrigger, className)}\n {...props}\n {...slotProps(asChild, children)}\n />\n )\n})\n\n// Lets TooltipContent supply Base UI's required Portal itself when no TooltipPortal wraps it, as\n// Radix rendered content without one.\nconst TooltipPortalPresenceContext = React.createContext(false)\n\nexport type TooltipPortalProps = {\n children?: React.ReactNode\n /** The element the content portals into; `document.body` when omitted or null. */\n container?: Element | DocumentFragment | null\n /** Keeps the content mounted while the tooltip is closed. */\n forceMount?: true\n}\n\nexport const TooltipPortal = React.forwardRef<HTMLElement, TooltipPortalProps>(\n function TooltipPortal({ container, forceMount, ...props }, ref) {\n return (\n <TooltipPortalPresenceContext.Provider value={true}>\n <TooltipPrimitive.Portal\n // Base UI types the ref as its portal div, which any HTMLElement ref can hold.\n ref={ref as React.Ref<HTMLDivElement>}\n data-slot=\"tooltip-portal\"\n {...{ [SLOT_ATTR]: \"tooltip-portal\" }}\n // Radix took any Element or DocumentFragment, null meaning the body. Base UI hands a\n // node straight to createPortal, which takes either, but reads null as \"wait for one\".\n container={(container ?? undefined) as HTMLElement | undefined}\n keepMounted={forceMount}\n {...props}\n />\n </TooltipPortalPresenceContext.Provider>\n )\n }\n)\n\ntype Side = \"top\" | \"right\" | \"bottom\" | \"left\"\n\nexport type TooltipContentProps = NativePartProps<\"div\"> & {\n /** The side of the trigger the content opens on. Flips when it would not fit. Defaults to top. */\n side?: Side\n /** Distance from the trigger in px, on top of the arrow's own height. Defaults to 0. */\n sideOffset?: number\n /** Alignment against the trigger. Defaults to center. */\n align?: \"start\" | \"center\" | \"end\"\n /** Offset from the `start` or `end` alignment in px. Defaults to 0. */\n alignOffset?: number\n /** Distance between the arrow and the content's corners in px. Defaults to 0. */\n arrowPadding?: number\n /** Flips and shifts the content to keep it in view. Defaults to true. */\n avoidCollisions?: boolean\n /** Elements the content must stay inside, besides the viewport. */\n collisionBoundary?: Element | null | Array<Element | null>\n /** Distance in px from the boundary edges before the content avoids them. Defaults to 0. */\n collisionPadding?: number | Partial<Record<Side, number>>\n /** `partial` keeps the content attached to its trigger; `always` keeps it in the boundary. */\n sticky?: \"partial\" | \"always\"\n /** Hides the content once its trigger is scrolled out of view. */\n hideWhenDetached?: boolean\n /** Accepted for compatibility; the position follows layout changes either way. */\n updatePositionStrategy?: \"optimized\" | \"always\"\n /**\n * Keeps the content mounted while the tooltip is closed. Inside TooltipPortal, the portal's\n * `forceMount` decides.\n */\n forceMount?: true\n /** Hides the arrow that points at the trigger. */\n hideArrow?: boolean\n variant?: \"default\" | \"destructive\"\n}\n\n// Radix's collision handling: flip to the opposite side or alignment, never to the other axis.\nconst AVOID_COLLISIONS = {\n side: \"flip\",\n align: \"flip\",\n fallbackAxisSide: \"none\",\n} as const\nconst IGNORE_COLLISIONS = {\n side: \"none\",\n align: \"none\",\n fallbackAxisSide: \"none\",\n} as const\n\nexport const TooltipContent = React.forwardRef<\n HTMLDivElement,\n TooltipContentProps\n>(function TooltipContent(\n {\n asChild = false,\n className,\n children,\n hideArrow = false,\n variant = \"default\",\n side = \"top\",\n sideOffset = 0,\n align = \"center\",\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding = 0,\n sticky = \"partial\",\n hideWhenDetached = false,\n updatePositionStrategy: _updatePositionStrategy,\n forceMount,\n id: idProp,\n ...props\n },\n ref\n) {\n const styles = useStyles()\n const tooltip = useTooltipContext(\"TooltipContent\")\n const hasPortal = React.useContext(TooltipPortalPresenceContext)\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 const arrowRef = React.useRef<HTMLDivElement>(null)\n const [popup, setPopup] = React.useState<HTMLDivElement | null>(null)\n const popupRef = useMergedRef(ref, setPopup)\n\n // Radix's tooltip was the topmost layer while open, so Escape closed it before anything under it:\n // a Dialog or a Radix menu it sits in, or a control. Base UI's listens later, after a Dialog has\n // taken the key. Taking it on the window in the capture phase, before Radix's layers and Zenith's\n // Base UI roots see it, and preventing it makes them leave it alone.\n const { open, closeOnEscape } = tooltip\n React.useEffect(() => {\n if (!open || !popup) return\n const element = popup\n openPopups.push(element)\n const view = element.ownerDocument.defaultView ?? window\n function onKeyDown(event: KeyboardEvent) {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing)\n return\n if (openPopups[openPopups.length - 1] !== element) return\n // Only an Escape from under the tooltip, earlier in the document. From inside it (a layer\n // nested in the content, or the content itself) Base UI's own handler runs first; from later\n // in the document, a layer opened over the tooltip takes its own.\n const target = event.target\n if (\n !(target instanceof Node) ||\n element.contains(target) ||\n !(\n element.compareDocumentPosition(target) &\n Node.DOCUMENT_POSITION_PRECEDING\n )\n )\n return\n event.preventDefault()\n closeOnEscape(event)\n }\n view.addEventListener(\"keydown\", onKeyDown, true)\n return () => {\n view.removeEventListener(\"keydown\", onKeyDown, true)\n openPopups.splice(openPopups.indexOf(element), 1)\n }\n }, [open, popup, closeOnEscape])\n\n // The trigger's `aria-describedby` points here, so a caller's own id has to reach it. Radix\n // described the trigger by `aria-label` when one was given; a hidden node carries it, because\n // not every accessibility engine reads the `aria-label` of a describing element.\n const popupId = idProp ?? tooltip.generatedId\n const ariaLabel = props[\"aria-label\"]\n const labelId = `${popupId}-label`\n const descriptionId = ariaLabel ? labelId : popupId\n const { setDescriptionId } = tooltip\n React.useEffect(() => {\n setDescriptionId(descriptionId)\n return () => setDescriptionId(undefined)\n }, [descriptionId, setDescriptionId])\n\n const label = ariaLabel && (\n <span id={labelId} hidden>\n {ariaLabel}\n </span>\n )\n\n const arrow = !hideArrow && (\n <TooltipPrimitive.Arrow\n ref={arrowRef}\n data-slot=\"tooltip-arrow\"\n {...{ [SLOT_ATTR]: \"tooltip-arrow\" }}\n data-variant={variant}\n className={styles.arrow}\n />\n )\n const child = asChild ? onlySlotChild(children) : undefined\n // The child keeps its own children, so the label and the arrow join them there.\n const content = child\n ? {\n render: React.cloneElement(\n child,\n undefined,\n (child.props as { children?: React.ReactNode }).children,\n label,\n arrow\n ),\n }\n : {\n children: (\n <>\n {children}\n {label}\n {arrow}\n </>\n ),\n }\n\n const positioner = (\n <TooltipPrimitive.Positioner\n className={mergeClasses(\n styles.positioner,\n hideWhenDetached && styles.hideWhenDetached\n )}\n positionMethod=\"fixed\"\n side={side}\n // Radix moved the content away by the arrow's own height on top of `sideOffset`.\n sideOffset={() => sideOffset + (arrowRef.current?.offsetHeight ?? 0)}\n align={align}\n // Radix applied the offset to `start` and `end` only; Base UI also shifts centred content.\n alignOffset={align === \"center\" ? 0 : alignOffset}\n arrowPadding={arrowPadding}\n // Radix's default is the viewport alone, not every clipping ancestor.\n collisionBoundary={\n Array.isArray(collisionBoundary)\n ? collisionBoundary.filter((boundary) => boundary !== null)\n : collisionBoundary === null\n ? []\n : collisionBoundary\n }\n collisionPadding={collisionPadding}\n sticky={sticky === \"always\"}\n collisionAvoidance={\n avoidCollisions ? AVOID_COLLISIONS : IGNORE_COLLISIONS\n }\n >\n <TooltipPrimitive.Popup\n ref={popupRef}\n id={popupId}\n // Base UI renders no role; Radix exposed the content as role=\"tooltip\".\n role=\"tooltip\"\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 {...content}\n />\n </TooltipPrimitive.Positioner>\n )\n\n // Base UI's Positioner requires a Portal ancestor; Radix rendered inline without one.\n return hasPortal ? (\n positioner\n ) : (\n <TooltipPrimitive.Portal keepMounted={forceMount}>\n {positioner}\n </TooltipPrimitive.Portal>\n )\n})\n"],"names":["useStyles","makeZenithStyles","nativeControl","OVERLAY_Z_INDEX","boxModel","shorthands","tokens.radiusLg","tokens.spacingElement2","tokens.textXs","tokens.gray12","tokens.gray1","tokens.errorA12","tokens.error1","tokens.error12","onlySlotChild","children","elements","React","slotProps","asChild","child","useMergedRef","a","b","node","ref","escapeDetails","details","event","openPopups","TooltipProviderContext","TooltipProvider","delayDuration","skipDelayDuration","disableHoverableContent","_ref","value","jsx","TooltipPrimitive","TooltipContext","Tooltip","openProp","defaultOpen","onOpenChange","provider","uncontrolledOpen","setUncontrolledOpen","open","generatedId","descriptionId","setDescriptionId","actionsRef","escapeRef","closeOnEscape","_a","context","root","nextOpen","baseDetails","escape","eventDetails","useTooltipContext","part","TooltipTrigger","className","props","styles","tooltip","SLOT_ATTR","mergeClasses","TooltipPortalPresenceContext","TooltipPortal","container","forceMount","AVOID_COLLISIONS","IGNORE_COLLISIONS","TooltipContent","hideArrow","variant","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","_updatePositionStrategy","idProp","hasPortal","override","useDensity","appearance","useAppearanceAttributes","arrowRef","popup","setPopup","popupRef","element","view","onKeyDown","target","popupId","ariaLabel","labelId","label","arrow","content","jsxs","Fragment","positioner","boundary"],"mappings":";;;;;;;;;;AAaA,MAAMA,IAAYC,GAAiB;AAAA;AAAA;AAAA,EAGjC,eAAe;AAAA,IACb,GAAGC;AAAA,EAAA;AAAA,EAEL,YAAY;AAAA,IACV,QAAQC;AAAA,EAAA;AAAA;AAAA,EAGV,kBAAkB;AAAA,IAChB,yBAAyB;AAAA,MACvB,YAAY;AAAA,MACZ,eAAe;AAAA,IAAA;AAAA,EACjB;AAAA;AAAA;AAAA,EAIF,OAAO;AAAA,IACL,GAAGC;AAAA,IACH,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,GAAGC,EAAW,aAAaC,EAAe;AAAA,IAC1C,GAAGD,EAAW,QAAQE,EAAsB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,IACN;AAAA,EAAA;AAKJ,SAAOlB,IACLqB,IAEA,gBAAA3E,EAACC,EAAiB,QAAjB,EAAwB,aAAamC,GACnC,UAAAuC,GACH;AAEJ,CAAC;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5152,7 +5152,7 @@ type ScrollOverflowProps = Omit<React.ComponentProps<"div">, "dir"> & UseScrollO
|
|
|
5152
5152
|
gradients?: boolean;
|
|
5153
5153
|
/** Gradient width in pixels. Default: 40 */
|
|
5154
5154
|
gradientWidth?: number;
|
|
5155
|
-
/** Gradient base color (CSS value). Should match the parent background. Default:
|
|
5155
|
+
/** Gradient base color (CSS value). Should match the parent background. Default: the Zenith body token. */
|
|
5156
5156
|
gradientColor?: string;
|
|
5157
5157
|
/** Show inset shadow on overflow edges. Default: true */
|
|
5158
5158
|
shadow?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as o from "./tokens/index.js";
|
|
2
2
|
import { makeZenithResetStyles as t, makeZenithStyles as a } from "./styles/make-styles.js";
|
|
3
|
-
import { SLOT_ATTR as i, assertAnchorIsFirstInHead as n, mergeClasses as p, shorthands as m } from "@epilot/zenith-runtime/v1";
|
|
3
|
+
import { SLOT_ATTR as i, assertAnchorIsFirstInHead as n, mergeClasses as p, shorthands as m } from "@epilot/zenith-runtime/v1/core.js";
|
|
4
4
|
import { BADGE_COLORS as x, Badge as d } from "./components/badge/badge.js";
|
|
5
5
|
import { Breadcrumb as s, BreadcrumbItem as u } from "./components/breadcrumb/breadcrumb.js";
|
|
6
6
|
import { Callout as D, CalloutAction as g, CalloutDescription as T, CalloutTitle as c } from "./components/callout/callout.js";
|
package/dist/lib/clear-button.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import { mergeClasses as c, SLOT_ATTR as m } from "@epilot/zenith-runtime/v1";
|
|
3
|
+
import { mergeClasses as c, SLOT_ATTR as m } from "@epilot/zenith-runtime/v1/core.js";
|
|
4
4
|
import { nativeControlReset as u } from "../styles/host-reset.js";
|
|
5
5
|
import { makeZenithResetStyles as f, makeZenithStyles as p } from "../styles/make-styles.js";
|
|
6
6
|
import { accentA8 as d } from "../tokens/index.js";
|
|
@@ -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 { 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;"}
|
|
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/core\"\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;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TOKENS_ATTR as t, ensureSheet as n } from "@epilot/zenith-runtime/v1";
|
|
1
|
+
import { TOKENS_ATTR as t, ensureSheet as n } from "@epilot/zenith-runtime/v1/core.js";
|
|
2
2
|
import { SHEET_HASH as o, NS as s, CSS as c } from "../generated/core.generated.js";
|
|
3
3
|
const a = Object.freeze({
|
|
4
4
|
namespace: s,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../tokens/dist/delivery/index.js"],"sourcesContent":["import { TOKENS_ATTR as t, ensureSheet as n } from \"@epilot/zenith-runtime/v1\";\nimport { SHEET_HASH as o, NS as s, CSS as c } from \"../generated/core.generated.js\";\nconst m = Object.freeze({\n namespace: s,\n sheetHash: o\n}), f = t;\nfunction T(r) {\n const e = r ?? (typeof document < \"u\" ? document : void 0);\n return e ? n(e, o, c) : !1;\n}\nfunction i(r = {}) {\n try {\n return T(r.document), Promise.resolve();\n } catch (e) {\n return Promise.reject(e);\n }\n}\nexport {\n m as CORE_TOKEN_ASSET,\n f as TOKENS_ATTR,\n T as ensureCoreTokens,\n i as prepareCoreTokens\n};\n//# sourceMappingURL=index.js.map\n"],"names":["m","s","o","f","t","n","c","i"],"mappings":";;AAEK,MAACA,IAAI,OAAO,OAAO;AAAA,EACtB,WAAWC;AAAAA,EACX,WAAWC;AACb,CAAC,GAAGC,IAAIC;AACR,SAAS,EAAE,GAAG;AACZ,QAAM,IAAI,MAAM,OAAO,WAAW,MAAM,WAAW;AACnD,SAAO,IAAIC,EAAE,GAAGH,GAAGI,CAAC,IAAI;AAC1B;AACA,SAASC,EAAE,IAAI,IAAI;AACjB,MAAI;AACF,WAAO,EAAE,EAAE,QAAQ,GAAG,QAAQ,QAAO;AAAA,EACvC,SAAS,GAAG;AACV,WAAO,QAAQ,OAAO,CAAC;AAAA,EACzB;AACF;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../tokens/dist/delivery/index.js"],"sourcesContent":["import { TOKENS_ATTR as t, ensureSheet as n } from \"@epilot/zenith-runtime/v1/core.js\";\nimport { SHEET_HASH as o, NS as s, CSS as c } from \"../generated/core.generated.js\";\nconst m = Object.freeze({\n namespace: s,\n sheetHash: o\n}), f = t;\nfunction T(r) {\n const e = r ?? (typeof document < \"u\" ? document : void 0);\n return e ? n(e, o, c) : !1;\n}\nfunction i(r = {}) {\n try {\n return T(r.document), Promise.resolve();\n } catch (e) {\n return Promise.reject(e);\n }\n}\nexport {\n m as CORE_TOKEN_ASSET,\n f as TOKENS_ATTR,\n T as ensureCoreTokens,\n i as prepareCoreTokens\n};\n//# sourceMappingURL=index.js.map\n"],"names":["m","s","o","f","t","n","c","i"],"mappings":";;AAEK,MAACA,IAAI,OAAO,OAAO;AAAA,EACtB,WAAWC;AAAAA,EACX,WAAWC;AACb,CAAC,GAAGC,IAAIC;AACR,SAAS,EAAE,GAAG;AACZ,QAAM,IAAI,MAAM,OAAO,WAAW,MAAM,WAAW;AACnD,SAAO,IAAIC,EAAE,GAAGH,GAAGI,CAAC,IAAI;AAC1B;AACA,SAASC,EAAE,IAAI,IAAI;AACjB,MAAI;AACF,WAAO,EAAE,EAAE,QAAQ,GAAG,QAAQ,QAAO;AAAA,EACvC,SAAS,GAAG;AACV,WAAO,QAAQ,OAAO,CAAC;AAAA,EACzB;AACF;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TOKENS_ATTR as c, ensureSheet as s } from "@epilot/zenith-runtime/v1";
|
|
1
|
+
import { TOKENS_ATTR as c, ensureSheet as s } from "@epilot/zenith-runtime/v1/core.js";
|
|
2
2
|
import { SHEET_HASH as t } from "./generated/palette.meta.generated.js";
|
|
3
3
|
import { ensureCoreTokens as f } from "./delivery/index.js";
|
|
4
4
|
function d(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sources":["../../../../../tokens/dist/install.js"],"sourcesContent":["import { TOKENS_ATTR as c, ensureSheet as s } from \"@epilot/zenith-runtime/v1\";\nimport { SHEET_HASH as f } from \"./generated/core.meta.generated.js\";\nimport { SHEET_HASH as r } from \"./generated/palette.meta.generated.js\";\nimport { ensureCoreTokens as l } from \"./delivery/index.js\";\nfunction C(e) {\n return l(e);\n}\nfunction i(e) {\n return e ?? (typeof document < \"u\" ? document : void 0);\n}\nlet u, o;\nfunction a() {\n return o ?? (o = import(\"./generated/palette.generated.js\").then(\n (e) => u = e.CSS,\n (e) => {\n throw o = void 0, e;\n }\n )), o;\n}\nfunction S(e) {\n const t = i(e);\n return t ? u !== void 0 ? s(t, r, u) : (t.querySelector(`[${c}=\"${r}\"]`) || a().then(\n (n) => s(t, r, n),\n () => {\n }\n ), !1) : !1;\n}\nfunction h(e = {}) {\n const t = i(e.document);\n return t ? a().then((n) => {\n s(t, r, n);\n }) : Promise.resolve();\n}\nconst m = /* @__PURE__ */ new Set([\n \"accent\",\n \"gray\",\n \"error\",\n \"info\",\n \"success\",\n \"warning\"\n]);\nfunction T(e) {\n return m.has(e);\n}\nfunction k(e, t) {\n return T(e) ? !1 : S(t);\n}\nconst _ = {\n core: f,\n palette: r\n};\nexport {\n _ as TOKEN_SHEET_HASHES,\n C as ensureCoreTokens,\n S as ensurePaletteTokens,\n k as ensurePaletteTokensFor,\n T as isCoreFamily,\n h as preparePaletteTokens\n};\n//# sourceMappingURL=install.js.map\n"],"names":["C","l","i","o","a","S","t","s","r","c","n","h","m","T","k"],"mappings":";;;AAIA,SAASA,EAAE,GAAG;AACZ,SAAOC,EAAE,CAAC;AACZ;AACA,SAASC,EAAE,GAAG;AACZ,SAAO,MAAM,OAAO,WAAW,MAAM,WAAW;AAClD;AACA,IAAI,GAAGC;AACP,SAASC,IAAI;AACX,SAAOD,MAAMA,IAAI,OAAO,kCAAkC,EAAE;AAAA,IAC1D,CAAC,MAAM,IAAI,EAAE;AAAA,IACb,CAAC,MAAM;AACL,YAAMA,IAAI,QAAQ;AAAA,IACpB;AAAA,EACJ,IAAMA;AACN;AACA,SAASE,EAAE,GAAG;AACZ,QAAMC,IAAIJ,EAAE,CAAC;AACb,SAAOI,IAAI,MAAM,SAASC,EAAED,GAAGE,GAAG,CAAC,KAAKF,EAAE,cAAc,IAAIG,CAAC,KAAKD,CAAC,IAAI,KAAKJ,EAAC,EAAG;AAAA,IAC9E,CAACM,MAAMH,EAAED,GAAGE,GAAGE,CAAC;AAAA,IAChB,MAAM;AAAA,IACN;AAAA,EACJ,GAAK,MAAM;AACX;AACA,SAASC,EAAE,IAAI,IAAI;AACjB,QAAML,IAAIJ,EAAE,EAAE,QAAQ;AACtB,SAAOI,IAAIF,EAAC,EAAG,KAAK,CAACM,MAAM;AACzBH,IAAAA,EAAED,GAAGE,GAAGE,CAAC;AAAA,EACX,CAAC,IAAI,QAAQ,QAAO;AACtB;AACA,MAAME,IAAoB,oBAAI,IAAI;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AACD,SAASC,EAAE,GAAG;AACZ,SAAOD,EAAE,IAAI,CAAC;AAChB;AACA,SAASE,EAAE,GAAGR,GAAG;AACf,SAAOO,EAAE,CAAC,IAAI,KAAKR,EAAEC,CAAC;AACxB;"}
|
|
1
|
+
{"version":3,"file":"install.js","sources":["../../../../../tokens/dist/install.js"],"sourcesContent":["import { TOKENS_ATTR as c, ensureSheet as s } from \"@epilot/zenith-runtime/v1/core.js\";\nimport { SHEET_HASH as f } from \"./generated/core.meta.generated.js\";\nimport { SHEET_HASH as r } from \"./generated/palette.meta.generated.js\";\nimport { ensureCoreTokens as l } from \"./delivery/index.js\";\nfunction C(e) {\n return l(e);\n}\nfunction i(e) {\n return e ?? (typeof document < \"u\" ? document : void 0);\n}\nlet u, o;\nfunction a() {\n return o ?? (o = import(\"./generated/palette.generated.js\").then(\n (e) => u = e.CSS,\n (e) => {\n throw o = void 0, e;\n }\n )), o;\n}\nfunction S(e) {\n const t = i(e);\n return t ? u !== void 0 ? s(t, r, u) : (t.querySelector(`[${c}=\"${r}\"]`) || a().then(\n (n) => s(t, r, n),\n () => {\n }\n ), !1) : !1;\n}\nfunction h(e = {}) {\n const t = i(e.document);\n return t ? a().then((n) => {\n s(t, r, n);\n }) : Promise.resolve();\n}\nconst m = /* @__PURE__ */ new Set([\n \"accent\",\n \"gray\",\n \"error\",\n \"info\",\n \"success\",\n \"warning\"\n]);\nfunction T(e) {\n return m.has(e);\n}\nfunction k(e, t) {\n return T(e) ? !1 : S(t);\n}\nconst _ = {\n core: f,\n palette: r\n};\nexport {\n _ as TOKEN_SHEET_HASHES,\n C as ensureCoreTokens,\n S as ensurePaletteTokens,\n k as ensurePaletteTokensFor,\n T as isCoreFamily,\n h as preparePaletteTokens\n};\n//# sourceMappingURL=install.js.map\n"],"names":["C","l","i","o","a","S","t","s","r","c","n","h","m","T","k"],"mappings":";;;AAIA,SAASA,EAAE,GAAG;AACZ,SAAOC,EAAE,CAAC;AACZ;AACA,SAASC,EAAE,GAAG;AACZ,SAAO,MAAM,OAAO,WAAW,MAAM,WAAW;AAClD;AACA,IAAI,GAAGC;AACP,SAASC,IAAI;AACX,SAAOD,MAAMA,IAAI,OAAO,kCAAkC,EAAE;AAAA,IAC1D,CAAC,MAAM,IAAI,EAAE;AAAA,IACb,CAAC,MAAM;AACL,YAAMA,IAAI,QAAQ;AAAA,IACpB;AAAA,EACJ,IAAMA;AACN;AACA,SAASE,EAAE,GAAG;AACZ,QAAMC,IAAIJ,EAAE,CAAC;AACb,SAAOI,IAAI,MAAM,SAASC,EAAED,GAAGE,GAAG,CAAC,KAAKF,EAAE,cAAc,IAAIG,CAAC,KAAKD,CAAC,IAAI,KAAKJ,EAAC,EAAG;AAAA,IAC9E,CAACM,MAAMH,EAAED,GAAGE,GAAGE,CAAC;AAAA,IAChB,MAAM;AAAA,IACN;AAAA,EACJ,GAAK,MAAM;AACX;AACA,SAASC,EAAE,IAAI,IAAI;AACjB,QAAML,IAAIJ,EAAE,EAAE,QAAQ;AACtB,SAAOI,IAAIF,EAAC,EAAG,KAAK,CAACM,MAAM;AACzBH,IAAAA,EAAED,GAAGE,GAAGE,CAAC;AAAA,EACX,CAAC,IAAI,QAAQ,QAAO;AACtB;AACA,MAAME,IAAoB,oBAAI,IAAI;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AACD,SAASC,EAAE,GAAG;AACZ,SAAOD,EAAE,IAAI,CAAC;AAChB;AACA,SAASE,EAAE,GAAGR,GAAG;AACf,SAAOO,EAAE,CAAC,IAAI,KAAKR,EAAEC,CAAC;AACxB;"}
|
package/dist/renderer/served.js
CHANGED
|
@@ -1,34 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import { BASE_UI_FAMILIES as n, getTokenSheet as r, assertCompatibility as s, BASE_UI_VERSION as a } from "@epilot/zenith-runtime/v1/core.js";
|
|
3
|
+
import { EXPECTED_TOKEN_SHEETS as h, EXPECTED_PRIMITIVES as m, EXPECTED_CLASS_SALT as p, EXPECTED_ABI_VERSION as E } from "./runtime-contract.generated.js";
|
|
3
4
|
let i = !1;
|
|
4
|
-
function
|
|
5
|
+
function u() {
|
|
5
6
|
if (!i) {
|
|
6
|
-
if (i = !0,
|
|
7
|
+
if (i = !0, n === void 0 || typeof r != "function")
|
|
7
8
|
throw new Error(
|
|
8
9
|
"Incompatible Zenith runtime: @epilot/zenith-react takes its Base UI primitives and core token sheet from @epilot/zenith-runtime/v1, but the runtime on this page serves neither (it predates the shared-primitives runtime). Deploy a runtime release that serves them (root-config) before this application, or bundle the runtime."
|
|
9
10
|
);
|
|
10
|
-
|
|
11
|
+
s({
|
|
11
12
|
abiVersion: E,
|
|
12
13
|
classSalt: p,
|
|
13
|
-
primitives:
|
|
14
|
-
tokenSheets:
|
|
14
|
+
primitives: m,
|
|
15
|
+
tokenSheets: h,
|
|
16
|
+
// The served primitives render inside this package's components, so they must run on this
|
|
17
|
+
// package's React: the page's single copy. A runtime bundled with a React of its own, or with
|
|
18
|
+
// a `react/jsx-runtime` of another React version, is named here with the host rule (#116).
|
|
19
|
+
react: o
|
|
15
20
|
});
|
|
16
21
|
}
|
|
17
22
|
}
|
|
18
|
-
|
|
19
|
-
function
|
|
23
|
+
u();
|
|
24
|
+
function f(e, t) {
|
|
20
25
|
if (t === void 0)
|
|
21
26
|
throw new Error(
|
|
22
|
-
`Incompatible Zenith runtime primitives: this build of @epilot/zenith-react needs Base UI "${e}", which the runtime on this page (Base UI ${
|
|
27
|
+
`Incompatible Zenith runtime primitives: this build of @epilot/zenith-react needs Base UI "${e}", which the runtime on this page (Base UI ${a}) does not serve. Deploy a runtime release that serves it (root-config) before this application.`
|
|
23
28
|
);
|
|
24
29
|
return t;
|
|
25
30
|
}
|
|
26
|
-
function
|
|
31
|
+
function S(e) {
|
|
27
32
|
return r(e);
|
|
28
33
|
}
|
|
29
34
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
u as ensureServedContract,
|
|
36
|
+
f as servedFamily,
|
|
37
|
+
S as servedTokenSheet
|
|
33
38
|
};
|
|
34
39
|
//# sourceMappingURL=served.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"served.js","sources":["../../src/renderer/served.ts"],"sourcesContent":["import {\n assertCompatibility,\n BASE_UI_FAMILIES,\n BASE_UI_VERSION,\n getTokenSheet,\n type ServedFamily,\n} from \"@epilot/zenith-runtime/v1\"\nimport {\n EXPECTED_ABI_VERSION,\n EXPECTED_CLASS_SALT,\n EXPECTED_PRIMITIVES,\n EXPECTED_TOKEN_SHEETS,\n} from \"./runtime-contract.generated\"\n\n/**\n * The seam where this package meets the runtime that serves its Base UI primitives and its core\n * token sheet (D13). It runs once, at module initialisation, before any served family or sheet is\n * read (`vite.shared-primitives.ts` makes every rewritten module import it first): a runtime that\n * predates the shared primitives,
|
|
1
|
+
{"version":3,"file":"served.js","sources":["../../src/renderer/served.ts"],"sourcesContent":["import * as React from \"react\"\nimport {\n assertCompatibility,\n BASE_UI_FAMILIES,\n BASE_UI_VERSION,\n getTokenSheet,\n type ServedFamily,\n} from \"@epilot/zenith-runtime/v1/core\"\nimport {\n EXPECTED_ABI_VERSION,\n EXPECTED_CLASS_SALT,\n EXPECTED_PRIMITIVES,\n EXPECTED_TOKEN_SHEETS,\n} from \"./runtime-contract.generated\"\n\n/**\n * The seam where this package meets the runtime that serves its Base UI primitives and its core\n * token sheet (D13). It runs once, at module initialisation, before any served family or sheet is\n * read (`vite.shared-primitives.ts` makes every rewritten module import it first): a runtime that\n * predates the shared primitives, that serves another family set or another sheet, or that runs on\n * a React of its own rather than this package's (#116), fails here with a named cause — never as a\n * TypeError inside a component, never as a blank page (D3).\n *\n * Named imports, not a namespace: a namespace object held in a variable makes a bundler keep every\n * export of `/v1`, and with it every served family, in an application that bundles the runtime.\n * Under SystemJS (the import-map host) an export the runtime lacks arrives as `undefined`, which is\n * what the first check reads; under native ESM the engine names the missing export itself.\n */\nlet asserted = false\n\n/**\n * Validates the contract once. Called here at module initialisation, and from `contract.ts` as a\n * statement: a bare side-effect import of this file would be dropped by a consumer's bundler, since\n * the package declares `sideEffects: false`, while a call is kept.\n */\nexport function ensureServedContract(): void {\n if (asserted) return\n asserted = true\n if (\n (BASE_UI_FAMILIES as unknown) === undefined ||\n typeof (getTokenSheet as unknown) !== \"function\"\n ) {\n throw new Error(\n \"Incompatible Zenith runtime: @epilot/zenith-react takes its Base UI primitives and core token \" +\n \"sheet from @epilot/zenith-runtime/v1, but the runtime on this page serves neither (it predates \" +\n \"the shared-primitives runtime). Deploy a runtime release that serves them (root-config) before \" +\n \"this application, or bundle the runtime.\"\n )\n }\n assertCompatibility({\n abiVersion: EXPECTED_ABI_VERSION,\n classSalt: EXPECTED_CLASS_SALT,\n primitives: EXPECTED_PRIMITIVES,\n tokenSheets: EXPECTED_TOKEN_SHEETS,\n // The served primitives render inside this package's components, so they must run on this\n // package's React: the page's single copy. A runtime bundled with a React of its own, or with\n // a `react/jsx-runtime` of another React version, is named here with the host rule (#116).\n react: React,\n })\n}\n\nensureServedContract()\n\n/** A served family, or the named cause when the runtime on the page does not serve it. */\nexport function servedFamily(\n key: string,\n family: ServedFamily | undefined\n): ServedFamily {\n if (family === undefined) {\n throw new Error(\n `Incompatible Zenith runtime primitives: this build of @epilot/zenith-react needs Base UI \"${key}\", ` +\n `which the runtime on this page (Base UI ${BASE_UI_VERSION}) does not serve. Deploy a ` +\n `runtime release that serves it (root-config) before this application.`\n )\n }\n return family\n}\n\n/** The served sheet for a hash this package was compiled against; the runtime names a missing one. */\nexport function servedTokenSheet(hash: string): string {\n return getTokenSheet(hash)\n}\n"],"names":["asserted","ensureServedContract","BASE_UI_FAMILIES","getTokenSheet","assertCompatibility","EXPECTED_ABI_VERSION","EXPECTED_CLASS_SALT","EXPECTED_PRIMITIVES","EXPECTED_TOKEN_SHEETS","React","servedFamily","key","family","BASE_UI_VERSION","servedTokenSheet","hash"],"mappings":";;;AA4BA,IAAIA,IAAW;AAOR,SAASC,IAA6B;AAC3C,MAAI,CAAAD,GAEJ;AAAA,QADAA,IAAW,IAERE,MAAiC,UAClC,OAAQC,KAA8B;AAEtC,YAAM,IAAI;AAAA,QACR;AAAA,MAAA;AAMJ,IAAAC,EAAoB;AAAA,MAClB,YAAYC;AAAA,MACZ,WAAWC;AAAA,MACX,YAAYC;AAAA,MACZ,aAAaC;AAAA;AAAA;AAAA;AAAA,MAIb,OAAOC;AAAA,IAAA,CACR;AAAA;AACH;AAEAR,EAAA;AAGO,SAASS,EACdC,GACAC,GACc;AACd,MAAIA,MAAW;AACb,UAAM,IAAI;AAAA,MACR,6FAA6FD,CAAG,8CACnDE,CAAe;AAAA,IAAA;AAIhE,SAAOD;AACT;AAGO,SAASE,EAAiBC,GAAsB;AACrD,SAAOZ,EAAcY,CAAI;AAC3B;"}
|
|
@@ -1 +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;"}
|
|
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/core\"\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;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as r from "react";
|
|
2
|
-
import { createZenithResetStylesRecipe as u, createZenithStylesRecipe as a } from "@epilot/zenith-runtime/v1";
|
|
2
|
+
import { createZenithResetStylesRecipe as u, createZenithStylesRecipe as a } from "@epilot/zenith-runtime/v1/core.js";
|
|
3
3
|
import { useZenithTargetDocument as o } from "./document-context.js";
|
|
4
4
|
import { ensureCoreTokens as i } from "../packages/tokens/dist/install.js";
|
|
5
5
|
function p(s) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-styles.js","sources":["../../src/styles/make-styles.ts"],"sourcesContent":["import * as React from \"react\"\nimport {\n createZenithStylesRecipe as runtimeCreateZenithStylesRecipe,\n createZenithResetStylesRecipe as runtimeCreateZenithResetStylesRecipe,\n type GriffelResetStyle,\n type GriffelStyle,\n} from \"@epilot/zenith-runtime/v1\"\n\nimport { ensureCoreTokens } from \"../tokens/install\"\nimport { useZenithTargetDocument } from \"./document-context\"\n\n/**\n * The runtime's style hooks, with this package's token sheet attached. WHY THIS WRAPPER EXISTS,\n * AND WHY IT IS NOT IN THE RUNTIME.\n */\n\nexport type ZenithStyles<Slots extends string> = Record<Slots, GriffelStyle>\n\n/**\n * One class per slot, atoms deduped against whatever is already on the page. **The generic is over\n * the object, not over the key union, and that is load-bearing.** Inferring a type parameter from\n * `Record<Slots, …>` against an object literal widens `Slots` to `string`, so every slot name\n * typechecks including ones that do not exist.\n */\nexport function makeZenithStyles<S extends Record<string, GriffelStyle>>(\n styles: S\n): () => Record<keyof S & string, string> {\n const recipe = runtimeCreateZenithStylesRecipe(styles)\n return function useZenithStyles(): Record<keyof S & string, string> {\n const doc = useZenithTargetDocument()\n const classes = recipe.getClasses()\n React.useInsertionEffect(() => {\n if (!doc) return\n ensureCoreTokens(doc)\n recipe.install(doc)\n })\n return classes\n }\n}\n\n/**\n * One monolithic class for an element's invariant base, rather than atoms.\n *\n * Lands in Griffel's `r` bucket, which sorts before every atom bucket, so variant atoms override it\n * by source order without any specificity escalation. Exactly one reset class per element.\n */\nexport function makeZenithResetStyles(styles: GriffelResetStyle): () => string {\n const recipe = runtimeCreateZenithResetStylesRecipe(styles)\n return function useZenithResetStyles(): string {\n const doc = useZenithTargetDocument()\n const className = recipe.getClasses()\n React.useInsertionEffect(() => {\n if (!doc) return\n ensureCoreTokens(doc)\n recipe.install(doc)\n })\n return className\n }\n}\n"],"names":["makeZenithStyles","styles","recipe","runtimeCreateZenithStylesRecipe","doc","useZenithTargetDocument","classes","React","ensureCoreTokens","makeZenithResetStyles","runtimeCreateZenithResetStylesRecipe","className"],"mappings":";;;;AAwBO,SAASA,EACdC,GACwC;AACxC,QAAMC,IAASC,EAAgCF,CAAM;AACrD,SAAO,WAA6D;AAClE,UAAMG,IAAMC,EAAA,GACNC,IAAUJ,EAAO,WAAA;AACvB,WAAAK,EAAM,mBAAmB,MAAM;AAC7B,MAAKH,MACLI,EAAiBJ,CAAG,GACpBF,EAAO,QAAQE,CAAG;AAAA,IACpB,CAAC,GACME;AAAA,EACT;AACF;AAQO,SAASG,EAAsBR,GAAyC;AAC7E,QAAMC,IAASQ,EAAqCT,CAAM;AAC1D,SAAO,WAAwC;AAC7C,UAAMG,IAAMC,EAAA,GACNM,IAAYT,EAAO,WAAA;AACzB,WAAAK,EAAM,mBAAmB,MAAM;AAC7B,MAAKH,MACLI,EAAiBJ,CAAG,GACpBF,EAAO,QAAQE,CAAG;AAAA,IACpB,CAAC,GACMO;AAAA,EACT;AACF;"}
|
|
1
|
+
{"version":3,"file":"make-styles.js","sources":["../../src/styles/make-styles.ts"],"sourcesContent":["import * as React from \"react\"\nimport {\n createZenithStylesRecipe as runtimeCreateZenithStylesRecipe,\n createZenithResetStylesRecipe as runtimeCreateZenithResetStylesRecipe,\n type GriffelResetStyle,\n type GriffelStyle,\n} from \"@epilot/zenith-runtime/v1/core\"\n\nimport { ensureCoreTokens } from \"../tokens/install\"\nimport { useZenithTargetDocument } from \"./document-context\"\n\n/**\n * The runtime's style hooks, with this package's token sheet attached. WHY THIS WRAPPER EXISTS,\n * AND WHY IT IS NOT IN THE RUNTIME.\n */\n\nexport type ZenithStyles<Slots extends string> = Record<Slots, GriffelStyle>\n\n/**\n * One class per slot, atoms deduped against whatever is already on the page. **The generic is over\n * the object, not over the key union, and that is load-bearing.** Inferring a type parameter from\n * `Record<Slots, …>` against an object literal widens `Slots` to `string`, so every slot name\n * typechecks including ones that do not exist.\n */\nexport function makeZenithStyles<S extends Record<string, GriffelStyle>>(\n styles: S\n): () => Record<keyof S & string, string> {\n const recipe = runtimeCreateZenithStylesRecipe(styles)\n return function useZenithStyles(): Record<keyof S & string, string> {\n const doc = useZenithTargetDocument()\n const classes = recipe.getClasses()\n React.useInsertionEffect(() => {\n if (!doc) return\n ensureCoreTokens(doc)\n recipe.install(doc)\n })\n return classes\n }\n}\n\n/**\n * One monolithic class for an element's invariant base, rather than atoms.\n *\n * Lands in Griffel's `r` bucket, which sorts before every atom bucket, so variant atoms override it\n * by source order without any specificity escalation. Exactly one reset class per element.\n */\nexport function makeZenithResetStyles(styles: GriffelResetStyle): () => string {\n const recipe = runtimeCreateZenithResetStylesRecipe(styles)\n return function useZenithResetStyles(): string {\n const doc = useZenithTargetDocument()\n const className = recipe.getClasses()\n React.useInsertionEffect(() => {\n if (!doc) return\n ensureCoreTokens(doc)\n recipe.install(doc)\n })\n return className\n }\n}\n"],"names":["makeZenithStyles","styles","recipe","runtimeCreateZenithStylesRecipe","doc","useZenithTargetDocument","classes","React","ensureCoreTokens","makeZenithResetStyles","runtimeCreateZenithResetStylesRecipe","className"],"mappings":";;;;AAwBO,SAASA,EACdC,GACwC;AACxC,QAAMC,IAASC,EAAgCF,CAAM;AACrD,SAAO,WAA6D;AAClE,UAAMG,IAAMC,EAAA,GACNC,IAAUJ,EAAO,WAAA;AACvB,WAAAK,EAAM,mBAAmB,MAAM;AAC7B,MAAKH,MACLI,EAAiBJ,CAAG,GACpBF,EAAO,QAAQE,CAAG;AAAA,IACpB,CAAC,GACME;AAAA,EACT;AACF;AAQO,SAASG,EAAsBR,GAAyC;AAC7E,QAAMC,IAASQ,EAAqCT,CAAM;AAC1D,SAAO,WAAwC;AAC7C,UAAMG,IAAMC,EAAA,GACNM,IAAYT,EAAO,WAAA;AACzB,WAAAK,EAAM,mBAAmB,MAAM;AAC7B,MAAKH,MACLI,EAAiBJ,CAAG,GACpBF,EAAO,QAAQE,CAAG;AAAA,IACpB,CAAC,GACMO;AAAA,EACT;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-box.js","sources":["../../src/styles/text-box.ts"],"sourcesContent":["import type { GriffelStyle } from \"@epilot/zenith-runtime/v1\"\n\n/**\n * Trim a text box to the font's cap height and alphabetic baseline.\n *\n * `text-box` is Baseline 2026, but the version of csstype used by Griffel does not declare it yet.\n * Keep the compatibility cast here so components can share the one progressive-enhancement rule\n * without weakening the type of their whole style object.\n */\nexport const capTrim = {\n textBox: \"trim-both cap alphabetic\",\n} as GriffelStyle\n"],"names":["capTrim"],"mappings":"AASO,MAAMA,IAAU;AAAA,EACrB,SAAS;AACX;"}
|
|
1
|
+
{"version":3,"file":"text-box.js","sources":["../../src/styles/text-box.ts"],"sourcesContent":["import type { GriffelStyle } from \"@epilot/zenith-runtime/v1/core\"\n\n/**\n * Trim a text box to the font's cap height and alphabetic baseline.\n *\n * `text-box` is Baseline 2026, but the version of csstype used by Griffel does not declare it yet.\n * Keep the compatibility cast here so components can share the one progressive-enhancement rule\n * without weakening the type of their whole style object.\n */\nexport const capTrim = {\n textBox: \"trim-both cap alphabetic\",\n} as GriffelStyle\n"],"names":["capTrim"],"mappings":"AASO,MAAMA,IAAU;AAAA,EACrB,SAAS;AACX;"}
|
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.
|
|
4
|
+
"version": "0.2.0-next.6",
|
|
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.
|
|
3
|
+
"version": "0.2.0-next.6",
|
|
4
4
|
"description": "Zenith React components, styled with Griffel and designed for isolated micro-frontend delivery",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"./tokens.json": "./dist/tokens.json",
|
|
32
32
|
"./testing/jest-preset.cjs": "./testing/jest-preset.cjs",
|
|
33
|
+
"./testing/setup.cjs": "./testing/setup.cjs",
|
|
33
34
|
"./package.json": "./package.json"
|
|
34
35
|
},
|
|
35
36
|
"files": [
|
|
@@ -92,7 +93,7 @@
|
|
|
92
93
|
"verify:consumer": "bun ../../scripts/verify-packed-consumer.ts"
|
|
93
94
|
},
|
|
94
95
|
"dependencies": {
|
|
95
|
-
"@epilot/zenith-runtime": "0.2.0-next.
|
|
96
|
+
"@epilot/zenith-runtime": "0.2.0-next.4"
|
|
96
97
|
},
|
|
97
98
|
"peerDependencies": {
|
|
98
99
|
"react": ">=18",
|
|
@@ -103,7 +104,7 @@
|
|
|
103
104
|
"@dnd-kit/core": "6.3.1",
|
|
104
105
|
"@dnd-kit/sortable": "10.0.0",
|
|
105
106
|
"@dnd-kit/utilities": "3.2.2",
|
|
106
|
-
"@epilot/zenith-tokens": "0.2.0-next.
|
|
107
|
+
"@epilot/zenith-tokens": "0.2.0-next.6",
|
|
107
108
|
"@tanstack/react-table": "8.21.3",
|
|
108
109
|
"@tanstack/react-virtual": "3.11.2",
|
|
109
110
|
"@testing-library/react": "^16.3.2",
|
|
@@ -126,6 +127,7 @@
|
|
|
126
127
|
"rollup": "^4.0.0",
|
|
127
128
|
"rollup-plugin-dts": "^6.5.1",
|
|
128
129
|
"sonner": "2.0.7",
|
|
130
|
+
"systemjs": "6.15.1",
|
|
129
131
|
"typescript": "^5.6.3",
|
|
130
132
|
"vite": "^6.4.4",
|
|
131
133
|
"vitest": "^4.1.11"
|