Skip to content

Commit

Permalink
revert commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sarkaaa committed Nov 27, 2024
1 parent 36ee31f commit 7175b82
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 44 deletions.
14 changes: 4 additions & 10 deletions packages/orbit-components/src/Tooltip/Tooltip.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const Default: Story = {
render: args => (
<Stack justify="center">
<Tooltip {...args}>
<Icons.Airplane />
<Icons.Airplane ariaLabel="More information" />
</Tooltip>
</Stack>
),
Expand All @@ -69,7 +69,6 @@ export const Default: Story = {

args: {
content: "Write your text here.",
"aria-label": "More information.",
},
};

Expand Down Expand Up @@ -148,7 +147,7 @@ export const WithImageInside: Story = {
</Stack>
}
>
<Icons.Airplane />
<Icons.Airplane ariaLabel="More information" />
</Tooltip>
),

Expand All @@ -163,7 +162,6 @@ export const WithImageInside: Story = {
"renderInPortal",
"stopPropagation",
"block",
"aria-labelledby",
],
},
},
Expand Down Expand Up @@ -191,7 +189,7 @@ export const WithImageInside: Story = {
};

export const Playground: Story = {
render: ({ children, content, "aria-labelledby": ariaLabelledby, ...args }) => (
render: ({ children, content, ...args }) => (
<Alert icon title="Lorem ipsum dolor sit amet" type="success">
<Stack spacing="none">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam lectus justo, vulputate
Expand All @@ -204,10 +202,9 @@ export const Playground: Story = {
<div>{content}</div>
</div>
}
aria-labelledby={ariaLabelledby}
{...args}
>
<Text id={ariaLabelledby}>{children}</Text>
<Text>{children}</Text>
</Tooltip>
</Stack>
</Alert>
Expand All @@ -233,8 +230,6 @@ export const Playground: Story = {
stopPropagation: false,
removeUnderlinedText: false,
block: false,
"aria-label": "Tooltip label",
"aria-labelledby": "tooltip-labelledby",
...WithImageInside.args,
},

Expand Down Expand Up @@ -278,7 +273,6 @@ export const Rtl: Story = {
"labelClose",
"renderInPortal",
"stopPropagation",
"aria-labelledby",
],
},
},
Expand Down
6 changes: 0 additions & 6 deletions packages/orbit-components/src/Tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const Tooltip = ({
stopPropagation = false,
removeUnderlinedText,
block = false,
"aria-label": ariaLabel,
"aria-labelledby": ariaLabelledby,
}: Props) => {
const { isLargeMobile } = useMediaQuery();
return isLargeMobile ? (
Expand All @@ -42,8 +40,6 @@ const Tooltip = ({
stopPropagation={stopPropagation}
removeUnderlinedText={removeUnderlinedText}
block={block}
aria-label={ariaLabel}
aria-labelledby={ariaLabelledby}
>
{children}
</TooltipPrimitive>
Expand All @@ -60,8 +56,6 @@ const Tooltip = ({
removeUnderlinedText={removeUnderlinedText}
stopPropagation={stopPropagation}
block={block}
aria-label={ariaLabel}
aria-labelledby={ariaLabelledby}
>
{children}
</MobileDialog>
Expand Down
2 changes: 0 additions & 2 deletions packages/orbit-components/src/Tooltip/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@ export interface Props extends Common.Globals {
readonly placement?: Placement;
readonly noFlip?: boolean;
readonly offset?: [number, number];
readonly "aria-label"?: string;
readonly "aria-labelledby"?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,19 @@ const meta: Meta<typeof MobileDialogPrimitive> = {
removeUnderlinedText: false,
block: false,
lockScrolling: false,
"aria-label": "Mobile Dialog Primitive label",
"aria-labelledby": "tooltip-labelledby",
},
};

export default meta;
type Story = StoryObj<typeof MobileDialogPrimitive>;

export const Playground: Story = {
render: ({ "aria-labelledby": ariaLabelledby, ...args }) => (
render: ({ ...args }) => (
<Alert icon title="Lorem ipsum dolor sit amet" type="warning">
<Stack spacing="none">
Excepteur sint occaecat cupidatat non proident.{" "}
<MobileDialogPrimitive aria-labelledby={ariaLabelledby} {...args}>
<Text id={ariaLabelledby}>Aliquam erat volutpat.</Text>
<MobileDialogPrimitive {...args}>
<Text>Aliquam erat volutpat.</Text>
</MobileDialogPrimitive>
</Stack>
</Alert>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ const MobileDialog = ({
removeUnderlinedText,
block = false,
lockScrolling,
"aria-label": ariaLabel,
"aria-labelledby": ariaLabelledby,
}: Props) => {
const [render, setRender, setRenderWithTimeout, clearRenderTimeout] =
useStateWithTimeout<boolean>(false, 200);
Expand Down Expand Up @@ -78,8 +76,6 @@ const MobileDialog = ({
enabled={enabled}
removeUnderlinedText={removeUnderlinedText}
block={block}
aria-label={ariaLabel}
aria-labelledby={ariaLabelledby}
>
{children}
</TooltipWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ export interface Props extends Common.Globals {
readonly stopPropagation?: boolean;
readonly removeUnderlinedText?: boolean;
readonly block?: boolean;
readonly "aria-label"?: string;
readonly "aria-labelledby"?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const Default: Story = {
render: args => (
<Stack justify="center">
<TooltipPrimitive {...args}>
<Icons.Airplane />
<Icons.Airplane ariaLabel="More information" />
</TooltipPrimitive>
</Stack>
),
Expand All @@ -65,7 +65,6 @@ export const Default: Story = {
args: {
content:
"Write your text here. If it’s longer than three lines though, consider format your content in some more structured way.",
"aria-label": "More information.",
},
};

Expand Down Expand Up @@ -147,7 +146,7 @@ export const WithImageInside: Story = {
</Stack>
}
>
<Icons.Airplane />
<Icons.Airplane ariaLabel="More information" />
</TooltipPrimitive>
),

Expand All @@ -162,7 +161,6 @@ export const WithImageInside: Story = {
"renderInPortal",
"stopPropagation",
"block",
"aria-labelledby",
],
},
},
Expand Down Expand Up @@ -190,7 +188,7 @@ export const WithImageInside: Story = {
};

export const Playground: Story = {
render: ({ children, content, "aria-labelledby": ariaLabelledby, ...args }) => (
render: ({ children, content, ...args }) => (
<Alert icon title="Lorem ipsum dolor sit amet" type="warning">
<Stack spacing="none">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam lectus justo, vulputate
Expand All @@ -203,10 +201,9 @@ export const Playground: Story = {
<div>{content}</div>
</div>
}
aria-labelledby={ariaLabelledby}
{...args}
>
<Text id={ariaLabelledby}>{children}</Text>
<Text>{children}</Text>
</TooltipPrimitive>
</Stack>
</Alert>
Expand Down Expand Up @@ -235,8 +232,6 @@ export const Playground: Story = {
block: false,
noFlip: false,
offset: [0, 5],
"aria-label": "More information.",
"aria-labelledby": "tooltip-labelledby",
},

argTypes: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ const TooltipPrimitive = ({
placement,
noFlip,
offset,
"aria-label": ariaLabel,
"aria-labelledby": ariaLabelledby,
}: Props) => {
const [shown, setShown] = React.useState(false);
const [referenceElement, setReferenceElement] = React.useState<HTMLSpanElement | null>(null);
Expand Down Expand Up @@ -135,8 +133,6 @@ const TooltipPrimitive = ({
enabled={enabled}
removeUnderlinedText={removeUnderlinedText}
block={block}
aria-label={ariaLabel}
aria-labelledby={ariaLabelledby}
>
{children}
</TooltipWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,4 @@ export interface Props extends Common.Globals {
readonly placement?: Placement;
readonly noFlip?: boolean;
readonly offset?: [number, number];
readonly "aria-label"?: string;
readonly "aria-labelledby"?: string;
}

0 comments on commit 7175b82

Please sign in to comment.