@skeletonlabs/skeleton 2.4.0 → 2.5.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 (81) hide show
  1. package/dist/actions/Filters/filter.test.d.ts +1 -0
  2. package/dist/actions/Filters/filter.test.js +36 -0
  3. package/dist/components/Accordion/Accordion.test.d.ts +1 -0
  4. package/dist/components/Accordion/Accordion.test.js +25 -0
  5. package/dist/components/Accordion/AccordionItem.test.d.ts +1 -0
  6. package/dist/components/Accordion/AccordionItem.test.js +22 -0
  7. package/dist/components/AppBar/AppBar.test.d.ts +1 -0
  8. package/dist/components/AppBar/AppBar.test.js +28 -0
  9. package/dist/components/AppRail/AppRail.test.d.ts +1 -0
  10. package/dist/components/AppRail/AppRail.test.js +28 -0
  11. package/dist/components/AppRail/AppRailTile.svelte +12 -3
  12. package/dist/components/AppRail/AppRailTile.svelte.d.ts +0 -1
  13. package/dist/components/AppRail/AppRailTile.test.d.ts +1 -0
  14. package/dist/components/AppRail/AppRailTile.test.js +27 -0
  15. package/dist/components/AppShell/AppShell.test.d.ts +1 -0
  16. package/dist/components/AppShell/AppShell.test.js +23 -0
  17. package/dist/components/Autocomplete/Autocomplete.svelte +2 -1
  18. package/dist/components/Autocomplete/Autocomplete.svelte.d.ts +2 -0
  19. package/dist/components/Autocomplete/Autocomplete.test.d.ts +1 -0
  20. package/dist/components/Autocomplete/Autocomplete.test.js +125 -0
  21. package/dist/components/Avatar/Avatar.test.d.ts +1 -0
  22. package/dist/components/Avatar/Avatar.test.js +35 -0
  23. package/dist/components/ConicGradient/ConicGradient.test.d.ts +1 -0
  24. package/dist/components/ConicGradient/ConicGradient.test.js +23 -0
  25. package/dist/components/FileButton/FileButton.test.d.ts +1 -0
  26. package/dist/components/FileButton/FileButton.test.js +29 -0
  27. package/dist/components/FileDropzone/FileDropzone.test.d.ts +1 -0
  28. package/dist/components/FileDropzone/FileDropzone.test.js +29 -0
  29. package/dist/components/ListBox/ListBox.test.d.ts +1 -0
  30. package/dist/components/ListBox/ListBox.test.js +42 -0
  31. package/dist/components/ListBox/ListBoxItem.test.d.ts +1 -0
  32. package/dist/components/ListBox/ListBoxItem.test.js +29 -0
  33. package/dist/components/Paginator/Paginator.test.d.ts +1 -0
  34. package/dist/components/Paginator/Paginator.test.js +26 -0
  35. package/dist/components/ProgressBar/ProgressBar.svelte +3 -2
  36. package/dist/components/ProgressBar/ProgressBar.svelte.d.ts +4 -2
  37. package/dist/components/ProgressBar/ProgressBar.test.d.ts +1 -0
  38. package/dist/components/ProgressBar/ProgressBar.test.js +24 -0
  39. package/dist/components/ProgressRadial/ProgressRadial.svelte +3 -2
  40. package/dist/components/ProgressRadial/ProgressRadial.svelte.d.ts +2 -0
  41. package/dist/components/ProgressRadial/ProgressRadial.test.d.ts +1 -0
  42. package/dist/components/ProgressRadial/ProgressRadial.test.js +24 -0
  43. package/dist/components/Radio/RadioGroup.test.d.ts +1 -0
  44. package/dist/components/Radio/RadioGroup.test.js +27 -0
  45. package/dist/components/Radio/RadioItem.test.d.ts +1 -0
  46. package/dist/components/Radio/RadioItem.test.js +24 -0
  47. package/dist/components/RangeSlider/RangeSlider.test.d.ts +1 -0
  48. package/dist/components/RangeSlider/RangeSlider.test.js +38 -0
  49. package/dist/components/Ratings/Ratings.test.d.ts +1 -0
  50. package/dist/components/Ratings/Ratings.test.js +20 -0
  51. package/dist/components/SlideToggle/SlideToggle.test.d.ts +1 -0
  52. package/dist/components/SlideToggle/SlideToggle.test.js +21 -0
  53. package/dist/components/Stepper/Step.test.d.ts +1 -0
  54. package/dist/components/Stepper/Step.test.js +21 -0
  55. package/dist/components/Stepper/Stepper.test.d.ts +1 -0
  56. package/dist/components/Stepper/Stepper.test.js +26 -0
  57. package/dist/components/Tab/Tab.test.d.ts +1 -0
  58. package/dist/components/Tab/Tab.test.js +30 -0
  59. package/dist/components/Tab/TabGroup.test.d.ts +1 -0
  60. package/dist/components/Tab/TabGroup.test.js +26 -0
  61. package/dist/components/Table/Table.svelte +3 -4
  62. package/dist/components/TreeView/RecursiveTreeViewItem.svelte +20 -19
  63. package/dist/components/TreeView/TreeView.test.d.ts +1 -0
  64. package/dist/components/TreeView/TreeView.test.js +28 -0
  65. package/dist/components/TreeView/TreeViewItem.svelte +9 -13
  66. package/dist/components/TreeView/TreeViewItem.test.d.ts +1 -0
  67. package/dist/components/TreeView/TreeViewItem.test.js +26 -0
  68. package/dist/utilities/CodeBlock/CodeBlock.test.d.ts +1 -0
  69. package/dist/utilities/CodeBlock/CodeBlock.test.js +24 -0
  70. package/dist/utilities/Drawer/Drawer.svelte +4 -3
  71. package/dist/utilities/Drawer/Drawer.test.d.ts +1 -0
  72. package/dist/utilities/Drawer/Drawer.test.js +13 -0
  73. package/dist/utilities/LightSwitch/LightSwitch.test.d.ts +1 -0
  74. package/dist/utilities/LightSwitch/LightSwitch.test.js +16 -0
  75. package/dist/utilities/Modal/Modal.test.d.ts +1 -0
  76. package/dist/utilities/Modal/Modal.test.js +39 -0
  77. package/dist/utilities/Modal/stores.d.ts +1 -1
  78. package/dist/utilities/Modal/stores.js +1 -1
  79. package/dist/utilities/Toast/Toast.test.d.ts +1 -0
  80. package/dist/utilities/Toast/Toast.test.js +23 -0
  81. package/package.json +1 -1
@@ -0,0 +1,24 @@
1
+ import { render } from '@testing-library/svelte';
2
+ import { describe, it, expect } from 'vitest';
3
+ import CodeBlock from './CodeBlock.svelte';
4
+ describe('CodeBlock.svelte', () => {
5
+ it('Renders with minimal props', async () => {
6
+ const { getByTestId } = render(CodeBlock, {
7
+ props: {
8
+ language: 'html',
9
+ code: '<p>Hello World</p>'
10
+ }
11
+ });
12
+ expect(getByTestId('codeblock')).toBeTruthy();
13
+ });
14
+ it('Renders with all props', async () => {
15
+ const { getByTestId } = render(CodeBlock, {
16
+ props: {
17
+ language: 'js',
18
+ code: `<div>Test</div>`,
19
+ background: 'bg-slate-800'
20
+ }
21
+ });
22
+ expect(getByTestId('codeblock')).toBeTruthy();
23
+ });
24
+ });
@@ -6,6 +6,7 @@ import { focusTrap } from "../../actions/FocusTrap/focusTrap.js";
6
6
  import { getDrawerStore } from "./stores.js";
7
7
  import { fade, fly } from "svelte/transition";
8
8
  import { dynamicTransition } from "../../internal/transitions.js";
9
+ import { cubicIn } from "svelte/easing";
9
10
  export let position = "left";
10
11
  export let bgDrawer = "bg-surface-100-800-token";
11
12
  export let border = "";
@@ -138,8 +139,8 @@ $:
138
139
  class="drawer-backdrop {classesBackdrop}"
139
140
  data-testid="drawer-backdrop"
140
141
  on:mousedown={onDrawerInteraction}
141
- on:touchstart
142
- on:touchend
142
+ on:touchstart|passive
143
+ on:touchend|passive
143
144
  on:keypress
144
145
  in:dynamicTransition|local={{
145
146
  transition: fade,
@@ -170,7 +171,7 @@ $:
170
171
  }}
171
172
  out:dynamicTransition|local={{
172
173
  transition: fly,
173
- params: { x: anim.x, y: anim.y, duration, opacity: opacityTransition ? undefined : 1 },
174
+ params: { x: anim.x, y: anim.y, duration, opacity: opacityTransition ? undefined : 1, easing: cubicIn },
174
175
  enabled: transitions
175
176
  }}
176
177
  >
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ // import { render } from '@testing-library/svelte';
2
+ import { describe, it } from 'vitest';
3
+ // import Drawer from './Drawer.svelte';
4
+ // import { drawerStore } from './stores.js';
5
+ describe('Drawer.svelte', () => {
6
+ it('Drawer hidden on load', async () => {
7
+ // const { getByTestId } = render(Drawer, {});
8
+ // FIXME: open drawer and verify elements exist
9
+ // drawerStore.open();
10
+ // expect(getByTestId('drawer-backdrop')).toBeFalsy();
11
+ // expect(getByTestId('drawer')).toBeFalsy();
12
+ });
13
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { render } from '@testing-library/svelte';
2
+ import { describe, it, expect } from 'vitest';
3
+ import LightSwitch from './LightSwitch.svelte';
4
+ describe.skip('LightSwitch.svelte', () => {
5
+ it('Renders', async () => {
6
+ const { getByTestId } = render(LightSwitch);
7
+ expect(getByTestId('menu-wrapper')).toBeTruthy();
8
+ });
9
+ /*
10
+ TODO: additional test cases:
11
+ - default render state
12
+ - click to toggle
13
+ - off = light, on = dark (L<-->D)
14
+ - etc.
15
+ */
16
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,39 @@
1
+ import { render } from '@testing-library/svelte';
2
+ import { describe, it, expect } from 'vitest';
3
+ import ModalTest from './ModalTest.svelte';
4
+ // Modal Payloads
5
+ const modalAlert = {
6
+ type: 'alert',
7
+ title: 'Welcome to Skeleton.',
8
+ body: 'This is a standard alert modal.'
9
+ };
10
+ const modalConfirm = {
11
+ type: 'confirm',
12
+ title: 'Please Confirm',
13
+ body: 'Are you sure you wish to proceed?',
14
+ response: (r) => console.log(r)
15
+ };
16
+ const modalPrompt = {
17
+ type: 'prompt',
18
+ title: 'Enter Name',
19
+ body: 'Provide your first name in the field below.',
20
+ value: 'foobar',
21
+ response: (r) => console.log(r)
22
+ };
23
+ describe('Modal.svelte', () => {
24
+ it('Renders modal alert', async () => {
25
+ const { getByTestId } = render(ModalTest, { props: { modalSetting: modalAlert } });
26
+ expect(getByTestId('modal-backdrop')).toBeTruthy();
27
+ expect(getByTestId('modal')).toBeTruthy();
28
+ });
29
+ it('Renders modal confirm', async () => {
30
+ const { getByTestId } = render(ModalTest, { props: { modalSetting: modalConfirm } });
31
+ expect(getByTestId('modal-backdrop')).toBeTruthy();
32
+ expect(getByTestId('modal')).toBeTruthy();
33
+ });
34
+ it('Renders modal prompt', async () => {
35
+ const { getByTestId } = render(ModalTest, { props: { modalSetting: modalPrompt } });
36
+ expect(getByTestId('modal-backdrop')).toBeTruthy();
37
+ expect(getByTestId('modal')).toBeTruthy();
38
+ });
39
+ });
@@ -8,7 +8,7 @@ import type { ModalSettings } from './types.js';
8
8
  * @example
9
9
  * ```svelte
10
10
  * <script>
11
- * import { getmodalStore } from "@skeletonlabs/skeleton";
11
+ * import { getModalStore } from "@skeletonlabs/skeleton";
12
12
  *
13
13
  * const modalStore = getModalStore();
14
14
  *
@@ -10,7 +10,7 @@ const MODAL_STORE_KEY = 'modalStore';
10
10
  * @example
11
11
  * ```svelte
12
12
  * <script>
13
- * import { getmodalStore } from "@skeletonlabs/skeleton";
13
+ * import { getModalStore } from "@skeletonlabs/skeleton";
14
14
  *
15
15
  * const modalStore = getModalStore();
16
16
  *
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { render } from '@testing-library/svelte';
2
+ import { describe, it, expect } from 'vitest';
3
+ import ToastTest from './ToastTest.svelte';
4
+ // Toast Payload
5
+ const toastMessage = {
6
+ message: 'Your Message Here',
7
+ autohide: true,
8
+ timeout: 5000,
9
+ action: {
10
+ label: 'Greeting',
11
+ response: () => alert('Hello, Skeleton')
12
+ }
13
+ };
14
+ describe('Toast.svelte', () => {
15
+ it('Renders modal alert', async () => {
16
+ const { getByTestId } = render(ToastTest, { props: { toastSettings: [toastMessage] } });
17
+ expect(getByTestId('toast')).toBeTruthy();
18
+ });
19
+ it('Renders only the configured max toasts at a time', async () => {
20
+ const { getAllByTestId } = render(ToastTest, { props: { max: 1, toastSettings: [{ message: '1' }, { message: '2' }] } });
21
+ expect(getAllByTestId('toast').length).toBe(1);
22
+ });
23
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonlabs/skeleton",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "A SvelteKit component library.",
5
5
  "author": "endigo9740 <chris@skeletonlabs.dev>",
6
6
  "repository": {