@purpurds/cta-link 4.3.0 → 4.5.0

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,5 +1,6 @@
1
- import React, { AnchorHTMLAttributes } from "react";
2
- import { ActionProps } from "@purpurds/action";
1
+ import { ActionProps } from '@purpurds/action';
2
+ import { default as React, AnchorHTMLAttributes } from 'react';
3
+
3
4
  export declare const ctaLinkIcons: readonly ["forward", "external", "back", "phone"];
4
5
  export type CtaLinkIcon = typeof ctaLinkIcons[number];
5
6
  export declare const CtaLink: ({ children, className, ["data-testid"]: dataTestid, fullWidth, iconOnly, size, variant, icon, ...props }: ActionProps & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
@@ -4,21 +4,21 @@ const o = {
4
4
  MD: "md",
5
5
  LG: "lg"
6
6
  };
7
- function x(t) {
8
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
7
+ function x(e) {
8
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
9
9
  }
10
- var g = { exports: {} };
10
+ var _ = { exports: {} };
11
11
  /*!
12
12
  Copyright (c) 2018 Jed Watson.
13
13
  Licensed under the MIT License (MIT), see
14
14
  http://jedwatson.github.io/classnames
15
15
  */
16
- (function(t) {
16
+ (function(e) {
17
17
  (function() {
18
18
  var l = {}.hasOwnProperty;
19
19
  function a() {
20
- for (var r = "", e = 0; e < arguments.length; e++) {
21
- var n = arguments[e];
20
+ for (var r = "", t = 0; t < arguments.length; t++) {
21
+ var n = arguments[t];
22
22
  n && (r = u(r, i.call(this, n)));
23
23
  }
24
24
  return r;
@@ -32,18 +32,18 @@ var g = { exports: {} };
32
32
  return a.apply(this, r);
33
33
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
34
34
  return r.toString();
35
- var e = "";
35
+ var t = "";
36
36
  for (var n in r)
37
- l.call(r, n) && r[n] && (e = u(e, this && this[n] || n));
38
- return e;
37
+ l.call(r, n) && r[n] && (t = u(t, this && this[n] || n));
38
+ return t;
39
39
  }
40
- function u(r, e) {
41
- return e ? r ? r + " " + e : r + e : r;
40
+ function u(r, t) {
41
+ return t ? r ? r + " " + t : r + t : r;
42
42
  }
43
- t.exports ? (a.default = a, t.exports = a) : window.classNames = a;
43
+ e.exports ? (a.default = a, e.exports = a) : window.classNames = a;
44
44
  })();
45
- })(g);
46
- var k = g.exports;
45
+ })(_);
46
+ var k = _.exports;
47
47
  const b = /* @__PURE__ */ x(k), $ = {
48
48
  "purpur-icon": "_purpur-icon_8u1lq_1",
49
49
  "purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
@@ -72,52 +72,52 @@ const b = /* @__PURE__ */ x(k), $ = {
72
72
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M5.341 2.228c.75-.622 1.73-.43 2.305.145l2.783 2.783a1.9 1.9 0 0 1 0 2.687L8.843 9.43a.1.1 0 0 0 0 .142l5.586 5.585a.1.1 0 0 0 .142 0l1.585-1.585a1.9 1.9 0 0 1 2.687 0l3.5 3.5c.343.342.698 1.023.31 1.742-.346.645-1.173 1.615-3.154 2.936-1.75 1.167-3.667 1.269-5.297.903-1.61-.361-3.015-1.192-3.839-2.016a.9.9 0 0 1 1.273-1.272c.573.572 1.669 1.242 2.96 1.532 1.27.285 2.656.188 3.905-.645 1.483-.989 2.137-1.68 2.418-2.06l-3.348-3.347a.1.1 0 0 0-.142 0l-1.586 1.585a1.9 1.9 0 0 1-2.687 0l-5.585-5.585a1.9 1.9 0 0 1 0-2.688l1.585-1.585a.1.1 0 0 0 0-.142L6.41 3.682c-.447.383-1.183 1.102-2.206 2.38-.878 1.097-1.14 2.08-1.127 2.951.013.898.323 1.758.732 2.59.24.488.733 1.079 1.551 1.88.561.549 1.227 1.152 2.002 1.854.344.312.71.644 1.098 1a.9.9 0 0 1-1.215 1.327c-.367-.336-.722-.658-1.061-.965a77.443 77.443 0 0 1-2.082-1.93c-.831-.813-1.523-1.586-1.909-2.372-.456-.93-.896-2.07-.916-3.356-.02-1.314.399-2.7 1.521-4.103 1.148-1.435 1.995-2.254 2.544-2.71Z" clip-rule="evenodd"/></svg>',
73
73
  keywords: ["phone"],
74
74
  category: "device"
75
- }, O = b.bind($), _ = "purpur-icon", C = "md", q = (t) => t.filter((l) => Object.keys(l).length >= 1).map((l) => `${l.name}="${l.value}"`).join(" "), N = ({ content: t = "", title: l } = {}) => {
75
+ }, O = b.bind($), v = "purpur-icon", C = "md", q = (e) => e.filter((l) => Object.keys(l).length >= 1).map((l) => `${l.name}="${l.value}"`).join(" "), N = ({ content: e = "", title: l } = {}) => {
76
76
  const a = [
77
77
  { name: "xmlns", value: "http://www.w3.org/2000/svg" },
78
78
  { name: "fill", value: "currentColor" },
79
79
  { name: "viewBox", value: "0 0 24 24" },
80
80
  l ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
81
81
  ], i = l ? `<title>${l}</title>` : "";
82
- return `<svg ${q(a)}>${i}${t}</svg>`;
83
- }, A = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), f = ({
84
- ["data-testid"]: t,
82
+ return `<svg ${q(a)}>${i}${e}</svg>`;
83
+ }, A = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), m = ({
84
+ ["data-testid"]: e,
85
85
  svg: l,
86
86
  allyTitle: a,
87
87
  className: i = "",
88
88
  size: u = C,
89
89
  ...r
90
90
  }) => {
91
- const e = N({
91
+ const t = N({
92
92
  content: A(l.svg),
93
93
  title: a
94
- }), n = O(i, _, `${_}--${u}`);
94
+ }), n = O(i, v, `${v}--${u}`);
95
95
  return /* @__PURE__ */ c(
96
96
  "span",
97
97
  {
98
98
  "aria-label": a,
99
99
  className: n,
100
- "data-testid": t,
101
- dangerouslySetInnerHTML: { __html: e },
100
+ "data-testid": e,
101
+ dangerouslySetInnerHTML: { __html: t },
102
102
  ...r
103
103
  }
104
104
  );
105
105
  };
106
- function H(t) {
107
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
106
+ function V(e) {
107
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
108
108
  }
109
- var m = { exports: {} };
109
+ var f = { exports: {} };
110
110
  /*!
111
111
  Copyright (c) 2018 Jed Watson.
112
112
  Licensed under the MIT License (MIT), see
113
113
  http://jedwatson.github.io/classnames
114
114
  */
115
- (function(t) {
115
+ (function(e) {
116
116
  (function() {
117
117
  var l = {}.hasOwnProperty;
118
118
  function a() {
119
- for (var r = "", e = 0; e < arguments.length; e++) {
120
- var n = arguments[e];
119
+ for (var r = "", t = 0; t < arguments.length; t++) {
120
+ var n = arguments[t];
121
121
  n && (r = u(r, i(n)));
122
122
  }
123
123
  return r;
@@ -131,69 +131,69 @@ var m = { exports: {} };
131
131
  return a.apply(null, r);
132
132
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
133
133
  return r.toString();
134
- var e = "";
134
+ var t = "";
135
135
  for (var n in r)
136
- l.call(r, n) && r[n] && (e = u(e, n));
137
- return e;
136
+ l.call(r, n) && r[n] && (t = u(t, n));
137
+ return t;
138
138
  }
139
- function u(r, e) {
140
- return e ? r ? r + " " + e : r + e : r;
139
+ function u(r, t) {
140
+ return t ? r ? r + " " + t : r + t : r;
141
141
  }
142
- t.exports ? (a.default = a, t.exports = a) : window.classNames = a;
142
+ e.exports ? (a.default = a, e.exports = a) : window.classNames = a;
143
143
  })();
144
- })(m);
145
- var V = m.exports;
146
- const B = /* @__PURE__ */ H(V), s = {
147
- "purpur-cta-link": "_purpur-cta-link_e7abc_1",
148
- "purpur-cta-link--sm": "_purpur-cta-link--sm_e7abc_33",
149
- "purpur-cta-link--icon-only": "_purpur-cta-link--icon-only_e7abc_36",
150
- "purpur-cta-link--md": "_purpur-cta-link--md_e7abc_39",
151
- "purpur-cta-link--lg": "_purpur-cta-link--lg_e7abc_45",
152
- "purpur-cta-link--full-width": "_purpur-cta-link--full-width_e7abc_51",
153
- "purpur-cta-link--primary": "_purpur-cta-link--primary_e7abc_54",
154
- "purpur-cta-link--disabled": "_purpur-cta-link--disabled_e7abc_58",
155
- "purpur-cta-link--primary-negative": "_purpur-cta-link--primary-negative_e7abc_64",
156
- "purpur-cta-link--secondary": "_purpur-cta-link--secondary_e7abc_76",
157
- "purpur-cta-link--secondary-negative": "_purpur-cta-link--secondary-negative_e7abc_87",
158
- "purpur-cta-link--expressive": "_purpur-cta-link--expressive_e7abc_98",
159
- "purpur-cta-link--expressive-negative": "_purpur-cta-link--expressive-negative_e7abc_108"
160
- }, p = "purpur-cta-link", D = ["forward", "external", "back", "phone"], P = {
144
+ })(f);
145
+ var B = f.exports;
146
+ const H = /* @__PURE__ */ V(B), s = {
147
+ "purpur-cta-link": "_purpur-cta-link_1mhg7_1",
148
+ "purpur-cta-link--sm": "_purpur-cta-link--sm_1mhg7_33",
149
+ "purpur-cta-link--icon-only": "_purpur-cta-link--icon-only_1mhg7_36",
150
+ "purpur-cta-link--md": "_purpur-cta-link--md_1mhg7_39",
151
+ "purpur-cta-link--lg": "_purpur-cta-link--lg_1mhg7_45",
152
+ "purpur-cta-link--full-width": "_purpur-cta-link--full-width_1mhg7_51",
153
+ "purpur-cta-link--primary": "_purpur-cta-link--primary_1mhg7_54",
154
+ "purpur-cta-link--disabled": "_purpur-cta-link--disabled_1mhg7_58",
155
+ "purpur-cta-link--primary-negative": "_purpur-cta-link--primary-negative_1mhg7_64",
156
+ "purpur-cta-link--secondary": "_purpur-cta-link--secondary_1mhg7_76",
157
+ "purpur-cta-link--secondary-negative": "_purpur-cta-link--secondary-negative_1mhg7_87",
158
+ "purpur-cta-link--expressive": "_purpur-cta-link--expressive_1mhg7_98",
159
+ "purpur-cta-link--expressive-negative": "_purpur-cta-link--expressive-negative_1mhg7_108"
160
+ }, p = "purpur-cta-link", D = ["forward", "external", "back", "phone"], I = {
161
161
  forward: S,
162
162
  external: j,
163
163
  back: M,
164
164
  phone: L
165
- }, I = ({
166
- children: t,
165
+ }, P = ({
166
+ children: e,
167
167
  className: l,
168
168
  ["data-testid"]: a,
169
169
  fullWidth: i = !1,
170
170
  iconOnly: u,
171
171
  size: r = o.MD,
172
- variant: e,
172
+ variant: t,
173
173
  icon: n = "forward",
174
174
  ...d
175
175
  }) => {
176
- const w = B(
176
+ const h = H(
177
177
  [
178
178
  l,
179
179
  s[p],
180
- s[`${p}--${e}`],
180
+ s[`${p}--${t}`],
181
181
  s[`${p}--${r}`]
182
182
  ],
183
183
  {
184
184
  [s[`${p}--icon-only`]]: u,
185
- [s[`${p}--negative`]]: e.endsWith("negative"),
185
+ [s[`${p}--negative`]]: t.endsWith("negative"),
186
186
  [s[`${p}--full-width`]]: i
187
187
  }
188
- ), h = d.href ? "a" : "span", v = P[n];
189
- return /* @__PURE__ */ y(h, { className: w, "data-testid": a, ...d, children: [
190
- (n === "back" || n === "phone") && /* @__PURE__ */ c(f, { svg: v, size: r === o.LG ? "sm" : "xs" }),
191
- !u && t,
192
- (n === "forward" || n === "external") && /* @__PURE__ */ c(f, { svg: v, size: r === o.LG ? "sm" : "xs" })
188
+ ), w = d.href ? "a" : "span", g = I[n];
189
+ return /* @__PURE__ */ y(w, { className: h, "data-testid": a, ...d, children: [
190
+ (n === "back" || n === "phone") && /* @__PURE__ */ c(m, { svg: g, size: r === o.LG ? "sm" : "xs" }),
191
+ !u && e,
192
+ (n === "forward" || n === "external") && /* @__PURE__ */ c(m, { svg: g, size: r === o.LG ? "sm" : "xs" })
193
193
  ] });
194
194
  };
195
195
  export {
196
- I as CtaLink,
196
+ P as CtaLink,
197
197
  D as ctaLinkIcons
198
198
  };
199
199
  //# sourceMappingURL=cta-link.es.js.map