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

feat: add component catalog base #54

Merged
merged 29 commits into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
99df456
feat: add component catalog base
andreancardona Oct 20, 2021
5ed45e7
Merge remote-tracking branch 'origin/main' into feat/add-component-ca…
andreancardona Oct 20, 2021
f10091e
feat(componentcatalog): added base component
andreancardona Oct 21, 2021
0f6ac3a
feat: added pagination
andreancardona Oct 24, 2021
1c9a2d7
Merge remote-tracking branch 'origin/main' into feat/add-component-ca…
andreancardona Oct 24, 2021
462ac3e
feat: added pagination - need to add content switcher
andreancardona Oct 25, 2021
468303b
feat: added styling need to fix breakpoints
andreancardona Oct 26, 2021
983f1ed
chore: continue merge
mattrosno Oct 26, 2021
3990bd7
chore: still merging
mattrosno Oct 26, 2021
91248fd
chore: enable stylelint again
mattrosno Oct 27, 2021
8b8451c
chore: run svg build, prettier
mattrosno Oct 27, 2021
f2ae9cc
feat: xl & l breakpoints
andreancardona Oct 27, 2021
82e8714
feat: added more mobile stylees
andreancardona Oct 28, 2021
1b969f0
feat: added grid component view
andreancardona Oct 28, 2021
4c72640
Merge branch 'main' into feat/add-component-catalog-base
mattrosno Oct 28, 2021
b3ae2e4
chore: fix build
mattrosno Oct 28, 2021
230cede
chore: run lint:fix
mattrosno Oct 28, 2021
de40e1a
chore: fix linting errors
mattrosno Oct 28, 2021
7c106c0
Merge branch 'main' of github.com:carbon-design-system/carbon-platfor…
jharvey10 Oct 29, 2021
c85f734
fix(web-app): switch to icons package
jharvey10 Oct 29, 2021
e07619b
fix(web-app): remove nested package-lock.json
jharvey10 Oct 29, 2021
b47ae8b
feat: fixed directories and styles
andreancardona Nov 5, 2021
d1ad241
feat: updated list view styles
andreancardona Nov 7, 2021
3bfb7d6
feat: updated grid and list views breakpoints all works
andreancardona Nov 8, 2021
3a6e2f1
feat: updated grid and list views breakpoints all works -pt.2
andreancardona Nov 8, 2021
fb5d133
feat: list and card view breakpoints and svgs
andreancardona Nov 8, 2021
2d03b43
fix: update commented icons whoops
andreancardona Nov 8, 2021
a077a7b
fix: update copyright header
andreancardona Nov 8, 2021
aace047
chore: remove unused files
mattrosno Nov 8, 2021
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
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ module.exports = {
named: 'never',
asyncArrow: 'always'
}
]
],
'no-use-before-define': 'off'
andreancardona marked this conversation as resolved.
Show resolved Hide resolved
},
settings: {
next: {
Expand Down
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ dist

# Changelogs
CHANGELOG.md

.carbon

.vscode
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"services:build": "npm --workspaces --if-present run service:build",
"lint": "scripts/lint",
"nightly": "scripts/nightly",
"prepare": "husky install"
"prepare": "husky install",
"format": "prettier --write '**/*.{js,md,scss,ts}'",
mattrosno marked this conversation as resolved.
Show resolved Hide resolved
"format:diff": "prettier --list-different '**/*.{js,md,scss,ts}'"
},
"devDependencies": {
"@commitlint/cli": "^13.2.1",
Expand Down
1 change: 0 additions & 1 deletion services/web-app/.env.example

This file was deleted.

19 changes: 19 additions & 0 deletions services/web-app/components/my-component/ComponentCatalog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright IBM Corp. 2021, 2021
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import ComponentCatalogItem from './ComponentCatalogItem'

// In this component we will map through the Component Catalog Items
const ComponentCatalog = () => {
return (
<section aria-label="Component Catalog">
<ComponentCatalogItem />
</section>
)
}

export default ComponentCatalog
55 changes: 55 additions & 0 deletions services/web-app/components/my-component/ComponentCatalogItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Copyright IBM Corp. 2021, 2021
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { Tag } from '@carbon/react'
import styles from './my-component.module.scss'
import {
Svg12Stable,
Svg10ArrowNorthwest,
Svg14Download,
Svg14License,
Svg16Carbon,
Svg32TagCarbon
} from '@/icons/index.js'
import { Add16 } from '@carbon/icons-react'

const ComponentCatalogItem = () => {
return (
<article className={styles.componentCatalogItem}>
<div className={styles.componentCatalogItemImage}>
<Add16 aria-label="Add" className="my-custom-class" />
</div>
<div className={styles.componentCatalogItemContent}>
<p className={styles.componentCatalogItemSponsor}>
{'Super Sponsor'}
<Svg10ArrowNorthwest className={styles.componentCatalogItemSponsorIcon} />
</p>
<header className={styles.componentCatalogItemName}>{'The best component ever'}</header>
<p className={styles.componentCatalogItemDescription}>
{
"This component is so powerful. It's actually the best component in the world if you didn't know"
andreancardona marked this conversation as resolved.
Show resolved Hide resolved
}
</p>
<footer className={styles.componentCatalogItemInfo}>
<Svg12Stable className={styles.componentCatalogItemStatusIcon} />
<div className={styles.componentCatalogItemStatus}>{'Stable'}</div>
<Svg14Download className={styles.componentCatalogItemDownloadsIcon} />
<div className={styles.componentCatalogItemDownloads}>{'1,234'}</div>
<Svg14License className={styles.componentCatalogItemLicenseIcon} />
<div className={styles.componentCatalogItemLicense}>{'Apache 2.0'}</div>
<Svg16Carbon className={styles.componentCatalogItemReviewedIcon} />
<div className={styles.componentCatalogItemReviewed}>{'Reviewed'}</div>
</footer>
</div>
<div className={styles.componentCatalogItemTags}>
<Tag aria-hidden="true">{'Design only'}</Tag>
<Svg32TagCarbon className={styles.componentCatalogItemTagsSponsor} />
</div>
</article>
)
}

export default ComponentCatalogItem
29 changes: 29 additions & 0 deletions services/web-app/components/my-component/ComponentCatalogSearch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright IBM Corp. 2021, 2021
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { Search } from '@carbon/react'
import styles from './my-component.module.scss'

function ComponentCatalogSearch({ value, onChange }) {
function handleOnChange(event) {
onChange(event.target.value)
}

return (
<div className={styles.componentCatalogSearch}>
<Search
id="component-index-search"
labelText="Search component index by name, keyword, or domain"
placeHolderText="Component name, keyword, domain"
value={value}
onChange={handleOnChange}
size="md"
/>
</div>
)
}

export default ComponentCatalogSearch
68 changes: 68 additions & 0 deletions services/web-app/components/my-component/ComponentCatalogSort.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/**
* Copyright IBM Corp. 2016, 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import { Button, Dropdown } from '@carbon/react'
import { SvgLeftContentSwitcher, SvgRightContentSwitcher } from '@/icons/index.js'

import styles from './my-component.module.scss'

function ComponentCatalogSort() {
const options = ['hi', 'bye']

return (
<div className={styles.componentCatalogSortContainer}>
<div className={styles.componentCatalogSortDropdownText}>
<Dropdown
id="component-index-sort"
initialSelectedItem="Most used"
items={options}
light
className={styles.componentCatalogSortDropdown}
// onChange={({ selectedItem }) => {
// onChange(selectedItem);
// }}
type="inline"
titleText="Sort by:"
label="Most used"
/>
</div>
<div>
<Dropdown
className={styles.componentCatalogSortToggle}
id="component-index-sort"
initialSelectedItem="hola"
items={options}
light
// onChange={({ selectedItem }) => {
// onChange(selectedItem);
// }}
type="inline"
titleText="Sort by:"
label="hello"
/>
</div>
<div className={styles.componentCatalogSortSwitcher}>
<Button
size="md"
kind="ghost"
renderIcon={SvgLeftContentSwitcher}
iconDescription="Icon Description"
hasIconOnly
/>
<Button
size="md"
kind="secondary"
renderIcon={SvgRightContentSwitcher}
iconDescription="Icon Description"
hasIconOnly
/>
</div>
</div>
)
}

export default ComponentCatalogSort
32 changes: 30 additions & 2 deletions services/web-app/components/my-component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,34 @@
* LICENSE file in the root directory of this source tree.
*/

import MyComponent from './my-component'
import { Column, Grid, Pagination } from '@carbon/react'

export default MyComponent
import ComponentCatalogItem from './ComponentCatalogItem'
import ComponentCatalogSearch from './ComponentCatalogSearch'
import ComponentCatalogSort from './ComponentCatalogSort'
import styles from './my-component.module.scss'

const ComponentCatalogIndexPage = () => {
return (
<Grid>
<Column xl={16} lg={16} md={8} sm={4} className={styles.componentCatalogIndexContainer}>
<ComponentCatalogSearch />
<ComponentCatalogSort />
<ComponentCatalogItem />
<Pagination
className={styles.componentCatalogPaginationContainer}
backwardText="Previous page"
forwardText="Next page"
itemsPerPageText="Items per page:"
page={1}
pageNumberText="Page Number"
pageSize={10}
pageSizes={[10, 20, 30, 40, 50]}
totalItems={103}
/>
</Column>
</Grid>
)
}

export default ComponentCatalogIndexPage
20 changes: 0 additions & 20 deletions services/web-app/components/my-component/my-component.js

This file was deleted.

Loading