Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
add arrow
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Schmatzler <christoph@medium.place>
  • Loading branch information
cschmatzler committed Jul 2, 2024
1 parent db8152d commit 9a7288c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hooks/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ var Tooltip = class extends Component {
return tooltip.connect(this.service.state, this.service.send, normalizeProps);
}
render() {
const parts = ["trigger", "positioner", "content"];
const parts = ["trigger", "positioner", "content", "arrow", "arrow-tip"];
for (const part of parts) renderPart(this.el, part, this.api);
}
onOpenChange(details) {
Expand Down
2 changes: 1 addition & 1 deletion hooks/dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ var Tooltip = class extends Component {
return tooltip.connect(this.service.state, this.service.send, normalizeProps);
}
render() {
const parts = ["trigger", "positioner", "content"];
const parts = ["trigger", "positioner", "content", "arrow", "arrow-tip"];
for (const part of parts) renderPart(this.el, part, this.api);
}
onOpenChange(details) {
Expand Down
2 changes: 1 addition & 1 deletion hooks/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Tooltip extends Component<tooltip.Context, tooltip.Api> {
}

render() {
const parts = ["trigger", "positioner", "content"];
const parts = ["trigger", "positioner", "content", "arrow", "arrow-tip"];
for (const part of parts) renderPart(this.el, part, this.api);
}

Expand Down
16 changes: 16 additions & 0 deletions lib/turboprop/headless/tooltip.ex
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@ defmodule Turboprop.Headless.Tooltip do
attr :rest, :global
slot :inner_block

def arrow(assigns) do
render_as_tag_or_component(assigns, %{"data-part" => "arrow"})
end

attr :as, :any, default: "div"
attr :rest, :global
slot :inner_block

def arrow_tip(assigns) do
render_as_tag_or_component(assigns, %{"data-part" => "arrow-tip"})
end

attr :as, :any, default: "div"
attr :rest, :global
slot :inner_block

def content(assigns) do
render_as_tag_or_component(assigns, %{"data-part" => "content"})
end
Expand Down

0 comments on commit 9a7288c

Please sign in to comment.