@pitchfork-ui/react 0.8.0 → 0.10.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.
Files changed (130) hide show
  1. package/LICENSE +21 -0
  2. package/dist/a11y/index.js +1 -0
  3. package/dist/components/Accordion/Accordion2.js +1 -0
  4. package/dist/components/Alert/Alert2.js +1 -0
  5. package/dist/components/Avatar/Avatar2.js +1 -0
  6. package/dist/components/AvatarGroup/AvatarGroup2.js +1 -0
  7. package/dist/components/Badge/Badge2.js +1 -0
  8. package/dist/components/BadgeGroup/BadgeGroup2.js +1 -0
  9. package/dist/components/Breadcrumbs/Breadcrumbs2.js +1 -0
  10. package/dist/components/Button/Button2.js +1 -0
  11. package/dist/components/ButtonGroup/ButtonGroup2.js +1 -0
  12. package/dist/components/Calendar/Calendar2.js +1 -0
  13. package/dist/components/Card/Card2.js +1 -0
  14. package/dist/components/Carousel/Carousel2.js +1 -0
  15. package/dist/components/Checkbox/Checkbox2.js +1 -0
  16. package/dist/components/CodeSnippet/CodeSnippet2.js +1 -0
  17. package/dist/components/Collapsible/Collapsible.css +86 -0
  18. package/dist/components/Collapsible/Collapsible2.js +65 -0
  19. package/dist/components/Combobox/Combobox2.js +1 -0
  20. package/dist/components/CommandPalette/CommandPalette2.js +1 -0
  21. package/dist/components/ContentDivider/ContentDivider2.js +1 -0
  22. package/dist/components/ContextMenu/ContextMenu.css +122 -0
  23. package/dist/components/ContextMenu/ContextMenu2.js +155 -0
  24. package/dist/components/CreditCard/CreditCard2.js +1 -0
  25. package/dist/components/DatePicker/DatePicker2.js +1 -0
  26. package/dist/components/DateRangePicker/DateRangePicker2.js +1 -0
  27. package/dist/components/Dropdown/Dropdown2.js +1 -0
  28. package/dist/components/EmptyState/EmptyState2.js +1 -0
  29. package/dist/components/FileUploader/FileUploader2.js +1 -0
  30. package/dist/components/GaugeChart/GaugeChart2.js +1 -0
  31. package/dist/components/HeaderNavigation/HeaderNavigation2.js +1 -0
  32. package/dist/components/Heatmap/Heatmap2.js +1 -0
  33. package/dist/components/Icon/Icon2.js +18 -0
  34. package/dist/components/InlineCTA/InlineCTA2.js +1 -0
  35. package/dist/components/Input/Input2.js +1 -0
  36. package/dist/components/Kbd/Kbd2.js +1 -0
  37. package/dist/components/LineBarCharts/LineBarChart2.js +1 -0
  38. package/dist/components/LoadingIndicators/LoadingIndicators2.js +1 -0
  39. package/dist/components/Metrics/Metrics2.js +1 -0
  40. package/dist/components/Modal/Modal.css +6 -3
  41. package/dist/components/Modal/Modal2.js +1 -0
  42. package/dist/components/MultiSelect/MultiSelect2.js +1 -0
  43. package/dist/components/Notification/Notification2.js +1 -0
  44. package/dist/components/NumberInput/NumberInput2.js +1 -0
  45. package/dist/components/PageHeader/PageHeader2.js +1 -0
  46. package/dist/components/Pagination/Pagination2.js +1 -0
  47. package/dist/components/PieChart/PieChart2.js +1 -0
  48. package/dist/components/Popover/Popover2.js +1 -0
  49. package/dist/components/ProgressIndicators/ProgressIndicators2.js +1 -0
  50. package/dist/components/ProgressSteps/ProgressSteps2.js +1 -0
  51. package/dist/components/RadarChart/RadarChart2.js +1 -0
  52. package/dist/components/RadioButton/RadioButton2.js +1 -0
  53. package/dist/components/RadioGroup/RadioGroup2.js +1 -0
  54. package/dist/components/Rating/Rating2.js +1 -0
  55. package/dist/components/Resizable/Resizable.css +79 -0
  56. package/dist/components/Resizable/Resizable2.js +101 -0
  57. package/dist/components/RichTextEditor/RichTextEditor2.js +1 -0
  58. package/dist/components/ScrollArea/ScrollArea.css +54 -0
  59. package/dist/components/ScrollArea/ScrollArea2.js +18 -0
  60. package/dist/components/SectionFooter/SectionFooter2.js +1 -0
  61. package/dist/components/SectionHeader/SectionHeader2.js +1 -0
  62. package/dist/components/Select/Select2.js +1 -0
  63. package/dist/components/SidebarNavigation/SidebarNavigation2.js +1 -0
  64. package/dist/components/SlideoutMenu/SlideoutMenu2.js +1 -0
  65. package/dist/components/Slider/Slider2.js +1 -0
  66. package/dist/components/Sparkline/Sparkline2.js +1 -0
  67. package/dist/components/Switch/Switch2.js +1 -0
  68. package/dist/components/Table/Table2.js +1 -0
  69. package/dist/components/Tabs/Tabs2.js +1 -0
  70. package/dist/components/Tag/Tag2.js +1 -0
  71. package/dist/components/TagInput/TagInput.css +72 -0
  72. package/dist/components/TagInput/TagInput2.js +116 -0
  73. package/dist/components/Textarea/Textarea2.js +1 -0
  74. package/dist/components/TimePicker/TimePicker.css +179 -0
  75. package/dist/components/TimePicker/TimePicker2.js +239 -0
  76. package/dist/components/Timeline/Timeline.css +128 -0
  77. package/dist/components/Timeline/Timeline2.js +49 -0
  78. package/dist/components/Toast/Toast.js +1 -0
  79. package/dist/components/Toolbar/Toolbar.css +37 -0
  80. package/dist/components/Toolbar/Toolbar2.js +71 -0
  81. package/dist/components/Tooltip/Tooltip2.js +1 -0
  82. package/dist/components/TreeView/TreeView2.js +1 -0
  83. package/dist/components/UtilityButton/UtilityButton2.js +1 -0
  84. package/dist/components/VideoPlayer/VideoPlayer2.js +1 -0
  85. package/dist/components/VisuallyHidden/VisuallyHidden.css +26 -0
  86. package/dist/components/VisuallyHidden/VisuallyHidden2.js +21 -0
  87. package/dist/hooks/useAnchoredPosition.js +1 -0
  88. package/dist/hooks/useComposedRefs.js +1 -0
  89. package/dist/hooks/useControllableState.js +1 -0
  90. package/dist/hooks/useDisclosure.js +1 -0
  91. package/dist/hooks/useExitAnimation.js +1 -0
  92. package/dist/hooks/useFocusTrap.js +1 -0
  93. package/dist/hooks/useListNavigation.js +1 -0
  94. package/dist/hooks/useOutsideInteraction.js +1 -0
  95. package/dist/hooks/usePresence.js +1 -0
  96. package/dist/index.cjs +787 -7
  97. package/dist/index.js +11 -1
  98. package/dist/src/components/Collapsible/Collapsible.d.ts +11 -0
  99. package/dist/src/components/Collapsible/Collapsible.test.d.ts +1 -0
  100. package/dist/src/components/Collapsible/index.d.ts +1 -0
  101. package/dist/src/components/ContextMenu/ContextMenu.d.ts +20 -0
  102. package/dist/src/components/ContextMenu/ContextMenu.test.d.ts +1 -0
  103. package/dist/src/components/ContextMenu/index.d.ts +1 -0
  104. package/dist/src/components/Resizable/Resizable.d.ts +19 -0
  105. package/dist/src/components/Resizable/Resizable.test.d.ts +1 -0
  106. package/dist/src/components/Resizable/index.d.ts +1 -0
  107. package/dist/src/components/ScrollArea/ScrollArea.d.ts +12 -0
  108. package/dist/src/components/ScrollArea/ScrollArea.test.d.ts +1 -0
  109. package/dist/src/components/ScrollArea/index.d.ts +1 -0
  110. package/dist/src/components/TagInput/TagInput.d.ts +23 -0
  111. package/dist/src/components/TagInput/TagInput.test.d.ts +1 -0
  112. package/dist/src/components/TagInput/index.d.ts +1 -0
  113. package/dist/src/components/TimePicker/TimePicker.d.ts +18 -0
  114. package/dist/src/components/TimePicker/TimePicker.test.d.ts +1 -0
  115. package/dist/src/components/TimePicker/index.d.ts +1 -0
  116. package/dist/src/components/Timeline/Timeline.d.ts +16 -0
  117. package/dist/src/components/Timeline/Timeline.test.d.ts +1 -0
  118. package/dist/src/components/Timeline/index.d.ts +1 -0
  119. package/dist/src/components/Toolbar/Toolbar.d.ts +8 -0
  120. package/dist/src/components/Toolbar/Toolbar.test.d.ts +1 -0
  121. package/dist/src/components/Toolbar/index.d.ts +1 -0
  122. package/dist/src/components/VisuallyHidden/VisuallyHidden.d.ts +15 -0
  123. package/dist/src/components/VisuallyHidden/VisuallyHidden.test.d.ts +1 -0
  124. package/dist/src/components/VisuallyHidden/index.d.ts +1 -0
  125. package/dist/src/index.d.ts +9 -0
  126. package/dist/styles/theme.css +77 -0
  127. package/dist/styles.css +866 -3
  128. package/dist/utils/FieldWrapper.js +1 -0
  129. package/dist/utils/cx.js +1 -0
  130. package/package.json +29 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Leland Rangel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  //#region src/a11y/index.ts
2
3
  var Keys = {
3
4
  ArrowDown: "ArrowDown",
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { Keys } from "../../a11y/index.js";
2
3
  import { useControllableState } from "../../hooks/useControllableState.js";
3
4
  import { cx } from "../../utils/cx.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useExitAnimation } from "../../hooks/useExitAnimation.js";
2
3
  import { cx } from "../../utils/cx.js";
3
4
  import { Icon } from "../Icon/Icon2.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './Avatar.css';/* empty css */
3
4
  import { forwardRef } from "react";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import { Avatar } from "../Avatar/Avatar2.js";
3
4
  import './AvatarGroup.css';/* empty css */
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './Badge.css';/* empty css */
3
4
  import { forwardRef } from "react";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './BadgeGroup.css';/* empty css */
3
4
  import { forwardRef } from "react";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './Breadcrumbs.css';/* empty css */
3
4
  import { forwardRef } from "react";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './Button.css';/* empty css */
3
4
  import { forwardRef } from "react";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './ButtonGroup.css';/* empty css */
3
4
  import { forwardRef, useMemo, useState } from "react";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import { Icon } from "../Icon/Icon2.js";
3
4
  import { Dropdown } from "../Dropdown/Dropdown2.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './Card.css';/* empty css */
3
4
  import { jsx } from "react/jsx-runtime";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import { Icon } from "../Icon/Icon2.js";
3
4
  import './Carousel.css';/* empty css */
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './Checkbox.css';/* empty css */
3
4
  import { forwardRef, useId } from "react";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import { Icon } from "../Icon/Icon2.js";
3
4
  import './CodeSnippet.css';/* empty css */
@@ -0,0 +1,86 @@
1
+ .pf-collapsible {
2
+ border: 1px solid var(--pf-collapsible-border);
3
+ border-radius: var(--radius-md);
4
+ }
5
+
6
+ .pf-collapsible__trigger {
7
+ align-items: center;
8
+ background: transparent;
9
+ border: 0;
10
+ border-radius: var(--radius-md);
11
+ color: var(--pf-collapsible-trigger-text);
12
+ cursor: pointer;
13
+ display: flex;
14
+ font: inherit;
15
+ font-weight: var(--font-weight-medium);
16
+ gap: var(--space-2);
17
+ justify-content: space-between;
18
+ padding: var(--space-3);
19
+ text-align: start;
20
+ width: 100%;
21
+ }
22
+
23
+ .pf-collapsible__trigger:hover:not(:disabled) {
24
+ background: var(--pf-collapsible-trigger-hover-bg);
25
+ }
26
+
27
+ .pf-collapsible__trigger:focus-visible {
28
+ box-shadow: var(--pf-collapsible-focus-ring, var(--pf-focus-ring));
29
+ outline: none;
30
+ }
31
+
32
+ .pf-collapsible__trigger:disabled {
33
+ color: var(--pf-control-text-disabled);
34
+ cursor: not-allowed;
35
+ }
36
+
37
+ .pf-collapsible__label {
38
+ min-width: 0;
39
+ }
40
+
41
+ .pf-collapsible__icon {
42
+ align-items: center;
43
+ color: var(--pf-collapsible-icon);
44
+ display: inline-flex;
45
+ flex-shrink: 0;
46
+ transition: transform var(--pf-transition-fast);
47
+ }
48
+
49
+ .pf-collapsible__icon svg {
50
+ display: block;
51
+ height: 16px;
52
+ width: 16px;
53
+ }
54
+
55
+ .pf-collapsible--open .pf-collapsible__icon {
56
+ transform: rotate(180deg);
57
+ }
58
+
59
+ /* Height animation via the grid-template-rows 0fr → 1fr technique. */
60
+ .pf-collapsible__panel {
61
+ display: grid;
62
+ grid-template-rows: 0fr;
63
+ transition: grid-template-rows var(--pf-transition-medium);
64
+ }
65
+
66
+ .pf-collapsible__panel--open {
67
+ grid-template-rows: 1fr;
68
+ }
69
+
70
+ .pf-collapsible__content {
71
+ min-height: 0;
72
+ overflow: hidden;
73
+ }
74
+
75
+ .pf-collapsible__content-inner {
76
+ border-top: 1px solid var(--pf-collapsible-border);
77
+ color: var(--pf-collapsible-content-text);
78
+ padding: var(--space-3);
79
+ }
80
+
81
+ @media (prefers-reduced-motion: reduce) {
82
+ .pf-collapsible__panel,
83
+ .pf-collapsible__icon {
84
+ transition: none;
85
+ }
86
+ }
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { Keys } from "../../a11y/index.js";
3
+ import { useDisclosure } from "../../hooks/useDisclosure.js";
4
+ import { cx } from "../../utils/cx.js";
5
+ import { Icon } from "../Icon/Icon2.js";
6
+ import './Collapsible.css';/* empty css */
7
+ import { forwardRef, useId } from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ //#region src/components/Collapsible/Collapsible.tsx
10
+ var Collapsible = forwardRef(function Collapsible({ className, trigger, open, defaultOpen, onOpenChange, disabled = false, showChevron = true, children, ...props }, ref) {
11
+ const baseId = useId();
12
+ const triggerId = `${baseId}-trigger`;
13
+ const contentId = `${baseId}-content`;
14
+ const disclosure = useDisclosure({
15
+ open,
16
+ defaultOpen,
17
+ onOpenChange,
18
+ disabled
19
+ });
20
+ const isOpen = disclosure.isOpen ?? false;
21
+ return /* @__PURE__ */ jsxs("div", {
22
+ ref,
23
+ className: cx("pf-collapsible", isOpen && "pf-collapsible--open", className),
24
+ ...props,
25
+ children: [/* @__PURE__ */ jsxs("button", {
26
+ id: triggerId,
27
+ type: "button",
28
+ className: "pf-collapsible__trigger",
29
+ disabled,
30
+ "aria-expanded": isOpen,
31
+ "aria-controls": contentId,
32
+ onClick: () => disclosure.toggle(),
33
+ onKeyDown: (event) => {
34
+ if (event.key === Keys.Escape && isOpen) disclosure.close();
35
+ },
36
+ children: [/* @__PURE__ */ jsx("span", {
37
+ className: "pf-collapsible__label",
38
+ children: trigger
39
+ }), showChevron ? /* @__PURE__ */ jsx("span", {
40
+ className: "pf-collapsible__icon",
41
+ "aria-hidden": true,
42
+ children: /* @__PURE__ */ jsx(Icon, {
43
+ name: "chevron-down",
44
+ "aria-hidden": true
45
+ })
46
+ }) : null]
47
+ }), /* @__PURE__ */ jsx("div", {
48
+ id: contentId,
49
+ role: "region",
50
+ "aria-labelledby": triggerId,
51
+ className: cx("pf-collapsible__panel", isOpen && "pf-collapsible__panel--open"),
52
+ ...!isOpen ? { inert: true } : {},
53
+ children: /* @__PURE__ */ jsx("div", {
54
+ className: "pf-collapsible__content",
55
+ children: /* @__PURE__ */ jsx("div", {
56
+ className: "pf-collapsible__content-inner",
57
+ children
58
+ })
59
+ })
60
+ })]
61
+ });
62
+ });
63
+ Collapsible.displayName = "Collapsible";
64
+ //#endregion
65
+ export { Collapsible };
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { Keys, composeDescribedBy } from "../../a11y/index.js";
2
3
  import { useAnchoredPosition } from "../../hooks/useAnchoredPosition.js";
3
4
  import { useComposedRefs } from "../../hooks/useComposedRefs.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { Keys } from "../../a11y/index.js";
2
3
  import { useFocusTrap } from "../../hooks/useFocusTrap.js";
3
4
  import { useListNavigation } from "../../hooks/useListNavigation.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './ContentDivider.css';/* empty css */
3
4
  import { forwardRef } from "react";
@@ -0,0 +1,122 @@
1
+ .pf-context-menu {
2
+ display: contents;
3
+ }
4
+
5
+ .pf-context-menu__menu {
6
+ animation: pf-context-menu-in var(--duration-fast) var(--easing-decelerate);
7
+ background: var(--pf-contextmenu-bg);
8
+ border: 1px solid var(--pf-contextmenu-border);
9
+ border-radius: var(--radius-md);
10
+ box-shadow: var(--pf-elevation-popover-shadow);
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: 2px;
14
+ min-width: 180px;
15
+ outline: none;
16
+ padding: var(--space-1);
17
+ z-index: 1100;
18
+ }
19
+
20
+ .pf-context-menu__menu--exiting {
21
+ animation: pf-context-menu-out var(--duration-fast) var(--easing-accelerate) forwards;
22
+ }
23
+
24
+ @keyframes pf-context-menu-in {
25
+ from {
26
+ opacity: 0;
27
+ transform: scale(0.96);
28
+ }
29
+ to {
30
+ opacity: 1;
31
+ transform: scale(1);
32
+ }
33
+ }
34
+
35
+ @keyframes pf-context-menu-out {
36
+ from {
37
+ opacity: 1;
38
+ transform: scale(1);
39
+ }
40
+ to {
41
+ opacity: 0;
42
+ transform: scale(0.96);
43
+ }
44
+ }
45
+
46
+ .pf-context-menu__item {
47
+ align-items: center;
48
+ background: var(--pf-contextmenu-bg);
49
+ border: 0;
50
+ border-radius: var(--radius-sm);
51
+ color: var(--pf-contextmenu-text);
52
+ cursor: pointer;
53
+ display: flex;
54
+ font: inherit;
55
+ gap: var(--space-2);
56
+ padding: var(--space-2) var(--space-3);
57
+ text-align: start;
58
+ width: 100%;
59
+ }
60
+
61
+ .pf-context-menu__item--active {
62
+ background: var(--pf-contextmenu-item-active-bg);
63
+ color: var(--pf-contextmenu-item-active-text);
64
+ }
65
+
66
+ .pf-context-menu__item:disabled {
67
+ color: var(--pf-contextmenu-text-muted);
68
+ cursor: not-allowed;
69
+ }
70
+
71
+ .pf-context-menu__item--destructive {
72
+ color: var(--pf-contextmenu-text-danger);
73
+ }
74
+
75
+ .pf-context-menu__item--destructive.pf-context-menu__item--active {
76
+ background: var(--pf-contextmenu-danger-active-bg);
77
+ color: var(--pf-contextmenu-danger-active-text);
78
+ }
79
+
80
+ .pf-context-menu__item-icon {
81
+ align-items: center;
82
+ display: inline-flex;
83
+ flex-shrink: 0;
84
+ height: 1rem;
85
+ justify-content: center;
86
+ width: 1rem;
87
+ }
88
+
89
+ .pf-context-menu__item-icon svg {
90
+ display: block;
91
+ height: 1rem;
92
+ width: 1rem;
93
+ }
94
+
95
+ .pf-context-menu__item-label {
96
+ flex: 1;
97
+ min-width: 0;
98
+ }
99
+
100
+ .pf-context-menu__item-shortcut {
101
+ color: var(--pf-contextmenu-text-muted);
102
+ flex-shrink: 0;
103
+ font-family: var(--font-family-mono, ui-monospace, monospace);
104
+ font-size: var(--font-size-xs);
105
+ }
106
+
107
+ .pf-context-menu__item--active .pf-context-menu__item-shortcut {
108
+ color: inherit;
109
+ }
110
+
111
+ .pf-context-menu__separator {
112
+ background: var(--pf-contextmenu-separator);
113
+ height: 1px;
114
+ margin: var(--space-1) 0;
115
+ }
116
+
117
+ @media (prefers-reduced-motion: reduce) {
118
+ .pf-context-menu__menu,
119
+ .pf-context-menu__menu--exiting {
120
+ animation: none;
121
+ }
122
+ }
@@ -0,0 +1,155 @@
1
+ "use client";
2
+ import { Keys } from "../../a11y/index.js";
3
+ import { useComposedRefs } from "../../hooks/useComposedRefs.js";
4
+ import { useListNavigation } from "../../hooks/useListNavigation.js";
5
+ import { useOutsideInteraction } from "../../hooks/useOutsideInteraction.js";
6
+ import { usePresence } from "../../hooks/usePresence.js";
7
+ import { cx } from "../../utils/cx.js";
8
+ import './ContextMenu.css';/* empty css */
9
+ import { forwardRef, useId, useLayoutEffect, useRef, useState } from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { createPortal } from "react-dom";
12
+ //#region src/components/ContextMenu/ContextMenu.tsx
13
+ var isSeparator = (entry) => entry.separator === true;
14
+ var VIEWPORT_PADDING = 8;
15
+ var ContextMenu = forwardRef(function ContextMenu({ className, items, disabled = false, onOpenChange, children, onContextMenu, ...props }, ref) {
16
+ const menuId = useId();
17
+ const [isOpen, setIsOpen] = useState(false);
18
+ const [point, setPoint] = useState({
19
+ x: 0,
20
+ y: 0
21
+ });
22
+ const [coords, setCoords] = useState(null);
23
+ const rootRefs = useComposedRefs(useRef(null), ref);
24
+ const menuRef = useRef(null);
25
+ const { isMounted, isExiting } = usePresence(isOpen, 140);
26
+ const actionable = items.filter((e) => !isSeparator(e));
27
+ const { activeIndex, move, setActiveIndex } = useListNavigation({
28
+ items: actionable,
29
+ isDisabled: (item) => Boolean(item.disabled)
30
+ });
31
+ const setOpen = (open) => {
32
+ setIsOpen(open);
33
+ onOpenChange?.(open);
34
+ };
35
+ useOutsideInteraction({
36
+ refs: [menuRef],
37
+ enabled: isOpen,
38
+ onInteractOutside: () => setOpen(false)
39
+ });
40
+ useLayoutEffect(() => {
41
+ if (!isMounted || !menuRef.current) return;
42
+ const rect = menuRef.current.getBoundingClientRect();
43
+ const maxLeft = window.innerWidth - rect.width - VIEWPORT_PADDING;
44
+ const maxTop = window.innerHeight - rect.height - VIEWPORT_PADDING;
45
+ setCoords({
46
+ left: Math.max(VIEWPORT_PADDING, Math.min(point.x, maxLeft)),
47
+ top: Math.max(VIEWPORT_PADDING, Math.min(point.y, maxTop))
48
+ });
49
+ }, [
50
+ isMounted,
51
+ point.x,
52
+ point.y
53
+ ]);
54
+ const handleContextMenu = (event) => {
55
+ onContextMenu?.(event);
56
+ if (disabled || event.defaultPrevented) return;
57
+ event.preventDefault();
58
+ setPoint({
59
+ x: event.clientX,
60
+ y: event.clientY
61
+ });
62
+ setCoords(null);
63
+ setActiveIndex(actionable.findIndex((item) => !item.disabled));
64
+ setOpen(true);
65
+ };
66
+ const select = (item) => {
67
+ if (item.disabled) return;
68
+ item.onSelect?.();
69
+ setOpen(false);
70
+ };
71
+ const onMenuKeyDown = (event) => {
72
+ if (event.key === Keys.Escape) {
73
+ event.preventDefault();
74
+ setOpen(false);
75
+ } else if (event.key === Keys.ArrowDown) {
76
+ event.preventDefault();
77
+ move("next");
78
+ } else if (event.key === Keys.ArrowUp) {
79
+ event.preventDefault();
80
+ move("previous");
81
+ } else if (event.key === Keys.Home) {
82
+ event.preventDefault();
83
+ move("first");
84
+ } else if (event.key === Keys.End) {
85
+ event.preventDefault();
86
+ move("last");
87
+ } else if (event.key === Keys.Enter || event.key === Keys.Space) {
88
+ event.preventDefault();
89
+ const item = actionable[activeIndex];
90
+ if (item) select(item);
91
+ }
92
+ };
93
+ useLayoutEffect(() => {
94
+ if (isMounted && coords) menuRef.current?.focus();
95
+ }, [isMounted, coords]);
96
+ let actionableIndex = -1;
97
+ return /* @__PURE__ */ jsxs("div", {
98
+ ref: rootRefs,
99
+ className: cx("pf-context-menu", className),
100
+ onContextMenu: handleContextMenu,
101
+ ...props,
102
+ children: [children, isMounted && typeof document !== "undefined" ? createPortal(/* @__PURE__ */ jsx("div", {
103
+ id: menuId,
104
+ ref: menuRef,
105
+ role: "menu",
106
+ "aria-label": "Context menu",
107
+ tabIndex: -1,
108
+ className: cx("pf-context-menu__menu", isExiting && "pf-context-menu__menu--exiting"),
109
+ style: {
110
+ position: "fixed",
111
+ left: coords?.left ?? point.x,
112
+ top: coords?.top ?? point.y,
113
+ visibility: coords ? "visible" : "hidden"
114
+ },
115
+ onKeyDown: onMenuKeyDown,
116
+ children: items.map((entry, index) => {
117
+ if (isSeparator(entry)) return /* @__PURE__ */ jsx("div", {
118
+ role: "separator",
119
+ className: "pf-context-menu__separator"
120
+ }, `sep-${index}`);
121
+ actionableIndex += 1;
122
+ const itemIndex = actionableIndex;
123
+ const isActive = itemIndex === activeIndex;
124
+ return /* @__PURE__ */ jsxs("button", {
125
+ type: "button",
126
+ role: "menuitem",
127
+ disabled: entry.disabled,
128
+ className: cx("pf-context-menu__item", isActive && "pf-context-menu__item--active", entry.destructive && "pf-context-menu__item--destructive"),
129
+ onMouseEnter: () => {
130
+ if (!entry.disabled) setActiveIndex(itemIndex);
131
+ },
132
+ onClick: () => select(entry),
133
+ children: [
134
+ entry.icon ? /* @__PURE__ */ jsx("span", {
135
+ className: "pf-context-menu__item-icon",
136
+ "aria-hidden": true,
137
+ children: entry.icon
138
+ }) : null,
139
+ /* @__PURE__ */ jsx("span", {
140
+ className: "pf-context-menu__item-label",
141
+ children: entry.label
142
+ }),
143
+ entry.shortcut ? /* @__PURE__ */ jsx("kbd", {
144
+ className: "pf-context-menu__item-shortcut",
145
+ children: entry.shortcut
146
+ }) : null
147
+ ]
148
+ }, entry.id ?? `${entry.label}-${index}`);
149
+ })
150
+ }), document.body) : null]
151
+ });
152
+ });
153
+ ContextMenu.displayName = "ContextMenu";
154
+ //#endregion
155
+ export { ContextMenu };
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './CreditCard.css';/* empty css */
3
4
  import { forwardRef } from "react";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { Keys, composeDescribedBy } from "../../a11y/index.js";
2
3
  import { useAnchoredPosition } from "../../hooks/useAnchoredPosition.js";
3
4
  import { useDisclosure } from "../../hooks/useDisclosure.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { Keys, composeDescribedBy } from "../../a11y/index.js";
2
3
  import { useAnchoredPosition } from "../../hooks/useAnchoredPosition.js";
3
4
  import { useDisclosure } from "../../hooks/useDisclosure.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { Keys, isActivationKey } from "../../a11y/index.js";
2
3
  import { useAnchoredPosition } from "../../hooks/useAnchoredPosition.js";
3
4
  import { useDisclosure } from "../../hooks/useDisclosure.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import { Icon } from "../Icon/Icon2.js";
3
4
  import './EmptyState.css';/* empty css */
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import { Icon } from "../Icon/Icon2.js";
3
4
  import { FieldWrapper } from "../../utils/FieldWrapper.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './GaugeChart.css';/* empty css */
3
4
  import { forwardRef } from "react";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './HeaderNavigation.css';/* empty css */
3
4
  import { forwardRef } from "react";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './Heatmap.css';/* empty css */
3
4
  import { forwardRef } from "react";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './Icon.css';/* empty css */
3
4
  import { faBarChart, faCalendar, faCircleCheck, faCircleQuestion, faCircleXmark, faCopy, faCreditCard, faSquareCaretLeft, faSquareCaretRight, faSquareCheck, faStar, faUser } from "@fortawesome/free-regular-svg-icons";
@@ -126,6 +127,23 @@ var customIcons = {
126
127
  "aria-hidden": "true",
127
128
  children: [/* @__PURE__ */ jsx("path", { d: "M12 5v14" }), /* @__PURE__ */ jsx("path", { d: "M5 12h14" })]
128
129
  }),
130
+ clock: /* @__PURE__ */ jsxs("svg", {
131
+ width: "1em",
132
+ height: "1em",
133
+ viewBox: "0 0 24 24",
134
+ fill: "none",
135
+ stroke: "currentColor",
136
+ strokeWidth: "2",
137
+ strokeLinecap: "round",
138
+ strokeLinejoin: "round",
139
+ focusable: "false",
140
+ "aria-hidden": "true",
141
+ children: [/* @__PURE__ */ jsx("circle", {
142
+ cx: "12",
143
+ cy: "12",
144
+ r: "9"
145
+ }), /* @__PURE__ */ jsx("path", { d: "M12 7v5l3 2" })]
146
+ }),
129
147
  "magnifying-glass": /* @__PURE__ */ jsxs("svg", {
130
148
  width: "1em",
131
149
  height: "1em",
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useExitAnimation } from "../../hooks/useExitAnimation.js";
2
3
  import { cx } from "../../utils/cx.js";
3
4
  import { Icon } from "../Icon/Icon2.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import { FieldWrapper } from "../../utils/FieldWrapper.js";
3
4
  import './Input.css';/* empty css */
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cx } from "../../utils/cx.js";
2
3
  import './Kbd.css';/* empty css */
3
4
  import { forwardRef } from "react";