diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/components/Stack.doc.ts b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/components/Stack.doc.ts index 78bd139fd..3e7c7de84 100644 --- a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/components/Stack.doc.ts +++ b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/components/Stack.doc.ts @@ -9,6 +9,11 @@ const generateCodeBlockForStack = (title: string, fileName: string) => { code: `../examples/stack/${fileName}.tsx`, language: 'tsx', }, + { + title: 'TS', + code: `../examples/stack/${fileName}.ts`, + language: 'ts', + }, ], }; }; @@ -123,16 +128,16 @@ You can center your block stack on the vertical axis by setting \`justifyContent }, { type: 'Generic', - anchorLink: 'block-align-contents-stretch', + anchorLink: 'block-align-content-stretch', title: 'Block Stack with horizontal stretching', sectionContent: ` This example demonstrates a block stack with elements stretched to fill the container width. By setting \`alignContents\` to \`stretch\`, the children will expand to fill the available horizontal space. This is useful when you want all elements to have consistent width, regardless of their content. `, codeblock: generateCodeBlockForStack( 'Block Stack with stretched contents', - 'block-align-contents-stretch', + 'block-align-content-stretch', ), - image: 'extension-stack-block-align-contents-stretch.png', + image: 'extension-stack-block-align-content-stretch.png', }, { type: 'Generic', diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-align-contents-stretch.ts b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-align-content-stretch.ts similarity index 100% rename from packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-align-contents-stretch.ts rename to packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-align-content-stretch.ts diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-align-content-stretch.tsx b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-align-content-stretch.tsx new file mode 100644 index 000000000..223d1dfca --- /dev/null +++ b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-align-content-stretch.tsx @@ -0,0 +1,27 @@ +import { + reactExtension, + SegmentedControl, + Stack, + Screen, +} from '@shopify/ui-extensions-react/point-of-sale'; +import React from 'react'; + +export default reactExtension('pos.home.modal.render', () => ( + + + console.log(`Selected segment with id: ${id}`)} + /> + + +)); diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-align-contents-stretch.tsx b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-align-contents-stretch.tsx deleted file mode 100644 index e468cb345..000000000 --- a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-align-contents-stretch.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { - Stack, - SegmentedControl, - Screen, -} from '@shopify/ui-extensions/point-of-sale'; - -export function BlockStackAlignContentsStretch() { - return ( - - - - console.log(`Selected segment with id: ${id}`) - } - /> - - - ); -} diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-center-all.ts b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-center-all.ts new file mode 100644 index 000000000..35ba82eaf --- /dev/null +++ b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-center-all.ts @@ -0,0 +1,37 @@ +import { + extension, + Button, + Screen, + Stack, +} from '@shopify/ui-extensions/point-of-sale'; + +export default extension('pos.home.modal.render', (root) => { + const button1 = root.createComponent(Button, { + title: 'Hello', + }); + + const button2 = root.createComponent(Button, { + title: 'Hello', + }); + + const stack = root.createComponent(Stack, { + direction: 'block', + justifyContent: 'center', + alignContent: 'center', + alignItems: 'center', + inlineSize: '100%', + paddingInline: '450', + blockSize: '50%', + gap: '200', + }); + stack.append(button1, button2); + + const screen = root.createComponent(Screen, { + name: 'Stack', + title: 'Stack', + }); + screen.append(stack); + root.append(screen); + + root.mount(); +}); diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-center-all.tsx b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-center-all.tsx index f5255fc48..61bfcab74 100644 --- a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-center-all.tsx +++ b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/stack/block-center-all.tsx @@ -1,15 +1,25 @@ - - -