@tightknitai/block-kitchen 0.10.6 → 0.10.7

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/dist/index.js CHANGED
@@ -3846,66 +3846,65 @@ function Palette({
3846
3846
  isSheet ? "w-full flex-1 bg-background" : "w-72 shrink-0 border-r bg-muted/20"
3847
3847
  ),
3848
3848
  children: [
3849
- offersSimple || searchVisible ? /* @__PURE__ */ jsxs(
3850
- "div",
3851
- {
3852
- className: cn(
3853
- "sticky top-0 z-10 flex flex-col gap-2 border-b px-3 pt-3 pb-2 backdrop-blur",
3854
- isSheet ? "bg-background" : "bg-muted/20"
3855
- ),
3856
- children: [
3857
- offersSimple ? (
3858
- // Titled row: with the sections gone, simple mode's header would
3859
- // otherwise be a lone right-aligned link over empty space, and
3860
- // nothing would name what the rail below it holds.
3861
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
3862
- /* @__PURE__ */ jsx(
3863
- "span",
3864
- {
3865
- className: cn(
3866
- "min-w-0 truncate font-medium uppercase tracking-wide text-muted-foreground",
3867
- isSheet ? "text-xs" : "text-[11px]"
3868
- ),
3869
- children: PALETTE_TITLE
3870
- }
3871
- ),
3872
- /* @__PURE__ */ jsx(
3873
- ModeLink,
3874
- {
3875
- advanced,
3876
- isSheet,
3877
- onToggle: () => {
3878
- setQuery("");
3879
- setAdvancedOpen((v) => !v);
3880
- }
3881
- }
3882
- )
3883
- ] })
3884
- ) : null,
3885
- searchVisible ? /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3849
+ offersSimple || searchVisible ? (
3850
+ // Two elements so the header is opaque *and* the exact color of the
3851
+ // rail. Painted with the rail's own `bg-muted/20`, it composited over
3852
+ // the scrolled list instead and headings read through the search box
3853
+ // (a `backdrop-blur` softened them, it didn't hide them). Restoring
3854
+ // the `bg-background` base under the tint rebuilds the rail's own two
3855
+ // layers, so the match holds under any theme.
3856
+ /* @__PURE__ */ jsx("div", { className: "sticky top-0 z-10 shrink-0 bg-background", children: /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2 border-b px-3 pt-3 pb-2", isSheet ? "bg-background" : "bg-muted/20"), children: [
3857
+ offersSimple ? (
3858
+ // Titled row: with the sections gone, simple mode's header would
3859
+ // otherwise be a lone right-aligned link over empty space, and
3860
+ // nothing would name what the rail below it holds.
3861
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
3886
3862
  /* @__PURE__ */ jsx(
3887
- Search,
3863
+ "span",
3888
3864
  {
3889
3865
  className: cn(
3890
- "pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground",
3891
- isSheet ? "h-4 w-4" : "h-3.5 w-3.5"
3892
- )
3866
+ "min-w-0 truncate font-medium uppercase tracking-wide text-muted-foreground",
3867
+ isSheet ? "text-xs" : "text-[11px]"
3868
+ ),
3869
+ children: PALETTE_TITLE
3893
3870
  }
3894
3871
  ),
3895
3872
  /* @__PURE__ */ jsx(
3896
- Input,
3873
+ ModeLink,
3897
3874
  {
3898
- type: "search",
3899
- value: query,
3900
- onChange: (e) => setQuery(e.target.value),
3901
- placeholder: searchPlaceholder,
3902
- "aria-label": searchPlaceholder,
3903
- className: cn(isSheet ? "h-10 pl-8 text-base" : "h-8 pl-7 text-sm")
3875
+ advanced,
3876
+ isSheet,
3877
+ onToggle: () => {
3878
+ setQuery("");
3879
+ setAdvancedOpen((v) => !v);
3880
+ }
3904
3881
  }
3905
3882
  )
3906
- ] }) : null
3907
- ]
3908
- }
3883
+ ] })
3884
+ ) : null,
3885
+ searchVisible ? /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3886
+ /* @__PURE__ */ jsx(
3887
+ Search,
3888
+ {
3889
+ className: cn(
3890
+ "pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground",
3891
+ isSheet ? "h-4 w-4" : "h-3.5 w-3.5"
3892
+ )
3893
+ }
3894
+ ),
3895
+ /* @__PURE__ */ jsx(
3896
+ Input,
3897
+ {
3898
+ type: "search",
3899
+ value: query,
3900
+ onChange: (e) => setQuery(e.target.value),
3901
+ placeholder: searchPlaceholder,
3902
+ "aria-label": searchPlaceholder,
3903
+ className: cn(isSheet ? "h-10 pl-8 text-base" : "h-8 pl-7 text-sm")
3904
+ }
3905
+ )
3906
+ ] }) : null
3907
+ ] }) })
3909
3908
  ) : null,
3910
3909
  /* @__PURE__ */ jsx("div", { className: cn("flex flex-col", isSheet ? "px-2 pb-6" : "p-3"), children: !advanced ? (
3911
3910
  // Simple mode: a flat list, no section headings — with this few
@@ -10121,18 +10120,29 @@ function Toolbar2({
10121
10120
  size: "sm",
10122
10121
  onClick: onClear,
10123
10122
  disabled: !canClear,
10124
- className: "hover:bg-destructive/10 hover:text-destructive",
10123
+ className: "group gap-0 hover:bg-destructive/10 hover:text-destructive",
10125
10124
  "aria-label": "Clear all blocks",
10126
10125
  children: [
10127
10126
  /* @__PURE__ */ jsx(Trash2, { className: "h-3.5 w-3.5" }),
10128
- /* @__PURE__ */ jsx("span", { className: "hidden md:inline", children: "Clear" })
10127
+ /* @__PURE__ */ jsx(ExpandingLabel, { children: "Clear" })
10128
+ ]
10129
+ }
10130
+ ),
10131
+ /* @__PURE__ */ jsxs(
10132
+ Button,
10133
+ {
10134
+ type: "button",
10135
+ variant: "ghost",
10136
+ size: "sm",
10137
+ onClick: onOpenJson,
10138
+ className: "group gap-0",
10139
+ "aria-label": "View JSON",
10140
+ children: [
10141
+ /* @__PURE__ */ jsx(Code2, { className: "h-3.5 w-3.5" }),
10142
+ /* @__PURE__ */ jsx(ExpandingLabel, { children: "View JSON" })
10129
10143
  ]
10130
10144
  }
10131
10145
  ),
10132
- /* @__PURE__ */ jsxs(Button, { type: "button", variant: "ghost", size: "sm", onClick: onOpenJson, "aria-label": "View JSON", children: [
10133
- /* @__PURE__ */ jsx(Code2, { className: "h-3.5 w-3.5" }),
10134
- /* @__PURE__ */ jsx("span", { className: "hidden md:inline", children: "View JSON" })
10135
- ] }),
10136
10146
  !showSend ? primaryAction ? (
10137
10147
  // Compose-only mode with a host-owned primary action: same
10138
10148
  // placement and styling as the built-in send button. No icon —
@@ -10242,6 +10252,19 @@ function Toolbar2({
10242
10252
  ] }) : null
10243
10253
  ] });
10244
10254
  }
10255
+ function ExpandingLabel({ children }) {
10256
+ return /* @__PURE__ */ jsx(
10257
+ "span",
10258
+ {
10259
+ className: cn(
10260
+ "grid grid-cols-[0fr] transition-[grid-template-columns] duration-200 ease-out",
10261
+ "group-hover:grid-cols-[1fr] group-focus-visible:grid-cols-[1fr]",
10262
+ "motion-reduce:transition-none"
10263
+ ),
10264
+ children: /* @__PURE__ */ jsx("span", { className: "overflow-hidden", children: /* @__PURE__ */ jsx("span", { className: "block whitespace-nowrap pl-1.5", children }) })
10265
+ }
10266
+ );
10267
+ }
10245
10268
  function Menu({
10246
10269
  ariaLabel,
10247
10270
  options,
@@ -10664,7 +10687,7 @@ function BlockKitchen(props) {
10664
10687
  /* @__PURE__ */ jsxs(
10665
10688
  "div",
10666
10689
  {
10667
- className: "bk-root flex h-full w-full flex-col overflow-hidden rounded-md border bg-background text-foreground",
10690
+ className: "bk-root flex h-full max-h-[var(--bk-max-height,100svh)] w-full flex-col overflow-hidden rounded-md border bg-background text-foreground",
10668
10691
  onKeyDown: handleKeyDown,
10669
10692
  children: [
10670
10693
  /* @__PURE__ */ jsx(