@situaction/traq-ui-ste 1.1.17 → 1.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import { FC, ReactNode } from 'react';
2
+ import { Size } from '../interface';
2
3
 
3
4
  export interface AccordionProps {
4
5
  /** An array of accordion items, each containing a header, content, and optional settings. */
@@ -14,6 +15,10 @@ export interface AccordionProps {
14
15
  }[];
15
16
  /** 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 */
16
17
  type?: 'block' | 'tile';
18
+ /** Padding size inside the Accordion: small, medium, large */
19
+ paddingHeader?: Size;
20
+ /** Function to handle click on the header */
21
+ onClickHeader?: (index: number) => void;
17
22
  }
18
23
  /**
19
24
  * Accordion component that displays a list of AccordionItem components.
@@ -1,18 +1,25 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { AccordionItem as i } from "./item/AccordionItem.js";
3
- import '../../styles/Accordion.css';const t = "_accordion_hz3a1_6", a = {
4
- accordion: t
5
- }, l = ({ items: n, type: r = "block" }) => /* @__PURE__ */ c("div", { className: a.accordion, children: n.map((o, e) => /* @__PURE__ */ c(
6
- i,
7
- {
8
- header: o.header,
9
- iconPosition: o.iconPosition ?? "right",
10
- defaultOpen: o.defaultOpen ?? !1,
11
- type: r ?? "block",
12
- children: o.content
13
- },
14
- e
15
- )) });
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { AccordionItem as t } from "./item/AccordionItem.js";
3
+ import '../../styles/Accordion.css';const s = "_accordion_hz3a1_6", l = {
4
+ accordion: s
5
+ }, f = ({ items: e, type: a = "block", paddingHeader: d, onClickHeader: c }) => {
6
+ const i = (o) => {
7
+ c && c(o);
8
+ };
9
+ return /* @__PURE__ */ r("div", { className: l.accordion, children: e.map((o, n) => /* @__PURE__ */ r(
10
+ t,
11
+ {
12
+ header: o.header,
13
+ iconPosition: o.iconPosition ?? "right",
14
+ defaultOpen: o.defaultOpen ?? !1,
15
+ type: a ?? "block",
16
+ paddingHeader: d ?? "m",
17
+ onClickHeader: () => i(n),
18
+ children: o.content
19
+ },
20
+ n
21
+ )) });
22
+ };
16
23
  export {
17
- l as Accordion
24
+ f as Accordion
18
25
  };
@@ -1,4 +1,5 @@
1
1
  import { FC, ReactNode } from 'react';
2
+ import { Size } from '../../interface';
2
3
 
3
4
  interface AccordionItemProps {
4
5
  /** The header content of the accordion item. */
@@ -11,6 +12,10 @@ interface AccordionItemProps {
11
12
  defaultOpen?: boolean;
12
13
  /** 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 */
13
14
  type?: 'block' | 'tile';
15
+ /** Padding size inside the Accordion: small, medium, large */
16
+ paddingHeader?: Size;
17
+ /** Click handler on the padding header (outside of IconButtons) */
18
+ onClickHeader?: () => void;
14
19
  }
15
20
  /**
16
21
  * AccordionItem component represents an individual item in an accordion.
@@ -1,46 +1,59 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import { useState as d, useEffect as w } from "react";
3
- import { IconButton as n } from "../../icon-button/IconButton.js";
4
- import '../../../styles/AccordionItem.css';const g = "_accordionHeader_e4xbv_7", v = "_title_e4xbv_16", _ = "_accordionContent_e4xbv_21", m = "_fullHeight_e4xbv_26", x = "_block_e4xbv_30", f = "_tile_e4xbv_38", l = {
5
- accordionHeader: g,
6
- title: v,
7
- accordionContent: _,
8
- fullHeight: m,
1
+ import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
+ import { useState as p, useEffect as m } from "react";
3
+ import { IconButton as c } 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
+ "padding-s": "_padding-s_1tsuj_15",
7
+ "padding-m": "_padding-m_1tsuj_19",
8
+ "padding-l": "_padding-l_1tsuj_23",
9
+ "padding-xl": "_padding-xl_1tsuj_27",
10
+ title: f,
11
+ fullHeight: v,
9
12
  block: x,
10
- tile: f
13
+ tile: j
11
14
  }, H = ({
12
- header: r,
13
- children: h,
14
- iconPosition: c = "right",
15
- defaultOpen: i = !1,
16
- type: a = "block"
15
+ header: h,
16
+ children: g,
17
+ iconPosition: d = "right",
18
+ defaultOpen: s = !1,
19
+ type: r = "block",
20
+ paddingHeader: _ = "m",
21
+ onClickHeader: e
17
22
  }) => {
18
- const [e, o] = d(!1);
19
- return w(() => {
20
- i && o(i);
21
- }, [i]), /* @__PURE__ */ s("div", { className: `${a === "tile" ? l.tile : l.block}`, children: [
22
- /* @__PURE__ */ s("div", { className: l.accordionHeader, children: [
23
- c === "left" && /* @__PURE__ */ t(
24
- n,
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__ */ n("div", { className: `${r === "tile" ? l.tile : l.block}`, children: [
35
+ /* @__PURE__ */ n("div", { className: `${l.accordionHeader} ${l[`padding-${_}`]}`, onClick: w, children: [
36
+ d === "left" && /* @__PURE__ */ t(
37
+ c,
25
38
  {
26
39
  mode: "ghost",
27
40
  size: "s",
28
- onClick: () => o(!e),
29
- children: e ? /* @__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" }) })
41
+ onClick: () => o(!i),
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" }) })
30
43
  }
31
44
  ),
32
- /* @__PURE__ */ t("div", { className: l.title, children: r }),
33
- c === "right" && /* @__PURE__ */ t(
34
- n,
45
+ /* @__PURE__ */ t("div", { className: l.title, children: h }),
46
+ d === "right" && /* @__PURE__ */ t(
47
+ c,
35
48
  {
36
49
  mode: "ghost",
37
50
  size: "s",
38
- onClick: () => o(!e),
39
- children: e ? /* @__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" }) })
51
+ onClick: () => o(!i),
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" }) })
40
53
  }
41
54
  )
42
55
  ] }),
43
- e && /* @__PURE__ */ t("div", { className: l.accordionContent, children: h })
56
+ i && g
44
57
  ] });
45
58
  };
46
59
  export {
@@ -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.