@situaction/traq-ui-ste 1.1.19 → 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.
@@ -12,13 +12,15 @@ 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';
18
22
  /** Padding size inside the Accordion: small, medium, large */
19
23
  paddingHeader?: Size;
20
- /** Function to handle click on the header */
21
- onClickHeader?: (index: number) => void;
22
24
  }
23
25
  /**
24
26
  * Accordion component that displays a list of AccordionItem components.
@@ -1,25 +1,23 @@
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
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { AccordionItem as i } from "./item/AccordionItem.js";
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
+ i,
7
+ {
8
+ header: o.header,
9
+ iconPosition: o.iconPosition ?? "right",
10
+ defaultOpen: o.defaultOpen ?? !1,
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);
19
16
  },
20
- n
21
- )) });
22
- };
17
+ children: o.content
18
+ },
19
+ e
20
+ )) });
23
21
  export {
24
- f as Accordion
22
+ h as Accordion
25
23
  };
@@ -1,6 +1,6 @@
1
- import { jsxs as n, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
2
  import { useState as p, useEffect as m } from "react";
3
- import { IconButton as c } from "../../icon-button/IconButton.js";
3
+ import { IconButton as n } from "../../icon-button/IconButton.js";
4
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
5
  accordionHeader: u,
6
6
  "padding-s": "_padding-s_1tsuj_15",
@@ -12,11 +12,11 @@ import '../../../styles/AccordionItem.css';const u = "_accordionHeader_1tsuj_7",
12
12
  block: x,
13
13
  tile: j
14
14
  }, H = ({
15
- header: h,
15
+ header: r,
16
16
  children: g,
17
17
  iconPosition: d = "right",
18
18
  defaultOpen: s = !1,
19
- type: r = "block",
19
+ type: h = "block",
20
20
  paddingHeader: _ = "m",
21
21
  onClickHeader: e
22
22
  }) => {
@@ -31,10 +31,10 @@ import '../../../styles/AccordionItem.css';const u = "_accordionHeader_1tsuj_7",
31
31
  }
32
32
  e == null || e();
33
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: [
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: [
36
36
  d === "left" && /* @__PURE__ */ t(
37
- c,
37
+ n,
38
38
  {
39
39
  mode: "ghost",
40
40
  size: "s",
@@ -42,9 +42,9 @@ import '../../../styles/AccordionItem.css';const u = "_accordionHeader_1tsuj_7",
42
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" }) })
43
43
  }
44
44
  ),
45
- /* @__PURE__ */ t("div", { className: l.title, children: h }),
45
+ /* @__PURE__ */ t("div", { className: l.title, children: r }),
46
46
  d === "right" && /* @__PURE__ */ t(
47
- c,
47
+ n,
48
48
  {
49
49
  mode: "ghost",
50
50
  size: "s",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@situaction/traq-ui-ste",
3
- "version": "1.1.19",
3
+ "version": "1.1.20",
4
4
  "description": "library react component Situaction",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",