stone-kit 0.0.197 → 0.0.198

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.
@@ -1,6 +1,6 @@
1
1
  import { ITabSwitcherItem, TabSwitcherProps } from './TabSwitcher.types';
2
2
 
3
- declare const SwitcherNamespace: (({ children, variant, addClassName, col, }: TabSwitcherProps) => import("react/jsx-runtime").JSX.Element | null) & {
3
+ declare const SwitcherNamespace: (({ children, variant, addClassName, col, }: TabSwitcherProps) => import("react/jsx-runtime").JSX.Element | undefined) & {
4
4
  Item: import('react').ForwardRefExoticComponent<Omit<ITabSwitcherItem, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
5
5
  };
6
6
  export { SwitcherNamespace as TabSwitcher };
@@ -1,43 +1,47 @@
1
- import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as _, Children as j, isValidElement as w, cloneElement as f } from "react";
3
- import { Text as p } from "../../Text/ui/Text.js";
4
- import { c as I } from "../../../index-rKuIKazb.js";
5
- const b = "_root_j8jt6_1", h = "_item_j8jt6_17", x = "_firstItem_j8jt6_29", N = "_lastItem_j8jt6_34", d = "_text_j8jt6_38", u = "_rootCol_j8jt6_46", C = "_whiteRow_j8jt6_71", t = {
6
- root: b,
7
- item: h,
8
- firstItem: x,
9
- lastItem: N,
10
- text: d,
11
- rootCol: u,
12
- whiteRow: C
13
- }, c = I.bind(t), R = ({
14
- children: e,
15
- variant: a = "whiteRow",
16
- addClassName: m = "",
17
- col: i = !1
18
- }) => !e || !Array.isArray(e) ? null : /* @__PURE__ */ r("div", { className: c(t.root, t[a], m, { [t.rootCol]: i }), children: j.map(e, (s, o) => w(s) && e ? f(s, {
19
- className: c(
20
- t.item,
21
- { [t.firstItem]: o === 0 },
22
- { [t.lastItem]: o === e.length - 1 },
23
- { [t.isDisabled]: s.props.disabled }
24
- )
25
- }) : s) }), l = _((e, a) => {
26
- const { children: m, className: i, addItemClassName: s, ...o } = e;
27
- return /* @__PURE__ */ n("label", { children: [
28
- /* @__PURE__ */ r(
1
+ import { jsxs as j, jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as w } from "react";
3
+ import { Text as d } from "../../Text/ui/Text.js";
4
+ import { c as f } from "../../../index-rKuIKazb.js";
5
+ const h = "_root_j8jt6_1", b = "_item_j8jt6_17", I = "_firstItem_j8jt6_29", x = "_lastItem_j8jt6_34", p = "_text_j8jt6_38", N = "_rootCol_j8jt6_46", R = "_whiteRow_j8jt6_71", t = {
6
+ root: h,
7
+ item: b,
8
+ firstItem: I,
9
+ lastItem: x,
10
+ text: p,
11
+ rootCol: N,
12
+ whiteRow: R
13
+ }, c = f.bind(t), C = ({
14
+ children: i,
15
+ variant: e = "whiteRow",
16
+ addClassName: s = "",
17
+ col: r = !1
18
+ }) => {
19
+ if (e !== "blackRow")
20
+ return /* @__PURE__ */ o("div", { className: c(t.root, t[e], s, { [t.rootCol]: r }), children: i });
21
+ if (e === "blackRow")
22
+ return /* @__PURE__ */ o("div", {});
23
+ }, m = w((i, e) => {
24
+ const { index: s, children: r, addItemClassName: a, disabled: l = !1, itemsLength: n = 0, ..._ } = i;
25
+ return /* @__PURE__ */ j("label", { children: [
26
+ /* @__PURE__ */ o(
29
27
  "input",
30
28
  {
31
- ref: a,
29
+ ref: e,
32
30
  type: "checkbox",
33
- ...o
31
+ ..._
34
32
  }
35
33
  ),
36
- /* @__PURE__ */ r("div", { className: c(i, s), children: /* @__PURE__ */ r(p, { className: t.text, children: m }) })
34
+ /* @__PURE__ */ o(
35
+ "div",
36
+ {
37
+ className: c(c(t.item, { [t.firstItem]: s === 0 }, { [t.lastItem]: s === n - 1 }, { [t.isDisabled]: l }), a),
38
+ children: /* @__PURE__ */ o(d, { className: t.text, children: r })
39
+ }
40
+ )
37
41
  ] });
38
42
  });
39
- l.displayName = "TabSwitcherItem";
40
- const v = Object.assign(R, { Item: l });
43
+ m.displayName = "TabSwitcherItem";
44
+ const g = Object.assign(C, { Item: m });
41
45
  export {
42
- v as TabSwitcher
46
+ g as TabSwitcher
43
47
  };
@@ -1,16 +1,20 @@
1
1
  /// <reference types="react" />
2
2
  declare const TAB_SWITCHER_VARIANTS: {
3
3
  whiteRow: string;
4
+ blackRow: string;
4
5
  };
5
6
  type BaseInputProps = JSX.IntrinsicElements['input'];
6
7
  export interface ITabSwitcherItem extends BaseInputProps {
7
8
  addItemClassName?: string;
9
+ index: number;
10
+ isDisabled?: boolean;
11
+ itemsLength: number;
8
12
  }
9
13
  export interface TabSwitcherProps {
10
- children?: React.ReactElement<HTMLButtonElement> | React.ReactElement<HTMLButtonElement>[];
11
14
  variant?: TABS_VARIANTS;
12
15
  addClassName?: string;
13
16
  col?: boolean;
17
+ children: React.ReactElement[];
14
18
  }
15
19
  export type TABS_VARIANTS = keyof typeof TAB_SWITCHER_VARIANTS;
16
20
  export {};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "stone-kit",
3
3
  "description": "uikit for redesign",
4
4
  "private": false,
5
- "version": "0.0.197",
5
+ "version": "0.0.198",
6
6
  "author": "Mollycodd1e",
7
7
  "license": "ISC",
8
8
  "type": "module",