@carbon/react 1.38.0 → 1.39.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 (60) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1391 -782
  2. package/es/components/CodeSnippet/CodeSnippet.js +9 -2
  3. package/es/components/ComboBox/ComboBox.d.ts +30 -27
  4. package/es/components/ComboBox/ComboBox.js +23 -24
  5. package/es/components/Copy/Copy.js +6 -1
  6. package/es/components/CopyButton/CopyButton.js +6 -0
  7. package/es/components/FileUploader/FileUploader.js +1 -1
  8. package/es/components/Grid/index.d.ts +1 -0
  9. package/es/components/Link/Link.d.ts +1 -1
  10. package/es/components/Link/index.d.ts +2 -2
  11. package/es/components/MultiSelect/MultiSelect.d.ts +24 -0
  12. package/es/components/MultiSelect/MultiSelect.js +26 -0
  13. package/es/components/Popover/index.d.ts +9 -5
  14. package/es/components/Popover/index.js +2 -3
  15. package/es/components/StructuredList/StructuredList.Skeleton.d.ts +32 -0
  16. package/es/components/StructuredList/StructuredList.Skeleton.js +16 -26
  17. package/es/components/StructuredList/StructuredList.d.ts +271 -0
  18. package/es/components/StructuredList/StructuredList.js +14 -33
  19. package/es/components/StructuredList/index.d.ts +8 -0
  20. package/es/components/UIShell/HeaderContainer.d.ts +1 -1
  21. package/es/components/UIShell/HeaderMenuButton.d.ts +4 -2
  22. package/es/components/UIShell/HeaderMenuItem.d.ts +1 -1
  23. package/es/components/UIShell/HeaderName.d.ts +1 -1
  24. package/es/components/UIShell/HeaderNavigation.d.ts +2 -5
  25. package/es/components/UIShell/HeaderSideNavItems.d.ts +1 -1
  26. package/es/components/UIShell/SideNav.d.ts +1 -1
  27. package/es/components/UIShell/SideNavDivider.js +2 -2
  28. package/es/components/UIShell/SkipToContent.d.ts +1 -1
  29. package/es/components/UIShell/index.d.ts +8 -8
  30. package/es/index.js +3 -2
  31. package/lib/components/CodeSnippet/CodeSnippet.js +9 -2
  32. package/lib/components/ComboBox/ComboBox.d.ts +30 -27
  33. package/lib/components/ComboBox/ComboBox.js +22 -23
  34. package/lib/components/Copy/Copy.js +6 -1
  35. package/lib/components/CopyButton/CopyButton.js +6 -0
  36. package/lib/components/FileUploader/FileUploader.js +1 -1
  37. package/lib/components/Grid/index.d.ts +1 -0
  38. package/lib/components/Link/Link.d.ts +1 -1
  39. package/lib/components/Link/index.d.ts +2 -2
  40. package/lib/components/MultiSelect/MultiSelect.d.ts +24 -0
  41. package/lib/components/MultiSelect/MultiSelect.js +26 -0
  42. package/lib/components/Popover/index.d.ts +9 -5
  43. package/lib/components/Popover/index.js +2 -3
  44. package/lib/components/StructuredList/StructuredList.Skeleton.d.ts +32 -0
  45. package/lib/components/StructuredList/StructuredList.Skeleton.js +16 -26
  46. package/lib/components/StructuredList/StructuredList.d.ts +271 -0
  47. package/lib/components/StructuredList/StructuredList.js +14 -33
  48. package/lib/components/StructuredList/index.d.ts +8 -0
  49. package/lib/components/UIShell/HeaderContainer.d.ts +1 -1
  50. package/lib/components/UIShell/HeaderMenuButton.d.ts +4 -2
  51. package/lib/components/UIShell/HeaderMenuItem.d.ts +1 -1
  52. package/lib/components/UIShell/HeaderName.d.ts +1 -1
  53. package/lib/components/UIShell/HeaderNavigation.d.ts +2 -5
  54. package/lib/components/UIShell/HeaderSideNavItems.d.ts +1 -1
  55. package/lib/components/UIShell/SideNav.d.ts +1 -1
  56. package/lib/components/UIShell/SideNavDivider.js +2 -2
  57. package/lib/components/UIShell/SkipToContent.d.ts +1 -1
  58. package/lib/components/UIShell/index.d.ts +8 -8
  59. package/lib/index.js +11 -9
  60. package/package.json +5 -6
@@ -0,0 +1,271 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { type HTMLAttributes, type ReactNode, type KeyboardEvent, type ChangeEvent, type MouseEvent } from 'react';
8
+ import PropTypes from 'prop-types';
9
+ type DivAttrs = HTMLAttributes<HTMLDivElement>;
10
+ export interface StructuredListWrapperProps extends DivAttrs {
11
+ /**
12
+ * Specify a label to be read by screen readers on the container node
13
+ */
14
+ 'aria-label'?: string;
15
+ /**
16
+ * Provide the contents of your StructuredListWrapper
17
+ */
18
+ children?: ReactNode;
19
+ /**
20
+ * Specify an optional className to be applied to the container node
21
+ */
22
+ className?: string;
23
+ /**
24
+ * Specify if structured list is condensed, default is false
25
+ */
26
+ isCondensed?: boolean;
27
+ /**
28
+ * Specify if structured list is flush, default is false
29
+ */
30
+ isFlush?: boolean;
31
+ /**
32
+ * Specify whether your StructuredListWrapper should have selections
33
+ */
34
+ selection?: boolean;
35
+ }
36
+ export declare function StructuredListWrapper(props: StructuredListWrapperProps): JSX.Element;
37
+ export declare namespace StructuredListWrapper {
38
+ var propTypes: {
39
+ /**
40
+ * Specify a label to be read by screen readers on the container node
41
+ */
42
+ "aria-label": PropTypes.Requireable<string>;
43
+ /**
44
+ * Deprecated, please use `aria-label` instead.
45
+ * Specify a label to be read by screen readers on the container note.
46
+ */
47
+ ariaLabel: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
48
+ /**
49
+ * Provide the contents of your StructuredListWrapper
50
+ */
51
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
52
+ /**
53
+ * Specify an optional className to be applied to the container node
54
+ */
55
+ className: PropTypes.Requireable<string>;
56
+ /**
57
+ * Specify if structured list is condensed, default is false
58
+ */
59
+ isCondensed: PropTypes.Requireable<boolean>;
60
+ /**
61
+ * Specify if structured list is flush, not valid for selection variant, default is false
62
+ */
63
+ isFlush: PropTypes.Requireable<boolean>;
64
+ /**
65
+ * Specify whether your StructuredListWrapper should have selections
66
+ */
67
+ selection: PropTypes.Requireable<boolean>;
68
+ };
69
+ }
70
+ export interface StructuredListHeadProps extends DivAttrs {
71
+ /**
72
+ * Provide the contents of your StructuredListHead
73
+ */
74
+ children?: ReactNode;
75
+ /**
76
+ * Specify an optional className to be applied to the node
77
+ */
78
+ className?: string;
79
+ }
80
+ export declare function StructuredListHead(props: any): JSX.Element;
81
+ export declare namespace StructuredListHead {
82
+ var propTypes: {
83
+ /**
84
+ * Provide the contents of your StructuredListHead
85
+ */
86
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
87
+ /**
88
+ * Specify an optional className to be applied to the node
89
+ */
90
+ className: PropTypes.Requireable<string>;
91
+ };
92
+ }
93
+ export interface StructuredListBodyProps extends DivAttrs {
94
+ /**
95
+ * Provide the contents of your StructuredListBody
96
+ */
97
+ children?: ReactNode;
98
+ /**
99
+ * Specify an optional className to be applied to the container node
100
+ */
101
+ className?: string;
102
+ head?: boolean;
103
+ /**
104
+ * Provide a handler that is invoked on the key down event for the control
105
+ */
106
+ onKeyDown?(event: KeyboardEvent): void;
107
+ }
108
+ export declare function StructuredListBody(props: StructuredListBodyProps): JSX.Element;
109
+ export declare namespace StructuredListBody {
110
+ var propTypes: {
111
+ /**
112
+ * Provide the contents of your StructuredListBody
113
+ */
114
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
115
+ /**
116
+ * Specify an optional className to be applied to the container node
117
+ */
118
+ className: PropTypes.Requireable<string>;
119
+ head: PropTypes.Requireable<boolean>;
120
+ /**
121
+ * Provide a handler that is invoked on the key down event for the control
122
+ */
123
+ onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
124
+ };
125
+ }
126
+ export interface StructuredListRowProps extends DivAttrs {
127
+ /**
128
+ * Provide the contents of your StructuredListRow
129
+ */
130
+ children?: ReactNode;
131
+ /**
132
+ * Specify an optional className to be applied to the container node
133
+ */
134
+ className?: string;
135
+ /**
136
+ * Specify whether your StructuredListRow should be used as a header row
137
+ */
138
+ head?: boolean;
139
+ /**
140
+ * Provide a handler that is invoked on the click
141
+ */
142
+ onClick?(event: MouseEvent): void;
143
+ /**
144
+ * Provide a handler that is invoked on the key down event for the control
145
+ */
146
+ onKeyDown?(event: KeyboardEvent): void;
147
+ }
148
+ export declare function StructuredListRow(props: StructuredListRowProps): JSX.Element;
149
+ export declare namespace StructuredListRow {
150
+ var propTypes: {
151
+ /**
152
+ * Provide the contents of your StructuredListRow
153
+ */
154
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
155
+ /**
156
+ * Specify an optional className to be applied to the container node
157
+ */
158
+ className: PropTypes.Requireable<string>;
159
+ /**
160
+ * Specify whether your StructuredListRow should be used as a header row
161
+ */
162
+ head: PropTypes.Requireable<boolean>;
163
+ /**
164
+ * Specify whether a `<label>` should be used
165
+ */
166
+ label: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
167
+ /**
168
+ * Provide a handler that is invoked on the click
169
+ */
170
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
171
+ /**
172
+ * Provide a handler that is invoked on the key down event for the control,
173
+ */
174
+ onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
175
+ };
176
+ }
177
+ export interface StructuredListInputProps extends DivAttrs {
178
+ /**
179
+ * Specify an optional className to be applied to the input
180
+ */
181
+ className?: string;
182
+ /**
183
+ * Specify a custom `id` for the input
184
+ */
185
+ id?: string;
186
+ /**
187
+ * Provide a `name` for the input
188
+ */
189
+ name?: string;
190
+ /**
191
+ * Provide an optional hook that is called each time the input is updated
192
+ */
193
+ onChange?(event: ChangeEvent<HTMLInputElement>): void;
194
+ /**
195
+ * Provide a `title` for the input
196
+ */
197
+ title?: string;
198
+ }
199
+ export declare function StructuredListInput(props: StructuredListInputProps): JSX.Element;
200
+ export declare namespace StructuredListInput {
201
+ var propTypes: {
202
+ /**
203
+ * Specify an optional className to be applied to the input
204
+ */
205
+ className: PropTypes.Requireable<string>;
206
+ /**
207
+ * Specify whether the underlying input should be checked by default
208
+ */
209
+ defaultChecked: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
210
+ /**
211
+ * Specify a custom `id` for the input
212
+ */
213
+ id: PropTypes.Requireable<string>;
214
+ /**
215
+ * Provide a `name` for the input
216
+ */
217
+ name: PropTypes.Requireable<string>;
218
+ /**
219
+ * Provide an optional hook that is called each time the input is updated
220
+ */
221
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
222
+ /**
223
+ * Provide a `title` for the input
224
+ */
225
+ title: PropTypes.Requireable<string>;
226
+ /**
227
+ * Specify the value of the input
228
+ */
229
+ value: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
230
+ };
231
+ }
232
+ export interface StructuredListCellProps extends DivAttrs {
233
+ /**
234
+ * Provide the contents of your StructuredListCell
235
+ */
236
+ children?: ReactNode;
237
+ /**
238
+ * Specify an optional className to be applied to the container node
239
+ */
240
+ className?: string;
241
+ /**
242
+ * Specify whether your StructuredListCell should be used as a header cell
243
+ */
244
+ head?: boolean;
245
+ /**
246
+ * Specify whether your StructuredListCell should have text wrapping
247
+ */
248
+ noWrap?: boolean;
249
+ }
250
+ export declare function StructuredListCell(props: StructuredListCellProps): JSX.Element;
251
+ export declare namespace StructuredListCell {
252
+ var propTypes: {
253
+ /**
254
+ * Provide the contents of your StructuredListCell
255
+ */
256
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
257
+ /**
258
+ * Specify an optional className to be applied to the container node
259
+ */
260
+ className: PropTypes.Requireable<string>;
261
+ /**
262
+ * Specify whether your StructuredListCell should be used as a header cell
263
+ */
264
+ head: PropTypes.Requireable<boolean>;
265
+ /**
266
+ * Specify whether your StructuredListCell should have text wrapping
267
+ */
268
+ noWrap: PropTypes.Requireable<boolean>;
269
+ };
270
+ }
271
+ export {};
@@ -20,18 +20,19 @@ function StructuredListWrapper(props) {
20
20
  children,
21
21
  selection,
22
22
  className,
23
- ['aria-label']: ariaLabel,
23
+ ['aria-label']: ariaLabel = 'Structured list section',
24
+ // @ts-expect-error: Deprecated prop
24
25
  ariaLabel: deprecatedAriaLabel,
25
26
  isCondensed,
26
27
  isFlush,
27
28
  ...other
28
29
  } = props;
29
30
  const prefix = usePrefix();
30
- const classes = cx(`${prefix}--structured-list`, className, {
31
+ const classes = cx(`${prefix}--structured-list`, {
31
32
  [`${prefix}--structured-list--selection`]: selection,
32
33
  [`${prefix}--structured-list--condensed`]: isCondensed,
33
34
  [`${prefix}--structured-list--flush`]: isFlush && !selection
34
- });
35
+ }, className);
35
36
  const [selectedRow, setSelectedRow] = React__default.useState(null);
36
37
  return /*#__PURE__*/React__default.createElement(GridSelectedRowStateContext.Provider, {
37
38
  value: selectedRow
@@ -75,12 +76,6 @@ StructuredListWrapper.propTypes = {
75
76
  */
76
77
  selection: PropTypes.bool
77
78
  };
78
- StructuredListWrapper.defaultProps = {
79
- selection: false,
80
- isCondensed: false,
81
- isFlush: false,
82
- ['aria-label']: 'Structured list section'
83
- };
84
79
  function StructuredListHead(props) {
85
80
  const {
86
81
  children,
@@ -132,9 +127,6 @@ StructuredListBody.propTypes = {
132
127
  */
133
128
  onKeyDown: PropTypes.func
134
129
  };
135
- StructuredListBody.defaultProps = {
136
- onKeyDown: () => {}
137
- };
138
130
  const GridRowContext = /*#__PURE__*/React__default.createContext(null);
139
131
  function StructuredListRow(props) {
140
132
  const {
@@ -153,11 +145,11 @@ function StructuredListRow(props) {
153
145
  const value = {
154
146
  id
155
147
  };
156
- const classes = cx(`${prefix}--structured-list-row`, className, {
148
+ const classes = cx(`${prefix}--structured-list-row`, {
157
149
  [`${prefix}--structured-list-row--header-row`]: head,
158
150
  [`${prefix}--structured-list-row--focused-within`]: hasFocusWithin,
159
151
  [`${prefix}--structured-list-row--selected`]: selectedRow === id
160
- });
152
+ }, className);
161
153
  return head ? /*#__PURE__*/React__default.createElement("div", _extends({
162
154
  role: "row"
163
155
  }, other, {
@@ -171,9 +163,9 @@ function StructuredListRow(props) {
171
163
  }, other, {
172
164
  role: "row",
173
165
  className: classes,
174
- onClick: () => {
175
- setSelectedRow(id);
176
- onClick && onClick();
166
+ onClick: event => {
167
+ setSelectedRow?.(id);
168
+ onClick && onClick(event);
177
169
  },
178
170
  onFocus: () => {
179
171
  setHasFocusWithin(true);
@@ -204,7 +196,7 @@ StructuredListRow.propTypes = {
204
196
  */
205
197
  label: deprecate(PropTypes.bool, `\nThe \`label\` prop is no longer needed and will be removed in the next major version of Carbon.`),
206
198
  /**
207
- * Provide a handler that is invoked on the click,
199
+ * Provide a handler that is invoked on the click
208
200
  */
209
201
  onClick: PropTypes.func,
210
202
  /**
@@ -212,10 +204,6 @@ StructuredListRow.propTypes = {
212
204
  */
213
205
  onKeyDown: PropTypes.func
214
206
  };
215
- StructuredListRow.defaultProps = {
216
- head: false,
217
- onKeyDown: () => {}
218
- };
219
207
  function StructuredListInput(props) {
220
208
  const defaultId = useId('structureListInput');
221
209
  const {
@@ -234,10 +222,10 @@ function StructuredListInput(props) {
234
222
  return /*#__PURE__*/React__default.createElement("input", _extends({}, other, {
235
223
  type: "radio",
236
224
  tabIndex: 0,
237
- checked: row && row.id === selectedRow,
225
+ checked: !!row && row.id === selectedRow,
238
226
  value: row?.id ?? '',
239
227
  onChange: event => {
240
- setSelectedRow(event.target.value);
228
+ setSelectedRow?.(event.target.value);
241
229
  onChange && onChange(event);
242
230
  },
243
231
  id: id ?? defaultId,
@@ -276,9 +264,6 @@ StructuredListInput.propTypes = {
276
264
  */
277
265
  value: deprecate(PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, `\nThe prop \`value\` will be removed in the next major version of Carbon.`)
278
266
  };
279
- StructuredListInput.defaultProps = {
280
- title: 'title'
281
- };
282
267
  function StructuredListCell(props) {
283
268
  const {
284
269
  children,
@@ -288,11 +273,11 @@ function StructuredListCell(props) {
288
273
  ...other
289
274
  } = props;
290
275
  const prefix = usePrefix();
291
- const classes = cx(className, {
276
+ const classes = cx({
292
277
  [`${prefix}--structured-list-th`]: head,
293
278
  [`${prefix}--structured-list-td`]: !head,
294
279
  [`${prefix}--structured-list-content--nowrap`]: noWrap
295
- });
280
+ }, className);
296
281
  if (head) {
297
282
  return /*#__PURE__*/React__default.createElement("span", _extends({
298
283
  className: classes,
@@ -322,9 +307,5 @@ StructuredListCell.propTypes = {
322
307
  */
323
308
  noWrap: PropTypes.bool
324
309
  };
325
- StructuredListCell.defaultProps = {
326
- head: false,
327
- noWrap: false
328
- };
329
310
 
330
311
  export { StructuredListBody, StructuredListCell, StructuredListHead, StructuredListInput, StructuredListRow, StructuredListWrapper };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export * from './StructuredList';
8
+ export { default as StructuredListSkeleton, type StructuredListSkeletonProps, } from './StructuredList.Skeleton';
@@ -10,7 +10,7 @@ interface HeaderContainerRenderProps {
10
10
  isSideNavExpanded: boolean;
11
11
  onClickSideNavExpand: () => void;
12
12
  }
13
- interface HeaderContainerProps {
13
+ export interface HeaderContainerProps {
14
14
  isSideNavExpanded?: boolean;
15
15
  render: React.ComponentType<HeaderContainerRenderProps>;
16
16
  }
@@ -7,7 +7,7 @@
7
7
  import { type ComponentProps } from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  type HeaderMenuButtonBaseProps = Omit<ComponentProps<'button'>, 'title' | 'type'>;
10
- interface HeaderMenuButtonProps extends HeaderMenuButtonBaseProps {
10
+ export interface HeaderMenuButtonProps extends HeaderMenuButtonBaseProps {
11
11
  'aria-label'?: string;
12
12
  'aria-labelledby'?: string;
13
13
  className?: string;
@@ -74,7 +74,9 @@ declare namespace HeaderMenuButton {
74
74
  fill(value: string, start?: number | undefined, end?: number | undefined): [key: string];
75
75
  copyWithin(target: number, start: number, end?: number | undefined): [key: string];
76
76
  entries(): IterableIterator<[number, string]>;
77
- keys(): IterableIterator<number>;
77
+ keys(): IterableIterator<number>; /**
78
+ * Specify whether the menu button is collapsible.
79
+ */
78
80
  values(): IterableIterator<string>;
79
81
  includes(searchElement: string, fromIndex?: number | undefined): boolean;
80
82
  flatMap<U_3, This = undefined>(callback: (this: This, value: string, index: number, array: string[]) => U_3 | readonly U_3[], thisArg?: This | undefined): U_3[];
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { type ComponentProps, type ForwardedRef, type ReactNode, ElementType, WeakValidationMap } from 'react';
8
8
  import { LinkProps } from './Link';
9
- type HeaderMenuItemProps<E extends ElementType> = LinkProps<E> & {
9
+ export type HeaderMenuItemProps<E extends ElementType> = LinkProps<E> & {
10
10
  className?: string | undefined;
11
11
  isActive?: boolean | undefined;
12
12
  isCurrentPage?: boolean | undefined;
@@ -7,7 +7,7 @@
7
7
  import { type ElementType } from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import { type LinkProps } from './Link';
10
- type HeaderNameProps<E extends ElementType> = LinkProps<E> & {
10
+ export type HeaderNameProps<E extends ElementType> = LinkProps<E> & {
11
11
  prefix?: string | undefined;
12
12
  };
13
13
  declare function HeaderName<E extends ElementType = 'a'>({ children, className: customClassName, prefix, ...rest }: HeaderNameProps<E>): JSX.Element;
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { type ComponentProps } from 'react';
8
8
  import PropTypes from 'prop-types';
9
- type HeaderNavigationProps = ComponentProps<'nav'>;
9
+ export type HeaderNavigationProps = ComponentProps<'nav'>;
10
10
  declare function HeaderNavigation({ 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, children, className: customClassName, ...rest }: HeaderNavigationProps): JSX.Element;
11
11
  declare namespace HeaderNavigation {
12
12
  var propTypes: {
@@ -61,10 +61,7 @@ declare namespace HeaderNavigation {
61
61
  includes(searchElement: string, fromIndex?: number | undefined): boolean;
62
62
  flatMap<U_3, This = undefined>(callback: (this: This, value: string, index: number, array: string[]) => U_3 | readonly U_3[], thisArg?: This | undefined): U_3[];
63
63
  flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
64
- at(index: number): string | undefined; /**
65
- * Provide valid children of HeaderNavigation, for example `HeaderMenuItem`
66
- * or `HeaderMenu`
67
- */
64
+ at(index: number): string | undefined;
68
65
  [Symbol.iterator](): IterableIterator<string>;
69
66
  [Symbol.unscopables](): {
70
67
  copyWithin: boolean;
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { type ReactNode } from 'react';
8
8
  import PropTypes from 'prop-types';
9
- interface HeaderSideNavItemsProps {
9
+ export interface HeaderSideNavItemsProps {
10
10
  className?: string | undefined;
11
11
  children?: ReactNode;
12
12
  hasDivider?: boolean | undefined;
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React, { type ComponentProps, type FocusEvent, type KeyboardEvent, type MouseEventHandler } from 'react';
8
- interface SideNavProps extends ComponentProps<'nav'> {
8
+ export interface SideNavProps extends ComponentProps<'nav'> {
9
9
  expanded?: boolean | undefined;
10
10
  defaultExpanded?: boolean | undefined;
11
11
  isChildOfHeader?: boolean | undefined;
@@ -10,6 +10,7 @@ import PropTypes from 'prop-types';
10
10
  import React__default from 'react';
11
11
  import { usePrefix } from '../../internal/usePrefix.js';
12
12
 
13
+ var _hr;
13
14
  function SideNavDivider(_ref) {
14
15
  let {
15
16
  className
@@ -17,9 +18,8 @@ function SideNavDivider(_ref) {
17
18
  const prefix = usePrefix();
18
19
  const classNames = cx(`${prefix}--side-nav__divider`, className);
19
20
  return /*#__PURE__*/React__default.createElement("li", {
20
- role: "separator",
21
21
  className: classNames
22
- });
22
+ }, _hr || (_hr = /*#__PURE__*/React__default.createElement("hr", null)));
23
23
  }
24
24
  SideNavDivider.propTypes = {
25
25
  /**
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { ComponentProps } from 'react';
8
8
  import PropTypes from 'prop-types';
9
- type SkipToContentProps = Omit<ComponentProps<'a'>, 'children'> & {
9
+ export type SkipToContentProps = Omit<ComponentProps<'a'>, 'children'> & {
10
10
  children?: string | undefined;
11
11
  };
12
12
  declare function SkipToContent({ children, className: customClassName, href, tabIndex, ...rest }: SkipToContentProps): JSX.Element;
@@ -6,21 +6,21 @@
6
6
  */
7
7
  export { default as Content } from './Content';
8
8
  export { default as Header } from './Header';
9
- export { default as HeaderContainer } from './HeaderContainer';
9
+ export { default as HeaderContainer, type HeaderContainerProps, } from './HeaderContainer';
10
10
  export { default as HeaderGlobalAction } from './HeaderGlobalAction';
11
11
  export { default as HeaderGlobalBar } from './HeaderGlobalBar';
12
12
  export { default as HeaderMenu } from './HeaderMenu';
13
- export { default as HeaderMenuButton } from './HeaderMenuButton';
14
- export { default as HeaderMenuItem } from './HeaderMenuItem';
15
- export { default as HeaderName } from './HeaderName';
16
- export { default as HeaderNavigation } from './HeaderNavigation';
13
+ export { default as HeaderMenuButton, type HeaderMenuButtonProps, } from './HeaderMenuButton';
14
+ export { default as HeaderMenuItem, type HeaderMenuItemProps, } from './HeaderMenuItem';
15
+ export { default as HeaderName, type HeaderNameProps } from './HeaderName';
16
+ export { default as HeaderNavigation, type HeaderNavigationProps, } from './HeaderNavigation';
17
17
  export { default as HeaderPanel } from './HeaderPanel';
18
- export { default as HeaderSideNavItems } from './HeaderSideNavItems';
18
+ export { default as HeaderSideNavItems, type HeaderSideNavItemsProps, } from './HeaderSideNavItems';
19
19
  export { default as Switcher } from './Switcher';
20
20
  export { default as SwitcherItem } from './SwitcherItem';
21
21
  export { default as SwitcherDivider } from './SwitcherDivider';
22
- export { default as SkipToContent } from './SkipToContent';
23
- export { default as SideNav } from './SideNav';
22
+ export { default as SkipToContent, type SkipToContentProps, } from './SkipToContent';
23
+ export { default as SideNav, type SideNavProps } from './SideNav';
24
24
  export { default as SideNavDetails } from './SideNavDetails';
25
25
  export { default as SideNavDivider } from './SideNavDivider';
26
26
  export { default as SideNavFooter } from './SideNavFooter';
package/es/index.js CHANGED
@@ -50,6 +50,7 @@ export { Grid } from './components/Grid/Grid.js';
50
50
  export { default as Row } from './components/Grid/Row.js';
51
51
  export { default as Column } from './components/Grid/Column.js';
52
52
  export { ColumnHang } from './components/Grid/ColumnHang.js';
53
+ export { GridSettings } from './components/Grid/GridContext.js';
53
54
  export { default as IconSkeleton } from './components/Icon/Icon.Skeleton.js';
54
55
  export { IdPrefix } from './components/IdPrefix/index.js';
55
56
  export { default as Link } from './components/Link/Link.js';
@@ -75,6 +76,8 @@ export { default as SelectItemGroup } from './components/SelectItemGroup/SelectI
75
76
  export { default as SkeletonPlaceholder } from './components/SkeletonPlaceholder/SkeletonPlaceholder.js';
76
77
  export { default as SkeletonText } from './components/SkeletonText/SkeletonText.js';
77
78
  export { default as Slider } from './components/Slider/index.js';
79
+ export { StructuredListBody, StructuredListCell, StructuredListHead, StructuredListInput, StructuredListRow, StructuredListWrapper } from './components/StructuredList/StructuredList.js';
80
+ export { default as StructuredListSkeleton } from './components/StructuredList/StructuredList.Skeleton.js';
78
81
  export { IconTab, Tab, TabList, TabPanel, TabPanels, Tabs } from './components/Tabs/Tabs.js';
79
82
  export { default as TabContent } from './components/TabContent/TabContent.js';
80
83
  export { default as TabsSkeleton } from './components/Tabs/Tabs.Skeleton.js';
@@ -214,8 +217,6 @@ export { default as RadioTile } from './components/RadioTile/RadioTile.js';
214
217
  export { default as SecondaryButton } from './components/SecondaryButton/SecondaryButton.js';
215
218
  export { default as SkeletonIcon } from './components/SkeletonIcon/SkeletonIcon.js';
216
219
  export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
217
- export { default as StructuredListSkeleton } from './components/StructuredList/StructuredList.Skeleton.js';
218
- export { StructuredListBody, StructuredListCell, StructuredListHead, StructuredListInput, StructuredListRow, StructuredListWrapper } from './components/StructuredList/StructuredList.js';
219
220
  export { default as Switch } from './components/Switch/Switch.js';
220
221
  export { default as IconSwitch } from './components/Switch/IconSwitch.js';
221
222
  export { Stack } from './components/Stack/Stack.js';
@@ -39,6 +39,7 @@ const defaultMinCollapsedNumberOfRows = 3;
39
39
  const defaultMinExpandedNumberOfRows = 16;
40
40
  function CodeSnippet(_ref) {
41
41
  let {
42
+ align = 'bottom',
42
43
  className,
43
44
  type,
44
45
  children,
@@ -158,6 +159,7 @@ function CodeSnippet(_ref) {
158
159
  }, children));
159
160
  }
160
161
  return /*#__PURE__*/React__default["default"].createElement(Copy["default"], _rollupPluginBabelHelpers["extends"]({}, rest, {
162
+ align: align,
161
163
  onClick: handleCopyClick,
162
164
  "aria-label": deprecatedAriaLabel || ariaLabel,
163
165
  "aria-describedby": uid,
@@ -212,6 +214,7 @@ function CodeSnippet(_ref) {
212
214
  }), hasRightOverflow && type !== 'multi' && /*#__PURE__*/React__default["default"].createElement("div", {
213
215
  className: `${prefix}--snippet__overflow-indicator--right`
214
216
  }), !hideCopyButton && /*#__PURE__*/React__default["default"].createElement(CopyButton["default"], {
217
+ align: align,
215
218
  size: type === 'multi' ? 'sm' : 'md',
216
219
  disabled: disabled,
217
220
  onClick: handleCopyClick,
@@ -234,13 +237,17 @@ function CodeSnippet(_ref) {
234
237
  }
235
238
  CodeSnippet.propTypes = {
236
239
  /**
237
- * Specify a label to be read by screen readers on the containing <textbox>
240
+ * Specify how the trigger should align with the tooltip
241
+ */
242
+ align: PropTypes__default["default"].oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'right']),
243
+ /**
244
+ * Specify a label to be read by screen readers on the containing textbox
238
245
  * node
239
246
  */
240
247
  ['aria-label']: PropTypes__default["default"].string,
241
248
  /**
242
249
  * Deprecated, please use `aria-label` instead.
243
- * Specify a label to be read by screen readers on the containing <textbox>
250
+ * Specify a label to be read by screen readers on the containing textbox
244
251
  * node
245
252
  */
246
253
  ariaLabel: deprecate["default"](PropTypes__default["default"].string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),