@versini/ui-button 1.0.0 → 1.0.2

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,22 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import i from "react";
3
+ const u = (t, r, n) => {
4
+ var o;
5
+ !r && (!document.activeElement || document.activeElement !== t.currentTarget) && typeof ((o = t == null ? void 0 : t.currentTarget) == null ? void 0 : o.focus) == "function" && t.currentTarget.focus(), typeof n == "function" && n(t);
6
+ }, f = i.forwardRef((t, r) => {
7
+ const { onClick: n, noInternalClick: o = !1, ...e } = t;
8
+ return /* @__PURE__ */ a(
9
+ "button",
10
+ {
11
+ ref: r,
12
+ onClick: (c) => {
13
+ u(c, o, n);
14
+ },
15
+ ...e
16
+ }
17
+ );
18
+ });
19
+ f.displayName = "BaseButton";
20
+ export {
21
+ f as BaseButton_private
22
+ };
@@ -1,5 +1,5 @@
1
1
  import a from "clsx";
2
- const p = (t) => {
2
+ const s = "av-button", p = (t) => {
3
3
  let e = "";
4
4
  if (typeof t == "number" || typeof t == "string")
5
5
  e = "m-" + t;
@@ -8,7 +8,7 @@ const p = (t) => {
8
8
  (t == null ? void 0 : t.t) !== void 0 && r.push(`mt-${t.t}`), (t == null ? void 0 : t.r) !== void 0 && r.push(`mr-${t.r}`), (t == null ? void 0 : t.b) !== void 0 && r.push(`mb-${t.b}`), (t == null ? void 0 : t.l) !== void 0 && r.push(`ml-${t.l}`), e = r.join(" ");
9
9
  }
10
10
  return e;
11
- }, s = "av-button", f = "icon", x = "button", m = "link", C = ({
11
+ }, f = "icon", x = "button", m = "link", C = ({
12
12
  type: t,
13
13
  size: e,
14
14
  labelRight: r,
@@ -196,6 +196,7 @@ const p = (t) => {
196
196
  }
197
197
  ));
198
198
  export {
199
+ s as BUTTON_CLASSNAME,
199
200
  x as TYPE_BUTTON,
200
201
  f as TYPE_ICON,
201
202
  m as TYPE_LINK,
@@ -1,36 +1,36 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
2
  import N from "react";
3
- import { BaseButton as T } from "../../chunks/BaseButton.D-AA7SPL.js";
4
- import { getButtonClasses as x, TYPE_BUTTON as C } from "../../chunks/utilities.CSwQTOog.js";
3
+ import { BaseButton_private as T } from "../../chunks/BaseButton.BFKIL4GO.js";
4
+ import { getButtonClasses as x, TYPE_BUTTON as C } from "../../chunks/utilities.u8fHoETw.js";
5
5
  const R = N.forwardRef(
6
6
  ({
7
7
  children: s,
8
8
  disabled: t = !1,
9
9
  mode: e = "system",
10
10
  focusMode: o = "system",
11
- fullWidth: m = !1,
12
- className: r,
13
- size: a = "medium",
11
+ fullWidth: r = !1,
12
+ className: a,
13
+ size: m = "medium",
14
14
  raw: f = !1,
15
- noBorder: l = !1,
16
- spacing: n,
17
- variant: p = "primary",
18
- noTruncate: u = !1,
19
- ...i
15
+ noBorder: p = !1,
16
+ spacing: l,
17
+ variant: n = "primary",
18
+ noTruncate: i = !1,
19
+ ...u
20
20
  }, B) => {
21
21
  const y = x({
22
22
  type: C,
23
23
  mode: e,
24
24
  focusMode: o,
25
- fullWidth: m,
25
+ fullWidth: r,
26
26
  disabled: t,
27
27
  raw: f,
28
- className: r,
29
- size: a,
30
- noBorder: l,
31
- spacing: n,
32
- variant: p,
33
- noTruncate: u
28
+ className: a,
29
+ size: m,
30
+ noBorder: p,
31
+ spacing: l,
32
+ variant: n,
33
+ noTruncate: i
34
34
  });
35
35
  return /* @__PURE__ */ c(
36
36
  T,
@@ -38,7 +38,7 @@ const R = N.forwardRef(
38
38
  ref: B,
39
39
  className: y,
40
40
  disabled: t,
41
- ...i,
41
+ ...u,
42
42
  children: s
43
43
  }
44
44
  );
@@ -1,16 +1,16 @@
1
- import { jsxs as g, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as c } from "react/jsx-runtime";
2
2
  import I from "clsx";
3
3
  import j from "react";
4
- import { BaseButton as v } from "../../chunks/BaseButton.D-AA7SPL.js";
5
- import { getButtonClasses as E, TYPE_ICON as O } from "../../chunks/utilities.CSwQTOog.js";
6
- const P = j.forwardRef(
4
+ import { BaseButton_private as v } from "../../chunks/BaseButton.BFKIL4GO.js";
5
+ import { getButtonClasses as _, TYPE_ICON as E } from "../../chunks/utilities.u8fHoETw.js";
6
+ const O = j.forwardRef(
7
7
  ({
8
8
  children: r,
9
9
  disabled: o = !1,
10
10
  mode: t = "system",
11
11
  focusMode: n = "system",
12
- fullWidth: l = !1,
13
- className: p,
12
+ fullWidth: p = !1,
13
+ className: l,
14
14
  type: m = "button",
15
15
  raw: s = !1,
16
16
  noBorder: i = !1,
@@ -18,24 +18,24 @@ const P = j.forwardRef(
18
18
  label: f,
19
19
  size: x = "medium",
20
20
  labelRight: a,
21
- labelLeft: c,
21
+ labelLeft: e,
22
22
  spacing: u,
23
23
  noBackground: d = !1,
24
24
  align: k = "center",
25
25
  ...N
26
26
  }, h) => {
27
- const B = E({
28
- type: O,
27
+ const B = _({
28
+ type: E,
29
29
  mode: t,
30
30
  focusMode: n,
31
- fullWidth: l,
31
+ fullWidth: p,
32
32
  disabled: o,
33
33
  raw: s,
34
- className: p,
34
+ className: l,
35
35
  noBorder: i,
36
36
  size: x,
37
37
  labelRight: a,
38
- labelLeft: c,
38
+ labelLeft: e,
39
39
  spacing: u,
40
40
  noBackground: d,
41
41
  align: k
@@ -55,15 +55,15 @@ const P = j.forwardRef(
55
55
  "aria-label": y || f,
56
56
  ...N,
57
57
  children: [
58
- c && /* @__PURE__ */ e("span", { className: "pr-2", children: c }),
59
- /* @__PURE__ */ e("div", { className: C, children: r }),
60
- a && /* @__PURE__ */ e("span", { className: "pl-2", children: a })
58
+ e && /* @__PURE__ */ c("span", { className: "pr-2", children: e }),
59
+ /* @__PURE__ */ c("div", { className: C, children: r }),
60
+ a && /* @__PURE__ */ c("span", { className: "pl-2", children: a })
61
61
  ]
62
62
  }
63
63
  );
64
64
  }
65
65
  );
66
- P.displayName = "ButtonIcon";
66
+ O.displayName = "ButtonIcon";
67
67
  export {
68
- P as ButtonIcon
68
+ O as ButtonIcon
69
69
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
2
  import b from "clsx";
3
3
  import v from "react";
4
- import { getButtonClasses as V, TYPE_LINK as C } from "../../chunks/utilities.CSwQTOog.js";
4
+ import { getButtonClasses as V, TYPE_LINK as C } from "../../chunks/utilities.u8fHoETw.js";
5
5
  const L = v.forwardRef(
6
6
  ({
7
7
  children: r,
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import * as _versini_ui_private_dist_utilities from '@versini/ui-private/dist/utilities';
2
2
  import React from 'react';
3
3
 
4
+ declare const BUTTON_CLASSNAME = "av-button";
5
+
4
6
  declare const Button: React.ForwardRefExoticComponent<{
5
7
  children: React.ReactNode;
6
8
  disabled?: boolean;
@@ -55,7 +57,7 @@ declare const ButtonLink: React.ForwardRefExoticComponent<{
55
57
  size?: "small" | "medium" | "large";
56
58
  } & _versini_ui_private_dist_utilities.SpacingProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLAnchorElement>>;
57
59
 
58
- declare const ButtonSort: React.ForwardRefExoticComponent<{
60
+ declare const ButtonSort_private: React.ForwardRefExoticComponent<{
59
61
  active?: boolean;
60
62
  } & {
61
63
  children: React.ReactNode;
@@ -75,4 +77,4 @@ declare const ButtonSort: React.ForwardRefExoticComponent<{
75
77
  size?: "small" | "medium" | "large";
76
78
  } & _versini_ui_private_dist_utilities.SpacingProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
77
79
 
78
- export { Button, ButtonIcon, ButtonLink, ButtonSort as ButtonSort_private };
80
+ export { BUTTON_CLASSNAME, Button, ButtonIcon, ButtonLink, ButtonSort_private };
package/dist/index.js CHANGED
@@ -1,30 +1,31 @@
1
- import { Button as D } from "./components/Button/Button.js";
2
- import { ButtonIcon as q } from "./components/Button/ButtonIcon.js";
3
- import { ButtonLink as A } from "./components/Button/ButtonLink.js";
4
- import { jsx as e, jsxs as T } from "react/jsx-runtime";
5
- import n from "clsx";
6
- import v from "react";
7
- import { getButtonClasses as C, TYPE_ICON as S } from "./chunks/utilities.CSwQTOog.js";
8
- import { BaseButton as E } from "./chunks/BaseButton.D-AA7SPL.js";
1
+ import { getButtonClasses as I, TYPE_ICON as v } from "./chunks/utilities.u8fHoETw.js";
2
+ import { BUTTON_CLASSNAME as V } from "./chunks/utilities.u8fHoETw.js";
3
+ import { Button as Y } from "./components/Button/Button.js";
4
+ import { ButtonIcon as z } from "./components/Button/ButtonIcon.js";
5
+ import { ButtonLink as G } from "./components/Button/ButtonLink.js";
6
+ import { jsx as e, jsxs as C } from "react/jsx-runtime";
7
+ import c from "clsx";
8
+ import S from "react";
9
+ import { BaseButton_private as E } from "./chunks/BaseButton.BFKIL4GO.js";
9
10
  /*!
10
- @versini/ui-button v1.0.0
11
+ @versini/ui-button v1.0.2
11
12
  © 2024 gizmette.com
12
13
  */
13
14
  try {
14
15
  window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
15
- version: "1.0.0",
16
- buildTime: "09/15/2024 07:01 PM EDT",
16
+ version: "1.0.2",
17
+ buildTime: "09/16/2024 06:30 PM EDT",
17
18
  homepage: "https://github.com/aversini/ui-components",
18
19
  license: "MIT"
19
20
  });
20
21
  } catch {
21
22
  }
22
- const U = v.forwardRef(
23
+ const U = S.forwardRef(
23
24
  ({
24
25
  children: o,
25
26
  disabled: i = !1,
26
27
  mode: t = "system",
27
- focusMode: c = "system",
28
+ focusMode: n = "system",
28
29
  fullWidth: l = !1,
29
30
  className: f,
30
31
  type: p = "button",
@@ -32,36 +33,36 @@ const U = v.forwardRef(
32
33
  noBorder: m = !1,
33
34
  "aria-label": d,
34
35
  label: b,
35
- size: u = "medium",
36
+ size: h = "medium",
36
37
  labelRight: a,
37
38
  labelLeft: s,
38
- spacing: h,
39
- noBackground: y = !1,
39
+ spacing: u,
40
+ noBackground: _ = !1,
40
41
  align: x = "center",
41
- active: _ = !1,
42
+ active: y = !1,
42
43
  ...k
43
- }, B) => {
44
- const N = C({
45
- type: S,
44
+ }, N) => {
45
+ const B = I({
46
+ type: v,
46
47
  mode: t,
47
- focusMode: c,
48
+ focusMode: n,
48
49
  fullWidth: l,
49
50
  disabled: i,
50
51
  raw: r,
51
52
  className: f,
52
53
  noBorder: m,
53
- size: u,
54
+ size: h,
54
55
  labelRight: a,
55
56
  labelLeft: s,
56
- spacing: h,
57
- noBackground: y,
57
+ spacing: u,
58
+ noBackground: _,
58
59
  align: x
59
- }), g = n({
60
+ }), g = c({
60
61
  "text-copy-accent-dark": t === "light" && !r,
61
62
  "text-copy-light": t === "dark" && !r,
62
63
  "text-copy-accent-dark dark:text-copy-light": t === "alt-system" && !r,
63
64
  "text-copy-light dark:text-copy-accent-dark": t === "system" && !r
64
- }), I = _ ? n(
65
+ }), T = y ? c(
65
66
  "relative",
66
67
  "focus-within:static",
67
68
  "focus-within:after:border-transparent",
@@ -78,11 +79,11 @@ const U = v.forwardRef(
78
79
  "after:border-table-light dark:after:border-table-dark": t === "alt-system"
79
80
  }
80
81
  ) : "";
81
- return /* @__PURE__ */ e("div", { className: I, children: /* @__PURE__ */ T(
82
+ return /* @__PURE__ */ e("div", { className: T, children: /* @__PURE__ */ C(
82
83
  E,
83
84
  {
84
- ref: B,
85
- className: N,
85
+ ref: N,
86
+ className: B,
86
87
  disabled: i,
87
88
  type: p,
88
89
  "aria-label": d || b,
@@ -98,8 +99,9 @@ const U = v.forwardRef(
98
99
  );
99
100
  U.displayName = "ButtonSort";
100
101
  export {
101
- D as Button,
102
- q as ButtonIcon,
103
- A as ButtonLink,
102
+ V as BUTTON_CLASSNAME,
103
+ Y as Button,
104
+ z as ButtonIcon,
105
+ G as ButtonLink,
104
106
  U as ButtonSort_private
105
107
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-button",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -38,17 +38,17 @@
38
38
  "react-dom": "^18.3.1"
39
39
  },
40
40
  "devDependencies": {
41
- "@versini/ui-icons": "1.12.0",
42
- "@versini/ui-styles": "1.9.6"
41
+ "@versini/ui-icons": "1.12.1",
42
+ "@versini/ui-styles": "1.9.7"
43
43
  },
44
44
  "dependencies": {
45
45
  "@tailwindcss/typography": "0.5.15",
46
- "@versini/ui-private": "1.4.8",
46
+ "@versini/ui-private": "1.4.9",
47
47
  "clsx": "2.1.1",
48
48
  "tailwindcss": "3.4.11"
49
49
  },
50
50
  "sideEffects": [
51
51
  "**/*.css"
52
52
  ],
53
- "gitHead": "39b8726f31198a8abfb9583d790d6793665c2534"
53
+ "gitHead": "cdc7c10fb6b8a5bbef5087c0a82a790476d424db"
54
54
  }
@@ -1,24 +0,0 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import u from "react";
3
- const f = (t, r, n) => {
4
- var o;
5
- !r && (!document.activeElement || document.activeElement !== t.currentTarget) && typeof ((o = t == null ? void 0 : t.currentTarget) == null ? void 0 : o.focus) == "function" && t.currentTarget.focus(), typeof n == "function" && n(t);
6
- }, i = u.forwardRef(
7
- (t, r) => {
8
- const { onClick: n, noInternalClick: o = !1, ...e } = t;
9
- return /* @__PURE__ */ a(
10
- "button",
11
- {
12
- ref: r,
13
- onClick: (c) => {
14
- f(c, o, n);
15
- },
16
- ...e
17
- }
18
- );
19
- }
20
- );
21
- i.displayName = "BaseButton";
22
- export {
23
- i as BaseButton
24
- };