@x33025/sveltely 0.0.22 → 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/components/SegmentedPicker.svelte +3 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/style/index.css +1 -0
- package/dist/style.css +3 -21
- 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
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<div
|
|
19
|
-
class={`hstack w-fit
|
|
19
|
+
class={`hstack w-fit ${className}`}
|
|
20
20
|
style="
|
|
21
21
|
padding: var(--segmented-picker-outer-padding);
|
|
22
22
|
border-radius: var(--segmented-picker-border-radius);
|
|
23
|
-
|
|
23
|
+
background: var(--segmented-picker-background);
|
|
24
|
+
gap: var(--segmented-picker-item-gap);
|
|
24
25
|
"
|
|
25
26
|
>
|
|
26
27
|
{#each options as option}
|
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/index.css
CHANGED
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
--segmented-picker-background: var(--color-zinc-100);
|
|
80
80
|
--segmented-picker-active-background: var(--color-white);
|
|
81
81
|
--segmented-picker-active-shadow: var(--shadow-xs);
|
|
82
|
+
--segmented-picker-item-gap: var(--spacing);
|
|
82
83
|
--segmented-picker-inner-border-radius: max(
|
|
83
84
|
0px,
|
|
84
85
|
calc(var(--segmented-picker-border-radius) - var(--segmented-picker-outer-padding))
|
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;
|
|
@@ -286,9 +283,6 @@
|
|
|
286
283
|
.items-center {
|
|
287
284
|
align-items: center;
|
|
288
285
|
}
|
|
289
|
-
.gap-1 {
|
|
290
|
-
gap: calc(var(--spacing) * 1);
|
|
291
|
-
}
|
|
292
286
|
.gap-2 {
|
|
293
287
|
gap: calc(var(--spacing) * 2);
|
|
294
288
|
}
|
|
@@ -346,9 +340,6 @@
|
|
|
346
340
|
.border-zinc-200 {
|
|
347
341
|
border-color: var(--color-zinc-200);
|
|
348
342
|
}
|
|
349
|
-
.bg-gray-100 {
|
|
350
|
-
background-color: var(--color-gray-100);
|
|
351
|
-
}
|
|
352
343
|
.bg-white {
|
|
353
344
|
background-color: var(--color-white);
|
|
354
345
|
}
|
|
@@ -386,10 +377,6 @@
|
|
|
386
377
|
font-size: var(--text-sm);
|
|
387
378
|
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
388
379
|
}
|
|
389
|
-
.text-xs {
|
|
390
|
-
font-size: var(--text-xs);
|
|
391
|
-
line-height: var(--tw-leading, var(--text-xs--line-height));
|
|
392
|
-
}
|
|
393
380
|
.font-medium {
|
|
394
381
|
--tw-font-weight: var(--font-weight-medium);
|
|
395
382
|
font-weight: var(--font-weight-medium);
|
|
@@ -402,15 +389,9 @@
|
|
|
402
389
|
--tw-tracking: var(--tracking-wide);
|
|
403
390
|
letter-spacing: var(--tracking-wide);
|
|
404
391
|
}
|
|
405
|
-
.text-gray-500 {
|
|
406
|
-
color: var(--color-gray-500);
|
|
407
|
-
}
|
|
408
392
|
.text-gray-700 {
|
|
409
393
|
color: var(--color-gray-700);
|
|
410
394
|
}
|
|
411
|
-
.text-gray-900 {
|
|
412
|
-
color: var(--color-gray-900);
|
|
413
|
-
}
|
|
414
395
|
.text-zinc-500 {
|
|
415
396
|
color: var(--color-zinc-500);
|
|
416
397
|
}
|
|
@@ -587,6 +568,7 @@
|
|
|
587
568
|
--segmented-picker-background: var(--color-zinc-100);
|
|
588
569
|
--segmented-picker-active-background: var(--color-white);
|
|
589
570
|
--segmented-picker-active-shadow: var(--shadow-xs);
|
|
571
|
+
--segmented-picker-item-gap: var(--spacing);
|
|
590
572
|
--segmented-picker-inner-border-radius: max(
|
|
591
573
|
0px,
|
|
592
574
|
calc(var(--segmented-picker-border-radius) - var(--segmented-picker-outer-padding))
|
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;
|