webcoreui 0.0.5 → 0.0.7

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.
Files changed (48) hide show
  1. package/README.md +4 -0
  2. package/astro.d.ts +19 -5
  3. package/astro.js +15 -7
  4. package/components/Accordion/Accordion.astro +5 -9
  5. package/components/Accordion/Accordion.svelte +3 -7
  6. package/components/Accordion/Accordion.tsx +7 -11
  7. package/components/Accordion/accordion.scss +7 -4
  8. package/components/Alert/Alert.astro +64 -0
  9. package/components/Alert/Alert.svelte +58 -0
  10. package/components/Alert/Alert.tsx +57 -0
  11. package/components/Alert/alert.scss +52 -0
  12. package/components/Alert/alert.ts +13 -0
  13. package/components/Badge/Badge.astro +27 -0
  14. package/components/Badge/Badge.svelte +20 -0
  15. package/components/Badge/Badge.tsx +19 -0
  16. package/components/Badge/badge.scss +85 -0
  17. package/components/Badge/badge.ts +12 -0
  18. package/components/Button/Button.tsx +3 -1
  19. package/components/Button/button.scss +5 -5
  20. package/components/Card/Card.astro +4 -9
  21. package/components/Card/Card.svelte +35 -0
  22. package/components/Card/Card.tsx +36 -0
  23. package/components/Card/card.scss +1 -1
  24. package/components/Card/card.ts +8 -0
  25. package/components/ConditionalWrapper/ConditionalWrapper.astro +17 -0
  26. package/components/ConditionalWrapper/ConditionalWrapper.svelte +14 -0
  27. package/components/ConditionalWrapper/ConditionalWrapper.tsx +13 -0
  28. package/components/ConditionalWrapper/conditionalwrapper.ts +3 -0
  29. package/components/Icon/Icon.astro +20 -0
  30. package/components/Icon/Icon.svelte +23 -0
  31. package/components/Icon/Icon.tsx +26 -0
  32. package/components/Icon/icon.ts +5 -0
  33. package/icons/alert.svg +3 -0
  34. package/{public/icons → icons}/arrow-down.svg +1 -1
  35. package/icons/check.svg +4 -0
  36. package/{public/icons → icons}/github.svg +3 -3
  37. package/icons/info.svg +4 -0
  38. package/icons/warning.svg +4 -0
  39. package/package.json +2 -2
  40. package/react.d.ts +19 -5
  41. package/react.js +15 -7
  42. package/svelte.d.ts +19 -5
  43. package/svelte.js +15 -7
  44. package/public/fonts/Inter-Bold.woff2 +0 -0
  45. package/public/fonts/Inter-Regular.woff2 +0 -0
  46. package/public/img/banner.png +0 -0
  47. package/public/img/favicon.svg +0 -9
  48. package/public/img/logo.png +0 -0
package/README.md CHANGED
@@ -132,5 +132,9 @@ import { Accordion } from 'webcoreui/react'
132
132
  ## Components
133
133
 
134
134
  - [Accordion](https://github.com/Frontendland/webcoreui/tree/main/src/components/Accordion)
135
+ - [Alert](https://github.com/Frontendland/webcoreui/tree/main/src/components/Alert)
136
+ - [ConditionalWrapper](https://github.com/Frontendland/webcoreui/tree/main/src/components/ConditionalWrapper)
137
+ - [Badge](https://github.com/Frontendland/webcoreui/tree/main/src/components/Badge)
135
138
  - [Button](https://github.com/Frontendland/webcoreui/tree/main/src/components/Button)
136
139
  - [Card](https://github.com/Frontendland/webcoreui/tree/main/src/components/Card)
140
+ - [Icon](https://github.com/Frontendland/webcoreui/tree/main/src/components/Icon)
package/astro.d.ts CHANGED
@@ -1,5 +1,19 @@
1
- declare module 'webcoreui/astro' {
2
- import type { AccordionProps } from './components/Accordion/accordion'
3
-
4
- export function Accordion(_props: AccordionProps): any
5
- }
1
+
2
+ declare module 'webcoreui/astro' {
3
+ import type { AccordionProps } from './components/Accordion/accordion'
4
+ import type { AlertProps } from './components/Alert/alert'
5
+ import type { BadgeProps } from './components/Badge/badge'
6
+ import type { ButtonProps } from './components/Button/button'
7
+ import type { CardProps } from './components/Card/card'
8
+ import type { ConditionalWrapperProps } from './components/ConditionalWrapper/conditionalwrapper'
9
+ import type { IconProps } from './components/Icon/icon'
10
+
11
+ export function Accordion(_props: AccordionProps): any
12
+ export function Alert(_props: AlertProps): any
13
+ export function Badge(_props: BadgeProps): any
14
+ export function Button(_props: ButtonProps): any
15
+ export function Card(_props: CardProps): any
16
+ export function ConditionalWrapper(_props: ConditionalWrapperProps): any
17
+ export function Icon(_props: IconProps): any
18
+ }
19
+
package/astro.js CHANGED
@@ -1,7 +1,15 @@
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
1
+ import AccordionComponent from './components/Accordion/Accordion.astro'
2
+ import AlertComponent from './components/Alert/Alert.astro'
3
+ import BadgeComponent from './components/Badge/Badge.astro'
4
+ import ButtonComponent from './components/Button/Button.astro'
5
+ import CardComponent from './components/Card/Card.astro'
6
+ import ConditionalWrapperComponent from './components/ConditionalWrapper/ConditionalWrapper.astro'
7
+ import IconComponent from './components/Icon/Icon.astro'
8
+
9
+ export const Accordion = AccordionComponent
10
+ export const Alert = AlertComponent
11
+ export const Badge = BadgeComponent
12
+ export const Button = ButtonComponent
13
+ export const Card = CardComponent
14
+ export const ConditionalWrapper = ConditionalWrapperComponent
15
+ export const Icon = IconComponent
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  import type { AccordionProps } from './accordion'
3
+ import ArrowDown from '../../icons/arrow-down.svg?raw'
3
4
 
4
5
  interface Props extends AccordionProps {}
5
6
 
@@ -8,17 +9,12 @@ const {
8
9
  } = Astro.props
9
10
  ---
10
11
 
11
- <ul data-id="accordion">
12
- {items.map(item => (
12
+ <ul class="w-accordion" data-id="w-accordion">
13
+ {items.map((item: AccordionProps['items'][0]) => (
13
14
  <li>
14
15
  <div class="accordion-title">
15
16
  {item.title}
16
- <img
17
- src="/icons/arrow-down.svg"
18
- alt="GitHub"
19
- width={15}
20
- height={15}
21
- />
17
+ <Fragment set:html={ArrowDown} />
22
18
  </div>
23
19
  <div class="accordion-wrapper">
24
20
  <div class="accordion-content">
@@ -30,7 +26,7 @@ const {
30
26
  </ul>
31
27
 
32
28
  <script>
33
- const accordions = document.querySelectorAll('[data-id="accordion"]')
29
+ const accordions = document.querySelectorAll('[data-id="w-accordion"]')
34
30
 
35
31
  Array.from(accordions).forEach(element => {
36
32
  element.addEventListener('click', event => {
@@ -1,5 +1,6 @@
1
1
  <script lang="ts">
2
2
  import type { AccordionProps } from './accordion'
3
+ import ArrowDown from '../../icons/arrow-down.svg?raw'
3
4
 
4
5
  export let items: AccordionProps['items']
5
6
 
@@ -13,7 +14,7 @@
13
14
  }
14
15
  </script>
15
16
 
16
- <ul>
17
+ <ul class="w-accordion">
17
18
  {#each items as item, index}
18
19
  <li>
19
20
  <div
@@ -22,12 +23,7 @@
22
23
  on:click={() => toggle(index)}
23
24
  >
24
25
  {item.title}
25
- <img
26
- src="/icons/arrow-down.svg"
27
- alt="GitHub"
28
- width={15}
29
- height={15}
30
- />
26
+ {@html ArrowDown}
31
27
  </div>
32
28
  <div class="accordion-wrapper">
33
29
  <div class="accordion-content">
@@ -1,8 +1,9 @@
1
1
  import React, { useState } from 'react'
2
2
  import type { AccordionProps } from './accordion'
3
+ import ArrowDown from '../../icons/arrow-down.svg?raw'
3
4
  import './accordion.scss'
4
5
 
5
- export const Accordion = ({ items }: AccordionProps) => {
6
+ const Accordion = ({ items }: AccordionProps) => {
6
7
  const [state, setState] = useState(Array(items.length).fill(false))
7
8
 
8
9
  const toggle = (index: number) => {
@@ -13,21 +14,14 @@ export const Accordion = ({ items }: AccordionProps) => {
13
14
  }
14
15
 
15
16
  return (
16
- <ul data-id="accordion">
17
+ <ul className="w-accordion">
17
18
  {items.map((item, index) => (
18
19
  <li key={index}>
19
20
  <div
20
21
  className={state[index] ? 'accordion-title open' : 'accordion-title'}
21
22
  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>
23
+ dangerouslySetInnerHTML={{ __html: `${item.title} ${ArrowDown}` }}
24
+ />
31
25
  <div className="accordion-wrapper">
32
26
  <div className="accordion-content">
33
27
  <div dangerouslySetInnerHTML={{ __html: item.content }} />
@@ -38,3 +32,5 @@ export const Accordion = ({ items }: AccordionProps) => {
38
32
  </ul>
39
33
  )
40
34
  }
35
+
36
+ export default Accordion
@@ -1,6 +1,6 @@
1
1
  @import '../../scss/config.scss';
2
2
 
3
- ul {
3
+ .w-accordion {
4
4
  margin: 0;
5
5
  padding: 0;
6
6
  list-style-type: none;
@@ -25,13 +25,16 @@ ul {
25
25
  align-items: center;
26
26
  cursor: pointer;
27
27
 
28
- img {
28
+ svg {
29
29
  @include Transition(transform);
30
- filter: brightness(.7);
30
+ color: #BBB;
31
+ width: 15px;
32
+ height: 15px;
33
+ pointer-events: none;
31
34
  }
32
35
 
33
36
  &.open {
34
- img {
37
+ svg {
35
38
  transform: rotate(180deg);
36
39
  }
37
40
 
@@ -0,0 +1,64 @@
1
+ ---
2
+ import type { AlertProps } from './alert'
3
+ import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.astro'
4
+
5
+ import info from '../../icons/info.svg?raw'
6
+ import success from '../../icons/check.svg?raw'
7
+ import warning from '../../icons/warning.svg?raw'
8
+ import alert from '../../icons/alert.svg?raw'
9
+
10
+ interface Props extends AlertProps {}
11
+
12
+ const iconMap = {
13
+ info,
14
+ success,
15
+ warning,
16
+ alert
17
+ }
18
+
19
+ const {
20
+ element = 'section',
21
+ title,
22
+ titleTag = 'strong',
23
+ className,
24
+ theme,
25
+ ...rest
26
+ } = Astro.props
27
+
28
+ const Component = element
29
+ const Title = titleTag
30
+ const hasCustomIcon = Astro.slots.has('icon')
31
+
32
+ const classes = [
33
+ 'w-alert',
34
+ (!hasCustomIcon && !theme) && 'col',
35
+ theme,
36
+ className
37
+ ].filter(Boolean).join(' ')
38
+
39
+ const props = {
40
+ class: classes
41
+ }
42
+ ---
43
+
44
+ <Component {...props} {...rest}>
45
+ <slot name="icon" />
46
+
47
+ {!hasCustomIcon && theme && <Fragment set:html={iconMap[theme]} />}
48
+
49
+ <ConditionalWrapper condition={!!(hasCustomIcon || theme)}>
50
+ <div class="alert-wrapper" slot="wrapper">
51
+ children
52
+ </div>
53
+ {title && (
54
+ <Title class:list="alert-title">{title}</Title>
55
+ )}
56
+ <div class="alert-body">
57
+ <slot />
58
+ </div>
59
+ </ConditionalWrapper>
60
+ </Component>
61
+
62
+ <style lang="scss">
63
+ @import './alert.scss';
64
+ </style>
@@ -0,0 +1,58 @@
1
+ <script lang="ts">
2
+ import type { AlertProps } from './alert'
3
+ import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.svelte'
4
+
5
+ import info from '../../icons/info.svg?raw'
6
+ import success from '../../icons/check.svg?raw'
7
+ import warning from '../../icons/warning.svg?raw'
8
+ import alert from '../../icons/alert.svg?raw'
9
+
10
+ export let element: AlertProps['element'] = 'section'
11
+ export let title: AlertProps['title'] = null
12
+ export let titleTag: AlertProps['title'] = 'strong'
13
+ export let className: AlertProps['className'] = null
14
+ export let theme: AlertProps['theme'] = null
15
+
16
+ const iconMap = {
17
+ info,
18
+ success,
19
+ warning,
20
+ alert
21
+ }
22
+
23
+ const hasCustomIcon = $$slots.icon
24
+
25
+ const classes = [
26
+ 'w-alert',
27
+ (!hasCustomIcon && !theme) && 'col',
28
+ theme,
29
+ className
30
+ ].filter(Boolean).join(' ')
31
+ </script>
32
+
33
+ <svelte:element this={element} class={classes} {...$$restProps}>
34
+ <slot name="icon" />
35
+
36
+ {#if !hasCustomIcon && theme}
37
+ {@html iconMap[theme]}
38
+ {/if}
39
+
40
+ <ConditionalWrapper
41
+ condition={!!(hasCustomIcon || theme)}
42
+ element="div"
43
+ class="alert-wrapper"
44
+ >
45
+ {#if title}
46
+ <svelte:element this={titleTag} class="alert-title">
47
+ {title}
48
+ </svelte:element>
49
+ {/if}
50
+ <div class="alert-body">
51
+ <slot />
52
+ </div>
53
+ </ConditionalWrapper>
54
+ </svelte:element>
55
+
56
+ <style lang="scss">
57
+ @import './alert.scss';
58
+ </style>
@@ -0,0 +1,57 @@
1
+ import React from 'react'
2
+ import type { AlertProps } from './alert'
3
+ import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.tsx'
4
+
5
+ import info from '../../icons/info.svg?raw'
6
+ import success from '../../icons/check.svg?raw'
7
+ import warning from '../../icons/warning.svg?raw'
8
+ import alert from '../../icons/alert.svg?raw'
9
+
10
+ import './alert.scss'
11
+
12
+ const iconMap = {
13
+ info,
14
+ success,
15
+ warning,
16
+ alert
17
+ }
18
+
19
+ const Alert = ({
20
+ Element = 'section',
21
+ title,
22
+ TitleTag = 'strong',
23
+ className,
24
+ theme,
25
+ children,
26
+ icon,
27
+ ...rest
28
+ }: AlertProps & { icon?: any }) => {
29
+ const classes = [
30
+ 'w-alert',
31
+ (!icon && !theme) && 'col',
32
+ theme,
33
+ className
34
+ ].filter(Boolean).join(' ')
35
+
36
+ return (
37
+ <Element className={classes} {...rest}>
38
+ {icon && icon}
39
+ {!icon && theme && <div dangerouslySetInnerHTML={{ __html: iconMap[theme] }} />}
40
+
41
+ <ConditionalWrapper condition={!!(icon || theme)} wrapper={children => (
42
+ <div className="alert-wrapper">
43
+ {children}
44
+ </div>
45
+ )}>
46
+ {title && (
47
+ <TitleTag className="alert-title">{title}</TitleTag>
48
+ )}
49
+ <div className="alert-body">
50
+ {children}
51
+ </div>
52
+ </ConditionalWrapper>
53
+ </Element>
54
+ )
55
+ }
56
+
57
+ export default Alert
@@ -0,0 +1,52 @@
1
+ @import '../../scss/config.scss';
2
+
3
+ .w-alert {
4
+ border: 1px solid #252525;
5
+ border-radius: 5px;
6
+ padding: 15px;
7
+ display: flex;
8
+
9
+ &.col {
10
+ flex-direction: column;
11
+ }
12
+
13
+ &:not(.col) {
14
+ gap: 10px;
15
+ }
16
+
17
+ &.info {
18
+ border: 1px solid #0abde3;
19
+ color: #0abde3;
20
+ }
21
+
22
+ &.success {
23
+ border: 1px solid #1dd1a1;
24
+ color: #1dd1a1;
25
+ }
26
+
27
+ &.warning {
28
+ border: 1px solid #ff9f43;
29
+ color: #ff9f43;
30
+ }
31
+
32
+ &.alert {
33
+ border: 1px solid #e73f40;
34
+ color: #e73f40;
35
+ }
36
+
37
+ svg {
38
+ width: 20px;
39
+ height: 20px;
40
+ margin-top: 1px;
41
+ }
42
+
43
+ .alert-title {
44
+ display: block;
45
+ margin-bottom: 5px;
46
+ }
47
+
48
+ .alert-body {
49
+ font-size: 16px;
50
+ color: #BBB;
51
+ }
52
+ }
@@ -0,0 +1,13 @@
1
+ export type AlertProps = {
2
+ element?: string
3
+ title?: string | null
4
+ titleTag?: string
5
+ icon?: string | null
6
+ className?: string | null
7
+ theme?: 'info'
8
+ | 'success'
9
+ | 'warning'
10
+ | 'alert'
11
+ | null
12
+ [key: string]: any
13
+ }
@@ -0,0 +1,27 @@
1
+ ---
2
+ import type { BadgeProps } from './badge'
3
+
4
+ interface Props extends BadgeProps {
5
+ interactive?: boolean
6
+ }
7
+
8
+ const {
9
+ theme,
10
+ interactive
11
+ } = Astro.props
12
+
13
+ const classes = [
14
+ 'w-badge',
15
+ theme || null,
16
+ interactive && 'hover'
17
+ ]
18
+ ---
19
+
20
+ <span class:list={classes}>
21
+ <slot />
22
+ </span>
23
+
24
+
25
+ <style lang="scss">
26
+ @import './badge.scss';
27
+ </style>
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { BadgeProps } from './badge'
3
+
4
+ export let theme: BadgeProps['theme'] = null
5
+ export let onClick: BadgeProps['onClick'] = () => {}
6
+
7
+ const classes = [
8
+ 'w-badge',
9
+ theme || null,
10
+ onClick && 'hover'
11
+ ].filter(Boolean).join(' ')
12
+ </script>
13
+
14
+ <span class={classes} on:click={onClick}>
15
+ <slot />
16
+ </span>
17
+
18
+ <style lang="scss">
19
+ @import './badge.scss';
20
+ </style>
@@ -0,0 +1,19 @@
1
+ import React from 'react'
2
+ import type { BadgeProps } from './badge'
3
+ import './badge.scss'
4
+
5
+ const Badge = ({ theme, onClick, children }: BadgeProps) => {
6
+ const classes = [
7
+ 'w-badge',
8
+ theme || null,
9
+ onClick && 'hover'
10
+ ].filter(Boolean).join(' ')
11
+
12
+ return (
13
+ <span className={classes} onClick={onClick}>
14
+ {children}
15
+ </span>
16
+ )
17
+ }
18
+
19
+ export default Badge
@@ -0,0 +1,85 @@
1
+ @import '../../scss/config.scss';
2
+
3
+ .w-badge {
4
+ @include Transition();
5
+ padding: 5px 10px;
6
+ border-radius: 5px;
7
+ display: inline-flex;
8
+ align-items: center;
9
+ gap: 5px;
10
+ font-size: 12px;
11
+ background: #FFF;
12
+ color: #252525;
13
+
14
+ &.hover {
15
+ cursor: pointer;
16
+
17
+ &:hover {
18
+ background: #BBB;
19
+ }
20
+
21
+ &.secondary:hover {
22
+ background: #333;
23
+ }
24
+
25
+ &.outline:hover {
26
+ color: #FFF;
27
+ background: transparent;
28
+ box-shadow: inset 0px 0px 0px 1px #FFF;
29
+ }
30
+
31
+ &.flat:hover {
32
+ background: #333;
33
+ }
34
+
35
+ &.info:hover {
36
+ background: #48dbfb;
37
+ }
38
+
39
+ &.success:hover {
40
+ background: #1dd1a1;
41
+ }
42
+
43
+ &.warning:hover {
44
+ background: #f7aa61;
45
+ }
46
+
47
+ &.alert:hover {
48
+ background: #ee5253;
49
+ }
50
+ }
51
+
52
+
53
+ &.secondary {
54
+ background: #252525;
55
+ color: #FFF;
56
+ }
57
+
58
+ &.outline {
59
+ background: #000;
60
+ color: #BBB;
61
+ box-shadow: inset 0px 0px 0px 1px #BBB;
62
+ }
63
+
64
+ &.flat {
65
+ background: #000;
66
+ color: #FFF;
67
+ }
68
+
69
+ &.info {
70
+ background: #0abde3;
71
+ }
72
+
73
+ &.success {
74
+ background: #10ac84;
75
+ }
76
+
77
+ &.warning {
78
+ background: #ff9f43;
79
+ }
80
+
81
+ &.alert {
82
+ background: #e73f40;
83
+ color: #fff;
84
+ }
85
+ }
@@ -0,0 +1,12 @@
1
+ export type BadgeProps = {
2
+ theme?: 'secondary'
3
+ | 'outline'
4
+ | 'flat'
5
+ | 'info'
6
+ | 'success'
7
+ | 'warning'
8
+ | 'alert'
9
+ | null
10
+ onClick?: () => any
11
+ [key: string]: any
12
+ }
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import type { ButtonProps } from './button'
3
3
  import './button.scss'
4
4
 
5
- export const Button = ({
5
+ const Button = ({
6
6
  theme,
7
7
  bold,
8
8
  href,
@@ -30,3 +30,5 @@ export const Button = ({
30
30
  </button>
31
31
  )
32
32
  }
33
+
34
+ export default Button
@@ -35,12 +35,12 @@
35
35
 
36
36
  &.outline {
37
37
  background: #000;
38
- color: #FFF;
39
- box-shadow: inset 0px 0px 0px 1px #FFF;
40
-
38
+ color: #BBB;
39
+ box-shadow: inset 0px 0px 0px 1px #BBB;
40
+
41
41
  &:hover {
42
- color: #BBB;
43
- box-shadow: inset 0px 0px 0px 1px #BBB;
42
+ color: #FFF;
43
+ box-shadow: inset 0px 0px 0px 1px #FFF;
44
44
  }
45
45
  }
46
46
 
@@ -1,12 +1,7 @@
1
1
  ---
2
- interface Props {
3
- element?: string
4
- title?: string
5
- compact?: boolean
6
- className?: string
7
- secondary?: boolean
8
- [key: string]: any
9
- }
2
+ import type { CardProps } from './card'
3
+
4
+ interface Props extends CardProps {}
10
5
 
11
6
  const {
12
7
  element = 'section',
@@ -19,9 +14,9 @@ const {
19
14
  } = Astro.props
20
15
 
21
16
  const classes = [
17
+ 'w-card',
22
18
  className,
23
19
  secondary && 'secondary',
24
- 'card'
25
20
  ].filter(Boolean).join(' ')
26
21
 
27
22
  const props = {
@@ -0,0 +1,35 @@
1
+ <script lang="ts">
2
+ import type { CardProps } from './card'
3
+
4
+ export let element: CardProps['element'] = 'section'
5
+ export let title: CardProps['title'] = ''
6
+ export let titleTag: CardProps['titleTag'] = 'span'
7
+ export let compact: CardProps['compact'] = false
8
+ export let className: CardProps['className'] = ''
9
+ export let secondary: CardProps['secondary'] = false
10
+
11
+ const classes = [
12
+ 'w-card',
13
+ className,
14
+ secondary && 'secondary'
15
+ ].filter(Boolean).join(' ')
16
+ </script>
17
+
18
+ <svelte:element this={element} class={classes} {...$$restProps}>
19
+ {#if title}
20
+ <svelte:element this={titleTag} class="card-title">
21
+ {title}
22
+ </svelte:element>
23
+ {/if}
24
+ <div class="card-body" class:compact>
25
+ {#if compact && !secondary}
26
+ <div class="card-wrapper"><slot /></div>
27
+ {:else}
28
+ <slot />
29
+ {/if}
30
+ </div>
31
+ </svelte:element>
32
+
33
+ <style lang="scss">
34
+ @import './card.scss';
35
+ </style>
@@ -0,0 +1,36 @@
1
+ import React from 'react'
2
+ import type { CardProps } from './card'
3
+ import './card.scss'
4
+
5
+ const Card = ({
6
+ Element = 'section',
7
+ title,
8
+ TitleTag = 'span',
9
+ compact,
10
+ className,
11
+ secondary,
12
+ children,
13
+ ...rest
14
+ }: CardProps) => {
15
+ const classes = [
16
+ 'w-card',
17
+ className,
18
+ secondary && 'secondary'
19
+ ].filter(Boolean).join(' ')
20
+
21
+ return (
22
+ <Element className={classes} {...rest}>
23
+ {title && (
24
+ <TitleTag className="card-title">{title}</TitleTag>
25
+ )}
26
+ <div className={compact ? 'card-body compact' : 'card-body'}>
27
+ {compact && !secondary
28
+ ? <div className="card-wrapper">{children}</div>
29
+ : children
30
+ }
31
+ </div>
32
+ </Element>
33
+ )
34
+ }
35
+
36
+ export default Card
@@ -1,4 +1,4 @@
1
- .card {
1
+ .w-card {
2
2
  border: 1px solid #252525;
3
3
  border-radius: 5px;
4
4
  display: flex;
@@ -0,0 +1,8 @@
1
+ export type CardProps = {
2
+ element?: string
3
+ title?: string
4
+ compact?: boolean
5
+ className?: string
6
+ secondary?: boolean
7
+ [key: string]: any
8
+ }
@@ -0,0 +1,17 @@
1
+ ---
2
+ import type { ConditionalWrapperProps } from './conditionalwrapper'
3
+
4
+ interface Props extends ConditionalWrapperProps {}
5
+
6
+ const { condition } = Astro.props
7
+
8
+ const wrapper = await Astro.slots.render('wrapper')
9
+ const children = await Astro.slots.render('default')
10
+ const wrapped = wrapper?.replace('children', children)
11
+
12
+ if (!Astro.slots.has('wrapper')) {
13
+ console.error('Missing wrapper. Add slot="wrapper" to one of the elements.')
14
+ }
15
+ ---
16
+
17
+ <Fragment set:html={condition ? wrapped : children} />
@@ -0,0 +1,14 @@
1
+ <script lang="ts">
2
+ import type { ConditionalWrapperProps } from './conditionalwrapper'
3
+
4
+ export let condition: ConditionalWrapperProps['condition']
5
+ export let element: string
6
+ </script>
7
+
8
+ {#if condition}
9
+ <svelte:element this={element} {...$$restProps}>
10
+ <slot />
11
+ </svelte:element>
12
+ {:else}
13
+ <slot />
14
+ {/if}
@@ -0,0 +1,13 @@
1
+ import React from 'react'
2
+ import type { ConditionalWrapperProps } from './conditionalwrapper'
3
+
4
+ type ExtendedConditionalWrapperProps = {
5
+ condition: ConditionalWrapperProps['condition']
6
+ wrapper: (_: React.ReactNode) => any
7
+ children: React.ReactNode
8
+ };
9
+
10
+ const ConditionalWrapper = ({ condition, wrapper, children }: ExtendedConditionalWrapperProps) =>
11
+ condition ? wrapper(children) : children
12
+
13
+ export default ConditionalWrapper
@@ -0,0 +1,3 @@
1
+ export type ConditionalWrapperProps = {
2
+ condition: boolean
3
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ import type { IconProps } from './icon'
3
+
4
+ interface Props extends IconProps {}
5
+
6
+ const {
7
+ type,
8
+ size = 24,
9
+ color
10
+ } = Astro.props
11
+
12
+ const { default: markup } = await import(`../../icons/${type}.svg?raw`)
13
+ const icon = markup
14
+ .replace('width="24"', `width=${size}`)
15
+ .replace('height="24"', color
16
+ ? `height=${size} color=${color}`
17
+ : `height=${size}`)
18
+ ---
19
+
20
+ <Fragment set:html={icon} />
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import type { IconProps } from './icon'
3
+
4
+ import Github from '../../icons/github.svg?raw'
5
+ import ArrowDown from '../../icons/arrow-down.svg?raw'
6
+
7
+ export let type: IconProps['type'] = ''
8
+ export let size: IconProps['size'] = 24
9
+ export let color: IconProps['color'] = ''
10
+
11
+ const iconMap = {
12
+ 'github': Github,
13
+ 'arrow-down': ArrowDown
14
+ }
15
+
16
+ const icon = iconMap[type as keyof typeof iconMap]
17
+ .replace('width="24"', `width=${size}`)
18
+ .replace('height="24"', color
19
+ ? `height=${size} color=${color}`
20
+ : `height=${size}`)
21
+ </script>
22
+
23
+ {@html icon}
@@ -0,0 +1,26 @@
1
+ import React from 'react'
2
+ import type { IconProps } from './icon'
3
+
4
+ import Github from '../../icons/github.svg?raw'
5
+ import ArrowDown from '../../icons/arrow-down.svg?raw'
6
+
7
+ const iconMap = {
8
+ 'github': Github,
9
+ 'arrow-down': ArrowDown
10
+ }
11
+
12
+ const Icon = ({
13
+ type,
14
+ size = 24,
15
+ color
16
+ }: IconProps) => {
17
+ const icon = iconMap[type as keyof typeof iconMap]
18
+ .replace('width="24"', `width=${size}`)
19
+ .replace('height="24"', color
20
+ ? `height=${size} color=${color}`
21
+ : `height=${size}`)
22
+
23
+ return <span dangerouslySetInnerHTML={{ __html: icon }} />
24
+ }
25
+
26
+ export default Icon
@@ -0,0 +1,5 @@
1
+ export type IconProps = {
2
+ type: string
3
+ size?: number
4
+ color?: string
5
+ }
@@ -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="M7.48872 2.15394C7.48856 2.1541 7.48888 2.15378 7.48872 2.15394L2.15302 7.48964C1.99269 7.64997 1.93416 7.74684 1.9045 7.81776C1.87504 7.88818 1.84615 7.99973 1.84615 8.23015V15.7698C1.84615 15.9963 1.8732 16.1054 1.90221 16.1759C1.93113 16.2463 1.9898 16.3459 2.15425 16.5104L7.48964 21.847C7.48966 21.847 7.48961 21.847 7.48964 21.847C7.64992 22.0073 7.74685 22.0658 7.81776 22.0955C7.88818 22.125 7.99973 22.1538 8.23015 22.1538H15.7698C15.9964 22.1538 16.1061 22.1268 16.1771 22.0976C16.2477 22.0687 16.3471 22.0102 16.5104 21.847L21.847 16.5104C22.0073 16.35 22.0658 16.2532 22.0955 16.1822C22.125 16.1118 22.1538 16.0003 22.1538 15.7698V8.23015C22.1538 8.00362 22.1268 7.89393 22.0976 7.82287C22.0687 7.75228 22.0102 7.65286 21.847 7.48964L16.5104 2.15302C16.3471 1.9898 16.2477 1.9313 16.1771 1.90235C16.1061 1.87321 15.9964 1.84615 15.7698 1.84615H8.23015C8.0037 1.84615 7.89439 1.87319 7.82354 1.90227C7.75298 1.93123 7.65289 1.99031 7.48872 2.15394ZM7.12261 0.194349C7.48962 0.0437307 7.85846 0 8.23015 0H15.7698C16.1415 0 16.5105 0.0437121 16.8776 0.194263C17.2452 0.345007 17.5433 0.575125 17.8158 0.847594L23.1524 6.18421C23.4249 6.45668 23.655 6.75479 23.8057 7.12236C23.9563 7.48946 24 7.85853 24 8.23015V15.7698C24 16.1548 23.952 16.5282 23.7987 16.8947C23.6455 17.2607 23.4155 17.5527 23.1524 17.8158L17.8158 23.1524C17.5433 23.4249 17.2452 23.655 16.8776 23.8057C16.5105 23.9563 16.1415 24 15.7698 24H8.23015C7.84519 24 7.47182 23.952 7.10532 23.7987C6.73932 23.6455 6.44726 23.4155 6.18421 23.1524L0.848825 17.8158C0.8488 17.8158 0.84885 17.8158 0.848825 17.8158C0.576388 17.5433 0.345783 17.2454 0.194714 16.8779C0.0437194 16.5106 0 16.1415 0 15.7698V8.23015C0 7.84519 0.0480391 7.47182 0.20135 7.10532C0.354452 6.73932 0.58454 6.44726 0.847594 6.18421L6.18513 0.846674C6.45759 0.574982 6.7554 0.345054 7.12261 0.194349ZM12 5.69477C12.5098 5.69477 12.9231 6.10804 12.9231 6.61785V13.3871C12.9231 13.8969 12.5098 14.3102 12 14.3102C11.4902 14.3102 11.0769 13.8969 11.0769 13.3871V6.61785C11.0769 6.10804 11.4902 5.69477 12 5.69477ZM12 15.8437C12.5098 15.8437 12.9231 16.257 12.9231 16.7668V17.3822C12.9231 17.892 12.5098 18.3052 12 18.3052C11.4902 18.3052 11.0769 17.892 11.0769 17.3822V16.7668C11.0769 16.257 11.4902 15.8437 12 15.8437Z" fill="currentColor"/>
3
+ </svg>
@@ -1,3 +1,3 @@
1
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" />
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="currentColor" />
3
3
  </svg>
@@ -0,0 +1,4 @@
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="M16.6425 7.92858C17.0558 8.22704 17.1489 8.80404 16.8505 9.21734L12.4237 15.3474C12.4236 15.3475 12.4238 15.3473 12.4237 15.3474C12.2341 15.6102 11.9873 15.8271 11.7024 15.9814C11.4174 16.1357 11.1011 16.2237 10.7773 16.2389C10.4535 16.254 10.1304 16.1958 9.83224 16.0687C9.53413 15.9416 9.26855 15.7489 9.05527 15.5049C9.0552 15.5048 9.05534 15.505 9.05527 15.5049L7.20296 13.3867C6.86736 13.003 6.90641 12.4198 7.29017 12.0842C7.67393 11.7486 8.25709 11.7877 8.59268 12.1714L10.445 14.2896C10.4755 14.3245 10.5136 14.3522 10.5562 14.3704C10.5988 14.3886 10.645 14.3969 10.6912 14.3947C10.7375 14.3925 10.7827 14.38 10.8234 14.3579C10.8641 14.3359 10.8993 14.3049 10.9264 14.2674L15.3538 8.13651C15.6522 7.72321 16.2292 7.63012 16.6425 7.92858Z" fill="currentColor"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12 1.84615C6.39219 1.84615 1.84615 6.39219 1.84615 12C1.84615 17.6078 6.39219 22.1538 12 22.1538C17.6078 22.1538 22.1538 17.6078 22.1538 12C22.1538 6.39219 17.6078 1.84615 12 1.84615ZM0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12Z" fill="currentColor"/>
4
+ </svg>
@@ -1,3 +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>
1
+ <svg width="24" height="24" viewBox="0 0 24 24" 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="currentColor"/>
3
+ </svg>
package/icons/info.svg ADDED
@@ -0,0 +1,4 @@
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="M12 6.15381C12.5098 6.15381 12.9231 6.56708 12.9231 7.07689V7.69227C12.9231 8.20207 12.5098 8.61535 12 8.61535C11.4902 8.61535 11.0769 8.20207 11.0769 7.69227V7.07689C11.0769 6.56708 11.4902 6.15381 12 6.15381ZM10.4615 10.7692C10.4615 10.2594 10.8748 9.84612 11.3846 9.84612H12C12.5098 9.84612 12.9231 10.2594 12.9231 10.7692V16.0525C13.2816 16.1792 13.5385 16.5211 13.5385 16.923C13.5385 17.4328 13.1252 17.8461 12.6154 17.8461H11.3846C10.8748 17.8461 10.4615 17.4328 10.4615 16.923C10.4615 16.5211 10.7184 16.1792 11.0769 16.0525V11.6397C10.7184 11.513 10.4615 11.1711 10.4615 10.7692Z" fill="currentColor"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M18.5084 0.0701433C17.6498 -1.24757e-05 16.5847 -6.90184e-06 15.2406 1.40675e-07H8.75939C7.41534 -6.90184e-06 6.3502 -1.24757e-05 5.4916 0.0701433C4.61356 0.141887 3.87051 0.291634 3.192 0.63723C2.09202 1.19771 1.19765 2.09215 0.637165 3.19213C0.29157 3.87064 0.141887 4.61356 0.0701433 5.4916C-1.24757e-05 6.3502 -6.90184e-06 7.41534 1.40675e-07 8.75939V15.2406C-6.90184e-06 16.5847 -1.24757e-05 17.6498 0.0701433 18.5084C0.141887 19.3864 0.291634 20.1295 0.63723 20.808C1.19771 21.908 2.09215 22.8024 3.19213 23.3628C3.87064 23.7084 4.61356 23.8581 5.4916 23.9299C6.35019 24 7.41532 24 8.75937 24H15.2406C16.5847 24 17.6498 24 18.5084 23.9299C19.3864 23.8581 20.1295 23.7084 20.808 23.3628C21.908 22.8023 22.8024 21.9078 23.3628 20.8079C23.7084 20.1294 23.8581 19.3864 23.9299 18.5084C24 17.6498 24 16.5847 24 15.2406V8.75937C24 7.41532 24 6.35019 23.9299 5.4916C23.8581 4.61356 23.7084 3.87051 23.3628 3.192C22.8023 2.09202 21.9079 1.19765 20.8079 0.637165C20.1294 0.29157 19.3864 0.141887 18.5084 0.0701433ZM4.03016 2.28216C4.40516 2.09117 4.87822 1.97257 5.64194 1.91017C6.41655 1.84687 7.40631 1.84615 8.8 1.84615H15.2C16.5937 1.84615 17.5834 1.84687 18.3581 1.91017C19.1219 1.97258 19.5949 2.0912 19.97 2.28222C20.7225 2.66571 21.3344 3.27758 21.7178 4.03016C21.9088 4.40516 22.0274 4.87822 22.0898 5.64194C22.1531 6.41656 22.1538 7.40631 22.1538 8.8V15.2C22.1538 16.5937 22.1531 17.5834 22.0898 18.3581C22.0274 19.1218 21.9088 19.5948 21.7178 19.9698C21.3344 20.7225 20.7225 21.3344 19.9698 21.7178C19.5948 21.9088 19.1218 22.0274 18.3581 22.0898C17.5834 22.1531 16.5937 22.1538 15.2 22.1538H8.8C7.40631 22.1538 6.41656 22.1531 5.64194 22.0898C4.87822 22.0274 4.40516 21.9088 4.03016 21.7178C3.27758 21.3344 2.66571 20.7225 2.28222 19.97C2.0912 19.5949 1.97258 19.1219 1.91017 18.3581C1.84687 17.5834 1.84615 16.5937 1.84615 15.2V8.8C1.84615 7.40631 1.84687 6.41655 1.91017 5.64194C1.97257 4.87822 2.09117 4.40516 2.28216 4.03016C2.66563 3.27764 3.27764 2.66563 4.03016 2.28216Z" fill="currentColor"/>
4
+ </svg>
@@ -0,0 +1,4 @@
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="M11.9222 8.23694C12.395 8.23694 12.7784 8.62029 12.7784 9.09318V15.3722C12.7784 15.8451 12.395 16.2284 11.9222 16.2284C11.4493 16.2284 11.0659 15.8451 11.0659 15.3722V9.09318C11.0659 8.62029 11.4493 8.23694 11.9222 8.23694ZM11.9222 17.652C12.395 17.652 12.7784 18.0354 12.7784 18.5083V19.0791C12.7784 19.552 12.395 19.9353 11.9222 19.9353C11.4493 19.9353 11.0659 19.552 11.0659 19.0791V18.5083C11.0659 18.0354 11.4493 17.652 11.9222 17.652Z" fill="currentColor"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M21.8974 18.9385L13.639 3.83981C12.9304 2.54425 11.0696 2.54425 10.361 3.83981L2.10258 18.9385C1.42165 20.1834 2.32258 21.7031 3.74156 21.7031H20.2584C21.6774 21.7031 22.5784 20.1834 21.8974 18.9385ZM15.278 2.94334C13.8607 0.35222 10.1393 0.35222 8.72202 2.94334L0.463591 18.042C-0.898272 20.5319 0.903593 23.5712 3.74156 23.5712H20.2584C23.0964 23.5712 24.8983 20.5319 23.5364 18.042L15.278 2.94334Z" fill="currentColor"/>
4
+ </svg>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "webcoreui",
3
3
  "type": "module",
4
- "version": "0.0.5",
4
+ "version": "0.0.7",
5
5
  "scripts": {
6
6
  "dev": "astro dev",
7
7
  "build": "astro check && astro build",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "files": [
30
30
  "components",
31
- "public",
31
+ "icons",
32
32
  "scss",
33
33
  "astro.d.ts",
34
34
  "astro.js",
package/react.d.ts CHANGED
@@ -1,5 +1,19 @@
1
- declare module 'webcoreui/react' {
2
- import type { AccordionProps } from './components/Accordion/accordion'
3
-
4
- export function Accordion(_props: AccordionProps): any
5
- }
1
+
2
+ declare module 'webcoreui/react' {
3
+ import type { AccordionProps } from './components/Accordion/accordion'
4
+ import type { AlertProps } from './components/Alert/alert'
5
+ import type { BadgeProps } from './components/Badge/badge'
6
+ import type { ButtonProps } from './components/Button/button'
7
+ import type { CardProps } from './components/Card/card'
8
+ import type { ConditionalWrapperProps } from './components/ConditionalWrapper/conditionalwrapper'
9
+ import type { IconProps } from './components/Icon/icon'
10
+
11
+ export function Accordion(_props: AccordionProps): any
12
+ export function Alert(_props: AlertProps): any
13
+ export function Badge(_props: BadgeProps): any
14
+ export function Button(_props: ButtonProps): any
15
+ export function Card(_props: CardProps): any
16
+ export function ConditionalWrapper(_props: ConditionalWrapperProps): any
17
+ export function Icon(_props: IconProps): any
18
+ }
19
+
package/react.js CHANGED
@@ -1,7 +1,15 @@
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
1
+ import AccordionComponent from './components/Accordion/Accordion.tsx'
2
+ import AlertComponent from './components/Alert/Alert.tsx'
3
+ import BadgeComponent from './components/Badge/Badge.tsx'
4
+ import ButtonComponent from './components/Button/Button.tsx'
5
+ import CardComponent from './components/Card/Card.tsx'
6
+ import ConditionalWrapperComponent from './components/ConditionalWrapper/ConditionalWrapper.tsx'
7
+ import IconComponent from './components/Icon/Icon.tsx'
8
+
9
+ export const Accordion = AccordionComponent
10
+ export const Alert = AlertComponent
11
+ export const Badge = BadgeComponent
12
+ export const Button = ButtonComponent
13
+ export const Card = CardComponent
14
+ export const ConditionalWrapper = ConditionalWrapperComponent
15
+ export const Icon = IconComponent
package/svelte.d.ts CHANGED
@@ -1,5 +1,19 @@
1
- declare module 'webcoreui/svelte' {
2
- import type { AccordionProps } from './components/Accordion/accordion'
3
-
4
- export function Accordion(_props: AccordionProps): any
5
- }
1
+
2
+ declare module 'webcoreui/svelte' {
3
+ import type { AccordionProps } from './components/Accordion/accordion'
4
+ import type { AlertProps } from './components/Alert/alert'
5
+ import type { BadgeProps } from './components/Badge/badge'
6
+ import type { ButtonProps } from './components/Button/button'
7
+ import type { CardProps } from './components/Card/card'
8
+ import type { ConditionalWrapperProps } from './components/ConditionalWrapper/conditionalwrapper'
9
+ import type { IconProps } from './components/Icon/icon'
10
+
11
+ export function Accordion(_props: AccordionProps): any
12
+ export function Alert(_props: AlertProps): any
13
+ export function Badge(_props: BadgeProps): any
14
+ export function Button(_props: ButtonProps): any
15
+ export function Card(_props: CardProps): any
16
+ export function ConditionalWrapper(_props: ConditionalWrapperProps): any
17
+ export function Icon(_props: IconProps): any
18
+ }
19
+
package/svelte.js CHANGED
@@ -1,7 +1,15 @@
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
1
+ import AccordionComponent from './components/Accordion/Accordion.svelte'
2
+ import AlertComponent from './components/Alert/Alert.svelte'
3
+ import BadgeComponent from './components/Badge/Badge.svelte'
4
+ import ButtonComponent from './components/Button/Button.svelte'
5
+ import CardComponent from './components/Card/Card.svelte'
6
+ import ConditionalWrapperComponent from './components/ConditionalWrapper/ConditionalWrapper.svelte'
7
+ import IconComponent from './components/Icon/Icon.svelte'
8
+
9
+ export const Accordion = AccordionComponent
10
+ export const Alert = AlertComponent
11
+ export const Badge = BadgeComponent
12
+ export const Button = ButtonComponent
13
+ export const Card = CardComponent
14
+ export const ConditionalWrapper = ConditionalWrapperComponent
15
+ export const Icon = IconComponent
Binary file
Binary file
Binary file
@@ -1,9 +0,0 @@
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