Skip to content

Commit bbe93e8

Browse files
authored
Prevent adding classname attribute for react wrapped components (#108)
Co-authored-by: Frédéric Collonval <[email protected]>
1 parent 9d0de6f commit bbe93e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+81
-39
lines changed

packages/react-components/lib/Accordion.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ provideJupyterDesignSystem().register(jpAccordion());
1313

1414
export const Accordion = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { expandMode, ...filteredProps } = props;
16+
const { className, expandMode, ...filteredProps } = props;
1717

1818
/** Event listeners - run once */
1919
useEventListener(ref, 'change', props.onChange);

packages/react-components/lib/AccordionItem.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ provideJupyterDesignSystem().register(jpAccordionItem());
1313

1414
export const AccordionItem = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { headingLevel, id, expanded, ...filteredProps } = props;
16+
const { className, headingLevel, id, expanded, ...filteredProps } = props;
1717

1818
/** Event listeners - run once */
1919
useEventListener(ref, 'change', props.onChange);

packages/react-components/lib/Anchor.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ provideJupyterDesignSystem().register(jpAnchor());
1111
export const Anchor = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
1313
const {
14+
className,
1415
appearance,
1516
download,
1617
href,

packages/react-components/lib/AnchoredRegion.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ provideJupyterDesignSystem().register(jpAnchoredRegion());
1414
export const AnchoredRegion = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
1616
const {
17+
className,
1718
horizontalViewportLock,
1819
horizontalInset,
1920
verticalViewportLock,

packages/react-components/lib/Avatar.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ provideJupyterDesignSystem().register(jpAvatar());
1010

1111
export const Avatar = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
13-
const { src, alt, fill, color, link, shape, ...filteredProps } = props;
13+
const { className, src, alt, fill, color, link, shape, ...filteredProps } =
14+
props;
1415

1516
/** Properties - run whenever a property has changed */
1617

packages/react-components/lib/Badge.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ provideJupyterDesignSystem().register(jpBadge());
1010

1111
export const Badge = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
13-
const { fill, color, circular, ...filteredProps } = props;
13+
const { className, fill, color, circular, ...filteredProps } = props;
1414

1515
/** Properties - run whenever a property has changed */
1616
useProperties(ref, 'circular', props.circular);

packages/react-components/lib/Breadcrumb.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ provideJupyterDesignSystem().register(jpBreadcrumb());
1313

1414
export const Breadcrumb = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { ...filteredProps } = props;
16+
const { className, ...filteredProps } = props;
1717

1818
/** Properties - run whenever a property has changed */
1919

packages/react-components/lib/BreadcrumbItem.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ provideJupyterDesignSystem().register(jpBreadcrumbItem());
1414
export const BreadcrumbItem = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
1616
const {
17+
className,
1718
download,
1819
href,
1920
hreflang,

packages/react-components/lib/Button.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import {
22
Button as ButtonElement,
3-
type ButtonScale
3+
type ButtonScale,
4+
type ButtonAppearance
45
} from '@jupyter/web-components';
56

6-
export type { ButtonElement };
7+
export type { ButtonAppearance, ButtonElement, ButtonScale };
78

89
export interface ButtonProps
910
extends Omit<React.AllHTMLAttributes<HTMLElement>, 'form'> {

packages/react-components/lib/Button.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ provideJupyterDesignSystem().register(jpButton());
1111
export const Button = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
1313
const {
14+
className,
1415
minimal,
1516
appearance,
1617
form,

packages/react-components/lib/Card.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ provideJupyterDesignSystem().register(jpCard());
1010

1111
export const Card = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
13-
const { ...filteredProps } = props;
13+
const { className, ...filteredProps } = props;
1414

1515
/** Properties - run whenever a property has changed */
1616

packages/react-components/lib/Checkbox.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ provideJupyterDesignSystem().register(jpCheckbox());
1414
export const Checkbox = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
1616
const {
17+
className,
1718
readonly,
1819
readOnly,
1920
indeterminate,

packages/react-components/lib/Combobox.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
type ComboboxScale
44
} from '@jupyter/web-components';
55

6-
export type { ComboboxElement };
6+
export type { ComboboxElement, ComboboxScale };
77

88
export interface ComboboxProps
99
extends Omit<React.AllHTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {

packages/react-components/lib/Combobox.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ import {
22
jpCombobox,
33
provideJupyterDesignSystem
44
} from '@jupyter/web-components';
5-
import React, {
6-
forwardRef,
7-
useEffect,
8-
useImperativeHandle,
9-
useRef
10-
} from 'react';
5+
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
116
import { useEventListener, useProperties } from './react-utils.js';
127
provideJupyterDesignSystem().register(jpCombobox());
138

149
export const Combobox = forwardRef((props, forwardedRef) => {
1510
const ref = useRef(null);
1611
const {
12+
className,
1713
autowidth,
1814
minimal,
1915
open,

packages/react-components/lib/DataGrid.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ provideJupyterDesignSystem().register(jpDataGrid());
1414
export const DataGrid = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
1616
const {
17+
className,
1718
noTabbing,
1819
generateHeader,
1920
gridTemplateColumns,

packages/react-components/lib/DataGridCell.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ provideJupyterDesignSystem().register(jpDataGridCell());
1313

1414
export const DataGridCell = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { cellType, gridColumn, rowData, columnDefinition, ...filteredProps } =
17-
props;
16+
const {
17+
className,
18+
cellType,
19+
gridColumn,
20+
rowData,
21+
columnDefinition,
22+
...filteredProps
23+
} = props;
1824

1925
/** Event listeners - run once */
2026
useEventListener(ref, 'cell-focused', props.onCellFocused);

packages/react-components/lib/DataGridRow.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ provideJupyterDesignSystem().register(jpDataGridRow());
1414
export const DataGridRow = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
1616
const {
17+
className,
1718
gridTemplateColumns,
1819
rowType,
1920
rowData,

packages/react-components/lib/DateField.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@ provideJupyterDesignSystem().register(jpDateField());
1313

1414
export const DateField = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { autofocus, step, max, min, disabled, required, ...filteredProps } =
17-
props;
16+
const {
17+
className,
18+
autofocus,
19+
step,
20+
max,
21+
min,
22+
disabled,
23+
required,
24+
...filteredProps
25+
} = props;
1826

1927
/** Event listeners - run once */
2028
useEventListener(ref, 'input', props.onInput);

packages/react-components/lib/Dialog.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ provideJupyterDesignSystem().register(jpDialog());
1111
export const Dialog = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
1313
const {
14+
className,
1415
trapFocus,
1516
ariaDescribedby,
1617
ariaLabelledby,

packages/react-components/lib/Disclosure.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ provideJupyterDesignSystem().register(jpDisclosure());
1313

1414
export const Disclosure = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { appearance, title, expanded, ...filteredProps } = props;
16+
const { className, appearance, title, expanded, ...filteredProps } = props;
1717

1818
/** Event listeners - run once */
1919
useEventListener(ref, 'toggle', props.onToggle);

packages/react-components/lib/Divider.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ provideJupyterDesignSystem().register(jpDivider());
1010

1111
export const Divider = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
13-
const { role, orientation, ...filteredProps } = props;
13+
const { className, role, orientation, ...filteredProps } = props;
1414

1515
/** Properties - run whenever a property has changed */
1616

packages/react-components/lib/Listbox.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ provideJupyterDesignSystem().register(jpListbox());
1111
export const Listbox = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
1313
const {
14+
className,
1415
multiple,
1516
size,
1617
length,

packages/react-components/lib/Menu.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ provideJupyterDesignSystem().register(jpMenu());
1010

1111
export const Menu = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
13-
const { ...filteredProps } = props;
13+
const { className, ...filteredProps } = props;
1414

1515
/** Properties - run whenever a property has changed */
1616

packages/react-components/lib/MenuItem.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ provideJupyterDesignSystem().register(jpMenuItem());
1313

1414
export const MenuItem = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { role, disabled, expanded, checked, ...filteredProps } = props;
16+
const { className, role, disabled, expanded, checked, ...filteredProps } =
17+
props;
1718

1819
/** Event listeners - run once */
1920
useEventListener(ref, 'expanded-change', props.onExpand);

packages/react-components/lib/NumberField.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ provideJupyterDesignSystem().register(jpNumberField());
1414
export const NumberField = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
1616
const {
17+
className,
1718
readonly,
1819
hideStep,
1920
appearance,

packages/react-components/lib/Option.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ provideJupyterDesignSystem().register(jpOption());
66
export const Option = forwardRef((props, forwardedRef) => {
77
const ref = useRef(null);
88
const {
9+
className,
910
selected,
1011
value,
1112
checked,

packages/react-components/lib/Picker.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ provideJupyterDesignSystem().register(jpPicker());
1111
export const Picker = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
1313
const {
14+
className,
1415
filterSelected,
1516
filterQuery,
1617
selection,

packages/react-components/lib/PickerList.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ provideJupyterDesignSystem().register(jpPickerList());
1313

1414
export const PickerList = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { ...filteredProps } = props;
16+
const { className, ...filteredProps } = props;
1717

1818
/** Properties - run whenever a property has changed */
1919

packages/react-components/lib/PickerListItem.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ provideJupyterDesignSystem().register(jpPickerListItem());
1313

1414
export const PickerListItem = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { value, contentsTemplate, ...filteredProps } = props;
16+
const { className, value, contentsTemplate, ...filteredProps } = props;
1717

1818
/** Properties - run whenever a property has changed */
1919
useProperties(ref, 'contentsTemplate', props.contentsTemplate);

packages/react-components/lib/PickerMenu.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ provideJupyterDesignSystem().register(jpPickerMenu());
1313

1414
export const PickerMenu = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { suggestionsAvailableText, ...filteredProps } = props;
16+
const { className, suggestionsAvailableText, ...filteredProps } = props;
1717

1818
/** Properties - run whenever a property has changed */
1919
useProperties(

packages/react-components/lib/PickerMenuOption.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ provideJupyterDesignSystem().register(jpPickerMenuOption());
1313

1414
export const PickerMenuOption = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { value, contentsTemplate, ...filteredProps } = props;
16+
const { className, value, contentsTemplate, ...filteredProps } = props;
1717

1818
/** Properties - run whenever a property has changed */
1919
useProperties(ref, 'contentsTemplate', props.contentsTemplate);

packages/react-components/lib/Progress.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ provideJupyterDesignSystem().register(jpProgress());
1313

1414
export const Progress = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { value, min, max, paused, ...filteredProps } = props;
16+
const { className, value, min, max, paused, ...filteredProps } = props;
1717

1818
/** Properties - run whenever a property has changed */
1919
useProperties(ref, 'value', props.value);

packages/react-components/lib/ProgressRing.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ provideJupyterDesignSystem().register(jpProgressRing());
1313

1414
export const ProgressRing = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { value, min, max, paused, ...filteredProps } = props;
16+
const { className, value, min, max, paused, ...filteredProps } = props;
1717

1818
/** Properties - run whenever a property has changed */
1919
useProperties(ref, 'value', props.value);

packages/react-components/lib/Radio.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ provideJupyterDesignSystem().register(jpRadio());
1111
export const Radio = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
1313
const {
14+
className,
1415
readonly,
1516
readOnly,
1617
name,

packages/react-components/lib/RadioGroup.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ provideJupyterDesignSystem().register(jpRadioGroup());
1414
export const RadioGroup = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
1616
const {
17+
className,
1718
readonly,
1819
disabled,
1920
name,

packages/react-components/lib/Search.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ provideJupyterDesignSystem().register(jpSearch());
1111
export const Search = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
1313
const {
14+
className,
1415
readonly,
1516
appearance,
1617
placeholder,

packages/react-components/lib/Select.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
type SelectScale
44
} from '@jupyter/web-components';
55

6-
export type { SelectElement };
6+
export type { SelectElement, SelectScale };
77

88
export interface SelectProps
99
extends Omit<

packages/react-components/lib/Select.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ provideJupyterDesignSystem().register(jpSelect());
1111
export const Select = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
1313
const {
14+
className,
1415
autowidth,
1516
minimal,
1617
open,

packages/react-components/lib/Skeleton.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ provideJupyterDesignSystem().register(jpSkeleton());
1313

1414
export const Skeleton = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { fill, shape, pattern, shimmer, ...filteredProps } = props;
16+
const { className, fill, shape, pattern, shimmer, ...filteredProps } = props;
1717

1818
/** Properties - run whenever a property has changed */
1919
useProperties(ref, 'shimmer', props.shimmer);

packages/react-components/lib/Slider.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ provideJupyterDesignSystem().register(jpSlider());
1111
export const Slider = forwardRef((props, forwardedRef) => {
1212
const ref = useRef(null);
1313
const {
14+
className,
1415
readonly,
1516
orientation,
1617
mode,

packages/react-components/lib/SliderLabel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ provideJupyterDesignSystem().register(jpSliderLabel());
1313

1414
export const SliderLabel = forwardRef((props, forwardedRef) => {
1515
const ref = useRef(null);
16-
const { hideMark, disabled, position, ...filteredProps } = props;
16+
const { className, hideMark, disabled, position, ...filteredProps } = props;
1717

1818
/** Properties - run whenever a property has changed */
1919

0 commit comments

Comments
 (0)