@pantheon-systems/pds-toolkit-react 1.0.0-dev.255 → 1.0.0-dev.256

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,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { Display } from '@libs/types/custom-types';
2
3
  /**
3
4
  * PDS Icon type.
4
5
  */
@@ -7,6 +8,10 @@ export type PDSIcon = keyof typeof svgData;
7
8
  * Icon component prop types
8
9
  */
9
10
  export interface IconProps {
11
+ /**
12
+ * Display value
13
+ */
14
+ display?: Display;
10
15
  /**
11
16
  * Which icon to render
12
17
  */
@@ -15,6 +20,11 @@ export interface IconProps {
15
20
  * Which size of icon to render
16
21
  */
17
22
  iconSize?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl';
23
+ /**
24
+ * Vertical align value
25
+ */
26
+ verticalAlign?: string;
27
+ /**
18
28
  /**
19
29
  * Additional class names
20
30
  */
@@ -23,7 +33,7 @@ export interface IconProps {
23
33
  /**
24
34
  * A component used to display an icon
25
35
  */
26
- export declare const Icon: ({ iconName, iconSize, className, ...props }: IconProps) => React.JSX.Element;
36
+ export declare const Icon: ({ display, iconName, iconSize, verticalAlign, className, ...props }: IconProps) => React.JSX.Element;
27
37
  declare const svgData: {
28
38
  readonly angleDown: {
29
39
  readonly path: "M201.4 342.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 274.7 86.6 137.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z";
package/_dist/index.js CHANGED
@@ -61,17 +61,21 @@ const c2 = () => Math.random().toString(32).substring(2, 13), xt = (t, n) => {
61
61
  a && (n[a] ? n[a].push(s) : n[a] = [s]);
62
62
  }
63
63
  }), n;
64
- }, z = (t) => t.join(" ").trim().replace(/\s+/g, " "), g1 = (t) => t ? t.startsWith("data:") ? /^data:image\/(png|jpeg|jpg|gif|bmp|webp);base64,[A-Za-z0-9+/]+=*$/.test(t) : !0 : !1, j = (r) => {
65
- var d = r, {
66
- iconName: t,
67
- iconSize: n = "md",
68
- className: s
69
- } = d, a = F(d, [
64
+ }, z = (t) => t.join(" ").trim().replace(/\s+/g, " "), g1 = (t) => t ? t.startsWith("data:") ? /^data:image\/(png|jpeg|jpg|gif|bmp|webp);base64,[A-Za-z0-9+/]+=*$/.test(t) : !0 : !1, j = (c) => {
65
+ var l = c, {
66
+ display: t = "inline-block",
67
+ iconName: n,
68
+ iconSize: s = "md",
69
+ verticalAlign: a = "middle",
70
+ className: r
71
+ } = l, d = F(l, [
72
+ "display",
70
73
  "iconName",
71
74
  "iconSize",
75
+ "verticalAlign",
72
76
  "className"
73
77
  ]);
74
- const c = `pds-icon pds-icon--${n} pds-icon--${t}`, l = `0 0 ${j2[t].width} 512`, o = {
78
+ const o = `pds-icon pds-icon--${s} pds-icon--${n}`, p = `0 0 ${j2[n].width} 512`, g = {
75
79
  sm: "0.8rem",
76
80
  md: "1rem",
77
81
  lg: "1.2rem",
@@ -85,16 +89,21 @@ const c2 = () => Math.random().toString(32).substring(2, 13), xt = (t, n) => {
85
89
  y({
86
90
  xmlns: "http://www.w3.org/2000/svg",
87
91
  role: "img",
88
- viewBox: l,
89
- height: o[n],
92
+ viewBox: p,
93
+ height: g[s],
90
94
  fill: "none",
91
95
  "aria-hidden": "true",
92
96
  preserveAspectRatio: "xMidYMid meet",
93
97
  focusable: "false",
94
- className: [c, s != null ? s : ""].join(" ").trim().replace(/\s+/g, " "),
95
- style: { flexShrink: 0, overflow: "visible" }
96
- }, a),
97
- /* @__PURE__ */ e.createElement("path", { d: j2[t].path, fill: "currentColor" })
98
+ className: z([o, r]),
99
+ style: {
100
+ display: t,
101
+ flexShrink: 0,
102
+ overflow: "visible",
103
+ verticalAlign: a
104
+ }
105
+ }, d),
106
+ /* @__PURE__ */ e.createElement("path", { d: j2[n].path, fill: "currentColor" })
98
107
  );
99
108
  }, j2 = {
100
109
  angleDown: {