@casinogate/ui 1.3.3 → 1.3.5

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.
@@ -3,3 +3,4 @@ export * from './exports.js';
3
3
  export { createTable } from './models/index.js';
4
4
  export type { ColumnDef, DataTableBodyProps, DataTableCellProps, DataTableHeaderProps, DataTableHeadProps, DataTableProps, DataTableResizeHandlerProps, DataTableRootProps, DataTableRowProps, DataTableSortButtonProps, DataTableTableProps, RowData, } from './types.js';
5
5
  export { rowModels, usePaginationState, useResizeState, useRowSelectionState } from './utils/index.js';
6
+ export { renderComponent, renderSnippet } from './utils/render-helper.js';
@@ -2,3 +2,4 @@ export * as DataTablePrimitive from './exports-primitive.js';
2
2
  export * from './exports.js';
3
3
  export { createTable } from './models/index.js';
4
4
  export { rowModels, usePaginationState, useResizeState, useRowSelectionState } from './utils/index.js';
5
+ export { renderComponent, renderSnippet } from './utils/render-helper.js';
@@ -1,23 +1,21 @@
1
- <script lang="ts" module>
2
- import type { Snippet } from 'svelte';
3
-
4
- export type FieldProps = WithoutChildrenOrChild<FieldRootProps> & {
5
- label?: string | Snippet;
6
- error?: string | Snippet;
7
- description?: string | Snippet;
8
- children?: Snippet<[{ props: Record<string, unknown> }]>;
9
- };
10
- </script>
11
-
12
1
  <script lang="ts">
13
2
  import type { WithoutChildrenOrChild } from 'svelte-toolbelt';
14
3
  import FieldControl from './components/field.control.svelte';
15
4
  import FieldDescription from './components/field.description.svelte';
16
5
  import FieldError from './components/field.error.svelte';
17
6
  import FieldLabel from './components/field.label.svelte';
18
- import FieldRoot, { type FieldRootProps } from './components/field.root.svelte';
7
+ import FieldRoot from './components/field.root.svelte';
8
+
9
+ import type { FieldProps } from './types.js';
19
10
 
20
- let { label, error, description, ref = $bindable(null), children: childrenSlot, ...restProps }: FieldProps = $props();
11
+ let {
12
+ label,
13
+ error,
14
+ description,
15
+ ref = $bindable(null),
16
+ children: childrenSnippet,
17
+ ...restProps
18
+ }: FieldProps = $props();
21
19
  </script>
22
20
 
23
21
  <FieldRoot bind:ref {...restProps}>
@@ -29,7 +27,7 @@
29
27
 
30
28
  <FieldControl>
31
29
  {#snippet children({ props })}
32
- {@render childrenSlot?.({ props })}
30
+ {@render childrenSnippet?.({ props })}
33
31
  {/snippet}
34
32
  </FieldControl>
35
33
 
@@ -1,14 +1,4 @@
1
- import type { Snippet } from 'svelte';
2
- export type FieldProps = WithoutChildrenOrChild<FieldRootProps> & {
3
- label?: string | Snippet;
4
- error?: string | Snippet;
5
- description?: string | Snippet;
6
- children?: Snippet<[{
7
- props: Record<string, unknown>;
8
- }]>;
9
- };
10
- import type { WithoutChildrenOrChild } from 'svelte-toolbelt';
11
- import { type FieldRootProps } from './components/field.root.svelte';
12
- declare const Field: import("svelte").Component<any, {}, "ref">;
1
+ import type { FieldProps } from './types.js';
2
+ declare const Field: import("svelte").Component<FieldProps, {}, "ref">;
13
3
  type Field = ReturnType<typeof Field>;
14
4
  export default Field;
@@ -1,3 +1,3 @@
1
1
  export * as FieldPrimitive from './exports-primitive.js';
2
2
  export * from './exports.js';
3
- export type { FieldControlProps, FieldDescriptionProps, FieldErrorProps, FieldLabelProps, FieldRootProps, } from './types.js';
3
+ export type { FieldControlProps, FieldDescriptionProps, FieldErrorProps, FieldLabelProps, FieldProps, FieldRootProps, } from './types.js';
@@ -1,6 +1,6 @@
1
1
  import type { PrimitiveDivAttributes, PrimitiveLabelAttributes, PrimitiveSpanAttributes } from '../../internal/types/html-attributes.js';
2
2
  import type { Snippet } from 'svelte';
3
- import type { WithChild, WithElementRef, Without } from 'svelte-toolbelt';
3
+ import type { WithChild, WithElementRef, Without, WithoutChildrenOrChild } from 'svelte-toolbelt';
4
4
  type FieldRootPropsWithoutHTML = WithElementRef<WithChild<{
5
5
  invalid?: boolean;
6
6
  disabled?: boolean;
@@ -20,4 +20,12 @@ type FieldErrorPropsWithoutHTML = WithElementRef<WithChild<{}>>;
20
20
  export type FieldErrorProps = FieldErrorPropsWithoutHTML & Without<PrimitiveSpanAttributes, FieldErrorPropsWithoutHTML>;
21
21
  type FieldLabelPropsWithoutHTML = WithElementRef<WithChild<{}>>;
22
22
  export type FieldLabelProps = FieldLabelPropsWithoutHTML & Without<PrimitiveLabelAttributes, FieldLabelPropsWithoutHTML>;
23
+ export type FieldProps = WithoutChildrenOrChild<FieldRootProps> & {
24
+ label?: string | Snippet;
25
+ error?: string | Snippet;
26
+ description?: string | Snippet;
27
+ children?: Snippet<[{
28
+ props: Record<string, unknown>;
29
+ }]>;
30
+ };
23
31
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casinogate/ui",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "svelte": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",