webcoreui 0.0.10 → 0.0.12

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 (123) hide show
  1. package/README.md +35 -7
  2. package/astro.d.ts +8 -0
  3. package/astro.js +8 -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.scss → accordion.module.scss} +18 -10
  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 +54 -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} +2 -2
  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 +89 -0
  21. package/components/Badge/badge.ts +8 -1
  22. package/components/Button/Button.astro +10 -6
  23. package/components/Button/Button.svelte +15 -11
  24. package/components/Button/Button.tsx +11 -7
  25. package/components/Button/button.module.scss +94 -0
  26. package/components/Button/button.ts +6 -1
  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 +33 -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.scss → checkbox.module.scss} +16 -17
  35. package/components/Checkbox/checkbox.ts +5 -1
  36. package/components/ConditionalWrapper/ConditionalWrapper.svelte +1 -1
  37. package/components/Icon/Icon.svelte +1 -8
  38. package/components/Icon/Icon.tsx +1 -8
  39. package/components/Icon/map.ts +23 -0
  40. package/components/Input/Input.astro +50 -0
  41. package/components/Input/Input.svelte +52 -0
  42. package/components/Input/Input.tsx +59 -0
  43. package/components/Input/input.module.scss +87 -0
  44. package/components/Input/input.ts +50 -0
  45. package/components/Menu/Menu.astro +107 -0
  46. package/components/Menu/Menu.svelte +88 -0
  47. package/components/Menu/Menu.tsx +107 -0
  48. package/components/Menu/menu.module.scss +144 -0
  49. package/components/Menu/menu.ts +21 -0
  50. package/components/Progress/Progress.astro +42 -40
  51. package/components/Progress/Progress.svelte +40 -38
  52. package/components/Progress/Progress.tsx +48 -47
  53. package/components/Progress/{progress.scss → progress.module.scss} +66 -66
  54. package/components/Radio/Radio.astro +57 -57
  55. package/components/Radio/Radio.svelte +58 -56
  56. package/components/Radio/Radio.tsx +69 -68
  57. package/components/Radio/{radio.scss → radio.module.scss} +92 -92
  58. package/components/Radio/radio.ts +4 -0
  59. package/components/Rating/Rating.astro +13 -10
  60. package/components/Rating/Rating.svelte +15 -15
  61. package/components/Rating/Rating.tsx +22 -11
  62. package/components/Rating/{rating.scss → rating.module.scss} +10 -9
  63. package/components/Rating/rating.ts +1 -1
  64. package/components/Spinner/Spinner.astro +44 -42
  65. package/components/Spinner/Spinner.svelte +40 -38
  66. package/components/Spinner/Spinner.tsx +45 -44
  67. package/components/Spinner/{spinner.scss → spinner.module.scss} +41 -41
  68. package/components/Switch/Switch.astro +13 -11
  69. package/components/Switch/Switch.svelte +26 -24
  70. package/components/Switch/Switch.tsx +14 -12
  71. package/components/Switch/{switch.scss → switch.module.scss} +4 -4
  72. package/components/Switch/switch.ts +8 -4
  73. package/components/Table/Table.astro +60 -0
  74. package/components/Table/Table.svelte +56 -0
  75. package/components/Table/Table.tsx +64 -0
  76. package/components/Table/table.module.scss +64 -0
  77. package/components/Table/table.ts +10 -0
  78. package/components/Tabs/Tabs.astro +77 -76
  79. package/components/Tabs/Tabs.svelte +56 -54
  80. package/components/Tabs/Tabs.tsx +70 -69
  81. package/components/Tabs/{tabs.scss → tabs.module.scss} +30 -31
  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 +74 -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} +71 -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.scss → timelineitem.module.scss} +31 -31
  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.scss → toast.module.scss} +44 -43
  99. package/components/Toast/toast.ts +3 -6
  100. package/icons/moon.svg +3 -0
  101. package/icons/sun.svg +3 -0
  102. package/index.js +3 -0
  103. package/package.json +3 -1
  104. package/react.d.ts +8 -0
  105. package/react.js +8 -0
  106. package/scss/global/elements.scss +1 -1
  107. package/scss/global/scrollbar.scss +21 -0
  108. package/scss/global/theme.scss +140 -0
  109. package/scss/global/tooltip.scss +8 -5
  110. package/scss/global/utility.scss +29 -0
  111. package/scss/global.scss +2 -0
  112. package/scss/resets.scss +5 -5
  113. package/scss/setup.scss +39 -18
  114. package/svelte.d.ts +18 -10
  115. package/svelte.js +8 -0
  116. package/utils/classNames.ts +4 -0
  117. package/utils/cookies.ts +28 -0
  118. package/utils/event.ts +17 -0
  119. package/utils/toast.ts +12 -9
  120. package/components/Alert/alert.scss +0 -53
  121. package/components/Badge/badge.scss +0 -85
  122. package/components/Button/button.scss +0 -91
  123. package/components/Card/card.scss +0 -37
@@ -1,6 +1,6 @@
1
1
  @import '../../scss/config.scss';
2
2
 
3
- .w-avatar {
3
+ .avatar {
4
4
  border-radius: 100%;
5
5
 
6
6
  &:not(.borderless) {
@@ -8,7 +8,7 @@
8
8
  }
9
9
  }
10
10
 
11
- .w-avatar-group {
11
+ .group {
12
12
  display: inline-flex;
13
13
  align-items: center;
14
14
 
@@ -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,89 @@
1
+ @import '../../scss/config.scss';
2
+
3
+ .badge {
4
+ @include Transition();
5
+ padding: 5px 10px;
6
+ border-radius: 5px;
7
+ display: inline-flex;
8
+ align-items: center;
9
+ gap: 5px;
10
+ font-size: 12px;
11
+ background: var(--w-color-primary);
12
+ color: var(--w-color-primary-50);
13
+ border: 0;
14
+
15
+ &.hover {
16
+ cursor: pointer;
17
+
18
+ &:hover {
19
+ background: var(--w-color-primary-20);
20
+ }
21
+
22
+ &.secondary:hover {
23
+ background: var(--w-color-primary-40);
24
+ }
25
+
26
+ &.outline:hover {
27
+ color: var(--w-color-primary);
28
+ background: transparent;
29
+ box-shadow: inset 0px 0px 0px 1px var(--w-color-primary);
30
+ }
31
+
32
+ &.flat:hover {
33
+ background: var(--w-color-primary-40);
34
+ }
35
+
36
+ &.info:hover {
37
+ background: var(--w-color-info-accent);
38
+ }
39
+
40
+ &.success:hover {
41
+ background: var(--w-color-success-accent);
42
+ }
43
+
44
+ &.warning:hover {
45
+ background: var(--w-color-warning-accent);
46
+ }
47
+
48
+ &.alert:hover {
49
+ background: var(--w-color-alert-accent);
50
+ }
51
+ }
52
+
53
+
54
+ &.secondary {
55
+ background: var(--w-color-primary-50);
56
+ color: var(--w-color-primary);
57
+ }
58
+
59
+ &.outline {
60
+ background: var(--w-color-primary-70);
61
+ color: var(--w-color-primary-20);
62
+ box-shadow: inset 0px 0px 0px 1px var(--w-color-primary-20);
63
+ }
64
+
65
+ &.flat {
66
+ background: var(--w-color-primary-70);
67
+ color: var(--w-color-primary);
68
+ }
69
+
70
+ &.info {
71
+ background: var(--w-color-info);
72
+ color: var(--w-color-info-fg);
73
+ }
74
+
75
+ &.success {
76
+ background: var(--w-color-success);
77
+ color: var(--w-color-success-fg);
78
+ }
79
+
80
+ &.warning {
81
+ background: var(--w-color-warning);
82
+ color: var(--w-color-warning-fg);
83
+ }
84
+
85
+ &.alert {
86
+ background: var(--w-color-alert);
87
+ color: var(--w-color-alert-fg);
88
+ }
89
+ }
@@ -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,6 +1,8 @@
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
 
@@ -8,14 +10,16 @@ const {
8
10
  theme,
9
11
  bold,
10
12
  href,
13
+ className,
11
14
  ...rest
12
15
  } = Astro.props
13
16
 
14
- const classes = [
15
- 'w-button',
16
- bold && 'bold',
17
- theme
18
- ].filter(Boolean).join(' ')
17
+ const classes = classNames([
18
+ styles.button,
19
+ bold && styles.bold,
20
+ theme && styles[theme],
21
+ className
22
+ ])
19
23
  ---
20
24
 
21
25
  {href ? (
@@ -1,17 +1,21 @@
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 bold: SvelteButtonProps['bold'] = false
9
+ export let href: SvelteButtonProps['href'] = ''
10
+ export let className: SvelteButtonProps['className'] = ''
11
+ export let onClick: SvelteButtonProps['onClick'] = () => {}
12
+
13
+ const classes = classNames([
14
+ styles.button,
15
+ bold && styles.bold,
16
+ theme && styles[theme],
17
+ className
18
+ ])
15
19
  </script>
16
20
 
17
21
 
@@ -1,20 +1,24 @@
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
9
  bold,
8
10
  href,
9
- children,
11
+ className,
10
12
  onClick,
13
+ children,
11
14
  ...rest
12
15
  }: ReactButtonProps) => {
13
- const classes = [
14
- 'w-button',
15
- bold && 'bold',
16
- theme
17
- ].filter(Boolean).join(' ')
16
+ const classes = classNames([
17
+ styles.button,
18
+ bold && styles.bold,
19
+ theme && styles[theme],
20
+ className
21
+ ])
18
22
 
19
23
  if (href) {
20
24
  return (
@@ -0,0 +1,94 @@
1
+ @import '../../scss/config.scss';
2
+
3
+ .button {
4
+ @include Transition();
5
+ padding: 10px 15px;
6
+ border-radius: 5px;
7
+ text-decoration: none;
8
+ display: inline-flex;
9
+ align-items: center;
10
+ gap: 5px;
11
+ font-size: 16px;
12
+ cursor: pointer;
13
+ border: 0;
14
+ background: var(--w-color-primary);
15
+ color: var(--w-color-primary-50);
16
+
17
+ &[disabled] {
18
+ cursor: no-drop;
19
+ background: var(--w-color-primary-20);
20
+ }
21
+
22
+ &:hover {
23
+ background: var(--w-color-primary-20);
24
+ }
25
+
26
+ &.secondary {
27
+ background: var(--w-color-primary-50);
28
+ color: var(--w-color-primary);
29
+
30
+ &:hover {
31
+ background: var(--w-color-primary-40);
32
+ }
33
+ }
34
+
35
+ &.outline {
36
+ background: transparent;
37
+ color: var(--w-color-primary-20);
38
+ box-shadow: inset 0px 0px 0px 1px var(--w-color-primary-20);
39
+
40
+ &:hover {
41
+ color: var(--w-color-primary);
42
+ box-shadow: inset 0px 0px 0px 1px var(--w-color-primary);
43
+ }
44
+ }
45
+
46
+ &.flat {
47
+ background: transparent;
48
+ color: var(--w-color-primary);
49
+
50
+ &:hover {
51
+ background: var(--w-color-primary-40);
52
+ }
53
+ }
54
+
55
+ &.info {
56
+ background: var(--w-color-info);
57
+ color: var(--w-color-info-fg);
58
+
59
+ &:hover {
60
+ background: var(--w-color-info-accent);
61
+ }
62
+ }
63
+
64
+ &.success {
65
+ background: var(--w-color-success);
66
+ color: var(--w-color-success-fg);
67
+
68
+ &:hover {
69
+ background: var(--w-color-success-accent);
70
+ }
71
+ }
72
+
73
+ &.warning {
74
+ background: var(--w-color-warning);
75
+ color: var(--w-color-warning-fg);
76
+
77
+ &:hover {
78
+ background: var(--w-color-warning-accent);
79
+ }
80
+ }
81
+
82
+ &.alert {
83
+ background: var(--w-color-alert);
84
+ color: var(--w-color-alert-fg);
85
+
86
+ &:hover {
87
+ background: var(--w-color-alert-accent);
88
+ }
89
+ }
90
+
91
+ &.bold {
92
+ font-family: Bold;
93
+ }
94
+ }
@@ -9,10 +9,15 @@ export type ButtonProps = {
9
9
  | null
10
10
  bold?: boolean
11
11
  href?: string
12
- onClick?: () => any
12
+ className?: string
13
13
  [key: string]: any
14
14
  }
15
15
 
16
+ export type SvelteButtonProps = {
17
+ onClick?: () => any
18
+ } & ButtonProps
19
+
16
20
  export type ReactButtonProps = {
21
+ onClick?: () => any
17
22
  children: React.ReactNode
18
23
  } & 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,33 @@
1
+ .card {
2
+ border: 1px solid var(--w-color-primary-50);
3
+ border-radius: 5px;
4
+ display: flex;
5
+ flex-direction: column;
6
+
7
+ &.secondary {
8
+ background: var(--w-color-primary-60);
9
+
10
+ .title {
11
+ background: var(--w-color-primary-70);
12
+ }
13
+ }
14
+
15
+ .title {
16
+ padding: 20px;
17
+ display: block;
18
+ border-bottom: 1px solid var(--w-color-primary-50);
19
+ font-size: 16px;
20
+ }
21
+
22
+ .body {
23
+ padding: 20px;
24
+ height: 100%;
25
+ position: relative;
26
+
27
+ &.compact {
28
+ border: 20px solid var(--w-color-primary-60);
29
+ background: var(--w-color-primary-70);
30
+ padding: 40px;
31
+ }
32
+ }
33
+ }
@@ -4,7 +4,7 @@ import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.astro'
4
4
 
5
5
  import check from '../../icons/check.svg?raw'
6
6
 
7
- import './checkbox.scss'
7
+ import styles from './checkbox.module.scss'
8
8
 
9
9
  interface Props extends CheckboxProps {}
10
10
 
@@ -13,14 +13,14 @@ const {
13
13
  label,
14
14
  subText,
15
15
  disabled,
16
- boxed,
17
- color
16
+ color,
17
+ className
18
18
  } = Astro.props
19
19
 
20
20
  const classes = [
21
- 'w-checkbox',
22
- boxed && 'boxed',
23
- label && subText && 'col'
21
+ styles.checkbox,
22
+ label && subText && styles.col,
23
+ className
24
24
  ]
25
25
 
26
26
  const style = color
@@ -30,21 +30,21 @@ const style = color
30
30
 
31
31
  <label class:list={classes} style={style}>
32
32
  <ConditionalWrapper condition={!!(label && subText)}>
33
- <div class="checkbox-wrapper" slot="wrapper">
33
+ <div class={styles.wrapper} slot="wrapper">
34
34
  children
35
35
  </div>
36
36
  <input type="checkbox" checked={checked} disabled={disabled} />
37
- <span class="check">
37
+ <span class={styles.check}>
38
38
  <Fragment set:html={check} />
39
39
  </span>
40
40
  {label && (
41
- <span class="label">
41
+ <span class={styles.label}>
42
42
  <Fragment set:html={label} />
43
43
  </span>
44
44
  )}
45
45
  </ConditionalWrapper>
46
46
  {label && subText && (
47
- <span class="sub-text">
47
+ <span class={styles.text}>
48
48
  <Fragment set:html={subText} />
49
49
  </span>
50
50
  )}