@shopify/ui-extensions 2.0.0-alpha.2 → 2022.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/checkout.esnext +1 -1
- package/checkout.js +1 -1
- package/checkout.mjs +1 -1
- package/index.esnext +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/loom.config.ts +9 -0
- package/package.json +10 -11
- package/src/api.ts +0 -5
- package/src/extension.ts +3 -29
- package/src/index.ts +1 -1
- package/src/surfaces/checkout/api/cart-line-details/render-after.ts +7 -3
- package/src/surfaces/checkout/api/shared.ts +810 -3
- package/src/surfaces/checkout/api/standard/standard.ts +1240 -2
- package/src/surfaces/checkout/components/Banner/Banner.ts +37 -0
- package/src/surfaces/checkout/components/Banner/README.md +14 -0
- package/src/surfaces/checkout/components/Banner/content/guidelines.md +9 -0
- package/src/surfaces/checkout/components/Banner/examples/basic-banner.example.ts +11 -0
- package/src/surfaces/checkout/components/BlockLayout/BlockLayout.ts +43 -0
- package/src/surfaces/checkout/components/BlockLayout/README.md +101 -0
- package/src/surfaces/checkout/components/BlockLayout/examples/basic-blockLayout.example.ts +16 -0
- package/src/surfaces/checkout/components/BlockSpacer/BlockSpacer.ts +25 -0
- package/src/surfaces/checkout/components/BlockSpacer/README.md +14 -0
- package/src/surfaces/checkout/components/BlockSpacer/examples/basic-blockspacer.example.ts +11 -0
- package/src/surfaces/checkout/components/BlockStack/BlockStack.ts +53 -0
- package/src/surfaces/checkout/components/BlockStack/README.md +77 -0
- package/src/surfaces/checkout/components/BlockStack/examples/basic-blockstack.example.ts +11 -0
- package/src/surfaces/checkout/components/Button/Button.ts +87 -0
- package/src/surfaces/checkout/components/Button/README.md +22 -0
- package/src/surfaces/checkout/components/Button/content/guidelines.md +10 -0
- package/src/surfaces/checkout/components/Button/examples/basic-button.example.ts +11 -0
- package/src/{components → surfaces/checkout/components}/Checkbox/Checkbox.ts +32 -1
- package/src/surfaces/checkout/components/Checkbox/README.md +18 -0
- package/src/surfaces/checkout/components/Checkbox/content/guidelines.md +9 -0
- package/src/surfaces/checkout/components/Checkbox/examples/basic-checkbox.example.ts +11 -0
- package/src/surfaces/checkout/components/Choice/Choice.ts +25 -0
- package/src/surfaces/checkout/components/Choice/README.md +14 -0
- package/src/surfaces/checkout/components/Choice/content/guidelines.md +9 -0
- package/src/surfaces/checkout/components/Choice/examples/basic-choice.example.ts +50 -0
- package/src/surfaces/checkout/components/ChoiceList/ChoiceList.ts +33 -0
- package/src/surfaces/checkout/components/ChoiceList/README.md +14 -0
- package/src/surfaces/checkout/components/ChoiceList/content/guidelines.md +10 -0
- package/src/surfaces/checkout/components/ChoiceList/examples/basic-choicelist.example.ts +50 -0
- package/src/surfaces/checkout/components/Divider/Divider.ts +33 -0
- package/src/surfaces/checkout/components/Divider/README.md +13 -0
- package/src/surfaces/checkout/components/Divider/examples/basic-divider.example.ts +7 -0
- package/src/surfaces/checkout/components/Form/Form.ts +30 -0
- package/src/surfaces/checkout/components/Form/README.md +21 -0
- package/src/surfaces/checkout/components/Form/content/guidelines.md +4 -0
- package/src/surfaces/checkout/components/Form/examples/basic-form.example.ts +48 -0
- package/src/surfaces/checkout/components/Grid/Grid.ts +104 -0
- package/src/surfaces/checkout/components/Grid/README.md +105 -0
- package/src/surfaces/checkout/components/Grid/content/guidelines.md +3 -0
- package/src/surfaces/checkout/components/Grid/examples/basic-grid.example.ts +45 -0
- package/src/surfaces/checkout/components/GridItem/GridItem.ts +42 -0
- package/src/surfaces/checkout/components/GridItem/README.md +72 -0
- package/src/surfaces/checkout/components/GridItem/content/guidelines.md +3 -0
- package/src/surfaces/checkout/components/GridItem/examples/basic-griditem.example.ts +42 -0
- package/src/surfaces/checkout/components/Heading/Heading.ts +44 -0
- package/src/surfaces/checkout/components/Heading/README.md +19 -0
- package/src/surfaces/checkout/components/Heading/content/guidelines.md +10 -0
- package/src/surfaces/checkout/components/Heading/examples/basic-heading.example.ts +7 -0
- package/src/surfaces/checkout/components/HeadingGroup/HeadingGroup.ts +15 -0
- package/src/surfaces/checkout/components/HeadingGroup/README.md +7 -0
- package/src/surfaces/checkout/components/HeadingGroup/content/guidelines.md +9 -0
- package/src/surfaces/checkout/components/HeadingGroup/examples/basic-headinggroup.example.ts +20 -0
- package/src/surfaces/checkout/components/Icon/Icon.ts +91 -0
- package/src/surfaces/checkout/components/Icon/README.md +15 -0
- package/src/surfaces/checkout/components/Icon/examples/basic-icon.example.ts +7 -0
- package/src/surfaces/checkout/components/Image/Image.ts +83 -0
- package/src/surfaces/checkout/components/Image/README.md +53 -0
- package/src/surfaces/checkout/components/Image/examples/basic-image.example.ts +10 -0
- package/src/surfaces/checkout/components/InlineLayout/InlineLayout.ts +49 -0
- package/src/surfaces/checkout/components/InlineLayout/README.md +103 -0
- package/src/surfaces/checkout/components/InlineLayout/examples/basic-inlineLayout.example.ts +16 -0
- package/src/surfaces/checkout/components/InlineSpacer/InlineSpacer.ts +24 -0
- package/src/surfaces/checkout/components/InlineSpacer/README.md +14 -0
- package/src/surfaces/checkout/components/InlineSpacer/examples/basic-inlinespacer.example.ts +16 -0
- package/src/surfaces/checkout/components/InlineStack/InlineStack.ts +63 -0
- package/src/surfaces/checkout/components/InlineStack/README.md +87 -0
- package/src/surfaces/checkout/components/InlineStack/examples/basic-inlinestack.example.ts +18 -0
- package/src/surfaces/checkout/components/Link/Link.ts +49 -0
- package/src/surfaces/checkout/components/Link/README.md +18 -0
- package/src/surfaces/checkout/components/Link/content/guidelines.md +9 -0
- package/src/surfaces/checkout/components/Link/examples/basic-link.example.ts +11 -0
- package/src/surfaces/checkout/components/List/List.ts +32 -0
- package/src/surfaces/checkout/components/List/README.md +19 -0
- package/src/surfaces/checkout/components/List/content/guidelines.md +11 -0
- package/src/surfaces/checkout/components/List/examples/basic-list.example.ts +11 -0
- package/src/surfaces/checkout/components/ListItem/ListItem.ts +12 -0
- package/src/surfaces/checkout/components/ListItem/README.md +5 -0
- package/src/surfaces/checkout/components/ListItem/content/guidelines.md +3 -0
- package/src/surfaces/checkout/components/ListItem/examples/basic-listitem.example.ts +9 -0
- package/src/surfaces/checkout/components/PhoneField/PhoneField.ts +77 -0
- package/src/surfaces/checkout/components/PhoneField/README.md +49 -0
- package/src/surfaces/checkout/components/PhoneField/examples/basic-phonefield.example.ts +10 -0
- package/src/surfaces/checkout/components/Pressable/Pressable.ts +128 -0
- package/src/surfaces/checkout/components/Pressable/README.md +74 -0
- package/src/surfaces/checkout/components/Pressable/examples/basic-pressable.example.ts +27 -0
- package/src/surfaces/checkout/components/ScrollView/README.md +62 -0
- package/src/surfaces/checkout/components/ScrollView/ScrollView.ts +76 -0
- package/src/surfaces/checkout/components/ScrollView/examples/basic-scrollview.example.ts +38 -0
- package/src/surfaces/checkout/components/Select/README.md +41 -0
- package/src/surfaces/checkout/components/Select/Select.ts +97 -0
- package/src/surfaces/checkout/components/Select/content/guidelines.md +4 -0
- package/src/surfaces/checkout/components/Select/examples/basic-select.example.ts +36 -0
- package/src/surfaces/checkout/components/SkeletonImage/README.md +13 -0
- package/src/surfaces/checkout/components/SkeletonImage/SkeletonImage.ts +27 -0
- package/src/surfaces/checkout/components/SkeletonImage/examples/basic-skeletonimage.example.ts +10 -0
- package/src/surfaces/checkout/components/SkeletonText/README.md +13 -0
- package/src/surfaces/checkout/components/SkeletonText/SkeletonText.ts +23 -0
- package/src/surfaces/checkout/components/SkeletonText/examples/basic-skeletontext.example.ts +7 -0
- package/src/surfaces/checkout/components/SkeletonTextBlock/README.md +13 -0
- package/src/surfaces/checkout/components/SkeletonTextBlock/SkeletonTextBlock.ts +24 -0
- package/src/surfaces/checkout/components/SkeletonTextBlock/examples/basic-skeletontextblock.example.ts +7 -0
- package/src/surfaces/checkout/components/Spinner/README.md +14 -0
- package/src/surfaces/checkout/components/Spinner/Spinner.ts +35 -0
- package/src/surfaces/checkout/components/Spinner/examples/basic-spinner.example.ts +7 -0
- package/src/surfaces/checkout/components/Stepper/README.md +28 -0
- package/src/surfaces/checkout/components/Stepper/Stepper.ts +63 -0
- package/src/surfaces/checkout/components/Stepper/content/guidelines.md +4 -0
- package/src/surfaces/checkout/components/Stepper/examples/basic-stepper.example.ts +10 -0
- package/src/surfaces/checkout/components/Tag/README.md +14 -0
- package/src/surfaces/checkout/components/Tag/Tag.ts +26 -0
- package/src/surfaces/checkout/components/Tag/examples/basic-tag.example.ts +7 -0
- package/src/surfaces/checkout/components/Text/README.md +17 -0
- package/src/surfaces/checkout/components/Text/Text.ts +44 -0
- package/src/surfaces/checkout/components/Text/content/guidelines.md +10 -0
- package/src/surfaces/checkout/components/Text/examples/basic-text.example.ts +14 -0
- package/src/surfaces/checkout/components/TextBlock/README.md +15 -0
- package/src/surfaces/checkout/components/TextBlock/TextBlock.ts +38 -0
- package/src/surfaces/checkout/components/TextBlock/content/guidelines.md +9 -0
- package/src/surfaces/checkout/components/TextBlock/examples/basic-textblock.example.ts +18 -0
- package/src/surfaces/checkout/components/TextField/README.md +49 -0
- package/src/surfaces/checkout/components/TextField/TextField.ts +173 -0
- package/src/surfaces/checkout/components/TextField/content/guidelines.md +5 -0
- package/src/surfaces/checkout/components/TextField/examples/basic-textfield.example.ts +9 -0
- package/src/surfaces/checkout/components/Tooltip/README.md +8 -0
- package/src/surfaces/checkout/components/Tooltip/Tooltip.ts +15 -0
- package/src/surfaces/checkout/components/Tooltip/examples/basic-tooltip.example.ts +23 -0
- package/src/surfaces/checkout/components/View/README.md +97 -0
- package/src/surfaces/checkout/components/View/View.ts +196 -0
- package/src/surfaces/checkout/components/View/examples/basic-view.example.ts +11 -0
- package/src/surfaces/checkout/components/shared.ts +560 -0
- package/src/surfaces/checkout/components.ts +155 -1
- package/src/surfaces/checkout/extension-points.ts +83 -3
- package/src/surfaces/checkout/globals.ts +15 -0
- package/src/surfaces/checkout/index.ts +2 -0
- package/src/surfaces/checkout/style/isEqual.test.ts +67 -0
- package/src/surfaces/checkout/style/isEqual.ts +41 -0
- package/src/surfaces/checkout/style/memoize.ts +176 -0
- package/src/surfaces/checkout/style/style.test.ts +131 -0
- package/src/surfaces/checkout/style/style.ts +161 -0
- package/src/surfaces/checkout/style/types.ts +67 -0
- package/src/surfaces/checkout/style.ts +16 -0
- package/src/utilities/registration.ts +9 -42
- package/LICENSE.md +0 -7
- package/admin.d.ts +0 -1
- package/admin.esnext +0 -1
- package/admin.js +0 -1
- package/admin.mjs +0 -1
- package/build/cjs/api.js +0 -1
- package/build/cjs/components/BlockStack/BlockStack.js +0 -11
- package/build/cjs/components/BlockStack/README.md +0 -1
- package/build/cjs/components/Button/Button.js +0 -11
- package/build/cjs/components/Button/README.md +0 -1
- package/build/cjs/components/Checkbox/Checkbox.js +0 -14
- package/build/cjs/components/Checkbox/README.md +0 -1
- package/build/cjs/components/Text/README.md +0 -1
- package/build/cjs/components/Text/Text.js +0 -11
- package/build/cjs/components/TextField/README.md +0 -1
- package/build/cjs/components/TextField/TextField.js +0 -11
- package/build/cjs/components/View/README.md +0 -1
- package/build/cjs/components/View/View.js +0 -11
- package/build/cjs/components.js +0 -53
- package/build/cjs/extension.js +0 -1
- package/build/cjs/index.js +0 -44
- package/build/cjs/surfaces/admin/api/checkout-editor/README.md +0 -1
- package/build/cjs/surfaces/admin/api/checkout-editor/render-settings.js +0 -1
- package/build/cjs/surfaces/admin/api/standard/README.md +0 -1
- package/build/cjs/surfaces/admin/api/standard/standard.js +0 -1
- package/build/cjs/surfaces/admin/api.js +0 -1
- package/build/cjs/surfaces/admin/components/TextField/TextField.js +0 -11
- package/build/cjs/surfaces/admin/components.js +0 -30
- package/build/cjs/surfaces/admin/extension-points.js +0 -1
- package/build/cjs/surfaces/admin/extension.js +0 -27
- package/build/cjs/surfaces/admin/index.js +0 -70
- package/build/cjs/surfaces/admin/shared.js +0 -1
- package/build/cjs/surfaces/checkout/api/cart-line-details/README.md +0 -1
- package/build/cjs/surfaces/checkout/api/cart-line-details/render-after.js +0 -1
- package/build/cjs/surfaces/checkout/api/shared.js +0 -1
- package/build/cjs/surfaces/checkout/api/standard/README.md +0 -1
- package/build/cjs/surfaces/checkout/api/standard/standard.js +0 -1
- package/build/cjs/surfaces/checkout/api.js +0 -1
- package/build/cjs/surfaces/checkout/components.js +0 -18
- package/build/cjs/surfaces/checkout/extension-points.js +0 -1
- package/build/cjs/surfaces/checkout/extension.js +0 -27
- package/build/cjs/surfaces/checkout/index.js +0 -70
- package/build/cjs/surfaces/checkout/shared.js +0 -1
- package/build/cjs/utilities/registration.js +0 -110
- package/build/esm/api.mjs +0 -0
- package/build/esm/components/BlockStack/BlockStack.mjs +0 -2
- package/build/esm/components/BlockStack/README.md +0 -1
- package/build/esm/components/Button/Button.mjs +0 -2
- package/build/esm/components/Button/README.md +0 -1
- package/build/esm/components/Checkbox/Checkbox.mjs +0 -6
- package/build/esm/components/Checkbox/README.md +0 -1
- package/build/esm/components/Text/README.md +0 -1
- package/build/esm/components/Text/Text.mjs +0 -2
- package/build/esm/components/TextField/README.md +0 -1
- package/build/esm/components/TextField/TextField.mjs +0 -2
- package/build/esm/components/View/README.md +0 -1
- package/build/esm/components/View/View.mjs +0 -2
- package/build/esm/components.mjs +0 -6
- package/build/esm/extension.mjs +0 -0
- package/build/esm/index.mjs +0 -3
- package/build/esm/surfaces/admin/api/checkout-editor/README.md +0 -1
- package/build/esm/surfaces/admin/api/checkout-editor/render-settings.mjs +0 -0
- package/build/esm/surfaces/admin/api/standard/README.md +0 -1
- package/build/esm/surfaces/admin/api/standard/standard.mjs +0 -0
- package/build/esm/surfaces/admin/api.mjs +0 -0
- package/build/esm/surfaces/admin/components/TextField/TextField.mjs +0 -2
- package/build/esm/surfaces/admin/components.mjs +0 -2
- package/build/esm/surfaces/admin/extension-points.mjs +0 -0
- package/build/esm/surfaces/admin/extension.mjs +0 -3
- package/build/esm/surfaces/admin/index.mjs +0 -5
- package/build/esm/surfaces/admin/shared.mjs +0 -0
- package/build/esm/surfaces/checkout/api/cart-line-details/README.md +0 -1
- package/build/esm/surfaces/checkout/api/cart-line-details/render-after.mjs +0 -0
- package/build/esm/surfaces/checkout/api/shared.mjs +0 -0
- package/build/esm/surfaces/checkout/api/standard/README.md +0 -1
- package/build/esm/surfaces/checkout/api/standard/standard.mjs +0 -0
- package/build/esm/surfaces/checkout/api.mjs +0 -0
- package/build/esm/surfaces/checkout/components.mjs +0 -1
- package/build/esm/surfaces/checkout/extension-points.mjs +0 -0
- package/build/esm/surfaces/checkout/extension.mjs +0 -3
- package/build/esm/surfaces/checkout/index.mjs +0 -5
- package/build/esm/surfaces/checkout/shared.mjs +0 -0
- package/build/esm/utilities/registration.mjs +0 -101
- package/build/esnext/api.esnext +0 -0
- package/build/esnext/components/BlockStack/BlockStack.esnext +0 -2
- package/build/esnext/components/BlockStack/README.md +0 -1
- package/build/esnext/components/Button/Button.esnext +0 -2
- package/build/esnext/components/Button/README.md +0 -1
- package/build/esnext/components/Checkbox/Checkbox.esnext +0 -6
- package/build/esnext/components/Checkbox/README.md +0 -1
- package/build/esnext/components/Text/README.md +0 -1
- package/build/esnext/components/Text/Text.esnext +0 -2
- package/build/esnext/components/TextField/README.md +0 -1
- package/build/esnext/components/TextField/TextField.esnext +0 -2
- package/build/esnext/components/View/README.md +0 -1
- package/build/esnext/components/View/View.esnext +0 -2
- package/build/esnext/components.esnext +0 -6
- package/build/esnext/extension.esnext +0 -0
- package/build/esnext/index.esnext +0 -3
- package/build/esnext/surfaces/admin/api/checkout-editor/README.md +0 -1
- package/build/esnext/surfaces/admin/api/checkout-editor/render-settings.esnext +0 -0
- package/build/esnext/surfaces/admin/api/standard/README.md +0 -1
- package/build/esnext/surfaces/admin/api/standard/standard.esnext +0 -0
- package/build/esnext/surfaces/admin/api.esnext +0 -0
- package/build/esnext/surfaces/admin/components/TextField/TextField.esnext +0 -2
- package/build/esnext/surfaces/admin/components.esnext +0 -2
- package/build/esnext/surfaces/admin/extension-points.esnext +0 -0
- package/build/esnext/surfaces/admin/extension.esnext +0 -3
- package/build/esnext/surfaces/admin/index.esnext +0 -5
- package/build/esnext/surfaces/admin/shared.esnext +0 -0
- package/build/esnext/surfaces/checkout/api/cart-line-details/README.md +0 -1
- package/build/esnext/surfaces/checkout/api/cart-line-details/render-after.esnext +0 -0
- package/build/esnext/surfaces/checkout/api/shared.esnext +0 -0
- package/build/esnext/surfaces/checkout/api/standard/README.md +0 -1
- package/build/esnext/surfaces/checkout/api/standard/standard.esnext +0 -0
- package/build/esnext/surfaces/checkout/api.esnext +0 -0
- package/build/esnext/surfaces/checkout/components.esnext +0 -1
- package/build/esnext/surfaces/checkout/extension-points.esnext +0 -0
- package/build/esnext/surfaces/checkout/extension.esnext +0 -3
- package/build/esnext/surfaces/checkout/index.esnext +0 -5
- package/build/esnext/surfaces/checkout/shared.esnext +0 -0
- package/build/esnext/utilities/registration.esnext +0 -37
- package/build/node/api.js +0 -1
- package/build/node/components/BlockStack/BlockStack.js +0 -11
- package/build/node/components/BlockStack/README.md +0 -1
- package/build/node/components/Button/Button.js +0 -11
- package/build/node/components/Button/README.md +0 -1
- package/build/node/components/Checkbox/Checkbox.js +0 -14
- package/build/node/components/Checkbox/README.md +0 -1
- package/build/node/components/Text/README.md +0 -1
- package/build/node/components/Text/Text.js +0 -11
- package/build/node/components/TextField/README.md +0 -1
- package/build/node/components/TextField/TextField.js +0 -11
- package/build/node/components/View/README.md +0 -1
- package/build/node/components/View/View.js +0 -11
- package/build/node/components.js +0 -53
- package/build/node/extension.js +0 -1
- package/build/node/index.js +0 -44
- package/build/node/surfaces/admin/api/checkout-editor/README.md +0 -1
- package/build/node/surfaces/admin/api/checkout-editor/render-settings.js +0 -1
- package/build/node/surfaces/admin/api/standard/README.md +0 -1
- package/build/node/surfaces/admin/api/standard/standard.js +0 -1
- package/build/node/surfaces/admin/api.js +0 -1
- package/build/node/surfaces/admin/components/TextField/TextField.js +0 -11
- package/build/node/surfaces/admin/components.js +0 -30
- package/build/node/surfaces/admin/extension-points.js +0 -1
- package/build/node/surfaces/admin/extension.js +0 -27
- package/build/node/surfaces/admin/index.js +0 -70
- package/build/node/surfaces/admin/shared.js +0 -1
- package/build/node/surfaces/checkout/api/cart-line-details/README.md +0 -1
- package/build/node/surfaces/checkout/api/cart-line-details/render-after.js +0 -1
- package/build/node/surfaces/checkout/api/shared.js +0 -1
- package/build/node/surfaces/checkout/api/standard/README.md +0 -1
- package/build/node/surfaces/checkout/api/standard/standard.js +0 -1
- package/build/node/surfaces/checkout/api.js +0 -1
- package/build/node/surfaces/checkout/components.js +0 -18
- package/build/node/surfaces/checkout/extension-points.js +0 -1
- package/build/node/surfaces/checkout/extension.js +0 -27
- package/build/node/surfaces/checkout/index.js +0 -70
- package/build/node/surfaces/checkout/shared.js +0 -1
- package/build/node/utilities/registration.js +0 -44
- package/build/ts/api.d.ts +0 -8
- package/build/ts/api.d.ts.map +0 -1
- package/build/ts/api.js +0 -2
- package/build/ts/components/BlockStack/BlockStack.d.ts +0 -8
- package/build/ts/components/BlockStack/BlockStack.d.ts.map +0 -1
- package/build/ts/components/BlockStack/BlockStack.js +0 -5
- package/build/ts/components/Button/Button.d.ts +0 -12
- package/build/ts/components/Button/Button.d.ts.map +0 -1
- package/build/ts/components/Button/Button.js +0 -5
- package/build/ts/components/Checkbox/Checkbox.d.ts +0 -30
- package/build/ts/components/Checkbox/Checkbox.d.ts.map +0 -1
- package/build/ts/components/Checkbox/Checkbox.js +0 -8
- package/build/ts/components/Text/Text.d.ts +0 -8
- package/build/ts/components/Text/Text.d.ts.map +0 -1
- package/build/ts/components/Text/Text.js +0 -5
- package/build/ts/components/TextField/TextField.d.ts +0 -53
- package/build/ts/components/TextField/TextField.d.ts.map +0 -1
- package/build/ts/components/TextField/TextField.js +0 -5
- package/build/ts/components/View/View.d.ts +0 -8
- package/build/ts/components/View/View.d.ts.map +0 -1
- package/build/ts/components/View/View.js +0 -5
- package/build/ts/components.d.ts +0 -13
- package/build/ts/components.d.ts.map +0 -1
- package/build/ts/components.js +0 -15
- package/build/ts/extension.d.ts +0 -15
- package/build/ts/extension.d.ts.map +0 -1
- package/build/ts/extension.js +0 -2
- package/build/ts/index.d.ts +0 -4
- package/build/ts/index.d.ts.map +0 -1
- package/build/ts/index.js +0 -19
- package/build/ts/surfaces/admin/api/checkout-editor/render-settings.d.ts +0 -19
- package/build/ts/surfaces/admin/api/checkout-editor/render-settings.d.ts.map +0 -1
- package/build/ts/surfaces/admin/api/checkout-editor/render-settings.js +0 -2
- package/build/ts/surfaces/admin/api/standard/standard.d.ts +0 -7
- package/build/ts/surfaces/admin/api/standard/standard.d.ts.map +0 -1
- package/build/ts/surfaces/admin/api/standard/standard.js +0 -2
- package/build/ts/surfaces/admin/api.d.ts +0 -3
- package/build/ts/surfaces/admin/api.d.ts.map +0 -1
- package/build/ts/surfaces/admin/api.js +0 -2
- package/build/ts/surfaces/admin/components/TextField/TextField.d.ts +0 -15
- package/build/ts/surfaces/admin/components/TextField/TextField.d.ts.map +0 -1
- package/build/ts/surfaces/admin/components/TextField/TextField.js +0 -5
- package/build/ts/surfaces/admin/components.d.ts +0 -4
- package/build/ts/surfaces/admin/components.d.ts.map +0 -1
- package/build/ts/surfaces/admin/components.js +0 -20
- package/build/ts/surfaces/admin/extension-points.d.ts +0 -9
- package/build/ts/surfaces/admin/extension-points.d.ts.map +0 -1
- package/build/ts/surfaces/admin/extension-points.js +0 -2
- package/build/ts/surfaces/admin/extension.d.ts +0 -4
- package/build/ts/surfaces/admin/extension.d.ts.map +0 -1
- package/build/ts/surfaces/admin/extension.js +0 -20
- package/build/ts/surfaces/admin/index.d.ts +0 -6
- package/build/ts/surfaces/admin/index.d.ts.map +0 -1
- package/build/ts/surfaces/admin/index.js +0 -21
- package/build/ts/surfaces/admin/shared.d.ts +0 -8
- package/build/ts/surfaces/admin/shared.d.ts.map +0 -1
- package/build/ts/surfaces/admin/shared.js +0 -2
- package/build/ts/surfaces/checkout/api/cart-line-details/render-after.d.ts +0 -6
- package/build/ts/surfaces/checkout/api/cart-line-details/render-after.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/api/cart-line-details/render-after.js +0 -2
- package/build/ts/surfaces/checkout/api/shared.d.ts +0 -4
- package/build/ts/surfaces/checkout/api/shared.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/api/shared.js +0 -2
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts +0 -7
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/api/standard/standard.js +0 -2
- package/build/ts/surfaces/checkout/api.d.ts +0 -3
- package/build/ts/surfaces/checkout/api.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/api.js +0 -2
- package/build/ts/surfaces/checkout/components.d.ts +0 -2
- package/build/ts/surfaces/checkout/components.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/components.js +0 -17
- package/build/ts/surfaces/checkout/extension-points.d.ts +0 -10
- package/build/ts/surfaces/checkout/extension-points.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/extension-points.js +0 -2
- package/build/ts/surfaces/checkout/extension.d.ts +0 -4
- package/build/ts/surfaces/checkout/extension.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/extension.js +0 -20
- package/build/ts/surfaces/checkout/index.d.ts +0 -6
- package/build/ts/surfaces/checkout/index.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/index.js +0 -21
- package/build/ts/surfaces/checkout/shared.d.ts +0 -8
- package/build/ts/surfaces/checkout/shared.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/shared.js +0 -2
- package/build/ts/utilities/registration.d.ts +0 -13
- package/build/ts/utilities/registration.d.ts.map +0 -1
- package/build/ts/utilities/registration.js +0 -111
- package/build/tsconfig.tsbuildinfo +0 -1
- package/checkout.d.ts +0 -1
- package/index.d.ts +0 -1
- package/sewing-kit.config.ts +0 -9
- package/src/components/BlockStack/BlockStack.ts +0 -7
- package/src/components/BlockStack/README.md +0 -1
- package/src/components/Button/Button.ts +0 -10
- package/src/components/Button/README.md +0 -1
- package/src/components/Checkbox/README.md +0 -1
- package/src/components/Text/README.md +0 -1
- package/src/components/Text/Text.ts +0 -5
- package/src/components/TextField/README.md +0 -1
- package/src/components/TextField/TextField.ts +0 -56
- package/src/components/View/README.md +0 -1
- package/src/components/View/View.ts +0 -5
- package/src/components.ts +0 -17
- package/src/surfaces/admin/api/checkout-editor/README.md +0 -1
- package/src/surfaces/admin/api/checkout-editor/render-settings.ts +0 -26
- package/src/surfaces/admin/api/standard/README.md +0 -1
- package/src/surfaces/admin/api/standard/standard.ts +0 -8
- package/src/surfaces/admin/api.ts +0 -2
- package/src/surfaces/admin/components/TextField/TextField.ts +0 -16
- package/src/surfaces/admin/components.ts +0 -4
- package/src/surfaces/admin/extension-points.ts +0 -17
- package/src/surfaces/admin/extension.ts +0 -7
- package/src/surfaces/admin/index.ts +0 -5
- package/src/surfaces/admin/shared.ts +0 -14
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {createRemoteComponent} from '@remote-ui/core';
|
|
2
|
+
|
|
3
|
+
import {Autocomplete} from '../shared';
|
|
4
|
+
|
|
5
|
+
interface Option {
|
|
6
|
+
/**
|
|
7
|
+
* The value that will be passed to the select’s `onChange` callback
|
|
8
|
+
* when this option is selected.
|
|
9
|
+
*/
|
|
10
|
+
value: string;
|
|
11
|
+
/**
|
|
12
|
+
* The buyer-facing label for this option.
|
|
13
|
+
*/
|
|
14
|
+
label: string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether this option can be selected or not.
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface SelectProps {
|
|
22
|
+
/**
|
|
23
|
+
* A unique identifier for the field. When no `id` is set,
|
|
24
|
+
* a globally unique value will be used instead.
|
|
25
|
+
*/
|
|
26
|
+
id?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Content to use as the field label.
|
|
29
|
+
*/
|
|
30
|
+
label: string;
|
|
31
|
+
/**
|
|
32
|
+
* An identifier for the field that is unique within the nearest
|
|
33
|
+
* containing `Form` component.
|
|
34
|
+
*/
|
|
35
|
+
name?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The active option for the select. This should match to one of the
|
|
38
|
+
* `value` properties in the `options` prop. When not set,
|
|
39
|
+
* the value will default to an empty string, which will show the
|
|
40
|
+
* `placeholder` text as the "selected value".
|
|
41
|
+
*/
|
|
42
|
+
value?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The options a buyer can select from.
|
|
45
|
+
*/
|
|
46
|
+
options: Option[];
|
|
47
|
+
/**
|
|
48
|
+
* Whether the field needs a value. This requirement adds semantic value
|
|
49
|
+
* to the field, but it will not cause an error to appear automatically.
|
|
50
|
+
* If you want to present an error when this field is empty, you can do
|
|
51
|
+
* so with the `error` prop.
|
|
52
|
+
*/
|
|
53
|
+
required?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the select can be changed.
|
|
56
|
+
*/
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the field is read only
|
|
60
|
+
*/
|
|
61
|
+
readonly?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Indicate an error to the user. The field will be given a specific stylistic treatment
|
|
64
|
+
* to communicate problems that have to be resolved immediately.
|
|
65
|
+
*/
|
|
66
|
+
error?: string;
|
|
67
|
+
/**
|
|
68
|
+
* A hint as to the intended content of the field.
|
|
69
|
+
*
|
|
70
|
+
* When set to `true`, this property indicates that the field should support
|
|
71
|
+
* autofill, but you do not have any more semantic information on the intended
|
|
72
|
+
* contents.
|
|
73
|
+
*
|
|
74
|
+
* When set to `false`, you are indicating that this field contains sensitive
|
|
75
|
+
* information, or contents that are never saved, like one-time codes. Note that
|
|
76
|
+
* it is impossible to prevent autocomplete in some browsers, so do not depend on
|
|
77
|
+
* its absence.
|
|
78
|
+
*
|
|
79
|
+
* Alternatively, you can provide an `Autocomplete` object, which describes the
|
|
80
|
+
* specific data you would like to be entered into this field during autocomplete.
|
|
81
|
+
*/
|
|
82
|
+
autocomplete?: Autocomplete | boolean;
|
|
83
|
+
/**
|
|
84
|
+
* A callback that is run whenever the selected option changes. This callback
|
|
85
|
+
* is called with the string `value` of the selected `option`. This component
|
|
86
|
+
* is [controlled](https://reactjs.org/docs/forms.html#controlled-components),
|
|
87
|
+
* so you must store this value in state and reflect it back in the `value`
|
|
88
|
+
* prop of the select.
|
|
89
|
+
*/
|
|
90
|
+
onChange?(value: string): void;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Selects let buyers choose one option from an options menu. Consider select
|
|
95
|
+
* when you have 4 or more options, to avoid cluttering the interface.
|
|
96
|
+
*/
|
|
97
|
+
export const Select = createRemoteComponent<'Select', SelectProps>('Select');
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {extend, Select} from '@shopify/checkout-ui-extensions';
|
|
2
|
+
|
|
3
|
+
extend('Checkout::Dynamic::Render', (root) => {
|
|
4
|
+
const select = root.createComponent(Select, {
|
|
5
|
+
label: 'Country',
|
|
6
|
+
value: '2',
|
|
7
|
+
options: [
|
|
8
|
+
{
|
|
9
|
+
value: '1',
|
|
10
|
+
label: 'Australia',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
value: '2',
|
|
14
|
+
label: 'Canada',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
value: '3',
|
|
18
|
+
label: 'France',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
value: '4',
|
|
22
|
+
label: 'Japan',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: '5',
|
|
26
|
+
label: 'Nigeria',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: '6',
|
|
30
|
+
label: 'United States',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
root.appendChild(select);
|
|
36
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# SkeletonImage
|
|
2
|
+
|
|
3
|
+
SkeletonImage is used to provide a low fidelity representation of an image before it appears on the page.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
optional = ?
|
|
8
|
+
|
|
9
|
+
| Name | Type | Description |
|
|
10
|
+
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
11
|
+
| blockSize? | <code>number | `${number}%` | "fill" | ConditionalStyle<<wbr>number | `${number}%` | "fill", AcceptedConditions<wbr>></code> | Adjust the block size of the skeleton. |
|
|
12
|
+
| inlineSize? | <code>number | `${number}%` | "fill" | ConditionalStyle<<wbr>number | `${number}%` | "fill", AcceptedConditions<wbr>></code> | Adjust the inline size of the skeleton. |
|
|
13
|
+
| aspectRatio? | <code>number</code> | Displays the skeleton at the specified aspect ratio (fills the width of the parent container and sets the height accordingly). |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {createRemoteComponent} from '@remote-ui/core';
|
|
2
|
+
|
|
3
|
+
import {MaybeResponsiveConditionalStyle} from '../../style';
|
|
4
|
+
|
|
5
|
+
export interface SkeletonImageProps {
|
|
6
|
+
/**
|
|
7
|
+
* Adjust the block size of the skeleton.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
blockSize?: MaybeResponsiveConditionalStyle<number | `${number}%` | 'fill'>;
|
|
11
|
+
/**
|
|
12
|
+
* Adjust the inline size of the skeleton.
|
|
13
|
+
*/
|
|
14
|
+
inlineSize?: MaybeResponsiveConditionalStyle<number | `${number}%` | 'fill'>;
|
|
15
|
+
/**
|
|
16
|
+
* Displays the skeleton at the specified aspect ratio (fills the width of the
|
|
17
|
+
* parent container and sets the height accordingly).
|
|
18
|
+
*/
|
|
19
|
+
aspectRatio?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* SkeletonImage is used to provide a low fidelity representation of an image before it appears on the page.
|
|
23
|
+
*/
|
|
24
|
+
export const SkeletonImage = createRemoteComponent<
|
|
25
|
+
'SkeletonImage',
|
|
26
|
+
SkeletonImageProps
|
|
27
|
+
>('SkeletonImage');
|
package/src/surfaces/checkout/components/SkeletonImage/examples/basic-skeletonimage.example.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {extend, SkeletonImage} from '@shopify/checkout-ui-extensions';
|
|
2
|
+
|
|
3
|
+
extend('Checkout::Dynamic::Render', (root) => {
|
|
4
|
+
const skeletonImage = root.createComponent(SkeletonImage, {
|
|
5
|
+
inlineSize: 300,
|
|
6
|
+
blockSize: 300,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
root.appendChild(skeletonImage);
|
|
10
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# SkeletonText
|
|
2
|
+
|
|
3
|
+
SkeletonText is used to provide a low fidelity representation of text content before it appears on the page.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
optional = ?
|
|
8
|
+
|
|
9
|
+
| Name | Type | Description |
|
|
10
|
+
| ----------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
11
|
+
| emphasis? | <code>"bold"</code> | Use to emphasize a word or a group of words. |
|
|
12
|
+
| inlineSize? | <code>"small" | "base" | "large"</code> | Adjust the length of the text when no children are passed. |
|
|
13
|
+
| size? | <code>"extraSmall" | "small" | "base" | "large" | "extraLarge" | "medium"</code> | Size of the text |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {createRemoteComponent} from '@remote-ui/core';
|
|
2
|
+
|
|
3
|
+
import type {Size} from '../shared';
|
|
4
|
+
import type {TextProps} from '../Text/Text';
|
|
5
|
+
|
|
6
|
+
export interface SkeletonTextProps extends Pick<TextProps, 'size'> {
|
|
7
|
+
/**
|
|
8
|
+
* Use to emphasize a word or a group of words.
|
|
9
|
+
*/
|
|
10
|
+
emphasis?: 'bold';
|
|
11
|
+
/**
|
|
12
|
+
* Adjust the length of the text when no children are passed.
|
|
13
|
+
*/
|
|
14
|
+
inlineSize?: Extract<Size, 'small' | 'base' | 'large'>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* SkeletonText is used to provide a low fidelity representation of text content before it appears on the page.
|
|
19
|
+
*/
|
|
20
|
+
export const SkeletonText = createRemoteComponent<
|
|
21
|
+
'SkeletonText',
|
|
22
|
+
SkeletonTextProps
|
|
23
|
+
>('SkeletonText');
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# SkeletonTextBlock
|
|
2
|
+
|
|
3
|
+
SkeletonTextBlock is used to provide a low fidelity representation of a block of text before it appears on the page.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
optional = ?
|
|
8
|
+
|
|
9
|
+
| Name | Type | Description |
|
|
10
|
+
| --------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
11
|
+
| emphasis? | <code>"bold"</code> | Use to emphasize a word or a group of words. |
|
|
12
|
+
| lines? | <code>number</code> | Number of lines to display when no children are passed.<br /><br />Default value: <code>1</code> |
|
|
13
|
+
| size? | <code>"extraSmall" | "small" | "base" | "large" | "extraLarge" | "medium"</code> | Size of the text |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {createRemoteComponent} from '@remote-ui/core';
|
|
2
|
+
|
|
3
|
+
import type {TextBlockProps} from '../TextBlock/TextBlock';
|
|
4
|
+
|
|
5
|
+
export interface SkeletonTextBlockProps extends Pick<TextBlockProps, 'size'> {
|
|
6
|
+
/**
|
|
7
|
+
* Use to emphasize a word or a group of words.
|
|
8
|
+
*/
|
|
9
|
+
emphasis?: 'bold';
|
|
10
|
+
/**
|
|
11
|
+
* Number of lines to display when no children are passed.
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue 1
|
|
14
|
+
*/
|
|
15
|
+
lines?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* SkeletonTextBlock is used to provide a low fidelity representation of a block of text before it appears on the page.
|
|
20
|
+
*/
|
|
21
|
+
export const SkeletonTextBlock = createRemoteComponent<
|
|
22
|
+
'SkeletonTextBlock',
|
|
23
|
+
SkeletonTextBlockProps
|
|
24
|
+
>('SkeletonTextBlock');
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Spinner
|
|
2
|
+
|
|
3
|
+
Spinner is used to notify buyers that their action is being processed.
|
|
4
|
+
The Spinner is usually used when sending or receiving data from a server.
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
optional = ?
|
|
9
|
+
|
|
10
|
+
| Name | Type | Description |
|
|
11
|
+
| ------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
12
|
+
| size? | <code>"extraSmall" | "small" | "base" | "large" | "fill"</code> | Adjusts the size of the icon.<br /><br />Default value: <code>'base'</code> |
|
|
13
|
+
| appearance? | <code>"accent" | "monochrome"</code> | Sets the appearance (color) of the icon.<br /><br /><code>"accent"</code>: Use to convey emphasis and draw attention to the icon.<br /><br /><code>"monochrome"</code>: Will take the color of its parent<br /><br />Default value: <code>'accent'</code> |
|
|
14
|
+
| accessibilityLabel? | <code>string</code> | A label to use for the Spinner that will be used for buyers using assistive technologies like screen readers. If will also be used to replace the animated loading indicator when buyers prefers reduced motion. If not included, it will use the loading indicator for all buyers. |
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {createRemoteComponent} from '@remote-ui/core';
|
|
2
|
+
|
|
3
|
+
import type {Size, Appearance} from '../shared';
|
|
4
|
+
|
|
5
|
+
export interface SpinnerProps {
|
|
6
|
+
/**
|
|
7
|
+
* Adjusts the size of the icon.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue 'base'
|
|
10
|
+
*/
|
|
11
|
+
size?: Extract<Size, 'extraSmall' | 'small' | 'base' | 'large' | 'fill'>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Sets the appearance (color) of the icon.
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue 'accent'
|
|
17
|
+
*/
|
|
18
|
+
appearance?: Extract<Appearance, 'accent' | 'monochrome'>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A label to use for the Spinner that will be used for buyers using
|
|
22
|
+
* assistive technologies like screen readers. If will also be used to replace
|
|
23
|
+
* the animated loading indicator when buyers prefers reduced motion. If not included,
|
|
24
|
+
* it will use the loading indicator for all buyers.
|
|
25
|
+
*/
|
|
26
|
+
accessibilityLabel?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Spinner is used to notify buyers that their action is being processed.
|
|
31
|
+
* The Spinner is usually used when sending or receiving data from a server.
|
|
32
|
+
*/
|
|
33
|
+
export const Spinner = createRemoteComponent<'Spinner', SpinnerProps>(
|
|
34
|
+
'Spinner',
|
|
35
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Stepper
|
|
2
|
+
|
|
3
|
+
Use a stepper to increase or decrease a value, like changing the quantity from 1 to 2.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
optional = ?
|
|
8
|
+
|
|
9
|
+
| Name | Type | Description |
|
|
10
|
+
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| icon? | <code>"arrowLeft" | "arrowRight" | "arrowUp" | "arrowUpRight" | "arrowDown" | "bag" | "calendar" | "camera" | "caretDown" | "cart" | "checkmark" | "chevronDown" | "chevronUp" | "chevronRight" | "chevronLeft" | "close" | "critical" | "discount" | "delivered" | "delivery" | "disabled" | "email" | "errorFill" | "geolocation" | "grid" | "hamburger" | "horizontalDots" | "info" | "infoFill" | "list" | "lock" | "magnify" | "map" | "marker" | "minus" | "mobile" | "note" | "pen" | "verticalDots" | "plus" | "questionFill" | "reorder" | "store" | "success" | "truck" | "warning" | "warningFill" | "giftFill" | "external" | "profile"</code> | An icon to render at the start of the field. |
|
|
12
|
+
| max? | <code>number</code> | The highest decimal or integer to be accepted for the stepper field. When used with `step` the value will round down to the max number. Note: a buyer will still be able to use the keyboard to input a number higher than the max. It is up to the developer to add appropriate validation. |
|
|
13
|
+
| min? | <code>number</code> | The lowest decimal or integer to be accepted for the stepper field. When used with `step` the value will round up to the min number. Note: a buyer will still be able to use the keyboard to input a number lower than the min. It is up to the developer to add appropriate validation.<br /><br />Default value: <code>0</code> |
|
|
14
|
+
| step? | <code>number</code> | The amount the value can increase or decrease by. This can be an integer or decimal. If a `max` or `min` is specified with `step` when increasing/decreasing the value via the stepper buttons the final value will always round to the `max` or `min` rather than the closest valid amount.<br /><br />Default value: <code>1</code> |
|
|
15
|
+
| id? | <code>string</code> | A unique identifier for the field. When no `id` is set, a globally unique value will be used instead. |
|
|
16
|
+
| name? | <code>string</code> | An identifier for the field that is unique within the nearest containing `Form` component. |
|
|
17
|
+
| label | <code>string</code> | Content to use as the field label. This value is also used as the placeholder when the field is empty. |
|
|
18
|
+
| prefix? | <code>string</code> | Text content to render before the value. |
|
|
19
|
+
| accessibilityDescription? | <code>string</code> | A detailed description for screen readers. |
|
|
20
|
+
| value? | <code>number | undefined</code> | The current value for the field. If omitted, the field will be empty. You should update this value in response to the `onChange` callback. |
|
|
21
|
+
| required? | <code>boolean</code> | Whether the field needs a value. This requirement adds semantic value to the field, but it will not cause an error to appear automatically. If you want to present an error when this field is empty, you can do so with the `error` prop. |
|
|
22
|
+
| error? | <code>string</code> | Indicate an error to the user. The field will be given a specific stylistic treatment to communicate problems that have to be resolved immediately. |
|
|
23
|
+
| disabled? | <code>boolean</code> | Whether the field can be modified. |
|
|
24
|
+
| readonly? | <code>boolean</code> | Whether the field is read-only. |
|
|
25
|
+
| onFocus? | <code>() => void</code> | Callback when input is focused. |
|
|
26
|
+
| onBlur? | <code>() => void</code> | Callback when focus is removed. |
|
|
27
|
+
| onChange? | <code>(value: number | undefined) => void</code> | Callback when the buyer has **finished editing** a field. Unlike `onChange` callbacks you may be familiar with from Polaris or other React component libraries, this callback is **not** run on every change to the input. Text fields are “partially controlled” components, which means that while the buyer edits the field, its state is controlled by the component. Once the buyer has signalled that they have finished editing the field (typically, by blurring the field), `onChange` is called if the input actually changed from the most recent `value` property. At that point, you are expected to store this “committed value” in state, and reflect it in the text field’s `value` property.<br /><br />This state management model is important given how UI Extensions are rendered. UI Extension components run on a separate thread from the UI, so they can’t respond to input synchronously. A pattern popularized by [controlled React components](https://reactjs.org/docs/forms.html#controlled-components) is to have the component be the source of truth for the input `value`, and update the `value` on every user input. The delay in responding to events from a UI extension is only a few milliseconds, but attempting to strictly store state with this delay can cause issues if a user types quickly, or if the buyer is using a lower-powered device. Having the UI thread take ownership for “in progress” input, and only synchronizing when the user is finished with a field, avoids this risk.<br /><br />It can still sometimes be useful to be notified when the user makes any input in the field. If you need this capability, you can use the `onInput` prop. However, never use that property to create tightly controlled state for the `value`.<br /><br />This callback is called with the current value of the field. If the value of a field is the same as the current `value` prop provided to the field, the `onChange` callback will not be run. |
|
|
28
|
+
| onInput? | <code>(value: number | undefined) => void</code> | Callback when the user makes any changes in the field. As noted in the documentation for `onChange`, you **must not** use this to update `state` — use the `onChange` callback for that purpose. Use the `onInput` prop when you need to do something as soon as the buyer makes a change, like clearing validation errors that apply to the field as soon as the user begins making the necessary adjustments.<br /><br />This callback is called with the current value of the field. |
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {createRemoteComponent} from '@remote-ui/core';
|
|
2
|
+
|
|
3
|
+
import type {TextFieldProps} from '../TextField/TextField';
|
|
4
|
+
import type {IconSource} from '../Icon/Icon';
|
|
5
|
+
|
|
6
|
+
export interface StepperProps
|
|
7
|
+
extends Pick<
|
|
8
|
+
TextFieldProps<number | undefined>,
|
|
9
|
+
| 'id'
|
|
10
|
+
| 'name'
|
|
11
|
+
| 'label'
|
|
12
|
+
| 'prefix'
|
|
13
|
+
| 'accessibilityDescription'
|
|
14
|
+
| 'required'
|
|
15
|
+
| 'error'
|
|
16
|
+
| 'disabled'
|
|
17
|
+
| 'readonly'
|
|
18
|
+
| 'value'
|
|
19
|
+
| 'onFocus'
|
|
20
|
+
| 'onBlur'
|
|
21
|
+
| 'onInput'
|
|
22
|
+
| 'onChange'
|
|
23
|
+
> {
|
|
24
|
+
/**
|
|
25
|
+
* An icon to render at the start of the field.
|
|
26
|
+
*/
|
|
27
|
+
icon?: IconSource;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The highest decimal or integer to be accepted for the stepper field.
|
|
31
|
+
* When used with `step` the value will round down to the max number.
|
|
32
|
+
* Note: a buyer will still be able to use the keyboard to input a number higher than
|
|
33
|
+
* the max. It is up to the developer to add appropriate validation.
|
|
34
|
+
*/
|
|
35
|
+
max?: number;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The lowest decimal or integer to be accepted for the stepper field.
|
|
39
|
+
* When used with `step` the value will round up to the min number.
|
|
40
|
+
* Note: a buyer will still be able to use the keyboard to input a number lower than
|
|
41
|
+
* the min. It is up to the developer to add appropriate validation.
|
|
42
|
+
*
|
|
43
|
+
* @defaultValue 0
|
|
44
|
+
*/
|
|
45
|
+
min?: number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The amount the value can increase or decrease by. This can be an integer or decimal.
|
|
49
|
+
* If a `max` or `min` is specified with `step` when increasing/decreasing the value
|
|
50
|
+
* via the stepper buttons the final value will always round to the `max` or `min`
|
|
51
|
+
* rather than the closest valid amount.
|
|
52
|
+
*
|
|
53
|
+
* @defaultValue 1
|
|
54
|
+
*/
|
|
55
|
+
step?: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Use a stepper to increase or decrease a value, like changing the quantity from 1 to 2.
|
|
60
|
+
*/
|
|
61
|
+
export const Stepper = createRemoteComponent<'Stepper', StepperProps>(
|
|
62
|
+
'Stepper',
|
|
63
|
+
);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
## Best practices
|
|
2
|
+
|
|
3
|
+
- Use this component when customers are likely to choose a number within a small range, such as when changing a quantity from one to three.
|
|
4
|
+
- If there’s no default number, then consider choosing another component such as a [`TextField`](https://github.com/Shopify/ui-extensions/tree/main/packages/checkout-ui-extensions/src/components/TextField) or [`Select`](https://github.com/Shopify/ui-extensions/tree/main/packages/checkout-ui-extensions/src/components/Select).
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Tag
|
|
2
|
+
|
|
3
|
+
A Tag is used to help label, organize or categorize objects. It is commonly used in Checkout to display the discounts applied to a cart.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
optional = ?
|
|
8
|
+
|
|
9
|
+
| Name | Type | Description |
|
|
10
|
+
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| children? | <code>string</code> | |
|
|
12
|
+
| icon? | <code>"arrowLeft" | "arrowRight" | "arrowUp" | "arrowUpRight" | "arrowDown" | "bag" | "calendar" | "camera" | "caretDown" | "cart" | "checkmark" | "chevronDown" | "chevronUp" | "chevronRight" | "chevronLeft" | "close" | "critical" | "discount" | "delivered" | "delivery" | "disabled" | "email" | "errorFill" | "geolocation" | "grid" | "hamburger" | "horizontalDots" | "info" | "infoFill" | "list" | "lock" | "magnify" | "map" | "marker" | "minus" | "mobile" | "note" | "pen" | "verticalDots" | "plus" | "questionFill" | "reorder" | "store" | "success" | "truck" | "warning" | "warningFill" | "giftFill" | "external" | "profile"</code> | Icon source |
|
|
13
|
+
| accessibilityLabel? | <code>string</code> | A label used for buyers using assistive technologies. When set, any `children` supplied to this component are hidden from being seen for accessibility purposes to prevent duplicate content from being read. |
|
|
14
|
+
| onRemove? | <code>() => void</code> | Callback when tag is removed |
|