@casinogate/ui 1.10.19 → 1.11.1
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/assets/css/root.css +60 -0
- package/dist/components/field/components/field.description.svelte +2 -4
- package/dist/components/field/components/field.error.svelte +9 -12
- package/dist/components/field/components/field.label.svelte +2 -4
- package/dist/components/field/components/field.root.svelte +2 -6
- package/dist/components/field/components/field.svelte.d.ts +1 -0
- package/dist/components/field/components/field.svelte.js +2 -1
- package/dist/components/field/components/index.d.ts +5 -0
- package/dist/components/field/components/index.js +5 -0
- package/dist/components/field/composed/basic/basic.svelte +40 -0
- package/dist/components/field/composed/basic/basic.svelte.d.ts +4 -0
- package/dist/components/field/composed/basic/index.d.ts +1 -0
- package/dist/components/field/composed/basic/index.js +1 -0
- package/dist/components/field/composed/index.d.ts +1 -0
- package/dist/components/field/composed/index.js +1 -0
- package/dist/components/field/field.svelte +6 -6
- package/dist/components/field/index.d.ts +2 -2
- package/dist/components/field/index.js +2 -2
- package/dist/components/field/styles.d.ts +8 -49
- package/dist/components/field/styles.js +21 -15
- package/dist/components/field/types.d.ts +7 -5
- package/dist/components/navigation/components/index.d.ts +7 -0
- package/dist/components/navigation/components/index.js +7 -0
- package/dist/components/navigation/components/navigation.sub-trigger.svelte +2 -0
- package/dist/components/navigation/components/navigation.svelte.d.ts +4 -0
- package/dist/components/navigation/components/navigation.svelte.js +2 -0
- package/dist/components/navigation/components/navigation.trigger.svelte +2 -0
- package/dist/components/navigation/{navigation.svelte → composed/basic/basic.svelte} +11 -25
- package/dist/components/navigation/composed/basic/basic.svelte.d.ts +4 -0
- package/dist/components/navigation/composed/basic/index.d.ts +1 -0
- package/dist/components/navigation/composed/basic/index.js +1 -0
- package/dist/components/navigation/composed/index.d.ts +1 -0
- package/dist/components/navigation/composed/index.js +1 -0
- package/dist/components/navigation/index.d.ts +4 -4
- package/dist/components/navigation/index.js +3 -3
- package/dist/components/navigation/model/create-nav-collection.d.ts +3 -0
- package/dist/components/navigation/model/create-nav-collection.js +14 -0
- package/dist/components/navigation/model/index.d.ts +1 -0
- package/dist/components/navigation/model/index.js +1 -0
- package/dist/components/navigation/styles.d.ts +1 -1
- package/dist/components/navigation/styles.js +9 -3
- package/dist/components/navigation/types.d.ts +4 -0
- package/package.json +157 -2
- package/dist/components/field/exports-primitive.d.ts +0 -5
- package/dist/components/field/exports-primitive.js +0 -5
- package/dist/components/field/exports.d.ts +0 -1
- package/dist/components/field/exports.js +0 -1
- package/dist/components/navigation/exports-primitive.d.ts +0 -7
- package/dist/components/navigation/exports-primitive.js +0 -7
- package/dist/components/navigation/exports.d.ts +0 -1
- package/dist/components/navigation/exports.js +0 -1
- package/dist/components/navigation/navigation.svelte.d.ts +0 -7
package/dist/assets/css/root.css
CHANGED
|
@@ -182,6 +182,9 @@
|
|
|
182
182
|
.cgui\:pointer-events-none {
|
|
183
183
|
pointer-events: none;
|
|
184
184
|
}
|
|
185
|
+
.cgui\:invisible {
|
|
186
|
+
visibility: hidden;
|
|
187
|
+
}
|
|
185
188
|
.cgui\:absolute {
|
|
186
189
|
position: absolute;
|
|
187
190
|
}
|
|
@@ -496,6 +499,9 @@
|
|
|
496
499
|
.cgui\:min-h-11 {
|
|
497
500
|
min-height: calc(var(--cgui-spacing) * 11);
|
|
498
501
|
}
|
|
502
|
+
.cgui\:min-h-\[1lh\] {
|
|
503
|
+
min-height: 1lh;
|
|
504
|
+
}
|
|
499
505
|
.cgui\:w-\(--app-shell-sidebar-width\) {
|
|
500
506
|
width: var(--app-shell-sidebar-width);
|
|
501
507
|
}
|
|
@@ -583,6 +589,9 @@
|
|
|
583
589
|
.cgui\:max-w-80 {
|
|
584
590
|
max-width: calc(var(--cgui-spacing) * 80);
|
|
585
591
|
}
|
|
592
|
+
.cgui\:max-w-84 {
|
|
593
|
+
max-width: calc(var(--cgui-spacing) * 84);
|
|
594
|
+
}
|
|
586
595
|
.cgui\:max-w-100 {
|
|
587
596
|
max-width: calc(var(--cgui-spacing) * 100);
|
|
588
597
|
}
|
|
@@ -769,6 +778,12 @@
|
|
|
769
778
|
margin-block-end: calc(calc(var(--cgui-spacing) * 3) * calc(1 - var(--tw-space-y-reverse)));
|
|
770
779
|
}
|
|
771
780
|
}
|
|
781
|
+
.cgui\:gap-x-3 {
|
|
782
|
+
column-gap: calc(var(--cgui-spacing) * 3);
|
|
783
|
+
}
|
|
784
|
+
.cgui\:gap-x-4 {
|
|
785
|
+
column-gap: calc(var(--cgui-spacing) * 4);
|
|
786
|
+
}
|
|
772
787
|
.cgui\:space-x-4 {
|
|
773
788
|
:where(& > :not(:last-child)) {
|
|
774
789
|
--tw-space-x-reverse: 0;
|
|
@@ -1281,6 +1296,9 @@
|
|
|
1281
1296
|
.cgui\:underline {
|
|
1282
1297
|
text-decoration-line: underline;
|
|
1283
1298
|
}
|
|
1299
|
+
.cgui\:opacity-0 {
|
|
1300
|
+
opacity: 0%;
|
|
1301
|
+
}
|
|
1284
1302
|
.cgui\:opacity-50 {
|
|
1285
1303
|
opacity: 50%;
|
|
1286
1304
|
}
|
|
@@ -1347,6 +1365,11 @@
|
|
|
1347
1365
|
transition-timing-function: var(--tw-ease, var(--cgui-default-transition-timing-function));
|
|
1348
1366
|
transition-duration: var(--tw-duration, var(--cgui-default-transition-duration));
|
|
1349
1367
|
}
|
|
1368
|
+
.cgui\:transition-opacity {
|
|
1369
|
+
transition-property: opacity;
|
|
1370
|
+
transition-timing-function: var(--tw-ease, var(--cgui-default-transition-timing-function));
|
|
1371
|
+
transition-duration: var(--tw-duration, var(--cgui-default-transition-duration));
|
|
1372
|
+
}
|
|
1350
1373
|
.cgui\:transition-transform {
|
|
1351
1374
|
transition-property: transform, translate, scale, rotate;
|
|
1352
1375
|
transition-timing-function: var(--tw-ease, var(--cgui-default-transition-timing-function));
|
|
@@ -1576,6 +1599,13 @@
|
|
|
1576
1599
|
}
|
|
1577
1600
|
}
|
|
1578
1601
|
}
|
|
1602
|
+
.cgui\:hover\:text-fg-white {
|
|
1603
|
+
&:hover {
|
|
1604
|
+
@media (hover: hover) {
|
|
1605
|
+
color: var(--cg-ui-color-fg-white);
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1579
1609
|
.cgui\:hover\:text-primary-60 {
|
|
1580
1610
|
&:hover {
|
|
1581
1611
|
@media (hover: hover) {
|
|
@@ -1700,11 +1730,26 @@
|
|
|
1700
1730
|
background-color: var(--cg-ui-color-surface-lightest);
|
|
1701
1731
|
}
|
|
1702
1732
|
}
|
|
1733
|
+
.cgui\:data-highlighted\:bg-transparent {
|
|
1734
|
+
&[data-highlighted] {
|
|
1735
|
+
background-color: transparent;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1703
1738
|
.cgui\:data-selected\:text-fg-primary {
|
|
1704
1739
|
&[data-selected] {
|
|
1705
1740
|
color: var(--cg-ui-color-fg-primary);
|
|
1706
1741
|
}
|
|
1707
1742
|
}
|
|
1743
|
+
.cgui\:data-\[active\]\:bg-surface-dark {
|
|
1744
|
+
&[data-active] {
|
|
1745
|
+
background-color: var(--cg-ui-color-surface-dark);
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
.cgui\:data-\[active\]\:text-fg-white {
|
|
1749
|
+
&[data-active] {
|
|
1750
|
+
color: var(--cg-ui-color-fg-white);
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1708
1753
|
.cgui\:data-\[active\=\"\"\]\:bg-surface-white {
|
|
1709
1754
|
&[data-active=""] {
|
|
1710
1755
|
background-color: var(--cg-ui-color-surface-white);
|
|
@@ -1796,6 +1841,16 @@
|
|
|
1796
1841
|
padding-inline-start: calc(var(--cgui-spacing) * 8);
|
|
1797
1842
|
}
|
|
1798
1843
|
}
|
|
1844
|
+
.cgui\:data-\[invalid\]\:visible {
|
|
1845
|
+
&[data-invalid] {
|
|
1846
|
+
visibility: visible;
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
.cgui\:data-\[invalid\]\:opacity-100 {
|
|
1850
|
+
&[data-invalid] {
|
|
1851
|
+
opacity: 100%;
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1799
1854
|
.cgui\:data-\[orientation\=horizontal\]\:h-2 {
|
|
1800
1855
|
&[data-orientation="horizontal"] {
|
|
1801
1856
|
height: calc(var(--cgui-spacing) * 2);
|
|
@@ -2216,6 +2271,11 @@
|
|
|
2216
2271
|
height: calc(var(--cgui-spacing) * 4);
|
|
2217
2272
|
}
|
|
2218
2273
|
}
|
|
2274
|
+
.cgui\:\[\&_\[data-slot\=\"trigger\"\]\[data-active\]\]\:bg-transparent {
|
|
2275
|
+
& [data-slot="trigger"][data-active] {
|
|
2276
|
+
background-color: transparent;
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2219
2279
|
.cgui\:hover\:\[\&_\[data-slot\=icon\]\]\:text-icon-focus {
|
|
2220
2280
|
&:hover {
|
|
2221
2281
|
@media (hover: hover) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn, useId } from '../../../internal/utils/common.js';
|
|
3
3
|
|
|
4
4
|
import { box, mergeProps } from 'svelte-toolbelt';
|
|
5
|
-
import {
|
|
5
|
+
import { fieldDescriptionVariants } from '../styles.js';
|
|
6
6
|
import type { FieldDescriptionProps } from '../types.js';
|
|
7
7
|
import { FieldDescriptionState } from './field.svelte.js';
|
|
8
8
|
|
|
@@ -17,8 +17,6 @@
|
|
|
17
17
|
...restProps
|
|
18
18
|
}: FieldDescriptionProps = $props();
|
|
19
19
|
|
|
20
|
-
const styles = FieldStylesContext.get();
|
|
21
|
-
|
|
22
20
|
const descriptionState = FieldDescriptionState.create({
|
|
23
21
|
ref: box.with(
|
|
24
22
|
() => ref,
|
|
@@ -28,7 +26,7 @@
|
|
|
28
26
|
});
|
|
29
27
|
|
|
30
28
|
const mergedProps = $derived(
|
|
31
|
-
mergeProps(restProps, descriptionState.props, { class: cn(
|
|
29
|
+
mergeProps(restProps, descriptionState.props, { class: cn(fieldDescriptionVariants({}), className) })
|
|
32
30
|
);
|
|
33
31
|
</script>
|
|
34
32
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { cn, useId } from '../../../internal/utils/common.js';
|
|
3
|
-
import { FieldStylesContext } from '../styles.js';
|
|
4
3
|
import type { FieldErrorProps } from '../types.js';
|
|
5
4
|
import { FieldErrorState } from './field.svelte.js';
|
|
6
5
|
|
|
6
|
+
import { fieldErrorVariants } from '../styles.js';
|
|
7
|
+
|
|
7
8
|
import { box, mergeProps } from 'svelte-toolbelt';
|
|
8
9
|
|
|
9
10
|
const uid = $props.id();
|
|
@@ -17,8 +18,6 @@
|
|
|
17
18
|
...restProps
|
|
18
19
|
}: FieldErrorProps = $props();
|
|
19
20
|
|
|
20
|
-
const styles = FieldStylesContext.get();
|
|
21
|
-
|
|
22
21
|
const errorState = FieldErrorState.create({
|
|
23
22
|
ref: box.with(
|
|
24
23
|
() => ref,
|
|
@@ -28,16 +27,14 @@
|
|
|
28
27
|
});
|
|
29
28
|
|
|
30
29
|
const mergedProps = $derived(
|
|
31
|
-
mergeProps(restProps, errorState.props, { class: cn(
|
|
30
|
+
mergeProps(restProps, errorState.props, { class: cn(fieldErrorVariants({}), className) })
|
|
32
31
|
);
|
|
33
32
|
</script>
|
|
34
33
|
|
|
35
|
-
{#if
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
</span>
|
|
42
|
-
{/if}
|
|
34
|
+
{#if child}
|
|
35
|
+
{@render child({ props: mergedProps })}
|
|
36
|
+
{:else}
|
|
37
|
+
<span {...mergedProps}>
|
|
38
|
+
{@render children?.()}
|
|
39
|
+
</span>
|
|
43
40
|
{/if}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { FieldLabelProps } from '../types.js';
|
|
3
3
|
import { FieldLabelState } from './field.svelte.js';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { fieldLabelVariants } from '../styles.js';
|
|
6
6
|
|
|
7
7
|
import { cn, useId } from '../../../internal/utils/common.js';
|
|
8
8
|
|
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
...restProps
|
|
20
20
|
}: FieldLabelProps = $props();
|
|
21
21
|
|
|
22
|
-
const styles = FieldStylesContext.get();
|
|
23
|
-
|
|
24
22
|
const labelState = FieldLabelState.create({
|
|
25
23
|
ref: box.with(
|
|
26
24
|
() => ref,
|
|
@@ -30,7 +28,7 @@
|
|
|
30
28
|
});
|
|
31
29
|
|
|
32
30
|
const mergedProps = $derived(
|
|
33
|
-
mergeProps(restProps, labelState.props, { class: cn(
|
|
31
|
+
mergeProps(restProps, labelState.props, { class: cn(fieldLabelVariants({}), className) })
|
|
34
32
|
);
|
|
35
33
|
</script>
|
|
36
34
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { cn, useId } from '../../../internal/utils/common.js';
|
|
3
3
|
import { box, mergeProps } from 'svelte-toolbelt';
|
|
4
|
-
import {
|
|
4
|
+
import { fieldRootVariants } from '../styles.js';
|
|
5
5
|
import type { FieldRootProps } from '../types.js';
|
|
6
6
|
import { FieldRootState } from './field.svelte.js';
|
|
7
7
|
|
|
@@ -32,11 +32,7 @@
|
|
|
32
32
|
required: box.with(() => required),
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
FieldStylesContext.set(box.with(() => variants));
|
|
38
|
-
|
|
39
|
-
const mergedProps = $derived(mergeProps(restProps, rootState.props, { class: cn(variants.root(), className) }));
|
|
35
|
+
const mergedProps = $derived(mergeProps(restProps, rootState.props, { class: cn(fieldRootVariants({}), className) }));
|
|
40
36
|
|
|
41
37
|
const attrStates = $derived({
|
|
42
38
|
invalid: rootState.opts.invalid.current,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SLOT_ATTR_NAME } from '../../../internal/constants/attrs.js';
|
|
2
|
-
import { getDataActive, getDataDisabled } from '../../../internal/utils/attrs.js';
|
|
2
|
+
import { boolAttr, getDataActive, getDataDisabled } from '../../../internal/utils/attrs.js';
|
|
3
3
|
import { Context } from 'runed';
|
|
4
4
|
import { untrack } from 'svelte';
|
|
5
5
|
import { attachRef } from 'svelte-toolbelt';
|
|
@@ -81,6 +81,7 @@ export class FieldErrorState {
|
|
|
81
81
|
}
|
|
82
82
|
props = $derived.by(() => ({
|
|
83
83
|
id: this.opts.id.current,
|
|
84
|
+
'data-invalid': boolAttr(this.root.opts.invalid.current),
|
|
84
85
|
[SLOT_ATTR_NAME]: SLOT_ATTR_VALUES.error,
|
|
85
86
|
...this.attachment,
|
|
86
87
|
}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Control } from './field.control.svelte';
|
|
2
|
+
export { default as Description } from './field.description.svelte';
|
|
3
|
+
export { default as Error } from './field.error.svelte';
|
|
4
|
+
export { default as Label } from './field.label.svelte';
|
|
5
|
+
export { default as Root } from './field.root.svelte';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Control } from './field.control.svelte';
|
|
2
|
+
export { default as Description } from './field.description.svelte';
|
|
3
|
+
export { default as Error } from './field.error.svelte';
|
|
4
|
+
export { default as Label } from './field.label.svelte';
|
|
5
|
+
export { default as Root } from './field.root.svelte';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as Primitive from '../../components/index.js';
|
|
3
|
+
|
|
4
|
+
import type { FieldProps } from '../../types.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
label,
|
|
8
|
+
error,
|
|
9
|
+
description,
|
|
10
|
+
ref = $bindable(null),
|
|
11
|
+
children: childrenSnippet,
|
|
12
|
+
...restProps
|
|
13
|
+
}: FieldProps = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<Primitive.Root bind:ref {...restProps}>
|
|
17
|
+
{#if typeof label === 'string'}
|
|
18
|
+
<Primitive.Label>{label}</Primitive.Label>
|
|
19
|
+
{:else}
|
|
20
|
+
{@render label?.()}
|
|
21
|
+
{/if}
|
|
22
|
+
|
|
23
|
+
<Primitive.Control>
|
|
24
|
+
{#snippet children({ props })}
|
|
25
|
+
{@render childrenSnippet?.({ props })}
|
|
26
|
+
{/snippet}
|
|
27
|
+
</Primitive.Control>
|
|
28
|
+
|
|
29
|
+
{#if typeof description === 'string'}
|
|
30
|
+
<Primitive.Description>{description}</Primitive.Description>
|
|
31
|
+
{:else}
|
|
32
|
+
{@render description?.()}
|
|
33
|
+
{/if}
|
|
34
|
+
|
|
35
|
+
{#if typeof error === 'string'}
|
|
36
|
+
<Primitive.Error>{error}</Primitive.Error>
|
|
37
|
+
{:else}
|
|
38
|
+
{@render error?.()}
|
|
39
|
+
{/if}
|
|
40
|
+
</Primitive.Root>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Basic } from './basic.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Basic } from './basic.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './basic/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './basic/index.js';
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
{/snippet}
|
|
31
31
|
</FieldControl>
|
|
32
32
|
|
|
33
|
-
{#if typeof error === 'string'}
|
|
34
|
-
<FieldError>{error}</FieldError>
|
|
35
|
-
{:else}
|
|
36
|
-
{@render error?.()}
|
|
37
|
-
{/if}
|
|
38
|
-
|
|
39
33
|
{#if typeof description === 'string'}
|
|
40
34
|
<FieldDescription>{description}</FieldDescription>
|
|
41
35
|
{:else}
|
|
42
36
|
{@render description?.()}
|
|
43
37
|
{/if}
|
|
38
|
+
|
|
39
|
+
{#if typeof error === 'string'}
|
|
40
|
+
<FieldError>{error}</FieldError>
|
|
41
|
+
{:else}
|
|
42
|
+
{@render error?.()}
|
|
43
|
+
{/if}
|
|
44
44
|
</FieldRoot>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * as FieldPrimitive from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * as FieldPrimitive from './components/index.js';
|
|
2
|
+
export * as Field from './composed/index.js';
|
|
3
3
|
export type { FieldControlProps, FieldDescriptionProps, FieldErrorProps, FieldLabelProps, FieldProps, FieldRootProps, } from './types.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * as FieldPrimitive from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * as FieldPrimitive from './components/index.js';
|
|
2
|
+
export * as Field from './composed/index.js';
|
|
@@ -1,50 +1,9 @@
|
|
|
1
|
-
import { Context } from 'runed';
|
|
2
|
-
import type { ReadableBox } from 'svelte-toolbelt';
|
|
3
1
|
import type { VariantProps } from 'tailwind-variants';
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
} | {
|
|
14
|
-
[x: string]: {
|
|
15
|
-
[x: string]: import("tailwind-merge").ClassNameValue | {
|
|
16
|
-
description?: import("tailwind-merge").ClassNameValue;
|
|
17
|
-
root?: import("tailwind-merge").ClassNameValue;
|
|
18
|
-
label?: import("tailwind-merge").ClassNameValue;
|
|
19
|
-
error?: import("tailwind-merge").ClassNameValue;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
} | {}, {
|
|
23
|
-
root: string;
|
|
24
|
-
label: string[];
|
|
25
|
-
error: string;
|
|
26
|
-
description: string;
|
|
27
|
-
}, undefined, {
|
|
28
|
-
[key: string]: {
|
|
29
|
-
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
30
|
-
description?: import("tailwind-merge").ClassNameValue;
|
|
31
|
-
root?: import("tailwind-merge").ClassNameValue;
|
|
32
|
-
label?: import("tailwind-merge").ClassNameValue;
|
|
33
|
-
error?: import("tailwind-merge").ClassNameValue;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
} | {}, {
|
|
37
|
-
root: string;
|
|
38
|
-
label: string[];
|
|
39
|
-
error: string;
|
|
40
|
-
description: string;
|
|
41
|
-
}, import("tailwind-variants").TVReturnType<unknown, {
|
|
42
|
-
root: string;
|
|
43
|
-
label: string[];
|
|
44
|
-
error: string;
|
|
45
|
-
description: string;
|
|
46
|
-
}, undefined, unknown, unknown, undefined>>;
|
|
47
|
-
export type FieldVariantsProps = VariantProps<typeof fieldStyles>;
|
|
48
|
-
type FieldStylesContextValues = ReadableBox<ReturnType<typeof fieldStyles>>;
|
|
49
|
-
export declare const FieldStylesContext: Context<FieldStylesContextValues>;
|
|
50
|
-
export {};
|
|
2
|
+
export declare const fieldRootVariants: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
3
|
+
export declare const fieldLabelVariants: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
4
|
+
export declare const fieldErrorVariants: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
5
|
+
export declare const fieldDescriptionVariants: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
6
|
+
export type FieldRootVariants = VariantProps<typeof fieldRootVariants>;
|
|
7
|
+
export type FieldLabelVariants = VariantProps<typeof fieldLabelVariants>;
|
|
8
|
+
export type FieldErrorVariants = VariantProps<typeof fieldErrorVariants>;
|
|
9
|
+
export type FieldDescriptionVariants = VariantProps<typeof fieldDescriptionVariants>;
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import { keyWithPrefix } from '../../internal/utils/common.js';
|
|
2
1
|
import { tv } from '../../internal/utils/tailwindcss.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
export const fieldRootVariants = tv({
|
|
3
|
+
base: ['cgui:flex cgui:flex-col cgui:gap-1'],
|
|
4
|
+
});
|
|
5
|
+
export const fieldLabelVariants = tv({
|
|
6
|
+
base: [
|
|
7
|
+
'cgui:relative',
|
|
8
|
+
'cgui:w-fit',
|
|
9
|
+
'cgui:inline-flex cgui:items-center cgui:gap-0.5',
|
|
10
|
+
'cgui:text-fg-medium cgui:text-caption cgui:font-medium',
|
|
11
|
+
],
|
|
12
|
+
});
|
|
13
|
+
export const fieldErrorVariants = tv({
|
|
14
|
+
base: [
|
|
15
|
+
'cgui:text-caption cgui:text-fg-error',
|
|
16
|
+
'cgui:min-h-[1lh]',
|
|
17
|
+
'cgui:invisible cgui:opacity-0 cgui:transition-opacity cgui:duration-200',
|
|
18
|
+
'cgui:data-[invalid]:visible cgui:data-[invalid]:opacity-100',
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
export const fieldDescriptionVariants = tv({
|
|
22
|
+
base: ['cgui:text-caption cgui:text-fg-medium'],
|
|
16
23
|
});
|
|
17
|
-
export const FieldStylesContext = new Context(keyWithPrefix('field-styles'));
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { WithVariants } from '../../internal/types/composition.js';
|
|
1
2
|
import type { PrimitiveDivAttributes, PrimitiveLabelAttributes, PrimitiveSpanAttributes } from '../../internal/types/html-attributes.js';
|
|
2
3
|
import type { Snippet } from 'svelte';
|
|
3
4
|
import type { WithChild, WithElementRef, Without, WithoutChildrenOrChild } from 'svelte-toolbelt';
|
|
4
|
-
type
|
|
5
|
+
import type { FieldDescriptionVariants, FieldErrorVariants, FieldLabelVariants, FieldRootVariants } from './styles.js';
|
|
6
|
+
type FieldRootPropsWithoutHTML = WithVariants<WithElementRef<WithChild<{
|
|
5
7
|
invalid?: boolean;
|
|
6
8
|
disabled?: boolean;
|
|
7
9
|
readOnly?: boolean;
|
|
@@ -11,7 +13,7 @@ type FieldRootPropsWithoutHTML = WithElementRef<WithChild<{
|
|
|
11
13
|
disabled: boolean;
|
|
12
14
|
readOnly: boolean;
|
|
13
15
|
required: boolean;
|
|
14
|
-
}
|
|
16
|
+
}>>, FieldRootVariants>;
|
|
15
17
|
export type FieldRootProps = FieldRootPropsWithoutHTML & Without<PrimitiveDivAttributes, FieldRootPropsWithoutHTML>;
|
|
16
18
|
export type FieldControlProps = {
|
|
17
19
|
children?: Snippet<[{
|
|
@@ -19,11 +21,11 @@ export type FieldControlProps = {
|
|
|
19
21
|
}]>;
|
|
20
22
|
id?: string;
|
|
21
23
|
};
|
|
22
|
-
type FieldDescriptionPropsWithoutHTML = WithElementRef<WithChild<{}
|
|
24
|
+
type FieldDescriptionPropsWithoutHTML = WithVariants<WithElementRef<WithChild<{}>>, FieldDescriptionVariants>;
|
|
23
25
|
export type FieldDescriptionProps = FieldDescriptionPropsWithoutHTML & Without<PrimitiveSpanAttributes, FieldDescriptionPropsWithoutHTML>;
|
|
24
|
-
type FieldErrorPropsWithoutHTML = WithElementRef<WithChild<{}
|
|
26
|
+
type FieldErrorPropsWithoutHTML = WithVariants<WithElementRef<WithChild<{}>>, FieldErrorVariants>;
|
|
25
27
|
export type FieldErrorProps = FieldErrorPropsWithoutHTML & Without<PrimitiveSpanAttributes, FieldErrorPropsWithoutHTML>;
|
|
26
|
-
type FieldLabelPropsWithoutHTML = WithElementRef<WithChild<{}
|
|
28
|
+
type FieldLabelPropsWithoutHTML = WithVariants<WithElementRef<WithChild<{}>>, FieldLabelVariants>;
|
|
27
29
|
export type FieldLabelProps = FieldLabelPropsWithoutHTML & Without<PrimitiveLabelAttributes, FieldLabelPropsWithoutHTML>;
|
|
28
30
|
export type FieldProps = WithoutChildrenOrChild<FieldRootProps> & {
|
|
29
31
|
label?: string | Snippet;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Content } from './navigation.content.svelte';
|
|
2
|
+
export { default as Item } from './navigation.item.svelte';
|
|
3
|
+
export { default as Root } from './navigation.root.svelte';
|
|
4
|
+
export { default as SubContent } from './navigation.sub-content.svelte';
|
|
5
|
+
export { default as SubTrigger } from './navigation.sub-trigger.svelte';
|
|
6
|
+
export { default as Sub } from './navigation.sub.svelte';
|
|
7
|
+
export { default as Trigger } from './navigation.trigger.svelte';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Content } from './navigation.content.svelte';
|
|
2
|
+
export { default as Item } from './navigation.item.svelte';
|
|
3
|
+
export { default as Root } from './navigation.root.svelte';
|
|
4
|
+
export { default as SubContent } from './navigation.sub-content.svelte';
|
|
5
|
+
export { default as SubTrigger } from './navigation.sub-trigger.svelte';
|
|
6
|
+
export { default as Sub } from './navigation.sub.svelte';
|
|
7
|
+
export { default as Trigger } from './navigation.trigger.svelte';
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
label,
|
|
21
21
|
class: className,
|
|
22
22
|
disabled = false,
|
|
23
|
+
active = false,
|
|
23
24
|
...restProps
|
|
24
25
|
}: NavigationSubTriggerProps = $props();
|
|
25
26
|
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
),
|
|
31
32
|
id: boxWith(() => id),
|
|
32
33
|
disabled: boxWith(() => disabled),
|
|
34
|
+
active: boxWith(() => active),
|
|
33
35
|
});
|
|
34
36
|
|
|
35
37
|
const mergedProps = $derived(
|
|
@@ -49,6 +49,7 @@ export declare class NavigationItemState {
|
|
|
49
49
|
}
|
|
50
50
|
type NavigationTriggerStateOpts = WithRefProps<ReadableBoxedValues<{
|
|
51
51
|
disabled: boolean;
|
|
52
|
+
active: boolean;
|
|
52
53
|
}>>;
|
|
53
54
|
export declare class NavigationTriggerState {
|
|
54
55
|
static create(opts: NavigationTriggerStateOpts): NavigationTriggerState;
|
|
@@ -60,6 +61,7 @@ export declare class NavigationTriggerState {
|
|
|
60
61
|
readonly id: string;
|
|
61
62
|
readonly "data-slot": "trigger";
|
|
62
63
|
readonly 'data-disabled': "" | undefined;
|
|
64
|
+
readonly 'data-active': "" | undefined;
|
|
63
65
|
};
|
|
64
66
|
}
|
|
65
67
|
type NavigationSubStateOpts = WithRefProps<WritableBoxedValues<{
|
|
@@ -83,6 +85,7 @@ export declare class NavigationSubState {
|
|
|
83
85
|
}
|
|
84
86
|
type NavigationSubTriggerStateOpts = WithRefProps<ReadableBoxedValues<{
|
|
85
87
|
disabled: boolean;
|
|
88
|
+
active: boolean;
|
|
86
89
|
}>>;
|
|
87
90
|
export declare class NavigationSubTriggerState {
|
|
88
91
|
static create(opts: NavigationSubTriggerStateOpts): NavigationSubTriggerState;
|
|
@@ -95,6 +98,7 @@ export declare class NavigationSubTriggerState {
|
|
|
95
98
|
readonly id: string;
|
|
96
99
|
readonly "data-slot": "sub-trigger";
|
|
97
100
|
readonly 'data-disabled': "" | undefined;
|
|
101
|
+
readonly 'data-active': "" | undefined;
|
|
98
102
|
readonly 'data-state': "open" | "closed";
|
|
99
103
|
readonly 'aria-expanded': boolean;
|
|
100
104
|
readonly 'aria-haspopup': "menu";
|
|
@@ -89,6 +89,7 @@ export class NavigationTriggerState {
|
|
|
89
89
|
id: this.opts.id.current,
|
|
90
90
|
[SLOT_ATTR_NAME]: SLOT_ATTR_VALUES.trigger,
|
|
91
91
|
'data-disabled': boolAttr(this.opts.disabled.current),
|
|
92
|
+
'data-active': boolAttr(this.opts.active.current),
|
|
92
93
|
...this.attachment,
|
|
93
94
|
}));
|
|
94
95
|
}
|
|
@@ -142,6 +143,7 @@ export class NavigationSubTriggerState {
|
|
|
142
143
|
id: this.opts.id.current,
|
|
143
144
|
[SLOT_ATTR_NAME]: SLOT_ATTR_VALUES.subTrigger,
|
|
144
145
|
'data-disabled': boolAttr(this.opts.disabled.current),
|
|
146
|
+
'data-active': boolAttr(this.opts.active.current),
|
|
145
147
|
'data-state': this.sub.isOpen ? 'open' : 'closed',
|
|
146
148
|
'aria-expanded': this.sub.isOpen,
|
|
147
149
|
'aria-haspopup': 'menu',
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
class: className,
|
|
19
19
|
href,
|
|
20
20
|
disabled = false,
|
|
21
|
+
active = false,
|
|
21
22
|
...restProps
|
|
22
23
|
}: NavigationTriggerProps = $props();
|
|
23
24
|
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
),
|
|
32
33
|
id: boxWith(() => id),
|
|
33
34
|
disabled: boxWith(() => disabled),
|
|
35
|
+
active: boxWith(() => active),
|
|
34
36
|
});
|
|
35
37
|
|
|
36
38
|
const mergedProps = $derived(
|
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
import { createListCollection } from '../../internal/index.js';
|
|
3
|
-
import type { ListCollection } from '../../internal/lib/collection/index.js';
|
|
4
2
|
import type {
|
|
5
|
-
NavigationCollectionOptions,
|
|
6
|
-
NavigationItem,
|
|
7
3
|
NavigationItemAction,
|
|
8
4
|
NavigationItemLink,
|
|
9
5
|
NavigationItemSub,
|
|
10
6
|
NavigationSelectableItem,
|
|
11
|
-
} from '
|
|
12
|
-
|
|
13
|
-
export function createNavigationCollection(options: NavigationCollectionOptions): ListCollection<NavigationItem> {
|
|
14
|
-
const { items } = options;
|
|
15
|
-
|
|
16
|
-
return createListCollection({
|
|
17
|
-
items,
|
|
18
|
-
itemToValue: (item) => item.key,
|
|
19
|
-
itemToString: (item) => {
|
|
20
|
-
return item.label;
|
|
21
|
-
},
|
|
22
|
-
isItemDisabled: (item) => {
|
|
23
|
-
return !!item.disabled;
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
}
|
|
7
|
+
} from '../../types.js';
|
|
27
8
|
|
|
28
9
|
function isLink(item: NavigationSelectableItem): item is NavigationItemLink {
|
|
29
10
|
return item.type === 'link';
|
|
@@ -39,8 +20,8 @@
|
|
|
39
20
|
</script>
|
|
40
21
|
|
|
41
22
|
<script lang="ts">
|
|
42
|
-
import * as Primitive from '
|
|
43
|
-
import type { NavigationProps } from '
|
|
23
|
+
import * as Primitive from '../../components/index.js';
|
|
24
|
+
import type { NavigationProps } from '../../types.js';
|
|
44
25
|
|
|
45
26
|
let {
|
|
46
27
|
collection,
|
|
@@ -48,6 +29,7 @@
|
|
|
48
29
|
compact = $bindable(false),
|
|
49
30
|
contentClass,
|
|
50
31
|
item: itemSnippet,
|
|
32
|
+
activeKey,
|
|
51
33
|
...restProps
|
|
52
34
|
}: NavigationProps = $props();
|
|
53
35
|
|
|
@@ -56,7 +38,11 @@
|
|
|
56
38
|
|
|
57
39
|
{#snippet defaultSubRenderer(item: NavigationItemSub)}
|
|
58
40
|
<Primitive.Sub>
|
|
59
|
-
<Primitive.SubTrigger
|
|
41
|
+
<Primitive.SubTrigger
|
|
42
|
+
label={item.label}
|
|
43
|
+
disabled={item.disabled}
|
|
44
|
+
active={item.children.some((child) => child.key === activeKey)}
|
|
45
|
+
>
|
|
60
46
|
{#snippet icon()}
|
|
61
47
|
{#if item.icon}
|
|
62
48
|
<item.icon width={24} height={24} />
|
|
@@ -74,7 +60,7 @@
|
|
|
74
60
|
|
|
75
61
|
{#snippet defaultLinkRenderer(item: NavigationItemLink)}
|
|
76
62
|
<Primitive.Item>
|
|
77
|
-
<Primitive.Trigger label={item.label} href={item.href} disabled={item.disabled}>
|
|
63
|
+
<Primitive.Trigger label={item.label} href={item.href} disabled={item.disabled} active={item.key === activeKey}>
|
|
78
64
|
{#snippet icon()}
|
|
79
65
|
{#if item.icon}
|
|
80
66
|
<item.icon width={24} height={24} />
|
|
@@ -86,7 +72,7 @@
|
|
|
86
72
|
|
|
87
73
|
{#snippet defaultActionRenderer(item: NavigationItemAction)}
|
|
88
74
|
<Primitive.Item>
|
|
89
|
-
<Primitive.Trigger label={item.label} disabled={item.disabled}>
|
|
75
|
+
<Primitive.Trigger label={item.label} disabled={item.disabled} active={item.key === activeKey}>
|
|
90
76
|
{#snippet icon()}
|
|
91
77
|
{#if item.icon}
|
|
92
78
|
<item.icon width={24} height={24} />
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Basic } from './basic.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Basic } from './basic.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './basic/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './basic/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * as NavigationPrimitive from './
|
|
2
|
-
export * as Navigation from './
|
|
3
|
-
export {
|
|
4
|
-
export type { NavigationCollection, NavigationCollectionOptions, NavigationContentProps, NavigationItem, NavigationItemAction, NavigationItemBase, NavigationItemLink, NavigationItemProps,
|
|
1
|
+
export * as NavigationPrimitive from './components/index.js';
|
|
2
|
+
export * as Navigation from './composed/index.js';
|
|
3
|
+
export { createNavCollection } from './model/index.js';
|
|
4
|
+
export type { NavigationCollection, NavigationCollectionOptions, NavigationContentProps, NavigationItem, NavigationItemAction, NavigationItemBase, NavigationItemLink, NavigationItemProps, NavigationItemSub, NavigationProps, NavigationRootProps, NavigationSelectableItem, NavigationSubContentProps, NavigationSubProps, NavigationSubTriggerProps, NavigationTriggerProps, } from './types.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * as NavigationPrimitive from './
|
|
2
|
-
export * as Navigation from './
|
|
3
|
-
export {
|
|
1
|
+
export * as NavigationPrimitive from './components/index.js';
|
|
2
|
+
export * as Navigation from './composed/index.js';
|
|
3
|
+
export { createNavCollection } from './model/index.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createListCollection } from '../../../internal/index.js';
|
|
2
|
+
export const createNavCollection = (options) => {
|
|
3
|
+
const { items } = options;
|
|
4
|
+
return createListCollection({
|
|
5
|
+
items,
|
|
6
|
+
itemToValue: (item) => item.key,
|
|
7
|
+
itemToString: (item) => {
|
|
8
|
+
return item.label;
|
|
9
|
+
},
|
|
10
|
+
isItemDisabled: (item) => {
|
|
11
|
+
return !!item.disabled;
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createNavCollection } from './create-nav-collection.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createNavCollection } from './create-nav-collection.js';
|
|
@@ -13,7 +13,7 @@ export declare const navigationRootStyles: import("tailwind-variants").TVReturnT
|
|
|
13
13
|
};
|
|
14
14
|
}, undefined, string[], unknown, unknown, undefined>>;
|
|
15
15
|
export declare const navigationContentStyles: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
16
|
-
export declare const navigationItemStyles: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined,
|
|
16
|
+
export declare const navigationItemStyles: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
17
17
|
export declare const navigationTriggerStyles: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
18
18
|
export declare const navigationSubStyles: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, never[], {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, never[], unknown, unknown, undefined>>;
|
|
19
19
|
export declare const navigationSubTriggerStyles: import("tailwind-variants").TVReturnType<{} | {} | {} | {}, undefined, string[], {} | {} | {}, undefined, import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>>;
|
|
@@ -15,18 +15,20 @@ export const navigationContentStyles = tv({
|
|
|
15
15
|
base: [''],
|
|
16
16
|
});
|
|
17
17
|
export const navigationItemStyles = tv({
|
|
18
|
-
base: [],
|
|
18
|
+
base: ['cgui:data-highlighted:bg-transparent'],
|
|
19
19
|
});
|
|
20
20
|
export const navigationTriggerStyles = tv({
|
|
21
21
|
base: [
|
|
22
22
|
'cgui:flex cgui:items-center cgui:gap-2',
|
|
23
|
-
'cgui:overflow-hidden cgui:truncate',
|
|
23
|
+
'cgui:overflow-hidden cgui:truncate cgui:rounded-xs',
|
|
24
24
|
'cgui:w-full cgui:px-3 cgui:py-4',
|
|
25
25
|
'cgui:group-data-[compact=true]/navigation:py-3 cgui:group-data-[compact=true]/navigation:justify-center',
|
|
26
26
|
'cgui:text-fg-semilight cgui:text-body',
|
|
27
27
|
'cgui:cursor-pointer cgui:transition-all cgui:duration-250 cgui:ease-in-out',
|
|
28
28
|
'cgui:data-[disabled]:cursor-not-allowed cgui:data-[disabled]:opacity-50',
|
|
29
29
|
'cgui:[&_svg]:size-6 cgui:[&_[data-slot="icon"]]:me-auto',
|
|
30
|
+
'cgui:hover:text-fg-white',
|
|
31
|
+
'cgui:data-[active]:bg-surface-dark cgui:data-[active]:text-fg-white ',
|
|
30
32
|
],
|
|
31
33
|
});
|
|
32
34
|
export const navigationSubStyles = tv({
|
|
@@ -37,7 +39,11 @@ export const navigationSubTriggerStyles = tv({
|
|
|
37
39
|
base: ['cgui:group-data-[compact=false]/navigation:data-[state=open]:[&_[data-slot="chevron"]]:rotate-180'],
|
|
38
40
|
});
|
|
39
41
|
export const navigationSubContentStyles = tv({
|
|
40
|
-
base: [
|
|
42
|
+
base: [
|
|
43
|
+
'cgui:data-[compact=false]:pl-10',
|
|
44
|
+
'cgui:data-[compact=false]:[&_[data-slot="trigger"]]:pl-0',
|
|
45
|
+
'cgui:[&_[data-slot="trigger"][data-active]]:bg-transparent',
|
|
46
|
+
],
|
|
41
47
|
});
|
|
42
48
|
export const navigationDropdownContentStyles = tv({
|
|
43
49
|
base: [
|
|
@@ -20,6 +20,7 @@ export type NavigationItemProps = NavigationItemPropsWithoutHTML & Without<Primi
|
|
|
20
20
|
type NavigationTriggerPropsWithoutHTML = WithElementRef<WithoutChildren<WithChild<{
|
|
21
21
|
href?: string;
|
|
22
22
|
disabled?: boolean;
|
|
23
|
+
active?: boolean;
|
|
23
24
|
icon?: Snippet;
|
|
24
25
|
label?: string | Snippet<[{
|
|
25
26
|
props: Record<string, unknown>;
|
|
@@ -36,6 +37,7 @@ type NavigationSubPropsWithoutHTML = WithElementRef<WithChild<{
|
|
|
36
37
|
export type NavigationSubProps = NavigationSubPropsWithoutHTML & Without<PrimitiveElementAttributes, NavigationSubPropsWithoutHTML>;
|
|
37
38
|
type NavigationSubTriggerPropsWithoutHTML = WithElementRef<WithoutChildren<WithChild<{
|
|
38
39
|
disabled?: boolean;
|
|
40
|
+
active?: boolean;
|
|
39
41
|
icon?: Snippet;
|
|
40
42
|
label?: string | Snippet<[{
|
|
41
43
|
props: Record<string, unknown>;
|
|
@@ -61,6 +63,7 @@ export type NavigationItemBase = {
|
|
|
61
63
|
}>;
|
|
62
64
|
/** Whether the item is disabled */
|
|
63
65
|
disabled?: boolean;
|
|
66
|
+
[key: string]: unknown;
|
|
64
67
|
};
|
|
65
68
|
export type NavigationItemLink = NavigationItemBase & {
|
|
66
69
|
type: 'link';
|
|
@@ -89,5 +92,6 @@ export type NavigationProps = WithoutChildrenOrChild<NavigationRootProps> & {
|
|
|
89
92
|
props: Record<string, unknown>;
|
|
90
93
|
}]>;
|
|
91
94
|
contentClass?: string;
|
|
95
|
+
activeKey?: string;
|
|
92
96
|
};
|
|
93
97
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@casinogate/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.1",
|
|
4
4
|
"svelte": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -10,7 +10,162 @@
|
|
|
10
10
|
"svelte": "./dist/index.js",
|
|
11
11
|
"default": "./dist/index.js"
|
|
12
12
|
},
|
|
13
|
-
"./styles.css": "./dist/assets/css/root.css"
|
|
13
|
+
"./styles.css": "./dist/assets/css/root.css",
|
|
14
|
+
"./app-shell": {
|
|
15
|
+
"types": "./dist/components/app-shell/index.d.ts",
|
|
16
|
+
"svelte": "./dist/components/app-shell/index.js",
|
|
17
|
+
"default": "./dist/components/app-shell/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./badge": {
|
|
20
|
+
"types": "./dist/components/badge/index.d.ts",
|
|
21
|
+
"svelte": "./dist/components/badge/index.js",
|
|
22
|
+
"default": "./dist/components/badge/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./breadcrumb": {
|
|
25
|
+
"types": "./dist/components/breadcrumb/index.d.ts",
|
|
26
|
+
"svelte": "./dist/components/breadcrumb/index.js",
|
|
27
|
+
"default": "./dist/components/breadcrumb/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./button": {
|
|
30
|
+
"types": "./dist/components/button/index.d.ts",
|
|
31
|
+
"svelte": "./dist/components/button/index.js",
|
|
32
|
+
"default": "./dist/components/button/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./button-group": {
|
|
35
|
+
"types": "./dist/components/button-group/index.d.ts",
|
|
36
|
+
"svelte": "./dist/components/button-group/index.js",
|
|
37
|
+
"default": "./dist/components/button-group/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./checkbox": {
|
|
40
|
+
"types": "./dist/components/checkbox/index.d.ts",
|
|
41
|
+
"svelte": "./dist/components/checkbox/index.js",
|
|
42
|
+
"default": "./dist/components/checkbox/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./collapsible": {
|
|
45
|
+
"types": "./dist/components/collapsible/index.d.ts",
|
|
46
|
+
"svelte": "./dist/components/collapsible/index.js",
|
|
47
|
+
"default": "./dist/components/collapsible/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./combobox": {
|
|
50
|
+
"types": "./dist/components/combobox/index.d.ts",
|
|
51
|
+
"svelte": "./dist/components/combobox/index.js",
|
|
52
|
+
"default": "./dist/components/combobox/index.js"
|
|
53
|
+
},
|
|
54
|
+
"./command": {
|
|
55
|
+
"types": "./dist/components/command/index.d.ts",
|
|
56
|
+
"svelte": "./dist/components/command/index.js",
|
|
57
|
+
"default": "./dist/components/command/index.js"
|
|
58
|
+
},
|
|
59
|
+
"./data-table": {
|
|
60
|
+
"types": "./dist/components/data-table/index.d.ts",
|
|
61
|
+
"svelte": "./dist/components/data-table/index.js",
|
|
62
|
+
"default": "./dist/components/data-table/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./dialog": {
|
|
65
|
+
"types": "./dist/components/dialog/index.d.ts",
|
|
66
|
+
"svelte": "./dist/components/dialog/index.js",
|
|
67
|
+
"default": "./dist/components/dialog/index.js"
|
|
68
|
+
},
|
|
69
|
+
"./drawer": {
|
|
70
|
+
"types": "./dist/components/drawer/index.d.ts",
|
|
71
|
+
"svelte": "./dist/components/drawer/index.js",
|
|
72
|
+
"default": "./dist/components/drawer/index.js"
|
|
73
|
+
},
|
|
74
|
+
"./dropdown": {
|
|
75
|
+
"types": "./dist/components/dropdown/index.d.ts",
|
|
76
|
+
"svelte": "./dist/components/dropdown/index.js",
|
|
77
|
+
"default": "./dist/components/dropdown/index.js"
|
|
78
|
+
},
|
|
79
|
+
"./field": {
|
|
80
|
+
"types": "./dist/components/field/index.d.ts",
|
|
81
|
+
"svelte": "./dist/components/field/index.js",
|
|
82
|
+
"default": "./dist/components/field/index.js"
|
|
83
|
+
},
|
|
84
|
+
"./icons": {
|
|
85
|
+
"types": "./dist/components/icons/index.d.ts",
|
|
86
|
+
"svelte": "./dist/components/icons/index.js",
|
|
87
|
+
"default": "./dist/components/icons/index.js"
|
|
88
|
+
},
|
|
89
|
+
"./input": {
|
|
90
|
+
"types": "./dist/components/input/index.d.ts",
|
|
91
|
+
"svelte": "./dist/components/input/index.js",
|
|
92
|
+
"default": "./dist/components/input/index.js"
|
|
93
|
+
},
|
|
94
|
+
"./input-group": {
|
|
95
|
+
"types": "./dist/components/input-group/index.d.ts",
|
|
96
|
+
"svelte": "./dist/components/input-group/index.js",
|
|
97
|
+
"default": "./dist/components/input-group/index.js"
|
|
98
|
+
},
|
|
99
|
+
"./kbd": {
|
|
100
|
+
"types": "./dist/components/kbd/index.d.ts",
|
|
101
|
+
"svelte": "./dist/components/kbd/index.js",
|
|
102
|
+
"default": "./dist/components/kbd/index.js"
|
|
103
|
+
},
|
|
104
|
+
"./navigation": {
|
|
105
|
+
"types": "./dist/components/navigation/index.d.ts",
|
|
106
|
+
"svelte": "./dist/components/navigation/index.js",
|
|
107
|
+
"default": "./dist/components/navigation/index.js"
|
|
108
|
+
},
|
|
109
|
+
"./number-input": {
|
|
110
|
+
"types": "./dist/components/number-input/index.d.ts",
|
|
111
|
+
"svelte": "./dist/components/number-input/index.js",
|
|
112
|
+
"default": "./dist/components/number-input/index.js"
|
|
113
|
+
},
|
|
114
|
+
"./pagination": {
|
|
115
|
+
"types": "./dist/components/pagination/index.d.ts",
|
|
116
|
+
"svelte": "./dist/components/pagination/index.js",
|
|
117
|
+
"default": "./dist/components/pagination/index.js"
|
|
118
|
+
},
|
|
119
|
+
"./popover": {
|
|
120
|
+
"types": "./dist/components/popover/index.d.ts",
|
|
121
|
+
"svelte": "./dist/components/popover/index.js",
|
|
122
|
+
"default": "./dist/components/popover/index.js"
|
|
123
|
+
},
|
|
124
|
+
"./segment": {
|
|
125
|
+
"types": "./dist/components/segment/index.d.ts",
|
|
126
|
+
"svelte": "./dist/components/segment/index.js",
|
|
127
|
+
"default": "./dist/components/segment/index.js"
|
|
128
|
+
},
|
|
129
|
+
"./select": {
|
|
130
|
+
"types": "./dist/components/select/index.d.ts",
|
|
131
|
+
"svelte": "./dist/components/select/index.js",
|
|
132
|
+
"default": "./dist/components/select/index.js"
|
|
133
|
+
},
|
|
134
|
+
"./separator": {
|
|
135
|
+
"types": "./dist/components/separator/index.d.ts",
|
|
136
|
+
"svelte": "./dist/components/separator/index.js",
|
|
137
|
+
"default": "./dist/components/separator/index.js"
|
|
138
|
+
},
|
|
139
|
+
"./skeleton": {
|
|
140
|
+
"types": "./dist/components/skeleton/index.d.ts",
|
|
141
|
+
"svelte": "./dist/components/skeleton/index.js",
|
|
142
|
+
"default": "./dist/components/skeleton/index.js"
|
|
143
|
+
},
|
|
144
|
+
"./slider": {
|
|
145
|
+
"types": "./dist/components/slider/index.d.ts",
|
|
146
|
+
"svelte": "./dist/components/slider/index.js",
|
|
147
|
+
"default": "./dist/components/slider/index.js"
|
|
148
|
+
},
|
|
149
|
+
"./spinner": {
|
|
150
|
+
"types": "./dist/components/spinner/index.d.ts",
|
|
151
|
+
"svelte": "./dist/components/spinner/index.js",
|
|
152
|
+
"default": "./dist/components/spinner/index.js"
|
|
153
|
+
},
|
|
154
|
+
"./switch": {
|
|
155
|
+
"types": "./dist/components/switch/index.d.ts",
|
|
156
|
+
"svelte": "./dist/components/switch/index.js",
|
|
157
|
+
"default": "./dist/components/switch/index.js"
|
|
158
|
+
},
|
|
159
|
+
"./textarea": {
|
|
160
|
+
"types": "./dist/components/textarea/index.d.ts",
|
|
161
|
+
"svelte": "./dist/components/textarea/index.js",
|
|
162
|
+
"default": "./dist/components/textarea/index.js"
|
|
163
|
+
},
|
|
164
|
+
"./toast": {
|
|
165
|
+
"types": "./dist/components/toast/index.d.ts",
|
|
166
|
+
"svelte": "./dist/components/toast/index.js",
|
|
167
|
+
"default": "./dist/components/toast/index.js"
|
|
168
|
+
}
|
|
14
169
|
},
|
|
15
170
|
"files": [
|
|
16
171
|
"dist",
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { default as Control } from './components/field.control.svelte';
|
|
2
|
-
export { default as Description } from './components/field.description.svelte';
|
|
3
|
-
export { default as Error } from './components/field.error.svelte';
|
|
4
|
-
export { default as Label } from './components/field.label.svelte';
|
|
5
|
-
export { default as Root } from './components/field.root.svelte';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { default as Control } from './components/field.control.svelte';
|
|
2
|
-
export { default as Description } from './components/field.description.svelte';
|
|
3
|
-
export { default as Error } from './components/field.error.svelte';
|
|
4
|
-
export { default as Label } from './components/field.label.svelte';
|
|
5
|
-
export { default as Root } from './components/field.root.svelte';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Field } from './field.svelte';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Field } from './field.svelte';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { default as Content } from './components/navigation.content.svelte';
|
|
2
|
-
export { default as Item } from './components/navigation.item.svelte';
|
|
3
|
-
export { default as Root } from './components/navigation.root.svelte';
|
|
4
|
-
export { default as SubContent } from './components/navigation.sub-content.svelte';
|
|
5
|
-
export { default as SubTrigger } from './components/navigation.sub-trigger.svelte';
|
|
6
|
-
export { default as Sub } from './components/navigation.sub.svelte';
|
|
7
|
-
export { default as Trigger } from './components/navigation.trigger.svelte';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { default as Content } from './components/navigation.content.svelte';
|
|
2
|
-
export { default as Item } from './components/navigation.item.svelte';
|
|
3
|
-
export { default as Root } from './components/navigation.root.svelte';
|
|
4
|
-
export { default as SubContent } from './components/navigation.sub-content.svelte';
|
|
5
|
-
export { default as SubTrigger } from './components/navigation.sub-trigger.svelte';
|
|
6
|
-
export { default as Sub } from './components/navigation.sub.svelte';
|
|
7
|
-
export { default as Trigger } from './components/navigation.trigger.svelte';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createNavigationCollection, default as Root } from './navigation.svelte';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createNavigationCollection, default as Root } from './navigation.svelte';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ListCollection } from '../../internal/lib/collection/index.js';
|
|
2
|
-
import type { NavigationCollectionOptions, NavigationItem } from './types.js';
|
|
3
|
-
export declare function createNavigationCollection(options: NavigationCollectionOptions): ListCollection<NavigationItem>;
|
|
4
|
-
import type { NavigationProps } from './types.js';
|
|
5
|
-
declare const Navigation: import("svelte").Component<NavigationProps, {}, "ref" | "compact">;
|
|
6
|
-
type Navigation = ReturnType<typeof Navigation>;
|
|
7
|
-
export default Navigation;
|