@pitchfork-ui/react 0.6.0 → 0.8.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 (49) hide show
  1. package/dist/components/AvatarGroup/AvatarGroup.css +26 -0
  2. package/dist/components/AvatarGroup/AvatarGroup2.js +37 -0
  3. package/dist/components/Calendar/Calendar.css +0 -1
  4. package/dist/components/Combobox/Combobox.css +155 -0
  5. package/dist/components/Combobox/Combobox2.js +191 -0
  6. package/dist/components/CommandPalette/CommandPalette.css +225 -0
  7. package/dist/components/CommandPalette/CommandPalette2.js +195 -0
  8. package/dist/components/DateRangePicker/DateRangePicker.css +258 -0
  9. package/dist/components/DateRangePicker/DateRangePicker2.js +378 -0
  10. package/dist/components/Heatmap/Heatmap.css +4 -0
  11. package/dist/components/Icon/Icon2.js +43 -0
  12. package/dist/components/Kbd/Kbd.css +25 -0
  13. package/dist/components/Kbd/Kbd2.js +17 -0
  14. package/dist/components/NumberInput/NumberInput.css +98 -0
  15. package/dist/components/NumberInput/NumberInput2.js +165 -0
  16. package/dist/components/Pagination/Pagination.css +5 -2
  17. package/dist/components/Popover/Popover.css +46 -0
  18. package/dist/components/Popover/Popover2.js +76 -0
  19. package/dist/components/Toast/Toast.js +129 -0
  20. package/dist/index.cjs +1190 -24
  21. package/dist/index.js +9 -1
  22. package/dist/src/components/AvatarGroup/AvatarGroup.d.ts +14 -0
  23. package/dist/src/components/AvatarGroup/AvatarGroup.test.d.ts +1 -0
  24. package/dist/src/components/AvatarGroup/index.d.ts +1 -0
  25. package/dist/src/components/Combobox/Combobox.d.ts +20 -0
  26. package/dist/src/components/Combobox/Combobox.test.d.ts +1 -0
  27. package/dist/src/components/Combobox/index.d.ts +1 -0
  28. package/dist/src/components/CommandPalette/CommandPalette.d.ts +18 -0
  29. package/dist/src/components/CommandPalette/CommandPalette.test.d.ts +1 -0
  30. package/dist/src/components/CommandPalette/index.d.ts +1 -0
  31. package/dist/src/components/DateRangePicker/DateRangePicker.d.ts +21 -0
  32. package/dist/src/components/DateRangePicker/DateRangePicker.test.d.ts +1 -0
  33. package/dist/src/components/DateRangePicker/index.d.ts +1 -0
  34. package/dist/src/components/Kbd/Kbd.d.ts +9 -0
  35. package/dist/src/components/Kbd/Kbd.test.d.ts +1 -0
  36. package/dist/src/components/Kbd/index.d.ts +1 -0
  37. package/dist/src/components/NumberInput/NumberInput.d.ts +19 -0
  38. package/dist/src/components/NumberInput/NumberInput.test.d.ts +1 -0
  39. package/dist/src/components/NumberInput/index.d.ts +1 -0
  40. package/dist/src/components/Popover/Popover.d.ts +21 -0
  41. package/dist/src/components/Popover/Popover.test.d.ts +1 -0
  42. package/dist/src/components/Popover/index.d.ts +1 -0
  43. package/dist/src/components/Toast/Toast.d.ts +35 -0
  44. package/dist/src/components/Toast/Toast.test.d.ts +1 -0
  45. package/dist/src/components/Toast/index.d.ts +1 -0
  46. package/dist/src/index.d.ts +8 -0
  47. package/dist/styles/theme.css +68 -0
  48. package/dist/styles.css +986 -79
  49. package/package.json +1 -1
@@ -0,0 +1,378 @@
1
+ import { Keys, composeDescribedBy } from "../../a11y/index.js";
2
+ import { useAnchoredPosition } from "../../hooks/useAnchoredPosition.js";
3
+ import { useDisclosure } from "../../hooks/useDisclosure.js";
4
+ import { useOutsideInteraction } from "../../hooks/useOutsideInteraction.js";
5
+ import { cx } from "../../utils/cx.js";
6
+ import { Icon } from "../Icon/Icon2.js";
7
+ import { FieldWrapper } from "../../utils/FieldWrapper.js";
8
+ import './DateRangePicker.css';/* empty css */
9
+ import { forwardRef, useCallback, useId, useMemo, useRef, useState } from "react";
10
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ import { createPortal } from "react-dom";
12
+ //#region src/components/DateRangePicker/DateRangePicker.tsx
13
+ var WEEKDAY_LABELS = [
14
+ "Su",
15
+ "Mo",
16
+ "Tu",
17
+ "We",
18
+ "Th",
19
+ "Fr",
20
+ "Sa"
21
+ ];
22
+ var toMidday = (d) => {
23
+ const n = new Date(d);
24
+ n.setHours(12, 0, 0, 0);
25
+ return n;
26
+ };
27
+ var isSameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
28
+ var startOfMonth = (d) => new Date(d.getFullYear(), d.getMonth(), 1, 12);
29
+ var addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1, 12);
30
+ var buildDays = (monthDate) => {
31
+ const ms = startOfMonth(monthDate);
32
+ const firstDay = ms.getDay();
33
+ return Array.from({ length: 42 }, (_, i) => {
34
+ const date = new Date(ms.getFullYear(), ms.getMonth(), ms.getDate() - firstDay + i, 12);
35
+ return {
36
+ date,
37
+ inCurrentMonth: date.getMonth() === monthDate.getMonth()
38
+ };
39
+ });
40
+ };
41
+ var formatDate = (d) => {
42
+ if (!d) return "";
43
+ return new Intl.DateTimeFormat("en-US", {
44
+ month: "short",
45
+ day: "numeric",
46
+ year: "numeric"
47
+ }).format(d);
48
+ };
49
+ function RangeCalendar({ monthDate, rangeStart, rangeEnd, hoverDate, onDayClick, onDayHover, disabledDates, showOutsideDays = true, isPrevDisabled, isNextDisabled, onPrev, onNext, hideNavDesktop = false }) {
50
+ const days = useMemo(() => buildDays(monthDate), [monthDate]);
51
+ const today = useMemo(() => toMidday(/* @__PURE__ */ new Date()), []);
52
+ const monthLabel = new Intl.DateTimeFormat("en-US", {
53
+ month: "long",
54
+ year: "numeric"
55
+ }).format(monthDate);
56
+ const effectiveEnd = rangeEnd ?? hoverDate;
57
+ const isInRange = useCallback((date) => {
58
+ if (!rangeStart || !effectiveEnd) return false;
59
+ return date > (rangeStart <= effectiveEnd ? rangeStart : effectiveEnd) && date < (rangeStart <= effectiveEnd ? effectiveEnd : rangeStart);
60
+ }, [rangeStart, effectiveEnd]);
61
+ const isRangeStart = (date) => !!rangeStart && isSameDay(date, rangeStart);
62
+ const isRangeEnd = (date) => {
63
+ const end = rangeEnd ?? (hoverDate && rangeStart ? hoverDate : null);
64
+ return !!end && isSameDay(date, end);
65
+ };
66
+ return /* @__PURE__ */ jsxs("div", {
67
+ className: "pf-daterange__calendar",
68
+ children: [/* @__PURE__ */ jsxs("div", {
69
+ className: cx("pf-daterange__cal-header", hideNavDesktop && "pf-daterange__cal-header--hide-nav-desktop"),
70
+ children: [
71
+ /* @__PURE__ */ jsx("button", {
72
+ type: "button",
73
+ className: "pf-daterange__nav",
74
+ "aria-label": "Previous month",
75
+ disabled: isPrevDisabled,
76
+ onClick: onPrev,
77
+ children: /* @__PURE__ */ jsx(Icon, {
78
+ name: "chevron-left",
79
+ "aria-hidden": true
80
+ })
81
+ }),
82
+ /* @__PURE__ */ jsx("span", {
83
+ className: "pf-daterange__cal-title",
84
+ children: monthLabel
85
+ }),
86
+ /* @__PURE__ */ jsx("button", {
87
+ type: "button",
88
+ className: "pf-daterange__nav",
89
+ "aria-label": "Next month",
90
+ disabled: isNextDisabled,
91
+ onClick: onNext,
92
+ children: /* @__PURE__ */ jsx(Icon, {
93
+ name: "chevron-right",
94
+ "aria-hidden": true
95
+ })
96
+ })
97
+ ]
98
+ }), /* @__PURE__ */ jsxs("div", {
99
+ className: "pf-daterange__grid",
100
+ role: "grid",
101
+ "aria-label": monthLabel,
102
+ children: [/* @__PURE__ */ jsx("div", {
103
+ role: "row",
104
+ style: { display: "contents" },
105
+ "aria-hidden": true,
106
+ children: WEEKDAY_LABELS.map((d) => /* @__PURE__ */ jsx("span", {
107
+ role: "columnheader",
108
+ className: "pf-daterange__weekday",
109
+ children: d
110
+ }, d))
111
+ }), Array.from({ length: 6 }, (_, week) => /* @__PURE__ */ jsx("div", {
112
+ role: "row",
113
+ style: { display: "contents" },
114
+ children: days.slice(week * 7, (week + 1) * 7).map(({ date, inCurrentMonth }) => {
115
+ const isToday = isSameDay(today, date);
116
+ const isStart = isRangeStart(date);
117
+ const isEnd = isRangeEnd(date);
118
+ const inRng = isInRange(date);
119
+ const isDisabled = Boolean(disabledDates?.(date));
120
+ if (!showOutsideDays && !inCurrentMonth) return /* @__PURE__ */ jsx("span", {
121
+ className: "pf-daterange__day-empty",
122
+ "aria-hidden": true
123
+ }, date.toISOString());
124
+ return /* @__PURE__ */ jsx("button", {
125
+ type: "button",
126
+ role: "gridcell",
127
+ className: cx("pf-daterange__day", !inCurrentMonth && "pf-daterange__day--outside", isToday && "pf-daterange__day--today", (isStart || isEnd) && "pf-daterange__day--selected", isStart && "pf-daterange__day--range-start", isEnd && "pf-daterange__day--range-end", inRng && "pf-daterange__day--in-range"),
128
+ "aria-label": new Intl.DateTimeFormat("en-US", {
129
+ month: "long",
130
+ day: "numeric",
131
+ year: "numeric"
132
+ }).format(date),
133
+ "aria-selected": isStart || isEnd || inRng,
134
+ "aria-current": isToday ? "date" : void 0,
135
+ disabled: isDisabled,
136
+ onClick: () => onDayClick(date),
137
+ onMouseEnter: () => onDayHover(date),
138
+ onMouseLeave: () => onDayHover(null),
139
+ children: date.getDate()
140
+ }, date.toISOString());
141
+ })
142
+ }, week))]
143
+ })]
144
+ });
145
+ }
146
+ var DateRangePicker = forwardRef(function DateRangePicker({ id, className, value, defaultValue, onValueChange, label, description, error, startPlaceholder = "Start date", endPlaceholder = "End date", required, disabled, disabledDates, showOutsideDays = true, startYear, endYear, "aria-describedby": ariaDescribedBy, ...props }, ref) {
147
+ const generatedId = useId();
148
+ const pickerId = id ?? generatedId;
149
+ const descriptionId = description ? `${pickerId}-description` : void 0;
150
+ const errorId = error ? `${pickerId}-error` : void 0;
151
+ const describedBy = composeDescribedBy(ariaDescribedBy, descriptionId, errorId);
152
+ const isControlled = value !== void 0;
153
+ const [internalRange, setInternalRange] = useState(defaultValue ?? {
154
+ start: null,
155
+ end: null
156
+ });
157
+ const range = isControlled ? value : internalRange;
158
+ const setRange = (next) => {
159
+ if (!isControlled) setInternalRange(next);
160
+ onValueChange?.(next);
161
+ };
162
+ const [selecting, setSelecting] = useState(null);
163
+ const [hoverDate, setHoverDate] = useState(null);
164
+ const yearRange = useMemo(() => {
165
+ const fallbackStart = (/* @__PURE__ */ new Date()).getFullYear() - 50;
166
+ const fallbackEnd = (/* @__PURE__ */ new Date()).getFullYear() + 50;
167
+ return {
168
+ start: startYear ?? fallbackStart,
169
+ end: endYear ?? fallbackEnd
170
+ };
171
+ }, [startYear, endYear]);
172
+ const clampMonth = (d) => {
173
+ const y = d.getFullYear();
174
+ if (y < yearRange.start) return new Date(yearRange.start, 0, 1, 12);
175
+ if (y > yearRange.end) return new Date(yearRange.end, 11, 1, 12);
176
+ return d;
177
+ };
178
+ const [leftMonth, setLeftMonth] = useState(() => clampMonth(startOfMonth(range.start ?? /* @__PURE__ */ new Date())));
179
+ const rightMonth = addMonths(leftMonth, 1);
180
+ const disclosure = useDisclosure({ disabled });
181
+ const { isOpen } = disclosure;
182
+ const rootRef = useRef(null);
183
+ const triggerRef = useRef(null);
184
+ const popoverRef = useRef(null);
185
+ const popoverStyle = useAnchoredPosition({
186
+ anchorRef: rootRef,
187
+ floatingRef: popoverRef,
188
+ enabled: isOpen,
189
+ flip: true,
190
+ matchAnchorWidth: false
191
+ });
192
+ useOutsideInteraction({
193
+ refs: [rootRef, popoverRef],
194
+ enabled: isOpen,
195
+ eventName: "mousedown",
196
+ onInteractOutside: () => {
197
+ setSelecting(null);
198
+ setHoverDate(null);
199
+ disclosure.close();
200
+ }
201
+ });
202
+ const handleDayClick = (date) => {
203
+ if (selecting === null) {
204
+ setRange({
205
+ start: toMidday(date),
206
+ end: null
207
+ });
208
+ setSelecting("start");
209
+ } else {
210
+ const start = range.start;
211
+ const end = toMidday(date);
212
+ if (isSameDay(start, end)) setRange({
213
+ start: toMidday(date),
214
+ end: null
215
+ });
216
+ else if (end < start) setRange({
217
+ start: end,
218
+ end: start
219
+ });
220
+ else setRange({
221
+ start,
222
+ end
223
+ });
224
+ setSelecting(null);
225
+ setHoverDate(null);
226
+ disclosure.close();
227
+ }
228
+ };
229
+ const clearRange = () => {
230
+ setRange({
231
+ start: null,
232
+ end: null
233
+ });
234
+ setSelecting(null);
235
+ setHoverDate(null);
236
+ };
237
+ const isPrevDisabled = leftMonth.getFullYear() === yearRange.start && leftMonth.getMonth() === 0;
238
+ const isNextDisabled = rightMonth.getFullYear() === yearRange.end && rightMonth.getMonth() === 11;
239
+ const hasValue = range.start !== null || range.end !== null;
240
+ const displayStart = formatDate(range.start);
241
+ const displayEnd = formatDate(range.end);
242
+ return /* @__PURE__ */ jsx(FieldWrapper, {
243
+ labelFor: `${pickerId}-trigger`,
244
+ label,
245
+ description,
246
+ descriptionId,
247
+ error,
248
+ errorId,
249
+ required,
250
+ children: /* @__PURE__ */ jsxs("div", {
251
+ ref,
252
+ ...props,
253
+ id: pickerId,
254
+ className: cx("pf-daterange", className),
255
+ "aria-describedby": describedBy,
256
+ children: [/* @__PURE__ */ jsxs("div", {
257
+ className: "pf-daterange__control-row",
258
+ ref: rootRef,
259
+ children: [/* @__PURE__ */ jsxs("button", {
260
+ ref: triggerRef,
261
+ id: `${pickerId}-trigger`,
262
+ type: "button",
263
+ className: cx("pf-daterange__trigger", error && "pf-daterange__trigger--invalid"),
264
+ disabled,
265
+ "aria-invalid": error ? true : void 0,
266
+ "aria-haspopup": "dialog",
267
+ "aria-expanded": isOpen,
268
+ "aria-required": required || void 0,
269
+ onClick: () => {
270
+ if (!isOpen) setSelecting(null);
271
+ disclosure.toggle();
272
+ },
273
+ onKeyDown: (e) => {
274
+ if (e.key === Keys.Escape) disclosure.close();
275
+ },
276
+ children: [/* @__PURE__ */ jsx("span", {
277
+ className: "pf-daterange__value",
278
+ children: displayStart ? /* @__PURE__ */ jsxs(Fragment, { children: [
279
+ /* @__PURE__ */ jsx("span", { children: displayStart }),
280
+ /* @__PURE__ */ jsx("span", {
281
+ className: "pf-daterange__separator",
282
+ "aria-hidden": true,
283
+ children: "–"
284
+ }),
285
+ /* @__PURE__ */ jsx("span", {
286
+ className: cx(!displayEnd && "pf-daterange__value--placeholder"),
287
+ children: displayEnd || endPlaceholder
288
+ })
289
+ ] }) : /* @__PURE__ */ jsxs("span", {
290
+ className: "pf-daterange__value--placeholder",
291
+ children: [
292
+ startPlaceholder,
293
+ /* @__PURE__ */ jsxs("span", {
294
+ className: "pf-daterange__separator",
295
+ "aria-hidden": true,
296
+ children: [
297
+ " ",
298
+ "–",
299
+ " "
300
+ ]
301
+ }),
302
+ endPlaceholder
303
+ ]
304
+ })
305
+ }), /* @__PURE__ */ jsx(Icon, {
306
+ name: "calendar",
307
+ "aria-hidden": true
308
+ })]
309
+ }), hasValue ? /* @__PURE__ */ jsx("button", {
310
+ type: "button",
311
+ className: "pf-date-picker__icon-button",
312
+ "aria-label": "Clear date range",
313
+ disabled,
314
+ onClick: clearRange,
315
+ children: /* @__PURE__ */ jsx(Icon, {
316
+ name: "circle-xmark",
317
+ "aria-hidden": true
318
+ })
319
+ }) : null]
320
+ }), isOpen && typeof document !== "undefined" ? createPortal(/* @__PURE__ */ jsxs("div", {
321
+ ref: popoverRef,
322
+ className: "pf-daterange__popover",
323
+ role: "dialog",
324
+ "aria-label": "Date range picker",
325
+ style: popoverStyle,
326
+ onKeyDown: (e) => {
327
+ if (e.key === Keys.Escape) {
328
+ setSelecting(null);
329
+ setHoverDate(null);
330
+ disclosure.close();
331
+ }
332
+ },
333
+ children: [selecting === "start" ? /* @__PURE__ */ jsx("p", {
334
+ className: "pf-daterange__hint",
335
+ "aria-live": "polite",
336
+ children: "Select an end date"
337
+ }) : /* @__PURE__ */ jsx("p", {
338
+ className: "pf-daterange__hint",
339
+ "aria-live": "polite",
340
+ children: "Select a start date"
341
+ }), /* @__PURE__ */ jsxs("div", {
342
+ className: "pf-daterange__months",
343
+ children: [/* @__PURE__ */ jsx(RangeCalendar, {
344
+ monthDate: leftMonth,
345
+ rangeStart: range.start,
346
+ rangeEnd: range.end,
347
+ hoverDate: selecting === "start" ? hoverDate : null,
348
+ onDayClick: handleDayClick,
349
+ onDayHover: (d) => selecting === "start" && setHoverDate(d),
350
+ disabledDates,
351
+ showOutsideDays,
352
+ isPrevDisabled,
353
+ isNextDisabled: false,
354
+ onPrev: () => setLeftMonth((m) => clampMonth(addMonths(m, -1))),
355
+ onNext: () => setLeftMonth((m) => clampMonth(addMonths(m, 1)))
356
+ }), /* @__PURE__ */ jsx(RangeCalendar, {
357
+ monthDate: rightMonth,
358
+ rangeStart: range.start,
359
+ rangeEnd: range.end,
360
+ hoverDate: selecting === "start" ? hoverDate : null,
361
+ onDayClick: handleDayClick,
362
+ onDayHover: (d) => selecting === "start" && setHoverDate(d),
363
+ disabledDates,
364
+ showOutsideDays,
365
+ isPrevDisabled: false,
366
+ isNextDisabled,
367
+ onPrev: () => setLeftMonth((m) => clampMonth(addMonths(m, -1))),
368
+ onNext: () => setLeftMonth((m) => clampMonth(addMonths(m, 1))),
369
+ hideNavDesktop: true
370
+ })]
371
+ })]
372
+ }), document.body) : null]
373
+ })
374
+ });
375
+ });
376
+ DateRangePicker.displayName = "DateRangePicker";
377
+ //#endregion
378
+ export { DateRangePicker };
@@ -1,5 +1,9 @@
1
1
  .pf-heatmap {
2
2
  display: inline-block;
3
+ max-width: 100%;
4
+ /* A full year is wider than small screens — scroll horizontally instead of
5
+ overflowing the page. */
6
+ overflow-x: auto;
3
7
  font-family: var(--font-family-sans);
4
8
  }
5
9
 
@@ -112,6 +112,49 @@ var customIcons = {
112
112
  /* @__PURE__ */ jsx("path", { d: "M12 12v6" }),
113
113
  /* @__PURE__ */ jsx("path", { d: "m15 15-3-3-3 3" })
114
114
  ]
115
+ }),
116
+ plus: /* @__PURE__ */ jsxs("svg", {
117
+ width: "1em",
118
+ height: "1em",
119
+ viewBox: "0 0 24 24",
120
+ fill: "none",
121
+ stroke: "currentColor",
122
+ strokeWidth: "2.5",
123
+ strokeLinecap: "round",
124
+ strokeLinejoin: "round",
125
+ focusable: "false",
126
+ "aria-hidden": "true",
127
+ children: [/* @__PURE__ */ jsx("path", { d: "M12 5v14" }), /* @__PURE__ */ jsx("path", { d: "M5 12h14" })]
128
+ }),
129
+ "magnifying-glass": /* @__PURE__ */ jsxs("svg", {
130
+ width: "1em",
131
+ height: "1em",
132
+ viewBox: "0 0 24 24",
133
+ fill: "none",
134
+ stroke: "currentColor",
135
+ strokeWidth: "2",
136
+ strokeLinecap: "round",
137
+ strokeLinejoin: "round",
138
+ focusable: "false",
139
+ "aria-hidden": "true",
140
+ children: [/* @__PURE__ */ jsx("circle", {
141
+ cx: "11",
142
+ cy: "11",
143
+ r: "8"
144
+ }), /* @__PURE__ */ jsx("path", { d: "m21 21-4.35-4.35" })]
145
+ }),
146
+ minus: /* @__PURE__ */ jsx("svg", {
147
+ width: "1em",
148
+ height: "1em",
149
+ viewBox: "0 0 24 24",
150
+ fill: "none",
151
+ stroke: "currentColor",
152
+ strokeWidth: "2.5",
153
+ strokeLinecap: "round",
154
+ strokeLinejoin: "round",
155
+ focusable: "false",
156
+ "aria-hidden": "true",
157
+ children: /* @__PURE__ */ jsx("path", { d: "M5 12h14" })
115
158
  })
116
159
  };
117
160
  var regularIcons = {
@@ -0,0 +1,25 @@
1
+ .pf-kbd {
2
+ align-items: center;
3
+ background: var(--pf-kbd-bg);
4
+ border: 1px solid var(--pf-kbd-border);
5
+ border-bottom-width: 2px;
6
+ border-radius: var(--radius-sm);
7
+ color: var(--pf-kbd-text);
8
+ display: inline-flex;
9
+ font-family: var(--font-family-mono, ui-monospace, monospace);
10
+ font-weight: var(--font-weight-medium);
11
+ line-height: 1;
12
+ white-space: nowrap;
13
+ }
14
+
15
+ .pf-kbd--md {
16
+ font-size: var(--font-size-xs);
17
+ min-width: 1.5em;
18
+ padding: 3px 6px;
19
+ }
20
+
21
+ .pf-kbd--sm {
22
+ font-size: var(--font-size-2xs);
23
+ min-width: 1.35em;
24
+ padding: 2px 5px;
25
+ }
@@ -0,0 +1,17 @@
1
+ import { cx } from "../../utils/cx.js";
2
+ import './Kbd.css';/* empty css */
3
+ import { forwardRef } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/components/Kbd/Kbd.tsx
6
+ var Kbd = forwardRef(function Kbd({ className, keys, size = "md", separator = "+", children, ...props }, ref) {
7
+ const content = keys && keys.length > 0 ? keys.join(` ${separator} `) : children;
8
+ return /* @__PURE__ */ jsx("kbd", {
9
+ ref,
10
+ className: cx("pf-kbd", `pf-kbd--${size}`, className),
11
+ ...props,
12
+ children: content
13
+ });
14
+ });
15
+ Kbd.displayName = "Kbd";
16
+ //#endregion
17
+ export { Kbd };
@@ -0,0 +1,98 @@
1
+ .pf-numberinput {
2
+ align-items: stretch;
3
+ background: var(--pf-numberinput-bg);
4
+ border: 1px solid var(--pf-numberinput-border);
5
+ border-radius: var(--radius-md);
6
+ display: inline-flex;
7
+ min-height: 40px;
8
+ overflow: hidden;
9
+ width: 100%;
10
+ transition:
11
+ border 0.2s,
12
+ box-shadow 0.2s;
13
+ }
14
+
15
+ .pf-numberinput:focus-within {
16
+ border-color: var(--pf-numberinput-focus-border);
17
+ box-shadow: var(--pf-numberinput-focus-ring, var(--pf-focus-ring));
18
+ }
19
+
20
+ .pf-numberinput--invalid {
21
+ border-color: var(--pf-numberinput-invalid-border);
22
+ }
23
+
24
+ .pf-numberinput__input {
25
+ background: transparent;
26
+ border: none;
27
+ color: var(--pf-numberinput-text);
28
+ flex: 1;
29
+ font: inherit;
30
+ min-width: 0;
31
+ outline: none;
32
+ padding: 0 var(--space-3);
33
+ text-align: center;
34
+ width: 100%;
35
+ }
36
+
37
+ .pf-numberinput__input::placeholder {
38
+ color: var(--pf-numberinput-placeholder);
39
+ }
40
+
41
+ .pf-numberinput__input:disabled {
42
+ cursor: not-allowed;
43
+ }
44
+
45
+ .pf-numberinput:has(.pf-numberinput__input:disabled) {
46
+ background: var(--pf-control-bg-disabled);
47
+ border-color: var(--pf-control-border-disabled);
48
+ color: var(--pf-control-text-disabled);
49
+ opacity: 0.6;
50
+ }
51
+
52
+ .pf-numberinput__step {
53
+ align-items: center;
54
+ align-self: stretch;
55
+ background: var(--pf-numberinput-step-bg);
56
+ border: none;
57
+ color: var(--pf-numberinput-step-text);
58
+ cursor: pointer;
59
+ display: inline-flex;
60
+ flex-shrink: 0;
61
+ justify-content: center;
62
+ padding: 0;
63
+ width: 40px;
64
+ transition:
65
+ background 0.15s,
66
+ color 0.15s;
67
+ }
68
+
69
+ .pf-numberinput__step:hover:not(:disabled) {
70
+ background: var(--pf-numberinput-step-hover-bg);
71
+ color: var(--pf-numberinput-step-hover-text);
72
+ }
73
+
74
+ .pf-numberinput__step:disabled {
75
+ cursor: not-allowed;
76
+ opacity: 0.45;
77
+ }
78
+
79
+ .pf-numberinput__step--decrement {
80
+ border-inline-end: 1px solid var(--pf-numberinput-border);
81
+ }
82
+
83
+ .pf-numberinput__step--increment {
84
+ border-inline-start: 1px solid var(--pf-numberinput-border);
85
+ }
86
+
87
+ .pf-numberinput__step svg {
88
+ display: block;
89
+ height: 16px;
90
+ width: 16px;
91
+ }
92
+
93
+ @media (prefers-reduced-motion: reduce) {
94
+ .pf-numberinput,
95
+ .pf-numberinput__step {
96
+ transition: none;
97
+ }
98
+ }