@casinogate/ui 1.10.18 → 1.10.19

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 (36) hide show
  1. package/dist/assets/css/root.css +120 -0
  2. package/dist/assets/css/tailwind/theme.css +1 -0
  3. package/dist/assets/css/theme.css +4 -0
  4. package/dist/assets/css/tokens/primitives.css +1 -0
  5. package/dist/components/index.d.ts +1 -0
  6. package/dist/components/index.js +1 -0
  7. package/dist/components/slider/components/index.d.ts +5 -0
  8. package/dist/components/slider/components/index.js +5 -0
  9. package/dist/components/slider/components/slider.range.svelte +12 -0
  10. package/dist/components/slider/components/slider.range.svelte.d.ts +4 -0
  11. package/dist/components/slider/components/slider.root.svelte +35 -0
  12. package/dist/components/slider/components/slider.root.svelte.d.ts +4 -0
  13. package/dist/components/slider/components/slider.thumb.svelte +25 -0
  14. package/dist/components/slider/components/slider.thumb.svelte.d.ts +4 -0
  15. package/dist/components/slider/components/slider.tick.svelte +24 -0
  16. package/dist/components/slider/components/slider.tick.svelte.d.ts +4 -0
  17. package/dist/components/slider/components/slider.track.svelte +32 -0
  18. package/dist/components/slider/components/slider.track.svelte.d.ts +4 -0
  19. package/dist/components/slider/components/state.svelte.d.ts +15 -0
  20. package/dist/components/slider/components/state.svelte.js +11 -0
  21. package/dist/components/slider/composed/index.d.ts +1 -0
  22. package/dist/components/slider/composed/index.js +1 -0
  23. package/dist/components/slider/composed/root/index.d.ts +1 -0
  24. package/dist/components/slider/composed/root/index.js +1 -0
  25. package/dist/components/slider/composed/root/slider.root.svelte +41 -0
  26. package/dist/components/slider/composed/root/slider.root.svelte.d.ts +4 -0
  27. package/dist/components/slider/index.d.ts +3 -0
  28. package/dist/components/slider/index.js +3 -0
  29. package/dist/components/slider/styles.d.ts +107 -0
  30. package/dist/components/slider/styles.js +103 -0
  31. package/dist/components/slider/types.d.ts +16 -0
  32. package/dist/components/slider/types.js +1 -0
  33. package/dist/internal/constants/stories-namespace.d.ts +3 -0
  34. package/dist/internal/constants/stories-namespace.js +3 -0
  35. package/dist/internal/types/composition.d.ts +2 -2
  36. package/package.json +8 -8
@@ -239,6 +239,9 @@
239
239
  .cgui\:z-1 {
240
240
  z-index: 1;
241
241
  }
242
+ .cgui\:z-5 {
243
+ z-index: 5;
244
+ }
242
245
  .cgui\:\!m-0 {
243
246
  margin: calc(var(--cgui-spacing) * 0) !important;
244
247
  }
@@ -311,6 +314,9 @@
311
314
  display: none;
312
315
  }
313
316
  }
317
+ .cgui\:block {
318
+ display: block;
319
+ }
314
320
  .cgui\:flex {
315
321
  display: flex;
316
322
  }
@@ -323,6 +329,9 @@
323
329
  .cgui\:inline-flex {
324
330
  display: inline-flex;
325
331
  }
332
+ .cgui\:aspect-square {
333
+ aspect-ratio: 1 / 1;
334
+ }
326
335
  .cgui\:size-1\/2 {
327
336
  width: calc(1 / 2 * 100%);
328
337
  height: calc(1 / 2 * 100%);
@@ -382,6 +391,12 @@
382
391
  .cgui\:h-1\.5 {
383
392
  height: calc(var(--cgui-spacing) * 1.5);
384
393
  }
394
+ .cgui\:h-2 {
395
+ height: calc(var(--cgui-spacing) * 2);
396
+ }
397
+ .cgui\:h-2\.5 {
398
+ height: calc(var(--cgui-spacing) * 2.5);
399
+ }
385
400
  .cgui\:h-3 {
386
401
  height: calc(var(--cgui-spacing) * 3);
387
402
  }
@@ -436,6 +451,9 @@
436
451
  .cgui\:h-34 {
437
452
  height: calc(var(--cgui-spacing) * 34);
438
453
  }
454
+ .cgui\:h-100 {
455
+ height: calc(var(--cgui-spacing) * 100);
456
+ }
439
457
  .cgui\:h-120 {
440
458
  height: calc(var(--cgui-spacing) * 120);
441
459
  }
@@ -484,12 +502,18 @@
484
502
  .cgui\:w-1\.5 {
485
503
  width: calc(var(--cgui-spacing) * 1.5);
486
504
  }
505
+ .cgui\:w-2 {
506
+ width: calc(var(--cgui-spacing) * 2);
507
+ }
487
508
  .cgui\:w-2\.5 {
488
509
  width: calc(var(--cgui-spacing) * 2.5);
489
510
  }
490
511
  .cgui\:w-3 {
491
512
  width: calc(var(--cgui-spacing) * 3);
492
513
  }
514
+ .cgui\:w-3\.5 {
515
+ width: calc(var(--cgui-spacing) * 3.5);
516
+ }
493
517
  .cgui\:w-4 {
494
518
  width: calc(var(--cgui-spacing) * 4);
495
519
  }
@@ -616,6 +640,9 @@
616
640
  .cgui\:grow {
617
641
  flex-grow: 1;
618
642
  }
643
+ .cgui\:basis-1\/2 {
644
+ flex-basis: calc(1 / 2 * 100%);
645
+ }
619
646
  .cgui\:origin-\(--bits-dropdown-menu-content-transform-origin\) {
620
647
  transform-origin: var(--bits-dropdown-menu-content-transform-origin);
621
648
  }
@@ -810,6 +837,14 @@
810
837
  border-style: var(--tw-border-style);
811
838
  border-width: 2px;
812
839
  }
840
+ .cgui\:border-4 {
841
+ border-style: var(--tw-border-style);
842
+ border-width: 4px;
843
+ }
844
+ .cgui\:border-5 {
845
+ border-style: var(--tw-border-style);
846
+ border-width: 5px;
847
+ }
813
848
  .cgui\:border-t {
814
849
  border-top-style: var(--tw-border-style);
815
850
  border-top-width: 1px;
@@ -847,6 +882,9 @@
847
882
  .cgui\:border-stroke-error {
848
883
  border-color: var(--cg-ui-color-stroke-error);
849
884
  }
885
+ .cgui\:border-stroke-focus {
886
+ border-color: var(--cg-ui-color-stroke-focus);
887
+ }
850
888
  .cgui\:border-stroke-primary {
851
889
  border-color: var(--cg-ui-color-stroke-primary);
852
890
  }
@@ -922,6 +960,12 @@
922
960
  .cgui\:bg-surface-darkest {
923
961
  background-color: var(--cg-ui-color-surface-darkest);
924
962
  }
963
+ .cgui\:bg-surface-darkest\/50 {
964
+ background-color: var(--cg-ui-color-surface-darkest);
965
+ @supports (color: color-mix(in lab, red, red)) {
966
+ background-color: color-mix(in oklab, var(--cg-ui-color-surface-darkest) 50%, transparent);
967
+ }
968
+ }
925
969
  .cgui\:bg-surface-hover {
926
970
  background-color: var(--cg-ui-color-surface-hover);
927
971
  }
@@ -946,6 +990,12 @@
946
990
  .cgui\:bg-surface-primary {
947
991
  background-color: var(--cg-ui-color-surface-primary);
948
992
  }
993
+ .cgui\:bg-surface-primary-active {
994
+ background-color: var(--cg-ui-color-surface-primary-active);
995
+ }
996
+ .cgui\:bg-surface-primary-light {
997
+ background-color: var(--cg-ui-color-surface-primary-light);
998
+ }
949
999
  .cgui\:bg-surface-primary-light-active {
950
1000
  background-color: var(--cg-ui-color-surface-primary-light-active);
951
1001
  }
@@ -1258,6 +1308,10 @@
1258
1308
  --tw-shadow: var(--cg-ui-shadow-select);
1259
1309
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1260
1310
  }
1311
+ .cgui\:shadow-thumb {
1312
+ --tw-shadow: var(--cg-ui-shadow-thumb);
1313
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1314
+ }
1261
1315
  .cgui\:shadow-toast {
1262
1316
  --tw-shadow: var(--cg-ui-shadow-toast);
1263
1317
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
@@ -1563,6 +1617,16 @@
1563
1617
  --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
1564
1618
  }
1565
1619
  }
1620
+ .cgui\:focus-visible\:outline-hidden {
1621
+ &:focus-visible {
1622
+ --tw-outline-style: none;
1623
+ outline-style: none;
1624
+ @media (forced-colors: active) {
1625
+ outline: 2px solid transparent;
1626
+ outline-offset: 2px;
1627
+ }
1628
+ }
1629
+ }
1566
1630
  .cgui\:active\:scale-95 {
1567
1631
  &:active {
1568
1632
  --tw-scale-x: 95%;
@@ -1626,6 +1690,11 @@
1626
1690
  color: var(--cg-ui-color-fg-primary);
1627
1691
  }
1628
1692
  }
1693
+ .cgui\:data-active\:scale-\[0\.98\] {
1694
+ &[data-active] {
1695
+ scale: 0.98;
1696
+ }
1697
+ }
1629
1698
  .cgui\:data-highlighted\:bg-surface-lightest {
1630
1699
  &[data-highlighted] {
1631
1700
  background-color: var(--cg-ui-color-surface-lightest);
@@ -1727,11 +1796,61 @@
1727
1796
  padding-inline-start: calc(var(--cgui-spacing) * 8);
1728
1797
  }
1729
1798
  }
1799
+ .cgui\:data-\[orientation\=horizontal\]\:h-2 {
1800
+ &[data-orientation="horizontal"] {
1801
+ height: calc(var(--cgui-spacing) * 2);
1802
+ }
1803
+ }
1804
+ .cgui\:data-\[orientation\=horizontal\]\:h-2\.5 {
1805
+ &[data-orientation="horizontal"] {
1806
+ height: calc(var(--cgui-spacing) * 2.5);
1807
+ }
1808
+ }
1809
+ .cgui\:data-\[orientation\=horizontal\]\:h-3\.5 {
1810
+ &[data-orientation="horizontal"] {
1811
+ height: calc(var(--cgui-spacing) * 3.5);
1812
+ }
1813
+ }
1814
+ .cgui\:data-\[orientation\=horizontal\]\:h-full {
1815
+ &[data-orientation="horizontal"] {
1816
+ height: 100%;
1817
+ }
1818
+ }
1819
+ .cgui\:data-\[orientation\=horizontal\]\:w-\[1px\] {
1820
+ &[data-orientation="horizontal"] {
1821
+ width: 1px;
1822
+ }
1823
+ }
1824
+ .cgui\:data-\[orientation\=vertical\]\:h-\[1px\] {
1825
+ &[data-orientation="vertical"] {
1826
+ height: 1px;
1827
+ }
1828
+ }
1730
1829
  .cgui\:data-\[orientation\=vertical\]\:h-auto {
1731
1830
  &[data-orientation="vertical"] {
1732
1831
  height: auto;
1733
1832
  }
1734
1833
  }
1834
+ .cgui\:data-\[orientation\=vertical\]\:w-2 {
1835
+ &[data-orientation="vertical"] {
1836
+ width: calc(var(--cgui-spacing) * 2);
1837
+ }
1838
+ }
1839
+ .cgui\:data-\[orientation\=vertical\]\:w-2\.5 {
1840
+ &[data-orientation="vertical"] {
1841
+ width: calc(var(--cgui-spacing) * 2.5);
1842
+ }
1843
+ }
1844
+ .cgui\:data-\[orientation\=vertical\]\:w-3\.5 {
1845
+ &[data-orientation="vertical"] {
1846
+ width: calc(var(--cgui-spacing) * 3.5);
1847
+ }
1848
+ }
1849
+ .cgui\:data-\[orientation\=vertical\]\:w-full {
1850
+ &[data-orientation="vertical"] {
1851
+ width: 100%;
1852
+ }
1853
+ }
1735
1854
  .cgui\:data-\[placeholder\]\:text-fg-regular {
1736
1855
  &[data-placeholder] {
1737
1856
  color: var(--cg-ui-color-fg-regular);
@@ -2513,6 +2632,7 @@
2513
2632
  --cg-ui-shadow-dropdown: var(--cg-ui-shadow-base);
2514
2633
  --cg-ui-shadow-select: var(--cg-ui-shadow-base);
2515
2634
  --cg-ui-shadow-dialog: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
2635
+ --cg-ui-shadow-thumb: 0px 1px 3px rgba(0, 0, 0, 0.4), 0px 2px 8px rgba(0, 0, 0, 0.25);
2516
2636
  --cg-ui-fz-base: 16;
2517
2637
  --cg-ui-fz-heading: calc(16 / var(--cg-ui-fz-base) * 1rem);
2518
2638
  --cg-ui-lh-heading: calc(22 / var(--cg-ui-fz-base) * 1rem);
@@ -135,6 +135,7 @@
135
135
  --shadow-select: var(--cg-ui-shadow-select);
136
136
  --shadow-dialog: var(--cg-ui-shadow-dialog);
137
137
  --shadow-dropdown: var(--cg-ui-shadow-dropdown);
138
+ --shadow-thumb: var(--cg-ui-shadow-thumb);
138
139
 
139
140
  /* -------------------------------------------------------------------------
140
141
  Typography
@@ -62,6 +62,9 @@
62
62
  --cg-ui-shadow-select: var(--cg-ui-shadow-base);
63
63
  --cg-ui-shadow-command: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
64
64
  --cg-ui-shadow-dialog: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
65
+ --cg-ui-shadow-thumb:
66
+ rgba(0, 0, 0, 0.25) 0px 0.0625em 0.0625em, rgba(0, 0, 0, 0.25) 0px 0.125em 0.5em,
67
+ rgba(255, 255, 255, 0.1) 0px 0px 0px 1px inset;
65
68
 
66
69
  /* Font sizes, Line heights */
67
70
  --cg-ui-fz-base: 16;
@@ -311,6 +314,7 @@
311
314
  --shadow-select: var(--cg-ui-shadow-select);
312
315
  --shadow-dialog: var(--cg-ui-shadow-dialog);
313
316
  --shadow-dropdown: var(--cg-ui-shadow-dropdown);
317
+ --shadow-thumb: var(--cg-ui-shadow-thumb);
314
318
 
315
319
  /* Font sizes, Line heights */
316
320
  --text-heading: var(--cg-ui-fz-heading);
@@ -76,6 +76,7 @@
76
76
  --cg-ui-shadow-dropdown: var(--cg-ui-shadow-base);
77
77
  --cg-ui-shadow-select: var(--cg-ui-shadow-base);
78
78
  --cg-ui-shadow-dialog: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
79
+ --cg-ui-shadow-thumb: 0px 1px 3px rgba(0, 0, 0, 0.4), 0px 2px 8px rgba(0, 0, 0, 0.25);
79
80
 
80
81
  /* -------------------------------------------------------------------------
81
82
  Typography
@@ -23,6 +23,7 @@ export * from './segment/index.js';
23
23
  export * from './select/index.js';
24
24
  export * from './separator/index.js';
25
25
  export * from './skeleton/index.js';
26
+ export * from './slider/index.js';
26
27
  export * from './spinner/index.js';
27
28
  export * from './switch/index.js';
28
29
  export * from './textarea/index.js';
@@ -23,6 +23,7 @@ export * from './segment/index.js';
23
23
  export * from './select/index.js';
24
24
  export * from './separator/index.js';
25
25
  export * from './skeleton/index.js';
26
+ export * from './slider/index.js';
26
27
  export * from './spinner/index.js';
27
28
  export * from './switch/index.js';
28
29
  export * from './textarea/index.js';
@@ -0,0 +1,5 @@
1
+ export { default as Range } from './slider.range.svelte';
2
+ export { default as Root } from './slider.root.svelte';
3
+ export { default as Thumb } from './slider.thumb.svelte';
4
+ export { default as Tick } from './slider.tick.svelte';
5
+ export { default as Track } from './slider.track.svelte';
@@ -0,0 +1,5 @@
1
+ export { default as Range } from './slider.range.svelte';
2
+ export { default as Root } from './slider.root.svelte';
3
+ export { default as Thumb } from './slider.thumb.svelte';
4
+ export { default as Tick } from './slider.tick.svelte';
5
+ export { default as Track } from './slider.track.svelte';
@@ -0,0 +1,12 @@
1
+ <script lang="ts">
2
+ import { Slider as SliderPrimitive } from 'bits-ui';
3
+
4
+ import { sliderPrimitiveRangeStyles } from '../styles.js';
5
+
6
+ import { cn } from '../../../internal/utils/common.js';
7
+ import type { SliderPrimitiveRangeProps } from '../types.js';
8
+
9
+ let { ref = $bindable(null), class: className, ...restProps }: SliderPrimitiveRangeProps = $props();
10
+ </script>
11
+
12
+ <SliderPrimitive.Range class={cn(sliderPrimitiveRangeStyles({}), className)} bind:ref {...restProps} />
@@ -0,0 +1,4 @@
1
+ import type { SliderPrimitiveRangeProps } from '../types.js';
2
+ declare const Slider: import("svelte").Component<SliderPrimitiveRangeProps, {}, "ref">;
3
+ type Slider = ReturnType<typeof Slider>;
4
+ export default Slider;
@@ -0,0 +1,35 @@
1
+ <script lang="ts">
2
+ import { Slider as SliderPrimitive } from 'bits-ui';
3
+
4
+ import { sliderPrimitiveRootStyles } from '../styles.js';
5
+
6
+ import { cn } from '../../../internal/utils/common.js';
7
+ import { boxWith } from 'svelte-toolbelt';
8
+ import type { SliderPrimitiveRootProps } from '../types.js';
9
+ import { SliderPrimitiveRootState } from './state.svelte.js';
10
+
11
+ let {
12
+ ref = $bindable(null),
13
+ value = $bindable(),
14
+ orientation = 'horizontal',
15
+ class: className,
16
+ size = 'default',
17
+ disabled = false,
18
+ ...restProps
19
+ }: SliderPrimitiveRootProps = $props();
20
+
21
+ SliderPrimitiveRootState.create({
22
+ size: boxWith(() => size),
23
+ orientation: boxWith(() => orientation),
24
+ disabled: boxWith(() => disabled),
25
+ });
26
+ </script>
27
+
28
+ <SliderPrimitive.Root
29
+ class={cn(sliderPrimitiveRootStyles({ orientation }), className)}
30
+ bind:ref
31
+ bind:value={value as never}
32
+ {orientation}
33
+ {disabled}
34
+ {...restProps}
35
+ />
@@ -0,0 +1,4 @@
1
+ import type { SliderPrimitiveRootProps } from '../types.js';
2
+ declare const Slider: import("svelte").Component<SliderPrimitiveRootProps, {}, "value" | "ref">;
3
+ type Slider = ReturnType<typeof Slider>;
4
+ export default Slider;
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ import { Slider as SliderPrimitive } from 'bits-ui';
3
+
4
+ import { sliderPrimitiveThumbStyles } from '../styles.js';
5
+
6
+ import { cn } from '../../../internal/utils/common.js';
7
+ import type { SliderPrimitiveThumbProps } from '../types.js';
8
+
9
+ import { SliderPrimitiveRootContext } from './state.svelte.js';
10
+
11
+ let { ref = $bindable(null), class: className, ...restProps }: SliderPrimitiveThumbProps = $props();
12
+
13
+ const rootContext = SliderPrimitiveRootContext.get();
14
+ </script>
15
+
16
+ <SliderPrimitive.Thumb
17
+ class={cn(
18
+ sliderPrimitiveThumbStyles({
19
+ size: rootContext.opts.size.current,
20
+ }),
21
+ className
22
+ )}
23
+ bind:ref
24
+ {...restProps}
25
+ />
@@ -0,0 +1,4 @@
1
+ import type { SliderPrimitiveThumbProps } from '../types.js';
2
+ declare const Slider: import("svelte").Component<SliderPrimitiveThumbProps, {}, "ref">;
3
+ type Slider = ReturnType<typeof Slider>;
4
+ export default Slider;
@@ -0,0 +1,24 @@
1
+ <script lang="ts">
2
+ import { Slider as SliderPrimitive } from 'bits-ui';
3
+
4
+ import { sliderPrimitiveTickStyles } from '../styles.js';
5
+
6
+ import { cn } from '../../../internal/utils/common.js';
7
+ import type { SliderPrimitiveTickProps } from '../types.js';
8
+ import { SliderPrimitiveRootContext } from './state.svelte.js';
9
+
10
+ let { ref = $bindable(null), class: className, ...restProps }: SliderPrimitiveTickProps = $props();
11
+
12
+ const rootContext = SliderPrimitiveRootContext.get();
13
+ </script>
14
+
15
+ <SliderPrimitive.Tick
16
+ class={cn(
17
+ sliderPrimitiveTickStyles({
18
+ size: rootContext.opts.size.current,
19
+ }),
20
+ className
21
+ )}
22
+ bind:ref
23
+ {...restProps}
24
+ />
@@ -0,0 +1,4 @@
1
+ import type { SliderPrimitiveTickProps } from '../types.js';
2
+ declare const Slider: import("svelte").Component<SliderPrimitiveTickProps, {}, "ref">;
3
+ type Slider = ReturnType<typeof Slider>;
4
+ export default Slider;
@@ -0,0 +1,32 @@
1
+ <script lang="ts">
2
+ import { boolAttr } from '../../../internal/utils/attrs.js';
3
+ import { cn } from '../../../internal/utils/common.js';
4
+ import { sliderPrimitiveTrackStyles } from '../styles.js';
5
+ import type { SliderPrimitiveTrackProps } from '../types.js';
6
+ import { SliderPrimitiveRootContext } from './state.svelte.js';
7
+
8
+ let { ref = $bindable(null), class: className, child, children, ...restProps }: SliderPrimitiveTrackProps = $props();
9
+
10
+ const rootContext = SliderPrimitiveRootContext.get();
11
+
12
+ const attrs = $derived({
13
+ 'data-slot': 'slider-track',
14
+ 'data-disabled': boolAttr(rootContext.opts.disabled.current),
15
+ class: cn(
16
+ sliderPrimitiveTrackStyles({
17
+ orientation: rootContext.opts.orientation.current,
18
+ size: rootContext.opts.size.current,
19
+ }),
20
+ className
21
+ ),
22
+ ...restProps,
23
+ });
24
+ </script>
25
+
26
+ {#if child}
27
+ {@render child({ props: attrs })}
28
+ {:else}
29
+ <span bind:this={ref} {...attrs}>
30
+ {@render children?.()}
31
+ </span>
32
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { SliderPrimitiveTrackProps } from '../types.js';
2
+ declare const Slider: import("svelte").Component<SliderPrimitiveTrackProps, {}, "ref">;
3
+ type Slider = ReturnType<typeof Slider>;
4
+ export default Slider;
@@ -0,0 +1,15 @@
1
+ import { Context } from 'runed';
2
+ import type { ReadableBoxedValues } from 'svelte-toolbelt';
3
+ import type { SliderPrimitiveRootProps } from '../types.js';
4
+ export declare const SliderPrimitiveRootContext: Context<SliderPrimitiveRootState>;
5
+ type SliderPrimitiveRootStateOps = ReadableBoxedValues<{
6
+ size: SliderPrimitiveRootProps['size'];
7
+ orientation: SliderPrimitiveRootProps['orientation'];
8
+ disabled: boolean;
9
+ }>;
10
+ export declare class SliderPrimitiveRootState {
11
+ static create(opts: SliderPrimitiveRootStateOps): SliderPrimitiveRootState;
12
+ readonly opts: SliderPrimitiveRootStateOps;
13
+ constructor(opts: SliderPrimitiveRootStateOps);
14
+ }
15
+ export {};
@@ -0,0 +1,11 @@
1
+ import { Context } from 'runed';
2
+ export const SliderPrimitiveRootContext = new Context('slider-primitive-root-context');
3
+ export class SliderPrimitiveRootState {
4
+ static create(opts) {
5
+ return SliderPrimitiveRootContext.set(new SliderPrimitiveRootState(opts));
6
+ }
7
+ opts;
8
+ constructor(opts) {
9
+ this.opts = opts;
10
+ }
11
+ }
@@ -0,0 +1 @@
1
+ export { Root } from './root/index.js';
@@ -0,0 +1 @@
1
+ export { Root } from './root/index.js';
@@ -0,0 +1 @@
1
+ export { default as Root } from './slider.root.svelte';
@@ -0,0 +1 @@
1
+ export { default as Root } from './slider.root.svelte';
@@ -0,0 +1,41 @@
1
+ <script lang="ts">
2
+ import * as SliderPrimitive from '../../components/index.js';
3
+ import type { SliderRootProps } from '../../types.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ value = $bindable(),
8
+ orientation = 'horizontal',
9
+ size = 'default',
10
+ disabled = false,
11
+ showTicks = false,
12
+ class: className,
13
+ ...restProps
14
+ }: SliderRootProps = $props();
15
+ </script>
16
+
17
+ <SliderPrimitive.Root
18
+ bind:ref
19
+ bind:value={value as never}
20
+ {orientation}
21
+ {size}
22
+ {disabled}
23
+ class={className}
24
+ {...restProps}
25
+ >
26
+ {#snippet children({ thumbItems, tickItems })}
27
+ <SliderPrimitive.Track>
28
+ <SliderPrimitive.Range />
29
+ </SliderPrimitive.Track>
30
+
31
+ {#each thumbItems as { index } (index)}
32
+ <SliderPrimitive.Thumb {index} />
33
+ {/each}
34
+
35
+ {#if showTicks}
36
+ {#each tickItems as { index } (index)}
37
+ <SliderPrimitive.Tick {index} />
38
+ {/each}
39
+ {/if}
40
+ {/snippet}
41
+ </SliderPrimitive.Root>
@@ -0,0 +1,4 @@
1
+ import type { SliderRootProps } from '../../types.js';
2
+ declare const Slider: import("svelte").Component<SliderRootProps, {}, "value" | "ref">;
3
+ type Slider = ReturnType<typeof Slider>;
4
+ export default Slider;
@@ -0,0 +1,3 @@
1
+ export * as SliderPrimitive from './components/index.js';
2
+ export * as Slider from './composed/index.js';
3
+ export * from './types.js';
@@ -0,0 +1,3 @@
1
+ export * as SliderPrimitive from './components/index.js';
2
+ export * as Slider from './composed/index.js';
3
+ export * from './types.js';
@@ -0,0 +1,107 @@
1
+ import type { VariantProps } from 'tailwind-variants';
2
+ export declare const sliderPrimitiveRootStyles: import("tailwind-variants").TVReturnType<{
3
+ orientation: {
4
+ horizontal: string;
5
+ vertical: string;
6
+ };
7
+ size: {
8
+ sm: string[];
9
+ default: string[];
10
+ lg: string[];
11
+ };
12
+ }, undefined, string[], {
13
+ orientation: {
14
+ horizontal: string;
15
+ vertical: string;
16
+ };
17
+ size: {
18
+ sm: string[];
19
+ default: string[];
20
+ lg: string[];
21
+ };
22
+ }, undefined, import("tailwind-variants").TVReturnType<{
23
+ orientation: {
24
+ horizontal: string;
25
+ vertical: string;
26
+ };
27
+ size: {
28
+ sm: string[];
29
+ default: string[];
30
+ lg: string[];
31
+ };
32
+ }, undefined, string[], unknown, unknown, undefined>>;
33
+ export declare const sliderPrimitiveTrackStyles: import("tailwind-variants").TVReturnType<{
34
+ size: {
35
+ sm: string[];
36
+ default: string[];
37
+ lg: string[];
38
+ };
39
+ orientation: {
40
+ horizontal: string[];
41
+ vertical: string[];
42
+ };
43
+ }, undefined, string[], {
44
+ size: {
45
+ sm: string[];
46
+ default: string[];
47
+ lg: string[];
48
+ };
49
+ orientation: {
50
+ horizontal: string[];
51
+ vertical: string[];
52
+ };
53
+ }, undefined, import("tailwind-variants").TVReturnType<{
54
+ size: {
55
+ sm: string[];
56
+ default: string[];
57
+ lg: string[];
58
+ };
59
+ orientation: {
60
+ horizontal: string[];
61
+ vertical: string[];
62
+ };
63
+ }, undefined, string[], unknown, unknown, undefined>>;
64
+ export declare const sliderPrimitiveRangeStyles: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
65
+ export declare const sliderPrimitiveThumbStyles: import("tailwind-variants").TVReturnType<{
66
+ size: {
67
+ sm: string[];
68
+ default: string[];
69
+ lg: string[];
70
+ };
71
+ }, undefined, string[], {
72
+ size: {
73
+ sm: string[];
74
+ default: string[];
75
+ lg: string[];
76
+ };
77
+ }, undefined, import("tailwind-variants").TVReturnType<{
78
+ size: {
79
+ sm: string[];
80
+ default: string[];
81
+ lg: string[];
82
+ };
83
+ }, undefined, string[], unknown, unknown, undefined>>;
84
+ export declare const sliderPrimitiveTickStyles: import("tailwind-variants").TVReturnType<{
85
+ size: {
86
+ sm: string[];
87
+ default: string[];
88
+ lg: string[];
89
+ };
90
+ }, undefined, string[], {
91
+ size: {
92
+ sm: string[];
93
+ default: string[];
94
+ lg: string[];
95
+ };
96
+ }, undefined, import("tailwind-variants").TVReturnType<{
97
+ size: {
98
+ sm: string[];
99
+ default: string[];
100
+ lg: string[];
101
+ };
102
+ }, undefined, string[], unknown, unknown, undefined>>;
103
+ export type SliderPrimitiveRootVariants = VariantProps<typeof sliderPrimitiveRootStyles>;
104
+ export type SliderPrimitiveRangeVariants = VariantProps<typeof sliderPrimitiveRangeStyles>;
105
+ export type SliderPrimitiveThumbVariants = VariantProps<typeof sliderPrimitiveThumbStyles>;
106
+ export type SliderPrimitiveTickVariants = VariantProps<typeof sliderPrimitiveTickStyles>;
107
+ export type SliderPrimitiveTrackVariants = VariantProps<typeof sliderPrimitiveTrackStyles>;
@@ -0,0 +1,103 @@
1
+ import { tv } from '../../internal/utils/tailwindcss.js';
2
+ const SliderSizes = ['sm', 'default', 'lg'];
3
+ const SliderOrientations = ['horizontal', 'vertical'];
4
+ export const sliderPrimitiveRootStyles = tv({
5
+ base: ['cgui:group', 'cgui:relative cgui:flex cgui:touch-none cgui:select-none cgui:items-center'],
6
+ variants: {
7
+ orientation: {
8
+ horizontal: 'cgui:flex-row cgui:w-full',
9
+ vertical: 'cgui:flex-col cgui:h-full',
10
+ },
11
+ size: {
12
+ sm: [''],
13
+ default: [''],
14
+ lg: [''],
15
+ },
16
+ },
17
+ });
18
+ export const sliderPrimitiveTrackStyles = tv({
19
+ base: [
20
+ 'cgui:relative cgui:rounded-full cgui:grow cgui:overflow-hidden',
21
+ 'cgui:cursor-pointer cgui:data-disabled:cursor-not-allowd cgui:bg-surface-primary-light',
22
+ ],
23
+ variants: {
24
+ size: {
25
+ sm: [''],
26
+ default: [''],
27
+ lg: [''],
28
+ },
29
+ orientation: {
30
+ horizontal: [''],
31
+ vertical: [''],
32
+ },
33
+ },
34
+ compoundVariants: [
35
+ {
36
+ size: 'sm',
37
+ orientation: 'horizontal',
38
+ className: ['cgui:h-2 cgui:w-full'],
39
+ },
40
+ {
41
+ size: 'sm',
42
+ orientation: 'vertical',
43
+ className: ['cgui:w-2 cgui:h-full'],
44
+ },
45
+ {
46
+ size: 'default',
47
+ orientation: 'horizontal',
48
+ className: ['cgui:h-2.5 cgui:w-full'],
49
+ },
50
+ {
51
+ size: 'default',
52
+ orientation: 'vertical',
53
+ className: ['cgui:w-2.5 cgui:h-full'],
54
+ },
55
+ {
56
+ size: 'lg',
57
+ orientation: 'horizontal',
58
+ className: ['cgui:h-3.5 cgui:w-full'],
59
+ },
60
+ {
61
+ size: 'lg',
62
+ orientation: 'vertical',
63
+ className: ['cgui:w-3.5 cgui:h-full'],
64
+ },
65
+ ],
66
+ });
67
+ export const sliderPrimitiveRangeStyles = tv({
68
+ base: [
69
+ 'cgui:absolute cgui:bg-surface-primary-active',
70
+ 'cgui:data-[orientation=horizontal]:h-full cgui:data-[orientation=vertical]:w-full',
71
+ ],
72
+ });
73
+ export const sliderPrimitiveThumbStyles = tv({
74
+ base: [
75
+ 'cgui:block',
76
+ 'cgui:cursor-pointer cgui:disabled:pointer-events-none cgui:disabled:opacity-50 cgui:z-5',
77
+ 'cgui:transition-colors',
78
+ 'cgui:border cgui:border-stroke-focus cgui:bg-surface-lightest cgui:rounded-full',
79
+ 'cgui:focus-visible:ring-stroke-focus cgui:focus-visible:outline-hidden',
80
+ 'cgui:data-active:scale-[0.98] cgui:shadow-thumb',
81
+ ],
82
+ variants: {
83
+ size: {
84
+ sm: ['cgui:size-4 cgui:border-2 cgui:aspect-square'],
85
+ default: ['cgui:size-6 cgui:border-4 cgui:aspect-square'],
86
+ lg: ['cgui:size-8 cgui:border-5 cgui:aspect-square'],
87
+ },
88
+ },
89
+ });
90
+ export const sliderPrimitiveTickStyles = tv({
91
+ base: [
92
+ 'cgui:z-1 cgui:bg-surface-darkest/50',
93
+ 'cgui:data-[orientation=horizontal]:w-[1px]',
94
+ 'cgui:data-[orientation=vertical]:h-[1px]',
95
+ ],
96
+ variants: {
97
+ size: {
98
+ sm: ['cgui:data-[orientation=horizontal]:h-2 cgui:data-[orientation=vertical]:w-2'],
99
+ default: ['cgui:data-[orientation=horizontal]:h-2.5 cgui:data-[orientation=vertical]:w-2.5'],
100
+ lg: ['cgui:data-[orientation=horizontal]:h-3.5 cgui:data-[orientation=vertical]:w-3.5'],
101
+ },
102
+ },
103
+ });
@@ -0,0 +1,16 @@
1
+ import type { SliderRangeProps as UISliderRangeProps, SliderRootProps as UISliderRootProps, SliderThumbProps as UISliderThumbProps, SliderTickProps as UISliderTickProps } from 'bits-ui';
2
+ import type { Without } from '../../internal/types/common.js';
3
+ import type { WithVariants } from '../../internal/types/composition.js';
4
+ import type { PrimitiveSpanAttributes } from '../../internal/types/html-attributes.js';
5
+ import type { WithChild, WithElementRef, WithoutChildrenOrChild } from 'svelte-toolbelt';
6
+ import type { SliderPrimitiveRangeVariants, SliderPrimitiveRootVariants, SliderPrimitiveThumbVariants, SliderPrimitiveTickVariants, SliderPrimitiveTrackVariants } from './styles.js';
7
+ export type SliderPrimitiveRootProps = WithVariants<UISliderRootProps, SliderPrimitiveRootVariants>;
8
+ export type SliderPrimitiveRangeProps = WithVariants<UISliderRangeProps, SliderPrimitiveRangeVariants>;
9
+ export type SliderPrimitiveThumbProps = WithVariants<UISliderThumbProps, Omit<SliderPrimitiveThumbVariants, 'size'>>;
10
+ export type SliderPrimitiveTickProps = WithVariants<UISliderTickProps, Omit<SliderPrimitiveTickVariants, 'size'>>;
11
+ type SliderPrimitiveTrackWithoutHTML = WithVariants<WithElementRef<WithChild<{}>>, Omit<SliderPrimitiveTrackVariants, 'size'>>;
12
+ export type SliderPrimitiveTrackProps = SliderPrimitiveTrackWithoutHTML & Without<PrimitiveSpanAttributes, SliderPrimitiveTrackWithoutHTML>;
13
+ export type SliderRootProps = WithoutChildrenOrChild<SliderPrimitiveRootProps> & {
14
+ showTicks?: boolean;
15
+ };
16
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare const STORIES_NAMESPACE: {
2
+ readonly UI_KIT: "UI Kit";
3
+ };
@@ -0,0 +1,3 @@
1
+ export const STORIES_NAMESPACE = {
2
+ UI_KIT: 'UI Kit',
3
+ };
@@ -1,5 +1,5 @@
1
1
  import type { Snippet } from 'svelte';
2
- import type { ReadableBoxedValues, WritableBoxedValues } from 'svelte-toolbelt';
2
+ import type { ReadableBoxedValues, Without, WritableBoxedValues } from 'svelte-toolbelt';
3
3
  import type { VariantProps } from 'tailwind-variants';
4
4
  export type WithChild<Props extends Record<PropertyKey, unknown> = {}, SnippetProps extends Record<PropertyKey, unknown> = {
5
5
  _default: never;
@@ -42,4 +42,4 @@ export type WithoutChildren<T> = T extends {
42
42
  export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & {
43
43
  ref?: U | null;
44
44
  };
45
- export type WithVariants<TSource, TStyles extends (...args: any) => any, TOmit extends keyof VariantProps<TStyles> = never> = TSource & Omit<VariantProps<TStyles>, TOmit>;
45
+ export type WithVariants<TSource extends Record<string, unknown>, TStyles extends VariantProps<any>> = TSource & Without<TStyles, TSource>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casinogate/ui",
3
- "version": "1.10.18",
3
+ "version": "1.10.19",
4
4
  "svelte": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
@@ -27,11 +27,11 @@
27
27
  "devDependencies": {
28
28
  "@chromatic-com/storybook": "^4.1.2",
29
29
  "@poppanator/sveltekit-svg": "^6.0.0",
30
- "@storybook/addon-a11y": "^10.0.3",
31
- "@storybook/addon-docs": "^10.0.3",
32
- "@storybook/addon-svelte-csf": "^5.0.10",
33
- "@storybook/addon-vitest": "^10.0.3",
34
- "@storybook/sveltekit": "^10.0.3",
30
+ "@storybook/addon-a11y": "^10.2.17",
31
+ "@storybook/addon-docs": "^10.2.17",
32
+ "@storybook/addon-svelte-csf": "^5.0.11",
33
+ "@storybook/addon-vitest": "^10.2.17",
34
+ "@storybook/sveltekit": "^10.2.17",
35
35
  "@sveltejs/adapter-static": "^3.0.8",
36
36
  "@sveltejs/kit": "^2.48.4",
37
37
  "@sveltejs/package": "^2.5.4",
@@ -45,7 +45,7 @@
45
45
  "prettier": "^3.6.2",
46
46
  "prettier-plugin-svelte": "^3.4.0",
47
47
  "publint": "^0.3.15",
48
- "storybook": "^10.0.3",
48
+ "storybook": "^10.2.17",
49
49
  "svelte": "^5.36.1",
50
50
  "svelte-check": "^4.3.0",
51
51
  "tailwind-scrollbar": "^4.0.2",
@@ -64,7 +64,7 @@
64
64
  "dependencies": {
65
65
  "@tanstack/table-core": "^8.21.3",
66
66
  "@zag-js/collection": "^1.30.0",
67
- "bits-ui": "^2.8.11",
67
+ "bits-ui": "2.16.3",
68
68
  "runed": "^0.35.1",
69
69
  "svelte-toolbelt": "^0.10.6",
70
70
  "tailwind-merge": "^3.3.1",