@pittorica/radio-react 0.23.0 → 0.23.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.
package/dist/Radio.d.ts CHANGED
@@ -8,6 +8,7 @@ export interface RadioProps extends Omit<BoxProps, 'onChange'> {
8
8
  /** @default 'indigo' */
9
9
  color?: PittoricaColor;
10
10
  value?: string;
11
+ name?: string;
11
12
  onCheckedChange?: (checked: boolean) => void;
12
13
  ref?: Ref<HTMLButtonElement>;
13
14
  }
@@ -15,7 +16,7 @@ export interface RadioProps extends Omit<BoxProps, 'onChange'> {
15
16
  * Primitive Radio component.
16
17
  */
17
18
  export declare const Radio: {
18
- ({ checked, disabled, color, className, style, onCheckedChange, ref, ...props }: RadioProps): import("react/jsx-runtime").JSX.Element;
19
+ ({ checked, disabled, color, className, style, onCheckedChange, name, ref, ...props }: RadioProps): import("react/jsx-runtime").JSX.Element;
19
20
  displayName: string;
20
21
  };
21
22
  //# sourceMappingURL=Radio.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../src/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,GAAG,EAAa,MAAM,OAAO,CAAC;AAMhE,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wBAAwB;IACxB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,KAAK;qFASf,UAAU;;CA+BZ,CAAC"}
1
+ {"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../src/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,GAAG,EAAa,MAAM,OAAO,CAAC;AAMhE,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wBAAwB;IACxB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,KAAK;2FAUf,UAAU;;CAgCZ,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as h } from "react/jsx-runtime";
2
- import { forwardRef as z, createElement as v } from "react";
2
+ import { forwardRef as I, createElement as v } from "react";
3
3
  function b(t) {
4
4
  var e, i, r = "";
5
5
  if (typeof t == "string" || typeof t == "number") r += t;
@@ -9,7 +9,7 @@ function b(t) {
9
9
  } else for (i in t) t[i] && (r && (r += " "), r += i);
10
10
  return r;
11
11
  }
12
- function T() {
12
+ function M() {
13
13
  for (var t, e, i = 0, r = "", a = arguments.length; i < a; i++) (t = arguments[i]) && (e = b(t)) && (r && (r += " "), r += e);
14
14
  return r;
15
15
  }
@@ -19,7 +19,7 @@ function T() {
19
19
  * This source code is licensed under the MIT license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
21
  */
22
- var I = {
22
+ var S = {
23
23
  outline: {
24
24
  xmlns: "http://www.w3.org/2000/svg",
25
25
  width: 24,
@@ -47,19 +47,19 @@ var I = {
47
47
  * See the LICENSE file in the root directory of this source tree.
48
48
  */
49
49
  const $ = (t, e, i, r) => {
50
- const a = z(
51
- ({ color: s = "currentColor", size: n = 24, stroke: l = 2, title: p, className: c, children: d, ...m }, f) => v(
50
+ const a = I(
51
+ ({ color: s = "currentColor", size: l = 24, stroke: c = 2, title: p, className: d, children: n, ...m }, f) => v(
52
52
  "svg",
53
53
  {
54
54
  ref: f,
55
- ...I[t],
56
- width: n,
57
- height: n,
58
- className: ["tabler-icon", `tabler-icon-${e}`, c].join(" "),
55
+ ...S[t],
56
+ width: l,
57
+ height: l,
58
+ className: ["tabler-icon", `tabler-icon-${e}`, d].join(" "),
59
59
  ...t === "filled" ? {
60
60
  fill: s
61
61
  } : {
62
- strokeWidth: l,
62
+ strokeWidth: c,
63
63
  stroke: s
64
64
  },
65
65
  ...m
@@ -67,7 +67,7 @@ const $ = (t, e, i, r) => {
67
67
  [
68
68
  p && v("title", { key: "svg-title" }, p),
69
69
  ...r.map(([g, u]) => v(g, u)),
70
- ...Array.isArray(d) ? d : [d]
70
+ ...Array.isArray(n) ? n : [n]
71
71
  ]
72
72
  )
73
73
  );
@@ -79,14 +79,14 @@ const $ = (t, e, i, r) => {
79
79
  * This source code is licensed under the MIT license.
80
80
  * See the LICENSE file in the root directory of this source tree.
81
81
  */
82
- const M = [["path", { d: "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", key: "svg-0" }]], S = $("outline", "circle", "Circle", M);
82
+ const T = [["path", { d: "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", key: "svg-0" }]], q = $("outline", "circle", "Circle", T);
83
83
  /**
84
84
  * @license @tabler/icons-react v3.36.1 - MIT
85
85
  *
86
86
  * This source code is licensed under the MIT license.
87
87
  * See the LICENSE file in the root directory of this source tree.
88
88
  */
89
- const q = [["path", { d: "M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z", key: "svg-0" }]], E = $("filled", "circle-check-filled", "CircleCheckFilled", q);
89
+ const E = [["path", { d: "M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z", key: "svg-0" }]], D = $("filled", "circle-check-filled", "CircleCheckFilled", E);
90
90
  function k(t) {
91
91
  var e, i, r = "";
92
92
  if (typeof t == "string" || typeof t == "number") r += t;
@@ -96,7 +96,7 @@ function k(t) {
96
96
  } else for (i in t) t[i] && (r && (r += " "), r += i);
97
97
  return r;
98
98
  }
99
- function D() {
99
+ function G() {
100
100
  for (var t, e, i = 0, r = "", a = arguments.length; i < a; i++) (t = arguments[i]) && (e = k(t)) && (r && (r += " "), r += e);
101
101
  return r;
102
102
  }
@@ -107,11 +107,11 @@ const x = ({
107
107
  display: r,
108
108
  m: a,
109
109
  mt: s,
110
- mr: n,
111
- mb: l,
110
+ mr: l,
111
+ mb: c,
112
112
  ml: p,
113
- p: c,
114
- pt: d,
113
+ p: d,
114
+ pt: n,
115
115
  pr: m,
116
116
  pb: f,
117
117
  pl: g,
@@ -125,12 +125,13 @@ const x = ({
125
125
  rel: B,
126
126
  htmlFor: C,
127
127
  type: F,
128
- disabled: L,
129
- ...W
128
+ name: L,
129
+ disabled: W,
130
+ ..._
130
131
  }) => {
131
132
  const o = {};
132
- r && (o.display = r), u && (o.width = u), y && (o.height = y), w && (o.position = w), a && (o.margin = `var(--pittorica-space-${a})`), s && (o.marginTop = `var(--pittorica-space-${s})`), n && (o.marginRight = `var(--pittorica-space-${n})`), l && (o.marginBottom = `var(--pittorica-space-${l})`), p && (o.marginLeft = `var(--pittorica-space-${p})`), c && (o.padding = `var(--pittorica-space-${c})`), d && (o.paddingTop = `var(--pittorica-space-${d})`), m && (o.paddingRight = `var(--pittorica-space-${m})`), f && (o.paddingBottom = `var(--pittorica-space-${f})`), g && (o.paddingLeft = `var(--pittorica-space-${g})`);
133
- const _ = {
133
+ r && (o.display = r), u && (o.width = u), y && (o.height = y), w && (o.position = w), a && (o.margin = `var(--pittorica-space-${a})`), s && (o.marginTop = `var(--pittorica-space-${s})`), l && (o.marginRight = `var(--pittorica-space-${l})`), c && (o.marginBottom = `var(--pittorica-space-${c})`), p && (o.marginLeft = `var(--pittorica-space-${p})`), d && (o.padding = `var(--pittorica-space-${d})`), n && (o.paddingTop = `var(--pittorica-space-${n})`), m && (o.paddingRight = `var(--pittorica-space-${m})`), f && (o.paddingBottom = `var(--pittorica-space-${f})`), g && (o.paddingLeft = `var(--pittorica-space-${g})`);
134
+ const z = {
134
135
  ...N,
135
136
  ...o
136
137
  };
@@ -138,53 +139,56 @@ const x = ({
138
139
  e,
139
140
  {
140
141
  ref: t,
141
- className: D("pittorica-box", A),
142
- style: _,
142
+ className: G("pittorica-box", A),
143
+ style: z,
143
144
  href: R,
144
145
  target: j,
145
146
  rel: B,
146
147
  htmlFor: C,
147
148
  type: F,
148
- disabled: L,
149
- ...W,
149
+ name: L,
150
+ disabled: W,
151
+ ..._,
150
152
  children: i
151
153
  }
152
154
  );
153
155
  };
154
156
  x.displayName = "Box";
155
- const G = ({
157
+ const H = ({
156
158
  checked: t,
157
159
  disabled: e,
158
160
  color: i = "indigo",
159
161
  className: r,
160
162
  style: a,
161
163
  onCheckedChange: s,
162
- ref: n,
163
- ...l
164
+ name: l,
165
+ ref: c,
166
+ ...p
164
167
  }) => {
165
- const c = i !== "inherit" && !(i != null && i.startsWith("#")) && !(i != null && i.startsWith("rgb")) ? `var(--pittorica-${i}-9)` : i;
168
+ const n = i !== "inherit" && !(i != null && i.startsWith("#")) && !(i != null && i.startsWith("rgb")) ? `var(--pittorica-${i}-9)` : i;
166
169
  return /* @__PURE__ */ h(
167
170
  x,
168
171
  {
169
- ...l,
172
+ ...p,
170
173
  as: "button",
171
174
  type: "button",
172
175
  role: "radio",
176
+ name: l,
173
177
  "aria-checked": t,
174
178
  "data-state": t ? "checked" : "unchecked",
175
179
  disabled: e,
176
- className: T("pittorica-radio-root", r),
180
+ className: M("pittorica-radio-root", r),
177
181
  onClick: () => !e && (s == null ? void 0 : s(!t)),
178
- ref: n,
182
+ ref: c,
179
183
  style: {
180
- "--pittorica-source-color": c,
184
+ "--pittorica-source-color": n,
181
185
  ...a
182
186
  },
183
- children: t ? /* @__PURE__ */ h(E, { size: 14 }) : /* @__PURE__ */ h(S, { size: 14, opacity: 0.5 })
187
+ children: t ? /* @__PURE__ */ h(D, { size: 14 }) : /* @__PURE__ */ h(q, { size: 14, opacity: 0.5 })
184
188
  }
185
189
  );
186
190
  };
187
- G.displayName = "Radio";
191
+ H.displayName = "Radio";
188
192
  export {
189
- G as Radio
193
+ H as Radio
190
194
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pittorica/radio-react",
3
- "version": "0.23.0",
3
+ "version": "0.23.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -11,8 +11,8 @@
11
11
  "dependencies": {
12
12
  "@tabler/icons-react": "^3.36.1",
13
13
  "clsx": "^2.1.1",
14
- "@pittorica/box-react": "0.23.0",
15
- "@pittorica/text-react": "0.23.0"
14
+ "@pittorica/box-react": "0.23.2",
15
+ "@pittorica/text-react": "0.23.2"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@testing-library/jest-dom": "^6.9.1",
@@ -24,9 +24,9 @@
24
24
  "typescript": "^5.0.0",
25
25
  "vite": "^5.0.0",
26
26
  "vitest": "^2.1.9",
27
- "@pittorica/flex-react": "0.23.0",
28
- "pittorica": "0.23.0",
29
- "@pittorica/theme-react": "0.23.0"
27
+ "@pittorica/flex-react": "0.23.2",
28
+ "pittorica": "0.23.2",
29
+ "@pittorica/theme-react": "0.23.2"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": ">=19",