@situaction/traq-ui-ste 1.1.18 → 1.1.20
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/accordion/Accordion.d.ts +4 -0
- package/dist/components/accordion/Accordion.js +12 -8
- package/dist/components/accordion/item/AccordionItem.d.ts +2 -0
- package/dist/components/accordion/item/AccordionItem.js +35 -26
- package/dist/components/calendar/Calendar.d.ts +4 -0
- package/dist/components/calendar/Calendar.js +435 -435
- package/dist/components/icon/Icon.d.ts +2 -1
- package/dist/components/menu/Menu.js +56 -56
- package/dist/components/panel/side-panel/SidePanel.js +34 -34
- package/dist/components/select/Select.js +36 -36
- package/dist/components/tabs/Tabs.js +51 -46
- package/dist/styles/Menu.css +1 -1
- package/dist/styles/Select.css +1 -1
- package/dist/styles/SidePanel.css +1 -1
- package/dist/styles/Tabs.css +1 -1
- package/package.json +1 -1
|
@@ -12,6 +12,10 @@ export interface AccordionProps {
|
|
|
12
12
|
defaultOpen?: boolean;
|
|
13
13
|
/** The content displayed when the accordion item is expanded. */
|
|
14
14
|
content: ReactNode;
|
|
15
|
+
/** ID accordions items*/
|
|
16
|
+
id: string;
|
|
17
|
+
/** Function to handle click on the header */
|
|
18
|
+
onClickHeader?: (id: string) => void;
|
|
15
19
|
}[];
|
|
16
20
|
/** Accordion style if block type the header and the content are in the same block, if it is tile they are separated into 2 blocks */
|
|
17
21
|
type?: 'block' | 'tile';
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { AccordionItem as i } from "./item/AccordionItem.js";
|
|
3
|
-
import '../../styles/Accordion.css';const
|
|
4
|
-
accordion:
|
|
5
|
-
},
|
|
3
|
+
import '../../styles/Accordion.css';const l = "_accordion_hz3a1_6", s = {
|
|
4
|
+
accordion: l
|
|
5
|
+
}, h = ({ items: r, type: d = "block", paddingHeader: a }) => /* @__PURE__ */ n("div", { className: s.accordion, children: r.map((o, e) => /* @__PURE__ */ n(
|
|
6
6
|
i,
|
|
7
7
|
{
|
|
8
8
|
header: o.header,
|
|
9
9
|
iconPosition: o.iconPosition ?? "right",
|
|
10
10
|
defaultOpen: o.defaultOpen ?? !1,
|
|
11
|
-
type:
|
|
12
|
-
paddingHeader:
|
|
11
|
+
type: d ?? "block",
|
|
12
|
+
paddingHeader: a ?? "m",
|
|
13
|
+
onClickHeader: () => {
|
|
14
|
+
var c;
|
|
15
|
+
return (c = o.onClickHeader) == null ? void 0 : c.call(o, o.id);
|
|
16
|
+
},
|
|
13
17
|
children: o.content
|
|
14
18
|
},
|
|
15
|
-
|
|
19
|
+
e
|
|
16
20
|
)) });
|
|
17
21
|
export {
|
|
18
|
-
|
|
22
|
+
h as Accordion
|
|
19
23
|
};
|
|
@@ -14,6 +14,8 @@ interface AccordionItemProps {
|
|
|
14
14
|
type?: 'block' | 'tile';
|
|
15
15
|
/** Padding size inside the Accordion: small, medium, large */
|
|
16
16
|
paddingHeader?: Size;
|
|
17
|
+
/** Click handler on the padding header (outside of IconButtons) */
|
|
18
|
+
onClickHeader?: () => void;
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* AccordionItem component represents an individual item in an accordion.
|
|
@@ -1,52 +1,61 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { IconButton as
|
|
4
|
-
import '../../../styles/AccordionItem.css';const
|
|
5
|
-
accordionHeader:
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p, useEffect as m } from "react";
|
|
3
|
+
import { IconButton as n } from "../../icon-button/IconButton.js";
|
|
4
|
+
import '../../../styles/AccordionItem.css';const u = "_accordionHeader_1tsuj_7", f = "_title_1tsuj_31", v = "_fullHeight_1tsuj_36", x = "_block_1tsuj_40", j = "_tile_1tsuj_48", l = {
|
|
5
|
+
accordionHeader: u,
|
|
6
6
|
"padding-s": "_padding-s_1tsuj_15",
|
|
7
7
|
"padding-m": "_padding-m_1tsuj_19",
|
|
8
8
|
"padding-l": "_padding-l_1tsuj_23",
|
|
9
9
|
"padding-xl": "_padding-xl_1tsuj_27",
|
|
10
|
-
title:
|
|
11
|
-
fullHeight:
|
|
12
|
-
block:
|
|
13
|
-
tile:
|
|
14
|
-
},
|
|
15
|
-
header:
|
|
16
|
-
children:
|
|
10
|
+
title: f,
|
|
11
|
+
fullHeight: v,
|
|
12
|
+
block: x,
|
|
13
|
+
tile: j
|
|
14
|
+
}, H = ({
|
|
15
|
+
header: r,
|
|
16
|
+
children: g,
|
|
17
17
|
iconPosition: d = "right",
|
|
18
|
-
defaultOpen:
|
|
18
|
+
defaultOpen: s = !1,
|
|
19
19
|
type: h = "block",
|
|
20
|
-
paddingHeader:
|
|
20
|
+
paddingHeader: _ = "m",
|
|
21
|
+
onClickHeader: e
|
|
21
22
|
}) => {
|
|
22
|
-
const [i,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
|
|
23
|
+
const [i, o] = p(!1);
|
|
24
|
+
m(() => {
|
|
25
|
+
s && o(s);
|
|
26
|
+
}, [s]);
|
|
27
|
+
const w = (a) => {
|
|
28
|
+
if (a.target.closest("button")) {
|
|
29
|
+
a.stopPropagation();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
e == null || e();
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ c("div", { className: `${h === "tile" ? l.tile : l.block}`, children: [
|
|
35
|
+
/* @__PURE__ */ c("div", { className: `${l.accordionHeader} ${l[`padding-${_}`]}`, onClick: w, "data-ignore-outside-click": !0, children: [
|
|
27
36
|
d === "left" && /* @__PURE__ */ t(
|
|
28
|
-
|
|
37
|
+
n,
|
|
29
38
|
{
|
|
30
39
|
mode: "ghost",
|
|
31
40
|
size: "s",
|
|
32
|
-
onClick: () =>
|
|
41
|
+
onClick: () => o(!i),
|
|
33
42
|
children: i ? /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ t("path", { d: "M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z" }) }) : /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ t("path", { d: "M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z" }) })
|
|
34
43
|
}
|
|
35
44
|
),
|
|
36
|
-
/* @__PURE__ */ t("div", { className: l.title, children:
|
|
45
|
+
/* @__PURE__ */ t("div", { className: l.title, children: r }),
|
|
37
46
|
d === "right" && /* @__PURE__ */ t(
|
|
38
|
-
|
|
47
|
+
n,
|
|
39
48
|
{
|
|
40
49
|
mode: "ghost",
|
|
41
50
|
size: "s",
|
|
42
|
-
onClick: () =>
|
|
51
|
+
onClick: () => o(!i),
|
|
43
52
|
children: i ? /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ t("path", { d: "M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z" }) }) : /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ t("path", { d: "M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z" }) })
|
|
44
53
|
}
|
|
45
54
|
)
|
|
46
55
|
] }),
|
|
47
|
-
i &&
|
|
56
|
+
i && g
|
|
48
57
|
] });
|
|
49
58
|
};
|
|
50
59
|
export {
|
|
51
|
-
|
|
60
|
+
H as AccordionItem
|
|
52
61
|
};
|
|
@@ -13,6 +13,10 @@ export interface CalendarProps {
|
|
|
13
13
|
start: Date;
|
|
14
14
|
end: Date;
|
|
15
15
|
}) => void;
|
|
16
|
+
/** Maximum date allowed by the selection */
|
|
17
|
+
maxDateSelected?: Date;
|
|
18
|
+
/** Minimum date allowed by the selection */
|
|
19
|
+
minDateSelected?: Date;
|
|
16
20
|
}
|
|
17
21
|
/**
|
|
18
22
|
* Calendar component that renders a month view for selecting dates.
|