@situaction/traq-ui-ste 1.2.20 → 1.2.24
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/Carousel.module-RC3aC2Nl.mjs +22 -0
- package/dist/components/accordion/Accordion.d.ts +27 -3
- package/dist/components/accordion/Accordion.js +56 -21
- package/dist/components/accordion/item/AccordionItem.d.ts +9 -1
- package/dist/components/accordion/item/AccordionItem.js +60 -54
- package/dist/components/carousel/Carousel.js +170 -180
- package/dist/components/carousel/FadeCarousel.d.ts +29 -0
- package/dist/components/carousel/FadeCarousel.js +195 -0
- package/dist/components/list/list-controls/ListControls.js +12 -10
- package/dist/components/list/nested-list/NestedList.js +10 -8
- package/dist/components/list/nested-list/item/NestedListItem.js +4 -2
- package/dist/components/menu/Menu.js +21 -19
- package/dist/components/panel/side-panel-header/SidePanelHeader.js +4 -2
- package/dist/components/select/Select.js +4 -2
- package/dist/components/select-filter-input-tags/SelectFilterInputTags.js +11 -9
- package/dist/components/select-multi-items/SelectMultiItems.js +11 -9
- package/dist/components/switch/Switch.js +13 -11
- package/dist/main.d.ts +1 -0
- package/dist/main.js +19 -17
- package/dist/styles/AccordionItem.css +1 -1
- package/dist/styles/Carousel.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import './styles/Carousel.css';const n = "_root_vqc19_6", t = "_viewport_vqc19_11", e = "_dragEnabled_vqc19_31", _ = "_dragging_vqc19_36", a = "_slide_vqc19_43", c = "_navButtonCtn_vqc19_50", o = "_navButton_vqc19_50", v = "_defaultBtn_vqc19_68", d = "_navPrev_vqc19_85", i = "_navNext_vqc19_90", s = "_fadeViewport_vqc19_95", f = "_fadeSlide_vqc19_102", g = "_fadeActive_vqc19_110", r = "_fadeOutgoing_vqc19_115", q = "_fadeIncoming_vqc19_119", u = "_fadeRunning_vqc19_123", l = "_fadeInteractive_vqc19_131", B = {
|
|
2
|
+
root: n,
|
|
3
|
+
viewport: t,
|
|
4
|
+
dragEnabled: e,
|
|
5
|
+
dragging: _,
|
|
6
|
+
slide: a,
|
|
7
|
+
navButtonCtn: c,
|
|
8
|
+
navButton: o,
|
|
9
|
+
defaultBtn: v,
|
|
10
|
+
navPrev: d,
|
|
11
|
+
navNext: i,
|
|
12
|
+
fadeViewport: s,
|
|
13
|
+
fadeSlide: f,
|
|
14
|
+
fadeActive: g,
|
|
15
|
+
fadeOutgoing: r,
|
|
16
|
+
fadeIncoming: q,
|
|
17
|
+
fadeRunning: u,
|
|
18
|
+
fadeInteractive: l
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
B as s
|
|
22
|
+
};
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { Size } from '../interface';
|
|
3
3
|
|
|
4
|
+
export interface AccordionHandle {
|
|
5
|
+
/** Open a specific item by id */
|
|
6
|
+
open: (id: string) => void;
|
|
7
|
+
/** Close a specific item by id */
|
|
8
|
+
close: (id: string) => void;
|
|
9
|
+
/** Toggle a specific item by id */
|
|
10
|
+
toggle: (id: string) => void;
|
|
11
|
+
/** Close all items */
|
|
12
|
+
closeAll: () => void;
|
|
13
|
+
/** Open only one item (close others) */
|
|
14
|
+
openOnly: (id: string) => void;
|
|
15
|
+
/** Get currently open ids */
|
|
16
|
+
getOpenIds: () => string[];
|
|
17
|
+
}
|
|
4
18
|
export interface AccordionProps {
|
|
5
19
|
/** An array of accordion items, each containing a header, content, and optional settings. */
|
|
6
20
|
items: {
|
|
@@ -18,9 +32,19 @@ export interface AccordionProps {
|
|
|
18
32
|
onClickHeader?: (id: string) => void;
|
|
19
33
|
}[];
|
|
20
34
|
/** 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 */
|
|
21
|
-
type?:
|
|
35
|
+
type?: "block" | "tile";
|
|
22
36
|
/** Padding size inside the Accordion: small, medium, large */
|
|
23
37
|
paddingHeader?: Size;
|
|
38
|
+
/** If true, clicking anywhere on the header (excluding buttons) toggles the content */
|
|
39
|
+
toggleOnHeaderClick?: boolean;
|
|
40
|
+
/** Visual mode for all accordion items */
|
|
41
|
+
mode?: "primary" | "secondary";
|
|
42
|
+
/** If true, only one item can be open at a time */
|
|
43
|
+
singleOpen?: boolean;
|
|
44
|
+
/** Controlled open ids (optional) */
|
|
45
|
+
openItemIds?: string[];
|
|
46
|
+
/** Controlled change callback */
|
|
47
|
+
onOpenItemIdsChange?: (ids: string[]) => void;
|
|
24
48
|
}
|
|
25
49
|
/**
|
|
26
50
|
* Accordion component that displays a list of AccordionItem components.
|
|
@@ -30,4 +54,4 @@ export interface AccordionProps {
|
|
|
30
54
|
* @param {AccordionProps} props - The props for the Accordion component.
|
|
31
55
|
* @returns {JSX.Element} The rendered Accordion component.
|
|
32
56
|
*/
|
|
33
|
-
export declare const Accordion:
|
|
57
|
+
export declare const Accordion: import('react').ForwardRefExoticComponent<AccordionProps & import('react').RefAttributes<AccordionHandle>>;
|
|
@@ -1,23 +1,58 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
))
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as x, useMemo as P, useState as j, useImperativeHandle as w } from "react";
|
|
3
|
+
import { AccordionItem as z } from "./item/AccordionItem.js";
|
|
4
|
+
import '../../styles/Accordion.css';const M = "_accordion_hz3a1_6", N = {
|
|
5
|
+
accordion: M
|
|
6
|
+
}, q = x(
|
|
7
|
+
({
|
|
8
|
+
items: s,
|
|
9
|
+
type: u = "block",
|
|
10
|
+
paddingHeader: O = "m",
|
|
11
|
+
toggleOnHeaderClick: g = !1,
|
|
12
|
+
mode: k = "primary",
|
|
13
|
+
singleOpen: y = !1,
|
|
14
|
+
openItemIds: t,
|
|
15
|
+
onOpenItemIdsChange: l
|
|
16
|
+
}, H) => {
|
|
17
|
+
const i = t !== void 0, v = P(() => s.filter((o) => o.defaultOpen).map((o) => o.id), [s]), [A, _] = j(v), r = i ? t ?? [] : A, c = (o) => {
|
|
18
|
+
i ? l == null || l(o) : _(o);
|
|
19
|
+
}, e = (o) => r.includes(o), a = (o) => {
|
|
20
|
+
if (e(o)) return;
|
|
21
|
+
const n = y ? [o] : [...r, o];
|
|
22
|
+
c(n);
|
|
23
|
+
}, d = (o) => {
|
|
24
|
+
e(o) && c(r.filter((n) => n !== o));
|
|
25
|
+
}, p = (o) => {
|
|
26
|
+
e(o) ? d(o) : a(o);
|
|
27
|
+
}, b = () => c([]), h = (o) => c([o]);
|
|
28
|
+
return w(H, () => ({
|
|
29
|
+
open: a,
|
|
30
|
+
close: d,
|
|
31
|
+
toggle: p,
|
|
32
|
+
closeAll: b,
|
|
33
|
+
openOnly: h,
|
|
34
|
+
getOpenIds: () => [...r]
|
|
35
|
+
})), /* @__PURE__ */ f("div", { className: N.accordion, children: s.map((o) => /* @__PURE__ */ f(
|
|
36
|
+
z,
|
|
37
|
+
{
|
|
38
|
+
header: o.header,
|
|
39
|
+
iconPosition: o.iconPosition ?? "right",
|
|
40
|
+
type: u ?? "block",
|
|
41
|
+
paddingHeader: O ?? "m",
|
|
42
|
+
toggleOnHeaderClick: g ?? !1,
|
|
43
|
+
mode: k ?? "primary",
|
|
44
|
+
open: e(o.id),
|
|
45
|
+
onToggle: () => p(o.id),
|
|
46
|
+
onClickHeader: () => {
|
|
47
|
+
var n;
|
|
48
|
+
return (n = o.onClickHeader) == null ? void 0 : n.call(o, o.id);
|
|
49
|
+
},
|
|
50
|
+
children: o.content
|
|
51
|
+
},
|
|
52
|
+
o.id
|
|
53
|
+
)) });
|
|
54
|
+
}
|
|
55
|
+
);
|
|
21
56
|
export {
|
|
22
|
-
|
|
57
|
+
q as Accordion
|
|
23
58
|
};
|
|
@@ -11,11 +11,19 @@ interface AccordionItemProps {
|
|
|
11
11
|
/** Determines whether the accordion should be open by default (true) or closed (false). */
|
|
12
12
|
defaultOpen?: boolean;
|
|
13
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 */
|
|
14
|
-
type?:
|
|
14
|
+
type?: "block" | "tile";
|
|
15
15
|
/** Padding size inside the Accordion: small, medium, large */
|
|
16
16
|
paddingHeader?: Size;
|
|
17
17
|
/** Click handler on the padding header (outside of IconButtons) */
|
|
18
18
|
onClickHeader?: () => void;
|
|
19
|
+
/** If true, clicking anywhere on the header (excluding buttons) toggles the content */
|
|
20
|
+
toggleOnHeaderClick?: boolean;
|
|
21
|
+
/** Visual mode for the accordion item */
|
|
22
|
+
mode?: "primary" | "secondary";
|
|
23
|
+
/** Controlled open state (optional) */
|
|
24
|
+
open?: boolean;
|
|
25
|
+
/** Toggle callback used when open is controlled */
|
|
26
|
+
onToggle?: () => void;
|
|
19
27
|
}
|
|
20
28
|
/**
|
|
21
29
|
* AccordionItem component represents an individual item in an accordion.
|
|
@@ -1,61 +1,67 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { IconButton as
|
|
4
|
-
import '../../../styles/AccordionItem.css';const
|
|
5
|
-
accordionHeader:
|
|
6
|
-
"padding-s": "_padding-
|
|
7
|
-
"padding-m": "_padding-
|
|
8
|
-
"padding-l": "_padding-
|
|
9
|
-
"padding-xl": "_padding-
|
|
10
|
-
title:
|
|
11
|
-
fullHeight:
|
|
12
|
-
block:
|
|
13
|
-
tile:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as k, useEffect as y, useMemo as B } from "react";
|
|
3
|
+
import { IconButton as w } from "../../icon-button/IconButton.js";
|
|
4
|
+
import '../../../styles/AccordionItem.css';const O = "_accordionHeader_bor6q_7", A = "_title_bor6q_31", M = "_fullHeight_bor6q_36", H = "_block_bor6q_40", I = "_tile_bor6q_48", L = "_secondaryOpen_bor6q_56", e = {
|
|
5
|
+
accordionHeader: O,
|
|
6
|
+
"padding-s": "_padding-s_bor6q_15",
|
|
7
|
+
"padding-m": "_padding-m_bor6q_19",
|
|
8
|
+
"padding-l": "_padding-l_bor6q_23",
|
|
9
|
+
"padding-xl": "_padding-xl_bor6q_27",
|
|
10
|
+
title: A,
|
|
11
|
+
fullHeight: M,
|
|
12
|
+
block: H,
|
|
13
|
+
tile: I,
|
|
14
|
+
secondaryOpen: L
|
|
15
|
+
}, z = ({
|
|
16
|
+
header: m,
|
|
17
|
+
children: f,
|
|
18
|
+
iconPosition: a = "right",
|
|
19
|
+
defaultOpen: d = !1,
|
|
20
|
+
type: c = "block",
|
|
21
|
+
paddingHeader: b = "m",
|
|
22
|
+
onClickHeader: s,
|
|
23
|
+
toggleOnHeaderClick: v = !1,
|
|
24
|
+
mode: h = "primary",
|
|
25
|
+
open: g,
|
|
26
|
+
onToggle: r
|
|
22
27
|
}) => {
|
|
23
|
-
const [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
|
|
28
|
+
const l = g !== void 0, [u, _] = k(!1);
|
|
29
|
+
y(() => {
|
|
30
|
+
l || _(!!d);
|
|
31
|
+
}, [d, l]);
|
|
32
|
+
const i = l ? !!g : u, n = () => {
|
|
33
|
+
if (l) {
|
|
34
|
+
r == null || r();
|
|
30
35
|
return;
|
|
31
36
|
}
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
onClick: ()
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
37
|
+
_((o) => !o);
|
|
38
|
+
}, x = (o) => {
|
|
39
|
+
if (o.target.closest("button")) {
|
|
40
|
+
o.stopPropagation();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
v && n(), s == null || s();
|
|
44
|
+
}, q = B(() => [
|
|
45
|
+
c === "tile" ? e.tile : e.block,
|
|
46
|
+
h === "secondary" && i ? e.secondaryOpen : ""
|
|
47
|
+
].filter(Boolean).join(" "), [c, h, i]);
|
|
48
|
+
return /* @__PURE__ */ p("div", { className: q, children: [
|
|
49
|
+
/* @__PURE__ */ p(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: `${e.accordionHeader} ${e[`padding-${b}`]}`,
|
|
53
|
+
onClick: x,
|
|
54
|
+
"data-ignore-outside-click": !0,
|
|
55
|
+
children: [
|
|
56
|
+
a === "left" && /* @__PURE__ */ t(w, { mode: "ghost", size: "s", onClick: n, 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" }) }) }),
|
|
57
|
+
/* @__PURE__ */ t("div", { className: e.title, children: m }),
|
|
58
|
+
a === "right" && /* @__PURE__ */ t(w, { mode: "ghost", size: "s", onClick: n, 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" }) }) })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
i && f
|
|
57
63
|
] });
|
|
58
64
|
};
|
|
59
65
|
export {
|
|
60
|
-
|
|
66
|
+
z as AccordionItem
|
|
61
67
|
};
|