@pantheon-systems/pds-toolkit-react 2.0.0-alpha.11 → 2.0.0-alpha.13
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/dist/components/Dropdown/Dropdown.d.ts +140 -0
- package/dist/components/Dropdown/DropdownSelectedIcon.d.ts +7 -0
- package/dist/components/Popover/Popover.d.ts +5 -1
- package/dist/components/Table/Table.d.ts +9 -18
- package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts +14 -8
- package/dist/components/buttons/IconButton/IconButton.d.ts +4 -0
- package/dist/components/buttons/MenuButton/MenuButton.d.ts +1 -0
- package/dist/components/charts/BarChart/BarChart.d.ts +21 -0
- package/dist/components/charts/LineChart/LineChart.d.ts +22 -0
- package/dist/components/charts/shared/ChartAccessibleTable.d.ts +17 -0
- package/dist/components/charts/shared/ChartLegend.d.ts +25 -0
- package/dist/components/charts/shared/chart-colors.d.ts +18 -0
- package/dist/components/charts/shared/chart-styles.d.ts +16 -0
- package/dist/components/charts/shared/formatters.d.ts +12 -0
- package/dist/components/charts/shared/types.d.ts +97 -0
- package/dist/components/icons/Icon/generated-icon-data.d.ts +9 -2
- package/dist/components/inputs/Combobox/Combobox.d.ts +16 -6
- package/dist/components/inputs/ComboboxMultiselect/ComboboxMultiselect.d.ts +9 -4
- package/dist/components/inputs/Datepicker/Datepicker.d.ts +15 -1
- package/dist/components/inputs/Select/Select.d.ts +6 -1
- package/dist/components/inputs/input-utilities.d.ts +1 -0
- package/dist/components/navigation/DropdownMenu/DropdownMenu.d.ts +1 -0
- package/dist/components/navigation/{NavMenu/NavMenu.d.ts → SiteMenu/SiteMenu.d.ts} +5 -4
- package/dist/components/navigation/SiteMenu/SiteMenuDropdown.d.ts +26 -0
- package/dist/components/navigation/WorkspaceSelector/WorkspaceSelector.d.ts +1 -0
- package/dist/components/notifications/Toaster/Toast.d.ts +12 -1
- package/dist/components/notifications/Toaster/Toaster.d.ts +16 -7
- package/dist/components/notifications/Toaster/useToast.d.ts +2 -0
- package/dist/components/panels/ExpansionPanel/ExpansionPanel.d.ts +1 -2
- package/dist/components/panels/ExpansionPanelGroup/ExpansionPanelGroup.d.ts +1 -2
- package/dist/components/progress-indicators/ProgressBar/ProgressBar.d.ts +3 -4
- package/dist/components/progress-indicators/ProgressRing/ProgressRing.d.ts +2 -3
- package/dist/css/component-css/pds-bar-chart.css +1 -0
- package/dist/css/component-css/pds-breadcrumb.css +1 -1
- package/dist/css/component-css/pds-chart-legend.css +1 -0
- package/dist/css/component-css/pds-chart-tokens.css +1 -0
- package/dist/css/component-css/pds-chart-wrapper.css +1 -0
- package/dist/css/component-css/pds-combobox-multiselect.css +4 -2
- package/dist/css/component-css/pds-combobox.css +1 -1
- package/dist/css/component-css/pds-dropdown-menu.css +2 -2
- package/dist/css/component-css/pds-dropdown.css +2 -0
- package/dist/css/component-css/pds-expansion-panel.css +1 -1
- package/dist/css/component-css/pds-icon-button.css +2 -2
- package/dist/css/component-css/pds-index.css +19 -16
- package/dist/css/component-css/pds-input-utilities.css +1 -1
- package/dist/css/component-css/pds-line-chart.css +1 -0
- package/dist/css/component-css/pds-menu-button.css +1 -1
- package/dist/css/component-css/pds-nav-menu.css +2 -2
- package/dist/css/component-css/pds-popover.css +1 -1
- package/dist/css/component-css/pds-progress-bar.css +1 -1
- package/dist/css/component-css/pds-progress-ring.css +1 -1
- package/dist/css/component-css/pds-select.css +1 -1
- package/dist/css/component-css/pds-side-nav-global.css +6 -6
- package/dist/css/component-css/pds-table.css +1 -1
- package/dist/css/component-css/pds-text-input.css +1 -1
- package/dist/css/component-css/pds-textarea.css +1 -1
- package/dist/css/component-css/pds-theme-switcher.css +1 -1
- package/dist/css/component-css/pds-toaster.css +1 -1
- package/dist/css/component-css/pds-tooltip.css +1 -1
- package/dist/css/component-css/pds-user-menu.css +1 -1
- package/dist/css/component-css/pds-workspace-selector.css +1 -1
- package/dist/css/design-tokens/variables.dark.css +11 -2
- package/dist/css/design-tokens/variables.light.css +11 -2
- package/dist/css/pds-components.css +19 -16
- package/dist/css/pds-core.css +2 -2
- package/dist/index.css +1 -1
- package/dist/index.d.ts +20 -0
- package/dist/index.js +5167 -2362
- package/dist/index.js.map +1 -1
- package/dist/index.source.d.ts +6 -1
- package/dist/libs/types/custom-types.d.ts +8 -0
- package/dist/libs/types/navigation-types.d.ts +1 -1
- package/dist/svg/pause.svg +3 -0
- package/dist/utilities/hooks/useDropdown/index.d.ts +1 -0
- package/dist/utilities/hooks/useDropdown/useDropdown.d.ts +121 -0
- package/package.json +7 -6
- package/dist/components/navigation/NavMenu/NavMenuDropdown.d.ts +0 -24
package/dist/index.source.d.ts
CHANGED
|
@@ -23,12 +23,16 @@ export * from './components/cards/NewSiteCard/NewSiteCard';
|
|
|
23
23
|
export * from './components/cards/PaymentCard/PaymentCard';
|
|
24
24
|
export * from './components/cards/PricingCard/PricingCard';
|
|
25
25
|
export * from './components/cards/SiteCard/SiteCard';
|
|
26
|
+
export * from './components/charts/BarChart/BarChart';
|
|
27
|
+
export * from './components/charts/LineChart/LineChart';
|
|
28
|
+
export * from './components/charts/shared/types';
|
|
26
29
|
export * from './components/CodeBlock/CodeBlock';
|
|
27
30
|
export * from './components/ComparisonList/ComparisonList';
|
|
28
31
|
export * from './components/CTALink/CTALink';
|
|
29
32
|
export * from './components/CTASlice/CTASlice';
|
|
30
33
|
export * from './components/DashboardStat/DashboardStat';
|
|
31
34
|
export * from './components/Drawer/Drawer';
|
|
35
|
+
export * from './components/Dropdown/Dropdown';
|
|
32
36
|
export * from './components/empty-states/CompactEmptyState/CompactEmptyState';
|
|
33
37
|
export * from './components/empty-states/HorizontalEmptyState/HorizontalEmptyState';
|
|
34
38
|
export * from './components/empty-states/VerticalEmptyState/VerticalEmptyState';
|
|
@@ -65,11 +69,11 @@ export * from './components/navigation/DashboardNav/DashboardNavItem';
|
|
|
65
69
|
export * from './components/navigation/DashboardSearch/DashboardSearch';
|
|
66
70
|
export * from './components/navigation/DropdownMenu/DropdownMenu';
|
|
67
71
|
export * from './components/navigation/Navbar/Navbar';
|
|
68
|
-
export * from './components/navigation/NavMenu/NavMenu';
|
|
69
72
|
export * from './components/navigation/SideNav/SideNav';
|
|
70
73
|
export * from './components/navigation/SideNavCompact/SideNavCompact';
|
|
71
74
|
export * from './components/navigation/SideNavGlobal/SideNavGlobal';
|
|
72
75
|
export * from './components/navigation/SideNavGlobal/SideNavGlobalItem';
|
|
76
|
+
export * from './components/navigation/SiteMenu/SiteMenu';
|
|
73
77
|
export * from './components/navigation/TabMenu/TabMenu';
|
|
74
78
|
export * from './components/navigation/UserMenu/UserMenu';
|
|
75
79
|
export * from './components/navigation/WorkspaceSelector/WorkspaceSelector';
|
|
@@ -129,6 +133,7 @@ export * from './libs/types/navigation-types';
|
|
|
129
133
|
export * from './utilities/context-providers/ResponsiveContext/ResponsiveContext';
|
|
130
134
|
export * from './utilities/hooks/useBreakpoint/useBreakpoint';
|
|
131
135
|
export * from './utilities/hooks/useClipboard/useClipboard';
|
|
136
|
+
export * from './utilities/hooks/useDropdown';
|
|
132
137
|
export * from './utilities/hooks/useKeyPress/useKeyPress';
|
|
133
138
|
export * from './utilities/hooks/useMediaQuery/useMediaQuery';
|
|
134
139
|
export * from './utilities/hooks/useWindowWidth/useWindowWidth';
|
|
@@ -46,6 +46,10 @@ export type LinkItemType = {
|
|
|
46
46
|
* Optional icon for this item. Choose from available icons in the Icon component.
|
|
47
47
|
*/
|
|
48
48
|
iconName?: PDSIcon;
|
|
49
|
+
/**
|
|
50
|
+
* Size of the icon. Defaults to 's'.
|
|
51
|
+
*/
|
|
52
|
+
iconSize?: IconSize;
|
|
49
53
|
/**
|
|
50
54
|
* Is this a critical action item?
|
|
51
55
|
*/
|
|
@@ -85,6 +89,10 @@ export type MenuItemType = {
|
|
|
85
89
|
* Optional icon for this item. Choose from available icons in the Icon component.
|
|
86
90
|
*/
|
|
87
91
|
iconName?: PDSIcon;
|
|
92
|
+
/**
|
|
93
|
+
* Size of the icon. Defaults to 's'.
|
|
94
|
+
*/
|
|
95
|
+
iconSize?: IconSize;
|
|
88
96
|
/**
|
|
89
97
|
* Optional ID value for this item.
|
|
90
98
|
*/
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor" aria-hidden="true" focusable="false" role="img">
|
|
2
|
+
<path d="M48 80l0 352 64 0 0-352-64 0zM0 80C0 53.5 21.5 32 48 32l64 0c26.5 0 48 21.5 48 48l0 352c0 26.5-21.5 48-48 48l-64 0c-26.5 0-48-21.5-48-48L0 80zm272 0l0 352 64 0 0-352-64 0zm-48 0c0-26.5 21.5-48 48-48l64 0c26.5 0 48 21.5 48 48l0 352c0 26.5-21.5 48-48 48l-64 0c-26.5 0-48-21.5-48-48l0-352z"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useDropdown';
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { Placement } from '@floating-ui/react';
|
|
2
|
+
import { useFloating, useInteractions } from '@floating-ui/react';
|
|
3
|
+
export type DropdownRole = 'menu' | 'listbox';
|
|
4
|
+
export type DropdownVariant = 'default' | 'input';
|
|
5
|
+
export interface UseDropdownOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Allow keyboard navigation to escape the list (move past first/last item).
|
|
8
|
+
* Useful for combobox inputs where focus should return to the input.
|
|
9
|
+
*/
|
|
10
|
+
allowEscape?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Enable click-to-toggle interaction via useClick.
|
|
13
|
+
* Set to false for combobox-type inputs where open/close is managed
|
|
14
|
+
* by input events (typing, focus) rather than a click toggle.
|
|
15
|
+
*/
|
|
16
|
+
enableClick?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Enable keyboard list navigation via useListNavigation.
|
|
19
|
+
* Set to false if keyboard nav is managed externally.
|
|
20
|
+
*/
|
|
21
|
+
enableListNavigation?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Enable shift middleware to keep the dropdown within viewport bounds.
|
|
24
|
+
* Set to false for inputs where the dropdown should align flush with the trigger.
|
|
25
|
+
*/
|
|
26
|
+
enableShift?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Enable transition animations on the dropdown panel.
|
|
29
|
+
*/
|
|
30
|
+
enableTransition?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Enable typeahead character search via useTypeahead.
|
|
33
|
+
*/
|
|
34
|
+
enableTypeahead?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Offset distance in pixels between the trigger and the dropdown panel.
|
|
37
|
+
* Ignored when variant is 'input' (uses dynamic offset based on placement).
|
|
38
|
+
*/
|
|
39
|
+
offsetValue?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Open the dropdown on hover (desktop navigation menus).
|
|
42
|
+
* Enables useHover with safePolygon.
|
|
43
|
+
*/
|
|
44
|
+
openOnHover?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Preferred placement of the dropdown panel relative to the trigger.
|
|
47
|
+
*/
|
|
48
|
+
placement?: Placement;
|
|
49
|
+
/**
|
|
50
|
+
* ARIA role for the dropdown container.
|
|
51
|
+
*/
|
|
52
|
+
role?: DropdownRole;
|
|
53
|
+
/**
|
|
54
|
+
* Index of the currently selected item. Used by typeahead to maintain
|
|
55
|
+
* selection context. Only needed for selection-style dropdowns (Select).
|
|
56
|
+
*/
|
|
57
|
+
selectedIndex?: number | null;
|
|
58
|
+
/**
|
|
59
|
+
* Dropdown variant. 'input' applies input-specific positioning: dynamic
|
|
60
|
+
* offset based on placement direction and size constraints with min/max height.
|
|
61
|
+
* Use for Select, Combobox, and other input-attached dropdowns.
|
|
62
|
+
*/
|
|
63
|
+
variant?: DropdownVariant;
|
|
64
|
+
/**
|
|
65
|
+
* Use virtual focus (aria-activedescendant) instead of roving tabindex.
|
|
66
|
+
* Appropriate for combobox-type inputs where focus must stay on the input.
|
|
67
|
+
*/
|
|
68
|
+
virtual?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface UseDropdownReturn {
|
|
71
|
+
/**
|
|
72
|
+
* Index of the currently active/focused item in the list.
|
|
73
|
+
*/
|
|
74
|
+
activeIndex: number | null;
|
|
75
|
+
/**
|
|
76
|
+
* Styles to apply to the floating panel element.
|
|
77
|
+
*/
|
|
78
|
+
floatingStyles: ReturnType<typeof useFloating>['floatingStyles'];
|
|
79
|
+
/**
|
|
80
|
+
* Props to spread on the floating panel element.
|
|
81
|
+
*/
|
|
82
|
+
getFloatingProps: ReturnType<typeof useInteractions>['getFloatingProps'];
|
|
83
|
+
/**
|
|
84
|
+
* Props to spread on each item element.
|
|
85
|
+
*/
|
|
86
|
+
getItemProps: ReturnType<typeof useInteractions>['getItemProps'];
|
|
87
|
+
/**
|
|
88
|
+
* Props to spread on the trigger/reference element.
|
|
89
|
+
*/
|
|
90
|
+
getReferenceProps: ReturnType<typeof useInteractions>['getReferenceProps'];
|
|
91
|
+
/**
|
|
92
|
+
* Whether the floating panel should be mounted in the DOM
|
|
93
|
+
* (accounts for transition animations).
|
|
94
|
+
*/
|
|
95
|
+
isMounted: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Whether the dropdown is currently open.
|
|
98
|
+
*/
|
|
99
|
+
isOpen: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Ref array for list item DOM nodes (used by useListNavigation).
|
|
102
|
+
*/
|
|
103
|
+
listRef: React.MutableRefObject<any[]>;
|
|
104
|
+
/**
|
|
105
|
+
* Floating UI refs for the reference and floating elements.
|
|
106
|
+
*/
|
|
107
|
+
refs: ReturnType<typeof useFloating>['refs'];
|
|
108
|
+
/**
|
|
109
|
+
* Set the active/focused item index.
|
|
110
|
+
*/
|
|
111
|
+
setActiveIndex: React.Dispatch<React.SetStateAction<number | null>>;
|
|
112
|
+
/**
|
|
113
|
+
* Set the open state of the dropdown.
|
|
114
|
+
*/
|
|
115
|
+
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
116
|
+
/**
|
|
117
|
+
* Transition styles to apply to the floating panel element.
|
|
118
|
+
*/
|
|
119
|
+
transitionStyles: React.CSSProperties;
|
|
120
|
+
}
|
|
121
|
+
export declare const useDropdown: ({ allowEscape, enableClick, enableListNavigation, enableShift, enableTransition, enableTypeahead, offsetValue, openOnHover, placement, role, selectedIndex, variant, virtual, }?: UseDropdownOptions) => UseDropdownReturn;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pantheon-systems/pds-toolkit-react",
|
|
3
3
|
"technology": "React",
|
|
4
|
-
"version": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.13",
|
|
5
5
|
"description": "PDS toolkit built using the React framework",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"prestorybook": "node scripts/filter-exports-by-tags.js && npm run build:css && npm run build:css:components && npm run build:css:layouts && npm run generate:ux-writing-search-index && npm run generate:ux-writing-guide",
|
|
53
53
|
"storybook": "storybook dev -p 6006",
|
|
54
54
|
"prebuild": "npm run build:css && npm run build:css:components && npm run build:css:layouts && npm run build:css:packageExtraCss && npm run generate:ux-writing-search-index && npm run generate:ux-writing-guide",
|
|
55
|
-
"build": "NODE_ENV=production storybook build",
|
|
55
|
+
"build": "NODE_OPTIONS=--max-old-space-size=4096 NODE_ENV=production storybook build",
|
|
56
56
|
"build-storybook": "NODE_ENV=production storybook build",
|
|
57
57
|
"postbuild": "node scripts/copy-mcp-assets.js && node scripts/build-starter-template.js && node scripts/generate-html-docs.js && node scripts/verify-mcp-build.js",
|
|
58
58
|
"verify:mcp": "node scripts/verify-mcp-build.js",
|
|
@@ -154,13 +154,13 @@
|
|
|
154
154
|
"vite-tsconfig-paths": "^4.3.2"
|
|
155
155
|
},
|
|
156
156
|
"peerDependencies": {
|
|
157
|
-
"react": "^
|
|
158
|
-
"react-dom": "^
|
|
157
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
158
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
159
159
|
},
|
|
160
160
|
"dependencies": {
|
|
161
161
|
"@floating-ui/react": "^0.24.3",
|
|
162
162
|
"@floating-ui/react-dom": "~1.3.0",
|
|
163
|
-
"@pantheon-systems/pds-design-tokens": "^2.0.0-alpha.
|
|
163
|
+
"@pantheon-systems/pds-design-tokens": "^2.0.0-alpha.34",
|
|
164
164
|
"@reactuses/core": "^5.0.15",
|
|
165
165
|
"date-fns": "^4.1.0",
|
|
166
166
|
"downshift": "^9.0.8",
|
|
@@ -177,7 +177,8 @@
|
|
|
177
177
|
"react-day-picker": "^9.11.1",
|
|
178
178
|
"react-device-detect": "^2.2.3",
|
|
179
179
|
"react-hotkeys-hook": "^4.5.1",
|
|
180
|
-
"react-toastify": "^
|
|
180
|
+
"react-toastify": "^10.0.6",
|
|
181
|
+
"recharts": "^3.8.1"
|
|
181
182
|
},
|
|
182
183
|
"optionalDependencies": {
|
|
183
184
|
"@fortawesome/free-brands-svg-icons": "^7.2.0",
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import { NavMenuItem } from '../../../libs/types/navigation-types';
|
|
3
|
-
/**
|
|
4
|
-
* Prop types for NavMenuDropdown
|
|
5
|
-
*/
|
|
6
|
-
interface NavMenuDropdownProps extends ComponentPropsWithoutRef<'button'> {
|
|
7
|
-
/**
|
|
8
|
-
* Dropdown items.
|
|
9
|
-
*/
|
|
10
|
-
items?: NavMenuItem[];
|
|
11
|
-
/**
|
|
12
|
-
* Dropdown label.
|
|
13
|
-
*/
|
|
14
|
-
label?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Mobile menu will be enabled when viewport is at or below this number in pixels.
|
|
17
|
-
*/
|
|
18
|
-
mobileMenuMaxWidth?: number;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* NavMenuDropdown UI component
|
|
22
|
-
*/
|
|
23
|
-
export declare const NavMenuDropdown: ({ items, label, mobileMenuMaxWidth, }: NavMenuDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export {};
|