@pittorica/segmented-control-react 0.23.1 → 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.
Files changed (2) hide show
  1. package/dist/index.js +25 -23
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as h } from "react/jsx-runtime";
2
- import { createContext as W, useState as q, useMemo as E, use as M } from "react";
2
+ import { createContext as q, useState as E, useMemo as M, use as U } from "react";
3
3
  function C(t) {
4
4
  var r, o, e = "";
5
5
  if (typeof t == "string" || typeof t == "number") e += t;
@@ -22,7 +22,7 @@ function x(t) {
22
22
  } else for (o in t) t[o] && (e && (e += " "), e += o);
23
23
  return e;
24
24
  }
25
- function U() {
25
+ function z() {
26
26
  for (var t, r, o = 0, e = "", n = arguments.length; o < n; o++) (t = arguments[o]) && (r = x(t)) && (e && (e += " "), e += r);
27
27
  return e;
28
28
  }
@@ -44,42 +44,44 @@ const v = ({
44
44
  width: d,
45
45
  height: y,
46
46
  position: b,
47
- style: R,
47
+ style: k,
48
48
  className: w,
49
49
  href: A,
50
50
  target: j,
51
51
  rel: B,
52
52
  htmlFor: I,
53
- type: T,
54
- disabled: D,
55
- ...F
53
+ type: D,
54
+ name: F,
55
+ disabled: L,
56
+ ...T
56
57
  }) => {
57
58
  const i = {};
58
59
  e && (i.display = e), d && (i.width = d), y && (i.height = y), b && (i.position = b), n && (i.margin = `var(--pittorica-space-${n})`), c && (i.marginTop = `var(--pittorica-space-${c})`), m && (i.marginRight = `var(--pittorica-space-${m})`), g && (i.marginBottom = `var(--pittorica-space-${g})`), u && (i.marginLeft = `var(--pittorica-space-${u})`), a && (i.padding = `var(--pittorica-space-${a})`), l && (i.paddingTop = `var(--pittorica-space-${l})`), s && (i.paddingRight = `var(--pittorica-space-${s})`), p && (i.paddingBottom = `var(--pittorica-space-${p})`), f && (i.paddingLeft = `var(--pittorica-space-${f})`);
59
- const L = {
60
- ...R,
60
+ const W = {
61
+ ...k,
61
62
  ...i
62
63
  };
63
64
  return /* @__PURE__ */ h(
64
65
  r,
65
66
  {
66
67
  ref: t,
67
- className: U("pittorica-box", w),
68
- style: L,
68
+ className: z("pittorica-box", w),
69
+ style: W,
69
70
  href: A,
70
71
  target: j,
71
72
  rel: B,
72
73
  htmlFor: I,
73
- type: T,
74
- disabled: D,
75
- ...F,
74
+ type: D,
75
+ name: F,
76
+ disabled: L,
77
+ ...T,
76
78
  children: o
77
79
  }
78
80
  );
79
81
  };
80
82
  v.displayName = "Box";
81
- const $ = W(null), z = () => {
82
- const t = M($);
83
+ const $ = q(null), G = () => {
84
+ const t = U($);
83
85
  if (!t)
84
86
  throw new Error(
85
87
  "SegmentedControl components must be wrapped in <SegmentedControl.Root />"
@@ -95,9 +97,9 @@ const $ = W(null), z = () => {
95
97
  className: m,
96
98
  ...g
97
99
  }) => {
98
- const [u, a] = q(o), l = r !== void 0, s = l ? r : u, p = (d) => {
100
+ const [u, a] = E(o), l = r !== void 0, s = l ? r : u, p = (d) => {
99
101
  l || a(d), e == null || e(d);
100
- }, f = E(
102
+ }, f = M(
101
103
  () => ({
102
104
  value: s,
103
105
  onValueChange: p,
@@ -115,7 +117,7 @@ const $ = W(null), z = () => {
115
117
  children: t
116
118
  }
117
119
  ) });
118
- }, k = ({
120
+ }, R = ({
119
121
  children: t,
120
122
  value: r,
121
123
  disabled: o,
@@ -129,7 +131,7 @@ const $ = W(null), z = () => {
129
131
  onValueChange: u,
130
132
  color: a,
131
133
  disabled: l
132
- } = z(), s = g === r, p = l || o, d = a !== "inherit" && !(a != null && a.startsWith("#")) && !(a != null && a.startsWith("rgb")) ? `var(--pittorica-${a}-9)` : a;
134
+ } = G(), s = g === r, p = l || o, d = a !== "inherit" && !(a != null && a.startsWith("#")) && !(a != null && a.startsWith("rgb")) ? `var(--pittorica-${a}-9)` : a;
133
135
  return /* @__PURE__ */ h(
134
136
  v,
135
137
  {
@@ -150,12 +152,12 @@ const $ = W(null), z = () => {
150
152
  children: t
151
153
  }
152
154
  );
153
- }, J = {
155
+ }, K = {
154
156
  Root: N,
155
- Item: k
157
+ Item: R
156
158
  };
157
159
  N.displayName = "SegmentedControl.Root";
158
- k.displayName = "SegmentedControl.Item";
160
+ R.displayName = "SegmentedControl.Item";
159
161
  export {
160
- J as SegmentedControl
162
+ K as SegmentedControl
161
163
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pittorica/segmented-control-react",
3
- "version": "0.23.1",
3
+ "version": "0.23.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -10,8 +10,8 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "clsx": "^2.1.1",
13
- "@pittorica/box-react": "0.23.1",
14
- "@pittorica/text-react": "0.23.1"
13
+ "@pittorica/box-react": "0.23.2",
14
+ "@pittorica/text-react": "0.23.2"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@tabler/icons-react": "^3.36.1",
@@ -24,8 +24,8 @@
24
24
  "typescript": "^5.0.0",
25
25
  "vite": "^5.0.0",
26
26
  "vitest": "^2.1.9",
27
- "@pittorica/theme-react": "0.23.1",
28
- "pittorica": "0.23.1"
27
+ "@pittorica/theme-react": "0.23.2",
28
+ "pittorica": "0.23.2"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "react": ">=19",