forked from backstage/backstage
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request backstage#27904 from backstage/canon-improve-box
Update Box component
- Loading branch information
Showing
32 changed files
with
673 additions
and
1,589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { addons } from '@storybook/manager-api'; | ||
import { create } from '@storybook/theming'; | ||
|
||
const theme = create({ | ||
base: 'light', | ||
brandTitle: 'My custom Storybook', | ||
brandUrl: 'https://example.com', | ||
brandImage: 'logo.svg', | ||
brandTarget: '_self', | ||
}); | ||
|
||
addons.setConfig({ | ||
theme, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Unstyled, Source } from '@storybook/blocks'; | ||
import { Title, Text, IconLibrary } from './components'; | ||
|
||
<Unstyled> | ||
|
||
<Title type="h1">Iconography</Title> | ||
|
||
<Text> | ||
All our default icons are provided by [Remix Icon](https://remixicon.com/). We | ||
don't import all icons to reduce the bundle size but we cherry pick a nice | ||
selection for you to use in your application. The list of names is set down | ||
below. To use an icon, you can use the `Icon` component and pass the name of | ||
the icon you want to use. | ||
</Text> | ||
|
||
<Source code={`<Icon name="heart" />`} language="tsx" dark /> | ||
|
||
<IconLibrary /> | ||
|
||
</Unstyled> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2024 The Backstage Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import React from 'react'; | ||
import { Icon } from '@backstage/canon'; | ||
import type { IconNames } from '@backstage/canon'; | ||
import { defaultIcons } from '../../../src/components/Icon/icons'; | ||
import { Text } from '../Text'; | ||
|
||
export const IconLibrary = () => { | ||
const icons = Object.keys(defaultIcons); | ||
|
||
return ( | ||
<div className="icon-library"> | ||
{icons.map(icon => ( | ||
<div key={icon} className="icon-library-item"> | ||
<div className="icon-library-item-icon"> | ||
<Icon name={icon as IconNames} /> | ||
</div> | ||
<Text>{icon}</Text> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.icon-library { | ||
display: grid; | ||
grid-template-columns: repeat(6, 1fr); | ||
gap: 1rem; | ||
} | ||
|
||
.icon-library-item { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 8px; | ||
} | ||
|
||
.icon-library-item-icon { | ||
display: flex; | ||
width: 100%; | ||
justify-content: center; | ||
align-items: center; | ||
height: 80px; | ||
border: 1px solid #d3d3d3; | ||
border-radius: 0.5rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import './IconLibrary/styles.css'; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.