webcoreui 0.0.2 → 0.0.5

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.
package/README.md CHANGED
@@ -1,47 +1,136 @@
1
- # Astro Starter Kit: Minimal
1
+ <p>
2
+ <a href="https://webcoreui.dev">
3
+ <img
4
+ alt="Webcore - Frontend components for Astro, Svelte, and React"
5
+ src="https://raw.githubusercontent.com/Frontendland/webcoreui/main/public/img/banner.png"
6
+ />
7
+ </a>
8
+ </p>
2
9
 
3
- ```sh
4
- npm create astro@latest -- --template minimal
10
+ <p align="center">
11
+ <a href="https://github.com/Frontendland/webcoreui/releases">
12
+ <img
13
+ src="https://img.shields.io/npm/v/webcoreui.svg?label=Latest%20Release"
14
+ alt="Latest Release"
15
+ />
16
+ </a>
17
+ <a href="https://github.com/Frontendland/webcoreui/blob/main/LICENSE">
18
+ <img
19
+ src="https://img.shields.io/badge/license-MIT-blue"
20
+ alt="License"
21
+ />
22
+ </a>
23
+ </p>
24
+
25
+ > [!IMPORTANT]
26
+ > This library is still in early development. New changes can break existing functionality, and no functionality should be considered final. The library will be considered stable once it reaches v1.0.
27
+
28
+ ---
29
+ ## Table of Contents
30
+
31
+ - [Table of Contents](#table-of-contents)
32
+ - [Documentation](#documentation)
33
+ - [Getting started](#getting-started)
34
+ - [Prerequisites](#prerequisites)
35
+ - [Installation](#installation)
36
+ - [Setup](#setup)
37
+ - [Using Components](#using-components)
38
+ - [Components](#components)
39
+
40
+ ## Documentation
41
+
42
+ Full documentation coming soon on [webcoreui.dev/docs](https://webcoreui.dev/docs).
43
+
44
+ ## Getting Started
45
+
46
+ Webcore can be used as a standalone project, or it can be integrated into your existing Astro, Svelte, or React ecosystems.
47
+
48
+ ### Prerequisites
49
+
50
+ > [!NOTE]
51
+ > Before getting started, make sure you have a package manager installed, such as <a href="https://nodejs.org/en/" rel="noreferrer">Node</a>.
52
+
53
+ Webcore components use Sass for styling. To use the component library, you must have the following packages installed:
54
+
55
+ - [Sass](https://www.npmjs.com/package/sass) - `v1.77` and above
56
+ - [TypeScript](https://www.npmjs.com/package/typescript) - `v5.4` and above
57
+
58
+ Depending on your project setup, you'll also need the following packages:
59
+
60
+ - **For Astro projects**
61
+ - [Astro](https://www.npmjs.com/package/astro) - `v4.10` and above
62
+ - **For Svelte projects**
63
+ - [Svelte](https://www.npmjs.com/package/svelte) - `v4.2` and above
64
+ - **For React projects**
65
+ - [React](https://www.npmjs.com/package/react) - `v18.3` and above
66
+ - [React DOM](https://www.npmjs.com/package/react-dom) -`v18.3` and above
67
+
68
+ ### Installation
69
+
70
+ Install Webcore as a dependency by running one of the following command:
71
+
72
+ ```bash
73
+ # Using NPM
74
+ npm i webcoreui
75
+
76
+ # Using Yarn
77
+ yarn add webcoreui
5
78
  ```
6
79
 
7
- [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/minimal)
8
- [![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/minimal)
9
- [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/minimal/devcontainer.json)
80
+ ### Setup
10
81
 
11
- > 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
82
+ 1. Add the following to your `tsconfig.json` to include TypeScript types:
12
83
 
13
- ## 🚀 Project Structure
84
+ ```json
85
+ {
86
+ "include": ["webcoreui"]
87
+ }
88
+ ```
14
89
 
15
- Inside of your Astro project, you'll see the following folders and files:
90
+ 2. Setup default styles and fonts by calling the following in your global SCSS file:
16
91
 
17
- ```text
18
- /
19
- ├── public/
20
- ├── src/
21
- │ └── pages/
22
- │ └── index.astro
23
- └── package.json
92
+ ```scss
93
+ @import 'webcoreui/styles';
94
+ @include Setup((
95
+ // Define paths for your fonts
96
+ fontRegular: '/fonts/Inter-Regular.woff2',
97
+ fontBold: '/fonts/Inter-Bold.woff2'
98
+ ));
24
99
  ```
25
100
 
26
- Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
101
+ > [!TIP]
102
+ > You can download the fonts Webcore uses from the [`public/fonts`](https://github.com/Frontendland/webcoreui/tree/main/public/fonts) directory.
27
103
 
28
- There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
104
+ The `Setup` mixin can also accept the following options:
29
105
 
30
- Any static assets, like images, can be placed in the `public/` directory.
31
106
 
32
- ## 🧞 Commands
107
+ | Property | Default value | Purpose |
108
+ |-----------|---------------|---------|
109
+ | `includeResets` | `true` | Include reset styles. Set to `false` if you want to use your own CSS resets. |
110
+ | `includeHelperClasses` | `true` | Adds global helper classes for CSS. All global helper classes are defined [here](https://github.com/Frontendland/webcoreui/tree/main/src/scss/global). |
33
111
 
34
- All commands are run from the root of the project, from a terminal:
112
+ ### Using Components
35
113
 
36
- | Command | Action |
37
- | :------------------------ | :----------------------------------------------- |
38
- | `npm install` | Installs dependencies |
39
- | `npm run dev` | Starts local dev server at `localhost:4321` |
40
- | `npm run build` | Build your production site to `./dist/` |
41
- | `npm run preview` | Preview your build locally, before deploying |
42
- | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
43
- | `npm run astro -- --help` | Get help using the Astro CLI |
114
+ Start using Webcore components in your code by importing them:
115
+
116
+ ```astro
117
+ ---
118
+ // Import the component relevant to your project
119
+ // How to import Astro components
120
+ import { Accordion } from 'webcoreui/astro'
121
+
122
+ // How to import Svelte components
123
+ import { Accordion } from 'webcoreui/svelte'
124
+
125
+ // How to import React components
126
+ import { Accordion } from 'webcoreui/react'
127
+ ---
128
+
129
+ <Accordion items={[{ ... }]} />
130
+ ```
44
131
 
45
- ## 👀 Want to learn more?
132
+ ## Components
46
133
 
47
- Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
134
+ - [Accordion](https://github.com/Frontendland/webcoreui/tree/main/src/components/Accordion)
135
+ - [Button](https://github.com/Frontendland/webcoreui/tree/main/src/components/Button)
136
+ - [Card](https://github.com/Frontendland/webcoreui/tree/main/src/components/Card)
package/astro.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ declare module 'webcoreui/astro' {
2
+ import type { AccordionProps } from './components/Accordion/accordion'
3
+
4
+ export function Accordion(_props: AccordionProps): any
5
+ }
package/astro.js ADDED
@@ -0,0 +1,7 @@
1
+ import AccordionComponent from './components/Accordion/Accordion.astro'
2
+ import ButtonComponent from './components/Button/Button.astro'
3
+ import CardComponent from './components/Card/Card.astro'
4
+
5
+ export const Accordion = AccordionComponent
6
+ export const Button = ButtonComponent
7
+ export const Card = CardComponent
@@ -0,0 +1,48 @@
1
+ ---
2
+ import type { AccordionProps } from './accordion'
3
+
4
+ interface Props extends AccordionProps {}
5
+
6
+ const {
7
+ items
8
+ } = Astro.props
9
+ ---
10
+
11
+ <ul data-id="accordion">
12
+ {items.map(item => (
13
+ <li>
14
+ <div class="accordion-title">
15
+ {item.title}
16
+ <img
17
+ src="/icons/arrow-down.svg"
18
+ alt="GitHub"
19
+ width={15}
20
+ height={15}
21
+ />
22
+ </div>
23
+ <div class="accordion-wrapper">
24
+ <div class="accordion-content">
25
+ <Fragment set:html={item.content} />
26
+ </div>
27
+ </div>
28
+ </li>
29
+ ))}
30
+ </ul>
31
+
32
+ <script>
33
+ const accordions = document.querySelectorAll('[data-id="accordion"]')
34
+
35
+ Array.from(accordions).forEach(element => {
36
+ element.addEventListener('click', event => {
37
+ const target = event.target as HTMLDivElement
38
+
39
+ if (target.classList.contains('accordion-title')) {
40
+ target.classList.toggle('open')
41
+ }
42
+ })
43
+ })
44
+ </script>
45
+
46
+ <style lang="scss">
47
+ @import './accordion.scss';
48
+ </style>
@@ -0,0 +1,43 @@
1
+ <script lang="ts">
2
+ import type { AccordionProps } from './accordion'
3
+
4
+ export let items: AccordionProps['items']
5
+
6
+ let state = Array(items.length).fill(false)
7
+
8
+ const toggle = (index: number) => {
9
+ state = state.map((_, i) => index === i
10
+ ? !state[i]
11
+ : state[i]
12
+ )
13
+ }
14
+ </script>
15
+
16
+ <ul>
17
+ {#each items as item, index}
18
+ <li>
19
+ <div
20
+ class="accordion-title"
21
+ class:open={state[index]}
22
+ on:click={() => toggle(index)}
23
+ >
24
+ {item.title}
25
+ <img
26
+ src="/icons/arrow-down.svg"
27
+ alt="GitHub"
28
+ width={15}
29
+ height={15}
30
+ />
31
+ </div>
32
+ <div class="accordion-wrapper">
33
+ <div class="accordion-content">
34
+ {@html item.content}
35
+ </div>
36
+ </div>
37
+ </li>
38
+ {/each}
39
+ </ul>
40
+
41
+ <style lang="scss">
42
+ @import './accordion.scss';
43
+ </style>
@@ -0,0 +1,40 @@
1
+ import React, { useState } from 'react'
2
+ import type { AccordionProps } from './accordion'
3
+ import './accordion.scss'
4
+
5
+ export const Accordion = ({ items }: AccordionProps) => {
6
+ const [state, setState] = useState(Array(items.length).fill(false))
7
+
8
+ const toggle = (index: number) => {
9
+ setState(state.map((_, i) => index === i
10
+ ? !state[i]
11
+ : state[i]
12
+ ))
13
+ }
14
+
15
+ return (
16
+ <ul data-id="accordion">
17
+ {items.map((item, index) => (
18
+ <li key={index}>
19
+ <div
20
+ className={state[index] ? 'accordion-title open' : 'accordion-title'}
21
+ onClick={() => toggle(index)}
22
+ >
23
+ {item.title}
24
+ <img
25
+ src="/icons/arrow-down.svg"
26
+ alt="GitHub"
27
+ width={15}
28
+ height={15}
29
+ />
30
+ </div>
31
+ <div className="accordion-wrapper">
32
+ <div className="accordion-content">
33
+ <div dangerouslySetInnerHTML={{ __html: item.content }} />
34
+ </div>
35
+ </div>
36
+ </li>
37
+ ))}
38
+ </ul>
39
+ )
40
+ }
@@ -0,0 +1,60 @@
1
+ @import '../../scss/config.scss';
2
+
3
+ ul {
4
+ margin: 0;
5
+ padding: 0;
6
+ list-style-type: none;
7
+
8
+ li {
9
+ border-bottom: 1px solid #252525;
10
+ padding: 10px 0;
11
+ font-size: 16px;
12
+
13
+ &:first-child {
14
+ padding-top: 0;
15
+ }
16
+
17
+ &:last-child {
18
+ border-bottom: 0;
19
+ padding-bottom: 0;
20
+ }
21
+
22
+ .accordion-title {
23
+ display: flex;
24
+ justify-content: space-between;
25
+ align-items: center;
26
+ cursor: pointer;
27
+
28
+ img {
29
+ @include Transition(transform);
30
+ filter: brightness(.7);
31
+ }
32
+
33
+ &.open {
34
+ img {
35
+ transform: rotate(180deg);
36
+ }
37
+
38
+ + .accordion-wrapper {
39
+ grid-template-rows: 1fr;
40
+
41
+ .accordion-content {
42
+ padding: 10px 0;
43
+ }
44
+ }
45
+ }
46
+ }
47
+
48
+ .accordion-wrapper {
49
+ @include Transition(grid-template-rows);
50
+ display: grid;
51
+ grid-template-rows: 0fr;
52
+ }
53
+
54
+ .accordion-content {
55
+ @include Transition();
56
+ overflow: hidden;
57
+ color: #BBB;
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,6 @@
1
+ export type AccordionProps = {
2
+ items: {
3
+ title: string
4
+ content: string
5
+ }[]
6
+ }
@@ -0,0 +1,32 @@
1
+ ---
2
+ import type { ButtonProps } from './button'
3
+
4
+ interface Props extends ButtonProps {}
5
+
6
+ const {
7
+ theme,
8
+ bold,
9
+ href,
10
+ ...rest
11
+ } = Astro.props
12
+
13
+ const classes = [
14
+ 'w-button',
15
+ bold && 'bold',
16
+ theme
17
+ ].filter(Boolean).join(' ')
18
+ ---
19
+
20
+ {href ? (
21
+ <a {...rest} href={href} class={classes || null}>
22
+ <slot />
23
+ </a>
24
+ ) : (
25
+ <button {...rest} class={classes || null}>
26
+ <slot />
27
+ </button>
28
+ )}
29
+
30
+ <style lang="scss">
31
+ @import './button.scss';
32
+ </style>
@@ -0,0 +1,29 @@
1
+ <script lang="ts">
2
+ import type { ButtonProps } from './button'
3
+
4
+ export let theme: ButtonProps['theme'] = null
5
+ export let bold: ButtonProps['bold'] = false
6
+ export let href: ButtonProps['href'] = ''
7
+ export let onClick: ButtonProps['onClick'] = () => {}
8
+
9
+ const classes = [
10
+ 'w-button',
11
+ bold && 'bold',
12
+ theme
13
+ ].filter(Boolean).join(' ')
14
+ </script>
15
+
16
+
17
+ {#if href}
18
+ <a {...$$restProps} href={href} class={classes || null}>
19
+ <slot />
20
+ </a>
21
+ {:else}
22
+ <button {...$$restProps} class={classes || null} on:click={onClick}>
23
+ <slot />
24
+ </button>
25
+ {/if}
26
+
27
+ <style lang="scss">
28
+ @import './button.scss';
29
+ </style>
@@ -0,0 +1,32 @@
1
+ import React from 'react'
2
+ import type { ButtonProps } from './button'
3
+ import './button.scss'
4
+
5
+ export const Button = ({
6
+ theme,
7
+ bold,
8
+ href,
9
+ children,
10
+ onClick,
11
+ ...rest
12
+ }: ButtonProps) => {
13
+ const classes = [
14
+ 'w-button',
15
+ bold && 'bold',
16
+ theme
17
+ ].filter(Boolean).join(' ')
18
+
19
+ if (href) {
20
+ return (
21
+ <a {...rest} href={href} className={classes || undefined}>
22
+ {children}
23
+ </a>
24
+ )
25
+ }
26
+
27
+ return (
28
+ <button {...rest} className={classes || undefined} onClick={onClick}>
29
+ {children}
30
+ </button>
31
+ )
32
+ }
@@ -0,0 +1,92 @@
1
+ @import '../../scss/config.scss';
2
+
3
+ .w-button {
4
+ @include Transition();
5
+ padding: 10px 15px;
6
+ border-radius: 5px;
7
+ text-decoration: none;
8
+ display: inline-flex;
9
+ align-items: center;
10
+ gap: 5px;
11
+ font-size: 16px;
12
+ font-family: Regular;
13
+ cursor: pointer;
14
+ border: 0;
15
+ background: #FFF;
16
+ color: #252525;
17
+
18
+ &[disabled] {
19
+ cursor: no-drop;
20
+ background: #BBB;
21
+ }
22
+
23
+ &:hover {
24
+ background: #BBB;
25
+ }
26
+
27
+ &.secondary {
28
+ background: #252525;
29
+ color: #FFF;
30
+
31
+ &:hover {
32
+ background: #333;
33
+ }
34
+ }
35
+
36
+ &.outline {
37
+ background: #000;
38
+ color: #FFF;
39
+ box-shadow: inset 0px 0px 0px 1px #FFF;
40
+
41
+ &:hover {
42
+ color: #BBB;
43
+ box-shadow: inset 0px 0px 0px 1px #BBB;
44
+ }
45
+ }
46
+
47
+ &.flat {
48
+ background: #000;
49
+ color: #FFF;
50
+
51
+ &:hover {
52
+ background: #333;
53
+ }
54
+ }
55
+
56
+ &.info {
57
+ background: #0abde3;
58
+
59
+ &:hover {
60
+ background: #48dbfb;
61
+ }
62
+ }
63
+
64
+ &.success {
65
+ background: #10ac84;
66
+
67
+ &:hover {
68
+ background: #1dd1a1;
69
+ }
70
+ }
71
+
72
+ &.warning {
73
+ background: #ff9f43;
74
+
75
+ &:hover {
76
+ background: #f7aa61;
77
+ }
78
+ }
79
+
80
+ &.alert {
81
+ background: #e73f40;
82
+ color: #fff;
83
+
84
+ &:hover {
85
+ background: #ee5253;
86
+ }
87
+ }
88
+
89
+ &.bold {
90
+ font-family: Bold;
91
+ }
92
+ }
@@ -0,0 +1,14 @@
1
+ export type ButtonProps = {
2
+ theme?: 'secondary'
3
+ | 'outline'
4
+ | 'flat'
5
+ | 'info'
6
+ | 'success'
7
+ | 'warning'
8
+ | 'alert'
9
+ | null
10
+ bold?: boolean
11
+ href?: string
12
+ onClick?: () => any
13
+ [key: string]: any
14
+ }
@@ -0,0 +1,50 @@
1
+ ---
2
+ interface Props {
3
+ element?: string
4
+ title?: string
5
+ compact?: boolean
6
+ className?: string
7
+ secondary?: boolean
8
+ [key: string]: any
9
+ }
10
+
11
+ const {
12
+ element = 'section',
13
+ title,
14
+ titleTag = 'span',
15
+ compact,
16
+ className,
17
+ secondary,
18
+ ...rest
19
+ } = Astro.props
20
+
21
+ const classes = [
22
+ className,
23
+ secondary && 'secondary',
24
+ 'card'
25
+ ].filter(Boolean).join(' ')
26
+
27
+ const props = {
28
+ class: classes
29
+ }
30
+
31
+ const Component = element
32
+ const Title = titleTag
33
+ ---
34
+
35
+ <Component {...props} {...rest}>
36
+ {title && (
37
+ <Title class="card-title">{title}</Title>
38
+ )}
39
+ <div class="card-body" class:list={[compact && 'compact']}>
40
+ {compact && !secondary ? (
41
+ <div class="card-wrapper"><slot /></div>
42
+ ) : (
43
+ <slot />
44
+ )}
45
+ </div>
46
+ </Component>
47
+
48
+ <style lang="scss">
49
+ @import './card.scss';
50
+ </style>
File without changes
File without changes
@@ -0,0 +1,36 @@
1
+ .card {
2
+ border: 1px solid #252525;
3
+ border-radius: 5px;
4
+ display: flex;
5
+ flex-direction: column;
6
+
7
+ &.secondary {
8
+ background: #111;
9
+
10
+ .card-title {
11
+ background: #000;
12
+ }
13
+ }
14
+
15
+ .card-title {
16
+ padding: 20px;
17
+ display: block;
18
+ border-bottom: 1px solid #252525;
19
+ font-size: 16px;
20
+ }
21
+
22
+ .card-body {
23
+ padding: 20px;
24
+ height: 100%;
25
+
26
+ &.compact {
27
+ background: #111;
28
+ }
29
+ }
30
+
31
+ .card-wrapper {
32
+ background: #000;
33
+ padding: 40px;
34
+ height: 100%;
35
+ }
36
+ }
package/package.json CHANGED
@@ -1,27 +1,65 @@
1
- {
2
- "name": "webcoreui",
3
- "type": "module",
4
- "version": "0.0.2",
5
- "scripts": {
6
- "dev": "astro dev",
7
- "build": "astro check && astro build",
8
- "build:package": "node scripts/build.js",
9
- "test": "echo \"Error: no test specified\""
10
- },
11
- "dependencies": {
12
- "@astrojs/check": "0.7.0",
13
- "@astrojs/svelte": "5.5.0",
14
- "astro": "4.10.2",
15
- "sass": "1.77.5",
16
- "svelte": "4.2.18",
17
- "typescript": "5.4.5"
18
- },
19
- "exports": {
20
- "./astro": "./astro.js",
21
- "./styles": "./scss/index.scss",
22
- "./config": "./scss/config.scss"
23
- },
24
- "files": [
25
- "dist"
26
- ]
27
- }
1
+ {
2
+ "name": "webcoreui",
3
+ "type": "module",
4
+ "version": "0.0.5",
5
+ "scripts": {
6
+ "dev": "astro dev",
7
+ "build": "astro check && astro build",
8
+ "build:package": "node scripts/build.js",
9
+ "test": "echo \"Error: no test specified\""
10
+ },
11
+ "dependencies": {
12
+ "@astrojs/check": "0.7.0",
13
+ "@astrojs/react": "3.5.0",
14
+ "@astrojs/svelte": "5.5.0",
15
+ "astro": "4.10.2",
16
+ "react": "18.3.1",
17
+ "react-dom": "18.3.1",
18
+ "sass": "1.77.5",
19
+ "svelte": "4.2.18",
20
+ "typescript": "5.4.5"
21
+ },
22
+ "exports": {
23
+ "./astro": "./astro.js",
24
+ "./svelte": "./svelte.js",
25
+ "./react": "./react.js",
26
+ "./styles": "./scss/index.scss",
27
+ "./config": "./scss/config.scss"
28
+ },
29
+ "files": [
30
+ "components",
31
+ "public",
32
+ "scss",
33
+ "astro.d.ts",
34
+ "astro.js",
35
+ "svelte.d.ts",
36
+ "svelte.js",
37
+ "react.d.ts",
38
+ "react.js",
39
+ "README.md",
40
+ "LICENSE"
41
+ ],
42
+ "license": "MIT",
43
+ "description": "UI component and template library for Astro, Svelte, and React apps styled with Sass.",
44
+ "keywords": [
45
+ "webcore",
46
+ "component",
47
+ "components",
48
+ "ui components",
49
+ "component library",
50
+ "astro components",
51
+ "svelte components",
52
+ "react components",
53
+ "frontend",
54
+ "library",
55
+ "sass"
56
+ ],
57
+ "homepage": "https://webcoreui.dev",
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "git+https://github.com/Frontendland/webcoreui.git"
61
+ },
62
+ "bugs": {
63
+ "url": "https://github.com/Frontendland/webcoreui/issues"
64
+ }
65
+ }
Binary file
Binary file
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M0.360618 6.42142C0.864272 5.88419 1.70806 5.85699 2.24526 6.36062L12 15.5057L21.7547 6.36062C22.292 5.85699 23.1358 5.88419 23.6395 6.42142C24.143 6.95865 24.1158 7.80243 23.5787 8.30606L12.9119 18.3062C12.3991 18.787 11.601 18.787 11.0881 18.3062L0.421418 8.30606C-0.11581 7.80243 -0.143009 6.95865 0.360618 6.42142Z" fill="white" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M22.3903 6.12641C21.3172 4.24172 19.8617 2.74961 18.0232 1.64975C16.1845 0.549822 14.1772 0 11.9999 0C9.82282 0 7.81486 0.54999 5.97655 1.64975C4.13797 2.74956 2.68246 4.24172 1.60939 6.12641C0.536482 8.01104 0 10.0691 0 12.3005C0 14.9808 0.762885 17.3911 2.28904 19.5319C3.81503 21.6728 5.78638 23.1543 8.20293 23.9764C8.48422 24.0299 8.69245 23.9923 8.82785 23.8644C8.96329 23.7364 9.03093 23.5761 9.03093 23.3841C9.03093 23.3521 9.02825 23.0639 9.02305 22.5193C9.01812 22.0442 9.01549 21.5691 9.01517 21.094L8.65579 21.1577C8.42665 21.2008 8.13758 21.219 7.78859 21.2138C7.43977 21.2088 7.07764 21.1714 6.70271 21.1017C6.32762 21.0326 5.97874 20.8725 5.6558 20.6215C5.33302 20.3706 5.10388 20.0422 4.96844 19.6367L4.81219 19.2681C4.70805 19.0227 4.54409 18.7502 4.32009 18.4514C4.0961 18.1523 3.86959 17.9496 3.64045 17.8428L3.53105 17.7625C3.45816 17.7092 3.39051 17.6448 3.32796 17.5702C3.26546 17.4955 3.21867 17.4208 3.18742 17.346C3.15612 17.2711 3.18206 17.2096 3.26552 17.1614C3.34898 17.1133 3.4998 17.0899 3.71865 17.0899L4.03103 17.1377C4.23937 17.1805 4.49708 17.3084 4.80448 17.522C5.11171 17.7356 5.36427 18.0131 5.56222 18.3547C5.80192 18.7926 6.09071 19.1262 6.42941 19.3559C6.76784 19.5855 7.10906 19.7001 7.45274 19.7001C7.79642 19.7001 8.09325 19.6734 8.34335 19.6202C8.59318 19.5668 8.82757 19.4866 9.04642 19.3799C9.14017 18.6642 9.39541 18.1143 9.81193 17.73C9.21826 17.6661 8.68452 17.5697 8.21042 17.4417C7.7366 17.3134 7.24697 17.1053 6.74184 16.8167C6.23645 16.5285 5.81719 16.1707 5.48396 15.7438C5.15068 15.3166 4.87715 14.7559 4.66378 14.062C4.45029 13.3678 4.34352 12.5671 4.34352 11.6595C4.34352 10.3673 4.75506 9.26765 5.57798 8.35997C5.19249 7.38846 5.22888 6.29936 5.68727 5.0928C5.98936 4.99659 6.43735 5.06879 7.03102 5.30894C7.6248 5.54921 8.05954 5.75504 8.33569 5.92569C8.61184 6.09629 8.8331 6.24085 8.99979 6.3581C9.96872 6.08058 10.9686 5.94179 11.9998 5.94179C13.0309 5.94179 14.0311 6.08058 15 6.3581L15.5938 5.97388C15.9998 5.71751 16.4792 5.48257 17.031 5.269C17.5831 5.05555 18.0052 4.99675 18.297 5.09296C18.7656 6.29959 18.8074 7.38863 18.4217 8.36014C19.2446 9.26782 19.6563 10.3677 19.6563 11.6597C19.6563 12.5673 19.5492 13.3705 19.336 14.07C19.1226 14.7696 18.8467 15.3298 18.5083 15.7518C18.1695 16.1737 17.7475 16.5288 17.2424 16.8169C16.7372 17.1052 16.2474 17.3134 15.7735 17.4416C15.2995 17.5698 14.7658 17.6662 14.1721 17.7303C14.7136 18.2106 14.9843 18.9688 14.9843 20.0045V23.3837C14.9843 23.5756 15.0495 23.7359 15.1798 23.864C15.31 23.9918 15.5156 24.0295 15.7969 23.9759C18.2138 23.1539 20.1851 21.6724 21.7111 19.5314C23.2368 17.3907 24 14.9804 24 12.3C23.9995 10.0689 23.4627 8.01104 22.3903 6.12641Z" fill="white"/>
3
+ </svg>
Binary file
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
2
+ <path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" />
3
+ <style>
4
+ path { fill: #000; }
5
+ @media (prefers-color-scheme: dark) {
6
+ path { fill: #FFF; }
7
+ }
8
+ </style>
9
+ </svg>
Binary file
package/react.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ declare module 'webcoreui/react' {
2
+ import type { AccordionProps } from './components/Accordion/accordion'
3
+
4
+ export function Accordion(_props: AccordionProps): any
5
+ }
package/react.js ADDED
@@ -0,0 +1,7 @@
1
+ import { Accordion as AccordionComponent } from './components/Accordion/Accordion.tsx'
2
+ import { Button as ButtonComponent } from './components/Button/Button.tsx'
3
+ import { Card as CardComponent } from './components/Card/Card.tsx'
4
+
5
+ export const Accordion = AccordionComponent
6
+ export const Button = ButtonComponent
7
+ export const Card = CardComponent
@@ -0,0 +1,16 @@
1
+ @mixin Transition($property: all, $speed: .3s) {
2
+ transition: $property $speed cubic-bezier(0.4, 0.0, 0.2, 1);
3
+ }
4
+
5
+ @mixin Media($size: 'xs') {
6
+ $sizes: (
7
+ 'xs': 600px,
8
+ 'sm': 800px,
9
+ 'md': 1024px,
10
+ 'lg': 1200px
11
+ );
12
+
13
+ @media (min-width: #{map-get($sizes, $size)}) {
14
+ @content;
15
+ }
16
+ }
@@ -0,0 +1 @@
1
+ @import './config/mixins.scss';
@@ -0,0 +1,11 @@
1
+ @import '../config';
2
+
3
+ @mixin Elements() {
4
+ code {
5
+ display: inline-block;
6
+ padding: 2px 10px;
7
+ border-radius: 5px;
8
+ border: 1px solid #252525;
9
+ font-size: 14px;
10
+ }
11
+ }
@@ -0,0 +1,42 @@
1
+ @import '../config';
2
+
3
+ @mixin Utility() {
4
+ .container {
5
+ margin: 0 auto;
6
+ max-width: 1200px;
7
+ padding: 0 20px;
8
+ }
9
+
10
+ .grid {
11
+ display: grid;
12
+ gap: 20px;
13
+ }
14
+
15
+ @include Media('md') {
16
+ .grid.md-2 {
17
+ grid-template-columns: repeat(2, minmax(0, 1fr));
18
+ }
19
+
20
+ .grid.md-3 {
21
+ grid-template-columns: repeat(3, minmax(0, 1fr));
22
+ }
23
+
24
+ .grid.md-4 {
25
+ grid-template-columns: repeat(4, minmax(0, 1fr));
26
+ }
27
+ }
28
+
29
+ @include Media('lg') {
30
+ .grid.lg-2 {
31
+ grid-template-columns: repeat(2, minmax(0, 1fr));
32
+ }
33
+
34
+ .grid.lg-3 {
35
+ grid-template-columns: repeat(3, minmax(0, 1fr));
36
+ }
37
+
38
+ .grid.lg-4 {
39
+ grid-template-columns: repeat(4, minmax(0, 1fr));
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,2 @@
1
+ @import './global/elements.scss';
2
+ @import './global/utility.scss';
@@ -0,0 +1,3 @@
1
+ @import './setup';
2
+ @import './resets';
3
+ @import './global';
@@ -0,0 +1,44 @@
1
+ @mixin Resets() {
2
+ @if (config('fontRegular')) {
3
+ @font-face {
4
+ font-family: Regular;
5
+ font-display: swap;
6
+ src: url(#{config('fontRegular')}) format('woff2');
7
+ }
8
+ }
9
+
10
+ @if (config('fontBold')) {
11
+ @font-face {
12
+ font-family: Bold;
13
+ font-display: swap;
14
+ src: url(#{config('fontBold')}) format('woff2');
15
+ }
16
+ }
17
+
18
+ * {
19
+ box-sizing: border-box;
20
+ }
21
+
22
+ body {
23
+ background: #000;
24
+ color: #FFF;
25
+ margin: 0;
26
+ font-size: 18px;
27
+ font-family: Regular, sans-serif;
28
+ }
29
+
30
+ h1,
31
+ h2,
32
+ h3,
33
+ h4,
34
+ h5,
35
+ h6,
36
+ strong {
37
+ font-family: Bold, sans-serif;
38
+ }
39
+
40
+ a {
41
+ color: #FFF;
42
+ text-decoration: none;
43
+ }
44
+ }
@@ -0,0 +1,27 @@
1
+ @use 'sass:map';
2
+
3
+ $config: (
4
+ includeResets: true,
5
+ includeHelperClasses: true,
6
+ includeElementStyles: true
7
+ );
8
+
9
+ @function config($key) {
10
+ @return map.get($config, $key);
11
+ }
12
+
13
+ @mixin Setup($customConfig: ()) {
14
+ $config: map.merge($config, $customConfig) !global;
15
+
16
+ @if (config('includeResets')) {
17
+ @include Resets();
18
+ }
19
+
20
+ @if (config('includeHelperClasses')) {
21
+ @include Utility();
22
+ }
23
+
24
+ @if (config('includeElementStyles')) {
25
+ @include Elements();
26
+ }
27
+ }
package/svelte.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ declare module 'webcoreui/svelte' {
2
+ import type { AccordionProps } from './components/Accordion/accordion'
3
+
4
+ export function Accordion(_props: AccordionProps): any
5
+ }
package/svelte.js ADDED
@@ -0,0 +1,7 @@
1
+ import AccordionComponent from './components/Accordion/Accordion.svelte'
2
+ import ButtonComponent from './components/Button/Button.svelte'
3
+ import CardComponent from './components/Card/Card.svelte'
4
+
5
+ export const Accordion = AccordionComponent
6
+ export const Button = ButtonComponent
7
+ export const Card = CardComponent
package/dist/env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="astro/client" />