tera-system-ui 0.0.20 → 0.0.22

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 (91) hide show
  1. package/dist/components/avatar/Avatar.d.ts +82 -0
  2. package/dist/components/avatar/Avatar.js +35 -0
  3. package/dist/components/avatar/Avatar.svelte +43 -0
  4. package/dist/components/avatar/Avatar.svelte.d.ts +3 -0
  5. package/dist/components/avatar/index.d.ts +1 -0
  6. package/dist/components/avatar/index.js +1 -0
  7. package/dist/components/brand-logo/BrandLogo.svelte +31 -31
  8. package/dist/components/button/Button.svelte +49 -49
  9. package/dist/components/combobox/Combobox.svelte +8 -8
  10. package/dist/components/command/command.scss +72 -72
  11. package/dist/components/command/components/Command.svelte +120 -120
  12. package/dist/components/command/components/CommandEmpty.svelte +30 -30
  13. package/dist/components/command/components/CommandGroup.svelte +110 -110
  14. package/dist/components/command/components/CommandInput.svelte +92 -92
  15. package/dist/components/command/components/CommandItem.svelte +110 -110
  16. package/dist/components/command/components/CommandList.svelte +56 -56
  17. package/dist/components/command/components/CommandLoading.svelte +28 -28
  18. package/dist/components/command/components/CommandSeparator.svelte +21 -21
  19. package/dist/components/dialog/Dialog.astro +63 -63
  20. package/dist/components/dialog/Dialog.svelte +109 -109
  21. package/dist/components/dialog/dialog.scss +115 -115
  22. package/dist/components/dropdown-menu/DropdownMenu.d.ts +22 -0
  23. package/dist/components/dropdown-menu/DropdownMenu.js +15 -0
  24. package/dist/components/dropdown-menu/components/DropdownMenu.svelte +34 -0
  25. package/dist/components/dropdown-menu/components/DropdownMenu.svelte.d.ts +3 -0
  26. package/dist/components/dropdown-menu/components/DropdownMenuGroup.svelte +12 -0
  27. package/dist/components/dropdown-menu/components/DropdownMenuGroup.svelte.d.ts +5 -0
  28. package/dist/components/dropdown-menu/components/DropdownMenuHeader.svelte +12 -0
  29. package/dist/components/dropdown-menu/components/DropdownMenuHeader.svelte.d.ts +5 -0
  30. package/dist/components/dropdown-menu/components/DropdownMenuItem.svelte +30 -0
  31. package/dist/components/dropdown-menu/components/DropdownMenuItem.svelte.d.ts +3 -0
  32. package/dist/components/dropdown-menu/components/DropdownMenuSeparator.svelte +11 -0
  33. package/dist/components/dropdown-menu/components/DropdownMenuSeparator.svelte.d.ts +5 -0
  34. package/dist/components/dropdown-menu/index.d.ts +5 -0
  35. package/dist/components/dropdown-menu/index.js +5 -0
  36. package/dist/components/header/Header.svelte +36 -36
  37. package/dist/components/header/header.scss +19 -19
  38. package/dist/components/icons/IconArrowBigRightFilled.svelte +10 -10
  39. package/dist/components/icons/IconBook.svelte +10 -10
  40. package/dist/components/icons/IconBookmarkPlus.svelte +10 -10
  41. package/dist/components/icons/IconCalculator.svelte +10 -10
  42. package/dist/components/icons/IconCheck.svelte +10 -10
  43. package/dist/components/icons/IconChevronDown.svelte +10 -10
  44. package/dist/components/icons/IconCopy.svelte +10 -10
  45. package/dist/components/icons/IconCopyCheckFilled.svelte +10 -10
  46. package/dist/components/icons/IconHamburger.svelte +10 -10
  47. package/dist/components/icons/IconLanguage.svelte +10 -10
  48. package/dist/components/icons/IconLoader2.svelte +10 -10
  49. package/dist/components/icons/IconLogout.svelte +10 -0
  50. package/dist/components/icons/IconLogout.svelte.d.ts +4 -0
  51. package/dist/components/icons/IconMoon.svelte +10 -10
  52. package/dist/components/icons/IconPointFilled.svelte +10 -10
  53. package/dist/components/icons/IconSearch.svelte +10 -10
  54. package/dist/components/icons/IconSettings.svelte +10 -0
  55. package/dist/components/icons/IconSettings.svelte.d.ts +4 -0
  56. package/dist/components/icons/IconSun.svelte +10 -10
  57. package/dist/components/icons/IconSwitchHorizontal.svelte +10 -10
  58. package/dist/components/icons/IconSwitchVertical.svelte +10 -10
  59. package/dist/components/icons/IconTransform.svelte +10 -10
  60. package/dist/components/icons/IconX.svelte +10 -10
  61. package/dist/components/icons/index.d.ts +2 -0
  62. package/dist/components/icons/index.js +2 -0
  63. package/dist/components/input/Input.svelte +24 -24
  64. package/dist/components/language-picker-button/LanguagePickerButton.svelte +109 -109
  65. package/dist/components/light-dark-toggle/LightDarkToggle.svelte +36 -36
  66. package/dist/components/popover/Popover.svelte +159 -137
  67. package/dist/components/popover-responsive/PopoverResponsive.svelte +87 -87
  68. package/dist/components/side-navigation/SideNavigation.svelte +114 -114
  69. package/dist/components/side-navigation/SideNavigationItem.svelte +17 -17
  70. package/dist/components/side-navigation/SideNavigationLayout.svelte +19 -19
  71. package/dist/components/side-navigation/sidenav.scss +149 -149
  72. package/dist/components/tera-ui-context/TeraUiContext.d.ts +1 -0
  73. package/dist/components/tera-ui-context/TeraUiContext.svelte +28 -28
  74. package/dist/components/user-avatar-with-menu/UserAvatarWithMenu.d.ts +11 -0
  75. package/dist/components/user-avatar-with-menu/UserAvatarWithMenu.js +7 -0
  76. package/dist/components/user-avatar-with-menu/UserAvatarWithMenu.svelte +68 -0
  77. package/dist/components/user-avatar-with-menu/UserAvatarWithMenu.svelte.d.ts +3 -0
  78. package/dist/components/user-avatar-with-menu/index.d.ts +1 -0
  79. package/dist/components/user-avatar-with-menu/index.js +1 -0
  80. package/dist/index.d.ts +4 -1
  81. package/dist/index.js +4 -1
  82. package/dist/internal/service/user.service.d.ts +2 -0
  83. package/dist/internal/service/user.service.js +20 -0
  84. package/dist/themes/scrollbar.scss +37 -37
  85. package/dist/themes/tera-ui-base.css +210 -210
  86. package/dist/themes/tw-preset.cjs +153 -153
  87. package/dist/types/user-data.d.ts +31 -0
  88. package/dist/types/user-data.js +1 -0
  89. package/package.json +98 -96
  90. package/scripts/add-component-template.js +120 -120
  91. package/scripts/generate-ts-index.js +138 -136
@@ -1,93 +1,93 @@
1
- <script lang="ts">
2
- import {derived, get} from 'svelte/store';
3
- import {getCtx, getState, ITEM_SELECTOR, VALUE_ATTR} from '../command.js';
4
- import {isBrowser} from '../../../internal/index.js';
5
- import type {InputEvents, InputProps} from '../types.js';
6
- import {sleep} from '../../../internal/helpers/sleep.js';
7
- import {styles} from "../../input/Input";
8
- import {IconSearch} from "../../..";
9
-
10
- type $$Props = InputProps;
11
- type $$Events = InputEvents;
12
-
13
- const {ids, commandEl} = getCtx();
14
- const commandState = getState();
15
-
16
- const valueStore = derived(commandState, ($commandState) => $commandState.value);
17
-
18
- let {
19
- autofocus = undefined,
20
- value = $bindable(),
21
- el,
22
- class: className,
23
- ...restProps
24
- }: $$Props & {
25
- el?: HTMLElement
26
- } = $props()
27
-
28
-
29
- const selectedItemId = derived([valueStore, commandEl], ([$value, $commandEl]) => {
30
- if (!isBrowser) return undefined;
31
- const item = $commandEl?.querySelector(`${ITEM_SELECTOR}[${VALUE_ATTR}="${$value}"]`);
32
- return item?.getAttribute('id');
33
- });
34
-
35
- function handleValueUpdate(v: string) {
36
- commandState.updateState('search', v);
37
- }
38
-
39
- function action(node: HTMLInputElement) {
40
- if (autofocus) {
41
- sleep(200).then(() => {
42
- node.focus()
43
- console.log('CommandInput autofocus')
44
- });
45
- }
46
- }
47
-
48
- let attrs = $state<Record<string, unknown>>()
49
-
50
- $effect(() => {
51
- attrs = {
52
- type: 'text',
53
- 'data-cmdk-input': '',
54
- autocomplete: 'off',
55
- autocorrect: 'off',
56
- spellcheck: false,
57
- 'aria-autocomplete': 'list',
58
- role: 'combobox',
59
- 'aria-expanded': true,
60
- 'aria-controls': ids.list,
61
- 'aria-labelledby': ids.label,
62
- 'aria-activedescendant': $selectedItemId ?? undefined,
63
- id: ids.input
64
- };
65
- })
66
-
67
- $effect(() => {
68
- return () => {
69
- value = ''
70
- }
71
- })
72
- </script>
73
-
74
- <div class="relative">
75
- <input
76
- class={styles({
77
- variant: 'borderless',
78
- size: 'lg',
79
- class: className + ' pl-9 border-b border-b-neutral-token-5 rounded-none text-sm',
80
- })}
81
- bind:this={el}
82
- {...attrs}
83
- bind:value={value}
84
- use:action
85
- {...restProps}
86
- onkeydown={() => {}}
87
- oninput={() => {handleValueUpdate(value)}}
88
- onfocus={() => {}}
89
- onblur={() => {}}
90
- onchange={() => {}}
91
- />
92
- <IconSearch class="absolute top-1/2 left-2 -translate-y-1/2 size-icon-xs opacity-60"/>
1
+ <script lang="ts">
2
+ import {derived, get} from 'svelte/store';
3
+ import {getCtx, getState, ITEM_SELECTOR, VALUE_ATTR} from '../command.js';
4
+ import {isBrowser} from '../../../internal/index.js';
5
+ import type {InputEvents, InputProps} from '../types.js';
6
+ import {sleep} from '../../../internal/helpers/sleep.js';
7
+ import {styles} from "../../input/Input";
8
+ import {IconSearch} from "../../..";
9
+
10
+ type $$Props = InputProps;
11
+ type $$Events = InputEvents;
12
+
13
+ const {ids, commandEl} = getCtx();
14
+ const commandState = getState();
15
+
16
+ const valueStore = derived(commandState, ($commandState) => $commandState.value);
17
+
18
+ let {
19
+ autofocus = undefined,
20
+ value = $bindable(),
21
+ el,
22
+ class: className,
23
+ ...restProps
24
+ }: $$Props & {
25
+ el?: HTMLElement,
26
+ } = $props()
27
+
28
+
29
+ const selectedItemId = derived([valueStore, commandEl], ([$value, $commandEl]) => {
30
+ if (!isBrowser) return undefined;
31
+ const item = $commandEl?.querySelector(`${ITEM_SELECTOR}[${VALUE_ATTR}="${$value}"]`);
32
+ return item?.getAttribute('id');
33
+ });
34
+
35
+ function handleValueUpdate(v: string) {
36
+ commandState.updateState('search', v);
37
+ }
38
+
39
+ function action(node: HTMLInputElement) {
40
+ if (autofocus) {
41
+ sleep(200).then(() => {
42
+ node.focus()
43
+ console.log('CommandInput autofocus')
44
+ });
45
+ }
46
+ }
47
+
48
+ let attrs = $state<Record<string, unknown>>()
49
+
50
+ $effect(() => {
51
+ attrs = {
52
+ type: 'text',
53
+ 'data-cmdk-input': '',
54
+ autocomplete: 'off',
55
+ autocorrect: 'off',
56
+ spellcheck: false,
57
+ 'aria-autocomplete': 'list',
58
+ role: 'combobox',
59
+ 'aria-expanded': true,
60
+ 'aria-controls': ids.list,
61
+ 'aria-labelledby': ids.label,
62
+ 'aria-activedescendant': $selectedItemId ?? undefined,
63
+ id: ids.input
64
+ };
65
+ })
66
+
67
+ $effect(() => {
68
+ return () => {
69
+ value = ''
70
+ }
71
+ })
72
+ </script>
73
+
74
+ <div class="relative">
75
+ <input
76
+ class={styles({
77
+ variant: 'borderless',
78
+ size: 'lg',
79
+ class: className + ' pl-9 border-b border-b-neutral-token-5 rounded-none text-sm',
80
+ })}
81
+ bind:this={el}
82
+ {...attrs}
83
+ bind:value={value}
84
+ use:action
85
+ {...restProps}
86
+ onkeydown={() => {}}
87
+ oninput={() => {handleValueUpdate(value)}}
88
+ onfocus={() => {}}
89
+ onblur={() => {}}
90
+ onchange={() => {}}
91
+ />
92
+ <IconSearch class="absolute top-1/2 left-2 -translate-y-1/2 size-icon-xs opacity-60"/>
93
93
  </div>
@@ -1,110 +1,110 @@
1
- <script lang="ts">
2
- import {addEventListener, executeCallbacks, generateId, isUndefined} from '../../../internal/index.js';
3
- import {getCtx, getGroup, getState, VALUE_ATTR} from '../command.js';
4
- import type {ItemProps} from '../types.js';
5
- import {derived} from 'svelte/store';
6
- import {onMount} from "svelte";
7
-
8
- type $$Props = ItemProps
9
- let {
10
- children,
11
- childrenWithProps,
12
- id = generateId(),
13
- alwaysRender = false,
14
- onSelect,
15
- value = '',
16
- disabled = false,
17
- ...restProps
18
- }: $$Props = $props()
19
-
20
- const groupContext = getGroup();
21
- const context = getCtx();
22
- const commandState = getState();
23
-
24
- const trueAlwaysRender = alwaysRender ?? groupContext?.alwaysRender;
25
-
26
- const render = derived(commandState, ($state) => {
27
- if (trueAlwaysRender || context.filter() === false || !$commandState.search) return true;
28
- const currentScore = $commandState.filtered.items.get(id);
29
- if (isUndefined(currentScore)) return false;
30
- return currentScore > 0;
31
- });
32
-
33
- const selected = derived(commandState, ($state) => $commandState.value === value);
34
-
35
- let isFirstRender = $state(true);
36
-
37
-
38
- let attrs = derived(selected, ($selected) => (
39
- {
40
- 'aria-disabled': disabled ? true : undefined,
41
- 'data-disabled': disabled ? true : undefined,
42
- 'aria-selected': $selected ? true : undefined,
43
- 'data-selected': $selected ? true : undefined,
44
- 'data-cmdk-item': '',
45
- 'data-value': value,
46
- role: 'option',
47
- id
48
- }
49
- ));
50
-
51
- onMount(() => {
52
- isFirstRender = false;
53
- })
54
-
55
-
56
- onMount(() => {
57
- let unsub
58
- unsub = context.item(id, groupContext?.id);
59
- return unsub;
60
- })
61
-
62
-
63
- function action(node: HTMLElement) {
64
- if (!value && node.textContent) {
65
- value = node.textContent.trim().toLowerCase();
66
- }
67
- context.value(id, value);
68
- node.setAttribute(VALUE_ATTR, value);
69
-
70
- const unsubEvents = executeCallbacks(
71
- addEventListener(node, 'pointerenter', () => {
72
- if (disabled) return;
73
- select();
74
- }),
75
- addEventListener(node, 'click', () => {
76
- if (disabled) return;
77
- handleItemClick();
78
- })
79
- );
80
-
81
- return {
82
- destroy() {
83
- unsubEvents();
84
- }
85
- };
86
- }
87
-
88
- function handleItemClick() {
89
- select();
90
- onSelect?.(value);
91
- }
92
-
93
- function select() {
94
- commandState.updateState('value', value, true);
95
- }
96
-
97
- </script>
98
-
99
- {#if $render || isFirstRender}
100
- <div {...$attrs} use:action {...restProps}>
101
- <!--{@render childrenWithProps?.(-->
102
- <!-- {-->
103
- <!-- attrs: attrs,-->
104
- <!-- action: action-->
105
- <!-- }-->
106
- <!--)-->
107
- <!--}-->
108
- {@render children?.()}
109
- </div>
110
- {/if}
1
+ <script lang="ts">
2
+ import {addEventListener, executeCallbacks, generateId, isUndefined} from '../../../internal/index.js';
3
+ import {getCtx, getGroup, getState, VALUE_ATTR} from '../command.js';
4
+ import type {ItemProps} from '../types.js';
5
+ import {derived} from 'svelte/store';
6
+ import {onMount} from "svelte";
7
+
8
+ type $$Props = ItemProps
9
+ let {
10
+ children,
11
+ childrenWithProps,
12
+ id = generateId(),
13
+ alwaysRender = false,
14
+ onSelect,
15
+ value = '',
16
+ disabled = false,
17
+ ...restProps
18
+ }: $$Props = $props()
19
+
20
+ const groupContext = getGroup();
21
+ const context = getCtx();
22
+ const commandState = getState();
23
+
24
+ const trueAlwaysRender = alwaysRender ?? groupContext?.alwaysRender;
25
+
26
+ const render = derived(commandState, ($state) => {
27
+ if (trueAlwaysRender || context.filter() === false || !$commandState.search) return true;
28
+ const currentScore = $commandState.filtered.items.get(id);
29
+ if (isUndefined(currentScore)) return false;
30
+ return currentScore > 0;
31
+ });
32
+
33
+ const selected = derived(commandState, ($state) => $commandState.value === value);
34
+
35
+ let isFirstRender = $state(true);
36
+
37
+
38
+ let attrs = derived(selected, ($selected) => (
39
+ {
40
+ 'aria-disabled': disabled ? true : undefined,
41
+ 'data-disabled': disabled ? true : undefined,
42
+ 'aria-selected': $selected ? true : undefined,
43
+ 'data-selected': $selected ? true : undefined,
44
+ 'data-cmdk-item': '',
45
+ 'data-value': value,
46
+ role: 'option',
47
+ id
48
+ }
49
+ ));
50
+
51
+ onMount(() => {
52
+ isFirstRender = false;
53
+ })
54
+
55
+
56
+ onMount(() => {
57
+ let unsub
58
+ unsub = context.item(id, groupContext?.id);
59
+ return unsub;
60
+ })
61
+
62
+
63
+ function action(node: HTMLElement) {
64
+ if (!value && node.textContent) {
65
+ value = node.textContent.trim().toLowerCase();
66
+ }
67
+ context.value(id, value);
68
+ node.setAttribute(VALUE_ATTR, value);
69
+
70
+ const unsubEvents = executeCallbacks(
71
+ addEventListener(node, 'pointerenter', () => {
72
+ if (disabled) return;
73
+ select();
74
+ }),
75
+ addEventListener(node, 'click', () => {
76
+ if (disabled) return;
77
+ handleItemClick();
78
+ })
79
+ );
80
+
81
+ return {
82
+ destroy() {
83
+ unsubEvents();
84
+ }
85
+ };
86
+ }
87
+
88
+ function handleItemClick() {
89
+ select();
90
+ onSelect?.(value);
91
+ }
92
+
93
+ function select() {
94
+ commandState.updateState('value', value, true);
95
+ }
96
+
97
+ </script>
98
+
99
+ {#if $render || isFirstRender}
100
+ <div {...$attrs} use:action {...restProps}>
101
+ <!--{@render childrenWithProps?.(-->
102
+ <!-- {-->
103
+ <!-- attrs: attrs,-->
104
+ <!-- action: action-->
105
+ <!-- }-->
106
+ <!--)-->
107
+ <!--}-->
108
+ {@render children?.()}
109
+ </div>
110
+ {/if}
@@ -1,56 +1,56 @@
1
- <script lang="ts">
2
- import {isHTMLElement} from '../../../internal/index.js';
3
- import {getCtx, getState} from '../command.js';
4
- import type {ListProps} from '../types.js';
5
-
6
- const {ids} = getCtx();
7
- const commandState = getState();
8
-
9
- type $$Props = ListProps;
10
-
11
- let {children, el, ...restProps} = $props()
12
-
13
- function sizerAction(node: HTMLElement) {
14
- let animationFrame: number;
15
- const listEl = node.closest('[data-cmdk-list]');
16
- if (!isHTMLElement(listEl)) {
17
- return;
18
- }
19
-
20
- const observer = new ResizeObserver(() => {
21
- animationFrame = requestAnimationFrame(() => {
22
- const height = node.offsetHeight;
23
- listEl.style.setProperty('--cmdk-list-height', height.toFixed(1) + 'px');
24
- });
25
- });
26
-
27
- observer.observe(node);
28
- return {
29
- destroy() {
30
- cancelAnimationFrame(animationFrame);
31
- observer.unobserve(node);
32
- }
33
- };
34
- }
35
-
36
- const listAttrs = {
37
- 'data-cmdk-list': '',
38
- role: 'listbox',
39
- 'aria-label': 'Suggestions',
40
- id: ids.list,
41
- 'aria-labelledby': ids.input
42
- };
43
-
44
- const sizerAttrs = {
45
- 'data-cmdk-list-sizer': ''
46
- };
47
-
48
- </script>
49
-
50
- <div {...listAttrs} bind:this={el} {...restProps}>
51
- <div {...sizerAttrs} use:sizerAction>
52
- {#key $commandState.search === ''}
53
- {@render children()}
54
- {/key}
55
- </div>
56
- </div>
1
+ <script lang="ts">
2
+ import {isHTMLElement} from '../../../internal/index.js';
3
+ import {getCtx, getState} from '../command.js';
4
+ import type {ListProps} from '../types.js';
5
+
6
+ const {ids} = getCtx();
7
+ const commandState = getState();
8
+
9
+ type $$Props = ListProps;
10
+
11
+ let {children, el, ...restProps} = $props()
12
+
13
+ function sizerAction(node: HTMLElement) {
14
+ let animationFrame: number;
15
+ const listEl = node.closest('[data-cmdk-list]');
16
+ if (!isHTMLElement(listEl)) {
17
+ return;
18
+ }
19
+
20
+ const observer = new ResizeObserver(() => {
21
+ animationFrame = requestAnimationFrame(() => {
22
+ const height = node.offsetHeight;
23
+ listEl.style.setProperty('--cmdk-list-height', height.toFixed(1) + 'px');
24
+ });
25
+ });
26
+
27
+ observer.observe(node);
28
+ return {
29
+ destroy() {
30
+ cancelAnimationFrame(animationFrame);
31
+ observer.unobserve(node);
32
+ }
33
+ };
34
+ }
35
+
36
+ const listAttrs = {
37
+ 'data-cmdk-list': '',
38
+ role: 'listbox',
39
+ 'aria-label': 'Suggestions',
40
+ id: ids.list,
41
+ 'aria-labelledby': ids.input
42
+ };
43
+
44
+ const sizerAttrs = {
45
+ 'data-cmdk-list-sizer': ''
46
+ };
47
+
48
+ </script>
49
+
50
+ <div {...listAttrs} bind:this={el} {...restProps}>
51
+ <div {...sizerAttrs} use:sizerAction>
52
+ {#key $commandState.search === ''}
53
+ {@render children()}
54
+ {/key}
55
+ </div>
56
+ </div>
@@ -1,29 +1,29 @@
1
- <script lang="ts">
2
- import type { LoadingProps } from '../types.js';
3
- import type {Snippet} from "svelte";
4
-
5
- type $$Props = LoadingProps;
6
-
7
- let {childrenWithProps, progress, ...restProps} : $$Props & {
8
- childrenWithProps: Snippet<[any]>
9
- } = $props()
10
-
11
- let attrs = $state<any>()
12
-
13
- $effect(() => {
14
- attrs = {
15
- 'data-cmdk-loading': '',
16
- role: 'progressbar',
17
- 'aria-valuenow': progress,
18
- 'aria-valuemin': 0,
19
- 'aria-valuemax': 100,
20
- 'aria-label': 'Loading...'
21
- };
22
- })
23
- </script>
24
-
25
- <div {...attrs} {...restProps}>
26
- <div aria-hidden>
27
- {@render childrenWithProps(attrs)}
28
- </div>
1
+ <script lang="ts">
2
+ import type { LoadingProps } from '../types.js';
3
+ import type {Snippet} from "svelte";
4
+
5
+ type $$Props = LoadingProps;
6
+
7
+ let {childrenWithProps, progress, ...restProps} : $$Props & {
8
+ childrenWithProps: Snippet<[any]>
9
+ } = $props()
10
+
11
+ let attrs = $state<any>()
12
+
13
+ $effect(() => {
14
+ attrs = {
15
+ 'data-cmdk-loading': '',
16
+ role: 'progressbar',
17
+ 'aria-valuenow': progress,
18
+ 'aria-valuemin': 0,
19
+ 'aria-valuemax': 100,
20
+ 'aria-label': 'Loading...'
21
+ };
22
+ })
23
+ </script>
24
+
25
+ <div {...attrs} {...restProps}>
26
+ <div aria-hidden>
27
+ {@render childrenWithProps(attrs)}
28
+ </div>
29
29
  </div>
@@ -1,21 +1,21 @@
1
- <script lang="ts">
2
- import { derived } from 'svelte/store';
3
- import { getState } from '../command.js';
4
- import type { SeparatorProps } from '../types.js';
5
-
6
- type $$Props = SeparatorProps;
7
-
8
- let {alwaysRender,...restProps} :$$Props= $props()
9
-
10
- const commandState = getState();
11
- const render = derived(commandState, ($state) => !$commandState.search);
12
-
13
- const attrs = {
14
- 'data-cmdk-separator': '',
15
- role: 'separator'
16
- };
17
- </script>
18
-
19
- {#if $render || alwaysRender}
20
- <div {...attrs} {...restProps}></div>
21
- {/if}
1
+ <script lang="ts">
2
+ import { derived } from 'svelte/store';
3
+ import { getState } from '../command.js';
4
+ import type { SeparatorProps } from '../types.js';
5
+
6
+ type $$Props = SeparatorProps;
7
+
8
+ let {alwaysRender,...restProps} :$$Props= $props()
9
+
10
+ const commandState = getState();
11
+ const render = derived(commandState, ($state) => !$commandState.search);
12
+
13
+ const attrs = {
14
+ 'data-cmdk-separator': '',
15
+ role: 'separator'
16
+ };
17
+ </script>
18
+
19
+ {#if $render || alwaysRender}
20
+ <div {...attrs} {...restProps}></div>
21
+ {/if}