webcoreui 0.0.12 → 0.2.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 (83) hide show
  1. package/README.md +39 -6
  2. package/astro.d.ts +4 -0
  3. package/astro.js +4 -0
  4. package/components/Accordion/accordion.module.scss +20 -27
  5. package/components/Alert/alert.module.scss +19 -22
  6. package/components/Avatar/avatar.module.scss +9 -6
  7. package/components/Badge/badge.module.scss +31 -34
  8. package/components/Button/Button.astro +0 -2
  9. package/components/Button/Button.svelte +0 -2
  10. package/components/Button/Button.tsx +0 -2
  11. package/components/Button/button.module.scss +32 -39
  12. package/components/Button/button.ts +1 -2
  13. package/components/Card/card.module.scss +19 -15
  14. package/components/Checkbox/checkbox.module.scss +27 -41
  15. package/components/Icon/Icon.astro +2 -2
  16. package/components/Icon/map.ts +2 -0
  17. package/components/Input/input.module.scss +28 -36
  18. package/components/Menu/Menu.astro +7 -3
  19. package/components/Menu/Menu.svelte +11 -3
  20. package/components/Menu/Menu.tsx +7 -1
  21. package/components/Menu/menu.module.scss +144 -144
  22. package/components/Menu/menu.ts +1 -0
  23. package/components/Modal/Modal.astro +70 -0
  24. package/components/Modal/Modal.svelte +71 -0
  25. package/components/Modal/Modal.tsx +76 -0
  26. package/components/Modal/modal.module.scss +103 -0
  27. package/components/Modal/modal.ts +18 -0
  28. package/components/Progress/progress.module.scss +26 -22
  29. package/components/Radio/radio.module.scss +32 -41
  30. package/components/Rating/Rating.astro +2 -2
  31. package/components/Rating/Rating.svelte +2 -2
  32. package/components/Rating/Rating.tsx +2 -2
  33. package/components/Rating/rating.module.scss +15 -8
  34. package/components/Slider/Slider.astro +44 -0
  35. package/components/Slider/Slider.svelte +42 -0
  36. package/components/Slider/Slider.tsx +48 -0
  37. package/components/Slider/slider.module.scss +68 -0
  38. package/components/Slider/slider.ts +20 -0
  39. package/components/Spinner/spinner.module.scss +11 -2
  40. package/components/Switch/switch.module.scss +28 -30
  41. package/components/Table/Table.astro +6 -1
  42. package/components/Table/Table.svelte +3 -1
  43. package/components/Table/Table.tsx +7 -1
  44. package/components/Table/table.module.scss +23 -17
  45. package/components/Table/table.ts +1 -0
  46. package/components/Tabs/Tabs.astro +0 -1
  47. package/components/Tabs/tabs.module.scss +45 -48
  48. package/components/ThemeSwitcher/ThemeSwitcher.astro +1 -0
  49. package/components/ThemeSwitcher/ThemeSwitcher.svelte +2 -1
  50. package/components/ThemeSwitcher/ThemeSwitcher.tsx +2 -1
  51. package/components/ThemeSwitcher/themeswitcher.module.scss +28 -26
  52. package/components/Timeline/timeline.module.scss +28 -23
  53. package/components/TimelineItem/TimelineItem.tsx +1 -6
  54. package/components/TimelineItem/timelineitem.module.scss +14 -17
  55. package/components/TimelineItem/timelineitem.ts +5 -0
  56. package/components/Toast/toast.module.scss +10 -14
  57. package/components/Toast/toast.ts +6 -1
  58. package/icons/close.svg +3 -0
  59. package/icons.d.ts +12 -0
  60. package/icons.js +10 -0
  61. package/index.js +2 -0
  62. package/package.json +3 -1
  63. package/react.d.ts +6 -2
  64. package/react.js +4 -0
  65. package/scss/config/color-palette.scss +24 -0
  66. package/scss/config/css-values.scss +44 -0
  67. package/scss/config/layout.scss +41 -0
  68. package/scss/config/mixins.scss +392 -9
  69. package/scss/config/typography.scss +65 -0
  70. package/scss/config.scss +6 -1
  71. package/scss/global/elements.scss +21 -1
  72. package/scss/global/scrollbar.scss +12 -9
  73. package/scss/global/theme.scss +73 -40
  74. package/scss/global/tooltip.scss +42 -35
  75. package/scss/global/utility.scss +79 -61
  76. package/scss/global.scss +0 -1
  77. package/scss/resets.scss +67 -9
  78. package/scss/setup.scss +14 -41
  79. package/svelte.d.ts +4 -0
  80. package/svelte.js +4 -0
  81. package/utils/interpolate.ts +23 -0
  82. package/utils/modal.ts +59 -0
  83. package/utils/toast.ts +3 -2
@@ -1,35 +1,40 @@
1
- @import '../../scss/config.scss';
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ body {
4
+ --w-progress-color: var(--w-color-primary);
5
+ --w-progress-background: var(--w-color-primary-50);
6
+ --w-progress-stripe-light: var(--w-color-primary);
7
+ --w-progress-stripe-dark: var(--w-color-primary-10);
8
+ }
2
9
 
3
10
  .w-progress {
4
- width: 100%;
5
- height: 10px;
6
- background: var(--w-progress-background);
7
- border-radius: 20px;
8
- overflow: hidden;
11
+ @include size('w100%', h10px);
12
+ @include border-radius(xl);
13
+ @include visibility(hidden);
14
+ @include typography(bold, xs);
15
+ @include background(var(--w-progress-background));
16
+
9
17
  color: var(--w-progress-background);
10
- font-family: Bold;
11
- font-size: 10px;
12
18
 
13
19
  &.medium {
14
- height: 15px;
15
- font-size: 12px;
20
+ @include size(h15px);
21
+ @include typography(sm);
16
22
  }
17
23
 
18
24
  &.large {
19
- height: 20px;
20
- font-size: 14px;
25
+ @include size(h20px);
26
+ @include typography(md);
21
27
  }
22
28
 
23
29
  &.square {
24
- border-radius: 2px;
30
+ @include border-radius(sm);
25
31
 
26
32
  .progress {
27
- border-radius: 2px;
33
+ @include border-radius(sm);
28
34
  }
29
35
  }
30
36
 
31
37
  &.striped {
32
-
33
38
  .progress {
34
39
  background-size: 10px 10px;
35
40
  background-image: linear-gradient(
@@ -54,13 +59,12 @@
54
59
  }
55
60
 
56
61
  .progress {
57
- @include Transition(width);
62
+ @include transition(width);
63
+ @include size('h100%');
64
+ @include border-radius(xl);
65
+ @include layout(flex, center);
66
+ @include background(var(--w-progress-color));
67
+
58
68
  width: var(--w-progress-width);
59
- height: 100%;
60
- background: var(--w-progress-color);
61
- border-radius: 20px;
62
- display: flex;
63
- align-items: center;
64
- justify-content: center;
65
69
  }
66
70
  }
@@ -1,49 +1,46 @@
1
- @import '../../scss/config.scss';
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ body {
4
+ --w-radio-color: var(--w-color-primary);
5
+ }
2
6
 
3
7
  .radio {
4
- display: flex;
5
- flex-direction: column;
6
- gap: 10px;
8
+ @include layout(flex, column, sm);
7
9
 
8
10
  &.inline {
9
- flex-direction: row;
11
+ @include layout(row);
10
12
  }
11
13
 
12
14
  label {
13
- display: flex;
14
- align-items: center;
15
- gap: 5px;
15
+ @include layout(flex, xs);
16
+
16
17
  cursor: pointer;
17
- font-size: 16px;
18
18
 
19
19
  &.disabled {
20
20
  cursor: no-drop;
21
21
 
22
22
  input + span::after {
23
- background: var(--w-color-primary-20);
23
+ @include background(primary-20);
24
24
  }
25
25
  }
26
26
 
27
27
  &.col {
28
- flex-direction: column;
29
- align-items: flex-start;
28
+ @include layout(column, v-start);
30
29
  }
31
30
  }
32
31
 
33
32
  input {
34
- display: none;
33
+ @include visibility(none);
35
34
 
36
35
  + span::after {
37
- @include Transition(transform);
36
+ @include transition(transform);
37
+ @include position(absolute, 't50%', 'l50%');
38
+ @include size(8px);
39
+ @include border-radius(max);
40
+ @include background(var(--w-radio-color));
41
+
38
42
  content: '';
39
- position: absolute;
40
- top: 50%;
41
- left: 50%;
42
43
  transform: translate(-50%, -50%) scale(0);
43
- width: 8px;
44
- height: 8px;
45
- border-radius: 100%;
46
- background: var(--w-radio-color);
47
44
  }
48
45
 
49
46
  &:checked + span::after {
@@ -51,41 +48,35 @@
51
48
  }
52
49
 
53
50
  &:disabled + span {
54
- background-color: var(--w-color-primary-40);
55
- border-color: var(--w-color-primary-40);
51
+ @include background(primary-40);
52
+ @include border(primary-40);
56
53
  }
57
54
  }
58
55
 
59
- a {
60
- text-decoration: underline;
61
- }
62
-
63
56
  .wrapper {
64
- display: flex;
65
- align-items: center;
66
- gap: 10px;
57
+ @include layout(flex, sm);
67
58
  }
68
-
59
+
69
60
  .icon {
61
+ @include size(16px);
62
+ @include border-radius(max);
63
+ @include position(relative);
64
+ @include spacing(mt-xxs);
65
+
70
66
  display: inline-block;
71
- width: 16px;
72
- height: 16px;
73
- border-radius: 100%;
67
+ min-width: 16px;
74
68
  border: 1px solid var(--w-radio-color);
75
- position: relative;
76
69
  }
77
70
 
78
71
  .subtext {
79
- margin-left: 25px;
80
- font-size: 14px;
81
- color: var(--w-color-primary-20);
72
+ @include spacing(ml-lg);
73
+ @include typography(md, primary-20);
82
74
 
83
75
  a {
84
- @include Transition(color);
85
- color: var(--w-color-primary-20);
76
+ @include typography(primary-20);
86
77
 
87
78
  &:hover {
88
- color: var(--w-color-primary);
79
+ @include typography(primary);
89
80
  }
90
81
  }
91
82
  }
@@ -45,11 +45,11 @@ const translatedReviewText = reviewText.replace('{0}', `${reviewCount}`)
45
45
 
46
46
  <span class:list={classes} style={styleVariables}>
47
47
  {score > 0 && (
48
- <span class={styles.score}>{Array(score).fill('★').join('')}</span>
48
+ <span class={styles.score}>{Array(Math.round(score)).fill('★').join('')}</span>
49
49
  )}
50
50
  {showEmpty && (
51
51
  <span class={styles.empty}>
52
- {Array(total - score).fill('★').join('')}
52
+ {Array(total - Math.round(score)).fill('★').join('')}
53
53
  </span>
54
54
  )}
55
55
  {showText && (
@@ -42,11 +42,11 @@
42
42
 
43
43
  <span class={classes} style={styleVariables}>
44
44
  {#if score}
45
- <span class={styles.score}>{Array(score).fill('★').join('')}</span>
45
+ <span class={styles.score}>{Array(Math.round(score)).fill('★').join('')}</span>
46
46
  {/if}
47
47
  {#if showEmpty}
48
48
  <span class={styles.empty}>
49
- {Array((total || 5) - score).fill('★').join('')}
49
+ {Array((total || 5) - Math.round(score)).fill('★').join('')}
50
50
  </span>
51
51
  {/if}
52
52
 
@@ -43,12 +43,12 @@ const Rating = ({
43
43
  <span className={classes} style={styleVariables}>
44
44
  {score > 0 && (
45
45
  <span className={styles.score}>
46
- {Array(score).fill('★').join('')}
46
+ {Array(Math.round(score)).fill('★').join('')}
47
47
  </span>
48
48
  )}
49
49
  {showEmpty && (
50
50
  <span className={styles.empty}>
51
- {Array(total - score).fill('★').join('')}
51
+ {Array(total - Math.round(score)).fill('★').join('')}
52
52
  </span>
53
53
  )}
54
54
  {showText && (
@@ -1,8 +1,15 @@
1
- @import '../../scss/config.scss';
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ body {
4
+ --w-rating-color: var(--w-color-primary);
5
+ --w-rating-empty-color: var(--w-color-primary);
6
+ --w-rating-empty-background: var(--w-color-primary-70);
7
+ --w-rating-size: 18px;
8
+ }
2
9
 
3
10
  .rating {
4
- display: inline-flex;
5
- align-items: center;
11
+ @include layout(inline-flex, v-center);
12
+
6
13
  color: var(--w-rating-color);
7
14
  font-size: var(--w-rating-size);
8
15
 
@@ -22,14 +29,14 @@
22
29
  color: var(--w-rating-empty-color);
23
30
  }
24
31
 
25
- a {
26
- text-decoration: underline;
32
+ a:hover .text {
33
+ @include typography(primary);
27
34
  }
28
35
 
29
36
  .text {
30
- font-size: 16px;
31
- color: var(--w-color-primary-20);
32
- margin-left: 5px;
37
+ @include transition(color);
38
+ @include typography(default, primary-20);
39
+ @include spacing(ml-xs);
33
40
 
34
41
  &.m {
35
42
  margin-right: 5px;
@@ -0,0 +1,44 @@
1
+ ---
2
+ import type { SliderProps } from './slider'
3
+
4
+ import styles from './slider.module.scss'
5
+ import { classNames } from '../../utils/classNames'
6
+
7
+ interface Props extends SliderProps {}
8
+
9
+ const {
10
+ min,
11
+ max,
12
+ value,
13
+ step,
14
+ disabled,
15
+ color,
16
+ background,
17
+ thumb,
18
+ id,
19
+ className
20
+ } = Astro.props
21
+
22
+ const classes = [
23
+ styles.slider,
24
+ className
25
+ ]
26
+
27
+ const styleVariables = classNames([
28
+ color && `--w-slider-color: ${color};`,
29
+ background && `--w-slider-background: ${background};`,
30
+ thumb && `--w-slider-thumb: ${thumb};`
31
+ ])
32
+ ---
33
+
34
+ <input
35
+ type="range"
36
+ min={min}
37
+ max={max}
38
+ value={value || min}
39
+ step={step}
40
+ disabled={disabled}
41
+ class:list={classes}
42
+ id={id}
43
+ style={styleVariables}
44
+ />
@@ -0,0 +1,42 @@
1
+ <script lang="ts">
2
+ import type { SvelteSliderProps } from './slider'
3
+
4
+ import styles from './slider.module.scss'
5
+ import { classNames } from '../../utils/classNames'
6
+
7
+ export let min: SvelteSliderProps['min'] = 0
8
+ export let max: SvelteSliderProps['max'] = 100
9
+ export let value: SvelteSliderProps['value'] = 0
10
+ export let step: SvelteSliderProps['step'] = 1
11
+ export let disabled: SvelteSliderProps['disabled'] = false
12
+ export let color: SvelteSliderProps['color'] = ''
13
+ export let background: SvelteSliderProps['background'] = ''
14
+ export let thumb: SvelteSliderProps['thumb'] = ''
15
+ export let id: SvelteSliderProps['id'] = ''
16
+ export let className: SvelteSliderProps['className'] = ''
17
+ export let onChange: SvelteSliderProps['onChange'] = () => {}
18
+
19
+ const classes = classNames([
20
+ styles.slider,
21
+ className
22
+ ])
23
+
24
+ const styleVariables = classNames([
25
+ color && `--w-slider-color: ${color};`,
26
+ background && `--w-slider-background: ${background};`,
27
+ thumb && `--w-slider-thumb: ${thumb};`
28
+ ])
29
+ </script>
30
+
31
+ <input
32
+ type="range"
33
+ min={min}
34
+ max={max}
35
+ value={value || min}
36
+ step={step}
37
+ disabled={disabled}
38
+ class={classes}
39
+ id={id || null}
40
+ style={styleVariables || null}
41
+ on:change={onChange}
42
+ />
@@ -0,0 +1,48 @@
1
+ import React from 'react'
2
+ import type { ReactSliderProps } from './slider'
3
+
4
+ import styles from './slider.module.scss'
5
+ import { classNames } from '../../utils/classNames'
6
+
7
+ const Slider = ({
8
+ min,
9
+ max,
10
+ value,
11
+ step,
12
+ disabled,
13
+ color,
14
+ background,
15
+ thumb,
16
+ id,
17
+ className,
18
+ onChange
19
+ }: ReactSliderProps) => {
20
+ const classes = classNames([
21
+ styles.slider,
22
+ className
23
+ ])
24
+
25
+ const styleVariables = {
26
+ ...(color && { '--w-slider-color': color }),
27
+ ...(background && { '--w-slider-background': background }),
28
+ ...(thumb && { '--w-slider-thumb': thumb })
29
+ } as React.CSSProperties
30
+
31
+ return (
32
+ <input
33
+ type="range"
34
+ min={min}
35
+ max={max}
36
+ defaultValue={value || min}
37
+ step={step}
38
+ disabled={disabled}
39
+ className={classes}
40
+ id={id}
41
+ style={styleVariables}
42
+ onChange={onChange}
43
+ />
44
+
45
+ )
46
+ }
47
+
48
+ export default Slider
@@ -0,0 +1,68 @@
1
+ @import '../../scss/config.scss';
2
+
3
+ body {
4
+ --w-slider-background: var(--w-color-primary-50);
5
+ --w-slider-color: var(--w-color-primary);
6
+ --w-slider-thumb: var(--w-color-primary-50);
7
+ }
8
+
9
+ .slider {
10
+ @include border-radius(xl);
11
+ @include size('w100%');
12
+ @include visibility(hidden);
13
+ @include size(h10px);
14
+ @include spacing(m0);
15
+
16
+ -webkit-appearance: none;
17
+ appearance: none;
18
+ cursor: pointer;
19
+
20
+ &[disabled]::-webkit-slider-runnable-track {
21
+ @include background(primary-50);
22
+ }
23
+
24
+ &[disabled]::-moz-range-track {
25
+ @include background(primary-50);
26
+ }
27
+
28
+ &[disabled]::-webkit-slider-thumb {
29
+ @include background(primary-50);
30
+ @include border(primary-30);
31
+ box-shadow: -995px 0 0 990px var(--w-color-primary-30);
32
+ }
33
+
34
+ &[disabled]::-moz-range-thumb {
35
+ @include background(primary-50);
36
+ @include border(primary-30);
37
+ box-shadow: -995px 0 0 990px var(--w-color-primary-30);
38
+ }
39
+ }
40
+
41
+ .slider::-webkit-slider-runnable-track {
42
+ @include background(var(--w-slider-background));
43
+ }
44
+
45
+ .slider::-moz-range-track {
46
+ @include background(var(--w-slider-background));
47
+ @include size(h10px);
48
+ }
49
+
50
+ .slider::-webkit-slider-thumb {
51
+ @include background(var(--w-slider-thumb));
52
+ @include size(10px);
53
+ @include border-radius(max);
54
+ @include border(var(--w-slider-color));
55
+
56
+ -webkit-appearance: none;
57
+ appearance: none;
58
+ box-shadow: -995px 0 0 990px var(--w-slider-color);
59
+ }
60
+
61
+ .slider::-moz-range-thumb {
62
+ @include background(var(--w-slider-thumb));
63
+ @include size(9px);
64
+ @include border-radius(max);
65
+ @include border(var(--w-slider-color));
66
+
67
+ box-shadow: -995px 0 0 990px var(--w-slider-color);
68
+ }
@@ -0,0 +1,20 @@
1
+ export type SliderProps = {
2
+ min: number
3
+ max: number
4
+ value?: number
5
+ step?: number
6
+ disabled?: boolean
7
+ color?: string
8
+ background?: string
9
+ thumb?: string
10
+ id?: string
11
+ className?: string
12
+ }
13
+
14
+ export type SvelteSliderProps = {
15
+ onChange?: (e: any) => any
16
+ } & SliderProps
17
+
18
+ export type ReactSliderProps = {
19
+ onChange?: (e: any) => any
20
+ } & SliderProps
@@ -1,7 +1,16 @@
1
- @import '../../scss/config.scss';
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ body {
4
+ --w-spinner-color: var(--w-color-primary);
5
+ --w-spinner-width: 2px;
6
+ --w-spinner-speed: 2s;
7
+ --w-spinner-size: 30px;
8
+ --w-spinner-dash: 8;
9
+ }
2
10
 
3
11
  .spinner {
4
- margin: 0px auto;
12
+ @include spacing(auto-none);
13
+
5
14
  width: var(--w-spinner-size);
6
15
  height: var(--w-spinner-size);
7
16
  animation: rotate var(--w-spinner-speed) linear infinite;
@@ -1,21 +1,24 @@
1
- @import '../../scss/config.scss';
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ body {
4
+ --w-switch-off-color: var(--w-color-primary-50);
5
+ --w-switch-on-color: var(--w-color-primary);
6
+ }
2
7
 
3
8
  .switch {
4
- display: inline-flex;
5
- align-items: center;
6
- gap: 10px;
9
+ @include layout(inline-flex, v-center, sm);
7
10
  cursor: pointer;
8
11
 
9
12
  &.reverse {
10
- flex-direction: row-reverse;
13
+ @include layout(row-reverse);
11
14
  }
12
15
 
13
16
  &.disabled .toggle {
17
+ @include background(primary-40);
14
18
  cursor: no-drop;
15
- background: var(--w-color-primary-40);
16
19
 
17
20
  &::before {
18
- background: var(--w-color-primary-50);
21
+ @include background(primary-50);
19
22
  }
20
23
  }
21
24
 
@@ -25,33 +28,31 @@
25
28
  }
26
29
 
27
30
  .toggle {
28
- width: 40px;
29
- height: 20px;
31
+ @include size(w40px, h20px);
30
32
 
31
33
  &::before {
32
- height: 14px;
33
- width: 14px;
34
+ @include size(14px);
34
35
  }
35
36
  }
36
37
 
37
38
  .label {
38
- font-size: 14px;
39
+ @include typography(md);
39
40
  }
40
41
  }
41
42
 
42
43
  &.square .toggle {
43
- border-radius: 5px;
44
+ @include border-radius(md);
44
45
 
45
46
  &::before {
46
- border-radius: 5px;
47
+ @include border-radius(md);
47
48
  }
48
49
  }
49
50
 
50
51
  input {
51
- display: none;
52
+ @include visibility(none);
52
53
 
53
54
  &:checked + span {
54
- background-color: var(--w-switch-on-color);
55
+ @include background(var(--w-switch-on-color));
55
56
 
56
57
  &::before {
57
58
  transform: translateX(30px);
@@ -60,22 +61,19 @@
60
61
  }
61
62
 
62
63
  .toggle {
63
- @include Transition(background);
64
- position: relative;
65
- width: 60px;
66
- height: 30px;
67
- background: var(--w-switch-off-color);
68
- border-radius: 30px;
64
+ @include transition(background);
65
+ @include position(relative);
66
+ @include size(w60px, h30px);
67
+ @include border-radius(xl);
68
+ @include background(var(--w-switch-off-color));
69
69
 
70
70
  &::before {
71
- content: "";
72
- position: absolute;
73
- height: 24px;
74
- width: 24px;
75
- left: 3px;
76
- bottom: 3px;
77
- background: var(--w-color-primary-70);
78
- border-radius: 50%;
71
+ @include position(absolute, l3px, b3px);
72
+ @include size(24px);
73
+ @include border-radius(max);
74
+ @include background(primary-70);
75
+
76
+ content: '';
79
77
  transition: 0.3s;
80
78
  }
81
79
  }
@@ -12,6 +12,7 @@ const {
12
12
  striped,
13
13
  offsetStripe,
14
14
  compact,
15
+ maxHeight,
15
16
  className
16
17
  } = Astro.props
17
18
 
@@ -21,11 +22,15 @@ const classes = [
21
22
  striped && styles[`striped-${striped}s`],
22
23
  offsetStripe && styles.offset,
23
24
  compact && styles.compact,
25
+ maxHeight && styles.scroll,
24
26
  className
25
27
  ]
26
28
  ---
27
29
 
28
- <div class:list={classes}>
30
+ <div
31
+ class:list={classes}
32
+ style={maxHeight ? `max-height:${maxHeight}` : undefined}
33
+ >
29
34
  <table>
30
35
  {headings?.length && (
31
36
  <thead>
@@ -11,6 +11,7 @@
11
11
  export let striped: TableProps['striped'] = null
12
12
  export let offsetStripe: TableProps['offsetStripe'] = false
13
13
  export let compact: TableProps['compact'] = false
14
+ export let maxHeight: TableProps['maxHeight'] = 0
14
15
  export let className: TableProps['className'] = ''
15
16
 
16
17
  const classes = classNames([
@@ -19,11 +20,12 @@
19
20
  striped && styles[`striped-${striped}s`],
20
21
  offsetStripe && styles.offset,
21
22
  compact && styles.compact,
23
+ maxHeight && styles.scroll,
22
24
  className
23
25
  ])
24
26
  </script>
25
27
 
26
- <div class={classes}>
28
+ <div class={classes} style={maxHeight ? `max-height:${maxHeight}` : null}>
27
29
  <table>
28
30
  {#if headings?.length}
29
31
  <thead>