@pantheon-systems/pds-toolkit-react 2.0.0-alpha.69 → 2.0.0-alpha.70

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.
package/dist/index.js CHANGED
@@ -2428,7 +2428,7 @@ var rt = Object.create, it = Object.defineProperty, at = Object.getOwnPropertyDe
2428
2428
  ...d
2429
2429
  }, o ? S : x);
2430
2430
  }, xt = ({ className: t, color: n = "brand-muted", label: r, size: i = "s", ...a }) => {
2431
- let o = "pds-badge", s = `${o}--${n}`, c = i === "m" ? null : `${o}--${i}`;
2431
+ let o = "pds-badge", s = `${o}--${n}`, c = `${o}--${i}`;
2432
2432
  return /* @__PURE__ */ e.createElement("span", {
2433
2433
  className: Z([
2434
2434
  o,
@@ -3050,25 +3050,25 @@ var Cn = ({ className: t, componentWidth: n, isLoading: r, loadingText: i = "Loa
3050
3050
  }, Nn = (e, t) => {
3051
3051
  let n = t.toLowerCase();
3052
3052
  return e.find((e) => (e?.textContent?.trim().toLowerCase() ?? "").startsWith(n));
3053
- }, Pn = ({ allowEscape: e = !1, enableClick: t = !0, enableListNavigation: n = !0, enableShift: r = !0, enableTransition: i = !0, enableTypeahead: a = !1, offsetValue: o = 0, openOnHover: s = !1, placement: c = "bottom-start", role: l = "menu", selectedIndex: u = null, shiftPadding: d = 24, variant: f = "default", virtual: p = !1 } = {}) => {
3054
- let [m, _] = g(!1), [v, y] = g(null), b = h([]), x = f === "input", { context: S, floatingStyles: C, refs: N } = M({
3055
- open: m,
3056
- onOpenChange: _,
3057
- placement: c,
3053
+ }, Pn = ({ allowEscape: e = !1, enableClick: t = !0, enableListNavigation: n = !0, enableShift: r = !0, enableTransition: i = !0, enableTypeahead: a = !1, matchReferenceWidth: o = !1, offsetValue: s = 0, openOnHover: c = !1, placement: l = "bottom-start", role: u = "menu", selectedIndex: d = null, shiftPadding: f = 24, variant: p = "default", virtual: m = !1 } = {}) => {
3054
+ let [_, v] = g(!1), [y, b] = g(null), x = h([]), S = p === "input", C = S || o, { context: N, floatingStyles: F, refs: V } = M({
3055
+ open: _,
3056
+ onOpenChange: v,
3057
+ placement: l,
3058
3058
  whileElementsMounted: w,
3059
3059
  middleware: (() => {
3060
3060
  let e = [];
3061
- return x ? e.push(E(({ placement: e }) => e.startsWith("top") ? 16 : 0)) : o > 0 && e.push(E(o)), e.push(T({
3061
+ return S ? e.push(E(({ placement: e }) => e.startsWith("top") ? 16 : 0)) : s > 0 && e.push(E(s)), e.push(T({
3062
3062
  crossAxis: !1,
3063
3063
  padding: 24
3064
3064
  })), r && e.push(O({
3065
- padding: d,
3066
- mainAxis: !x
3065
+ padding: f,
3066
+ mainAxis: !C
3067
3067
  })), e.push(k({
3068
3068
  apply({ availableHeight: e, elements: t, rects: n }) {
3069
3069
  if (t.floating) {
3070
3070
  let r = { maxHeight: `${e}px` };
3071
- x && (r.minHeight = "var(--pds-spacing-3xl)", r.minWidth = `${n.reference.width}px`), Object.assign(t.floating.style, r);
3071
+ S ? (r.minHeight = "var(--pds-spacing-3xl)", r.minWidth = `${n.reference.width}px`) : o && (r.width = `${n.reference.width}px`), Object.assign(t.floating.style, r);
3072
3072
  }
3073
3073
  },
3074
3074
  padding: {
@@ -3080,15 +3080,15 @@ var Cn = ({ className: t, componentWidth: n, isLoading: r, loadingText: i = "Loa
3080
3080
  })), e;
3081
3081
  })(),
3082
3082
  strategy: "fixed"
3083
- }), { getFloatingProps: F, getItemProps: V, getReferenceProps: H } = I([
3084
- A(S, {
3083
+ }), { getFloatingProps: H, getItemProps: U, getReferenceProps: W } = I([
3084
+ A(N, {
3085
3085
  enabled: t,
3086
3086
  event: "mousedown"
3087
3087
  }),
3088
- j(S),
3089
- R(S, { role: l }),
3090
- P(S, {
3091
- enabled: s,
3088
+ j(N),
3089
+ R(N, { role: u }),
3090
+ P(N, {
3091
+ enabled: c,
3092
3092
  move: !1,
3093
3093
  delay: {
3094
3094
  open: 100,
@@ -3100,27 +3100,27 @@ var Cn = ({ className: t, componentWidth: n, isLoading: r, loadingText: i = "Loa
3100
3100
  blockPointerEvents: !0
3101
3101
  })
3102
3102
  }),
3103
- L(S, {
3103
+ L(N, {
3104
3104
  enabled: n,
3105
- listRef: b,
3106
- activeIndex: v,
3107
- onNavigate: y,
3108
- virtual: p,
3105
+ listRef: x,
3106
+ activeIndex: y,
3107
+ onNavigate: b,
3108
+ virtual: m,
3109
3109
  loop: !0,
3110
3110
  allowEscape: e,
3111
- focusItemOnHover: !p
3111
+ focusItemOnHover: !m
3112
3112
  }),
3113
- B(S, {
3113
+ B(N, {
3114
3114
  enabled: a,
3115
- listRef: b,
3116
- activeIndex: v,
3117
- selectedIndex: u,
3115
+ listRef: x,
3116
+ activeIndex: y,
3117
+ selectedIndex: d,
3118
3118
  onMatch: (e) => {
3119
- m || _(!0), y(e);
3119
+ _ || v(!0), b(e);
3120
3120
  },
3121
3121
  findMatch: Nn
3122
3122
  })
3123
- ]), { isMounted: U, styles: W } = z(S, i ? {
3123
+ ]), { isMounted: G, styles: K } = z(N, i ? {
3124
3124
  duration: {
3125
3125
  open: 300,
3126
3126
  close: 150
@@ -3130,18 +3130,18 @@ var Cn = ({ className: t, componentWidth: n, isLoading: r, loadingText: i = "Loa
3130
3130
  close: { opacity: 0 }
3131
3131
  } : { duration: 0 });
3132
3132
  return {
3133
- activeIndex: v,
3134
- floatingStyles: C,
3135
- getFloatingProps: F,
3136
- getItemProps: V,
3137
- getReferenceProps: H,
3138
- isOpen: m,
3139
- isMounted: U,
3140
- listRef: b,
3141
- refs: N,
3142
- setActiveIndex: y,
3143
- setIsOpen: _,
3144
- transitionStyles: W
3133
+ activeIndex: y,
3134
+ floatingStyles: F,
3135
+ getFloatingProps: H,
3136
+ getItemProps: U,
3137
+ getReferenceProps: W,
3138
+ isOpen: _,
3139
+ isMounted: G,
3140
+ listRef: x,
3141
+ refs: V,
3142
+ setActiveIndex: b,
3143
+ setIsOpen: v,
3144
+ transitionStyles: K
3145
3145
  };
3146
3146
  }, Fn = i(null), In = () => {
3147
3147
  let e = l(Fn);
@@ -8748,56 +8748,10 @@ var Hr = {
8748
8748
  iconName: a,
8749
8749
  size: "m"
8750
8750
  })), /* @__PURE__ */ e.createElement("span", { className: `${t}__link-label` }, n.props.children))] })) : n), o;
8751
- }, Ki = ({ ariaLabel: t, border: n = !1, className: r, menuItems: i, ...a }) => {
8752
- let o = h(null), s = "pds-button-nav", c = n ? `${s}--bordered` : null;
8753
- u(() => {
8754
- let e = (e) => {
8755
- if (document.documentElement.hasAttribute("data-pds-mobile")) return;
8756
- let t = o.current;
8757
- if (!t) return;
8758
- let n = Array.from(t.querySelectorAll("a, button, [tabindex]:not([tabindex=\"-1\"])"));
8759
- if (n.length === 0) return;
8760
- let r = document.activeElement, i = n.indexOf(r);
8761
- i !== -1 && (e.key === "ArrowRight" ? (e.preventDefault(), n[(i + 1) % n.length].focus()) : e.key === "ArrowLeft" && (e.preventDefault(), n[(i - 1 + n.length) % n.length].focus()));
8762
- };
8763
- return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
8764
- }, []);
8765
- let l = ({ isActive: t, linkContent: n }) => {
8766
- let r = `${s}__item`;
8767
- return /* @__PURE__ */ e.createElement("li", { className: Z([r, t ? `${r}--active` : null]) }, n);
8768
- }, d = i.length > 0 ? /* @__PURE__ */ e.createElement("ul", { className: `${s}__menu` }, i.map((t, n) => /* @__PURE__ */ e.createElement(l, {
8769
- key: n,
8770
- isActive: Vi(t),
8771
- linkContent: t.linkContent
8772
- }))) : null, f = [];
8773
- i.map((e) => {
8774
- e.linkContent && (Vi(e) ? f.unshift({
8775
- linkContent: e.linkContent,
8776
- isLink: !0
8777
- }) : f.push({
8778
- linkContent: e.linkContent,
8779
- isLink: !0
8780
- }));
8781
- });
8782
- let p = f.length > 0 ? /* @__PURE__ */ e.createElement("div", { className: `${s}__mobile` }, /* @__PURE__ */ e.createElement(rr, {
8783
- actionItems: f,
8784
- id: "mobile-nav-split-button",
8785
- size: "s",
8786
- variant: "secondary"
8787
- })) : null;
8788
- return /* @__PURE__ */ e.createElement("nav", {
8789
- ref: o,
8790
- "aria-label": t,
8791
- className: Z([
8792
- s,
8793
- c,
8794
- r ?? ""
8795
- ]),
8796
- ...a
8797
- }, d, p);
8798
- }, qi = ({ className: t, headingText: n, menuItems: i, selectTextFallback: a = "Navigate to...", ...o }) => {
8751
+ }, Ki = ({ className: t, headingText: n, menuItems: i, selectTextFallback: a = "Navigate to...", ...o }) => {
8799
8752
  let s = "pds-dropdown-menu", c = Ri(i), l = c ? c.props.children : a, u = /* @__PURE__ */ e.createElement(Gn, { className: `pds-dropdown__selected-icon ${s}__active-icon` }), { activeIndex: d, floatingStyles: f, getFloatingProps: p, getItemProps: m, getReferenceProps: h, isMounted: g, listRef: _, refs: v, setIsOpen: y, transitionStyles: b } = Pn({
8800
8753
  enableTypeahead: !0,
8754
+ matchReferenceWidth: !0,
8801
8755
  role: "menu"
8802
8756
  }), x = (e) => {
8803
8757
  e.target.nodeName === "A" && y(!1);
@@ -8895,6 +8849,43 @@ var Hr = {
8895
8849
  tabIndex: d === n ? 0 : -1,
8896
8850
  ...m({ onKeyDown: C })
8897
8851
  }, t.linkContent, t.isActive === !0 && u)))));
8852
+ }, qi = ({ ariaLabel: t, border: n = !1, className: r, hasMobileDropdown: i = !1, menuItems: a, ...o }) => {
8853
+ let s = h(null), c = "pds-button-nav", l = n ? `${c}--bordered` : null, d = i ? `${c}--has-mobile-dropdown` : null;
8854
+ u(() => {
8855
+ let e = (e) => {
8856
+ if (document.documentElement.hasAttribute("data-pds-mobile")) return;
8857
+ let t = s.current;
8858
+ if (!t) return;
8859
+ let n = Array.from(t.querySelectorAll("a, button, [tabindex]:not([tabindex=\"-1\"])"));
8860
+ if (n.length === 0) return;
8861
+ let r = document.activeElement, i = n.indexOf(r);
8862
+ i !== -1 && (e.key === "ArrowRight" ? (e.preventDefault(), n[(i + 1) % n.length].focus()) : e.key === "ArrowLeft" && (e.preventDefault(), n[(i - 1 + n.length) % n.length].focus()));
8863
+ };
8864
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
8865
+ }, []);
8866
+ let f = ({ isActive: t, linkContent: n }) => {
8867
+ let r = `${c}__item`;
8868
+ return /* @__PURE__ */ e.createElement("li", { className: Z([r, t ? `${r}--active` : null]) }, n);
8869
+ }, p = a.length > 0 ? /* @__PURE__ */ e.createElement("ul", { className: `${c}__menu` }, a.map((t, n) => /* @__PURE__ */ e.createElement(f, {
8870
+ key: n,
8871
+ isActive: Vi(t),
8872
+ linkContent: t.linkContent
8873
+ }))) : null, m = /* @__PURE__ */ e.createElement(Ki, {
8874
+ className: `${c}__mobile`,
8875
+ menuItems: a,
8876
+ selectTextFallback: t
8877
+ });
8878
+ return /* @__PURE__ */ e.createElement("nav", {
8879
+ ref: s,
8880
+ "aria-label": t,
8881
+ className: Z([
8882
+ c,
8883
+ l,
8884
+ d,
8885
+ r ?? ""
8886
+ ]),
8887
+ ...o
8888
+ }, p, i && m);
8898
8889
  }, Ji = ({ children: t, className: n, width: r = "standard", ...i }) => {
8899
8890
  let a = "pds-container", o = r === "standard" ? null : `${a}--${r}`;
8900
8891
  return /* @__PURE__ */ e.createElement("div", {
@@ -9058,7 +9049,7 @@ var Hr = {
9058
9049
  Vi(t) ? `${m}--active` : null
9059
9050
  ])
9060
9051
  }, Wi(t.linkContent, t.links))))) : i);
9061
- }, S = /* @__PURE__ */ e.createElement(e.Fragment, null, a && /* @__PURE__ */ e.createElement("h2", { className: `${f}__heading` }, a), c.length > 0 && /* @__PURE__ */ e.createElement("ul", { className: `${f}__menu ${f}__menu--top-level` }, c.map((e, t) => x(e, t)))), C = /* @__PURE__ */ e.createElement(qi, {
9052
+ }, S = /* @__PURE__ */ e.createElement(e.Fragment, null, a && /* @__PURE__ */ e.createElement("h2", { className: `${f}__heading` }, a), c.length > 0 && /* @__PURE__ */ e.createElement("ul", { className: `${f}__menu ${f}__menu--top-level` }, c.map((e, t) => x(e, t)))), C = /* @__PURE__ */ e.createElement(Ki, {
9062
9053
  className: `${f}__mobile`,
9063
9054
  headingText: a,
9064
9055
  menuItems: c,
@@ -12746,6 +12737,6 @@ var bo = ({ children: t, className: n, columns: r, depth: i = 0, hasChildren: a
12746
12737
  }, []), t;
12747
12738
  };
12748
12739
  //#endregion
12749
- export { ur as ActionCard, qo as AppLayout, bt as Avatar, xt as Badge, fa as Banner, Nr as BarChart, Cn as BranchDiff, Li as Breadcrumb, Dn as Button, On as ButtonLink, Ki as ButtonNav, Ni as CTALink, lr as Callout, dr as Card, fr as CardSelect, $r as Checkbox, ei as CheckboxFieldset, ti as CheckboxGroup, jn as ClipboardButton, Mn as CloseButton, Ur as CodeBlock, ni as Combobox, ii as ComboboxMultiselect, pr as CompactEmptyState, Gr as ComparisonList, Ji as Container, Ci as Datepicker, Jo as DocsLayout, Da as Drawer, Ln as Dropdown, qi as DropdownMenu, Fa as ExpansionPanel, Ia as ExpansionPanelGroup, Yr as FileDiff, wi as FileUpload, Kn as FilterButton, $o as FlexContainer, Oa as FullScreenOverlay, cs as GlobalWrapper, ls as Grid, us as GridItem, qr as HorizontalEmptyState, Q as Icon, An as IconButton, Qr as IdentityBlock, ma as InlineMessage, Ti as InputGroup, Fr as LineChart, Pi as LinkNewWindow, _a as MIN_AUTO_CLOSE_DURATION, tr as MenuButton, ka as Modal, Yi as Navbar, Ma as Pagination, Na as PaginationChapter, Pa as PaginationCompact, La as Panel, Ra as PanelList, za as PanelRow, Ba as PanelStack, Wa as PantheonLogo, Zr as PaymentIcon, Ii as Picture, Lr as PieChart, ir as PlatformIcon, qa as Popover, Ya as ProgressBar, Za as ProgressRing, zr as ProportionBar, Ei as RadioGroup, eo as ResultCount, or as SSOButton, ga as SectionMessage, nr as SegmentedButton, hr as Select, mr as SelectOptionGroup, Xi as SideNav, Qi as SideNavGlobal, Zi as SideNavGlobalItem, Yo as SidebarLayout, ro as SiteFooter, ea as SiteMenu, io as SiteOptionDisplay, ao as SiteSearch, er as SiteTypeIcon, $n as SiteTypeLabel, kr as Skeleton, Fi as Skiplink, vo as SortableList, fo as SortableListHeader, bo as SortableRow, bn as Spinner, rr as SplitButton, xn as StatusBadge, So as StatusChecker, Co as StatusIndicator, Jn as StatusTypeLabels, wo as StepList, To as Stepper, Xo as StepperLayout, Di as Switch, na as TabMenu, Oo as Table, Fo as TableOfContents, Io as Tabs, Wo as Tag, ki as TagsInput, Sn as Tally, Mi as TextInput, Ai as Textarea, rs as ThemeContext, os as ThemeContextProvider, oa as ThemeSwitcher, Zo as ThreeItemLayout, li as Timepicker, wa as Toast, Ta as ToastType, xa as Toaster, ya as ToasterContext, nn as Tooltip, ia as TreeNav, Qo as TwoItemLayout, sa as UserMenu, Go as UtilityBar, sr as UtilityButton, Jr as VerticalEmptyState, Do as VerticalStepper, Kr as VideoEmbed, ca as WorkspaceSelector, yi as getPresetDateRange, as as getThemeInitScript, _t as iconList, Xn as isHeadingItemType, Zn as isLinkItemType, Qn as isNodeItemType, Yn as isSeparatorItemType, xo as statusCheckerStates, Lo as tagColors, Bo as tagSolidColors, Ro as tagSolidHueColors, zo as tagSolidStatusColors, Ko as useBreakpoint, kn as useClipboard, Pn as useDropdown, Xt as useIsMobile, ds as useKeyPress, tn as useKeyboardShortcut, es as useMediaQuery, ss as useTheme, Ea as useToast, fs as useWindowWidth };
12740
+ export { ur as ActionCard, qo as AppLayout, bt as Avatar, xt as Badge, fa as Banner, Nr as BarChart, Cn as BranchDiff, Li as Breadcrumb, Dn as Button, On as ButtonLink, qi as ButtonNav, Ni as CTALink, lr as Callout, dr as Card, fr as CardSelect, $r as Checkbox, ei as CheckboxFieldset, ti as CheckboxGroup, jn as ClipboardButton, Mn as CloseButton, Ur as CodeBlock, ni as Combobox, ii as ComboboxMultiselect, pr as CompactEmptyState, Gr as ComparisonList, Ji as Container, Ci as Datepicker, Jo as DocsLayout, Da as Drawer, Ln as Dropdown, Ki as DropdownMenu, Fa as ExpansionPanel, Ia as ExpansionPanelGroup, Yr as FileDiff, wi as FileUpload, Kn as FilterButton, $o as FlexContainer, Oa as FullScreenOverlay, cs as GlobalWrapper, ls as Grid, us as GridItem, qr as HorizontalEmptyState, Q as Icon, An as IconButton, Qr as IdentityBlock, ma as InlineMessage, Ti as InputGroup, Fr as LineChart, Pi as LinkNewWindow, _a as MIN_AUTO_CLOSE_DURATION, tr as MenuButton, ka as Modal, Yi as Navbar, Ma as Pagination, Na as PaginationChapter, Pa as PaginationCompact, La as Panel, Ra as PanelList, za as PanelRow, Ba as PanelStack, Wa as PantheonLogo, Zr as PaymentIcon, Ii as Picture, Lr as PieChart, ir as PlatformIcon, qa as Popover, Ya as ProgressBar, Za as ProgressRing, zr as ProportionBar, Ei as RadioGroup, eo as ResultCount, or as SSOButton, ga as SectionMessage, nr as SegmentedButton, hr as Select, mr as SelectOptionGroup, Xi as SideNav, Qi as SideNavGlobal, Zi as SideNavGlobalItem, Yo as SidebarLayout, ro as SiteFooter, ea as SiteMenu, io as SiteOptionDisplay, ao as SiteSearch, er as SiteTypeIcon, $n as SiteTypeLabel, kr as Skeleton, Fi as Skiplink, vo as SortableList, fo as SortableListHeader, bo as SortableRow, bn as Spinner, rr as SplitButton, xn as StatusBadge, So as StatusChecker, Co as StatusIndicator, Jn as StatusTypeLabels, wo as StepList, To as Stepper, Xo as StepperLayout, Di as Switch, na as TabMenu, Oo as Table, Fo as TableOfContents, Io as Tabs, Wo as Tag, ki as TagsInput, Sn as Tally, Mi as TextInput, Ai as Textarea, rs as ThemeContext, os as ThemeContextProvider, oa as ThemeSwitcher, Zo as ThreeItemLayout, li as Timepicker, wa as Toast, Ta as ToastType, xa as Toaster, ya as ToasterContext, nn as Tooltip, ia as TreeNav, Qo as TwoItemLayout, sa as UserMenu, Go as UtilityBar, sr as UtilityButton, Jr as VerticalEmptyState, Do as VerticalStepper, Kr as VideoEmbed, ca as WorkspaceSelector, yi as getPresetDateRange, as as getThemeInitScript, _t as iconList, Xn as isHeadingItemType, Zn as isLinkItemType, Qn as isNodeItemType, Yn as isSeparatorItemType, xo as statusCheckerStates, Lo as tagColors, Bo as tagSolidColors, Ro as tagSolidHueColors, zo as tagSolidStatusColors, Ko as useBreakpoint, kn as useClipboard, Pn as useDropdown, Xt as useIsMobile, ds as useKeyPress, tn as useKeyboardShortcut, es as useMediaQuery, ss as useTheme, Ea as useToast, fs as useWindowWidth };
12750
12741
 
12751
12742
  //# sourceMappingURL=index.js.map