@situaction/traq-ui-ste 1.1.4 → 1.1.6

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.
@@ -0,0 +1,26 @@
1
+ import { FC, ReactNode } from 'react';
2
+
3
+ export interface AccordionProps {
4
+ /** An array of accordion items, each containing a header, content, and optional settings. */
5
+ items: {
6
+ /** The header content of the accordion item. */
7
+ header: ReactNode;
8
+ /** Defines the position of the icon, either on the left or right of the header. */
9
+ iconPosition?: "left" | "right";
10
+ /** Determines whether the accordion item should be open by default (true) or closed (false). */
11
+ defaultOpen?: boolean;
12
+ /** The content displayed when the accordion item is expanded. */
13
+ content: ReactNode;
14
+ }[];
15
+ /** 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
+ type?: 'block' | 'tile';
17
+ }
18
+ /**
19
+ * Accordion component that displays a list of AccordionItem components.
20
+ * Each AccordionItem can be expanded or collapsed.
21
+ * The Accordion takes an array of items to render each item with its header and content.
22
+ *
23
+ * @param {AccordionProps} props - The props for the Accordion component.
24
+ * @returns {JSX.Element} The rendered Accordion component.
25
+ */
26
+ export declare const Accordion: FC<AccordionProps>;
@@ -0,0 +1,18 @@
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_1soy0_6", d = {
4
+ accordion: t
5
+ }, l = ({ items: n, type: r = "block" }) => /* @__PURE__ */ c("div", { className: d.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
+ )) });
16
+ export {
17
+ l as Accordion
18
+ };
@@ -0,0 +1,25 @@
1
+ import { FC, ReactNode } from 'react';
2
+
3
+ interface AccordionItemProps {
4
+ /** The header content of the accordion item. */
5
+ header: ReactNode;
6
+ /** The content displayed when the accordion is expanded. */
7
+ children: ReactNode;
8
+ /** Defines the position of the icon, either on the left or right of the header. */
9
+ iconPosition?: "left" | "right";
10
+ /** Determines whether the accordion should be open by default (true) or closed (false). */
11
+ defaultOpen?: boolean;
12
+ /** 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
+ type?: 'block' | 'tile';
14
+ }
15
+ /**
16
+ * AccordionItem component represents an individual item in an accordion.
17
+ * It can be opened and closed, showing or hiding its content.
18
+ * The icon can be positioned either to the left or right of the header.
19
+ * The item can also be set to be open by default.
20
+ *
21
+ * @param {AccordionItemProps} props - The props for the AccordionItem component.
22
+ * @returns {JSX.Element} The rendered AccordionItem component.
23
+ */
24
+ export declare const AccordionItem: FC<AccordionItemProps>;
25
+ export {};
@@ -0,0 +1,48 @@
1
+ import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
+ import { useState as a, useEffect as g } from "react";
3
+ import { IconButton as n } from "../../icon-button/IconButton.js";
4
+ import '../../../styles/AccordionItem.css';const w = "_accordionHeader_zfdov_7", v = "_title_zfdov_16", f = "_accordionContent_zfdov_21", _ = "_fullHeight_zfdov_27", m = "_block_zfdov_31", p = "_tile_zfdov_39", l = {
5
+ accordionHeader: w,
6
+ title: v,
7
+ accordionContent: f,
8
+ fullHeight: _,
9
+ block: m,
10
+ tile: p
11
+ }, k = ({
12
+ header: d,
13
+ children: h,
14
+ iconPosition: c = "right",
15
+ defaultOpen: e = !1,
16
+ type: r = "block"
17
+ }) => {
18
+ const [o, i] = a(!1);
19
+ return g(() => {
20
+ e && i(e);
21
+ }, [e]), /* @__PURE__ */ s("div", { className: `${o && l.fullHeight} ${r === "tile" ? l.tile : l.block}`, children: [
22
+ /* @__PURE__ */ s("div", { className: l.accordionHeader, children: [
23
+ c === "left" && /* @__PURE__ */ t(
24
+ n,
25
+ {
26
+ mode: "ghost",
27
+ size: "s",
28
+ onClick: () => i(!o),
29
+ children: o ? /* @__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
+ }
31
+ ),
32
+ /* @__PURE__ */ t("div", { className: l.title, children: d }),
33
+ c === "right" && /* @__PURE__ */ t(
34
+ n,
35
+ {
36
+ mode: "ghost",
37
+ size: "s",
38
+ onClick: () => i(!o),
39
+ children: o ? /* @__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
+ }
41
+ )
42
+ ] }),
43
+ o && /* @__PURE__ */ t("div", { className: l.accordionContent, children: h })
44
+ ] });
45
+ };
46
+ export {
47
+ k as AccordionItem
48
+ };
@@ -1,56 +1,56 @@
1
- import { jsxs as d, jsx as n } from "react/jsx-runtime";
2
- import '../../styles/Button.css';const i = "_button_vdgnu_23", p = "_flexHorizontalCenter_vdgnu_184", t = {
3
- button: i,
4
- "button-primary": "_button-primary_vdgnu_47",
5
- "button-secondary": "_button-secondary_vdgnu_61",
6
- "button-tertiary": "_button-tertiary_vdgnu_77",
7
- "button-ghost": "_button-ghost_vdgnu_93",
8
- "button-text": "_button-text_vdgnu_109",
9
- "button-text-selected": "_button-text-selected_vdgnu_122",
10
- "button-error": "_button-error_vdgnu_128",
11
- "button-size-xl": "_button-size-xl_vdgnu_141",
12
- "button-size-l": "_button-size-l_vdgnu_147",
13
- "button-size-m": "_button-size-m_vdgnu_153",
14
- "button-size-s": "_button-size-s_vdgnu_159",
15
- "button-size-menu": "_button-size-menu_vdgnu_165",
16
- "button-gap-menu": "_button-gap-menu_vdgnu_171",
17
- "button-gap-xl": "_button-gap-xl_vdgnu_174",
18
- "button-gap-l": "_button-gap-l_vdgnu_177",
19
- "button-gap-m": "_button-gap-m_vdgnu_171",
20
- "button-gap-s": "_button-gap-s_vdgnu_180",
21
- flexHorizontalCenter: p
22
- }, x = ({
1
+ import { jsxs as p, jsx as n } from "react/jsx-runtime";
2
+ import '../../styles/Button.css';const v = "_button_wt8sv_23", w = "_flexHorizontalCenter_wt8sv_184", t = {
3
+ button: v,
4
+ "button-primary": "_button-primary_wt8sv_47",
5
+ "button-secondary": "_button-secondary_wt8sv_61",
6
+ "button-tertiary": "_button-tertiary_wt8sv_77",
7
+ "button-ghost": "_button-ghost_wt8sv_93",
8
+ "button-text": "_button-text_wt8sv_109",
9
+ "button-text-selected": "_button-text-selected_wt8sv_122",
10
+ "button-error": "_button-error_wt8sv_128",
11
+ "button-size-xl": "_button-size-xl_wt8sv_141",
12
+ "button-size-l": "_button-size-l_wt8sv_147",
13
+ "button-size-m": "_button-size-m_wt8sv_153",
14
+ "button-size-s": "_button-size-s_wt8sv_159",
15
+ "button-size-menu": "_button-size-menu_wt8sv_165",
16
+ "button-gap-menu": "_button-gap-menu_wt8sv_171",
17
+ "button-gap-xl": "_button-gap-xl_wt8sv_174",
18
+ "button-gap-l": "_button-gap-l_wt8sv_177",
19
+ "button-gap-m": "_button-gap-m_wt8sv_171",
20
+ "button-gap-s": "_button-gap-s_wt8sv_180",
21
+ flexHorizontalCenter: w
22
+ }, m = ({
23
23
  mode: o = "primary",
24
- size: u = "m",
25
- label: b,
26
- error: s,
24
+ size: e = "m",
25
+ label: u,
26
+ error: b,
27
27
  selected: r,
28
- childrenLeft: e,
28
+ childrenLeft: s,
29
29
  childrenRight: _,
30
30
  ...a
31
31
  }) => {
32
- const l = () => s ? "error" : o, g = [
32
+ const l = () => b ? "error" : o, i = [
33
33
  t.button,
34
34
  t[`button-${l()}`],
35
- t[`button-size-${u}`],
36
- t[`button-gap-${u}`],
35
+ t[`button-size-${e}`],
36
+ t[`button-gap-${e}`],
37
37
  r && o === "text" && t["button-text-selected"],
38
38
  t.flexHorizontalCenter
39
39
  ].filter(Boolean).join(" ");
40
- return /* @__PURE__ */ d(
40
+ return /* @__PURE__ */ p(
41
41
  "button",
42
42
  {
43
43
  type: "button",
44
- className: g,
44
+ className: i,
45
45
  ...a,
46
46
  children: [
47
- e && /* @__PURE__ */ n("span", { className: t.flexHorizontalCenter, children: e }),
48
- /* @__PURE__ */ n("span", { children: b }),
47
+ s && /* @__PURE__ */ n("span", { className: t.flexHorizontalCenter, children: s }),
48
+ /* @__PURE__ */ n("span", { children: u }),
49
49
  _ && /* @__PURE__ */ n("span", { className: t.flexHorizontalCenter, children: _ })
50
50
  ]
51
51
  }
52
52
  );
53
53
  };
54
54
  export {
55
- x as Button
55
+ m as Button
56
56
  };
@@ -0,0 +1,17 @@
1
+ import { FC } from 'react';
2
+
3
+ export interface CalendarProps {
4
+ /** Whether the date range selection is enabled */
5
+ selectRange?: boolean;
6
+ /** The currently selected date or a range of dates */
7
+ selectedDate?: Date | {
8
+ start: Date;
9
+ end: Date;
10
+ };
11
+ /** Callback to return the selected date or date range */
12
+ onDateSelect: (date: Date | {
13
+ start: Date;
14
+ end: Date;
15
+ }) => void;
16
+ }
17
+ export declare const Calendar: FC<CalendarProps>;