@pitchfork-ui/react 0.7.0 → 0.9.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 (117) 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/AvatarGroup.css +26 -0
  7. package/dist/components/AvatarGroup/AvatarGroup2.js +38 -0
  8. package/dist/components/Badge/Badge2.js +1 -0
  9. package/dist/components/BadgeGroup/BadgeGroup2.js +1 -0
  10. package/dist/components/Breadcrumbs/Breadcrumbs2.js +1 -0
  11. package/dist/components/Button/Button2.js +1 -0
  12. package/dist/components/ButtonGroup/ButtonGroup2.js +1 -0
  13. package/dist/components/Calendar/Calendar.css +0 -1
  14. package/dist/components/Calendar/Calendar2.js +1 -0
  15. package/dist/components/Card/Card2.js +1 -0
  16. package/dist/components/Carousel/Carousel2.js +1 -0
  17. package/dist/components/Checkbox/Checkbox2.js +1 -0
  18. package/dist/components/CodeSnippet/CodeSnippet2.js +1 -0
  19. package/dist/components/Combobox/Combobox.css +155 -0
  20. package/dist/components/Combobox/Combobox2.js +192 -0
  21. package/dist/components/CommandPalette/CommandPalette.css +225 -0
  22. package/dist/components/CommandPalette/CommandPalette2.js +196 -0
  23. package/dist/components/ContentDivider/ContentDivider2.js +1 -0
  24. package/dist/components/CreditCard/CreditCard2.js +1 -0
  25. package/dist/components/DatePicker/DatePicker2.js +1 -0
  26. package/dist/components/DateRangePicker/DateRangePicker.css +258 -0
  27. package/dist/components/DateRangePicker/DateRangePicker2.js +379 -0
  28. package/dist/components/Dropdown/Dropdown2.js +1 -0
  29. package/dist/components/EmptyState/EmptyState2.js +1 -0
  30. package/dist/components/FileUploader/FileUploader2.js +1 -0
  31. package/dist/components/GaugeChart/GaugeChart2.js +1 -0
  32. package/dist/components/HeaderNavigation/HeaderNavigation2.js +1 -0
  33. package/dist/components/Heatmap/Heatmap2.js +1 -0
  34. package/dist/components/Icon/Icon2.js +44 -0
  35. package/dist/components/InlineCTA/InlineCTA2.js +1 -0
  36. package/dist/components/Input/Input2.js +1 -0
  37. package/dist/components/Kbd/Kbd.css +25 -0
  38. package/dist/components/Kbd/Kbd2.js +18 -0
  39. package/dist/components/LineBarCharts/LineBarChart2.js +1 -0
  40. package/dist/components/LoadingIndicators/LoadingIndicators2.js +1 -0
  41. package/dist/components/Metrics/Metrics2.js +1 -0
  42. package/dist/components/Modal/Modal.css +6 -3
  43. package/dist/components/Modal/Modal2.js +1 -0
  44. package/dist/components/MultiSelect/MultiSelect2.js +1 -0
  45. package/dist/components/Notification/Notification2.js +1 -0
  46. package/dist/components/NumberInput/NumberInput.css +98 -0
  47. package/dist/components/NumberInput/NumberInput2.js +166 -0
  48. package/dist/components/PageHeader/PageHeader2.js +1 -0
  49. package/dist/components/Pagination/Pagination2.js +1 -0
  50. package/dist/components/PieChart/PieChart2.js +1 -0
  51. package/dist/components/Popover/Popover.css +46 -0
  52. package/dist/components/Popover/Popover2.js +77 -0
  53. package/dist/components/ProgressIndicators/ProgressIndicators2.js +1 -0
  54. package/dist/components/ProgressSteps/ProgressSteps2.js +1 -0
  55. package/dist/components/RadarChart/RadarChart2.js +1 -0
  56. package/dist/components/RadioButton/RadioButton2.js +1 -0
  57. package/dist/components/RadioGroup/RadioGroup2.js +1 -0
  58. package/dist/components/Rating/Rating2.js +1 -0
  59. package/dist/components/RichTextEditor/RichTextEditor2.js +1 -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/Textarea/Textarea2.js +1 -0
  72. package/dist/components/Toast/Toast.js +130 -0
  73. package/dist/components/Tooltip/Tooltip2.js +1 -0
  74. package/dist/components/TreeView/TreeView2.js +1 -0
  75. package/dist/components/UtilityButton/UtilityButton2.js +1 -0
  76. package/dist/components/VideoPlayer/VideoPlayer2.js +1 -0
  77. package/dist/hooks/useAnchoredPosition.js +1 -0
  78. package/dist/hooks/useComposedRefs.js +1 -0
  79. package/dist/hooks/useControllableState.js +1 -0
  80. package/dist/hooks/useDisclosure.js +1 -0
  81. package/dist/hooks/useExitAnimation.js +1 -0
  82. package/dist/hooks/useFocusTrap.js +1 -0
  83. package/dist/hooks/useListNavigation.js +1 -0
  84. package/dist/hooks/useOutsideInteraction.js +1 -0
  85. package/dist/hooks/usePresence.js +1 -0
  86. package/dist/index.cjs +1191 -24
  87. package/dist/index.js +10 -1
  88. package/dist/src/components/AvatarGroup/AvatarGroup.d.ts +14 -0
  89. package/dist/src/components/AvatarGroup/AvatarGroup.test.d.ts +1 -0
  90. package/dist/src/components/AvatarGroup/index.d.ts +1 -0
  91. package/dist/src/components/Combobox/Combobox.d.ts +20 -0
  92. package/dist/src/components/Combobox/Combobox.test.d.ts +1 -0
  93. package/dist/src/components/Combobox/index.d.ts +1 -0
  94. package/dist/src/components/CommandPalette/CommandPalette.d.ts +18 -0
  95. package/dist/src/components/CommandPalette/CommandPalette.test.d.ts +1 -0
  96. package/dist/src/components/CommandPalette/index.d.ts +1 -0
  97. package/dist/src/components/DateRangePicker/DateRangePicker.d.ts +21 -0
  98. package/dist/src/components/DateRangePicker/DateRangePicker.test.d.ts +1 -0
  99. package/dist/src/components/DateRangePicker/index.d.ts +1 -0
  100. package/dist/src/components/Kbd/Kbd.d.ts +9 -0
  101. package/dist/src/components/Kbd/Kbd.test.d.ts +1 -0
  102. package/dist/src/components/Kbd/index.d.ts +1 -0
  103. package/dist/src/components/NumberInput/NumberInput.d.ts +19 -0
  104. package/dist/src/components/NumberInput/NumberInput.test.d.ts +1 -0
  105. package/dist/src/components/NumberInput/index.d.ts +1 -0
  106. package/dist/src/components/Popover/Popover.d.ts +21 -0
  107. package/dist/src/components/Popover/Popover.test.d.ts +1 -0
  108. package/dist/src/components/Popover/index.d.ts +1 -0
  109. package/dist/src/components/Toast/Toast.d.ts +35 -0
  110. package/dist/src/components/Toast/Toast.test.d.ts +1 -0
  111. package/dist/src/components/Toast/index.d.ts +1 -0
  112. package/dist/src/index.d.ts +8 -0
  113. package/dist/styles/theme.css +68 -0
  114. package/dist/styles.css +983 -80
  115. package/dist/utils/FieldWrapper.js +1 -0
  116. package/dist/utils/cx.js +1 -0
  117. package/package.json +29 -3
@@ -0,0 +1,225 @@
1
+ /* ── Backdrop ─────────────────────────────────────────────────────────────── */
2
+
3
+ .pf-command__backdrop {
4
+ animation: pf-command-backdrop-in var(--pf-transition-fast);
5
+ background: var(--pf-overlay-backdrop);
6
+ inset: 0;
7
+ position: fixed;
8
+ z-index: 1100;
9
+ }
10
+
11
+ .pf-command__backdrop--exiting {
12
+ animation: pf-command-backdrop-out var(--pf-transition-fast) forwards;
13
+ }
14
+
15
+ @keyframes pf-command-backdrop-in {
16
+ from {
17
+ opacity: 0;
18
+ }
19
+ to {
20
+ opacity: 1;
21
+ }
22
+ }
23
+
24
+ @keyframes pf-command-backdrop-out {
25
+ from {
26
+ opacity: 1;
27
+ }
28
+ to {
29
+ opacity: 0;
30
+ }
31
+ }
32
+
33
+ /* ── Dialog ───────────────────────────────────────────────────────────────── */
34
+
35
+ .pf-command {
36
+ animation: pf-command-in var(--pf-transition-fast) var(--easing-decelerate);
37
+ background: var(--pf-command-bg);
38
+ border: 1px solid var(--pf-command-border);
39
+ border-radius: var(--radius-lg);
40
+ box-shadow: var(--pf-elevation-overlay-shadow);
41
+ display: flex;
42
+ flex-direction: column;
43
+ left: 50%;
44
+ max-height: min(560px, 80vh);
45
+ max-width: 560px;
46
+ overflow: hidden;
47
+ position: fixed;
48
+ top: 12%;
49
+ transform: translateX(-50%);
50
+ width: calc(100vw - var(--space-8));
51
+ z-index: 1101;
52
+ }
53
+
54
+ .pf-command--exiting {
55
+ animation: pf-command-out var(--pf-transition-fast) var(--easing-accelerate) forwards;
56
+ }
57
+
58
+ @keyframes pf-command-in {
59
+ from {
60
+ opacity: 0;
61
+ transform: translateX(-50%) translateY(-8px) scale(0.97);
62
+ }
63
+ to {
64
+ opacity: 1;
65
+ transform: translateX(-50%) translateY(0) scale(1);
66
+ }
67
+ }
68
+
69
+ @keyframes pf-command-out {
70
+ from {
71
+ opacity: 1;
72
+ transform: translateX(-50%) translateY(0) scale(1);
73
+ }
74
+ to {
75
+ opacity: 0;
76
+ transform: translateX(-50%) translateY(-8px) scale(0.97);
77
+ }
78
+ }
79
+
80
+ /* ── Search bar ───────────────────────────────────────────────────────────── */
81
+
82
+ .pf-command__search {
83
+ align-items: center;
84
+ border-block-end: 1px solid var(--pf-command-border);
85
+ display: flex;
86
+ flex-shrink: 0;
87
+ gap: var(--space-2);
88
+ padding: var(--space-3) var(--space-4);
89
+ }
90
+
91
+ .pf-command__search-icon {
92
+ color: var(--pf-command-text-muted);
93
+ flex-shrink: 0;
94
+ font-size: 1.1rem;
95
+ }
96
+
97
+ .pf-command__input {
98
+ background: transparent;
99
+ border: none;
100
+ color: var(--pf-command-text);
101
+ flex: 1;
102
+ font-size: var(--font-size-md);
103
+ min-width: 0;
104
+ outline: none;
105
+ }
106
+
107
+ .pf-command__input::placeholder {
108
+ color: var(--pf-command-text-muted);
109
+ }
110
+
111
+ .pf-command__esc-hint {
112
+ background: var(--pf-command-shortcut-bg);
113
+ border: 1px solid var(--pf-command-border);
114
+ border-bottom-width: 2px;
115
+ border-radius: var(--radius-sm);
116
+ color: var(--pf-command-text-muted);
117
+ flex-shrink: 0;
118
+ font-family: var(--font-family-mono);
119
+ font-size: var(--font-size-xs);
120
+ padding: 1px 6px;
121
+ }
122
+
123
+ /* ── Results list ─────────────────────────────────────────────────────────── */
124
+
125
+ .pf-command__list {
126
+ overflow-y: auto;
127
+ padding: var(--space-2);
128
+ }
129
+
130
+ .pf-command__empty {
131
+ color: var(--pf-command-text-muted);
132
+ font-size: var(--font-size-sm);
133
+ margin: 0;
134
+ padding: var(--space-6) var(--space-4);
135
+ text-align: center;
136
+ }
137
+
138
+ .pf-command__group-label {
139
+ color: var(--pf-command-text-muted);
140
+ font-size: var(--font-size-xs);
141
+ font-weight: var(--font-weight-semibold);
142
+ letter-spacing: 0.04em;
143
+ margin: 0;
144
+ padding: var(--space-2) var(--space-2) var(--space-1);
145
+ text-transform: uppercase;
146
+ }
147
+
148
+ /* ── Items ────────────────────────────────────────────────────────────────── */
149
+
150
+ .pf-command__item {
151
+ align-items: center;
152
+ border-radius: var(--radius-md);
153
+ cursor: pointer;
154
+ display: flex;
155
+ gap: var(--space-3);
156
+ padding: var(--space-2) var(--space-3);
157
+ transition: background 0.1s;
158
+ }
159
+
160
+ .pf-command__item--active {
161
+ background: var(--pf-command-item-active-bg);
162
+ }
163
+
164
+ .pf-command__item--disabled {
165
+ cursor: not-allowed;
166
+ opacity: 0.45;
167
+ }
168
+
169
+ .pf-command__item-icon {
170
+ align-items: center;
171
+ color: var(--pf-command-text-muted);
172
+ display: inline-flex;
173
+ flex-shrink: 0;
174
+ font-size: 1rem;
175
+ height: 20px;
176
+ justify-content: center;
177
+ width: 20px;
178
+ }
179
+
180
+ .pf-command__item--active .pf-command__item-icon {
181
+ color: var(--pf-command-item-active-text);
182
+ }
183
+
184
+ .pf-command__item-content {
185
+ display: flex;
186
+ flex: 1;
187
+ flex-direction: column;
188
+ gap: 1px;
189
+ min-width: 0;
190
+ }
191
+
192
+ .pf-command__item-label {
193
+ color: var(--pf-command-text);
194
+ font-size: var(--font-size-sm);
195
+ font-weight: var(--font-weight-medium);
196
+ overflow: hidden;
197
+ text-overflow: ellipsis;
198
+ white-space: nowrap;
199
+ }
200
+
201
+ .pf-command__item--active .pf-command__item-label {
202
+ color: var(--pf-command-item-active-text);
203
+ }
204
+
205
+ .pf-command__item-description {
206
+ color: var(--pf-command-text-muted);
207
+ font-size: var(--font-size-xs);
208
+ overflow: hidden;
209
+ text-overflow: ellipsis;
210
+ white-space: nowrap;
211
+ }
212
+
213
+ .pf-command__item--active .pf-command__item-description {
214
+ color: var(--pf-command-item-active-text);
215
+ opacity: 0.85;
216
+ }
217
+
218
+ @media (prefers-reduced-motion: reduce) {
219
+ .pf-command__backdrop,
220
+ .pf-command__backdrop--exiting,
221
+ .pf-command,
222
+ .pf-command--exiting {
223
+ animation: none;
224
+ }
225
+ }
@@ -0,0 +1,196 @@
1
+ "use client";
2
+ import { Keys } from "../../a11y/index.js";
3
+ import { useFocusTrap } from "../../hooks/useFocusTrap.js";
4
+ import { useListNavigation } from "../../hooks/useListNavigation.js";
5
+ import { usePresence } from "../../hooks/usePresence.js";
6
+ import { cx } from "../../utils/cx.js";
7
+ import { Icon } from "../Icon/Icon2.js";
8
+ import './CommandPalette.css';/* empty css */
9
+ import { useEffect, useId, useMemo, useRef, useState } from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { createPortal } from "react-dom";
12
+ //#region src/components/CommandPalette/CommandPalette.tsx
13
+ function CommandPalette({ open, onOpenChange, items, placeholder = "Search commands…", emptyMessage = "No results found." }) {
14
+ const inputId = useId();
15
+ const listId = useId();
16
+ const [query, setQuery] = useState("");
17
+ const dialogRef = useRef(null);
18
+ const inputRef = useRef(null);
19
+ const { isMounted, isExiting } = usePresence(open, 180);
20
+ useEffect(() => {
21
+ if (!open) return;
22
+ const frame = requestAnimationFrame(() => {
23
+ setQuery("");
24
+ inputRef.current?.focus();
25
+ });
26
+ return () => cancelAnimationFrame(frame);
27
+ }, [open]);
28
+ useEffect(() => {
29
+ if (!isMounted || typeof document === "undefined") return;
30
+ const prev = document.body.style.overflow;
31
+ document.body.style.overflow = "hidden";
32
+ return () => {
33
+ document.body.style.overflow = prev;
34
+ };
35
+ }, [isMounted]);
36
+ useFocusTrap({
37
+ containerRef: dialogRef,
38
+ enabled: open,
39
+ onEscape: () => onOpenChange(false)
40
+ });
41
+ const filtered = useMemo(() => {
42
+ const q = query.trim().toLowerCase();
43
+ if (!q) return items;
44
+ return items.filter((item) => item.label.toLowerCase().includes(q) || item.description?.toLowerCase().includes(q) || item.group?.toLowerCase().includes(q));
45
+ }, [items, query]);
46
+ const { activeIndex, move, setActiveIndex } = useListNavigation({
47
+ items: filtered,
48
+ isDisabled: (item) => !!item.disabled
49
+ });
50
+ useEffect(() => {
51
+ setActiveIndex(0);
52
+ }, [query, setActiveIndex]);
53
+ const selectActive = () => {
54
+ const item = filtered[activeIndex];
55
+ if (item && !item.disabled) {
56
+ item.onSelect();
57
+ onOpenChange(false);
58
+ }
59
+ };
60
+ const onKeyDown = (e) => {
61
+ if (e.key === Keys.ArrowDown) {
62
+ e.preventDefault();
63
+ move("next");
64
+ } else if (e.key === Keys.ArrowUp) {
65
+ e.preventDefault();
66
+ move("previous");
67
+ } else if (e.key === Keys.Home) {
68
+ e.preventDefault();
69
+ move("first");
70
+ } else if (e.key === Keys.End) {
71
+ e.preventDefault();
72
+ move("last");
73
+ } else if (e.key === Keys.Enter) {
74
+ e.preventDefault();
75
+ selectActive();
76
+ }
77
+ };
78
+ const groupedItems = useMemo(() => {
79
+ const groups = [];
80
+ const seen = /* @__PURE__ */ new Map();
81
+ filtered.forEach((item, index) => {
82
+ const g = item.group;
83
+ if (!seen.has(g)) {
84
+ seen.set(g, groups.length);
85
+ groups.push({
86
+ group: g,
87
+ items: []
88
+ });
89
+ }
90
+ groups[seen.get(g)].items.push({
91
+ item,
92
+ index
93
+ });
94
+ });
95
+ return groups;
96
+ }, [filtered]);
97
+ const activeOptionId = filtered[activeIndex] ? `${listId}-option-${activeIndex}` : void 0;
98
+ if (!isMounted || typeof document === "undefined") return null;
99
+ return createPortal(/* @__PURE__ */ jsx("div", {
100
+ className: cx("pf-command__backdrop", isExiting && "pf-command__backdrop--exiting"),
101
+ onClick: () => onOpenChange(false),
102
+ children: /* @__PURE__ */ jsxs("div", {
103
+ ref: dialogRef,
104
+ className: cx("pf-command", isExiting && "pf-command--exiting"),
105
+ role: "dialog",
106
+ "aria-modal": "true",
107
+ "aria-label": "Command palette",
108
+ tabIndex: -1,
109
+ onClick: (e) => e.stopPropagation(),
110
+ onKeyDown,
111
+ children: [/* @__PURE__ */ jsxs("div", {
112
+ className: "pf-command__search",
113
+ children: [
114
+ /* @__PURE__ */ jsx(Icon, {
115
+ name: "magnifying-glass",
116
+ "aria-hidden": true,
117
+ className: "pf-command__search-icon"
118
+ }),
119
+ /* @__PURE__ */ jsx("input", {
120
+ ref: inputRef,
121
+ id: inputId,
122
+ type: "text",
123
+ className: "pf-command__input",
124
+ value: query,
125
+ placeholder,
126
+ autoComplete: "off",
127
+ spellCheck: false,
128
+ role: "combobox",
129
+ "aria-autocomplete": "list",
130
+ "aria-expanded": true,
131
+ "aria-controls": listId,
132
+ "aria-activedescendant": activeOptionId,
133
+ onChange: (e) => setQuery(e.target.value)
134
+ }),
135
+ /* @__PURE__ */ jsx("kbd", {
136
+ className: "pf-command__esc-hint",
137
+ "aria-hidden": true,
138
+ children: "esc"
139
+ })
140
+ ]
141
+ }), /* @__PURE__ */ jsx("div", {
142
+ id: listId,
143
+ role: "listbox",
144
+ "aria-label": "Commands",
145
+ className: "pf-command__list",
146
+ children: filtered.length === 0 ? /* @__PURE__ */ jsx("p", {
147
+ className: "pf-command__empty",
148
+ role: "presentation",
149
+ children: emptyMessage
150
+ }) : groupedItems.map(({ group, items: groupItems }) => /* @__PURE__ */ jsxs("div", {
151
+ role: "presentation",
152
+ children: [group ? /* @__PURE__ */ jsx("p", {
153
+ className: "pf-command__group-label",
154
+ role: "presentation",
155
+ children: group
156
+ }) : null, groupItems.map(({ item, index }) => {
157
+ const isActive = index === activeIndex;
158
+ return /* @__PURE__ */ jsxs("div", {
159
+ id: `${listId}-option-${index}`,
160
+ role: "option",
161
+ "aria-selected": isActive,
162
+ "aria-disabled": item.disabled ? true : void 0,
163
+ className: cx("pf-command__item", isActive && "pf-command__item--active", item.disabled && "pf-command__item--disabled"),
164
+ onMouseEnter: () => {
165
+ if (!item.disabled) setActiveIndex(index);
166
+ },
167
+ onMouseDown: (e) => e.preventDefault(),
168
+ onClick: () => {
169
+ if (!item.disabled) {
170
+ item.onSelect();
171
+ onOpenChange(false);
172
+ }
173
+ },
174
+ children: [item.icon ? /* @__PURE__ */ jsx("span", {
175
+ className: "pf-command__item-icon",
176
+ "aria-hidden": true,
177
+ children: item.icon
178
+ }) : null, /* @__PURE__ */ jsxs("span", {
179
+ className: "pf-command__item-content",
180
+ children: [/* @__PURE__ */ jsx("span", {
181
+ className: "pf-command__item-label",
182
+ children: item.label
183
+ }), item.description ? /* @__PURE__ */ jsx("span", {
184
+ className: "pf-command__item-description",
185
+ children: item.description
186
+ }) : null]
187
+ })]
188
+ }, item.id);
189
+ })]
190
+ }, group ?? "__ungrouped"))
191
+ })]
192
+ })
193
+ }), document.body);
194
+ }
195
+ //#endregion
196
+ export { CommandPalette };
@@ -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";
@@ -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";
@@ -0,0 +1,258 @@
1
+ .pf-daterange {
2
+ position: relative;
3
+ }
4
+
5
+ .pf-daterange__control-row {
6
+ align-items: center;
7
+ display: flex;
8
+ gap: var(--space-1);
9
+ }
10
+
11
+ /* ── Trigger button ───────────────────────────────────────────────────────── */
12
+
13
+ .pf-daterange__trigger {
14
+ align-items: center;
15
+ background: var(--pf-daterange-bg);
16
+ border: 1px solid var(--pf-daterange-border);
17
+ border-radius: var(--radius-md);
18
+ color: var(--pf-daterange-text);
19
+ cursor: pointer;
20
+ display: inline-flex;
21
+ flex: 1;
22
+ font-size: var(--font-size-sm);
23
+ gap: var(--space-2);
24
+ justify-content: space-between;
25
+ min-height: 40px;
26
+ min-width: 0;
27
+ padding: 0 var(--space-3);
28
+ text-align: start;
29
+ transition: border 0.2s;
30
+ }
31
+
32
+ .pf-daterange__trigger:hover:not(:disabled) {
33
+ border-color: var(--pf-daterange-border-strong);
34
+ }
35
+
36
+ .pf-daterange__trigger:focus-visible {
37
+ box-shadow: var(--pf-daterange-focus-ring, var(--pf-focus-ring));
38
+ outline: none;
39
+ }
40
+
41
+ .pf-daterange__trigger:disabled {
42
+ background: var(--pf-daterange-bg-subtle);
43
+ color: var(--pf-daterange-text-muted);
44
+ cursor: not-allowed;
45
+ }
46
+
47
+ .pf-daterange__trigger--invalid {
48
+ border-color: var(--pf-daterange-invalid-border);
49
+ }
50
+
51
+ .pf-daterange__value {
52
+ align-items: center;
53
+ display: flex;
54
+ flex-wrap: wrap;
55
+ gap: var(--space-1);
56
+ min-width: 0;
57
+ overflow: hidden;
58
+ }
59
+
60
+ .pf-daterange__value--placeholder {
61
+ color: var(--pf-daterange-text-muted);
62
+ }
63
+
64
+ .pf-daterange__separator {
65
+ color: var(--pf-daterange-text-muted);
66
+ }
67
+
68
+ /* ── Popover ──────────────────────────────────────────────────────────────── */
69
+
70
+ .pf-daterange__popover {
71
+ background: var(--pf-daterange-menu-bg);
72
+ border: 1px solid var(--pf-daterange-menu-border);
73
+ border-radius: var(--radius-lg);
74
+ box-shadow: var(--pf-elevation-popover-shadow);
75
+ color: var(--pf-calendar-text);
76
+ padding: var(--space-4);
77
+ position: fixed;
78
+ z-index: 999;
79
+ }
80
+
81
+ .pf-daterange__hint {
82
+ color: var(--pf-daterange-text-muted);
83
+ font-size: var(--font-size-xs);
84
+ margin: 0 0 var(--space-3);
85
+ }
86
+
87
+ /* ── Two-month layout ─────────────────────────────────────────────────────── */
88
+
89
+ .pf-daterange__months {
90
+ display: grid;
91
+ gap: var(--space-4);
92
+ grid-template-columns: 1fr;
93
+ }
94
+
95
+ @media (min-width: 640px) {
96
+ .pf-daterange__months {
97
+ grid-template-columns: 1fr 1fr;
98
+ }
99
+ }
100
+
101
+ /* ── Individual calendar panel ────────────────────────────────────────────── */
102
+
103
+ .pf-daterange__calendar {
104
+ background: var(--pf-calendar-bg);
105
+ color: var(--pf-calendar-text);
106
+ display: grid;
107
+ gap: var(--space-2);
108
+ min-width: 0;
109
+ }
110
+
111
+ .pf-daterange__cal-header {
112
+ align-items: center;
113
+ display: grid;
114
+ grid-template-columns: 28px 1fr 28px;
115
+ }
116
+
117
+ .pf-daterange__cal-title {
118
+ font-size: var(--font-size-sm);
119
+ font-weight: var(--font-weight-semibold);
120
+ text-align: center;
121
+ }
122
+
123
+ /* Nav buttons — desktop right-panel hides its own nav (left panel drives both) */
124
+ .pf-daterange__nav {
125
+ align-items: center;
126
+ background: transparent;
127
+ border: 0;
128
+ border-radius: var(--radius-sm);
129
+ color: var(--pf-calendar-text-muted);
130
+ cursor: pointer;
131
+ display: inline-flex;
132
+ font-size: var(--font-size-sm);
133
+ height: 28px;
134
+ justify-content: center;
135
+ padding: 0;
136
+ width: 28px;
137
+ }
138
+
139
+ .pf-daterange__nav:hover:not(:disabled) {
140
+ background: var(--pf-calendar-bg-subtle);
141
+ color: var(--pf-calendar-text);
142
+ }
143
+
144
+ .pf-daterange__nav:focus-visible {
145
+ box-shadow: var(--pf-calendar-focus-ring, var(--pf-focus-ring));
146
+ outline: none;
147
+ }
148
+
149
+ .pf-daterange__nav svg {
150
+ display: block;
151
+ height: 14px;
152
+ width: 14px;
153
+ }
154
+
155
+ @media (min-width: 640px) {
156
+ .pf-daterange__cal-header--hide-nav-desktop .pf-daterange__nav {
157
+ pointer-events: none;
158
+ visibility: hidden;
159
+ }
160
+ }
161
+
162
+ /* ── Grid & weekday labels ────────────────────────────────────────────────── */
163
+
164
+ .pf-daterange__grid {
165
+ display: grid;
166
+ gap: var(--space-1);
167
+ grid-template-columns: repeat(7, minmax(0, 1fr));
168
+ }
169
+
170
+ .pf-daterange__weekday {
171
+ color: var(--pf-calendar-text-muted);
172
+ font-size: var(--font-size-xs);
173
+ font-weight: var(--font-weight-medium);
174
+ text-align: center;
175
+ }
176
+
177
+ /* ── Day cells ────────────────────────────────────────────────────────────── */
178
+
179
+ .pf-daterange__day,
180
+ .pf-daterange__day-empty {
181
+ align-items: center;
182
+ aspect-ratio: 1 / 1;
183
+ border-radius: var(--radius-sm);
184
+ display: inline-flex;
185
+ font-size: var(--font-size-xs);
186
+ justify-content: center;
187
+ }
188
+
189
+ .pf-daterange__day {
190
+ background: transparent;
191
+ border: 0;
192
+ color: var(--pf-calendar-text);
193
+ cursor: pointer;
194
+ }
195
+
196
+ .pf-daterange__day:hover:not(:disabled):not(.pf-daterange__day--selected):not(
197
+ .pf-daterange__day--in-range
198
+ ) {
199
+ background: var(--pf-calendar-bg-subtle);
200
+ }
201
+
202
+ .pf-daterange__day--outside {
203
+ color: var(--pf-calendar-text-muted);
204
+ }
205
+
206
+ .pf-daterange__day--today {
207
+ background: var(--pf-calendar-today-bg);
208
+ border: 1.5px solid var(--pf-calendar-today-border);
209
+ }
210
+
211
+ .pf-daterange__day--selected {
212
+ background: var(--pf-calendar-selected-bg);
213
+ color: var(--pf-calendar-selected-text);
214
+ font-weight: var(--font-weight-semibold);
215
+ }
216
+
217
+ .pf-daterange__day--selected:hover:not(:disabled) {
218
+ background: var(--pf-calendar-selected-bg-hover);
219
+ color: var(--pf-calendar-selected-text);
220
+ }
221
+
222
+ .pf-daterange__day:disabled {
223
+ color: var(--pf-calendar-text-muted);
224
+ cursor: not-allowed;
225
+ opacity: 0.45;
226
+ }
227
+
228
+ /* ── Range highlight ──────────────────────────────────────────────────────── */
229
+
230
+ .pf-daterange__day--in-range {
231
+ background: var(--pf-daterange-range-bg);
232
+ border-radius: 0;
233
+ color: var(--pf-daterange-range-text);
234
+ }
235
+
236
+ /* In-range overrides today indicator bg (today border still shows through) */
237
+ .pf-daterange__day--today.pf-daterange__day--in-range {
238
+ background: var(--pf-daterange-range-bg);
239
+ color: var(--pf-daterange-range-text);
240
+ }
241
+
242
+ /* Selected caps already have the right bg/color from --selected;
243
+ just shape the radius to connect flush with the range band. */
244
+ .pf-daterange__day--range-start:not(.pf-daterange__day--range-end) {
245
+ border-end-end-radius: 0;
246
+ border-start-end-radius: 0;
247
+ }
248
+
249
+ .pf-daterange__day--range-end:not(.pf-daterange__day--range-start) {
250
+ border-end-start-radius: 0;
251
+ border-start-start-radius: 0;
252
+ }
253
+
254
+ @media (prefers-reduced-motion: reduce) {
255
+ .pf-daterange__trigger {
256
+ transition: none;
257
+ }
258
+ }