Skip to content

Commit

Permalink
feat: connecting element and its tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
mfranzke committed Oct 17, 2023
1 parent a34464d commit 6502382
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
let-exampleIndex="exampleIndex"
let-variantIndex="variantIndex"
>
<db-button>
<db-button [describedbyid]="exampleProps.id">
{{ exampleName }}
<db-tooltip
[width]="exampleProps.width"
Expand All @@ -19,6 +19,7 @@
[behaviour]="exampleProps.behaviour"
[delay]="exampleProps.delay"
[variant]="exampleProps.variant"
[id]="exampleProps.id"
>{{ exampleProps.content }}</db-tooltip
>
</db-button>
Expand Down
8 changes: 5 additions & 3 deletions showcases/react-showcase/src/components/tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ const getTooltip = ({
delay,
content,
behaviour,
variant
variant,
id
}: DBTooltipProps & { content: string }) => (
<DBButton>
<DBButton describedbyid={id}>
{children}
<DBTooltip
width={width}
emphasis={emphasis}
placement={placement}
behaviour={behaviour}
delay={delay}
variant={variant}>
variant={variant}
id={id}>
{content}
</DBTooltip>
</DBButton>
Expand Down
51 changes: 34 additions & 17 deletions showcases/shared/tooltip.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@
"name": "functional",
"className": "db-ui-functional",
"props": {
"content": "Tooltip"
"content": "Tooltip",
"id": "tooltip-01"
}
},
{
"name": "regular (Default)",
"className": "db-ui-regular",
"props": {
"content": "Tooltip"
"content": "Tooltip",
"id": "tooltip-02"
}
},
{
"name": "expressive",
"className": "db-ui-expressive",
"props": {
"content": "Tooltip"
"content": "Tooltip",
"id": "tooltip-03"
}
}
]
Expand All @@ -31,14 +34,16 @@
{
"name": "With arrow (Default)",
"props": {
"content": "Tooltip"
"content": "Tooltip",
"id": "tooltip-04"
}
},
{
"name": "Basic",
"props": {
"content": "Tooltip",
"variant": "basic"
"variant": "basic",
"id": "tooltip-05"
}
}
]
Expand All @@ -49,14 +54,16 @@
{
"name": "Weak (Default)",
"props": {
"content": "Tooltip"
"content": "Tooltip",
"id": "tooltip-06"
}
},
{
"name": "Strong",
"props": {
"content": "Tooltip",
"emphasis": "strong"
"emphasis": "strong",
"id": "tooltip-07"
}
}
]
Expand All @@ -68,28 +75,32 @@
"name": "bottom (Default)",
"props": {
"content": "Tooltip",
"placement": "bottom"
"placement": "bottom",
"id": "tooltip-08"
}
},
{
"name": "top",
"props": {
"content": "Tooltip",
"placement": "top"
"placement": "top",
"id": "tooltip-09"
}
},
{
"name": "left",
"props": {
"content": "Tooltip",
"placement": "left"
"placement": "left",
"id": "tooltip-10"
}
},
{
"name": "right",
"props": {
"content": "Tooltip",
"placement": "right"
"placement": "right",
"id": "tooltip-11"
}
}
]
Expand All @@ -100,14 +111,16 @@
{
"name": "Auto (Default)",
"props": {
"content": "Max width, lorem ipsum dolor sit amet, consetetur sadipscing"
"content": "Max width, lorem ipsum dolor sit amet, consetetur sadipscing",
"id": "tooltip-12"
}
},
{
"name": "Fixed",
"props": {
"content": "Max width, lorem ipsum dolor sit amet, consetetur sadipscing",
"width": "fixed"
"width": "fixed",
"id": "tooltip-13"
}
}
]
Expand All @@ -118,28 +131,32 @@
{
"name": "Animation no delay (Default)",
"props": {
"content": "Tooltip"
"content": "Tooltip",
"id": "tooltip-14"
}
},
{
"name": "Delay slow",
"props": {
"content": "Tooltip",
"delay": "slow"
"delay": "slow",
"id": "tooltip-15"
}
},
{
"name": "Delay fast",
"props": {
"content": "Tooltip",
"delay": "fast"
"delay": "fast",
"id": "tooltip-16"
}
},
{
"name": "No animation",
"props": {
"content": "Tooltip",
"behaviour": "plain"
"behaviour": "plain",
"id": "tooltip-17"
}
}
]
Expand Down
3 changes: 2 additions & 1 deletion showcases/vue-showcase/src/components/tooltip/Tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DBButton, DBTooltip } from "../../../../../output/vue/vue3/src";
<template
#example="{ exampleIndex, variantIndex, exampleName, exampleProps }"
>
<DBButton>
<DBButton :describedbyid="exampleProps.id">
{{ exampleName }}
<DBTooltip
:width="exampleProps.width"
Expand All @@ -18,6 +18,7 @@ import { DBButton, DBTooltip } from "../../../../../output/vue/vue3/src";
:behaviour="exampleProps.behaviour"
:delay="exampleProps.delay"
:variant="exampleProps.variant"
:id="exampleProps.id"
>
{{ exampleProps.content }}
</DBTooltip>
Expand Down

0 comments on commit 6502382

Please sign in to comment.