@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.
Files changed (154) hide show
  1. package/README.md +20 -5
  2. package/dist/components/Accordion/Accordion.css +85 -0
  3. package/dist/components/Accordion/Accordion2.js +96 -0
  4. package/dist/components/Alert/Alert.css +111 -0
  5. package/dist/{index8.js → components/Alert/Alert2.js} +7 -5
  6. package/dist/components/Avatar/Avatar.css +97 -0
  7. package/dist/{index10.js → components/Avatar/Avatar2.js} +2 -2
  8. package/dist/components/Badge/Badge.css +26 -0
  9. package/dist/{index23.js → components/Badge/Badge2.js} +2 -2
  10. package/dist/components/BadgeGroup/BadgeGroup.css +115 -0
  11. package/dist/{index14.js → components/BadgeGroup/BadgeGroup2.js} +2 -2
  12. package/dist/components/Breadcrumbs/Breadcrumbs.css +45 -0
  13. package/dist/{index18.js → components/Breadcrumbs/Breadcrumbs2.js} +2 -2
  14. package/dist/components/Button/Button.css +93 -0
  15. package/dist/{index12.js → components/Button/Button2.js} +2 -2
  16. package/dist/components/ButtonGroup/ButtonGroup.css +107 -0
  17. package/dist/{index16.js → components/ButtonGroup/ButtonGroup2.js} +2 -2
  18. package/dist/components/Calendar/Calendar.css +144 -0
  19. package/dist/{index40.js → components/Calendar/Calendar2.js} +4 -4
  20. package/dist/components/Card/Card.css +23 -0
  21. package/dist/{index25.js → components/Card/Card2.js} +2 -2
  22. package/dist/components/Carousel/Carousel.css +124 -0
  23. package/dist/components/Carousel/Carousel2.js +147 -0
  24. package/dist/components/Checkbox/Checkbox.css +62 -0
  25. package/dist/{index29.js → components/Checkbox/Checkbox2.js} +2 -2
  26. package/dist/components/CodeSnippet/CodeSnippet.css +155 -0
  27. package/dist/{index46.js → components/CodeSnippet/CodeSnippet2.js} +6 -6
  28. package/dist/components/ContentDivider/ContentDivider.css +38 -0
  29. package/dist/{index48.js → components/ContentDivider/ContentDivider2.js} +2 -2
  30. package/dist/components/CreditCard/CreditCard.css +139 -0
  31. package/dist/{index27.js → components/CreditCard/CreditCard2.js} +2 -2
  32. package/dist/components/DatePicker/DatePicker.css +91 -0
  33. package/dist/{index50.js → components/DatePicker/DatePicker2.js} +9 -9
  34. package/dist/components/Dropdown/Dropdown.css +149 -0
  35. package/dist/{index38.js → components/Dropdown/Dropdown2.js} +8 -9
  36. package/dist/components/EmptyState/EmptyState.css +72 -0
  37. package/dist/{index52.js → components/EmptyState/EmptyState2.js} +3 -3
  38. package/dist/components/FileUploader/FileUploader.css +135 -0
  39. package/dist/{index54.js → components/FileUploader/FileUploader2.js} +4 -4
  40. package/dist/components/GaugeChart/GaugeChart.css +63 -0
  41. package/dist/components/GaugeChart/GaugeChart2.js +74 -0
  42. package/dist/components/HeaderNavigation/HeaderNavigation.css +87 -0
  43. package/dist/{index56.js → components/HeaderNavigation/HeaderNavigation2.js} +2 -2
  44. package/dist/components/Heatmap/Heatmap.css +100 -0
  45. package/dist/components/Heatmap/Heatmap2.js +160 -0
  46. package/dist/components/Icon/Icon.css +6 -0
  47. package/dist/{index6.js → components/Icon/Icon2.js} +2 -2
  48. package/dist/components/InlineCTA/InlineCTA.css +144 -0
  49. package/dist/{index58.js → components/InlineCTA/InlineCTA2.js} +17 -5
  50. package/dist/components/Input/Input.css +75 -0
  51. package/dist/{index21.js → components/Input/Input2.js} +3 -3
  52. package/dist/components/LineBarCharts/LineBarChart.css +122 -0
  53. package/dist/{index60.js → components/LineBarCharts/LineBarChart2.js} +11 -3
  54. package/dist/components/LoadingIndicators/LoadingIndicators.css +107 -0
  55. package/dist/{index62.js → components/LoadingIndicators/LoadingIndicators2.js} +2 -2
  56. package/dist/components/Metrics/Metrics.css +106 -0
  57. package/dist/{index64.js → components/Metrics/Metrics2.js} +3 -3
  58. package/dist/components/Modal/Modal.css +198 -0
  59. package/dist/{index66.js → components/Modal/Modal2.js} +11 -9
  60. package/dist/components/MultiSelect/MultiSelect.css +174 -0
  61. package/dist/{index68.js → components/MultiSelect/MultiSelect2.js} +11 -12
  62. package/dist/components/Notification/Notification.css +242 -0
  63. package/dist/{index70.js → components/Notification/Notification2.js} +7 -5
  64. package/dist/components/PageHeader/PageHeader.css +85 -0
  65. package/dist/{index72.js → components/PageHeader/PageHeader2.js} +3 -3
  66. package/dist/components/Pagination/Pagination.css +101 -0
  67. package/dist/{index74.js → components/Pagination/Pagination2.js} +2 -2
  68. package/dist/components/PieChart/PieChart.css +115 -0
  69. package/dist/{index76.js → components/PieChart/PieChart2.js} +3 -3
  70. package/dist/components/ProgressIndicators/ProgressIndicators.css +95 -0
  71. package/dist/{index78.js → components/ProgressIndicators/ProgressIndicators2.js} +6 -3
  72. package/dist/components/ProgressSteps/ProgressSteps.css +175 -0
  73. package/dist/{index80.js → components/ProgressSteps/ProgressSteps2.js} +2 -2
  74. package/dist/components/RadarChart/RadarChart.css +119 -0
  75. package/dist/{index82.js → components/RadarChart/RadarChart2.js} +21 -15
  76. package/dist/components/RadioButton/RadioButton.css +21 -0
  77. package/dist/{index84.js → components/RadioButton/RadioButton2.js} +2 -2
  78. package/dist/components/RadioGroup/RadioGroup.css +64 -0
  79. package/dist/{index86.js → components/RadioGroup/RadioGroup2.js} +2 -2
  80. package/dist/components/Rating/Rating.css +91 -0
  81. package/dist/{index88.js → components/Rating/Rating2.js} +3 -3
  82. package/dist/components/RichTextEditor/RichTextEditor.css +94 -0
  83. package/dist/{index90.js → components/RichTextEditor/RichTextEditor2.js} +4 -4
  84. package/dist/components/SectionFooter/SectionFooter.css +59 -0
  85. package/dist/{index92.js → components/SectionFooter/SectionFooter2.js} +2 -2
  86. package/dist/components/SectionHeader/SectionHeader.css +78 -0
  87. package/dist/{index94.js → components/SectionHeader/SectionHeader2.js} +2 -2
  88. package/dist/components/Select/Select.css +156 -0
  89. package/dist/{index102.js → components/Select/Select2.js} +11 -12
  90. package/dist/components/SidebarNavigation/SidebarNavigation.css +116 -0
  91. package/dist/{index96.js → components/SidebarNavigation/SidebarNavigation2.js} +2 -2
  92. package/dist/components/SlideoutMenu/SlideoutMenu.css +161 -0
  93. package/dist/{index98.js → components/SlideoutMenu/SlideoutMenu2.js} +3 -3
  94. package/dist/components/Slider/Slider.css +106 -0
  95. package/dist/{index104.js → components/Slider/Slider2.js} +2 -2
  96. package/dist/components/Sparkline/Sparkline.css +65 -0
  97. package/dist/components/Sparkline/Sparkline2.js +100 -0
  98. package/dist/components/Switch/Switch.css +59 -0
  99. package/dist/{index100.js → components/Switch/Switch2.js} +2 -2
  100. package/dist/components/Table/Table.css +126 -0
  101. package/dist/{index108.js → components/Table/Table2.js} +2 -2
  102. package/dist/components/Tabs/Tabs.css +138 -0
  103. package/dist/{index110.js → components/Tabs/Tabs2.js} +53 -6
  104. package/dist/components/Tag/Tag.css +64 -0
  105. package/dist/{index106.js → components/Tag/Tag2.js} +3 -3
  106. package/dist/components/Textarea/Textarea.css +52 -0
  107. package/dist/{index112.js → components/Textarea/Textarea2.js} +3 -3
  108. package/dist/components/Tooltip/Tooltip.css +61 -0
  109. package/dist/{index114.js → components/Tooltip/Tooltip2.js} +6 -6
  110. package/dist/components/TreeView/TreeView.css +109 -0
  111. package/dist/{index116.js → components/TreeView/TreeView2.js} +2 -2
  112. package/dist/components/UtilityButton/UtilityButton.css +90 -0
  113. package/dist/{index118.js → components/UtilityButton/UtilityButton2.js} +2 -2
  114. package/dist/components/VideoPlayer/VideoPlayer.css +41 -0
  115. package/dist/{index120.js → components/VideoPlayer/VideoPlayer2.js} +2 -2
  116. package/dist/{index33.js → hooks/useDisclosure.js} +1 -1
  117. package/dist/hooks/useExitAnimation.js +25 -0
  118. package/dist/{index34.js → hooks/useFocusTrap.js} +1 -1
  119. package/dist/hooks/usePresence.js +31 -0
  120. package/dist/index.cjs +1030 -4720
  121. package/dist/index.js +69 -63
  122. package/dist/src/components/Accordion/Accordion.d.ts +20 -0
  123. package/dist/src/components/Accordion/Accordion.test.d.ts +1 -0
  124. package/dist/src/components/Accordion/index.d.ts +1 -0
  125. package/dist/src/components/GaugeChart/GaugeChart.d.ts +17 -0
  126. package/dist/src/components/GaugeChart/GaugeChart.test.d.ts +1 -0
  127. package/dist/src/components/GaugeChart/index.d.ts +1 -0
  128. package/dist/src/components/Heatmap/Heatmap.d.ts +28 -0
  129. package/dist/src/components/Heatmap/Heatmap.test.d.ts +1 -0
  130. package/dist/src/components/Heatmap/index.d.ts +1 -0
  131. package/dist/src/components/InlineCTA/InlineCTA.d.ts +2 -0
  132. package/dist/src/components/LineBarCharts/LineBarChart.d.ts +2 -0
  133. package/dist/src/components/Sparkline/Sparkline.d.ts +17 -0
  134. package/dist/src/components/Sparkline/Sparkline.test.d.ts +1 -0
  135. package/dist/src/components/Sparkline/index.d.ts +1 -0
  136. package/dist/src/hooks/index.d.ts +2 -0
  137. package/dist/src/hooks/useExitAnimation.d.ts +18 -0
  138. package/dist/src/hooks/usePresence.d.ts +13 -0
  139. package/dist/src/index.d.ts +4 -0
  140. package/dist/styles/theme.css +813 -0
  141. package/dist/styles.css +881 -68
  142. package/dist/{index19.js → utils/FieldWrapper.js} +1 -1
  143. package/package.json +8 -4
  144. package/theme.starter.css +58 -0
  145. package/dist/index42.js +0 -134
  146. package/dist/index43.js +0 -16
  147. package/dist/index44.js +0 -4232
  148. /package/dist/{index3.js → a11y/index.js} +0 -0
  149. /package/dist/{index30.js → hooks/useAnchoredPosition.js} +0 -0
  150. /package/dist/{index31.js → hooks/useComposedRefs.js} +0 -0
  151. /package/dist/{index32.js → hooks/useControllableState.js} +0 -0
  152. /package/dist/{index35.js → hooks/useListNavigation.js} +0 -0
  153. /package/dist/{index36.js → hooks/useOutsideInteraction.js} +0 -0
  154. /package/dist/{index4.js → utils/cx.js} +0 -0
@@ -0,0 +1,93 @@
1
+ .pf-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-semibold);
9
+ gap: var(--space-2);
10
+ justify-content: center;
11
+ line-height: 1;
12
+ min-height: 40px;
13
+ text-decoration: none;
14
+ transition:
15
+ background-color var(--pf-transition-fast),
16
+ border-color var(--pf-transition-fast),
17
+ color var(--pf-transition-fast),
18
+ box-shadow var(--pf-transition-fast);
19
+ }
20
+
21
+ .pf-button:focus-visible {
22
+ box-shadow: var(--pf-button-focus-ring, var(--pf-focus-ring));
23
+ outline: none;
24
+ }
25
+
26
+ .pf-button:disabled {
27
+ cursor: not-allowed;
28
+ opacity: 0.55;
29
+ }
30
+
31
+ .pf-button--sm {
32
+ font-size: var(--font-size-sm);
33
+ min-height: 36px;
34
+ padding: 0 var(--space-3);
35
+ }
36
+ .pf-button--md {
37
+ font-size: var(--font-size-md);
38
+ min-height: 40px;
39
+ padding: 0 var(--space-4);
40
+ }
41
+ .pf-button--lg {
42
+ font-size: var(--font-size-lg);
43
+ min-height: 48px;
44
+ padding: 0 var(--space-5);
45
+ }
46
+ .pf-button--full {
47
+ width: 100%;
48
+ }
49
+
50
+ .pf-button--primary {
51
+ background: var(--pf-button-primary-bg);
52
+ color: var(--pf-button-primary-text);
53
+ }
54
+ .pf-button--primary:hover:not(:disabled) {
55
+ background: var(--pf-button-primary-bg-hover);
56
+ }
57
+ .pf-button--secondary {
58
+ background: var(--pf-button-secondary-bg);
59
+ border-color: var(--pf-button-secondary-border);
60
+ color: var(--pf-button-secondary-text);
61
+ }
62
+ .pf-button--secondary:hover:not(:disabled) {
63
+ background: var(--pf-button-secondary-bg-hover);
64
+ border-color: var(--pf-button-secondary-border-hover);
65
+ }
66
+ .pf-button--ghost {
67
+ background: transparent;
68
+ color: var(--pf-button-ghost-text);
69
+ }
70
+ .pf-button--ghost:hover:not(:disabled) {
71
+ background: var(--pf-button-ghost-bg-hover);
72
+ }
73
+
74
+ .pf-button--loading:disabled {
75
+ cursor: wait;
76
+ opacity: 1;
77
+ }
78
+
79
+ .pf-button__spinner {
80
+ animation: pf-spin 0.65s linear infinite;
81
+ flex-shrink: 0;
82
+ }
83
+
84
+ @media (prefers-reduced-motion: reduce) {
85
+ .pf-button {
86
+ transition: none;
87
+ }
88
+
89
+ .pf-button__spinner {
90
+ animation-duration: 0.01ms;
91
+ animation-iteration-count: 1;
92
+ }
93
+ }
@@ -1,5 +1,5 @@
1
- import { cx } from "./index4.js";
2
- /* empty css */
1
+ import { cx } from "../../utils/cx.js";
2
+ import './Button.css';/* empty css */
3
3
  import { forwardRef } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/components/Button/Button.tsx
@@ -0,0 +1,107 @@
1
+ .pf-button-group {
2
+ display: inline-flex;
3
+ flex-wrap: wrap;
4
+ align-items: stretch;
5
+ }
6
+
7
+ .pf-button-group__button {
8
+ align-items: center;
9
+ background: var(--pf-buttongroup-bg);
10
+ border: 1px solid var(--pf-buttongroup-border);
11
+ color: var(--pf-buttongroup-text);
12
+ cursor: pointer;
13
+ display: inline-flex;
14
+ gap: var(--space-2);
15
+ justify-content: center;
16
+ line-height: 1;
17
+ margin-inline-start: -1px;
18
+ min-height: 40px;
19
+ padding: 0 var(--space-4);
20
+ position: relative;
21
+ transition:
22
+ background-color 120ms ease,
23
+ border-color 120ms ease,
24
+ color 120ms ease,
25
+ box-shadow 120ms ease;
26
+ }
27
+
28
+ .pf-button-group__button:first-child {
29
+ border-bottom-left-radius: var(--radius-md);
30
+ border-top-left-radius: var(--radius-md);
31
+ margin-inline-start: 0;
32
+ }
33
+
34
+ .pf-button-group__button:last-child {
35
+ border-bottom-right-radius: var(--radius-md);
36
+ border-top-right-radius: var(--radius-md);
37
+ }
38
+
39
+ .pf-button-group__button:focus-visible {
40
+ box-shadow: var(--pf-buttongroup-focus-ring, var(--pf-focus-ring));
41
+ outline: none;
42
+ z-index: 2;
43
+ }
44
+
45
+ .pf-button-group__button:hover:not(:disabled):not(.pf-button-group__button--selected) {
46
+ background: var(--pf-buttongroup-bg-subtle);
47
+ }
48
+
49
+ .pf-button-group__button--selected {
50
+ background: var(--pf-buttongroup-action-primary);
51
+ border-color: var(--pf-buttongroup-action-primary);
52
+ color: var(--pf-buttongroup-action-primary-text);
53
+ z-index: 1;
54
+ }
55
+
56
+ .pf-button-group__button--selected:hover:not(:disabled) {
57
+ background: var(--pf-buttongroup-action-primary-hover);
58
+ border-color: var(--pf-buttongroup-action-primary-hover);
59
+ }
60
+
61
+ .pf-button-group__button:disabled {
62
+ cursor: not-allowed;
63
+ opacity: 0.55;
64
+ }
65
+
66
+ .pf-button-group__button:disabled:hover {
67
+ background: var(--pf-buttongroup-bg);
68
+ }
69
+
70
+ .pf-button-group__button--selected:disabled:hover {
71
+ background: var(--pf-buttongroup-action-primary);
72
+ border-color: var(--pf-buttongroup-action-primary);
73
+ }
74
+
75
+ .pf-button-group__icon {
76
+ display: inline-flex;
77
+ flex-shrink: 0;
78
+ }
79
+
80
+ .pf-button-group__icon svg {
81
+ display: block;
82
+ height: 16px;
83
+ width: 16px;
84
+ }
85
+
86
+ .pf-button-group__dot {
87
+ background: var(--pf-buttongroup-action-primary);
88
+ border-radius: 999px;
89
+ flex-shrink: 0;
90
+ height: 8px;
91
+ width: 8px;
92
+ }
93
+
94
+ .pf-button-group__button--selected .pf-button-group__dot {
95
+ background: var(--pf-buttongroup-dot-selected);
96
+ }
97
+
98
+ .pf-button-group__label {
99
+ font: inherit;
100
+ font-weight: var(--font-weight-semibold);
101
+ }
102
+
103
+ @media (prefers-reduced-motion: reduce) {
104
+ .pf-button-group__button {
105
+ transition: none;
106
+ }
107
+ }
@@ -1,5 +1,5 @@
1
- import { cx } from "./index4.js";
2
- /* empty css */
1
+ import { cx } from "../../utils/cx.js";
2
+ import './ButtonGroup.css';/* empty css */
3
3
  import { forwardRef, useMemo, useState } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/components/ButtonGroup/ButtonGroup.tsx
@@ -0,0 +1,144 @@
1
+ .pf-calendar {
2
+ background: var(--pf-calendar-bg);
3
+ border: 1px solid var(--pf-calendar-border);
4
+ color: var(--pf-calendar-text);
5
+ display: grid;
6
+ gap: var(--space-2);
7
+ max-width: 320px;
8
+ padding: var(--space-3);
9
+ }
10
+
11
+ .pf-calendar--invalid {
12
+ border-color: var(--pf-calendar-invalid-border);
13
+ }
14
+
15
+ .pf-calendar__header {
16
+ align-items: center;
17
+ display: grid;
18
+ gap: var(--space-2);
19
+ grid-template-columns: 28px 1fr 28px;
20
+ }
21
+
22
+ .pf-calendar__month-controls {
23
+ align-items: center;
24
+ display: grid;
25
+ gap: var(--space-1);
26
+ grid-template-columns: minmax(0, 1fr) auto;
27
+ }
28
+
29
+ .pf-calendar__control-label {
30
+ border: 0;
31
+ clip: rect(0 0 0 0);
32
+ height: 1px;
33
+ margin: -1px;
34
+ overflow: hidden;
35
+ padding: 0;
36
+ position: absolute;
37
+ white-space: nowrap;
38
+ width: 1px;
39
+ }
40
+
41
+ .pf-calendar__control {
42
+ appearance: none;
43
+ background: var(--pf-calendar-bg);
44
+ border: 1px solid var(--pf-calendar-border);
45
+ border-radius: var(--radius-sm);
46
+ color: var(--pf-calendar-text);
47
+ font-size: var(--font-size-xs);
48
+ font-weight: var(--font-weight-medium);
49
+ height: 28px;
50
+ min-width: 0;
51
+ padding: 0 var(--space-2);
52
+ }
53
+
54
+ .pf-calendar__control:focus-visible {
55
+ box-shadow: var(--pf-calendar-focus-ring, var(--pf-focus-ring));
56
+ outline: none;
57
+ }
58
+
59
+ .pf-calendar__nav {
60
+ align-items: center;
61
+ background: transparent;
62
+ border: 0;
63
+ border-radius: var(--radius-sm);
64
+ color: var(--pf-calendar-text-muted);
65
+ cursor: pointer;
66
+ display: inline-flex;
67
+ font-size: var(--font-size-sm);
68
+ height: 28px;
69
+ justify-content: center;
70
+ padding: 0;
71
+ width: 28px;
72
+ }
73
+
74
+ .pf-calendar__nav:hover {
75
+ background: var(--pf-calendar-bg-subtle);
76
+ color: var(--pf-calendar-text);
77
+ }
78
+
79
+ .pf-calendar__nav:focus-visible {
80
+ box-shadow: var(--pf-calendar-focus-ring, var(--pf-focus-ring));
81
+ outline: none;
82
+ }
83
+
84
+ .pf-calendar__weekday {
85
+ color: var(--pf-calendar-text-muted);
86
+ font-size: var(--font-size-xs);
87
+ font-weight: var(--font-weight-medium);
88
+ text-align: center;
89
+ }
90
+
91
+ .pf-calendar__grid {
92
+ display: grid;
93
+ gap: var(--space-1);
94
+ grid-template-columns: repeat(7, minmax(0, 1fr));
95
+ }
96
+
97
+ .pf-calendar__day,
98
+ .pf-calendar__day-empty {
99
+ align-items: center;
100
+ aspect-ratio: 1 / 1;
101
+ border-radius: var(--radius-sm);
102
+ display: inline-flex;
103
+ font-size: var(--font-size-xs);
104
+ justify-content: center;
105
+ }
106
+
107
+ .pf-calendar__day {
108
+ background: transparent;
109
+ border: 0;
110
+ color: var(--pf-calendar-text);
111
+ cursor: pointer;
112
+ }
113
+
114
+ .pf-calendar__day:hover:not(:disabled) {
115
+ background: var(--pf-calendar-bg-subtle);
116
+ }
117
+
118
+ .pf-calendar__day--outside {
119
+ color: var(--pf-calendar-text-muted);
120
+ opacity: 0.55;
121
+ }
122
+
123
+ .pf-calendar__day--today {
124
+ background: var(--pf-calendar-today-bg);
125
+ border: 1.5px solid var(--pf-calendar-today-border);
126
+ box-shadow: none;
127
+ }
128
+
129
+ .pf-calendar__day--selected {
130
+ background: var(--pf-calendar-selected-bg);
131
+ color: var(--pf-calendar-selected-text);
132
+ font-weight: var(--font-weight-semibold);
133
+ }
134
+
135
+ .pf-calendar__day--selected:hover:not(:disabled) {
136
+ background: var(--pf-calendar-selected-bg-hover);
137
+ color: var(--pf-calendar-selected-text);
138
+ }
139
+
140
+ .pf-calendar__day:disabled {
141
+ color: var(--pf-calendar-text-muted);
142
+ cursor: not-allowed;
143
+ opacity: 0.45;
144
+ }
@@ -1,7 +1,7 @@
1
- import { cx } from "./index4.js";
2
- import { Icon } from "./index6.js";
3
- import { Dropdown } from "./index38.js";
4
- /* empty css */
1
+ import { cx } from "../../utils/cx.js";
2
+ import { Icon } from "../Icon/Icon2.js";
3
+ import { Dropdown } from "../Dropdown/Dropdown2.js";
4
+ import './Calendar.css';/* empty css */
5
5
  import { forwardRef, useEffect, useId, useMemo, useState } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/components/Calendar/Calendar.tsx
@@ -0,0 +1,23 @@
1
+ .pf-card {
2
+ background: var(--pf-card-background);
3
+ border: 1px solid var(--pf-card-border);
4
+ border-radius: var(--pf-card-radius, var(--radius-lg));
5
+ box-shadow: var(--pf-card-shadow, var(--shadow-sm));
6
+ overflow: hidden;
7
+ }
8
+
9
+ .pf-card__header,
10
+ .pf-card__content,
11
+ .pf-card__footer {
12
+ padding: var(--pf-card-section-padding, var(--space-4));
13
+ }
14
+
15
+ .pf-card__header {
16
+ border-bottom: 1px solid var(--pf-card-border);
17
+ }
18
+
19
+ .pf-card__footer {
20
+ display: flex;
21
+ gap: var(--pf-card-footer-gap);
22
+ border-top: 1px solid var(--pf-card-border);
23
+ }
@@ -1,5 +1,5 @@
1
- import { cx } from "./index4.js";
2
- /* empty css */
1
+ import { cx } from "../../utils/cx.js";
2
+ import './Card.css';/* empty css */
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  //#region src/components/Card/Card.tsx
5
5
  function Card({ className, ref, ...props }) {
@@ -0,0 +1,124 @@
1
+ .pf-carousel {
2
+ background: var(--pf-carousel-bg);
3
+ border: 1px solid var(--pf-carousel-border);
4
+ border-radius: var(--pf-carousel-radius, var(--radius-md));
5
+ display: grid;
6
+ gap: var(--pf-carousel-gap, var(--space-3));
7
+ overflow: hidden;
8
+ padding: var(--pf-carousel-padding, var(--space-3));
9
+ width: 100%;
10
+ }
11
+
12
+ .pf-carousel__viewport {
13
+ background: var(--pf-carousel-viewport-bg);
14
+ border-radius: var(--pf-carousel-viewport-radius, var(--radius-sm));
15
+ overflow: hidden;
16
+ width: 100%;
17
+ }
18
+
19
+ .pf-carousel__track {
20
+ display: flex;
21
+ transition: transform var(--pf-carousel-transition-duration, var(--duration-moderate))
22
+ var(--easing-decelerate);
23
+ width: 100%;
24
+ }
25
+
26
+ .pf-carousel__slide {
27
+ background: var(--pf-carousel-slide-background, transparent);
28
+ color: var(--pf-carousel-slide-text);
29
+ flex: 0 0 100%;
30
+ min-width: 0;
31
+ padding: var(--pf-carousel-slide-padding, 0);
32
+ }
33
+
34
+ .pf-carousel__empty {
35
+ align-items: center;
36
+ color: var(--pf-carousel-empty-text);
37
+ display: flex;
38
+ font-size: var(--pf-carousel-empty-font-size, var(--font-size-sm));
39
+ justify-content: center;
40
+ min-height: var(--pf-carousel-empty-min-height, 180px);
41
+ padding: var(--pf-carousel-empty-padding, var(--space-4));
42
+ text-align: center;
43
+ }
44
+
45
+ .pf-carousel__controls {
46
+ align-items: center;
47
+ display: grid;
48
+ gap: var(--pf-carousel-controls-gap, var(--space-2));
49
+ grid-template-columns:
50
+ var(--pf-carousel-nav-size, 28px) 1fr
51
+ var(--pf-carousel-nav-size, 28px);
52
+ }
53
+
54
+ .pf-carousel__nav {
55
+ align-items: center;
56
+ background: transparent;
57
+ border: 0;
58
+ border-radius: var(--pf-carousel-nav-radius, var(--radius-sm));
59
+ color: var(--pf-carousel-nav-text);
60
+ cursor: pointer;
61
+ display: inline-flex;
62
+ font-size: var(--pf-carousel-nav-font-size, var(--font-size-sm));
63
+ height: var(--pf-carousel-nav-size, 28px);
64
+ justify-content: center;
65
+ padding: 0;
66
+ width: var(--pf-carousel-nav-size, 28px);
67
+ }
68
+
69
+ .pf-carousel__nav:hover:not(:disabled) {
70
+ background: var(--pf-carousel-nav-hover-bg);
71
+ color: var(--pf-carousel-nav-hover-text);
72
+ }
73
+
74
+ .pf-carousel__nav:focus-visible {
75
+ box-shadow: var(--pf-carousel-focus-ring, var(--pf-focus-ring));
76
+ outline: none;
77
+ }
78
+
79
+ .pf-carousel__nav:disabled {
80
+ color: var(--pf-carousel-nav-text);
81
+ cursor: not-allowed;
82
+ opacity: var(--pf-carousel-disabled-opacity, 0.45);
83
+ }
84
+
85
+ .pf-carousel__indicators {
86
+ align-items: center;
87
+ display: inline-flex;
88
+ gap: var(--pf-carousel-indicator-gap, var(--space-1));
89
+ justify-content: center;
90
+ }
91
+
92
+ .pf-carousel__indicator {
93
+ background: var(--pf-carousel-indicator-bg);
94
+ border: 0;
95
+ border-radius: var(--pf-carousel-indicator-radius, 999px);
96
+ cursor: pointer;
97
+ height: var(--pf-carousel-indicator-size, 8px);
98
+ padding: 0;
99
+ transition: all var(--pf-carousel-indicator-transition-duration, var(--duration-fast))
100
+ var(--easing-decelerate);
101
+ width: var(--pf-carousel-indicator-size, 8px);
102
+ }
103
+
104
+ .pf-carousel__indicator--active {
105
+ background: var(--pf-carousel-indicator-active-bg);
106
+ width: var(--pf-carousel-indicator-active-width, 20px);
107
+ }
108
+
109
+ .pf-carousel__indicator:focus-visible {
110
+ box-shadow: var(--pf-carousel-focus-ring, var(--pf-focus-ring));
111
+ outline: none;
112
+ }
113
+
114
+ .pf-carousel__indicator-spacer {
115
+ display: block;
116
+ min-height: var(--pf-carousel-indicator-size, 8px);
117
+ }
118
+
119
+ @media (prefers-reduced-motion: reduce) {
120
+ .pf-carousel__track,
121
+ .pf-carousel__indicator {
122
+ transition: none;
123
+ }
124
+ }
@@ -0,0 +1,147 @@
1
+ import { cx } from "../../utils/cx.js";
2
+ import { Icon } from "../Icon/Icon2.js";
3
+ import './Carousel.css';/* empty css */
4
+ import { forwardRef, useEffect, useMemo, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/Carousel/Carousel.tsx
7
+ var clamp = (value, min, max) => {
8
+ return Math.min(Math.max(value, min), max);
9
+ };
10
+ var Carousel = forwardRef(function Carousel({ className, slides, initialIndex = 0, loop = true, showIndicators = true, autoPlay = false, autoPlayInterval = 5e3, onIndexChange, "aria-label": ariaLabel = "Carousel", ...props }, ref) {
11
+ const totalSlides = slides.length;
12
+ const [activeIndex, setActiveIndex] = useState(clamp(initialIndex, 0, Math.max(totalSlides - 1, 0)));
13
+ const resolvedActiveIndex = clamp(activeIndex, 0, Math.max(totalSlides - 1, 0));
14
+ const goToIndex = (nextIndex) => {
15
+ if (totalSlides === 0) return;
16
+ const resolvedIndex = loop ? (nextIndex % totalSlides + totalSlides) % totalSlides : clamp(nextIndex, 0, totalSlides - 1);
17
+ setActiveIndex(resolvedIndex);
18
+ onIndexChange?.(resolvedIndex);
19
+ };
20
+ useEffect(() => {
21
+ if (!autoPlay || totalSlides < 2) return;
22
+ const interval = window.setInterval(() => {
23
+ setActiveIndex((current) => {
24
+ const next = loop ? (current + 1) % totalSlides : Math.min(current + 1, totalSlides - 1);
25
+ onIndexChange?.(next);
26
+ return next;
27
+ });
28
+ }, autoPlayInterval);
29
+ return () => {
30
+ window.clearInterval(interval);
31
+ };
32
+ }, [
33
+ autoPlay,
34
+ autoPlayInterval,
35
+ loop,
36
+ onIndexChange,
37
+ totalSlides
38
+ ]);
39
+ const isPrevDisabled = !loop && resolvedActiveIndex <= 0;
40
+ const isNextDisabled = !loop && resolvedActiveIndex >= totalSlides - 1;
41
+ const slideLabel = useMemo(() => {
42
+ if (totalSlides === 0) return "No slides";
43
+ return `Slide ${resolvedActiveIndex + 1} of ${totalSlides}`;
44
+ }, [resolvedActiveIndex, totalSlides]);
45
+ return /* @__PURE__ */ jsxs("div", {
46
+ ref,
47
+ className: cx("pf-carousel", className),
48
+ role: "region",
49
+ "aria-roledescription": "carousel",
50
+ "aria-label": ariaLabel,
51
+ ...props,
52
+ children: [
53
+ /* @__PURE__ */ jsx("div", {
54
+ className: "pf-carousel__viewport",
55
+ children: totalSlides === 0 ? /* @__PURE__ */ jsx("div", {
56
+ className: "pf-carousel__empty",
57
+ role: "status",
58
+ children: "Add at least one slide."
59
+ }) : /* @__PURE__ */ jsx("div", {
60
+ className: "pf-carousel__track",
61
+ style: { transform: `translateX(-${resolvedActiveIndex * 100}%)` },
62
+ children: slides.map((slide, index) => {
63
+ const isInactive = index !== resolvedActiveIndex;
64
+ return /* @__PURE__ */ jsx("div", {
65
+ className: "pf-carousel__slide",
66
+ role: "group",
67
+ "aria-roledescription": "slide",
68
+ "aria-label": `Slide ${index + 1} of ${totalSlides}`,
69
+ "aria-hidden": isInactive,
70
+ ...isInactive ? { inert: true } : {},
71
+ children: slide
72
+ }, `slide-${index}`);
73
+ })
74
+ })
75
+ }),
76
+ /* @__PURE__ */ jsx("div", {
77
+ className: "pf-sr-only",
78
+ "aria-live": "polite",
79
+ "aria-atomic": "true",
80
+ children: totalSlides > 0 ? slideLabel : ""
81
+ }),
82
+ /* @__PURE__ */ jsxs("div", {
83
+ className: "pf-carousel__controls",
84
+ onKeyDown: (event) => {
85
+ if (event.key === "ArrowLeft") {
86
+ event.preventDefault();
87
+ goToIndex(resolvedActiveIndex - 1);
88
+ } else if (event.key === "ArrowRight") {
89
+ event.preventDefault();
90
+ goToIndex(resolvedActiveIndex + 1);
91
+ }
92
+ },
93
+ children: [
94
+ /* @__PURE__ */ jsx("button", {
95
+ type: "button",
96
+ className: "pf-carousel__nav",
97
+ "aria-label": "Previous slide",
98
+ disabled: isPrevDisabled || totalSlides < 2,
99
+ onClick: () => {
100
+ goToIndex(resolvedActiveIndex - 1);
101
+ },
102
+ children: /* @__PURE__ */ jsx(Icon, {
103
+ name: "square-caret-left",
104
+ "aria-hidden": true
105
+ })
106
+ }),
107
+ showIndicators && totalSlides > 1 ? /* @__PURE__ */ jsx("div", {
108
+ className: "pf-carousel__indicators",
109
+ role: "group",
110
+ "aria-label": "Slide indicators",
111
+ children: slides.map((_, index) => {
112
+ const isActive = index === resolvedActiveIndex;
113
+ return /* @__PURE__ */ jsx("button", {
114
+ type: "button",
115
+ className: cx("pf-carousel__indicator", isActive && "pf-carousel__indicator--active"),
116
+ "aria-label": `Go to slide ${index + 1}`,
117
+ "aria-current": isActive ? "true" : void 0,
118
+ onClick: () => {
119
+ goToIndex(index);
120
+ }
121
+ }, `indicator-${index}`);
122
+ })
123
+ }) : /* @__PURE__ */ jsx("span", {
124
+ className: "pf-carousel__indicator-spacer",
125
+ "aria-hidden": true
126
+ }),
127
+ /* @__PURE__ */ jsx("button", {
128
+ type: "button",
129
+ className: "pf-carousel__nav",
130
+ "aria-label": "Next slide",
131
+ disabled: isNextDisabled || totalSlides < 2,
132
+ onClick: () => {
133
+ goToIndex(resolvedActiveIndex + 1);
134
+ },
135
+ children: /* @__PURE__ */ jsx(Icon, {
136
+ name: "square-caret-right",
137
+ "aria-hidden": true
138
+ })
139
+ })
140
+ ]
141
+ })
142
+ ]
143
+ });
144
+ });
145
+ Carousel.displayName = "Carousel";
146
+ //#endregion
147
+ export { Carousel };