@casinogate/ui 1.3.1 → 1.3.3

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 (266) hide show
  1. package/dist/components/app-shell/components/app-shell.content.svelte +5 -10
  2. package/dist/components/app-shell/components/app-shell.content.svelte.d.ts +1 -4
  3. package/dist/components/app-shell/components/app-shell.header.svelte +5 -10
  4. package/dist/components/app-shell/components/app-shell.header.svelte.d.ts +1 -4
  5. package/dist/components/app-shell/components/app-shell.nav-bar.svelte +5 -10
  6. package/dist/components/app-shell/components/app-shell.nav-bar.svelte.d.ts +1 -4
  7. package/dist/components/app-shell/components/app-shell.root.svelte +6 -21
  8. package/dist/components/app-shell/components/app-shell.root.svelte.d.ts +2 -11
  9. package/dist/components/app-shell/components/app-shell.sidebar-footer.svelte +5 -10
  10. package/dist/components/app-shell/components/app-shell.sidebar-footer.svelte.d.ts +1 -4
  11. package/dist/components/app-shell/components/app-shell.sidebar-head.svelte +5 -10
  12. package/dist/components/app-shell/components/app-shell.sidebar-head.svelte.d.ts +1 -4
  13. package/dist/components/app-shell/components/app-shell.sidebar-toggle.svelte +7 -12
  14. package/dist/components/app-shell/components/app-shell.sidebar-toggle.svelte.d.ts +1 -4
  15. package/dist/components/app-shell/components/app-shell.sidebar.svelte +5 -10
  16. package/dist/components/app-shell/components/app-shell.sidebar.svelte.d.ts +1 -4
  17. package/dist/components/app-shell/components/app-shell.viewport.svelte +5 -10
  18. package/dist/components/app-shell/components/app-shell.viewport.svelte.d.ts +1 -4
  19. package/dist/components/app-shell/exports-primitive.d.ts +9 -0
  20. package/dist/components/app-shell/exports-primitive.js +9 -0
  21. package/dist/components/app-shell/index.d.ts +2 -20
  22. package/dist/components/app-shell/index.js +1 -20
  23. package/dist/components/app-shell/types.d.ts +26 -0
  24. package/dist/components/button/button.component.svelte +12 -135
  25. package/dist/components/button/button.component.svelte.d.ts +2 -236
  26. package/dist/components/button/exports.d.ts +1 -0
  27. package/dist/components/button/exports.js +1 -0
  28. package/dist/components/button/index.d.ts +2 -233
  29. package/dist/components/button/index.js +1 -4
  30. package/dist/components/button/styles.d.ts +231 -0
  31. package/dist/components/button/styles.js +105 -0
  32. package/dist/components/button/types.d.ts +7 -0
  33. package/dist/components/button/types.js +1 -0
  34. package/dist/components/button-group/button-group.stories.svelte +10 -10
  35. package/dist/components/button-group/button-group.stories.svelte.d.ts +0 -1
  36. package/dist/components/button-group/components/button-group.root.svelte +4 -11
  37. package/dist/components/button-group/components/button-group.root.svelte.d.ts +1 -5
  38. package/dist/components/button-group/components/button-group.separator.svelte +2 -2
  39. package/dist/components/button-group/components/button-group.separator.svelte.d.ts +1 -11
  40. package/dist/components/button-group/exports-primitive.d.ts +2 -0
  41. package/dist/components/button-group/exports-primitive.js +2 -0
  42. package/dist/components/button-group/index.d.ts +2 -16
  43. package/dist/components/button-group/index.js +1 -6
  44. package/dist/components/button-group/types.d.ts +8 -0
  45. package/dist/components/button-group/types.js +1 -0
  46. package/dist/components/checkbox/components/checkbox.root.svelte +8 -9
  47. package/dist/components/checkbox/components/checkbox.root.svelte.d.ts +3 -4
  48. package/dist/components/checkbox/exports-primitive.d.ts +2 -0
  49. package/dist/components/checkbox/exports-primitive.js +2 -0
  50. package/dist/components/checkbox/index.d.ts +3 -0
  51. package/dist/components/checkbox/index.js +2 -6
  52. package/dist/components/checkbox/model/{checkbox-model.svelte.d.ts → checkbox-controller.svelte.d.ts} +3 -4
  53. package/dist/components/checkbox/model/{checkbox-model.svelte.js → checkbox-controller.svelte.js} +1 -4
  54. package/dist/components/checkbox/model/index.d.ts +1 -1
  55. package/dist/components/checkbox/model/index.js +1 -1
  56. package/dist/components/checkbox/types.d.ts +3 -0
  57. package/dist/components/checkbox/types.js +2 -0
  58. package/dist/components/collapsible/components/collapsaible.content.svelte +5 -9
  59. package/dist/components/collapsible/components/collapsaible.content.svelte.d.ts +1 -2
  60. package/dist/components/collapsible/components/collapsaible.root.svelte +6 -14
  61. package/dist/components/collapsible/components/collapsaible.root.svelte.d.ts +1 -3
  62. package/dist/components/collapsible/components/collapsaible.trigger.svelte +7 -14
  63. package/dist/components/collapsible/components/collapsaible.trigger.svelte.d.ts +1 -5
  64. package/dist/components/collapsible/exports-primitive.d.ts +3 -0
  65. package/dist/components/collapsible/exports-primitive.js +3 -0
  66. package/dist/components/collapsible/index.d.ts +2 -9
  67. package/dist/components/collapsible/index.js +1 -8
  68. package/dist/components/collapsible/styles.d.ts +8 -8
  69. package/dist/components/collapsible/types.d.ts +8 -0
  70. package/dist/components/collapsible/types.js +1 -1
  71. package/dist/components/data-table/components/data-table.body.svelte +2 -10
  72. package/dist/components/data-table/components/data-table.body.svelte.d.ts +1 -5
  73. package/dist/components/data-table/components/data-table.cell.svelte +2 -14
  74. package/dist/components/data-table/components/data-table.cell.svelte.d.ts +1 -7
  75. package/dist/components/data-table/components/data-table.head.svelte +2 -14
  76. package/dist/components/data-table/components/data-table.head.svelte.d.ts +1 -7
  77. package/dist/components/data-table/components/data-table.header.svelte +2 -9
  78. package/dist/components/data-table/components/data-table.header.svelte.d.ts +1 -4
  79. package/dist/components/data-table/components/data-table.resize-handler.svelte +2 -9
  80. package/dist/components/data-table/components/data-table.resize-handler.svelte.d.ts +1 -4
  81. package/dist/components/data-table/components/data-table.root.svelte +4 -15
  82. package/dist/components/data-table/components/data-table.root.svelte.d.ts +6 -13
  83. package/dist/components/data-table/components/data-table.row.svelte +2 -9
  84. package/dist/components/data-table/components/data-table.row.svelte.d.ts +1 -4
  85. package/dist/components/data-table/components/data-table.sort-button.svelte +4 -11
  86. package/dist/components/data-table/components/data-table.sort-button.svelte.d.ts +1 -4
  87. package/dist/components/data-table/components/data-table.svelte.d.ts +2 -2
  88. package/dist/components/data-table/components/data-table.table.svelte +2 -9
  89. package/dist/components/data-table/components/data-table.table.svelte.d.ts +1 -4
  90. package/dist/components/data-table/data-table.svelte +3 -16
  91. package/dist/components/data-table/data-table.svelte.d.ts +2 -9
  92. package/dist/components/data-table/exports-primitive.d.ts +10 -0
  93. package/dist/components/data-table/exports-primitive.js +10 -0
  94. package/dist/components/data-table/exports.d.ts +1 -0
  95. package/dist/components/data-table/exports.js +1 -28
  96. package/dist/components/data-table/index.d.ts +4 -0
  97. package/dist/components/data-table/index.js +3 -0
  98. package/dist/components/data-table/types.d.ts +37 -1
  99. package/dist/components/data-table/types.js +1 -1
  100. package/dist/components/field/components/field.control.svelte +3 -1
  101. package/dist/components/field/components/field.description.svelte +5 -10
  102. package/dist/components/field/components/field.description.svelte.d.ts +1 -4
  103. package/dist/components/field/components/field.error.svelte +5 -10
  104. package/dist/components/field/components/field.error.svelte.d.ts +1 -4
  105. package/dist/components/field/components/field.label.svelte +5 -10
  106. package/dist/components/field/components/field.label.svelte.d.ts +1 -4
  107. package/dist/components/field/components/field.root.svelte +5 -19
  108. package/dist/components/field/components/field.root.svelte.d.ts +1 -9
  109. package/dist/components/field/exports-primitive.d.ts +5 -0
  110. package/dist/components/field/exports-primitive.js +5 -0
  111. package/dist/components/field/exports.d.ts +1 -0
  112. package/dist/components/field/exports.js +1 -0
  113. package/dist/components/field/field.svelte.d.ts +1 -1
  114. package/dist/components/field/index.d.ts +3 -14
  115. package/dist/components/field/index.js +2 -14
  116. package/dist/components/field/styles.d.ts +3 -3
  117. package/dist/components/field/types.d.ts +23 -0
  118. package/dist/components/field/types.js +1 -0
  119. package/dist/components/icons/exports.d.ts +22 -0
  120. package/dist/components/icons/exports.js +22 -0
  121. package/dist/components/icons/index.d.ts +1 -22
  122. package/dist/components/icons/index.js +1 -22
  123. package/dist/components/index.d.ts +19 -0
  124. package/dist/components/index.js +19 -0
  125. package/dist/components/input/exports.d.ts +2 -0
  126. package/dist/components/input/exports.js +2 -0
  127. package/dist/components/input/index.d.ts +2 -6
  128. package/dist/components/input/index.js +1 -5
  129. package/dist/components/input/input.password.svelte +6 -15
  130. package/dist/components/input/input.password.svelte.d.ts +2 -4
  131. package/dist/components/input/input.svelte +5 -16
  132. package/dist/components/input/input.svelte.d.ts +1 -9
  133. package/dist/components/input/types.d.ts +13 -0
  134. package/dist/components/input/types.js +1 -0
  135. package/dist/components/navigation/components/navigation.content.svelte +6 -11
  136. package/dist/components/navigation/components/navigation.content.svelte.d.ts +1 -4
  137. package/dist/components/navigation/components/navigation.item.svelte +5 -10
  138. package/dist/components/navigation/components/navigation.item.svelte.d.ts +1 -4
  139. package/dist/components/navigation/components/navigation.root.svelte +6 -11
  140. package/dist/components/navigation/components/navigation.root.svelte.d.ts +1 -7
  141. package/dist/components/navigation/components/navigation.sub-content.svelte +6 -11
  142. package/dist/components/navigation/components/navigation.sub-content.svelte.d.ts +1 -6
  143. package/dist/components/navigation/components/navigation.trigger.svelte +4 -21
  144. package/dist/components/navigation/components/navigation.trigger.svelte.d.ts +1 -9
  145. package/dist/components/navigation/exports-primitive.d.ts +5 -0
  146. package/dist/components/navigation/exports-primitive.js +5 -0
  147. package/dist/components/navigation/exports.d.ts +1 -0
  148. package/dist/components/navigation/exports.js +1 -0
  149. package/dist/components/navigation/index.d.ts +3 -12
  150. package/dist/components/navigation/index.js +2 -12
  151. package/dist/components/navigation/types.d.ts +23 -0
  152. package/dist/components/navigation/types.js +1 -0
  153. package/dist/components/pagination/components/pagination.ellipsis.svelte +3 -9
  154. package/dist/components/pagination/components/pagination.ellipsis.svelte.d.ts +1 -4
  155. package/dist/components/pagination/components/pagination.item.svelte +2 -5
  156. package/dist/components/pagination/components/pagination.item.svelte.d.ts +1 -2
  157. package/dist/components/pagination/components/pagination.next-button.svelte +4 -10
  158. package/dist/components/pagination/components/pagination.next-button.svelte.d.ts +1 -2
  159. package/dist/components/pagination/components/pagination.prev-button.svelte +4 -11
  160. package/dist/components/pagination/components/pagination.prev-button.svelte.d.ts +1 -2
  161. package/dist/components/pagination/components/pagination.root.svelte +3 -10
  162. package/dist/components/pagination/components/pagination.root.svelte.d.ts +1 -3
  163. package/dist/components/pagination/exports-primitive.d.ts +5 -0
  164. package/dist/components/pagination/exports-primitive.js +5 -0
  165. package/dist/components/pagination/exports.d.ts +1 -0
  166. package/dist/components/pagination/exports.js +1 -0
  167. package/dist/components/pagination/index.d.ts +3 -16
  168. package/dist/components/pagination/index.js +2 -16
  169. package/dist/components/pagination/pagination.stories.svelte +1 -1
  170. package/dist/components/pagination/pagination.svelte +28 -0
  171. package/dist/components/pagination/pagination.svelte.d.ts +3 -0
  172. package/dist/components/pagination/types.d.ts +10 -0
  173. package/dist/components/pagination/types.js +1 -0
  174. package/dist/components/popover/exports-primitive.d.ts +4 -0
  175. package/dist/components/popover/exports-primitive.js +5 -0
  176. package/dist/components/popover/exports.d.ts +1 -0
  177. package/dist/components/popover/exports.js +1 -15
  178. package/dist/components/popover/index.d.ts +2 -0
  179. package/dist/components/popover/index.js +1 -0
  180. package/dist/components/popover/popover.svelte +1 -2
  181. package/dist/components/popover/popover.svelte.d.ts +1 -2
  182. package/dist/components/popover/types.d.ts +1 -1
  183. package/dist/components/segment/components/segment.item.svelte +12 -14
  184. package/dist/components/segment/components/segment.item.svelte.d.ts +1 -6
  185. package/dist/components/segment/components/segment.root.svelte +6 -22
  186. package/dist/components/segment/components/segment.root.svelte.d.ts +1 -10
  187. package/dist/components/segment/exports-primitive.d.ts +2 -0
  188. package/dist/components/segment/exports-primitive.js +2 -0
  189. package/dist/components/segment/index.d.ts +2 -7
  190. package/dist/components/segment/index.js +1 -6
  191. package/dist/components/segment/types.d.ts +14 -0
  192. package/dist/components/segment/types.js +1 -0
  193. package/dist/components/select/components/select.root.svelte +3 -6
  194. package/dist/components/select/components/select.root.svelte.d.ts +1 -3
  195. package/dist/components/select/components/select.trigger.svelte +2 -11
  196. package/dist/components/select/components/select.trigger.svelte.d.ts +1 -7
  197. package/dist/components/select/exports-primitive.d.ts +2 -0
  198. package/dist/components/select/exports-primitive.js +2 -0
  199. package/dist/components/select/index.d.ts +2 -7
  200. package/dist/components/select/index.js +1 -6
  201. package/dist/components/select/select.stories.svelte +3 -3
  202. package/dist/components/select/types.d.ts +9 -0
  203. package/dist/components/select/types.js +2 -0
  204. package/dist/components/separator/exports.d.ts +1 -0
  205. package/dist/components/separator/exports.js +1 -0
  206. package/dist/components/separator/index.d.ts +2 -5
  207. package/dist/components/separator/index.js +1 -4
  208. package/dist/components/separator/separator.svelte +1 -4
  209. package/dist/components/separator/separator.svelte.d.ts +0 -1
  210. package/dist/components/separator/types.d.ts +2 -0
  211. package/dist/components/separator/types.js +1 -0
  212. package/dist/components/skeleton/exports.d.ts +1 -0
  213. package/dist/components/skeleton/exports.js +1 -0
  214. package/dist/components/skeleton/index.d.ts +2 -1
  215. package/dist/components/skeleton/index.js +1 -1
  216. package/dist/components/skeleton/skeleton.svelte +3 -15
  217. package/dist/components/skeleton/skeleton.svelte.d.ts +1 -8
  218. package/dist/components/skeleton/types.d.ts +9 -0
  219. package/dist/components/skeleton/types.js +1 -0
  220. package/dist/components/spinner/exports.d.ts +1 -0
  221. package/dist/components/spinner/exports.js +1 -0
  222. package/dist/components/spinner/index.d.ts +2 -1
  223. package/dist/components/spinner/index.js +1 -1
  224. package/dist/components/spinner/spinner.svelte +3 -13
  225. package/dist/components/spinner/spinner.svelte.d.ts +1 -6
  226. package/dist/components/spinner/types.d.ts +7 -0
  227. package/dist/components/spinner/types.js +1 -0
  228. package/dist/components/switch/components/switch.root.svelte +6 -7
  229. package/dist/components/switch/components/switch.root.svelte.d.ts +2 -4
  230. package/dist/components/switch/components/switch.thumb.svelte +5 -7
  231. package/dist/components/switch/components/switch.thumb.svelte.d.ts +1 -2
  232. package/dist/components/switch/exports-primitive.d.ts +2 -0
  233. package/dist/components/switch/exports-primitive.js +2 -0
  234. package/dist/components/switch/exports.d.ts +1 -0
  235. package/dist/components/switch/exports.js +1 -0
  236. package/dist/components/switch/index.d.ts +4 -10
  237. package/dist/components/switch/index.js +3 -10
  238. package/dist/components/switch/model/index.d.ts +1 -1
  239. package/dist/components/switch/model/index.js +1 -1
  240. package/dist/components/switch/model/switch-controller.svelte.d.ts +11 -0
  241. package/dist/components/switch/model/{switch-model.svelte.js → switch-controller.svelte.js} +1 -4
  242. package/dist/components/switch/switch.stories.svelte +1 -1
  243. package/dist/components/switch/switch.svelte +11 -0
  244. package/dist/components/switch/switch.svelte.d.ts +3 -0
  245. package/dist/components/switch/types.d.ts +5 -0
  246. package/dist/components/switch/types.js +2 -0
  247. package/dist/components/toast/exports.d.ts +1 -0
  248. package/dist/components/toast/exports.js +1 -0
  249. package/dist/components/toast/index.d.ts +2 -1
  250. package/dist/components/toast/index.js +1 -1
  251. package/dist/components/toast/styles.d.ts +152 -0
  252. package/dist/components/toast/styles.js +62 -0
  253. package/dist/components/toast/toast.component.svelte +9 -97
  254. package/dist/components/toast/toast.component.svelte.d.ts +1 -155
  255. package/dist/components/toast/types.d.ts +11 -0
  256. package/dist/components/toast/types.js +1 -0
  257. package/dist/index.d.ts +1 -17
  258. package/dist/index.js +1 -17
  259. package/package.json +1 -1
  260. package/dist/components/pagination/presets/basic.svelte +0 -31
  261. package/dist/components/pagination/presets/basic.svelte.d.ts +0 -5
  262. package/dist/components/pagination/presets/index.d.ts +0 -1
  263. package/dist/components/pagination/presets/index.js +0 -1
  264. package/dist/components/switch/model/switch-model.svelte.d.ts +0 -12
  265. package/dist/components/switch/presets/basic.svelte +0 -14
  266. package/dist/components/switch/presets/basic.svelte.d.ts +0 -5
@@ -1,20 +1,15 @@
1
- <script lang="ts" module>
2
- type AppShellContentPropsWithoutHTML = WithElementRef<WithChild<{}>>;
3
-
4
- export type AppShellContentProps = AppShellContentPropsWithoutHTML &
5
- Without<PrimitiveDivAttributes, AppShellContentPropsWithoutHTML>;
6
- </script>
7
-
8
1
  <script lang="ts">
9
2
  import { AppShellStylesContext } from '../styles.js';
10
- import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
3
+ import type { AppShellContentProps } from '../types.js';
11
4
  import { cn, useId } from '../../../internal/utils/common.js';
12
- import { box, mergeProps, type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
5
+ import { box, mergeProps } from 'svelte-toolbelt';
13
6
  import { AppShellContentState } from './app-shell.svelte.js';
14
7
 
8
+ const uid = $props.id();
9
+
15
10
  let {
16
11
  ref = $bindable(null),
17
- id = useId(),
12
+ id = useId(uid),
18
13
  children,
19
14
  child,
20
15
  class: className,
@@ -1,7 +1,4 @@
1
- type AppShellContentPropsWithoutHTML = WithElementRef<WithChild<{}>>;
2
- export type AppShellContentProps = AppShellContentPropsWithoutHTML & Without<PrimitiveDivAttributes, AppShellContentPropsWithoutHTML>;
3
- import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
4
- import { type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
1
+ import type { AppShellContentProps } from '../types.js';
5
2
  declare const AppShell: import("svelte").Component<AppShellContentProps, {}, "ref">;
6
3
  type AppShell = ReturnType<typeof AppShell>;
7
4
  export default AppShell;
@@ -1,20 +1,15 @@
1
- <script lang="ts" module>
2
- type AppShellHeaderPropsWithoutHTML = WithElementRef<WithChild<{}>>;
3
-
4
- export type AppShellHeaderProps = AppShellHeaderPropsWithoutHTML &
5
- Without<PrimitiveHeaderAttributes, AppShellHeaderPropsWithoutHTML>;
6
- </script>
7
-
8
1
  <script lang="ts">
9
- import type { PrimitiveHeaderAttributes } from '../../../internal/types/html-attributes.js';
2
+ import type { AppShellHeaderProps } from '../types.js';
10
3
  import { cn, useId } from '../../../internal/utils/common.js';
11
- import { box, mergeProps, type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
4
+ import { box, mergeProps } from 'svelte-toolbelt';
12
5
  import { AppShellStylesContext } from '../styles.js';
13
6
  import { AppShellHeaderState } from './app-shell.svelte.js';
14
7
 
8
+ const uid = $props.id();
9
+
15
10
  let {
16
11
  ref = $bindable(null),
17
- id = useId(),
12
+ id = useId(uid),
18
13
  children,
19
14
  child,
20
15
  class: className,
@@ -1,7 +1,4 @@
1
- type AppShellHeaderPropsWithoutHTML = WithElementRef<WithChild<{}>>;
2
- export type AppShellHeaderProps = AppShellHeaderPropsWithoutHTML & Without<PrimitiveHeaderAttributes, AppShellHeaderPropsWithoutHTML>;
3
- import type { PrimitiveHeaderAttributes } from '../../../internal/types/html-attributes.js';
4
- import { type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
1
+ import type { AppShellHeaderProps } from '../types.js';
5
2
  declare const AppShell: import("svelte").Component<AppShellHeaderProps, {}, "ref">;
6
3
  type AppShell = ReturnType<typeof AppShell>;
7
4
  export default AppShell;
@@ -1,20 +1,15 @@
1
- <script lang="ts" module>
2
- type AppShellNavBarPropsWithoutHTML = WithElementRef<WithChild<{}>>;
3
-
4
- export type AppShellNavBarProps = AppShellNavBarPropsWithoutHTML &
5
- Without<PrimitiveElementAttributes, AppShellNavBarPropsWithoutHTML>;
6
- </script>
7
-
8
1
  <script lang="ts">
9
- import type { PrimitiveElementAttributes } from '../../../internal/types/html-attributes.js';
2
+ import type { AppShellNavBarProps } from '../types.js';
10
3
  import { cn, useId } from '../../../internal/utils/common.js';
11
- import { box, mergeProps, type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
4
+ import { box, mergeProps } from 'svelte-toolbelt';
12
5
  import { AppShellStylesContext } from '../styles.js';
13
6
  import { AppShellNavBarState } from './app-shell.svelte.js';
14
7
 
8
+ const uid = $props.id();
9
+
15
10
  let {
16
11
  ref = $bindable(null),
17
- id = useId(),
12
+ id = useId(uid),
18
13
  children,
19
14
  child,
20
15
  class: className,
@@ -1,7 +1,4 @@
1
- type AppShellNavBarPropsWithoutHTML = WithElementRef<WithChild<{}>>;
2
- export type AppShellNavBarProps = AppShellNavBarPropsWithoutHTML & Without<PrimitiveElementAttributes, AppShellNavBarPropsWithoutHTML>;
3
- import type { PrimitiveElementAttributes } from '../../../internal/types/html-attributes.js';
4
- import { type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
1
+ import type { AppShellNavBarProps } from '../types.js';
5
2
  declare const AppShell: import("svelte").Component<AppShellNavBarProps, {}, "ref">;
6
3
  type AppShell = ReturnType<typeof AppShell>;
7
4
  export default AppShell;
@@ -1,31 +1,16 @@
1
- <script lang="ts" module>
2
- type AppShellRootPropsWithoutHTML = WithElementRef<
3
- WithChildren<{
4
- collapsed?: boolean;
5
-
6
- sidebar?: AppShellSidebarConfiguration;
7
-
8
- header?: AppShellHeaderConfiguration;
9
- }>
10
- > &
11
- AppShellVariantsProps;
12
-
13
- export type AppShellRootProps = AppShellRootPropsWithoutHTML &
14
- Without<PrimitiveDivAttributes, AppShellRootPropsWithoutHTML>;
15
- </script>
16
-
17
1
  <script lang="ts">
18
- import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
2
+ import type { AppShellRootProps } from '../types.js';
19
3
  import { cn, useId } from '../../../internal/utils/common.js';
20
- import { box, mergeProps, type WithChildren, type WithElementRef, type Without } from 'svelte-toolbelt';
21
- import { AppShellStylesContext, appShellVariants, type AppShellVariantsProps } from '../styles.js';
22
- import type { AppShellHeaderConfiguration, AppShellSidebarConfiguration } from '../types.js';
4
+ import { box, mergeProps } from 'svelte-toolbelt';
5
+ import { AppShellStylesContext, appShellVariants } from '../styles.js';
23
6
  import { AppShellRootState } from './app-shell.svelte.js';
24
7
 
8
+ const uid = $props.id();
9
+
25
10
  let {
26
11
  children,
27
12
  ref = $bindable(null),
28
- id = useId(),
13
+ id = useId(uid),
29
14
  collapsed = $bindable(false),
30
15
  class: className,
31
16
  layout = 'adjacent',
@@ -1,13 +1,4 @@
1
- type AppShellRootPropsWithoutHTML = WithElementRef<WithChildren<{
2
- collapsed?: boolean;
3
- sidebar?: AppShellSidebarConfiguration;
4
- header?: AppShellHeaderConfiguration;
5
- }>> & AppShellVariantsProps;
6
- export type AppShellRootProps = AppShellRootPropsWithoutHTML & Without<PrimitiveDivAttributes, AppShellRootPropsWithoutHTML>;
7
- import type { PrimitiveDivAttributes } from '../../../internal/types/html-attributes.js';
8
- import { type WithChildren, type WithElementRef, type Without } from 'svelte-toolbelt';
9
- import { type AppShellVariantsProps } from '../styles.js';
10
- import type { AppShellHeaderConfiguration, AppShellSidebarConfiguration } from '../types.js';
11
- declare const AppShell: import("svelte").Component<AppShellRootProps, {}, "ref" | "collapsed">;
1
+ import type { AppShellRootProps } from '../types.js';
2
+ declare const AppShell: import("svelte").Component<AppShellRootProps, {}, "collapsed" | "ref">;
12
3
  type AppShell = ReturnType<typeof AppShell>;
13
4
  export default AppShell;
@@ -1,20 +1,15 @@
1
- <script lang="ts" module>
2
- type AppShellSidebarFooterPropsWithoutHTML = WithElementRef<WithChild<{}>>;
3
-
4
- export type AppShellSidebarFooterProps = AppShellSidebarFooterPropsWithoutHTML &
5
- Without<PrimitiveHeaderAttributes, AppShellSidebarFooterPropsWithoutHTML>;
6
- </script>
7
-
8
1
  <script lang="ts">
9
- import type { PrimitiveHeaderAttributes } from '../../../internal/types/html-attributes.js';
2
+ import type { AppShellSidebarFooterProps } from '../types.js';
10
3
  import { cn, useId } from '../../../internal/utils/common.js';
11
- import { box, mergeProps, type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
4
+ import { box, mergeProps } from 'svelte-toolbelt';
12
5
  import { AppShellStylesContext } from '../styles.js';
13
6
  import { AppShellSidebarFooterState } from './app-shell.svelte.js';
14
7
 
8
+ const uid = $props.id();
9
+
15
10
  let {
16
11
  ref = $bindable(null),
17
- id = useId(),
12
+ id = useId(uid),
18
13
  children,
19
14
  child,
20
15
  class: className,
@@ -1,7 +1,4 @@
1
- type AppShellSidebarFooterPropsWithoutHTML = WithElementRef<WithChild<{}>>;
2
- export type AppShellSidebarFooterProps = AppShellSidebarFooterPropsWithoutHTML & Without<PrimitiveHeaderAttributes, AppShellSidebarFooterPropsWithoutHTML>;
3
- import type { PrimitiveHeaderAttributes } from '../../../internal/types/html-attributes.js';
4
- import { type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
1
+ import type { AppShellSidebarFooterProps } from '../types.js';
5
2
  declare const AppShell: import("svelte").Component<AppShellSidebarFooterProps, {}, "ref">;
6
3
  type AppShell = ReturnType<typeof AppShell>;
7
4
  export default AppShell;
@@ -1,20 +1,15 @@
1
- <script lang="ts" module>
2
- type AppShellSidebarHeadPropsWithoutHTML = WithElementRef<WithChild<{}>>;
3
-
4
- export type AppShellSidebarHeadProps = AppShellSidebarHeadPropsWithoutHTML &
5
- Without<PrimitiveHeaderAttributes, AppShellSidebarHeadPropsWithoutHTML>;
6
- </script>
7
-
8
1
  <script lang="ts">
9
- import type { PrimitiveHeaderAttributes } from '../../../internal/types/html-attributes.js';
2
+ import type { AppShellSidebarHeadProps } from '../types.js';
10
3
  import { cn, useId } from '../../../internal/utils/common.js';
11
- import { box, mergeProps, type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
4
+ import { box, mergeProps } from 'svelte-toolbelt';
12
5
  import { AppShellStylesContext } from '../styles.js';
13
6
  import { AppShellSidebarHeadState } from './app-shell.svelte.js';
14
7
 
8
+ const uid = $props.id();
9
+
15
10
  let {
16
11
  ref = $bindable(null),
17
- id = useId(),
12
+ id = useId(uid),
18
13
  children,
19
14
  child,
20
15
  class: className,
@@ -1,7 +1,4 @@
1
- type AppShellSidebarHeadPropsWithoutHTML = WithElementRef<WithChild<{}>>;
2
- export type AppShellSidebarHeadProps = AppShellSidebarHeadPropsWithoutHTML & Without<PrimitiveHeaderAttributes, AppShellSidebarHeadPropsWithoutHTML>;
3
- import type { PrimitiveHeaderAttributes } from '../../../internal/types/html-attributes.js';
4
- import { type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
1
+ import type { AppShellSidebarHeadProps } from '../types.js';
5
2
  declare const AppShell: import("svelte").Component<AppShellSidebarHeadProps, {}, "ref">;
6
3
  type AppShell = ReturnType<typeof AppShell>;
7
4
  export default AppShell;
@@ -1,22 +1,17 @@
1
- <script lang="ts" module>
2
- type AppShellSidebarTogglePropsWithoutHTML = WithElementRef<WithChild<{}>>;
3
-
4
- export type AppShellSidebarToggleProps = AppShellSidebarTogglePropsWithoutHTML &
5
- Without<PrimitiveButtonAttributes, AppShellSidebarTogglePropsWithoutHTML>;
6
- </script>
7
-
8
1
  <script lang="ts">
2
+ import type { AppShellSidebarToggleProps } from '../types.js';
9
3
  import { AppShellStylesContext } from '../styles.js';
10
4
  import { AppShellSidebarToggleState } from './app-shell.svelte.js';
11
5
 
12
- import { SidebarToggleIcon } from '../../icons/index.js';
13
- import type { PrimitiveButtonAttributes } from '../../../internal/types/html-attributes.js';
6
+ import { Icon } from '../../icons/index.js';
14
7
  import { cn, useId } from '../../../internal/utils/common.js';
15
- import { box, mergeProps, type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
8
+ import { box, mergeProps } from 'svelte-toolbelt';
9
+
10
+ const uid = $props.id();
16
11
 
17
12
  let {
18
13
  ref = $bindable(null),
19
- id = useId(),
14
+ id = useId(uid),
20
15
  children,
21
16
  child,
22
17
  class: className,
@@ -45,7 +40,7 @@
45
40
  {#if children}
46
41
  {@render children?.()}
47
42
  {:else}
48
- <SidebarToggleIcon
43
+ <Icon.SidebarToggle
49
44
  class={cn('cgui:transition-transform cgui:duration-250 cgui:ease-in-out', {
50
45
  'cgui:-scale-x-[1]': sidebarToggleState.root.opts.collapsed.current,
51
46
  })}
@@ -1,7 +1,4 @@
1
- type AppShellSidebarTogglePropsWithoutHTML = WithElementRef<WithChild<{}>>;
2
- export type AppShellSidebarToggleProps = AppShellSidebarTogglePropsWithoutHTML & Without<PrimitiveButtonAttributes, AppShellSidebarTogglePropsWithoutHTML>;
3
- import type { PrimitiveButtonAttributes } from '../../../internal/types/html-attributes.js';
4
- import { type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
1
+ import type { AppShellSidebarToggleProps } from '../types.js';
5
2
  declare const AppShell: import("svelte").Component<AppShellSidebarToggleProps, {}, "ref">;
6
3
  type AppShell = ReturnType<typeof AppShell>;
7
4
  export default AppShell;
@@ -1,20 +1,15 @@
1
- <script lang="ts" module>
2
- type AppShellSidebarPropsWithoutHTML = WithElementRef<WithChild<{}>>;
3
-
4
- export type AppShellSidebarProps = AppShellSidebarPropsWithoutHTML &
5
- Without<PrimitiveElementAttributes, AppShellSidebarPropsWithoutHTML>;
6
- </script>
7
-
8
1
  <script lang="ts">
9
- import type { PrimitiveElementAttributes } from '../../../internal/types/html-attributes.js';
2
+ import type { AppShellSidebarProps } from '../types.js';
10
3
  import { cn, useId } from '../../../internal/utils/common.js';
11
- import { box, mergeProps, type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
4
+ import { box, mergeProps } from 'svelte-toolbelt';
12
5
  import { AppShellStylesContext } from '../styles.js';
13
6
  import { AppShellSidebarState } from './app-shell.svelte.js';
14
7
 
8
+ const uid = $props.id();
9
+
15
10
  let {
16
11
  ref = $bindable(null),
17
- id = useId(),
12
+ id = useId(uid),
18
13
  children,
19
14
  child,
20
15
  class: className,
@@ -1,7 +1,4 @@
1
- type AppShellSidebarPropsWithoutHTML = WithElementRef<WithChild<{}>>;
2
- export type AppShellSidebarProps = AppShellSidebarPropsWithoutHTML & Without<PrimitiveElementAttributes, AppShellSidebarPropsWithoutHTML>;
3
- import type { PrimitiveElementAttributes } from '../../../internal/types/html-attributes.js';
4
- import { type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
1
+ import type { AppShellSidebarProps } from '../types.js';
5
2
  declare const AppShell: import("svelte").Component<AppShellSidebarProps, {}, "ref">;
6
3
  type AppShell = ReturnType<typeof AppShell>;
7
4
  export default AppShell;
@@ -1,20 +1,15 @@
1
- <script lang="ts" module>
2
- type AppShellViewportPropsWithoutHTML = WithElementRef<WithChild<{}>>;
3
-
4
- export type AppShellViewportProps = AppShellViewportPropsWithoutHTML &
5
- Without<PrimitiveElementAttributes, AppShellViewportPropsWithoutHTML>;
6
- </script>
7
-
8
1
  <script lang="ts">
9
- import type { PrimitiveElementAttributes } from '../../../internal/types/html-attributes.js';
2
+ import type { AppShellViewportProps } from '../types.js';
10
3
  import { cn, useId } from '../../../internal/utils/common.js';
11
- import { box, mergeProps, type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
4
+ import { box, mergeProps } from 'svelte-toolbelt';
12
5
  import { AppShellStylesContext } from '../styles.js';
13
6
  import { AppShellViewportState } from './app-shell.svelte.js';
14
7
 
8
+ const uid = $props.id();
9
+
15
10
  let {
16
11
  ref = $bindable(null),
17
- id = useId(),
12
+ id = useId(uid),
18
13
  children,
19
14
  child,
20
15
  class: className,
@@ -1,7 +1,4 @@
1
- type AppShellViewportPropsWithoutHTML = WithElementRef<WithChild<{}>>;
2
- export type AppShellViewportProps = AppShellViewportPropsWithoutHTML & Without<PrimitiveElementAttributes, AppShellViewportPropsWithoutHTML>;
3
- import type { PrimitiveElementAttributes } from '../../../internal/types/html-attributes.js';
4
- import { type WithChild, type WithElementRef, type Without } from 'svelte-toolbelt';
1
+ import type { AppShellViewportProps } from '../types.js';
5
2
  declare const AppShell: import("svelte").Component<AppShellViewportProps, {}, "ref">;
6
3
  type AppShell = ReturnType<typeof AppShell>;
7
4
  export default AppShell;
@@ -0,0 +1,9 @@
1
+ export { default as Content } from './components/app-shell.content.svelte';
2
+ export { default as Header } from './components/app-shell.header.svelte';
3
+ export { default as NavBar } from './components/app-shell.nav-bar.svelte';
4
+ export { default as Root } from './components/app-shell.root.svelte';
5
+ export { default as SidebarFooter } from './components/app-shell.sidebar-footer.svelte';
6
+ export { default as SidebarHead } from './components/app-shell.sidebar-head.svelte';
7
+ export { default as SidebarToggle } from './components/app-shell.sidebar-toggle.svelte';
8
+ export { default as Sidebar } from './components/app-shell.sidebar.svelte';
9
+ export { default as Viewport } from './components/app-shell.viewport.svelte';
@@ -0,0 +1,9 @@
1
+ export { default as Content } from './components/app-shell.content.svelte';
2
+ export { default as Header } from './components/app-shell.header.svelte';
3
+ export { default as NavBar } from './components/app-shell.nav-bar.svelte';
4
+ export { default as Root } from './components/app-shell.root.svelte';
5
+ export { default as SidebarFooter } from './components/app-shell.sidebar-footer.svelte';
6
+ export { default as SidebarHead } from './components/app-shell.sidebar-head.svelte';
7
+ export { default as SidebarToggle } from './components/app-shell.sidebar-toggle.svelte';
8
+ export { default as Sidebar } from './components/app-shell.sidebar.svelte';
9
+ export { default as Viewport } from './components/app-shell.viewport.svelte';
@@ -1,20 +1,2 @@
1
- import { type AppShellContentProps } from './components/app-shell.content.svelte';
2
- import { type AppShellHeaderProps } from './components/app-shell.header.svelte';
3
- import { type AppShellRootProps } from './components/app-shell.root.svelte';
4
- import { type AppShellSidebarFooterProps } from './components/app-shell.sidebar-footer.svelte';
5
- import { type AppShellSidebarHeadProps } from './components/app-shell.sidebar-head.svelte';
6
- import { type AppShellSidebarToggleProps } from './components/app-shell.sidebar-toggle.svelte';
7
- import { type AppShellSidebarProps } from './components/app-shell.sidebar.svelte';
8
- import { type AppShellViewportProps } from './components/app-shell.viewport.svelte';
9
- export declare const AppShellPrimitive: {
10
- Root: import("svelte").Component<AppShellRootProps, {}, "ref" | "collapsed">;
11
- Sidebar: import("svelte").Component<AppShellSidebarProps, {}, "ref">;
12
- Header: import("svelte").Component<AppShellHeaderProps, {}, "ref">;
13
- Content: import("svelte").Component<AppShellContentProps, {}, "ref">;
14
- Viewport: import("svelte").Component<AppShellViewportProps, {}, "ref">;
15
- SidebarToggle: import("svelte").Component<AppShellSidebarToggleProps, {}, "ref">;
16
- SidebarHead: import("svelte").Component<AppShellSidebarHeadProps, {}, "ref">;
17
- SidebarFooter: import("svelte").Component<AppShellSidebarFooterProps, {}, "ref">;
18
- NavBar: import("svelte").Component<import("./components/app-shell.nav-bar.svelte").AppShellNavBarProps, {}, "ref">;
19
- };
20
- export type { AppShellContentProps, AppShellHeaderProps, AppShellRootProps, AppShellSidebarFooterProps, AppShellSidebarHeadProps, AppShellSidebarProps, AppShellSidebarToggleProps, AppShellViewportProps, };
1
+ export * as AppShellPrimitive from './exports-primitive.js';
2
+ export type { AppShellContentProps, AppShellHeaderConfiguration, AppShellHeaderProps, AppShellNavBarProps, AppShellRootProps, AppShellSidebarConfiguration, AppShellSidebarFooterProps, AppShellSidebarHeadProps, AppShellSidebarProps, AppShellSidebarToggleProps, AppShellViewportProps, } from './types.js';
@@ -1,20 +1 @@
1
- import Content, {} from './components/app-shell.content.svelte';
2
- import Header, {} from './components/app-shell.header.svelte';
3
- import NavBar from './components/app-shell.nav-bar.svelte';
4
- import Root, {} from './components/app-shell.root.svelte';
5
- import SidebarFooter, {} from './components/app-shell.sidebar-footer.svelte';
6
- import SidebarHead, {} from './components/app-shell.sidebar-head.svelte';
7
- import SidebarToggle, {} from './components/app-shell.sidebar-toggle.svelte';
8
- import Sidebar, {} from './components/app-shell.sidebar.svelte';
9
- import Viewport, {} from './components/app-shell.viewport.svelte';
10
- export const AppShellPrimitive = {
11
- Root,
12
- Sidebar,
13
- Header,
14
- Content,
15
- Viewport,
16
- SidebarToggle,
17
- SidebarHead,
18
- SidebarFooter,
19
- NavBar,
20
- };
1
+ export * as AppShellPrimitive from './exports-primitive.js';
@@ -1,3 +1,6 @@
1
+ import type { AppShellVariantsProps } from './styles.js';
2
+ import type { PrimitiveButtonAttributes, PrimitiveDivAttributes, PrimitiveElementAttributes, PrimitiveHeaderAttributes } from '../../internal/types/html-attributes.js';
3
+ import type { WithChild, WithChildren, WithElementRef, Without } from 'svelte-toolbelt';
1
4
  export type AppShellSidebarConfiguration = {
2
5
  width?: number;
3
6
  collapsedWidth?: number;
@@ -5,3 +8,26 @@ export type AppShellSidebarConfiguration = {
5
8
  export type AppShellHeaderConfiguration = {
6
9
  height?: number;
7
10
  };
11
+ type AppShellRootPropsWithoutHTML = WithElementRef<WithChildren<{
12
+ collapsed?: boolean;
13
+ sidebar?: AppShellSidebarConfiguration;
14
+ header?: AppShellHeaderConfiguration;
15
+ }>> & AppShellVariantsProps;
16
+ export type AppShellRootProps = AppShellRootPropsWithoutHTML & Without<PrimitiveDivAttributes, AppShellRootPropsWithoutHTML>;
17
+ type AppShellContentPropsWithoutHTML = WithElementRef<WithChild<{}>>;
18
+ export type AppShellContentProps = AppShellContentPropsWithoutHTML & Without<PrimitiveDivAttributes, AppShellContentPropsWithoutHTML>;
19
+ type AppShellHeaderPropsWithoutHTML = WithElementRef<WithChild<{}>>;
20
+ export type AppShellHeaderProps = AppShellHeaderPropsWithoutHTML & Without<PrimitiveHeaderAttributes, AppShellHeaderPropsWithoutHTML>;
21
+ type AppShellNavBarPropsWithoutHTML = WithElementRef<WithChild<{}>>;
22
+ export type AppShellNavBarProps = AppShellNavBarPropsWithoutHTML & Without<PrimitiveElementAttributes, AppShellNavBarPropsWithoutHTML>;
23
+ type AppShellSidebarFooterPropsWithoutHTML = WithElementRef<WithChild<{}>>;
24
+ export type AppShellSidebarFooterProps = AppShellSidebarFooterPropsWithoutHTML & Without<PrimitiveHeaderAttributes, AppShellSidebarFooterPropsWithoutHTML>;
25
+ type AppShellSidebarHeadPropsWithoutHTML = WithElementRef<WithChild<{}>>;
26
+ export type AppShellSidebarHeadProps = AppShellSidebarHeadPropsWithoutHTML & Without<PrimitiveHeaderAttributes, AppShellSidebarHeadPropsWithoutHTML>;
27
+ type AppShellSidebarTogglePropsWithoutHTML = WithElementRef<WithChild<{}>>;
28
+ export type AppShellSidebarToggleProps = AppShellSidebarTogglePropsWithoutHTML & Without<PrimitiveButtonAttributes, AppShellSidebarTogglePropsWithoutHTML>;
29
+ type AppShellSidebarPropsWithoutHTML = WithElementRef<WithChild<{}>>;
30
+ export type AppShellSidebarProps = AppShellSidebarPropsWithoutHTML & Without<PrimitiveElementAttributes, AppShellSidebarPropsWithoutHTML>;
31
+ type AppShellViewportPropsWithoutHTML = WithElementRef<WithChild<{}>>;
32
+ export type AppShellViewportProps = AppShellViewportPropsWithoutHTML & Without<PrimitiveElementAttributes, AppShellViewportPropsWithoutHTML>;
33
+ export {};
@@ -1,136 +1,12 @@
1
- <script lang="ts" module>
2
- import type { WithVariants } from '../../internal/types/composition.js';
3
- import { cn } from '../../internal/utils/common.js';
4
- import { tv } from '../../internal/utils/tailwindcss.js';
5
-
6
- export const buttonStyles = tv({
7
- slots: {
8
- root: [
9
- 'cgui:flex cgui:items-center cgui:justify-center cgui:gap-1.5 cgui:cursor-pointer cgui:px-2 cgui:text-center cgui:overflow-hidden',
10
- 'cgui:transition-all cgui:duration-250 cgui:ease-in-out',
11
- 'cgui:select-none cgui:font-medium',
12
- 'cgui:disabled:cursor-not-allowed cgui:disabled:opacity-50',
13
- ],
14
-
15
- chevron: ['cgui:inline-flex cgui:items-center cgui:justify-center cgui:shrink-0'],
16
- },
17
-
18
- variants: {
19
- variant: {
20
- primary: {
21
- root: ['cgui:bg-primary-80 cgui:text-fg-white', 'cgui:hover:bg-primary-60 ', ' cgui:active:bg-primary-100'],
22
- },
23
- outline: {
24
- root: [
25
- 'cgui:bg-transparent cgui:text-primary-80 cgui:border cgui:border-stroke-primary',
26
- 'cgui:hover:text-primary-60 cgui:hover:border-stroke-primary-60',
27
- 'cgui:active:text-primary-100 cgui:active:border-stroke-primary-100',
28
- ],
29
- },
30
- ghost: {
31
- root: [
32
- 'cgui:bg-transparent cgui:text-primary-80',
33
- 'cgui:hover:text-primary-60',
34
- 'cgui:active:text-primary-100',
35
- ],
36
- },
37
- link: {
38
- root: [
39
- 'cgui:bg-transparent cgui:text-primary-80',
40
- 'cgui:hover:text-primary-60',
41
- 'cgui:active:text-primary-100',
42
- 'cgui:underline',
43
- ],
44
- },
45
- },
46
-
47
- loading: {
48
- true: {
49
- root: 'cgui:pointer-events-none cgui:opacity-50',
50
- },
51
- },
52
-
53
- shadow: {
54
- true: {
55
- root: 'cgui:shadow-btn',
56
- },
57
- },
58
-
59
- size: {
60
- xs: {
61
- root: 'cgui:h-7.5',
62
- },
63
- sm: {
64
- root: 'cgui:h-8',
65
- },
66
- md: {
67
- root: 'cgui:h-8.5',
68
- },
69
- lg: {
70
- root: 'cgui:h-14',
71
- },
72
- },
73
-
74
- w: {
75
- full: {
76
- root: 'cgui:w-full',
77
- },
78
- auto: {
79
- root: 'cgui:w-auto',
80
- },
81
- fit: {
82
- root: 'cgui:w-fit',
83
- },
84
- clean: {
85
- root: '',
86
- },
87
- },
88
-
89
- rounded: {
90
- sm: {
91
- root: 'cgui:rounded-sm',
92
- },
93
- md: {
94
- root: 'cgui:rounded-md',
95
- },
96
- lg: {
97
- root: 'cgui:rounded-lg',
98
- },
99
- xl: {
100
- root: 'cgui:rounded-xl',
101
- },
102
- full: {
103
- root: 'cgui:rounded-full',
104
- },
105
- clean: {
106
- root: '',
107
- },
108
- },
109
- },
110
-
111
- defaultVariants: {
112
- variant: 'primary',
113
- size: 'md',
114
- shadow: true,
115
- rounded: 'md',
116
- },
117
- });
118
-
119
- export type ButtonProps = WithVariants<
120
- ButtonRootProps & {
121
- startChevron?: Snippet;
122
-
123
- endChevron?: Snippet;
124
- },
125
- typeof buttonStyles
126
- >;
127
- </script>
128
-
129
1
  <script lang="ts">
130
- import { Button, type ButtonRootProps } from 'bits-ui';
131
- import type { Snippet } from 'svelte';
2
+ import { buttonVariants } from './styles.js';
3
+ import type { ButtonProps } from './types.js';
4
+ import { cn } from '../../internal/utils/common.js';
5
+ import { Button, useId } from 'bits-ui';
132
6
  import { fly } from 'svelte/transition';
133
7
 
8
+ const uid = $props.id();
9
+
134
10
  let {
135
11
  startChevron,
136
12
  endChevron,
@@ -143,16 +19,17 @@
143
19
  shadow = true,
144
20
  w = 'full',
145
21
  loading = false,
22
+ id = useId(uid),
146
23
  class: className,
147
24
  ...props
148
25
  }: ButtonProps = $props();
149
26
 
150
- const styles = $derived(buttonStyles({ variant, size, rounded, shadow, w, loading }));
27
+ const variants = $derived(buttonVariants({ variant, size, rounded, shadow, w, loading }));
151
28
  </script>
152
29
 
153
- <Button.Root data-slot="button" bind:ref class={cn(styles.root(), className)} {disabled} {...props}>
30
+ <Button.Root data-slot="button" bind:ref {id} class={cn(variants.root(), className)} {disabled} {...props}>
154
31
  {#if startChevron}
155
- <span data-slot="start-chevron" class={styles.chevron}>
32
+ <span data-slot="start-chevron" class={variants.chevron}>
156
33
  {@render startChevron()}
157
34
  </span>
158
35
  {/if}
@@ -160,13 +37,13 @@
160
37
  {@render children?.()}
161
38
 
162
39
  {#if loading}
163
- <span in:fly={{ duration: 200, x: 20 }} data-slot="loading" class={styles.chevron()}>
40
+ <span in:fly={{ duration: 200, x: 20 }} data-slot="loading" class={variants.chevron()}>
164
41
  <!-- <AnimatedLoaderIcon width={18} height={18} /> -->
165
42
  </span>
166
43
  {/if}
167
44
 
168
45
  {#if endChevron && !loading}
169
- <span data-slot="end-chevron" class={styles.chevron}>
46
+ <span data-slot="end-chevron" class={variants.chevron}>
170
47
  {@render endChevron()}
171
48
  </span>
172
49
  {/if}