@epilot/zenith-react 0.2.0-next.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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 +41 -39
- 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 +1 -1
- package/dist/components/field/field-combobox.js.map +1 -1
- package/dist/components/field/field-select.js +1 -1
- 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 +15 -12
- 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 +1 -1
- package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +1 -1
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.js +178 -176
- 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 +59 -57
- 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 +1 -1
- 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.js +1 -1
- package/dist/lib/clear-button.js +1 -1
- package/dist/lib/clear-button.js.map +1 -1
- package/dist/lib/hidden-input-box.js +26 -0
- package/dist/lib/hidden-input-box.js.map +1 -0
- 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 +1 -1
- 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 +3 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","sources":["../../../src/components/card/card.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1
|
|
1
|
+
{"version":3,"file":"card.js","sources":["../../../src/components/card/card.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\n\n/**\n * Card — the first compound component: ONE `makeZenithStyles` call for the whole family, one slot\n * per sub-component, and each sub-component reads its own slot. Callout, Breadcrumb and Table copy\n * this pattern.\n */\n\nconst useStyles = makeZenithStyles({\n root: {\n ...boxModel,\n // The container role recipe Surface's `section` uses: fill, edge, radius and shadow all follow\n // the theme. In dark mode the role has no border width and no shadow, so the fill is what\n // separates the card from the page.\n backgroundColor: tokens.surfaceContainer,\n display: \"flex\",\n flexDirection: \"column\",\n ...shorthands.gap(tokens.spacingGroup2),\n ...shorthands.borderRadius(tokens.surfaceRadiusContainer),\n ...shorthands.borderWidth(tokens.borderWidthContainer),\n ...shorthands.borderStyle(\"solid\"),\n ...shorthands.borderColor(tokens.borderContainer),\n paddingTop: tokens.spacingGroup2,\n paddingBottom: tokens.spacingGroup2,\n boxShadow: tokens.shadowContainer,\n },\n header: {\n ...boxModel,\n containerType: \"inline-size\",\n containerName: \"card-header\",\n display: \"grid\",\n gridAutoRows: \"min-content\",\n gridTemplateRows: \"auto auto\",\n alignItems: \"start\",\n ...shorthands.gap(tokens.spacingElement2),\n paddingLeft: tokens.spacingGroup2,\n paddingRight: tokens.spacingGroup2,\n \"&:is(.border-b)\": {\n paddingBottom: tokens.spacingGroup2,\n },\n [`&:has([${SLOT_ATTR}=\"card-action\"])`]: {\n gridTemplateColumns: \"1fr auto\",\n },\n },\n title: {\n // v1 `leading-none` — a literal 1 because no token exists for it.\n lineHeight: 1,\n fontWeight: tokens.fontWeightSemibold,\n },\n description: {\n color: tokens.grayA11,\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n },\n action: {\n gridColumnStart: 2,\n gridRowStart: 1,\n gridRowEnd: \"span 2\",\n alignSelf: \"start\",\n justifySelf: \"end\",\n },\n content: {\n ...boxModel,\n paddingLeft: tokens.spacingGroup2,\n paddingRight: tokens.spacingGroup2,\n },\n footer: {\n ...boxModel,\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: tokens.spacingGroup2,\n paddingRight: tokens.spacingGroup2,\n \"&:is(.border-t)\": {\n paddingTop: tokens.spacingGroup2,\n },\n },\n})\n\nexport type CardProps = React.ComponentProps<\"div\">\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(\n { className, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"card\"\n {...{ [SLOT_ATTR]: \"card\" }}\n className={mergeClasses(styles.root, className)}\n {...props}\n />\n )\n})\n\nexport const CardHeader = React.forwardRef<HTMLDivElement, CardProps>(\n function CardHeader({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"card-header\"\n {...{ [SLOT_ATTR]: \"card-header\" }}\n className={mergeClasses(styles.header, className)}\n {...props}\n />\n )\n }\n)\n\nexport const CardTitle = React.forwardRef<HTMLDivElement, CardProps>(\n function CardTitle({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"card-title\"\n {...{ [SLOT_ATTR]: \"card-title\" }}\n className={mergeClasses(styles.title, className)}\n {...props}\n />\n )\n }\n)\n\nexport const CardDescription = React.forwardRef<HTMLDivElement, CardProps>(\n function CardDescription({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"card-description\"\n {...{ [SLOT_ATTR]: \"card-description\" }}\n className={mergeClasses(styles.description, className)}\n {...props}\n />\n )\n }\n)\n\nexport const CardAction = React.forwardRef<HTMLDivElement, CardProps>(\n function CardAction({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"card-action\"\n {...{ [SLOT_ATTR]: \"card-action\" }}\n className={mergeClasses(styles.action, className)}\n {...props}\n />\n )\n }\n)\n\nexport const CardContent = React.forwardRef<HTMLDivElement, CardProps>(\n function CardContent({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"card-content\"\n {...{ [SLOT_ATTR]: \"card-content\" }}\n className={mergeClasses(styles.content, className)}\n {...props}\n />\n )\n }\n)\n\nexport const CardFooter = React.forwardRef<HTMLDivElement, CardProps>(\n function CardFooter({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"card-footer\"\n {...{ [SLOT_ATTR]: \"card-footer\" }}\n className={mergeClasses(styles.footer, className)}\n {...props}\n />\n )\n }\n)\n"],"names":["useStyles","makeZenithStyles","boxModel","tokens.surfaceContainer","shorthands","tokens.spacingGroup2","tokens.surfaceRadiusContainer","tokens.borderWidthContainer","tokens.borderContainer","tokens.shadowContainer","tokens.spacingElement2","SLOT_ATTR","tokens.fontWeightSemibold","tokens.grayA11","tokens.textSm","tokens.leadingSm","Card","React","className","props","ref","styles","jsx","mergeClasses","CardHeader","CardTitle","CardDescription","CardAction","CardContent","CardFooter"],"mappings":";;;;;;AAeA,MAAMA,IAAYC,EAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,GAAGC;AAAA;AAAA;AAAA;AAAA,IAIH,iBAAiBC;AAAAA,IACjB,SAAS;AAAA,IACT,eAAe;AAAA,IACf,GAAGC,EAAW,IAAIC,CAAoB;AAAA,IACtC,GAAGD,EAAW,aAAaE,CAA6B;AAAA,IACxD,GAAGF,EAAW,YAAYG,CAA2B;AAAA,IACrD,GAAGH,EAAW,YAAY,OAAO;AAAA,IACjC,GAAGA,EAAW,YAAYI,CAAsB;AAAA,IAChD,YAAYH;AAAAA,IACZ,eAAeA;AAAAA,IACf,WAAWI;AAAAA,EAAO;AAAA,EAEpB,QAAQ;AAAA,IACN,GAAGP;AAAA,IACH,eAAe;AAAA,IACf,eAAe;AAAA,IACf,SAAS;AAAA,IACT,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,GAAGE,EAAW,IAAIM,CAAsB;AAAA,IACxC,aAAaL;AAAAA,IACb,cAAcA;AAAAA,IACd,mBAAmB;AAAA,MACjB,eAAeA;AAAAA,IAAO;AAAA,IAExB,CAAC,UAAUM,CAAS,kBAAkB,GAAG;AAAA,MACvC,qBAAqB;AAAA,IAAA;A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S;AAAA,QAChD,GAAGC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF,GAEaU,IAAaZ,EAAM;AAAA,EAC9B,SAAoB,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,GAAK;AAChD,UAAMC,IAASrB,EAAA;AAEf,WACE,gBAAAsB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAF;AAAA,QACA,aAAU;AAAA,QACJ,CAACT,CAAS,GAAG;AAAA,QACnB,WAAWY,EAAaF,EAAO,QAAQH,CAAS;AAAA,QAC/C,GAAGC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
|
-
import { Checkbox as
|
|
4
|
-
import { SLOT_ATTR as n, mergeClasses as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
3
|
+
import { Checkbox as b } from "../../_virtual/_zenith-runtime-family_checkbox.js";
|
|
4
|
+
import { SLOT_ATTR as n, mergeClasses as S, shorthands as e } from "@epilot/zenith-runtime/v1";
|
|
5
|
+
import { useOptionalFieldContext as T } from "../field/field.js";
|
|
6
|
+
import { HiddenInputBox as y } from "../../lib/hidden-input-box.js";
|
|
7
|
+
import { makeZenithStyles as q } from "../../styles/make-styles.js";
|
|
8
|
+
import { boxModel as R, nativeControl as I } from "../../styles/host-reset.js";
|
|
9
|
+
import { accentContrast as O, accentSolid as M, accentOnSoft as A, accentA7 as p, focusRing as f, radiusSm as B, accentSoft as L, errorA8 as E, grayA4 as F } from "../../tokens/index.js";
|
|
10
|
+
const N = i.forwardRef(function(r, t) {
|
|
9
11
|
return /* @__PURE__ */ o(
|
|
10
12
|
"svg",
|
|
11
13
|
{
|
|
@@ -21,7 +23,7 @@ const L = i.forwardRef(function(r, t) {
|
|
|
21
23
|
children: /* @__PURE__ */ o("path", { d: "m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z" })
|
|
22
24
|
}
|
|
23
25
|
);
|
|
24
|
-
}),
|
|
26
|
+
}), Z = i.forwardRef(function(r, t) {
|
|
25
27
|
return /* @__PURE__ */ o(
|
|
26
28
|
"svg",
|
|
27
29
|
{
|
|
@@ -37,17 +39,17 @@ const L = i.forwardRef(function(r, t) {
|
|
|
37
39
|
children: /* @__PURE__ */ o("path", { d: "M280-440q-17 0-28.5-11.5T240-480q0-17 11.5-28.5T280-520h400q17 0 28.5 11.5T720-480q0 17-11.5 28.5T680-440H280Z" })
|
|
38
40
|
}
|
|
39
41
|
);
|
|
40
|
-
}),
|
|
42
|
+
}), _ = q({
|
|
41
43
|
root: {
|
|
42
|
-
...
|
|
43
|
-
...e.border("1px", "solid",
|
|
44
|
-
backgroundColor:
|
|
44
|
+
...I,
|
|
45
|
+
...e.border("1px", "solid", p),
|
|
46
|
+
backgroundColor: L,
|
|
45
47
|
display: "inline-block",
|
|
46
48
|
boxSizing: "border-box",
|
|
47
49
|
width: "1rem",
|
|
48
50
|
height: "1rem",
|
|
49
51
|
flexShrink: 0,
|
|
50
|
-
borderRadius:
|
|
52
|
+
borderRadius: B,
|
|
51
53
|
// v1 `shadow-xs` — elevation comes from Tailwind's shadow scale, which has no token (B7).
|
|
52
54
|
boxShadow: "0 1px 2px 0 #0000000d",
|
|
53
55
|
transitionProperty: "box-shadow",
|
|
@@ -60,26 +62,26 @@ const L = i.forwardRef(function(r, t) {
|
|
|
60
62
|
outlineOffset: "2px",
|
|
61
63
|
outlineWidth: "2px",
|
|
62
64
|
outlineStyle: "solid",
|
|
63
|
-
outlineColor:
|
|
65
|
+
outlineColor: f
|
|
64
66
|
},
|
|
65
67
|
"&[data-disabled]": {
|
|
66
68
|
cursor: "not-allowed",
|
|
67
69
|
opacity: 0.5,
|
|
68
|
-
...e.borderColor(
|
|
70
|
+
...e.borderColor(F)
|
|
69
71
|
},
|
|
70
72
|
"&[aria-invalid='true']": {
|
|
71
|
-
outlineColor:
|
|
72
|
-
...e.borderColor(
|
|
73
|
+
outlineColor: f,
|
|
74
|
+
...e.borderColor(E)
|
|
73
75
|
},
|
|
74
76
|
"&[data-indeterminate]": {
|
|
75
|
-
backgroundColor:
|
|
77
|
+
backgroundColor: p,
|
|
76
78
|
...e.borderColor("transparent"),
|
|
77
|
-
color:
|
|
79
|
+
color: A
|
|
78
80
|
},
|
|
79
81
|
"&[data-checked]": {
|
|
80
|
-
backgroundColor:
|
|
82
|
+
backgroundColor: M,
|
|
81
83
|
...e.borderWidth("0px"),
|
|
82
|
-
color:
|
|
84
|
+
color: O
|
|
83
85
|
},
|
|
84
86
|
"&[data-checked] svg, &[data-indeterminate] svg": {
|
|
85
87
|
width: "0.875rem",
|
|
@@ -87,7 +89,7 @@ const L = i.forwardRef(function(r, t) {
|
|
|
87
89
|
}
|
|
88
90
|
},
|
|
89
91
|
indicator: {
|
|
90
|
-
...
|
|
92
|
+
...R,
|
|
91
93
|
display: "grid",
|
|
92
94
|
placeContent: "center",
|
|
93
95
|
height: "100%",
|
|
@@ -98,47 +100,47 @@ const L = i.forwardRef(function(r, t) {
|
|
|
98
100
|
height: "0.875rem"
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
|
-
}),
|
|
103
|
+
}), z = /* @__PURE__ */ o("button", {}), K = i.forwardRef(
|
|
102
104
|
function({
|
|
103
105
|
className: r,
|
|
104
106
|
checked: t,
|
|
105
|
-
defaultChecked:
|
|
107
|
+
defaultChecked: k,
|
|
106
108
|
onCheckedChange: c,
|
|
107
|
-
asChild:
|
|
108
|
-
value:
|
|
109
|
-
...
|
|
109
|
+
asChild: D,
|
|
110
|
+
value: l,
|
|
111
|
+
...s
|
|
110
112
|
}, g) {
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
u.Root,
|
|
113
|
+
const h = _(), w = T() !== null, [C, v] = i.useState(k ?? !1), a = t === void 0 ? C : t, m = /* @__PURE__ */ o(
|
|
114
|
+
b.Root,
|
|
114
115
|
{
|
|
115
116
|
ref: g,
|
|
116
117
|
nativeButton: !0,
|
|
117
|
-
render:
|
|
118
|
+
render: z,
|
|
118
119
|
checked: a === !0,
|
|
119
120
|
indeterminate: a === "indeterminate",
|
|
120
|
-
onCheckedChange: (
|
|
121
|
-
c == null || c(
|
|
121
|
+
onCheckedChange: (u, x) => {
|
|
122
|
+
c == null || c(u, x), x.isCanceled || v(u);
|
|
122
123
|
},
|
|
123
|
-
value:
|
|
124
|
+
value: l === void 0 ? void 0 : String(l),
|
|
124
125
|
"data-slot": "checkbox",
|
|
125
126
|
[n]: "checkbox",
|
|
126
|
-
className:
|
|
127
|
-
...
|
|
127
|
+
className: S(h.root, r),
|
|
128
|
+
...s,
|
|
128
129
|
children: /* @__PURE__ */ o(
|
|
129
|
-
|
|
130
|
+
b.Indicator,
|
|
130
131
|
{
|
|
131
132
|
"data-slot": "checkbox-indicator",
|
|
132
133
|
[n]: "checkbox-indicator",
|
|
133
|
-
className:
|
|
134
|
-
children: a === "indeterminate" ? /* @__PURE__ */ o(
|
|
134
|
+
className: h.indicator,
|
|
135
|
+
children: a === "indeterminate" ? /* @__PURE__ */ o(Z, {}) : /* @__PURE__ */ o(N, {})
|
|
135
136
|
}
|
|
136
137
|
)
|
|
137
138
|
}
|
|
138
139
|
);
|
|
140
|
+
return s.name === void 0 || w ? m : /* @__PURE__ */ o(y, { slot: "checkbox-box", layout: "inline-block", children: m });
|
|
139
141
|
}
|
|
140
142
|
);
|
|
141
143
|
export {
|
|
142
|
-
|
|
144
|
+
K as Checkbox
|
|
143
145
|
};
|
|
144
146
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sources":["../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1/core\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\n\nconst CheckIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function CheckIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-check-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-check-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z\" />\n </svg>\n )\n})\n\nconst MinusIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function MinusIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-minus-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-minus-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M280-440q-17 0-28.5-11.5T240-480q0-17 11.5-28.5T280-520h400q17 0 28.5 11.5T720-480q0 17-11.5 28.5T680-440H280Z\" />\n </svg>\n )\n})\n\nconst useStyles = makeZenithStyles({\n root: {\n ...nativeControl,\n ...shorthands.border(\"1px\", \"solid\", tokens.accentA7),\n backgroundColor: tokens.accentSoft,\n display: \"inline-block\",\n boxSizing: \"border-box\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n borderRadius: tokens.radiusSm,\n // v1 `shadow-xs` — elevation comes from Tailwind's shadow scale, which has no token (B7).\n boxShadow: \"0 1px 2px 0 #0000000d\",\n transitionProperty: \"box-shadow\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n transitionDuration: \"150ms\",\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \":focus-visible\": {\n outlineOffset: \"2px\",\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.focusRing,\n },\n \"&[data-disabled]\": {\n cursor: \"not-allowed\",\n opacity: 0.5,\n ...shorthands.borderColor(tokens.grayA4),\n },\n \"&[aria-invalid='true']\": {\n outlineColor: tokens.focusRing,\n ...shorthands.borderColor(tokens.errorA8),\n },\n \"&[data-indeterminate]\": {\n backgroundColor: tokens.accentA7,\n ...shorthands.borderColor(\"transparent\"),\n color: tokens.accentOnSoft,\n },\n \"&[data-checked]\": {\n backgroundColor: tokens.accentSolid,\n ...shorthands.borderWidth(\"0px\"),\n color: tokens.accentContrast,\n },\n \"&[data-checked] svg, &[data-indeterminate] svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n indicator: {\n ...boxModel,\n display: \"grid\",\n placeContent: \"center\",\n height: \"100%\",\n color: \"currentColor\",\n transitionProperty: \"none\",\n \"& svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n})\n\n/**\n * `checked` and `defaultChecked` accept the same three states as on Radix; Base UI models the third\n * as its own `indeterminate` boolean, which the wrapper sets.\n */\nexport type CheckboxCheckedState = boolean | \"indeterminate\"\n\n/**\n * What `onCheckedChange` receives as its second argument: Base UI's change details, declared in\n * Zenith so that none of Base UI's internals reach the published declarations, where TypeScript 4\n * cannot parse them.\n */\ntype CheckboxCheckedChangeDetails = {\n /** Why the checkbox changed. Base UI reports every checkbox change as `none`. */\n reason: \"none\"\n /** The native event behind the change. */\n event: Event\n /** Keeps the checkbox in its current state. */\n cancel: () => void\n /** Lets the event propagate where the checkbox 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}\n\n/**\n * The checkbox props Base UI adds to a `<button>`'s, declared in Zenith with Base UI's types, apart\n * from the three-state `checked`, `defaultChecked` and `onCheckedChange`, which keep their Radix\n * shape. The root renders a native `<button>`, so the DOM attributes, handlers, `ref`, `key`,\n * `className`, `style` and `value` stay the button's, as they were on Radix; `render`,\n * `nativeButton`, `indeterminate` and `parent` are not part of the surface.\n */\ntype CheckboxRootProps = {\n /**\n * Whether the checkbox is currently checked, or `\"indeterminate\"`.\n *\n * To render an uncontrolled checkbox, use the `defaultChecked` prop instead.\n */\n checked?: CheckboxCheckedState | undefined\n /** Whether the checkbox is initially checked, or `\"indeterminate\"`. */\n defaultChecked?: CheckboxCheckedState | undefined\n /** Whether the component should ignore user interaction. */\n disabled?: boolean | undefined\n /** A ref to access the hidden `<input>` element. */\n inputRef?: React.Ref<HTMLInputElement> | undefined\n /** Identifies the field when a form is submitted. */\n name?: string | undefined\n /**\n * Identifies the form that owns the hidden input.\n * Useful when the checkbox is rendered outside the form.\n */\n form?: string | undefined\n /**\n * Event handler called when the checkbox is checked or unchecked. Clicking an indeterminate\n * checkbox reports `true`.\n */\n onCheckedChange?:\n | ((\n checked: CheckboxCheckedState,\n eventDetails: CheckboxCheckedChangeDetails\n ) => void)\n | undefined\n /** Whether the user should be unable to check or uncheck the checkbox. */\n readOnly?: boolean | undefined\n /** Whether the user must check the checkbox before submitting a form. */\n required?: boolean | undefined\n /**\n * The value submitted with the form when the checkbox is unchecked.\n * By default, unchecked checkboxes do not submit any value, matching native checkbox behavior.\n */\n uncheckedValue?: string | undefined\n}\n\nexport type CheckboxProps = Omit<\n React.ComponentPropsWithRef<\"button\">,\n keyof CheckboxRootProps\n> &\n CheckboxRootProps & {\n /**\n * @deprecated Has no effect. The indicator is the checkbox's only child, so on Radix this\n * rendered the indicator as the checkbox rather than an element of yours. Remove it.\n */\n asChild?: boolean\n }\n\n// Base UI renders a <span> by default and moves the caller's id onto its hidden input. A native\n// button keeps the id, the HTMLButtonElement ref, native disabled and <label for> as Radix had them.\nconst ROOT_ELEMENT = <button />\n\nexport const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(\n function Checkbox(\n {\n className,\n checked,\n defaultChecked,\n onCheckedChange,\n asChild: _asChild,\n value,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n // Base UI has no third state to start from or to hold uncontrolled, so the state lives here\n // and Base UI is always controlled; a cancelled change leaves it as it was.\n const [uncontrolled, setUncontrolled] =\n React.useState<CheckboxCheckedState>(defaultChecked ?? false)\n const state = checked === undefined ? uncontrolled : checked\n\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n nativeButton\n render={ROOT_ELEMENT}\n checked={state === true}\n indeterminate={state === \"indeterminate\"}\n onCheckedChange={(next, details) => {\n onCheckedChange?.(next, details)\n if (!details.isCanceled) setUncontrolled(next)\n }}\n // Radix took the button's value type; Base UI submits a string, so it is converted here\n // the way the button's value attribute stringified it.\n value={value === undefined ? undefined : String(value)}\n data-slot=\"checkbox\"\n {...{ [SLOT_ATTR]: \"checkbox\" }}\n className={mergeClasses(styles.root, className)}\n // Base UI types the root's handlers for its default <span>; the element is the button\n // above, so the caller's button-typed handlers receive exactly the events they declare.\n {...(props as CheckboxPrimitive.Root.Props)}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n {...{ [SLOT_ATTR]: \"checkbox-indicator\" }}\n className={styles.indicator}\n >\n {state === \"indeterminate\" ? <MinusIcon /> : <CheckIcon />}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n }\n)\n"],"names":["CheckIcon","React","props","ref","jsx","SLOT_ATTR","MinusIcon","useStyles","makeZenithStyles","nativeControl","shorthands","tokens.accentA7","tokens.accentSoft","tokens.radiusSm","tokens.focusRing","tokens.grayA4","tokens.errorA8","tokens.accentOnSoft","tokens.accentSolid","tokens.accentContrast","boxModel","ROOT_ELEMENT","Checkbox","className","checked","defaultChecked","onCheckedChange","_asChild","value","styles","uncontrolled","setUncontrolled","state","CheckboxPrimitive","next","details","mergeClasses"],"mappings":";;;;;;;AASA,MAAMA,IAAYC,EAAM,WAGtB,SAAmBC,GAAOC,GAAK;AAC/B,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,aAAU;AAAA,MACJ,CAACE,CAAS,GAAG;AAAA,MACnB,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,MAAK;AAAA,MACJ,GAAGH;AAAA,MAEJ,UAAA,gBAAAE,EAAC,QAAA,EAAK,GAAE,uJAAA,CAAuJ;AAAA,IAAA;AAAA,EAAA;AAGrK,CAAC,GAEKE,IAAYL,EAAM,WAGtB,SAAmBC,GAAOC,GAAK;AAC/B,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,aAAU;AAAA,MACJ,CAACE,CAAS,GAAG;AAAA,MACnB,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,MAAK;AAAA,MACJ,GAAGH;AAAA,MAEJ,UAAA,gBAAAE,EAAC,QAAA,EAAK,GAAE,iHAAA,CAAiH;AAAA,IAAA;AAAA,EAAA;AAG/H,CAAC,GAEKG,IAAYC,EAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,GAAGC;AAAA,IACH,GAAGC,EAAW,OAAO,OAAO,SAASC,CAAe;AAAA,IACpD,iBAAiBC;AAAAA,IACjB,SAAS;AAAA,IACT,WAAW;AAAA,IACX,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,cAAcC;AAAAA;AAAAA,IAEd,WAAW;AAAA,IACX,oBAAoB;AAAA,IACpB,0BAA0B;AAAA,IAC1B,oBAAoB;AAAA,IACpB,2CAA2C;AAAA,MACzC,oBAAoB;AAAA,IAAA;AAAA,IAEtB,kBAAkB;A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,QACA,cAAY;AAAA,QACZ,QAAQkB;AAAA,QACR,SAASW,MAAU;AAAA,QACnB,eAAeA,MAAU;AAAA,QACzB,iBAAiB,CAACE,GAAMC,MAAY;AAClC,UAAAT,KAAA,QAAAA,EAAkBQ,GAAMC,IACnBA,EAAQ,cAAYJ,EAAgBG,CAAI;AAAA,QAC/C;AAAA,QAGA,OAAON,MAAU,SAAY,SAAY,OAAOA,CAAK;AAAA,QACrD,aAAU;AAAA,QACJ,CAACvB,CAAS,GAAG;AAAA,QACnB,WAAW+B,EAAaP,EAAO,MAAMN,CAAS;AAAA,QAG7C,GAAIrB;AAAA,QAEL,UAAA,gBAAAE;AAAA,UAAC6B,EAAkB;AAAA,UAAlB;AAAA,YACC,aAAU;AAAA,YACJ,CAAC5B,CAAS,GAAG;AAAA,YACnB,WAAWwB,EAAO;AAAA,YAEjB,gBAAU,kBAAkB,gBAAAzB,EAACE,GAAA,EAAU,sBAAMN,GAAA,CAAA,CAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MAC1D;AAAA,IAAA;AAAA,EAGN;AACF;"}
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { useOptionalFieldContext } from \"../field/field\"\nimport { HiddenInputBox } from \"../../lib/hidden-input-box\"\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\n\nconst CheckIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function CheckIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-check-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-check-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z\" />\n </svg>\n )\n})\n\nconst MinusIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function MinusIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-minus-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-minus-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M280-440q-17 0-28.5-11.5T240-480q0-17 11.5-28.5T280-520h400q17 0 28.5 11.5T720-480q0 17-11.5 28.5T680-440H280Z\" />\n </svg>\n )\n})\n\nconst useStyles = makeZenithStyles({\n root: {\n ...nativeControl,\n ...shorthands.border(\"1px\", \"solid\", tokens.accentA7),\n backgroundColor: tokens.accentSoft,\n display: \"inline-block\",\n boxSizing: \"border-box\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n borderRadius: tokens.radiusSm,\n // v1 `shadow-xs` — elevation comes from Tailwind's shadow scale, which has no token (B7).\n boxShadow: \"0 1px 2px 0 #0000000d\",\n transitionProperty: \"box-shadow\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n transitionDuration: \"150ms\",\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \":focus-visible\": {\n outlineOffset: \"2px\",\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.focusRing,\n },\n \"&[data-disabled]\": {\n cursor: \"not-allowed\",\n opacity: 0.5,\n ...shorthands.borderColor(tokens.grayA4),\n },\n \"&[aria-invalid='true']\": {\n outlineColor: tokens.focusRing,\n ...shorthands.borderColor(tokens.errorA8),\n },\n \"&[data-indeterminate]\": {\n backgroundColor: tokens.accentA7,\n ...shorthands.borderColor(\"transparent\"),\n color: tokens.accentOnSoft,\n },\n \"&[data-checked]\": {\n backgroundColor: tokens.accentSolid,\n ...shorthands.borderWidth(\"0px\"),\n color: tokens.accentContrast,\n },\n \"&[data-checked] svg, &[data-indeterminate] svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n indicator: {\n ...boxModel,\n display: \"grid\",\n placeContent: \"center\",\n height: \"100%\",\n color: \"currentColor\",\n transitionProperty: \"none\",\n \"& svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n})\n\n/**\n * `checked` and `defaultChecked` accept the same three states as on Radix; Base UI models the third\n * as its own `indeterminate` boolean, which the wrapper sets.\n */\nexport type CheckboxCheckedState = boolean | \"indeterminate\"\n\n/**\n * What `onCheckedChange` receives as its second argument: Base UI's change details, declared in\n * Zenith so that none of Base UI's internals reach the published declarations, where TypeScript 4\n * cannot parse them.\n */\ntype CheckboxCheckedChangeDetails = {\n /** Why the checkbox changed. Base UI reports every checkbox change as `none`. */\n reason: \"none\"\n /** The native event behind the change. */\n event: Event\n /** Keeps the checkbox in its current state. */\n cancel: () => void\n /** Lets the event propagate where the checkbox 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}\n\n/**\n * The checkbox props Base UI adds to a `<button>`'s, declared in Zenith with Base UI's types, apart\n * from the three-state `checked`, `defaultChecked` and `onCheckedChange`, which keep their Radix\n * shape. The root renders a native `<button>`, so the DOM attributes, handlers, `ref`, `key`,\n * `className`, `style` and `value` stay the button's, as they were on Radix; `render`,\n * `nativeButton`, `indeterminate` and `parent` are not part of the surface.\n */\ntype CheckboxRootProps = {\n /**\n * Whether the checkbox is currently checked, or `\"indeterminate\"`.\n *\n * To render an uncontrolled checkbox, use the `defaultChecked` prop instead.\n */\n checked?: CheckboxCheckedState | undefined\n /** Whether the checkbox is initially checked, or `\"indeterminate\"`. */\n defaultChecked?: CheckboxCheckedState | undefined\n /** Whether the component should ignore user interaction. */\n disabled?: boolean | undefined\n /** A ref to access the hidden `<input>` element. */\n inputRef?: React.Ref<HTMLInputElement> | undefined\n /** Identifies the field when a form is submitted. */\n name?: string | undefined\n /**\n * Identifies the form that owns the hidden input.\n * Useful when the checkbox is rendered outside the form.\n */\n form?: string | undefined\n /**\n * Event handler called when the checkbox is checked or unchecked. Clicking an indeterminate\n * checkbox reports `true`.\n */\n onCheckedChange?:\n | ((\n checked: CheckboxCheckedState,\n eventDetails: CheckboxCheckedChangeDetails\n ) => void)\n | undefined\n /** Whether the user should be unable to check or uncheck the checkbox. */\n readOnly?: boolean | undefined\n /** Whether the user must check the checkbox before submitting a form. */\n required?: boolean | undefined\n /**\n * The value submitted with the form when the checkbox is unchecked.\n * By default, unchecked checkboxes do not submit any value, matching native checkbox behavior.\n */\n uncheckedValue?: string | undefined\n}\n\nexport type CheckboxProps = Omit<\n React.ComponentPropsWithRef<\"button\">,\n keyof CheckboxRootProps\n> &\n CheckboxRootProps & {\n /**\n * @deprecated Has no effect. The indicator is the checkbox's only child, so on Radix this\n * rendered the indicator as the checkbox rather than an element of yours. Remove it.\n */\n asChild?: boolean\n }\n\n// Base UI renders a <span> by default and moves the caller's id onto its hidden input. A native\n// button keeps the id, the HTMLButtonElement ref, native disabled and <label for> as Radix had them.\nconst ROOT_ELEMENT = <button />\n\nexport const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(\n function Checkbox(\n {\n className,\n checked,\n defaultChecked,\n onCheckedChange,\n asChild: _asChild,\n value,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const inField = useOptionalFieldContext() !== null\n // Base UI has no third state to start from or to hold uncontrolled, so the state lives here\n // and Base UI is always controlled; a cancelled change leaves it as it was.\n const [uncontrolled, setUncontrolled] =\n React.useState<CheckboxCheckedState>(defaultChecked ?? false)\n const state = checked === undefined ? uncontrolled : checked\n\n const root = (\n <CheckboxPrimitive.Root\n ref={ref}\n nativeButton\n render={ROOT_ELEMENT}\n checked={state === true}\n indeterminate={state === \"indeterminate\"}\n onCheckedChange={(next, details) => {\n onCheckedChange?.(next, details)\n if (!details.isCanceled) setUncontrolled(next)\n }}\n // Radix took the button's value type; Base UI submits a string, so it is converted here\n // the way the button's value attribute stringified it.\n value={value === undefined ? undefined : String(value)}\n data-slot=\"checkbox\"\n {...{ [SLOT_ATTR]: \"checkbox\" }}\n className={mergeClasses(styles.root, className)}\n // Base UI types the root's handlers for its default <span>; the element is the button\n // above, so the caller's button-typed handlers receive exactly the events they declare.\n {...(props as CheckboxPrimitive.Root.Props)}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n {...{ [SLOT_ATTR]: \"checkbox-indicator\" }}\n className={styles.indicator}\n >\n {state === \"indeterminate\" ? <MinusIcon /> : <CheckIcon />}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n\n // A named checkbox's hidden input sits beside the button; the box keeps it in (#132). A Field\n // is positioned already, so inside one the checkbox stays the layout item itself.\n return props.name === undefined || inField ? (\n root\n ) : (\n <HiddenInputBox slot=\"checkbox-box\" layout=\"inline-block\">\n {root}\n </HiddenInputBox>\n )\n }\n)\n"],"names":["CheckIcon","React","props","ref","jsx","SLOT_ATTR","MinusIcon","useStyles","makeZenithStyles","nativeControl","shorthands","tokens.accentA7","tokens.accentSoft","tokens.radiusSm","tokens.focusRing","tokens.grayA4","tokens.errorA8","tokens.accentOnSoft","tokens.accentSolid","tokens.accentContrast","boxModel","ROOT_ELEMENT","Checkbox","className","checked","defaultChecked","onCheckedChange","_asChild","value","styles","inField","useOptionalFieldContext","uncontrolled","setUncontrolled","state","root","CheckboxPrimitive","next","details","mergeClasses","HiddenInputBox"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAYC,EAAM,WAGtB,SAAmBC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G,GAAMC,MAAY;AAClC,UAAAZ,KAAA,QAAAA,EAAkBW,GAAMC,IACnBA,EAAQ,cAAYL,EAAgBI,CAAI;AAAA,QAC/C;AAAA,QAGA,OAAOT,MAAU,SAAY,SAAY,OAAOA,CAAK;AAAA,QACrD,aAAU;AAAA,QACJ,CAACvB,CAAS,GAAG;AAAA,QACnB,WAAWkC,EAAaV,EAAO,MAAMN,CAAS;AAAA,QAG7C,GAAIrB;AAAA,QAEL,UAAA,gBAAAE;AAAA,UAACgC,EAAkB;AAAA,UAAlB;AAAA,YACC,aAAU;AAAA,YACJ,CAAC/B,CAAS,GAAG;AAAA,YACnB,WAAWwB,EAAO;AAAA,YAEjB,gBAAU,kBAAkB,gBAAAzB,EAACE,GAAA,EAAU,sBAAMN,GAAA,CAAA,CAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MAC1D;AAAA,IAAA;AAMJ,WAAOE,EAAM,SAAS,UAAa4B,IACjCK,IAEA,gBAAA/B,EAACoC,GAAA,EAAe,MAAK,gBAAe,QAAO,gBACxC,UAAAL,EAAA,CACH;AAAA,EAEJ;AACF;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as k, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { SLOT_ATTR as t, mergeClasses as b, shorthands as l } from "@epilot/zenith-runtime/v1
|
|
3
|
+
import { SLOT_ATTR as t, mergeClasses as b, shorthands as l } from "@epilot/zenith-runtime/v1";
|
|
4
4
|
import { makeZenithStyles as te } from "../../styles/make-styles.js";
|
|
5
5
|
import { boxModel as a } from "../../styles/host-reset.js";
|
|
6
6
|
import { surfaceContainer as R, spacingElement3 as j, spacingElement2 as h, grayA8 as ie, grayA2 as D, focusRing as le, grayA12 as E, leadingXs as $, textXs as B, fontMono as Y, spacingElement05 as g, grayA11 as ae, fontWeightMedium as ne, surfaceRadiusContainer as re, borderWidthContainer as F, surfaceSep as de, spacingElement1 as ce, borderContainer as se } from "../../tokens/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-block.js","sources":["../../../src/components/code-block/code-block.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1/core\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\nimport { Button } from \"../button/button\"\nimport { highlightCode, splitTokenLines } from \"../../lib/code-highlight\"\nimport { useCodeTokenRenderer } from \"../../lib/code-tokens\"\nimport { gutterDigits } from \"../../lib/code-lines\"\n\n/**\n * Read-only highlighted code. Source is rendered as text, and the focusable `<pre>` keeps\n * horizontal overflow keyboard-accessible.\n */\n\nconst COPY_FEEDBACK_MS = 2000\n\n/** Gutter width in monospace glyphs, shared by every numbered row. */\nconst GUTTER = \"--zenith-code-gutter\"\n\nconst useStyles = makeZenithStyles({\n root: {\n ...boxModel,\n display: \"flex\",\n flexDirection: \"column\",\n minWidth: 0,\n position: \"relative\",\n // The same role recipe Surface's `section` uses, and the same property shapes, so a caller's\n // own border or radius replaces these through `mergeClasses` without a wrapper.\n backgroundColor: tokens.surfaceContainer,\n ...shorthands.borderWidth(tokens.borderWidthContainer),\n ...shorthands.borderStyle(\"solid\"),\n ...shorthands.borderColor(tokens.borderContainer),\n borderRadius: tokens.surfaceRadiusContainer,\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n },\n // Griffel ancestor state selectors must be declared on the ancestor.\n rootCopyReveal: {\n \"&:hover [data-copy-state]\": { opacity: 1 },\n \"&:focus-within [data-copy-state]\": { opacity: 1 },\n },\n header: {\n ...boxModel,\n display: \"flex\",\n alignItems: \"center\",\n ...shorthands.gap(tokens.spacingElement2),\n ...shorthands.paddingBlock(tokens.spacingElement1),\n ...shorthands.paddingInline(tokens.spacingElement2),\n // `borderBottom` expands to the three bottom-edge longhands; there is no per-edge width\n // helper, and a bare `borderBottomWidth: …` alongside a neighbour's `borderWidth` shorthand\n // is exactly the property-shape mismatch AGENTS.md rule 3 warns about.\n ...shorthands.borderBottom(\n tokens.borderWidthContainer,\n \"solid\",\n tokens.surfaceSep\n ),\n },\n // Reserve the overlay button's width when a caption is present.\n headerWithCopy: {\n ...boxModel,\n paddingRight: `calc(1.75rem + ${tokens.spacingElement2} + ${tokens.spacingElement05})`,\n minHeight: `calc(1.75rem + ${tokens.spacingElement05} + ${tokens.spacingElement05})`,\n },\n title: {\n ...boxModel,\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n fontWeight: tokens.fontWeightMedium,\n color: tokens.grayA12,\n minWidth: 0,\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n language: {\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n color: tokens.grayA11,\n // The language label names a machine format, so it stays in the code family rather than\n // inheriting the surrounding UI face.\n fontFamily: tokens.fontMono,\n whiteSpace: \"nowrap\",\n },\n headerSpacer: {\n ...boxModel,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: \"0%\",\n minWidth: 0,\n },\n // The button stays in the tab order while its paint is hidden.\n copy: {\n position: \"absolute\",\n top: tokens.spacingElement05,\n right: tokens.spacingElement05,\n zIndex: 1,\n backgroundColor: tokens.surfaceContainer,\n opacity: 0,\n transitionProperty: \"opacity\",\n transitionDuration: \"120ms\",\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0s\",\n },\n \"@media (hover: none)\": {\n opacity: 1,\n },\n // Focus and feedback must override the hidden resting state.\n \"&[data-copy-state='copied']\": { opacity: 1 },\n \"&[data-copy-state='error']\": { opacity: 1 },\n \"&:focus-visible\": { opacity: 1 },\n },\n pre: {\n ...boxModel,\n ...shorthands.margin(0),\n ...shorthands.padding(tokens.spacingElement2),\n overflowX: \"auto\",\n overflowY: \"auto\",\n fontFamily: tokens.fontMono,\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n color: tokens.grayA12,\n // `tab-size` is what makes a tab-indented source line up at all; 2 matches the indent the\n // editor inserts by default.\n tabSize: 2,\n outlineStyle: \"none\",\n // Declared after the base so the focus ring wins, per the ordering rule in AGENTS.md.\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"-2px\",\n outlineColor: tokens.focusRing,\n },\n },\n // Sticky numbers must pin flush to the scrollport.\n preGutter: {\n ...boxModel,\n paddingLeft: 0,\n },\n preNoWrap: {\n whiteSpace: \"pre\",\n },\n preWrap: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"break-word\",\n },\n code: {\n // `<code>` is inline by default, which collapses the numbered-line grid to one row.\n display: \"block\",\n fontFamily: \"inherit\",\n fontSize: \"inherit\",\n lineHeight: \"inherit\",\n },\n // Give sticky gutters and row bands the full width of unwrapped code.\n codeNoWrap: {\n ...boxModel,\n width: \"max-content\",\n minWidth: \"100%\",\n },\n line: {\n ...boxModel,\n display: \"flex\",\n width: \"100%\",\n // Avoid sticky touch-hover states; paint both cells because the gutter is opaque.\n \"@media (hover: hover)\": {\n [`&:hover [${SLOT_ATTR}='code-block-line-number'], &:hover [${SLOT_ATTR}='code-block-line-content']`]:\n {\n backgroundImage: `linear-gradient(${tokens.grayA2}, ${tokens.grayA2})`,\n },\n },\n },\n lineNumber: {\n // Not selectable, so dragging a selection across the block copies code and not a column of\n // integers. The copy button never sees these at all — it copies the original `code` string.\n userSelect: \"none\",\n textAlign: \"right\",\n flexGrow: 0,\n flexShrink: 0,\n color: tokens.grayA8,\n boxSizing: \"border-box\",\n width: `calc(var(${GUTTER}) + ${tokens.spacingElement2} + ${tokens.spacingElement3})`,\n paddingLeft: tokens.spacingElement2,\n paddingRight: tokens.spacingElement3,\n // Opaque because horizontally scrolled code passes beneath the sticky gutter.\n position: \"sticky\",\n left: 0,\n backgroundColor: tokens.surfaceContainer,\n },\n lineContent: {\n ...boxModel,\n minWidth: 0,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: \"auto\",\n },\n lineContentWrap: {\n overflowWrap: \"break-word\",\n },\n srOnly: {\n ...boxModel,\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n ...shorthands.padding(0),\n ...shorthands.margin(\"-1px\"),\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n whiteSpace: \"nowrap\",\n },\n})\n\nconst CopyIcon = (props: React.ComponentProps<\"svg\">) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n {...props}\n >\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M5 15V5a2 2 0 0 1 2-2h10\" />\n </svg>\n)\n\nconst CheckIcon = (props: React.ComponentProps<\"svg\">) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n {...props}\n >\n <path d=\"m4 12.5 5 5 11-11\" />\n </svg>\n)\n\n/** Idle, or the outcome of the last copy attempt. Drives both the icon and the live region. */\ntype CopyState = \"idle\" | \"copied\" | \"error\"\n\nexport type CodeBlockProps = Omit<\n React.ComponentProps<\"div\">,\n \"children\" | \"title\"\n> & {\n /** The source to display. Rendered as text — never as markup, and never evaluated. */\n code: string\n /** Language grammar used for syntax highlighting, also shown in the header. */\n language?: string\n /**\n * Visible caption, typically a file name. Also names the scrollable code region.\n *\n * This replaces the native `title` attribute, which would have rendered a browser tooltip\n * instead of a caption.\n */\n title?: string\n /** Soft-wrap long lines instead of scrolling horizontally. */\n wrap?: boolean\n /**\n * Render a non-selectable line-number gutter, and give each row a hover band.\n *\n * Off by default. Numbers are wayfinding for prose that refers to a line by number; on a\n * four-line snippet they are a column of noise that also costs horizontal space.\n */\n showLineNumbers?: boolean\n /** Show the copy button. */\n copyable?: boolean\n /** Accessible name of the copy button. */\n copyLabel?: string\n /** Announced, and used as the button's name, after a successful copy. */\n copiedLabel?: string\n /** Announced, and used as the button's name, when the clipboard is unavailable or refuses. */\n copyErrorLabel?: string\n /** Called with the exact string written to the clipboard. */\n onCopy?: (code: string) => void\n /** Called when the clipboard write failed or was unavailable. */\n onCopyError?: (error: unknown) => void\n}\n\nexport const CodeBlock = React.forwardRef<HTMLDivElement, CodeBlockProps>(\n function CodeBlock(\n {\n code,\n language,\n title,\n wrap = false,\n showLineNumbers = false,\n copyable = false,\n copyLabel = \"Copy code\",\n copiedLabel = \"Copied\",\n copyErrorLabel = \"Copy failed\",\n onCopy,\n onCopyError,\n className,\n style,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const reactId = React.useId()\n const titleId = `${reactId}-title`\n\n const [copyState, setCopyState] = React.useState<CopyState>(\"idle\")\n const resetTimer = React.useRef<ReturnType<typeof setTimeout> | null>(null)\n React.useEffect(\n () => () => {\n if (resetTimer.current !== null) clearTimeout(resetTimer.current)\n },\n []\n )\n\n const handleCopy = React.useCallback(async () => {\n // Read the clipboard off `navigator` at click time, never at import or render time: this is\n // the only browser-only access in the component, and an event handler cannot run on a\n // server. A missing or rejecting clipboard is an ordinary outcome here (insecure origin,\n // denied permission, older browser), not an exception to propagate.\n let failure: unknown = null\n try {\n const clipboard =\n typeof navigator === \"undefined\" ? undefined : navigator.clipboard\n if (typeof clipboard?.writeText !== \"function\") {\n failure = new Error(\"Clipboard API unavailable\")\n } else {\n await clipboard.writeText(code)\n }\n } catch (error) {\n failure = error ?? new Error(\"Clipboard write rejected\")\n }\n\n if (failure === null) onCopy?.(code)\n else onCopyError?.(failure)\n\n setCopyState(failure === null ? \"copied\" : \"error\")\n if (resetTimer.current !== null) clearTimeout(resetTimer.current)\n resetTimer.current = setTimeout(() => {\n resetTimer.current = null\n setCopyState(\"idle\")\n }, COPY_FEEDBACK_MS)\n }, [code, onCopy, onCopyError])\n\n // One trailing newline is an artefact of how source files end, not a line the reader should\n // see numbered and empty. The clipboard still gets `code` byte for byte.\n const displayed = code.endsWith(\"\\n\") ? code.slice(0, -1) : code\n const renderTokens = useCodeTokenRenderer()\n\n // Tokenized once per (source, language). Synchronous by construction, so the server render and\n // the first client render produce identical markup and hydration has nothing to reconcile.\n const highlighted = React.useMemo(\n () => highlightCode(displayed, language),\n [displayed, language]\n )\n\n // Two shapes, because the gutter needs rows: a plain string or a token run when there are no\n // line numbers, and one entry per line when there are.\n const plainLines = React.useMemo(\n () => (showLineNumbers ? displayed.split(\"\\n\") : null),\n [displayed, showLineNumbers]\n )\n const tokenLines = React.useMemo(\n () =>\n showLineNumbers && highlighted !== null\n ? splitTokenLines(highlighted)\n : null,\n [highlighted, showLineNumbers]\n )\n\n // An empty string is not a caption. Normalised once, so the header, the caption element and\n // the region's name can never disagree about whether there is one — labelling the region by an\n // empty caption would name it with nothing, which is worse than leaving it unnamed.\n const hasTitle = title !== undefined && title !== \"\"\n const hasLanguage = language !== undefined && language !== \"\"\n\n const ariaLabel = props[\"aria-label\"]\n const ariaLabelledBy = props[\"aria-labelledby\"]\n // A region needs a name. Prefer the caption the reader can see, then whatever the caller\n // supplied; with none of the three, stay focusable but claim no landmark.\n const labelledBy = hasTitle ? titleId : ariaLabelledBy\n const named = labelledBy !== undefined || ariaLabel !== undefined\n\n const copyStatusLabel =\n copyState === \"copied\"\n ? copiedLabel\n : copyState === \"error\"\n ? copyErrorLabel\n : copyLabel\n\n // A header exists for content. A copy button is an overlay and does not summon one — that is\n // what lets `<CodeBlock code copyable />` reserve no vertical space for chrome at all.\n const showHeader = hasTitle || hasLanguage\n\n const gutterStyle =\n plainLines === null\n ? style\n : ({\n [GUTTER]: `${gutterDigits(plainLines.length)}ch`,\n ...style,\n } as React.CSSProperties)\n\n return (\n <div\n ref={ref}\n data-slot=\"code-block\"\n {...{ [SLOT_ATTR]: \"code-block\" }}\n data-language={language}\n className={mergeClasses(\n styles.root,\n copyable ? styles.rootCopyReveal : undefined,\n className\n )}\n style={gutterStyle}\n {...props}\n aria-label={undefined}\n aria-labelledby={undefined}\n >\n {showHeader ? (\n <div\n data-slot=\"code-block-header\"\n {...{ [SLOT_ATTR]: \"code-block-header\" }}\n className={mergeClasses(\n styles.header,\n copyable ? styles.headerWithCopy : undefined\n )}\n >\n {hasTitle ? (\n <span\n id={titleId}\n data-slot=\"code-block-title\"\n {...{ [SLOT_ATTR]: \"code-block-title\" }}\n className={styles.title}\n >\n {title}\n </span>\n ) : null}\n {hasLanguage ? (\n <span\n data-slot=\"code-block-language\"\n {...{ [SLOT_ATTR]: \"code-block-language\" }}\n className={styles.language}\n >\n {language}\n </span>\n ) : null}\n <span className={styles.headerSpacer} />\n </div>\n ) : null}\n\n {copyable ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n // Button keeps its OWN slot markers, the way Callout leaves the ClearButton it\n // composes alone: a Button stays a Button, and a rule written against the button\n // slot must still reach this one. `data-copy-state` is the handle for this\n // button specifically, and it carries the state a caller would want to select on.\n data-copy-state={copyState}\n aria-label={copyStatusLabel}\n className={styles.copy}\n onClick={handleCopy}\n >\n {copyState === \"copied\" ? <CheckIcon /> : <CopyIcon />}\n </Button>\n ) : null}\n\n <pre\n data-slot=\"code-block-content\"\n {...{ [SLOT_ATTR]: \"code-block-content\" }}\n // Always reachable: this is the scroll container, and a pointer must not be the only\n // way to scroll it.\n tabIndex={0}\n role={named ? \"region\" : undefined}\n aria-label={ariaLabel}\n aria-labelledby={labelledBy}\n className={mergeClasses(\n styles.pre,\n plainLines === null ? undefined : styles.preGutter,\n wrap ? styles.preWrap : styles.preNoWrap\n )}\n >\n <code\n data-slot=\"code-block-code\"\n {...{ [SLOT_ATTR]: \"code-block-code\" }}\n className={mergeClasses(\n styles.code,\n plainLines !== null && !wrap ? styles.codeNoWrap : undefined\n )}\n >\n {plainLines === null\n ? // No gutter: one run, highlighted if we have a grammar, otherwise the raw string.\n highlighted === null\n ? displayed\n : renderTokens(highlighted)\n : plainLines.map((line, index) => (\n <span\n // Lines have no identity beyond their position, and the whole block\n // re-renders when `code` changes, so the index is the key.\n key={index}\n data-slot=\"code-block-line\"\n {...{ [SLOT_ATTR]: \"code-block-line\" }}\n data-line={index + 1}\n className={styles.line}\n >\n <span\n aria-hidden=\"true\"\n data-slot=\"code-block-line-number\"\n {...{ [SLOT_ATTR]: \"code-block-line-number\" }}\n className={styles.lineNumber}\n >\n {index + 1}\n </span>\n <span\n data-slot=\"code-block-line-content\"\n {...{ [SLOT_ATTR]: \"code-block-line-content\" }}\n className={mergeClasses(\n styles.lineContent,\n wrap ? styles.lineContentWrap : undefined\n )}\n >\n {/* `tokenLines` is the same text as `plainLines`, split by the same\n newlines — `splitTokenLines` round-trips — so the row count matches and\n the index is safe. Falls back to the plain line when there is no\n grammar. */}\n {tokenLines === null\n ? line\n : renderTokens(tokenLines[index] ?? [])}\n {/* The newline keeps a dragged selection line-separated, exactly as the\n unnumbered rendering is. */}\n {\"\\n\"}\n </span>\n </span>\n ))}\n </code>\n </pre>\n\n {copyable ? (\n <span\n role=\"status\"\n aria-live=\"polite\"\n data-slot=\"code-block-copy-status\"\n {...{ [SLOT_ATTR]: \"code-block-copy-status\" }}\n className={styles.srOnly}\n >\n {copyState === \"idle\" ? \"\" : copyStatusLabel}\n </span>\n ) : null}\n </div>\n )\n }\n)\n"],"names":["COPY_FEEDBACK_MS","GUTTER","useStyles","makeZenithStyles","boxModel","tokens.surfaceContainer","shorthands","tokens.borderWidthContainer","tokens.borderContainer","tokens.surfaceRadiusContainer","tokens.spacingElement2","tokens.spacingElement1","tokens.surfaceSep","tokens.spacingElement05","tokens.textXs","tokens.leadingXs","tokens.fontWeightMedium","tokens.grayA12","tokens.grayA11","tokens.fontMono","tokens.focusRing","SLOT_ATTR","tokens.grayA2","tokens.grayA8","tokens.spacingElement3","CopyIcon","props","jsxs","jsx","CheckIcon","CodeBlock","React","code","language","title","wrap","showLineNumbers","copyable","copyLabel","copiedLabel","copyErrorLabel","onCopy","onCopyError","className","style","ref","styles","titleId","copyState","setCopyState","resetTimer","handleCopy","failure","clipboard","error","displayed","renderTokens","useCodeTokenRenderer","highlighted","highlightCode","plainLines","tokenLines","splitTokenLines","hasTitle","hasLanguage","ariaLabel","ariaLabelledBy","labelledBy","named","copyStatusLabel","showHeader","gutterStyle","gutterDigits","mergeClasses","Button","line","index"],"mappings":";;;;;;;;;;AAkBA,MAAMA,KAAmB,KAGnBC,IAAS,wBAETC,KAAYC,GAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,GAAGC;AAAA,IACH,SAAS;AAAA,IACT,eAAe;AAAA,IACf,UAAU;AAAA,IACV,UAAU;AAAA;AAAA;AAAA,IAGV,iBAAiBC;AAAAA,IACjB,GAAGC,EAAW,YAAYC,CAA2B;AAAA,IACrD,GAAGD,EAAW,YAAY,OAAO;AAAA,IACjC,GAAGA,EAAW,YAAYE,EAAsB;AAAA,IAChD,cAAcC;AAAAA,IACd,WAAW;AAAA,IACX,WAAW;AAAA,EAAA;AAAA;AAAA,EAGb,gBAAgB;AAAA,IACd,6BAA6B,EAAE,SAAS,EAAA;AAAA,IACxC,oCAAoC,EAAE,SAAS,EAAA;AAAA,EAAE;AAAA,EAEnD,QAAQ;AAAA,IACN,GAAGL;AAAA,IACH,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,GAAGE,EAAW,IAAII,CAAsB;AAAA,IACxC,GAAGJ,EAAW,aAAaK,EAAsB;AAAA,IACjD,GAAGL,EAAW,cAAcI,CAAsB;AAAA;AAAA;AAAA;AAAA,IAIlD,GAAGJ,EAAW;AAAA,MACZC;AAAAA,MACA;AAAA,MACAK;AAAAA,IAAO;AAAA,EACT;AAAA;AAAA,EAGF,gBAAgB;AAAA,IACd,GAAGR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AA,cACnB,WAAWyB,EAAO;AAAA,cAEjB,UAAAE,MAAc,SAAS,KAAKqB;AAAA,YAAA;AAAA,UAAA,IAE7B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
|
|
1
|
+
{"version":3,"file":"code-block.js","sources":["../../../src/components/code-block/code-block.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\nimport { Button } from \"../button/button\"\nimport { highlightCode, splitTokenLines } from \"../../lib/code-highlight\"\nimport { useCodeTokenRenderer } from \"../../lib/code-tokens\"\nimport { gutterDigits } from \"../../lib/code-lines\"\n\n/**\n * Read-only highlighted code. Source is rendered as text, and the focusable `<pre>` keeps\n * horizontal overflow keyboard-accessible.\n */\n\nconst COPY_FEEDBACK_MS = 2000\n\n/** Gutter width in monospace glyphs, shared by every numbered row. */\nconst GUTTER = \"--zenith-code-gutter\"\n\nconst useStyles = makeZenithStyles({\n root: {\n ...boxModel,\n display: \"flex\",\n flexDirection: \"column\",\n minWidth: 0,\n position: \"relative\",\n // The same role recipe Surface's `section` uses, and the same property shapes, so a caller's\n // own border or radius replaces these through `mergeClasses` without a wrapper.\n backgroundColor: tokens.surfaceContainer,\n ...shorthands.borderWidth(tokens.borderWidthContainer),\n ...shorthands.borderStyle(\"solid\"),\n ...shorthands.borderColor(tokens.borderContainer),\n borderRadius: tokens.surfaceRadiusContainer,\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n },\n // Griffel ancestor state selectors must be declared on the ancestor.\n rootCopyReveal: {\n \"&:hover [data-copy-state]\": { opacity: 1 },\n \"&:focus-within [data-copy-state]\": { opacity: 1 },\n },\n header: {\n ...boxModel,\n display: \"flex\",\n alignItems: \"center\",\n ...shorthands.gap(tokens.spacingElement2),\n ...shorthands.paddingBlock(tokens.spacingElement1),\n ...shorthands.paddingInline(tokens.spacingElement2),\n // `borderBottom` expands to the three bottom-edge longhands; there is no per-edge width\n // helper, and a bare `borderBottomWidth: …` alongside a neighbour's `borderWidth` shorthand\n // is exactly the property-shape mismatch AGENTS.md rule 3 warns about.\n ...shorthands.borderBottom(\n tokens.borderWidthContainer,\n \"solid\",\n tokens.surfaceSep\n ),\n },\n // Reserve the overlay button's width when a caption is present.\n headerWithCopy: {\n ...boxModel,\n paddingRight: `calc(1.75rem + ${tokens.spacingElement2} + ${tokens.spacingElement05})`,\n minHeight: `calc(1.75rem + ${tokens.spacingElement05} + ${tokens.spacingElement05})`,\n },\n title: {\n ...boxModel,\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n fontWeight: tokens.fontWeightMedium,\n color: tokens.grayA12,\n minWidth: 0,\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n language: {\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n color: tokens.grayA11,\n // The language label names a machine format, so it stays in the code family rather than\n // inheriting the surrounding UI face.\n fontFamily: tokens.fontMono,\n whiteSpace: \"nowrap\",\n },\n headerSpacer: {\n ...boxModel,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: \"0%\",\n minWidth: 0,\n },\n // The button stays in the tab order while its paint is hidden.\n copy: {\n position: \"absolute\",\n top: tokens.spacingElement05,\n right: tokens.spacingElement05,\n zIndex: 1,\n backgroundColor: tokens.surfaceContainer,\n opacity: 0,\n transitionProperty: \"opacity\",\n transitionDuration: \"120ms\",\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0s\",\n },\n \"@media (hover: none)\": {\n opacity: 1,\n },\n // Focus and feedback must override the hidden resting state.\n \"&[data-copy-state='copied']\": { opacity: 1 },\n \"&[data-copy-state='error']\": { opacity: 1 },\n \"&:focus-visible\": { opacity: 1 },\n },\n pre: {\n ...boxModel,\n ...shorthands.margin(0),\n ...shorthands.padding(tokens.spacingElement2),\n overflowX: \"auto\",\n overflowY: \"auto\",\n fontFamily: tokens.fontMono,\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n color: tokens.grayA12,\n // `tab-size` is what makes a tab-indented source line up at all; 2 matches the indent the\n // editor inserts by default.\n tabSize: 2,\n outlineStyle: \"none\",\n // Declared after the base so the focus ring wins, per the ordering rule in AGENTS.md.\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"-2px\",\n outlineColor: tokens.focusRing,\n },\n },\n // Sticky numbers must pin flush to the scrollport.\n preGutter: {\n ...boxModel,\n paddingLeft: 0,\n },\n preNoWrap: {\n whiteSpace: \"pre\",\n },\n preWrap: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"break-word\",\n },\n code: {\n // `<code>` is inline by default, which collapses the numbered-line grid to one row.\n display: \"block\",\n fontFamily: \"inherit\",\n fontSize: \"inherit\",\n lineHeight: \"inherit\",\n },\n // Give sticky gutters and row bands the full width of unwrapped code.\n codeNoWrap: {\n ...boxModel,\n width: \"max-content\",\n minWidth: \"100%\",\n },\n line: {\n ...boxModel,\n display: \"flex\",\n width: \"100%\",\n // Avoid sticky touch-hover states; paint both cells because the gutter is opaque.\n \"@media (hover: hover)\": {\n [`&:hover [${SLOT_ATTR}='code-block-line-number'], &:hover [${SLOT_ATTR}='code-block-line-content']`]:\n {\n backgroundImage: `linear-gradient(${tokens.grayA2}, ${tokens.grayA2})`,\n },\n },\n },\n lineNumber: {\n // Not selectable, so dragging a selection across the block copies code and not a column of\n // integers. The copy button never sees these at all — it copies the original `code` string.\n userSelect: \"none\",\n textAlign: \"right\",\n flexGrow: 0,\n flexShrink: 0,\n color: tokens.grayA8,\n boxSizing: \"border-box\",\n width: `calc(var(${GUTTER}) + ${tokens.spacingElement2} + ${tokens.spacingElement3})`,\n paddingLeft: tokens.spacingElement2,\n paddingRight: tokens.spacingElement3,\n // Opaque because horizontally scrolled code passes beneath the sticky gutter.\n position: \"sticky\",\n left: 0,\n backgroundColor: tokens.surfaceContainer,\n },\n lineContent: {\n ...boxModel,\n minWidth: 0,\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: \"auto\",\n },\n lineContentWrap: {\n overflowWrap: \"break-word\",\n },\n srOnly: {\n ...boxModel,\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n ...shorthands.padding(0),\n ...shorthands.margin(\"-1px\"),\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n whiteSpace: \"nowrap\",\n },\n})\n\nconst CopyIcon = (props: React.ComponentProps<\"svg\">) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n {...props}\n >\n <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n <path d=\"M5 15V5a2 2 0 0 1 2-2h10\" />\n </svg>\n)\n\nconst CheckIcon = (props: React.ComponentProps<\"svg\">) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n {...props}\n >\n <path d=\"m4 12.5 5 5 11-11\" />\n </svg>\n)\n\n/** Idle, or the outcome of the last copy attempt. Drives both the icon and the live region. */\ntype CopyState = \"idle\" | \"copied\" | \"error\"\n\nexport type CodeBlockProps = Omit<\n React.ComponentProps<\"div\">,\n \"children\" | \"title\"\n> & {\n /** The source to display. Rendered as text — never as markup, and never evaluated. */\n code: string\n /** Language grammar used for syntax highlighting, also shown in the header. */\n language?: string\n /**\n * Visible caption, typically a file name. Also names the scrollable code region.\n *\n * This replaces the native `title` attribute, which would have rendered a browser tooltip\n * instead of a caption.\n */\n title?: string\n /** Soft-wrap long lines instead of scrolling horizontally. */\n wrap?: boolean\n /**\n * Render a non-selectable line-number gutter, and give each row a hover band.\n *\n * Off by default. Numbers are wayfinding for prose that refers to a line by number; on a\n * four-line snippet they are a column of noise that also costs horizontal space.\n */\n showLineNumbers?: boolean\n /** Show the copy button. */\n copyable?: boolean\n /** Accessible name of the copy button. */\n copyLabel?: string\n /** Announced, and used as the button's name, after a successful copy. */\n copiedLabel?: string\n /** Announced, and used as the button's name, when the clipboard is unavailable or refuses. */\n copyErrorLabel?: string\n /** Called with the exact string written to the clipboard. */\n onCopy?: (code: string) => void\n /** Called when the clipboard write failed or was unavailable. */\n onCopyError?: (error: unknown) => void\n}\n\nexport const CodeBlock = React.forwardRef<HTMLDivElement, CodeBlockProps>(\n function CodeBlock(\n {\n code,\n language,\n title,\n wrap = false,\n showLineNumbers = false,\n copyable = false,\n copyLabel = \"Copy code\",\n copiedLabel = \"Copied\",\n copyErrorLabel = \"Copy failed\",\n onCopy,\n onCopyError,\n className,\n style,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const reactId = React.useId()\n const titleId = `${reactId}-title`\n\n const [copyState, setCopyState] = React.useState<CopyState>(\"idle\")\n const resetTimer = React.useRef<ReturnType<typeof setTimeout> | null>(null)\n React.useEffect(\n () => () => {\n if (resetTimer.current !== null) clearTimeout(resetTimer.current)\n },\n []\n )\n\n const handleCopy = React.useCallback(async () => {\n // Read the clipboard off `navigator` at click time, never at import or render time: this is\n // the only browser-only access in the component, and an event handler cannot run on a\n // server. A missing or rejecting clipboard is an ordinary outcome here (insecure origin,\n // denied permission, older browser), not an exception to propagate.\n let failure: unknown = null\n try {\n const clipboard =\n typeof navigator === \"undefined\" ? undefined : navigator.clipboard\n if (typeof clipboard?.writeText !== \"function\") {\n failure = new Error(\"Clipboard API unavailable\")\n } else {\n await clipboard.writeText(code)\n }\n } catch (error) {\n failure = error ?? new Error(\"Clipboard write rejected\")\n }\n\n if (failure === null) onCopy?.(code)\n else onCopyError?.(failure)\n\n setCopyState(failure === null ? \"copied\" : \"error\")\n if (resetTimer.current !== null) clearTimeout(resetTimer.current)\n resetTimer.current = setTimeout(() => {\n resetTimer.current = null\n setCopyState(\"idle\")\n }, COPY_FEEDBACK_MS)\n }, [code, onCopy, onCopyError])\n\n // One trailing newline is an artefact of how source files end, not a line the reader should\n // see numbered and empty. The clipboard still gets `code` byte for byte.\n const displayed = code.endsWith(\"\\n\") ? code.slice(0, -1) : code\n const renderTokens = useCodeTokenRenderer()\n\n // Tokenized once per (source, language). Synchronous by construction, so the server render and\n // the first client render produce identical markup and hydration has nothing to reconcile.\n const highlighted = React.useMemo(\n () => highlightCode(displayed, language),\n [displayed, language]\n )\n\n // Two shapes, because the gutter needs rows: a plain string or a token run when there are no\n // line numbers, and one entry per line when there are.\n const plainLines = React.useMemo(\n () => (showLineNumbers ? displayed.split(\"\\n\") : null),\n [displayed, showLineNumbers]\n )\n const tokenLines = React.useMemo(\n () =>\n showLineNumbers && highlighted !== null\n ? splitTokenLines(highlighted)\n : null,\n [highlighted, showLineNumbers]\n )\n\n // An empty string is not a caption. Normalised once, so the header, the caption element and\n // the region's name can never disagree about whether there is one — labelling the region by an\n // empty caption would name it with nothing, which is worse than leaving it unnamed.\n const hasTitle = title !== undefined && title !== \"\"\n const hasLanguage = language !== undefined && language !== \"\"\n\n const ariaLabel = props[\"aria-label\"]\n const ariaLabelledBy = props[\"aria-labelledby\"]\n // A region needs a name. Prefer the caption the reader can see, then whatever the caller\n // supplied; with none of the three, stay focusable but claim no landmark.\n const labelledBy = hasTitle ? titleId : ariaLabelledBy\n const named = labelledBy !== undefined || ariaLabel !== undefined\n\n const copyStatusLabel =\n copyState === \"copied\"\n ? copiedLabel\n : copyState === \"error\"\n ? copyErrorLabel\n : copyLabel\n\n // A header exists for content. A copy button is an overlay and does not summon one — that is\n // what lets `<CodeBlock code copyable />` reserve no vertical space for chrome at all.\n const showHeader = hasTitle || hasLanguage\n\n const gutterStyle =\n plainLines === null\n ? style\n : ({\n [GUTTER]: `${gutterDigits(plainLines.length)}ch`,\n ...style,\n } as React.CSSProperties)\n\n return (\n <div\n ref={ref}\n data-slot=\"code-block\"\n {...{ [SLOT_ATTR]: \"code-block\" }}\n data-language={language}\n className={mergeClasses(\n styles.root,\n copyable ? styles.rootCopyReveal : undefined,\n className\n )}\n style={gutterStyle}\n {...props}\n aria-label={undefined}\n aria-labelledby={undefined}\n >\n {showHeader ? (\n <div\n data-slot=\"code-block-header\"\n {...{ [SLOT_ATTR]: \"code-block-header\" }}\n className={mergeClasses(\n styles.header,\n copyable ? styles.headerWithCopy : undefined\n )}\n >\n {hasTitle ? (\n <span\n id={titleId}\n data-slot=\"code-block-title\"\n {...{ [SLOT_ATTR]: \"code-block-title\" }}\n className={styles.title}\n >\n {title}\n </span>\n ) : null}\n {hasLanguage ? (\n <span\n data-slot=\"code-block-language\"\n {...{ [SLOT_ATTR]: \"code-block-language\" }}\n className={styles.language}\n >\n {language}\n </span>\n ) : null}\n <span className={styles.headerSpacer} />\n </div>\n ) : null}\n\n {copyable ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n // Button keeps its OWN slot markers, the way Callout leaves the ClearButton it\n // composes alone: a Button stays a Button, and a rule written against the button\n // slot must still reach this one. `data-copy-state` is the handle for this\n // button specifically, and it carries the state a caller would want to select on.\n data-copy-state={copyState}\n aria-label={copyStatusLabel}\n className={styles.copy}\n onClick={handleCopy}\n >\n {copyState === \"copied\" ? <CheckIcon /> : <CopyIcon />}\n </Button>\n ) : null}\n\n <pre\n data-slot=\"code-block-content\"\n {...{ [SLOT_ATTR]: \"code-block-content\" }}\n // Always reachable: this is the scroll container, and a pointer must not be the only\n // way to scroll it.\n tabIndex={0}\n role={named ? \"region\" : undefined}\n aria-label={ariaLabel}\n aria-labelledby={labelledBy}\n className={mergeClasses(\n styles.pre,\n plainLines === null ? undefined : styles.preGutter,\n wrap ? styles.preWrap : styles.preNoWrap\n )}\n >\n <code\n data-slot=\"code-block-code\"\n {...{ [SLOT_ATTR]: \"code-block-code\" }}\n className={mergeClasses(\n styles.code,\n plainLines !== null && !wrap ? styles.codeNoWrap : undefined\n )}\n >\n {plainLines === null\n ? // No gutter: one run, highlighted if we have a grammar, otherwise the raw string.\n highlighted === null\n ? displayed\n : renderTokens(highlighted)\n : plainLines.map((line, index) => (\n <span\n // Lines have no identity beyond their position, and the whole block\n // re-renders when `code` changes, so the index is the key.\n key={index}\n data-slot=\"code-block-line\"\n {...{ [SLOT_ATTR]: \"code-block-line\" }}\n data-line={index + 1}\n className={styles.line}\n >\n <span\n aria-hidden=\"true\"\n data-slot=\"code-block-line-number\"\n {...{ [SLOT_ATTR]: \"code-block-line-number\" }}\n className={styles.lineNumber}\n >\n {index + 1}\n </span>\n <span\n data-slot=\"code-block-line-content\"\n {...{ [SLOT_ATTR]: \"code-block-line-content\" }}\n className={mergeClasses(\n styles.lineContent,\n wrap ? styles.lineContentWrap : undefined\n )}\n >\n {/* `tokenLines` is the same text as `plainLines`, split by the same\n newlines — `splitTokenLines` round-trips — so the row count matches and\n the index is safe. Falls back to the plain line when there is no\n grammar. */}\n {tokenLines === null\n ? line\n : renderTokens(tokenLines[index] ?? [])}\n {/* The newline keeps a dragged selection line-separated, exactly as the\n unnumbered rendering is. */}\n {\"\\n\"}\n </span>\n </span>\n ))}\n </code>\n </pre>\n\n {copyable ? (\n <span\n role=\"status\"\n aria-live=\"polite\"\n data-slot=\"code-block-copy-status\"\n {...{ [SLOT_ATTR]: \"code-block-copy-status\" }}\n className={styles.srOnly}\n >\n {copyState === \"idle\" ? \"\" : copyStatusLabel}\n </span>\n ) : null}\n </div>\n )\n }\n)\n"],"names":["COPY_FEEDBACK_MS","GUTTER","useStyles","makeZenithStyles","boxModel","tokens.surfaceContainer","shorthands","tokens.borderWidthContainer","tokens.borderContainer","tokens.surfaceRadiusContainer","tokens.spacingElement2","tokens.spacingElement1","tokens.surfaceSep","tokens.spacingElement05","tokens.textXs","tokens.leadingXs","tokens.fontWeightMedium","tokens.grayA12","tokens.grayA11","tokens.fontMono","tokens.focusRing","SLOT_ATTR","tokens.grayA2","tokens.grayA8","tokens.spacingElement3","CopyIcon","props","jsxs","jsx","CheckIcon","CodeBlock","React","code","language","title","wrap","showLineNumbers","copyable","copyLabel","copiedLabel","copyErrorLabel","onCopy","onCopyError","className","style","ref","styles","titleId","copyState","setCopyState","resetTimer","handleCopy","failure","clipboard","error","displayed","renderTokens","useCodeTokenRenderer","highlighted","highlightCode","plainLines","tokenLines","splitTokenLines","hasTitle","hasLanguage","ariaLabel","ariaLabelledBy","labelledBy","named","copyStatusLabel","showHeader","gutterStyle","gutterDigits","mergeClasses","Button","line","index"],"mappings":";;;;;;;;;;AAkBA,MAAMA,KAAmB,KAGnBC,IAAS,wBAETC,KAAYC,GAAiB;AAAA,EACjC,MAAM;AAAA,IACJ,GAAGC;AAAA,IACH,SAAS;AAAA,IACT,eAAe;AAAA,IACf,UAAU;AAAA,IACV,UAAU;AAAA;AAAA;AAAA,IAGV,iBAAiBC;AAAAA,IACjB,GAAGC,EAAW,YAAYC,CAA2B;AAAA,IACrD,GAAGD,EAAW,YAAY,OAAO;AAAA,IACjC,GAAGA,EAAW,YAAYE,EAAsB;AAAA,IAChD,cAAcC;AAAAA,IACd,WAAW;AAAA,IACX,WAAW;AAAA,EAAA;AAAA;AAAA,EAGb,gBAAgB;AAAA,IACd,6BAA6B,EAAE,SAAS,EAAA;AAAA,IACxC,oCAAoC,EAAE,SAAS,EAAA;AAAA,EAAE;AAAA,EAEnD,QAAQ;AAAA,IACN,GAAGL;AAAA,IACH,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,GAAGE,EAAW,IAAII,CAAsB;AAAA,IACxC,GAAGJ,EAAW,aAAaK,EAAsB;AAAA,IACjD,GAAGL,EAAW,cAAcI,CAAsB;AAAA;AAAA;AAAA;AAAA,IAIlD,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C,gBAAAT;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,aAAU;AAAA,cACV,aAAU;AAAA,cACJ,CAACP,CAAS,GAAG;AAAA,cACnB,WAAWyB,EAAO;AAAA,cAEjB,UAAAE,MAAc,SAAS,KAAKqB;AAAA,YAAA;AAAA,UAAA,IAE7B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as Y, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
|
-
import { mergeClasses as m, SLOT_ATTR as c, shorthands as l } from "@epilot/zenith-runtime/v1
|
|
3
|
+
import { mergeClasses as m, SLOT_ATTR as c, shorthands as l } from "@epilot/zenith-runtime/v1";
|
|
4
4
|
import { makeZenithStyles as lt } from "../../styles/make-styles.js";
|
|
5
5
|
import { boxModel as p, nativeControl as at } from "../../styles/host-reset.js";
|
|
6
6
|
import { leadingXs as ae, spacingElement2 as x, surfaceField as ie, spacingElement05 as We, info11 as st, warning11 as ct, error11 as dt, infoUi as ut, warningUi as ft, errorUi as Te, grayA12 as j, spacingElement3 as ne, grayA8 as le, grayA2 as Re, fontMono as Ie, accentA5 as ht, fontWeightNormal as gt, trackingNormal as mt, textXs as pt, grayA3 as $e, focusRing as vt, surfaceRadiusField as bt, borderField as yt, borderWidthField as kt } from "../../tokens/index.js";
|