@hashicorp/mds-react 0.9.4 → 0.9.6

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 (62) hide show
  1. package/components/badge/style.module.scss +8 -6
  2. package/components/badge-count/style.module.scss +7 -6
  3. package/components/breadcrumbs/truncation-button/index.js +6 -6
  4. package/components/breadcrumbs/truncation-button/index.js.map +1 -1
  5. package/components/button/button-primitive.d.ts +5 -0
  6. package/components/button/button-primitive.js +59 -0
  7. package/components/button/button-primitive.js.map +1 -0
  8. package/components/button/index.d.ts +2 -4
  9. package/components/button/index.js +21 -71
  10. package/components/button/index.js.map +1 -1
  11. package/components/card/index.js +9 -9
  12. package/components/card/index.js.map +1 -1
  13. package/components/code-block/code-block.module.scss +3 -3
  14. package/components/form/error/index.js +7 -7
  15. package/components/form/error/index.js.map +1 -1
  16. package/components/form/fieldset/index.d.ts +1 -2
  17. package/components/form/fieldset/index.js.map +1 -1
  18. package/components/form/file-input/form-file-input.module.scss +2 -2
  19. package/components/form/indicator/index.js +3 -4
  20. package/components/form/indicator/index.js.map +1 -1
  21. package/components/form/radio/index.d.ts +3 -5
  22. package/components/form/radio/index.js.map +1 -1
  23. package/components/form/radio-card/RadioCardStory.css +21 -0
  24. package/components/form/select/index.d.ts +1 -0
  25. package/components/form/select/index.js.map +1 -1
  26. package/components/icon-tile/style.module.scss +12 -10
  27. package/components/inline-link/index.js +12 -11
  28. package/components/inline-link/index.js.map +1 -1
  29. package/components/modal/modal.module.css +5 -0
  30. package/components/tabs/index.js +63 -65
  31. package/components/tabs/index.js.map +1 -1
  32. package/index.js +26 -22
  33. package/index.js.map +1 -1
  34. package/package.json +1 -1
  35. package/patterns/card/person-card/index.js +37 -35
  36. package/patterns/card/person-card/index.js.map +1 -1
  37. package/patterns/card/primitives.js +16 -16
  38. package/patterns/card/primitives.js.map +1 -1
  39. package/style.css +1 -1
  40. package/utils/i18n/constants/index.js +16 -3
  41. package/utils/i18n/constants/index.js.map +1 -1
  42. package/utils/i18n/helpers/index.d.ts +4 -0
  43. package/utils/i18n/helpers/index.js +8 -0
  44. package/utils/i18n/helpers/index.js.map +1 -0
  45. package/utils/i18n/helpers/locale-provider.d.ts +14 -0
  46. package/utils/i18n/helpers/locale-provider.js +14 -4
  47. package/utils/i18n/helpers/locale-provider.js.map +1 -1
  48. package/utils/i18n/helpers/to-smart-sentence-case.d.ts +2 -0
  49. package/utils/i18n/helpers/to-smart-sentence-case.js.map +1 -1
  50. package/utils/i18n/helpers/to-smart-title-case.d.ts +2 -0
  51. package/utils/i18n/helpers/to-smart-title-case.js.map +1 -1
  52. package/utils/i18n/helpers/use-locale.d.ts +2 -0
  53. package/utils/i18n/helpers/use-locale.js +1 -1
  54. package/utils/i18n/helpers/use-locale.js.map +1 -1
  55. package/utils/i18n/index.d.ts +11 -1
  56. package/utils/i18n/index.js +29 -3
  57. package/utils/i18n/index.js.map +1 -1
  58. package/utils/index.d.ts +1 -0
  59. package/utils/index.js +10 -6
  60. package/utils/index.js.map +1 -1
  61. package/utils/i18n/index2.js +0 -33
  62. package/utils/i18n/index2.js.map +0 -1
@@ -1,52 +1,54 @@
1
- import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
- import { memo as s } from "react";
3
- import { Text as d } from "../../../components/text/index.js";
4
- import { IconGithub16 as p } from "@hashicorp/flight-icons/svg-react/github-16";
5
- import { IconTwitter16 as h } from "@hashicorp/flight-icons/svg-react/twitter-16";
6
- import { IconLinkedin16 as u } from "@hashicorp/flight-icons/svg-react/linkedin-16";
7
- import { IconLink16 as f } from "@hashicorp/flight-icons/svg-react/link-16";
8
- import { IconMail16 as w } from "@hashicorp/flight-icons/svg-react/mail-16";
1
+ import { jsxs as a, jsx as n } from "react/jsx-runtime";
2
+ import { memo as d } from "react";
3
+ import { Text as p } from "../../../components/text/index.js";
4
+ import { FlightIcon as o } from "../../../components/flight-icon/index.js";
9
5
  import { CardPrimitives as i } from "../primitives.js";
10
- import m from "./style.module.css.js";
11
- const I = /* @__PURE__ */ new Map([
6
+ import s from "./style.module.css.js";
7
+ const h = /* @__PURE__ */ new Map([
12
8
  // null signals that we don't want to render any icon
13
9
  ["hashicorp.com", null],
14
10
  [
15
11
  "twitter.com",
16
- /* @__PURE__ */ o(h, { "data-testid": "wpl-personcard-twitter-icon" })
12
+ /* @__PURE__ */ n(o, { name: "twitter", "data-testid": "wpl-personcard-twitter-icon" })
13
+ ],
14
+ [
15
+ "github.com",
16
+ /* @__PURE__ */ n(o, { name: "github", "data-testid": "wpl-personcard-github-icon" })
17
17
  ],
18
- ["github.com", /* @__PURE__ */ o(p, { "data-testid": "wpl-personcard-github-icon" })],
19
18
  [
20
19
  "linkedin.com",
21
- /* @__PURE__ */ o(u, { "data-testid": "wpl-personcard-linkedin-icon" })
20
+ /* @__PURE__ */ n(o, { name: "linkedin", "data-testid": "wpl-personcard-linkedin-icon" })
22
21
  ],
23
- ["mailto:", /* @__PURE__ */ o(w, { "data-testid": "wpl-personcard-mail-icon" })]
24
- ]), b = s(function({ url: a }) {
25
- const { protocol: t, host: r } = new URL(a), n = I.get(t === "mailto:" ? "mailto:" : r);
26
- return n === null ? null : /* @__PURE__ */ o("div", { className: m.thumbnailIcon, children: n ?? /* @__PURE__ */ o(f, { "data-testid": "wpl-personcard-link-icon" }) });
27
- }), g = ({
22
+ [
23
+ "mailto:",
24
+ /* @__PURE__ */ n(o, { name: "mail", "data-testid": "wpl-personcard-mail-icon" })
25
+ ]
26
+ ]), u = d(function({ url: c }) {
27
+ const { protocol: r, host: e } = new URL(c), t = h.get(r === "mailto:" ? "mailto:" : e);
28
+ return t === null ? null : /* @__PURE__ */ n("div", { className: s.thumbnailIcon, children: t ?? /* @__PURE__ */ n(o, { name: "link", "data-testid": "wpl-personcard-link-icon" }) });
29
+ }), w = ({
28
30
  link: l,
29
- thumbnail: a,
30
- name: t,
31
- location: r,
32
- bio: n,
33
- productBadges: c
34
- }) => /* @__PURE__ */ e(i.Root, { link: l, withArrow: !1, "aria-label": t, children: [
35
- /* @__PURE__ */ e("div", { className: m.thumbnailContainer, children: [
36
- /* @__PURE__ */ o(i.PersonThumbnail, { ...a }),
37
- /* @__PURE__ */ o(b, { url: l })
31
+ thumbnail: c,
32
+ name: r,
33
+ location: e,
34
+ bio: t,
35
+ productBadges: m
36
+ }) => /* @__PURE__ */ a(i.Root, { link: l, withArrow: !1, "aria-label": r, children: [
37
+ /* @__PURE__ */ a("div", { className: s.thumbnailContainer, children: [
38
+ /* @__PURE__ */ n(i.PersonThumbnail, { ...c }),
39
+ /* @__PURE__ */ n(u, { url: l })
38
40
  ] }),
39
- /* @__PURE__ */ e(i.Content, { children: [
40
- /* @__PURE__ */ e("div", { children: [
41
- /* @__PURE__ */ o(i.Heading, { children: t }),
42
- r ? /* @__PURE__ */ o(d.Body, { tag: "p", size: "200", className: m.location, children: r }) : null
41
+ /* @__PURE__ */ a(i.Content, { children: [
42
+ /* @__PURE__ */ a("div", { children: [
43
+ /* @__PURE__ */ n(i.Heading, { children: r }),
44
+ e ? /* @__PURE__ */ n(p.Body, { tag: "p", size: "200", className: s.location, children: e }) : null
43
45
  ] }),
44
- n ? /* @__PURE__ */ o(i.Description, { children: n }) : null,
45
- c && c?.length > 0 ? /* @__PURE__ */ o(i.ProductBadges, { badges: c }) : null
46
+ t ? /* @__PURE__ */ n(i.Description, { children: t }) : null,
47
+ m && m?.length > 0 ? /* @__PURE__ */ n(i.ProductBadges, { badges: m }) : null
46
48
  ] })
47
49
  ] });
48
- g.displayName = "PersonCard";
50
+ w.displayName = "PersonCard";
49
51
  export {
50
- g as PersonCard
52
+ w as PersonCard
51
53
  };
52
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/patterns/card/person-card/index.tsx"],"sourcesContent":["import { memo, type ReactNode } from 'react'\nimport { Text } from '../../../components/text'\nimport { IconGithub16 } from '@hashicorp/flight-icons/svg-react/github-16'\nimport { IconTwitter16 } from '@hashicorp/flight-icons/svg-react/twitter-16'\nimport { IconLinkedin16 } from '@hashicorp/flight-icons/svg-react/linkedin-16'\nimport { IconLink16 } from '@hashicorp/flight-icons/svg-react/link-16'\nimport { IconMail16 } from '@hashicorp/flight-icons/svg-react/mail-16'\nimport type { ProductBadgesProps, ThumbnailProps } from '../types'\nimport { CardPrimitives } from '../primitives'\nimport s from './style.module.css'\n\ninterface PersonCardProps {\n\tthumbnail: ThumbnailProps\n\tlink: string\n\tname: string\n\tlocation?: string\n\tbio?: string\n\tproductBadges?: ProductBadgesProps['badges']\n}\n\n// Map of hostnames to icons.\n/* eslint-disable react/jsx-key */\nconst iconMap = new Map<string, ReactNode>([\n\t// null signals that we don't want to render any icon\n\t['hashicorp.com', null],\n\t[\n\t\t'twitter.com',\n\t\t<IconTwitter16 data-testid={'wpl-personcard-twitter-icon'} />,\n\t],\n\t['github.com', <IconGithub16 data-testid={'wpl-personcard-github-icon'} />],\n\t[\n\t\t'linkedin.com',\n\t\t<IconLinkedin16 data-testid={'wpl-personcard-linkedin-icon'} />,\n\t],\n\t['mailto:', <IconMail16 data-testid={'wpl-personcard-mail-icon'} />],\n])\n/* eslint-enable react/jsx-key */\n\nconst Icon = memo(function Icon({ url }: { url: string }) {\n\tconst { protocol, host } = new URL(url)\n\tconst icon = iconMap.get(protocol === 'mailto:' ? 'mailto:' : host)\n\n\t// If the icon value is null, don't render an icon\n\tif (icon === null) {\n\t\treturn null\n\t}\n\n\t// Render the icon or the default icon if the icon value is undefined\n\treturn (\n\t\t<div className={s.thumbnailIcon}>\n\t\t\t{icon ?? <IconLink16 data-testid={'wpl-personcard-link-icon'} />}\n\t\t</div>\n\t)\n})\n\nconst PersonCard = ({\n\tlink,\n\tthumbnail,\n\tname,\n\tlocation,\n\tbio,\n\tproductBadges,\n}: PersonCardProps) => {\n\treturn (\n\t\t<CardPrimitives.Root link={link} withArrow={false} aria-label={name}>\n\t\t\t<div className={s.thumbnailContainer}>\n\t\t\t\t<CardPrimitives.PersonThumbnail {...thumbnail} />\n\t\t\t\t<Icon url={link} />\n\t\t\t</div>\n\t\t\t<CardPrimitives.Content>\n\t\t\t\t<div>\n\t\t\t\t\t<CardPrimitives.Heading>{name}</CardPrimitives.Heading>\n\t\t\t\t\t{location ? (\n\t\t\t\t\t\t<Text.Body tag=\"p\" size=\"200\" className={s.location}>\n\t\t\t\t\t\t\t{location}\n\t\t\t\t\t\t</Text.Body>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t\t{bio ? (\n\t\t\t\t\t<CardPrimitives.Description>{bio}</CardPrimitives.Description>\n\t\t\t\t) : null}\n\t\t\t\t{productBadges && productBadges?.length > 0 ? (\n\t\t\t\t\t<CardPrimitives.ProductBadges badges={productBadges} />\n\t\t\t\t) : null}\n\t\t\t</CardPrimitives.Content>\n\t\t</CardPrimitives.Root>\n\t)\n}\n\nPersonCard.displayName = 'PersonCard'\n\nexport type { PersonCardProps }\nexport { PersonCard }\n"],"names":["iconMap","jsx","IconTwitter16","IconGithub16","IconLinkedin16","IconMail16","Icon","memo","url","protocol","host","icon","s","IconLink16","PersonCard","link","thumbnail","name","location","bio","productBadges","jsxs","CardPrimitives","Text"],"mappings":";;;;;;;;;;AAsBA,MAAMA,wBAAc,IAAuB;AAAA;AAAA,EAE1C,CAAC,iBAAiB,IAAI;AAAA,EACtB;AAAA,IACC;AAAA,IACA,gBAAAC,EAACC,GAAA,EAAc,eAAa,8BAAA,CAA+B;AAAA,EAAA;AAAA,EAE5D,CAAC,cAAc,gBAAAD,EAACE,GAAA,EAAa,eAAa,8BAA8B,CAAE;AAAA,EAC1E;AAAA,IACC;AAAA,IACA,gBAAAF,EAACG,GAAA,EAAe,eAAa,+BAAA,CAAgC;AAAA,EAAA;AAAA,EAE9D,CAAC,WAAW,gBAAAH,EAACI,GAAA,EAAW,eAAa,4BAA4B,CAAE;AACpE,CAAC,GAGKC,IAAOC,EAAK,SAAc,EAAE,KAAAC,KAAwB;AACzD,QAAM,EAAE,UAAAC,GAAU,MAAA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sourcesContent":["import { memo, type ReactNode } from 'react'\nimport { Text } from '../../../components/text'\nimport { FlightIcon } from '../../../components/flight-icon'\nimport type { ProductBadgesProps, ThumbnailProps } from '../types'\nimport { CardPrimitives } from '../primitives'\nimport s from './style.module.css'\n\ninterface PersonCardProps {\n\tthumbnail: ThumbnailProps\n\tlink: string\n\tname: string\n\tlocation?: string\n\tbio?: string\n\tproductBadges?: ProductBadgesProps['badges']\n}\n\n// Map of hostnames to icons.\n/* eslint-disable react/jsx-key */\nconst iconMap = new Map<string, ReactNode>([\n\t// null signals that we don't want to render any icon\n\t['hashicorp.com', null],\n\t[\n\t\t'twitter.com',\n\t\t<FlightIcon name=\"twitter\" data-testid={'wpl-personcard-twitter-icon'} />,\n\t],\n\t[\n\t\t'github.com',\n\t\t<FlightIcon name=\"github\" data-testid={'wpl-personcard-github-icon'} />,\n\t],\n\t[\n\t\t'linkedin.com',\n\t\t<FlightIcon name=\"linkedin\" data-testid={'wpl-personcard-linkedin-icon'} />,\n\t],\n\t[\n\t\t'mailto:',\n\t\t<FlightIcon name=\"mail\" data-testid={'wpl-personcard-mail-icon'} />,\n\t],\n])\n/* eslint-enable react/jsx-key */\n\nconst Icon = memo(function Icon({ url }: { url: string }) {\n\tconst { protocol, host } = new URL(url)\n\tconst icon = iconMap.get(protocol === 'mailto:' ? 'mailto:' : host)\n\n\t// If the icon value is null, don't render an icon\n\tif (icon === null) {\n\t\treturn null\n\t}\n\n\t// Render the icon or the default icon if the icon value is undefined\n\treturn (\n\t\t<div className={s.thumbnailIcon}>\n\t\t\t{icon ?? (\n\t\t\t\t<FlightIcon name=\"link\" data-testid={'wpl-personcard-link-icon'} />\n\t\t\t)}\n\t\t</div>\n\t)\n})\n\nconst PersonCard = ({\n\tlink,\n\tthumbnail,\n\tname,\n\tlocation,\n\tbio,\n\tproductBadges,\n}: PersonCardProps) => {\n\treturn (\n\t\t<CardPrimitives.Root link={link} withArrow={false} aria-label={name}>\n\t\t\t<div className={s.thumbnailContainer}>\n\t\t\t\t<CardPrimitives.PersonThumbnail {...thumbnail} />\n\t\t\t\t<Icon url={link} />\n\t\t\t</div>\n\t\t\t<CardPrimitives.Content>\n\t\t\t\t<div>\n\t\t\t\t\t<CardPrimitives.Heading>{name}</CardPrimitives.Heading>\n\t\t\t\t\t{location ? (\n\t\t\t\t\t\t<Text.Body tag=\"p\" size=\"200\" className={s.location}>\n\t\t\t\t\t\t\t{location}\n\t\t\t\t\t\t</Text.Body>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t\t{bio ? (\n\t\t\t\t\t<CardPrimitives.Description>{bio}</CardPrimitives.Description>\n\t\t\t\t) : null}\n\t\t\t\t{productBadges && productBadges?.length > 0 ? (\n\t\t\t\t\t<CardPrimitives.ProductBadges badges={productBadges} />\n\t\t\t\t) : null}\n\t\t\t</CardPrimitives.Content>\n\t\t</CardPrimitives.Root>\n\t)\n}\n\nPersonCard.displayName = 'PersonCard'\n\nexport type { PersonCardProps }\nexport { PersonCard }\n"],"names":["iconMap","jsx","FlightIcon","Icon","memo","url","protocol","host","icon","PersonCard","link","thumbnail","name","location","bio","productBadges","jsxs","CardPrimitives","Text"],"mappings":";;;;;;AAkBA,MAAMA,wBAAc,IAAuB;AAAA;AAAA,EAE1C,CAAC,iBAAiB,IAAI;AAAA,EACtB;AAAA,IACC;AAAA,IACA,gBAAAC,EAACC,GAAA,EAAW,MAAK,WAAU,eAAa,8BAAA,CAA+B;AAAA,EAAA;AAAA,EAExE;AAAA,IACC;AAAA,IACA,gBAAAD,EAACC,GAAA,EAAW,MAAK,UAAS,eAAa,6BAAA,CAA8B;AAAA,EAAA;AAAA,EAEtE;AAAA,IACC;AAAA,IACA,gBAAAD,EAACC,GAAA,EAAW,MAAK,YAAW,eAAa,+BAAA,CAAgC;AAAA,EAAA;AAAA,EAE1E;AAAA,IACC;AAAA,IACA,gBAAAD,EAACC,GAAA,EAAW,MAAK,QAAO,eAAa,2BAAA,CAA4B;AAAA,EAAA;AAEnE,CA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ACL;AAAA,GACD;AAIFN,EAAW,cAAc;"}
@@ -1,11 +1,11 @@
1
- import { jsxs as o, jsx as r, Fragment as y } from "react/jsx-runtime";
1
+ import { jsxs as o, jsx as e, Fragment as y } from "react/jsx-runtime";
2
2
  import { forwardRef as v } from "react";
3
3
  import { Card as w } from "../../components/card/index.js";
4
4
  import { Text as n } from "../../components/text/index.js";
5
- import { IconArrowRight24 as C } from "@hashicorp/flight-icons/svg-react/arrow-right-24";
5
+ import { FlightIcon as C } from "../../components/flight-icon/index.js";
6
6
  import { ProductBadge as x } from "../product-badge/index.js";
7
7
  import { LogoThumbnail as P, PersonThumbnail as B, Thumbnail as D } from "./thumbnails/index.js";
8
- import e from "./style.module.css.js";
8
+ import r from "./style.module.css.js";
9
9
  import L from "classnames";
10
10
  const d = v((a, t) => {
11
11
  const {
@@ -20,7 +20,7 @@ const d = v((a, t) => {
20
20
  return /* @__PURE__ */ o(
21
21
  w,
22
22
  {
23
- className: L(e.card, f),
23
+ className: L(r.card, f),
24
24
  href: s,
25
25
  onClickCapture: h,
26
26
  isExternal: N,
@@ -28,26 +28,26 @@ const d = v((a, t) => {
28
28
  "aria-label": b,
29
29
  children: [
30
30
  g,
31
- /* @__PURE__ */ r("div", { className: e.cta, children: i ? /* @__PURE__ */ r(C, {}) : null })
31
+ /* @__PURE__ */ e("div", { className: r.cta, children: i ? /* @__PURE__ */ e(C, { name: "arrow-right", size: 24 }) : null })
32
32
  ]
33
33
  }
34
34
  );
35
35
  });
36
36
  d.displayName = "CardPrimitives.Root";
37
- const c = ({ items: a }) => /* @__PURE__ */ r("div", { className: e.meta, "data-testid": "wpl-card-meta", children: /* @__PURE__ */ r(n.Label, { children: a.map((t, i) => {
37
+ const l = ({ items: a }) => /* @__PURE__ */ e("div", { className: r.meta, "data-testid": "wpl-card-meta", children: /* @__PURE__ */ e(n.Label, { children: a.map((t, i) => {
38
38
  const s = i === a.length - 1;
39
39
  return /* @__PURE__ */ o(y, { children: [
40
40
  t,
41
- s ? null : /* @__PURE__ */ r("span", { className: e.metaSeparator, "aria-hidden": !0, children: "|" })
41
+ s ? null : /* @__PURE__ */ e("span", { className: r.metaSeparator, "aria-hidden": !0, children: "|" })
42
42
  ] });
43
43
  }) }) });
44
- c.displayName = "Meta";
45
- const l = ({ children: a }) => /* @__PURE__ */ r("div", { className: e.content, "data-testid": "wpl-card-content", children: a });
46
- l.displayName = "Content";
47
- const m = ({ as: a = "h2", children: t }) => /* @__PURE__ */ r(n.DisplayExpressive, { tag: a, size: "200", className: e.heading, children: t });
44
+ l.displayName = "Meta";
45
+ const c = ({ children: a }) => /* @__PURE__ */ e("div", { className: r.content, "data-testid": "wpl-card-content", children: a });
46
+ c.displayName = "Content";
47
+ const m = ({ as: a = "h2", children: t }) => /* @__PURE__ */ e(n.DisplayExpressive, { tag: a, size: "200", className: r.heading, children: t });
48
48
  m.displayName = "Heading";
49
- const p = ({ badges: a, children: t }) => /* @__PURE__ */ o("div", { className: e.productBadges, "data-testid": "wpl-card-badges", children: [
50
- a.map((i, s) => /* @__PURE__ */ r(
49
+ const p = ({ badges: a, children: t }) => /* @__PURE__ */ o("div", { className: r.productBadges, "data-testid": "wpl-card-badges", children: [
50
+ a.map((i, s) => /* @__PURE__ */ e(
51
51
  x,
52
52
  {
53
53
  productName: i,
@@ -58,15 +58,15 @@ const p = ({ badges: a, children: t }) => /* @__PURE__ */ o("div", { className:
58
58
  t
59
59
  ] });
60
60
  p.displayName = "ProductBadges";
61
- const u = ({ children: a }) => /* @__PURE__ */ r(n.Body, { tag: "p", size: "200", className: e.description, children: a });
61
+ const u = ({ children: a }) => /* @__PURE__ */ e(n.Body, { tag: "p", size: "200", className: r.description, children: a });
62
62
  u.displayName = "Description";
63
63
  const M = {
64
64
  Root: d,
65
65
  Thumbnail: D,
66
66
  PersonThumbnail: B,
67
67
  LogoThumbnail: P,
68
- Meta: c,
69
- Content: l,
68
+ Meta: l,
69
+ Content: c,
70
70
  Heading: m,
71
71
  Description: u,
72
72
  ProductBadges: p
@@ -1 +1 @@
1
- {"version":3,"file":"primitives.js","sources":["../../../src/patterns/card/primitives.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { Card as MDSCard } from '../../components/card'\nimport { Text } from '../../components/text'\nimport { IconArrowRight24 } from '@hashicorp/flight-icons/svg-react/arrow-right-24'\nimport { ProductBadge } from '../product-badge'\nimport { Thumbnail, PersonThumbnail, LogoThumbnail } from './thumbnails'\nimport type {\n\tCardPrimitiveProps,\n\tMetaProps,\n\tContentProps,\n\tHeadingProps,\n\tProductBadgesProps,\n\tDescriptionProps,\n} from './types'\nimport s from './style.module.css'\nimport classNames from 'classnames'\n\nconst Root = forwardRef<HTMLDivElement, CardPrimitiveProps>((props, ref) => {\n\tconst {\n\t\twithArrow = true,\n\t\tlink,\n\t\tclickHandler,\n\t\tisExternal,\n\t\tchildren,\n\t\tclassName,\n\t\t'aria-label': ariaLabel,\n\t} = props\n\n\treturn (\n\t\t<MDSCard\n\t\t\tclassName={classNames(s.card, className)}\n\t\t\thref={link}\n\t\t\tonClickCapture={clickHandler}\n\t\t\tisExternal={isExternal}\n\t\t\tref={ref}\n\t\t\taria-label={ariaLabel}\n\t\t>\n\t\t\t{children}\n\t\t\t<div className={s.cta}>{withArrow ? <IconArrowRight24 /> : null}</div>\n\t\t</MDSCard>\n\t)\n})\n\nRoot.displayName = 'CardPrimitives.Root'\n\nconst Meta = ({ items }: MetaProps) => {\n\treturn (\n\t\t<div className={s.meta} data-testid=\"wpl-card-meta\">\n\t\t\t<Text.Label>\n\t\t\t\t{items.map((item, stableIdx) => {\n\t\t\t\t\tconst isLastItem = stableIdx === items.length - 1\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{item}\n\t\t\t\t\t\t\t{!isLastItem ? (\n\t\t\t\t\t\t\t\t<span className={s.metaSeparator} aria-hidden={true}>\n\t\t\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</Text.Label>\n\t\t</div>\n\t)\n}\n\nMeta.displayName = 'Meta'\n\nconst Content = ({ children }: ContentProps) => {\n\treturn (\n\t\t<div className={s.content} data-testid=\"wpl-card-content\">\n\t\t\t{children}\n\t\t</div>\n\t)\n}\n\nContent.displayName = 'Content'\n\nconst Heading = ({ as = 'h2', children }: HeadingProps) => {\n\treturn (\n\t\t<Text.DisplayExpressive tag={as} size=\"200\" className={s.heading}>\n\t\t\t{children}\n\t\t</Text.DisplayExpressive>\n\t)\n}\n\nHeading.displayName = 'Heading'\n\nconst ProductBadges = ({ badges, children }: ProductBadgesProps) => {\n\treturn (\n\t\t<div className={s.productBadges} data-testid=\"wpl-card-badges\">\n\t\t\t{badges.map((badge, stableIdx) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ProductBadge\n\t\t\t\t\t\t// eslint-disable-next-line react/no-array-index-key\n\t\t\t\t\t\tkey={`product-badge-${stableIdx}`}\n\t\t\t\t\t\tproductName={badge}\n\t\t\t\t\t\thasDot={true}\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t})}\n\t\t\t{children}\n\t\t</div>\n\t)\n}\n\nProductBadges.displayName = 'ProductBadges'\n\nconst Description = ({ children }: DescriptionProps) => {\n\treturn (\n\t\t<Text.Body tag=\"p\" size=\"200\" className={s.description}>\n\t\t\t{children}\n\t\t</Text.Body>\n\t)\n}\n\nDescription.displayName = 'Description'\n\nconst CardPrimitives = {\n\tRoot,\n\tThumbnail,\n\tPersonThumbnail,\n\tLogoThumbnail,\n\tMeta,\n\tContent,\n\tHeading,\n\tDescription,\n\tProductBadges,\n}\n\nexport { CardPrimitives }\n"],"names":["Root","forwardRef","props","ref","withArrow","link","clickHandler","isExternal","children","className","ariaLabel","jsxs","MDSCard","classNames","s","jsx","IconArrowRight24","Meta","items","Text","item","stableIdx","isLastItem","Fragment","Content","Heading","as","ProductBadges","badges","badge","ProductBadge","Description","C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AAc;AAEtB,MAAMC,IAAU,CAAC,EAAE,IAAAC,IAAK,MAAM,UAAAlB,QAE5B,gBAAAO,EAACI,EAAK,mBAAL,EAAuB,KAAKO,GAAI,MAAK,OAAM,WAAWZ,EAAE,SACvD,UAAAN,EAAA,CACF;AAIFiB,EAAQ,cAAc;AAEtB,MAAME,IAAgB,CAAC,EAAE,QAAAC,GAAQ,UAAApB,0BAE9B,OAAA,EAAI,WAAWM,EAAE,eAAe,eAAY,mBAC3C,UAAA;AAAA,EAAAc,EAAO,IAAI,CAACC,GAAOR,MAElB,gBAAAN;AAAA,IAACe;AAAA,IAAA;AAAA,MAGA,aAAaD;AAAA,MACb,QAAQ;AAAA,IAAA;AAAA,IAFH,iBAAiBR,CAAS;AAAA,EAAA,CAKjC;AAAA,EACAb;AAAA,GACF;AAIFmB,EAAc,cAAc;AAE5B,MAAMI,IAAc,CAAC,EAAE,UAAAvB,QAErB,gBAAAO,EAACI,EAAK,MAAL,EAAU,KAAI,KAAI,MAAK,OAAM,WAAWL,EAAE,aACzC,UAAAN,EAAA,CACF;AAIFuB,EAAY,cAAc;AAE1B,MAAMC,IAAiB;AAAA,EACtB,MAAAhC;AAAA,EACA,WAAAiC;AAAA,EACA,iBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,MAAAlB;AAAA,EACA,SAAAO;AAAA,EACA,SAAAC;AAAA,EACA,aAAAM;AAAA,EACA,eAAAJ;AACD;"}
1
+ {"version":3,"file":"primitives.js","sources":["../../../src/patterns/card/primitives.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { Card as MDSCard } from '../../components/card'\nimport { Text } from '../../components/text'\nimport { FlightIcon } from '../../components/flight-icon'\nimport { ProductBadge } from '../product-badge'\nimport { Thumbnail, PersonThumbnail, LogoThumbnail } from './thumbnails'\nimport type {\n\tCardPrimitiveProps,\n\tMetaProps,\n\tContentProps,\n\tHeadingProps,\n\tProductBadgesProps,\n\tDescriptionProps,\n} from './types'\nimport s from './style.module.css'\nimport classNames from 'classnames'\n\nconst Root = forwardRef<HTMLDivElement, CardPrimitiveProps>((props, ref) => {\n\tconst {\n\t\twithArrow = true,\n\t\tlink,\n\t\tclickHandler,\n\t\tisExternal,\n\t\tchildren,\n\t\tclassName,\n\t\t'aria-label': ariaLabel,\n\t} = props\n\n\treturn (\n\t\t<MDSCard\n\t\t\tclassName={classNames(s.card, className)}\n\t\t\thref={link}\n\t\t\tonClickCapture={clickHandler}\n\t\t\tisExternal={isExternal}\n\t\t\tref={ref}\n\t\t\taria-label={ariaLabel}\n\t\t>\n\t\t\t{children}\n\t\t\t<div className={s.cta}>\n\t\t\t\t{withArrow ? <FlightIcon name=\"arrow-right\" size={24} /> : null}\n\t\t\t</div>\n\t\t</MDSCard>\n\t)\n})\n\nRoot.displayName = 'CardPrimitives.Root'\n\nconst Meta = ({ items }: MetaProps) => {\n\treturn (\n\t\t<div className={s.meta} data-testid=\"wpl-card-meta\">\n\t\t\t<Text.Label>\n\t\t\t\t{items.map((item, stableIdx) => {\n\t\t\t\t\tconst isLastItem = stableIdx === items.length - 1\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{item}\n\t\t\t\t\t\t\t{!isLastItem ? (\n\t\t\t\t\t\t\t\t<span className={s.metaSeparator} aria-hidden={true}>\n\t\t\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</Text.Label>\n\t\t</div>\n\t)\n}\n\nMeta.displayName = 'Meta'\n\nconst Content = ({ children }: ContentProps) => {\n\treturn (\n\t\t<div className={s.content} data-testid=\"wpl-card-content\">\n\t\t\t{children}\n\t\t</div>\n\t)\n}\n\nContent.displayName = 'Content'\n\nconst Heading = ({ as = 'h2', children }: HeadingProps) => {\n\treturn (\n\t\t<Text.DisplayExpressive tag={as} size=\"200\" className={s.heading}>\n\t\t\t{children}\n\t\t</Text.DisplayExpressive>\n\t)\n}\n\nHeading.displayName = 'Heading'\n\nconst ProductBadges = ({ badges, children }: ProductBadgesProps) => {\n\treturn (\n\t\t<div className={s.productBadges} data-testid=\"wpl-card-badges\">\n\t\t\t{badges.map((badge, stableIdx) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ProductBadge\n\t\t\t\t\t\t// eslint-disable-next-line react/no-array-index-key\n\t\t\t\t\t\tkey={`product-badge-${stableIdx}`}\n\t\t\t\t\t\tproductName={badge}\n\t\t\t\t\t\thasDot={true}\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t})}\n\t\t\t{children}\n\t\t</div>\n\t)\n}\n\nProductBadges.displayName = 'ProductBadges'\n\nconst Description = ({ children }: DescriptionProps) => {\n\treturn (\n\t\t<Text.Body tag=\"p\" size=\"200\" className={s.description}>\n\t\t\t{children}\n\t\t</Text.Body>\n\t)\n}\n\nDescription.displayName = 'Description'\n\nconst CardPrimitives = {\n\tRoot,\n\tThumbnail,\n\tPersonThumbnail,\n\tLogoThumbnail,\n\tMeta,\n\tContent,\n\tHeading,\n\tDescription,\n\tProductBadges,\n}\n\nexport { CardPrimitives }\n"],"names":["Root","forwardRef","props","ref","withArrow","link","clickHandler","isExternal","children","className","ariaLabel","jsxs","MDSCard","classNames","s","jsx","FlightIcon","Meta","items","Text","item","stableIdx","isLastItem","Fragment","Content","Heading","as","ProductBadges","badges","badge","ProductBadge","Description","CardPrimitives","Thumbnail","PersonThumbnail","LogoThumbnail"],"mappings":";;;;;;;;;AAiBA,MAAMA,IAAOC,EAA+C,CAACC,GAAOC,MAAQ;AAC3E,QAAM;AAAA,IACL,WAAAC,IAAY;AAAA,IACZ,MAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAcC;AAAA,EAAA,IACXR;AAEJ,SACC,gBAAAS;AAAA,IAACC;AAAAA,IAAA;AAAA,MACA,WAAWC,EAAWC,EAAE,MAAML,CA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