@shopify/ui-extensions 2025.10.0-rc.45 → 2025.10.0-rc.47
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/build/cjs/surfaces/checkout/preact/api.js +1 -1
- package/build/cjs/surfaces/checkout/shared.js +1 -1
- package/build/esm/surfaces/checkout/preact/api.mjs +1 -1
- package/build/esm/surfaces/checkout/shared.mjs +1 -1
- package/build/esnext/surfaces/checkout/preact/api.esnext +1 -1
- package/build/esnext/surfaces/checkout/shared.esnext +1 -1
- package/build/ts/docs/shared/components/ConsentCheckbox.d.ts +4 -0
- package/build/ts/docs/shared/components/ConsentCheckbox.d.ts.map +1 -0
- package/build/ts/docs/shared/components/ConsentPhoneField.d.ts +4 -0
- package/build/ts/docs/shared/components/ConsentPhoneField.d.ts.map +1 -0
- package/build/ts/docs/shared/components/index.d.ts +2 -0
- package/build/ts/docs/shared/components/index.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.doc.d.ts +4 -0
- package/build/ts/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.doc.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/ConsentCheckbox.d.ts +84 -0
- package/build/ts/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.doc.d.ts +4 -0
- package/build/ts/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.doc.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/ConsentPhoneField.d.ts +129 -0
- package/build/ts/surfaces/checkout/components/NumberField/NumberField.doc.d.ts +4 -0
- package/build/ts/surfaces/checkout/components/NumberField/NumberField.doc.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/NumberField.d.ts +98 -0
- package/build/ts/surfaces/checkout/components/PasswordField.d.ts +1 -1
- package/build/ts/surfaces/checkout/components/components-shared.d.ts +17 -0
- package/build/ts/surfaces/checkout/components/components.d.ts +216 -144
- package/build/ts/surfaces/checkout/shared.d.ts +1 -1
- package/build/ts/surfaces/checkout/shared.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/targets/Checkout::Actions::RenderBefore.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::CartLineDetails::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::CartLineDetails::RenderLineComponents.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::CartLines::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::Contact::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::CustomerInformation::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::DeliveryAddress::RenderBefore.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::Dynamic::Render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::GiftCard::Render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PaymentMethod::HostedFields::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PaymentMethod::Render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PaymentMethod::RenderRequiredAction.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PickupLocations::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PickupLocations::RenderBefore.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PickupPoints::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PickupPoints::RenderBefore.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::Reductions::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::Reductions::RenderBefore.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ShippingMethodDetails::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ShippingMethodDetails::RenderExpanded.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ShippingMethods::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ShippingMethods::RenderBefore.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ThankYou::CartLineDetails::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ThankYou::CartLines::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ThankYou::CustomerInformation::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ThankYou::Dynamic::Render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.cart-line-item.line-components.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.actions.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.block.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.cart-line-item.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.cart-line-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.contact.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.delivery-address.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.delivery-address.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.footer.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.gift-card.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.header.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-method-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-method-list.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-option-item.action-required.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-option-item.details.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-option-item.hosted-fields.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-location-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-location-list.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-location-option-item.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-point-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-point-list.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.reductions.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.reductions.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-item.details.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-item.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-list.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.announcement.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.block.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.cart-line-item.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.cart-line-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.customer-information.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.footer.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.header.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/components/ConsentCheckbox.d.ts +84 -0
- package/build/ts/surfaces/customer-account/components/ConsentPhoneField.d.ts +129 -0
- package/build/ts/surfaces/customer-account/components/NumberField.d.ts +98 -0
- package/build/ts/surfaces/customer-account/components/PasswordField.d.ts +1 -1
- package/build/ts/surfaces/customer-account/components/components-shared.d.ts +17 -0
- package/build/ts/surfaces/customer-account/components/components.d.ts +216 -144
- package/build/ts/surfaces/customer-account/targets/customer-account.footer.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-index.announcement.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-index.block.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.announcement.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.block.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.cart-line-item.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.cart-line-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.customer-information.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.fulfillment-details.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.payment-details.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.return-details.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.unfulfilled-items.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order.action.menu-item.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order.action.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order.page.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.page.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.addresses.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.announcement.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.block.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-details.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-addresses.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-payment.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-staff.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.payment.render-after.d.ts +3 -0
- package/build/ts/surfaces/point-of-sale/components/Badge.d.ts +10 -1
- package/build/ts/surfaces/point-of-sale/components/Banner.d.ts +12 -4
- package/build/ts/surfaces/point-of-sale/components/Box.d.ts +51 -14
- package/build/ts/surfaces/point-of-sale/components/Button.d.ts +12 -2
- package/build/ts/surfaces/point-of-sale/components/Choice.d.ts +3 -2
- package/build/ts/surfaces/point-of-sale/components/ChoiceList/ChoiceList.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/ChoiceList.d.ts +13 -4
- package/build/ts/surfaces/point-of-sale/components/Clickable.d.ts +11 -4
- package/build/ts/surfaces/point-of-sale/components/DateField/DateField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/DateField.d.ts +20 -13
- package/build/ts/surfaces/point-of-sale/components/DatePicker/DatePicker.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/DatePicker.d.ts +16 -4
- package/build/ts/surfaces/point-of-sale/components/DateSpinner/DateSpinner.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/DateSpinner.d.ts +16 -4
- package/build/ts/surfaces/point-of-sale/components/Divider/Divider.doc.d.ts +4 -0
- package/build/ts/surfaces/point-of-sale/components/Divider/Divider.doc.d.ts.map +1 -0
- package/build/ts/surfaces/point-of-sale/components/Divider.d.ts +4 -3
- package/build/ts/surfaces/point-of-sale/components/EmailField/EmailField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/EmailField.d.ts +22 -5
- package/build/ts/surfaces/point-of-sale/components/Heading.d.ts +7 -4
- package/build/ts/surfaces/point-of-sale/components/Icon.d.ts +13 -3
- package/build/ts/surfaces/point-of-sale/components/Image.d.ts +12 -5
- package/build/ts/surfaces/point-of-sale/components/Modal.d.ts +28 -7
- package/build/ts/surfaces/point-of-sale/components/NumberField/NumberField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/NumberField.d.ts +32 -23
- package/build/ts/surfaces/point-of-sale/components/Page.d.ts +25 -11
- package/build/ts/surfaces/point-of-sale/components/PosBlock.d.ts +12 -13
- package/build/ts/surfaces/point-of-sale/components/QrCode.d.ts +12 -8
- package/build/ts/surfaces/point-of-sale/components/ScrollBox.d.ts +47 -15
- package/build/ts/surfaces/point-of-sale/components/SearchField/SearchField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/SearchField.d.ts +17 -5
- package/build/ts/surfaces/point-of-sale/components/Section.d.ts +15 -9
- package/build/ts/surfaces/point-of-sale/components/Stack.d.ts +67 -7
- package/build/ts/surfaces/point-of-sale/components/Text.d.ts +25 -4
- package/build/ts/surfaces/point-of-sale/components/TextArea/TextArea.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/TextArea.d.ts +22 -5
- package/build/ts/surfaces/point-of-sale/components/TextField/TextField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/TextField.d.ts +22 -5
- package/build/ts/surfaces/point-of-sale/components/Tile.d.ts +12 -2
- package/build/ts/surfaces/point-of-sale/components/TimeField/TimeField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/TimeField.d.ts +18 -6
- package/build/ts/surfaces/point-of-sale/components/TimePicker/TimePicker.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/TimePicker.d.ts +16 -4
- package/build/ts/surfaces/point-of-sale/components/components-shared.d.ts +102 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -3
- package/src/docs/shared/components/ConsentCheckbox.ts +12 -0
- package/src/docs/shared/components/ConsentPhoneField.ts +12 -0
- package/src/docs/shared/components/index.ts +2 -0
- package/src/surfaces/checkout/components/ConsentCheckbox/examples/basic-consent-checkbox.example.html +5 -0
- package/src/surfaces/checkout/components/ConsentCheckbox.d.ts +84 -0
- package/src/surfaces/checkout/components/ConsentPhoneField/examples/basic-consent-phone-field.example.html +5 -0
- package/src/surfaces/checkout/components/ConsentPhoneField.d.ts +129 -0
- package/src/surfaces/checkout/components/NumberField/examples/basic-number-field.example.html +8 -0
- package/src/surfaces/checkout/components/NumberField.d.ts +98 -0
- package/src/surfaces/checkout/components/PasswordField.d.ts +1 -1
- package/src/surfaces/checkout/components/PhoneField/examples/basic-phone-field.example.html +2 -1
- package/src/surfaces/checkout/components/ProductThumbnail/examples/basic-product-thumbnail.example.html +4 -1
- package/src/surfaces/checkout/components/Stack/examples/basic-stack.example.html +20 -4
- package/src/surfaces/checkout/components/TextArea/examples/basic-text-area.example.html +5 -1
- package/src/surfaces/checkout/components/TextField/examples/basic-text-field.example.html +4 -1
- package/src/surfaces/checkout/components/components-shared.d.ts +17 -0
- package/src/surfaces/checkout/components/components.d.ts +216 -144
- package/src/surfaces/checkout/preact/api.ts +1 -1
- package/src/surfaces/checkout/preact/tests/api.test.tsx +22 -13
- package/src/surfaces/checkout/preact/tests/app-metafields.test.ts +52 -56
- package/src/surfaces/checkout/preact/tests/attributes.test.ts +34 -24
- package/src/surfaces/checkout/preact/tests/billing-address.test.ts +17 -7
- package/src/surfaces/checkout/preact/tests/buyer-identity-businessCustomer.test.ts +16 -9
- package/src/surfaces/checkout/preact/tests/buyer-identity.test.tsx +57 -26
- package/src/surfaces/checkout/preact/tests/buyer-journey.test.ts +71 -74
- package/src/surfaces/checkout/preact/tests/capabilities.test.ts +32 -28
- package/src/surfaces/checkout/preact/tests/cart-line-target.test.ts +31 -24
- package/src/surfaces/checkout/preact/tests/checkout-settings.test.ts +17 -9
- package/src/surfaces/checkout/preact/tests/checkout-token.test.ts +16 -6
- package/src/surfaces/checkout/preact/tests/configuration.test.ts +16 -6
- package/src/surfaces/checkout/preact/tests/country.test.tsx +18 -8
- package/src/surfaces/checkout/preact/tests/currency.test.tsx +18 -8
- package/src/surfaces/checkout/preact/tests/customer-privacy.test.ts +17 -8
- package/src/surfaces/checkout/preact/tests/delivery-group-list-target.test.ts +24 -18
- package/src/surfaces/checkout/preact/tests/delivery-group-target.test.ts +25 -19
- package/src/surfaces/checkout/preact/tests/delivery-group.test.ts +22 -16
- package/src/surfaces/checkout/preact/tests/delivery-groups.test.ts +17 -11
- package/src/surfaces/checkout/preact/tests/delivery-selection-groups.test.ts +31 -24
- package/src/surfaces/checkout/preact/tests/discounts.test.tsx +21 -14
- package/src/surfaces/checkout/preact/tests/extension-language.test.tsx +17 -8
- package/src/surfaces/checkout/preact/tests/gift-cards.test.tsx +17 -8
- package/src/surfaces/checkout/preact/tests/localized-fields.test.ts +58 -59
- package/src/surfaces/checkout/preact/tests/market.test.tsx +17 -7
- package/src/surfaces/checkout/preact/tests/metafield.test.tsx +33 -36
- package/src/surfaces/checkout/preact/tests/metafields.test.tsx +36 -53
- package/src/surfaces/checkout/preact/tests/mount.tsx +60 -17
- package/src/surfaces/checkout/preact/tests/notes.test.tsx +16 -6
- package/src/surfaces/checkout/preact/tests/payment-method.test.ts +87 -60
- package/src/surfaces/checkout/preact/tests/payment-options.test.tsx +26 -24
- package/src/surfaces/checkout/preact/tests/pickup-location-option-target.test.tsx +55 -46
- package/src/surfaces/checkout/preact/tests/redeemable.test.ts +30 -23
- package/src/surfaces/checkout/preact/tests/session-token.test.tsx +12 -6
- package/src/surfaces/checkout/preact/tests/shipping-address.test.ts +17 -7
- package/src/surfaces/checkout/preact/tests/shipping-option-target.test.ts +54 -50
- package/src/surfaces/checkout/preact/tests/shopping-address.test.tsx +18 -10
- package/src/surfaces/checkout/preact/tests/timezone.test.tsx +17 -7
- package/src/surfaces/checkout/preact/tests/translate.test.tsx +18 -13
- package/src/surfaces/checkout/preact/tests/tsconfig.json +1 -1
- package/src/surfaces/checkout/shared.ts +2 -0
- package/src/surfaces/point-of-sale/components/Badge.d.ts +10 -1
- package/src/surfaces/point-of-sale/components/Banner/examples/default.html +8 -8
- package/src/surfaces/point-of-sale/components/Banner.d.ts +12 -4
- package/src/surfaces/point-of-sale/components/Box/examples/default.html +2 -2
- package/src/surfaces/point-of-sale/components/Box.d.ts +51 -14
- package/src/surfaces/point-of-sale/components/Button/examples/default.html +2 -4
- package/src/surfaces/point-of-sale/components/Button.d.ts +12 -2
- package/src/surfaces/point-of-sale/components/Choice.d.ts +3 -2
- package/src/surfaces/point-of-sale/components/ChoiceList/examples/default.html +5 -4
- package/src/surfaces/point-of-sale/components/ChoiceList/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/ChoiceList/examples/multiple-selection.jsx +9 -0
- package/src/surfaces/point-of-sale/components/ChoiceList.d.ts +13 -4
- package/src/surfaces/point-of-sale/components/Clickable/examples/default.html +5 -2
- package/src/surfaces/point-of-sale/components/Clickable.d.ts +11 -4
- package/src/surfaces/point-of-sale/components/DateField/examples/default.html +2 -10
- package/src/surfaces/point-of-sale/components/DateField/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/DateField.d.ts +20 -13
- package/src/surfaces/point-of-sale/components/DatePicker/examples/command-system.jsx +10 -0
- package/src/surfaces/point-of-sale/components/DatePicker/examples/default.html +4 -5
- package/src/surfaces/point-of-sale/components/DatePicker/examples/event-handling.jsx +7 -0
- package/src/surfaces/point-of-sale/components/DatePicker.d.ts +16 -4
- package/src/surfaces/point-of-sale/components/DateSpinner/examples/command-system.jsx +10 -0
- package/src/surfaces/point-of-sale/components/DateSpinner/examples/default.html +1 -2
- package/src/surfaces/point-of-sale/components/DateSpinner/examples/event-handling.jsx +7 -0
- package/src/surfaces/point-of-sale/components/DateSpinner.d.ts +16 -4
- package/src/surfaces/point-of-sale/components/Divider/examples/default.html +1 -0
- package/src/surfaces/point-of-sale/components/Divider.d.ts +4 -3
- package/src/surfaces/point-of-sale/components/EmailField/examples/accessory-slot.jsx +9 -0
- package/src/surfaces/point-of-sale/components/EmailField/examples/default.html +3 -10
- package/src/surfaces/point-of-sale/components/EmailField/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/EmailField.d.ts +22 -5
- package/src/surfaces/point-of-sale/components/Heading/examples/default.html +4 -5
- package/src/surfaces/point-of-sale/components/Heading.d.ts +7 -4
- package/src/surfaces/point-of-sale/components/Icon/examples/default.html +4 -1
- package/src/surfaces/point-of-sale/components/Icon.d.ts +13 -3
- package/src/surfaces/point-of-sale/components/Image/examples/default.html +1 -1
- package/src/surfaces/point-of-sale/components/Image.d.ts +12 -5
- package/src/surfaces/point-of-sale/components/Modal/examples/default.html +6 -8
- package/src/surfaces/point-of-sale/components/Modal.d.ts +28 -7
- package/src/surfaces/point-of-sale/components/NumberField/examples/controls-constraints.jsx +9 -0
- package/src/surfaces/point-of-sale/components/NumberField/examples/default.html +5 -2
- package/src/surfaces/point-of-sale/components/NumberField/examples/input-mode.jsx +15 -0
- package/src/surfaces/point-of-sale/components/NumberField.d.ts +32 -23
- package/src/surfaces/point-of-sale/components/Page/examples/default.html +3 -4
- package/src/surfaces/point-of-sale/components/Page.d.ts +25 -11
- package/src/surfaces/point-of-sale/components/PosBlock/examples/default.html +3 -9
- package/src/surfaces/point-of-sale/components/PosBlock.d.ts +12 -13
- package/src/surfaces/point-of-sale/components/QrCode.d.ts +12 -8
- package/src/surfaces/point-of-sale/components/ScrollBox/examples/default.html +5 -4
- package/src/surfaces/point-of-sale/components/ScrollBox.d.ts +47 -15
- package/src/surfaces/point-of-sale/components/SearchField/examples/default.html +1 -1
- package/src/surfaces/point-of-sale/components/SearchField/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/SearchField.d.ts +17 -5
- package/src/surfaces/point-of-sale/components/Section/examples/default.html +6 -8
- package/src/surfaces/point-of-sale/components/Section.d.ts +15 -9
- package/src/surfaces/point-of-sale/components/Stack/examples/default.html +3 -3
- package/src/surfaces/point-of-sale/components/Stack.d.ts +67 -7
- package/src/surfaces/point-of-sale/components/Text/examples/default.html +3 -6
- package/src/surfaces/point-of-sale/components/Text.d.ts +25 -4
- package/src/surfaces/point-of-sale/components/TextArea/examples/accessory-slot.jsx +9 -0
- package/src/surfaces/point-of-sale/components/TextArea/examples/default.html +4 -1
- package/src/surfaces/point-of-sale/components/TextArea/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/TextArea/examples/rows-configuration.jsx +7 -0
- package/src/surfaces/point-of-sale/components/TextArea.d.ts +22 -5
- package/src/surfaces/point-of-sale/components/TextField/examples/accessory-slot.jsx +5 -0
- package/src/surfaces/point-of-sale/components/TextField/examples/common-props.jsx +11 -0
- package/src/surfaces/point-of-sale/components/TextField/examples/default.html +5 -3
- package/src/surfaces/point-of-sale/components/TextField/examples/event-handling.jsx +17 -0
- package/src/surfaces/point-of-sale/components/TextField.d.ts +22 -5
- package/src/surfaces/point-of-sale/components/Tile/examples/default.html +2 -5
- package/src/surfaces/point-of-sale/components/Tile.d.ts +12 -2
- package/src/surfaces/point-of-sale/components/TimeField/examples/default.html +1 -9
- package/src/surfaces/point-of-sale/components/TimeField/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/TimeField.d.ts +18 -6
- package/src/surfaces/point-of-sale/components/TimePicker/examples/command-system.jsx +10 -0
- package/src/surfaces/point-of-sale/components/TimePicker/examples/default.html +4 -1
- package/src/surfaces/point-of-sale/components/TimePicker/examples/event-handling.jsx +7 -0
- package/src/surfaces/point-of-sale/components/TimePicker.d.ts +16 -4
- package/src/surfaces/point-of-sale/components/components-shared.d.ts +102 -1
- package/src/surfaces/point-of-sale/components.d.ts +957 -472
- package/build/ts/surfaces/checkout/errors.d.ts +0 -10
- package/build/ts/surfaces/checkout/errors.d.ts.map +0 -1
- package/src/surfaces/checkout/errors.ts +0 -13
|
@@ -26,13 +26,22 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement>
|
|
|
26
26
|
extends BaseElementProps<TClass> {
|
|
27
27
|
children?: ComponentChildren;
|
|
28
28
|
}
|
|
29
|
+
export type IntrinsicElementProps<T> = T & BaseElementPropsWithChildren<T>;
|
|
29
30
|
|
|
30
31
|
declare const tagName = 's-badge';
|
|
31
32
|
export interface BadgeJSXProps extends Pick<BadgeProps, 'id'> {
|
|
33
|
+
/**
|
|
34
|
+
* Sets the tone of the Badge, based on the intention of the information being conveyed.
|
|
35
|
+
*
|
|
36
|
+
* @default 'auto'
|
|
37
|
+
*/
|
|
32
38
|
tone?: Extract<
|
|
33
39
|
BadgeProps['tone'],
|
|
34
40
|
'auto' | 'neutral' | 'info' | 'success' | 'warning' | 'critical' | 'caution'
|
|
35
41
|
>;
|
|
42
|
+
/**
|
|
43
|
+
* The content of the Badge.
|
|
44
|
+
*/
|
|
36
45
|
children?: ComponentChildren;
|
|
37
46
|
}
|
|
38
47
|
declare global {
|
|
@@ -43,7 +52,7 @@ declare global {
|
|
|
43
52
|
declare module 'preact' {
|
|
44
53
|
namespace createElement.JSX {
|
|
45
54
|
interface IntrinsicElements {
|
|
46
|
-
[tagName]:
|
|
55
|
+
[tagName]: IntrinsicElementProps<BadgeJSXProps>;
|
|
47
56
|
}
|
|
48
57
|
}
|
|
49
58
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<s-banner heading="
|
|
2
|
-
<s-button slot="primary-action">
|
|
1
|
+
<s-banner heading="Marked as delivered" tone="success">
|
|
2
|
+
<s-button slot="primary-action">Dismiss</s-button>
|
|
3
3
|
</s-banner>
|
|
4
4
|
|
|
5
|
-
<s-banner heading="
|
|
6
|
-
<s-button slot="primary-action">
|
|
5
|
+
<s-banner heading="Ready for shipping" tone="info">
|
|
6
|
+
<s-button slot="primary-action">Dismiss</s-button>
|
|
7
7
|
</s-banner>
|
|
8
8
|
|
|
9
|
-
<s-banner heading="
|
|
10
|
-
<s-button slot="primary-action">
|
|
9
|
+
<s-banner heading="Couldn't restock items" tone="warning">
|
|
10
|
+
<s-button slot="primary-action">Dismiss</s-button>
|
|
11
11
|
</s-banner>
|
|
12
12
|
|
|
13
|
-
<s-banner heading="
|
|
14
|
-
<s-button slot="primary-action">
|
|
13
|
+
<s-banner heading="Action failed. Contact developer" tone="critical">
|
|
14
|
+
<s-button slot="primary-action">Dismiss</s-button>
|
|
15
15
|
</s-banner>
|
|
@@ -31,36 +31,44 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement>
|
|
|
31
31
|
extends BaseElementProps<TClass> {
|
|
32
32
|
children?: ComponentChildren;
|
|
33
33
|
}
|
|
34
|
+
export type IntrinsicElementProps<T> = T & BaseElementPropsWithChildren<T>;
|
|
34
35
|
|
|
35
36
|
declare const tagName = 's-banner';
|
|
36
37
|
export interface BannerJSXProps extends Pick<BannerProps, 'heading' | 'id'> {
|
|
37
38
|
/**
|
|
38
39
|
* Determines whether the banner is hidden.
|
|
40
|
+
*
|
|
41
|
+
* @default false
|
|
39
42
|
*/
|
|
40
43
|
hidden?: BannerProps['hidden'];
|
|
41
44
|
/**
|
|
42
45
|
* Sets the tone of the Banner, based on the intention of the information being conveyed.
|
|
46
|
+
*
|
|
47
|
+
* @default 'auto'
|
|
43
48
|
*/
|
|
44
49
|
tone?: Extract<
|
|
45
50
|
BannerProps['tone'],
|
|
46
|
-
'success' | 'info' | 'warning' | 'critical'
|
|
51
|
+
'auto' | 'success' | 'info' | 'warning' | 'critical'
|
|
47
52
|
>;
|
|
48
53
|
/**
|
|
49
54
|
* The action taken when the Banner is pressed.
|
|
50
55
|
*/
|
|
51
56
|
primaryAction?: ComponentChild;
|
|
57
|
+
/**
|
|
58
|
+
* The content of the Banner.
|
|
59
|
+
*/
|
|
52
60
|
children?: ComponentChildren;
|
|
53
61
|
}
|
|
62
|
+
export type ElementProps = Omit<BannerJSXProps, 'primaryAction'>;
|
|
54
63
|
declare global {
|
|
55
64
|
interface HTMLElementTagNameMap {
|
|
56
|
-
[tagName]:
|
|
65
|
+
[tagName]: ElementProps;
|
|
57
66
|
}
|
|
58
67
|
}
|
|
59
68
|
declare module 'preact' {
|
|
60
69
|
namespace createElement.JSX {
|
|
61
70
|
interface IntrinsicElements {
|
|
62
|
-
[tagName]:
|
|
63
|
-
BaseElementPropsWithChildren<Omit<BannerJSXProps, 'primaryAction'>>;
|
|
71
|
+
[tagName]: IntrinsicElementProps<ElementProps>;
|
|
64
72
|
}
|
|
65
73
|
}
|
|
66
74
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<s-box>
|
|
2
|
-
<s-text>
|
|
1
|
+
<s-box padding="base">
|
|
2
|
+
<s-text>View shipping settings</s-text>
|
|
3
3
|
</s-box>
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/triple-slash-reference, spaced-comment
|
|
10
10
|
/// <reference lib="DOM" />
|
|
11
11
|
import type {
|
|
12
|
-
|
|
12
|
+
SizeUnitsOrAuto,
|
|
13
|
+
SizeUnitsOrNone,
|
|
14
|
+
SizeUnits,
|
|
13
15
|
SizeKeyword,
|
|
14
16
|
MaybeAllValuesShorthandProperty,
|
|
15
17
|
MaybeTwoValuesShorthandProperty,
|
|
@@ -33,19 +35,51 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement>
|
|
|
33
35
|
extends BaseElementProps<TClass> {
|
|
34
36
|
children?: ComponentChildren;
|
|
35
37
|
}
|
|
38
|
+
export type IntrinsicElementProps<T> = T & BaseElementPropsWithChildren<T>;
|
|
36
39
|
|
|
37
40
|
declare const tagName = 's-box';
|
|
38
41
|
export type PaddingKeyword = SizeKeyword | 'none';
|
|
39
|
-
export interface BoxJSXProps
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
export interface BoxJSXProps {
|
|
43
|
+
/**
|
|
44
|
+
* A unique identifier for the element.
|
|
45
|
+
*/
|
|
46
|
+
id?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Adjust the block size.
|
|
49
|
+
*
|
|
50
|
+
* @default 'auto'
|
|
51
|
+
*/
|
|
52
|
+
blockSize?: SizeUnitsOrAuto;
|
|
53
|
+
/**
|
|
54
|
+
* Adjust the inline size.
|
|
55
|
+
*
|
|
56
|
+
* @default 'auto'
|
|
57
|
+
*/
|
|
58
|
+
inlineSize?: SizeUnitsOrAuto;
|
|
59
|
+
/**
|
|
60
|
+
* Adjust the maximum block size.
|
|
61
|
+
*
|
|
62
|
+
* @default 'none'
|
|
63
|
+
*/
|
|
64
|
+
maxBlockSize?: SizeUnitsOrNone;
|
|
65
|
+
/**
|
|
66
|
+
* Adjust the maximum inline size.
|
|
67
|
+
*
|
|
68
|
+
* @default 'none'
|
|
69
|
+
*/
|
|
70
|
+
maxInlineSize?: SizeUnitsOrNone;
|
|
71
|
+
/**
|
|
72
|
+
* Adjust the minimum block size.
|
|
73
|
+
*
|
|
74
|
+
* @default '0'
|
|
75
|
+
*/
|
|
76
|
+
minBlockSize?: SizeUnits;
|
|
77
|
+
/**
|
|
78
|
+
* Adjust the minimum inline size.
|
|
79
|
+
*
|
|
80
|
+
* @default '0'
|
|
81
|
+
*/
|
|
82
|
+
minInlineSize?: SizeUnits;
|
|
49
83
|
/**
|
|
50
84
|
* Adjust the padding of all edges.
|
|
51
85
|
*
|
|
@@ -76,7 +110,7 @@ export interface BoxJSXProps
|
|
|
76
110
|
*
|
|
77
111
|
* @default '' - meaning no override
|
|
78
112
|
*/
|
|
79
|
-
paddingBlock?: MaybeTwoValuesShorthandProperty<PaddingKeyword | ''
|
|
113
|
+
paddingBlock?: MaybeTwoValuesShorthandProperty<PaddingKeyword> | '';
|
|
80
114
|
/**
|
|
81
115
|
* Adjust the block-start padding.
|
|
82
116
|
*
|
|
@@ -102,7 +136,7 @@ export interface BoxJSXProps
|
|
|
102
136
|
*
|
|
103
137
|
* @default '' - meaning no override
|
|
104
138
|
*/
|
|
105
|
-
paddingInline?: MaybeTwoValuesShorthandProperty<PaddingKeyword | ''
|
|
139
|
+
paddingInline?: MaybeTwoValuesShorthandProperty<PaddingKeyword> | '';
|
|
106
140
|
/**
|
|
107
141
|
* Adjust the inline-start padding.
|
|
108
142
|
*
|
|
@@ -119,6 +153,9 @@ export interface BoxJSXProps
|
|
|
119
153
|
* @default '' - meaning no override
|
|
120
154
|
*/
|
|
121
155
|
paddingInlineEnd?: PaddingKeyword | '';
|
|
156
|
+
/**
|
|
157
|
+
* The content of the Box.
|
|
158
|
+
*/
|
|
122
159
|
children?: ComponentChildren;
|
|
123
160
|
}
|
|
124
161
|
declare global {
|
|
@@ -129,7 +166,7 @@ declare global {
|
|
|
129
166
|
declare module 'preact' {
|
|
130
167
|
namespace createElement.JSX {
|
|
131
168
|
interface IntrinsicElements {
|
|
132
|
-
[tagName]:
|
|
169
|
+
[tagName]: IntrinsicElementProps<BoxJSXProps>;
|
|
133
170
|
}
|
|
134
171
|
}
|
|
135
172
|
}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
<s-button variant="primary">
|
|
2
|
-
<s-button variant="secondary">
|
|
3
|
-
<s-button tone="critical">Label</s-button>
|
|
4
|
-
<s-button disabled>Label</s-button>
|
|
1
|
+
<s-button variant="primary">Add customer</s-button>
|
|
2
|
+
<s-button variant="secondary">Select more items</s-button>
|
|
@@ -26,6 +26,7 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement>
|
|
|
26
26
|
extends BaseElementProps<TClass> {
|
|
27
27
|
children?: ComponentChildren;
|
|
28
28
|
}
|
|
29
|
+
export type IntrinsicElementProps<T> = T & BaseElementPropsWithChildren<T>;
|
|
29
30
|
export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
30
31
|
currentTarget: HTMLElementTagNameMap[T];
|
|
31
32
|
bubbles?: boolean;
|
|
@@ -38,7 +39,10 @@ export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
|
38
39
|
|
|
39
40
|
declare const tagName = 's-button';
|
|
40
41
|
export interface ButtonJSXProps
|
|
41
|
-
extends Pick<
|
|
42
|
+
extends Pick<
|
|
43
|
+
ButtonProps,
|
|
44
|
+
'id' | 'disabled' | 'command' | 'commandFor' | 'loading'
|
|
45
|
+
> {
|
|
42
46
|
/**
|
|
43
47
|
* Sets the action the `commandFor` should take when this clickable is activated.
|
|
44
48
|
*
|
|
@@ -72,7 +76,13 @@ export interface ButtonJSXProps
|
|
|
72
76
|
* @default 'auto' - the variant is automatically determined by the Button's context
|
|
73
77
|
*/
|
|
74
78
|
variant?: Extract<ButtonProps['variant'], 'primary' | 'secondary'>;
|
|
79
|
+
/**
|
|
80
|
+
* Called when the button is activated.
|
|
81
|
+
*/
|
|
75
82
|
onClick?: (event: CallbackEvent<typeof tagName>) => void;
|
|
83
|
+
/**
|
|
84
|
+
* The content of the Button.
|
|
85
|
+
*/
|
|
76
86
|
children?: ComponentChildren;
|
|
77
87
|
}
|
|
78
88
|
declare global {
|
|
@@ -83,7 +93,7 @@ declare global {
|
|
|
83
93
|
declare module 'preact' {
|
|
84
94
|
namespace createElement.JSX {
|
|
85
95
|
interface IntrinsicElements {
|
|
86
|
-
[tagName]:
|
|
96
|
+
[tagName]: IntrinsicElementProps<ButtonJSXProps>;
|
|
87
97
|
}
|
|
88
98
|
}
|
|
89
99
|
}
|
|
@@ -26,10 +26,11 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement>
|
|
|
26
26
|
extends BaseElementProps<TClass> {
|
|
27
27
|
children?: ComponentChildren;
|
|
28
28
|
}
|
|
29
|
+
export type IntrinsicElementProps<T> = T & BaseElementPropsWithChildren<T>;
|
|
29
30
|
|
|
30
31
|
declare const tagName = 's-choice';
|
|
31
32
|
export interface ChoiceJSXProps
|
|
32
|
-
extends Pick<ChoiceProps, 'value' | 'disabled' | 'selected'> {
|
|
33
|
+
extends Pick<ChoiceProps, 'id' | 'value' | 'disabled' | 'selected'> {
|
|
33
34
|
children?: ComponentChildren;
|
|
34
35
|
}
|
|
35
36
|
declare global {
|
|
@@ -40,7 +41,7 @@ declare global {
|
|
|
40
41
|
declare module 'preact' {
|
|
41
42
|
namespace createElement.JSX {
|
|
42
43
|
interface IntrinsicElements {
|
|
43
|
-
[tagName]:
|
|
44
|
+
[tagName]: IntrinsicElementProps<ChoiceJSXProps>;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<s-choice-list>
|
|
2
|
-
<s-choice value="
|
|
3
|
-
<s-choice value="
|
|
4
|
-
<s-choice value="
|
|
5
|
-
</s-choice
|
|
2
|
+
<s-choice value="s" selected>Small</s-choice>
|
|
3
|
+
<s-choice value="m">Medium</s-choice>
|
|
4
|
+
<s-choice value="l">Large</s-choice>
|
|
5
|
+
<s-choice value="xl">Extra large</s-choice>
|
|
6
|
+
</s-choice-list>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<s-choice-list
|
|
2
|
+
onChange={(event) => console.log('onChange:', event.target.values)}
|
|
3
|
+
onInput={(event) => console.log('onInput:', event.target.values)}
|
|
4
|
+
>
|
|
5
|
+
<s-choice value="option1">Option 1</s-choice>
|
|
6
|
+
<s-choice value="option2" disabled>Option 2 (disabled)</s-choice>
|
|
7
|
+
<s-choice value="option3">Option 3</s-choice>
|
|
8
|
+
</s-choice-list>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<s-choice-list
|
|
2
|
+
multiple
|
|
3
|
+
values={['small', 'medium']}
|
|
4
|
+
onChange={(event) => console.log('Selected:', event.target.values)}
|
|
5
|
+
>
|
|
6
|
+
<s-choice value="small">Small</s-choice>
|
|
7
|
+
<s-choice value="medium">Medium</s-choice>
|
|
8
|
+
<s-choice value="large">Large</s-choice>
|
|
9
|
+
</s-choice-list>
|
|
@@ -26,6 +26,7 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement>
|
|
|
26
26
|
extends BaseElementProps<TClass> {
|
|
27
27
|
children?: ComponentChildren;
|
|
28
28
|
}
|
|
29
|
+
export type IntrinsicElementProps<T> = T & BaseElementPropsWithChildren<T>;
|
|
29
30
|
export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
30
31
|
currentTarget: HTMLElementTagNameMap[T];
|
|
31
32
|
bubbles?: boolean;
|
|
@@ -38,9 +39,18 @@ export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
|
38
39
|
|
|
39
40
|
declare const tagName = 's-choice-list';
|
|
40
41
|
export interface ChoiceListJSXProps
|
|
41
|
-
extends Pick<ChoiceListProps, 'values' | 'multiple'> {
|
|
42
|
-
|
|
42
|
+
extends Pick<ChoiceListProps, 'id' | 'values' | 'multiple'> {
|
|
43
|
+
/**
|
|
44
|
+
* Callback when the user changes a choice. Fires simultaneously with onChange.
|
|
45
|
+
*/
|
|
43
46
|
onInput?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
47
|
+
/**
|
|
48
|
+
* Callback when the user changes a choice. Fires simultaneously with onInput.
|
|
49
|
+
*/
|
|
50
|
+
onChange?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
51
|
+
/**
|
|
52
|
+
* The content of the ChoiceList. Should be one or more Choice elements.
|
|
53
|
+
*/
|
|
44
54
|
children?: ComponentChildren;
|
|
45
55
|
}
|
|
46
56
|
declare global {
|
|
@@ -51,8 +61,7 @@ declare global {
|
|
|
51
61
|
declare module 'preact' {
|
|
52
62
|
namespace createElement.JSX {
|
|
53
63
|
interface IntrinsicElements {
|
|
54
|
-
[tagName]: ChoiceListJSXProps
|
|
55
|
-
BaseElementPropsWithChildren<ChoiceListJSXProps>;
|
|
64
|
+
[tagName]: IntrinsicElementProps<ChoiceListJSXProps>;
|
|
56
65
|
}
|
|
57
66
|
}
|
|
58
67
|
}
|
|
@@ -26,6 +26,7 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement>
|
|
|
26
26
|
extends BaseElementProps<TClass> {
|
|
27
27
|
children?: ComponentChildren;
|
|
28
28
|
}
|
|
29
|
+
export type IntrinsicElementProps<T> = T & BaseElementPropsWithChildren<T>;
|
|
29
30
|
export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
30
31
|
currentTarget: HTMLElementTagNameMap[T];
|
|
31
32
|
bubbles?: boolean;
|
|
@@ -37,9 +38,16 @@ export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
declare const tagName = 's-clickable';
|
|
40
|
-
export interface ClickableJSXProps
|
|
41
|
-
|
|
41
|
+
export interface ClickableJSXProps
|
|
42
|
+
extends Pick<ClickableProps, 'id' | 'disabled'> {
|
|
43
|
+
/**
|
|
44
|
+
* Callback when the element is activated.
|
|
45
|
+
*/
|
|
42
46
|
onClick?: (event: CallbackEvent<typeof tagName>) => void;
|
|
47
|
+
/**
|
|
48
|
+
* The content of the Clickable.
|
|
49
|
+
*/
|
|
50
|
+
children?: ComponentChildren;
|
|
43
51
|
}
|
|
44
52
|
declare global {
|
|
45
53
|
interface HTMLElementTagNameMap {
|
|
@@ -49,8 +57,7 @@ declare global {
|
|
|
49
57
|
declare module 'preact' {
|
|
50
58
|
namespace createElement.JSX {
|
|
51
59
|
interface IntrinsicElements {
|
|
52
|
-
[tagName]: ClickableJSXProps
|
|
53
|
-
BaseElementPropsWithChildren<ClickableJSXProps>;
|
|
60
|
+
[tagName]: IntrinsicElementProps<ClickableJSXProps>;
|
|
54
61
|
}
|
|
55
62
|
}
|
|
56
63
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<s-date-field
|
|
2
|
+
label="Order date"
|
|
3
|
+
value="2024-10-26"
|
|
4
|
+
onInput={(event) => console.log('Input:', event.target.value)}
|
|
5
|
+
onChange={(event) => console.log('Change:', event.target.value)}
|
|
6
|
+
onFocus={(event) => console.log('Focused with:', event.target.value)}
|
|
7
|
+
onBlur={(event) => console.log('Blurred with:', event.target.value)}
|
|
8
|
+
/>
|
|
@@ -8,12 +8,7 @@
|
|
|
8
8
|
/* eslint-disable import-x/namespace */
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/triple-slash-reference, spaced-comment
|
|
10
10
|
/// <reference lib="DOM" />
|
|
11
|
-
import type {
|
|
12
|
-
DateFieldProps,
|
|
13
|
-
Key,
|
|
14
|
-
Ref,
|
|
15
|
-
ComponentChild,
|
|
16
|
-
} from './components-shared.d.ts';
|
|
11
|
+
import type {DateFieldProps, Key, Ref} from './components-shared.d.ts';
|
|
17
12
|
|
|
18
13
|
export type ComponentChildren = any;
|
|
19
14
|
/**
|
|
@@ -31,6 +26,7 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement>
|
|
|
31
26
|
extends BaseElementProps<TClass> {
|
|
32
27
|
children?: ComponentChildren;
|
|
33
28
|
}
|
|
29
|
+
export type IntrinsicElementProps<T> = T & BaseElementPropsWithChildren<T>;
|
|
34
30
|
export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
35
31
|
currentTarget: HTMLElementTagNameMap[T];
|
|
36
32
|
bubbles?: boolean;
|
|
@@ -45,24 +41,35 @@ declare const tagName = 's-date-field';
|
|
|
45
41
|
export interface DateFieldJSXProps
|
|
46
42
|
extends Pick<
|
|
47
43
|
DateFieldProps,
|
|
48
|
-
'label' | 'details' | 'value' | 'disabled' | 'error'
|
|
44
|
+
'id' | 'label' | 'details' | 'value' | 'disabled' | 'error'
|
|
49
45
|
> {
|
|
46
|
+
/**
|
|
47
|
+
* Callback when the user makes any changes in the field.
|
|
48
|
+
*/
|
|
50
49
|
onInput?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Callback after editing completes (typically on blur).
|
|
52
|
+
*/
|
|
53
53
|
onChange?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
54
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Callback when the element loses focus.
|
|
56
|
+
*/
|
|
57
|
+
onBlur?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
58
|
+
/**
|
|
59
|
+
* Callback when the element receives focus.
|
|
60
|
+
*/
|
|
61
|
+
onFocus?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
55
62
|
}
|
|
63
|
+
export type ElementProps = Omit<DateFieldJSXProps, 'accessory'>;
|
|
56
64
|
declare global {
|
|
57
65
|
interface HTMLElementTagNameMap {
|
|
58
|
-
[tagName]:
|
|
66
|
+
[tagName]: ElementProps;
|
|
59
67
|
}
|
|
60
68
|
}
|
|
61
69
|
declare module 'preact' {
|
|
62
70
|
namespace createElement.JSX {
|
|
63
71
|
interface IntrinsicElements {
|
|
64
|
-
[tagName]:
|
|
65
|
-
BaseElementPropsWithChildren<Omit<DateFieldJSXProps, 'accessory'>>;
|
|
72
|
+
[tagName]: IntrinsicElementProps<ElementProps>;
|
|
66
73
|
}
|
|
67
74
|
}
|
|
68
75
|
}
|
|
@@ -26,6 +26,7 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement>
|
|
|
26
26
|
extends BaseElementProps<TClass> {
|
|
27
27
|
children?: ComponentChildren;
|
|
28
28
|
}
|
|
29
|
+
export type IntrinsicElementProps<T> = T & BaseElementPropsWithChildren<T>;
|
|
29
30
|
export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
30
31
|
currentTarget: HTMLElementTagNameMap[T];
|
|
31
32
|
bubbles?: boolean;
|
|
@@ -39,10 +40,22 @@ export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
|
39
40
|
declare const tagName = 's-date-picker';
|
|
40
41
|
export interface DatePickerJSXProps
|
|
41
42
|
extends Pick<DatePickerProps, 'id' | 'value'> {
|
|
43
|
+
/**
|
|
44
|
+
* Callback when the user selects a date from the picker.
|
|
45
|
+
*/
|
|
46
|
+
onInput?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
47
|
+
/**
|
|
48
|
+
* Callback when the user selects a date from the picker that is different to the current value.
|
|
49
|
+
*/
|
|
50
|
+
onChange?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
51
|
+
/**
|
|
52
|
+
* Callback when the date picker is dismissed.
|
|
53
|
+
*/
|
|
42
54
|
onBlur?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
55
|
+
/**
|
|
56
|
+
* Callback when the date picker is revealed.
|
|
57
|
+
*/
|
|
43
58
|
onFocus?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
44
|
-
onChange?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
45
|
-
onInput?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
46
59
|
}
|
|
47
60
|
declare global {
|
|
48
61
|
interface HTMLElementTagNameMap {
|
|
@@ -52,8 +65,7 @@ declare global {
|
|
|
52
65
|
declare module 'preact' {
|
|
53
66
|
namespace createElement.JSX {
|
|
54
67
|
interface IntrinsicElements {
|
|
55
|
-
[tagName]: DatePickerJSXProps
|
|
56
|
-
BaseElementPropsWithChildren<DatePickerJSXProps>;
|
|
68
|
+
[tagName]: IntrinsicElementProps<DatePickerJSXProps>;
|
|
57
69
|
}
|
|
58
70
|
}
|
|
59
71
|
}
|
|
@@ -26,6 +26,7 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement>
|
|
|
26
26
|
extends BaseElementProps<TClass> {
|
|
27
27
|
children?: ComponentChildren;
|
|
28
28
|
}
|
|
29
|
+
export type IntrinsicElementProps<T> = T & BaseElementPropsWithChildren<T>;
|
|
29
30
|
export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
30
31
|
currentTarget: HTMLElementTagNameMap[T];
|
|
31
32
|
bubbles?: boolean;
|
|
@@ -39,10 +40,22 @@ export interface CallbackEvent<T extends keyof HTMLElementTagNameMap> {
|
|
|
39
40
|
declare const tagName = 's-date-spinner';
|
|
40
41
|
export interface DateSpinnerJSXProps
|
|
41
42
|
extends Pick<DateSpinnerProps, 'id' | 'value'> {
|
|
43
|
+
/**
|
|
44
|
+
* Callback when the user makes a selection.
|
|
45
|
+
*/
|
|
46
|
+
onInput?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
47
|
+
/**
|
|
48
|
+
* Callback when the value changes. Only called when a different value is selected.
|
|
49
|
+
*/
|
|
50
|
+
onChange?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
51
|
+
/**
|
|
52
|
+
* Callback when the date spinner is dismissed.
|
|
53
|
+
*/
|
|
42
54
|
onBlur?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
55
|
+
/**
|
|
56
|
+
* Callback when the date spinner is revealed.
|
|
57
|
+
*/
|
|
43
58
|
onFocus?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
44
|
-
onChange?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
45
|
-
onInput?: (event: CallbackEvent<typeof tagName>) => void | null;
|
|
46
59
|
}
|
|
47
60
|
declare global {
|
|
48
61
|
interface HTMLElementTagNameMap {
|
|
@@ -52,8 +65,7 @@ declare global {
|
|
|
52
65
|
declare module 'preact' {
|
|
53
66
|
namespace createElement.JSX {
|
|
54
67
|
interface IntrinsicElements {
|
|
55
|
-
[tagName]: DateSpinnerJSXProps
|
|
56
|
-
BaseElementPropsWithChildren<DateSpinnerJSXProps>;
|
|
68
|
+
[tagName]: IntrinsicElementProps<DateSpinnerJSXProps>;
|
|
57
69
|
}
|
|
58
70
|
}
|
|
59
71
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<s-divider />
|