@arthurzakharov/ui-kit 3.9.0 → 3.10.0

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 @@
1
+ ._Accordion_o1wti_1{display:block;width:100%;background-color:var(--rm-ui-color-background-primary, #fff);border:1px solid var(--rm-ui-grey-100);border-radius:var(--rm-ui-border-radius-md, 8px);overflow:hidden}._Header_o1wti_10{display:flex;align-items:center;gap:var(--rm-ui-padding-sm);width:100%;padding:var(--rm-ui-padding-md) var(--rm-ui-padding-md);background:transparent;border:0;cursor:pointer;text-align:left;font-family:inherit}._Header_o1wti_10:focus-visible{outline:2px solid var(--rm-ui-color-focus);outline-offset:-2px}._Index_o1wti_31{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:28px;height:28px;padding:0 var(--rm-ui-padding-xxs);border-radius:50%;background-color:var(--rm-ui-color-theme-primary);color:var(--rm-ui-color-text-on-theme, #fff);font-size:var(--rm-ui-font-size-body-small);font-weight:var(--rm-ui-font-weight-medium);line-height:1}._Title_o1wti_47{flex:1 1 auto;min-width:0}._Chevron_o1wti_52{flex:0 0 auto;display:inline-flex;color:var(--rm-ui-color-text-secondary)}._Body_o1wti_58{position:relative;padding:0 var(--rm-ui-padding-md) var(--rm-ui-padding-md)}._Subtitle_o1wti_63{margin:0 0 var(--rm-ui-padding-sm)}._Content_o1wti_67{display:block}._LoaderOverlay_o1wti_71{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background-color:#ffffffbf;z-index:1}._Stepped_o1wti_81{background:transparent;border:0;border-radius:0;overflow:visible}._Stepped_o1wti_81 ._Header_o1wti_10{gap:var(--rm-ui-padding-md);padding:0}._Stepped_o1wti_81 ._Index_o1wti_31{min-width:24px;width:24px;height:24px;padding:0;background-color:var(--rm-ui-color-action);color:#fff;font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body)}._Stepped_o1wti_81 ._Chevron_o1wti_52{color:var(--rm-ui-color-text-primary)}._Stepped_o1wti_81 ._Body_o1wti_58{padding:var(--rm-ui-padding-xs) 0 var(--rm-ui-padding-md) 28px;margin-left:11px;border-left:2px solid var(--rm-ui-color-action)}._Stepped_o1wti_81 ._Subtitle_o1wti_63{margin:0 0 var(--rm-ui-padding-md)}._Stepped_o1wti_81 ._Content_o1wti_67{display:flex;flex-direction:column;gap:var(--rm-ui-padding-md)}
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Base } from '../../utils/types';
3
+ export type AccordionVariant = 'default' | 'stepped';
3
4
  export interface AccordionProps extends Base {
4
5
  title: string;
5
6
  isOpen: boolean;
@@ -7,6 +8,7 @@ export interface AccordionProps extends Base {
7
8
  index?: number | string;
8
9
  subtitle?: ReactNode;
9
10
  loading?: boolean;
11
+ variant?: AccordionVariant;
10
12
  children: ReactNode;
11
13
  }
12
- export declare const Accordion: ({ title, isOpen, onTitleClick, index, subtitle, loading, children, ...base }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const Accordion: ({ title, isOpen, onTitleClick, index, subtitle, loading, variant, children, ...base }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,61 +1,75 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import { ChevronDown as h } from "lucide-react";
3
- import { baseProps as i, clsx as s } from "../../utils/functions/functions.util.js";
4
- import { FadeGrow as v } from "../../animations/fade-grow/fade-grow.component.js";
5
- import { Rotate as p } from "../../animations/rotate/rotate.component.js";
6
- import { Loader as z } from "../loader/loader.component.js";
7
- import '../../assets/accordion-D1OVgv7W.css';const k = "_Accordion_1k5zy_1", C = "_Header_1k5zy_10", N = "_HeaderOpen_1k5zy_32", x = "_Index_1k5zy_36", b = "_Title_1k5zy_52", f = "_Chevron_1k5zy_57", H = "_Body_1k5zy_63", $ = "_Subtitle_1k5zy_68", u = "_Content_1k5zy_75", A = "_LoaderOverlay_1k5zy_79", o = {
8
- Accordion: k,
9
- Header: C,
10
- HeaderOpen: N,
11
- Index: x,
12
- Title: b,
13
- Chevron: f,
14
- Body: H,
15
- Subtitle: $,
16
- Content: u,
17
- LoaderOverlay: A
18
- }, j = ({
19
- title: l,
20
- isOpen: d,
21
- onTitleClick: _,
22
- index: r,
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import { ChevronDown as C } from "lucide-react";
3
+ import { baseProps as s, clsx as l } from "../../utils/functions/functions.util.js";
4
+ import { FadeGrow as S } from "../../animations/fade-grow/fade-grow.component.js";
5
+ import { Rotate as f } from "../../animations/rotate/rotate.component.js";
6
+ import { Loader as N } from "../loader/loader.component.js";
7
+ import { Text as m } from "../text/text.component.js";
8
+ import '../../assets/accordion-Bzio9jMo.css';const H = "_Accordion_o1wti_1", $ = "_Header_o1wti_10", g = "_HeaderOpen_o1wti_28", z = "_Index_o1wti_31", A = "_Title_o1wti_47", I = "_Chevron_o1wti_52", L = "_Body_o1wti_58", T = "_Subtitle_o1wti_63", B = "_Content_o1wti_67", O = "_LoaderOverlay_o1wti_71", j = "_Stepped_o1wti_81", e = {
9
+ Accordion: H,
10
+ Header: $,
11
+ HeaderOpen: g,
12
+ Index: z,
13
+ Title: A,
14
+ Chevron: I,
15
+ Body: L,
16
+ Subtitle: T,
17
+ Content: B,
18
+ LoaderOverlay: O,
19
+ Stepped: j
20
+ }, E = ({
21
+ title: _,
22
+ isOpen: r,
23
+ onTitleClick: p,
24
+ index: n,
23
25
  subtitle: a,
24
- loading: m = !1,
25
- children: y,
26
+ loading: h = !1,
27
+ variant: y = "default",
28
+ children: v,
26
29
  ...c
27
30
  }) => {
28
- const t = i(c, "data-testid", "accordion");
29
- return /* @__PURE__ */ n(
31
+ const o = s(c, "data-testid", "accordion"), d = y === "stepped", w = d ? "body" : "body-large", b = !d && r ? "theme-primary" : "text-primary", x = d ? "body" : "body-small", u = d ? "text-primary" : "text-secondary";
32
+ return /* @__PURE__ */ i(
30
33
  "div",
31
34
  {
32
- "data-testid": t,
33
- className: s(o.Accordion, i(c, "className")),
35
+ "data-testid": o,
36
+ className: l(e.Accordion, { [e.Stepped]: d }, s(c, "className")),
34
37
  children: [
35
- /* @__PURE__ */ n(
38
+ /* @__PURE__ */ i(
36
39
  "button",
37
40
  {
38
41
  type: "button",
39
- "data-testid": `${t}-header`,
40
- className: s(o.Header, { [o.HeaderOpen]: d }),
41
- onClick: _,
42
- "aria-expanded": d,
42
+ "data-testid": `${o}-header`,
43
+ className: l(e.Header, { [e.HeaderOpen]: r }),
44
+ onClick: p,
45
+ "aria-expanded": r,
43
46
  children: [
44
- r !== void 0 && /* @__PURE__ */ e("span", { "data-testid": `${t}-index`, className: o.Index, children: r }),
45
- /* @__PURE__ */ e("span", { className: o.Title, children: l }),
46
- /* @__PURE__ */ e("span", { className: o.Chevron, children: /* @__PURE__ */ e(p, { name: `${t}-chevron`, condition: d, from: "top", to: "bottom", children: /* @__PURE__ */ e(h, { size: 20 }) }) })
47
+ n !== void 0 && /* @__PURE__ */ t("span", { "data-testid": `${o}-index`, className: e.Index, children: n }),
48
+ /* @__PURE__ */ t(m, { tag: "span", className: e.Title, weight: "medium", size: w, color: b, children: _ }),
49
+ /* @__PURE__ */ t("span", { className: e.Chevron, children: /* @__PURE__ */ t(f, { name: `${o}-chevron`, condition: r, from: "top", to: "bottom", children: /* @__PURE__ */ t(C, { size: d ? 24 : 20 }) }) })
47
50
  ]
48
51
  }
49
52
  ),
50
- /* @__PURE__ */ e(v, { name: `${t}-body`, condition: d, children: /* @__PURE__ */ n("div", { "data-testid": `${t}-body`, className: o.Body, children: [
51
- m && /* @__PURE__ */ e("div", { "data-testid": `${t}-loader`, className: o.LoaderOverlay, children: /* @__PURE__ */ e(z, { color: "accent-primary", size: "md" }) }),
52
- a != null && /* @__PURE__ */ e("div", { "data-testid": `${t}-subtitle`, className: o.Subtitle, children: a }),
53
- /* @__PURE__ */ e("div", { className: o.Content, children: y })
53
+ /* @__PURE__ */ t(S, { name: `${o}-body`, condition: r, children: /* @__PURE__ */ i("div", { "data-testid": `${o}-body`, className: e.Body, children: [
54
+ h && /* @__PURE__ */ t("div", { "data-testid": `${o}-loader`, className: e.LoaderOverlay, children: /* @__PURE__ */ t(N, { color: "accent-primary", size: "md" }) }),
55
+ a != null && /* @__PURE__ */ t(
56
+ m,
57
+ {
58
+ tag: "div",
59
+ "data-testid": `${o}-subtitle`,
60
+ className: e.Subtitle,
61
+ weight: "regular",
62
+ size: x,
63
+ color: u,
64
+ children: a
65
+ }
66
+ ),
67
+ /* @__PURE__ */ t("div", { className: e.Content, children: v })
54
68
  ] }) })
55
69
  ]
56
70
  }
57
71
  );
58
72
  };
59
73
  export {
60
- j as Accordion
74
+ E as Accordion
61
75
  };
@@ -1 +1 @@
1
- export { Accordion, type AccordionProps } from './accordion.component';
1
+ export { Accordion, type AccordionProps, type AccordionVariant } from './accordion.component';
package/dist/main.d.ts CHANGED
@@ -23,7 +23,7 @@ export { HiddenInput, type HiddenInputProps } from './controls/primitives/hidden
23
23
  export { Label, type LabelProps } from './controls/primitives/label';
24
24
  export { RadioLabel, type RadioLabelProps } from './controls/primitives/radio-label';
25
25
  export { Status, type StatusProps } from './controls/primitives/status';
26
- export { Accordion, type AccordionProps } from './components/accordion';
26
+ export { Accordion, type AccordionProps, type AccordionVariant } from './components/accordion';
27
27
  export { AccordionTable, type AccordionTableProps } from './components/accordion-table/accordion-table.component';
28
28
  export { Dropzone, type DropzoneProps, type DropzoneRejectionReason } from './components/dropzone';
29
29
  export { BottomBar } from './components/bottom-bar';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arthurzakharov/ui-kit",
3
3
  "private": false,
4
- "version": "3.9.0",
4
+ "version": "3.10.0",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -1 +0,0 @@
1
- ._Accordion_1k5zy_1{display:block;width:100%;background-color:var(--rm-ui-color-background-primary, #fff);border:1px solid var(--rm-ui-grey-100);border-radius:var(--rm-ui-border-radius-md, 8px);overflow:hidden}._Header_1k5zy_10{display:flex;align-items:center;gap:var(--rm-ui-padding-sm);width:100%;padding:var(--rm-ui-padding-md) var(--rm-ui-padding-md);background:transparent;border:0;cursor:pointer;text-align:left;color:var(--rm-ui-color-text-primary);font-family:inherit;font-size:var(--rm-ui-font-size-body-large);line-height:var(--rm-ui-line-height-body-large);font-weight:var(--rm-ui-font-weight-medium)}._Header_1k5zy_10:focus-visible{outline:2px solid var(--rm-ui-color-focus);outline-offset:-2px}._HeaderOpen_1k5zy_32{color:var(--rm-ui-color-theme-primary)}._Index_1k5zy_36{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:28px;height:28px;padding:0 var(--rm-ui-padding-xxs);border-radius:50%;background-color:var(--rm-ui-color-theme-primary);color:var(--rm-ui-color-text-on-theme, #fff);font-size:var(--rm-ui-font-size-body-small);font-weight:var(--rm-ui-font-weight-medium);line-height:1}._Title_1k5zy_52{flex:1 1 auto;min-width:0}._Chevron_1k5zy_57{flex:0 0 auto;display:inline-flex;color:var(--rm-ui-color-text-secondary)}._Body_1k5zy_63{position:relative;padding:0 var(--rm-ui-padding-md) var(--rm-ui-padding-md)}._Subtitle_1k5zy_68{margin:0 0 var(--rm-ui-padding-sm);color:var(--rm-ui-color-text-secondary);font-size:var(--rm-ui-font-size-body-small);line-height:var(--rm-ui-line-height-body-small)}._Content_1k5zy_75{display:block}._LoaderOverlay_1k5zy_79{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background-color:#ffffffbf;z-index:1}