@arthurzakharov/ui-kit 3.9.0 → 3.11.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_1l7nf_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_1l7nf_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_1l7nf_10:focus-visible{outline:2px solid var(--rm-ui-color-focus);outline-offset:-2px}._Index_1l7nf_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_1l7nf_47{flex:1 1 auto;min-width:0}._Chevron_1l7nf_52{flex:0 0 auto;display:inline-flex;color:var(--rm-ui-color-text-secondary)}._Body_1l7nf_58{position:relative;padding:0 var(--rm-ui-padding-md) var(--rm-ui-padding-md)}._Subtitle_1l7nf_63{margin:0 0 var(--rm-ui-padding-sm)}._Content_1l7nf_67{display:block}._LoaderOverlay_1l7nf_71{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background-color:#ffffffbf;z-index:1}._Stepped_1l7nf_81{background:transparent;border:0;border-radius:0;overflow:visible}._Stepped_1l7nf_81 ._Header_1l7nf_10{gap:var(--rm-ui-padding-md);padding:0}._Stepped_1l7nf_81 ._Index_1l7nf_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_1l7nf_81 ._Chevron_1l7nf_52{color:var(--rm-ui-color-text-primary)}._Stepped_1l7nf_81 ._Body_1l7nf_58{padding:var(--rm-ui-padding-xs) 0 var(--rm-ui-padding-md) 28px;margin:var(--rm-ui-padding-sm) 0 0 11px;border-left:2px solid var(--rm-ui-color-action)}._Stepped_1l7nf_81 ._Subtitle_1l7nf_63{margin:0 0 var(--rm-ui-padding-md)}._Stepped_1l7nf_81 ._Content_1l7nf_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,
1
+ import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
+ import { ChevronDown as C } from "lucide-react";
3
+ import { baseProps as l, clsx as s } from "../../utils/functions/functions.util.js";
4
+ import { FadeGrow as S } from "../../animations/fade-grow/fade-grow.component.js";
5
+ import { Rotate as N } from "../../animations/rotate/rotate.component.js";
6
+ import { Loader as H } from "../loader/loader.component.js";
7
+ import { Text as m } from "../text/text.component.js";
8
+ import '../../assets/accordion-CBUfe0V-.css';const $ = "_Accordion_1l7nf_1", g = "_Header_1l7nf_10", z = "_HeaderOpen_1l7nf_28", A = "_Index_1l7nf_31", I = "_Title_1l7nf_47", L = "_Chevron_1l7nf_52", T = "_Body_1l7nf_58", w = "_Subtitle_1l7nf_63", B = "_Content_1l7nf_67", O = "_LoaderOverlay_1l7nf_71", j = "_Stepped_1l7nf_81", e = {
9
+ Accordion: $,
10
+ Header: g,
11
+ HeaderOpen: z,
12
+ Index: A,
13
+ Title: I,
14
+ Chevron: L,
15
+ Body: T,
16
+ Subtitle: w,
17
+ Content: B,
18
+ LoaderOverlay: O,
19
+ Stepped: j
20
+ }, E = ({
21
+ title: _,
20
22
  isOpen: d,
21
- onTitleClick: _,
22
- index: r,
23
- subtitle: a,
24
- loading: m = !1,
23
+ onTitleClick: p,
24
+ index: i,
25
+ subtitle: r,
26
+ loading: f = !1,
27
+ variant: h = "default",
25
28
  children: y,
26
29
  ...c
27
30
  }) => {
28
- const t = i(c, "data-testid", "accordion");
29
- return /* @__PURE__ */ n(
31
+ const o = l(c, "data-testid", "accordion"), n = h === "stepped", v = n ? "body" : "body-large", b = !n && d ? "theme-primary" : "text-primary", x = n ? "body" : "body-small", u = n ? "text-primary" : "text-secondary";
32
+ return /* @__PURE__ */ a(
30
33
  "div",
31
34
  {
32
- "data-testid": t,
33
- className: s(o.Accordion, i(c, "className")),
35
+ "data-testid": o,
36
+ className: s(e.Accordion, { [e.Stepped]: n }, l(c, "className")),
34
37
  children: [
35
- /* @__PURE__ */ n(
38
+ /* @__PURE__ */ a(
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
+ "data-testid": `${o}-header`,
43
+ className: s(e.Header, { [e.HeaderOpen]: d }),
44
+ onClick: p,
42
45
  "aria-expanded": d,
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
+ i !== void 0 && /* @__PURE__ */ t("span", { "data-testid": `${o}-index`, className: e.Index, children: i }),
48
+ /* @__PURE__ */ t(m, { tag: "span", className: e.Title, weight: "medium", size: v, color: b, children: _ }),
49
+ /* @__PURE__ */ t("span", { className: e.Chevron, children: /* @__PURE__ */ t(N, { name: `${o}-chevron`, condition: d, from: "top", to: "bottom", children: /* @__PURE__ */ t(C, { size: n ? 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: d, children: /* @__PURE__ */ a("div", { "data-testid": `${o}-body`, className: e.Body, children: [
54
+ f && /* @__PURE__ */ t("div", { "data-testid": `${o}-loader`, className: e.LoaderOverlay, children: /* @__PURE__ */ t(H, { color: "accent-primary", size: "md" }) }),
55
+ r != 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: r
65
+ }
66
+ ),
67
+ /* @__PURE__ */ t("div", { className: e.Content, children: y })
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.11.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}