Skip to content

Commit

Permalink
Refactor to define a single wrap method (#91)
Browse files Browse the repository at this point in the history
Co-authored-by: Frédéric Collonval <fcollonval@users.noreply.github.com>
  • Loading branch information
fcollonval and fcollonval authored Mar 1, 2024
1 parent ac784ad commit 8e93bcc
Show file tree
Hide file tree
Showing 46 changed files with 142 additions and 283 deletions.
3 changes: 1 addition & 2 deletions packages/lab-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
},
"license": "BSD-3-Clause",
"author": {
"name": "Jupyter Developer Team",
"email": ""
"name": "Jupyter Developer Team"
},
"files": [
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
provideJupyterDesignSystem,
jpAccordionItem
} from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpAccordionItem } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const AccordionItem: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
provideJupyterDesignSystem,
jpAccordion
} from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpAccordion } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Accordion: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { provideJupyterDesignSystem, jpAnchor } from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpAnchor } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Anchor: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
provideJupyterDesignSystem,
jpAnchoredRegion
} from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpAnchoredRegion } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const AnchoredRegion: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { provideJupyterDesignSystem, jpAvatar } from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpAvatar } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Avatar: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { provideJupyterDesignSystem, jpBadge } from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpBadge } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Badge: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
provideJupyterDesignSystem,
jpBreadcrumbItem
} from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpBreadcrumbItem } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const BreadcrumbItem: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
provideJupyterDesignSystem,
jpBreadcrumb
} from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpBreadcrumb } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Breadcrumb: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { provideJupyterDesignSystem, jpButton } from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpButton } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Button: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { provideJupyterDesignSystem, jpCard } from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpCard } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Card: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
provideJupyterDesignSystem,
jpCheckbox
} from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpCheckbox } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Checkbox: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
provideJupyterDesignSystem,
jpCombobox
} from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpCombobox } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Combobox: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
// Distributed under the terms of the Modified BSD License.

import {
provideJupyterDesignSystem,
jpDataGrid,
jpDataGridCell,
jpDataGridRow
} from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import type React from 'react';
import { wrap } from '../wrap';

// WARNING The wrapping needs to be called in order (from bottom to top DOM elements)
// Otherwise during the wrapping the tag for sub elements won't be resolved and this
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
provideJupyterDesignSystem,
jpDateField
} from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpDateField } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const DateField: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
provideJupyterDesignSystem,
jpDesignSystemProvider
} from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpDesignSystemProvider } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const DesignSystemProvider: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { provideJupyterDesignSystem, jpDialog } from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpDialog } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Dialog: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
provideJupyterDesignSystem,
jpDisclosure
} from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpDisclosure } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Disclosure: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { provideJupyterDesignSystem, jpDivider } from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpDivider } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Divider: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { provideJupyterDesignSystem, jpPicker } from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpPicker } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../../wrap';

/**
* @alpha
Expand Down
2 changes: 2 additions & 0 deletions packages/react-components/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

export * from './wrap';

export * from './accordion';
export * from './accordion-item';
export * from './anchor';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { provideJupyterDesignSystem, jpListbox } from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpListbox } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Listbox: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
provideJupyterDesignSystem,
jpMenuItem
} from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpMenuItem } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const MenuItem: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { provideJupyterDesignSystem, jpMenu } from '@jupyter/web-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
import React from 'react';

const { wrap } = provideReactWrapper(React, provideJupyterDesignSystem());
import { jpMenu } from '@jupyter/web-components';
import type React from 'react';
import { wrap } from '../wrap';

export const Menu: React.DetailedHTMLFactory<
React.HTMLAttributes<HTMLElement>,
Expand Down
Loading

0 comments on commit 8e93bcc

Please sign in to comment.