-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
packages/ui-extensions-react/src/surfaces/admin/components/Card/Card.ts
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,6 @@ | ||
import {Card as BaseCard} from '@shopify/ui-extensions/admin'; | ||
import type {CardProps} from '@shopify/ui-extensions/admin'; | ||
import {createRemoteReactComponent} from '@remote-ui/react'; | ||
|
||
export const Card = createRemoteReactComponent<'Card', CardProps>(BaseCard); | ||
export type {CardProps} from '@shopify/ui-extensions/admin'; |
11 changes: 11 additions & 0 deletions
11
...es/ui-extensions-react/src/surfaces/admin/components/Card/examples/basic-card.example.tsx
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,11 @@ | ||
import {render, Card} from '@shopify/ui-extensions-react/admin'; | ||
|
||
render('Playground', () => <App />); | ||
|
||
function App() { | ||
return ( | ||
<Card padding={true}> | ||
Card | ||
</Card> | ||
); | ||
} |
Binary file added
BIN
+7.46 KB
packages/ui-extensions/docs/surfaces/admin/screenshots/card-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.3 KB
packages/ui-extensions/docs/surfaces/admin/screenshots/card-thumbnail.png
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
42 changes: 42 additions & 0 deletions
42
packages/ui-extensions/src/surfaces/admin/components/Card/Card.doc-skip.ts
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,42 @@ | ||
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'; | ||
|
||
const data: ReferenceEntityTemplateSchema = { | ||
name: 'Card', | ||
description: | ||
'Cards are used to group similar concepts and tasks together for users to scan, read, and get things done. It displays content in a familiar and recognizable style.', | ||
requires: '', | ||
thumbnail: 'card-thumbnail.png', | ||
isVisualComponent: true, | ||
type: '', | ||
definitions: [ | ||
{ | ||
title: 'CardProps', | ||
description: '', | ||
type: 'CardProps', | ||
}, | ||
], | ||
category: 'Components', | ||
subCategory: 'Structure', | ||
defaultExample: { | ||
image: 'card-default.png', | ||
codeblock: { | ||
title: 'Use Card to build your layout', | ||
tabs: [ | ||
{ | ||
title: 'React', | ||
code: '../../../../../../ui-extensions-react/src/surfaces/admin/components/Card/examples/basic-Card.example.tsx', | ||
language: 'tsx', | ||
}, | ||
{ | ||
title: 'JS', | ||
code: './examples/basic-Card.example.ts', | ||
language: 'js', | ||
}, | ||
], | ||
}, | ||
}, | ||
|
||
related: [], | ||
}; | ||
|
||
export default data; |
13 changes: 13 additions & 0 deletions
13
packages/ui-extensions/src/surfaces/admin/components/Card/Card.ts
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,13 @@ | ||
import {createRemoteComponent} from '@remote-ui/core'; | ||
import {BackgroundProps} from '../shared'; | ||
|
||
export interface CardProps extends BackgroundProps { | ||
/** | ||
* Adjust the padding of all edges. | ||
* | ||
* `true` applies a default padding that is appropriate for the component. | ||
*/ | ||
padding?: boolean; | ||
} | ||
|
||
export const Card = createRemoteComponent<'Card', CardProps>('Card'); |
11 changes: 11 additions & 0 deletions
11
packages/ui-extensions/src/surfaces/admin/components/Card/examples/basic-card.example.ts
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,11 @@ | ||
import {extend, Card} from '@shopify/ui-extensions/admin'; | ||
|
||
extend('Playground', (root) => { | ||
const card = root.createComponent( | ||
Card, | ||
{padding: true}, | ||
'Card', | ||
); | ||
|
||
root.appendChild(card); | ||
}); |
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