@pitchfork-ui/react 0.1.9 → 0.6.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.
- package/README.md +20 -5
- package/dist/components/Accordion/Accordion.css +85 -0
- package/dist/components/Accordion/Accordion2.js +96 -0
- package/dist/components/Alert/Alert.css +111 -0
- package/dist/{index8.js → components/Alert/Alert2.js} +7 -5
- package/dist/components/Avatar/Avatar.css +97 -0
- package/dist/{index10.js → components/Avatar/Avatar2.js} +2 -2
- package/dist/components/Badge/Badge.css +26 -0
- package/dist/{index23.js → components/Badge/Badge2.js} +2 -2
- package/dist/components/BadgeGroup/BadgeGroup.css +115 -0
- package/dist/{index14.js → components/BadgeGroup/BadgeGroup2.js} +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.css +45 -0
- package/dist/{index18.js → components/Breadcrumbs/Breadcrumbs2.js} +2 -2
- package/dist/components/Button/Button.css +93 -0
- package/dist/{index12.js → components/Button/Button2.js} +2 -2
- package/dist/components/ButtonGroup/ButtonGroup.css +107 -0
- package/dist/{index16.js → components/ButtonGroup/ButtonGroup2.js} +2 -2
- package/dist/components/Calendar/Calendar.css +144 -0
- package/dist/{index40.js → components/Calendar/Calendar2.js} +4 -4
- package/dist/components/Card/Card.css +23 -0
- package/dist/{index25.js → components/Card/Card2.js} +2 -2
- package/dist/components/Carousel/Carousel.css +124 -0
- package/dist/components/Carousel/Carousel2.js +147 -0
- package/dist/components/Checkbox/Checkbox.css +62 -0
- package/dist/{index29.js → components/Checkbox/Checkbox2.js} +2 -2
- package/dist/components/CodeSnippet/CodeSnippet.css +155 -0
- package/dist/{index46.js → components/CodeSnippet/CodeSnippet2.js} +6 -6
- package/dist/components/ContentDivider/ContentDivider.css +38 -0
- package/dist/{index48.js → components/ContentDivider/ContentDivider2.js} +2 -2
- package/dist/components/CreditCard/CreditCard.css +139 -0
- package/dist/{index27.js → components/CreditCard/CreditCard2.js} +2 -2
- package/dist/components/DatePicker/DatePicker.css +91 -0
- package/dist/{index50.js → components/DatePicker/DatePicker2.js} +9 -9
- package/dist/components/Dropdown/Dropdown.css +149 -0
- package/dist/{index38.js → components/Dropdown/Dropdown2.js} +8 -9
- package/dist/components/EmptyState/EmptyState.css +72 -0
- package/dist/{index52.js → components/EmptyState/EmptyState2.js} +3 -3
- package/dist/components/FileUploader/FileUploader.css +135 -0
- package/dist/{index54.js → components/FileUploader/FileUploader2.js} +4 -4
- package/dist/components/GaugeChart/GaugeChart.css +63 -0
- package/dist/components/GaugeChart/GaugeChart2.js +74 -0
- package/dist/components/HeaderNavigation/HeaderNavigation.css +87 -0
- package/dist/{index56.js → components/HeaderNavigation/HeaderNavigation2.js} +2 -2
- package/dist/components/Heatmap/Heatmap.css +100 -0
- package/dist/components/Heatmap/Heatmap2.js +160 -0
- package/dist/components/Icon/Icon.css +6 -0
- package/dist/{index6.js → components/Icon/Icon2.js} +2 -2
- package/dist/components/InlineCTA/InlineCTA.css +144 -0
- package/dist/{index58.js → components/InlineCTA/InlineCTA2.js} +17 -5
- package/dist/components/Input/Input.css +75 -0
- package/dist/{index21.js → components/Input/Input2.js} +3 -3
- package/dist/components/LineBarCharts/LineBarChart.css +122 -0
- package/dist/{index60.js → components/LineBarCharts/LineBarChart2.js} +11 -3
- package/dist/components/LoadingIndicators/LoadingIndicators.css +107 -0
- package/dist/{index62.js → components/LoadingIndicators/LoadingIndicators2.js} +2 -2
- package/dist/components/Metrics/Metrics.css +106 -0
- package/dist/{index64.js → components/Metrics/Metrics2.js} +3 -3
- package/dist/components/Modal/Modal.css +198 -0
- package/dist/{index66.js → components/Modal/Modal2.js} +11 -9
- package/dist/components/MultiSelect/MultiSelect.css +174 -0
- package/dist/{index68.js → components/MultiSelect/MultiSelect2.js} +11 -12
- package/dist/components/Notification/Notification.css +242 -0
- package/dist/{index70.js → components/Notification/Notification2.js} +7 -5
- package/dist/components/PageHeader/PageHeader.css +85 -0
- package/dist/{index72.js → components/PageHeader/PageHeader2.js} +3 -3
- package/dist/components/Pagination/Pagination.css +101 -0
- package/dist/{index74.js → components/Pagination/Pagination2.js} +2 -2
- package/dist/components/PieChart/PieChart.css +115 -0
- package/dist/{index76.js → components/PieChart/PieChart2.js} +3 -3
- package/dist/components/ProgressIndicators/ProgressIndicators.css +95 -0
- package/dist/{index78.js → components/ProgressIndicators/ProgressIndicators2.js} +6 -3
- package/dist/components/ProgressSteps/ProgressSteps.css +175 -0
- package/dist/{index80.js → components/ProgressSteps/ProgressSteps2.js} +2 -2
- package/dist/components/RadarChart/RadarChart.css +119 -0
- package/dist/{index82.js → components/RadarChart/RadarChart2.js} +21 -15
- package/dist/components/RadioButton/RadioButton.css +21 -0
- package/dist/{index84.js → components/RadioButton/RadioButton2.js} +2 -2
- package/dist/components/RadioGroup/RadioGroup.css +64 -0
- package/dist/{index86.js → components/RadioGroup/RadioGroup2.js} +2 -2
- package/dist/components/Rating/Rating.css +91 -0
- package/dist/{index88.js → components/Rating/Rating2.js} +3 -3
- package/dist/components/RichTextEditor/RichTextEditor.css +94 -0
- package/dist/{index90.js → components/RichTextEditor/RichTextEditor2.js} +4 -4
- package/dist/components/SectionFooter/SectionFooter.css +59 -0
- package/dist/{index92.js → components/SectionFooter/SectionFooter2.js} +2 -2
- package/dist/components/SectionHeader/SectionHeader.css +78 -0
- package/dist/{index94.js → components/SectionHeader/SectionHeader2.js} +2 -2
- package/dist/components/Select/Select.css +156 -0
- package/dist/{index102.js → components/Select/Select2.js} +11 -12
- package/dist/components/SidebarNavigation/SidebarNavigation.css +116 -0
- package/dist/{index96.js → components/SidebarNavigation/SidebarNavigation2.js} +2 -2
- package/dist/components/SlideoutMenu/SlideoutMenu.css +161 -0
- package/dist/{index98.js → components/SlideoutMenu/SlideoutMenu2.js} +3 -3
- package/dist/components/Slider/Slider.css +106 -0
- package/dist/{index104.js → components/Slider/Slider2.js} +2 -2
- package/dist/components/Sparkline/Sparkline.css +65 -0
- package/dist/components/Sparkline/Sparkline2.js +100 -0
- package/dist/components/Switch/Switch.css +59 -0
- package/dist/{index100.js → components/Switch/Switch2.js} +2 -2
- package/dist/components/Table/Table.css +126 -0
- package/dist/{index108.js → components/Table/Table2.js} +2 -2
- package/dist/components/Tabs/Tabs.css +138 -0
- package/dist/{index110.js → components/Tabs/Tabs2.js} +53 -6
- package/dist/components/Tag/Tag.css +64 -0
- package/dist/{index106.js → components/Tag/Tag2.js} +3 -3
- package/dist/components/Textarea/Textarea.css +52 -0
- package/dist/{index112.js → components/Textarea/Textarea2.js} +3 -3
- package/dist/components/Tooltip/Tooltip.css +61 -0
- package/dist/{index114.js → components/Tooltip/Tooltip2.js} +6 -6
- package/dist/components/TreeView/TreeView.css +109 -0
- package/dist/{index116.js → components/TreeView/TreeView2.js} +2 -2
- package/dist/components/UtilityButton/UtilityButton.css +90 -0
- package/dist/{index118.js → components/UtilityButton/UtilityButton2.js} +2 -2
- package/dist/components/VideoPlayer/VideoPlayer.css +41 -0
- package/dist/{index120.js → components/VideoPlayer/VideoPlayer2.js} +2 -2
- package/dist/{index33.js → hooks/useDisclosure.js} +1 -1
- package/dist/hooks/useExitAnimation.js +25 -0
- package/dist/{index34.js → hooks/useFocusTrap.js} +1 -1
- package/dist/hooks/usePresence.js +31 -0
- package/dist/index.cjs +1030 -4720
- package/dist/index.js +69 -63
- package/dist/src/components/Accordion/Accordion.d.ts +20 -0
- package/dist/src/components/Accordion/Accordion.test.d.ts +1 -0
- package/dist/src/components/Accordion/index.d.ts +1 -0
- package/dist/src/components/GaugeChart/GaugeChart.d.ts +17 -0
- package/dist/src/components/GaugeChart/GaugeChart.test.d.ts +1 -0
- package/dist/src/components/GaugeChart/index.d.ts +1 -0
- package/dist/src/components/Heatmap/Heatmap.d.ts +28 -0
- package/dist/src/components/Heatmap/Heatmap.test.d.ts +1 -0
- package/dist/src/components/Heatmap/index.d.ts +1 -0
- package/dist/src/components/InlineCTA/InlineCTA.d.ts +2 -0
- package/dist/src/components/LineBarCharts/LineBarChart.d.ts +2 -0
- package/dist/src/components/Sparkline/Sparkline.d.ts +17 -0
- package/dist/src/components/Sparkline/Sparkline.test.d.ts +1 -0
- package/dist/src/components/Sparkline/index.d.ts +1 -0
- package/dist/src/hooks/index.d.ts +2 -0
- package/dist/src/hooks/useExitAnimation.d.ts +18 -0
- package/dist/src/hooks/usePresence.d.ts +13 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/styles/theme.css +813 -0
- package/dist/styles.css +881 -68
- package/dist/{index19.js → utils/FieldWrapper.js} +1 -1
- package/package.json +8 -4
- package/theme.starter.css +58 -0
- package/dist/index42.js +0 -134
- package/dist/index43.js +0 -16
- package/dist/index44.js +0 -4232
- /package/dist/{index3.js → a11y/index.js} +0 -0
- /package/dist/{index30.js → hooks/useAnchoredPosition.js} +0 -0
- /package/dist/{index31.js → hooks/useComposedRefs.js} +0 -0
- /package/dist/{index32.js → hooks/useControllableState.js} +0 -0
- /package/dist/{index35.js → hooks/useListNavigation.js} +0 -0
- /package/dist/{index36.js → hooks/useOutsideInteraction.js} +0 -0
- /package/dist/{index4.js → utils/cx.js} +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
.pf-tag {
|
|
2
|
+
align-items: center;
|
|
3
|
+
border-radius: var(--radius-full);
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
gap: var(--space-1);
|
|
6
|
+
min-height: 26px;
|
|
7
|
+
padding: 0 var(--space-2);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.pf-tag__label {
|
|
11
|
+
font-size: var(--font-size-sm);
|
|
12
|
+
font-weight: var(--font-weight-medium);
|
|
13
|
+
line-height: 1;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.pf-tag--neutral {
|
|
17
|
+
background: var(--pf-tag-neutral-bg);
|
|
18
|
+
color: var(--pf-tag-neutral-text);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.pf-tag--brand {
|
|
22
|
+
background: var(--pf-tag-brand-bg);
|
|
23
|
+
color: var(--pf-tag-brand-text);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.pf-tag--success {
|
|
27
|
+
background: var(--pf-tag-success-bg);
|
|
28
|
+
color: var(--pf-tag-success-text);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.pf-tag--warning {
|
|
32
|
+
background: var(--pf-tag-warning-bg);
|
|
33
|
+
color: var(--pf-tag-warning-text);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.pf-tag__dismiss {
|
|
37
|
+
align-items: center;
|
|
38
|
+
background: transparent;
|
|
39
|
+
border: 0;
|
|
40
|
+
border-radius: 999px;
|
|
41
|
+
color: currentColor;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
height: 18px;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
margin-inline-end: -2px;
|
|
47
|
+
padding: 0;
|
|
48
|
+
width: 18px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.pf-tag__dismiss:hover {
|
|
52
|
+
background: var(--pf-tag-subtle-hover-overlay, var(--pf-subtle-hover-overlay));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.pf-tag__dismiss:focus-visible {
|
|
56
|
+
box-shadow: var(--pf-tag-focus-ring, var(--pf-focus-ring));
|
|
57
|
+
outline: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.pf-tag__dismiss svg {
|
|
61
|
+
display: block;
|
|
62
|
+
height: 12px;
|
|
63
|
+
width: 12px;
|
|
64
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { cx } from "
|
|
2
|
-
import { Icon } from "
|
|
3
|
-
|
|
1
|
+
import { cx } from "../../utils/cx.js";
|
|
2
|
+
import { Icon } from "../Icon/Icon2.js";
|
|
3
|
+
import './Tag.css';/* empty css */
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/Tag/Tag.tsx
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.pf-field {
|
|
2
|
+
display: grid;
|
|
3
|
+
gap: var(--space-2);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.pf-field__label {
|
|
7
|
+
color: var(--pf-field-label);
|
|
8
|
+
font-size: var(--font-size-sm);
|
|
9
|
+
font-weight: var(--font-weight-medium);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.pf-field__description {
|
|
13
|
+
color: var(--pf-field-description);
|
|
14
|
+
font-size: var(--font-size-sm);
|
|
15
|
+
margin: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pf-field__error {
|
|
19
|
+
color: var(--pf-field-error);
|
|
20
|
+
font-size: var(--font-size-sm);
|
|
21
|
+
margin: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.pf-textarea {
|
|
25
|
+
background: var(--pf-textarea-bg);
|
|
26
|
+
border: 1px solid var(--pf-textarea-border);
|
|
27
|
+
border-radius: var(--radius-md);
|
|
28
|
+
color: var(--pf-textarea-text);
|
|
29
|
+
font: inherit;
|
|
30
|
+
line-height: 1.45;
|
|
31
|
+
min-height: 96px;
|
|
32
|
+
padding: var(--space-2) var(--space-3);
|
|
33
|
+
resize: vertical;
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.pf-textarea:focus {
|
|
38
|
+
outline: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.pf-textarea:focus-visible {
|
|
42
|
+
border-color: var(--pf-textarea-focus-border);
|
|
43
|
+
box-shadow: var(--pf-textarea-focus-ring, var(--pf-focus-ring));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.pf-textarea::placeholder {
|
|
47
|
+
color: var(--pf-textarea-text-muted);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.pf-textarea--invalid {
|
|
51
|
+
border-color: var(--pf-textarea-invalid-border);
|
|
52
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { cx } from "
|
|
2
|
-
import { FieldWrapper } from "
|
|
3
|
-
|
|
1
|
+
import { cx } from "../../utils/cx.js";
|
|
2
|
+
import { FieldWrapper } from "../../utils/FieldWrapper.js";
|
|
3
|
+
import './Textarea.css';/* empty css */
|
|
4
4
|
import { forwardRef, useId } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/Textarea/Textarea.tsx
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.pf-tooltip__trigger {
|
|
2
|
+
border-radius: var(--radius-sm);
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.pf-tooltip__trigger:has(:focus-visible) {
|
|
7
|
+
outline: var(--pf-focus-ring);
|
|
8
|
+
outline-offset: 2px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.pf-tooltip {
|
|
12
|
+
background: var(--pf-tooltip-bg);
|
|
13
|
+
border-radius: var(--radius-sm);
|
|
14
|
+
box-shadow: var(--pf-tooltip-elevation-tooltip-shadow, var(--pf-elevation-tooltip-shadow));
|
|
15
|
+
color: var(--pf-tooltip-text);
|
|
16
|
+
font-size: var(--font-size-sm);
|
|
17
|
+
line-height: 1.35;
|
|
18
|
+
max-height: calc(100vh - 16px);
|
|
19
|
+
max-width: min(260px, calc(100vw - 16px));
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
overflow-wrap: anywhere;
|
|
22
|
+
padding: var(--space-2) var(--pf-tooltip-padding-x);
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
position: fixed;
|
|
25
|
+
z-index: 1100;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Entrance animation — uses motion tokens via theme aliases */
|
|
29
|
+
@keyframes pf-tooltip-in {
|
|
30
|
+
from {
|
|
31
|
+
opacity: 0;
|
|
32
|
+
transform: translateY(2px);
|
|
33
|
+
}
|
|
34
|
+
to {
|
|
35
|
+
opacity: 1;
|
|
36
|
+
transform: translateY(0);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.pf-tooltip {
|
|
41
|
+
animation: pf-tooltip-in var(--pf-transition-fast);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Exit fade — plays while the tooltip is dismissed (presence handling) */
|
|
45
|
+
@keyframes pf-tooltip-out {
|
|
46
|
+
to {
|
|
47
|
+
opacity: 0;
|
|
48
|
+
transform: translateY(2px);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pf-tooltip--exiting {
|
|
53
|
+
animation: pf-tooltip-out var(--duration-fast) var(--easing-accelerate) forwards;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@media (prefers-reduced-motion: reduce) {
|
|
57
|
+
.pf-tooltip,
|
|
58
|
+
.pf-tooltip--exiting {
|
|
59
|
+
animation: none;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { usePresence } from "../../hooks/usePresence.js";
|
|
2
|
+
import { cx } from "../../utils/cx.js";
|
|
3
|
+
import './Tooltip.css';/* empty css */
|
|
3
4
|
import { forwardRef, useEffect, useId, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
4
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { createPortal } from "react-dom";
|
|
@@ -87,6 +88,7 @@ var Tooltip = forwardRef(function Tooltip({ content, children, open, placement =
|
|
|
87
88
|
const [resolvedPlacement, setResolvedPlacement] = useState(placement);
|
|
88
89
|
const isControlled = open !== void 0;
|
|
89
90
|
const isVisible = !disabled && (isControlled ? open : isOpen);
|
|
91
|
+
const { isMounted, isExiting } = usePresence(Boolean(isVisible), 160);
|
|
90
92
|
const clearShowTimer = () => {
|
|
91
93
|
if (showTimerRef.current !== void 0) {
|
|
92
94
|
window.clearTimeout(showTimerRef.current);
|
|
@@ -105,8 +107,6 @@ var Tooltip = forwardRef(function Tooltip({ content, children, open, placement =
|
|
|
105
107
|
clearShowTimer();
|
|
106
108
|
if (isControlled) return;
|
|
107
109
|
setIsOpen(false);
|
|
108
|
-
setStyle({ visibility: "hidden" });
|
|
109
|
-
setResolvedPlacement(placement);
|
|
110
110
|
};
|
|
111
111
|
useEffect(() => {
|
|
112
112
|
return () => {
|
|
@@ -141,11 +141,11 @@ var Tooltip = forwardRef(function Tooltip({ content, children, open, placement =
|
|
|
141
141
|
},
|
|
142
142
|
"aria-describedby": isVisible ? tooltipId : void 0,
|
|
143
143
|
children: children ?? /* @__PURE__ */ jsx("span", {})
|
|
144
|
-
}),
|
|
144
|
+
}), isMounted && typeof document !== "undefined" ? createPortal(/* @__PURE__ */ jsx("div", {
|
|
145
145
|
id: tooltipId,
|
|
146
146
|
ref: tooltipRef,
|
|
147
147
|
role: "tooltip",
|
|
148
|
-
className: cx("pf-tooltip", `pf-tooltip--${resolvedPlacement}`, className),
|
|
148
|
+
className: cx("pf-tooltip", `pf-tooltip--${resolvedPlacement}`, isExiting && "pf-tooltip--exiting", className),
|
|
149
149
|
style,
|
|
150
150
|
children: content
|
|
151
151
|
}), document.body) : null] });
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
.pf-tree-view {
|
|
2
|
+
background: var(--pf-treeview-bg);
|
|
3
|
+
border: 1px solid var(--pf-treeview-border);
|
|
4
|
+
border-radius: var(--radius-md);
|
|
5
|
+
padding: var(--space-2);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.pf-tree-view__list {
|
|
9
|
+
list-style: none;
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.pf-tree-view__item {
|
|
15
|
+
min-width: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pf-tree-view__row {
|
|
19
|
+
align-items: center;
|
|
20
|
+
display: grid;
|
|
21
|
+
grid-template-columns: auto 1fr;
|
|
22
|
+
min-width: 0;
|
|
23
|
+
padding-inline-start: calc(var(--pf-tree-level, 0) * var(--space-4));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.pf-tree-view__toggle-wrap {
|
|
27
|
+
align-items: center;
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
width: 24px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.pf-tree-view__toggle,
|
|
34
|
+
.pf-tree-view__spacer {
|
|
35
|
+
align-items: center;
|
|
36
|
+
color: var(--pf-treeview-text-muted);
|
|
37
|
+
display: inline-flex;
|
|
38
|
+
font-size: var(--font-size-xs);
|
|
39
|
+
height: 24px;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
width: 24px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.pf-tree-view__toggle {
|
|
45
|
+
background: transparent;
|
|
46
|
+
border: 0;
|
|
47
|
+
border-radius: var(--radius-sm);
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
padding: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pf-tree-view__toggle:hover {
|
|
53
|
+
background: var(--pf-treeview-bg-subtle);
|
|
54
|
+
color: var(--pf-treeview-text);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.pf-tree-view__node {
|
|
58
|
+
align-items: center;
|
|
59
|
+
background: transparent;
|
|
60
|
+
border: 0;
|
|
61
|
+
border-radius: var(--radius-sm);
|
|
62
|
+
color: var(--pf-treeview-text-muted);
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
display: grid;
|
|
65
|
+
font: inherit;
|
|
66
|
+
gap: var(--space-2);
|
|
67
|
+
grid-template-columns: auto 1fr auto;
|
|
68
|
+
justify-items: start;
|
|
69
|
+
min-height: 34px;
|
|
70
|
+
min-width: 0;
|
|
71
|
+
padding: 0 var(--space-2);
|
|
72
|
+
text-align: start;
|
|
73
|
+
width: 100%;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.pf-tree-view__node:hover {
|
|
77
|
+
background: var(--pf-treeview-bg-subtle);
|
|
78
|
+
color: var(--pf-treeview-text);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.pf-tree-view__node:focus-visible {
|
|
82
|
+
box-shadow: var(--pf-treeview-focus-ring, var(--pf-focus-ring));
|
|
83
|
+
outline: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.pf-tree-view__row--selected .pf-tree-view__node {
|
|
87
|
+
background: var(--pf-treeview-bg-subtle);
|
|
88
|
+
color: var(--pf-treeview-text);
|
|
89
|
+
font-weight: var(--font-weight-semibold);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.pf-tree-view__row--disabled .pf-tree-view__node {
|
|
93
|
+
cursor: not-allowed;
|
|
94
|
+
opacity: 0.5;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.pf-tree-view__icon,
|
|
98
|
+
.pf-tree-view__badge {
|
|
99
|
+
align-items: center;
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.pf-tree-view__label {
|
|
105
|
+
min-width: 0;
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
text-overflow: ellipsis;
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cx } from "
|
|
2
|
-
|
|
1
|
+
import { cx } from "../../utils/cx.js";
|
|
2
|
+
import './TreeView.css';/* empty css */
|
|
3
3
|
import { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/TreeView/TreeView.tsx
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
.pf-utility-button {
|
|
2
|
+
align-items: center;
|
|
3
|
+
border: 1px solid transparent;
|
|
4
|
+
border-radius: var(--radius-md);
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
font-family: inherit;
|
|
8
|
+
font-weight: var(--font-weight-medium);
|
|
9
|
+
gap: var(--space-1);
|
|
10
|
+
justify-content: center;
|
|
11
|
+
line-height: 1;
|
|
12
|
+
transition:
|
|
13
|
+
background-color 120ms ease,
|
|
14
|
+
border-color 120ms ease,
|
|
15
|
+
color 120ms ease,
|
|
16
|
+
box-shadow 120ms ease;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.pf-utility-button:focus-visible {
|
|
20
|
+
box-shadow: var(--pf-utilitybutton-focus-ring, var(--pf-focus-ring));
|
|
21
|
+
outline: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.pf-utility-button:disabled {
|
|
25
|
+
cursor: not-allowed;
|
|
26
|
+
opacity: 0.55;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.pf-utility-button--sm {
|
|
30
|
+
font-size: var(--font-size-sm);
|
|
31
|
+
min-height: 32px;
|
|
32
|
+
padding: 0 var(--space-2);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.pf-utility-button--md {
|
|
36
|
+
font-size: var(--font-size-sm);
|
|
37
|
+
min-height: 36px;
|
|
38
|
+
padding: 0 var(--space-3);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.pf-utility-button--neutral {
|
|
42
|
+
background: var(--pf-utility-btn-neutral-bg);
|
|
43
|
+
border-color: var(--pf-utility-btn-neutral-border);
|
|
44
|
+
color: var(--pf-utility-btn-neutral-text);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.pf-utility-button--neutral:hover:not(:disabled) {
|
|
48
|
+
background: var(--pf-utility-btn-neutral-bg-hover);
|
|
49
|
+
border-color: var(--pf-utility-btn-neutral-border-hover);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pf-utility-button--brand {
|
|
53
|
+
background: var(--pf-utility-btn-brand-bg);
|
|
54
|
+
border-color: var(--pf-utility-btn-brand-border);
|
|
55
|
+
color: var(--pf-utility-btn-brand-text);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.pf-utility-button--brand:hover:not(:disabled) {
|
|
59
|
+
background: var(--pf-utility-btn-brand-bg-hover);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.pf-utility-button--danger {
|
|
63
|
+
background: var(--pf-utility-btn-danger-bg);
|
|
64
|
+
border-color: var(--pf-utility-btn-danger-border);
|
|
65
|
+
color: var(--pf-utility-btn-danger-text);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.pf-utility-button--danger:hover:not(:disabled) {
|
|
69
|
+
background: var(--pf-utility-btn-danger-bg-hover);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.pf-utility-button__icon {
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.pf-utility-button__icon svg {
|
|
77
|
+
display: block;
|
|
78
|
+
height: 16px;
|
|
79
|
+
width: 16px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.pf-utility-button__label {
|
|
83
|
+
white-space: nowrap;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media (prefers-reduced-motion: reduce) {
|
|
87
|
+
.pf-utility-button {
|
|
88
|
+
transition: none;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cx } from "
|
|
2
|
-
|
|
1
|
+
import { cx } from "../../utils/cx.js";
|
|
2
|
+
import './UtilityButton.css';/* empty css */
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/UtilityButton/UtilityButton.tsx
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.pf-video-player {
|
|
2
|
+
background: var(--pf-videoplayer-bg);
|
|
3
|
+
border: 1px solid var(--pf-videoplayer-border);
|
|
4
|
+
border-radius: var(--radius-md);
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
width: 100%;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.pf-video-player--ratio-16-9 {
|
|
10
|
+
aspect-ratio: 16 / 9;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.pf-video-player--ratio-4-3 {
|
|
14
|
+
aspect-ratio: 4 / 3;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pf-video-player--ratio-1-1 {
|
|
18
|
+
aspect-ratio: 1 / 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.pf-video-player--invalid {
|
|
22
|
+
border-color: var(--pf-videoplayer-invalid-border);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.pf-video-player__video {
|
|
26
|
+
display: block;
|
|
27
|
+
height: 100%;
|
|
28
|
+
object-fit: cover;
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.pf-video-player__empty {
|
|
33
|
+
align-items: center;
|
|
34
|
+
color: var(--pf-videoplayer-text-muted);
|
|
35
|
+
display: flex;
|
|
36
|
+
font-size: var(--font-size-sm);
|
|
37
|
+
height: 100%;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
padding: var(--space-4);
|
|
40
|
+
text-align: center;
|
|
41
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cx } from "
|
|
2
|
-
|
|
1
|
+
import { cx } from "../../utils/cx.js";
|
|
2
|
+
import './VideoPlayer.css';/* empty css */
|
|
3
3
|
import { forwardRef, useId } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/VideoPlayer/VideoPlayer.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useControllableState } from "./
|
|
1
|
+
import { useControllableState } from "./useControllableState.js";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
//#region src/hooks/useDisclosure.ts
|
|
4
4
|
function useDisclosure({ open, defaultOpen = false, onOpenChange, disabled = false } = {}) {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
//#region src/hooks/useExitAnimation.ts
|
|
3
|
+
var prefersReducedMotion = () => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
4
|
+
/**
|
|
5
|
+
* Plays an exit animation before signalling removal. Apply `isExiting` to a CSS
|
|
6
|
+
* class that runs the exit keyframes; `onExited` fires after `duration`. When the
|
|
7
|
+
* user prefers reduced motion, `onExited` fires immediately with no animation.
|
|
8
|
+
*/
|
|
9
|
+
function useExitAnimation({ onExited, duration = 220 } = {}) {
|
|
10
|
+
const [isExiting, setIsExiting] = useState(false);
|
|
11
|
+
const startExit = () => {
|
|
12
|
+
if (prefersReducedMotion()) {
|
|
13
|
+
onExited?.();
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
setIsExiting(true);
|
|
17
|
+
window.setTimeout(() => onExited?.(), duration);
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
isExiting,
|
|
21
|
+
startExit
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { useExitAnimation };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Keys, getFocusableElements } from "
|
|
1
|
+
import { Keys, getFocusableElements } from "../a11y/index.js";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
//#region src/hooks/useFocusTrap.ts
|
|
4
4
|
function useFocusTrap({ containerRef, enabled = true, onEscape, restoreFocus = true }) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
//#region src/hooks/usePresence.ts
|
|
3
|
+
var prefersReducedMotion = () => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
4
|
+
/**
|
|
5
|
+
* Keeps a conditionally-rendered element mounted long enough to play an exit
|
|
6
|
+
* animation. Drive it with the `present` prop (e.g. a Modal's `open`): when it
|
|
7
|
+
* flips to false, the element stays mounted with `isExiting` true for `duration`
|
|
8
|
+
* ms, then unmounts. Reduced motion unmounts immediately.
|
|
9
|
+
*/
|
|
10
|
+
function usePresence(present, duration = 200) {
|
|
11
|
+
const [isExiting, setIsExiting] = useState(false);
|
|
12
|
+
const wasPresent = useRef(false);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (present) {
|
|
15
|
+
wasPresent.current = true;
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (!wasPresent.current || prefersReducedMotion()) return;
|
|
19
|
+
wasPresent.current = false;
|
|
20
|
+
setIsExiting(true);
|
|
21
|
+
const timer = window.setTimeout(() => setIsExiting(false), duration);
|
|
22
|
+
return () => window.clearTimeout(timer);
|
|
23
|
+
}, [present, duration]);
|
|
24
|
+
const exiting = !present && isExiting;
|
|
25
|
+
return {
|
|
26
|
+
isMounted: present || exiting,
|
|
27
|
+
isExiting: exiting
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { usePresence };
|