webcoreui 1.5.0-0 → 1.5.0-beta.2

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 (228) hide show
  1. package/astro.d.ts +62 -56
  2. package/astro.js +4 -0
  3. package/components/Accordion/Accordion.astro +1 -1
  4. package/components/Accordion/Accordion.svelte +60 -58
  5. package/components/Accordion/Accordion.tsx +4 -2
  6. package/components/Alert/Alert.astro +2 -1
  7. package/components/Alert/Alert.svelte +9 -2
  8. package/components/Alert/Alert.tsx +10 -3
  9. package/components/Alert/alert.ts +2 -18
  10. package/components/AspectRatio/AspectRatio.astro +1 -1
  11. package/components/AspectRatio/AspectRatio.svelte +7 -2
  12. package/components/AspectRatio/AspectRatio.tsx +6 -3
  13. package/components/AspectRatio/aspectratio.ts +0 -10
  14. package/components/Avatar/Avatar.astro +1 -1
  15. package/components/Avatar/Avatar.svelte +3 -1
  16. package/components/Avatar/Avatar.tsx +3 -2
  17. package/components/Badge/Badge.astro +2 -1
  18. package/components/Badge/Badge.svelte +9 -2
  19. package/components/Badge/Badge.tsx +8 -3
  20. package/components/Badge/badge.ts +11 -13
  21. package/components/Banner/Banner.astro +1 -1
  22. package/components/Banner/Banner.svelte +7 -2
  23. package/components/Banner/Banner.tsx +6 -2
  24. package/components/Banner/banner.ts +0 -10
  25. package/components/BottomNavigation/BottomNavigation.astro +1 -1
  26. package/components/BottomNavigation/BottomNavigation.svelte +3 -1
  27. package/components/BottomNavigation/BottomNavigation.tsx +3 -2
  28. package/components/Breadcrumb/Breadcrumb.astro +1 -1
  29. package/components/Breadcrumb/Breadcrumb.svelte +3 -1
  30. package/components/Breadcrumb/Breadcrumb.tsx +3 -1
  31. package/components/Button/Button.astro +2 -1
  32. package/components/Button/Button.svelte +9 -2
  33. package/components/Button/Button.tsx +7 -2
  34. package/components/Button/button.ts +23 -20
  35. package/components/Card/Card.astro +9 -2
  36. package/components/Card/Card.svelte +17 -4
  37. package/components/Card/Card.tsx +23 -6
  38. package/components/Card/card.module.scss +11 -4
  39. package/components/Card/card.ts +3 -16
  40. package/components/Carousel/Carousel.astro +1 -1
  41. package/components/Carousel/Carousel.svelte +8 -3
  42. package/components/Carousel/Carousel.tsx +7 -2
  43. package/components/Carousel/carousel.ts +0 -12
  44. package/components/CarouselItem/CarouselItem.astro +14 -0
  45. package/components/CarouselItem/CarouselItem.svelte +18 -0
  46. package/components/CarouselItem/CarouselItem.tsx +18 -0
  47. package/components/CarouselItem/carouselItem.ts +4 -0
  48. package/components/Checkbox/Checkbox.astro +3 -6
  49. package/components/Checkbox/Checkbox.svelte +9 -7
  50. package/components/Checkbox/Checkbox.tsx +8 -5
  51. package/components/Checkbox/checkbox.ts +2 -17
  52. package/components/Collapsible/Collapsible.astro +1 -1
  53. package/components/Collapsible/Collapsible.svelte +9 -2
  54. package/components/Collapsible/Collapsible.tsx +8 -2
  55. package/components/Collapsible/collapsible.ts +0 -15
  56. package/components/ConditionalWrapper/ConditionalWrapper.astro +1 -1
  57. package/components/ConditionalWrapper/ConditionalWrapper.svelte +8 -2
  58. package/components/ConditionalWrapper/ConditionalWrapper.tsx +7 -2
  59. package/components/ConditionalWrapper/conditionalwrapper.ts +2 -14
  60. package/components/ContextMenu/ContextMenu.astro +2 -1
  61. package/components/ContextMenu/ContextMenu.svelte +9 -3
  62. package/components/ContextMenu/ContextMenu.tsx +8 -2
  63. package/components/ContextMenu/contextmenu.ts +2 -17
  64. package/components/Copy/Copy.astro +2 -2
  65. package/components/Copy/Copy.svelte +8 -3
  66. package/components/Copy/Copy.tsx +7 -3
  67. package/components/Copy/copy.ts +2 -12
  68. package/components/Counter/Counter.astro +3 -2
  69. package/components/Counter/Counter.svelte +10 -5
  70. package/components/Counter/Counter.tsx +11 -7
  71. package/components/Counter/counter.ts +2 -11
  72. package/components/DataTable/DataTable.astro +1 -1
  73. package/components/DataTable/DataTable.svelte +8 -2
  74. package/components/DataTable/DataTable.tsx +7 -2
  75. package/components/DataTable/datatable.ts +0 -12
  76. package/components/Flex/Flex.astro +2 -1
  77. package/components/Flex/Flex.svelte +8 -2
  78. package/components/Flex/Flex.tsx +8 -3
  79. package/components/Flex/flex.ts +2 -15
  80. package/components/Footer/Footer.astro +1 -1
  81. package/components/Footer/Footer.svelte +7 -2
  82. package/components/Footer/Footer.tsx +6 -2
  83. package/components/Footer/footer.ts +0 -10
  84. package/components/Grid/Grid.astro +2 -1
  85. package/components/Grid/Grid.svelte +8 -2
  86. package/components/Grid/Grid.tsx +8 -3
  87. package/components/Grid/grid.ts +2 -15
  88. package/components/Group/Group.astro +1 -1
  89. package/components/Group/Group.svelte +7 -2
  90. package/components/Group/Group.tsx +6 -2
  91. package/components/Group/group.ts +0 -10
  92. package/components/Icon/Icon.astro +1 -1
  93. package/components/Icon/Icon.svelte +3 -1
  94. package/components/Icon/Icon.tsx +3 -2
  95. package/components/Image/Image.astro +2 -1
  96. package/components/Image/Image.svelte +4 -1
  97. package/components/Image/Image.tsx +3 -1
  98. package/components/Image/image.ts +2 -3
  99. package/components/ImageLoader/ImageLoader.astro +1 -1
  100. package/components/ImageLoader/ImageLoader.svelte +3 -1
  101. package/components/ImageLoader/ImageLoader.tsx +4 -2
  102. package/components/Input/Input.astro +3 -2
  103. package/components/Input/Input.svelte +14 -4
  104. package/components/Input/Input.tsx +11 -3
  105. package/components/Input/input.ts +26 -53
  106. package/components/Kbd/Kbd.astro +1 -1
  107. package/components/Kbd/Kbd.svelte +7 -2
  108. package/components/Kbd/Kbd.tsx +6 -2
  109. package/components/Kbd/kbd.ts +0 -10
  110. package/components/List/List.astro +1 -1
  111. package/components/List/List.svelte +6 -2
  112. package/components/List/List.tsx +8 -4
  113. package/components/List/list.ts +0 -8
  114. package/components/Masonry/Masonry.astro +1 -1
  115. package/components/Masonry/Masonry.svelte +7 -2
  116. package/components/Masonry/Masonry.tsx +7 -3
  117. package/components/Masonry/masonry.ts +2 -13
  118. package/components/Menu/Menu.astro +1 -1
  119. package/components/Menu/Menu.svelte +7 -2
  120. package/components/Menu/Menu.tsx +6 -2
  121. package/components/Menu/menu.ts +0 -10
  122. package/components/Modal/Modal.astro +2 -3
  123. package/components/Modal/Modal.svelte +8 -4
  124. package/components/Modal/Modal.tsx +6 -4
  125. package/components/Modal/modal.ts +2 -14
  126. package/components/OTPInput/OTPInput.astro +3 -5
  127. package/components/OTPInput/OTPInput.svelte +6 -6
  128. package/components/OTPInput/OTPInput.tsx +10 -8
  129. package/components/OTPInput/otpinput.ts +2 -4
  130. package/components/Pagination/Pagination.astro +1 -1
  131. package/components/Pagination/Pagination.svelte +6 -2
  132. package/components/Pagination/Pagination.tsx +6 -2
  133. package/components/Pagination/pagination.ts +0 -8
  134. package/components/Popover/Popover.astro +3 -7
  135. package/components/Popover/Popover.svelte +9 -8
  136. package/components/Popover/Popover.tsx +9 -12
  137. package/components/Popover/popover.ts +2 -15
  138. package/components/Progress/Progress.astro +1 -1
  139. package/components/Progress/Progress.svelte +3 -1
  140. package/components/Progress/Progress.tsx +3 -1
  141. package/components/Radio/Radio.astro +3 -4
  142. package/components/Radio/Radio.svelte +10 -5
  143. package/components/Radio/Radio.tsx +7 -5
  144. package/components/Radio/radio.ts +2 -14
  145. package/components/RangeSlider/RangeSlider.astro +1 -1
  146. package/components/RangeSlider/RangeSlider.svelte +6 -2
  147. package/components/RangeSlider/RangeSlider.tsx +7 -3
  148. package/components/RangeSlider/rangeslider.ts +0 -9
  149. package/components/Rating/Rating.astro +1 -1
  150. package/components/Rating/Rating.svelte +3 -1
  151. package/components/Rating/Rating.tsx +3 -1
  152. package/components/Ribbon/Ribbon.astro +1 -1
  153. package/components/Ribbon/Ribbon.svelte +7 -2
  154. package/components/Ribbon/Ribbon.tsx +6 -2
  155. package/components/Ribbon/ribbon.ts +0 -10
  156. package/components/Select/Select.astro +1 -1
  157. package/components/Select/Select.svelte +9 -4
  158. package/components/Select/Select.tsx +9 -4
  159. package/components/Select/select.ts +1 -12
  160. package/components/Sheet/Sheet.astro +2 -1
  161. package/components/Sheet/Sheet.svelte +5 -3
  162. package/components/Sheet/Sheet.tsx +5 -4
  163. package/components/Sheet/sheet.ts +3 -10
  164. package/components/Sidebar/Sidebar.astro +1 -1
  165. package/components/Sidebar/Sidebar.svelte +7 -2
  166. package/components/Sidebar/Sidebar.tsx +6 -2
  167. package/components/Sidebar/sidebar.ts +0 -10
  168. package/components/Skeleton/Skeleton.astro +1 -1
  169. package/components/Skeleton/Skeleton.svelte +3 -1
  170. package/components/Skeleton/Skeleton.tsx +3 -1
  171. package/components/Slider/Slider.astro +1 -1
  172. package/components/Slider/Slider.svelte +8 -2
  173. package/components/Slider/Slider.tsx +6 -2
  174. package/components/Slider/slider.ts +0 -10
  175. package/components/SpeedDial/SpeedDial.astro +1 -1
  176. package/components/SpeedDial/SpeedDial.svelte +3 -1
  177. package/components/SpeedDial/SpeedDial.tsx +4 -2
  178. package/components/Spinner/Spinner.astro +1 -1
  179. package/components/Spinner/Spinner.svelte +3 -1
  180. package/components/Spinner/Spinner.tsx +3 -1
  181. package/components/Spoiler/Spoiler.astro +1 -1
  182. package/components/Spoiler/Spoiler.svelte +7 -2
  183. package/components/Spoiler/Spoiler.tsx +6 -2
  184. package/components/Spoiler/spoiler.ts +0 -10
  185. package/components/Stepper/Stepper.astro +1 -1
  186. package/components/Stepper/Stepper.svelte +3 -1
  187. package/components/Stepper/Stepper.tsx +3 -1
  188. package/components/Switch/Switch.astro +7 -2
  189. package/components/Switch/Switch.svelte +13 -4
  190. package/components/Switch/Switch.tsx +8 -4
  191. package/components/Switch/switch.ts +2 -16
  192. package/components/Tab/Tab.astro +25 -0
  193. package/components/Tab/Tab.svelte +28 -0
  194. package/components/Tab/Tab.tsx +30 -0
  195. package/components/Tab/tab.ts +6 -0
  196. package/components/Table/Table.astro +1 -1
  197. package/components/Table/Table.svelte +3 -1
  198. package/components/Table/Table.tsx +3 -1
  199. package/components/Tabs/Tabs.astro +58 -25
  200. package/components/Tabs/Tabs.svelte +45 -12
  201. package/components/Tabs/Tabs.tsx +42 -11
  202. package/components/Tabs/tabs.module.scss +7 -6
  203. package/components/Tabs/tabs.ts +0 -10
  204. package/components/Textarea/Textarea.astro +3 -6
  205. package/components/Textarea/Textarea.svelte +10 -7
  206. package/components/Textarea/Textarea.tsx +9 -7
  207. package/components/Textarea/textarea.ts +2 -17
  208. package/components/ThemeSwitcher/ThemeSwitcher.astro +1 -1
  209. package/components/ThemeSwitcher/ThemeSwitcher.svelte +9 -3
  210. package/components/ThemeSwitcher/ThemeSwitcher.tsx +7 -2
  211. package/components/ThemeSwitcher/themeswitcher.ts +0 -13
  212. package/components/Timeline/Timeline.astro +1 -1
  213. package/components/Timeline/Timeline.svelte +7 -2
  214. package/components/Timeline/Timeline.tsx +6 -2
  215. package/components/Timeline/timeline.ts +0 -10
  216. package/components/TimelineItem/TimelineItem.astro +1 -1
  217. package/components/TimelineItem/TimelineItem.svelte +7 -2
  218. package/components/TimelineItem/TimelineItem.tsx +8 -3
  219. package/components/TimelineItem/timelineitem.ts +0 -12
  220. package/components/Toast/Toast.astro +2 -1
  221. package/components/Toast/Toast.svelte +5 -3
  222. package/components/Toast/Toast.tsx +5 -4
  223. package/components/Toast/toast.ts +3 -11
  224. package/package.json +19 -19
  225. package/react.d.ts +145 -138
  226. package/react.js +4 -0
  227. package/svelte.d.ts +145 -138
  228. package/svelte.js +4 -0
@@ -1,5 +1,7 @@
1
1
  <script lang="ts">
2
- import type { SvelteInputProps } from './input'
2
+ import type { Snippet } from 'svelte'
3
+ import type { HTMLInputAttributes } from 'svelte/elements'
4
+ import type { InputProps, InputTarget } from './input'
3
5
 
4
6
  import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.svelte'
5
7
 
@@ -7,6 +9,14 @@
7
9
 
8
10
  import styles from './input.module.scss'
9
11
 
12
+ export type Props = InputProps<HTMLInputAttributes> & {
13
+ onChange?: (event: Event & InputTarget) => void
14
+ onKeyUp?: (event: KeyboardEvent & InputTarget) => void
15
+ onInput?: (event: Event & InputTarget) => void
16
+ onClick?: (event: MouseEvent & InputTarget) => void
17
+ children?: Snippet
18
+ }
19
+
10
20
  let {
11
21
  type = 'text',
12
22
  theme,
@@ -21,7 +31,7 @@
21
31
  onClick,
22
32
  children,
23
33
  ...rest
24
- }: SvelteInputProps = $props()
34
+ }: Props = $props()
25
35
 
26
36
  const classes = $derived(classNames([
27
37
  styles.input,
@@ -52,14 +62,14 @@
52
62
  >
53
63
  {@render children?.()}
54
64
  <input
65
+ {...rest}
66
+ {...{ type }}
55
67
  bind:value
56
68
  class={classes}
57
69
  onchange={onChange}
58
70
  onkeyup={onKeyUp}
59
71
  oninput={onInput}
60
72
  onclick={onClick}
61
- {...{ type }}
62
- {...rest}
63
73
  />
64
74
  </ConditionalWrapper>
65
75
  {#if subText}
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import type { ReactInputProps } from './input'
2
+ import type { InputProps } from './input'
3
3
 
4
4
  import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.tsx'
5
5
 
@@ -7,6 +7,14 @@ import { classNames } from '../../utils/classNames'
7
7
 
8
8
  import styles from './input.module.scss'
9
9
 
10
+ export type Props = InputProps<React.InputHTMLAttributes<HTMLInputElement>> & {
11
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void
12
+ onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void
13
+ onInput?: (event: React.InputEvent<HTMLInputElement>) => void
14
+ onClick?: (event: React.MouseEvent<HTMLInputElement>) => void
15
+ children?: React.ReactNode
16
+ }
17
+
10
18
  const Input = ({
11
19
  type = 'text',
12
20
  theme,
@@ -17,7 +25,7 @@ const Input = ({
17
25
  labelClassName,
18
26
  children,
19
27
  ...rest
20
- }: ReactInputProps) => {
28
+ }: Props) => {
21
29
  const classes = classNames([
22
30
  styles.input,
23
31
  theme && styles[theme],
@@ -50,10 +58,10 @@ const Input = ({
50
58
  )}>
51
59
  {children}
52
60
  <input
61
+ {...rest}
53
62
  type={type}
54
63
  className={classes}
55
64
  defaultValue={value}
56
- {...rest}
57
65
  />
58
66
  </ConditionalWrapper>
59
67
  {subText && (
@@ -1,62 +1,35 @@
1
- import type { Snippet } from 'svelte'
2
-
3
1
  export type InputTarget = {
4
2
  currentTarget: HTMLInputElement
5
3
  }
6
4
 
7
- export type InputProps = {
8
- type?: 'text'
9
- | 'email'
10
- | 'password'
11
- | 'number'
12
- | 'tel'
13
- | 'url'
14
- | 'search'
15
- | 'file'
16
- | 'date'
17
- | 'datetime-local'
18
- | 'month'
19
- | 'week'
20
- | 'time'
21
- | 'color'
22
- theme?: 'info'
23
- | 'success'
24
- | 'warning'
25
- | 'alert'
26
- | 'fill'
27
- | null
5
+ type InputType = 'text'
6
+ | 'email'
7
+ | 'password'
8
+ | 'number'
9
+ | 'tel'
10
+ | 'url'
11
+ | 'search'
12
+ | 'file'
13
+ | 'date'
14
+ | 'datetime-local'
15
+ | 'month'
16
+ | 'week'
17
+ | 'time'
18
+ | 'color'
19
+
20
+ type InputTheme = 'info'
21
+ | 'success'
22
+ | 'warning'
23
+ | 'alert'
24
+ | 'fill'
25
+ | null
26
+
27
+ export type InputProps<T extends object = object> = {
28
+ type?: InputType
29
+ theme?: InputTheme
28
30
  value?: string | number
29
- name?: string
30
- placeholder?: string
31
31
  label?: string
32
- disabled?: boolean
33
32
  subText?: string
34
- maxLength?: number
35
- min?: number
36
- max?: number
37
- step?: number
38
- multiple?: boolean
39
- pattern?: string
40
- required?: boolean
41
- autofocus?: boolean
42
- autocomplete?: 'on' | 'off' | 'one-time-code'
43
33
  className?: string
44
34
  labelClassName?: string
45
- [key: string]: any
46
- }
47
-
48
- export type SvelteInputProps = {
49
- onChange?: (event: Event & InputTarget) => void
50
- onKeyUp?: (event: KeyboardEvent & InputTarget) => void
51
- onInput?: (event: Event & InputTarget) => void
52
- onClick?: (event: MouseEvent & InputTarget) => void
53
- children?: Snippet
54
- } & InputProps
55
-
56
- export type ReactInputProps = {
57
- onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void
58
- onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void
59
- onInput?: (event: React.InputEvent<HTMLInputElement>) => void
60
- onClick?: (event: React.MouseEvent<HTMLInputElement>) => void
61
- children?: React.ReactNode
62
- } & InputProps
35
+ } & T
@@ -4,7 +4,7 @@ import { keyMap } from './keyMap'
4
4
 
5
5
  import styles from './kbd.module.scss'
6
6
 
7
- interface Props extends KbdProps {}
7
+ export type Props = KbdProps
8
8
 
9
9
  const {
10
10
  keys,
@@ -1,16 +1,21 @@
1
1
  <script lang="ts">
2
- import type { SvelteKbdProps } from './kbd'
2
+ import type { Snippet } from 'svelte'
3
+ import type { KbdProps } from './kbd'
3
4
  import { keyMap } from './keyMap'
4
5
 
5
6
  import { classNames } from '../../utils/classNames'
6
7
 
7
8
  import styles from './kbd.module.scss'
8
9
 
10
+ export type Props = KbdProps & {
11
+ children?: Snippet
12
+ }
13
+
9
14
  const {
10
15
  keys,
11
16
  className,
12
17
  children
13
- }: SvelteKbdProps = $props()
18
+ }: Props = $props()
14
19
 
15
20
  const classes = $derived(classNames([
16
21
  styles.kbd,
@@ -1,16 +1,20 @@
1
1
  import React from 'react'
2
- import type { ReactKbdProps } from './kbd'
2
+ import type { KbdProps } from './kbd'
3
3
  import { keyMap } from './keyMap'
4
4
 
5
5
  import { classNames } from '../../utils/classNames'
6
6
 
7
7
  import styles from './kbd.module.scss'
8
8
 
9
+ export type Props = KbdProps & {
10
+ children?: React.ReactNode
11
+ }
12
+
9
13
  const Kbd = ({
10
14
  keys,
11
15
  className,
12
16
  children
13
- }: ReactKbdProps) => {
17
+ }: Props) => {
14
18
  const classes = classNames([
15
19
  styles.kbd,
16
20
  className
@@ -1,5 +1,3 @@
1
- import type { Snippet } from 'svelte'
2
-
3
1
  export type KbdProps = {
4
2
  keys?: ('cmd'
5
3
  | 'shift'
@@ -22,11 +20,3 @@ export type KbdProps = {
22
20
  | 'space')[]
23
21
  className?: string
24
22
  }
25
-
26
- export type SvelteKbdProps = {
27
- children?: Snippet
28
- } & KbdProps
29
-
30
- export type ReactKbdProps = {
31
- children?: React.ReactNode
32
- } & KbdProps
@@ -8,7 +8,7 @@ import searchIcon from '../../icons/search.svg?raw'
8
8
 
9
9
  import styles from './list.module.scss'
10
10
 
11
- interface Props extends ListProps {}
11
+ export type Props = ListProps
12
12
 
13
13
  const {
14
14
  showSearchBar,
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import type { ListEventType,SvelteListProps } from './list'
2
+ import type { ListEventType, ListProps } from './list'
3
3
 
4
4
  import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.svelte'
5
5
  import Input from '../Input/Input.svelte'
@@ -10,6 +10,10 @@
10
10
 
11
11
  import styles from './list.module.scss'
12
12
 
13
+ export type Props = ListProps & {
14
+ onSelect?: (event: ListEventType) => void
15
+ }
16
+
13
17
  let {
14
18
  showSearchBar,
15
19
  showSearchBarIcon,
@@ -22,7 +26,7 @@
22
26
  secondary,
23
27
  itemGroups = $bindable([]),
24
28
  onSelect
25
- }: SvelteListProps = $props()
29
+ }: Props = $props()
26
30
 
27
31
  let searchValue = $state('')
28
32
  let numberOfResults = $state(1)
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import type { ListEventType, ReactListProps } from './list'
2
+ import type { ListEventType, ListProps } from './list'
3
3
 
4
4
  import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.tsx'
5
5
  import Input from '../Input/Input.tsx'
@@ -10,6 +10,10 @@ import searchIcon from '../../icons/search.svg?raw'
10
10
 
11
11
  import styles from './list.module.scss'
12
12
 
13
+ export type Props = ListProps & {
14
+ onSelect?: (event: ListEventType) => void
15
+ }
16
+
13
17
  const List = ({
14
18
  showSearchBar,
15
19
  showSearchBarIcon,
@@ -22,7 +26,7 @@ const List = ({
22
26
  secondary,
23
27
  itemGroups,
24
28
  onSelect
25
- }: ReactListProps) => {
29
+ }: Props) => {
26
30
  const [searchValue, setSearchValue] = useState('')
27
31
  const [numberOfResults, setNumberOfResults] = useState(1)
28
32
  const [itemGroupsWithActive, setItemGroups] = useState(itemGroups)
@@ -44,7 +48,7 @@ const List = ({
44
48
  ? { maxHeight } as React.CSSProperties
45
49
  : undefined
46
50
 
47
- const search = (event: React.FormEvent<HTMLInputElement>) => {
51
+ const search = (event: React.InputEvent<HTMLInputElement>) => {
48
52
  const value = (event.target as HTMLInputElement).value.toLowerCase()
49
53
 
50
54
  setSearchValue(value)
@@ -107,7 +111,7 @@ const List = ({
107
111
  </div>
108
112
  )}>
109
113
  <ul className={classes} id={id} style={style}>
110
- {itemGroupsWithActive.map((group: ReactListProps['itemGroups'][0], index) => (
114
+ {itemGroupsWithActive.map((group: Props['itemGroups'][0], index) => (
111
115
  <React.Fragment key={index}>
112
116
  {group.title && (
113
117
  <li className={styles.title}
@@ -30,11 +30,3 @@ export type ListProps = {
30
30
  }[]
31
31
  }[]
32
32
  }
33
-
34
- export type SvelteListProps = {
35
- onSelect?: (event: ListEventType) => void
36
- } & ListProps
37
-
38
- export type ReactListProps = {
39
- onSelect?: (event: ListEventType) => void
40
- } & ListProps
@@ -3,7 +3,7 @@ import type { MasonryProps } from './masonry'
3
3
 
4
4
  import styles from './masonry.module.scss'
5
5
 
6
- interface Props extends MasonryProps {}
6
+ export type Props = MasonryProps
7
7
 
8
8
  const {
9
9
  items,
@@ -1,10 +1,15 @@
1
1
  <script lang="ts">
2
- import type { SvelteMasonryProps } from './masonry'
2
+ import type { SvelteComponent } from 'svelte'
3
+ import type { Items, MasonryProps } from './masonry'
3
4
 
4
5
  import { classNames } from '../../utils/classNames'
5
6
 
6
7
  import styles from './masonry.module.scss'
7
8
 
9
+ export type Props = Omit<MasonryProps, 'items'> & {
10
+ items: Items<typeof SvelteComponent<any>>[]
11
+ }
12
+
8
13
  const {
9
14
  items,
10
15
  element = 'section',
@@ -12,7 +17,7 @@
12
17
  columns = 3,
13
18
  sequential,
14
19
  className
15
- }: SvelteMasonryProps = $props()
20
+ }: Props = $props()
16
21
 
17
22
  const classes = $derived(classNames([
18
23
  styles.masonry,
@@ -1,10 +1,14 @@
1
- import React, { type JSX } from 'react'
2
- import type { ReactMasonryProps } from './masonry'
1
+ import React, { type FC, type JSX } from 'react'
2
+ import type { Items,MasonryProps } from './masonry'
3
3
 
4
4
  import { classNames } from '../../utils/classNames'
5
5
 
6
6
  import styles from './masonry.module.scss'
7
7
 
8
+ export type Props = Omit<MasonryProps, 'items'> & {
9
+ items: Items<FC<any>>[]
10
+ }
11
+
8
12
  const Masonry = ({
9
13
  items,
10
14
  element = 'section',
@@ -12,7 +16,7 @@ const Masonry = ({
12
16
  columns = 3,
13
17
  sequential,
14
18
  className
15
- }: ReactMasonryProps) => {
19
+ }: Props) => {
16
20
  const classes = classNames([
17
21
  styles.masonry,
18
22
  className
@@ -1,7 +1,4 @@
1
- import type { FC } from 'react'
2
- import type { SvelteComponent } from 'svelte'
3
-
4
- type ChildrenProps<ComponentType> = {
1
+ export type ChildrenProps<ComponentType> = {
5
2
  component: ComponentType
6
3
  children?: string | number
7
4
  props?: {
@@ -9,7 +6,7 @@ type ChildrenProps<ComponentType> = {
9
6
  }
10
7
  } | string | number
11
8
 
12
- type Items<ComponentType> = {
9
+ export type Items<ComponentType> = {
13
10
  component?: ComponentType;
14
11
  children?: ChildrenProps<ComponentType>
15
12
  html?: string
@@ -26,11 +23,3 @@ export type MasonryProps = {
26
23
  sequential?: boolean
27
24
  className?: string
28
25
  }
29
-
30
- export type SvelteMasonryProps = {
31
- items: Items<typeof SvelteComponent<any>>[]
32
- } & Omit<MasonryProps, 'items'>
33
-
34
- export type ReactMasonryProps = {
35
- items: Items<FC<any>>[]
36
- } & Omit<MasonryProps, 'items'>
@@ -5,7 +5,7 @@ import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.astro'
5
5
 
6
6
  import styles from './menu.module.scss'
7
7
 
8
- interface Props extends MenuProps {}
8
+ export type Props = MenuProps
9
9
 
10
10
  const {
11
11
  items,
@@ -1,5 +1,6 @@
1
1
  <script lang="ts">
2
- import type { SvelteMenuProps } from './menu'
2
+ import type { Snippet } from 'svelte'
3
+ import type { MenuProps } from './menu'
3
4
 
4
5
  import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.svelte'
5
6
 
@@ -7,6 +8,10 @@
7
8
 
8
9
  import styles from './menu.module.scss'
9
10
 
11
+ export type Props = MenuProps & {
12
+ children?: Snippet
13
+ }
14
+
10
15
  const {
11
16
  items,
12
17
  logo,
@@ -14,7 +19,7 @@
14
19
  className,
15
20
  wrapperClassName,
16
21
  children
17
- }: SvelteMenuProps = $props()
22
+ }: Props = $props()
18
23
 
19
24
  const classes = $derived(classNames([
20
25
  styles.menu,
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import type { ReactMenuProps } from './menu'
2
+ import type { MenuProps } from './menu'
3
3
 
4
4
  import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.tsx'
5
5
 
@@ -7,6 +7,10 @@ import { classNames } from '../../utils/classNames'
7
7
 
8
8
  import styles from './menu.module.scss'
9
9
 
10
+ export type Props = MenuProps & {
11
+ children?: React.ReactNode
12
+ }
13
+
10
14
  const Menu = ({
11
15
  items,
12
16
  logo,
@@ -15,7 +19,7 @@ const Menu = ({
15
19
  wrapperClassName,
16
20
  children
17
21
  // eslint-disable-next-line complexity
18
- }: ReactMenuProps) => {
22
+ }: Props) => {
19
23
  const [active, setActive] = useState(false)
20
24
 
21
25
  const classes = classNames([
@@ -1,5 +1,3 @@
1
- import type { Snippet } from 'svelte'
2
-
3
1
  import type { ButtonProps } from '../Button/button'
4
2
 
5
3
  export type MenuProps = {
@@ -20,11 +18,3 @@ export type MenuProps = {
20
18
  className?: string
21
19
  wrapperClassName?: string
22
20
  }
23
-
24
- export type SvelteMenuProps = {
25
- children?: Snippet
26
- } & MenuProps
27
-
28
- export type ReactMenuProps = {
29
- children?: React.ReactNode
30
- } & MenuProps
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import type { HTMLAttributes } from 'astro/types'
2
3
  import type { ModalProps } from './modal'
3
4
 
4
5
  import Button from '../Button/Button.astro'
@@ -11,7 +12,7 @@ import warning from '../../icons/warning.svg?raw'
11
12
 
12
13
  import styles from './modal.module.scss'
13
14
 
14
- interface Props extends ModalProps {}
15
+ export type Props = ModalProps<HTMLAttributes<'dialog'>>
15
16
 
16
17
  const iconMap = {
17
18
  info,
@@ -28,7 +29,6 @@ const {
28
29
  closeOnOverlay = true,
29
30
  transparent,
30
31
  theme,
31
- id,
32
32
  className,
33
33
  ...rest
34
34
  } = Astro.props
@@ -49,7 +49,6 @@ const classes = [
49
49
 
50
50
  <dialog
51
51
  class:list={classes}
52
- id={id}
53
52
  data-close={close.length ? close : undefined}
54
53
  {...rest}
55
54
  >
@@ -1,5 +1,7 @@
1
1
  <script lang="ts">
2
- import type { SvelteModalProps } from './modal'
2
+ import type { Snippet } from 'svelte'
3
+ import type { HTMLDialogAttributes } from 'svelte/elements'
4
+ import type { ModalProps } from './modal'
3
5
 
4
6
  import Button from '../Button/Button.svelte'
5
7
 
@@ -13,6 +15,10 @@
13
15
 
14
16
  import styles from './modal.module.scss'
15
17
 
18
+ export type Props = ModalProps<HTMLDialogAttributes> & {
19
+ children?: Snippet
20
+ }
21
+
16
22
  const {
17
23
  title,
18
24
  subTitle,
@@ -21,11 +27,10 @@
21
27
  closeOnOverlay = true,
22
28
  transparent,
23
29
  theme,
24
- id,
25
30
  className,
26
31
  children,
27
32
  ...rest
28
- }: SvelteModalProps = $props()
33
+ }: Props = $props()
29
34
 
30
35
  const iconMap = {
31
36
  info,
@@ -50,7 +55,6 @@
50
55
 
51
56
  <dialog
52
57
  class={classes}
53
- id={id}
54
58
  data-close={close.length ? close : undefined}
55
59
  {...rest}
56
60
  >
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import type { ReactModalProps } from './modal'
2
+ import type { ModalProps } from './modal'
3
3
 
4
4
  import Button from '../Button/Button.tsx'
5
5
 
@@ -13,6 +13,10 @@ import warning from '../../icons/warning.svg?raw'
13
13
 
14
14
  import styles from './modal.module.scss'
15
15
 
16
+ export type Props = ModalProps<React.DialogHTMLAttributes<HTMLDialogElement>> & {
17
+ children?: React.ReactNode
18
+ }
19
+
16
20
  const iconMap = {
17
21
  info,
18
22
  success,
@@ -28,11 +32,10 @@ const Modal = ({
28
32
  closeOnOverlay = true,
29
33
  transparent,
30
34
  theme,
31
- id,
32
35
  className,
33
36
  children,
34
37
  ...rest
35
- }: ReactModalProps) => {
38
+ }: Props) => {
36
39
  const classes = classNames([
37
40
  styles.modal,
38
41
  theme && styles[theme],
@@ -50,7 +53,6 @@ const Modal = ({
50
53
  <React.Fragment>
51
54
  <dialog
52
55
  className={classes}
53
- id={id}
54
56
  data-close={close.length ? close : undefined}
55
57
  {...rest}
56
58
  >
@@ -1,25 +1,13 @@
1
- import type { Snippet } from 'svelte'
2
-
3
- export type ModalProps = {
1
+ export type ModalProps<T extends object = object> = {
4
2
  title?: string
5
3
  subTitle?: string
6
4
  showCloseIcon?: boolean
7
5
  closeOnEsc?: boolean
8
6
  closeOnOverlay?: boolean
9
7
  transparent?: boolean
10
- id?: string
11
8
  className?: string
12
9
  theme?: 'info'
13
10
  | 'success'
14
11
  | 'warning'
15
12
  | 'alert'
16
- [key: string]: any
17
- }
18
-
19
- export type SvelteModalProps = {
20
- children: Snippet
21
- } & ModalProps
22
-
23
- export type ReactModalProps = {
24
- children?: React.ReactNode
25
- } & ModalProps
13
+ } & T