Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new components WelcomeLoader #2624

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/WelcomeLoader/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*
!/dist/*.js
!/dist/*.d.ts
3 changes: 3 additions & 0 deletions packages/WelcomeLoader/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Change Log

All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
17 changes: 17 additions & 0 deletions packages/WelcomeLoader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# @welcome-ui/welcome-loader

The [WelcomeLoader](https://welcome-ui.com/components/welcome-loader) component from [@welcome-ui](https://welcome-ui.com).

![npm bundle size](https://img.shields.io/bundlephobia/minzip/@welcome-ui/welcome-loader) [![License](https://img.shields.io/npm/l/welcome-ui.svg)](https://github.com/WTTJ/welcome-ui/tree/main/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-mediumspringgreen.svg)](ttps://github.com/WTTJ/welcome-ui/tree/main/CONTRIBUTING.mdx)

## Installation

yarn add @welcome-ui/welcome-loader

## Import

import { WelcomeLoader } from '@welcome-ui/welcome-loader'

## Documentation

See the [documentation](https://welcome-ui.com/components/welcome-loader) or [package source](https://github.com/WTTJ/welcome-ui/tree/main/packages/WelcomeLoader) for more details.
8 changes: 8 additions & 0 deletions packages/WelcomeLoader/docs/examples/overview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as React from 'react'
import { WelcomeLoader } from '@welcome-ui/welcome-loader'

const Example = () => {
return <WelcomeLoader />
}

export default Example
8 changes: 8 additions & 0 deletions packages/WelcomeLoader/docs/examples/resize.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as React from 'react'
import { WelcomeLoader } from '@welcome-ui/welcome-loader'

const Example = () => {
return <WelcomeLoader w={32} />
}

export default Example
12 changes: 12 additions & 0 deletions packages/WelcomeLoader/docs/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
category: icons-&-logo
description: The WelcomeLoader component is a visual indicator used to signal that a page is loading or content is being retrieved. Designed for Welcome to the Jungle, it ensures users stay informed during transitions, maintaining engagement and reducing perceived wait times. The loader is styled to align with the brand’s aesthetic, offering a seamless and polished user experience.
packageName: welcome-loader
title: WelcomeLoader
---

### Resize

You can resize or add some properties like margin etc.

<div data-playground="resize.tsx" data-component="WelcomeLoader"></div>
5 changes: 5 additions & 0 deletions packages/WelcomeLoader/docs/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"WelcomeLoader": {
"props": {}
}
}
61 changes: 61 additions & 0 deletions packages/WelcomeLoader/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "@welcome-ui/welcome-loader",
"version": "6.1.1",
"description": "Customizable design system with react • styled-components • styled-system and ariakit.",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/types/index.d.ts",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json",
"./dist/index.doc.json": "./dist/index.doc.json"
},
"scripts": {
"build": "node ../../scripts/build.js",
"test": "jest",
"types": "rimraf dist/types && tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
"doc": "node -r esm ../../scripts/doc-props.js --name WelcomeLoader"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/WTTJ/welcome-ui.git"
},
"keywords": [
"design-system",
"react",
"ariakit",
"styled-components",
"styled-system",
"ui-library",
"ui",
"ux",
"jungle",
"welcome",
"WTTJ"
],
"author": "WTTJ <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/WTTJ/welcome-ui/issues"
},
"dependencies": {
"lottie-light-react": "^2.4.0",
"@welcome-ui/box": "^6.1.1",
"@welcome-ui/system": "^6.1.1"
},
"peerDependencies": {
"@xstyled/styled-components": "^3.7.3",
"react": "^18.0.0",
"styled-components": "^5.3.9"
},
"gitHead": "974e7bfd71f8cfe846cbffd678c3860a8952f9e9",
"sideEffects": false,
"homepage": "https://welcome-ui.com/components/welcome-loader"
}
23 changes: 23 additions & 0 deletions packages/WelcomeLoader/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react'
import { forwardRef } from '@welcome-ui/system'
import { Box, BoxProps } from '@welcome-ui/box'
import { useLottie } from 'lottie-light-react'

import loader from './loader.json'

export const WelcomeLoader = forwardRef<'div', BoxProps>(({ w = 150, ...props }, ref) => {
const options = {
animationData: loader,
loop: true,
}

const { View } = useLottie(options)

return (
<Box ref={ref} w={w} {...props}>
{View}
</Box>
)
})

WelcomeLoader.displayName = 'WelcomeLoader'
1 change: 1 addition & 0 deletions packages/WelcomeLoader/src/loader.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions packages/WelcomeLoader/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "../../types"]
}
4 changes: 3 additions & 1 deletion website/build-app/examples.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 40 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9646,6 +9646,18 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
dependencies:
js-tokens "^3.0.0 || ^4.0.0"

lottie-light-react@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/lottie-light-react/-/lottie-light-react-2.4.0.tgz#cb18e1a1cb36c87778027feac9746b0cad7c6295"
integrity sha512-TXJOnyqEc6ev9/um8Xkxve5EVcgCX2pi1olWc8jj+81qaPyFBA+VxHIc2Ojl42IqeAiKhGHz098ztQOIImJcyg==
dependencies:
lottie-web "^5.10.2"

lottie-web@^5.10.2:
version "5.12.2"
resolved "https://registry.yarnpkg.com/lottie-web/-/lottie-web-5.12.2.tgz#579ca9fe6d3fd9e352571edd3c0be162492f68e5"
integrity sha512-uvhvYPC8kGPjXT3MyKMrL3JitEAmDMp30lVkuq/590Mw9ok6pWcFCwXJveo0t5uqYw1UREQHofD+jVpdjBv8wg==

loud-rejection@^1.0.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f"
Expand Down Expand Up @@ -12798,7 +12810,16 @@ string-natural-compare@^3.0.1:
resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4"
integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==

"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -12943,7 +12964,14 @@ stringify-package@^1.0.1:
resolved "https://registry.yarnpkg.com/stringify-package/-/stringify-package-1.0.1.tgz#e5aa3643e7f74d0f28628b72f3dad5cecfc3ba85"
integrity sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg==

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -14133,7 +14161,16 @@ wordwrap@^1.0.0:
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down
Loading