@pantheon-systems/pds-toolkit-react 2.0.0-alpha.76 → 2.0.0-alpha.78
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 +67 -2
- package/dist/components/RowActionsMenu/RowActionsMenu.d.ts +46 -0
- package/dist/components/buttons/MenuButton/MenuButton.d.ts +16 -2
- package/dist/components/cards/Card/Card.d.ts +2 -2
- package/dist/components/empty-states/VerticalEmptyState/VerticalEmptyState.d.ts +3 -2
- package/dist/components/icons/Icon/generated-icon-data.d.ts +1 -1
- package/dist/components/links/CTALink/CTALink.d.ts +2 -2
- package/dist/components/links/LinkNewWindow/LinkNewWindow.d.ts +1 -1
- package/dist/components/panels/FeaturePanel/FeaturePanel.d.ts +72 -0
- package/dist/components/panels/WidgetPanel/WidgetPanel.d.ts +39 -0
- package/dist/css/component-css/pds-cta-link.css +1 -1
- package/dist/css/component-css/pds-dropdown.css +2 -1
- package/dist/css/component-css/pds-feature-panel.css +15 -0
- package/dist/css/component-css/pds-index.css +21 -5
- package/dist/css/component-css/pds-link-new-window.css +1 -1
- package/dist/css/component-css/pds-row-actions-menu.css +2 -0
- package/dist/css/component-css/pds-widget-panel.css +1 -0
- package/dist/css/layout-css/pds-sidebar-layout.css +11 -3
- package/dist/css/pds-components.css +21 -5
- package/dist/css/pds-core.css +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1954 -1804
- package/dist/index.js.map +1 -1
- package/dist/index.source.d.ts +4 -0
- package/dist/layouts/SidebarLayout/SidebarLayout.d.ts +22 -3
- package/dist/libs/types/layout-types.d.ts +1 -0
- package/dist/utilities/auto-grid/AutoGrid.d.ts +48 -0
- package/dist/utilities/hooks/useDropdown/useDropdown.d.ts +11 -1
- package/package.json +1 -1
package/dist/index.source.d.ts
CHANGED
|
@@ -85,15 +85,18 @@ export * from './components/pagination/PaginationChapter/PaginationChapter';
|
|
|
85
85
|
export * from './components/pagination/PaginationCompact/PaginationCompact';
|
|
86
86
|
export * from './components/panels/ExpansionPanel/ExpansionPanel';
|
|
87
87
|
export * from './components/panels/ExpansionPanelGroup/ExpansionPanelGroup';
|
|
88
|
+
export * from './components/panels/FeaturePanel/FeaturePanel';
|
|
88
89
|
export * from './components/panels/Panel/Panel';
|
|
89
90
|
export * from './components/panels/PanelList/PanelList';
|
|
90
91
|
export * from './components/panels/PanelList/PanelRow';
|
|
91
92
|
export * from './components/panels/PanelStack/PanelStack';
|
|
93
|
+
export * from './components/panels/WidgetPanel/WidgetPanel';
|
|
92
94
|
export * from './components/PantheonLogo/PantheonLogo';
|
|
93
95
|
export * from './components/Popover/Popover';
|
|
94
96
|
export * from './components/progress-indicators/ProgressBar/ProgressBar';
|
|
95
97
|
export * from './components/progress-indicators/ProgressRing/ProgressRing';
|
|
96
98
|
export * from './components/ResultCount/ResultCount';
|
|
99
|
+
export * from './components/RowActionsMenu/RowActionsMenu';
|
|
97
100
|
export * from './components/SiteFooter/SiteFooter';
|
|
98
101
|
export * from './components/SiteSearch/SiteSearch';
|
|
99
102
|
export * from './components/SortableList/SortableList';
|
|
@@ -128,6 +131,7 @@ export * from './libs/types/custom-types';
|
|
|
128
131
|
export * from './libs/types/input-types';
|
|
129
132
|
export * from './libs/types/layout-types';
|
|
130
133
|
export * from './libs/types/navigation-types';
|
|
134
|
+
export * from './utilities/auto-grid/AutoGrid';
|
|
131
135
|
export * from './utilities/context-providers/ThemeContext/ThemeContext';
|
|
132
136
|
export * from './utilities/grid/Grid';
|
|
133
137
|
export * from './utilities/grid/GridItem';
|
|
@@ -7,7 +7,8 @@ import './sidebar-layout.css';
|
|
|
7
7
|
interface SidebarLayoutProps extends ComponentPropsWithoutRef<'div'> {
|
|
8
8
|
/**
|
|
9
9
|
* Children to render in the layout. Main content can be passed without a slot attribute (unslotted).
|
|
10
|
-
* Optional named slots: `sidebar` for sidebar content, `
|
|
10
|
+
* Optional named slots: `sidebar` for sidebar content, `second-sidebar` for a second, opposite-side
|
|
11
|
+
* sidebar, `content` for backwards compatibility.
|
|
11
12
|
*/
|
|
12
13
|
children: ReactNode;
|
|
13
14
|
/**
|
|
@@ -15,10 +16,28 @@ interface SidebarLayoutProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
15
16
|
*/
|
|
16
17
|
className?: string;
|
|
17
18
|
/**
|
|
18
|
-
* Gap between the main content and sidebar, from the numbered spacing scale.
|
|
19
|
+
* Gap between the main content and sidebar(s), from the numbered spacing scale.
|
|
19
20
|
* Defaults to `xl`.
|
|
20
21
|
*/
|
|
21
22
|
gridGap?: GapScale;
|
|
23
|
+
/**
|
|
24
|
+
* Mobile position of the `second-sidebar` slot: `'before'` or `'after'` (default) the main content.
|
|
25
|
+
* When both sidebars resolve to `'after'`, they stack in the same left-to-right order they have
|
|
26
|
+
* on desktop.
|
|
27
|
+
*/
|
|
28
|
+
secondSidebarMobileLocation?: 'before' | 'after';
|
|
29
|
+
/**
|
|
30
|
+
* Width of the second sidebar as a percentage (e.g. `'33%'`). Defaults to `sidebarWidth`.
|
|
31
|
+
*/
|
|
32
|
+
secondSidebarWidth?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Maximum width of the second sidebar in rems. Defaults to `sidebarWidthMax`.
|
|
35
|
+
*/
|
|
36
|
+
secondSidebarWidthMax?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Minimum width of the second sidebar in rems. Defaults to `sidebarWidthMin`.
|
|
39
|
+
*/
|
|
40
|
+
secondSidebarWidthMin?: number;
|
|
22
41
|
/**
|
|
23
42
|
* Sidebar location.
|
|
24
43
|
*/
|
|
@@ -43,5 +62,5 @@ interface SidebarLayoutProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
43
62
|
/**
|
|
44
63
|
* SidebarLayout UI component
|
|
45
64
|
*/
|
|
46
|
-
export declare const SidebarLayout: ({ children, className, gridGap, sidebarLocation, sidebarMobileLocation, sidebarWidth, sidebarWidthMax, sidebarWidthMin, ...props }: SidebarLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
export declare const SidebarLayout: ({ children, className, gridGap, secondSidebarMobileLocation, secondSidebarWidth, secondSidebarWidthMax, secondSidebarWidthMin, sidebarLocation, sidebarMobileLocation, sidebarWidth, sidebarWidthMax, sidebarWidthMin, ...props }: SidebarLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
47
66
|
export {};
|
|
@@ -3,3 +3,4 @@ export type PaddingScale = 'none' | 'condensed' | 'standard' | 'spacious';
|
|
|
3
3
|
export type CardPaddingScale = Exclude<PaddingScale, 'none'>;
|
|
4
4
|
export type CardBackground = 'default' | 'secondary' | 'transparent';
|
|
5
5
|
export type VerticalAlignOptions = 'start' | 'center' | 'end';
|
|
6
|
+
export type ImageDisplayVariant = 'bleed' | 'inset';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import { GapScale } from '../../libs/types/layout-types';
|
|
3
|
+
import './auto-grid.css';
|
|
4
|
+
/**
|
|
5
|
+
* Prop types for AutoGrid
|
|
6
|
+
*/
|
|
7
|
+
export interface AutoGridProps extends ComponentPropsWithoutRef<'div'> {
|
|
8
|
+
/**
|
|
9
|
+
* Grid content. Each child is placed directly as a grid item -- no
|
|
10
|
+
* wrapper component needed.
|
|
11
|
+
*/
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Additional class names
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Gap between items, from the numbered spacing scale. Fixed at all
|
|
19
|
+
* breakpoints; set `mobileGap` to change it on small screens. Defaults
|
|
20
|
+
* to `xl`.
|
|
21
|
+
*/
|
|
22
|
+
gap?: GapScale;
|
|
23
|
+
/**
|
|
24
|
+
* Minimum width of each item, as a CSS length (e.g. `'13rem'`). Items
|
|
25
|
+
* grow to evenly fill each row up to that width, wrapping to a new row
|
|
26
|
+
* once another item can't fit at it. Every item is always the same
|
|
27
|
+
* width, regardless of how many end up in the last row -- an
|
|
28
|
+
* incomplete row just leaves blank trailing space instead of
|
|
29
|
+
* stretching its items wider.
|
|
30
|
+
*/
|
|
31
|
+
itemMinWidth: string;
|
|
32
|
+
/**
|
|
33
|
+
* Caps the number of columns, regardless of how much width is
|
|
34
|
+
* available. Uncapped by default.
|
|
35
|
+
*/
|
|
36
|
+
maxColumns?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Gap on small (mobile) screens. If not set, uses the same value as `gap`.
|
|
39
|
+
*/
|
|
40
|
+
mobileGap?: GapScale;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* AutoGrid layout component — a responsive grid that fits as many
|
|
44
|
+
* `itemMinWidth`-wide items per row as will fit, evenly filling the row up
|
|
45
|
+
* to that width, and wraps the rest to new rows. Every item is always the
|
|
46
|
+
* same width. Optionally cap the column count with `maxColumns`.
|
|
47
|
+
*/
|
|
48
|
+
export declare const AutoGrid: ({ children, className, gap, itemMinWidth, maxColumns, mobileGap, ...props }: AutoGridProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Placement } from '@floating-ui/react';
|
|
2
|
-
import { useFloating, useInteractions } from '@floating-ui/react';
|
|
2
|
+
import { useFloating, useFloatingNodeId, useInteractions } from '@floating-ui/react';
|
|
3
3
|
export type DropdownRole = 'menu' | 'listbox' | 'dialog';
|
|
4
4
|
export type DropdownVariant = 'default' | 'input';
|
|
5
5
|
export interface UseDropdownOptions {
|
|
@@ -118,6 +118,16 @@ export interface UseDropdownReturn {
|
|
|
118
118
|
* Ref array for list item DOM nodes (used by useListNavigation).
|
|
119
119
|
*/
|
|
120
120
|
listRef: React.MutableRefObject<any[]>;
|
|
121
|
+
/**
|
|
122
|
+
* This instance's Floating UI tree node ID (`null` when not part of a
|
|
123
|
+
* `<FloatingTree>`). Consumers that can be nested inside another floating
|
|
124
|
+
* panel (e.g. MenuButton, Dropdown) wrap their rendered floating panel in
|
|
125
|
+
* a `<FloatingNode id={nodeId}>` so outside-click/Escape resolve to the
|
|
126
|
+
* correct (innermost) panel when nested. See each consumer's own
|
|
127
|
+
* `useFloatingParentNodeId()` check for whether it also needs to provide
|
|
128
|
+
* its own `<FloatingTree>` (root case) or can join an ancestor's.
|
|
129
|
+
*/
|
|
130
|
+
nodeId: ReturnType<typeof useFloatingNodeId>;
|
|
121
131
|
/**
|
|
122
132
|
* Floating UI refs for the reference and floating elements.
|
|
123
133
|
*/
|
package/package.json
CHANGED