@x33025/sveltely 0.0.23 → 0.0.24
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.
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/style.css +2 -18
- package/package.json +1 -1
- package/dist/components/TabView/Tab.svelte +0 -52
- package/dist/components/TabView/Tab.svelte.d.ts +0 -11
- package/dist/components/TabView/TabPanel.svelte +0 -32
- package/dist/components/TabView/TabPanel.svelte.d.ts +0 -9
- package/dist/components/TabView/TabView.svelte +0 -38
- package/dist/components/TabView/TabView.svelte.d.ts +0 -10
- package/dist/components/TabView/index.d.ts +0 -8
- package/dist/components/TabView/index.js +0 -7
package/dist/index.d.ts
CHANGED
|
@@ -10,4 +10,3 @@ export { default as Spinner } from './components/Spinner.svelte';
|
|
|
10
10
|
export { default as TextShimmer } from './components/TextShimmer.svelte';
|
|
11
11
|
export { default as Tooltip } from './components/Tooltip.svelte';
|
|
12
12
|
export { default as Dropdown } from './components/Dropdown';
|
|
13
|
-
export { default as TabView } from './components/TabView';
|
package/dist/index.js
CHANGED
|
@@ -10,4 +10,3 @@ export { default as Spinner } from './components/Spinner.svelte';
|
|
|
10
10
|
export { default as TextShimmer } from './components/TextShimmer.svelte';
|
|
11
11
|
export { default as Tooltip } from './components/Tooltip.svelte';
|
|
12
12
|
export { default as Dropdown } from './components/Dropdown';
|
|
13
|
-
export { default as TabView } from './components/TabView';
|
package/dist/style.css
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
"Courier New", monospace;
|
|
10
10
|
--color-gray-100: oklch(96.7% 0.003 264.542);
|
|
11
11
|
--color-gray-200: oklch(92.8% 0.006 264.531);
|
|
12
|
-
--color-gray-500: oklch(55.1% 0.027 264.364);
|
|
13
12
|
--color-gray-700: oklch(37.3% 0.034 259.733);
|
|
14
13
|
--color-gray-900: oklch(21% 0.034 264.665);
|
|
15
14
|
--color-zinc-50: oklch(98.5% 0 0);
|
|
@@ -23,8 +22,6 @@
|
|
|
23
22
|
--color-black: #000;
|
|
24
23
|
--color-white: #fff;
|
|
25
24
|
--spacing: 0.25rem;
|
|
26
|
-
--text-xs: 0.75rem;
|
|
27
|
-
--text-xs--line-height: calc(1 / 0.75);
|
|
28
25
|
--text-sm: 0.875rem;
|
|
29
26
|
--text-sm--line-height: calc(1.25 / 0.875);
|
|
30
27
|
--font-weight-medium: 500;
|
|
@@ -224,8 +221,8 @@
|
|
|
224
221
|
.z-50 {
|
|
225
222
|
z-index: 50;
|
|
226
223
|
}
|
|
227
|
-
.
|
|
228
|
-
margin-
|
|
224
|
+
.mt-2 {
|
|
225
|
+
margin-top: calc(var(--spacing) * 2);
|
|
229
226
|
}
|
|
230
227
|
.block {
|
|
231
228
|
display: block;
|
|
@@ -343,9 +340,6 @@
|
|
|
343
340
|
.border-zinc-200 {
|
|
344
341
|
border-color: var(--color-zinc-200);
|
|
345
342
|
}
|
|
346
|
-
.bg-gray-100 {
|
|
347
|
-
background-color: var(--color-gray-100);
|
|
348
|
-
}
|
|
349
343
|
.bg-white {
|
|
350
344
|
background-color: var(--color-white);
|
|
351
345
|
}
|
|
@@ -383,10 +377,6 @@
|
|
|
383
377
|
font-size: var(--text-sm);
|
|
384
378
|
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
385
379
|
}
|
|
386
|
-
.text-xs {
|
|
387
|
-
font-size: var(--text-xs);
|
|
388
|
-
line-height: var(--tw-leading, var(--text-xs--line-height));
|
|
389
|
-
}
|
|
390
380
|
.font-medium {
|
|
391
381
|
--tw-font-weight: var(--font-weight-medium);
|
|
392
382
|
font-weight: var(--font-weight-medium);
|
|
@@ -399,15 +389,9 @@
|
|
|
399
389
|
--tw-tracking: var(--tracking-wide);
|
|
400
390
|
letter-spacing: var(--tracking-wide);
|
|
401
391
|
}
|
|
402
|
-
.text-gray-500 {
|
|
403
|
-
color: var(--color-gray-500);
|
|
404
|
-
}
|
|
405
392
|
.text-gray-700 {
|
|
406
393
|
color: var(--color-gray-700);
|
|
407
394
|
}
|
|
408
|
-
.text-gray-900 {
|
|
409
|
-
color: var(--color-gray-900);
|
|
410
|
-
}
|
|
411
395
|
.text-zinc-500 {
|
|
412
396
|
color: var(--color-zinc-500);
|
|
413
397
|
}
|
package/package.json
CHANGED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { getContext } from 'svelte';
|
|
3
|
-
import type { Snippet } from 'svelte';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
value: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
class?: string;
|
|
9
|
-
activeClass?: string;
|
|
10
|
-
children?: Snippet;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
let {
|
|
14
|
-
value,
|
|
15
|
-
disabled = false,
|
|
16
|
-
class: className = '',
|
|
17
|
-
activeClass = '',
|
|
18
|
-
children
|
|
19
|
-
}: Props = $props();
|
|
20
|
-
|
|
21
|
-
const context = getContext<{
|
|
22
|
-
active: string;
|
|
23
|
-
setActive: (value: string) => void;
|
|
24
|
-
registerTab?: (value: string) => void;
|
|
25
|
-
}>('tabView');
|
|
26
|
-
|
|
27
|
-
const isActive = $derived(context.active === value);
|
|
28
|
-
|
|
29
|
-
$effect(() => {
|
|
30
|
-
context.registerTab?.(value);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
function handleClick() {
|
|
34
|
-
if (disabled) return;
|
|
35
|
-
context.setActive(value);
|
|
36
|
-
}
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<button
|
|
40
|
-
id={'tab-' + value}
|
|
41
|
-
type="button"
|
|
42
|
-
role="tab"
|
|
43
|
-
aria-selected={isActive}
|
|
44
|
-
aria-controls={'panel-' + value}
|
|
45
|
-
{disabled}
|
|
46
|
-
class="{className} {isActive ? activeClass : ''}"
|
|
47
|
-
onclick={handleClick}
|
|
48
|
-
>
|
|
49
|
-
{#if children}
|
|
50
|
-
{@render children()}
|
|
51
|
-
{/if}
|
|
52
|
-
</button>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
interface Props {
|
|
3
|
-
value: string;
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
class?: string;
|
|
6
|
-
activeClass?: string;
|
|
7
|
-
children?: Snippet;
|
|
8
|
-
}
|
|
9
|
-
declare const Tab: import("svelte").Component<Props, {}, "">;
|
|
10
|
-
type Tab = ReturnType<typeof Tab>;
|
|
11
|
-
export default Tab;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { getContext } from 'svelte';
|
|
3
|
-
import type { Snippet } from 'svelte';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
value: string;
|
|
7
|
-
class?: string;
|
|
8
|
-
children?: Snippet;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let { value, class: className = '', children }: Props = $props();
|
|
12
|
-
|
|
13
|
-
const context = getContext<{
|
|
14
|
-
active: string;
|
|
15
|
-
setActive: (value: string) => void;
|
|
16
|
-
}>('tabView');
|
|
17
|
-
|
|
18
|
-
const isActive = $derived(context.active === value);
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
{#if isActive}
|
|
22
|
-
<div
|
|
23
|
-
id={"panel-" + value}
|
|
24
|
-
role="tabpanel"
|
|
25
|
-
aria-labelledby={"tab-" + value}
|
|
26
|
-
class={className}
|
|
27
|
-
>
|
|
28
|
-
{#if children}
|
|
29
|
-
{@render children()}
|
|
30
|
-
{/if}
|
|
31
|
-
</div>
|
|
32
|
-
{/if}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { setContext } from 'svelte';
|
|
3
|
-
import type { Snippet } from 'svelte';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
active: string;
|
|
7
|
-
onChange?: (value: string) => void;
|
|
8
|
-
tabs?: Snippet;
|
|
9
|
-
panels?: Snippet;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
let { active = $bindable(), onChange, tabs, panels }: Props = $props();
|
|
13
|
-
|
|
14
|
-
function setActive(value: string) {
|
|
15
|
-
if (active === value) return;
|
|
16
|
-
active = value;
|
|
17
|
-
onChange?.(value);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
setContext('tabView', {
|
|
21
|
-
get active() {
|
|
22
|
-
return active;
|
|
23
|
-
},
|
|
24
|
-
setActive
|
|
25
|
-
});
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
{#if tabs}
|
|
29
|
-
<div role="tablist">
|
|
30
|
-
{@render tabs()}
|
|
31
|
-
</div>
|
|
32
|
-
{/if}
|
|
33
|
-
|
|
34
|
-
{#if panels}
|
|
35
|
-
<div>
|
|
36
|
-
{@render panels()}
|
|
37
|
-
</div>
|
|
38
|
-
{/if}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
interface Props {
|
|
3
|
-
active: string;
|
|
4
|
-
onChange?: (value: string) => void;
|
|
5
|
-
tabs?: Snippet;
|
|
6
|
-
panels?: Snippet;
|
|
7
|
-
}
|
|
8
|
-
declare const TabView: import("svelte").Component<Props, {}, "active">;
|
|
9
|
-
type TabView = ReturnType<typeof TabView>;
|
|
10
|
-
export default TabView;
|