webcoreui 0.4.1 → 0.6.0

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 (92) hide show
  1. package/README.md +237 -227
  2. package/astro.d.ts +115 -62
  3. package/astro.js +14 -0
  4. package/components/Avatar/Avatar.astro +9 -2
  5. package/components/Avatar/Avatar.svelte +3 -1
  6. package/components/Avatar/Avatar.tsx +4 -2
  7. package/components/Avatar/avatar.ts +1 -0
  8. package/components/Badge/Badge.astro +4 -0
  9. package/components/Badge/Badge.svelte +5 -1
  10. package/components/Badge/Badge.tsx +4 -0
  11. package/components/Badge/badge.module.scss +8 -0
  12. package/components/Badge/badge.ts +7 -3
  13. package/components/Breadcrumb/Breadcrumb.astro +51 -0
  14. package/components/Breadcrumb/Breadcrumb.svelte +45 -0
  15. package/components/Breadcrumb/Breadcrumb.tsx +51 -0
  16. package/components/Breadcrumb/breadcrumb.module.scss +26 -0
  17. package/components/Breadcrumb/breadcrumb.ts +12 -0
  18. package/components/Button/button.module.scss +6 -1
  19. package/components/Button/button.ts +13 -3
  20. package/components/Carousel/Carousel.astro +198 -0
  21. package/components/Carousel/Carousel.svelte +161 -0
  22. package/components/Carousel/Carousel.tsx +172 -0
  23. package/components/Carousel/carousel.module.scss +58 -0
  24. package/components/Carousel/carousel.ts +26 -0
  25. package/components/Checkbox/checkbox.ts +4 -2
  26. package/components/DataTable/DataTable.astro +332 -0
  27. package/components/DataTable/DataTable.svelte +272 -0
  28. package/components/DataTable/DataTable.tsx +287 -0
  29. package/components/DataTable/datatable.module.scss +102 -0
  30. package/components/DataTable/datatable.ts +41 -0
  31. package/components/Footer/Footer.astro +91 -0
  32. package/components/Footer/Footer.svelte +94 -0
  33. package/components/Footer/Footer.tsx +107 -0
  34. package/components/Footer/footer.module.scss +61 -0
  35. package/components/Footer/footer.ts +29 -0
  36. package/components/Icon/Icon.svelte +1 -1
  37. package/components/Icon/icon.ts +18 -1
  38. package/components/Icon/map.ts +14 -0
  39. package/components/Input/input.module.scss +6 -0
  40. package/components/List/List.astro +1 -1
  41. package/components/List/List.svelte +1 -1
  42. package/components/List/List.tsx +1 -2
  43. package/components/List/list.ts +3 -1
  44. package/components/Masonry/Masonry.astro +54 -0
  45. package/components/Masonry/Masonry.svelte +54 -0
  46. package/components/Masonry/Masonry.tsx +62 -0
  47. package/components/Masonry/masonry.module.scss +18 -0
  48. package/components/Masonry/masonry.ts +36 -0
  49. package/components/Menu/Menu.astro +1 -1
  50. package/components/Menu/Menu.svelte +1 -1
  51. package/components/Menu/Menu.tsx +1 -1
  52. package/components/Menu/menu.ts +4 -2
  53. package/components/Modal/Modal.astro +2 -0
  54. package/components/Modal/Modal.svelte +2 -0
  55. package/components/Modal/Modal.tsx +2 -0
  56. package/components/Modal/modal.module.scss +29 -22
  57. package/components/Modal/modal.ts +1 -0
  58. package/components/Pagination/Pagination.astro +189 -0
  59. package/components/Pagination/Pagination.svelte +144 -0
  60. package/components/Pagination/Pagination.tsx +162 -0
  61. package/components/Pagination/pagination.module.scss +49 -0
  62. package/components/Pagination/pagination.ts +35 -0
  63. package/components/Rating/rating.ts +3 -1
  64. package/components/Select/Select.astro +8 -4
  65. package/components/Select/Select.svelte +15 -6
  66. package/components/Select/Select.tsx +15 -8
  67. package/components/Select/select.ts +7 -2
  68. package/components/Sidebar/Sidebar.astro +61 -0
  69. package/components/Sidebar/Sidebar.svelte +50 -0
  70. package/components/Sidebar/Sidebar.tsx +58 -0
  71. package/components/Sidebar/sidebar.module.scss +43 -0
  72. package/components/Sidebar/sidebar.ts +21 -0
  73. package/components/Switch/switch.ts +4 -2
  74. package/components/Table/Table.svelte +1 -1
  75. package/components/Table/table.ts +1 -1
  76. package/icons/arrow-left.svg +3 -0
  77. package/icons/arrow-right.svg +3 -0
  78. package/icons/circle-close.svg +3 -0
  79. package/icons/components.svg +3 -0
  80. package/icons/file.svg +3 -0
  81. package/icons/home.svg +4 -0
  82. package/icons/order.svg +3 -0
  83. package/icons/sun.svg +1 -1
  84. package/icons.d.ts +7 -0
  85. package/icons.js +7 -0
  86. package/index.d.ts +6 -6
  87. package/package.json +8 -10
  88. package/react.d.ts +115 -62
  89. package/react.js +14 -0
  90. package/scss/resets.scss +27 -1
  91. package/svelte.d.ts +116 -62
  92. package/svelte.js +14 -0
@@ -21,8 +21,9 @@ const {
21
21
  label,
22
22
  subText,
23
23
  disabled,
24
- className,
25
24
  position,
25
+ updateValue = true,
26
+ className,
26
27
  ...rest
27
28
  } = Astro.props
28
29
 
@@ -42,6 +43,7 @@ const classes = classNames([
42
43
  label={label}
43
44
  subText={subText}
44
45
  data-id={`w-select-${name}`}
46
+ data-no-update={!updateValue ? 'true' : undefined}
45
47
  data-position={position}
46
48
  labelClassName={classes}
47
49
  >
@@ -125,11 +127,13 @@ const classes = classNames([
125
127
 
126
128
  closePopover(`[data-id="${popoverId}"]`)
127
129
 
128
- selectElement.value = name
130
+ if (!selectElement.dataset.noUpdate) {
131
+ selectElement.value = name
132
+ }
129
133
 
130
134
  dispatch('selectOnChange', {
131
- select: selectName,
132
- ...payload
135
+ ...payload,
136
+ select: selectName
133
137
  })
134
138
  })
135
139
  </script>
@@ -16,14 +16,17 @@
16
16
 
17
17
  import styles from './select.module.scss'
18
18
 
19
+ import type { ListEventType } from '../List/list'
20
+
19
21
  export let name: SvelteSelectProps['name'] = ''
20
22
  export let value: SvelteSelectProps['value'] = ''
21
23
  export let placeholder: SvelteSelectProps['placeholder'] = ''
22
24
  export let label: SvelteSelectProps['label'] = ''
23
25
  export let subText: SvelteSelectProps['subText'] = ''
24
26
  export let disabled: SvelteSelectProps['disabled'] = false
25
- export let className: SvelteSelectProps['className'] = ''
27
+ export let updateValue: SvelteSelectProps['updateValue'] = true
26
28
  export let position: SvelteSelectProps['position'] = 'bottom'
29
+ export let className: SvelteSelectProps['className'] = ''
27
30
  export let onChange: SvelteSelectProps['onChange'] = () => {}
28
31
 
29
32
  let popoverInstance: any
@@ -39,18 +42,22 @@
39
42
  styles.popover
40
43
  ])
41
44
 
42
- const select = (payload: any) => {
45
+ const select = (event: ListEventType) => {
43
46
  closePopover(`.w-options-${name}`)
44
47
 
45
- value = payload.name
48
+ if (updateValue) {
49
+ value = event.name
50
+ }
46
51
 
47
52
  onChange?.({
48
- select: name,
49
- ...payload
53
+ ...event,
54
+ select: name
50
55
  })
51
56
  }
52
57
 
53
58
  onMount(() => {
59
+ let observer: ResizeObserver | undefined
60
+
54
61
  if (position === 'modal') {
55
62
  modal({
56
63
  trigger: `.w-select-${name}`,
@@ -73,7 +80,8 @@
73
80
  dialogElement.style.width = `${width}px`
74
81
  })
75
82
 
76
- new ResizeObserver(() => resize()).observe(document.body)
83
+ observer = new ResizeObserver(() => resize())
84
+ observer.observe(document.body)
77
85
 
78
86
  popoverInstance = popover({
79
87
  trigger: `.w-select-${name}`,
@@ -91,6 +99,7 @@
91
99
 
92
100
  return () => {
93
101
  popoverInstance?.remove()
102
+ observer?.unobserve(document.body)
94
103
  }
95
104
  })
96
105
  </script>
@@ -15,6 +15,8 @@ import ArrowDown from '../../icons/arrow-down.svg?raw'
15
15
 
16
16
  import styles from './select.module.scss'
17
17
 
18
+ import type { ListEventType } from '../List/list'
19
+
18
20
  const Select = ({
19
21
  name,
20
22
  value,
@@ -22,8 +24,9 @@ const Select = ({
22
24
  label,
23
25
  subText,
24
26
  disabled,
25
- className,
27
+ updateValue = true,
26
28
  position = 'bottom',
29
+ className,
27
30
  onChange,
28
31
  ...rest
29
32
  }: ReactSelectProps) => {
@@ -41,18 +44,22 @@ const Select = ({
41
44
 
42
45
  let popoverInstance: any
43
46
 
44
- const select = (payload: any) => {
47
+ const select = (event: ListEventType) => {
45
48
  closePopover(`.w-options-${name}`)
46
49
 
47
- setValue(payload.name)
50
+ if (updateValue) {
51
+ setValue(event.name)
52
+ }
48
53
 
49
54
  onChange?.({
50
- select: name,
51
- ...payload
55
+ ...event,
56
+ select: name
52
57
  })
53
58
  }
54
59
 
55
60
  useEffect(() => {
61
+ let observer: ResizeObserver | undefined
62
+
56
63
  if (position === 'modal') {
57
64
  modal({
58
65
  trigger: `.w-select-${name}`,
@@ -76,7 +83,8 @@ const Select = ({
76
83
  dialogElement.style.width = `${width}px`
77
84
  })
78
85
 
79
- new ResizeObserver(() => resize()).observe(document.body)
86
+ observer = new ResizeObserver(() => resize())
87
+ observer.observe(document.body)
80
88
 
81
89
  popoverInstance = popover({
82
90
  trigger: `.w-select-${name}`,
@@ -95,6 +103,7 @@ const Select = ({
95
103
 
96
104
  return () => {
97
105
  popoverInstance?.remove()
106
+ observer?.unobserve(document.body)
98
107
  }
99
108
  }, [])
100
109
 
@@ -114,8 +123,6 @@ const Select = ({
114
123
  <span
115
124
  dangerouslySetInnerHTML={{ __html: ArrowDown }}
116
125
  style={{
117
- height: '18px',
118
- position: 'absolute',
119
126
  right: 0,
120
127
  pointerEvents: 'none'
121
128
  }}
@@ -2,6 +2,10 @@ import type { PopoverPosition } from '../../utils/popover'
2
2
 
3
3
  import type { ListEventType, ListProps } from '../List/list'
4
4
 
5
+ export type SelectEventType = {
6
+ select: string
7
+ } & ListEventType
8
+
5
9
  export type SelectProps = {
6
10
  name: string
7
11
  value?: string
@@ -9,13 +13,14 @@ export type SelectProps = {
9
13
  label?: string
10
14
  subText?: string
11
15
  disabled?: boolean
16
+ updateValue?: boolean
12
17
  position?: PopoverPosition | 'modal'
13
18
  } & ListProps
14
19
 
15
20
  export type SvelteSelectProps = {
16
- onChange?: (event: ListEventType & { select: string }) => void
21
+ onChange?: (event: SelectEventType) => void
17
22
  } & SelectProps
18
23
 
19
24
  export type ReactSelectProps = {
20
- onChange?: (event: ListEventType & { select: string }) => void
25
+ onChange?: (event: SelectEventType) => void
21
26
  } & SelectProps
@@ -0,0 +1,61 @@
1
+ ---
2
+ import type { SidebarProps } from './sidebar'
3
+
4
+ import Badge from '../Badge/Badge.astro'
5
+ import Icon from '../Icon/Icon.astro'
6
+
7
+ import styles from './sidebar.module.scss'
8
+
9
+ import type { IconProps } from '../Icon/icon'
10
+
11
+ interface Props extends SidebarProps {}
12
+
13
+ const {
14
+ groups,
15
+ className
16
+ } = Astro.props
17
+
18
+ const classes = [
19
+ styles.sidebar,
20
+ className
21
+ ]
22
+ ---
23
+
24
+ <aside class:list={classes}>
25
+ {groups.map(group => (
26
+ <Fragment>
27
+ {group.title && (
28
+ <strong>{group.title}</strong>
29
+ )}
30
+
31
+ <ul>
32
+ {group.items.map(item => (
33
+ <li>
34
+ <a
35
+ href={item.href}
36
+ target={item.target}
37
+ class:list={[item.active && styles.active]}
38
+ >
39
+ {item.icon && (
40
+ <Fragment>
41
+ {item.icon.startsWith('<svg')
42
+ ? <Fragment set:html={item.icon} />
43
+ : <Icon type={item.icon as IconProps['type']} />
44
+ }
45
+ </Fragment>
46
+ )}
47
+ {item.name}
48
+ {item.badge && (
49
+ <Badge theme={item.badgeTheme || 'success'} small={true}>
50
+ {item.badge}
51
+ </Badge>
52
+ )}
53
+ </a>
54
+ </li>
55
+ ))}
56
+ </ul>
57
+ </Fragment>
58
+ ))}
59
+
60
+ <slot />
61
+ </aside>
@@ -0,0 +1,50 @@
1
+ <script lang="ts">
2
+ import type { SidebarProps } from './sidebar'
3
+
4
+ import Badge from '../Badge/Badge.svelte'
5
+
6
+ import { classNames } from '../../utils/classNames'
7
+
8
+ import styles from './sidebar.module.scss'
9
+
10
+ export let groups: SidebarProps['groups'] = []
11
+ export let className: SidebarProps['className'] = ''
12
+
13
+ const classes = classNames([
14
+ styles.sidebar,
15
+ className
16
+ ])
17
+ </script>
18
+
19
+ <aside class={classes}>
20
+ {#each groups as group}
21
+
22
+ {#if group.title}
23
+ <strong>{group.title}</strong>
24
+ {/if}
25
+
26
+ <ul>
27
+ {#each group.items as item}
28
+ <li>
29
+ <a
30
+ href={item.href}
31
+ target={item.target}
32
+ class={item.active ? styles.active : undefined}
33
+ >
34
+ {#if item.icon}
35
+ {@html item.icon}
36
+ {/if}
37
+ {item.name}
38
+ {#if item.badge}
39
+ <Badge theme={item.badgeTheme || 'success'} small={true}>
40
+ {item.badge}
41
+ </Badge>
42
+ {/if}
43
+ </a>
44
+ </li>
45
+ {/each}
46
+ </ul>
47
+ {/each}
48
+
49
+ <slot />
50
+ </aside>
@@ -0,0 +1,58 @@
1
+ import React from 'react'
2
+ import type { ReactSidebarProps } from './sidebar'
3
+
4
+ import Badge from '../Badge/Badge.tsx'
5
+
6
+ import { classNames } from '../../utils/classNames'
7
+
8
+ import styles from './sidebar.module.scss'
9
+
10
+ const Sidebar = ({
11
+ groups,
12
+ children,
13
+ className
14
+ }: ReactSidebarProps) => {
15
+ const classes = classNames([
16
+ styles.sidebar,
17
+ className
18
+ ])
19
+
20
+ return (
21
+ <aside className={classes}>
22
+ {groups.map((group, groupIndex) => (
23
+ <React.Fragment key={groupIndex}>
24
+ {group.title && (
25
+ <strong>{group.title}</strong>
26
+ )}
27
+
28
+ <ul>
29
+ {group.items.map((item, itemIndex) => (
30
+ <li key={itemIndex}>
31
+ <a
32
+ href={item.href}
33
+ target={item.target}
34
+ className={item.active ? styles.active : undefined}
35
+ >
36
+ {item.icon && (
37
+ <span dangerouslySetInnerHTML={{ __html: item.icon }} />
38
+ )}
39
+ {item.name}
40
+ {item.badge && (
41
+ <Badge theme={item.badgeTheme || 'success'} small={true}>
42
+ {item.badge}
43
+ </Badge>
44
+ )}
45
+ </a>
46
+ </li>
47
+ ))}
48
+ </ul>
49
+ </React.Fragment>
50
+ ))}
51
+
52
+ {children}
53
+ </aside>
54
+ )
55
+ }
56
+
57
+ export default Sidebar
58
+
@@ -0,0 +1,43 @@
1
+ @import '../../scss/config.scss';
2
+
3
+ .sidebar {
4
+
5
+ strong {
6
+ @include spacing(mb-sm);
7
+
8
+ display: block;
9
+ }
10
+
11
+ ul {
12
+ @include layout(flex, column, sm);
13
+ @include typography(normal);
14
+ @include spacing(0);
15
+
16
+ list-style-type: none;
17
+
18
+ &:not(:last-child) {
19
+ @include spacing('mb-3xl');
20
+ }
21
+
22
+ li {
23
+ @include spacing(m0);
24
+ }
25
+
26
+ a {
27
+ @include typography(primary-20, none);
28
+ @include layout(flex, v-center, sm);
29
+
30
+ &:hover {
31
+ @include typography(primary);
32
+ }
33
+
34
+ &.active {
35
+ @include typography(primary);
36
+ }
37
+
38
+ svg {
39
+ @include size(18px);
40
+ }
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,21 @@
1
+ import type { ButtonProps } from '../Button/button'
2
+
3
+ export type SidebarProps = {
4
+ groups: {
5
+ title?: string
6
+ items: {
7
+ name: string
8
+ href: string
9
+ target?: ButtonProps['target']
10
+ active?: boolean
11
+ icon?: string
12
+ badge?: string
13
+ badgeTheme?: ButtonProps['theme']
14
+ }[]
15
+ }[]
16
+ className?: string
17
+ }
18
+
19
+ export type ReactSidebarProps = {
20
+ children?: React.ReactNode
21
+ } & SidebarProps
@@ -1,3 +1,5 @@
1
+ import type { MouseEventHandler } from 'svelte/elements'
2
+
1
3
  export type SwitchProps = {
2
4
  label?: string
3
5
  reverse?: boolean
@@ -11,9 +13,9 @@ export type SwitchProps = {
11
13
  }
12
14
 
13
15
  export type SvelteSwitchProps = {
14
- onClick?: (key: any) => any
16
+ onClick?: MouseEventHandler<HTMLInputElement>
15
17
  } & SwitchProps
16
18
 
17
19
  export type ReactSwitchProps = {
18
- onClick?: (key: any) => any
20
+ onClick?: React.MouseEventHandler<HTMLInputElement>
19
21
  } & SwitchProps
@@ -12,7 +12,7 @@
12
12
  export let striped: TableProps['striped'] = null
13
13
  export let offsetStripe: TableProps['offsetStripe'] = false
14
14
  export let compact: TableProps['compact'] = false
15
- export let maxHeight: TableProps['maxHeight'] = 0
15
+ export let maxHeight: TableProps['maxHeight'] = ''
16
16
  export let className: TableProps['className'] = ''
17
17
 
18
18
  const classes = classNames([
@@ -6,6 +6,6 @@ export type TableProps = {
6
6
  striped?: 'column' | 'row' | null
7
7
  offsetStripe?: boolean
8
8
  compact?: boolean
9
- maxHeight?: number
9
+ maxHeight?: string
10
10
  className?: string
11
11
  }
@@ -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="M17.5786 0.360618C18.1158 0.864272 18.143 1.70806 17.6394 2.24526L8.4943 12L17.6394 21.7547C18.143 22.292 18.1158 23.1358 17.5786 23.6395C17.0413 24.143 16.1976 24.1158 15.6939 23.5787L5.6938 12.9119C5.213 12.3991 5.213 11.601 5.6938 11.0881L15.6939 0.421418C16.1976 -0.11581 17.0414 -0.143009 17.5786 0.360618Z" fill="currentColor"/>
3
+ </svg>
@@ -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="M6.42142 23.6394C5.88419 23.1357 5.85699 22.2919 6.36062 21.7547L15.5057 12L6.36062 2.2453C5.85699 1.708 5.88419 0.8642 6.42142 0.3605C6.95865 -0.143 7.80243 -0.115799 8.30606 0.421301L18.3062 11.0881C18.787 11.6009 18.787 12.399 18.3062 12.9119L8.30606 23.5786C7.80243 24.1158 6.95865 24.143 6.42142 23.6394Z" fill="currentColor"/>
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="M15.6667 8.33333L8.33333 15.6667M8.33333 8.33333L15.6667 15.6667M23 12C23 13.4445 22.7155 14.8749 22.1627 16.2095C21.6099 17.5441 20.7996 18.7567 19.7782 19.7782C18.7567 20.7996 17.5441 21.6099 16.2095 22.1627C14.8749 22.7155 13.4445 23 12 23C10.5555 23 9.12506 22.7155 7.79048 22.1627C6.4559 21.6099 5.24327 20.7996 4.22183 19.7782C3.20038 18.7567 2.39013 17.5441 1.83733 16.2095C1.28452 14.8749 1 13.4445 1 12C1 9.08262 2.15893 6.28473 4.22183 4.22183C6.28473 2.15893 9.08262 1 12 1C14.9174 1 17.7153 2.15893 19.7782 4.22183C21.8411 6.28473 23 9.08262 23 12Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
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="M8.15 4.85L12 1L15.85 4.85L12 8.7L8.15 4.85ZM15.3 12.55L19.15 8.7L23 12.55L19.15 16.4L15.3 12.55ZM8.15 19.15L12 15.3L15.85 19.15L12 23L8.15 19.15ZM1 12L4.85 8.15L8.7 12L4.85 15.85L1 12Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
package/icons/file.svg ADDED
@@ -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="M9.30726 1H6.66667C5.95942 1 5.28115 1.28973 4.78105 1.80546C4.28095 2.32118 4 3.02065 4 3.75V20.25C4 20.9793 4.28095 21.6788 4.78105 22.1945C5.28115 22.7103 5.95942 23 6.66667 23H17.3333C18.0406 23 18.7189 22.7103 19.219 22.1945C19.719 21.6788 20 20.9793 20 20.25V12M9.30726 1C10.7804 1 12 2.23078 12 3.75V6.5C12 7.22935 12.281 7.92882 12.781 8.44454C13.2811 8.96027 13.9594 9.25 14.6667 9.25H17.3333C18.0406 9.25 18.7189 9.53973 19.219 10.0555C19.719 10.5712 20 11.2707 20 12M9.30726 1C13.6806 1 20 7.55111 20 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
package/icons/home.svg ADDED
@@ -0,0 +1,4 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M4.66625 23C3.19375 23 2 21.8022 2 20.3234V9.56554C2 8.75277 2.36875 7.98279 3 7.47557L10.3337 1.587C10.8023 1.2076 11.3916 1 12 1C12.6084 1 13.1977 1.2076 13.6663 1.587L20.9987 7.47557C21.6312 7.98279 22 8.75277 22 9.56554V20.3234C22 21.8022 20.8063 23 19.3338 23H4.66625Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M9 23V16.4C9 15.7635 9.25286 15.153 9.70294 14.7029C10.153 14.2529 10.7635 14 11.4 14H12.6C13.2365 14 13.847 14.2529 14.2971 14.7029C14.7471 15.153 15 15.7635 15 16.4V23" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </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="M5.8125 20V4M5.8125 4L10.625 9.09091M5.8125 4L1 9.09091M18.1875 4V20M18.1875 20L23 14.9091M18.1875 20L13.375 14.9091" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
package/icons/sun.svg CHANGED
@@ -1,3 +1,3 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M1 12H4.66667M3.44444 3.44444L6.03678 6.03678M20.5556 3.44444L17.9632 6.03678M3.44444 20.5556L6.03678 17.9632M20.5556 20.5556L17.9632 17.9632M12 1V4.66667M12 23V19.3333M19.3333 12H23M15.6667 12C15.6667 12.9725 15.2804 13.9051 14.5927 14.5927C13.9051 15.2804 12.9725 15.6667 12 15.6667C11.0275 15.6667 10.0949 15.2804 9.40727 14.5927C8.71964 13.9051 8.33333 12.9725 8.33333 12C8.33333 11.0275 8.71964 10.0949 9.40727 9.40727C10.0949 8.71964 11.0275 8.33333 12 8.33333C12.9725 8.33333 13.9051 8.71964 14.5927 9.40727C15.2804 10.0949 15.6667 11.0275 15.6667 12Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
3
  </svg>
package/icons.d.ts CHANGED
@@ -1,12 +1,19 @@
1
1
  declare module 'webcoreui/icons' {
2
2
  export const alert: string
3
3
  export const arrowDown: string
4
+ export const arrowLeft: string
5
+ export const arrowRight: string
4
6
  export const check: string
5
7
  export const circleCheck: string
8
+ export const circleClose: string
6
9
  export const close: string
10
+ export const components: string
11
+ export const file: string
7
12
  export const github: string
13
+ export const home: string
8
14
  export const info: string
9
15
  export const moon: string
16
+ export const order: string
10
17
  export const search: string
11
18
  export const sun: string
12
19
  export const warning: string
package/icons.js CHANGED
@@ -1,11 +1,18 @@
1
1
  export { default as alert } from './icons/alert.svg?raw'
2
2
  export { default as arrowDown } from './icons/arrow-down.svg?raw'
3
+ export { default as arrowLeft } from './icons/arrow-left.svg?raw'
4
+ export { default as arrowRight } from './icons/arrow-right.svg?raw'
3
5
  export { default as check } from './icons/check.svg?raw'
4
6
  export { default as circleCheck } from './icons/circle-check.svg?raw'
7
+ export { default as circleClose } from './icons/circle-close.svg?raw'
5
8
  export { default as close } from './icons/close.svg?raw'
9
+ export { default as components } from './icons/components.svg?raw'
10
+ export { default as file } from './icons/file.svg?raw'
6
11
  export { default as github } from './icons/github.svg?raw'
12
+ export { default as home } from './icons/home.svg?raw'
7
13
  export { default as info } from './icons/info.svg?raw'
8
14
  export { default as moon } from './icons/moon.svg?raw'
15
+ export { default as order } from './icons/order.svg?raw'
9
16
  export { default as search } from './icons/search.svg?raw'
10
17
  export { default as sun } from './icons/sun.svg?raw'
11
18
  export { default as warning } from './icons/warning.svg?raw'
package/index.d.ts CHANGED
@@ -1,17 +1,17 @@
1
1
 
2
- type ModalCallback = {
2
+ export type ModalCallback = {
3
3
  trigger: Element | null
4
4
  modal: HTMLElement
5
5
  }
6
6
 
7
- type Modal = {
7
+ export type Modal = {
8
8
  trigger: string
9
9
  modal: string
10
10
  onOpen?: (args: ModalCallback) => unknown
11
11
  onClose?: (args: ModalCallback) => unknown
12
12
  }
13
13
 
14
- type PopoverPosition = 'top'
14
+ export type PopoverPosition = 'top'
15
15
  | 'top-start'
16
16
  | 'top-end'
17
17
  | 'left'
@@ -24,13 +24,13 @@ type PopoverPosition = 'top'
24
24
  | 'bottom-start'
25
25
  | 'bottom-end'
26
26
 
27
- type PopoverCallback = {
27
+ export type PopoverCallback = {
28
28
  trigger: HTMLElement
29
29
  popover: HTMLElement
30
30
  position: PopoverPosition | undefined
31
31
  }
32
32
 
33
- type Popover = {
33
+ export type Popover = {
34
34
  trigger: string
35
35
  popover: string
36
36
  position?: PopoverPosition
@@ -40,7 +40,7 @@ type Popover = {
40
40
  onClose?: (args: PopoverCallback) => unknown
41
41
  }
42
42
 
43
- type Toast = {
43
+ export type Toast = {
44
44
  element: string
45
45
  timeout?: number
46
46
  title?: string
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "webcoreui",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.6.0",
5
5
  "scripts": {
6
6
  "prepare": "husky",
7
7
  "pre-commit": "lint-staged",
@@ -12,20 +12,13 @@
12
12
  "create-component": "node scripts/createComponent.js",
13
13
  "lint": "eslint src/**/* --fix"
14
14
  },
15
- "dependencies": {
15
+ "devDependencies": {
16
16
  "@astrojs/check": "0.7.0",
17
17
  "@astrojs/react": "3.5.0",
18
18
  "@astrojs/svelte": "5.5.0",
19
- "astro": "4.10.2",
20
- "react": "18.3.1",
21
- "react-dom": "18.3.1",
22
- "sass": "1.77.5",
23
- "svelte": "4.2.18",
24
- "typescript": "5.4.5"
25
- },
26
- "devDependencies": {
27
19
  "@eslint/js": "9.9.1",
28
20
  "@typescript-eslint/parser": "8.3.0",
21
+ "astro": "4.15.11",
29
22
  "astro-eslint-parser": "1.0.2",
30
23
  "eslint": "9.9.1",
31
24
  "eslint-plugin-astro": "1.2.3",
@@ -34,7 +27,12 @@
34
27
  "eslint-plugin-svelte": "2.43.0",
35
28
  "husky": "9.1.5",
36
29
  "lint-staged": "15.2.9",
30
+ "react": "18.3.1",
31
+ "react-dom": "18.3.1",
32
+ "sass": "1.77.5",
33
+ "svelte": "4.2.19",
37
34
  "svelte-eslint-parser": "0.41.0",
35
+ "typescript": "5.4.5",
38
36
  "typescript-eslint": "8.3.0"
39
37
  },
40
38
  "exports": {