@cfx-dev/ui-components 5.0.7 → 5.0.9

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.
@@ -6,6 +6,7 @@ export interface LinkButtonProps extends BtnExtendedProps {
6
6
  to: string;
7
7
  isHrefProp?: boolean;
8
8
  target?: string;
9
+ rel?: React.AnchorHTMLAttributes<HTMLAnchorElement>['rel'];
9
10
  Component?: React.ElementType;
10
11
  }
11
12
  export declare function LinkButton(props: LinkButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
2
  import o from "react";
3
- import { isExternalUrl as b } from "../../utils/links.js";
4
- import { getButtonClassName as h, ButtonContent as B } from "./Button.js";
5
- function M(e) {
3
+ import { isExternalUrl as h } from "../../utils/links.js";
4
+ import { getButtonClassName as B, ButtonContent as N } from "./Button.js";
5
+ function P(e) {
6
6
  const {
7
7
  to: t,
8
8
  title: f = "",
@@ -12,8 +12,9 @@ function M(e) {
12
12
  isHrefProp: a = !1,
13
13
  Component: c,
14
14
  disabled: l = !1,
15
- ref: C
16
- } = e, d = o.useMemo(() => h(e), [e]), r = b(t), k = r ? "a" : c || "a", p = o.useMemo(() => r || a ? { href: t } : { to: t }, [t, r, a]), x = o.useCallback((i) => {
15
+ ref: C,
16
+ rel: d = "noopener noreferrer"
17
+ } = e, k = o.useMemo(() => B(e), [e]), r = h(t), p = r ? "a" : c || "a", x = o.useMemo(() => r || a ? { href: t } : { to: t }, [t, r, a]), b = o.useCallback((i) => {
17
18
  if (l) {
18
19
  i.preventDefault();
19
20
  return;
@@ -21,20 +22,20 @@ function M(e) {
21
22
  n && n(i);
22
23
  }, [l, n]);
23
24
  return /* @__PURE__ */ s(
24
- k,
25
+ p,
25
26
  {
26
27
  ref: C,
27
- className: d,
28
+ className: k,
28
29
  tabIndex: m,
29
30
  title: f,
30
31
  target: u,
31
- rel: "noopener noreferrer",
32
- onClickCapture: x,
33
- ...p,
34
- children: /* @__PURE__ */ s(B, { ...e })
32
+ rel: d,
33
+ onClickCapture: b,
34
+ ...x,
35
+ children: /* @__PURE__ */ s(N, { ...e })
35
36
  }
36
37
  );
37
38
  }
38
39
  export {
39
- M as LinkButton
40
+ P as LinkButton
40
41
  };
@@ -114,9 +114,9 @@ var q = "Checkbox", [ce, yt] = W(q), [ne, F] = ce(q);
114
114
  function se(o) {
115
115
  const {
116
116
  __scopeCheckbox: a,
117
- checked: n,
117
+ checked: c,
118
118
  children: p,
119
- defaultChecked: i,
119
+ defaultChecked: r,
120
120
  disabled: e,
121
121
  form: _,
122
122
  name: h,
@@ -125,41 +125,41 @@ function se(o) {
125
125
  value: x = "on",
126
126
  // @ts-expect-error
127
127
  internal_do_not_use_render: u
128
- } = o, [t, v] = Y({
129
- prop: n,
130
- defaultProp: i ?? !1,
128
+ } = o, [n, y] = Y({
129
+ prop: c,
130
+ defaultProp: r ?? !1,
131
131
  onChange: d,
132
132
  caller: q
133
- }), [l, k] = f.useState(null), [C, c] = f.useState(null), r = f.useRef(!1), N = l ? !!_ || !!l.closest("form") : (
133
+ }), [l, k] = f.useState(null), [C, i] = f.useState(null), t = f.useRef(!1), g = l ? !!_ || !!l.closest("form") : (
134
134
  // We set this to true by default so that events bubble to forms without JS (SSR)
135
135
  !0
136
- ), g = {
137
- checked: t,
136
+ ), I = {
137
+ checked: n,
138
138
  disabled: e,
139
- setChecked: v,
139
+ setChecked: y,
140
140
  control: l,
141
141
  setControl: k,
142
142
  name: h,
143
143
  form: _,
144
144
  value: x,
145
- hasConsumerStoppedPropagationRef: r,
145
+ hasConsumerStoppedPropagationRef: t,
146
146
  required: b,
147
- defaultChecked: I(i) ? !1 : i,
148
- isFormControl: N,
147
+ defaultChecked: v(r) ? !1 : r,
148
+ isFormControl: g,
149
149
  bubbleInput: C,
150
- setBubbleInput: c
150
+ setBubbleInput: i
151
151
  };
152
152
  return /* @__PURE__ */ m(
153
153
  ne,
154
154
  {
155
155
  scope: a,
156
- ...g,
157
- children: ae(u) ? u(g) : p
156
+ ...I,
157
+ children: ae(u) ? u(I) : p
158
158
  }
159
159
  );
160
160
  }
161
161
  var O = "CheckboxTrigger", D = f.forwardRef(
162
- ({ __scopeCheckbox: o, onKeyDown: a, onClick: n, ...p }, i) => {
162
+ ({ __scopeCheckbox: o, onKeyDown: a, onClick: c, ...p }, r) => {
163
163
  const {
164
164
  control: e,
165
165
  value: _,
@@ -168,22 +168,22 @@ var O = "CheckboxTrigger", D = f.forwardRef(
168
168
  required: b,
169
169
  setControl: x,
170
170
  setChecked: u,
171
- hasConsumerStoppedPropagationRef: t,
172
- isFormControl: v,
171
+ hasConsumerStoppedPropagationRef: n,
172
+ isFormControl: y,
173
173
  bubbleInput: l
174
- } = F(O, o), k = A(i, x), C = f.useRef(d);
174
+ } = F(O, o), k = A(r, x), C = f.useRef(d);
175
175
  return f.useEffect(() => {
176
- const c = e == null ? void 0 : e.form;
177
- if (c) {
178
- const r = () => u(C.current);
179
- return c.addEventListener("reset", r), () => c.removeEventListener("reset", r);
176
+ const i = e == null ? void 0 : e.form;
177
+ if (i) {
178
+ const t = () => u(C.current);
179
+ return i.addEventListener("reset", t), () => i.removeEventListener("reset", t);
180
180
  }
181
181
  }, [e, u]), /* @__PURE__ */ m(
182
182
  w.button,
183
183
  {
184
184
  type: "button",
185
185
  role: "checkbox",
186
- "aria-checked": I(d) ? "mixed" : d,
186
+ "aria-checked": v(d) ? "mixed" : d,
187
187
  "aria-required": b,
188
188
  "data-state": K(d),
189
189
  "data-disabled": h ? "" : void 0,
@@ -191,11 +191,11 @@ var O = "CheckboxTrigger", D = f.forwardRef(
191
191
  value: _,
192
192
  ...p,
193
193
  ref: k,
194
- onKeyDown: T(a, (c) => {
195
- c.key === "Enter" && c.preventDefault();
194
+ onKeyDown: T(a, (i) => {
195
+ i.key === "Enter" && i.preventDefault();
196
196
  }),
197
- onClick: T(n, (c) => {
198
- u((r) => I(r) ? !0 : !r), l && v && (t.current = c.isPropagationStopped(), t.current || c.stopPropagation());
197
+ onClick: T(c, (i) => {
198
+ u((t) => v(t) ? !0 : !t), l && y && (n.current = i.isPropagationStopped(), n.current || i.stopPropagation());
199
199
  })
200
200
  }
201
201
  );
@@ -205,9 +205,9 @@ D.displayName = O;
205
205
  var L = f.forwardRef(
206
206
  (o, a) => {
207
207
  const {
208
- __scopeCheckbox: n,
208
+ __scopeCheckbox: c,
209
209
  name: p,
210
- checked: i,
210
+ checked: r,
211
211
  defaultChecked: e,
212
212
  required: _,
213
213
  disabled: h,
@@ -219,8 +219,8 @@ var L = f.forwardRef(
219
219
  return /* @__PURE__ */ m(
220
220
  se,
221
221
  {
222
- __scopeCheckbox: n,
223
- checked: i,
222
+ __scopeCheckbox: c,
223
+ checked: r,
224
224
  defaultChecked: e,
225
225
  disabled: h,
226
226
  required: _,
@@ -228,19 +228,19 @@ var L = f.forwardRef(
228
228
  name: p,
229
229
  form: x,
230
230
  value: d,
231
- internal_do_not_use_render: ({ isFormControl: t }) => /* @__PURE__ */ U(V, { children: [
231
+ internal_do_not_use_render: ({ isFormControl: n }) => /* @__PURE__ */ U(V, { children: [
232
232
  /* @__PURE__ */ m(
233
233
  D,
234
234
  {
235
235
  ...u,
236
236
  ref: a,
237
- __scopeCheckbox: n
237
+ __scopeCheckbox: c
238
238
  }
239
239
  ),
240
- t && /* @__PURE__ */ m(
240
+ n && /* @__PURE__ */ m(
241
241
  G,
242
242
  {
243
- __scopeCheckbox: n
243
+ __scopeCheckbox: c
244
244
  }
245
245
  )
246
246
  ] })
@@ -251,17 +251,17 @@ var L = f.forwardRef(
251
251
  L.displayName = q;
252
252
  var j = "CheckboxIndicator", H = f.forwardRef(
253
253
  (o, a) => {
254
- const { __scopeCheckbox: n, forceMount: p, ...i } = o, e = F(j, n);
254
+ const { __scopeCheckbox: c, forceMount: p, ...r } = o, e = F(j, c);
255
255
  return /* @__PURE__ */ m(
256
256
  oe,
257
257
  {
258
- present: p || I(e.checked) || e.checked === !0,
258
+ present: p || v(e.checked) || e.checked === !0,
259
259
  children: /* @__PURE__ */ m(
260
260
  w.span,
261
261
  {
262
262
  "data-state": K(e.checked),
263
263
  "data-disabled": e.disabled ? "" : void 0,
264
- ...i,
264
+ ...r,
265
265
  ref: a,
266
266
  style: { pointerEvents: "none", ...o.style }
267
267
  }
@@ -272,10 +272,10 @@ var j = "CheckboxIndicator", H = f.forwardRef(
272
272
  );
273
273
  H.displayName = j;
274
274
  var $ = "CheckboxBubbleInput", G = f.forwardRef(
275
- ({ __scopeCheckbox: o, ...a }, n) => {
275
+ ({ __scopeCheckbox: o, ...a }, c) => {
276
276
  const {
277
277
  control: p,
278
- hasConsumerStoppedPropagationRef: i,
278
+ hasConsumerStoppedPropagationRef: r,
279
279
  checked: e,
280
280
  defaultChecked: _,
281
281
  required: h,
@@ -283,28 +283,28 @@ var $ = "CheckboxBubbleInput", G = f.forwardRef(
283
283
  name: b,
284
284
  value: x,
285
285
  form: u,
286
- bubbleInput: t,
287
- setBubbleInput: v
288
- } = F($, o), l = A(n, v), k = ee(e), C = Z(p);
286
+ bubbleInput: n,
287
+ setBubbleInput: y
288
+ } = F($, o), l = A(c, y), k = ee(e), C = Z(p);
289
289
  f.useEffect(() => {
290
- const r = t;
291
- if (!r) return;
292
- const N = window.HTMLInputElement.prototype, y = Object.getOwnPropertyDescriptor(
293
- N,
290
+ const t = n;
291
+ if (!t) return;
292
+ const g = window.HTMLInputElement.prototype, N = Object.getOwnPropertyDescriptor(
293
+ g,
294
294
  "checked"
295
- ).set, S = !i.current;
296
- if (k !== e && y) {
295
+ ).set, S = !r.current;
296
+ if (k !== e && N) {
297
297
  const z = new Event("click", { bubbles: S });
298
- r.indeterminate = I(e), y.call(r, I(e) ? !1 : e), r.dispatchEvent(z);
298
+ t.indeterminate = v(e), N.call(t, v(e) ? !1 : e), t.dispatchEvent(z);
299
299
  }
300
- }, [t, k, e, i]);
301
- const c = f.useRef(I(e) ? !1 : e);
300
+ }, [n, k, e, r]);
301
+ const i = f.useRef(v(e) ? !1 : e);
302
302
  return /* @__PURE__ */ m(
303
303
  w.input,
304
304
  {
305
305
  type: "checkbox",
306
306
  "aria-hidden": !0,
307
- defaultChecked: _ ?? c.current,
307
+ defaultChecked: _ ?? i.current,
308
308
  required: h,
309
309
  disabled: d,
310
310
  name: b,
@@ -333,11 +333,11 @@ G.displayName = $;
333
333
  function ae(o) {
334
334
  return typeof o == "function";
335
335
  }
336
- function I(o) {
336
+ function v(o) {
337
337
  return o === "indeterminate";
338
338
  }
339
339
  function K(o) {
340
- return I(o) ? "indeterminate" : o ? "checked" : "unchecked";
340
+ return v(o) ? "indeterminate" : o ? "checked" : "unchecked";
341
341
  }
342
342
  const me = "cfxui__Checkbox__rootUnset__cbb57", pe = "cfxui__Checkbox__root__865aa", de = "cfxui__Checkbox__secondary__95e8e", ue = "cfxui__Checkbox__isChecked__e5d94", le = "cfxui__Checkbox__icon__f9f6b", fe = "cfxui__Checkbox__square__029aa", _e = "cfxui__Checkbox__indicator__2afc0", he = "cfxui__Checkbox__squareFilledIcon__7d9b7", Ce = "cfxui__Checkbox__tickIcon__a7f19", s = {
343
343
  rootUnset: me,
@@ -356,9 +356,9 @@ const me = "cfxui__Checkbox__rootUnset__cbb57", pe = "cfxui__Checkbox__root__865
356
356
  function ke(o) {
357
357
  const {
358
358
  id: a,
359
- size: n = "medium",
359
+ size: c = "medium",
360
360
  rootClassName: p,
361
- indicatorClassName: i,
361
+ indicatorClassName: r,
362
362
  iconClassName: e,
363
363
  checkedClassName: _,
364
364
  squareClassName: h,
@@ -366,33 +366,33 @@ function ke(o) {
366
366
  color: b,
367
367
  opacity: x,
368
368
  luminance: u,
369
- checked: t,
370
- iconSquare: v = te,
369
+ checked: n,
370
+ iconSquare: y = te,
371
371
  iconIndicator: l = M,
372
372
  name: k,
373
373
  theme: C = "primary",
374
- onClick: c,
375
- onCheckedChange: r,
376
- ...N
377
- } = o, [g, y] = R.useState(t);
374
+ onClick: i,
375
+ onCheckedChange: t,
376
+ ...g
377
+ } = o, [I, N] = R.useState(n);
378
378
  R.useEffect(() => {
379
- y(t);
380
- }, [t]);
379
+ N(n);
380
+ }, [n]);
381
381
  const S = R.useCallback(() => {
382
- y((E) => !E);
382
+ N((E) => !E);
383
383
  }, []), z = R.useCallback((E) => {
384
- y(E), r && r(E);
385
- }, [r]), X = ie(o), B = P(
384
+ N(E), t && t(E);
385
+ }, [t]), X = ie(o), B = P(
386
386
  s.isChecked,
387
387
  _
388
388
  ), J = P(
389
389
  s.root,
390
390
  s.rootUnset,
391
- s[`size-${n}`],
391
+ s[`size-${c}`],
392
392
  s[C],
393
393
  p,
394
394
  {
395
- [B]: t
395
+ [B]: I
396
396
  }
397
397
  ), Q = P(
398
398
  s.icon,
@@ -406,9 +406,9 @@ function ke(o) {
406
406
  return /* @__PURE__ */ U(
407
407
  L,
408
408
  {
409
- ...N,
409
+ ...g,
410
410
  id: a,
411
- checked: g,
411
+ checked: I,
412
412
  style: { color: X },
413
413
  className: J,
414
414
  onClick: S,
@@ -419,23 +419,23 @@ function ke(o) {
419
419
  {
420
420
  type: "hidden",
421
421
  name: k,
422
- value: t ? "on" : ""
422
+ value: I ? "on" : ""
423
423
  }
424
424
  ),
425
425
  /* @__PURE__ */ m(
426
- v,
426
+ y,
427
427
  {
428
428
  className: P(
429
429
  s.square,
430
430
  s[C],
431
431
  {
432
- [B]: t
432
+ [B]: I
433
433
  },
434
434
  h
435
435
  )
436
436
  }
437
437
  ),
438
- /* @__PURE__ */ m(H, { className: P(s.indicator, s[C], i), children: /* @__PURE__ */ m(l, { className: Q }) })
438
+ /* @__PURE__ */ m(H, { className: P(s.indicator, s[C], r), children: /* @__PURE__ */ m(l, { className: Q }) })
439
439
  ]
440
440
  }
441
441
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
3
  "private": false,
4
- "version": "5.0.7",
4
+ "version": "5.0.9",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",