-
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
201 additions
and
0 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
1 change: 1 addition & 0 deletions
1
packages/ui-extensions-react/src/surfaces/point-of-sale/components.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
4 changes: 4 additions & 0 deletions
4
packages/ui-extensions-react/src/surfaces/point-of-sale/components/Box/Box.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,4 @@ | ||
import {Box as BaseBox} from '@shopify/ui-extensions/point-of-sale'; | ||
import {createRemoteReactComponent} from '@remote-ui/react'; | ||
|
||
export const Box = createRemoteReactComponent(BaseBox); |
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
6 changes: 6 additions & 0 deletions
6
packages/ui-extensions/src/surfaces/point-of-sale/render/components/Box/Box.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 {createRemoteComponent} from '@remote-ui/core'; | ||
import {PaddingProps, SizingProps} from '../shared/box'; | ||
|
||
export interface BoxProps extends PaddingProps, SizingProps {} | ||
|
||
export const Box = createRemoteComponent<'Box', BoxProps>('Box'); |
17 changes: 17 additions & 0 deletions
17
packages/ui-extensions/src/surfaces/point-of-sale/render/components/Image/Image.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 |
---|---|---|
@@ -1,10 +1,27 @@ | ||
import {createRemoteComponent} from '@remote-ui/core'; | ||
|
||
export type ImageSize = 's' | 'm' | 'l' | 'xl'; | ||
|
||
export type FillResizeMode = | ||
/** | ||
* FillResizeMode will apply formatting to the image to fill the container. | ||
* | ||
* https://reactnative.dev/docs/image#resizemode | ||
*/ | ||
'cover' | 'contain' | 'stretch' | 'repeat' | 'center'; | ||
|
||
export interface ImageProps { | ||
/** | ||
* The source of the image to be displayed. | ||
*/ | ||
src?: string; | ||
|
||
/** | ||
* The size or fill size of the image. | ||
* | ||
* @default 'l' | ||
*/ | ||
size?: ImageSize | FillResizeMode; | ||
} | ||
|
||
export const Image = createRemoteComponent<'Image', ImageProps>('Image'); |
131 changes: 131 additions & 0 deletions
131
packages/ui-extensions/src/surfaces/point-of-sale/render/components/shared/box.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,131 @@ | ||
import {SizeKeyword} from './sizes'; | ||
|
||
export type PaddingKeys = SizeKeyword | 'none'; | ||
|
||
export interface PaddingProps { | ||
/** | ||
* Adjust the padding of all edges in pixels. | ||
* | ||
* @default '0' | ||
*/ | ||
padding?: PaddingKeys; | ||
|
||
/** | ||
* Adjust the block-padding. | ||
* | ||
* This overrides the block value of `padding`. | ||
* | ||
* @default '0' | ||
*/ | ||
paddingBlock?: PaddingKeys; | ||
|
||
/** | ||
* Adjust the block-start padding. | ||
* | ||
* This overrides the block-start value of `paddingBlock`. | ||
* | ||
* @default '0' | ||
*/ | ||
paddingBlockStart?: PaddingKeys; | ||
|
||
/** | ||
* Adjust the block-end padding. | ||
* | ||
* This overrides the block-end value of `paddingBlock`. | ||
* | ||
* @default '0' | ||
*/ | ||
paddingBlockEnd?: PaddingKeys; | ||
|
||
/** | ||
* Adjust the inline padding. | ||
* | ||
* | ||
* This overrides the inline value of `padding`. | ||
* | ||
* @default '0' | ||
*/ | ||
paddingInline?: PaddingKeys; | ||
|
||
/** | ||
* Adjust the inline-start padding. | ||
* | ||
* This overrides the inline-start value of `paddingInline`. | ||
* | ||
* @default '0' | ||
*/ | ||
paddingInlineStart?: PaddingKeys; | ||
|
||
/** | ||
* Adjust the inline-end padding. | ||
* | ||
* This overrides the inline-end value of `paddingInline`. | ||
* @default '0' | ||
*/ | ||
paddingInlineEnd?: PaddingKeys; | ||
} | ||
|
||
export type SizeUnits = `${number}px` | `${number}%` | `0`; | ||
export type SizeUnitsOrNone = SizeUnits | 'none'; | ||
export type SizeUnitsOrAuto = SizeUnits | 'auto'; | ||
|
||
export interface SizingProps { | ||
/** | ||
* Adjust the block size. | ||
* | ||
* Auto takes the block size of the box's children. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/block-size | ||
* | ||
* @default 'auto' | ||
*/ | ||
blockSize?: SizeUnitsOrAuto; | ||
|
||
/** | ||
* Adjust the minimum block size. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/min-block-size | ||
* | ||
* @default '0' | ||
*/ | ||
minBlockSize?: SizeUnits; | ||
|
||
/** | ||
* Adjust the maximum block size. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/max-block-size | ||
* | ||
* @default 'none' | ||
*/ | ||
maxBlockSize?: SizeUnitsOrNone; | ||
|
||
/** | ||
* Adjust the inline size. | ||
* | ||
* Auto takes the inline size of the box's children. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/inline-size | ||
* | ||
* @default 'auto' | ||
*/ | ||
inlineSize?: SizeUnitsOrAuto; | ||
|
||
/** | ||
* Adjust the minimum inline size. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/min-inline-size | ||
* | ||
* @default '0' | ||
*/ | ||
minInlineSize?: SizeUnits; | ||
|
||
/** | ||
* Adjust the maximum inline size. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/max-inline-size | ||
* | ||
* @default 'none' | ||
*/ | ||
maxInlineSize?: SizeUnitsOrNone; | ||
} |
22 changes: 22 additions & 0 deletions
22
packages/ui-extensions/src/surfaces/point-of-sale/render/components/shared/sizes.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,22 @@ | ||
export type SizeKeyword = | ||
| '0' | ||
| '025' | ||
| '050' | ||
| '100' | ||
| '200' | ||
| '250' | ||
| '300' | ||
| '350' | ||
| '400' | ||
| '450' | ||
| '500' | ||
| '600' | ||
| '700' | ||
| '800' | ||
| '900' | ||
| '1000' | ||
| '1100' | ||
| '1200' | ||
| '1400' | ||
| '1800' | ||
| '2000'; |