@kolking/react-ui 1.6.0 → 1.7.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.
@@ -1,10 +1,12 @@
1
- import { jsx as f, jsxs as i, Fragment as T } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as f, Fragment as T } from "react/jsx-runtime";
2
2
  import c from "classnames";
3
3
  import { wrapNode as t, cssProps as p } from "../../utils/helpers.js";
4
4
  const y = "Tag_tag_-ovOm", _ = {
5
5
  tag: y,
6
6
  "default-gray": "Tag_default-gray_Ju2wo",
7
7
  "solid-gray": "Tag_solid-gray_q6GO4",
8
+ "default-brown": "Tag_default-brown_csCrz",
9
+ "solid-brown": "Tag_solid-brown_5IxVx",
8
10
  "default-red": "Tag_default-red_5NeXY",
9
11
  "solid-red": "Tag_solid-red_uPhj-",
10
12
  "default-orange": "Tag_default-orange_fuy0F",
@@ -23,8 +25,6 @@ const y = "Tag_tag_-ovOm", _ = {
23
25
  "solid-indigo": "Tag_solid-indigo_2gfJj",
24
26
  "default-purple": "Tag_default-purple_oBbek",
25
27
  "solid-purple": "Tag_solid-purple_e10WH",
26
- "default-brown": "Tag_default-brown_csCrz",
27
- "solid-brown": "Tag_solid-brown_5IxVx",
28
28
  "default-accent": "Tag_default-accent_uUXnO",
29
29
  "solid-accent": "Tag_solid-accent_bbTSM"
30
30
  }, j = ({
@@ -33,23 +33,23 @@ const y = "Tag_tag_-ovOm", _ = {
33
33
  scheme: l = "gray",
34
34
  title: e,
35
35
  icon: d,
36
- iconPosition: g = "start",
36
+ iconPosition: o = "start",
37
37
  className: r,
38
38
  style: u,
39
- children: o,
40
- ...n
41
- }) => /* @__PURE__ */ f(
39
+ children: g,
40
+ ...i
41
+ }) => /* @__PURE__ */ n(
42
42
  "span",
43
43
  {
44
- ...n,
44
+ ...i,
45
45
  "data-tag": a,
46
46
  "data-scheme": l,
47
47
  className: c(_.tag, _[`${a}-${l}`], r),
48
48
  style: { ...u, ...p({ size: s }) },
49
- children: o ? t(o, "span") : /* @__PURE__ */ i(T, { children: [
50
- g === "start" && d,
51
- e && t(e, "span"),
52
- g === "end" && d
49
+ children: g ? t(g, "span") : /* @__PURE__ */ f(T, { children: [
50
+ o === "start" && d,
51
+ e !== void 0 && t(e, "span"),
52
+ o === "end" && d
53
53
  ] })
54
54
  }
55
55
  );
@@ -1,5 +1,19 @@
1
+ import { default as React } from 'react';
1
2
  import { ButtonProps } from '../Button';
2
3
  export type ToggleButtonProps = Omit<ButtonProps, 'variant'> & {
3
4
  selected?: boolean;
4
5
  };
5
- export declare const ToggleButton: ({ selected, role, ...props }: ToggleButtonProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const ToggleButton: React.ForwardRefExoticComponent<Omit<ButtonProps, "variant"> & {
7
+ selected?: boolean;
8
+ } & React.RefAttributes<(<T extends React.ElementType = "button">(props: {
9
+ as?: T | undefined;
10
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
11
+ variant?: "primary" | "secondary" | "tertiary";
12
+ scheme?: "default" | "negative" | "positive" | "warning";
13
+ minWidth?: React.CSSProperties["minWidth"];
14
+ maxWidth?: React.CSSProperties["maxWidth"];
15
+ busy?: boolean;
16
+ title?: React.ReactNode;
17
+ icon?: React.ReactElement;
18
+ iconPosition?: "start" | "end";
19
+ } & Omit<React.PropsWithoutRef<React.ComponentProps<T>>, "title" | "size" | "as" | "icon" | "scheme" | "minWidth" | "maxWidth" | "variant" | "busy" | "iconPosition"> & React.RefAttributes<unknown>) => React.ReactElement | null)>>;
@@ -1,16 +1,21 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { Button as t } from "../Button/Button.js";
3
- const n = ({ selected: a = !1, role: o, ...r }) => /* @__PURE__ */ i(
4
- t,
5
- {
6
- ...r,
7
- role: o,
8
- "aria-checked": o === "radio" ? a : void 0,
9
- "aria-pressed": o !== "radio" ? a : void 0,
10
- "data-selected": a,
11
- variant: a ? "primary" : "secondary"
12
- }
2
+ import d from "react";
3
+ import { Button as f } from "../Button/Button.js";
4
+ const e = d.forwardRef(
5
+ ({ selected: a = !1, role: o, ...r }, t) => /* @__PURE__ */ i(
6
+ f,
7
+ {
8
+ ...r,
9
+ ref: t,
10
+ role: o,
11
+ "data-toggle-button": !0,
12
+ "data-selected": a,
13
+ variant: a ? "primary" : "secondary",
14
+ "aria-checked": o === "radio" ? a : void 0,
15
+ "aria-pressed": o !== "radio" ? a : void 0
16
+ }
17
+ )
13
18
  );
14
19
  export {
15
- n as ToggleButton
20
+ e as ToggleButton
16
21
  };
@@ -1,43 +1,46 @@
1
- import { jsx as _ } from "react/jsx-runtime";
2
- import e from "react";
3
- import x from "classnames";
4
- import { cssProps as h } from "../../utils/helpers.js";
5
- const k = "ToggleButton_group_yo9Nc", t = {
6
- group: k
7
- }, T = ({
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import t from "react";
3
+ import { Composite as _, CompositeItem as x } from "@floating-ui/react";
4
+ import h from "classnames";
5
+ import { cssProps as k } from "../../utils/helpers.js";
6
+ const B = "ToggleButton_group_yo9Nc", l = {
7
+ group: B
8
+ }, E = ({
8
9
  variant: o = "inline",
9
- selected: l,
10
- disabled: s,
11
- equalWidth: c,
12
- minWidth: p,
13
- maxWidth: i,
10
+ selected: s,
11
+ disabled: p,
12
+ equalWidth: i,
13
+ minWidth: m,
14
+ maxWidth: c,
14
15
  className: n,
15
16
  style: g,
16
- children: m,
17
- onSelect: u,
18
- ...d
17
+ children: u,
18
+ onSelect: d,
19
+ ...a
19
20
  }) => {
20
- const a = o === "block" ? "flex" : void 0, f = c ? "0" : void 0;
21
- return /* @__PURE__ */ _(
22
- "div",
21
+ const f = o === "block" ? "flex" : void 0, y = i ? "0" : void 0;
22
+ return /* @__PURE__ */ e(
23
+ _,
23
24
  {
24
- ...d,
25
+ ...a,
25
26
  role: "radiogroup",
26
27
  "data-toggle-group": !0,
27
- className: x(t.group, t[o], n),
28
- style: { ...g, ...h({ display: a, flexBasis: f, minWidth: p, maxWidth: i }) },
29
- children: e.Children.map(
30
- m,
31
- (y, r) => e.cloneElement(y, {
32
- role: "radio",
33
- disabled: s,
34
- selected: r === l,
35
- onClick: () => u(r)
36
- })
37
- )
28
+ className: h(l.group, l[o], n),
29
+ style: { ...g, ...k({ display: f, flexBasis: y, minWidth: m, maxWidth: c }) },
30
+ children: t.Children.map(u, (C, r) => /* @__PURE__ */ e(
31
+ x,
32
+ {
33
+ render: t.cloneElement(C, {
34
+ role: "radio",
35
+ disabled: p,
36
+ selected: r === s,
37
+ onClick: () => d(r)
38
+ })
39
+ }
40
+ ))
38
41
  }
39
42
  );
40
43
  };
41
44
  export {
42
- T as ToggleGroup
45
+ E as ToggleGroup
43
46
  };
@@ -1,12 +1,12 @@
1
- import { jsxs as m, Fragment as S, jsx as f } from "react/jsx-runtime";
1
+ import { jsxs as m, Fragment as S, jsx as a } from "react/jsx-runtime";
2
2
  import j, { useRef as w, useState as g, useEffect as R } from "react";
3
3
  import k from "classnames";
4
4
  import { useFloating as C, offset as U, flip as W, shift as b, arrow as A, autoUpdate as B, useInteractions as D, useDismiss as H, useRole as I, useHover as V, useFocus as $, useClick as q, useMergeRefs as z, FloatingPortal as G, FloatingArrow as J } from "@floating-ui/react";
5
- const K = "Tooltip_tooltip_u1Uix", L = "Tooltip_arrow_NBFiV", Q = "Tooltip_content_lfpfM", a = {
5
+ const K = "Tooltip_tooltip_u1Uix", L = "Tooltip_arrow_NBFiV", Q = "Tooltip_content_lfpfM", f = {
6
6
  tooltip: K,
7
7
  arrow: L,
8
8
  content: Q
9
- }, te = ({
9
+ }, et = ({
10
10
  trigger: r = "hover focus",
11
11
  placement: c = "top",
12
12
  anchor: l,
@@ -18,7 +18,7 @@ const K = "Tooltip_tooltip_u1Uix", L = "Tooltip_arrow_NBFiV", Q = "Tooltip_conte
18
18
  children: o,
19
19
  ...x
20
20
  }) => {
21
- const u = w(null), p = w(null), [d, O] = g(!1), [N, P] = g(!1), { refs: e, context: t, floatingStyles: T } = C({
21
+ const u = w(null), p = w(null), [d, O] = g(!1), [N, P] = g(!1), { refs: t, context: e, floatingStyles: T } = C({
22
22
  open: d,
23
23
  placement: c,
24
24
  onOpenChange: O,
@@ -32,50 +32,50 @@ const K = "Tooltip_tooltip_u1Uix", L = "Tooltip_arrow_NBFiV", Q = "Tooltip_conte
32
32
  ), { element: u, padding: 8 }))
33
33
  ]
34
34
  }), { getReferenceProps: y, getFloatingProps: E } = D([
35
- H(t),
36
- I(t, { role: "tooltip" }),
37
- V(t, { move: !1, enabled: r.includes("hover") }),
38
- $(t, { enabled: r.includes("focus") }),
39
- q(t, { enabled: r.includes("click") })
35
+ H(e),
36
+ I(e, { role: "tooltip" }),
37
+ V(e, { move: !1, enabled: r.includes("hover") }),
38
+ $(e, { enabled: r.includes("focus") }),
39
+ q(e, { enabled: r.includes("click") })
40
40
  ]), M = z([
41
- e.setReference,
41
+ t.setReference,
42
42
  "ref" in o ? o.ref : null
43
43
  ]);
44
44
  return R(() => {
45
45
  var n;
46
- const s = (n = e.domReference.current) == null ? void 0 : n.closest("[data-floating-root]");
46
+ const s = (n = t.domReference.current) == null ? void 0 : n.closest("[data-floating-root]");
47
47
  !i && s && (p.current = s);
48
- }, [e, i]), R(() => {
49
- l && e.setPositionReference(l);
50
- }, [e, l]), i ? o : /* @__PURE__ */ m(S, { children: [
48
+ }, [t, i]), R(() => {
49
+ l && t.setPositionReference(l);
50
+ }, [t, l]), i ? o : /* @__PURE__ */ m(S, { children: [
51
51
  j.cloneElement(o, y({ ref: M, ...o.props })),
52
- d && /* @__PURE__ */ f(G, { root: p, children: /* @__PURE__ */ m(
52
+ d && /* @__PURE__ */ a(G, { root: p, children: /* @__PURE__ */ m(
53
53
  "div",
54
54
  {
55
55
  ...x,
56
- ref: e.setFloating,
56
+ ref: t.setFloating,
57
57
  "data-tooltip": c,
58
- className: k(a.tooltip, v),
58
+ className: k(f.tooltip, v),
59
59
  style: { ...T, minWidth: F, maxWidth: _ },
60
60
  ...E(),
61
61
  children: [
62
- /* @__PURE__ */ f(
62
+ /* @__PURE__ */ a(
63
63
  J,
64
64
  {
65
65
  width: 12,
66
66
  height: 6,
67
67
  ref: u,
68
- context: t,
69
- className: a.arrow,
68
+ context: e,
69
+ className: f.arrow,
70
70
  staticOffset: N ? 8 : null
71
71
  }
72
72
  ),
73
- /* @__PURE__ */ f("div", { className: a.content, children: h })
73
+ /* @__PURE__ */ a("div", { "data-tooltip-content": !0, className: f.content, children: h })
74
74
  ]
75
75
  }
76
76
  ) })
77
77
  ] });
78
78
  };
79
79
  export {
80
- te as Tooltip
80
+ et as Tooltip
81
81
  };
@@ -5,10 +5,11 @@ $font-family: (
5
5
  );
6
6
 
7
7
  $font-weight: (
8
- normal: 400,
9
- medium: 600,
10
- bold: 700,
11
- black: 800,
8
+ normal: 400,
9
+ medium: 600,
10
+ bold: 700,
11
+ black: 800,
12
+ heading: 700,
12
13
  );
13
14
 
14
15
  $font-size: (
@@ -66,11 +67,11 @@ $ease-out-bounce: cubic-bezier(0.1, 1.3, 0.7, 1.1);
66
67
  $light-colors: (
67
68
  black: #000000,
68
69
  white: #FFFFFF,
69
- fg: #191919,
70
+ fg: #101010,
70
71
  bg: #FFFFFF,
72
+ input: #FFFFFF,
71
73
  popup: #FFFFFF,
72
74
  dialog: #FFFFFF,
73
- input: #FFFFFF,
74
75
  backdrop: rgb(0 0 0 / 50%),
75
76
  focus: var(--color-accent-400),
76
77
  link: var(--color-blue-500),
@@ -79,28 +80,28 @@ $light-colors: (
79
80
  );
80
81
 
81
82
  $dark-colors: (
82
- fg: #E6E6E6,
83
- bg: #161616,
84
- popup: #262626,
83
+ fg: #F0F0F0,
84
+ bg: #131313,
85
+ input: #0C0C0C,
86
+ popup: #202020,
85
87
  dialog: #191919,
86
- input: #101010,
87
- backdrop: rgb(0 0 0 / 65%),
88
+ backdrop: rgb(0 0 0 / 70%),
88
89
  );
89
90
 
90
91
  $light-palette: (
91
92
  colors: (
92
- gray: #8E8E99,
93
- red: #FF3B30,
94
- orange: #FF9500,
95
- yellow: #FFCC00,
96
- green: #34C759,
97
- teal: #30B0C7,
98
- cyan: #32ADE6,
99
- blue: #007AFF,
100
- indigo: #5856D6,
101
- purple: #AF52DE,
102
- brown: #A2845E,
103
- accent: #007AFF,
93
+ gray: #8D8D96,
94
+ brown: #A08060,
95
+ red: #F03020,
96
+ orange: #FF8000,
97
+ yellow: #FFBB00,
98
+ green: #20B610,
99
+ teal: #30B0C0,
100
+ cyan: #30B0F0,
101
+ blue: #0070F7,
102
+ indigo: #6056ED,
103
+ purple: #A949D9,
104
+ accent: #0070F7,
104
105
  ),
105
106
  tints: (
106
107
  50: 95%,
@@ -117,18 +118,18 @@ $light-palette: (
117
118
 
118
119
  $dark-palette: (
119
120
  colors: (
120
- gray: #737380,
121
- red: #FF453A,
122
- orange: #FF9E0B,
123
- yellow: #FED709,
124
- green: #31D158,
125
- teal: #40C8E0,
126
- cyan: #64D3FF,
127
- blue: #0B84FF,
128
- indigo: #5E5CE6,
129
- purple: #BF5AF2,
130
- brown: #AC8E68,
131
- accent: #0B84FF,
121
+ gray: #656573,
122
+ brown: #A08060,
123
+ red: #F03020,
124
+ orange: #FF8000,
125
+ yellow: #FFBB00,
126
+ green: #20B610,
127
+ teal: #30B0C0,
128
+ cyan: #30B0F0,
129
+ blue: #0080FF,
130
+ indigo: #7369FF,
131
+ purple: #B353E3,
132
+ accent: #0080FF,
132
133
  ),
133
134
  tints: (
134
135
  50: 95%,