From 41dc3ce0cefbd7b22969fdcdb0964eef4a0f42ad Mon Sep 17 00:00:00 2001 From: -l Date: Tue, 16 May 2023 14:09:10 +0200 Subject: [PATCH] docs(PaymentCard): change imports of types to /payment-card --- .../releases/eufemia/v10-info.mdx | 22 +++++++++++-------- .../extensions/payment-card/properties.mdx | 16 +++++++------- .../stories/PaymentCard.stories.tsx | 12 +++++----- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/packages/dnb-design-system-portal/src/docs/uilib/about-the-lib/releases/eufemia/v10-info.mdx b/packages/dnb-design-system-portal/src/docs/uilib/about-the-lib/releases/eufemia/v10-info.mdx index 8e1f045a668..1c77cb360a8 100644 --- a/packages/dnb-design-system-portal/src/docs/uilib/about-the-lib/releases/eufemia/v10-info.mdx +++ b/packages/dnb-design-system-portal/src/docs/uilib/about-the-lib/releases/eufemia/v10-info.mdx @@ -403,14 +403,18 @@ Changed `img_class` prop to be `imgClass`. ### [PaymentCard](/uilib/extensions/payment-card/) 1. `Type`'s `DNB` value/option `Metalic` was removed. -2. `Type`'s `Saga` value/option `VisaPlatinum` was removed. -3. `Type`'s `PB` value/option `Platinum` was removed. -4. `Type`'s `Mastercard` value/option `DefaultWhite` was removed. -5. `Type`'s `Mastercard` value/option `Metalic` was removed. -6. `Type`'s `Mastercard` value/option `BlackMetalic` was removed. -7. `Type`'s `Visa` value/option `Metalic` was removed. -8. `CardDesign`'s value/option `white` was removed. If used as a default design, consider replacing it with `defaultDesign`. -9. `CardDesign`'s value/option `silver` was removed. -10. `ProductType`'s value/option `BankAxept` was removed. +1. `Type`'s `Saga` value/option `VisaPlatinum` was removed. +1. `Type`'s `PB` value/option `Platinum` was removed. +1. `Type`'s `Mastercard` value/option `DefaultWhite` was removed. +1. `Type`'s `Mastercard` value/option `Metalic` was removed. +1. `Type`'s `Mastercard` value/option `BlackMetalic` was removed. +1. `Type`'s `Visa` value/option `Metalic` was removed. +1. `CardDesign`'s value/option `white` was removed. If used as a default design, consider replacing it with `defaultDesign`. +1. `CardDesign`'s value/option `silver` was removed. +1. `ProductType`'s value/option `BankAxept` was removed. +1. For better TypeScript support, import `CardType` from `/payment-card` instead of from `/payment-card/utils/Types`. + 1. Find `import { CardType } from '@dnb/eufemia/extensions/payment-card/utils/Types'`, and replace with `import { CardType } from '@dnb/eufemia/extensions/payment-card'` +1. For better TypeScript support, import `ProductType` from `/payment-card` instead of from `/payment-card/utils/Types`. + 1. Find `import { ProductType } from '@dnb/eufemia/extensions/payment-card/utils/Types'`, and replace with `import { ProductType } from '@dnb/eufemia/extensions/payment-card'` _April, 20. 2023_ diff --git a/packages/dnb-design-system-portal/src/docs/uilib/extensions/payment-card/properties.mdx b/packages/dnb-design-system-portal/src/docs/uilib/extensions/payment-card/properties.mdx index f3d2b3e521a..31af313be02 100644 --- a/packages/dnb-design-system-portal/src/docs/uilib/extensions/payment-card/properties.mdx +++ b/packages/dnb-design-system-portal/src/docs/uilib/extensions/payment-card/properties.mdx @@ -18,14 +18,14 @@ showTabs: true ## Card Data -| Properties | Type | Description | -| ------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `productCode` | `string` | _(required)_ product code for the given card. | -| `productName` | `string` | _(required)_ product name. Can be blank. | -| `displayName` | `string` | _(required)_ the visible product name. Can be empty. | -| `cardDesign` | `object` | _(required)_ object that describes the style properties of the card. can be imported from `@dnb/eufemia/extensions/payment-card/utils/CardDesigns` (see available designs below) or a custom one can be created. | -| `cardType` | `Union Type` | _(required)_ import CardType from `@dnb/eufemia/extensions/payment-card/utils/Types` to use. Can be CardType.Visa, CardType.Mastercard or CardType.None | -| `productType` | `Union Type` | _(required)_ import ProductType from `@dnb/eufemia/extensions/payment-card/utils/Types` to use. Can be ProductType.Saga, ProductType.Pluss, ProductType.Intro, ProductType.Business, ProductType.Bedrift, ProductType.PrivateBanking or ProductType.None | +| Properties | Type | Description | +| ------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `productCode` | `string` | _(required)_ product code for the given card. | +| `productName` | `string` | _(required)_ product name. Can be blank. | +| `displayName` | `string` | _(required)_ the visible product name. Can be empty. | +| `cardDesign` | `object` | _(required)_ object that describes the style properties of the card. `import { Designs } from '@dnb/eufemia/extensions/payment-card'` (see available designs below) or a custom one can be created. | +| `cardType` | `Union Type` | _(required)_ `import { CardType } from '@dnb/eufemia/extensions/payment-card'` to use. Can be CardType.Visa, CardType.Mastercard or CardType.None | +| `productType` | `Union Type` | _(required)_ `import { ProductType } from '@dnb/eufemia/extensions/payment-card'` to use. Can be ProductType.Saga, ProductType.Pluss, ProductType.Intro, ProductType.Business, ProductType.Bedrift, ProductType.PrivateBanking or ProductType.None | ## Card Design diff --git a/packages/dnb-eufemia/src/extensions/payment-card/stories/PaymentCard.stories.tsx b/packages/dnb-eufemia/src/extensions/payment-card/stories/PaymentCard.stories.tsx index 4ae37d2c06f..7d0163d468b 100644 --- a/packages/dnb-eufemia/src/extensions/payment-card/stories/PaymentCard.stories.tsx +++ b/packages/dnb-eufemia/src/extensions/payment-card/stories/PaymentCard.stories.tsx @@ -11,12 +11,14 @@ import { H3 } from '../../..' import '../style' import '../style/themes/ui' -import PaymentCard, { getCardData } from '../../../extensions/payment-card' +import PaymentCard, { + getCardData, + Designs, + CardType, + ProductType, + BankAxeptType, +} from '../../../extensions/payment-card' import cardData from '../utils/cardProducts' -import { Designs } from '../PaymentCard' -import { CardType } from '../PaymentCard' -import { ProductType } from '../PaymentCard' -import { BankAxeptType } from '../PaymentCard' export default { title: 'Eufemia/Extensions/PaymentCard',