From b82774f5250ad69ad12ef39eee9d2c96b120bff0 Mon Sep 17 00:00:00 2001 From: Trish Ta Date: Fri, 29 Nov 2024 17:17:18 -0500 Subject: [PATCH] Add remote-dom components for Admin --- .changeset/wet-laws-explain.md | 6 + .../ui-extensions-react/src/surfaces/admin.ts | 1 - .../src/surfaces/admin/components.ts | 85 - .../components/AdminAction/AdminAction.ts | 5 - .../admin/components/AdminBlock/AdminBlock.ts | 5 - .../AdminPrintAction/AdminPrintAction.ts | 5 - .../surfaces/admin/components/Badge/Badge.ts | 5 - .../Badge/examples/basic-badge.example.tsx | 15 +- .../admin/components/Banner/Banner.ts | 5 - .../Banner/examples/basic-banner.example.tsx | 16 - .../admin/components/BlockStack/BlockStack.ts | 5 - .../examples/basic-blockstack.example.tsx | 18 - .../src/surfaces/admin/components/Box/Box.ts | 5 - .../Box/examples/basic-box.example.tsx | 13 +- .../admin/components/Button/Button.ts | 5 - .../Button/examples/basic-button.example.tsx | 12 +- .../admin/components/Checkbox/Checkbox.ts | 5 - .../examples/basic-checkbox.example.tsx | 7 +- .../admin/components/ChoiceList/ChoiceList.ts | 5 - .../examples/basic-choicelist.example.tsx | 16 - .../components/ColorPicker/ColorPicker.ts | 5 - .../examples/basic-colorpicker.example.tsx | 17 - .../CustomerSegmentTemplate.ts | 7 - .../admin/components/DateField/DateField.ts | 5 - .../examples/basic-datefield.example.tsx | 15 - .../examples/multiple-datefield.example.tsx | 16 - .../examples/range-datefield.example.tsx | 16 - .../admin/components/DatePicker/DatePicker.ts | 5 - .../examples/basic-datepicker.example.tsx | 15 - .../examples/multiple-datepicker.example.tsx | 17 - .../examples/range-datepicker.example.tsx | 16 - .../admin/components/Divider/Divider.ts | 5 - .../examples/basic-divider.example.tsx | 16 +- .../admin/components/EmailField/EmailField.ts | 5 - .../examples/basic-emailfield.example.tsx | 7 - .../surfaces/admin/components/Form/Form.ts | 5 - .../Form/examples/basic-form.example.tsx | 51 - .../FunctionSettings/FunctionSettings.ts | 8 - .../admin/components/Heading/Heading.ts | 5 - .../examples/basic-heading.example.tsx | 7 +- .../components/HeadingGroup/HeadingGroup.ts | 5 - .../examples/basic-headinggroup.example.tsx | 23 - .../surfaces/admin/components/Icon/Icon.ts | 5 - .../Icon/examples/basic-icon.example.tsx | 9 +- .../surfaces/admin/components/Image/Image.ts | 5 - .../Image/examples/basic-image.example.tsx | 17 +- .../components/InlineStack/InlineStack.ts | 5 - .../InternalCustomerSegmentTemplate.ts | 7 - .../InternalLocationList.ts | 7 - .../surfaces/admin/components/Link/Link.ts | 5 - .../Link/examples/app-link.example.tsx | 14 +- .../Link/examples/external-link.example.tsx | 10 +- .../Link/examples/relative-link.example.tsx | 10 +- .../examples/shopify-section-link.example.tsx | 10 +- .../admin/components/MoneyField/MoneyField.ts | 5 - .../examples/basic-moneyfield.example.tsx | 10 - .../components/NumberField/NumberField.ts | 5 - .../examples/basic-numberfield.example.tsx | 7 - .../Option/examples/basic-option.example.tsx | 57 + .../admin/components/Paragraph/Paragraph.ts | 5 - .../examples/basic-paragraph.example.tsx | 32 +- .../components/PasswordField/PasswordField.ts | 5 - .../examples/basic-passwordfield.example.tsx | 17 - .../admin/components/Pressable/Pressable.ts | 5 - .../examples/basic-pressable.example.tsx | 20 - .../ProgressIndicator/ProgressIndicator.ts | 5 - .../basic-progressindicator.example.tsx | 12 - .../admin/components/Section/Section.ts | 5 - ....example.tsx => basic-section.example.tsx} | 10 +- .../admin/components/Select/Select.ts | 11 - .../Select/examples/basic-select.example.tsx | 71 +- .../examples/basic-stack.example.tsx} | 15 +- .../surfaces/admin/components/Text/Text.ts | 5 - .../Text/examples/basic-text.example.tsx | 16 +- .../admin/components/TextArea/TextArea.ts | 5 - .../examples/basic-textarea.example.tsx | 7 - .../admin/components/TextField/TextField.ts | 5 - .../examples/basic-textfield.example.tsx | 7 - .../admin/components/URLField/URLField.ts | 5 - .../examples/basic-urlfield.example.tsx | 7 - .../src/surfaces/admin/components/util.ts | 22 +- .../src/surfaces/admin/props.ts | 3544 ++++++++++++++++ .../customer-account/hooks/live-navigation.ts | 4 +- .../docs/surfaces/admin/build-docs.sh | 9 + .../docs/surfaces/admin/create-doc-files.sh | 20 +- packages/ui-extensions/loom.config.ts | 25 +- packages/ui-extensions/src/surfaces/admin.ts | 2 - .../src/surfaces/admin/components.d.ts | 3591 +++++++++++++++++ .../src/surfaces/admin/components.ts | 51 - .../components/AdminAction/AdminAction.doc.ts | 10 +- .../components/AdminAction/AdminAction.ts | 23 - .../examples/basic-adminaction.example.ts | 31 +- .../components/AdminBlock/AdminBlock.doc.ts | 10 +- .../admin/components/AdminBlock/AdminBlock.ts | 11 - .../examples/basic-adminblock.example.ts | 10 +- .../AdminPrintAction/AdminPrintAction.doc.ts | 10 +- .../AdminPrintAction/AdminPrintAction.ts | 8 - .../basic-adminprintaction.example.ts | 15 +- .../admin/components/Badge/Badge.doc.ts | 14 +- .../surfaces/admin/components/Badge/Badge.ts | 33 - .../Badge/examples/basic-badge.example.ts | 15 +- .../admin/components/Banner/Banner.ts | 31 - .../Banner/examples/basic-banner.example.ts | 11 - .../admin/components/BlockStack/BlockStack.ts | 34 - .../examples/basic-blockstack.example.ts | 24 - .../surfaces/admin/components/Box/Box.doc.ts | 14 +- .../src/surfaces/admin/components/Box/Box.ts | 12 - .../Box/examples/basic-box.example.ts | 12 +- .../admin/components/Button/Button.doc.ts | 14 +- .../admin/components/Button/Button.ts | 116 - .../Button/examples/basic-button.example.ts | 13 +- .../admin/components/Checkbox/Checkbox.doc.ts | 14 +- .../admin/components/Checkbox/Checkbox.ts | 53 - .../examples/basic-checkbox.example.ts | 15 +- .../components/ChoiceList/ChoiceList.doc.ts | 48 - .../admin/components/ChoiceList/ChoiceList.ts | 31 - .../examples/basic-choicelist.example.ts | 23 - .../components/ColorPicker/ColorPicker.doc.ts | 47 - .../components/ColorPicker/ColorPicker.ts | 36 - .../examples/basic-colorpicker.example.ts | 19 - .../CustomerSegmentTemplate.doc.ts | 10 +- .../CustomerSegmentTemplate.ts | 35 - .../customersegmenttemplate.example.ts | 17 +- .../components/DateField/DateField.doc.ts | 83 - .../admin/components/DateField/DateField.ts | 21 - .../examples/basic-datefield.example.ts | 11 - .../examples/multiple-datefield.example.ts | 11 - .../examples/range-datefield.example.ts | 11 - .../components/DatePicker/DatePicker.doc.ts | 83 - .../admin/components/DatePicker/DatePicker.ts | 93 - .../examples/basic-datepicker.example.ts | 11 - .../examples/multiple-datepicker.example.ts | 11 - .../examples/range-datepicker.example.ts | 11 - .../admin/components/Divider/Divider.doc.ts | 16 +- .../admin/components/Divider/Divider.ts | 9 - .../admin/components/Divider/README.md | 7 - .../Divider/examples/basic-divider.example.ts | 20 +- .../components/EmailField/EmailField.doc.ts | 51 - .../admin/components/EmailField/EmailField.ts | 17 - .../admin/components/EmailField/README.md | 7 - .../examples/basic-emailfield.example.ts | 9 - .../admin/components/Form/Form.doc.ts | 57 - .../surfaces/admin/components/Form/Form.ts | 16 - .../Form/examples/basic-form.example.ts | 43 - .../FunctionSettings/FunctionSettings.doc.ts | 10 +- .../FunctionSettings/FunctionSettings.ts | 45 - .../basic-functionsettings.example.ts | 53 +- .../admin/components/Heading/Heading.doc.ts | 19 +- .../admin/components/Heading/Heading.ts | 14 - .../admin/components/Heading/README.md | 6 - .../Heading/examples/basic-heading.example.ts | 8 +- .../HeadingGroup/HeadingGroup.doc.ts | 41 - .../components/HeadingGroup/HeadingGroup.ts | 1 - .../admin/components/HeadingGroup/README.md | 5 - .../examples/basic-headinggroup.example.ts | 20 - .../admin/components/Icon/Icon.doc.ts | 33 +- .../surfaces/admin/components/Icon/Icon.ts | 35 - .../admin/components/Icon/IconName.ts | 567 --- .../surfaces/admin/components/Icon/README.md | 3 - .../Icon/examples/basic-icon.example.ts | 8 +- .../admin/components/Image/Image.doc.ts | 14 +- .../surfaces/admin/components/Image/Image.ts | 120 - .../Image/examples/basic-image.example.ts | 11 +- .../components/InlineStack/InlineStack.doc.ts | 47 - .../components/InlineStack/InlineStack.ts | 32 - .../examples/basic-inlinestack.example.ts | 18 - .../InternalCustomerSegmentTemplate.ts | 59 - ...internalcustomersegmenttemplate.example.ts | 45 - .../InternalLocationList.ts | 69 - .../admin/components/Link/Link.doc.ts | 38 +- .../surfaces/admin/components/Link/Link.ts | 60 - .../Link/examples/app-link.example.ts | 22 +- .../Link/examples/external-link.example.ts | 22 +- .../Link/examples/relative-link.example.ts | 22 +- .../examples/shopify-section-link.example.ts | 22 +- .../components/MoneyField/MoneyField.doc.ts | 47 - .../admin/components/MoneyField/MoneyField.ts | 187 - .../admin/components/MoneyField/README.md | 3 - .../examples/basic-moneyfield.example.ts | 9 - .../components/NumberField/NumberField.doc.ts | 48 - .../components/NumberField/NumberField.ts | 29 - .../admin/components/NumberField/README.md | 7 - .../examples/basic-numberfield.example.ts | 9 - .../Banner.doc.ts => Option/Option.doc.ts} | 28 +- .../admin/components/Option/README.md | 94 + .../Option/examples/basic-option.example.ts | 56 + .../components/Paragraph/Paragraph.doc.ts | 14 +- .../admin/components/Paragraph/Paragraph.ts | 5 - .../examples/basic-paragraph.example.ts | 27 +- .../PasswordField/PasswordField.doc.ts | 53 - .../components/PasswordField/PasswordField.ts | 16 - .../admin/components/PasswordField/README.md | 7 - .../examples/basic-passwordfield.example.ts | 14 - .../components/Pressable/Pressable.doc.ts | 48 - .../admin/components/Pressable/Pressable.ts | 4 - .../examples/basic-pressable.example.ts | 25 - .../ProgressIndicator.doc.ts | 48 - .../ProgressIndicator/ProgressIndicator.ts | 26 - .../basic-progressindicator.example.ts | 18 - .../admin/components/Section/Section.doc.ts | 16 +- .../admin/components/Section/Section.ts | 29 - .../Section/examples/basic-Section.example.ts | 19 - .../Section/examples/basic-section.example.ts | 9 + .../admin/components/Select/Select.doc.ts | 14 +- .../admin/components/Select/Select.ts | 143 - .../Select/examples/basic-select.example.ts | 92 +- .../BlockStack.doc.ts => Stack/Stack.doc.ts} | 32 +- .../Stack/examples/basic-stack.example.ts | 10 + .../admin/components/Text/Text.doc.ts | 14 +- .../surfaces/admin/components/Text/Text.ts | 42 - .../Text/examples/basic-text.example.ts | 22 +- .../admin/components/TextArea/TextArea.doc.ts | 48 - .../admin/components/TextArea/TextArea.ts | 18 - .../examples/basic-textarea.example.ts | 10 - .../admin/components/TextField/README.md | 7 - .../components/TextField/TextField.doc.ts | 58 - .../admin/components/TextField/TextField.ts | 13 - .../examples/basic-textfield.example.ts | 9 - .../admin/components/URLField/README.md | 7 - .../admin/components/URLField/URLField.doc.ts | 46 - .../admin/components/URLField/URLField.ts | 21 - .../examples/basic-urlfield.example.ts | 9 - .../admin/components/shared/display.ts | 7 - .../surfaces/admin/components/shared/index.ts | 1029 ----- .../src/surfaces/admin/shared.ts | 6 - 225 files changed, 7966 insertions(+), 5708 deletions(-) create mode 100644 .changeset/wet-laws-explain.md delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/AdminAction/AdminAction.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/AdminBlock/AdminBlock.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/AdminPrintAction/AdminPrintAction.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Badge/Badge.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Banner/Banner.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Banner/examples/basic-banner.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/BlockStack/BlockStack.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/BlockStack/examples/basic-blockstack.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Box/Box.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Button/Button.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Checkbox/Checkbox.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/ChoiceList/ChoiceList.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/ChoiceList/examples/basic-choicelist.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/ColorPicker/ColorPicker.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/ColorPicker/examples/basic-colorpicker.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/DateField/DateField.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/DateField/examples/basic-datefield.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/DateField/examples/multiple-datefield.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/DateField/examples/range-datefield.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/DatePicker.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/examples/basic-datepicker.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/examples/multiple-datepicker.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/examples/range-datepicker.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Divider/Divider.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/EmailField/EmailField.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/EmailField/examples/basic-emailfield.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Form/Form.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Form/examples/basic-form.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/FunctionSettings/FunctionSettings.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Heading/Heading.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/HeadingGroup/HeadingGroup.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/HeadingGroup/examples/basic-headinggroup.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Icon/Icon.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Image/Image.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/InlineStack/InlineStack.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/InternalLocationList/InternalLocationList.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Link/Link.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/MoneyField/MoneyField.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/MoneyField/examples/basic-moneyfield.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/NumberField/NumberField.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/NumberField/examples/basic-numberfield.example.tsx create mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Option/examples/basic-option.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Paragraph/Paragraph.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/PasswordField/PasswordField.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/PasswordField/examples/basic-passwordfield.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Pressable/Pressable.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Pressable/examples/basic-pressable.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/ProgressIndicator/ProgressIndicator.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/ProgressIndicator/examples/basic-progressindicator.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Section/Section.ts rename packages/ui-extensions-react/src/surfaces/admin/components/Section/examples/{basic-Section.example.tsx => basic-section.example.tsx} (70%) delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Select/Select.ts rename packages/ui-extensions-react/src/surfaces/admin/components/{InlineStack/examples/basic-inlinestack.example.tsx => Stack/examples/basic-stack.example.tsx} (61%) delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/Text/Text.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/TextArea/TextArea.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/TextArea/examples/basic-textarea.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/TextField/TextField.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/TextField/examples/basic-textfield.example.tsx delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/URLField/URLField.ts delete mode 100644 packages/ui-extensions-react/src/surfaces/admin/components/URLField/examples/basic-urlfield.example.tsx create mode 100644 packages/ui-extensions-react/src/surfaces/admin/props.ts create mode 100644 packages/ui-extensions/src/surfaces/admin/components.d.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/AdminAction/AdminAction.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/AdminBlock/AdminBlock.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/AdminPrintAction/AdminPrintAction.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Badge/Badge.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Banner/Banner.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Banner/examples/basic-banner.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/BlockStack/BlockStack.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/BlockStack/examples/basic-blockstack.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Box/Box.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Button/Button.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Checkbox/Checkbox.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/ChoiceList/ChoiceList.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/ChoiceList/ChoiceList.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/ChoiceList/examples/basic-choicelist.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/ColorPicker/ColorPicker.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/ColorPicker/ColorPicker.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/ColorPicker/examples/basic-colorpicker.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/DateField/DateField.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/DateField/DateField.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/DateField/examples/basic-datefield.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/DateField/examples/multiple-datefield.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/DateField/examples/range-datefield.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/DatePicker/DatePicker.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/DatePicker/DatePicker.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/DatePicker/examples/basic-datepicker.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/DatePicker/examples/multiple-datepicker.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/DatePicker/examples/range-datepicker.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Divider/Divider.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Divider/README.md delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/EmailField/EmailField.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/EmailField/EmailField.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/EmailField/README.md delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/EmailField/examples/basic-emailfield.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Form/Form.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Form/Form.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Form/examples/basic-form.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/FunctionSettings/FunctionSettings.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Heading/Heading.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/HeadingGroup/HeadingGroup.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/HeadingGroup/HeadingGroup.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/HeadingGroup/README.md delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/HeadingGroup/examples/basic-headinggroup.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Icon/Icon.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Icon/IconName.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Icon/README.md delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Image/Image.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/InlineStack/InlineStack.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/InlineStack/InlineStack.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/InlineStack/examples/basic-inlinestack.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/InternalCustomerSegmentTemplate/examples/internalcustomersegmenttemplate.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/InternalLocationList/InternalLocationList.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Link/Link.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/MoneyField/MoneyField.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/MoneyField/MoneyField.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/MoneyField/README.md delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/MoneyField/examples/basic-moneyfield.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/NumberField/NumberField.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/NumberField/NumberField.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/NumberField/README.md delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/NumberField/examples/basic-numberfield.example.ts rename packages/ui-extensions/src/surfaces/admin/components/{Banner/Banner.doc.ts => Option/Option.doc.ts} (58%) create mode 100644 packages/ui-extensions/src/surfaces/admin/components/Option/README.md create mode 100644 packages/ui-extensions/src/surfaces/admin/components/Option/examples/basic-option.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Paragraph/Paragraph.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/PasswordField/PasswordField.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/PasswordField/PasswordField.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/PasswordField/README.md delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/PasswordField/examples/basic-passwordfield.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Pressable/Pressable.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Pressable/Pressable.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Pressable/examples/basic-pressable.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/ProgressIndicator/ProgressIndicator.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/ProgressIndicator/ProgressIndicator.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/ProgressIndicator/examples/basic-progressindicator.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Section/Section.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Section/examples/basic-Section.example.ts create mode 100644 packages/ui-extensions/src/surfaces/admin/components/Section/examples/basic-section.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Select/Select.ts rename packages/ui-extensions/src/surfaces/admin/components/{BlockStack/BlockStack.doc.ts => Stack/Stack.doc.ts} (59%) create mode 100644 packages/ui-extensions/src/surfaces/admin/components/Stack/examples/basic-stack.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/Text/Text.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/TextArea/TextArea.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/TextArea/TextArea.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/TextArea/examples/basic-textarea.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/TextField/README.md delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/TextField/TextField.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/TextField/TextField.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/TextField/examples/basic-textfield.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/URLField/README.md delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/URLField/URLField.doc.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/URLField/URLField.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/URLField/examples/basic-urlfield.example.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/shared/display.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/components/shared/index.ts delete mode 100644 packages/ui-extensions/src/surfaces/admin/shared.ts diff --git a/.changeset/wet-laws-explain.md b/.changeset/wet-laws-explain.md new file mode 100644 index 000000000..11413feed --- /dev/null +++ b/.changeset/wet-laws-explain.md @@ -0,0 +1,6 @@ +--- +'@shopify/ui-extensions-react': patch +'@shopify/ui-extensions': patch +--- + +Add new remote-dom components for Admin diff --git a/packages/ui-extensions-react/src/surfaces/admin.ts b/packages/ui-extensions-react/src/surfaces/admin.ts index 669f01274..4de9bdd9f 100644 --- a/packages/ui-extensions-react/src/surfaces/admin.ts +++ b/packages/ui-extensions-react/src/surfaces/admin.ts @@ -1,5 +1,4 @@ export {extend, extension} from '@shopify/ui-extensions/admin'; -export * from './admin/components'; export * from './admin/hooks'; export {render, reactExtension} from './admin/render'; diff --git a/packages/ui-extensions-react/src/surfaces/admin/components.ts b/packages/ui-extensions-react/src/surfaces/admin/components.ts deleted file mode 100644 index 258fbdddc..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components.ts +++ /dev/null @@ -1,85 +0,0 @@ -export {AdminAction} from './components/AdminAction/AdminAction'; -export type {AdminActionProps} from './components/AdminAction/AdminAction'; -export {AdminPrintAction} from './components/AdminPrintAction/AdminPrintAction'; -export type {AdminPrintActionProps} from './components/AdminPrintAction/AdminPrintAction'; -export {AdminBlock} from './components/AdminBlock/AdminBlock'; -export type {AdminBlockProps} from './components/AdminBlock/AdminBlock'; -export {Badge} from './components/Badge/Badge'; -export type {BadgeProps} from './components/Badge/Badge'; -export {Banner} from './components/Banner/Banner'; -export type {BannerProps} from './components/Banner/Banner'; -export {BlockStack} from './components/BlockStack/BlockStack'; -export type {BlockStackProps} from './components/BlockStack/BlockStack'; -export {Box} from './components/Box/Box'; -export type {BoxProps} from './components/Box/Box'; -export {Button} from './components/Button/Button'; -export type {ButtonProps} from './components/Button/Button'; -export {Checkbox} from './components/Checkbox/Checkbox'; -export type {CheckboxProps} from './components/Checkbox/Checkbox'; -export {ChoiceList} from './components/ChoiceList/ChoiceList'; -export type {ChoiceListProps} from './components/ChoiceList/ChoiceList'; -export {ColorPicker} from './components/ColorPicker/ColorPicker'; -export type {ColorPickerProps} from './components/ColorPicker/ColorPicker'; -export {CustomerSegmentTemplate} from './components/CustomerSegmentTemplate/CustomerSegmentTemplate'; -export type {CustomerSegmentTemplateProps} from './components/CustomerSegmentTemplate/CustomerSegmentTemplate'; -export {DatePicker} from './components/DatePicker/DatePicker'; -export type {DatePickerProps} from './components/DatePicker/DatePicker'; -export {DateField} from './components/DateField/DateField'; -export type {DateFieldProps} from './components/DateField/DateField'; -export {Divider} from './components/Divider/Divider'; -export type {DividerProps} from './components/Divider/Divider'; -export {EmailField} from './components/EmailField/EmailField'; -export type {EmailFieldProps} from './components/EmailField/EmailField'; -export {Form} from './components/Form/Form'; -export type {FormProps} from './components/Form/Form'; -export {FunctionSettings} from './components/FunctionSettings/FunctionSettings'; -export type { - FunctionSettingsProps, - FunctionSettingsError, -} from './components/FunctionSettings/FunctionSettings'; -export {Heading} from './components/Heading/Heading'; -export type {HeadingProps} from './components/Heading/Heading'; -export {HeadingGroup} from './components/HeadingGroup/HeadingGroup'; -export type {HeadingGroupProps} from './components/HeadingGroup/HeadingGroup'; -export {Icon} from './components/Icon/Icon'; -export type {IconProps} from './components/Icon/Icon'; -export {Image} from './components/Image/Image'; -export type {ImageProps} from './components/Image/Image'; -export {InlineStack} from './components/InlineStack/InlineStack'; -export type {InlineStackProps} from './components/InlineStack/InlineStack'; -export {InternalCustomerSegmentTemplate} from './components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate'; -export type {InternalCustomerSegmentTemplateProps} from './components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate'; -export {Link} from './components/Link/Link'; -export type {LinkProps} from './components/Link/Link'; -export {MoneyField} from './components/MoneyField/MoneyField'; -export type {MoneyFieldProps} from './components/MoneyField/MoneyField'; -export {NumberField} from './components/NumberField/NumberField'; -export type {NumberFieldProps} from './components/NumberField/NumberField'; -export {Paragraph} from './components/Paragraph/Paragraph'; -export type {ParagraphProps} from './components/Paragraph/Paragraph'; -export {PasswordField} from './components/PasswordField/PasswordField'; -export type {PasswordFieldProps} from './components/PasswordField/PasswordField'; -export {Pressable} from './components/Pressable/Pressable'; -export type {PressableProps} from './components/Pressable/Pressable'; -export {ProgressIndicator} from './components/ProgressIndicator/ProgressIndicator'; -export type {ProgressIndicatorProps} from './components/ProgressIndicator/ProgressIndicator'; -export {Section} from './components/Section/Section'; -export type {SectionProps} from './components/Section/Section'; -export {Select} from './components/Select/Select'; -export type { - OptionDescription, - OptionGroupDescription, - OptionGroupProps, - OptionProps, - SelectProps, -} from './components/Select/Select'; -export {Text} from './components/Text/Text'; -export type {TextProps} from './components/Text/Text'; -export {TextArea} from './components/TextArea/TextArea'; -export type {TextAreaProps} from './components/TextArea/TextArea'; -export {TextField} from './components/TextField/TextField'; -export type {TextFieldProps} from './components/TextField/TextField'; -export {URLField} from './components/URLField/URLField'; -export type {URLFieldProps} from './components/URLField/URLField'; -export {InternalLocationList} from './components/InternalLocationList/InternalLocationList'; -export type {InternalLocationListProps} from './components/InternalLocationList/InternalLocationList'; diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/AdminAction/AdminAction.ts b/packages/ui-extensions-react/src/surfaces/admin/components/AdminAction/AdminAction.ts deleted file mode 100644 index 7134a86e0..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/AdminAction/AdminAction.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {AdminActionProps} from '@shopify/ui-extensions/admin'; - -export const AdminAction = createRemoteComponent('ui-admin-action'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/AdminBlock/AdminBlock.ts b/packages/ui-extensions-react/src/surfaces/admin/components/AdminBlock/AdminBlock.ts deleted file mode 100644 index 69e548e09..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/AdminBlock/AdminBlock.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {AdminBlockProps} from '@shopify/ui-extensions/admin'; - -export const AdminBlock = createRemoteComponent('ui-admin-block'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/AdminPrintAction/AdminPrintAction.ts b/packages/ui-extensions-react/src/surfaces/admin/components/AdminPrintAction/AdminPrintAction.ts deleted file mode 100644 index cfbd27f3e..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/AdminPrintAction/AdminPrintAction.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {AdminPrintActionProps} from '@shopify/ui-extensions/admin'; - -export const AdminPrintAction = createRemoteComponent('ui-admin-print-action'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Badge/Badge.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Badge/Badge.ts deleted file mode 100644 index 051fc1ed8..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Badge/Badge.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {BadgeProps} from '@shopify/ui-extensions/admin'; - -export const Badge = createRemoteComponent('ui-badge'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Badge/examples/basic-badge.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Badge/examples/basic-badge.example.tsx index 33dfa4e89..319af1dfa 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Badge/examples/basic-badge.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Badge/examples/basic-badge.example.tsx @@ -1,13 +1,10 @@ -import {render, Badge} from '@shopify/ui-extensions-react/admin'; +import { + reactExtension, + Badge, +} from '@shopify/ui-extensions-react/admin'; -render('Playground', () => ); +reactExtension('Playground', () => ); function App() { - return ( - - Fulfilled - - ); + return Fulfilled; } diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Banner/Banner.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Banner/Banner.ts deleted file mode 100644 index 728a34947..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Banner/Banner.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {BannerProps} from '@shopify/ui-extensions/admin'; - -export const Banner = createRemoteComponent('ui-banner'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Banner/examples/basic-banner.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Banner/examples/basic-banner.example.tsx deleted file mode 100644 index 8db34382e..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Banner/examples/basic-banner.example.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import { - render, - Banner, - Paragraph, -} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - -function App() { - return ( - console.log('dismissed banner')}> - Your store may be affected - - ); -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/BlockStack/BlockStack.ts b/packages/ui-extensions-react/src/surfaces/admin/components/BlockStack/BlockStack.ts deleted file mode 100644 index fb4d04559..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/BlockStack/BlockStack.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {BlockStackProps} from '@shopify/ui-extensions/admin'; - -export const BlockStack = createRemoteComponent('ui-block-stack'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/BlockStack/examples/basic-blockstack.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/BlockStack/examples/basic-blockstack.example.tsx deleted file mode 100644 index b2c2a1dab..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/BlockStack/examples/basic-blockstack.example.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { - render, - BlockStack, -} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - -function App() { - return ( - - <>Child 1 - <>Child 2 - <>Child 3 - <>Child 4 - - ); -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Box/Box.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Box/Box.ts deleted file mode 100644 index b5a8afb60..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Box/Box.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {BoxProps} from '@shopify/ui-extensions/admin'; - -export const Box = createRemoteComponent('ui-box'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Box/examples/basic-box.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Box/examples/basic-box.example.tsx index 30be05184..18ee89ba8 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Box/examples/basic-box.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Box/examples/basic-box.example.tsx @@ -1,11 +1,10 @@ -import {render, Box} from '@shopify/ui-extensions-react/admin'; +import { + reactExtension, + Box, +} from '@shopify/ui-extensions-react/admin'; -render('Playground', () => ); +reactExtension('Playground', () => ); function App() { - return ( - - Box - - ); + return Box; } diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Button/Button.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Button/Button.ts deleted file mode 100644 index 931634df8..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Button/Button.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {ButtonProps} from '@shopify/ui-extensions/admin'; - -export const Button = createRemoteComponent('ui-button'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Button/examples/basic-button.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Button/examples/basic-button.example.tsx index 93fcdd8f2..68b88bf04 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Button/examples/basic-button.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Button/examples/basic-button.example.tsx @@ -1,6 +1,7 @@ -import {render, Button} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); +import { + reactExtension, + Button, +} from '@shopify/ui-extensions-react/admin'; function App() { return ( @@ -13,3 +14,8 @@ function App() { ); } + +export default reactExtension( + 'Playground', + () => , +); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Checkbox/Checkbox.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Checkbox/Checkbox.ts deleted file mode 100644 index 0fc14909a..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Checkbox/Checkbox.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {CheckboxProps} from '@shopify/ui-extensions/admin'; - -export const Checkbox = createRemoteComponent('ui-checkbox'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Checkbox/examples/basic-checkbox.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Checkbox/examples/basic-checkbox.example.tsx index 40644d732..e068d6339 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Checkbox/examples/basic-checkbox.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Checkbox/examples/basic-checkbox.example.tsx @@ -1,6 +1,9 @@ -import {render, Checkbox} from '@shopify/ui-extensions-react/admin'; +import { + reactExtension, + Checkbox, +} from '@shopify/ui-extensions-react/admin'; -render('Playground', () => ); +reactExtension('Playground', () => ); function App() { return ( diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/ChoiceList/ChoiceList.ts b/packages/ui-extensions-react/src/surfaces/admin/components/ChoiceList/ChoiceList.ts deleted file mode 100644 index 4aa60d67b..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/ChoiceList/ChoiceList.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {ChoiceListProps} from '@shopify/ui-extensions/admin'; - -export const ChoiceList = createRemoteComponent('ui-choice-list'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/ChoiceList/examples/basic-choicelist.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/ChoiceList/examples/basic-choicelist.example.tsx deleted file mode 100644 index f34899efe..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/ChoiceList/examples/basic-choicelist.example.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import {render, ChoiceList} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - -function App() { - return ( - - ); -} \ No newline at end of file diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/ColorPicker/ColorPicker.ts b/packages/ui-extensions-react/src/surfaces/admin/components/ColorPicker/ColorPicker.ts deleted file mode 100644 index 375de0137..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/ColorPicker/ColorPicker.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {ColorPickerProps} from '@shopify/ui-extensions/admin'; - -export const ColorPicker = createRemoteComponent('ui-color-picker'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/ColorPicker/examples/basic-colorpicker.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/ColorPicker/examples/basic-colorpicker.example.tsx deleted file mode 100644 index bddc08726..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/ColorPicker/examples/basic-colorpicker.example.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { - render, - ColorPicker, -} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - -function App() { - return ( - { - console.log({value}); - }} - /> - ); -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.ts b/packages/ui-extensions-react/src/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.ts deleted file mode 100644 index 8110f6578..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/CustomerSegmentTemplate/CustomerSegmentTemplate.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {CustomerSegmentTemplateProps} from '@shopify/ui-extensions/admin'; - -export const CustomerSegmentTemplate = createRemoteComponent( - 'ui-customer-segment-template', -); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/DateField/DateField.ts b/packages/ui-extensions-react/src/surfaces/admin/components/DateField/DateField.ts deleted file mode 100644 index c56494551..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/DateField/DateField.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {DateFieldProps} from '@shopify/ui-extensions/admin'; - -export const DateField = createRemoteComponent('ui-date-field'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/DateField/examples/basic-datefield.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/DateField/examples/basic-datefield.example.tsx deleted file mode 100644 index 13542e019..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/DateField/examples/basic-datefield.example.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import React, { useState } from 'react'; -import { - render, - DateField, - type Selected -} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - -function App() { - const [selected, setSelected] = useState('2023-11-08') - return ( - - ); -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/DateField/examples/multiple-datefield.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/DateField/examples/multiple-datefield.example.tsx deleted file mode 100644 index 3e2914e80..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/DateField/examples/multiple-datefield.example.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import { - render, - DateField, - type Selected, -} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - -function App() { - const [selected, setSelected] = React.useState(['2023-11-08']); - - return ( - - ); -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/DateField/examples/range-datefield.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/DateField/examples/range-datefield.example.tsx deleted file mode 100644 index 8519b66db..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/DateField/examples/range-datefield.example.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import { - render, - DateField, - type Selected -} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - -function App() { - const [selected, setSelected] = React.useState({start: '2023-11-08', end: '2023-11-10' }); - - return ( - - ); -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/DatePicker.ts b/packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/DatePicker.ts deleted file mode 100644 index 21f3cdbfe..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/DatePicker.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {DatePickerProps} from '@shopify/ui-extensions/admin'; - -export const DatePicker = createRemoteComponent('ui-date-picker'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/examples/basic-datepicker.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/examples/basic-datepicker.example.tsx deleted file mode 100644 index 4f36fd932..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/examples/basic-datepicker.example.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import React, { useState } from 'react'; -import { - render, - DatePicker, - type Selected -} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - -function App() { - const [selected, setSelected] = useState('2023-11-08') - return ( - - ); -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/examples/multiple-datepicker.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/examples/multiple-datepicker.example.tsx deleted file mode 100644 index c5dbf5892..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/examples/multiple-datepicker.example.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import { - render, - DatePicker, - type Selected, -} from '@shopify/ui-extensions-react/admin'; - - -render('Playground', () => ); - -function App() { - const [selected, setSelected] = React.useState(['2023-11-08']); - - return ( - - ); -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/examples/range-datepicker.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/examples/range-datepicker.example.tsx deleted file mode 100644 index 209fe39f6..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/DatePicker/examples/range-datepicker.example.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import { - render, - DatePicker, - type Selected -} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - -function App() { - const [selected, setSelected] = React.useState({start: '2023-11-08', end: '2023-11-10' }); - - return ( - - ); -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Divider/Divider.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Divider/Divider.ts deleted file mode 100644 index a26fac0e3..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Divider/Divider.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {DividerProps} from '@shopify/ui-extensions/admin'; - -export const Divider = createRemoteComponent('ui-divider'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Divider/examples/basic-divider.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Divider/examples/basic-divider.example.tsx index 902ab9478..dc5fe92ab 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Divider/examples/basic-divider.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Divider/examples/basic-divider.example.tsx @@ -1,18 +1,22 @@ import React from 'react'; import { - render, + reactExtension, Divider, - BlockStack, + Stack, + reactExtension, } from '@shopify/ui-extensions-react/admin'; -render('Playground', () => ); - function App() { return ( - + <>First text <>Second Text - + ); } + +export default reactExtension( + 'Playground', + () => , +); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/EmailField/EmailField.ts b/packages/ui-extensions-react/src/surfaces/admin/components/EmailField/EmailField.ts deleted file mode 100644 index 6c3b7de33..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/EmailField/EmailField.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {EmailFieldProps} from '@shopify/ui-extensions/admin'; - -export const EmailField = createRemoteComponent('ui-email-field'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/EmailField/examples/basic-emailfield.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/EmailField/examples/basic-emailfield.example.tsx deleted file mode 100644 index 2b4cdff6b..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/EmailField/examples/basic-emailfield.example.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import {render, EmailField} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - -function App() { - return ; -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Form/Form.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Form/Form.ts deleted file mode 100644 index d62ad110e..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Form/Form.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {FormProps} from '@shopify/ui-extensions/admin'; - -export const Form = createRemoteComponent('ui-form'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Form/examples/basic-form.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Form/examples/basic-form.example.tsx deleted file mode 100644 index c6d445ed8..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Form/examples/basic-form.example.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import React, { useCallback, useState } from 'react'; -import { - reactExtension, - Form, - TextField, -} from '@shopify/ui-extensions-react/admin'; - -export default reactExtension("admin.product-details.block.render", () => ); - -function App() { - const [value, setValue] = useState(""); - const [error, setError] = useState(''); - - const onSubmit = useCallback( - async () => { - // API call to save the values - const res = await fetch('/save', {method:'POST', body: JSON.stringify({name: value})}); - if (!res.ok) { - const json = await res.json(); - const errors = json.errors.join(','); - setError(errors); - } - }, - [value] - ); - - const onReset = useCallback(async () => { - // Reset to initial value - setValue('') - // Clear errors - setError('') - }, []); - - const onInput = useCallback((nameValue) => { - if (!nameValue) { - setError("Please enter a name."); - } - }, []) - - // Field values can only be updated on change when using Remote UI. - const onChange = useCallback((nameValue) => { - setValue(nameValue); - }, []) - - - return ( -
- - - ); -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/FunctionSettings/FunctionSettings.ts b/packages/ui-extensions-react/src/surfaces/admin/components/FunctionSettings/FunctionSettings.ts deleted file mode 100644 index 4aadb0e05..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/FunctionSettings/FunctionSettings.ts +++ /dev/null @@ -1,8 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type { - FunctionSettingsProps, - FunctionSettingsError, -} from '@shopify/ui-extensions/admin'; - -export const FunctionSettings = createRemoteComponent('ui-functipo'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Heading/Heading.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Heading/Heading.ts deleted file mode 100644 index b6e6d73b6..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Heading/Heading.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {HeadingProps} from '@shopify/ui-extensions/admin'; - -export const Heading = createRemoteComponent('ui-heading'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Heading/examples/basic-heading.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Heading/examples/basic-heading.example.tsx index b03a114e7..67f1979fc 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Heading/examples/basic-heading.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Heading/examples/basic-heading.example.tsx @@ -1,6 +1,9 @@ -import {render, Heading} from '@shopify/ui-extensions-react/admin'; +import { + reactExtension, + Heading, +} from '@shopify/ui-extensions-react/admin'; -render('Playground', () => ); +reactExtension('Playground', () => ); function App() { return Store name; diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/HeadingGroup/HeadingGroup.ts b/packages/ui-extensions-react/src/surfaces/admin/components/HeadingGroup/HeadingGroup.ts deleted file mode 100644 index 7f6f45c24..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/HeadingGroup/HeadingGroup.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {HeadingGroupProps} from '@shopify/ui-extensions/admin'; - -export const HeadingGroup = createRemoteComponent('ui-heading-group'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/HeadingGroup/examples/basic-headinggroup.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/HeadingGroup/examples/basic-headinggroup.example.tsx deleted file mode 100644 index 7bcaef390..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/HeadingGroup/examples/basic-headinggroup.example.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { - render, - HeadingGroup, - Heading, - } from '@shopify/ui-extensions-react/admin'; - - render('Playground', () => ); - - function App() { - return ( - <> - Heading <h1> - - - Heading <h2> - - - Heading <h3> - - - - ); - } diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Icon/Icon.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Icon/Icon.ts deleted file mode 100644 index c50233a7c..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Icon/Icon.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {IconProps} from '@shopify/ui-extensions/admin'; - -export const Icon = createRemoteComponent('ui-icon'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Icon/examples/basic-icon.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Icon/examples/basic-icon.example.tsx index a3e8089a4..7ec7d6114 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Icon/examples/basic-icon.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Icon/examples/basic-icon.example.tsx @@ -1,7 +1,10 @@ -import {render, Icon} from '@shopify/ui-extensions-react/admin'; +import { + reactExtension, + Icon, +} from '@shopify/ui-extensions-react/admin'; -render('Playground', () => ); +reactExtension('Playground', () => ); function App() { - return ; + return ; } diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Image/Image.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Image/Image.ts deleted file mode 100644 index 82b47d291..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Image/Image.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {ImageProps} from '@shopify/ui-extensions/admin'; - -export const Image = createRemoteComponent('ui-image'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Image/examples/basic-image.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Image/examples/basic-image.example.tsx index 43dc6f5ea..bfea056f1 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Image/examples/basic-image.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Image/examples/basic-image.example.tsx @@ -1,9 +1,18 @@ -import {render, Image} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); +import { + reactExtension, + Image, +} from '@shopify/ui-extensions-react/admin'; function App() { return ( - Pickaxe + Pickaxe ); } + +export default reactExtension( + 'Playground', + () => , +); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/InlineStack/InlineStack.ts b/packages/ui-extensions-react/src/surfaces/admin/components/InlineStack/InlineStack.ts deleted file mode 100644 index 140cc12bf..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/InlineStack/InlineStack.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {InlineStackProps} from '@shopify/ui-extensions/admin'; - -export const InlineStack = createRemoteComponent('ui-inline-stack'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate.ts b/packages/ui-extensions-react/src/surfaces/admin/components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate.ts deleted file mode 100644 index 74b94026c..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/InternalCustomerSegmentTemplate/InternalCustomerSegmentTemplate.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {InternalCustomerSegmentTemplateProps} from '@shopify/ui-extensions/admin'; - -export const InternalCustomerSegmentTemplate = createRemoteComponent( - 'ui-internal-customer-segment-template', -); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/InternalLocationList/InternalLocationList.ts b/packages/ui-extensions-react/src/surfaces/admin/components/InternalLocationList/InternalLocationList.ts deleted file mode 100644 index 557356e83..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/InternalLocationList/InternalLocationList.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {InternalLocationListProps} from '@shopify/ui-extensions/admin'; - -export const InternalLocationList = createRemoteComponent( - 'ui-internal-location-list', -); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Link/Link.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Link/Link.ts deleted file mode 100644 index bda27989c..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Link/Link.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {LinkProps} from '@shopify/ui-extensions/admin'; - -export const Link = createRemoteComponent('ui-link'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/app-link.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/app-link.example.tsx index 73b437853..6bc65d3e1 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/app-link.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/app-link.example.tsx @@ -1,16 +1,16 @@ import React from 'react'; import { - render, + reactExtension, Link, } from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - function App() { return ( - - Link to app path - + Link to app path ); } + +export default reactExtension( + 'Playground', + () => , +); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/external-link.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/external-link.example.tsx index 0f4c6af28..764c09d70 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/external-link.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/external-link.example.tsx @@ -1,12 +1,9 @@ import React from 'react'; import { - render, + reactExtension, Link, } from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - function App() { return ( @@ -14,3 +11,8 @@ function App() { ); } + +export default reactExtension( + 'Playground', + () => , +); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/relative-link.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/relative-link.example.tsx index 822ae7bdc..4b74a2750 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/relative-link.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/relative-link.example.tsx @@ -1,12 +1,9 @@ import React from 'react'; import { - render, + reactExtension, Link, } from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - function App() { return ( @@ -14,3 +11,8 @@ function App() { ); } + +export default reactExtension( + 'Playground', + () => , +); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/shopify-section-link.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/shopify-section-link.example.tsx index f10a0e5ad..f73b37296 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/shopify-section-link.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Link/examples/shopify-section-link.example.tsx @@ -1,12 +1,9 @@ import React from 'react'; import { - render, + reactExtension, Link, } from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - function App() { return ( @@ -14,3 +11,8 @@ function App() { ); } + +export default reactExtension( + 'Playground', + () => , +); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/MoneyField/MoneyField.ts b/packages/ui-extensions-react/src/surfaces/admin/components/MoneyField/MoneyField.ts deleted file mode 100644 index f176a02a6..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/MoneyField/MoneyField.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {MoneyFieldProps} from '@shopify/ui-extensions/admin'; - -export const MoneyField = createRemoteComponent('ui-money-field'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/MoneyField/examples/basic-moneyfield.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/MoneyField/examples/basic-moneyfield.example.tsx deleted file mode 100644 index bdd46cdcd..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/MoneyField/examples/basic-moneyfield.example.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import {render, MoneyField} from '@shopify/ui-extensions-react/admin'; -import {useState} from 'react'; - -render('Playground', () => ); - -function App() { - const [value, setValue] = useState({ amount: 100, currencyCode: 'USD' }); - - return ; -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/NumberField/NumberField.ts b/packages/ui-extensions-react/src/surfaces/admin/components/NumberField/NumberField.ts deleted file mode 100644 index 3f44e86e6..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/NumberField/NumberField.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {NumberFieldProps} from '@shopify/ui-extensions/admin'; - -export const NumberField = createRemoteComponent('ui-number-field'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/NumberField/examples/basic-numberfield.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/NumberField/examples/basic-numberfield.example.tsx deleted file mode 100644 index 65dd16ea3..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/NumberField/examples/basic-numberfield.example.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import {render, NumberField} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - -function App() { - return ; -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Option/examples/basic-option.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Option/examples/basic-option.example.tsx new file mode 100644 index 000000000..aaefd39e5 --- /dev/null +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Option/examples/basic-option.example.tsx @@ -0,0 +1,57 @@ +import React from 'react'; +import { + reactExtension, + Option, + Select, +} from '@shopify/ui-extensions-react/admin'; + +const options = [ + { + value: '1', + label: 'Australia', + }, + { + value: '2', + label: 'Canada', + }, + { + value: '3', + label: 'France', + }, + { + value: '4', + label: 'Japan', + }, + { + value: '5', + label: 'Nigeria', + }, + { + value: '6', + label: 'United States', + }, +]; + +function App() { + const [value, setValue] = React.useState('2'); + return ( + + ); +} + +export default reactExtension( + 'Playground', + () => , +); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Paragraph/Paragraph.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Paragraph/Paragraph.ts deleted file mode 100644 index d727b8839..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Paragraph/Paragraph.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {ParagraphProps} from '@shopify/ui-extensions/admin'; - -export const Paragraph = createRemoteComponent('ui-paragraph'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Paragraph/examples/basic-paragraph.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Paragraph/examples/basic-paragraph.example.tsx index 022b4c2db..4a3c2c962 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Paragraph/examples/basic-paragraph.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Paragraph/examples/basic-paragraph.example.tsx @@ -1,16 +1,26 @@ import { - render, - BlockStack, - Paragraph, + reactExtension, + Paragraph, + Stack, + Text, } from '@shopify/ui-extensions-react/admin'; -render('Playground', () => ); - function App() { - return ( - - Name: - Jane Doe - - ) + return ( + + + Name: + Jane Doe + + + ); } + +export default reactExtension( + 'Playground', + () => , +); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/PasswordField/PasswordField.ts b/packages/ui-extensions-react/src/surfaces/admin/components/PasswordField/PasswordField.ts deleted file mode 100644 index 68f167a40..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/PasswordField/PasswordField.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {PasswordFieldProps} from '@shopify/ui-extensions/admin'; - -export const PasswordField = createRemoteComponent('ui-password-field'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/PasswordField/examples/basic-passwordfield.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/PasswordField/examples/basic-passwordfield.example.tsx deleted file mode 100644 index a2ca1d62e..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/PasswordField/examples/basic-passwordfield.example.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { - render, - BlockStack, - TextField, - PasswordField -} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - -function App() { - return ( - - - - - ) -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Pressable/Pressable.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Pressable/Pressable.ts deleted file mode 100644 index fcca37def..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Pressable/Pressable.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {PressableProps} from '@shopify/ui-extensions/admin'; - -export const Pressable = createRemoteComponent('ui-pressable'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Pressable/examples/basic-pressable.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Pressable/examples/basic-pressable.example.tsx deleted file mode 100644 index 67efde16b..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Pressable/examples/basic-pressable.example.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { - reactExtension, - Icon, - InlineStack, - Pressable, - Text, -} from '@shopify/ui-extensions-react/admin'; - -reactExtension('Playground', () => ); - -function Extension() { - return ( - - - Go to Apps Dashboard - - - - ); -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/ProgressIndicator/ProgressIndicator.ts b/packages/ui-extensions-react/src/surfaces/admin/components/ProgressIndicator/ProgressIndicator.ts deleted file mode 100644 index b10c17719..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/ProgressIndicator/ProgressIndicator.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {ProgressIndicatorProps} from '@shopify/ui-extensions/admin'; - -export const ProgressIndicator = createRemoteComponent('ui-progress-indicator'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/ProgressIndicator/examples/basic-progressindicator.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/ProgressIndicator/examples/basic-progressindicator.example.tsx deleted file mode 100644 index 8b4968f5e..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/ProgressIndicator/examples/basic-progressindicator.example.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { - reactExtension, - ProgressIndicator, -} from '@shopify/ui-extensions-react/admin'; - -reactExtension('Playground', () => ); - -function App() { - return ( - - ); -} diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Section/Section.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Section/Section.ts deleted file mode 100644 index 6cc484c55..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Section/Section.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {SectionProps} from '@shopify/ui-extensions/admin'; - -export const Section = createRemoteComponent('ui-section'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Section/examples/basic-Section.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Section/examples/basic-section.example.tsx similarity index 70% rename from packages/ui-extensions-react/src/surfaces/admin/components/Section/examples/basic-Section.example.tsx rename to packages/ui-extensions-react/src/surfaces/admin/components/Section/examples/basic-section.example.tsx index 45538063f..9030c1e16 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Section/examples/basic-Section.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Section/examples/basic-section.example.tsx @@ -1,12 +1,9 @@ import React from 'react'; import { - render, + reactExtension, Section, } from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - function App() { return (
@@ -14,3 +11,8 @@ function App() {
); } + +export default reactExtension( + 'Playground', + () => , +); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Select/Select.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Select/Select.ts deleted file mode 100644 index 9f0b79f15..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Select/Select.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type { - SelectProps, - OptionDescription, - OptionGroupDescription, - OptionGroupProps, - OptionProps, -} from '@shopify/ui-extensions/admin'; - -export const Select = createRemoteComponent('ui-select'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Select/examples/basic-select.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Select/examples/basic-select.example.tsx index f9cec98b9..d28013aa6 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Select/examples/basic-select.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Select/examples/basic-select.example.tsx @@ -1,45 +1,56 @@ import React from 'react'; import { - render, + reactExtension, + Option, Select, } from '@shopify/ui-extensions-react/admin'; -render('Playground', () => ); +const options = [ + { + value: '1', + label: 'Australia', + }, + { + value: '2', + label: 'Canada', + }, + { + value: '3', + label: 'France', + }, + { + value: '4', + label: 'Japan', + }, + { + value: '5', + label: 'Nigeria', + }, + { + value: '6', + label: 'United States', + }, +]; function App() { const [value, setValue] = React.useState('2'); - return ( ); } +export default reactExtension( + 'Playground', + () => , +); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/InlineStack/examples/basic-inlinestack.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Stack/examples/basic-stack.example.tsx similarity index 61% rename from packages/ui-extensions-react/src/surfaces/admin/components/InlineStack/examples/basic-inlinestack.example.tsx rename to packages/ui-extensions-react/src/surfaces/admin/components/Stack/examples/basic-stack.example.tsx index d9fb203f8..e606b4cd8 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/InlineStack/examples/basic-inlinestack.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Stack/examples/basic-stack.example.tsx @@ -1,18 +1,21 @@ import React from 'react'; import { - render, - InlineStack, + reactExtension, + Stack, } from '@shopify/ui-extensions-react/admin'; -render('Playground', () => ); - function App() { return ( - + <>Child 1 <>Child 2 <>Child 3 <>Child 4 - + ); } + +export default reactExtension( + 'Playground', + () => , +); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Text/Text.ts b/packages/ui-extensions-react/src/surfaces/admin/components/Text/Text.ts deleted file mode 100644 index 8f040b4fc..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Text/Text.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {TextProps} from '@shopify/ui-extensions/admin'; - -export const Text = createRemoteComponent('ui-text'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/Text/examples/basic-text.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/Text/examples/basic-text.example.tsx index eee51ee38..71aa4abfd 100644 --- a/packages/ui-extensions-react/src/surfaces/admin/components/Text/examples/basic-text.example.tsx +++ b/packages/ui-extensions-react/src/surfaces/admin/components/Text/examples/basic-text.example.tsx @@ -1,12 +1,20 @@ -import {render, Text, BlockStack} from '@shopify/ui-extensions-react/admin'; +import { + reactExtension, + Text, + Stack, +} from '@shopify/ui-extensions-react/admin'; -render('Playground', () => ); +reactExtension('Playground', () => ); function App() { return ( - + Name: Jane Doe - + ); } diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/TextArea/TextArea.ts b/packages/ui-extensions-react/src/surfaces/admin/components/TextArea/TextArea.ts deleted file mode 100644 index a9f53e617..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/TextArea/TextArea.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {createRemoteComponent} from '../util'; - -export type {TextAreaProps} from '@shopify/ui-extensions/admin'; - -export const TextArea = createRemoteComponent('ui-text-area'); diff --git a/packages/ui-extensions-react/src/surfaces/admin/components/TextArea/examples/basic-textarea.example.tsx b/packages/ui-extensions-react/src/surfaces/admin/components/TextArea/examples/basic-textarea.example.tsx deleted file mode 100644 index d13515507..000000000 --- a/packages/ui-extensions-react/src/surfaces/admin/components/TextArea/examples/basic-textarea.example.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import {render, TextArea} from '@shopify/ui-extensions-react/admin'; - -render('Playground', () => ); - -function App() { - return