Skip to content

Commit

Permalink
chore: rework imports (#2652)
Browse files Browse the repository at this point in the history
* chore: rework imports

* fix: bring back old imports

* fix: bring back old imports on lib

* refactor: bring back old imports on website

* fix: script on snake case

* feat: add new imports
  • Loading branch information
theo-mesnil committed Jan 28, 2025
1 parent 458c537 commit e68104b
Show file tree
Hide file tree
Showing 291 changed files with 626 additions and 397 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Getting started

```js
import React from 'react'
import { Button, createTheme, WuiProvider } from 'welcome-ui'
import { createTheme, WuiProvider } from 'welcome-ui/theme'
import { Button } from 'welcome-ui/Button'

// Add theme options (if you want)
const options = {
Expand Down
5 changes: 4 additions & 1 deletion lib/src/components/Accordion/docs/examples/avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Accordion, Avatar, Flex, Text, useAccordion } from 'welcome-ui'
import * as React from 'react'
import { Flex } from 'welcome-ui/Flex'
import { Avatar } from 'welcome-ui/Avatar'
import { Text } from 'welcome-ui/Text'
import { Accordion, useAccordion } from 'welcome-ui/Accordion'

const Example = () => {
const accordion = useAccordion()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Accordion, useAccordion } from 'welcome-ui'
import * as React from 'react'
import { Accordion, useAccordion } from 'welcome-ui/Accordion'

const Example = () => {
const accordion = useAccordion({ defaultOpen: true })
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Accordion/docs/examples/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Accordion, useAccordion } from 'welcome-ui'
import * as React from 'react'
import { Accordion, useAccordion } from 'welcome-ui/Accordion'

const Example = () => {
const accordion = useAccordion()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Accordion, PlayIcon, useAccordion } from 'welcome-ui'
import * as React from 'react'
import { Accordion, useAccordion } from 'welcome-ui/Accordion'
import { PlayIcon } from 'welcome-ui/Icons'

const Example = () => {
const accordion = useAccordion()
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Alert/docs/examples/close-button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Alert } from 'welcome-ui'
import * as React from 'react'
import { Alert } from 'welcome-ui/Alert'

const Example = () => {
const [hideAlert, setHideAlert] = React.useState(false)
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Alert/docs/examples/cta.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Alert } from 'welcome-ui'
import * as React from 'react'
import { Alert } from 'welcome-ui/Alert'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Alert/docs/examples/is-full-width.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Alert } from 'welcome-ui'
import * as React from 'react'
import { Alert } from 'welcome-ui/Alert'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Alert/docs/examples/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Alert } from 'welcome-ui'
import * as React from 'react'
import { Alert } from 'welcome-ui/Alert'

const Example = () => {
return (
Expand Down
3 changes: 2 additions & 1 deletion lib/src/components/Alert/docs/examples/sizes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Alert, Stack } from 'welcome-ui'
import * as React from 'react'
import { Alert } from 'welcome-ui/Alert'
import { Stack } from 'welcome-ui/Stack'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Alert/docs/examples/title.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Alert } from 'welcome-ui'
import * as React from 'react'
import { Alert } from 'welcome-ui/Alert'

const Example = () => {
return (
Expand Down
3 changes: 2 additions & 1 deletion lib/src/components/Alert/docs/examples/variants.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Alert, Stack } from 'welcome-ui'
import * as React from 'react'
import { Alert } from 'welcome-ui/Alert'
import { Stack } from 'welcome-ui/Stack'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/AspectRatio/docs/examples/map.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AspectRatio } from 'welcome-ui'
/* eslint-disable react/iframe-missing-sandbox */
import * as React from 'react'
import { AspectRatio } from 'welcome-ui/AspectRatio'

const Example = () => {
return (
Expand Down
3 changes: 2 additions & 1 deletion lib/src/components/AspectRatio/docs/examples/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AspectRatio, Box } from 'welcome-ui'
import * as React from 'react'
import { AspectRatio } from 'welcome-ui/AspectRatio'
import { Box } from 'welcome-ui/Box'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/AspectRatio/docs/examples/ratio.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AspectRatio } from 'welcome-ui'
import * as React from 'react'
import { AspectRatio } from 'welcome-ui/AspectRatio'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/AspectRatio/docs/examples/video.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AspectRatio } from 'welcome-ui'
/* eslint-disable react/iframe-missing-sandbox */
import * as React from 'react'
import { AspectRatio } from 'welcome-ui/AspectRatio'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Avatar/docs/examples/images.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Avatar } from 'welcome-ui'
import * as React from 'react'
import { Avatar } from 'welcome-ui/Avatar'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Avatar/docs/examples/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Avatar } from 'welcome-ui'
import * as React from 'react'
import { Avatar } from 'welcome-ui/Avatar'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Avatar/docs/examples/shape.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Avatar } from 'welcome-ui'
import * as React from 'react'
import { Avatar } from 'welcome-ui/Avatar'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Avatar/docs/examples/texts.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Avatar } from 'welcome-ui'
import * as React from 'react'
import { Avatar } from 'welcome-ui/Avatar'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Badge/docs/examples/disabled.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Badge } from 'welcome-ui'
import * as React from 'react'
import { Badge } from 'welcome-ui/Badge'

const Example = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Badge } from 'welcome-ui'
import * as React from 'react'
import { Badge } from 'welcome-ui/Badge'

const Example = () => {
return <Badge withNumberAbbreviation>{100}</Badge>
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Badge/docs/examples/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Badge } from 'welcome-ui'
import * as React from 'react'
import { Badge } from 'welcome-ui/Badge'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Badge/docs/examples/size.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Badge } from 'welcome-ui'
import * as React from 'react'
import { Badge } from 'welcome-ui/Badge'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Badge/docs/examples/variant.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Badge } from 'welcome-ui'
import * as React from 'react'
import { Badge } from 'welcome-ui/Badge'

const Example = () => {
return (
Expand Down
5 changes: 4 additions & 1 deletion lib/src/components/Box/docs/examples/example.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Badge, Box, StarIcon, Text } from 'welcome-ui'
import * as React from 'react'
import { Box } from 'welcome-ui/Box'
import { Badge } from 'welcome-ui/Badge'
import { StarIcon } from 'welcome-ui/Icons'
import { Text } from 'welcome-ui/Text'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Box/docs/examples/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box } from 'welcome-ui'
import * as React from 'react'
import { Box } from 'welcome-ui/Box'

const Example = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Breadcrumb } from 'welcome-ui'
import * as React from 'react'
import { Breadcrumb } from 'welcome-ui/Breadcrumb'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Breadcrumb/docs/examples/last-child.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Breadcrumb } from 'welcome-ui'
import * as React from 'react'
import { Breadcrumb } from 'welcome-ui/Breadcrumb'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Breadcrumb/docs/examples/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Breadcrumb } from 'welcome-ui'
import * as React from 'react'
import { Breadcrumb } from 'welcome-ui/Breadcrumb'

const Example = () => {
return (
Expand Down
3 changes: 2 additions & 1 deletion lib/src/components/Breadcrumb/docs/examples/separator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Breadcrumb, Stack } from 'welcome-ui'
import * as React from 'react'
import { Breadcrumb } from 'welcome-ui/Breadcrumb'
import { Stack } from 'welcome-ui/Stack'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Button/docs/examples/danger.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from 'welcome-ui'
import * as React from 'react'
import { Button } from 'welcome-ui/Button'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Button/docs/examples/disabled.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from 'welcome-ui'
import * as React from 'react'
import { Button } from 'welcome-ui/Button'

const Example = () => {
return <Button disabled>Disabled</Button>
Expand Down
3 changes: 2 additions & 1 deletion lib/src/components/Button/docs/examples/icons.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Button, WttjIcon } from 'welcome-ui'
import * as React from 'react'
import { Button } from 'welcome-ui/Button'
import { WttjIcon } from 'welcome-ui/Icons'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Button/docs/examples/is-loading.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from 'welcome-ui'
import * as React from 'react'
import { Button } from 'welcome-ui/Button'

const Example = () => {
const [isLoading, setIsLoading] = React.useState<boolean>(false)
Expand Down
3 changes: 2 additions & 1 deletion lib/src/components/Button/docs/examples/link.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Button, WttjIcon } from 'welcome-ui'
import * as React from 'react'
import { Button } from 'welcome-ui/Button'
import { WttjIcon } from 'welcome-ui/Icons'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Button/docs/examples/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from 'welcome-ui'
import * as React from 'react'
import { Button } from 'welcome-ui/Button'

const Example = () => {
return <Button>Button</Button>
Expand Down
3 changes: 2 additions & 1 deletion lib/src/components/Button/docs/examples/shapes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Button, WttjIcon } from 'welcome-ui'
import * as React from 'react'
import { Button } from 'welcome-ui/Button'
import { WttjIcon } from 'welcome-ui/Icons'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Button/docs/examples/sizes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from 'welcome-ui'
import * as React from 'react'
import { Button } from 'welcome-ui/Button'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Button/docs/examples/variants.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from 'welcome-ui'
import * as React from 'react'
import { Button } from 'welcome-ui/Button'

const Example = () => {
return (
Expand Down
3 changes: 2 additions & 1 deletion lib/src/components/ButtonGroup/docs/examples/overload.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Button, ButtonGroup } from 'welcome-ui'
import { Button } from 'welcome-ui/Button'
import { ButtonGroup } from 'welcome-ui/ButtonGroup'
import * as React from 'react'

const Example = () => {
Expand Down
3 changes: 2 additions & 1 deletion lib/src/components/ButtonGroup/docs/examples/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Button, ButtonGroup } from 'welcome-ui'
import { Button } from 'welcome-ui/Button'
import { ButtonGroup } from 'welcome-ui/ButtonGroup'
import * as React from 'react'

const Example = () => {
Expand Down
3 changes: 2 additions & 1 deletion lib/src/components/Card/docs/examples/content.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Card, Text } from 'welcome-ui'
import * as React from 'react'
import { Card } from 'welcome-ui/Card'
import { Text } from 'welcome-ui/Text'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Card/docs/examples/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Card } from 'welcome-ui'
import * as React from 'react'
import { Card } from 'welcome-ui/Card'

const Example = () => {
return (
Expand Down
4 changes: 3 additions & 1 deletion lib/src/components/Card/docs/examples/picture.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Box, Card, Text } from 'welcome-ui'
import * as React from 'react'
import { Card } from 'welcome-ui/Card'
import { Box } from 'welcome-ui/Box'
import { Text } from 'welcome-ui/Text'

const Example = () => {
return (
Expand Down
3 changes: 2 additions & 1 deletion lib/src/components/Checkbox/docs/examples/hint.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Checkbox, Field } from 'welcome-ui'
import * as React from 'react'
import { Checkbox } from 'welcome-ui/Checkbox'
import { Field } from 'welcome-ui/Field'

const Example = () => {
const [checkbox, setCheckbox] = React.useState(false)
Expand Down
4 changes: 3 additions & 1 deletion lib/src/components/Checkbox/docs/examples/labels.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Checkbox, Field, Stack } from 'welcome-ui'
import * as React from 'react'
import { Checkbox } from 'welcome-ui/Checkbox'
import { Field } from 'welcome-ui/Field'
import { Stack } from 'welcome-ui/Stack'

const Example = () => {
const [checkbox, setCheckbox] = React.useState(false)
Expand Down
4 changes: 3 additions & 1 deletion lib/src/components/Checkbox/docs/examples/nested.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Checkbox, Field, Stack } from 'welcome-ui'
import * as React from 'react'
import { Checkbox } from 'welcome-ui/Checkbox'
import { Field } from 'welcome-ui/Field'
import { Stack } from 'welcome-ui/Stack'

const Example = () => {
const [checkboxA, setCheckboxA] = React.useState(false)
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/Checkbox/docs/examples/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Checkbox } from 'welcome-ui'
import * as React from 'react'
import { Checkbox } from 'welcome-ui/Checkbox'

const Example = () => {
const [checkbox, setCheckbox] = React.useState(false)
Expand Down
4 changes: 3 additions & 1 deletion lib/src/components/Checkbox/docs/examples/variants.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Checkbox, Field, Stack } from 'welcome-ui'
import * as React from 'react'
import { Checkbox } from 'welcome-ui/Checkbox'
import { Field } from 'welcome-ui/Field'
import { Stack } from 'welcome-ui/Stack'

const Example = () => {
const [checkbox, setCheckbox] = React.useState(false)
Expand Down
3 changes: 2 additions & 1 deletion lib/src/components/DatePicker/docs/examples/icon.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { DatePicker, WttjIcon } from 'welcome-ui'
import * as React from 'react'
import { DatePicker } from 'welcome-ui/DatePicker'
import { WttjIcon } from 'welcome-ui/Icons'

const Example = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/DatePicker/docs/examples/months.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DatePicker } from 'welcome-ui'
import * as React from 'react'
import { DatePicker } from 'welcome-ui/DatePicker'

const Example = () => {
return <DatePicker dateFormat="MM/yyyy" name="welcome" showMonthYearPicker value={new Date()} />
Expand Down
Loading

0 comments on commit e68104b

Please sign in to comment.