@yatoday/astro-ui 0.0.3 → 0.0.6

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 (106) hide show
  1. package/README.md +15 -0
  2. package/astro.d.ts +15 -0
  3. package/astro.js +10 -0
  4. package/components/Analytics/Analytics.svelte +7 -0
  5. package/components/BackToTopButton/BackToTopButton.astro +31 -28
  6. package/components/BackToTopButton/BackToTopButton.svelte +7 -0
  7. package/components/BackToTopButton/types.ts +2 -2
  8. package/components/Breadcrumbs/Breadcrumbs.astro +5 -6
  9. package/components/Breadcrumbs/Breadcrumbs.svelte +7 -0
  10. package/components/Breadcrumbs/types.ts +2 -2
  11. package/components/BreadcrumbsItem/BreadcrumbsItem.astro +5 -5
  12. package/components/BreadcrumbsItem/BreadcrumbsItem.svelte +7 -0
  13. package/components/BreadcrumbsItem/types.ts +1 -1
  14. package/components/Button/Button.astro +33 -4
  15. package/components/Button/Button.svelte +2 -29
  16. package/components/Button/button-variants.ts +30 -0
  17. package/components/Button/types.ts +9 -18
  18. package/components/CallToAction/CallToAction.astro +5 -6
  19. package/components/CallToAction/CallToAction.svelte +7 -0
  20. package/components/CallToAction/types.ts +5 -13
  21. package/components/Card0/Card0.astro +12 -8
  22. package/components/Card0/Card0.svelte +7 -0
  23. package/components/Card0/types.ts +4 -3
  24. package/components/Card1/Card1.astro +11 -9
  25. package/components/Card1/Card1.svelte +7 -0
  26. package/components/Card1/types.ts +7 -17
  27. package/components/Card2/Card2.astro +14 -11
  28. package/components/Card2/Card2.svelte +7 -0
  29. package/components/Card2/types.ts +3 -3
  30. package/components/Card3/Card3.astro +100 -0
  31. package/components/Card3/Card3.svelte +3 -0
  32. package/components/Card3/types.ts +11 -0
  33. package/components/DarkMode/DarkMode.astro +1 -1
  34. package/components/DarkMode/DarkMode.svelte +7 -0
  35. package/components/Footer/Footer.astro +103 -0
  36. package/components/Footer/Footer.svelte +3 -0
  37. package/components/Footer/types.ts +21 -0
  38. package/components/Headline/Headline.astro +25 -25
  39. package/components/Headline/Headline.svelte +7 -0
  40. package/components/Headline/types.ts +1 -1
  41. package/components/HeroSection/HeroSection.astro +9 -9
  42. package/components/HeroSection/HeroSection.svelte +7 -0
  43. package/components/HeroSection/types.ts +4 -4
  44. package/components/Image/Image.astro +22 -21
  45. package/components/Image/Image.svelte +7 -0
  46. package/components/ItemGrid0/ItemGrid0.astro +1 -1
  47. package/components/ItemGrid0/ItemGrid0.svelte +7 -0
  48. package/components/ItemGrid0/types.ts +2 -2
  49. package/components/Layout/Layout.astro +17 -19
  50. package/components/Layout/Layout.svelte +7 -0
  51. package/components/Layout/types.ts +1 -1
  52. package/components/Metadata/Metadata.svelte +7 -0
  53. package/components/Navbar/Navbar.astro +235 -0
  54. package/components/Navbar/Navbar.svelte +7 -0
  55. package/components/Navbar/ToggleMenu.astro +29 -0
  56. package/components/Navbar/types.ts +24 -0
  57. package/components/SiteVerification/SiteVerification.svelte +7 -0
  58. package/components/Stats0/Stats0.astro +32 -0
  59. package/components/Stats0/Stats0.svelte +3 -0
  60. package/components/Stats0/types.ts +6 -0
  61. package/components/SwiperSlider/SwiperSlider.astro +21 -21
  62. package/components/SwiperSlider/SwiperSlider.svelte +7 -0
  63. package/components/SwiperSlider/types.ts +1 -1
  64. package/components/WidgetCardSlider/WidgetCardSlider.astro +9 -8
  65. package/components/WidgetCardSlider/WidgetCardSlider.svelte +7 -0
  66. package/components/WidgetCardSlider/types.ts +8 -6
  67. package/components/WidgetFeatures0/WidgetFeatures0.astro +4 -4
  68. package/components/WidgetFeatures0/WidgetFeatures0.svelte +7 -0
  69. package/components/WidgetFeatures0/types.ts +4 -3
  70. package/components/WidgetFeaturesCard/WidgetFeaturesCard.astro +2 -2
  71. package/components/WidgetFeaturesCard/WidgetFeaturesCard.svelte +7 -0
  72. package/components/WidgetFeaturesCard/types.ts +1 -1
  73. package/components/WidgetHero0/WidgetHero0.astro +118 -0
  74. package/components/WidgetHero0/WidgetHero0.svelte +3 -0
  75. package/components/WidgetHero0/types.ts +14 -0
  76. package/components/WidgetHeroSlider/WidgetHeroSlider.astro +16 -16
  77. package/components/WidgetHeroSlider/WidgetHeroSlider.svelte +7 -0
  78. package/components/WidgetHeroSlider/types.ts +2 -2
  79. package/components/WidgetWrapper/WidgetWrapper.svelte +7 -0
  80. package/index.d.ts +40 -15
  81. package/package.json +21 -14
  82. package/svelte.d.ts +15 -0
  83. package/svelte.js +10 -0
  84. package/utils/DOMUtils.ts +78 -57
  85. package/utils/URLUtils.ts +1 -1
  86. package/utils/images.ts +1 -1
  87. package/vendor-config/utils/configBuilder.ts +1 -1
  88. package/components/Card0/card0.ts +0 -6
  89. package/components/NameValueList/NameValueList.astro +0 -7
  90. package/components/NameValueList/types.ts +0 -8
  91. package/components/SeoAnalytics/SeoAnalytics.astro +0 -15
  92. package/components/SeoAnalytics/types.ts +0 -3
  93. package/components/SeoAnalyticsGoogleProvider/SeoAnalyticsGoogleProvider.astro +0 -17
  94. package/components/SeoAnalyticsGoogleProvider/types.ts +0 -4
  95. package/components/SeoAstroSeo/SeoAstroSeo.astro +0 -40
  96. package/components/SeoAstroSeo/SeoAstroSeo.svelte +0 -3
  97. package/components/SeoAstroSeo/types.ts +0 -146
  98. package/components/SeoMetadata/SeoMetadata.astro +0 -8
  99. package/components/SeoMetadata/types.ts +0 -38
  100. package/components/SeoSiteVerification/SeoSiteVerification.astro +0 -6
  101. package/components/SeoSiteVerification/types.ts +0 -3
  102. package/components/WidgetHeroSlider/HeroSlide.astro +0 -117
  103. package/components/WidgetWrapper/WidgetWrapper.ts +0 -6
  104. package/utils/buildTags.ts +0 -380
  105. package/utils/css.ts +0 -39
  106. package/utils/permalinks.ts +0 -13
package/README.md CHANGED
@@ -1,2 +1,17 @@
1
1
  > [!IMPORTANT]
2
2
  > This library is still in early development. New changes can break existing functionality, and no functionality should be considered final at this stage. The library will be considered stable once it reaches v1.0.
3
+
4
+
5
+ ## Publish package to npm
6
+
7
+ The build is done using Github Actions. See `.github/workflows/publish.yml` for more information.
8
+
9
+ 1. Make a new release
10
+ ```shell
11
+ git tag -a {tag} -m 'tag message here'
12
+ ```
13
+
14
+ ```shell
15
+ git push origin {tag}
16
+ ```
17
+ 2. Go the project release page on Github, Draft a release and choose the tag you pushed before, write the release title, and publish it.
package/astro.d.ts CHANGED
@@ -8,19 +8,24 @@ import type { CallToActionProps as YtCallToActionProps } from './components/Call
8
8
  import type { Card0Props as YtCard0Props } from './components/Card0/types'
9
9
  import type { Card1Props as YtCard1Props } from './components/Card1/types'
10
10
  import type { Card2Props as YtCard2Props } from './components/Card2/types'
11
+ import type { Card3Props as YtCard3Props } from './components/Card3/types'
11
12
  import type { ConditionalWrapperProps as YtConditionalWrapperProps } from './components/ConditionalWrapper/types'
12
13
  import type { DarkModeProps as YtDarkModeProps } from './components/DarkMode/types'
14
+ import type { FooterProps as YtFooterProps } from './components/Footer/types'
13
15
  import type { HeadlineProps as YtHeadlineProps } from './components/Headline/types'
14
16
  import type { HeroSectionProps as YtHeroSectionProps } from './components/HeroSection/types'
15
17
  import type { ImageProps as YtImageProps } from './components/Image/types'
16
18
  import type { ItemGrid0Props as YtItemGrid0Props } from './components/ItemGrid0/types'
17
19
  import type { LayoutProps as YtLayoutProps } from './components/Layout/types'
18
20
  import type { MetadataProps as YtMetadataProps } from './components/Metadata/types'
21
+ import type { NavbarProps as YtNavbarProps } from './components/Navbar/types'
19
22
  import type { SiteVerificationProps as YtSiteVerificationProps } from './components/SiteVerification/types'
23
+ import type { Stats0Props as YtStats0Props } from './components/Stats0/types'
20
24
  import type { SwiperSliderProps as YtSwiperSliderProps } from './components/SwiperSlider/types'
21
25
  import type { WidgetCardSliderProps as YtWidgetCardSliderProps } from './components/WidgetCardSlider/types'
22
26
  import type { WidgetFeatures0Props as YtWidgetFeatures0Props } from './components/WidgetFeatures0/types'
23
27
  import type { WidgetFeaturesCardProps as YtWidgetFeaturesCardProps } from './components/WidgetFeaturesCard/types'
28
+ import type { WidgetHero0Props as YtWidgetHero0Props } from './components/WidgetHero0/types'
24
29
  import type { WidgetHeroSliderProps as YtWidgetHeroSliderProps } from './components/WidgetHeroSlider/types'
25
30
  import type { WidgetWrapperProps as YtWidgetWrapperProps } from './components/WidgetWrapper/types'
26
31
 
@@ -35,19 +40,24 @@ declare module '@yatoday/astro-ui/astro' {
35
40
  export function Card0(_props: YtCard0Props): any
36
41
  export function Card1(_props: YtCard1Props): any
37
42
  export function Card2(_props: YtCard2Props): any
43
+ export function Card3(_props: YtCard3Props): any
38
44
  export function ConditionalWrapper(_props: YtConditionalWrapperProps): any
39
45
  export function DarkMode(_props: YtDarkModeProps): any
46
+ export function Footer(_props: YtFooterProps): any
40
47
  export function Headline(_props: YtHeadlineProps): any
41
48
  export function HeroSection(_props: YtHeroSectionProps): any
42
49
  export function Image(_props: YtImageProps): any
43
50
  export function ItemGrid0(_props: YtItemGrid0Props): any
44
51
  export function Layout(_props: YtLayoutProps): any
45
52
  export function Metadata(_props: YtMetadataProps): any
53
+ export function Navbar(_props: YtNavbarProps): any
46
54
  export function SiteVerification(_props: YtSiteVerificationProps): any
55
+ export function Stats0(_props: YtStats0Props): any
47
56
  export function SwiperSlider(_props: YtSwiperSliderProps): any
48
57
  export function WidgetCardSlider(_props: YtWidgetCardSliderProps): any
49
58
  export function WidgetFeatures0(_props: YtWidgetFeatures0Props): any
50
59
  export function WidgetFeaturesCard(_props: YtWidgetFeaturesCardProps): any
60
+ export function WidgetHero0(_props: YtWidgetHero0Props): any
51
61
  export function WidgetHeroSlider(_props: YtWidgetHeroSliderProps): any
52
62
  export function WidgetWrapper(_props: YtWidgetWrapperProps): any
53
63
 
@@ -61,19 +71,24 @@ declare module '@yatoday/astro-ui/astro' {
61
71
  export type Card0Props = YtCard0Props
62
72
  export type Card1Props = YtCard1Props
63
73
  export type Card2Props = YtCard2Props
74
+ export type Card3Props = YtCard3Props
64
75
  export type ConditionalWrapperProps = YtConditionalWrapperProps
65
76
  export type DarkModeProps = YtDarkModeProps
77
+ export type FooterProps = YtFooterProps
66
78
  export type HeadlineProps = YtHeadlineProps
67
79
  export type HeroSectionProps = YtHeroSectionProps
68
80
  export type ImageProps = YtImageProps
69
81
  export type ItemGrid0Props = YtItemGrid0Props
70
82
  export type LayoutProps = YtLayoutProps
71
83
  export type MetadataProps = YtMetadataProps
84
+ export type NavbarProps = YtNavbarProps
72
85
  export type SiteVerificationProps = YtSiteVerificationProps
86
+ export type Stats0Props = YtStats0Props
73
87
  export type SwiperSliderProps = YtSwiperSliderProps
74
88
  export type WidgetCardSliderProps = YtWidgetCardSliderProps
75
89
  export type WidgetFeatures0Props = YtWidgetFeatures0Props
76
90
  export type WidgetFeaturesCardProps = YtWidgetFeaturesCardProps
91
+ export type WidgetHero0Props = YtWidgetHero0Props
77
92
  export type WidgetHeroSliderProps = YtWidgetHeroSliderProps
78
93
  export type WidgetWrapperProps = YtWidgetWrapperProps
79
94
  }
package/astro.js CHANGED
@@ -8,19 +8,24 @@ import CallToActionComponent from './components/CallToAction/CallToAction.astro'
8
8
  import Card0Component from './components/Card0/Card0.astro'
9
9
  import Card1Component from './components/Card1/Card1.astro'
10
10
  import Card2Component from './components/Card2/Card2.astro'
11
+ import Card3Component from './components/Card3/Card3.astro'
11
12
  import ConditionalWrapperComponent from './components/ConditionalWrapper/ConditionalWrapper.astro'
12
13
  import DarkModeComponent from './components/DarkMode/DarkMode.astro'
14
+ import FooterComponent from './components/Footer/Footer.astro'
13
15
  import HeadlineComponent from './components/Headline/Headline.astro'
14
16
  import HeroSectionComponent from './components/HeroSection/HeroSection.astro'
15
17
  import ImageComponent from './components/Image/Image.astro'
16
18
  import ItemGrid0Component from './components/ItemGrid0/ItemGrid0.astro'
17
19
  import LayoutComponent from './components/Layout/Layout.astro'
18
20
  import MetadataComponent from './components/Metadata/Metadata.astro'
21
+ import NavbarComponent from './components/Navbar/Navbar.astro'
19
22
  import SiteVerificationComponent from './components/SiteVerification/SiteVerification.astro'
23
+ import Stats0Component from './components/Stats0/Stats0.astro'
20
24
  import SwiperSliderComponent from './components/SwiperSlider/SwiperSlider.astro'
21
25
  import WidgetCardSliderComponent from './components/WidgetCardSlider/WidgetCardSlider.astro'
22
26
  import WidgetFeatures0Component from './components/WidgetFeatures0/WidgetFeatures0.astro'
23
27
  import WidgetFeaturesCardComponent from './components/WidgetFeaturesCard/WidgetFeaturesCard.astro'
28
+ import WidgetHero0Component from './components/WidgetHero0/WidgetHero0.astro'
24
29
  import WidgetHeroSliderComponent from './components/WidgetHeroSlider/WidgetHeroSlider.astro'
25
30
  import WidgetWrapperComponent from './components/WidgetWrapper/WidgetWrapper.astro'
26
31
 
@@ -34,18 +39,23 @@ export const CallToAction = CallToActionComponent
34
39
  export const Card0 = Card0Component
35
40
  export const Card1 = Card1Component
36
41
  export const Card2 = Card2Component
42
+ export const Card3 = Card3Component
37
43
  export const ConditionalWrapper = ConditionalWrapperComponent
38
44
  export const DarkMode = DarkModeComponent
45
+ export const Footer = FooterComponent
39
46
  export const Headline = HeadlineComponent
40
47
  export const HeroSection = HeroSectionComponent
41
48
  export const Image = ImageComponent
42
49
  export const ItemGrid0 = ItemGrid0Component
43
50
  export const Layout = LayoutComponent
44
51
  export const Metadata = MetadataComponent
52
+ export const Navbar = NavbarComponent
45
53
  export const SiteVerification = SiteVerificationComponent
54
+ export const Stats0 = Stats0Component
46
55
  export const SwiperSlider = SwiperSliderComponent
47
56
  export const WidgetCardSlider = WidgetCardSliderComponent
48
57
  export const WidgetFeatures0 = WidgetFeatures0Component
49
58
  export const WidgetFeaturesCard = WidgetFeaturesCardComponent
59
+ export const WidgetHero0 = WidgetHero0Component
50
60
  export const WidgetHeroSlider = WidgetHeroSliderComponent
51
61
  export const WidgetWrapper = WidgetWrapperComponent
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+
3
+ </script>
4
+
5
+ <div>
6
+ TODO
7
+ </div>
@@ -1,5 +1,8 @@
1
1
  ---
2
2
  import { Icon } from 'astro-icon/components';
3
+ import type { BackToTopButtonProps as Props } from './types';
4
+
5
+ const { selector = '#header' } = Astro.props;
3
6
  ---
4
7
 
5
8
  <style>
@@ -53,65 +56,65 @@ import { Icon } from 'astro-icon/components';
53
56
  </style>
54
57
 
55
58
  <!-- Back to top button-->
56
- <a class="btn-scroll-top text-card-foreground" href="#top" data-scroll>
59
+ <a class="btn-scroll-top text-card-foreground" href={selector} data-scroll>
57
60
  <svg viewBox="0 0 40 40" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
58
61
  <circle cx="20" cy="20" r="19" fill="none" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10"></circle>
59
62
  </svg>
60
63
  <span class="flex items-center justify-center">
61
- <Icon name="tabler:arrow-up" />
62
- </span>
64
+ <Icon name="tabler:arrow-up" />
65
+ </span>
63
66
  </a>
64
67
 
65
68
  <script>
66
69
  /**
67
70
  * Animate scroll to top button in/off view
68
71
  */
69
- const scrollTopButton = function() {
70
- const button = document.querySelector('.btn-scroll-top')
71
- const scrollOffset = '450'
72
+ const scrollTopButton = function () {
73
+ const button = document.querySelector('.btn-scroll-top');
74
+ const scrollOffset = '450';
72
75
 
73
76
  if (button == null) {
74
- return
77
+ return;
75
78
  }
76
79
 
77
- const offsetFromTop = parseInt(scrollOffset, 10)
78
- const progress = button.querySelector('svg circle') as SVGCircleElement
80
+ const offsetFromTop = parseInt(scrollOffset, 10);
81
+ const progress = button.querySelector('svg circle') as SVGCircleElement;
79
82
 
80
83
  if (progress == null) {
81
- return
84
+ return;
82
85
  }
83
86
 
84
- let length = 0
87
+ let length = 0;
85
88
  if (document.documentElement.clientWidth > 100) {
86
- length = progress?.getTotalLength() || 0
89
+ length = progress?.getTotalLength() || 0;
87
90
  }
88
91
 
89
- progress.style.strokeDasharray = `${length}`
90
- progress.style.strokeDashoffset = `${length}`
92
+ progress.style.strokeDasharray = `${length}`;
93
+ progress.style.strokeDashoffset = `${length}`;
91
94
 
92
95
  const showProgress = function showProgress() {
93
96
  const scrollPercent =
94
- (document.body.scrollTop + document.documentElement.scrollTop)
95
- / (document.documentElement.scrollHeight - document.documentElement.clientHeight)
96
- const draw = length * scrollPercent
97
- progress.style.strokeDashoffset = String(length - draw)
98
- }
97
+ (document.body.scrollTop + document.documentElement.scrollTop) /
98
+ (document.documentElement.scrollHeight - document.documentElement.clientHeight);
99
+ const draw = length * scrollPercent;
100
+ progress.style.strokeDashoffset = String(length - draw);
101
+ };
99
102
 
100
- window.addEventListener('scroll', function() {
103
+ window.addEventListener('scroll', function () {
101
104
  // if (event?.currentTarget?.pageYOffset > offsetFromTop) {
102
105
  if (window.scrollY > offsetFromTop) {
103
- button.classList.add('show')
106
+ button.classList.add('show');
104
107
  } else {
105
- button.classList.remove('show')
108
+ button.classList.remove('show');
106
109
  }
107
110
 
108
- showProgress()
109
- })
110
- }
111
+ showProgress();
112
+ });
113
+ };
111
114
 
112
- scrollTopButton()
115
+ scrollTopButton();
113
116
 
114
117
  document.addEventListener('astro:after-swap', () => {
115
- scrollTopButton()
116
- })
118
+ scrollTopButton();
119
+ });
117
120
  </script>
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+
3
+ </script>
4
+
5
+ <div>
6
+ TODO
7
+ </div>
@@ -1,3 +1,3 @@
1
1
  export type BackToTopButtonProps = {
2
-
3
- }
2
+ selector?: string;
3
+ };
@@ -1,15 +1,14 @@
1
1
  ---
2
- import type {BreadcrumbsProps as Props} from './types';
2
+ import type { BreadcrumbsProps as Props } from './types';
3
3
 
4
+ import { Icon } from 'astro-icon/components';
4
5
 
5
- import {Icon} from 'astro-icon/components';
6
-
7
- const {class: classNames = 'text-gray-600 dark:text-gray-400', ariaLabel = 'Breadcrumbs', items = []} = Astro.props;
6
+ const { class: classNames = 'text-gray-600 dark:text-gray-400', ariaLabel = 'Breadcrumbs', items = [] } = Astro.props;
8
7
  ---
8
+
9
9
  <nav class:list={['breadcrumbs', classNames]} aria-label={ariaLabel}>
10
10
  <ol class="list flex flex-wrap gap-2 m-0 p-0 list-none" itemscope itemtype="https://schema.org/BreadcrumbList">
11
- {items.length === 0 &&
12
- <slot/>}
11
+ {items.length === 0 && <slot />}
13
12
 
14
13
  <!--{
15
14
  items.length > 0 &&
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+
3
+ </script>
4
+
5
+ <div>
6
+ TODO
7
+ </div>
@@ -1,8 +1,8 @@
1
- import type {BreadcrumbsItemProps} from '../BreadcrumbsItem/types';
1
+ import type { BreadcrumbsItemProps } from '../BreadcrumbsItem/types';
2
2
 
3
3
  export type BreadcrumbsProps = {
4
4
  class?: string;
5
5
  children: BreadcrumbsItemProps | BreadcrumbsItemProps[];
6
6
  items: BreadcrumbsItemProps[];
7
7
  ariaLabel?: string;
8
- }
8
+ };
@@ -1,7 +1,7 @@
1
1
  ---
2
- import type {BreadcrumbsItemProps as Props} from './types';
2
+ import type { BreadcrumbsItemProps as Props } from './types';
3
3
 
4
- const {href = '#', label = 'Breadcrumb', currentPage = false, hasIcon = false, class: classNames} = Astro.props;
4
+ const { href = '#', label = 'Breadcrumb', currentPage = false, hasIcon = false, class: classNames } = Astro.props;
5
5
  ---
6
6
 
7
7
  <li class:list={['item', classNames]} itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
@@ -10,18 +10,18 @@ const {href = '#', label = 'Breadcrumb', currentPage = false, hasIcon = false, c
10
10
  <span aria-current="page" class:list={[hasIcon ? 'has-icon' : '']}>
11
11
  {hasIcon ? (
12
12
  <Fragment>
13
- <slot name="icon"/>
13
+ <slot name="icon" />
14
14
  <span class="sr-only">{label}</span>
15
15
  </Fragment>
16
16
  ) : (
17
17
  label
18
18
  )}
19
- </span>
19
+ </span>
20
20
  ) : (
21
21
  <a href={href} class:list={[hasIcon ? 'has-icon' : '']}>
22
22
  {hasIcon ? (
23
23
  <Fragment>
24
- <slot name="icon"/>
24
+ <slot name="icon" />
25
25
  <span class="sr-only">{label}</span>
26
26
  </Fragment>
27
27
  ) : (
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+
3
+ </script>
4
+
5
+ <div>
6
+ TODO
7
+ </div>
@@ -4,4 +4,4 @@ export type BreadcrumbsItemProps = {
4
4
  currentPage?: boolean;
5
5
  hasIcon?: boolean;
6
6
  class?: string;
7
- }
7
+ };
@@ -1,7 +1,36 @@
1
1
  ---
2
- import type {ButtonProps as Props} from './types';
3
- ---
2
+ import type { ButtonProps as Props } from './types';
3
+
4
+ import { Icon } from 'astro-icon/components';
5
+ import { buttonVariants } from './button-variants';
6
+ import { cn } from '../../utils';
4
7
 
5
- <div>
8
+ const {
9
+ variant = 'default',
10
+ size = 'default',
11
+ target,
12
+ text = Astro.slots.render('default'),
13
+ icon = '',
14
+ class: className = '',
15
+ type = 'button',
16
+ ...rest
17
+ } = Astro.props;
18
+ ---
6
19
 
7
- </div>
20
+ {
21
+ rest?.href ? (
22
+ <a
23
+ class={cn(buttonVariants({ size, variant }), className)}
24
+ {...(target ? { target: target, rel: 'noopener noreferrer' } : {})}
25
+ {...rest}
26
+ >
27
+ <Fragment set:html={text} />
28
+ {icon && <Icon name={icon} class="w-5 h-5 ml-1 -mr-1.5 rtl:mr-1 rtl:-ml-1.5 inline-block" />}
29
+ </a>
30
+ ) : (
31
+ <button type={type} class={cn(buttonVariants({ size, variant }), className)} {...rest}>
32
+ <Fragment set:html={text} />
33
+ {icon && <Icon name={icon} class="w-5 h-5 ml-1 -mr-1.5 rtl:mr-1 rtl:-ml-1.5 inline-block" />}
34
+ </button>
35
+ )
36
+ }
@@ -2,35 +2,7 @@
2
2
  import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements'
3
3
 
4
4
  import type { WithElementRef } from 'bits-ui';
5
- import { tv, type VariantProps } from 'tailwind-variants';
6
-
7
- export const buttonVariants = tv({
8
- base: 'btn rounded-btn ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-base font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer',
9
- variants: {
10
- variant: {
11
- default: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
12
- primary: 'bg-primary text-primary-foreground hover:bg-primary/90',
13
- accent: 'bg-accent text-accent-foreground hover:bg-accent/80',
14
- destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
15
- outline: 'border border-input bg-transparent text-primary hover:bg-primary/10',
16
- ghost: 'text-gray-700 dark:text-zinc-300 hover:text-black dark:hover:text-white hover:bg-gray-100 dark:hover:bg-zinc-800',
17
- link: '!px-0 underline-offset-4 underline'
18
- },
19
- size: {
20
- default: 'px-6 sm:px-8 h-10 sm:h-12',
21
- sm: 'h-8 px-4 text-xs sm:h-10 sm:px-6 sm:text-sm',
22
- lg: 'h-14 px-8 text-base sm:text-lg md:text-xl',
23
- icon: 'size-10'
24
- }
25
- },
26
- defaultVariants: {
27
- variant: 'default',
28
- size: 'default'
29
- }
30
- })
31
-
32
- export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
33
- export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
5
+ import type {ButtonSize, ButtonVariant} from "./button-variants.ts";
34
6
 
35
7
  export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
36
8
  WithElementRef<HTMLAnchorAttributes> & {
@@ -42,6 +14,7 @@
42
14
 
43
15
  <script lang="ts">
44
16
  import { cn } from '../../utils';
17
+ import {buttonVariants} from "./button-variants.ts";
45
18
 
46
19
  let {
47
20
  class: className = '',
@@ -0,0 +1,30 @@
1
+ import { tv, type VariantProps } from 'tailwind-variants';
2
+
3
+ export const buttonVariants = tv({
4
+ base: 'btn ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-base font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer',
5
+ variants: {
6
+ variant: {
7
+ default: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
8
+ primary: 'bg-primary text-primary-foreground hover:bg-primary/90',
9
+ accent: 'bg-accent text-accent-foreground hover:bg-accent/80',
10
+ destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
11
+ outline: 'border border-input bg-transparent text-primary hover:bg-primary/10',
12
+ ghost:
13
+ 'text-gray-700 dark:text-zinc-300 hover:text-black dark:hover:text-white hover:bg-gray-100 dark:hover:bg-zinc-800',
14
+ link: '!px-0 underline-offset-4 underline',
15
+ },
16
+ size: {
17
+ default: 'px-6 sm:px-8 h-10 sm:h-12 rounded-(--radius-btn)',
18
+ sm: 'h-8 px-4 text-xs sm:h-10 sm:px-6 sm:text-sm rounded-[calc(var(--radius-btn)-2px)]',
19
+ lg: 'h-14 px-8 text-base sm:text-lg md:text-xl rounded-[calc(var(--radius-btn)+2px)]',
20
+ icon: 'size-10',
21
+ },
22
+ },
23
+ defaultVariants: {
24
+ variant: 'default',
25
+ size: 'default',
26
+ },
27
+ });
28
+
29
+ export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
30
+ export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
@@ -1,20 +1,11 @@
1
- import type { WithElementRef } from 'bits-ui'
2
- import type { Snippet } from 'svelte'
3
- import type {HTMLAnchorAttributes, HTMLButtonAttributes, MouseEventHandler } from 'svelte/elements'
1
+ import type { WithElementRef } from 'bits-ui';
2
+ import type { Snippet } from 'svelte';
3
+ import type { HTMLAnchorAttributes, HTMLButtonAttributes, MouseEventHandler } from 'svelte/elements';
4
4
 
5
5
  export type ButtonProps = {
6
- variant?: 'default'
7
- | 'primary'
8
- | 'accent'
9
- | 'destructive'
10
- | 'outline'
11
- | 'ghost'
12
- | 'link'
13
- size?: 'default'
14
- | 'sm'
15
- | 'lg'
16
- | 'icon'
17
- text?: string
18
- class?: string
19
- [key: string]: any
20
- }
6
+ variant?: 'default' | 'primary' | 'accent' | 'destructive' | 'outline' | 'ghost' | 'link';
7
+ size?: 'default' | 'sm' | 'lg' | 'icon';
8
+ text?: string;
9
+ class?: string;
10
+ [key: string]: any;
11
+ };
@@ -1,9 +1,8 @@
1
1
  ---
2
2
  import type { CallToActionProps as Props } from './types';
3
- import WidgetWrapper from '../WidgetWrapper/WidgetWrapper.astro'
4
- import Headline from "../Headline/Headline.astro";
5
- import Button from '../Button/Button.svelte';
6
-
3
+ import WidgetWrapper from '../WidgetWrapper/WidgetWrapper.astro';
4
+ import Headline from '../Headline/Headline.astro';
5
+ import Button from '../Button/Button.astro';
7
6
 
8
7
  const {
9
8
  title = await Astro.slots.render('title'),
@@ -14,7 +13,7 @@ const {
14
13
  id,
15
14
  isDark = false,
16
15
  classes = {},
17
- bg = await Astro.slots.render('bg')
16
+ bg = await Astro.slots.render('bg'),
18
17
  } = Astro.props;
19
18
  ---
20
19
 
@@ -27,7 +26,7 @@ const {
27
26
  classes={{
28
27
  container: 'mb-0 md:mb-0 text-left',
29
28
  title: 'text-4xl md:text-4xl font-bold tracking-tighter mb-4 font-heading',
30
- subtitle: 'text-xl'
29
+ subtitle: 'text-xl',
31
30
  }}
32
31
  />
33
32
  {
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+
3
+ </script>
4
+
5
+ <div>
6
+ TODO
7
+ </div>
@@ -1,18 +1,10 @@
1
- import type {HTMLAttributes} from "astro/types";
2
- import type {WidgetWrapperProps} from "../WidgetWrapper/types";
1
+ import type { WidgetWrapperProps } from '../WidgetWrapper/types';
2
+ import type { ToAction } from '../../types';
3
3
 
4
4
  export type CallToActionProps = {
5
5
  title?: string;
6
6
  subtitle?: string;
7
7
  tagline?: string;
8
- callToAction?: ICallToAction;
9
- actions?: string | ICallToAction[];
10
- } & WidgetWrapperProps
11
-
12
- export interface ICallToAction extends Omit<HTMLAttributes<'a'>, 'slot'> {
13
- variant?: 'primary' | 'secondary' | 'tertiary' | 'link' | 'icon';
14
- text?: string;
15
- icon?: string;
16
- classes?: Record<string, string>;
17
- type?: 'button' | 'submit' | 'reset';
18
- }
8
+ callToAction?: ToAction;
9
+ actions?: string | ToAction[];
10
+ } & WidgetWrapperProps;
@@ -1,12 +1,12 @@
1
1
  ---
2
- import type {Card0Props as Props} from './types';
3
- import {twMerge} from 'tailwind-merge';
2
+ import type { Card0Props as Props } from './types';
3
+ import { twMerge } from 'tailwind-merge';
4
4
 
5
- const {as = 'article', classes = {}} = Astro.props;
5
+ const { badge, as = 'article', classes = {} } = Astro.props;
6
6
 
7
7
  const WrapperTag = as;
8
8
 
9
- const {container: containerClass = '', badge: badgeClass = ''} = classes;
9
+ const { container: containerClass = '', badge: badgeClass = 'top-2 left-2' } = classes;
10
10
  ---
11
11
 
12
12
  <WrapperTag
@@ -15,9 +15,13 @@ const {container: containerClass = '', badge: badgeClass = ''} = classes;
15
15
  containerClass
16
16
  )}
17
17
  >
18
- <div class={twMerge('absolute', badgeClass)}>
19
- <slot name="badge"/>
18
+ <div class={twMerge('absolute z-10', badgeClass)}>
19
+ <slot name="badge">
20
+ {badge && <Fragment set:html={badge} />}
21
+ </slot>
20
22
  </div>
21
- <slot name="image"/>
22
- <slot/>
23
+
24
+ <slot name="image" />
25
+
26
+ <slot />
23
27
  </WrapperTag>
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+
3
+ </script>
4
+
5
+ <div>
6
+ TODO
7
+ </div>
@@ -1,9 +1,10 @@
1
- import type {HTMLTag} from 'astro/types';
2
- import type {ImageProps} from "../../utils/images-optimization.ts";
1
+ import type { HTMLTag } from 'astro/types';
2
+ import type { ImageProps } from '../../utils/images-optimization.ts';
3
3
 
4
4
  export type Card0Props = {
5
5
  image?: ImageProps | string;
6
6
  content?: string;
7
- as?: HTMLTag;
7
+ ['as']?: HTMLTag;
8
+ badge?: string;
8
9
  classes?: Record<string, string>;
9
10
  };