diff --git a/packages/docs/stories/assets/constants.ts b/packages/docs/stories/assets/constants.ts index 59f31e01..658098ca 100644 --- a/packages/docs/stories/assets/constants.ts +++ b/packages/docs/stories/assets/constants.ts @@ -5,7 +5,7 @@ export const codes = { noDiscount: 'BACKPACKFFFFFF000000XXXX', outOfStock: '5PANECAP9D9CA1FFFFFFXXXX', doNotTrack: 'BOTT17OZFFFFFF000000XXXX', - doNotShip: 'DUFFLBAG000000FFFFFFXXXX', + digitalProduct: 'EBOOKECOMPLAYBOOKED1XXXX', subscription: 'POLOMXXX000000FFFFFFMXXX', bundleAvailable: 'CLGETTINGSTARTED', bundleOutOfStock: 'CLOUTOFSTOCK' diff --git a/packages/docs/stories/availability/cl-availability-info.stories.ts b/packages/docs/stories/availability/cl-availability-info.stories.ts index ad3f79dc..ca83f65d 100644 --- a/packages/docs/stories/availability/cl-availability-info.stories.ts +++ b/packages/docs/stories/availability/cl-availability-info.stories.ts @@ -5,18 +5,24 @@ import { create } from '../../utils' import { codes } from '../assets/constants' type Args = DropInArgs['cl-availability-info'] & { - ['Use an available product']: boolean + ['Product availability']: string } const meta: Meta = { title: 'Components/Availability/cl-availability-info', component: 'cl-availability-info', argTypes: { - 'Use an available product': { + 'Product availability': { description: - 'Toggle this switch to swap from an out-of-stock to an available product in the example above.', - type: { - name: 'boolean' + 'Select one of the options to swap between products with different availability in the example above.', + options: [codes.available, codes.digitalProduct, codes.outOfStock], + control: { + type: 'select', + labels: { + [codes.available]: 'Shippable product', + [codes.digitalProduct]: 'Digital product', + [codes.outOfStock]: 'Out of stock product' + } }, table: { category: 'storybook' @@ -29,17 +35,17 @@ export default meta export const Basic: StoryFn = (args) => { return create(html` - - + + + + `) } Basic.args = { - 'Use an available product': true, + 'Product availability': codes.available, type: 'min-days' } diff --git a/packages/docs/stories/availability/cl-availability-status.stories.ts b/packages/docs/stories/availability/cl-availability-status.stories.ts index db5ac4d4..750fccdb 100644 --- a/packages/docs/stories/availability/cl-availability-status.stories.ts +++ b/packages/docs/stories/availability/cl-availability-status.stories.ts @@ -5,18 +5,24 @@ import { create } from '../../utils' import { codes } from '../assets/constants' type Args = DropInArgs['cl-availability-status'] & { - ['Use an available product']: boolean + ['Product availability']: string } const meta: Meta = { title: 'Components/Availability/cl-availability-status', component: 'cl-availability-status', argTypes: { - 'Use an available product': { + 'Product availability': { description: - 'Toggle this switch to swap from an out-of-stock to an available product in the example above.', - type: { - name: 'boolean' + 'Select one of the options to swap between products with different availability in the example above.', + options: [codes.available, codes.digitalProduct, codes.outOfStock], + control: { + type: 'select', + labels: { + [codes.available]: 'Shippable product', + [codes.digitalProduct]: 'Digital product', + [codes.outOfStock]: 'Out of stock product' + } }, table: { category: 'storybook' @@ -29,11 +35,7 @@ export default meta export const Basic: StoryFn = (args) => { return create(html` - + • message @@ -41,6 +43,6 @@ export const Basic: StoryFn = (args) => { `) } Basic.args = { - 'Use an available product': true, + 'Product availability': codes.available, type: 'available' } diff --git a/packages/drop-in/seed/data/prices.json b/packages/drop-in/seed/data/prices.json index fc25d614..65095190 100644 --- a/packages/drop-in/seed/data/prices.json +++ b/packages/drop-in/seed/data/prices.json @@ -313,5 +313,26 @@ "amount_cents": 3110, "compare_at_amount_cents": 3550, "price_list": "price_list_3" + }, + { + "reference": "price_751", + "sku_code": "EBOOKECOMPLAYBOOKED1XXXX", + "amount_cents": 3110, + "compare_at_amount_cents": 3550, + "price_list": "price_list_1" + }, + { + "reference": "price_752", + "sku_code": "EBOOKECOMPLAYBOOKED1XXXX", + "amount_cents": 3110, + "compare_at_amount_cents": 3550, + "price_list": "price_list_2" + }, + { + "reference": "price_753", + "sku_code": "EBOOKECOMPLAYBOOKED1XXXX", + "amount_cents": 3110, + "compare_at_amount_cents": 3550, + "price_list": "price_list_3" } ] diff --git a/packages/drop-in/seed/data/shipping_categories.json b/packages/drop-in/seed/data/shipping_categories.json index 9f47c159..0708dd61 100644 --- a/packages/drop-in/seed/data/shipping_categories.json +++ b/packages/drop-in/seed/data/shipping_categories.json @@ -2,5 +2,9 @@ { "reference": "shipping_category_1", "name": "Merchandising" + }, + { + "reference": "shipping_category_2", + "name": "Digital" } ] diff --git a/packages/drop-in/seed/data/skus.json b/packages/drop-in/seed/data/skus.json index d7796a33..46b8e7cb 100644 --- a/packages/drop-in/seed/data/skus.json +++ b/packages/drop-in/seed/data/skus.json @@ -56,7 +56,6 @@ "name": "Black Duffle Bag with White Logo", "description": "The perfect spacious bag no matter the occasion. It’s great for packing exercise gear when heading to the gym, or throwing in necessities and going on an adventure.", "image_url": "https://data.commercelayer.app/seed/images/skus/DUFFLBAG000000FFFFFFXXXX_FLAT.png", - "do_not_ship": true, "shipping_category": "shipping_category_1" }, { @@ -122,5 +121,14 @@ "description": "This is THE classic t-shirt. Its fine jersey cotton construction makes it extremely soft and comfortable to wear, so it's a good choice for a day-to-day outfit — it's durable and can withstand several washings while retaining its shape and color.", "image_url": "https://data.commercelayer.app/seed/images/skus/TSHIRTMSFFFFFF000000XLXX_FLAT.png", "shipping_category": "shipping_category_1" + }, + { + "reference": "sku_251", + "code": "EBOOKECOMPLAYBOOKED1XXXX", + "name": "The Ecommerce Playbook (Ebook ed.1)", + "description": "How to get started with a composable commerce approach, powered by Commerce Layer. Download the ebook for free.", + "image_url": "https://data.commercelayer.app/seed/images/skus/EBOOKECOMPLAYBOOKED1XXXX_FLAT.png", + "do_not_ship": true, + "shipping_category": "shipping_category_2" } ] diff --git a/packages/drop-in/seed/data/stock_items.json b/packages/drop-in/seed/data/stock_items.json index 2477a462..bcd0dc93 100644 --- a/packages/drop-in/seed/data/stock_items.json +++ b/packages/drop-in/seed/data/stock_items.json @@ -142,5 +142,17 @@ "sku_code": "TSHIRTMSFFFFFF000000XLXX", "quantity": 166, "stock_location": "stock_location_2" + }, + { + "reference": "stock_item_501", + "sku_code": "EBOOKECOMPLAYBOOKED1XXXX", + "quantity": 500, + "stock_location": "stock_location_1" + }, + { + "reference": "stock_item_502", + "sku_code": "EBOOKECOMPLAYBOOKED1XXXX", + "quantity": 500, + "stock_location": "stock_location_2" } ] diff --git a/packages/drop-in/seed/drop_in.json b/packages/drop-in/seed/drop_in.json index 6ef6c389..b9b89afa 100644 --- a/packages/drop-in/seed/drop_in.json +++ b/packages/drop-in/seed/drop_in.json @@ -69,7 +69,8 @@ { "resourceType": "shipping_categories", "referenceKeys": [ - "shipping_category_1" + "shipping_category_1", + "shipping_category_2" ] }, { diff --git a/packages/drop-in/seed/reset_stock_items.json b/packages/drop-in/seed/reset_stock_items.json index 9bb4b5c6..30415bb4 100644 --- a/packages/drop-in/seed/reset_stock_items.json +++ b/packages/drop-in/seed/reset_stock_items.json @@ -6,8 +6,8 @@ "stock_item_60", "stock_item_358", "stock_item_108", - "stock_item_41", - "stock_item_291" + "stock_item_501", + "stock_item_502" ] } ] \ No newline at end of file diff --git a/packages/drop-in/src/index.html b/packages/drop-in/src/index.html index 85d8b104..2b7f3938 100644 --- a/packages/drop-in/src/index.html +++ b/packages/drop-in/src/index.html @@ -142,7 +142,7 @@ - +