@casinogate/ui 1.1.3 → 1.2.0

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 (75) hide show
  1. package/dist/assets/css/root.css +127 -20
  2. package/dist/assets/css/theme.css +2 -2
  3. package/dist/components/app-shell/app-shell.stories.svelte +107 -0
  4. package/dist/components/app-shell/app-shell.stories.svelte.d.ts +18 -0
  5. package/dist/components/app-shell/components/app-shell.content.svelte +45 -0
  6. package/dist/components/app-shell/components/app-shell.content.svelte.d.ts +7 -0
  7. package/dist/components/app-shell/components/app-shell.header.svelte +45 -0
  8. package/dist/components/app-shell/components/app-shell.header.svelte.d.ts +7 -0
  9. package/dist/components/app-shell/components/app-shell.nav-bar.svelte +45 -0
  10. package/dist/components/app-shell/components/app-shell.nav-bar.svelte.d.ts +7 -0
  11. package/dist/components/app-shell/components/app-shell.root.svelte +70 -0
  12. package/dist/components/app-shell/components/app-shell.root.svelte.d.ts +13 -0
  13. package/dist/components/app-shell/components/app-shell.sidebar-footer.svelte +45 -0
  14. package/dist/components/app-shell/components/app-shell.sidebar-footer.svelte.d.ts +7 -0
  15. package/dist/components/app-shell/components/app-shell.sidebar-head.svelte +45 -0
  16. package/dist/components/app-shell/components/app-shell.sidebar-head.svelte.d.ts +7 -0
  17. package/dist/components/app-shell/components/app-shell.sidebar-toggle.svelte +55 -0
  18. package/dist/components/app-shell/components/app-shell.sidebar-toggle.svelte.d.ts +7 -0
  19. package/dist/components/app-shell/components/app-shell.sidebar.svelte +45 -0
  20. package/dist/components/app-shell/components/app-shell.sidebar.svelte.d.ts +7 -0
  21. package/dist/components/app-shell/components/app-shell.svelte.d.ts +122 -0
  22. package/dist/components/app-shell/components/app-shell.svelte.js +184 -0
  23. package/dist/components/app-shell/components/app-shell.viewport.svelte +45 -0
  24. package/dist/components/app-shell/components/app-shell.viewport.svelte.d.ts +7 -0
  25. package/dist/components/app-shell/index.d.ts +20 -0
  26. package/dist/components/app-shell/index.js +20 -0
  27. package/dist/components/app-shell/styles.d.ts +83 -0
  28. package/dist/components/app-shell/styles.js +67 -0
  29. package/dist/components/app-shell/types.d.ts +7 -0
  30. package/dist/components/app-shell/types.js +1 -0
  31. package/dist/components/button-group/components/button-group.root.svelte +1 -2
  32. package/dist/components/checkbox/components/checkbox.root.svelte +2 -1
  33. package/dist/components/collapsible/components/collapsaible.content.svelte +1 -2
  34. package/dist/components/collapsible/components/collapsaible.root.svelte +1 -2
  35. package/dist/components/collapsible/components/collapsaible.trigger.svelte +1 -2
  36. package/dist/components/data-table/components/data-table.body.svelte +2 -2
  37. package/dist/components/data-table/components/data-table.cell.svelte +1 -2
  38. package/dist/components/data-table/components/data-table.head.svelte +1 -2
  39. package/dist/components/data-table/components/data-table.header.svelte +1 -2
  40. package/dist/components/data-table/components/data-table.resize-handler.svelte +1 -2
  41. package/dist/components/data-table/components/data-table.root.svelte +2 -3
  42. package/dist/components/data-table/components/data-table.root.svelte.d.ts +1 -2
  43. package/dist/components/data-table/components/data-table.row.svelte +1 -2
  44. package/dist/components/data-table/components/data-table.sort-button.svelte +1 -2
  45. package/dist/components/data-table/components/data-table.table.svelte +2 -3
  46. package/dist/components/data-table/components/data-table.table.svelte.d.ts +1 -2
  47. package/dist/components/field/components/field.control.svelte +1 -1
  48. package/dist/components/field/components/field.description.svelte +1 -2
  49. package/dist/components/field/components/field.error.svelte +1 -2
  50. package/dist/components/field/components/field.label.svelte +1 -2
  51. package/dist/components/field/components/field.root.svelte +1 -2
  52. package/dist/components/icons/index.d.ts +1 -0
  53. package/dist/components/icons/index.js +1 -0
  54. package/dist/components/icons/sidebar-toggle.svelte +16 -0
  55. package/dist/components/icons/sidebar-toggle.svelte.d.ts +3 -0
  56. package/dist/components/input/input.password.svelte +1 -0
  57. package/dist/components/input/input.svelte +2 -3
  58. package/dist/components/segment/components/segment.item.svelte +1 -2
  59. package/dist/components/segment/components/segment.root.svelte +1 -2
  60. package/dist/components/select/components/select.trigger.svelte +2 -2
  61. package/dist/components/skeleton/skeleton.svelte +9 -3
  62. package/dist/components/skeleton/skeleton.svelte.d.ts +1 -0
  63. package/dist/components/skeleton/styles.d.ts +14 -2
  64. package/dist/components/skeleton/styles.js +5 -1
  65. package/dist/components/switch/components/switch.root.svelte +2 -2
  66. package/dist/components/switch/components/switch.thumb.svelte +2 -2
  67. package/dist/index.d.ts +1 -0
  68. package/dist/index.js +1 -0
  69. package/dist/internal/utils/attrs.d.ts +1 -0
  70. package/dist/internal/utils/attrs.js +3 -0
  71. package/dist/internal/utils/common.d.ts +1 -0
  72. package/dist/internal/utils/common.js +2 -0
  73. package/dist/internal/utils/styles.d.ts +2 -0
  74. package/dist/internal/utils/styles.js +2 -0
  75. package/package.json +1 -1
@@ -0,0 +1,83 @@
1
+ import { Context } from 'runed';
2
+ import type { ReadableBox } from 'svelte-toolbelt';
3
+ import type { VariantProps } from 'tailwind-variants';
4
+ export declare const appShellVariants: import("tailwind-variants").TVReturnType<{
5
+ layout: {
6
+ stacked: {
7
+ sidebar: string[];
8
+ };
9
+ adjacent: {
10
+ header: string[];
11
+ };
12
+ };
13
+ withBorder: {
14
+ true: {
15
+ header: string[];
16
+ sidebar: string[];
17
+ };
18
+ };
19
+ }, {
20
+ root: string[];
21
+ header: string[];
22
+ sidebar: string[];
23
+ content: string[];
24
+ viewport: string[];
25
+ sidebarToggle: string[];
26
+ sidebarHead: string[];
27
+ sidebarFooter: string[];
28
+ navBar: string[];
29
+ }, undefined, {
30
+ layout: {
31
+ stacked: {
32
+ sidebar: string[];
33
+ };
34
+ adjacent: {
35
+ header: string[];
36
+ };
37
+ };
38
+ withBorder: {
39
+ true: {
40
+ header: string[];
41
+ sidebar: string[];
42
+ };
43
+ };
44
+ }, {
45
+ root: string[];
46
+ header: string[];
47
+ sidebar: string[];
48
+ content: string[];
49
+ viewport: string[];
50
+ sidebarToggle: string[];
51
+ sidebarHead: string[];
52
+ sidebarFooter: string[];
53
+ navBar: string[];
54
+ }, import("tailwind-variants").TVReturnType<{
55
+ layout: {
56
+ stacked: {
57
+ sidebar: string[];
58
+ };
59
+ adjacent: {
60
+ header: string[];
61
+ };
62
+ };
63
+ withBorder: {
64
+ true: {
65
+ header: string[];
66
+ sidebar: string[];
67
+ };
68
+ };
69
+ }, {
70
+ root: string[];
71
+ header: string[];
72
+ sidebar: string[];
73
+ content: string[];
74
+ viewport: string[];
75
+ sidebarToggle: string[];
76
+ sidebarHead: string[];
77
+ sidebarFooter: string[];
78
+ navBar: string[];
79
+ }, undefined, unknown, unknown, undefined>>;
80
+ export type AppShellVariantsProps = VariantProps<typeof appShellVariants>;
81
+ type AppShellStylesContextValues = ReadableBox<ReturnType<typeof appShellVariants>>;
82
+ export declare const AppShellStylesContext: Context<AppShellStylesContextValues>;
83
+ export {};
@@ -0,0 +1,67 @@
1
+ import { keyWithPrefix } from '../../internal/utils/common.js';
2
+ import { tv } from '../../internal/utils/tailwindcss.js';
3
+ import { Context } from 'runed';
4
+ export const appShellVariants = tv({
5
+ slots: {
6
+ root: ['cgui:group/appShell', 'cgui:relative', 'cgui:size-full', 'cgui:bg-bg-main'],
7
+ header: [
8
+ 'cgui:fixed cgui:top-0 cgui:right-0 cgui:h-(--app-shell-header-height) cgui:w-full',
9
+ 'cgui:flex cgui:items-center',
10
+ 'cgui:transition-(width) cgui:duration-250 cgui:ease-in-out',
11
+ 'cgui:bg-surface-white',
12
+ ],
13
+ sidebar: [
14
+ 'cgui:flex cgui:flex-col',
15
+ 'cgui:h-full cgui:w-(--app-shell-sidebar-width) cgui:data-[collapsed]:w-(--app-shell-sidebar-collapsed-width)',
16
+ 'cgui:bg-surface-darkest',
17
+ 'cgui:transition-(width) cgui:duration-250 cgui:ease-in-out',
18
+ 'cgui:fixed cgui:left-0 cgui:bottom-0',
19
+ 'cgui:will-change-width',
20
+ ],
21
+ content: [
22
+ 'cgui:overflow-y-auto',
23
+ 'cgui:size-full cgui:flex cgui:flex-col cgui:grow',
24
+ 'cgui:transition-all cgui:duration-250 cgui:ease-in-out',
25
+ ],
26
+ viewport: [
27
+ 'cgui:size-full cgui:overflow-hidden cgui:flex cgui:flex-col cgui:grow',
28
+ 'cgui:transition-all cgui:duration-250 cgui:ease-in-out',
29
+ 'cgui:group-has-[[data-slot="sidebar"]]/appShell:pl-(--app-shell-sidebar-width) cgui:group-data-[collapsed]/appShell:group-has-[[data-slot="sidebar"]]/appShell:pl-(--app-shell-sidebar-collapsed-width)',
30
+ 'cgui:group-has-[[data-slot="header"]]/appShell:pt-(--app-shell-header-height)',
31
+ ],
32
+ sidebarToggle: [
33
+ 'cgui:flex cgui:items-center cgui:justify-center',
34
+ 'cgui:transparent cgui:cursor-pointer cgui:size-6 cgui:text-icon-default',
35
+ 'cgui:disabled:opacity-50 cgui:disabled:cursor-not-allowed',
36
+ ],
37
+ sidebarHead: [
38
+ 'cgui:flex cgui:items-center cgui:shrink-0 cgui:p-4',
39
+ 'cgui:border-b cgui:border-b-stroke-minimum/10',
40
+ ],
41
+ sidebarFooter: [
42
+ 'cgui:flex cgui:items-center cgui:shrink-0 cgui:px-4 cgui:pt-4 cgui:pb-3',
43
+ 'cgui:border-t cgui:border-t-stroke-minimum/10',
44
+ ],
45
+ navBar: ['cgui:flex cgui:flex-col cgui:grow'],
46
+ },
47
+ variants: {
48
+ layout: {
49
+ stacked: {
50
+ sidebar: ['cgui:group-has-[[data-slot="header"]]/appShell:h-[calc(100%-var(--app-shell-header-height))]'],
51
+ },
52
+ adjacent: {
53
+ header: [
54
+ 'cgui:group-has-[[data-slot="sidebar"]]/appShell:w-[calc(100%-var(--app-shell-sidebar-width))]',
55
+ 'cgui:group-data-[collapsed]/appShell:group-has-[[data-slot="sidebar"]]/appShell:w-[calc(100%-var(--app-shell-sidebar-collapsed-width))] ',
56
+ ],
57
+ },
58
+ },
59
+ withBorder: {
60
+ true: {
61
+ header: ['cgui:border-b cgui:border-stroke-divider'],
62
+ sidebar: ['cgui:border-r cgui:border-stroke-divider'],
63
+ },
64
+ },
65
+ },
66
+ });
67
+ export const AppShellStylesContext = new Context(keyWithPrefix('app-shell-styles'));
@@ -0,0 +1,7 @@
1
+ export type AppShellSidebarConfiguration = {
2
+ width?: number;
3
+ collapsedWidth?: number;
4
+ };
5
+ export type AppShellHeaderConfiguration = {
6
+ height?: number;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -8,8 +8,7 @@
8
8
  <script lang="ts">
9
9
  import { SLOT_ATTR_NAME } from '../../../internal/constants/attrs.js';
10
10
  import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
11
- import { cn } from '../../../internal/utils/common.js';
12
- import { useId } from 'bits-ui';
11
+ import { cn, useId } from '../../../internal/utils/common.js';
13
12
  import { box, type WithChildren, type WithElementRef, type Without } from 'svelte-toolbelt';
14
13
  import type { ButtonGroupVariantsProps } from '../styles.js';
15
14
  import { ButtonGroupStylesContext, buttonGroupStyles } from '../styles.js';
@@ -5,7 +5,8 @@
5
5
  <script lang="ts">
6
6
  import { checkboxVariants, type CheckboxVariantsProps } from '../styles.js';
7
7
  import { CheckIcon } from '../../icons/index.js';
8
- import { Checkbox, useId, type CheckboxRootProps as CheckboxRootPropsPrimitive } from 'bits-ui';
8
+ import { useId } from '../../../internal/utils/common.js';
9
+ import { Checkbox, type CheckboxRootProps as CheckboxRootPropsPrimitive } from 'bits-ui';
9
10
  import { cubicInOut } from 'svelte/easing';
10
11
  import { fly } from 'svelte/transition';
11
12
 
@@ -5,11 +5,10 @@
5
5
  <script lang="ts">
6
6
  import { CollapsibleStylesContext } from '../styles.js';
7
7
 
8
- import { cn } from '../../../internal/utils/common.js';
8
+ import { cn, useId } from '../../../internal/utils/common.js';
9
9
 
10
10
  import {
11
11
  Collapsible as CollapsiblePrimitive,
12
- useId,
13
12
  type CollapsibleContentProps as CollapsibleContentPropsPrimitive,
14
13
  } from 'bits-ui';
15
14
  import { fade } from 'svelte/transition';
@@ -4,10 +4,9 @@
4
4
 
5
5
  <script lang="ts">
6
6
  import { CollapsibleStylesContext, collapsibleVariants } from '../styles.js';
7
- import { cn } from '../../../internal/utils/common.js';
7
+ import { cn, useId } from '../../../internal/utils/common.js';
8
8
  import {
9
9
  Collapsible as CollapsiblePrimitive,
10
- useId,
11
10
  type CollapsibleRootProps as CollapsibleRootPropsPrimitive,
12
11
  } from 'bits-ui';
13
12
  import { box, mergeProps } from 'svelte-toolbelt';
@@ -7,11 +7,10 @@
7
7
  <script lang="ts">
8
8
  import { CollapsibleStylesContext } from '../styles.js';
9
9
  import { ChevronSmallRightIcon } from '../../icons/index.js';
10
- import { cn } from '../../../internal/utils/common.js';
10
+ import { cn, useId } from '../../../internal/utils/common.js';
11
11
 
12
12
  import {
13
13
  Collapsible as CollapsiblePrimitive,
14
- useId,
15
14
  type CollapsibleTriggerProps as CollapsibleTriggerPropsPrimitive,
16
15
  } from 'bits-ui';
17
16
  import type { Snippet } from 'svelte';
@@ -7,8 +7,8 @@
7
7
 
8
8
  <script lang="ts">
9
9
  import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
10
- import { cn } from '../../../internal/utils/common.js';
11
- import { useId, type WithChildren } from 'bits-ui';
10
+ import { cn, useId } from '../../../internal/utils/common.js';
11
+ import { type WithChildren } from 'bits-ui';
12
12
  import { box, mergeProps, type WithElementRef, type Without } from 'svelte-toolbelt';
13
13
  import { DataTableStylesContext } from '../styles.js';
14
14
  import { DataTableBodyState } from './data-table.svelte.js';
@@ -15,9 +15,8 @@
15
15
  import { DataTableCellState } from './data-table.svelte.js';
16
16
 
17
17
  import type { PrimitiveTdAttributes } from '../../../internal/types/html-attributes.js';
18
- import { cn } from '../../../internal/utils/common.js';
18
+ import { cn, useId } from '../../../internal/utils/common.js';
19
19
  import type { Cell } from '@tanstack/table-core';
20
- import { useId } from 'bits-ui';
21
20
  import { box, mergeProps, type WithChildren, type WithElementRef, type Without } from 'svelte-toolbelt';
22
21
 
23
22
  let {
@@ -15,9 +15,8 @@
15
15
  import { DataTableHeadState } from './data-table.svelte.js';
16
16
 
17
17
  import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
18
- import { cn } from '../../../internal/utils/common.js';
18
+ import { cn, useId } from '../../../internal/utils/common.js';
19
19
  import type { Header } from '@tanstack/table-core';
20
- import { useId } from 'bits-ui';
21
20
  import { box, mergeProps, type WithChildren, type WithElementRef, type Without } from 'svelte-toolbelt';
22
21
 
23
22
  let {
@@ -11,8 +11,7 @@
11
11
  import { DataTableStylesContext } from '../styles.js';
12
12
 
13
13
  import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
14
- import { cn } from '../../../internal/utils/common.js';
15
- import { useId } from 'bits-ui';
14
+ import { cn, useId } from '../../../internal/utils/common.js';
16
15
  import { box, mergeProps, type WithChildren, type WithElementRef, type Without } from 'svelte-toolbelt';
17
16
 
18
17
  let {
@@ -7,8 +7,7 @@
7
7
 
8
8
  <script lang="ts">
9
9
  import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
10
- import { cn } from '../../../internal/utils/common.js';
11
- import { useId } from 'bits-ui';
10
+ import { cn, useId } from '../../../internal/utils/common.js';
12
11
  import { box, mergeProps, type WithElementRef, type Without } from 'svelte-toolbelt';
13
12
  import { DataTableStylesContext } from '../styles.js';
14
13
  import { DataTableResizeHandlerState } from './data-table.svelte.js';
@@ -13,10 +13,9 @@
13
13
  <script lang="ts" generics="TData extends RowData">
14
14
  import type { CreateTableReturn } from '../models/create-table.svelte.js';
15
15
  import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
16
- import { cn } from '../../../internal/utils/common.js';
16
+ import { cn, useId } from '../../../internal/utils/common.js';
17
17
  import type { RowData } from '@tanstack/table-core';
18
- import { useId, type Without } from 'bits-ui';
19
- import { box, mergeProps, type WithChildren, type WithElementRef } from 'svelte-toolbelt';
18
+ import { box, mergeProps, type WithChildren, type WithElementRef, type Without } from 'svelte-toolbelt';
20
19
  import { DataTableStylesContext, dataTableVariants, type DataTableVariantsProps } from '../styles.js';
21
20
  import { DataTableRootState } from './data-table.svelte.js';
22
21
 
@@ -5,8 +5,7 @@ export type DataTableRootProps<TData extends RowData> = DataTableRootPropsWithou
5
5
  import type { CreateTableReturn } from '../models/create-table.svelte.js';
6
6
  import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
7
7
  import type { RowData } from '@tanstack/table-core';
8
- import { type Without } from 'bits-ui';
9
- import { type WithChildren, type WithElementRef } from 'svelte-toolbelt';
8
+ import { type WithChildren, type WithElementRef, type Without } from 'svelte-toolbelt';
10
9
  import { type DataTableVariantsProps } from '../styles.js';
11
10
  declare function $$render<TData extends RowData>(): {
12
11
  props: DataTableRootProps<TData>;
@@ -11,8 +11,7 @@
11
11
  import { DataTableRowState } from './data-table.svelte.js';
12
12
 
13
13
  import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
14
- import { cn } from '../../../internal/utils/common.js';
15
- import { useId } from 'bits-ui';
14
+ import { cn, useId } from '../../../internal/utils/common.js';
16
15
  import { box, mergeProps, type WithChildren, type WithElementRef, type Without } from 'svelte-toolbelt';
17
16
 
18
17
  let { ref = $bindable(null), id = useId(), children, class: className, ...restProps }: DataTableRowProps = $props();
@@ -8,8 +8,7 @@
8
8
  <script lang="ts">
9
9
  import { SortIcon } from '../../icons/index.js';
10
10
  import type { PrimitiveButtonAttributes } from '../../../internal/types/html-attributes.js';
11
- import { cn } from '../../../internal/utils/common.js';
12
- import { useId } from 'bits-ui';
11
+ import { cn, useId } from '../../../internal/utils/common.js';
13
12
  import { box, mergeProps, type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
14
13
  import { DataTableStylesContext } from '../styles.js';
15
14
  import { DataTableSortButtonState } from './data-table.svelte.js';
@@ -7,9 +7,8 @@
7
7
 
8
8
  <script lang="ts">
9
9
  import type { PrimitiveTableAttributes } from '../../../internal/types/html-attributes.js';
10
- import { cn } from '../../../internal/utils/common.js';
11
- import { useId, type Without } from 'bits-ui';
12
- import { box, mergeProps, type WithChildren, type WithElementRef } from 'svelte-toolbelt';
10
+ import { cn, useId } from '../../../internal/utils/common.js';
11
+ import { box, mergeProps, type WithChildren, type WithElementRef, type Without } from 'svelte-toolbelt';
13
12
  import { DataTableStylesContext } from '../styles.js';
14
13
  import { DataTableTableState } from './data-table.svelte.js';
15
14
 
@@ -1,8 +1,7 @@
1
1
  type DataTableTablePropsWithoutHTML = WithElementRef<WithChildren<{}>>;
2
2
  export type DataTableTableProps = DataTableTablePropsWithoutHTML & Without<PrimitiveTableAttributes, DataTableTablePropsWithoutHTML>;
3
3
  import type { PrimitiveTableAttributes } from '../../../internal/types/html-attributes.js';
4
- import { type Without } from 'bits-ui';
5
- import { type WithChildren, type WithElementRef } from 'svelte-toolbelt';
4
+ import { type WithChildren, type WithElementRef, type Without } from 'svelte-toolbelt';
6
5
  declare const DataTable: import("svelte").Component<DataTableTableProps, {}, "ref">;
7
6
  type DataTable = ReturnType<typeof DataTable>;
8
7
  export default DataTable;
@@ -7,7 +7,7 @@
7
7
  </script>
8
8
 
9
9
  <script lang="ts">
10
- import { useId } from 'bits-ui';
10
+ import { useId } from '../../../internal/utils/common.js';
11
11
  import type { Snippet } from 'svelte';
12
12
  import { box, mergeProps } from 'svelte-toolbelt';
13
13
  import { FieldControlState } from './field.svelte.js';
@@ -7,8 +7,7 @@
7
7
 
8
8
  <script lang="ts">
9
9
  import type { PrimitiveSpanAttributes } from '../../../internal/types/html-attributes.js';
10
- import { cn } from '../../../internal/utils/common.js';
11
- import { useId } from 'bits-ui';
10
+ import { cn, useId } from '../../../internal/utils/common.js';
12
11
 
13
12
  import { box, mergeProps, type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
14
13
  import { FieldStylesContext } from '../styles.js';
@@ -7,8 +7,7 @@
7
7
 
8
8
  <script lang="ts">
9
9
  import type { PrimitiveSpanAttributes } from '../../../internal/types/html-attributes.js';
10
- import { cn } from '../../../internal/utils/common.js';
11
- import { useId } from 'bits-ui';
10
+ import { cn, useId } from '../../../internal/utils/common.js';
12
11
  import { FieldStylesContext } from '../styles.js';
13
12
  import { FieldErrorState } from './field.svelte.js';
14
13
 
@@ -11,8 +11,7 @@
11
11
  import { FieldStylesContext } from '../styles.js';
12
12
 
13
13
  import type { PrimitiveLabelAttributes } from '../../../internal/types/html-attributes.js';
14
- import { cn } from '../../../internal/utils/common.js';
15
- import { useId } from 'bits-ui';
14
+ import { cn, useId } from '../../../internal/utils/common.js';
16
15
 
17
16
  import { box, mergeProps, type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
18
17
 
@@ -16,8 +16,7 @@
16
16
 
17
17
  <script lang="ts">
18
18
  import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
19
- import { cn } from '../../../internal/utils/common.js';
20
- import { useId } from 'bits-ui';
19
+ import { cn, useId } from '../../../internal/utils/common.js';
21
20
  import { box, mergeProps, type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
22
21
  import { fieldStyles, FieldStylesContext } from '../styles.js';
23
22
  import { FieldRootState } from './field.svelte.js';
@@ -15,6 +15,7 @@ export { default as EyeCrossedIcon } from './eye-crossed.svelte';
15
15
  export { default as EyeIcon } from './eye.svelte';
16
16
  export { default as InfoIcon } from './info.svelte';
17
17
  export { default as MinusIcon } from './minus.svelte';
18
+ export { default as SidebarToggleIcon } from './sidebar-toggle.svelte';
18
19
  export { default as SortIcon } from './sort.svelte';
19
20
  export { default as SpinnerIcon } from './spinner.svelte';
20
21
  export { default as SuccessIcon } from './success.svelte';
@@ -15,6 +15,7 @@ export { default as EyeCrossedIcon } from './eye-crossed.svelte';
15
15
  export { default as EyeIcon } from './eye.svelte';
16
16
  export { default as InfoIcon } from './info.svelte';
17
17
  export { default as MinusIcon } from './minus.svelte';
18
+ export { default as SidebarToggleIcon } from './sidebar-toggle.svelte';
18
19
  export { default as SortIcon } from './sort.svelte';
19
20
  export { default as SpinnerIcon } from './spinner.svelte';
20
21
  export { default as SuccessIcon } from './success.svelte';
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import type { IconProps } from './types.js';
3
+
4
+ let props: IconProps = $props();
5
+ </script>
6
+
7
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
8
+ <path
9
+ d="M3 8.229V15.771C3 17.112 3.324 18.228 3.945 19.083C4.206 19.461 4.539 19.794 4.917 20.055C5.655 20.595 6.591 20.91 7.698 20.982V3.027C4.746 3.216 3 5.133 3 8.229Z"
10
+ fill="currentColor"
11
+ />
12
+ <path
13
+ d="M20.055 4.917C19.794 4.539 19.461 4.206 19.083 3.945C18.228 3.324 17.112 3 15.771 3H9.048V21H15.771C19.047 21 21 19.047 21 15.771V8.229C21 6.888 20.676 5.772 20.055 4.917ZM15.15 13.827C15.411 14.088 15.411 14.52 15.15 14.781C15.015 14.916 14.844 14.979 14.673 14.979C14.502 14.979 14.331 14.916 14.196 14.781L11.892 12.477C11.631 12.216 11.631 11.784 11.892 11.523L14.196 9.219C14.457 8.958 14.889 8.958 15.15 9.219C15.411 9.48 15.411 9.912 15.15 10.173L13.332 12L15.15 13.827Z"
14
+ fill="currentColor"
15
+ />
16
+ </svg>
@@ -0,0 +1,3 @@
1
+ declare const SidebarToggle: import("svelte").Component<import("../../internal/types/html-attributes.js").PrimitiveSVGAttributes, {}, "">;
2
+ type SidebarToggle = ReturnType<typeof SidebarToggle>;
3
+ export default SidebarToggle;
@@ -27,6 +27,7 @@
27
27
  <Input bind:ref bind:value {type} {...restProps}>
28
28
  {#snippet endChevron()}
29
29
  <button
30
+ type="button"
30
31
  onclick={togglePassword}
31
32
  class={cn(
32
33
  'cgui:cursor-pointer cgui:p-0 cgui:flex cgui:items-center cgui:justify-center cgui:bg-transparent cgui:border-none',
@@ -1,8 +1,7 @@
1
1
  <script lang="ts" module>
2
2
  import type { PrimitiveInputAttributes } from '../../internal/types/html-attributes.js';
3
3
  import { getDataActive } from '../../internal/utils/attrs.js';
4
- import { cn } from '../../internal/utils/common.js';
5
- import { useId } from 'bits-ui';
4
+ import { cn, useId } from '../../internal/utils/common.js';
6
5
  import type { Snippet } from 'svelte';
7
6
  import type { WithElementRef, Without } from 'svelte-toolbelt';
8
7
  import { type InputVariants, inputStyles } from './styles.js';
@@ -63,5 +62,5 @@
63
62
  {/if}
64
63
  </div>
65
64
  {:else}
66
- <input bind:this={ref} {id} data-slot="input" class={cn(variants.input(), className)} {...restProps} />
65
+ <input bind:this={ref} bind:value {id} data-slot="input" class={cn(variants.input(), className)} {...restProps} />
67
66
  {/if}
@@ -1,7 +1,6 @@
1
1
  <script lang="ts" module>
2
2
  import type { PrimitiveButtonAttributes } from '../../../internal/types/html-attributes.js';
3
- import { cn } from '../../../internal/utils/common.js';
4
- import { useId } from 'bits-ui';
3
+ import { cn, useId } from '../../../internal/utils/common.js';
5
4
  import { box, mergeProps, type WithChildren, type WithElementRef, type Without } from 'svelte-toolbelt';
6
5
  import { SegmentStylesContext } from '../styles.js';
7
6
  import { SegmentItemState } from './segmet.svelte.js';
@@ -1,8 +1,7 @@
1
1
  <script lang="ts" module>
2
2
  import type { Without } from '../../../internal/types/common.js';
3
3
  import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
4
- import { cn } from '../../../internal/utils/common.js';
5
- import { useId } from 'bits-ui';
4
+ import { cn, useId } from '../../../internal/utils/common.js';
6
5
  import { box, mergeProps, type WithChildren, type WithElementRef } from 'svelte-toolbelt';
7
6
  import { SegmentStylesContext, segmentVariants, type SegmentVariantsProps } from '../styles.js';
8
7
  import { SegmentRootState } from './segmet.svelte.js';
@@ -8,8 +8,8 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import { getDataActive } from '../../../internal/utils/attrs.js';
11
- import { cn } from '../../../internal/utils/common.js';
12
- import { Select as SelectPrimitive, useId, type SelectTriggerProps as SelectTriggerPropsPrimitive } from 'bits-ui';
11
+ import { cn, useId } from '../../../internal/utils/common.js';
12
+ import { Select as SelectPrimitive, type SelectTriggerProps as SelectTriggerPropsPrimitive } from 'bits-ui';
13
13
  import type { Snippet } from 'svelte';
14
14
  import type { WithoutChild } from 'svelte-toolbelt';
15
15
  import { SelectStylesContext } from '../styles.js';
@@ -6,6 +6,8 @@
6
6
 
7
7
  type SkeletonPropsWithoutHTML = WithElementRef<{
8
8
  count?: number;
9
+
10
+ as?: keyof HTMLElementTagNameMap;
9
11
  }> &
10
12
  SkeletonVariantProps;
11
13
 
@@ -19,13 +21,17 @@
19
21
  w = 'clear',
20
22
  rounded = 'md',
21
23
  variant = 'clear',
24
+ as = 'div',
22
25
  count = 1,
26
+ color = 'default',
23
27
  ...restProps
24
28
  }: SkeletonProps = $props();
25
29
 
26
- const variants = $derived(skeletonStyles({ w, rounded, variant }));
30
+ const variants = $derived(skeletonStyles({ w, rounded, variant, color }));
31
+
32
+ const items = $derived(Array.from({ length: count }).map((_, idx) => idx));
27
33
  </script>
28
34
 
29
- {#each Array.from({ length: count }) as i (i)}
30
- <div class={cn(variants, className)} {...restProps}></div>
35
+ {#each items as item (item)}
36
+ <svelte:element this={as} class={cn(variants, className)} {...restProps}></svelte:element>
31
37
  {/each}
@@ -3,6 +3,7 @@ import type { WithElementRef, Without } from 'svelte-toolbelt';
3
3
  import { type SkeletonVariantProps } from './styles.js';
4
4
  type SkeletonPropsWithoutHTML = WithElementRef<{
5
5
  count?: number;
6
+ as?: keyof HTMLElementTagNameMap;
6
7
  }> & SkeletonVariantProps;
7
8
  export type SkeletonProps = SkeletonPropsWithoutHTML & Without<PrimitiveDivAttributes, SkeletonPropsWithoutHTML>;
8
9
  declare const Skeleton: import("svelte").Component<SkeletonProps, {}, "ref">;
@@ -1,5 +1,9 @@
1
1
  import type { VariantProps } from 'tailwind-variants';
2
2
  export declare const skeletonStyles: import("tailwind-variants").TVReturnType<{
3
+ color: {
4
+ default: string;
5
+ surface: string;
6
+ };
3
7
  w: {
4
8
  full: string;
5
9
  clear: string;
@@ -24,7 +28,11 @@ export declare const skeletonStyles: import("tailwind-variants").TVReturnType<{
24
28
  'avatar-lg': string;
25
29
  clear: string;
26
30
  };
27
- }, undefined, "cgui:animate-pulse cgui:bg-neutral-20", {
31
+ }, undefined, "cgui:animate-pulse", {
32
+ color: {
33
+ default: string;
34
+ surface: string;
35
+ };
28
36
  w: {
29
37
  full: string;
30
38
  clear: string;
@@ -50,6 +58,10 @@ export declare const skeletonStyles: import("tailwind-variants").TVReturnType<{
50
58
  clear: string;
51
59
  };
52
60
  }, undefined, import("tailwind-variants").TVReturnType<{
61
+ color: {
62
+ default: string;
63
+ surface: string;
64
+ };
53
65
  w: {
54
66
  full: string;
55
67
  clear: string;
@@ -74,5 +86,5 @@ export declare const skeletonStyles: import("tailwind-variants").TVReturnType<{
74
86
  'avatar-lg': string;
75
87
  clear: string;
76
88
  };
77
- }, undefined, "cgui:animate-pulse cgui:bg-neutral-20", unknown, unknown, undefined>>;
89
+ }, undefined, "cgui:animate-pulse", unknown, unknown, undefined>>;
78
90
  export type SkeletonVariantProps = VariantProps<typeof skeletonStyles>;
@@ -1,7 +1,11 @@
1
1
  import { tv } from '../../internal/utils/tailwindcss.js';
2
2
  export const skeletonStyles = tv({
3
- base: 'cgui:animate-pulse cgui:bg-neutral-20',
3
+ base: 'cgui:animate-pulse',
4
4
  variants: {
5
+ color: {
6
+ default: 'cgui:bg-neutral-20',
7
+ surface: 'cgui:bg-surface-lightest',
8
+ },
5
9
  w: {
6
10
  full: 'cgui:w-full',
7
11
  clear: '',
@@ -7,8 +7,8 @@
7
7
 
8
8
  import { SwitchStylesContext, switchVariants, type SwitchVariantsProps } from '../styles.js';
9
9
 
10
- import { cn } from '../../../internal/utils/common.js';
11
- import { Switch as SwitchPrimitive, useId, type SwitchRootProps as SwitchRootPropsPrimitive } from 'bits-ui';
10
+ import { cn, useId } from '../../../internal/utils/common.js';
11
+ import { Switch as SwitchPrimitive, type SwitchRootProps as SwitchRootPropsPrimitive } from 'bits-ui';
12
12
 
13
13
  let {
14
14
  id = useId(),