@amboss/design-system 3.39.0 → 3.39.1

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"FormErrorMessages",{enumerable:!0,get:function(){return FormErrorMessages}});const _react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_default")._(require("react")),_Stack=require("../../Stack/Stack"),_Icon=require("../../Icon/Icon"),_Box=require("../../Box/Box"),_Inline=require("../../Inline/Inline"),_Text=require("../../Typography/Text/Text");function FormErrorMessages({messages=[],"data-e2e-test-id":dataE2eTestId}){return _react.default.createElement(_Box.Box,{space:"zero",tSpace:"xxs",role:"alert","aria-atomic":"true"},_react.default.createElement(_Stack.Stack,{"data-e2e-test-id":dataE2eTestId,"data-ds-id":"FormErrorMessages",space:"xxs"},messages.map(message=>_react.default.createElement(_Inline.Inline,{key:message,noWrap:!0},_react.default.createElement(_Box.Box,{space:"zero",tSpace:"xxxs"},_react.default.createElement(_Icon.Icon,{size:"s",color:"error",name:"alert-triangle"})),_react.default.createElement(_Text.Text,{size:"s",color:"error"},message)))))}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"FormErrorMessages",{enumerable:!0,get:function(){return FormErrorMessages}});const _react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_default")._(require("react")),_Stack=require("../../Stack/Stack"),_Icon=require("../../Icon/Icon"),_Box=require("../../Box/Box"),_Inline=require("../../Inline/Inline"),_Text=require("../../Typography/Text/Text"),_useIntl=require("../../../shared/intl/useIntl");function FormErrorMessages({messages=[],"data-e2e-test-id":dataE2eTestId}){let{formatMessage}=(0,_useIntl.useIntl)();return _react.default.createElement(_Box.Box,{space:"zero",tSpace:"xxs",role:"alert","aria-atomic":"true"},_react.default.createElement(_Stack.Stack,{"data-e2e-test-id":dataE2eTestId,"data-ds-id":"FormErrorMessages",space:"xxs"},messages.map(message=>_react.default.createElement(_Inline.Inline,{key:message,noWrap:!0},_react.default.createElement(_Box.Box,{space:"zero",tSpace:"xxxs"},_react.default.createElement(_Icon.Icon,{size:"s",color:"error",name:"alert-triangle","aria-label":formatMessage("FormField.ErrorIcon.AriaLabel")})),_react.default.createElement(_Text.Text,{size:"s",color:"error"},message)))))}
@@ -0,0 +1,3 @@
1
+ {
2
+ "FormField.ErrorIcon.AriaLabel": "Fehler"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "FormField.ErrorIcon.AriaLabel": "Error"
3
+ }
@@ -0,0 +1,8 @@
1
+ import en from "./translations/en.json";
2
+ type Messages = typeof en;
3
+ type MessageId = keyof Messages;
4
+ export type IntlShape = {
5
+ formatMessage(id: MessageId): string;
6
+ };
7
+ export declare function useIntl(): IntlShape;
8
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"useIntl",{enumerable:!0,get:function(){return useIntl}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=require("react"),_useWindow=require("../useWindow"),_dejson=/*#__PURE__*/_interop_require_default._(require("./translations/de.json")),_enjson=/*#__PURE__*/_interop_require_default._(require("./translations/en.json"));function useIntl(){let window=(0,_useWindow.useWindow)(),translations="de"===window?.__AMBOSS_CONFIG__?.URL_LOCALE_PREFIX?_dejson.default:_enjson.default;return(0,_react.useMemo)(()=>({formatMessage:id=>translations[id]}),[translations])}
@@ -1 +1 @@
1
- import React from"react";import{Stack}from"../../Stack/Stack";import{Icon}from"../../Icon/Icon";import{Box}from"../../Box/Box";import{Inline}from"../../Inline/Inline";import{Text}from"../../Typography/Text/Text";export function FormErrorMessages({messages=[],"data-e2e-test-id":dataE2eTestId}){return React.createElement(Box,{space:"zero",tSpace:"xxs",role:"alert","aria-atomic":"true"},React.createElement(Stack,{"data-e2e-test-id":dataE2eTestId,"data-ds-id":"FormErrorMessages",space:"xxs"},messages.map(message=>React.createElement(Inline,{key:message,noWrap:!0},React.createElement(Box,{space:"zero",tSpace:"xxxs"},React.createElement(Icon,{size:"s",color:"error",name:"alert-triangle"})),React.createElement(Text,{size:"s",color:"error"},message)))))}
1
+ import React from"react";import{Stack}from"../../Stack/Stack";import{Icon}from"../../Icon/Icon";import{Box}from"../../Box/Box";import{Inline}from"../../Inline/Inline";import{Text}from"../../Typography/Text/Text";import{useIntl}from"../../../shared/intl/useIntl";export function FormErrorMessages({messages=[],"data-e2e-test-id":dataE2eTestId}){let{formatMessage}=useIntl();return React.createElement(Box,{space:"zero",tSpace:"xxs",role:"alert","aria-atomic":"true"},React.createElement(Stack,{"data-e2e-test-id":dataE2eTestId,"data-ds-id":"FormErrorMessages",space:"xxs"},messages.map(message=>React.createElement(Inline,{key:message,noWrap:!0},React.createElement(Box,{space:"zero",tSpace:"xxxs"},React.createElement(Icon,{size:"s",color:"error",name:"alert-triangle","aria-label":formatMessage("FormField.ErrorIcon.AriaLabel")})),React.createElement(Text,{size:"s",color:"error"},message)))))}
@@ -0,0 +1,3 @@
1
+ {
2
+ "FormField.ErrorIcon.AriaLabel": "Fehler"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "FormField.ErrorIcon.AriaLabel": "Error"
3
+ }
@@ -0,0 +1,8 @@
1
+ import en from "./translations/en.json";
2
+ type Messages = typeof en;
3
+ type MessageId = keyof Messages;
4
+ export type IntlShape = {
5
+ formatMessage(id: MessageId): string;
6
+ };
7
+ export declare function useIntl(): IntlShape;
8
+ export {};
@@ -0,0 +1 @@
1
+ import{useMemo}from"react";import{useWindow}from"../useWindow";import de from"./translations/de.json";import en from"./translations/en.json";export function useIntl(){let window=useWindow(),translations="de"===window?.__AMBOSS_CONFIG__?.URL_LOCALE_PREFIX?de:en;return useMemo(()=>({formatMessage:id=>translations[id]}),[translations])}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amboss/design-system",
3
- "version": "3.39.0",
3
+ "version": "3.39.1",
4
4
  "description": "the design system for AMBOSS products",
5
5
  "author": "AMBOSS",
6
6
  "license": "ISC",