@box/copy-input 1.5.0 → 1.5.1

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.
@@ -1,11 +1,11 @@
1
1
  import { useUniqueId as _, BaseTextInput as k, Button as F, InlineError as O, Text as q } from "@box/blueprint-web";
2
- import i from "clsx";
3
- import { forwardRef as w, useCallback as b } from "react";
2
+ import c from "clsx";
3
+ import { forwardRef as w, useCallback as f } from "react";
4
4
  import { useIntl as z } from "react-intl";
5
- import { messages as f } from "./messages.js";
5
+ import { messages as h } from "./messages.js";
6
6
  import { useClipboardCopy as H } from "./utils.js";
7
7
  import { jsxs as I, jsx as s } from "react/jsx-runtime";
8
- import '../../styles/copy-input.css';const U = "_formWrapper_yd7hc_1", A = "_hasError_yd7hc_6", G = "_copyInputWrapper_yd7hc_14", J = "_copied_yd7hc_19", K = "_copyButton_yd7hc_34", P = "_copyInput_yd7hc_14", Q = "_noButton_yd7hc_43", V = "_subtext_yd7hc_56", X = "_inlineError_yd7hc_57", e = {
8
+ import '../../styles/copy-input.css';const U = "_formWrapper_1obil_2", A = "_hasError_1obil_7", G = "_copyInputWrapper_1obil_15", J = "_copied_1obil_20", K = "_copyButton_1obil_35", P = "_copyInput_1obil_15", Q = "_noButton_1obil_44", V = "_subtext_1obil_57", X = "_inlineError_1obil_58", o = {
9
9
  formWrapper: U,
10
10
  hasError: A,
11
11
  copyInputWrapper: G,
@@ -28,39 +28,39 @@ import '../../styles/copy-input.css';const U = "_formWrapper_yd7hc_1", A = "_has
28
28
  onCopy: L,
29
29
  hideLabel: W,
30
30
  ...l
31
- } = x, d = z(), N = d.formatMessage(f.copyButtonLabel), S = d.formatMessage(f.copyButtonCopiedLabel), u = _("inline-error-"), y = _("subtext-"), {
32
- copied: m,
33
- handleCopy: h,
31
+ } = x, u = z(), N = u.formatMessage(h.copyButtonLabel), S = u.formatMessage(h.copyButtonCopiedLabel), d = _("inline-error-"), b = _("subtext-"), {
32
+ copied: y,
33
+ handleCopy: m,
34
34
  inputRef: T
35
- } = H(n, L, C), D = b((o) => {
36
- o.target.select();
37
- }, []), M = b((o) => {
38
- o.target instanceof HTMLInputElement && o.target.setSelectionRange(0, o.target.value.length);
39
- }, []), t = !!r && !n, c = !r && !!p, R = t || c;
40
- let a = "";
41
- t ? a = u : c && (a = y);
42
- const j = i(l["aria-describedby"], {
43
- [a]: R
35
+ } = H(n, L, C), D = f((t) => {
36
+ t.target.select();
37
+ }, []), M = f((t) => {
38
+ t.target instanceof HTMLInputElement && t.target.setSelectionRange(0, t.target.value.length);
39
+ }, []), e = !!r && !n, a = !r && !!p, R = e || a;
40
+ let i = "";
41
+ e ? i = d : a && (i = b);
42
+ const j = c(l["aria-describedby"], {
43
+ [i]: R
44
44
  });
45
45
  return /* @__PURE__ */ I("div", {
46
- className: i(e.formWrapper, {
47
- [e.hasError]: r
46
+ className: c(o.formWrapper, {
47
+ [o.hasError]: r
48
48
  }),
49
49
  children: [/* @__PURE__ */ I("div", {
50
- className: i(e.copyInputWrapper, {
51
- [e.copied]: m
50
+ className: c(o.copyInputWrapper, {
51
+ [o.copied]: y
52
52
  }),
53
53
  children: [/* @__PURE__ */ s(k, {
54
54
  ...l,
55
55
  ref: T,
56
56
  "aria-describedby": j || void 0,
57
- "aria-invalid": t,
58
- className: e.copyInput,
57
+ "aria-invalid": e,
58
+ className: o.copyInput,
59
59
  disabled: n,
60
60
  hideLabel: W,
61
- invalid: t,
61
+ invalid: e,
62
62
  label: v,
63
- onCopy: h,
63
+ onCopy: m,
64
64
  onFocus: D,
65
65
  onSelect: M,
66
66
  readOnly: !0,
@@ -68,22 +68,22 @@ import '../../styles/copy-input.css';const U = "_formWrapper_yd7hc_1", A = "_has
68
68
  }), /* @__PURE__ */ s(F, {
69
69
  ref: B,
70
70
  "aria-live": g,
71
- className: e.copyButton,
71
+ className: o.copyButton,
72
72
  disabled: n,
73
- onClick: h,
73
+ onClick: m,
74
74
  size: "large",
75
75
  variant: "secondary",
76
- children: m ? S : N
76
+ children: y ? S : N
77
77
  })]
78
- }), t ? /* @__PURE__ */ s(O, {
79
- className: e.inlineError,
80
- id: u,
78
+ }), e ? /* @__PURE__ */ s(O, {
79
+ className: o.inlineError,
80
+ id: d,
81
81
  children: r
82
- }) : c && /* @__PURE__ */ s(q, {
82
+ }) : a && /* @__PURE__ */ s(q, {
83
83
  as: "p",
84
- className: e.subtext,
84
+ className: o.subtext,
85
85
  color: "textOnLightSecondary",
86
- id: y,
86
+ id: b,
87
87
  variant: "caption",
88
88
  children: p
89
89
  })]
@@ -1 +1 @@
1
- ._formWrapper_yd7hc_1{--border-collapsible-border: var(--border-cta-border-secondary);display:flex;flex-direction:column}._formWrapper_yd7hc_1._hasError_yd7hc_6 input:not(:focus-visible){border-color:var(--border-input-border-error)!important;border-width:2px!important}._formWrapper_yd7hc_1 ._copyInputWrapper_yd7hc_14{--text-input-disabled-opacity-api: .3;display:flex}._formWrapper_yd7hc_1 ._copyInputWrapper_yd7hc_14._copied_yd7hc_19{--border-collapsible-border: var(--green-light-120);--surface-cta-surface-secondary: var(--green-light-50);--surface-cta-surface-secondary-hover: var(--green-light-50)}._formWrapper_yd7hc_1 ._copyInputWrapper_yd7hc_14._copied_yd7hc_19 input{border-color:var(--green-light-120)!important;border-width:1px!important}._formWrapper_yd7hc_1 ._copyInputWrapper_yd7hc_14._copied_yd7hc_19 input:focus{border-color:var(--outline-focus-on-light)!important;border-width:2px!important}._formWrapper_yd7hc_1 ._copyInputWrapper_yd7hc_14._copied_yd7hc_19 ._copyButton_yd7hc_34._copyButton_yd7hc_34{background-color:var(--green-light-50);border-color:var(--green-light-120)}._formWrapper_yd7hc_1 ._copyInputWrapper_yd7hc_14 ._copyInput_yd7hc_14._copyInput_yd7hc_14{position:relative;left:1px;flex-grow:1}._formWrapper_yd7hc_1 ._copyInputWrapper_yd7hc_14 ._copyInput_yd7hc_14._copyInput_yd7hc_14:not(._noButton_yd7hc_43) input{border-top-right-radius:0;border-bottom-right-radius:0}._formWrapper_yd7hc_1 ._copyInputWrapper_yd7hc_14 ._copyButton_yd7hc_34._copyButton_yd7hc_34{flex-grow:0;align-self:flex-end;border-start-start-radius:0;border-end-start-radius:0}._formWrapper_yd7hc_1 ._copyInputWrapper_yd7hc_14 ._copyButton_yd7hc_34._copyButton_yd7hc_34:focus-visible{z-index:1}._formWrapper_yd7hc_1 ._subtext_yd7hc_56,._formWrapper_yd7hc_1 ._inlineError_yd7hc_57{margin-block-start:var(--space-2)}
1
+ ._formWrapper_1obil_2{--border-collapsible-border: var(--border-cta-border-secondary);display:flex;flex-direction:column}._formWrapper_1obil_2._hasError_1obil_7 input:not(:focus-visible){border-color:var(--border-input-border-error)!important;border-width:2px!important}._formWrapper_1obil_2 ._copyInputWrapper_1obil_15{--text-input-disabled-opacity-api: .3;display:flex}._formWrapper_1obil_2 ._copyInputWrapper_1obil_15._copied_1obil_20{--border-collapsible-border: var(--green-light-120);--surface-cta-surface-secondary: var(--green-light-50);--surface-cta-surface-secondary-hover: var(--green-light-50)}._formWrapper_1obil_2 ._copyInputWrapper_1obil_15._copied_1obil_20 input{border-color:var(--green-light-120)!important;border-width:1px!important}._formWrapper_1obil_2 ._copyInputWrapper_1obil_15._copied_1obil_20 input:focus{border-color:var(--outline-focus-on-light)!important;border-width:2px!important}._formWrapper_1obil_2 ._copyInputWrapper_1obil_15._copied_1obil_20 ._copyButton_1obil_35._copyButton_1obil_35{background-color:var(--green-light-50);border-color:var(--green-light-120)}._formWrapper_1obil_2 ._copyInputWrapper_1obil_15 ._copyInput_1obil_15._copyInput_1obil_15{position:relative;left:1px;flex-grow:1}._formWrapper_1obil_2 ._copyInputWrapper_1obil_15 ._copyInput_1obil_15._copyInput_1obil_15:not(._noButton_1obil_44) input{border-top-right-radius:0;border-bottom-right-radius:0}._formWrapper_1obil_2 ._copyInputWrapper_1obil_15 ._copyButton_1obil_35._copyButton_1obil_35{flex-grow:0;align-self:flex-end;border-start-start-radius:0;border-end-start-radius:0}._formWrapper_1obil_2 ._copyInputWrapper_1obil_15 ._copyButton_1obil_35._copyButton_1obil_35:focus-visible{z-index:1}._formWrapper_1obil_2 ._subtext_1obil_57,._formWrapper_1obil_2 ._inlineError_1obil_58{margin-block-start:var(--space-2)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/copy-input",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^9.19.0",
@@ -10,9 +10,9 @@
10
10
  "react-intl": "^6.4.2"
11
11
  },
12
12
  "devDependencies": {
13
- "@box/blueprint-web": "^12.92.0",
14
- "@box/blueprint-web-assets": "^4.76.0",
15
- "@box/storybook-utils": "0.14.12",
13
+ "@box/blueprint-web": "^12.92.1",
14
+ "@box/blueprint-web-assets": "^4.76.2",
15
+ "@box/storybook-utils": "0.14.13",
16
16
  "@box/eslint-plugin-blueprint": "1.0.5",
17
17
  "react-intl": "^6.4.2"
18
18
  },