@consumidor-positivo/aurora 0.12.0 → 1.0.0
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/dist/components/Alert/index.d.ts +6 -1
- package/dist/components/Alert/index.es.js +10 -1
- package/dist/components/Alert/index.es.js.map +1 -1
- package/dist/components/Alert/styles.css +1 -1
- package/dist/components/BadgeInfo/index.d.ts +0 -4
- package/dist/components/BadgeInfo/index.es.js +2 -1
- package/dist/components/BadgeInfo/index.es.js.map +1 -1
- package/dist/components/BadgeState/index.es.js +2 -1
- package/dist/components/BadgeState/index.es.js.map +1 -1
- package/dist/components/Button/index.d.ts +9 -0
- package/dist/components/Button/index.es.js.map +1 -1
- package/dist/components/Button/styles.css +1 -1
- package/dist/components/Calendar/index.es.js +2 -2
- package/dist/components/CalendarHeader/index.es.js +3 -2
- package/dist/components/CalendarHeader/index.es.js.map +1 -1
- package/dist/components/Checkbox/index.es.js +1 -1
- package/dist/components/Chip/index.es.js +1 -0
- package/dist/components/Chip/index.es.js.map +1 -1
- package/dist/components/Datepicker/index.es.js +4 -4
- package/dist/components/Drawer/index.d.ts +7 -1
- package/dist/components/Drawer/index.es.js +4 -1
- package/dist/components/Drawer/index.es.js.map +1 -1
- package/dist/components/Drawer/styles.css +1 -1
- package/dist/components/Footer/index.es.js +1 -0
- package/dist/components/Footer/index.es.js.map +1 -1
- package/dist/components/Header/index.es.js +1 -1
- package/dist/components/Icon/index.es.js +14 -2
- package/dist/components/Icon/index.es.js.map +1 -1
- package/dist/components/Image/index.es.js +1 -1
- package/dist/components/Label/index.es.js +2 -1
- package/dist/components/Label/index.es.js.map +1 -1
- package/dist/components/LinkButton/index.d.ts +27 -0
- package/dist/components/LinkButton/index.es.js +56 -0
- package/dist/components/LinkButton/index.es.js.map +1 -0
- package/dist/components/LinkButton/styles.css +1 -0
- package/dist/components/Modal/index.d.ts +3 -1
- package/dist/components/Modal/index.es.js +8 -0
- package/dist/components/Modal/index.es.js.map +1 -1
- package/dist/components/PortalHolder/index.es.js +1 -1
- package/dist/components/Segment/index.es.js +2 -1
- package/dist/components/Segment/index.es.js.map +1 -1
- package/dist/components/SelectField/index.es.js +1 -1
- package/dist/components/SpecialButton/SpecialButton.test.d.ts +1 -0
- package/dist/components/SpecialButton/index.d.ts +38 -0
- package/dist/components/SpecialButton/index.es.js +193 -0
- package/dist/components/SpecialButton/index.es.js.map +1 -0
- package/dist/components/SpecialButton/styles.css +1 -0
- package/dist/components/Spinner/index.d.ts +9 -5
- package/dist/components/Spinner/index.es.js +25 -15
- package/dist/components/Spinner/index.es.js.map +1 -1
- package/dist/components/SubHeader/index.es.js +1 -0
- package/dist/components/SubHeader/index.es.js.map +1 -1
- package/dist/components/Tabs/index.d.ts +3 -4
- package/dist/components/Tabs/index.es.js +80 -84
- package/dist/components/Tabs/index.es.js.map +1 -1
- package/dist/components/Tabs/styles.css +1 -1
- package/dist/components/Tag/index.es.js +8 -86
- package/dist/components/Tag/index.es.js.map +1 -1
- package/dist/components/TextareaField/index.es.js.map +1 -1
- package/dist/components/form/SelectField/types.d.ts +1 -0
- package/dist/components/form/TextareaField/index.d.ts +1 -0
- package/dist/components/icons/Icon.test/index.es.js +23 -5
- package/dist/components/icons/Icon.test/index.es.js.map +1 -1
- package/dist/{index-Dws33tXs.js → index-BgBOcVUP.js} +3 -3
- package/dist/{index-Dws33tXs.js.map → index-BgBOcVUP.js.map} +1 -1
- package/dist/{index-CnXw6SB7.js → index-DHwXRotU.js} +3 -3
- package/dist/{index-CnXw6SB7.js.map → index-DHwXRotU.js.map} +1 -1
- package/dist/{index-fyDB87KK.js → index-DnQGzfVW.js} +3 -3
- package/dist/{index-fyDB87KK.js.map → index-DnQGzfVW.js.map} +1 -1
- package/dist/main.d.ts +3 -1
- package/dist/main.es.js +21 -33
- package/dist/main.es.js.map +1 -1
- package/dist/{tokens-CKZdIZ5O.js → tokens-C4yCunfz.js} +15 -15
- package/dist/{tokens-CKZdIZ5O.js.map → tokens-C4yCunfz.js.map} +1 -1
- package/package.json +3 -3
- package/dist/components/Tag/index.d.ts +0 -22
- package/dist/components/Tag/styles.css +0 -1
- /package/dist/components/{Tag/Tag.test.d.ts → LinkButton/LinkButton.test.d.ts} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c as classNames } from "../../index-C6Q03EyZ.js";
|
|
3
|
+
import "react";
|
|
3
4
|
import "../Icon/index.es.js";
|
|
4
5
|
import { IconChevronLeft } from "../icons/IconChevronLeft/index.es.js";
|
|
5
6
|
import { IconHelpCircle } from "../icons/IconHelpCircle/index.es.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/SubHeader/index.tsx"],"sourcesContent":["import { IconChevronLeft, IconHelpCircle } from '../icons/default'\n\nimport { Container } from '@components/Container'\nimport { Text } from '@components/Text'\nimport { Button } from '@components/Button'\n\nimport classNames from 'classnames'\n\nimport './styles.scss'\n\ntype SubHeaderProps = {\n title: string\n handleReturn: () => void\n handleHelpInfo?: () => void\n 'data-testid'?: string\n}\n\nexport const SubHeader = ({\n title,\n handleReturn,\n handleHelpInfo,\n 'data-testid': dataTestId,\n}: SubHeaderProps) => {\n return (\n <div\n className={classNames('au-sub-header', {\n 'au-sub-header--with-help': handleHelpInfo,\n })}\n data-testid={dataTestId}>\n <Container customClass=\"au-sub-header__container\">\n <Button\n className=\"au-sub-header__button\"\n onClick={handleReturn}\n type=\"ghost\"\n aria-label=\"Voltar\">\n <IconChevronLeft aria-hidden=\"true\" />\n </Button>\n <Text\n className=\"au-sub-header__title\"\n variant=\"heading-micro\"\n variantDesk=\"heading-small\"\n weight=\"bold\"\n as=\"div\">\n {title}\n </Text>\n {handleHelpInfo && (\n <Button\n className=\"au-sub-header__button\"\n onClick={handleHelpInfo}\n type=\"ghost\"\n aria-label=\"Ajuda\">\n <IconHelpCircle aria-hidden=\"true\" />\n </Button>\n )}\n </Container>\n </div>\n )\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/SubHeader/index.tsx"],"sourcesContent":["import { IconChevronLeft, IconHelpCircle } from '../icons/default'\n\nimport { Container } from '@components/Container'\nimport { Text } from '@components/Text'\nimport { Button } from '@components/Button'\n\nimport classNames from 'classnames'\n\nimport './styles.scss'\n\ntype SubHeaderProps = {\n title: string\n handleReturn: () => void\n handleHelpInfo?: () => void\n 'data-testid'?: string\n}\n\nexport const SubHeader = ({\n title,\n handleReturn,\n handleHelpInfo,\n 'data-testid': dataTestId,\n}: SubHeaderProps) => {\n return (\n <div\n className={classNames('au-sub-header', {\n 'au-sub-header--with-help': handleHelpInfo,\n })}\n data-testid={dataTestId}>\n <Container customClass=\"au-sub-header__container\">\n <Button\n className=\"au-sub-header__button\"\n onClick={handleReturn}\n type=\"ghost\"\n aria-label=\"Voltar\">\n <IconChevronLeft aria-hidden=\"true\" />\n </Button>\n <Text\n className=\"au-sub-header__title\"\n variant=\"heading-micro\"\n variantDesk=\"heading-small\"\n weight=\"bold\"\n as=\"div\">\n {title}\n </Text>\n {handleHelpInfo && (\n <Button\n className=\"au-sub-header__button\"\n onClick={handleHelpInfo}\n type=\"ghost\"\n aria-label=\"Ajuda\">\n <IconHelpCircle aria-hidden=\"true\" />\n </Button>\n )}\n </Container>\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;;;;;AAiBO,MAAM,YAAY,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AACjB,MAAsB;AACpB,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,WAAW,iBAAiB;AAAA,QACrC,4BAA4B;AAAA,MAAA,CAC7B;AAAA,MACD,eAAa;AAAA,MACb,UAAA,qBAAC,WAAA,EAAU,aAAY,4BACrB,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,SAAS;AAAA,YACT,MAAK;AAAA,YACL,cAAW;AAAA,YACX,UAAA,oBAAC,iBAAA,EAAgB,eAAY,OAAA,CAAO;AAAA,UAAA;AAAA,QAAA;AAAA,QAEtC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,SAAQ;AAAA,YACR,aAAY;AAAA,YACZ,QAAO;AAAA,YACP,IAAG;AAAA,YACF,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAEF,kBACC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,SAAS;AAAA,YACT,MAAK;AAAA,YACL,cAAW;AAAA,YACX,UAAA,oBAAC,gBAAA,EAAe,eAAY,OAAA,CAAO;AAAA,UAAA;AAAA,QAAA;AAAA,MACrC,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type TabsProps = {
|
|
2
2
|
tabs: TabItemProps[];
|
|
3
|
-
|
|
3
|
+
/** Hides the tab bar and renders only the active panel. Not mapped in Figma. */
|
|
4
4
|
areTabsHidden?: boolean;
|
|
5
5
|
initialTab?: string;
|
|
6
|
-
|
|
6
|
+
/** Content rendered at the right side of the tab bar. Not mapped in Figma. */
|
|
7
7
|
rightSlotChildren?: React.ReactNode;
|
|
8
8
|
onClick?: (value: string) => void;
|
|
9
9
|
'data-testid'?: string;
|
|
@@ -12,7 +12,6 @@ export type TabItemProps = {
|
|
|
12
12
|
tab: string;
|
|
13
13
|
title: string;
|
|
14
14
|
children?: React.ReactElement;
|
|
15
|
-
icon?: React.ReactNode;
|
|
16
15
|
};
|
|
17
|
-
export declare const Tabs: ({ tabs,
|
|
16
|
+
export declare const Tabs: ({ tabs, initialTab, onClick, areTabsHidden, rightSlotChildren, "data-testid": dataTestId, }: TabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
17
|
export default Tabs;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useRef, useEffect } from "react";
|
|
3
|
-
import { W as When
|
|
4
|
-
import { Text } from "../Text/index.es.js";
|
|
5
|
-
import { Chip } from "../Chip/index.es.js";
|
|
3
|
+
import { W as When } from "../../react-if.esm-Cozt8l48.js";
|
|
6
4
|
import { c as classNames } from "../../index-C6Q03EyZ.js";
|
|
7
5
|
import './styles.css';const Tabs = ({
|
|
8
6
|
tabs,
|
|
9
|
-
type = 1,
|
|
10
7
|
initialTab,
|
|
11
8
|
onClick,
|
|
12
9
|
areTabsHidden,
|
|
13
10
|
rightSlotChildren,
|
|
14
|
-
withLabel = false,
|
|
15
11
|
"data-testid": dataTestId
|
|
16
12
|
}) => {
|
|
17
|
-
|
|
18
|
-
const [currButton, setCurrButton] = useState(initialTab ?? "");
|
|
13
|
+
var _a;
|
|
19
14
|
const [activeTab, setActiveTab] = useState(initialTab);
|
|
20
15
|
const [indicatorStyle, setIndicatorStyle] = useState({ left: 0, width: 0 });
|
|
21
16
|
const tabsRef = useRef(null);
|
|
@@ -23,97 +18,98 @@ import './styles.css';const Tabs = ({
|
|
|
23
18
|
setActiveTab(initialTab);
|
|
24
19
|
}, [initialTab]);
|
|
25
20
|
useEffect(() => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
-
}
|
|
21
|
+
const container = tabsRef.current;
|
|
22
|
+
if (activeTab && container) {
|
|
23
|
+
const activeElement = container.querySelector(
|
|
24
|
+
".au-tabs__btns-option--active"
|
|
25
|
+
);
|
|
26
|
+
if (activeElement) {
|
|
27
|
+
setIndicatorStyle({
|
|
28
|
+
left: activeElement.offsetLeft,
|
|
29
|
+
width: activeElement.offsetWidth
|
|
30
|
+
});
|
|
38
31
|
}
|
|
39
32
|
}
|
|
40
|
-
}, [activeTab, tabs
|
|
33
|
+
}, [activeTab, tabs]);
|
|
41
34
|
const handleClick = (item) => {
|
|
42
35
|
onClick && onClick(item.tab);
|
|
43
|
-
setCurrButton(item.tab);
|
|
44
36
|
setActiveTab(item.tab);
|
|
45
|
-
setIsClicked(true);
|
|
46
37
|
};
|
|
38
|
+
const handleKeyDown = (event) => {
|
|
39
|
+
var _a2;
|
|
40
|
+
if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) return;
|
|
41
|
+
const container = tabsRef.current;
|
|
42
|
+
if (!container) return;
|
|
43
|
+
const tabButtons = Array.from(
|
|
44
|
+
container.querySelectorAll('[role="tab"]')
|
|
45
|
+
);
|
|
46
|
+
const currentIndex = tabButtons.indexOf(
|
|
47
|
+
document.activeElement
|
|
48
|
+
);
|
|
49
|
+
if (currentIndex === -1) return;
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
const lastIndex = tabButtons.length - 1;
|
|
52
|
+
const nextIndex = {
|
|
53
|
+
ArrowLeft: currentIndex === 0 ? lastIndex : currentIndex - 1,
|
|
54
|
+
ArrowRight: currentIndex === lastIndex ? 0 : currentIndex + 1,
|
|
55
|
+
Home: 0,
|
|
56
|
+
End: lastIndex
|
|
57
|
+
}[event.key];
|
|
58
|
+
(_a2 = tabButtons[nextIndex]) == null ? void 0 : _a2.focus();
|
|
59
|
+
};
|
|
60
|
+
const focusableTab = activeTab ?? ((_a = tabs[0]) == null ? void 0 : _a.tab);
|
|
47
61
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
48
|
-
/* @__PURE__ */ jsx(When, { condition: !areTabsHidden, children: /* @__PURE__ */ jsx(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
/* @__PURE__ */ jsx(When, { condition: !areTabsHidden, children: /* @__PURE__ */ jsx("div", { className: "au-tabs", "data-testid": dataTestId, children: /* @__PURE__ */ jsxs("div", { className: "au-tabs__container", children: [
|
|
63
|
+
/* @__PURE__ */ jsxs(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: "au-tabs__btns",
|
|
67
|
+
role: "tablist",
|
|
68
|
+
ref: tabsRef,
|
|
69
|
+
onKeyDown: handleKeyDown,
|
|
70
|
+
children: [
|
|
71
|
+
tabs.map((item) => /* @__PURE__ */ jsx(
|
|
72
|
+
"button",
|
|
59
73
|
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"button",
|
|
83
|
-
{
|
|
84
|
-
type: "button",
|
|
85
|
-
className: classNames("au-tabs__btns-option", {
|
|
86
|
-
"au-tabs__btns-option--active": activeTab === item.tab
|
|
87
|
-
}),
|
|
88
|
-
onClick: () => handleClick(item),
|
|
89
|
-
children: item.title
|
|
90
|
-
}
|
|
91
|
-
) })
|
|
92
|
-
] }, item.tab);
|
|
93
|
-
}),
|
|
94
|
-
/* @__PURE__ */ jsx(When, { condition: type === 2, children: /* @__PURE__ */ jsx(
|
|
95
|
-
"div",
|
|
96
|
-
{
|
|
97
|
-
className: "au-tabs__btns-indicator",
|
|
98
|
-
"aria-hidden": "true",
|
|
99
|
-
style: {
|
|
100
|
-
left: `${indicatorStyle.left}px`,
|
|
101
|
-
width: `${indicatorStyle.width}px`
|
|
102
|
-
}
|
|
74
|
+
type: "button",
|
|
75
|
+
role: "tab",
|
|
76
|
+
id: `au-tab-${item.tab}`,
|
|
77
|
+
"aria-selected": activeTab === item.tab,
|
|
78
|
+
"aria-controls": `au-tabpanel-${item.tab}`,
|
|
79
|
+
tabIndex: item.tab === focusableTab ? 0 : -1,
|
|
80
|
+
className: classNames("au-tabs__btns-option", {
|
|
81
|
+
"au-tabs__btns-option--active": activeTab === item.tab
|
|
82
|
+
}),
|
|
83
|
+
onClick: () => handleClick(item),
|
|
84
|
+
children: item.title
|
|
85
|
+
},
|
|
86
|
+
item.tab
|
|
87
|
+
)),
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
89
|
+
"div",
|
|
90
|
+
{
|
|
91
|
+
className: "au-tabs__btns-indicator",
|
|
92
|
+
"aria-hidden": "true",
|
|
93
|
+
style: {
|
|
94
|
+
left: `${indicatorStyle.left}px`,
|
|
95
|
+
width: `${indicatorStyle.width}px`
|
|
103
96
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
]
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
) }),
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ jsx(When, { condition: !!rightSlotChildren, children: rightSlotChildren })
|
|
103
|
+
] }) }) }),
|
|
111
104
|
tabs.map(({ children, tab }) => {
|
|
112
105
|
return /* @__PURE__ */ jsx(
|
|
113
106
|
"div",
|
|
114
107
|
{
|
|
108
|
+
role: "tabpanel",
|
|
109
|
+
id: `au-tabpanel-${tab}`,
|
|
110
|
+
"aria-labelledby": `au-tab-${tab}`,
|
|
115
111
|
className: `au-tabs__children children-${tab}`,
|
|
116
|
-
children: /* @__PURE__ */ jsx(When, { condition:
|
|
112
|
+
children: /* @__PURE__ */ jsx(When, { condition: activeTab === tab, children })
|
|
117
113
|
},
|
|
118
114
|
`au-tabs-${tab}`
|
|
119
115
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Tabs/index.tsx"],"sourcesContent":["import { useEffect, useState, useRef } from 'react'\nimport { If
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Tabs/index.tsx"],"sourcesContent":["import { useEffect, useState, useRef } from 'react'\nimport { If } from '@components/misc'\n\nimport classNames from 'classnames'\n\nimport './styles.scss'\n\nexport type TabsProps = {\n tabs: TabItemProps[]\n /** Hides the tab bar and renders only the active panel. Not mapped in Figma. */\n areTabsHidden?: boolean\n initialTab?: string\n /** Content rendered at the right side of the tab bar. Not mapped in Figma. */\n rightSlotChildren?: React.ReactNode\n onClick?: (value: string) => void\n 'data-testid'?: string\n}\n\nexport type TabItemProps = {\n tab: string\n title: string\n children?: React.ReactElement\n}\n\nexport const Tabs = ({\n tabs,\n initialTab,\n onClick,\n areTabsHidden,\n rightSlotChildren,\n 'data-testid': dataTestId,\n}: TabsProps) => {\n const [activeTab, setActiveTab] = useState(initialTab)\n const [indicatorStyle, setIndicatorStyle] = useState({ left: 0, width: 0 })\n\n const tabsRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n setActiveTab(initialTab)\n }, [initialTab])\n\n useEffect(() => {\n const container = tabsRef.current\n if (activeTab && container) {\n const activeElement = container.querySelector(\n '.au-tabs__btns-option--active',\n ) as HTMLElement\n\n if (activeElement) {\n setIndicatorStyle({\n left: activeElement.offsetLeft,\n width: activeElement.offsetWidth,\n })\n }\n }\n }, [activeTab, tabs])\n\n const handleClick = (item: TabItemProps) => {\n onClick && onClick(item.tab)\n setActiveTab(item.tab)\n }\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) return\n\n const container = tabsRef.current\n if (!container) return\n\n const tabButtons = Array.from(\n container.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]'),\n )\n const currentIndex = tabButtons.indexOf(\n document.activeElement as HTMLButtonElement,\n )\n if (currentIndex === -1) return\n\n event.preventDefault()\n\n const lastIndex = tabButtons.length - 1\n const nextIndex = {\n ArrowLeft: currentIndex === 0 ? lastIndex : currentIndex - 1,\n ArrowRight: currentIndex === lastIndex ? 0 : currentIndex + 1,\n Home: 0,\n End: lastIndex,\n }[event.key as 'ArrowLeft' | 'ArrowRight' | 'Home' | 'End']\n\n tabButtons[nextIndex]?.focus()\n }\n\n const focusableTab = activeTab ?? tabs[0]?.tab\n\n return (\n <>\n <If condition={!areTabsHidden}>\n <div className=\"au-tabs\" data-testid={dataTestId}>\n <div className=\"au-tabs__container\">\n <div\n className=\"au-tabs__btns\"\n role=\"tablist\"\n ref={tabsRef}\n onKeyDown={handleKeyDown}>\n {tabs.map((item: TabItemProps) => (\n <button\n key={item.tab}\n type=\"button\"\n role=\"tab\"\n id={`au-tab-${item.tab}`}\n aria-selected={activeTab === item.tab}\n aria-controls={`au-tabpanel-${item.tab}`}\n tabIndex={item.tab === focusableTab ? 0 : -1}\n className={classNames('au-tabs__btns-option', {\n 'au-tabs__btns-option--active': activeTab === item.tab,\n })}\n onClick={() => handleClick(item)}>\n {item.title}\n </button>\n ))}\n <div\n className=\"au-tabs__btns-indicator\"\n aria-hidden=\"true\"\n style={{\n left: `${indicatorStyle.left}px`,\n width: `${indicatorStyle.width}px`,\n }}\n />\n </div>\n <If condition={!!rightSlotChildren}>{rightSlotChildren}</If>\n </div>\n </div>\n </If>\n\n {tabs.map(({ children, tab }: TabItemProps) => {\n return (\n <div\n role=\"tabpanel\"\n id={`au-tabpanel-${tab}`}\n aria-labelledby={`au-tab-${tab}`}\n className={`au-tabs__children children-${tab}`}\n key={`au-tabs-${tab}`}>\n <If condition={activeTab === tab}>{children}</If>\n </div>\n )\n })}\n </>\n )\n}\n\nexport default Tabs\n"],"names":["_a","If"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-tabs
|
|
1
|
+
.au-tabs{border-bottom:1px solid #e2e4e9}.au-tabs__container{display:flex;flex-direction:column}@media(min-width:600px){.au-tabs__container{flex-direction:row;align-items:center;justify-content:space-between}}.au-tabs__btns{display:flex;position:relative;white-space:nowrap;overflow-x:auto;overflow-y:hidden}.au-tabs__btns::-webkit-scrollbar{display:none}@media(min-width:600px){.au-tabs__btns{overflow:unset}}.au-tabs__btns-option{display:flex;flex:1 0 0;align-items:center;justify-content:center;min-height:36px;border:none;background:none;cursor:pointer;padding:8px 24px;font-family:Lexend Deca,sans-serif;font-size:14px;font-weight:400;line-height:1.4;color:#454a54;position:relative;transition:all .3s ease}@media(min-width:600px){.au-tabs__btns-option{flex:0 0 auto}}.au-tabs__btns-option--active{color:#0048db;font-weight:600}.au-tabs__btns-indicator{position:absolute;bottom:-1px;left:0;height:2px;background-color:#0048db;transition:all .3s cubic-bezier(.4,0,.2,1)}.au-tabs__children{margin-top:24px}@media(min-width:600px){.au-tabs__children{margin-top:32px}}
|
|
@@ -1,99 +1,21 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as classNames } from "../../index-C6Q03EyZ.js";
|
|
3
|
-
|
|
4
|
-
import { IconAlertOctagon } from "../icons/IconAlertOctagon/index.es.js";
|
|
5
|
-
import { IconAlertTriangle } from "../icons/IconAlertTriangle/index.es.js";
|
|
6
|
-
import { IconCheck } from "../icons/IconCheck/index.es.js";
|
|
7
|
-
import { IconInfo } from "../icons/IconInfo/index.es.js";
|
|
8
|
-
import { IconSlash } from "../icons/IconSlash/index.es.js";
|
|
9
|
-
import { Conditional } from "../Conditional/index.es.js";
|
|
10
|
-
import { d as COLOR_NEUTRAL_70, g as COLOR_BRAND_CYAN_50, f as COLOR_INFO_50, e as COLOR_WARNING_50, b as COLOR_ERROR_50, C as COLOR_SUCCESS_50 } from "../../tokens-CKZdIZ5O.js";
|
|
11
|
-
import './styles.css';const Tag = ({
|
|
12
|
-
status,
|
|
13
|
-
border = "square",
|
|
14
|
-
size = "medium",
|
|
15
|
-
type = "read-only",
|
|
3
|
+
const CardTag = ({
|
|
16
4
|
color = "primary",
|
|
17
|
-
|
|
18
|
-
text,
|
|
5
|
+
icon,
|
|
19
6
|
children,
|
|
20
|
-
fullWidth,
|
|
21
|
-
actionButton,
|
|
22
7
|
"data-testid": dataTestId
|
|
23
8
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
icon: /* @__PURE__ */ jsx(IconCheck, { rawColor: COLOR_SUCCESS_50 })
|
|
28
|
-
},
|
|
29
|
-
error: {
|
|
30
|
-
option: "error",
|
|
31
|
-
icon: /* @__PURE__ */ jsx(IconAlertOctagon, { rawColor: COLOR_ERROR_50 })
|
|
32
|
-
},
|
|
33
|
-
warning: {
|
|
34
|
-
option: "warning",
|
|
35
|
-
icon: /* @__PURE__ */ jsx(IconAlertTriangle, { rawColor: COLOR_WARNING_50 })
|
|
36
|
-
},
|
|
37
|
-
info: { option: "info", icon: /* @__PURE__ */ jsx(IconInfo, { rawColor: COLOR_INFO_50 }) },
|
|
38
|
-
support: {
|
|
39
|
-
option: "support",
|
|
40
|
-
icon: /* @__PURE__ */ jsx(IconInfo, { rawColor: COLOR_BRAND_CYAN_50 })
|
|
41
|
-
},
|
|
42
|
-
neutral: {
|
|
43
|
-
option: "neutral",
|
|
44
|
-
icon: /* @__PURE__ */ jsx(IconSlash, { rawColor: COLOR_NEUTRAL_70 })
|
|
45
|
-
},
|
|
46
|
-
custom: {
|
|
47
|
-
option: "custom",
|
|
48
|
-
icon: customIcon
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const tagClasses = classNames("au-tag", {
|
|
52
|
-
[`au-tag--${statusMap[status].option}`]: statusMap[status].option,
|
|
53
|
-
[`au-tag--size-${size}`]: !!size,
|
|
54
|
-
[`au-tag--type-${type}`]: !!type,
|
|
55
|
-
[`au-tag--border-${border}`]: !!border,
|
|
56
|
-
[`au-tag--color-${color}`]: !!color,
|
|
57
|
-
[`au-tag--full-width`]: !!fullWidth
|
|
9
|
+
const tagClasses = classNames("au-card__tag", {
|
|
10
|
+
"au-card__tag--primary": color === "primary",
|
|
11
|
+
"au-card__tag--secondary": color === "secondary"
|
|
58
12
|
});
|
|
59
|
-
const isBadgeTag = type === "badge";
|
|
60
|
-
const supportText = isBadgeTag ? text.toUpperCase() : text;
|
|
61
13
|
return /* @__PURE__ */ jsxs("div", { className: tagClasses, "data-testid": dataTestId, children: [
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
64
|
-
Conditional,
|
|
65
|
-
{
|
|
66
|
-
condition: !isBadgeTag,
|
|
67
|
-
renderIf: /* @__PURE__ */ jsx("div", { className: "au-tag__content-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
68
|
-
Conditional,
|
|
69
|
-
{
|
|
70
|
-
condition: !!customIcon,
|
|
71
|
-
renderIf: customIcon,
|
|
72
|
-
renderElse: statusMap[status].icon
|
|
73
|
-
}
|
|
74
|
-
) })
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
/* @__PURE__ */ jsx("p", { className: `au-tag__content-support-text`, children: supportText }),
|
|
78
|
-
/* @__PURE__ */ jsx(
|
|
79
|
-
Conditional,
|
|
80
|
-
{
|
|
81
|
-
condition: !!actionButton,
|
|
82
|
-
renderIf: /* @__PURE__ */ jsx(
|
|
83
|
-
"button",
|
|
84
|
-
{
|
|
85
|
-
className: "au-tag__action-btn",
|
|
86
|
-
onClick: actionButton == null ? void 0 : actionButton.onClick,
|
|
87
|
-
children: actionButton == null ? void 0 : actionButton.content
|
|
88
|
-
}
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
|
-
)
|
|
92
|
-
] }),
|
|
93
|
-
children
|
|
14
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: icon }),
|
|
15
|
+
/* @__PURE__ */ jsx("span", { children })
|
|
94
16
|
] });
|
|
95
17
|
};
|
|
96
18
|
export {
|
|
97
|
-
|
|
19
|
+
CardTag
|
|
98
20
|
};
|
|
99
21
|
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Tag/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport {
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Card/Tag/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { ReactNode } from 'react'\n\nexport type CardTagProps = {\n color?: 'primary' | 'secondary'\n icon?: ReactNode\n children: ReactNode\n 'data-testid'?: string\n}\nexport const CardTag = ({\n color = 'primary',\n icon,\n children,\n 'data-testid': dataTestId,\n}: CardTagProps) => {\n const tagClasses = classNames('au-card__tag', {\n 'au-card__tag--primary': color === 'primary',\n 'au-card__tag--secondary': color === 'secondary',\n })\n return (\n <div className={tagClasses} data-testid={dataTestId}>\n <span aria-hidden=\"true\">{icon}</span>\n <span>{children}</span>\n </div>\n )\n}\n"],"names":[],"mappings":";;AASO,MAAM,UAAU,CAAC;AAAA,EACtB,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,eAAe;AACjB,MAAoB;AAClB,QAAM,aAAa,WAAW,gBAAgB;AAAA,IAC5C,yBAAyB,UAAU;AAAA,IACnC,2BAA2B,UAAU;AAAA,EAAA,CACtC;AACD,SACE,qBAAC,OAAA,EAAI,WAAW,YAAY,eAAa,YACvC,UAAA;AAAA,IAAA,oBAAC,QAAA,EAAK,eAAY,QAAQ,UAAA,MAAK;AAAA,IAC/B,oBAAC,UAAM,SAAA,CAAS;AAAA,EAAA,GAClB;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/form/TextareaField/index.tsx"],"sourcesContent":["import Field from '../Field'\n\nexport type TextAreaProps =\n React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n showOptionalLabel?: boolean\n success?: boolean\n error?: boolean\n errorMessage?: string\n helpMessage?: string\n label?: string\n textAreaStyle?: React.CSSProperties\n textareaRef?: React.RefObject<HTMLTextAreaElement>\n horizontalResize?: boolean\n }\n\nexport const TextAreaField = ({\n showOptionalLabel,\n required,\n success,\n error,\n errorMessage,\n helpMessage,\n label,\n id,\n disabled,\n style,\n className,\n textAreaStyle,\n textareaRef,\n maxLength,\n horizontalResize,\n ...props\n}: TextAreaProps) => {\n return (\n <Field.Root\n style={style}\n customclass={className}\n success={success}\n error={error}\n disabled={disabled}>\n <Field.Label\n text={label}\n id={id}\n required={required}\n showOptionalLabel={showOptionalLabel}\n success={success}\n error={error}\n disabled={disabled}\n />\n <Field.TextArea\n id={id}\n textareaRef={textareaRef}\n disabled={disabled}\n style={textAreaStyle}\n maxLength={maxLength}\n horizontalResize={horizontalResize}\n {...props}\n />\n <Field.Message hasError={!!error} errorMessage={errorMessage} helpMessage={helpMessage} />\n </Field.Root>\n )\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/form/TextareaField/index.tsx"],"sourcesContent":["import Field from '../Field'\n\nexport type TextAreaProps =\n React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n showOptionalLabel?: boolean\n success?: boolean\n error?: boolean\n errorMessage?: string\n helpMessage?: string\n label?: string\n textAreaStyle?: React.CSSProperties\n textareaRef?: React.RefObject<HTMLTextAreaElement>\n /** Allows the user to resize the textarea horizontally. Not mapped in Figma. */\n horizontalResize?: boolean\n }\n\nexport const TextAreaField = ({\n showOptionalLabel,\n required,\n success,\n error,\n errorMessage,\n helpMessage,\n label,\n id,\n disabled,\n style,\n className,\n textAreaStyle,\n textareaRef,\n maxLength,\n horizontalResize,\n ...props\n}: TextAreaProps) => {\n return (\n <Field.Root\n style={style}\n customclass={className}\n success={success}\n error={error}\n disabled={disabled}>\n <Field.Label\n text={label}\n id={id}\n required={required}\n showOptionalLabel={showOptionalLabel}\n success={success}\n error={error}\n disabled={disabled}\n />\n <Field.TextArea\n id={id}\n textareaRef={textareaRef}\n disabled={disabled}\n style={textAreaStyle}\n maxLength={maxLength}\n horizontalResize={horizontalResize}\n {...props}\n />\n <Field.Message hasError={!!error} errorMessage={errorMessage} helpMessage={helpMessage} />\n </Field.Root>\n )\n}\n"],"names":[],"mappings":";;AAgBO,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAqB;AACnB,SACE;AAAA,IAAC,MAAM;AAAA,IAAN;AAAA,MACC;AAAA,MACA,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAA;AAAA,QAAA;AAAA,UAAC,MAAM;AAAA,UAAN;AAAA,YACC,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QAAA;AAAA,QAEF;AAAA,UAAC,MAAM;AAAA,UAAN;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACC,GAAG;AAAA,UAAA;AAAA,QAAA;AAAA,QAEN,oBAAC,MAAM,SAAN,EAAc,UAAU,CAAC,CAAC,OAAO,cAA4B,YAAA,CAA0B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG9F;"}
|
|
@@ -19,6 +19,7 @@ export type SelectFieldProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
19
19
|
register?: (instance: HTMLSelectElement | null) => void;
|
|
20
20
|
autocomplete?: boolean;
|
|
21
21
|
EmptyText?: string;
|
|
22
|
+
/** On mobile, opens the options list in a full-screen modal. Not mapped in Figma. */
|
|
22
23
|
fullScreenOptions?: boolean;
|
|
23
24
|
htmlType?: 'text' | 'number';
|
|
24
25
|
'data-testid'?: string;
|
|
@@ -7,6 +7,7 @@ export type TextAreaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> &
|
|
|
7
7
|
label?: string;
|
|
8
8
|
textAreaStyle?: React.CSSProperties;
|
|
9
9
|
textareaRef?: React.RefObject<HTMLTextAreaElement>;
|
|
10
|
+
/** Allows the user to resize the textarea horizontally. Not mapped in Figma. */
|
|
10
11
|
horizontalResize?: boolean;
|
|
11
12
|
};
|
|
12
13
|
export declare const TextAreaField: ({ showOptionalLabel, required, success, error, errorMessage, helpMessage, label, id, disabled, style, className, textAreaStyle, textareaRef, maxLength, horizontalResize, ...props }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,7 @@ var __commonJS = (cb, mod) => function __require() {
|
|
|
5
5
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
6
6
|
};
|
|
7
7
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
9
9
|
import * as $8WNJc$react from "react";
|
|
10
10
|
import $8WNJc$react__default from "react";
|
|
11
11
|
import ReactDOM from "react-dom";
|
|
@@ -2625,7 +2625,7 @@ var require_index_es = __commonJS({
|
|
|
2625
2625
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
2626
2626
|
var Element2 = REACT_ELEMENT_TYPE;
|
|
2627
2627
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
2628
|
-
var
|
|
2628
|
+
var Fragment2 = REACT_FRAGMENT_TYPE;
|
|
2629
2629
|
var Lazy = REACT_LAZY_TYPE;
|
|
2630
2630
|
var Memo = REACT_MEMO_TYPE;
|
|
2631
2631
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -2689,7 +2689,7 @@ var require_index_es = __commonJS({
|
|
|
2689
2689
|
reactIs_development$2.ContextProvider = ContextProvider;
|
|
2690
2690
|
reactIs_development$2.Element = Element2;
|
|
2691
2691
|
reactIs_development$2.ForwardRef = ForwardRef;
|
|
2692
|
-
reactIs_development$2.Fragment =
|
|
2692
|
+
reactIs_development$2.Fragment = Fragment2;
|
|
2693
2693
|
reactIs_development$2.Lazy = Lazy;
|
|
2694
2694
|
reactIs_development$2.Memo = Memo;
|
|
2695
2695
|
reactIs_development$2.Portal = Portal;
|
|
@@ -18998,7 +18998,7 @@ var require_index_es = __commonJS({
|
|
|
18998
18998
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
18999
18999
|
var Element2 = REACT_ELEMENT_TYPE;
|
|
19000
19000
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
19001
|
-
var
|
|
19001
|
+
var Fragment2 = REACT_FRAGMENT_TYPE;
|
|
19002
19002
|
var Lazy = REACT_LAZY_TYPE;
|
|
19003
19003
|
var Memo = REACT_MEMO_TYPE;
|
|
19004
19004
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -19066,7 +19066,7 @@ var require_index_es = __commonJS({
|
|
|
19066
19066
|
reactIs_development.ContextProvider = ContextProvider;
|
|
19067
19067
|
reactIs_development.Element = Element2;
|
|
19068
19068
|
reactIs_development.ForwardRef = ForwardRef;
|
|
19069
|
-
reactIs_development.Fragment =
|
|
19069
|
+
reactIs_development.Fragment = Fragment2;
|
|
19070
19070
|
reactIs_development.Lazy = Lazy;
|
|
19071
19071
|
reactIs_development.Memo = Memo;
|
|
19072
19072
|
reactIs_development.Portal = Portal;
|
|
@@ -36158,6 +36158,24 @@ To automatically clean-up native timers, use \`shouldClearNativeTimers\`.`
|
|
|
36158
36158
|
el.click();
|
|
36159
36159
|
globalExpect(onClick).toHaveBeenCalled();
|
|
36160
36160
|
});
|
|
36161
|
+
it("namespaces svg ids per instance so two icons never share defs", () => {
|
|
36162
|
+
const markup2 = "<svg><defs><linearGradient id='grad'><stop stop-color='currentColor'/></linearGradient></defs><path fill='url(#grad)'/></svg>";
|
|
36163
|
+
render(
|
|
36164
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36165
|
+
/* @__PURE__ */ jsx(Icon, { markup: markup2, name: "A" }),
|
|
36166
|
+
/* @__PURE__ */ jsx(Icon, { markup: markup2, name: "B" })
|
|
36167
|
+
] })
|
|
36168
|
+
);
|
|
36169
|
+
const gradients = document.querySelectorAll("linearGradient");
|
|
36170
|
+
const paths = document.querySelectorAll("path");
|
|
36171
|
+
globalExpect(gradients).toHaveLength(2);
|
|
36172
|
+
const idA = gradients[0].getAttribute("id");
|
|
36173
|
+
const idB = gradients[1].getAttribute("id");
|
|
36174
|
+
globalExpect(idA).not.toBe("grad");
|
|
36175
|
+
globalExpect(idA).not.toBe(idB);
|
|
36176
|
+
globalExpect(paths[0].getAttribute("fill")).toBe(`url(#${idA})`);
|
|
36177
|
+
globalExpect(paths[1].getAttribute("fill")).toBe(`url(#${idB})`);
|
|
36178
|
+
});
|
|
36161
36179
|
});
|
|
36162
36180
|
}
|
|
36163
36181
|
});
|