Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IconHash: Add component #1543

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changeset/calm-owls-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'braid-design-system': minor
---

---
new:
- IconHash
---

**IconHash:** Add component

**EXAMPLE USAGE:**
```jsx
<IconHash />
```
1 change: 1 addition & 0 deletions packages/braid-design-system/icons/hash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/braid-design-system/scripts/generateIcons.cts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const svgrConfig = {

const docs: ComponentDocs = {
category: 'Icon',
Example: () =>
Example: () =>
source(
<Stack space="none" align="center">
<Heading component="div" level="1">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import type { ComponentDocs } from 'site/types';
import { iconDocumentation } from '../iconCommon.docs';
import source from '@braid-design-system/source.macro';
import { IconHash, Heading, Stack } from '../../';

const docs: ComponentDocs = {
category: 'Icon',
Example: () =>
source(
<Stack space="none" align="center">
<Heading component="div" level="1">
<IconHash />
</Heading>
</Stack>,
),
alternatives: [],
additional: [iconDocumentation],
};

export default docs;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import { Box } from '../../Box/Box';
import useIcon, { type UseIconProps } from '../../../hooks/useIcon';
import { IconHashSvg } from './IconHashSvg';

export type IconHashProps = UseIconProps;

export const IconHash = (props: IconHashProps) => {
const iconProps = useIcon(props);

return <Box component={IconHashSvg} {...iconProps} />;
};
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,29 @@ export const IconGridSvg = ({ title, titleId, ...props }: SVGProps) => (
"
`;

exports[`IconHashSvg should match snapshot 1`] = `
"import React from 'react';

import type { SVGProps } from '../SVGTypes';

export const IconHashSvg = ({ title, titleId, ...props }: SVGProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
focusable="false"
fill="currentColor"
width={16}
height={16}
aria-labelledby={titleId}
{...props}
>
{title ? <title id={titleId}>{title}</title> : null}
<path d="M20 14h-4.216l.445-4H20a1 1 0 1 0 0-2h-3.55l.544-4.89a1.001 1.001 0 0 0-.884-1.104 1.014 1.014 0 0 0-1.104.884L14.438 8h-3.987l.543-4.89a1.001 1.001 0 0 0-.884-1.104c-.536-.05-1.044.335-1.104.884L8.438 8H4a1 1 0 1 0 0 2h4.216l-.445 4H4a1 1 0 1 0 0 2h3.55l-.544 4.89a1.001 1.001 0 0 0 1.988.22L9.562 16h3.987l-.543 4.89a1.001 1.001 0 0 0 1.988.22l.568-5.11H20a1 1 0 1 0 0-2ZM9.784 14l.445-4h3.987l-.445 4H9.784Z" />
</svg>
);
"
`;

exports[`IconHeartActiveSvg should match snapshot 1`] = `
"import React from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export { IconFlag } from './IconFlag/IconFlag';
export { IconGift } from './IconGift/IconGift';
export { IconGlobe } from './IconGlobe/IconGlobe';
export { IconGrid } from './IconGrid/IconGrid';
export { IconHash } from './IconHash/IconHash';
export { IconHeart } from './IconHeart/IconHeart';
export { IconHelp } from './IconHelp/IconHelp';
export { IconHistory } from './IconHistory/IconHistory';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4371,6 +4371,37 @@ exports[`IconGrid 1`] = `
}
`;

exports[`IconHash 1`] = `
{
exportType: component,
props: {
alignY?:
| "lowercase"
| "uppercase"
data?: DataAttributeMap
size?:
| "fill"
| "large"
| "small"
| "standard"
| "xsmall"
title?: string
titleId?: string
tone?:
| "brandAccent"
| "caution"
| "critical"
| "formAccent"
| "info"
| "link"
| "neutral"
| "positive"
| "promote"
| "secondary"
},
}
`;

exports[`IconHeart 1`] = `
{
exportType: component,
Expand Down