@primer/components 0.0.0-2021919182815 → 0.0.0-2021919184749

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