@primer/components 0.0.0-202191502023 → 0.0.0-2021915134443
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/CHANGELOG.md +2 -2
- package/dist/browser.esm.js +613 -613
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +176 -176
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList2/Description.d.ts +5 -0
- package/lib/ActionList2/Description.js +54 -0
- package/lib/ActionList2/Divider.d.ts +8 -0
- package/lib/ActionList2/Divider.js +42 -0
- package/lib/ActionList2/Group.d.ts +8 -0
- package/lib/ActionList2/Group.js +39 -0
- package/lib/ActionList2/Header.d.ts +26 -0
- package/lib/ActionList2/Header.js +55 -0
- package/lib/ActionList2/Item.d.ts +53 -0
- package/lib/ActionList2/Item.js +188 -0
- package/lib/ActionList2/List.d.ts +18 -0
- package/lib/ActionList2/List.js +52 -0
- package/lib/ActionList2/Selection.d.ts +5 -0
- package/lib/ActionList2/Selection.js +67 -0
- package/lib/ActionList2/Visuals.d.ts +12 -0
- package/lib/ActionList2/Visuals.js +91 -0
- package/lib/ActionList2/hacks.d.ts +30 -0
- package/lib/ActionList2/hacks.js +38 -0
- package/lib/ActionList2/index.d.ts +26 -0
- package/lib/ActionList2/index.js +36 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +8 -0
- package/lib-esm/ActionList2/Description.d.ts +5 -0
- package/lib-esm/ActionList2/Description.js +38 -0
- package/lib-esm/ActionList2/Divider.d.ts +8 -0
- package/lib-esm/ActionList2/Divider.js +30 -0
- package/lib-esm/ActionList2/Group.d.ts +8 -0
- package/lib-esm/ActionList2/Group.js +29 -0
- package/lib-esm/ActionList2/Header.d.ts +26 -0
- package/lib-esm/ActionList2/Header.js +45 -0
- package/lib-esm/ActionList2/Item.d.ts +53 -0
- package/lib-esm/ActionList2/Item.js +185 -0
- package/lib-esm/ActionList2/List.d.ts +18 -0
- package/lib-esm/ActionList2/List.js +42 -0
- package/lib-esm/ActionList2/Selection.d.ts +5 -0
- package/lib-esm/ActionList2/Selection.js +50 -0
- package/lib-esm/ActionList2/Visuals.d.ts +12 -0
- package/lib-esm/ActionList2/Visuals.js +68 -0
- package/lib-esm/ActionList2/hacks.d.ts +30 -0
- package/lib-esm/ActionList2/hacks.js +30 -0
- package/lib-esm/ActionList2/index.d.ts +26 -0
- package/lib-esm/ActionList2/index.js +23 -0
- package/lib-esm/index.d.ts +1 -0
- package/lib-esm/index.js +1 -0
- package/package.json +1 -1
@@ -0,0 +1,185 @@
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
3
|
+
/**
|
4
|
+
* test suite!
|
5
|
+
* id, role
|
6
|
+
* text could be non-text
|
7
|
+
* activeDescendantAttribute
|
8
|
+
* deepmerge sx
|
9
|
+
* nicer name for showDivider?
|
10
|
+
* aria-label
|
11
|
+
* aria-describedby
|
12
|
+
* React.FC<Props> doesn't allow id?
|
13
|
+
* truncate description
|
14
|
+
* icon color
|
15
|
+
* disabled checkbox
|
16
|
+
* check height with divider
|
17
|
+
*
|
18
|
+
* use immediate child slot API instead of double render?
|
19
|
+
* change as= li | div based on context of menu or not?
|
20
|
+
* check if everyone accepts sx prop
|
21
|
+
* link example outside of overlay? (details)
|
22
|
+
* if one item has selected, should we give all of them selected without the need to pass prop?
|
23
|
+
* move custom item themes to primitives?
|
24
|
+
* padding: 8 or 6?
|
25
|
+
* ActionList.Selection or ActionList.Item selected?
|
26
|
+
* different size for icon and avatar, range?
|
27
|
+
* minimize number of divs?
|
28
|
+
*/
|
29
|
+
import React from 'react';
|
30
|
+
import { useColorSchemeVar, useTheme } from '../ThemeProvider';
|
31
|
+
import Box from '../Box';
|
32
|
+
import { get } from '../constants';
|
33
|
+
import { ListContext } from './List';
|
34
|
+
import { customItemThemes } from './hacks';
|
35
|
+
import { Selection } from './Selection';
|
36
|
+
export const getVariantStyles = (variant, disabled) => {
|
37
|
+
if (disabled) {
|
38
|
+
return {
|
39
|
+
color: get('colors.fg.muted'),
|
40
|
+
iconColor: get('colors.fg.muted'),
|
41
|
+
annotationColor: get('colors.fg.muted')
|
42
|
+
};
|
43
|
+
}
|
44
|
+
|
45
|
+
switch (variant) {
|
46
|
+
case 'danger':
|
47
|
+
return {
|
48
|
+
color: 'danger.fg',
|
49
|
+
iconColor: 'danger.fg',
|
50
|
+
annotationColor: 'fg.muted'
|
51
|
+
};
|
52
|
+
|
53
|
+
default:
|
54
|
+
return {
|
55
|
+
color: 'fg.default',
|
56
|
+
iconColor: 'fg.muted',
|
57
|
+
annotationColor: 'fg.muted'
|
58
|
+
};
|
59
|
+
}
|
60
|
+
};
|
61
|
+
export const ItemContext = /*#__PURE__*/React.createContext({
|
62
|
+
registerSlot: () => null
|
63
|
+
});
|
64
|
+
export const Item = /*#__PURE__*/React.forwardRef(({
|
65
|
+
variant = 'default',
|
66
|
+
disabled = false,
|
67
|
+
selected = undefined,
|
68
|
+
showDivider = false,
|
69
|
+
onAction = () => null,
|
70
|
+
sx = {},
|
71
|
+
...props
|
72
|
+
}, forwardedRef) => {
|
73
|
+
const customItemTheme = customItemThemes[variant];
|
74
|
+
const {
|
75
|
+
variant: listVariant
|
76
|
+
} = React.useContext(ListContext);
|
77
|
+
const {
|
78
|
+
theme
|
79
|
+
} = useTheme();
|
80
|
+
const [slots, setSlots] = React.useState({
|
81
|
+
LeadingVisual: null,
|
82
|
+
InlineDescription: null,
|
83
|
+
BlockDescription: null,
|
84
|
+
TrailingVisual: null
|
85
|
+
});
|
86
|
+
|
87
|
+
const registerSlot = (name, contents) => {
|
88
|
+
if (slots[name] === null) setSlots(latestSlots => ({ ...latestSlots,
|
89
|
+
[name]: contents
|
90
|
+
}));
|
91
|
+
};
|
92
|
+
|
93
|
+
const styles = {
|
94
|
+
display: 'flex',
|
95
|
+
paddingX: get('space.2'),
|
96
|
+
paddingY: '6px',
|
97
|
+
marginX: listVariant === 'inset' ? get('space.2') : 0,
|
98
|
+
minHeight: get('space.5'),
|
99
|
+
borderRadius: get('radii.2'),
|
100
|
+
transition: 'background 33.333ms linear',
|
101
|
+
color: getVariantStyles(variant, disabled).color,
|
102
|
+
textDecoration: 'none',
|
103
|
+
// for as="a"
|
104
|
+
':not(disabled)': {
|
105
|
+
cursor: 'pointer'
|
106
|
+
},
|
107
|
+
'@media (hover: hover) and (pointer: fine)': {
|
108
|
+
':hover': {
|
109
|
+
backgroundColor: useColorSchemeVar(customItemTheme.hover, 'inherit')
|
110
|
+
},
|
111
|
+
':focus': {
|
112
|
+
backgroundColor: useColorSchemeVar(customItemTheme.focus, 'inherit')
|
113
|
+
}
|
114
|
+
},
|
115
|
+
|
116
|
+
/** Divider styles */
|
117
|
+
'[data-component="ActionList.Item--Main"]': {
|
118
|
+
position: 'relative'
|
119
|
+
},
|
120
|
+
'[data-component="ActionList.Item--Main"]::before': {
|
121
|
+
content: '" "',
|
122
|
+
display: 'block',
|
123
|
+
position: 'absolute',
|
124
|
+
width: '100%',
|
125
|
+
top: '-7px',
|
126
|
+
border: '0 solid',
|
127
|
+
borderTopWidth: showDivider ? `1px` : '0',
|
128
|
+
borderColor: 'var(--divider-color, transparent)'
|
129
|
+
},
|
130
|
+
// show between 2 items
|
131
|
+
':not(:first-of-type)': {
|
132
|
+
'--divider-color': theme === null || theme === void 0 ? void 0 : theme.colors.border.muted
|
133
|
+
},
|
134
|
+
// hide divider after dividers & group header
|
135
|
+
'[data-component="ActionList.Divider"] + &': {
|
136
|
+
'--divider-color': 'transparent'
|
137
|
+
},
|
138
|
+
// hide border on current and previous item
|
139
|
+
'&:hover, &:focus': {
|
140
|
+
'--divider-color': 'transparent'
|
141
|
+
},
|
142
|
+
'&:hover + &, &:focus + &': {
|
143
|
+
'--divider-color': 'transparent'
|
144
|
+
},
|
145
|
+
...sx
|
146
|
+
};
|
147
|
+
const clickHandler = React.useCallback(event => {
|
148
|
+
if (disabled) return;
|
149
|
+
if (!event.defaultPrevented) onAction(event);
|
150
|
+
}, [onAction, disabled]);
|
151
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
152
|
+
as: "li",
|
153
|
+
sx: styles,
|
154
|
+
"data-component": "ActionList.Item",
|
155
|
+
onClick: clickHandler,
|
156
|
+
ref: forwardedRef
|
157
|
+
}, props), /*#__PURE__*/React.createElement(ItemContext.Provider, {
|
158
|
+
value: {
|
159
|
+
registerSlot
|
160
|
+
}
|
161
|
+
}, /*#__PURE__*/React.createElement(Selection, {
|
162
|
+
selected: selected,
|
163
|
+
disabled: disabled
|
164
|
+
}), slots.LeadingVisual, /*#__PURE__*/React.createElement(Box, {
|
165
|
+
"data-component": "ActionList.Item--Main",
|
166
|
+
sx: {
|
167
|
+
display: 'flex',
|
168
|
+
flexDirection: 'column',
|
169
|
+
flexGrow: 1,
|
170
|
+
minWidth: 0
|
171
|
+
}
|
172
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
173
|
+
sx: {
|
174
|
+
display: 'flex'
|
175
|
+
}
|
176
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
177
|
+
sx: {
|
178
|
+
display: 'flex',
|
179
|
+
flexGrow: 1,
|
180
|
+
alignItems: 'baseline',
|
181
|
+
minWidth: 0
|
182
|
+
}
|
183
|
+
}, /*#__PURE__*/React.createElement("span", null, props.children), slots.InlineDescription), slots.TrailingVisual), slots.BlockDescription)));
|
184
|
+
});
|
185
|
+
Item.displayName = 'ActionList.Item';
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* showItemDividers
|
4
|
+
* deepmerge sx
|
5
|
+
* change as= ul | div based on context of menu or not?
|
6
|
+
* should selectionVariant be single by default or nothing. ask for explicit choice?
|
7
|
+
*/
|
8
|
+
import React from 'react';
|
9
|
+
import { ForwardRefComponent as PolymorphicForwardRefComponent } from '@radix-ui/react-polymorphic';
|
10
|
+
import { SxProp } from '../sx';
|
11
|
+
export declare type ListProps = {
|
12
|
+
variant?: 'inset' | 'full';
|
13
|
+
selectionVariant?: 'single' | 'multiple';
|
14
|
+
} & SxProp;
|
15
|
+
declare type ContextProps = Pick<ListProps, 'selectionVariant' | 'variant'>;
|
16
|
+
export declare const ListContext: React.Context<ContextProps>;
|
17
|
+
export declare const List: PolymorphicForwardRefComponent<"ul", ListProps>;
|
18
|
+
export {};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
3
|
+
/**
|
4
|
+
*
|
5
|
+
* showItemDividers
|
6
|
+
* deepmerge sx
|
7
|
+
* change as= ul | div based on context of menu or not?
|
8
|
+
* should selectionVariant be single by default or nothing. ask for explicit choice?
|
9
|
+
*/
|
10
|
+
import React from 'react';
|
11
|
+
import Box from '../Box';
|
12
|
+
import { get } from '../constants';
|
13
|
+
export const ListContext = /*#__PURE__*/React.createContext({});
|
14
|
+
export const List = /*#__PURE__*/React.forwardRef(({
|
15
|
+
variant = 'inset',
|
16
|
+
selectionVariant = 'single',
|
17
|
+
sx = {},
|
18
|
+
...props
|
19
|
+
}, forwardedRef) => {
|
20
|
+
const styles = {
|
21
|
+
margin: 0,
|
22
|
+
fontSize: get('fontSizes.1'),
|
23
|
+
lineHeight: '20px',
|
24
|
+
// TODO: check if we replace this already
|
25
|
+
paddingInlineStart: 0,
|
26
|
+
// reset ul styles
|
27
|
+
paddingY: variant === 'inset' ? get('space.2') : 0,
|
28
|
+
...sx
|
29
|
+
};
|
30
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
31
|
+
as: "ul",
|
32
|
+
sx: styles
|
33
|
+
}, props, {
|
34
|
+
ref: forwardedRef
|
35
|
+
}), /*#__PURE__*/React.createElement(ListContext.Provider, {
|
36
|
+
value: {
|
37
|
+
variant,
|
38
|
+
selectionVariant
|
39
|
+
}
|
40
|
+
}, props.children));
|
41
|
+
});
|
42
|
+
List.displayName = 'ActionList';
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { CheckIcon } from '@primer/octicons-react';
|
3
|
+
import { useTheme } from '../ThemeProvider';
|
4
|
+
import { ListContext } from './List';
|
5
|
+
import { LeadingVisualContainer } from './Visuals';
|
6
|
+
export const Selection = ({
|
7
|
+
selected,
|
8
|
+
disabled
|
9
|
+
}) => {
|
10
|
+
const {
|
11
|
+
selectionVariant
|
12
|
+
} = React.useContext(ListContext);
|
13
|
+
const {
|
14
|
+
theme
|
15
|
+
} = useTheme();
|
16
|
+
if (typeof selected === 'undefined') return null;
|
17
|
+
|
18
|
+
if (selectionVariant === 'single') {
|
19
|
+
return /*#__PURE__*/React.createElement(LeadingVisualContainer, null, selected && /*#__PURE__*/React.createElement(CheckIcon, {
|
20
|
+
fill: theme === null || theme === void 0 ? void 0 : theme.colors.text.primary
|
21
|
+
}));
|
22
|
+
}
|
23
|
+
|
24
|
+
if (selectionVariant === 'multiple') {
|
25
|
+
/**
|
26
|
+
* readOnly is required because we are doing a one-way bind to `checked`
|
27
|
+
* aria-readonly="false" tells screen that they can still interact with the checkbox
|
28
|
+
* TODO: not sure if disabled & aria-label be here or should we apply it on the instance as props
|
29
|
+
* TODO: aria-label should come from the text part of the slot
|
30
|
+
*/
|
31
|
+
return /*#__PURE__*/React.createElement(LeadingVisualContainer, {
|
32
|
+
sx: {
|
33
|
+
input: {
|
34
|
+
margin: 0,
|
35
|
+
pointerEvents: 'none'
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}, /*#__PURE__*/React.createElement("input", {
|
39
|
+
type: "checkbox",
|
40
|
+
checked: selected,
|
41
|
+
disabled: disabled,
|
42
|
+
"aria-label": "TODO",
|
43
|
+
tabIndex: -1,
|
44
|
+
readOnly: true,
|
45
|
+
"aria-readonly": "false"
|
46
|
+
}));
|
47
|
+
}
|
48
|
+
|
49
|
+
return null;
|
50
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { SxProp } from '../sx';
|
3
|
+
import { ItemProps } from './Item';
|
4
|
+
declare type VisualProps = Pick<ItemProps, 'variant' | 'disabled' | 'sx'> & {
|
5
|
+
children: React.ReactNode;
|
6
|
+
};
|
7
|
+
export declare const LeadingVisualContainer: React.FC<SxProp>;
|
8
|
+
export declare type LeadingVisualProps = VisualProps;
|
9
|
+
export declare const LeadingVisual: React.FC<VisualProps>;
|
10
|
+
export declare type TrailingVisualProps = VisualProps;
|
11
|
+
export declare const TrailingVisual: React.FC<VisualProps>;
|
12
|
+
export {};
|
@@ -0,0 +1,68 @@
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
3
|
+
import React from 'react';
|
4
|
+
import Box from '../Box';
|
5
|
+
import { get } from '../constants';
|
6
|
+
import { ItemContext, getVariantStyles } from './Item';
|
7
|
+
export const LeadingVisualContainer = ({
|
8
|
+
sx = {},
|
9
|
+
...props
|
10
|
+
}) => {
|
11
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
12
|
+
as: "span",
|
13
|
+
sx: {
|
14
|
+
height: '20px',
|
15
|
+
// match height of text row
|
16
|
+
minWidth: get('space.3'),
|
17
|
+
maxWidth: '20px',
|
18
|
+
// square (same as height)
|
19
|
+
display: 'flex',
|
20
|
+
justifyContent: 'center',
|
21
|
+
alignItems: 'center',
|
22
|
+
flexShrink: 0,
|
23
|
+
marginRight: 2,
|
24
|
+
...sx
|
25
|
+
}
|
26
|
+
}, props));
|
27
|
+
};
|
28
|
+
LeadingVisualContainer.displayName = "LeadingVisualContainer";
|
29
|
+
export const LeadingVisual = ({
|
30
|
+
variant,
|
31
|
+
disabled,
|
32
|
+
sx = {},
|
33
|
+
...props
|
34
|
+
}) => {
|
35
|
+
const {
|
36
|
+
registerSlot
|
37
|
+
} = React.useContext(ItemContext);
|
38
|
+
registerSlot('LeadingVisual', /*#__PURE__*/React.createElement(LeadingVisualContainer, _extends({
|
39
|
+
sx: {
|
40
|
+
color: getVariantStyles(variant, disabled).iconColor,
|
41
|
+
svg: {
|
42
|
+
fontSize: 0
|
43
|
+
},
|
44
|
+
...sx
|
45
|
+
}
|
46
|
+
}, props), props.children));
|
47
|
+
return null;
|
48
|
+
};
|
49
|
+
export const TrailingVisual = ({
|
50
|
+
variant,
|
51
|
+
disabled,
|
52
|
+
...props
|
53
|
+
}) => {
|
54
|
+
const {
|
55
|
+
registerSlot
|
56
|
+
} = React.useContext(ItemContext);
|
57
|
+
registerSlot('TrailingVisual', /*#__PURE__*/React.createElement(Box, _extends({
|
58
|
+
as: "span",
|
59
|
+
sx: {
|
60
|
+
height: '20px',
|
61
|
+
// match height of text row
|
62
|
+
flexShrink: 0,
|
63
|
+
color: getVariantStyles(variant, disabled).annotationColor,
|
64
|
+
marginLeft: 2
|
65
|
+
}
|
66
|
+
}, props), props.children));
|
67
|
+
return null;
|
68
|
+
};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/**
|
2
|
+
* These colors are not yet in our default theme.
|
3
|
+
* TODO: Need to remove this once they are added.
|
4
|
+
*/
|
5
|
+
export declare const customItemThemes: {
|
6
|
+
default: {
|
7
|
+
hover: {
|
8
|
+
light: string;
|
9
|
+
dark: string;
|
10
|
+
dark_dimmed: string;
|
11
|
+
};
|
12
|
+
focus: {
|
13
|
+
light: string;
|
14
|
+
dark: string;
|
15
|
+
dark_dimmed: string;
|
16
|
+
};
|
17
|
+
};
|
18
|
+
danger: {
|
19
|
+
hover: {
|
20
|
+
light: string;
|
21
|
+
dark: string;
|
22
|
+
dark_dimmed: string;
|
23
|
+
};
|
24
|
+
focus: {
|
25
|
+
light: string;
|
26
|
+
dark: string;
|
27
|
+
dark_dimmed: string;
|
28
|
+
};
|
29
|
+
};
|
30
|
+
};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/**
|
2
|
+
* These colors are not yet in our default theme.
|
3
|
+
* TODO: Need to remove this once they are added.
|
4
|
+
*/
|
5
|
+
export const customItemThemes = {
|
6
|
+
default: {
|
7
|
+
hover: {
|
8
|
+
light: 'rgba(46, 77, 108, 0.06)',
|
9
|
+
dark: 'rgba(201, 206, 212, 0.12)',
|
10
|
+
dark_dimmed: 'rgba(201, 206, 212, 0.12)'
|
11
|
+
},
|
12
|
+
focus: {
|
13
|
+
light: 'rgba(54, 77, 100, 0.16)',
|
14
|
+
dark: 'rgba(201, 206, 212, 0.24)',
|
15
|
+
dark_dimmed: 'rgba(201, 206, 212, 0.24)'
|
16
|
+
}
|
17
|
+
},
|
18
|
+
danger: {
|
19
|
+
hover: {
|
20
|
+
light: 'rgba(234, 74, 90, 0.08)',
|
21
|
+
dark: 'rgba(248, 81, 73, 0.16)',
|
22
|
+
dark_dimmed: 'rgba(248, 81, 73, 0.16)'
|
23
|
+
},
|
24
|
+
focus: {
|
25
|
+
light: 'rgba(234, 74, 90, 0.14)',
|
26
|
+
dark: 'rgba(248, 81, 73, 0.24)',
|
27
|
+
dark_dimmed: 'rgba(248, 81, 73, 0.24)'
|
28
|
+
}
|
29
|
+
}
|
30
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Group } from './Group';
|
3
|
+
import { Divider } from './Divider';
|
4
|
+
export type { ListProps as ActionListProps } from './List';
|
5
|
+
export type { GroupProps } from './Group';
|
6
|
+
export type { ItemProps } from './Item';
|
7
|
+
export type { DescriptionProps } from './Description';
|
8
|
+
export type { LeadingVisualProps, TrailingVisualProps } from './Visuals';
|
9
|
+
/**
|
10
|
+
* Collection of list-related components.
|
11
|
+
*/
|
12
|
+
export declare const ActionList: import("@radix-ui/react-polymorphic").ForwardRefComponent<"ul", import("./List").ListProps> & {
|
13
|
+
/** Collects related `Items` in an `ActionList`. */
|
14
|
+
Group: typeof Group;
|
15
|
+
/** An actionable or selectable `Item` with an optional icon and description. */
|
16
|
+
Item: import("@radix-ui/react-polymorphic").ForwardRefComponent<"li", import("./Item").ItemProps>;
|
17
|
+
/** Visually separates `Item`s or `Group`s in an `ActionList`. */
|
18
|
+
Divider: typeof Divider;
|
19
|
+
Description: import("react").FC<import("./Description").DescriptionProps>;
|
20
|
+
LeadingVisual: import("react").FC<Pick<import("./Item").ItemProps, "sx" | "disabled" | "variant"> & {
|
21
|
+
children: import("react").ReactNode;
|
22
|
+
}>;
|
23
|
+
TrailingVisual: import("react").FC<Pick<import("./Item").ItemProps, "sx" | "disabled" | "variant"> & {
|
24
|
+
children: import("react").ReactNode;
|
25
|
+
}>;
|
26
|
+
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { List } from './List';
|
2
|
+
import { Group } from './Group';
|
3
|
+
import { Item } from './Item';
|
4
|
+
import { Divider } from './Divider';
|
5
|
+
import { Description } from './Description';
|
6
|
+
import { LeadingVisual, TrailingVisual } from './Visuals';
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Collection of list-related components.
|
10
|
+
*/
|
11
|
+
export const ActionList = Object.assign(List, {
|
12
|
+
/** Collects related `Items` in an `ActionList`. */
|
13
|
+
Group,
|
14
|
+
|
15
|
+
/** An actionable or selectable `Item` with an optional icon and description. */
|
16
|
+
Item,
|
17
|
+
|
18
|
+
/** Visually separates `Item`s or `Group`s in an `ActionList`. */
|
19
|
+
Divider,
|
20
|
+
Description,
|
21
|
+
LeadingVisual,
|
22
|
+
TrailingVisual
|
23
|
+
});
|
package/lib-esm/index.d.ts
CHANGED
@@ -22,6 +22,7 @@ export { useOnEscapePress } from './hooks/useOnEscapePress';
|
|
22
22
|
export { useOverlay } from './hooks/useOverlay';
|
23
23
|
export { useConfirm } from './Dialog/ConfirmationDialog';
|
24
24
|
export { ActionList } from './ActionList';
|
25
|
+
export { ActionList as ActionList2 } from './ActionList2';
|
25
26
|
export { ActionMenu } from './ActionMenu';
|
26
27
|
export type { ActionMenuProps } from './ActionMenu';
|
27
28
|
export { default as Autocomplete } from './Autocomplete';
|
package/lib-esm/index.js
CHANGED
@@ -18,6 +18,7 @@ export { useOverlay } from './hooks/useOverlay';
|
|
18
18
|
export { useConfirm } from './Dialog/ConfirmationDialog'; // Components
|
19
19
|
|
20
20
|
export { ActionList } from './ActionList';
|
21
|
+
export { ActionList as ActionList2 } from './ActionList2';
|
21
22
|
export { ActionMenu } from './ActionMenu';
|
22
23
|
export { default as Autocomplete } from './Autocomplete';
|
23
24
|
export { default as Avatar } from './Avatar';
|