@pitchfork-ui/react 0.1.9 → 0.2.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 (137) hide show
  1. package/README.md +20 -5
  2. package/dist/components/Alert/Alert.css +83 -0
  3. package/dist/{index8.js → components/Alert/Alert2.js} +3 -3
  4. package/dist/components/Avatar/Avatar.css +97 -0
  5. package/dist/{index10.js → components/Avatar/Avatar2.js} +2 -2
  6. package/dist/components/Badge/Badge.css +26 -0
  7. package/dist/{index23.js → components/Badge/Badge2.js} +2 -2
  8. package/dist/components/BadgeGroup/BadgeGroup.css +115 -0
  9. package/dist/{index14.js → components/BadgeGroup/BadgeGroup2.js} +2 -2
  10. package/dist/components/Breadcrumbs/Breadcrumbs.css +45 -0
  11. package/dist/{index18.js → components/Breadcrumbs/Breadcrumbs2.js} +2 -2
  12. package/dist/components/Button/Button.css +93 -0
  13. package/dist/{index12.js → components/Button/Button2.js} +2 -2
  14. package/dist/components/ButtonGroup/ButtonGroup.css +107 -0
  15. package/dist/{index16.js → components/ButtonGroup/ButtonGroup2.js} +2 -2
  16. package/dist/components/Calendar/Calendar.css +144 -0
  17. package/dist/{index40.js → components/Calendar/Calendar2.js} +4 -4
  18. package/dist/components/Card/Card.css +23 -0
  19. package/dist/{index25.js → components/Card/Card2.js} +2 -2
  20. package/dist/components/Carousel/Carousel.css +122 -0
  21. package/dist/{index42.js → components/Carousel/Carousel2.js} +3 -3
  22. package/dist/components/Checkbox/Checkbox.css +62 -0
  23. package/dist/{index29.js → components/Checkbox/Checkbox2.js} +2 -2
  24. package/dist/components/CodeSnippet/CodeSnippet.css +155 -0
  25. package/dist/{index46.js → components/CodeSnippet/CodeSnippet2.js} +6 -6
  26. package/dist/components/ContentDivider/ContentDivider.css +38 -0
  27. package/dist/{index48.js → components/ContentDivider/ContentDivider2.js} +2 -2
  28. package/dist/components/CreditCard/CreditCard.css +139 -0
  29. package/dist/{index27.js → components/CreditCard/CreditCard2.js} +2 -2
  30. package/dist/components/DatePicker/DatePicker.css +91 -0
  31. package/dist/{index50.js → components/DatePicker/DatePicker2.js} +9 -9
  32. package/dist/components/Dropdown/Dropdown.css +132 -0
  33. package/dist/{index38.js → components/Dropdown/Dropdown2.js} +8 -8
  34. package/dist/components/EmptyState/EmptyState.css +72 -0
  35. package/dist/{index52.js → components/EmptyState/EmptyState2.js} +3 -3
  36. package/dist/components/FileUploader/FileUploader.css +135 -0
  37. package/dist/{index54.js → components/FileUploader/FileUploader2.js} +4 -4
  38. package/dist/components/GaugeChart/GaugeChart.css +46 -0
  39. package/dist/components/GaugeChart/GaugeChart2.js +73 -0
  40. package/dist/components/HeaderNavigation/HeaderNavigation.css +87 -0
  41. package/dist/{index56.js → components/HeaderNavigation/HeaderNavigation2.js} +2 -2
  42. package/dist/components/Icon/Icon.css +6 -0
  43. package/dist/{index6.js → components/Icon/Icon2.js} +2 -2
  44. package/dist/components/InlineCTA/InlineCTA.css +86 -0
  45. package/dist/{index58.js → components/InlineCTA/InlineCTA2.js} +3 -3
  46. package/dist/components/Input/Input.css +75 -0
  47. package/dist/{index21.js → components/Input/Input2.js} +3 -3
  48. package/dist/components/LineBarCharts/LineBarChart.css +122 -0
  49. package/dist/{index60.js → components/LineBarCharts/LineBarChart2.js} +11 -3
  50. package/dist/components/LoadingIndicators/LoadingIndicators.css +107 -0
  51. package/dist/{index62.js → components/LoadingIndicators/LoadingIndicators2.js} +2 -2
  52. package/dist/components/Metrics/Metrics.css +106 -0
  53. package/dist/{index64.js → components/Metrics/Metrics2.js} +3 -3
  54. package/dist/components/Modal/Modal.css +136 -0
  55. package/dist/{index66.js → components/Modal/Modal2.js} +4 -4
  56. package/dist/components/MultiSelect/MultiSelect.css +157 -0
  57. package/dist/{index68.js → components/MultiSelect/MultiSelect2.js} +11 -11
  58. package/dist/components/Notification/Notification.css +187 -0
  59. package/dist/{index70.js → components/Notification/Notification2.js} +3 -3
  60. package/dist/components/PageHeader/PageHeader.css +85 -0
  61. package/dist/{index72.js → components/PageHeader/PageHeader2.js} +3 -3
  62. package/dist/components/Pagination/Pagination.css +101 -0
  63. package/dist/{index74.js → components/Pagination/Pagination2.js} +2 -2
  64. package/dist/components/PieChart/PieChart.css +81 -0
  65. package/dist/{index76.js → components/PieChart/PieChart2.js} +2 -2
  66. package/dist/components/ProgressIndicators/ProgressIndicators.css +77 -0
  67. package/dist/{index78.js → components/ProgressIndicators/ProgressIndicators2.js} +2 -2
  68. package/dist/components/ProgressSteps/ProgressSteps.css +158 -0
  69. package/dist/{index80.js → components/ProgressSteps/ProgressSteps2.js} +2 -2
  70. package/dist/components/RadarChart/RadarChart.css +97 -0
  71. package/dist/{index82.js → components/RadarChart/RadarChart2.js} +2 -2
  72. package/dist/components/RadioButton/RadioButton.css +21 -0
  73. package/dist/{index84.js → components/RadioButton/RadioButton2.js} +2 -2
  74. package/dist/components/RadioGroup/RadioGroup.css +64 -0
  75. package/dist/{index86.js → components/RadioGroup/RadioGroup2.js} +2 -2
  76. package/dist/components/Rating/Rating.css +91 -0
  77. package/dist/{index88.js → components/Rating/Rating2.js} +3 -3
  78. package/dist/components/RichTextEditor/RichTextEditor.css +94 -0
  79. package/dist/{index90.js → components/RichTextEditor/RichTextEditor2.js} +4 -4
  80. package/dist/components/SectionFooter/SectionFooter.css +59 -0
  81. package/dist/{index92.js → components/SectionFooter/SectionFooter2.js} +2 -2
  82. package/dist/components/SectionHeader/SectionHeader.css +78 -0
  83. package/dist/{index94.js → components/SectionHeader/SectionHeader2.js} +2 -2
  84. package/dist/components/Select/Select.css +137 -0
  85. package/dist/{index102.js → components/Select/Select2.js} +11 -11
  86. package/dist/components/SidebarNavigation/SidebarNavigation.css +116 -0
  87. package/dist/{index96.js → components/SidebarNavigation/SidebarNavigation2.js} +2 -2
  88. package/dist/components/SlideoutMenu/SlideoutMenu.css +161 -0
  89. package/dist/{index98.js → components/SlideoutMenu/SlideoutMenu2.js} +3 -3
  90. package/dist/components/Slider/Slider.css +106 -0
  91. package/dist/{index104.js → components/Slider/Slider2.js} +2 -2
  92. package/dist/components/Sparkline/Sparkline.css +17 -0
  93. package/dist/components/Sparkline/Sparkline2.js +99 -0
  94. package/dist/components/Switch/Switch.css +59 -0
  95. package/dist/{index100.js → components/Switch/Switch2.js} +2 -2
  96. package/dist/components/Table/Table.css +126 -0
  97. package/dist/{index108.js → components/Table/Table2.js} +2 -2
  98. package/dist/components/Tabs/Tabs.css +112 -0
  99. package/dist/{index110.js → components/Tabs/Tabs2.js} +2 -2
  100. package/dist/components/Tag/Tag.css +64 -0
  101. package/dist/{index106.js → components/Tag/Tag2.js} +3 -3
  102. package/dist/components/Textarea/Textarea.css +52 -0
  103. package/dist/{index112.js → components/Textarea/Textarea2.js} +3 -3
  104. package/dist/components/Tooltip/Tooltip.css +26 -0
  105. package/dist/{index114.js → components/Tooltip/Tooltip2.js} +2 -2
  106. package/dist/components/TreeView/TreeView.css +109 -0
  107. package/dist/{index116.js → components/TreeView/TreeView2.js} +2 -2
  108. package/dist/components/UtilityButton/UtilityButton.css +90 -0
  109. package/dist/{index118.js → components/UtilityButton/UtilityButton2.js} +2 -2
  110. package/dist/components/VideoPlayer/VideoPlayer.css +41 -0
  111. package/dist/{index120.js → components/VideoPlayer/VideoPlayer2.js} +2 -2
  112. package/dist/{index33.js → hooks/useDisclosure.js} +1 -1
  113. package/dist/{index34.js → hooks/useFocusTrap.js} +1 -1
  114. package/dist/index.cjs +380 -4450
  115. package/dist/index.js +65 -63
  116. package/dist/src/components/GaugeChart/GaugeChart.d.ts +17 -0
  117. package/dist/src/components/GaugeChart/GaugeChart.test.d.ts +1 -0
  118. package/dist/src/components/GaugeChart/index.d.ts +1 -0
  119. package/dist/src/components/LineBarCharts/LineBarChart.d.ts +2 -0
  120. package/dist/src/components/Sparkline/Sparkline.d.ts +15 -0
  121. package/dist/src/components/Sparkline/Sparkline.test.d.ts +1 -0
  122. package/dist/src/components/Sparkline/index.d.ts +1 -0
  123. package/dist/src/index.d.ts +2 -0
  124. package/dist/styles/theme.css +779 -0
  125. package/dist/styles.css +124 -5
  126. package/dist/{index19.js → utils/FieldWrapper.js} +1 -1
  127. package/package.json +8 -4
  128. package/theme.starter.css +57 -0
  129. package/dist/index43.js +0 -16
  130. package/dist/index44.js +0 -4232
  131. /package/dist/{index3.js → a11y/index.js} +0 -0
  132. /package/dist/{index30.js → hooks/useAnchoredPosition.js} +0 -0
  133. /package/dist/{index31.js → hooks/useComposedRefs.js} +0 -0
  134. /package/dist/{index32.js → hooks/useControllableState.js} +0 -0
  135. /package/dist/{index35.js → hooks/useListNavigation.js} +0 -0
  136. /package/dist/{index36.js → hooks/useOutsideInteraction.js} +0 -0
  137. /package/dist/{index4.js → utils/cx.js} +0 -0
@@ -0,0 +1,116 @@
1
+ .pf-sidebar-navigation {
2
+ background: var(--pf-sidebar-nav-bg);
3
+ border: 1px solid var(--pf-sidebar-nav-border);
4
+ border-radius: var(--radius-md);
5
+ display: flex;
6
+ flex-direction: column;
7
+ min-height: 0;
8
+ width: 100%;
9
+ }
10
+
11
+ @media (min-width: 768px) {
12
+ .pf-sidebar-navigation {
13
+ min-height: 360px;
14
+ width: min(100%, 280px);
15
+ }
16
+ }
17
+
18
+ .pf-sidebar-navigation__header,
19
+ .pf-sidebar-navigation__footer {
20
+ border-color: var(--pf-sidebar-nav-border);
21
+ padding: var(--space-3) var(--space-3);
22
+ }
23
+
24
+ .pf-sidebar-navigation__header {
25
+ border-bottom: 1px solid var(--pf-sidebar-nav-border);
26
+ }
27
+
28
+ .pf-sidebar-navigation__footer {
29
+ border-top: 1px solid var(--pf-sidebar-nav-border);
30
+ margin-top: auto;
31
+ }
32
+
33
+ .pf-sidebar-navigation__nav {
34
+ display: grid;
35
+ gap: var(--space-3);
36
+ padding: var(--space-3);
37
+ }
38
+
39
+ .pf-sidebar-navigation__section {
40
+ display: grid;
41
+ gap: var(--space-1);
42
+ }
43
+
44
+ .pf-sidebar-navigation__section-title {
45
+ color: var(--pf-sidebar-nav-text-muted);
46
+ font-size: var(--font-size-xs);
47
+ font-weight: var(--font-weight-semibold);
48
+ letter-spacing: 0.04em;
49
+ margin: 0;
50
+ padding: 0 var(--space-2);
51
+ text-transform: uppercase;
52
+ }
53
+
54
+ .pf-sidebar-navigation__list {
55
+ display: grid;
56
+ gap: 2px;
57
+ list-style: none;
58
+ margin: 0;
59
+ padding: 0;
60
+ }
61
+
62
+ .pf-sidebar-navigation__item {
63
+ min-width: 0;
64
+ }
65
+
66
+ .pf-sidebar-navigation__link {
67
+ align-items: center;
68
+ background: transparent;
69
+ border: 0;
70
+ border-radius: var(--radius-sm);
71
+ color: var(--pf-sidebar-nav-text-muted);
72
+ cursor: pointer;
73
+ display: grid;
74
+ font: inherit;
75
+ gap: var(--space-2);
76
+ grid-template-columns: auto 1fr auto;
77
+ min-height: 36px;
78
+ padding: 0 var(--space-2);
79
+ text-align: left;
80
+ text-decoration: none;
81
+ width: 100%;
82
+ }
83
+
84
+ .pf-sidebar-navigation__link:hover {
85
+ background: var(--pf-sidebar-nav-bg-subtle);
86
+ color: var(--pf-sidebar-nav-text);
87
+ }
88
+
89
+ .pf-sidebar-navigation__link:focus-visible {
90
+ box-shadow: var(--pf-sidebarnavigation-focus-ring, var(--pf-focus-ring));
91
+ outline: none;
92
+ }
93
+
94
+ .pf-sidebar-navigation__link--active {
95
+ background: var(--pf-sidebar-nav-bg-subtle);
96
+ color: var(--pf-sidebar-nav-text);
97
+ font-weight: var(--font-weight-semibold);
98
+ }
99
+
100
+ .pf-sidebar-navigation__link--disabled {
101
+ cursor: not-allowed;
102
+ opacity: 0.45;
103
+ }
104
+
105
+ .pf-sidebar-navigation__icon,
106
+ .pf-sidebar-navigation__badge {
107
+ align-items: center;
108
+ display: inline-flex;
109
+ justify-content: center;
110
+ }
111
+
112
+ .pf-sidebar-navigation__label {
113
+ overflow: hidden;
114
+ text-overflow: ellipsis;
115
+ white-space: nowrap;
116
+ }
@@ -1,5 +1,5 @@
1
- import { cx } from "./index4.js";
2
- /* empty css */
1
+ import { cx } from "../../utils/cx.js";
2
+ import './SidebarNavigation.css';/* empty css */
3
3
  import { forwardRef } from "react";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/components/SidebarNavigation/SidebarNavigation.tsx
@@ -0,0 +1,161 @@
1
+ .pf-slideout__portal {
2
+ inset: 0;
3
+ position: fixed;
4
+ z-index: 1000;
5
+ }
6
+
7
+ .pf-slideout__overlay {
8
+ background: var(--pf-slideoutmenu-overlay-backdrop, var(--pf-overlay-backdrop));
9
+ opacity: 1;
10
+ inset: 0;
11
+ position: absolute;
12
+ transition: opacity 220ms ease;
13
+ }
14
+
15
+ .pf-slideout__viewport {
16
+ display: flex;
17
+ inset: 0;
18
+ pointer-events: none;
19
+ position: absolute;
20
+ }
21
+
22
+ .pf-slideout__viewport--right {
23
+ justify-content: flex-end;
24
+ }
25
+
26
+ .pf-slideout__viewport--left {
27
+ justify-content: flex-start;
28
+ }
29
+
30
+ .pf-slideout {
31
+ background: var(--pf-slideout-bg);
32
+ border-color: var(--pf-slideout-border);
33
+ border-style: solid;
34
+ box-shadow: var(--pf-slideoutmenu-elevation-overlay-shadow, var(--pf-elevation-overlay-shadow));
35
+ color: var(--pf-slideout-text);
36
+ display: grid;
37
+ grid-template-rows: auto 1fr auto;
38
+ height: 100%;
39
+ max-width: 100%;
40
+ pointer-events: auto;
41
+ transition: transform 220ms ease;
42
+ will-change: transform;
43
+ }
44
+
45
+ .pf-slideout:focus-visible {
46
+ outline: none;
47
+ }
48
+
49
+ .pf-slideout__viewport--right .pf-slideout {
50
+ border-left-width: 1px;
51
+ transform: translateX(0);
52
+ }
53
+
54
+ .pf-slideout__viewport--left .pf-slideout {
55
+ border-right-width: 1px;
56
+ transform: translateX(0);
57
+ }
58
+
59
+ .pf-slideout__portal[data-state='closed'] .pf-slideout__overlay {
60
+ opacity: 0;
61
+ }
62
+
63
+ .pf-slideout__portal[data-state='closed'] .pf-slideout__viewport--right .pf-slideout {
64
+ transform: translateX(100%);
65
+ }
66
+
67
+ .pf-slideout__portal[data-state='closed'] .pf-slideout__viewport--left .pf-slideout {
68
+ transform: translateX(-100%);
69
+ }
70
+
71
+ @media (prefers-reduced-motion: reduce) {
72
+ .pf-slideout,
73
+ .pf-slideout__overlay {
74
+ transition: none;
75
+ }
76
+ }
77
+
78
+ .pf-slideout--sm {
79
+ width: min(420px, 100vw);
80
+ }
81
+
82
+ .pf-slideout--md {
83
+ width: min(520px, 100vw);
84
+ }
85
+
86
+ .pf-slideout--lg {
87
+ width: min(680px, 100vw);
88
+ }
89
+
90
+ .pf-slideout__header,
91
+ .pf-slideout__footer {
92
+ align-items: start;
93
+ display: flex;
94
+ gap: var(--space-3);
95
+ justify-content: space-between;
96
+ padding: var(--space-3);
97
+ }
98
+
99
+ @media (min-width: 768px) {
100
+ .pf-slideout__header,
101
+ .pf-slideout__body,
102
+ .pf-slideout__footer {
103
+ padding: var(--space-4);
104
+ }
105
+ }
106
+
107
+ .pf-slideout__header {
108
+ border-bottom: 1px solid var(--pf-slideout-border);
109
+ }
110
+
111
+ .pf-slideout__footer {
112
+ border-top: 1px solid var(--pf-slideout-border);
113
+ justify-content: flex-end;
114
+ }
115
+
116
+ .pf-slideout__body {
117
+ overflow-y: auto;
118
+ padding: var(--space-3);
119
+ }
120
+
121
+ .pf-slideout__heading-group {
122
+ display: grid;
123
+ gap: var(--space-1);
124
+ min-width: 0;
125
+ }
126
+
127
+ .pf-slideout__title {
128
+ font-size: var(--font-size-lg);
129
+ font-weight: var(--font-weight-semibold);
130
+ line-height: 1.2;
131
+ margin: 0;
132
+ }
133
+
134
+ .pf-slideout__description {
135
+ color: var(--pf-slideout-text-muted);
136
+ font-size: var(--font-size-sm);
137
+ line-height: 1.45;
138
+ margin: 0;
139
+ }
140
+
141
+ .pf-slideout__close {
142
+ align-items: center;
143
+ background: transparent;
144
+ border: 0;
145
+ border-radius: var(--radius-sm);
146
+ color: var(--pf-slideout-text-muted);
147
+ cursor: pointer;
148
+ display: inline-flex;
149
+ flex: 0 0 auto;
150
+ font-size: var(--font-size-lg);
151
+ height: var(--space-8);
152
+ justify-content: center;
153
+ width: var(--space-8);
154
+ }
155
+
156
+ .pf-slideout__close:hover,
157
+ .pf-slideout__close:focus-visible {
158
+ background: var(--pf-slideout-bg-subtle);
159
+ color: var(--pf-slideout-text);
160
+ outline: none;
161
+ }
@@ -1,6 +1,6 @@
1
- import { cx } from "./index4.js";
2
- import { Icon } from "./index6.js";
3
- /* empty css */
1
+ import { cx } from "../../utils/cx.js";
2
+ import { Icon } from "../Icon/Icon2.js";
3
+ import './SlideoutMenu.css';/* empty css */
4
4
  import { useEffect, useId, useRef, useState } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { createPortal } from "react-dom";
@@ -0,0 +1,106 @@
1
+ .pf-field {
2
+ display: grid;
3
+ gap: var(--space-2);
4
+ }
5
+
6
+ .pf-field__label {
7
+ color: var(--pf-slider-text);
8
+ font-size: var(--font-size-sm);
9
+ font-weight: var(--font-weight-medium);
10
+ }
11
+
12
+ .pf-field__description {
13
+ color: var(--pf-slider-text-muted);
14
+ font-size: var(--font-size-sm);
15
+ margin: 0;
16
+ }
17
+
18
+ .pf-field__error {
19
+ color: var(--pf-slider-error-text);
20
+ font-size: var(--font-size-sm);
21
+ margin: 0;
22
+ }
23
+
24
+ .pf-slider__header {
25
+ align-items: center;
26
+ display: flex;
27
+ justify-content: space-between;
28
+ }
29
+
30
+ .pf-slider__value {
31
+ color: var(--pf-slider-text-muted);
32
+ font-size: var(--font-size-sm);
33
+ font-weight: var(--font-weight-medium);
34
+ }
35
+
36
+ .pf-slider {
37
+ appearance: none;
38
+ background: linear-gradient(
39
+ to right,
40
+ var(--pf-slider-action) 0,
41
+ var(--pf-slider-action) var(--pf-slider-progress, 0%),
42
+ var(--pf-slider-border) var(--pf-slider-progress, 0%),
43
+ var(--pf-slider-border) 100%
44
+ );
45
+ border-radius: var(--radius-full);
46
+ cursor: pointer;
47
+ height: var(--pf-slider-track-height);
48
+ width: 100%;
49
+ }
50
+
51
+ .pf-slider:focus {
52
+ outline: none;
53
+ }
54
+
55
+ .pf-slider:focus-visible {
56
+ box-shadow: var(--pf-slider-focus-ring, var(--pf-focus-ring));
57
+ }
58
+
59
+ .pf-slider::-webkit-slider-thumb {
60
+ appearance: none;
61
+ background: var(--pf-slider-bg);
62
+ border: 2px solid var(--pf-slider-action);
63
+ border-radius: 50%;
64
+ box-shadow: var(--pf-slider-control-thumb-outline-shadow, var(--pf-control-thumb-outline-shadow));
65
+ height: var(--pf-slider-thumb-size);
66
+ margin-top: calc((var(--pf-slider-track-height) - var(--pf-slider-thumb-size)) / 2);
67
+ width: var(--pf-slider-thumb-size);
68
+ }
69
+
70
+ .pf-slider::-moz-range-thumb {
71
+ background: var(--pf-slider-bg);
72
+ border: 2px solid var(--pf-slider-action);
73
+ border-radius: 50%;
74
+ box-shadow: var(--pf-slider-control-thumb-outline-shadow, var(--pf-control-thumb-outline-shadow));
75
+ height: var(--pf-slider-thumb-size);
76
+ width: var(--pf-slider-thumb-size);
77
+ }
78
+
79
+ .pf-slider::-moz-range-track {
80
+ background: transparent;
81
+ border-radius: var(--radius-full);
82
+ height: var(--pf-slider-track-height);
83
+ }
84
+
85
+ .pf-slider:disabled {
86
+ cursor: not-allowed;
87
+ opacity: 0.55;
88
+ }
89
+
90
+ .pf-slider--invalid {
91
+ background: linear-gradient(
92
+ to right,
93
+ var(--pf-slider-danger-fill) 0,
94
+ var(--pf-slider-danger-fill) var(--pf-slider-progress, 0%),
95
+ var(--pf-slider-border) var(--pf-slider-progress, 0%),
96
+ var(--pf-slider-border) 100%
97
+ );
98
+ }
99
+
100
+ .pf-slider--invalid::-webkit-slider-thumb {
101
+ border-color: var(--pf-slider-danger-fill);
102
+ }
103
+
104
+ .pf-slider--invalid::-moz-range-thumb {
105
+ border-color: var(--pf-slider-danger-fill);
106
+ }
@@ -1,5 +1,5 @@
1
- import { cx } from "./index4.js";
2
- /* empty css */
1
+ import { cx } from "../../utils/cx.js";
2
+ import './Slider.css';/* empty css */
3
3
  import { forwardRef, useId, useMemo, useState } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/components/Slider/Slider.tsx
@@ -0,0 +1,17 @@
1
+ .pf-sparkline {
2
+ display: block;
3
+ overflow: visible;
4
+ }
5
+
6
+ .pf-sparkline__line {
7
+ stroke: var(--pf-sparkline-color-override, var(--pf-sparkline-color));
8
+ }
9
+
10
+ .pf-sparkline__area {
11
+ fill: var(--pf-sparkline-color-override, var(--pf-sparkline-color));
12
+ opacity: var(--pf-sparkline-area-opacity, 0.15);
13
+ }
14
+
15
+ .pf-sparkline__dot {
16
+ fill: var(--pf-sparkline-color-override, var(--pf-sparkline-color));
17
+ }
@@ -0,0 +1,99 @@
1
+ import { cx } from "../../utils/cx.js";
2
+ import './Sparkline.css';/* empty css */
3
+ import { forwardRef, useMemo } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/components/Sparkline/Sparkline.tsx
6
+ function buildPath(points, close = false) {
7
+ if (points.length < 2) return "";
8
+ const [first, ...rest] = points;
9
+ const d = [`M ${first[0]} ${first[1]}`];
10
+ for (const [x, y] of rest) d.push(`L ${x} ${y}`);
11
+ if (close) {
12
+ const lastX = points[points.length - 1][0];
13
+ points[points.length - 1][1];
14
+ d.push(`L ${lastX} ${close}`);
15
+ d.push(`L ${first[0]} ${close}`);
16
+ d.push("Z");
17
+ }
18
+ return d.join(" ");
19
+ }
20
+ function normalizePoints(data, width, height, padding) {
21
+ if (data.length === 0) return [];
22
+ const min = Math.min(...data);
23
+ const range = Math.max(...data) - min || 1;
24
+ const innerW = width - padding * 2;
25
+ const innerH = height - padding * 2;
26
+ return data.map((value, i) => {
27
+ return [padding + i / (data.length - 1) * innerW, padding + (1 - (value - min) / range) * innerH];
28
+ });
29
+ }
30
+ var Sparkline = forwardRef(function Sparkline({ className, data = [], width = 120, height = 36, variant = "line", strokeWidth = 1.5, color, endDot = false, label, style, ...props }, ref) {
31
+ const padding = strokeWidth + 2;
32
+ const points = useMemo(() => normalizePoints(data, width, height, padding), [
33
+ data,
34
+ width,
35
+ height,
36
+ padding
37
+ ]);
38
+ const linePath = useMemo(() => buildPath(points), [points]);
39
+ const areaPath = useMemo(() => {
40
+ if (variant !== "area" || points.length < 2) return "";
41
+ const [first, ...rest] = points;
42
+ const d = [`M ${first[0]} ${first[1]}`];
43
+ for (const [x, y] of rest) d.push(`L ${x} ${y}`);
44
+ const lastX = points[points.length - 1][0];
45
+ const bottom = height - padding + strokeWidth;
46
+ d.push(`L ${lastX} ${bottom}`);
47
+ d.push(`L ${first[0]} ${bottom}`);
48
+ d.push("Z");
49
+ return d.join(" ");
50
+ }, [
51
+ points,
52
+ variant,
53
+ height,
54
+ padding,
55
+ strokeWidth
56
+ ]);
57
+ const lastPoint = points[points.length - 1];
58
+ const colorVar = color ?? "var(--pf-sparkline-color)";
59
+ return /* @__PURE__ */ jsxs("svg", {
60
+ ref,
61
+ width,
62
+ height,
63
+ viewBox: `0 0 ${width} ${height}`,
64
+ className: cx("pf-sparkline", `pf-sparkline--${variant}`, className),
65
+ "aria-label": label,
66
+ role: label ? "img" : "presentation",
67
+ style: {
68
+ "--pf-sparkline-color-override": color,
69
+ ...style
70
+ },
71
+ ...props,
72
+ children: [
73
+ variant === "area" && areaPath && /* @__PURE__ */ jsx("path", {
74
+ d: areaPath,
75
+ fill: colorVar,
76
+ className: "pf-sparkline__area"
77
+ }),
78
+ linePath && /* @__PURE__ */ jsx("path", {
79
+ d: linePath,
80
+ fill: "none",
81
+ stroke: colorVar,
82
+ strokeWidth,
83
+ strokeLinecap: "round",
84
+ strokeLinejoin: "round",
85
+ className: "pf-sparkline__line"
86
+ }),
87
+ endDot && lastPoint && /* @__PURE__ */ jsx("circle", {
88
+ cx: lastPoint[0],
89
+ cy: lastPoint[1],
90
+ r: strokeWidth + 1.5,
91
+ fill: colorVar,
92
+ className: "pf-sparkline__dot"
93
+ })
94
+ ]
95
+ });
96
+ });
97
+ Sparkline.displayName = "Sparkline";
98
+ //#endregion
99
+ export { Sparkline };
@@ -0,0 +1,59 @@
1
+ .pf-switch-field {
2
+ align-items: center;
3
+ display: inline-flex;
4
+ gap: var(--space-2);
5
+ }
6
+
7
+ .pf-switch {
8
+ appearance: none;
9
+ background: var(--pf-switch-track-bg);
10
+ border-radius: var(--radius-full);
11
+ cursor: pointer;
12
+ height: 24px;
13
+ margin: 0;
14
+ position: relative;
15
+ transition: background-color 120ms ease;
16
+ width: 44px;
17
+ }
18
+
19
+ .pf-switch::after {
20
+ background: var(--pf-switch-thumb-bg);
21
+ border-radius: 50%;
22
+ content: '';
23
+ height: 20px;
24
+ left: 2px;
25
+ position: absolute;
26
+ top: 2px;
27
+ transition: transform 120ms ease;
28
+ width: 20px;
29
+ }
30
+
31
+ .pf-switch:checked {
32
+ background: var(--pf-switch-track-checked-bg);
33
+ }
34
+
35
+ .pf-switch:checked::after {
36
+ transform: translateX(20px);
37
+ }
38
+
39
+ .pf-switch:focus-visible {
40
+ box-shadow: var(--pf-switch-focus-ring, var(--pf-focus-ring));
41
+ outline: none;
42
+ }
43
+
44
+ .pf-switch:disabled {
45
+ cursor: not-allowed;
46
+ opacity: 0.55;
47
+ }
48
+
49
+ .pf-switch-field label {
50
+ color: var(--pf-switch-label-text);
51
+ font-size: var(--font-size-md);
52
+ }
53
+
54
+ @media (prefers-reduced-motion: reduce) {
55
+ .pf-switch,
56
+ .pf-switch::after {
57
+ transition: none;
58
+ }
59
+ }
@@ -1,5 +1,5 @@
1
- import { cx } from "./index4.js";
2
- /* empty css */
1
+ import { cx } from "../../utils/cx.js";
2
+ import './Switch.css';/* empty css */
3
3
  import { forwardRef, useId } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/components/Switch/Switch.tsx