@companix/uikit 0.0.45 → 0.0.47

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.
@@ -20,11 +20,14 @@
20
20
  }
21
21
 
22
22
  &[data-loading] {
23
- @include mixins.use-styles(button, $appearance, $mode, loading);
23
+ &:hover,
24
+ &[data-active],
25
+ &:active {
26
+ @include mixins.use-styles(button, $appearance, $mode, enabled);
27
+ }
24
28
  }
25
29
 
26
30
  &[disabled] {
27
- cursor: not-allowed;
28
31
  @include mixins.use-styles(button, $appearance, $mode, disabled);
29
32
  }
30
33
  }
@@ -71,6 +74,12 @@
71
74
  width: 100%;
72
75
  }
73
76
 
77
+ // disabled
78
+
79
+ &[disabled] {
80
+ cursor: not-allowed;
81
+ }
82
+
74
83
  // align
75
84
 
76
85
  &[data-align='center'] {
@@ -125,4 +134,19 @@
125
134
  @include use-appearance(neutral);
126
135
  @include use-appearance(negative);
127
136
  @include use-appearance(positive);
137
+
138
+ &[data-loading] {
139
+ cursor: progress;
140
+ position: relative;
141
+
142
+ .button-text {
143
+ visibility: hidden;
144
+ }
145
+
146
+ .button-spinner {
147
+ position: absolute;
148
+ margin: 0;
149
+ color: inherit;
150
+ }
151
+ }
128
152
  }
@@ -1,42 +1,45 @@
1
- import { jsx as e, jsxs as x, Fragment as j } from "react/jsx-runtime";
2
- import k from "classnames";
3
- import { Spinner as z } from "./bundle.es6.js";
4
- import { forwardRef as N } from "react";
5
- import { attr as r } from "@companix/utils-browser";
6
- const F = N(
1
+ import { jsx as a, jsxs as i, Fragment as l } from "react/jsx-runtime";
2
+ import h from "classnames";
3
+ import { Spinner as j } from "./bundle.es6.js";
4
+ import { forwardRef as k } from "react";
5
+ import { attr as d } from "@companix/utils-browser";
6
+ const F = k(
7
7
  ({
8
- children: d,
9
- fill: l,
10
- text: m,
11
- active: c,
12
- mode: f = "default",
13
- appearance: s = "neutral",
14
- size: p = "md",
15
- align: u,
16
- icon: n,
8
+ children: e,
9
+ fill: c,
10
+ text: r,
11
+ active: f,
12
+ mode: p = "default",
13
+ appearance: u = "neutral",
14
+ size: b = "md",
15
+ align: N,
16
+ icon: m,
17
17
  loading: t,
18
- className: b,
18
+ className: v,
19
19
  iconRight: o,
20
- Component: i = "button",
21
- ...a
22
- }, v) => /* @__PURE__ */ e(
23
- i,
20
+ Component: s = "button",
21
+ ...n
22
+ }, x) => /* @__PURE__ */ a(
23
+ s,
24
24
  {
25
- ref: v,
26
- className: k("button", b),
27
- "data-size": p,
28
- "data-loading": r(t),
29
- "data-align": t ? "center" : u ?? (n && o ? "left" : "center"),
30
- "data-appearance": s,
31
- "data-mode": f,
32
- "data-fill": r(l),
33
- "data-active": r(c),
34
- type: i === "button" ? "button" : void 0,
35
- ...a,
36
- onClick: t ?? a.disabled ? void 0 : a.onClick,
37
- children: t ? /* @__PURE__ */ e(z, { size: 14 }) : /* @__PURE__ */ x(j, { children: [
38
- n,
39
- (d ?? m) && /* @__PURE__ */ e("span", { className: "button-text", children: m ?? d }),
25
+ ref: x,
26
+ className: h("button", v),
27
+ "data-size": b,
28
+ "data-loading": d(t),
29
+ "data-align": t ? "center" : N ?? (m && o ? "left" : "center"),
30
+ "data-appearance": u,
31
+ "data-mode": p,
32
+ "data-fill": d(c),
33
+ "data-active": d(f),
34
+ type: s === "button" ? "button" : void 0,
35
+ ...n,
36
+ onClick: t ?? n.disabled ? void 0 : n.onClick,
37
+ children: t ? /* @__PURE__ */ i(l, { children: [
38
+ /* @__PURE__ */ a(j, { size: 16, className: "button-spinner" }),
39
+ /* @__PURE__ */ a("span", { className: "button-text", children: r ?? e })
40
+ ] }) : /* @__PURE__ */ i(l, { children: [
41
+ m,
42
+ (e ?? r) && /* @__PURE__ */ a("span", { className: "button-text", children: r ?? e }),
40
43
  o
41
44
  ] })
42
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companix/uikit",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "main": "./dist/bundle.es.js",
5
5
  "module": "./dist/bundle.es.js",
6
6
  "types": "./dist/index.d.ts",