webcoreui 0.0.11 → 0.1.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 (141) hide show
  1. package/README.md +42 -11
  2. package/astro.d.ts +4 -0
  3. package/astro.js +4 -0
  4. package/components/Accordion/Accordion.astro +10 -8
  5. package/components/Accordion/Accordion.svelte +8 -8
  6. package/components/Accordion/Accordion.tsx +7 -6
  7. package/components/Accordion/accordion.module.scss +65 -0
  8. package/components/Alert/Alert.astro +11 -7
  9. package/components/Alert/Alert.svelte +9 -7
  10. package/components/Alert/Alert.tsx +11 -7
  11. package/components/Alert/alert.module.scss +51 -0
  12. package/components/Alert/alert.ts +3 -1
  13. package/components/Avatar/Avatar.astro +4 -4
  14. package/components/Avatar/Avatar.svelte +13 -7
  15. package/components/Avatar/Avatar.tsx +11 -9
  16. package/components/Avatar/{avatar.scss → avatar.module.scss} +11 -8
  17. package/components/Badge/Badge.astro +8 -8
  18. package/components/Badge/Badge.svelte +25 -13
  19. package/components/Badge/Badge.tsx +26 -8
  20. package/components/Badge/badge.module.scss +86 -0
  21. package/components/Badge/badge.ts +8 -1
  22. package/components/Button/Button.astro +9 -7
  23. package/components/Button/Button.svelte +13 -11
  24. package/components/Button/Button.tsx +10 -8
  25. package/components/Button/button.module.scss +87 -0
  26. package/components/Button/button.ts +6 -2
  27. package/components/Card/Card.astro +7 -15
  28. package/components/Card/Card.svelte +16 -13
  29. package/components/Card/Card.tsx +15 -11
  30. package/components/Card/card.module.scss +38 -0
  31. package/components/Checkbox/Checkbox.astro +10 -10
  32. package/components/Checkbox/Checkbox.svelte +19 -18
  33. package/components/Checkbox/Checkbox.tsx +12 -11
  34. package/components/Checkbox/checkbox.module.scss +70 -0
  35. package/components/Checkbox/checkbox.ts +5 -1
  36. package/components/ConditionalWrapper/ConditionalWrapper.svelte +1 -1
  37. package/components/Icon/Icon.astro +2 -2
  38. package/components/Icon/Icon.svelte +1 -8
  39. package/components/Icon/Icon.tsx +1 -8
  40. package/components/Icon/map.ts +23 -0
  41. package/components/Input/Input.astro +50 -52
  42. package/components/Input/Input.svelte +52 -52
  43. package/components/Input/Input.tsx +59 -59
  44. package/components/Input/input.module.scss +79 -0
  45. package/components/Input/input.ts +8 -2
  46. package/components/Menu/Menu.astro +107 -0
  47. package/components/Menu/Menu.svelte +88 -0
  48. package/components/Menu/Menu.tsx +107 -0
  49. package/components/Menu/menu.module.scss +141 -0
  50. package/components/Menu/menu.ts +21 -0
  51. package/components/Progress/Progress.astro +42 -40
  52. package/components/Progress/Progress.svelte +40 -38
  53. package/components/Progress/Progress.tsx +48 -47
  54. package/components/Progress/progress.module.scss +70 -0
  55. package/components/Radio/Radio.astro +57 -57
  56. package/components/Radio/Radio.svelte +58 -56
  57. package/components/Radio/Radio.tsx +69 -68
  58. package/components/Radio/radio.module.scss +84 -0
  59. package/components/Radio/radio.ts +4 -0
  60. package/components/Rating/Rating.astro +13 -10
  61. package/components/Rating/Rating.svelte +15 -15
  62. package/components/Rating/Rating.tsx +22 -11
  63. package/components/Rating/rating.module.scss +45 -0
  64. package/components/Rating/rating.ts +1 -1
  65. package/components/Spinner/Spinner.astro +44 -42
  66. package/components/Spinner/Spinner.svelte +40 -38
  67. package/components/Spinner/Spinner.tsx +45 -44
  68. package/components/Spinner/{spinner.scss → spinner.module.scss} +50 -41
  69. package/components/Switch/Switch.astro +13 -11
  70. package/components/Switch/Switch.svelte +26 -24
  71. package/components/Switch/Switch.tsx +14 -12
  72. package/components/Switch/switch.module.scss +82 -0
  73. package/components/Switch/switch.ts +8 -4
  74. package/components/Table/Table.astro +60 -60
  75. package/components/Table/Table.svelte +56 -54
  76. package/components/Table/Table.tsx +64 -63
  77. package/components/Table/{table.scss → table.module.scss} +60 -65
  78. package/components/Tabs/Tabs.astro +76 -76
  79. package/components/Tabs/Tabs.svelte +56 -54
  80. package/components/Tabs/Tabs.tsx +70 -69
  81. package/components/Tabs/tabs.module.scss +125 -0
  82. package/components/ThemeSwitcher/ThemeSwitcher.astro +106 -0
  83. package/components/ThemeSwitcher/ThemeSwitcher.svelte +76 -0
  84. package/components/ThemeSwitcher/ThemeSwitcher.tsx +89 -0
  85. package/components/ThemeSwitcher/themeswitcher.module.scss +76 -0
  86. package/components/ThemeSwitcher/themeswitcher.ts +13 -0
  87. package/components/Timeline/Timeline.astro +36 -34
  88. package/components/Timeline/Timeline.svelte +32 -30
  89. package/components/Timeline/Timeline.tsx +38 -37
  90. package/components/Timeline/{timeline.scss → timeline.module.scss} +76 -71
  91. package/components/TimelineItem/TimelineItem.astro +27 -26
  92. package/components/TimelineItem/TimelineItem.svelte +24 -22
  93. package/components/TimelineItem/TimelineItem.tsx +33 -32
  94. package/components/TimelineItem/timelineitem.module.scss +29 -0
  95. package/components/Toast/Toast.astro +41 -30
  96. package/components/Toast/Toast.svelte +32 -21
  97. package/components/Toast/Toast.tsx +38 -28
  98. package/components/Toast/toast.module.scss +40 -0
  99. package/components/Toast/toast.ts +8 -6
  100. package/icons/moon.svg +3 -0
  101. package/icons/sun.svg +3 -0
  102. package/icons.d.ts +11 -0
  103. package/icons.js +9 -0
  104. package/index.js +3 -0
  105. package/package.json +5 -1
  106. package/react.d.ts +4 -0
  107. package/react.js +4 -0
  108. package/scss/config/color-palette.scss +23 -0
  109. package/scss/config/css-values.scss +44 -0
  110. package/scss/config/layout.scss +41 -0
  111. package/scss/config/mixins.scss +395 -9
  112. package/scss/config/typography.scss +66 -0
  113. package/scss/config.scss +6 -1
  114. package/scss/global/elements.scss +22 -2
  115. package/scss/global/scrollbar.scss +24 -0
  116. package/scss/global/theme.scss +140 -0
  117. package/scss/global/tooltip.scss +47 -39
  118. package/scss/global/utility.scss +33 -4
  119. package/scss/global.scss +2 -1
  120. package/scss/resets.scss +64 -11
  121. package/scss/setup.scss +25 -31
  122. package/svelte.d.ts +16 -12
  123. package/svelte.js +4 -0
  124. package/utils/classNames.ts +4 -0
  125. package/utils/cookies.ts +28 -0
  126. package/utils/event.ts +17 -0
  127. package/utils/toast.ts +15 -11
  128. package/components/Accordion/accordion.scss +0 -63
  129. package/components/Alert/alert.scss +0 -53
  130. package/components/Badge/badge.scss +0 -85
  131. package/components/Button/button.scss +0 -91
  132. package/components/Card/card.scss +0 -37
  133. package/components/Checkbox/checkbox.scss +0 -85
  134. package/components/Input/input.scss +0 -83
  135. package/components/Progress/progress.scss +0 -66
  136. package/components/Radio/radio.scss +0 -92
  137. package/components/Rating/rating.scss +0 -37
  138. package/components/Switch/switch.scss +0 -84
  139. package/components/Tabs/tabs.scss +0 -134
  140. package/components/TimelineItem/timelineitem.scss +0 -31
  141. package/components/Toast/toast.scss +0 -43
@@ -1,22 +1,25 @@
1
- @import '../../scss/config.scss';
1
+ @use '../../scss/config.scss' as *;
2
2
 
3
- .w-avatar {
4
- border-radius: 100%;
3
+ body {
4
+ --w-avatar-border: var(--w-color-primary-70);
5
+ }
6
+
7
+ .avatar {
8
+ @include border-radius(max);
5
9
 
6
10
  &:not(.borderless) {
7
11
  border: 3px solid var(--w-avatar-border);
8
12
  }
9
13
  }
10
14
 
11
- .w-avatar-group {
12
- display: inline-flex;
13
- align-items: center;
15
+ .group {
16
+ @include layout(inline-flex, v-center);
14
17
 
15
18
  &.reverse {
16
- flex-direction: row-reverse;
19
+ @include layout(row-reverse);
17
20
 
18
21
  img {
19
- z-index: 1;
22
+ @include layer(fg);
20
23
  }
21
24
 
22
25
  img:not(:first-child) {
@@ -1,21 +1,21 @@
1
1
  ---
2
2
  import type { BadgeProps } from './badge'
3
- import './badge.scss'
3
+ import styles from './badge.module.scss'
4
4
 
5
- interface Props extends BadgeProps {
6
- interactive?: boolean
7
- }
5
+ interface Props extends BadgeProps {}
8
6
 
9
7
  const {
10
8
  theme,
11
- interactive,
9
+ hover,
10
+ className,
12
11
  ...rest
13
12
  } = Astro.props
14
13
 
15
14
  const classes = [
16
- 'w-badge',
17
- theme || null,
18
- interactive && 'hover'
15
+ styles.badge,
16
+ theme && styles[theme],
17
+ hover && styles.hover,
18
+ className
19
19
  ]
20
20
  ---
21
21
 
@@ -1,17 +1,29 @@
1
1
  <script lang="ts">
2
- import type { BadgeProps } from './badge'
3
- import './badge.scss'
4
-
5
- export let theme: BadgeProps['theme'] = null
6
- export let onClick: BadgeProps['onClick'] = () => {}
2
+ import type { SvelteBadgeProps } from './badge'
3
+
4
+ import styles from './badge.module.scss'
5
+ import { classNames } from '../../utils/classNames'
7
6
 
8
- const classes = [
9
- 'w-badge',
10
- theme || null,
11
- onClick && 'hover'
12
- ].filter(Boolean).join(' ')
7
+ export let theme: SvelteBadgeProps['theme'] = null
8
+ export let onClick: SvelteBadgeProps['onClick'] = null
9
+ export let hover: SvelteBadgeProps['hover'] = false
10
+ export let className: SvelteBadgeProps['className'] = ''
11
+
12
+ const classes = classNames([
13
+ styles.badge,
14
+ theme && styles[theme],
15
+ (onClick || hover) && styles.hover,
16
+ className
17
+ ])
13
18
  </script>
14
19
 
15
- <span class={classes} on:click={onClick} {...$$restProps}>
16
- <slot />
17
- </span>
20
+ {#if onClick}
21
+ <button class={classes} on:click={onClick} {...$$restProps}>
22
+ <slot />
23
+ </button>
24
+ {:else}
25
+ <span class={classes} {...$$restProps}>
26
+ <slot />
27
+ </span>
28
+ {/if}
29
+
@@ -1,16 +1,34 @@
1
1
  import React from 'react'
2
2
  import type { ReactBadgeProps } from './badge'
3
- import './badge.scss'
4
3
 
5
- const Badge = ({ theme, onClick, children, ...rest }: ReactBadgeProps) => {
6
- const classes = [
7
- 'w-badge',
8
- theme || null,
9
- onClick && 'hover'
10
- ].filter(Boolean).join(' ')
4
+ import styles from './badge.module.scss'
5
+ import { classNames } from '../../utils/classNames'
6
+
7
+ const Badge = ({
8
+ theme,
9
+ onClick,
10
+ hover,
11
+ className,
12
+ children,
13
+ ...rest
14
+ }: ReactBadgeProps) => {
15
+ const classes = classNames([
16
+ styles.badge,
17
+ theme && styles[theme],
18
+ (onClick || hover) && styles.hover,
19
+ className
20
+ ])
21
+
22
+ if (onClick) {
23
+ return (
24
+ <button className={classes} onClick={onClick} {...rest}>
25
+ {children}
26
+ </button>
27
+ )
28
+ }
11
29
 
12
30
  return (
13
- <span className={classes} onClick={onClick} {...rest}>
31
+ <span className={classes} {...rest}>
14
32
  {children}
15
33
  </span>
16
34
  )
@@ -0,0 +1,86 @@
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ .badge {
4
+ @include transition();
5
+ @include spacing(py-xs, px-sm);
6
+ @include border-radius(xs);
7
+ @include layout(inline-flex, v-center, xs);
8
+ @include typography(xs, primary-50);
9
+ @include border(0);
10
+ @include background(primary);
11
+
12
+ &.hover {
13
+ cursor: pointer;
14
+
15
+ &:hover {
16
+ @include background(primary-20);
17
+ }
18
+
19
+ &.secondary:hover {
20
+ @include background(primary-40);
21
+ }
22
+
23
+ &.outline:hover {
24
+ @include typography(primary);
25
+ @include background(transparent);
26
+ box-shadow: inset 0px 0px 0px 1px var(--w-color-primary);
27
+ }
28
+
29
+ &.flat:hover {
30
+ @include background(primary-40);
31
+ }
32
+
33
+ &.info:hover {
34
+ @include background(info-accent);
35
+ }
36
+
37
+ &.success:hover {
38
+ @include background(success-accent);
39
+ }
40
+
41
+ &.warning:hover {
42
+ @include background(warning-accent);
43
+ }
44
+
45
+ &.alert:hover {
46
+ @include background(alert-accent);
47
+ }
48
+ }
49
+
50
+
51
+ &.secondary {
52
+ @include typography(primary);
53
+ @include background(primary-50);
54
+ }
55
+
56
+ &.outline {
57
+ @include typography(primary-20);
58
+ @include background(primary-70);
59
+ box-shadow: inset 0px 0px 0px 1px var(--w-color-primary-20);
60
+ }
61
+
62
+ &.flat {
63
+ @include typography(primary);
64
+ @include background(primary-70);
65
+ }
66
+
67
+ &.info {
68
+ @include typography(info-fg);
69
+ @include background(info);
70
+ }
71
+
72
+ &.success {
73
+ @include typography(success-fg);
74
+ @include background(success);
75
+ }
76
+
77
+ &.warning {
78
+ @include typography(warning-fg);
79
+ @include background(warning);
80
+ }
81
+
82
+ &.alert {
83
+ @include typography(alert-fg);
84
+ @include background(alert);
85
+ }
86
+ }
@@ -7,9 +7,16 @@ export type BadgeProps = {
7
7
  | 'warning'
8
8
  | 'alert'
9
9
  | null
10
- onClick?: () => any
10
+ hover?: boolean
11
+ className?: string
12
+ [key: string]: any
11
13
  }
12
14
 
15
+ export type SvelteBadgeProps = {
16
+ onClick?: (() => any) | null
17
+ } & BadgeProps
18
+
13
19
  export type ReactBadgeProps = {
20
+ onClick?: (() => any) | null
14
21
  children: React.ReactNode
15
22
  } & BadgeProps
@@ -1,21 +1,23 @@
1
1
  ---
2
2
  import type { ButtonProps } from './button'
3
- import './button.scss'
3
+
4
+ import styles from './button.module.scss'
5
+ import { classNames } from '../../utils/classNames'
4
6
 
5
7
  interface Props extends ButtonProps {}
6
8
 
7
9
  const {
8
10
  theme,
9
- bold,
10
11
  href,
12
+ className,
11
13
  ...rest
12
14
  } = Astro.props
13
15
 
14
- const classes = [
15
- 'w-button',
16
- bold && 'bold',
17
- theme
18
- ].filter(Boolean).join(' ')
16
+ const classes = classNames([
17
+ styles.button,
18
+ theme && styles[theme],
19
+ className
20
+ ])
19
21
  ---
20
22
 
21
23
  {href ? (
@@ -1,17 +1,19 @@
1
1
  <script lang="ts">
2
- import type { ButtonProps } from './button'
3
- import './button.scss'
2
+ import type { SvelteButtonProps } from './button'
4
3
 
5
- export let theme: ButtonProps['theme'] = null
6
- export let bold: ButtonProps['bold'] = false
7
- export let href: ButtonProps['href'] = ''
8
- export let onClick: ButtonProps['onClick'] = () => {}
4
+ import styles from './button.module.scss'
5
+ import { classNames } from '../../utils/classNames'
9
6
 
10
- const classes = [
11
- 'w-button',
12
- bold && 'bold',
13
- theme
14
- ].filter(Boolean).join(' ')
7
+ export let theme: SvelteButtonProps['theme'] = null
8
+ export let href: SvelteButtonProps['href'] = ''
9
+ export let className: SvelteButtonProps['className'] = ''
10
+ export let onClick: SvelteButtonProps['onClick'] = () => {}
11
+
12
+ const classes = classNames([
13
+ styles.button,
14
+ theme && styles[theme],
15
+ className
16
+ ])
15
17
  </script>
16
18
 
17
19
 
@@ -1,20 +1,22 @@
1
1
  import React from 'react'
2
2
  import type { ReactButtonProps } from './button'
3
- import './button.scss'
3
+
4
+ import styles from './button.module.scss'
5
+ import { classNames } from '../../utils/classNames'
4
6
 
5
7
  const Button = ({
6
8
  theme,
7
- bold,
8
9
  href,
9
- children,
10
+ className,
10
11
  onClick,
12
+ children,
11
13
  ...rest
12
14
  }: ReactButtonProps) => {
13
- const classes = [
14
- 'w-button',
15
- bold && 'bold',
16
- theme
17
- ].filter(Boolean).join(' ')
15
+ const classes = classNames([
16
+ styles.button,
17
+ theme && styles[theme],
18
+ className
19
+ ])
18
20
 
19
21
  if (href) {
20
22
  return (
@@ -0,0 +1,87 @@
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ .button {
4
+ @include layout(inline-flex, v-center, xs);
5
+ @include typography(md, primary-50, none);
6
+ @include spacing(py-sm, px-md);
7
+ @include border-radius(xs);
8
+ @include border(0);
9
+ @include transition();
10
+ @include background(primary);
11
+
12
+ cursor: pointer;
13
+
14
+ &[disabled] {
15
+ cursor: no-drop;
16
+ @include background(primary-20);
17
+ }
18
+
19
+ &:hover {
20
+ @include background(primary-20);
21
+ }
22
+
23
+ &.secondary {
24
+ @include typography(primary);
25
+ @include background(primary-50);
26
+
27
+ &:hover {
28
+ @include background(primary-40);
29
+ }
30
+ }
31
+
32
+ &.outline {
33
+ @include typography(primary-20);
34
+ @include background(transparent);
35
+ box-shadow: inset 0px 0px 0px 1px var(--w-color-primary-20);
36
+
37
+ &:hover {
38
+ @include typography(primary);
39
+ box-shadow: inset 0px 0px 0px 1px var(--w-color-primary);
40
+ }
41
+ }
42
+
43
+ &.flat {
44
+ @include typography(primary);
45
+ @include background(transparent);
46
+
47
+ &:hover {
48
+ @include background(primary-40);
49
+ }
50
+ }
51
+
52
+ &.info {
53
+ @include typography(info-fg);
54
+ @include background(info);
55
+
56
+ &:hover {
57
+ @include background(info-accent);
58
+ }
59
+ }
60
+
61
+ &.success {
62
+ @include typography(success-fg);
63
+ @include background(success);
64
+
65
+ &:hover {
66
+ @include background(success-accent);
67
+ }
68
+ }
69
+
70
+ &.warning {
71
+ @include typography(warning-fg);
72
+ @include background(warning);
73
+
74
+ &:hover {
75
+ @include background(warning-accent);
76
+ }
77
+ }
78
+
79
+ &.alert {
80
+ @include typography(alert-fg);
81
+ @include background(alert);
82
+
83
+ &:hover {
84
+ @include background(alert-accent);
85
+ }
86
+ }
87
+ }
@@ -7,12 +7,16 @@ export type ButtonProps = {
7
7
  | 'warning'
8
8
  | 'alert'
9
9
  | null
10
- bold?: boolean
11
10
  href?: string
12
- onClick?: () => any
11
+ className?: string
13
12
  [key: string]: any
14
13
  }
15
14
 
15
+ export type SvelteButtonProps = {
16
+ onClick?: () => any
17
+ } & ButtonProps
18
+
16
19
  export type ReactButtonProps = {
20
+ onClick?: () => any
17
21
  children: React.ReactNode
18
22
  } & ButtonProps
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  import type { CardProps } from './card'
3
- import './card.scss'
3
+ import styles from './card.module.scss'
4
4
 
5
5
  interface Props extends CardProps {}
6
6
 
@@ -15,28 +15,20 @@ const {
15
15
  } = Astro.props
16
16
 
17
17
  const classes = [
18
- 'w-card',
18
+ styles.card,
19
+ secondary && styles.secondary,
19
20
  className,
20
- secondary && 'secondary',
21
21
  ].filter(Boolean).join(' ')
22
22
 
23
- const props = {
24
- class: classes
25
- }
26
-
27
23
  const Component = element
28
24
  const Title = titleTag
29
25
  ---
30
26
 
31
- <Component {...props} {...rest}>
27
+ <Component class:list={classes} {...rest}>
32
28
  {title && (
33
- <Title class:list="card-title">{title}</Title>
29
+ <Title class:list={styles.title}>{title}</Title>
34
30
  )}
35
- <div class="card-body" class:list={[compact && 'compact']}>
36
- {compact && !secondary ? (
37
- <div class="card-wrapper"><slot /></div>
38
- ) : (
39
- <slot />
40
- )}
31
+ <div class:list={[styles.body, compact && styles.compact]}>
32
+ <slot />
41
33
  </div>
42
34
  </Component>
@@ -1,6 +1,8 @@
1
1
  <script lang="ts">
2
2
  import type { CardProps } from './card'
3
- import './card.scss'
3
+
4
+ import styles from './card.module.scss'
5
+ import { classNames } from '../../utils/classNames'
4
6
 
5
7
  export let element: CardProps['element'] = 'section'
6
8
  export let title: CardProps['title'] = ''
@@ -9,24 +11,25 @@
9
11
  export let className: CardProps['className'] = ''
10
12
  export let secondary: CardProps['secondary'] = false
11
13
 
12
- const classes = [
13
- 'w-card',
14
- className,
15
- secondary && 'secondary'
16
- ].filter(Boolean).join(' ')
14
+ const classes = classNames([
15
+ styles.card,
16
+ secondary && styles.secondary,
17
+ className
18
+ ])
19
+
20
+ const bodyClasses = classNames([
21
+ styles.body,
22
+ compact && styles.compact
23
+ ])
17
24
  </script>
18
25
 
19
26
  <svelte:element this={element} class={classes} {...$$restProps}>
20
27
  {#if title}
21
- <svelte:element this={titleTag} class="card-title">
28
+ <svelte:element this={titleTag} class={styles.title}>
22
29
  {title}
23
30
  </svelte:element>
24
31
  {/if}
25
- <div class="card-body" class:compact>
26
- {#if compact && !secondary}
27
- <div class="card-wrapper"><slot /></div>
28
- {:else}
29
- <slot />
30
- {/if}
32
+ <div class={bodyClasses}>
33
+ <slot />
31
34
  </div>
32
35
  </svelte:element>
@@ -1,6 +1,8 @@
1
1
  import React from 'react'
2
2
  import type { ReactCardProps } from './card'
3
- import './card.scss'
3
+
4
+ import styles from './card.module.scss'
5
+ import { classNames } from '../../utils/classNames'
4
6
 
5
7
  const Card = ({
6
8
  Element = 'section',
@@ -12,22 +14,24 @@ const Card = ({
12
14
  children,
13
15
  ...rest
14
16
  }: ReactCardProps) => {
15
- const classes = [
16
- 'w-card',
17
+ const classes = classNames([
18
+ styles.card,
17
19
  className,
18
- secondary && 'secondary'
19
- ].filter(Boolean).join(' ')
20
+ secondary && styles.secondary
21
+ ])
22
+
23
+ const bodyClasses = classNames([
24
+ styles.body,
25
+ compact && styles.compact
26
+ ])
20
27
 
21
28
  return (
22
29
  <Element className={classes} {...rest}>
23
30
  {title && (
24
- <TitleTag className="card-title">{title}</TitleTag>
31
+ <TitleTag className={styles.title}>{title}</TitleTag>
25
32
  )}
26
- <div className={compact ? 'card-body compact' : 'card-body'}>
27
- {compact && !secondary
28
- ? <div className="card-wrapper">{children}</div>
29
- : children
30
- }
33
+ <div className={bodyClasses}>
34
+ {children}
31
35
  </div>
32
36
  </Element>
33
37
  )
@@ -0,0 +1,38 @@
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ .card {
4
+ @include border(primary-50);
5
+ @include border-radius(md);
6
+ @include layout(flex, column);
7
+
8
+ &.secondary {
9
+ @include background(primary-60);
10
+
11
+ .title {
12
+ @include background(primary-70);
13
+ }
14
+ }
15
+
16
+ .title {
17
+ @include spacing(p-default);
18
+ @include border(primary-50, bottom);
19
+ @include typography(md);
20
+ display: block;
21
+ }
22
+
23
+ .body {
24
+ @include spacing(p-default);
25
+ @include size('h100%');
26
+ @include position(relative);
27
+
28
+ &.compact {
29
+ @include border(20px, primary-60);
30
+ @include spacing(p-3xl);
31
+ @include background(primary-70);
32
+ }
33
+ }
34
+ }
35
+
36
+ a.card {
37
+ @include typography(none);
38
+ }