@trilogy-ds/react 0.0.1-beta-71 → 0.0.1-beta-74
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/lib/components/accordion/body/AccordionBody.d.ts +0 -1
- package/lib/components/accordion/body/AccordionBody.js +0 -1
- package/lib/components/accordion/body/AccordionBody.js.map +1 -1
- package/lib/components/accordion/body/AccordionBodyProps.d.ts +0 -1
- package/lib/components/accordion/body/AccordionBodyPropsDefaults.js +0 -7
- package/lib/components/alert/Alert.d.ts +4 -5
- package/lib/components/alert/Alert.js +10 -11
- package/lib/components/alert/Alert.js.map +1 -1
- package/lib/components/alert/Alert.native.d.ts +6 -6
- package/lib/components/alert/Alert.native.js +13 -13
- package/lib/components/alert/Alert.native.js.map +1 -1
- package/lib/components/alert/AlertProps.d.ts +3 -4
- package/lib/components/alert/AlertPropsDefaults.js +1 -8
- package/lib/components/alert/{ToasterAlertPropsDefaults.js → ToasterStatusPropsDefaults.js} +1 -16
- package/lib/components/alert/context/ToastPropsDefaults.js +1 -1
- package/lib/components/alert/context/ToasterContextProps.d.ts +3 -3
- package/lib/components/badge/Badge.d.ts +1 -2
- package/lib/components/badge/Badge.js +3 -8
- package/lib/components/badge/Badge.js.map +1 -1
- package/lib/components/badge/Badge.native.d.ts +1 -2
- package/lib/components/badge/Badge.native.js +2 -5
- package/lib/components/badge/Badge.native.js.map +1 -1
- package/lib/components/badge/BadgeProps.d.ts +1 -2
- package/lib/components/badge/BadgePropsDefaults.js +0 -8
- package/lib/components/box/Box.d.ts +2 -2
- package/lib/components/box/Box.js +3 -3
- package/lib/components/box/Box.js.map +1 -1
- package/lib/components/box/Box.native.d.ts +2 -2
- package/lib/components/box/Box.native.js +8 -8
- package/lib/components/box/Box.native.js.map +1 -1
- package/lib/components/box/BoxProps.d.ts +1 -1
- package/lib/components/box/BoxPropsDefaults.js +3 -3
- package/lib/components/box/content/BoxContentPropsDefaults.js +1 -1
- package/lib/components/box/footer/BoxFooterPropsDefaults.js +1 -1
- package/lib/components/box/header/BoxHeaderPropsDefaults.js +1 -1
- package/lib/components/card/Card.d.ts +3 -0
- package/lib/components/card/Card.js +3 -2
- package/lib/components/card/Card.js.map +1 -1
- package/lib/components/card/CardPropsDefaults.js +1 -1
- package/lib/components/card/content/CardContent.native.d.ts +0 -1
- package/lib/components/card/content/CardContent.native.js +0 -1
- package/lib/components/card/content/CardContent.native.js.map +1 -1
- package/lib/components/card/content/CardContentProps.d.ts +0 -1
- package/lib/components/card/content/CardContentPropsDefaults.js +0 -8
- package/lib/components/card/image/CardImage.d.ts +0 -1
- package/lib/components/card/image/CardImage.js +0 -1
- package/lib/components/card/image/CardImage.js.map +1 -1
- package/lib/components/card/image/CardImage.native.d.ts +1 -1
- package/lib/components/card/image/CardImage.native.js +2 -1
- package/lib/components/card/image/CardImage.native.js.map +1 -1
- package/lib/components/card/image/CardImageProps.d.ts +0 -2
- package/lib/components/card/image/CardImagePropsDefaults.js +0 -8
- package/lib/components/chips/Chips.d.ts +1 -2
- package/lib/components/chips/Chips.js +4 -6
- package/lib/components/chips/Chips.js.map +1 -1
- package/lib/components/chips/Chips.native.d.ts +1 -2
- package/lib/components/chips/Chips.native.js +1 -3
- package/lib/components/chips/Chips.native.js.map +1 -1
- package/lib/components/chips/ChipsProps.d.ts +0 -1
- package/lib/components/chips/ChipsPropsDefaults.js +0 -8
- package/lib/components/chips/list/ChipsList.js +1 -1
- package/lib/components/chips/list/ChipsList.js.map +1 -1
- package/lib/components/columns/Columns.d.ts +0 -1
- package/lib/components/columns/Columns.js +2 -3
- package/lib/components/columns/Columns.js.map +1 -1
- package/lib/components/columns/ColumnsProps.d.ts +1 -3
- package/lib/components/columns/ColumnsPropsDefaults.js +0 -17
- package/lib/components/columns/item/ColumnsItem.native.js +3 -0
- package/lib/components/columns/item/ColumnsItem.native.js.map +1 -1
- package/lib/components/container/ContainerPropsDefaults.js +1 -1
- package/lib/components/countdown/Countdown.d.ts +2 -1
- package/lib/components/countdown/Countdown.js +3 -2
- package/lib/components/countdown/Countdown.js.map +1 -1
- package/lib/components/countdown/Countdown.native.d.ts +2 -1
- package/lib/components/countdown/Countdown.native.js +3 -2
- package/lib/components/countdown/Countdown.native.js.map +1 -1
- package/lib/components/countdown/CountdownProps.d.ts +1 -0
- package/lib/components/countdown/CountdownPropsDefaults.js +8 -0
- package/lib/components/divider/DividerPropsDefaults.js +3 -3
- package/lib/components/enumsComponentsName.d.ts +1 -1
- package/lib/components/enumsComponentsName.js +1 -1
- package/lib/components/enumsComponentsName.js.map +1 -1
- package/lib/components/fab/FabProps.d.ts +2 -2
- package/lib/components/fab/FabPropsDefaults.js +0 -16
- package/lib/components/hero/HeroPropsDefaults.js +1 -1
- package/lib/components/icon/IconPropsDefaults.js +1 -1
- package/lib/components/icon/circle/CircleIconPropsDefaults.js +1 -1
- package/lib/components/input/Input.d.ts +3 -2
- package/lib/components/input/Input.js +10 -3
- package/lib/components/input/Input.js.map +1 -1
- package/lib/components/input/Input.native.d.ts +3 -1
- package/lib/components/input/Input.native.js +33 -22
- package/lib/components/input/Input.native.js.map +1 -1
- package/lib/components/input/InputProps.d.ts +2 -3
- package/lib/components/input/InputPropsDefaults.js +8 -17
- package/lib/components/input/autocomplete/AutoCompletePropsDefaults.js +8 -17
- package/lib/components/link/Link.js +2 -2
- package/lib/components/link/Link.js.map +1 -1
- package/lib/components/link/Link.native.d.ts +0 -1
- package/lib/components/link/Link.native.js +0 -1
- package/lib/components/link/Link.native.js.map +1 -1
- package/lib/components/link/LinkProps.d.ts +0 -1
- package/lib/components/link/LinkPropsDefaults.js +0 -8
- package/lib/components/modal/ModalPropsDefaults.js +1 -1
- package/lib/components/modal/title/ModalTitlePropsDefaults.js +1 -1
- package/lib/components/otp/Otp.d.ts +0 -12
- package/lib/components/otp/Otp.js +77 -98
- package/lib/components/otp/Otp.js.map +1 -1
- package/lib/components/price/Price.d.ts +1 -1
- package/lib/components/price/Price.js +2 -2
- package/lib/components/price/Price.js.map +1 -1
- package/lib/components/price/Price.native.d.ts +1 -2
- package/lib/components/price/Price.native.js +3 -5
- package/lib/components/price/Price.native.js.map +1 -1
- package/lib/components/price/PriceProps.d.ts +5 -5
- package/lib/components/price/PricePropsDefaults.js +0 -21
- package/lib/components/progress/Progress.d.ts +1 -1
- package/lib/components/progress/Progress.js +4 -4
- package/lib/components/progress/Progress.js.map +1 -1
- package/lib/components/progress/Progress.native.d.ts +2 -2
- package/lib/components/progress/Progress.native.js +5 -5
- package/lib/components/progress/Progress.native.js.map +1 -1
- package/lib/components/progress/ProgressProps.d.ts +2 -2
- package/lib/components/progress/ProgressPropsDefaults.js +1 -1
- package/lib/components/progress/item/ProgressItem.d.ts +1 -1
- package/lib/components/progress/item/ProgressItem.js +4 -4
- package/lib/components/progress/item/ProgressItem.js.map +1 -1
- package/lib/components/progress/item/ProgressItem.native.d.ts +2 -2
- package/lib/components/progress/item/ProgressItem.native.js +2 -2
- package/lib/components/progress/item/ProgressItem.native.js.map +1 -1
- package/lib/components/progress/item/ProgressItemProps.d.ts +2 -2
- package/lib/components/progress/item/ProgressItemPropsDefaults.js +1 -1
- package/lib/components/progress/radial/ProgressRadial.native.d.ts +3 -3
- package/lib/components/progress/radial/ProgressRadial.native.js +7 -7
- package/lib/components/progress/radial/ProgressRadial.native.js.map +1 -1
- package/lib/components/progress/radial/ProgressRadialProps.d.ts +3 -3
- package/lib/components/progress/radial/ProgressRadialPropsDefaults.js +2 -2
- package/lib/components/rows/Rows.d.ts +1 -0
- package/lib/components/rows/Rows.js +4 -2
- package/lib/components/rows/Rows.js.map +1 -1
- package/lib/components/rows/Rows.native.d.ts +5 -2
- package/lib/components/rows/Rows.native.js +4 -2
- package/lib/components/rows/Rows.native.js.map +1 -1
- package/lib/components/rows/RowsProps.d.ts +1 -0
- package/lib/components/rows/RowsPropsDefaults.js +8 -0
- package/lib/components/rows/item/RowItem.native.js +3 -1
- package/lib/components/rows/item/RowItem.native.js.map +1 -1
- package/lib/components/scroll-view/ScrollViewPropsDefaults.js +1 -1
- package/lib/components/section/Section.js +1 -1
- package/lib/components/section/Section.js.map +1 -1
- package/lib/components/section/SectionProps.d.ts +2 -2
- package/lib/components/section/SectionPropsDefaults.js +1 -17
- package/lib/components/segment-control/SegmentControlProps.d.ts +1 -4
- package/lib/components/segment-control/SegmentControlPropsDefaults.js +0 -46
- package/lib/components/sticker/Sticker.d.ts +2 -2
- package/lib/components/sticker/Sticker.js +3 -3
- package/lib/components/sticker/Sticker.js.map +1 -1
- package/lib/components/switch/Switch.d.ts +2 -2
- package/lib/components/switch/Switch.js +4 -4
- package/lib/components/switch/Switch.js.map +1 -1
- package/lib/components/switch/Switch.native.d.ts +2 -2
- package/lib/components/switch/Switch.native.js +4 -4
- package/lib/components/switch/Switch.native.js.map +1 -1
- package/lib/components/switch/SwitchProps.d.ts +2 -2
- package/lib/components/switch/SwitchPropsDefaults.js +1 -1
- package/lib/components/table/body/TableBodyPropsDefaults.js +2 -2
- package/lib/components/table/head/TableHeadPropsDefaults.js +2 -2
- package/lib/components/table/tr/TableTrPropsWebDefaults.js +1 -1
- package/lib/components/textarea/Textarea.d.ts +3 -3
- package/lib/components/textarea/Textarea.js +11 -6
- package/lib/components/textarea/Textarea.js.map +1 -1
- package/lib/components/textarea/Textarea.native.js +25 -11
- package/lib/components/textarea/Textarea.native.js.map +1 -1
- package/lib/components/textarea/TextareaProps.d.ts +2 -0
- package/lib/components/timeline/marker/TimelineMarkerPropsDefaults.js +1 -1
- package/lib/components/timeline/marker/TimelineMarkerWebPropsDefaults.js +1 -1
- package/lib/components/title/Title.js +2 -2
- package/lib/components/title/Title.js.map +1 -1
- package/lib/components/toaster/Toaster.js +4 -4
- package/lib/components/toaster/Toaster.js.map +1 -1
- package/lib/components/toaster/Toaster.native.js +7 -7
- package/lib/components/toaster/Toaster.native.js.map +1 -1
- package/lib/components/toaster/ToasterProps.d.ts +2 -2
- package/lib/components/toaster/ToasterPropsDefaults.js +1 -1
- package/lib/components/toaster/context/ToastPropsDefaults.js +1 -1
- package/lib/components/toaster/context/ToasterContextProps.d.ts +3 -3
- package/lib/components/view/ViewPropsDefaults.js +1 -1
- package/lib/objects/facets/Status.d.ts +36 -0
- package/lib/objects/facets/{Alert.js → Status.js} +19 -19
- package/lib/objects/facets/Status.js.map +1 -0
- package/lib/objects/facets/index.d.ts +1 -1
- package/lib/objects/facets/index.js +1 -1
- package/lib/objects/facets/index.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/lib/objects/facets/Alert.d.ts +0 -36
- package/lib/objects/facets/Alert.js.map +0 -1
|
@@ -5,7 +5,6 @@ import { AccordionBodyProps } from "./AccordionBodyProps";
|
|
|
5
5
|
* @param children {React.ReactNode} Children for Accordion body
|
|
6
6
|
* - ------------------ WEB PROPERTIES -----------------------
|
|
7
7
|
* @param className {string} Additionnal CSS Classes
|
|
8
|
-
* @param contentClassName {string} Additionnal CSS Classes for accordion-content
|
|
9
8
|
*/
|
|
10
9
|
declare const AccordionBody: ({ children, className, dataId, testId, ...others }: AccordionBodyProps) => React.JSX.Element;
|
|
11
10
|
export default AccordionBody;
|
|
@@ -7,7 +7,6 @@ import { useTrilogyContext } from "../../../context";
|
|
|
7
7
|
* @param children {React.ReactNode} Children for Accordion body
|
|
8
8
|
* - ------------------ WEB PROPERTIES -----------------------
|
|
9
9
|
* @param className {string} Additionnal CSS Classes
|
|
10
|
-
* @param contentClassName {string} Additionnal CSS Classes for accordion-content
|
|
11
10
|
*/
|
|
12
11
|
const AccordionBody = ({ children, className, dataId, testId, ...others }) => {
|
|
13
12
|
const { styled } = useTrilogyContext();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionBody.js","sourceRoot":"","sources":["../../../../components/accordion/body/AccordionBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAE7C
|
|
1
|
+
{"version":3,"file":"AccordionBody.js","sourceRoot":"","sources":["../../../../components/accordion/body/AccordionBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAE7C;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,EACrB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,MAAM,EACN,GAAG,MAAM,EACU,EAAqB,EAAE;IAC1C,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAEtC,OAAO,CACL,oDACuB,IAAI,aAChB,MAAM,iBACF,MAAM,EACnB,SAAS,EAAE,SAAS,CAClB,MAAM,EACN,IAAI,CAAC,2BAA2B,EAAE,SAAS,CAAC,CAC7C,KACG,MAAM,EACV,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,eAAe,EAAE,CAAA;QACrB,CAAC;QAED,6BAAK,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC,IACzD,QAAQ,CACL,CACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AlertProps,
|
|
2
|
+
import { AlertProps, ToasterStatusProps } from "./AlertProps";
|
|
3
3
|
/**
|
|
4
4
|
* Alert Component
|
|
5
5
|
* @param iconName {IconName} Custom icon
|
|
6
6
|
* @param title {string} Alert title content
|
|
7
7
|
* @param description {string|ReactNode} Alertt description content
|
|
8
|
-
* @param alert {
|
|
8
|
+
* @param alert {StatusState} Alert Variant (INFO|SUCCESS|WARNING|ERROR)
|
|
9
9
|
* @param onClick {Function} onClick Event for all alert
|
|
10
10
|
* @param className {string} Additionnal CSS Classes
|
|
11
|
-
* @param iconClassname {string} Additionnal Icon CSS
|
|
12
11
|
* @param display
|
|
13
12
|
* @param others
|
|
14
13
|
*/
|
|
15
|
-
declare const Alert: ({
|
|
14
|
+
declare const Alert: ({ status, className, iconName, title, description, onClick, display, testId, ...others }: AlertProps) => JSX.Element;
|
|
16
15
|
/**
|
|
17
16
|
* Toaster Alert Provider
|
|
18
17
|
* @param children {React.ReactNode} Custom Toast Content
|
|
@@ -20,5 +19,5 @@ declare const Alert: ({ alert, className, iconClassname, iconName, title, descri
|
|
|
20
19
|
* @param offset {number} Offset position margin (Default: 10 dp)
|
|
21
20
|
* @param others
|
|
22
21
|
*/
|
|
23
|
-
export declare const ToasterAlertProvider: ({ children }:
|
|
22
|
+
export declare const ToasterAlertProvider: ({ children }: ToasterStatusProps) => JSX.Element;
|
|
24
23
|
export default Alert;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { getStatusClassName, getStatusIconName } from "../../objects";
|
|
4
4
|
import { has, is } from "../../services/classify";
|
|
5
5
|
import { Icon, IconName, IconSize } from "../../components/icon";
|
|
6
6
|
import { Text } from "../../components/text";
|
|
@@ -16,7 +16,7 @@ import { useEffect, useRef, useState } from "react";
|
|
|
16
16
|
*/
|
|
17
17
|
const ToasterAlert = ({ props, ...others }) => {
|
|
18
18
|
const { styled } = useTrilogyContext();
|
|
19
|
-
const { title, position, description, iconName,
|
|
19
|
+
const { title, position, description, iconName, status, closable, onClick, className, offset, children } = props;
|
|
20
20
|
const displayed = Boolean(title);
|
|
21
21
|
const positionTop = {
|
|
22
22
|
top: offset || 0,
|
|
@@ -26,7 +26,7 @@ const ToasterAlert = ({ props, ...others }) => {
|
|
|
26
26
|
bottom: offset || 0,
|
|
27
27
|
position: 'fixed',
|
|
28
28
|
};
|
|
29
|
-
const classes = hashClass(styled, clsx('toaster',
|
|
29
|
+
const classes = hashClass(styled, clsx('toaster', status && is(getStatusClassName(status)), !alert && is('info'), className));
|
|
30
30
|
if (!displayed) {
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
@@ -57,22 +57,21 @@ const ToasterAlert = ({ props, ...others }) => {
|
|
|
57
57
|
* @param iconName {IconName} Custom icon
|
|
58
58
|
* @param title {string} Alert title content
|
|
59
59
|
* @param description {string|ReactNode} Alertt description content
|
|
60
|
-
* @param alert {
|
|
60
|
+
* @param alert {StatusState} Alert Variant (INFO|SUCCESS|WARNING|ERROR)
|
|
61
61
|
* @param onClick {Function} onClick Event for all alert
|
|
62
62
|
* @param className {string} Additionnal CSS Classes
|
|
63
|
-
* @param iconClassname {string} Additionnal Icon CSS
|
|
64
63
|
* @param display
|
|
65
64
|
* @param others
|
|
66
65
|
*/
|
|
67
|
-
const Alert = ({
|
|
66
|
+
const Alert = ({ status, className, iconName, title, description, onClick, display, testId, ...others }) => {
|
|
68
67
|
const { styled } = useTrilogyContext();
|
|
69
|
-
const classes = hashClass(styled, clsx("alert", has("body"),
|
|
68
|
+
const classes = hashClass(styled, clsx("alert", has("body"), status && is(getStatusClassName(status)), className));
|
|
70
69
|
const iconAlert = React.useMemo(() => {
|
|
71
70
|
var _a;
|
|
72
71
|
if (iconName != null)
|
|
73
72
|
return iconName;
|
|
74
|
-
else if (
|
|
75
|
-
return (_a =
|
|
73
|
+
else if (status)
|
|
74
|
+
return (_a = getStatusIconName(status)) !== null && _a !== void 0 ? _a : IconName.INFOS_CIRCLE;
|
|
76
75
|
else
|
|
77
76
|
return IconName.INFOS_CIRCLE;
|
|
78
77
|
}, [iconName, alert]);
|
|
@@ -82,7 +81,7 @@ const Alert = ({ alert, className, iconClassname, iconName, title, description,
|
|
|
82
81
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
83
82
|
e.stopPropagation();
|
|
84
83
|
}, className: classes, ...others },
|
|
85
|
-
React.createElement(Icon, {
|
|
84
|
+
React.createElement(Icon, { name: iconAlert }),
|
|
86
85
|
React.createElement("div", { className: hashClass(styled, clsx("body")) },
|
|
87
86
|
title && typeof title.valueOf() === "string" ? (React.createElement(Title, { level: TitleLevels.SIX }, title)) : (title),
|
|
88
87
|
description && typeof description.valueOf() === "string" ? (React.createElement(Text, null, description)) : (description))));
|
|
@@ -117,7 +116,7 @@ export const ToasterAlertProvider = ({ children }) => {
|
|
|
117
116
|
description: toasterState === null || toasterState === void 0 ? void 0 : toasterState.description,
|
|
118
117
|
position: toasterState === null || toasterState === void 0 ? void 0 : toasterState.position,
|
|
119
118
|
iconName: toasterState === null || toasterState === void 0 ? void 0 : toasterState.iconName,
|
|
120
|
-
|
|
119
|
+
status: toasterState === null || toasterState === void 0 ? void 0 : toasterState.status,
|
|
121
120
|
onClick: toasterState === null || toasterState === void 0 ? void 0 : toasterState.onClick,
|
|
122
121
|
onHide: toasterState === null || toasterState === void 0 ? void 0 : toasterState.onHide,
|
|
123
122
|
closable: toasterState === null || toasterState === void 0 ? void 0 : toasterState.closable,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../../components/alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../../components/alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AACjE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,QAA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AAE,QAAQ,CAAC,CAAA;IACd,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK,CAAC,CAAC,CAAA;IAEvC,OAAO,CACL,oBAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE;QAClE,QAAQ;QACT,oBAAC,YAAY,IACX,KAAK,EAAE;gBACL,KAAK,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK;gBAC1B,WAAW,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW;gBACtC,QAAQ,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ;gBAChC,QAAQ,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ;gBAChC,MAAM,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM;gBAC5B,OAAO,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO;gBAC9B,MAAM,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM;gBAC5B,QAAQ,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ;gBAChC,MAAM,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM;gBAC5B,MAAM,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM;aAC7B,GACD,CACsB,CAC3B,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { AlertProps,
|
|
2
|
+
import { AlertProps, ToasterStatusProps } from "./AlertProps";
|
|
3
3
|
import { ComponentName } from "../../components/enumsComponentsName";
|
|
4
4
|
/**
|
|
5
5
|
* Alert Component
|
|
6
6
|
* @param iconName {IconName} Custom icon
|
|
7
7
|
* @param title {string} Alert title content
|
|
8
8
|
* @param description {string|ReactNode} Aleert description content
|
|
9
|
-
* @param alert {
|
|
9
|
+
* @param alert {StatusState} Alert Variant (INFO|SUCCESS|WARNING|ERROR)
|
|
10
10
|
* @param info (boolean) Small info alert use it without button and arrow
|
|
11
11
|
* @param onClick {Function} onClick Event for all alert
|
|
12
12
|
*/
|
|
13
13
|
declare const Alert: {
|
|
14
|
-
({
|
|
14
|
+
({ status, iconName, title, description, onClick, display, ...others }: AlertProps): JSX.Element;
|
|
15
15
|
displayName: ComponentName;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
@@ -19,12 +19,12 @@ declare const Alert: {
|
|
|
19
19
|
* @param title {string} Notification title content
|
|
20
20
|
* @param description {string|ReactNode} Notification description content
|
|
21
21
|
* @param iconName {IconName} Custom icon
|
|
22
|
-
* @param
|
|
22
|
+
* @param status {StatusState} Alert Variant (INFO|SUCCESS|WARNING|ERROR)
|
|
23
23
|
* @param onClick {Function} onClick Event for all notification
|
|
24
24
|
* @param closable {Function} onClick Event on cross icon
|
|
25
25
|
*/
|
|
26
26
|
export declare const ToasterAlert: React.FC<{
|
|
27
|
-
props:
|
|
27
|
+
props: ToasterStatusProps;
|
|
28
28
|
}>;
|
|
29
29
|
/**
|
|
30
30
|
* Toaster provider
|
|
@@ -33,5 +33,5 @@ export declare const ToasterAlert: React.FC<{
|
|
|
33
33
|
* @param offset {number} Offset position margin (Default: 10 dp)
|
|
34
34
|
* @param others
|
|
35
35
|
*/
|
|
36
|
-
export declare const ToasterAlertProvider: ({ children }:
|
|
36
|
+
export declare const ToasterAlertProvider: ({ children }: ToasterStatusProps) => JSX.Element;
|
|
37
37
|
export default Alert;
|
|
@@ -5,7 +5,7 @@ import { Spacer, SpacerSize } from "../../components/spacer";
|
|
|
5
5
|
import { View } from "../../components/view";
|
|
6
6
|
import { Text, TextLevels } from "../../components/text";
|
|
7
7
|
import { Title, TitleLevels } from "../../components/title";
|
|
8
|
-
import {
|
|
8
|
+
import { getStatusIconName, getStatusStyle } from "../../objects/facets/Status";
|
|
9
9
|
import { getColorStyle, TrilogyColor } from "../../objects/facets/Color";
|
|
10
10
|
import { ToasterAlertPosition } from "./AlertProps";
|
|
11
11
|
import { Icon, IconName, IconSize } from "../../components/icon";
|
|
@@ -18,7 +18,7 @@ import LibToast from "react-native-toast-message";
|
|
|
18
18
|
* @param params {ToasterShowContext}
|
|
19
19
|
*/
|
|
20
20
|
const showToast = (params) => {
|
|
21
|
-
const { position, duration, offset, title, description, onClick, closable, onHide, iconName,
|
|
21
|
+
const { position, duration, offset, title, description, onClick, closable, onHide, iconName, status, } = params;
|
|
22
22
|
LibToast.show({
|
|
23
23
|
type: "tomatoToast",
|
|
24
24
|
position: position || ToasterAlertPosition.BOTTOM,
|
|
@@ -34,19 +34,19 @@ const showToast = (params) => {
|
|
|
34
34
|
* @param iconName {IconName} Custom icon
|
|
35
35
|
* @param title {string} Alert title content
|
|
36
36
|
* @param description {string|ReactNode} Aleert description content
|
|
37
|
-
* @param alert {
|
|
37
|
+
* @param alert {StatusState} Alert Variant (INFO|SUCCESS|WARNING|ERROR)
|
|
38
38
|
* @param info (boolean) Small info alert use it without button and arrow
|
|
39
39
|
* @param onClick {Function} onClick Event for all alert
|
|
40
40
|
*/
|
|
41
|
-
const Alert = ({
|
|
42
|
-
const backgroundColor = getColorStyle(
|
|
43
|
-
const fontColor =
|
|
41
|
+
const Alert = ({ status, iconName, title, description, onClick, display, ...others }) => {
|
|
42
|
+
const backgroundColor = getColorStyle(status, 1);
|
|
43
|
+
const fontColor = getStatusStyle(status) || getColorStyle(TrilogyColor.MAIN);
|
|
44
44
|
let alertView;
|
|
45
45
|
const styles = StyleSheet.create({
|
|
46
46
|
container: {
|
|
47
47
|
width: "100%",
|
|
48
48
|
paddingTop: 10,
|
|
49
|
-
borderColor:
|
|
49
|
+
borderColor: status !== undefined ? fontColor : backgroundColor,
|
|
50
50
|
paddingBottom: 10,
|
|
51
51
|
borderWidth: 1,
|
|
52
52
|
backgroundColor: backgroundColor,
|
|
@@ -58,7 +58,7 @@ const Alert = ({ alert, iconName, title, description, onClick, display, ...other
|
|
|
58
58
|
icon: {
|
|
59
59
|
justifyContent: "center",
|
|
60
60
|
alignItems: "center",
|
|
61
|
-
color:
|
|
61
|
+
color: status !== undefined ? fontColor : getColorStyle(TrilogyColor.MAIN),
|
|
62
62
|
},
|
|
63
63
|
description: {
|
|
64
64
|
justifyContent: "center",
|
|
@@ -78,7 +78,7 @@ const Alert = ({ alert, iconName, title, description, onClick, display, ...other
|
|
|
78
78
|
React.createElement(View, { style: [styles.container, others.style] },
|
|
79
79
|
React.createElement(Columns, null,
|
|
80
80
|
React.createElement(ColumnsItem, { size: 1 },
|
|
81
|
-
React.createElement(Icon, { style: styles.icon, name: iconName ? iconName :
|
|
81
|
+
React.createElement(Icon, { style: styles.icon, name: iconName ? iconName : getStatusIconName(status) })),
|
|
82
82
|
React.createElement(ColumnsItem, { size: 11 },
|
|
83
83
|
React.createElement(Text, { style: styles.containerTitle, level: TextLevels.ONE, typo: TypographyBold.TEXT_WEIGHT_SEMIBOLD }, title),
|
|
84
84
|
React.createElement(Spacer, { size: SpacerSize.SMALLER }))),
|
|
@@ -97,14 +97,14 @@ const Alert = ({ alert, iconName, title, description, onClick, display, ...other
|
|
|
97
97
|
* @param title {string} Notification title content
|
|
98
98
|
* @param description {string|ReactNode} Notification description content
|
|
99
99
|
* @param iconName {IconName} Custom icon
|
|
100
|
-
* @param
|
|
100
|
+
* @param status {StatusState} Alert Variant (INFO|SUCCESS|WARNING|ERROR)
|
|
101
101
|
* @param onClick {Function} onClick Event for all notification
|
|
102
102
|
* @param closable {Function} onClick Event on cross icon
|
|
103
103
|
*/
|
|
104
104
|
export const ToasterAlert = ({ props }) => {
|
|
105
|
-
const { title, description, iconName,
|
|
106
|
-
const color =
|
|
107
|
-
const backgroundColor = getColorStyle(
|
|
105
|
+
const { title, description, iconName, status, closable, onClick } = props;
|
|
106
|
+
const color = getStatusStyle(status) || getColorStyle(TrilogyColor.MAIN);
|
|
107
|
+
const backgroundColor = getColorStyle(status, 1);
|
|
108
108
|
const styles = StyleSheet.create({
|
|
109
109
|
toaster: {
|
|
110
110
|
padding: 24,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.native.js","sourceRoot":"","sources":["../../../components/alert/Alert.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Alert.native.js","sourceRoot":"","sources":["../../../components/alert/Alert.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,iBA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C;wBAED,oBAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,GAAI,CACnC,CACP,CACf,CACO,CACO,CACd,CACR,CAAA;AACH,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAE,QAAQ,EAAsB,EAAe,EAAE;IACpF,MAAM,WAAW,GAAG;QAClB,WAAW,EAAE,YAAY;KAC1B,CAAA;IAED,OAAO,CACL,oBAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE;QACrE,QAAQ;QACT,oBAAC,QAAQ,IAAC,MAAM,EAAE,WAAW,GAAI,CACT,CAC3B,CAAA;AACH,CAAC,CAAA;AAED,KAAK,CAAC,WAAW,GAAG,aAAa,CAAC,KAAK,CAAA;AAEvC,eAAe,KAAK,CAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Clickable } from '../../objects/facets/Clickable';
|
|
3
|
-
import { Accessibility,
|
|
3
|
+
import { Accessibility, StatusProps } from '../../objects/facets';
|
|
4
4
|
import { IconName, IconNameValues } from '../../components/icon/IconNameEnum';
|
|
5
5
|
import { ClickEvent } from "../../events/OnClickEvent";
|
|
6
6
|
export declare enum ToasterAlertPosition {
|
|
7
7
|
TOP = "top",
|
|
8
8
|
BOTTOM = "bottom"
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface ToasterStatusProps extends StatusProps, Clickable, Accessibility {
|
|
11
11
|
children?: React.ReactNode;
|
|
12
12
|
className?: string;
|
|
13
13
|
toasterChildren?: React.ReactNode;
|
|
@@ -26,12 +26,11 @@ export interface ToasterAlertProps extends AlertProps, Clickable, Accessibility
|
|
|
26
26
|
/**
|
|
27
27
|
* Alert Interface
|
|
28
28
|
*/
|
|
29
|
-
export interface AlertProps extends
|
|
29
|
+
export interface AlertProps extends StatusProps, Clickable, Accessibility {
|
|
30
30
|
iconName?: IconName | IconNameValues;
|
|
31
31
|
title?: string | React.ReactNode;
|
|
32
32
|
description?: string | React.ReactNode;
|
|
33
33
|
className?: string;
|
|
34
|
-
iconClassname?: string;
|
|
35
34
|
display?: boolean;
|
|
36
35
|
toaster?: boolean;
|
|
37
36
|
}
|
|
@@ -86,13 +86,6 @@ export default {
|
|
|
86
86
|
"string"
|
|
87
87
|
]
|
|
88
88
|
},
|
|
89
|
-
"iconClassname": {
|
|
90
|
-
"type": "string",
|
|
91
|
-
"values": [
|
|
92
|
-
"undefined",
|
|
93
|
-
"string"
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
89
|
"display": {
|
|
97
90
|
"type": "boolean",
|
|
98
91
|
"values": [
|
|
@@ -109,7 +102,7 @@ export default {
|
|
|
109
102
|
"true"
|
|
110
103
|
]
|
|
111
104
|
},
|
|
112
|
-
"
|
|
105
|
+
"status": {
|
|
113
106
|
"type": "enum",
|
|
114
107
|
"values": [
|
|
115
108
|
"undefined",
|
|
@@ -174,22 +174,7 @@ export default {
|
|
|
174
174
|
"() => void"
|
|
175
175
|
]
|
|
176
176
|
},
|
|
177
|
-
"
|
|
178
|
-
"type": "string",
|
|
179
|
-
"values": [
|
|
180
|
-
"undefined",
|
|
181
|
-
"string"
|
|
182
|
-
]
|
|
183
|
-
},
|
|
184
|
-
"toaster": {
|
|
185
|
-
"type": "boolean",
|
|
186
|
-
"values": [
|
|
187
|
-
"undefined",
|
|
188
|
-
"false",
|
|
189
|
-
"true"
|
|
190
|
-
]
|
|
191
|
-
},
|
|
192
|
-
"alert": {
|
|
177
|
+
"status": {
|
|
193
178
|
"type": "enum",
|
|
194
179
|
"values": [
|
|
195
180
|
"undefined",
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Accessibility,
|
|
1
|
+
import { Accessibility, StatusProps } from '../../../objects';
|
|
2
2
|
import { IconName, IconNameValues } from '../../../components/icon';
|
|
3
3
|
import { ToasterAlertPosition } from '../../../components/alert/AlertProps';
|
|
4
4
|
/**
|
|
5
5
|
* @param title {string} Notification title content
|
|
6
6
|
* @param description {string|ReactNode} Notification description content
|
|
7
7
|
* @param iconName {IconName} Custom icon
|
|
8
|
-
* @param alert {
|
|
8
|
+
* @param alert {StatusState} Alert Variant (INFO|SUCCESS|WARNING|ERROR)
|
|
9
9
|
* @param onClick {Function} onClick Event for all notification
|
|
10
10
|
* @param closable {Function} onClick Event on cross icon
|
|
11
11
|
* @param onHide {Function} onClick Event on hide
|
|
12
12
|
*/
|
|
13
|
-
export interface ToastProps extends
|
|
13
|
+
export interface ToastProps extends StatusProps, Accessibility {
|
|
14
14
|
title: string;
|
|
15
15
|
description?: string;
|
|
16
16
|
iconName?: IconName | IconNameValues;
|
|
@@ -6,10 +6,9 @@ import { BadgeProps } from "./BadgeProps";
|
|
|
6
6
|
* @param textContent {string} Content text for badge with text, if textContent props, it will display badge with text
|
|
7
7
|
* @param content {string|number} Badge content text
|
|
8
8
|
* @param direction {BadgeTextDirection} Text direction for Badge (LEFT|RIGHT)
|
|
9
|
-
* @param color {BadgeColor} Change color for Badge
|
|
10
9
|
* @param onClick {Function} onClick Event for Badge
|
|
11
10
|
* - -------------------------- WEB PROPERTIES -------------------------------
|
|
12
11
|
* @param className {string} Additionnal CSS Classes (ONLY FOR WEB)
|
|
13
12
|
*/
|
|
14
|
-
declare const Badge: ({ children, className, textContent, content, direction,
|
|
13
|
+
declare const Badge: ({ children, className, textContent, content, direction, onClick, testId, ...others }: BadgeProps) => JSX.Element;
|
|
15
14
|
export default Badge;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Text, TextMarkup } from "../../components/text";
|
|
3
3
|
import { BadgeTextDirection } from "./BadgeEnum";
|
|
4
|
-
import { has } from "../../services";
|
|
5
|
-
import { getColorClassName, } from "../../objects/facets";
|
|
6
4
|
import clsx from "clsx";
|
|
7
5
|
import { hashClass } from "../../helpers";
|
|
8
6
|
import { useTrilogyContext } from "../../context";
|
|
@@ -12,12 +10,11 @@ import { useTrilogyContext } from "../../context";
|
|
|
12
10
|
* @param textContent {string} Content text for badge with text, if textContent props, it will display badge with text
|
|
13
11
|
* @param content {string|number} Badge content text
|
|
14
12
|
* @param direction {BadgeTextDirection} Text direction for Badge (LEFT|RIGHT)
|
|
15
|
-
* @param color {BadgeColor} Change color for Badge
|
|
16
13
|
* @param onClick {Function} onClick Event for Badge
|
|
17
14
|
* - -------------------------- WEB PROPERTIES -------------------------------
|
|
18
15
|
* @param className {string} Additionnal CSS Classes (ONLY FOR WEB)
|
|
19
16
|
*/
|
|
20
|
-
const Badge = ({ children, className, textContent, content, direction,
|
|
17
|
+
const Badge = ({ children, className, textContent, content, direction, onClick, testId, ...others }) => {
|
|
21
18
|
const { styled } = useTrilogyContext();
|
|
22
19
|
const classes = hashClass(styled, clsx(textContent ? "badge-and-text" : "badge", className));
|
|
23
20
|
if (textContent) {
|
|
@@ -26,16 +23,14 @@ const Badge = ({ children, className, textContent, content, direction, color, on
|
|
|
26
23
|
e.stopPropagation();
|
|
27
24
|
}, className: classes, ...others },
|
|
28
25
|
(!direction || direction === BadgeTextDirection.LEFT) && (React.createElement(Text, { markup: TextMarkup.P }, textContent)),
|
|
29
|
-
React.createElement("span", { className: hashClass(styled, clsx(
|
|
30
|
-
has(`background-${getColorClassName(color)}`), "badge is-level")) }, content || children),
|
|
26
|
+
React.createElement("span", { className: hashClass(styled, clsx("badge is-level")) }, content || children),
|
|
31
27
|
direction === BadgeTextDirection.RIGHT && (React.createElement(Text, { markup: TextMarkup.P }, textContent))));
|
|
32
28
|
}
|
|
33
29
|
return (React.createElement("div", { "data-testid": testId, onClick: (e) => {
|
|
34
30
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
35
31
|
e.stopPropagation();
|
|
36
32
|
} },
|
|
37
|
-
React.createElement(Text, { className: clsx(
|
|
38
|
-
has(`background-${getColorClassName(color)}`), textContent ? "badge-and-text" : "badge", className), markup: TextMarkup.SPAN, ...others }, content || children)));
|
|
33
|
+
React.createElement(Text, { className: clsx(textContent ? "badge-and-text" : "badge", className), markup: TextMarkup.SPAN, ...others }, content || children)));
|
|
39
34
|
};
|
|
40
35
|
export default Badge;
|
|
41
36
|
//# sourceMappingURL=Badge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../components/badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../components/badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAE7C;;;;;;;;;GASG;AACH,MAAM,KAAK,GAAG,CAAC,EACb,QAAQ,EACR,SAAS,EACT,WAAW,EACX,OAAO,EACP,SAAS,EACT,OAAO,EACP,MAAM,EACN,GAAG,MAAM,EACE,EAAe,EAAE;IAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAEtC,MAAM,OAAO,GAAG,SAAS,CACvB,MAAM,EACN,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAC1D,CAAA;IAED,IAAI,WAAW,EAAE;QACf,OAAO,CACL,4CACe,MAAM,EACnB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBACb,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,CAAC,CAAC,CAAA;gBACZ,CAAC,CAAC,eAAe,EAAE,CAAA;YACrB,CAAC,EACD,SAAS,EAAE,OAAO,KACd,MAAM;YAET,CAAC,CAAC,SAAS,IAAI,SAAS,KAAK,kBAAkB,CAAC,IAAI,CAAC,IAAI,CACxD,oBAAC,IAAI,IAAC,MAAM,EAAE,UAAU,CAAC,CAAC,IAAG,WAAW,CAAQ,CACjD;YACD,8BACE,SAAS,EAAE,SAAS,CAClB,MAAM,EACN,IAAI,CAAC,gBAAgB,CAAC,CACvB,IAEA,OAAO,IAAI,QAAQ,CACf;YACN,SAAS,KAAK,kBAAkB,CAAC,KAAK,IAAI,CACzC,oBAAC,IAAI,IAAC,MAAM,EAAE,UAAU,CAAC,CAAC,IAAG,WAAW,CAAQ,CACjD,CACG,CACP,CAAA;KACF;IAED,OAAO,CACL,4CACe,MAAM,EACnB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,CAAC,CAAC,CAAA;YACZ,CAAC,CAAC,eAAe,EAAE,CAAA;QACrB,CAAC;QAED,oBAAC,IAAI,IACH,SAAS,EAAE,IAAI,CACb,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,EACxC,SAAS,CACV,EACD,MAAM,EAAE,UAAU,CAAC,IAAI,KACnB,MAAM,IAET,OAAO,IAAI,QAAQ,CACf,CACH,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -8,10 +8,9 @@ import { ComponentName } from "../../components/enumsComponentsName";
|
|
|
8
8
|
* @param content content {string|number} Badge content text
|
|
9
9
|
* @param direction {BadgeTextDirection} Text direction for Badge (LEFT|RIGHT)
|
|
10
10
|
* @param onClick {Function} onClick Event for Badge
|
|
11
|
-
* @param color {BadgeColor} Change color for Badge
|
|
12
11
|
*/
|
|
13
12
|
declare const Badge: {
|
|
14
|
-
({ children, textContent, content, direction,
|
|
13
|
+
({ children, textContent, content, direction, onClick, testId, ...others }: BadgeProps): JSX.Element;
|
|
15
14
|
displayName: ComponentName;
|
|
16
15
|
};
|
|
17
16
|
export default Badge;
|
|
@@ -10,12 +10,9 @@ import { ComponentName } from "../../components/enumsComponentsName";
|
|
|
10
10
|
* @param content content {string|number} Badge content text
|
|
11
11
|
* @param direction {BadgeTextDirection} Text direction for Badge (LEFT|RIGHT)
|
|
12
12
|
* @param onClick {Function} onClick Event for Badge
|
|
13
|
-
* @param color {BadgeColor} Change color for Badge
|
|
14
13
|
*/
|
|
15
|
-
const Badge = ({ children, textContent, content, direction,
|
|
16
|
-
const badgeColor =
|
|
17
|
-
? getColorStyle(color)
|
|
18
|
-
: getColorStyle(BadgeColor.MAIN);
|
|
14
|
+
const Badge = ({ children, textContent, content, direction, onClick, testId, ...others }) => {
|
|
15
|
+
const badgeColor = getColorStyle(BadgeColor.MAIN);
|
|
19
16
|
const textColor = getColorStyle(TrilogyColor.BACKGROUND);
|
|
20
17
|
const styles = StyleSheet.create({
|
|
21
18
|
container: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.native.js","sourceRoot":"","sources":["../../../components/badge/Badge.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEvE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,YAAY,GAAuB,MAAM,wBAAwB,CAAA;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAEhE
|
|
1
|
+
{"version":3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vC,eAAe,KAAK,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Clickable } from '../../objects/facets/Clickable';
|
|
3
|
-
import {
|
|
3
|
+
import { BadgeTextDirection, BadgeTextDirectionValues } from './BadgeEnum';
|
|
4
4
|
import { Accessibility } from '../../objects';
|
|
5
5
|
/**
|
|
6
6
|
* Badge Interface
|
|
@@ -11,5 +11,4 @@ export interface BadgeProps extends Clickable, Accessibility {
|
|
|
11
11
|
textContent?: string;
|
|
12
12
|
direction?: BadgeTextDirection | BadgeTextDirectionValues;
|
|
13
13
|
className?: string;
|
|
14
|
-
color?: BadgeColor | BadgeColorValues;
|
|
15
14
|
}
|
|
@@ -7,7 +7,7 @@ import { BoxProps } from "./BoxProps";
|
|
|
7
7
|
* @param skeleton {boolean} Box skeleton
|
|
8
8
|
* @param background {TrilogyColor} Box Content Background Color
|
|
9
9
|
* @param inverted {boolean} Inverted Box Color
|
|
10
|
-
* @param
|
|
10
|
+
* @param highlighted {TrilogyColor} Add Left Highlight Border With Semantic Color
|
|
11
11
|
* @param shadowless {boolean} Remove box shadow
|
|
12
12
|
* @param flat {boolean} Flat box remove shadow and add plain border
|
|
13
13
|
* @param backgroundSrc {string} Source of background Image
|
|
@@ -21,5 +21,5 @@ import { BoxProps } from "./BoxProps";
|
|
|
21
21
|
* @param fullheight
|
|
22
22
|
* @param others
|
|
23
23
|
*/
|
|
24
|
-
declare const Box: ({ inverted, children, className, onClick, markup, skeleton, to, background,
|
|
24
|
+
declare const Box: ({ inverted, children, className, onClick, markup, skeleton, to, background, highlighted, shadowless, backgroundSrc, testId, flat, hat, fullheight, active, ...others }: BoxProps) => JSX.Element;
|
|
25
25
|
export default Box;
|
|
@@ -13,7 +13,7 @@ import { useTrilogyContext } from "../../context";
|
|
|
13
13
|
* @param skeleton {boolean} Box skeleton
|
|
14
14
|
* @param background {TrilogyColor} Box Content Background Color
|
|
15
15
|
* @param inverted {boolean} Inverted Box Color
|
|
16
|
-
* @param
|
|
16
|
+
* @param highlighted {TrilogyColor} Add Left Highlight Border With Semantic Color
|
|
17
17
|
* @param shadowless {boolean} Remove box shadow
|
|
18
18
|
* @param flat {boolean} Flat box remove shadow and add plain border
|
|
19
19
|
* @param backgroundSrc {string} Source of background Image
|
|
@@ -27,10 +27,10 @@ import { useTrilogyContext } from "../../context";
|
|
|
27
27
|
* @param fullheight
|
|
28
28
|
* @param others
|
|
29
29
|
*/
|
|
30
|
-
const Box = ({ inverted, children, className, onClick, markup, skeleton, to, background,
|
|
30
|
+
const Box = ({ inverted, children, className, onClick, markup, skeleton, to, background, highlighted, shadowless, backgroundSrc, testId, flat, hat, fullheight, active, ...others }) => {
|
|
31
31
|
const { styled } = useTrilogyContext();
|
|
32
32
|
const [isLoading, setIsLoading] = useState(skeleton || false);
|
|
33
|
-
const classes = hashClass(styled, clsx("box", shadowless && is("shadowless"), className, background && has(getBackgroundClassName(background)), backgroundSrc && has("background"), (inverted && is("inverted")) || is("base"), isLoading ? is("loading") : is("loaded"),
|
|
33
|
+
const classes = hashClass(styled, clsx("box", shadowless && is("shadowless"), className, background && has(getBackgroundClassName(background)), backgroundSrc && has("background"), (inverted && is("inverted")) || is("base"), isLoading ? is("loading") : is("loaded"), highlighted && `${is("highlighted")} ${is(getColorClassName(highlighted))}`, flat && is("flat"), hat && has("hat"), fullheight && is("fullheight"), active && is("active")));
|
|
34
34
|
useEffect(() => {
|
|
35
35
|
setIsLoading(skeleton || false);
|
|
36
36
|
}, [skeleton]);
|