@situaction/traq-ui-ste 1.0.13 → 1.0.15

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,19 +1,19 @@
1
- import { ButtonHTMLAttributes, ReactNode } from 'react';
1
+ import { ButtonHTMLAttributes, FC, ReactNode } from 'react';
2
2
  import { Color } from '../interface';
3
3
 
4
- interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
- mode?: 'primary' | 'secondary' | 'tertiary' | 'ghost'; /** Is this the principal call to action on the page? */
4
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
+ mode?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'text'; /** Is this the principal call to action on the page? */
6
6
  color?: Color; /** What background color to use (blue, red, ...)*/
7
7
  colorMode?: 'light' | 'dark'; /** what mode do you use for light or dark color **/
8
8
  size?: 's' | 'm' | 'l' | 'xl'; /** How large should the button be? */
9
9
  label: string; /** button contents */
10
- error?: boolean;
11
- children?: ReactNode; /** Additional content inside the button */
12
- childrenPosition?: 'left' | 'right' | 'both'; /** Position of the children relative to the label */
10
+ error?: boolean; /** If true, the button will be styled to indicate an error state. */
11
+ selected?: boolean; /** If true, the button is activated */
12
+ childrenLeft?: ReactNode; /** Additional content inside the input */
13
+ childrenRight?: ReactNode; /** Additional content inside the input */
13
14
  onClick?: () => void; /** Optional click handler */
14
15
  }
15
16
  /**
16
17
  * Primary UI component for user interaction
17
18
  */
18
- export declare const Button: ({ mode, size, color, colorMode, label, error, children, childrenPosition, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
19
- export {};
19
+ export declare const Button: FC<ButtonProps>;
@@ -1,64 +1,67 @@
1
- import { jsxs as y, jsx as b } from "react/jsx-runtime";
2
- import '../../styles/index.css';import '../../styles/Button.css';/* empty css */
3
- import { useEffect as z } from "react";
4
- const c = "_button_tplzh_196", a = {
5
- button: c,
6
- "button-primary": "_button-primary_tplzh_211",
7
- "button-secondary": "_button-secondary_tplzh_226",
8
- "button-tertiary": "_button-tertiary_tplzh_245",
9
- "button-ghost": "_button-ghost_tplzh_264",
10
- "button-error": "_button-error_tplzh_279",
11
- "button-size-xl": "_button-size-xl_tplzh_294",
12
- "button-size-l": "_button-size-l_tplzh_299",
13
- "button-size-m": "_button-size-m_tplzh_304",
14
- "button-size-s": "_button-size-s_tplzh_309",
15
- "button-gap-xl": "_button-gap-xl_tplzh_314",
16
- "button-gap-l": "_button-gap-l_tplzh_317",
17
- "button-gap-m": "_button-gap-m_tplzh_320",
18
- "button-gap-s": "_button-gap-s_tplzh_320"
19
- }, d = ({
20
- mode: s = "primary",
21
- size: u = "m",
1
+ import { jsxs as x, jsx as e } from "react/jsx-runtime";
2
+ import { useEffect as y } from "react";
3
+ import '../../styles/Button.css';const j = "_button_1mr6j_38", d = "_flexHorizontalCenter_1mr6j_180", r = {
4
+ button: j,
5
+ "button-primary": "_button-primary_1mr6j_60",
6
+ "button-secondary": "_button-secondary_1mr6j_74",
7
+ "button-tertiary": "_button-tertiary_1mr6j_88",
8
+ "button-ghost": "_button-ghost_1mr6j_102",
9
+ "button-text": "_button-text_1mr6j_118",
10
+ "button-text-selected": "_button-text-selected_1mr6j_131",
11
+ "button-error": "_button-error_1mr6j_137",
12
+ "button-size-xl": "_button-size-xl_1mr6j_150",
13
+ "button-size-l": "_button-size-l_1mr6j_155",
14
+ "button-size-m": "_button-size-m_1mr6j_160",
15
+ "button-size-s": "_button-size-s_1mr6j_165",
16
+ "button-gap-xl": "_button-gap-xl_1mr6j_170",
17
+ "button-gap-l": "_button-gap-l_1mr6j_173",
18
+ "button-gap-m": "_button-gap-m_1mr6j_176",
19
+ "button-gap-s": "_button-gap-s_1mr6j_176",
20
+ flexHorizontalCenter: d
21
+ }, z = ({
22
+ mode: o = "primary",
23
+ size: a = "m",
22
24
  color: t,
23
- colorMode: r,
24
- label: _,
25
- error: p,
26
- children: o,
27
- childrenPosition: n,
28
- ...e
25
+ colorMode: n,
26
+ label: u,
27
+ error: b,
28
+ selected: i,
29
+ childrenLeft: s,
30
+ childrenRight: _,
31
+ ...m
29
32
  }) => {
30
- const l = () => p ? "error" : s;
31
- z(() => {
32
- r && !t && console.warn("`colorMode` is defined but `color` is missing. `colorMode` will be ignored.");
33
+ const l = () => b ? "error" : o;
34
+ y(() => {
35
+ n && !t && console.warn("`colorMode` is defined but `color` is missing. `colorMode` will be ignored.");
33
36
  }, [t]);
34
- const i = [
35
- a.button,
36
- a[`button-${l()}`],
37
- a[`button-size-${u}`],
38
- a[`button-gap-${u}`],
39
- "flexHorizontalCenter"
40
- ].join(" "), m = {
41
- "--dynamic-color-text": t ? r === "dark" ? "var(--primary-color-900)" : "var(--color-light-100)" : "var(--btn-primary-color-text)",
42
- "--dynamic-color": t ? `var(--color-${t}-${r === "dark" ? "200" : "900"})` : "var(--btn-primary-color)",
43
- "--dynamic-color-hover": t ? `var(--color-${t}-${r === "dark" ? "100" : "800"})` : "var(--btn-primary-color-hover)",
44
- "--dynamic-color-activated": t ? `var(--color-${t}-${r === "dark" ? "50" : "700"})` : "var(--btn-primary-color-activated)",
45
- "--dynamic-color-disabled": t ? r === "dark" ? "var(--color-dark-10)" : `var(--color-${t}-50)` : "var(--btn-primary-color-disabled)"
37
+ const c = [
38
+ r.button,
39
+ r[`button-${l()}`],
40
+ r[`button-size-${a}`],
41
+ r[`button-gap-${a}`],
42
+ i && o === "text" && r["button-text-selected"],
43
+ r.flexHorizontalCenter
44
+ ].join(" "), p = {
45
+ "--dynamic-color-text": t ? n === "dark" ? `var(--color-${t}-900)` : "var(--color-light-100)" : "var(--btn-primary-color-text)",
46
+ "--dynamic-color": t ? `var(--color-${t}-${n === "dark" ? "200" : "900"})` : "var(--btn-primary-color)",
47
+ "--dynamic-color-hover": t ? `var(--color-${t}-${n === "dark" ? "100" : "800"})` : "var(--btn-primary-color-hover)",
48
+ "--dynamic-color-activated": t ? `var(--color-${t}-${n === "dark" ? "50" : "700"})` : "var(--btn-primary-color-activated)"
46
49
  };
47
- return /* @__PURE__ */ y(
50
+ return /* @__PURE__ */ x(
48
51
  "button",
49
52
  {
50
53
  type: "button",
51
- className: i,
52
- style: s === "primary" ? m : void 0,
53
- ...e,
54
+ className: c,
55
+ style: o === "primary" ? p : void 0,
56
+ ...m,
54
57
  children: [
55
- (n === "left" || n === "both") && o && /* @__PURE__ */ b("span", { children: o }),
56
- /* @__PURE__ */ b("span", { children: _ }),
57
- (n === "right" || n === "both") && o && /* @__PURE__ */ b("span", { children: o })
58
+ s && /* @__PURE__ */ e("span", { className: r.flexHorizontalCenter, children: s }),
59
+ /* @__PURE__ */ e("span", { children: u }),
60
+ _ && /* @__PURE__ */ e("span", { className: r.flexHorizontalCenter, children: _ })
58
61
  ]
59
62
  }
60
63
  );
61
64
  };
62
65
  export {
63
- d as Button
66
+ z as Button
64
67
  };
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+
3
+ export interface ColorsProps {
4
+ color: string;
5
+ hex: string[];
6
+ }
7
+ declare const Colors: FC<ColorsProps>;
8
+ export default Colors;
@@ -0,0 +1,24 @@
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import '../../styles/Colors.css';const n = "_palette_l21ra_6", d = "_colors_l21ra_13", i = "_desc_l21ra_26", h = "_hex_l21ra_35", s = {
3
+ palette: n,
4
+ colors: d,
5
+ desc: i,
6
+ hex: h
7
+ }, v = ({ color: t, hex: o }) => {
8
+ const r = t === "light" ? ["05", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100"] : ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"];
9
+ return /* @__PURE__ */ e("div", { className: s.palette, children: o.map((c, a) => /* @__PURE__ */ l("div", { className: s.colors, children: [
10
+ /* @__PURE__ */ e("div", { style: { backgroundColor: c } }),
11
+ /* @__PURE__ */ l("div", { className: s.desc, children: [
12
+ /* @__PURE__ */ l("div", { children: [
13
+ "color-",
14
+ t,
15
+ "-",
16
+ r[a]
17
+ ] }),
18
+ /* @__PURE__ */ e("div", { className: s.hex, children: c })
19
+ ] })
20
+ ] })) });
21
+ };
22
+ export {
23
+ v as default
24
+ };
@@ -1,14 +1,16 @@
1
1
  import { FC, ReactElement } from 'react';
2
2
  import { Color } from '../interface';
3
3
 
4
- interface IconButtonProps {
5
- mode?: 'primary' | 'secondary' | 'tertiary' | 'ghost';
4
+ export interface IconButtonProps {
5
+ mode?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'icon'; /** Specifies the visual style of the button. */
6
6
  color?: Color; /** What background color to use (blue, red, ...)*/
7
7
  colorMode?: 'light' | 'dark'; /** what mode do you use for light or dark color **/
8
- size?: 'xs' | 's' | 'm' | 'l' | 'xl'; /** How large should the button be? */
9
- error?: boolean;
8
+ size?: 's' | 'm' | 'l' | 'xl'; /** How large should the button be? */
9
+ round?: boolean; /** If true, the button will have rounded corners. */
10
+ error?: boolean; /** If true, the button will be styled to indicate an error state. */
11
+ selected?: boolean; /** If true, the button is activated */
12
+ disabled?: boolean; /** If true, the button will be disabled and non-interactive. */
10
13
  children: ReactElement; /** Only icons (React elements) allowed inside the button */
11
14
  onClick?: () => void; /** Optional click handler */
12
15
  }
13
16
  export declare const IconButton: FC<IconButtonProps>;
14
- export {};
@@ -1,52 +1,60 @@
1
- import { jsx as _ } from "react/jsx-runtime";
2
- import { useEffect as c } from "react";
3
- import '../../styles/IconButton.css';const l = "_button_1qaum_196", o = {
4
- button: l,
5
- "button-primary": "_button-primary_1qaum_216",
6
- "button-secondary": "_button-secondary_1qaum_231",
7
- "button-tertiary": "_button-tertiary_1qaum_250",
8
- "button-ghost": "_button-ghost_1qaum_269",
9
- "button-error": "_button-error_1qaum_284",
10
- "button-size-xl": "_button-size-xl_1qaum_299",
11
- "button-size-l": "_button-size-l_1qaum_304",
12
- "button-size-m": "_button-size-m_1qaum_309",
13
- "button-size-s": "_button-size-s_1qaum_314",
14
- "button-size-xs": "_button-size-xs_1qaum_319"
15
- }, v = ({
16
- mode: a = "primary",
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useEffect as y } from "react";
3
+ import '../../styles/IconButton.css';const k = "_button_7dkt1_38", x = "_flexHorizontalCenter_7dkt1_175", o = {
4
+ button: k,
5
+ "button-round": "_button-round_7dkt1_66",
6
+ "button-primary": "_button-primary_7dkt1_69",
7
+ "button-secondary": "_button-secondary_7dkt1_82",
8
+ "button-tertiary": "_button-tertiary_7dkt1_96",
9
+ "button-ghost": "_button-ghost_7dkt1_110",
10
+ "button-text": "_button-text_7dkt1_123",
11
+ "button-text-selected": "_button-text-selected_7dkt1_135",
12
+ "button-error": "_button-error_7dkt1_141",
13
+ "button-size-xl": "_button-size-xl_7dkt1_154",
14
+ "button-size-l": "_button-size-l_7dkt1_159",
15
+ "button-size-m": "_button-size-m_7dkt1_164",
16
+ "button-size-s": "_button-size-s_7dkt1_169",
17
+ flexHorizontalCenter: x
18
+ }, f = ({
19
+ mode: r = "primary",
17
20
  color: t,
18
- colorMode: r,
19
- size: n = "m",
20
- error: i,
21
- children: u,
22
- onClick: e
21
+ colorMode: n,
22
+ size: e = "m",
23
+ error: u,
24
+ selected: i,
25
+ round: a,
26
+ disabled: _,
27
+ children: b,
28
+ onClick: s
23
29
  }) => {
24
- const s = () => i ? "error" : a;
25
- c(() => {
26
- r && !t && console.warn("`colorMode` is defined but `color` is missing. `colorMode` will be ignored.");
30
+ const d = () => u ? "error" : r;
31
+ y(() => {
32
+ n && !t && console.warn("`colorMode` is defined but `color` is missing. `colorMode` will be ignored.");
27
33
  }, [t]);
28
- const b = [
34
+ const l = [
29
35
  o.button,
30
- o[`button-${s()}`],
31
- o[`button-size-${n}`],
32
- "flexHorizontalCenter"
33
- ].join(" "), m = {
34
- "--dynamic-color-text": t ? r === "dark" ? "var(--primary-color-900)" : "var(--color-light-100)" : "var(--btn-primary-color-text)",
35
- "--dynamic-color": t ? `var(--color-${t}-${r === "dark" ? "200" : "900"})` : "var(--btn-primary-color)",
36
- "--dynamic-color-hover": t ? `var(--color-${t}-${r === "dark" ? "100" : "800"})` : "var(--btn-primary-color-hover)",
37
- "--dynamic-color-activated": t ? `var(--color-${t}-${r === "dark" ? "50" : "700"})` : "var(--btn-primary-color-activated)",
38
- "--dynamic-color-disabled": t ? r === "dark" ? "var(--color-dark-10)" : `var(--color-${t}-50)` : "var(--btn-primary-color-disabled)"
36
+ o[`button-${d()}`],
37
+ a && o["button-round"],
38
+ o[`button-size-${e}`],
39
+ i && r === "icon" && o["button-text-selected"],
40
+ o.flexHorizontalCenter
41
+ ].join(" "), c = {
42
+ "--dynamic-color-text": t ? n === "dark" ? "var(--primary-color-900)" : "var(--color-light-100)" : "var(--btn-primary-color-text)",
43
+ "--dynamic-color": t ? `var(--color-${t}-${n === "dark" ? "200" : "900"})` : "var(--btn-primary-color)",
44
+ "--dynamic-color-hover": t ? `var(--color-${t}-${n === "dark" ? "100" : "800"})` : "var(--btn-primary-color-hover)",
45
+ "--dynamic-color-activated": t ? `var(--color-${t}-${n === "dark" ? "50" : "700"})` : "var(--btn-primary-color-activated)"
39
46
  };
40
- return /* @__PURE__ */ _(
47
+ return /* @__PURE__ */ m(
41
48
  "button",
42
49
  {
43
- className: b,
44
- style: a === "primary" ? m : void 0,
45
- onClick: e,
46
- children: u
50
+ className: l,
51
+ style: c,
52
+ onClick: s,
53
+ disabled: _,
54
+ children: b
47
55
  }
48
56
  );
49
57
  };
50
58
  export {
51
- v as IconButton
59
+ f as IconButton
52
60
  };
@@ -1,16 +1,19 @@
1
- import { InputHTMLAttributes, ReactNode } from 'react';
1
+ import { FC, InputHTMLAttributes, ReactNode } from 'react';
2
2
 
3
- interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
3
+ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
4
4
  sizeStyle?: 's' | 'm' | 'l' | 'xl'; /** How large should the input be? */
5
- label: string; /** input contents **/
6
- labelUnit?: string;
5
+ label: string; /** The label or placeholder text for the input field */
6
+ labelUnit?: string; /** Optional unit or additional label to display next to the input */
7
+ dark?: boolean; /** Toggle for dark mode styling */
7
8
  color?: string; /** red, green, blue, pink **/
9
+ classNames?: string; /** class names for parent div due to general input props (input elem takes every other props in <Input/> component) **/
10
+ focusBackground?: boolean; /** Whether to change the background color when the input is focused */
8
11
  status?: 'default' | 'error' | 'success' | 'ternary'; /** input status style **/
9
- ghost?: boolean;
10
- children?: ReactNode; /** Additional content inside the input */
11
- childrenPosition?: 'left' | 'right' | 'both'; /** Position of the children relative to the label */
12
- defaultValue?: string;
13
- disabled?: boolean;
12
+ ghost?: boolean; /** Whether to apply a ghost style (transparent background) */
13
+ round?: boolean; /** If true, the input will have rounded corners */
14
+ iconLeft?: ReactNode; /** Icon or element to display on the left side of the input */
15
+ iconRight?: ReactNode; /** Icon or element to display on the right side of the input */
16
+ defaultValue?: string; /** Default value for the input field */
17
+ disabled?: boolean; /** Disable the input field */
14
18
  }
15
- export declare const Input: ({ sizeStyle, label, labelUnit, color, status, ghost, children, childrenPosition, disabled, defaultValue, ...props }: InputProps) => import("react/jsx-runtime").JSX.Element;
16
- export {};
19
+ export declare const Input: FC<InputProps>;
@@ -1,132 +1,110 @@
1
- import { jsxs as f, jsx as t, Fragment as O } from "react/jsx-runtime";
2
- import { useState as x, useRef as y, useEffect as q } from "react";
3
- import '../../styles/Input.css';const A = "_hideBorder_1in9x_466", e = {
4
- "input-style": "_input-style_1in9x_333",
5
- "input-style-ghost": "_input-style-ghost_1in9x_341",
6
- "input-style-disabled": "_input-style-disabled_1in9x_346",
7
- "input-style-focused": "_input-style-focused_1in9x_355",
8
- "input-container": "_input-container_1in9x_360",
9
- "floating-input": "_floating-input_1in9x_360",
10
- "floating-label": "_floating-label_1in9x_360",
11
- "input-style-error": "_input-style-error_1in9x_363",
12
- "input-style-error-focused": "_input-style-error-focused_1in9x_370",
13
- "input-style-error-disabled": "_input-style-error-disabled_1in9x_373",
14
- "input-style-success": "_input-style-success_1in9x_381",
15
- "input-style-success-focused": "_input-style-success-focused_1in9x_388",
16
- "input-style-success-disabled": "_input-style-success-disabled_1in9x_391",
17
- "floating-label-size-xl": "_floating-label-size-xl_1in9x_416",
18
- "floating-label-size-l": "_floating-label-size-l_1in9x_419",
19
- "floating-label-size-m": "_floating-label-size-m_1in9x_422",
20
- "floating-label-size-s": "_floating-label-size-s_1in9x_425",
21
- "floating-input-size-xl": "_floating-input-size-xl_1in9x_434",
22
- "floating-input-size-l": "_floating-input-size-l_1in9x_438",
23
- "floating-input-size-m": "_floating-input-size-m_1in9x_442",
24
- "floating-input-size-s": "_floating-input-size-s_1in9x_446",
25
- hideBorder: A,
26
- "hideBorder-error": "_hideBorder-error_1in9x_476",
27
- "hideBorder-success": "_hideBorder-success_1in9x_479",
28
- "input-style-size-xl": "_input-style-size-xl_1in9x_482",
29
- "input-style-size-l": "_input-style-size-l_1in9x_488",
30
- "input-style-size-m": "_input-style-size-m_1in9x_494",
31
- "input-style-size-s": "_input-style-size-s_1in9x_500"
1
+ import { jsxs as _, jsx as s, Fragment as R } from "react/jsx-runtime";
2
+ import { useState as y, useRef as q } from "react";
3
+ import '../../styles/Input.css';const A = "_flexHorizontalBetween_dkt9v_197", E = "_flexHorizontal_dkt9v_197", t = {
4
+ "input-style": "_input-style_dkt9v_65",
5
+ "input-style-ghost": "_input-style-ghost_dkt9v_76",
6
+ "input-style-disabled": "_input-style-disabled_dkt9v_81",
7
+ "input-style-focused": "_input-style-focused_dkt9v_90",
8
+ "input-style-error": "_input-style-error_dkt9v_95",
9
+ "input-style-error-focused": "_input-style-error-focused_dkt9v_102",
10
+ "input-style-error-focus-background": "_input-style-error-focus-background_dkt9v_108",
11
+ "input-style-error-disabled": "_input-style-error-disabled_dkt9v_111",
12
+ "input-style-success": "_input-style-success_dkt9v_119",
13
+ "input-style-success-focused": "_input-style-success-focused_dkt9v_126",
14
+ "input-style-success-focus-background": "_input-style-success-focus-background_dkt9v_132",
15
+ "input-style-success-disabled": "_input-style-success-disabled_dkt9v_135",
16
+ "input-container": "_input-container_dkt9v_143",
17
+ "floating-input": "_floating-input_dkt9v_147",
18
+ "floating-input-size-xl": "_floating-input-size-xl_dkt9v_153",
19
+ "floating-input-size-l": "_floating-input-size-l_dkt9v_157",
20
+ "floating-input-size-m": "_floating-input-size-m_dkt9v_161",
21
+ "floating-input-size-s": "_floating-input-size-s_dkt9v_165",
22
+ "input-style-size-xl": "_input-style-size-xl_dkt9v_169",
23
+ "input-style-size-l": "_input-style-size-l_dkt9v_175",
24
+ "input-style-size-m": "_input-style-size-m_dkt9v_181",
25
+ "input-style-size-s": "_input-style-size-s_dkt9v_187",
26
+ "input-style-radius": "_input-style-radius_dkt9v_193",
27
+ flexHorizontalBetween: A,
28
+ flexHorizontal: E
32
29
  }, K = ({
33
- sizeStyle: c = "m",
34
- label: b,
35
- labelUnit: m,
30
+ sizeStyle: u = "m",
31
+ label: f,
32
+ labelUnit: o,
36
33
  color: n,
37
- status: i = "default",
38
- ghost: h = !1,
39
- children: l,
40
- childrenPosition: o = "left",
41
- disabled: _,
42
- defaultValue: z,
43
- ...B
34
+ dark: r,
35
+ focusBackground: l,
36
+ status: a = "default",
37
+ ghost: v = !1,
38
+ iconLeft: c,
39
+ iconRight: p,
40
+ round: k,
41
+ classNames: g,
42
+ disabled: i,
43
+ defaultValue: m,
44
+ ...z
44
45
  }) => {
45
- const [d, g] = x(!1), [r, $] = x(z || ""), s = y(null), u = y(null), a = y(null), C = () => g(!0), N = () => g(!1), j = (p) => {
46
- $(p.target.value);
47
- }, R = [
48
- e["input-style"],
49
- e[`input-style-size-${c}`],
50
- e[`input-style-gap-${i}`],
51
- "flexHorizontalCenter gap4",
52
- h && e["input-style-ghost"]
53
- ].filter(Boolean).join(" "), v = [
54
- d && e["input-style-focused"],
55
- _ && e["input-style-disabled"]
56
- ].filter(Boolean).join(" "), S = [
57
- e["input-style-error"],
58
- _ && e["input-style-error-disabled"],
59
- d && e["input-style-error-focused"]
60
- ].filter(Boolean).join(" "), F = [
61
- e["input-style-success"],
62
- _ && e["input-style-success-disabled"],
63
- d && e["input-style-success-focused"]
64
- ].filter(Boolean).join(" "), H = () => {
65
- switch (i) {
46
+ const [e, d] = y(!1), [b, h] = y(m || ""), x = q(null), $ = () => d(!0), H = () => d(!1), S = (D) => {
47
+ h(D.target.value);
48
+ }, j = [
49
+ t["input-style"],
50
+ t[`input-style-size-${u}`],
51
+ t[`input-style-gap-${a}`],
52
+ k && t["input-style-radius"],
53
+ t.flexHorizontalBetween,
54
+ "gap4",
55
+ v && t["input-style-ghost"]
56
+ ].filter(Boolean).join(" "), B = [
57
+ e && t["input-style-focused"],
58
+ i && t["input-style-disabled"]
59
+ ].filter(Boolean).join(" "), N = [
60
+ t["input-style-error"],
61
+ i && t["input-style-error-disabled"],
62
+ e && t["input-style-error-focused"],
63
+ e && l && t["input-style-error-focus-background"]
64
+ ].filter(Boolean).join(" "), C = [
65
+ t["input-style-success"],
66
+ i && t["input-style-success-disabled"],
67
+ e && t["input-style-success-focused"],
68
+ e && l && t["input-style-success-focus-background"]
69
+ ].filter(Boolean).join(" "), w = () => {
70
+ switch (a) {
66
71
  case "error":
67
- return S;
72
+ return N;
68
73
  case "success":
69
- return F;
74
+ return C;
70
75
  default:
71
- return v;
76
+ return B;
72
77
  }
73
- }, I = [
74
- e["floating-label"],
75
- e[`floating-label-size-${c}`]
76
- ].join(" "), k = [
77
- e["floating-input"],
78
- e[`floating-input-size-${c}`]
79
- ].join(" "), w = {
80
- "--dynamic-color": `${n}`,
81
- "--dynamic-color-border": `$color-${n}-300`,
82
- "--dynamic-background-color": `$color-${n}-50`
78
+ }, F = [
79
+ t["floating-input"],
80
+ t[`floating-input-size-${u}`]
81
+ ].join(" "), I = {
82
+ "--dynamic-color": `var(--color-${n}-${r ? "800" : "300"})`,
83
+ "--dynamic-color-border": `var(--color-${n}-${r ? "800" : "300"})`,
84
+ "--dynamic-background-color": `${l ? `var(--color-${n}-50)` : "transparent"}`
83
85
  }, V = {
84
- "--dynamic-color": "var(--primary-color-blue)",
85
- "--dynamic-color-border": "$color-blue-grey-300",
86
- "--dynamic-background-color": "$color-blue-situaction-50"
87
- }, W = [
88
- e.hideBorder,
89
- i === "success" && e["hideBorder-success"],
90
- i === "error" && e["hideBorder-error"]
91
- ].filter(Boolean).join(" ");
92
- return q(() => {
93
- if (r && s.current && u.current && a.current) {
94
- const p = s.current.offsetWidth + 6;
95
- u.current.style.width = `${p}px`;
96
- const D = s.current.getBoundingClientRect(), E = a.current.getBoundingClientRect(), L = D.left - E.left;
97
- u.current.style.left = `${L - 3}px`;
98
- }
99
- }, [s, r, a]), /* @__PURE__ */ f(
100
- "div",
101
- {
102
- ref: a,
103
- className: `input-style ${R} ${H()}`,
104
- onFocus: C,
105
- onBlur: N,
106
- style: n ? w : V,
107
- children: [
108
- r && /* @__PURE__ */ t("div", { className: W, ref: u }),
109
- l && (o === "left" || o === "both") && /* @__PURE__ */ t("span", { className: "flexHorizontal", children: l }),
110
- /* @__PURE__ */ f("div", { className: e["input-container"], children: [
111
- /* @__PURE__ */ t(
112
- "input",
113
- {
114
- className: k,
115
- placeholder: " ",
116
- value: r,
117
- onChange: j,
118
- ...B
119
- }
120
- ),
121
- /* @__PURE__ */ t("label", { className: I, ref: s, children: b })
122
- ] }),
123
- l && (o === "right" || o === "both") && /* @__PURE__ */ f(O, { children: [
124
- /* @__PURE__ */ t("div", { children: m }),
125
- /* @__PURE__ */ t("span", { className: "flexHorizontal", children: l })
126
- ] })
127
- ]
128
- }
129
- );
86
+ "--dynamic-color": "var(--color-blue-situaction-800)",
87
+ "--dynamic-color-border": "var(--color-blue-situaction-800)",
88
+ "--dynamic-background-color": `${l ? "var(--color-blue-situaction-50)" : "transparent"}`
89
+ };
90
+ return /* @__PURE__ */ _("div", { ref: x, className: `input-style ${j} ${g} ${w()} gap-xs-2`, onFocus: $, onBlur: H, style: n ? I : V, children: [
91
+ c && /* @__PURE__ */ s("span", { className: "", children: c }),
92
+ /* @__PURE__ */ s("div", { className: t["input-container"], children: /* @__PURE__ */ s(
93
+ "input",
94
+ {
95
+ autoCorrect: "false",
96
+ className: F,
97
+ placeholder: f,
98
+ value: b,
99
+ onChange: S,
100
+ ...z
101
+ }
102
+ ) }),
103
+ /* @__PURE__ */ _(R, { children: [
104
+ o && /* @__PURE__ */ s("div", { children: o }),
105
+ p && /* @__PURE__ */ s("span", { className: t.flexHorizontal, children: p })
106
+ ] })
107
+ ] });
130
108
  };
131
109
  export {
132
110
  K as Input
@@ -1,8 +1,8 @@
1
1
  import { FC } from 'react';
2
2
 
3
- interface TabsProps {
4
- listItems: string[];
5
- onTabSelect: (selectedItem: string) => void;
3
+ export interface TabsProps {
4
+ listItems: string[]; /** Array of strings representing the labels of the tabs */
5
+ defaultActiveTab?: number; /** Index of the tab that should be active by default */
6
+ onTabSelect: (selectedItem: string) => void; /** Callback function to handle tab selection, receiving the selected tab's label */
6
7
  }
7
8
  export declare const Tabs: FC<TabsProps>;
8
- export {};