tabler-react-2 0.1.164 → 0.1.165

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.
@@ -40,23 +40,8 @@ var Checkbox = exports.Checkbox = function Checkbox(_ref) {
40
40
  }
41
41
  onChange(e.target.checked);
42
42
  };
43
-
44
- // Standalone (wrapped) checkbox gets visible partial styling
45
- var partialInputStyle = !naked && isPartial ? {
46
- outline: "2px dashed var(--tblr-primary, #0a837f)",
47
- outlineOffset: 2,
48
- borderColor: "var(--tblr-primary, #0a837f)",
49
- backgroundColor: "rgba(10, 131, 127, 0.12)",
50
- backgroundImage: "linear-gradient(to bottom, transparent calc(50% - 1px), var(--tblr-primary, #0a837f) 0, var(--tblr-primary, #0a837f) 2px, transparent 0)",
51
- backgroundRepeat: "no-repeat",
52
- backgroundSize: "70% 100%",
53
- backgroundPosition: "center",
54
- accentColor: "var(--tblr-primary, #0a837f)",
55
- cursor: "pointer"
56
- } : undefined;
57
43
  if (naked) {
58
- // IMPORTANT: no visual styling here; in EnclosedSelectGroup the input is hidden by CSS
59
- // and the label provides the visible UI. We keep it clean to avoid breaking that.
44
+ // Keep naked input visually unopinionated so containers (like EnclosedSelectGroup) can style it.
60
45
  return /*#__PURE__*/_react["default"].createElement("input", _extends({
61
46
  ref: ref,
62
47
  type: "checkbox",
@@ -66,6 +51,25 @@ var Checkbox = exports.Checkbox = function Checkbox(_ref) {
66
51
  onChange: handleChange
67
52
  }, props));
68
53
  }
54
+
55
+ // Visible (wrapped) checkbox: PARTIAL = subtle gray background + centered dash icon.
56
+ var inputStyle = isPartial ? {
57
+ backgroundColor: "rgba(0,0,0,0.08)",
58
+ borderColor: "rgba(0,0,0,0.25)",
59
+ boxShadow: "inset 0 0 0 1px rgba(0,0,0,0.05)",
60
+ outline: "none"
61
+ } : undefined;
62
+ var dashStyle = isPartial ? {
63
+ position: "absolute",
64
+ top: "50%",
65
+ left: "50%",
66
+ transform: "translate(-50%, -50%)",
67
+ width: 12,
68
+ height: 2,
69
+ background: "rgba(0,0,0,0.6)",
70
+ borderRadius: 1,
71
+ pointerEvents: "none"
72
+ } : undefined;
69
73
  return /*#__PURE__*/_react["default"].createElement("label", _extends({
70
74
  className: (0, _classnames["default"])("form-check", className),
71
75
  style: {
@@ -73,15 +77,23 @@ var Checkbox = exports.Checkbox = function Checkbox(_ref) {
73
77
  alignItems: "center",
74
78
  gap: 8
75
79
  }
76
- }, props), /*#__PURE__*/_react["default"].createElement("input", {
80
+ }, props), /*#__PURE__*/_react["default"].createElement("span", {
81
+ style: {
82
+ position: "relative",
83
+ display: "inline-block"
84
+ }
85
+ }, /*#__PURE__*/_react["default"].createElement("input", {
77
86
  ref: ref,
78
87
  className: (0, _classnames["default"])("form-check-input"),
79
88
  type: "checkbox",
80
89
  checked: Boolean(value) && !isPartial,
81
90
  "aria-checked": isPartial ? "mixed" : Boolean(value),
82
91
  onChange: handleChange,
83
- style: partialInputStyle
84
- }), label && /*#__PURE__*/_react["default"].createElement("span", {
92
+ style: inputStyle
93
+ }), isPartial && /*#__PURE__*/_react["default"].createElement("span", {
94
+ "aria-hidden": true,
95
+ style: dashStyle
96
+ })), label && /*#__PURE__*/_react["default"].createElement("span", {
85
97
  className: (0, _classnames["default"])("form-check-label", {
86
98
  required: required
87
99
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabler-react-2",
3
- "version": "0.1.164",
3
+ "version": "0.1.165",
4
4
  "description": "A react implementation of Tabler ui",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {