@shopify/ui-extensions 0.0.0-unstable-20230118190150
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/README.md +42 -0
- package/build/cjs/index.js +2 -0
- package/build/cjs/surfaces/checkout/components/Banner/Banner.js +12 -0
- package/build/cjs/surfaces/checkout/components/BlockLayout/BlockLayout.js +14 -0
- package/build/cjs/surfaces/checkout/components/BlockSpacer/BlockSpacer.js +15 -0
- package/build/cjs/surfaces/checkout/components/BlockStack/BlockStack.js +12 -0
- package/build/cjs/surfaces/checkout/components/Button/Button.js +12 -0
- package/build/cjs/surfaces/checkout/components/Checkbox/Checkbox.js +12 -0
- package/build/cjs/surfaces/checkout/components/Choice/Choice.js +13 -0
- package/build/cjs/surfaces/checkout/components/ChoiceList/ChoiceList.js +13 -0
- package/build/cjs/surfaces/checkout/components/Divider/Divider.js +12 -0
- package/build/cjs/surfaces/checkout/components/Form/Form.js +20 -0
- package/build/cjs/surfaces/checkout/components/Grid/Grid.js +12 -0
- package/build/cjs/surfaces/checkout/components/GridItem/GridItem.js +14 -0
- package/build/cjs/surfaces/checkout/components/Heading/Heading.js +17 -0
- package/build/cjs/surfaces/checkout/components/HeadingGroup/HeadingGroup.js +16 -0
- package/build/cjs/surfaces/checkout/components/Icon/Icon.js +13 -0
- package/build/cjs/surfaces/checkout/components/Image/Image.js +12 -0
- package/build/cjs/surfaces/checkout/components/InlineLayout/InlineLayout.js +16 -0
- package/build/cjs/surfaces/checkout/components/InlineSpacer/InlineSpacer.js +15 -0
- package/build/cjs/surfaces/checkout/components/InlineStack/InlineStack.js +12 -0
- package/build/cjs/surfaces/checkout/components/Link/Link.js +12 -0
- package/build/cjs/surfaces/checkout/components/List/List.js +12 -0
- package/build/cjs/surfaces/checkout/components/ListItem/ListItem.js +14 -0
- package/build/cjs/surfaces/checkout/components/PhoneField/PhoneField.js +17 -0
- package/build/cjs/surfaces/checkout/components/Pressable/Pressable.js +14 -0
- package/build/cjs/surfaces/checkout/components/ScrollView/ScrollView.js +13 -0
- package/build/cjs/surfaces/checkout/components/Select/Select.js +13 -0
- package/build/cjs/surfaces/checkout/components/SkeletonImage/SkeletonImage.js +12 -0
- package/build/cjs/surfaces/checkout/components/SkeletonText/SkeletonText.js +12 -0
- package/build/cjs/surfaces/checkout/components/SkeletonTextBlock/SkeletonTextBlock.js +12 -0
- package/build/cjs/surfaces/checkout/components/Spinner/Spinner.js +13 -0
- package/build/cjs/surfaces/checkout/components/Stepper/Stepper.js +12 -0
- package/build/cjs/surfaces/checkout/components/Tag/Tag.js +12 -0
- package/build/cjs/surfaces/checkout/components/Text/Text.js +13 -0
- package/build/cjs/surfaces/checkout/components/TextBlock/TextBlock.js +12 -0
- package/build/cjs/surfaces/checkout/components/TextField/TextField.js +12 -0
- package/build/cjs/surfaces/checkout/components/Tooltip/Tooltip.js +17 -0
- package/build/cjs/surfaces/checkout/components/View/View.js +17 -0
- package/build/cjs/surfaces/checkout/extension.js +11 -0
- package/build/cjs/surfaces/checkout/style/isEqual.js +29 -0
- package/build/cjs/surfaces/checkout/style/memoize.js +139 -0
- package/build/cjs/surfaces/checkout/style/style.js +74 -0
- package/build/cjs/surfaces/checkout.js +88 -0
- package/build/cjs/utilities/registration.js +21 -0
- package/build/esm/index.mjs +1 -0
- package/build/esm/surfaces/checkout/components/Banner/Banner.mjs +8 -0
- package/build/esm/surfaces/checkout/components/BlockLayout/BlockLayout.mjs +10 -0
- package/build/esm/surfaces/checkout/components/BlockSpacer/BlockSpacer.mjs +11 -0
- package/build/esm/surfaces/checkout/components/BlockStack/BlockStack.mjs +8 -0
- package/build/esm/surfaces/checkout/components/Button/Button.mjs +8 -0
- package/build/esm/surfaces/checkout/components/Checkbox/Checkbox.mjs +8 -0
- package/build/esm/surfaces/checkout/components/Choice/Choice.mjs +9 -0
- package/build/esm/surfaces/checkout/components/ChoiceList/ChoiceList.mjs +9 -0
- package/build/esm/surfaces/checkout/components/Divider/Divider.mjs +8 -0
- package/build/esm/surfaces/checkout/components/Form/Form.mjs +16 -0
- package/build/esm/surfaces/checkout/components/Grid/Grid.mjs +8 -0
- package/build/esm/surfaces/checkout/components/GridItem/GridItem.mjs +10 -0
- package/build/esm/surfaces/checkout/components/Heading/Heading.mjs +13 -0
- package/build/esm/surfaces/checkout/components/HeadingGroup/HeadingGroup.mjs +12 -0
- package/build/esm/surfaces/checkout/components/Icon/Icon.mjs +9 -0
- package/build/esm/surfaces/checkout/components/Image/Image.mjs +8 -0
- package/build/esm/surfaces/checkout/components/InlineLayout/InlineLayout.mjs +12 -0
- package/build/esm/surfaces/checkout/components/InlineSpacer/InlineSpacer.mjs +11 -0
- package/build/esm/surfaces/checkout/components/InlineStack/InlineStack.mjs +8 -0
- package/build/esm/surfaces/checkout/components/Link/Link.mjs +8 -0
- package/build/esm/surfaces/checkout/components/List/List.mjs +8 -0
- package/build/esm/surfaces/checkout/components/ListItem/ListItem.mjs +10 -0
- package/build/esm/surfaces/checkout/components/PhoneField/PhoneField.mjs +13 -0
- package/build/esm/surfaces/checkout/components/Pressable/Pressable.mjs +10 -0
- package/build/esm/surfaces/checkout/components/ScrollView/ScrollView.mjs +9 -0
- package/build/esm/surfaces/checkout/components/Select/Select.mjs +9 -0
- package/build/esm/surfaces/checkout/components/SkeletonImage/SkeletonImage.mjs +8 -0
- package/build/esm/surfaces/checkout/components/SkeletonText/SkeletonText.mjs +8 -0
- package/build/esm/surfaces/checkout/components/SkeletonTextBlock/SkeletonTextBlock.mjs +8 -0
- package/build/esm/surfaces/checkout/components/Spinner/Spinner.mjs +9 -0
- package/build/esm/surfaces/checkout/components/Stepper/Stepper.mjs +8 -0
- package/build/esm/surfaces/checkout/components/Tag/Tag.mjs +8 -0
- package/build/esm/surfaces/checkout/components/Text/Text.mjs +9 -0
- package/build/esm/surfaces/checkout/components/TextBlock/TextBlock.mjs +8 -0
- package/build/esm/surfaces/checkout/components/TextField/TextField.mjs +8 -0
- package/build/esm/surfaces/checkout/components/Tooltip/Tooltip.mjs +13 -0
- package/build/esm/surfaces/checkout/components/View/View.mjs +13 -0
- package/build/esm/surfaces/checkout/extension.mjs +6 -0
- package/build/esm/surfaces/checkout/style/isEqual.mjs +25 -0
- package/build/esm/surfaces/checkout/style/memoize.mjs +133 -0
- package/build/esm/surfaces/checkout/style/style.mjs +68 -0
- package/build/esm/surfaces/checkout.mjs +39 -0
- package/build/esm/utilities/registration.mjs +17 -0
- package/build/esnext/index.esnext +1 -0
- package/build/esnext/surfaces/checkout/components/Banner/Banner.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/BlockLayout/BlockLayout.esnext +10 -0
- package/build/esnext/surfaces/checkout/components/BlockSpacer/BlockSpacer.esnext +11 -0
- package/build/esnext/surfaces/checkout/components/BlockStack/BlockStack.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/Button/Button.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/Checkbox/Checkbox.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/Choice/Choice.esnext +9 -0
- package/build/esnext/surfaces/checkout/components/ChoiceList/ChoiceList.esnext +9 -0
- package/build/esnext/surfaces/checkout/components/Divider/Divider.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/Form/Form.esnext +16 -0
- package/build/esnext/surfaces/checkout/components/Grid/Grid.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/GridItem/GridItem.esnext +10 -0
- package/build/esnext/surfaces/checkout/components/Heading/Heading.esnext +13 -0
- package/build/esnext/surfaces/checkout/components/HeadingGroup/HeadingGroup.esnext +12 -0
- package/build/esnext/surfaces/checkout/components/Icon/Icon.esnext +9 -0
- package/build/esnext/surfaces/checkout/components/Image/Image.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/InlineLayout/InlineLayout.esnext +12 -0
- package/build/esnext/surfaces/checkout/components/InlineSpacer/InlineSpacer.esnext +11 -0
- package/build/esnext/surfaces/checkout/components/InlineStack/InlineStack.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/Link/Link.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/List/List.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/ListItem/ListItem.esnext +10 -0
- package/build/esnext/surfaces/checkout/components/PhoneField/PhoneField.esnext +13 -0
- package/build/esnext/surfaces/checkout/components/Pressable/Pressable.esnext +10 -0
- package/build/esnext/surfaces/checkout/components/ScrollView/ScrollView.esnext +9 -0
- package/build/esnext/surfaces/checkout/components/Select/Select.esnext +9 -0
- package/build/esnext/surfaces/checkout/components/SkeletonImage/SkeletonImage.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/SkeletonText/SkeletonText.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/SkeletonTextBlock/SkeletonTextBlock.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/Spinner/Spinner.esnext +9 -0
- package/build/esnext/surfaces/checkout/components/Stepper/Stepper.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/Tag/Tag.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/Text/Text.esnext +9 -0
- package/build/esnext/surfaces/checkout/components/TextBlock/TextBlock.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/TextField/TextField.esnext +8 -0
- package/build/esnext/surfaces/checkout/components/Tooltip/Tooltip.esnext +13 -0
- package/build/esnext/surfaces/checkout/components/View/View.esnext +13 -0
- package/build/esnext/surfaces/checkout/extension.esnext +6 -0
- package/build/esnext/surfaces/checkout/style/isEqual.esnext +25 -0
- package/build/esnext/surfaces/checkout/style/memoize.esnext +133 -0
- package/build/esnext/surfaces/checkout/style/style.esnext +68 -0
- package/build/esnext/surfaces/checkout.esnext +39 -0
- package/build/esnext/utilities/registration.esnext +17 -0
- package/build/ts/api.d.ts +4 -0
- package/build/ts/api.d.ts.map +1 -0
- package/build/ts/extension.d.ts +8 -0
- package/build/ts/extension.d.ts.map +1 -0
- package/build/ts/index.d.ts +4 -0
- package/build/ts/index.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api/cart-line-details/render-after.d.ts +9 -0
- package/build/ts/surfaces/checkout/api/cart-line-details/render-after.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api/shared.d.ts +5 -0
- package/build/ts/surfaces/checkout/api/shared.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts +1122 -0
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api.d.ts +4 -0
- package/build/ts/surfaces/checkout/api.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Banner/Banner.d.ts +38 -0
- package/build/ts/surfaces/checkout/components/Banner/Banner.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/BlockLayout/BlockLayout.d.ts +41 -0
- package/build/ts/surfaces/checkout/components/BlockLayout/BlockLayout.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/BlockSpacer/BlockSpacer.d.ts +22 -0
- package/build/ts/surfaces/checkout/components/BlockSpacer/BlockSpacer.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/BlockStack/BlockStack.d.ts +42 -0
- package/build/ts/surfaces/checkout/components/BlockStack/BlockStack.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Button/Button.d.ts +83 -0
- package/build/ts/surfaces/checkout/components/Button/Button.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Checkbox/Checkbox.d.ts +59 -0
- package/build/ts/surfaces/checkout/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Choice/Choice.d.ts +27 -0
- package/build/ts/surfaces/checkout/components/Choice/Choice.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/ChoiceList/ChoiceList.d.ts +32 -0
- package/build/ts/surfaces/checkout/components/ChoiceList/ChoiceList.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Divider/Divider.d.ts +30 -0
- package/build/ts/surfaces/checkout/components/Divider/Divider.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Form/Form.d.ts +32 -0
- package/build/ts/surfaces/checkout/components/Form/Form.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Grid/Grid.d.ts +95 -0
- package/build/ts/surfaces/checkout/components/Grid/Grid.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/GridItem/GridItem.d.ts +36 -0
- package/build/ts/surfaces/checkout/components/GridItem/GridItem.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Heading/Heading.d.ts +43 -0
- package/build/ts/surfaces/checkout/components/Heading/Heading.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/HeadingGroup/HeadingGroup.d.ts +15 -0
- package/build/ts/surfaces/checkout/components/HeadingGroup/HeadingGroup.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Icon/Icon.d.ts +38 -0
- package/build/ts/surfaces/checkout/components/Icon/Icon.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Image/Image.d.ts +73 -0
- package/build/ts/surfaces/checkout/components/Image/Image.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/InlineLayout/InlineLayout.d.ts +43 -0
- package/build/ts/surfaces/checkout/components/InlineLayout/InlineLayout.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/InlineSpacer/InlineSpacer.d.ts +22 -0
- package/build/ts/surfaces/checkout/components/InlineSpacer/InlineSpacer.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/InlineStack/InlineStack.d.ts +50 -0
- package/build/ts/surfaces/checkout/components/InlineStack/InlineStack.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Link/Link.d.ts +50 -0
- package/build/ts/surfaces/checkout/components/Link/Link.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/List/List.d.ts +32 -0
- package/build/ts/surfaces/checkout/components/List/List.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/ListItem/ListItem.d.ts +13 -0
- package/build/ts/surfaces/checkout/components/ListItem/ListItem.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/PhoneField/PhoneField.d.ts +58 -0
- package/build/ts/surfaces/checkout/components/PhoneField/PhoneField.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Pressable/Pressable.d.ts +96 -0
- package/build/ts/surfaces/checkout/components/Pressable/Pressable.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/ScrollView/ScrollView.d.ts +75 -0
- package/build/ts/surfaces/checkout/components/ScrollView/ScrollView.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Select/Select.d.ts +98 -0
- package/build/ts/surfaces/checkout/components/Select/Select.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/SkeletonImage/SkeletonImage.d.ts +25 -0
- package/build/ts/surfaces/checkout/components/SkeletonImage/SkeletonImage.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/SkeletonText/SkeletonText.d.ts +21 -0
- package/build/ts/surfaces/checkout/components/SkeletonText/SkeletonText.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/SkeletonTextBlock/SkeletonTextBlock.d.ts +22 -0
- package/build/ts/surfaces/checkout/components/SkeletonTextBlock/SkeletonTextBlock.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Spinner/Spinner.d.ts +32 -0
- package/build/ts/surfaces/checkout/components/Spinner/Spinner.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Stepper/Stepper.d.ts +42 -0
- package/build/ts/surfaces/checkout/components/Stepper/Stepper.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Tag/Tag.d.ts +31 -0
- package/build/ts/surfaces/checkout/components/Tag/Tag.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Text/Text.d.ts +34 -0
- package/build/ts/surfaces/checkout/components/Text/Text.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/TextBlock/TextBlock.d.ts +32 -0
- package/build/ts/surfaces/checkout/components/TextBlock/TextBlock.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/TextField/TextField.d.ts +175 -0
- package/build/ts/surfaces/checkout/components/TextField/TextField.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/Tooltip/Tooltip.d.ts +16 -0
- package/build/ts/surfaces/checkout/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/View/View.d.ts +169 -0
- package/build/ts/surfaces/checkout/components/View/View.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/shared.d.ts +407 -0
- package/build/ts/surfaces/checkout/components/shared.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components.d.ts +76 -0
- package/build/ts/surfaces/checkout/components.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/extension-points.d.ts +98 -0
- package/build/ts/surfaces/checkout/extension-points.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/extension.d.ts +5 -0
- package/build/ts/surfaces/checkout/extension.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/globals.d.ts +11 -0
- package/build/ts/surfaces/checkout/globals.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/shared.d.ts +8 -0
- package/build/ts/surfaces/checkout/shared.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/style/isEqual.d.ts +8 -0
- package/build/ts/surfaces/checkout/style/isEqual.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/style/isEqual.test.d.ts +2 -0
- package/build/ts/surfaces/checkout/style/isEqual.test.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/style/memoize.d.ts +13 -0
- package/build/ts/surfaces/checkout/style/memoize.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/style/style.d.ts +70 -0
- package/build/ts/surfaces/checkout/style/style.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/style/style.test.d.ts +2 -0
- package/build/ts/surfaces/checkout/style/style.test.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/style/types.d.ts +46 -0
- package/build/ts/surfaces/checkout/style/types.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/style.d.ts +3 -0
- package/build/ts/surfaces/checkout/style.d.ts.map +1 -0
- package/build/ts/surfaces/checkout.d.ts +8 -0
- package/build/ts/surfaces/checkout.d.ts.map +1 -0
- package/build/ts/utilities/registration.d.ts +12 -0
- package/build/ts/utilities/registration.d.ts.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/checkout.esnext +1 -0
- package/checkout.js +1 -0
- package/checkout.mjs +1 -0
- package/index.esnext +1 -0
- package/index.js +1 -0
- package/index.mjs +1 -0
- package/package.json +51 -0
- package/src/api.ts +3 -0
- package/src/extension.ts +19 -0
- package/src/index.ts +3 -0
- package/src/surfaces/checkout/api/cart-line-details/README.md +1 -0
- package/src/surfaces/checkout/api/cart-line-details/render-after.ts +11 -0
- package/src/surfaces/checkout/api/shared.ts +810 -0
- package/src/surfaces/checkout/api/standard/README.md +1 -0
- package/src/surfaces/checkout/api/standard/standard.ts +1340 -0
- package/src/surfaces/checkout/api.ts +67 -0
- 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/surfaces/checkout/components/Checkbox/Checkbox.ts +63 -0
- 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 +20 -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 +28 -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 +581 -0
- package/src/surfaces/checkout/components.ts +157 -0
- package/src/surfaces/checkout/extension-points.ts +164 -0
- package/src/surfaces/checkout/extension.ts +8 -0
- package/src/surfaces/checkout/globals.ts +15 -0
- package/src/surfaces/checkout/shared.ts +14 -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 +177 -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/surfaces/checkout.ts +7 -0
- package/src/utilities/registration.ts +27 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
export {Banner} from './components/Banner/Banner';
|
|
2
|
+
export type {BannerProps} from './components/Banner/Banner';
|
|
3
|
+
|
|
4
|
+
export {BlockLayout} from './components/BlockLayout/BlockLayout';
|
|
5
|
+
export type {BlockLayoutProps} from './components/BlockLayout/BlockLayout';
|
|
6
|
+
|
|
7
|
+
export {BlockSpacer} from './components/BlockSpacer/BlockSpacer';
|
|
8
|
+
export type {BlockSpacerProps} from './components/BlockSpacer/BlockSpacer';
|
|
9
|
+
|
|
10
|
+
export {BlockStack} from './components/BlockStack/BlockStack';
|
|
11
|
+
export type {BlockStackProps} from './components/BlockStack/BlockStack';
|
|
12
|
+
|
|
13
|
+
export {Button} from './components/Button/Button';
|
|
14
|
+
export type {ButtonProps} from './components/Button/Button';
|
|
15
|
+
|
|
16
|
+
export {Checkbox} from './components/Checkbox/Checkbox';
|
|
17
|
+
export type {CheckboxProps} from './components/Checkbox/Checkbox';
|
|
18
|
+
|
|
19
|
+
export {Choice} from './components/Choice/Choice';
|
|
20
|
+
export type {ChoiceProps} from './components/Choice/Choice';
|
|
21
|
+
|
|
22
|
+
export {ChoiceList} from './components/ChoiceList/ChoiceList';
|
|
23
|
+
export type {ChoiceListProps} from './components/ChoiceList/ChoiceList';
|
|
24
|
+
|
|
25
|
+
export {Divider} from './components/Divider/Divider';
|
|
26
|
+
export type {DividerProps} from './components/Divider/Divider';
|
|
27
|
+
|
|
28
|
+
export {Form} from './components/Form/Form';
|
|
29
|
+
export type {FormProps} from './components/Form/Form';
|
|
30
|
+
|
|
31
|
+
export {Grid} from './components/Grid/Grid';
|
|
32
|
+
export type {GridProps} from './components/Grid/Grid';
|
|
33
|
+
|
|
34
|
+
export {GridItem} from './components/GridItem/GridItem';
|
|
35
|
+
export type {GridItemProps} from './components/GridItem/GridItem';
|
|
36
|
+
|
|
37
|
+
export {Heading} from './components/Heading/Heading';
|
|
38
|
+
export type {HeadingProps} from './components/Heading/Heading';
|
|
39
|
+
|
|
40
|
+
export {HeadingGroup} from './components/HeadingGroup/HeadingGroup';
|
|
41
|
+
export type {HeadingGroupProps} from './components/HeadingGroup/HeadingGroup';
|
|
42
|
+
|
|
43
|
+
export {Icon} from './components/Icon/Icon';
|
|
44
|
+
export type {IconProps} from './components/Icon/Icon';
|
|
45
|
+
|
|
46
|
+
export {Image} from './components/Image/Image';
|
|
47
|
+
export type {ImageProps} from './components/Image/Image';
|
|
48
|
+
|
|
49
|
+
export {InlineLayout} from './components/InlineLayout/InlineLayout';
|
|
50
|
+
export type {InlineLayoutProps} from './components/InlineLayout/InlineLayout';
|
|
51
|
+
|
|
52
|
+
export {InlineStack} from './components/InlineStack/InlineStack';
|
|
53
|
+
export type {InlineStackProps} from './components/InlineStack/InlineStack';
|
|
54
|
+
|
|
55
|
+
export {InlineSpacer} from './components/InlineSpacer/InlineSpacer';
|
|
56
|
+
export type {InlineSpacerProps} from './components/InlineSpacer/InlineSpacer';
|
|
57
|
+
|
|
58
|
+
export {Link} from './components/Link/Link';
|
|
59
|
+
export type {LinkProps} from './components/Link/Link';
|
|
60
|
+
|
|
61
|
+
export {List} from './components/List/List';
|
|
62
|
+
export type {ListProps} from './components/List/List';
|
|
63
|
+
|
|
64
|
+
export {ListItem} from './components/ListItem/ListItem';
|
|
65
|
+
export type {ListItemProps} from './components/ListItem/ListItem';
|
|
66
|
+
|
|
67
|
+
export {PhoneField} from './components/PhoneField/PhoneField';
|
|
68
|
+
export type {PhoneFieldProps} from './components/PhoneField/PhoneField';
|
|
69
|
+
|
|
70
|
+
export {Pressable} from './components/Pressable/Pressable';
|
|
71
|
+
export type {PressableProps} from './components/Pressable/Pressable';
|
|
72
|
+
|
|
73
|
+
export {ScrollView} from './components/ScrollView/ScrollView';
|
|
74
|
+
export type {
|
|
75
|
+
ScrollViewProps,
|
|
76
|
+
ScrollViewEvent,
|
|
77
|
+
} from './components/ScrollView/ScrollView';
|
|
78
|
+
|
|
79
|
+
export {Select} from './components/Select/Select';
|
|
80
|
+
export type {SelectProps} from './components/Select/Select';
|
|
81
|
+
|
|
82
|
+
export {SkeletonImage} from './components/SkeletonImage/SkeletonImage';
|
|
83
|
+
export type {SkeletonImageProps} from './components/SkeletonImage/SkeletonImage';
|
|
84
|
+
|
|
85
|
+
export {SkeletonText} from './components/SkeletonText/SkeletonText';
|
|
86
|
+
export type {SkeletonTextProps} from './components/SkeletonText/SkeletonText';
|
|
87
|
+
|
|
88
|
+
export {SkeletonTextBlock} from './components/SkeletonTextBlock/SkeletonTextBlock';
|
|
89
|
+
export type {SkeletonTextBlockProps} from './components/SkeletonTextBlock/SkeletonTextBlock';
|
|
90
|
+
|
|
91
|
+
export {Spinner} from './components/Spinner/Spinner';
|
|
92
|
+
export type {SpinnerProps} from './components/Spinner/Spinner';
|
|
93
|
+
|
|
94
|
+
export {Stepper} from './components/Stepper/Stepper';
|
|
95
|
+
export type {StepperProps} from './components/Stepper/Stepper';
|
|
96
|
+
|
|
97
|
+
export {Tag} from './components/Tag/Tag';
|
|
98
|
+
export type {TagProps} from './components/Tag/Tag';
|
|
99
|
+
|
|
100
|
+
export {Text} from './components/Text/Text';
|
|
101
|
+
export type {TextProps} from './components/Text/Text';
|
|
102
|
+
|
|
103
|
+
export {TextBlock} from './components/TextBlock/TextBlock';
|
|
104
|
+
export type {TextBlockProps} from './components/TextBlock/TextBlock';
|
|
105
|
+
|
|
106
|
+
export {TextField} from './components/TextField/TextField';
|
|
107
|
+
export type {TextFieldProps} from './components/TextField/TextField';
|
|
108
|
+
|
|
109
|
+
export {Tooltip} from './components/Tooltip/Tooltip';
|
|
110
|
+
export type {TooltipProps} from './components/Tooltip/Tooltip';
|
|
111
|
+
|
|
112
|
+
export {View} from './components/View/View';
|
|
113
|
+
export type {
|
|
114
|
+
ViewProps,
|
|
115
|
+
Coordinate as ViewCoordinate,
|
|
116
|
+
Position as ViewPosition,
|
|
117
|
+
PositionType as ViewPositionType,
|
|
118
|
+
Translate as ViewTranslate,
|
|
119
|
+
} from './components/View/View';
|
|
120
|
+
|
|
121
|
+
export type {
|
|
122
|
+
AccessibilityRole,
|
|
123
|
+
ViewLikeAccessibilityRole,
|
|
124
|
+
NonPresentationalAccessibilityRole,
|
|
125
|
+
Autocomplete,
|
|
126
|
+
AutocompleteField,
|
|
127
|
+
AutocompleteGroup,
|
|
128
|
+
Background,
|
|
129
|
+
BackgroundFit,
|
|
130
|
+
BackgroundPosition,
|
|
131
|
+
BackgroundRepeat,
|
|
132
|
+
BlockAlignment,
|
|
133
|
+
InlineAlignment,
|
|
134
|
+
BorderRadius,
|
|
135
|
+
BorderStyle,
|
|
136
|
+
BorderWidth,
|
|
137
|
+
Breakpoint,
|
|
138
|
+
CornerRadius,
|
|
139
|
+
ShorthandProperty,
|
|
140
|
+
MaybeShorthandProperty,
|
|
141
|
+
Fit,
|
|
142
|
+
Status,
|
|
143
|
+
Size,
|
|
144
|
+
Spacing,
|
|
145
|
+
Alignment,
|
|
146
|
+
Appearance,
|
|
147
|
+
GridItemSize,
|
|
148
|
+
Columns,
|
|
149
|
+
Rows,
|
|
150
|
+
BackgroundProps,
|
|
151
|
+
BorderProps,
|
|
152
|
+
CornerProps,
|
|
153
|
+
SizingProps,
|
|
154
|
+
SpacingProps,
|
|
155
|
+
VisibilityProps,
|
|
156
|
+
OverlayActivatorProps,
|
|
157
|
+
} from './components/shared';
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type {RenderExtension} from '../../extension';
|
|
2
|
+
|
|
3
|
+
import type {AnyComponent} from './shared';
|
|
4
|
+
import type {StandardApi, CartLineDetailsRenderAfterApi} from './api';
|
|
5
|
+
|
|
6
|
+
export interface ExtensionPoints {
|
|
7
|
+
/**
|
|
8
|
+
* A [dynamic extension point](https://shopify.dev/api/checkout-extensions/checkout#extension-points) that isn't tied to a specific checkout section or feature.
|
|
9
|
+
* Unlike static extension points, dynamic extension points render where the merchant
|
|
10
|
+
* sets them using the [checkout editor](https://shopify.dev/apps/checkout/test-ui-extensions#test-the-extension-in-the-checkout-editor).
|
|
11
|
+
*`
|
|
12
|
+
* The [supported locations](https://shopify.dev/api/checkout-extensions/checkout#supported-locations) for dynamic extension points can be previewed during development
|
|
13
|
+
* by [using a URL parameter](https://shopify.dev/apps/checkout/test-ui-extensions#dynamic-extension-points).
|
|
14
|
+
*/
|
|
15
|
+
'Checkout::Dynamic::Render': RenderExtension<
|
|
16
|
+
StandardApi<'Checkout::Dynamic::Render'>,
|
|
17
|
+
AnyComponent
|
|
18
|
+
>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A static extension point that renders on every line item, inside the details
|
|
22
|
+
* under the line item properties element.
|
|
23
|
+
*/
|
|
24
|
+
'Checkout::CartLineDetails::RenderAfter': RenderExtension<
|
|
25
|
+
CartLineDetailsRenderAfterApi,
|
|
26
|
+
AnyComponent
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A static extension point that is rendered after all line items.
|
|
31
|
+
*/
|
|
32
|
+
'Checkout::CartLines::RenderAfter': RenderExtension<
|
|
33
|
+
StandardApi<'Checkout::CartLines::RenderAfter'>,
|
|
34
|
+
AnyComponent
|
|
35
|
+
>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A static extension point that is rendered between the shipping address header
|
|
39
|
+
* and shipping address form elements.
|
|
40
|
+
*/
|
|
41
|
+
'Checkout::DeliveryAddress::RenderBefore': RenderExtension<
|
|
42
|
+
StandardApi<'Checkout::DeliveryAddress::RenderBefore'>,
|
|
43
|
+
AnyComponent
|
|
44
|
+
>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A static extension point that is rendered between the shipping method
|
|
48
|
+
* header and shipping method options.
|
|
49
|
+
*/
|
|
50
|
+
'Checkout::ShippingMethods::RenderBefore': RenderExtension<
|
|
51
|
+
StandardApi<'Checkout::ShippingMethods::RenderBefore'>,
|
|
52
|
+
AnyComponent
|
|
53
|
+
>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A static extension point that is rendered after the shipping method
|
|
57
|
+
* options.
|
|
58
|
+
*/
|
|
59
|
+
'Checkout::ShippingMethods::RenderAfter': RenderExtension<
|
|
60
|
+
StandardApi<'Checkout::ShippingMethods::RenderAfter'>,
|
|
61
|
+
AnyComponent
|
|
62
|
+
>;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* A static extension point that is rendered in the order summary, before the discount form element.
|
|
66
|
+
*/
|
|
67
|
+
'Checkout::Reductions::RenderBefore': RenderExtension<
|
|
68
|
+
StandardApi<'Checkout::Reductions::RenderBefore'>,
|
|
69
|
+
AnyComponent
|
|
70
|
+
>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* A static extension point that is rendered in the order summary, after the discount form
|
|
74
|
+
* and discount tag elements.
|
|
75
|
+
*/
|
|
76
|
+
'Checkout::Reductions::RenderAfter': RenderExtension<
|
|
77
|
+
StandardApi<'Checkout::Reductions::RenderAfter'>,
|
|
78
|
+
AnyComponent
|
|
79
|
+
>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A static extension point that is rendered immediately before any actions within each step.
|
|
83
|
+
*/
|
|
84
|
+
'Checkout::Actions::RenderBefore': RenderExtension<
|
|
85
|
+
StandardApi<'Checkout::Actions::RenderBefore'>,
|
|
86
|
+
AnyComponent
|
|
87
|
+
>;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* A static extension point that is rendered immediately after the contact form element.
|
|
91
|
+
*/
|
|
92
|
+
'Checkout::Contact::RenderAfter': RenderExtension<
|
|
93
|
+
StandardApi<'Checkout::Contact::RenderAfter'>,
|
|
94
|
+
AnyComponent
|
|
95
|
+
>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type ExtensionPoint = keyof ExtensionPoints;
|
|
99
|
+
|
|
100
|
+
export type ExtensionForExtensionPoint<T extends ExtensionPoint> =
|
|
101
|
+
ExtensionPoints[T];
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* For a given extension point, returns the value that is expected to be
|
|
105
|
+
* returned by that extension point’s callback type.
|
|
106
|
+
*/
|
|
107
|
+
export type ReturnTypeForExtension<ID extends keyof ExtensionPoints> =
|
|
108
|
+
ReturnType<ExtensionPoints[ID]>;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* For a given extension point, returns the tuple of arguments that would
|
|
112
|
+
* be provided to that extension point’s callback type.
|
|
113
|
+
*/
|
|
114
|
+
export type ArgumentsForExtension<ID extends keyof ExtensionPoints> =
|
|
115
|
+
Parameters<ExtensionPoints[ID]>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* A union type containing all of the extension points that follow the pattern of
|
|
119
|
+
* accepting a [`@remote-ui/core` `RemoteRoot`](https://github.com/Shopify/remote-ui/tree/main/packages/core)
|
|
120
|
+
* and an additional `api` argument, and using those arguments to render
|
|
121
|
+
* UI.
|
|
122
|
+
*/
|
|
123
|
+
export type RenderExtensionPoint = {
|
|
124
|
+
[ID in keyof ExtensionPoints]: ExtensionPoints[ID] extends RenderExtension<
|
|
125
|
+
any,
|
|
126
|
+
any
|
|
127
|
+
>
|
|
128
|
+
? ID
|
|
129
|
+
: never;
|
|
130
|
+
}[keyof ExtensionPoints];
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* A mapping of each “render extension” name to its callback type.
|
|
134
|
+
*/
|
|
135
|
+
export type RenderExtensions = {
|
|
136
|
+
[ID in RenderExtensionPoint]: ExtensionPoints[ID];
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
type ExtractedApiFromRenderExtension<T> = T extends RenderExtension<
|
|
140
|
+
infer Api,
|
|
141
|
+
any
|
|
142
|
+
>
|
|
143
|
+
? Api
|
|
144
|
+
: never;
|
|
145
|
+
|
|
146
|
+
type ExtractedAllowedComponentsFromRenderExtension<T> =
|
|
147
|
+
T extends RenderExtension<any, infer Components> ? Components : never;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* For a given rendering extension point, returns the type of the API that the
|
|
151
|
+
* extension will receive at runtime. This API type is the second argument to
|
|
152
|
+
* the callback for that extension point. The first callback for all of the rendering
|
|
153
|
+
* extension points each receive a `RemoteRoot` object.
|
|
154
|
+
*/
|
|
155
|
+
export type ApiForRenderExtension<ID extends keyof RenderExtensions> =
|
|
156
|
+
ExtractedApiFromRenderExtension<RenderExtensions[ID]>;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* For a given rendering extension point, returns the UI components that the
|
|
160
|
+
* extension point supports.
|
|
161
|
+
*/
|
|
162
|
+
export type AllowedComponentsForRenderExtension<
|
|
163
|
+
ID extends keyof RenderExtensions,
|
|
164
|
+
> = ExtractedAllowedComponentsFromRenderExtension<RenderExtensions[ID]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {createExtensionRegistrationFunction} from '../../utilities/registration';
|
|
2
|
+
|
|
3
|
+
import type {ExtensionPoints} from './extension-points';
|
|
4
|
+
|
|
5
|
+
export * from '../../extension';
|
|
6
|
+
|
|
7
|
+
export const extension = createExtensionRegistrationFunction<ExtensionPoints>();
|
|
8
|
+
export const extend = extension;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type {ExtensionPoints} from './extension-points';
|
|
2
|
+
|
|
3
|
+
export interface ShopifyGlobal {
|
|
4
|
+
extend<ExtensionPoint extends keyof ExtensionPoints>(
|
|
5
|
+
extensionPoint: ExtensionPoint,
|
|
6
|
+
extend: ExtensionPoints[ExtensionPoint],
|
|
7
|
+
): void;
|
|
8
|
+
reload(): void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare global {
|
|
12
|
+
interface WorkerGlobalScope {
|
|
13
|
+
readonly shopify: ShopifyGlobal;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type {RemoteComponentType} from '@remote-ui/core';
|
|
2
|
+
|
|
3
|
+
type ComponentTypes = typeof import('./components');
|
|
4
|
+
|
|
5
|
+
export type Components = {
|
|
6
|
+
[K in keyof ComponentTypes]: ComponentTypes[K] extends RemoteComponentType<
|
|
7
|
+
any,
|
|
8
|
+
any
|
|
9
|
+
>
|
|
10
|
+
? ComponentTypes[K]
|
|
11
|
+
: never;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type AnyComponent = Components[keyof Components];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {isEqual} from './isEqual';
|
|
2
|
+
|
|
3
|
+
describe('isEqual', () => {
|
|
4
|
+
it('returns true when two strings are equal', () => {
|
|
5
|
+
expect(isEqual('a', 'a')).toBe(true);
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
it('returns true when two numbers are equal', () => {
|
|
9
|
+
expect(isEqual(1, 1)).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('returns true when two booleans are equal', () => {
|
|
13
|
+
expect(isEqual(true, true)).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('returns true when two objects are equal', () => {
|
|
17
|
+
expect(
|
|
18
|
+
isEqual(
|
|
19
|
+
{
|
|
20
|
+
string: 'string',
|
|
21
|
+
number: 1,
|
|
22
|
+
boolean: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
string: 'string',
|
|
26
|
+
number: 1,
|
|
27
|
+
boolean: true,
|
|
28
|
+
},
|
|
29
|
+
),
|
|
30
|
+
).toBe(true);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('returns true when two nested objects are equal', () => {
|
|
34
|
+
expect(
|
|
35
|
+
isEqual(
|
|
36
|
+
{
|
|
37
|
+
string: 'string',
|
|
38
|
+
number: 1,
|
|
39
|
+
boolean: true,
|
|
40
|
+
object: {
|
|
41
|
+
foo: 'a',
|
|
42
|
+
bar: 'b',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
object: {
|
|
47
|
+
foo: 'a',
|
|
48
|
+
bar: 'b',
|
|
49
|
+
},
|
|
50
|
+
number: 1,
|
|
51
|
+
string: 'string',
|
|
52
|
+
boolean: true,
|
|
53
|
+
},
|
|
54
|
+
),
|
|
55
|
+
).toBe(true);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('returns true when two arrays are equal', () => {
|
|
59
|
+
expect(isEqual([1, 'a', true], [1, 'a', true])).toBe(true);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('returns true when two nested arrays are equal', () => {
|
|
63
|
+
expect(
|
|
64
|
+
isEqual([1, [2, 'b', false], 'a', true], [1, [2, 'b', false], 'a', true]),
|
|
65
|
+
).toBe(true);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A simple isEqual function that can be used to compare two style objects that's
|
|
3
|
+
* good enough for our use case on the style builder.
|
|
4
|
+
*/
|
|
5
|
+
export function isEqual<
|
|
6
|
+
T =
|
|
7
|
+
| {[key: string]: any}
|
|
8
|
+
| any[]
|
|
9
|
+
| number
|
|
10
|
+
| boolean
|
|
11
|
+
| string
|
|
12
|
+
| null
|
|
13
|
+
| undefined,
|
|
14
|
+
>(first: T, second: T): boolean {
|
|
15
|
+
if (Object.is(first, second)) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (typeof first === 'object' && typeof second === 'object') {
|
|
20
|
+
if (Array.isArray(first) && Array.isArray(second)) {
|
|
21
|
+
if (first.length === second.length) {
|
|
22
|
+
return first.every((value: any, index: number) =>
|
|
23
|
+
isEqual(value, second[index]),
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
} else {
|
|
27
|
+
const firstEntries = Object.entries(first!);
|
|
28
|
+
const secondEntries = Object.entries(second!);
|
|
29
|
+
if (firstEntries.length === secondEntries.length) {
|
|
30
|
+
return firstEntries.every(([key]) =>
|
|
31
|
+
isEqual(
|
|
32
|
+
(first as {[key: string]: any})[key],
|
|
33
|
+
(second as {[key: string]: any})[key],
|
|
34
|
+
),
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/* eslint-disable prefer-rest-params */
|
|
2
|
+
/* eslint-disable prefer-spread */
|
|
3
|
+
|
|
4
|
+
// This memoize function is heavily inspired by reselect's defaultMemoize
|
|
5
|
+
// https://github.com/reduxjs/reselect
|
|
6
|
+
|
|
7
|
+
type EqualityFn = (a: any, b: any) => boolean;
|
|
8
|
+
|
|
9
|
+
// Cache implementation based on Erik Rasmussen's `lru-memoize`:
|
|
10
|
+
// https://github.com/erikras/lru-memoize
|
|
11
|
+
|
|
12
|
+
const NOT_FOUND = 'NOT_FOUND';
|
|
13
|
+
type NOT_FOUND_TYPE = typeof NOT_FOUND;
|
|
14
|
+
|
|
15
|
+
interface Entry {
|
|
16
|
+
key: unknown;
|
|
17
|
+
value: unknown;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface Cache {
|
|
21
|
+
get(key: unknown): unknown | NOT_FOUND_TYPE;
|
|
22
|
+
put(key: unknown, value: unknown): void;
|
|
23
|
+
getEntries(): Entry[];
|
|
24
|
+
clear(): void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function createSingletonCache(equals: EqualityFn): Cache {
|
|
28
|
+
let entry: Entry | undefined;
|
|
29
|
+
return {
|
|
30
|
+
get(key: unknown) {
|
|
31
|
+
if (entry && equals(entry.key, key)) {
|
|
32
|
+
return entry.value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return NOT_FOUND;
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
put(key: unknown, value: unknown) {
|
|
39
|
+
entry = {key, value};
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
getEntries() {
|
|
43
|
+
return entry ? [entry] : [];
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
clear() {
|
|
47
|
+
entry = undefined;
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function createLruCache(maxSize: number, equals: EqualityFn): Cache {
|
|
53
|
+
let entries: Entry[] = [];
|
|
54
|
+
|
|
55
|
+
function get(key: unknown) {
|
|
56
|
+
const cacheIndex = entries.findIndex((entry) => equals(key, entry.key));
|
|
57
|
+
|
|
58
|
+
// We found a cached entry
|
|
59
|
+
if (cacheIndex > -1) {
|
|
60
|
+
const entry = entries[cacheIndex];
|
|
61
|
+
|
|
62
|
+
// Cached entry not at top of cache, move it to the top
|
|
63
|
+
if (cacheIndex > 0) {
|
|
64
|
+
entries.splice(cacheIndex, 1);
|
|
65
|
+
entries.unshift(entry);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return entry.value;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// No entry found in cache, return sentinel
|
|
72
|
+
return NOT_FOUND;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function put(key: unknown, value: unknown) {
|
|
76
|
+
if (get(key) === NOT_FOUND) {
|
|
77
|
+
entries.unshift({key, value});
|
|
78
|
+
if (entries.length > maxSize) {
|
|
79
|
+
entries.pop();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function getEntries() {
|
|
85
|
+
return entries;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function clear() {
|
|
89
|
+
entries = [];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return {get, put, getEntries, clear};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const defaultEqualityCheck: EqualityFn = (first, second): boolean => {
|
|
96
|
+
return first === second;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export function createCacheKeyComparator(equalityCheck: EqualityFn) {
|
|
100
|
+
return function areArgumentsShallowlyEqual(
|
|
101
|
+
prev: unknown[] | IArguments | null,
|
|
102
|
+
next: unknown[] | IArguments | null,
|
|
103
|
+
): boolean {
|
|
104
|
+
if (prev === null || next === null || prev.length !== next.length) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
|
|
109
|
+
const length = prev.length;
|
|
110
|
+
for (let i = 0; i < length; i++) {
|
|
111
|
+
if (!equalityCheck(prev[i], next[i])) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return true;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface DefaultMemoizeOptions {
|
|
121
|
+
equalityCheck?: EqualityFn;
|
|
122
|
+
resultEqualityCheck?: EqualityFn;
|
|
123
|
+
maxSize?: number;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// defaultMemoize now supports a configurable cache size with LRU behavior,
|
|
127
|
+
// and optional comparison of the result value with existing values
|
|
128
|
+
export function memoize<F extends (...args: any[]) => any>(
|
|
129
|
+
func: F,
|
|
130
|
+
equalityCheckOrOptions?: EqualityFn | DefaultMemoizeOptions,
|
|
131
|
+
) {
|
|
132
|
+
const providedOptions =
|
|
133
|
+
typeof equalityCheckOrOptions === 'object'
|
|
134
|
+
? equalityCheckOrOptions
|
|
135
|
+
: {equalityCheck: equalityCheckOrOptions};
|
|
136
|
+
|
|
137
|
+
const {
|
|
138
|
+
equalityCheck = defaultEqualityCheck,
|
|
139
|
+
maxSize = 1,
|
|
140
|
+
resultEqualityCheck,
|
|
141
|
+
} = providedOptions;
|
|
142
|
+
|
|
143
|
+
const comparator = createCacheKeyComparator(equalityCheck);
|
|
144
|
+
|
|
145
|
+
const cache =
|
|
146
|
+
maxSize === 1
|
|
147
|
+
? createSingletonCache(comparator)
|
|
148
|
+
: createLruCache(maxSize, comparator);
|
|
149
|
+
|
|
150
|
+
// we reference arguments instead of spreading them for performance reasons
|
|
151
|
+
function memoized() {
|
|
152
|
+
let value = cache.get(arguments);
|
|
153
|
+
if (value === NOT_FOUND) {
|
|
154
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
155
|
+
// @ts-ignore
|
|
156
|
+
value = func.apply(null, arguments);
|
|
157
|
+
|
|
158
|
+
if (resultEqualityCheck) {
|
|
159
|
+
const entries = cache.getEntries();
|
|
160
|
+
const matchingEntry = entries.find((entry) =>
|
|
161
|
+
resultEqualityCheck(entry.value, value),
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
if (matchingEntry) {
|
|
165
|
+
value = matchingEntry.value;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
cache.put(arguments, value);
|
|
170
|
+
}
|
|
171
|
+
return value;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
memoized.clearCache = () => cache.clear();
|
|
175
|
+
|
|
176
|
+
return memoized as F & {clearCache: () => void};
|
|
177
|
+
}
|