diff --git a/packages/form-system/stories/17-Validation-Examples.stories.mdx b/packages/form-system/stories/17-Validation-Examples.stories.mdx index 14babb3a3..cd13a519c 100644 --- a/packages/form-system/stories/17-Validation-Examples.stories.mdx +++ b/packages/form-system/stories/17-Validation-Examples.stories.mdx @@ -35,9 +35,11 @@ For an input that may mean that it is not an empty string, while for a checkbox group it means at least one checkbox needs to be checked. - {html` + {() => { + loadDefaultFeedbackMessages(); + return html` - `} + `}} ```html @@ -242,7 +244,7 @@ const tomorrow = new Date(year, month, day + 1); ## Validation Types When defining your own component you can decide to allow for multiple types of validation. -By default only `error` is used however there are certainly use cases where warning or success messages make sense. +By default only `error` is used, however there are certainly use cases where warning or success messages make sense. {() => { @@ -258,29 +260,24 @@ By default only `error` is used however there are certainly use cases where warn } return html` `; }} @@ -315,29 +313,24 @@ try { ```html ``` @@ -421,9 +415,11 @@ class MyValidator extends Validator { > ``` -## Override default messages +## Default messages -Oftern +To get default validation messages you need to import and call the `loadDefaultFeedbackMessages` function once in your application. + +Sometimes the default messages don't make sense for your input field. In that case you want to override it by adding a `getMessage` function to your validator. {html` @@ -469,6 +465,8 @@ Oftern ## Override fieldName +In the scenario that the default messages are correct, but you only want to change the `fieldName`, this can both be done for a single specific validator or for all at once. + {html` diff --git a/packages/localize/stories/50-system-overview.stories.mdx b/packages/localize/stories/50-system-overview.stories.mdx index e863e245f..c5773ce51 100644 --- a/packages/localize/stories/50-system-overview.stories.mdx +++ b/packages/localize/stories/50-system-overview.stories.mdx @@ -277,7 +277,7 @@ If you want to optimize the page rendering and you can inline some of your local ```js // my-inlined-data.js -import { localize } from 'lion-localize/localize.js'; +import { localize } from '@lion/localize'; localize.addData('en-GB', 'my-namespace', { /* data */ }); diff --git a/packages/overlays/stories/20-index.stories.mdx b/packages/overlays/stories/20-index.stories.mdx index 9af2d4850..ece81f005 100644 --- a/packages/overlays/stories/20-index.stories.mdx +++ b/packages/overlays/stories/20-index.stories.mdx @@ -21,7 +21,7 @@ On top of this, the system was built having accessibility in mind. For a detailed rationale, please consult [Rationale](?path=/docs/overlay-rationale--page). - + {html` @@ -312,7 +312,7 @@ Below is another demo where you can toggle between configurations using buttons. ```js -import { withModalDialogConfig, withBottomSheetConfig, withDropdownConfig } from 'lion/overlays'; +import { withModalDialogConfig, withBottomSheetConfig, withDropdownConfig } from '@lion/overlays'; ``` ```html