@consumidor-positivo/aurora 0.0.205 → 0.0.206

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.
@@ -9,5 +9,9 @@ export type TagProps = {
9
9
  children?: React.ReactNode;
10
10
  customIcon?: string | JSX.Element;
11
11
  fullWidth?: boolean;
12
+ actionButton?: {
13
+ content?: string;
14
+ onClick?: () => void;
15
+ };
12
16
  };
13
- export declare const Tag: ({ status, border, size, type, color, customIcon, text, children, fullWidth, }: TagProps) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const Tag: ({ status, border, size, type, color, customIcon, text, children, fullWidth, actionButton, }: TagProps) => import("react/jsx-runtime").JSX.Element;
@@ -17,7 +17,8 @@ import './styles.css';const Tag = ({
17
17
  customIcon,
18
18
  text,
19
19
  children,
20
- fullWidth
20
+ fullWidth,
21
+ actionButton
21
22
  }) => {
22
23
  const statusMap = {
23
24
  success: {
@@ -72,7 +73,21 @@ import './styles.css';const Tag = ({
72
73
  ) })
73
74
  }
74
75
  ),
75
- /* @__PURE__ */ jsx("p", { className: `au-tag__content-support-text`, children: supportText })
76
+ /* @__PURE__ */ jsx("p", { className: `au-tag__content-support-text`, children: supportText }),
77
+ /* @__PURE__ */ jsx(
78
+ Conditional,
79
+ {
80
+ condition: !!actionButton,
81
+ renderIf: /* @__PURE__ */ jsx(
82
+ "button",
83
+ {
84
+ className: "au-tag__action-btn",
85
+ onClick: actionButton == null ? void 0 : actionButton.onClick,
86
+ children: actionButton == null ? void 0 : actionButton.content
87
+ }
88
+ )
89
+ }
90
+ )
76
91
  ] }),
77
92
  children
78
93
  ] });
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../../../lib/components/Tag/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport {\n IconAlertOctagon,\n IconAlertTriangle,\n IconCheck,\n IconInfo,\n IconSlash,\n} from '@components/icons'\nimport {\n COLOR_ERROR_50,\n COLOR_INFO_50,\n COLOR_SUCCESS_50,\n COLOR_WARNING_50,\n COLOR_BRAND_CYAN_50,\n COLOR_NEUTRAL_70,\n} from '@core/tokens'\nimport './styles.scss'\nimport { Conditional } from '@components/misc'\n\nexport type TagProps = {\n status: 'info' | 'success' | 'error' | 'warning' | 'support' | 'neutral'\n border?: 'rounded' | 'square'\n type?: 'read-only' | 'badge'\n color?: 'primary' | 'secondary'\n size?: 'small' | 'medium' | 'large'\n text: string\n children?: React.ReactNode\n customIcon?: string | JSX.Element\n fullWidth?: boolean\n}\n\nexport const Tag = ({\n status,\n border = 'square',\n size = 'medium',\n type = 'read-only',\n color = 'primary',\n customIcon,\n text,\n children,\n fullWidth,\n}: TagProps) => {\n const statusMap = {\n success: {\n option: 'success',\n icon: <IconCheck rawColor={COLOR_SUCCESS_50} />,\n },\n error: {\n option: 'error',\n icon: <IconAlertOctagon rawColor={COLOR_ERROR_50} />,\n },\n warning: {\n option: 'warning',\n icon: <IconAlertTriangle rawColor={COLOR_WARNING_50} />,\n },\n info: { option: 'info', icon: <IconInfo rawColor={COLOR_INFO_50} /> },\n support: {\n option: 'support',\n icon: <IconInfo rawColor={COLOR_BRAND_CYAN_50} />,\n },\n neutral: {\n option: 'neutral',\n icon: <IconSlash rawColor={COLOR_NEUTRAL_70} />,\n },\n custom: {\n option: 'custom',\n icon: customIcon,\n },\n }\n\n const tagClasses = classNames('au-tag', {\n [`au-tag--${statusMap[status].option}`]: statusMap[status].option,\n [`au-tag--size-${size}`]: !!size,\n [`au-tag--type-${type}`]: !!type,\n [`au-tag--border-${border}`]: !!border,\n [`au-tag--color-${color}`]: !!color,\n [`au-tag--full-width`]: !!fullWidth,\n })\n\n const isBadgeTag = type === 'badge'\n const supportText = isBadgeTag ? text.toUpperCase() : text\n\n return (\n <div className={tagClasses}>\n <div className=\"au-tag__content\">\n <Conditional\n condition={!isBadgeTag}\n renderIf={\n <div className=\"au-tag__content-icon\">\n <Conditional\n condition={!!customIcon}\n renderIf={customIcon}\n renderElse={statusMap[status].icon}\n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GAAG,CAAC,CAAC;AAAA,IAChC,CAAC,iBAAiB,KAAK,EAAE,GAAG,CAAC,CAAC;AAAA,IAC9B,CAAC,oBAAoB,GAAG,CAAC,CAAC;AAAA,EAAA,CAC3B;AAED,QAAM,aAAa,SAAS;AAC5B,QAAM,cAAc,aAAa,KAAK,YAAA,IAAgB;AAGpD,SAAA,qBAAC,OAAI,EAAA,WAAW,YACd,UAAA;AAAA,IAAC,qBAAA,OAAA,EAAI,WAAU,mBACb,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW,CAAC;AAAA,UACZ,UACE,oBAAC,OAAI,EAAA,WAAU,wBACb,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,CAAC,CAAC;AAAA,cACb,UAAU;AAAA,cACV,YAAY,UAAU,MAAM,EAAE;AAAA,YAAA;AAAA,UAAA,GAElC;AAAA,QAAA;AAAA,MAEJ;AAAA,MACC,oBAAA,KAAA,EAAE,WAAW,gCAAiC,UAAY,aAAA;AAAA,IAAA,GAC7D;AAAA,IACC;AAAA,EACH,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"index.es.js","sources":["../../../lib/components/Tag/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport {\n IconAlertOctagon,\n IconAlertTriangle,\n IconCheck,\n IconInfo,\n IconSlash,\n} from '@components/icons'\nimport {\n COLOR_ERROR_50,\n COLOR_INFO_50,\n COLOR_SUCCESS_50,\n COLOR_WARNING_50,\n COLOR_BRAND_CYAN_50,\n COLOR_NEUTRAL_70,\n} from '@core/tokens'\nimport './styles.scss'\nimport { Conditional } from '@components/misc'\n\nexport type TagProps = {\n status: 'info' | 'success' | 'error' | 'warning' | 'support' | 'neutral'\n border?: 'rounded' | 'square'\n type?: 'read-only' | 'badge'\n color?: 'primary' | 'secondary'\n size?: 'small' | 'medium' | 'large'\n text: string\n children?: React.ReactNode\n customIcon?: string | JSX.Element\n fullWidth?: boolean\n actionButton?: { content?: string; onClick?: () => void }\n}\n\nexport const Tag = ({\n status,\n border = 'square',\n size = 'medium',\n type = 'read-only',\n color = 'primary',\n customIcon,\n text,\n children,\n fullWidth,\n actionButton,\n}: TagProps) => {\n const statusMap = {\n success: {\n option: 'success',\n icon: <IconCheck rawColor={COLOR_SUCCESS_50} />,\n },\n error: {\n option: 'error',\n icon: <IconAlertOctagon rawColor={COLOR_ERROR_50} />,\n },\n warning: {\n option: 'warning',\n icon: <IconAlertTriangle rawColor={COLOR_WARNING_50} />,\n },\n info: { option: 'info', icon: <IconInfo rawColor={COLOR_INFO_50} /> },\n support: {\n option: 'support',\n icon: <IconInfo rawColor={COLOR_BRAND_CYAN_50} />,\n },\n neutral: {\n option: 'neutral',\n icon: <IconSlash rawColor={COLOR_NEUTRAL_70} />,\n },\n custom: {\n option: 'custom',\n icon: customIcon,\n },\n }\n\n const tagClasses = classNames('au-tag', {\n [`au-tag--${statusMap[status].option}`]: statusMap[status].option,\n [`au-tag--size-${size}`]: !!size,\n [`au-tag--type-${type}`]: !!type,\n [`au-tag--border-${border}`]: !!border,\n [`au-tag--color-${color}`]: !!color,\n [`au-tag--full-width`]: !!fullWidth,\n })\n\n const isBadgeTag = type === 'badge'\n const supportText = isBadgeTag ? text.toUpperCase() : text\n\n return (\n <div className={tagClasses}>\n <div className=\"au-tag__content\">\n <Conditional\n condition={!isBadgeTag}\n renderIf={\n <div className=\"au-tag__content-icon\">\n <Conditional\n condition={!!customIcon}\n renderIf={customIcon}\n renderElse={statusMap[status].icon}\n />\n </div>\n }\n />\n <p className={`au-tag__content-support-text`}>{supportText}</p>\n\n <Conditional\n condition={!!actionButton}\n renderIf={\n <button\n className=\"au-tag__action-btn\"\n onClick={actionButton?.onClick}>\n {actionButton?.content}\n </button>\n }\n />\n </div>\n {children}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;;;;;;AAgCO,MAAM,MAAM,CAAC;AAAA,EAClB;AAAA,EACA,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OA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cAAc,aAAa,KAAK,YAAA,IAAgB;AAGpD,SAAA,qBAAC,OAAI,EAAA,WAAW,YACd,UAAA;AAAA,IAAC,qBAAA,OAAA,EAAI,WAAU,mBACb,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW,CAAC;AAAA,UACZ,UACE,oBAAC,OAAI,EAAA,WAAU,wBACb,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,CAAC,CAAC;AAAA,cACb,UAAU;AAAA,cACV,YAAY,UAAU,MAAM,EAAE;AAAA,YAAA;AAAA,UAAA,GAElC;AAAA,QAAA;AAAA,MAEJ;AAAA,MACC,oBAAA,KAAA,EAAE,WAAW,gCAAiC,UAAY,aAAA;AAAA,MAE3D;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW,CAAC,CAAC;AAAA,UACb,UACE;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,SAAS,6CAAc;AAAA,cACtB,UAAc,6CAAA;AAAA,YAAA;AAAA,UACjB;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA,GACF;AAAA,IACC;AAAA,EACH,EAAA,CAAA;AAEJ;"}
@@ -1 +1 @@
1
- .au-tag{font-family:"Source Sans 3",sans-serif;display:flex;justify-content:center;border-radius:8px;padding:8px;width:fit-content}.au-tag__content{display:flex;gap:8px;justify-content:center;align-items:center}.au-tag__content-icon .au-icon,.au-tag__content-icon .au-icon>svg{width:16px;height:16px}.au-tag__content-support-text{color:#16181d;font-size:12px;font-weight:600;line-height:18px}.au-tag--size-small{height:26px;padding:4px 8px}.au-tag--size-medium{height:36px}.au-tag--size-large{height:38px}.au-tag--size-large-support-text{font-size:14px;line-height:22px}.au-tag--border-rounded{border-radius:500px}.au-tag--color-primary.au-tag--info{background-color:#eee6ff}.au-tag--color-primary.au-tag--success{background-color:#e5fff0}.au-tag--color-primary.au-tag--error{background-color:#ffe5e5}.au-tag--color-primary.au-tag--warning{background-color:#fff0e6}.au-tag--color-primary.au-tag--support{background-color:#f1fcff}.au-tag--color-primary.au-tag--neutral{background-color:#e2e4e9}.au-tag--color-secondary.au-tag--info{background-color:#d4bfff}.au-tag--color-secondary.au-tag--success{background-color:#a1e5bd}.au-tag--color-secondary.au-tag--error{background-color:#ffbfbf}.au-tag--color-secondary.au-tag--warning{background-color:#ffdabf}.au-tag--color-secondary.au-tag--support{background-color:#ccf3ff}.au-tag--color-secondary.au-tag--neutral{background-color:#c4c9d4}.au-tag--type-badge.au-tag--info p{color:#46008c}.au-tag--type-badge.au-tag--error p{color:#731111}.au-tag--type-badge.au-tag--success p{color:#08331a}.au-tag--type-badge.au-tag--warning p{color:#803500}.au-tag--type-badge.au-tag--support p{color:#004155}.au-tag--type-badge.au-tag--size-large{height:36px;font-size:12px;line-height:18px}.au-tag--full-width{width:100%}
1
+ .au-tag{font-family:"Source Sans 3",sans-serif;display:flex;justify-content:center;border-radius:8px;padding:8px;width:fit-content}.au-tag__content{display:flex;gap:8px;justify-content:center;align-items:center}.au-tag__content-icon .au-icon,.au-tag__content-icon .au-icon>svg{width:16px;height:16px}.au-tag__content-support-text{color:#16181d;font-size:12px;font-weight:600;line-height:18px}.au-tag--size-small{height:26px;padding:4px 8px}.au-tag--size-medium{height:36px}.au-tag--size-large{height:38px}.au-tag--size-large-support-text{font-size:14px;line-height:22px}.au-tag--border-rounded{border-radius:500px}.au-tag--color-primary.au-tag--info{background-color:#eee6ff}.au-tag--color-primary.au-tag--success{background-color:#e5fff0}.au-tag--color-primary.au-tag--error{background-color:#ffe5e5}.au-tag--color-primary.au-tag--warning{background-color:#fff0e6}.au-tag--color-primary.au-tag--support{background-color:#f1fcff}.au-tag--color-primary.au-tag--neutral{background-color:#e2e4e9}.au-tag--color-secondary.au-tag--info{background-color:#d4bfff}.au-tag--color-secondary.au-tag--success{background-color:#a1e5bd}.au-tag--color-secondary.au-tag--error{background-color:#ffbfbf}.au-tag--color-secondary.au-tag--warning{background-color:#ffdabf}.au-tag--color-secondary.au-tag--support{background-color:#ccf3ff}.au-tag--color-secondary.au-tag--neutral{background-color:#c4c9d4}.au-tag--type-badge.au-tag--info p{color:#46008c}.au-tag--type-badge.au-tag--error p{color:#731111}.au-tag--type-badge.au-tag--success p{color:#08331a}.au-tag--type-badge.au-tag--warning p{color:#803500}.au-tag--type-badge.au-tag--support p{color:#004155}.au-tag--type-badge.au-tag--size-large{height:36px;font-size:12px;line-height:18px}.au-tag--full-width{width:100%}.au-tag__action-btn{font-family:"Source Sans 3",sans-serif;background-color:transparent;border:none;color:#0048db;cursor:pointer;font-size:12px;font-weight:600;line-height:19px}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@consumidor-positivo/aurora",
3
3
  "private": false,
4
- "version": "0.0.205",
4
+ "version": "0.0.206",
5
5
  "type": "module",
6
6
  "main": "./dist/main.es.js",
7
7
  "modules": "./dist/main.es.js",