@cloudvoyant/helix-svelte 0.12.0 → 0.13.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.
- package/dist/Input.svelte +17 -0
- package/dist/Input.svelte.d.ts +8 -0
- package/dist/Textarea.svelte +14 -0
- package/dist/Textarea.svelte.d.ts +4 -0
- package/dist/checkbox/Checkbox.svelte +23 -0
- package/dist/checkbox/Checkbox.svelte.d.ts +8 -0
- package/dist/checkbox/CheckboxContext.svelte.d.ts +1 -0
- package/dist/checkbox/CheckboxContext.svelte.js +3 -0
- package/dist/checkbox/CheckboxControl.svelte +17 -0
- package/dist/checkbox/CheckboxControl.svelte.d.ts +4 -0
- package/dist/checkbox/CheckboxGroup.svelte +14 -0
- package/dist/checkbox/CheckboxGroup.svelte.d.ts +4 -0
- package/dist/checkbox/CheckboxIndicator.svelte +14 -0
- package/dist/checkbox/CheckboxIndicator.svelte.d.ts +4 -0
- package/dist/checkbox/CheckboxLabel.svelte +14 -0
- package/dist/checkbox/CheckboxLabel.svelte.d.ts +4 -0
- package/dist/checkbox/index.d.ts +6 -0
- package/dist/checkbox/index.js +7 -0
- package/dist/combobox/Combobox.svelte +25 -0
- package/dist/combobox/Combobox.svelte.d.ts +9 -0
- package/dist/combobox/ComboboxClear.svelte +14 -0
- package/dist/combobox/ComboboxClear.svelte.d.ts +4 -0
- package/dist/combobox/ComboboxContent.svelte +19 -0
- package/dist/combobox/ComboboxContent.svelte.d.ts +4 -0
- package/dist/combobox/ComboboxContext.svelte.d.ts +1 -0
- package/dist/combobox/ComboboxContext.svelte.js +3 -0
- package/dist/combobox/ComboboxControl.svelte +14 -0
- package/dist/combobox/ComboboxControl.svelte.d.ts +4 -0
- package/dist/combobox/ComboboxEmpty.svelte +18 -0
- package/dist/combobox/ComboboxEmpty.svelte.d.ts +4 -0
- package/dist/combobox/ComboboxInput.svelte +17 -0
- package/dist/combobox/ComboboxInput.svelte.d.ts +8 -0
- package/dist/combobox/ComboboxItem.svelte +22 -0
- package/dist/combobox/ComboboxItem.svelte.d.ts +10 -0
- package/dist/combobox/ComboboxItemGroup.svelte +11 -0
- package/dist/combobox/ComboboxItemGroup.svelte.d.ts +4 -0
- package/dist/combobox/ComboboxItemGroupLabel.svelte +14 -0
- package/dist/combobox/ComboboxItemGroupLabel.svelte.d.ts +4 -0
- package/dist/combobox/ComboboxItemIndicator.svelte +14 -0
- package/dist/combobox/ComboboxItemIndicator.svelte.d.ts +4 -0
- package/dist/combobox/ComboboxItemText.svelte +11 -0
- package/dist/combobox/ComboboxItemText.svelte.d.ts +4 -0
- package/dist/combobox/ComboboxList.svelte +14 -0
- package/dist/combobox/ComboboxList.svelte.d.ts +4 -0
- package/dist/combobox/ComboboxTrigger.svelte +14 -0
- package/dist/combobox/ComboboxTrigger.svelte.d.ts +4 -0
- package/dist/combobox/index.d.ts +14 -0
- package/dist/combobox/index.js +15 -0
- package/dist/field/Field.svelte +14 -0
- package/dist/field/Field.svelte.d.ts +4 -0
- package/dist/field/FieldContext.svelte.d.ts +1 -0
- package/dist/field/FieldContext.svelte.js +3 -0
- package/dist/field/FieldError.svelte +14 -0
- package/dist/field/FieldError.svelte.d.ts +4 -0
- package/dist/field/FieldHelper.svelte +14 -0
- package/dist/field/FieldHelper.svelte.d.ts +4 -0
- package/dist/field/FieldLabel.svelte +14 -0
- package/dist/field/FieldLabel.svelte.d.ts +4 -0
- package/dist/field/FieldRequiredIndicator.svelte +14 -0
- package/dist/field/FieldRequiredIndicator.svelte.d.ts +4 -0
- package/dist/field/FieldSet.svelte +14 -0
- package/dist/field/FieldSet.svelte.d.ts +4 -0
- package/dist/field/FieldSetError.svelte +14 -0
- package/dist/field/FieldSetError.svelte.d.ts +4 -0
- package/dist/field/FieldSetHelper.svelte +14 -0
- package/dist/field/FieldSetHelper.svelte.d.ts +4 -0
- package/dist/field/FieldSetLegend.svelte +14 -0
- package/dist/field/FieldSetLegend.svelte.d.ts +4 -0
- package/dist/field/index.d.ts +10 -0
- package/dist/field/index.js +11 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/number-input/NumberInput.svelte +14 -0
- package/dist/number-input/NumberInput.svelte.d.ts +4 -0
- package/dist/number-input/NumberInputContext.svelte.d.ts +1 -0
- package/dist/number-input/NumberInputContext.svelte.js +3 -0
- package/dist/number-input/NumberInputControl.svelte +14 -0
- package/dist/number-input/NumberInputControl.svelte.d.ts +4 -0
- package/dist/number-input/NumberInputDecrement.svelte +14 -0
- package/dist/number-input/NumberInputDecrement.svelte.d.ts +4 -0
- package/dist/number-input/NumberInputIncrement.svelte +14 -0
- package/dist/number-input/NumberInputIncrement.svelte.d.ts +4 -0
- package/dist/number-input/NumberInputInput.svelte +12 -0
- package/dist/number-input/NumberInputInput.svelte.d.ts +4 -0
- package/dist/number-input/index.d.ts +6 -0
- package/dist/number-input/index.js +7 -0
- package/dist/select/Select.svelte +70 -0
- package/dist/select/Select.svelte.d.ts +11 -0
- package/dist/select/SelectClearTrigger.svelte +14 -0
- package/dist/select/SelectClearTrigger.svelte.d.ts +4 -0
- package/dist/select/SelectContent.svelte +19 -0
- package/dist/select/SelectContent.svelte.d.ts +4 -0
- package/dist/select/SelectContext.svelte.d.ts +1 -0
- package/dist/select/SelectContext.svelte.js +3 -0
- package/dist/select/SelectIndicator.svelte +14 -0
- package/dist/select/SelectIndicator.svelte.d.ts +4 -0
- package/dist/select/SelectItem.svelte +21 -0
- package/dist/select/SelectItem.svelte.d.ts +9 -0
- package/dist/select/SelectItemGroup.svelte +11 -0
- package/dist/select/SelectItemGroup.svelte.d.ts +4 -0
- package/dist/select/SelectItemGroupLabel.svelte +14 -0
- package/dist/select/SelectItemGroupLabel.svelte.d.ts +4 -0
- package/dist/select/SelectItemIndicator.svelte +14 -0
- package/dist/select/SelectItemIndicator.svelte.d.ts +4 -0
- package/dist/select/SelectItemText.svelte +14 -0
- package/dist/select/SelectItemText.svelte.d.ts +4 -0
- package/dist/select/SelectNative.svelte +73 -0
- package/dist/select/SelectNative.svelte.d.ts +16 -0
- package/dist/select/SelectTrigger.svelte +19 -0
- package/dist/select/SelectTrigger.svelte.d.ts +8 -0
- package/dist/select/SelectValue.svelte +18 -0
- package/dist/select/SelectValue.svelte.d.ts +4 -0
- package/dist/select/index.d.ts +13 -0
- package/dist/select/index.js +14 -0
- package/dist/switch/Switch.svelte +23 -0
- package/dist/switch/Switch.svelte.d.ts +8 -0
- package/dist/switch/SwitchContext.svelte.d.ts +1 -0
- package/dist/switch/SwitchContext.svelte.js +3 -0
- package/dist/switch/SwitchControl.svelte +17 -0
- package/dist/switch/SwitchControl.svelte.d.ts +4 -0
- package/dist/switch/SwitchLabel.svelte +14 -0
- package/dist/switch/SwitchLabel.svelte.d.ts +4 -0
- package/dist/switch/SwitchThumb.svelte +12 -0
- package/dist/switch/SwitchThumb.svelte.d.ts +4 -0
- package/dist/switch/index.d.ts +5 -0
- package/dist/switch/index.js +6 -0
- package/dist/tags-input/TagInput.svelte +19 -0
- package/dist/tags-input/TagInput.svelte.d.ts +4 -0
- package/dist/tags-input/TagInputClearTrigger.svelte +14 -0
- package/dist/tags-input/TagInputClearTrigger.svelte.d.ts +4 -0
- package/dist/tags-input/TagInputContext.svelte.d.ts +1 -0
- package/dist/tags-input/TagInputContext.svelte.js +3 -0
- package/dist/tags-input/TagInputControl.svelte +14 -0
- package/dist/tags-input/TagInputControl.svelte.d.ts +4 -0
- package/dist/tags-input/TagInputInput.svelte +12 -0
- package/dist/tags-input/TagInputInput.svelte.d.ts +4 -0
- package/dist/tags-input/TagInputItem.svelte +14 -0
- package/dist/tags-input/TagInputItem.svelte.d.ts +4 -0
- package/dist/tags-input/TagInputItemDeleteTrigger.svelte +14 -0
- package/dist/tags-input/TagInputItemDeleteTrigger.svelte.d.ts +4 -0
- package/dist/tags-input/TagInputItemInput.svelte +12 -0
- package/dist/tags-input/TagInputItemInput.svelte.d.ts +4 -0
- package/dist/tags-input/TagInputItemPreview.svelte +11 -0
- package/dist/tags-input/TagInputItemPreview.svelte.d.ts +4 -0
- package/dist/tags-input/TagInputItemText.svelte +14 -0
- package/dist/tags-input/TagInputItemText.svelte.d.ts +4 -0
- package/dist/tags-input/index.d.ts +11 -0
- package/dist/tags-input/index.js +12 -0
- package/package.json +2 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/Input.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI input (@ark-ui/svelte/field), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { FieldInput, type FieldInputProps } from '@ark-ui/svelte/field';
|
|
5
|
+
import { inputVariants, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
type Props = Omit<FieldInputProps, 'size'> & {
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
class?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
let { size = 'md', class: className = '', ...rest }: Props = $props();
|
|
13
|
+
|
|
14
|
+
const classes = $derived(cn(inputVariants({ size }), className));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<FieldInput class={classes} {...rest} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type FieldInputProps } from '@ark-ui/svelte/field';
|
|
2
|
+
type Props = Omit<FieldInputProps, 'size'> & {
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
class?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const Input: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type Input = ReturnType<typeof Input>;
|
|
8
|
+
export default Input;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/Textarea.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI textarea (@ark-ui/svelte/field), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { FieldTextarea, type FieldTextareaProps } from '@ark-ui/svelte/field';
|
|
5
|
+
import { textareaBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
let { class: className = '', children, ...rest }: FieldTextareaProps = $props();
|
|
8
|
+
|
|
9
|
+
const classes = $derived(cn(textareaBase, className));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<FieldTextarea class={classes} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</FieldTextarea>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/checkbox/Checkbox.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI checkbox (@ark-ui/svelte/checkbox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { setContext } from 'svelte';
|
|
5
|
+
import { CheckboxRoot, CheckboxHiddenInput, type CheckboxRootProps } from '@ark-ui/svelte/checkbox';
|
|
6
|
+
import { cn } from '@cloudvoyant/helix';
|
|
7
|
+
|
|
8
|
+
type Props = CheckboxRootProps & {
|
|
9
|
+
size?: 'sm' | 'md' | 'lg';
|
|
10
|
+
class?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
let { size = 'md', class: className = '', children, ...rest }: Props = $props();
|
|
14
|
+
|
|
15
|
+
setContext<'sm' | 'md' | 'lg'>('checkbox-size', size);
|
|
16
|
+
|
|
17
|
+
const classes = $derived(cn('flex items-center gap-2', className));
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<CheckboxRoot class={classes} {...rest}>
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
<CheckboxHiddenInput />
|
|
23
|
+
</CheckboxRoot>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type CheckboxRootProps } from '@ark-ui/svelte/checkbox';
|
|
2
|
+
type Props = CheckboxRootProps & {
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
class?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const Checkbox: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type Checkbox = ReturnType<typeof Checkbox>;
|
|
8
|
+
export default Checkbox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useCheckboxContext as useCheckbox } from '@ark-ui/svelte/checkbox';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/checkbox/CheckboxControl.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI checkbox (@ark-ui/svelte/checkbox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { getContext } from 'svelte';
|
|
5
|
+
import { CheckboxControl, type CheckboxControlProps } from '@ark-ui/svelte/checkbox';
|
|
6
|
+
import { checkboxVariants, cn } from '@cloudvoyant/helix';
|
|
7
|
+
|
|
8
|
+
let { class: className = '', children, ...rest }: CheckboxControlProps = $props();
|
|
9
|
+
|
|
10
|
+
const size = getContext<'sm' | 'md' | 'lg'>('checkbox-size');
|
|
11
|
+
|
|
12
|
+
const classes = $derived(cn(checkboxVariants({ size }), className));
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<CheckboxControl class={classes} {...rest}>
|
|
16
|
+
{@render children?.()}
|
|
17
|
+
</CheckboxControl>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/checkbox/CheckboxGroup.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI checkbox (@ark-ui/svelte/checkbox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { CheckboxGroup, type CheckboxGroupProps } from '@ark-ui/svelte/checkbox';
|
|
5
|
+
import { checkboxGroupBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
let { class: className = '', children, ...rest }: CheckboxGroupProps = $props();
|
|
8
|
+
|
|
9
|
+
const classes = $derived(cn(checkboxGroupBase, className));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<CheckboxGroup class={classes} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</CheckboxGroup>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/checkbox/CheckboxIndicator.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI checkbox (@ark-ui/svelte/checkbox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { CheckboxIndicator, type CheckboxIndicatorProps } from '@ark-ui/svelte/checkbox';
|
|
5
|
+
import { checkboxIndicatorBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
let { class: className = '', children, ...rest }: CheckboxIndicatorProps = $props();
|
|
8
|
+
|
|
9
|
+
const classes = $derived(cn(checkboxIndicatorBase, className));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<CheckboxIndicator class={classes} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</CheckboxIndicator>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CheckboxIndicator, type CheckboxIndicatorProps } from '@ark-ui/svelte/checkbox';
|
|
2
|
+
declare const CheckboxIndicator: import("svelte").Component<CheckboxIndicatorProps, {}, "">;
|
|
3
|
+
type CheckboxIndicator = ReturnType<typeof CheckboxIndicator>;
|
|
4
|
+
export default CheckboxIndicator;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/checkbox/CheckboxLabel.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI checkbox (@ark-ui/svelte/checkbox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { CheckboxLabel, type CheckboxLabelProps } from '@ark-ui/svelte/checkbox';
|
|
5
|
+
import { checkboxLabelBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
let { class: className = '', children, ...rest }: CheckboxLabelProps = $props();
|
|
8
|
+
|
|
9
|
+
const classes = $derived(cn(checkboxLabelBase, className));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<CheckboxLabel class={classes} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</CheckboxLabel>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as Checkbox } from './Checkbox.svelte';
|
|
2
|
+
export { default as CheckboxControl } from './CheckboxControl.svelte';
|
|
3
|
+
export { default as CheckboxIndicator } from './CheckboxIndicator.svelte';
|
|
4
|
+
export { default as CheckboxLabel } from './CheckboxLabel.svelte';
|
|
5
|
+
export { default as CheckboxGroup } from './CheckboxGroup.svelte';
|
|
6
|
+
export { useCheckbox } from './CheckboxContext.svelte';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// libs/helix-svelte/src/checkbox/index.ts
|
|
2
|
+
export { default as Checkbox } from './Checkbox.svelte';
|
|
3
|
+
export { default as CheckboxControl } from './CheckboxControl.svelte';
|
|
4
|
+
export { default as CheckboxIndicator } from './CheckboxIndicator.svelte';
|
|
5
|
+
export { default as CheckboxLabel } from './CheckboxLabel.svelte';
|
|
6
|
+
export { default as CheckboxGroup } from './CheckboxGroup.svelte';
|
|
7
|
+
export { useCheckbox } from './CheckboxContext.svelte';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/combobox/Combobox.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI combobox (@ark-ui/svelte/combobox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<!-- Note: adapted to Ark UI v5 collection-based API (ComboboxRoot `collection` + ComboboxItem `item`). -->
|
|
4
|
+
<script lang="ts">
|
|
5
|
+
import {
|
|
6
|
+
ComboboxRoot,
|
|
7
|
+
createListCollection,
|
|
8
|
+
type ComboboxRootProps,
|
|
9
|
+
type ListCollection,
|
|
10
|
+
} from '@ark-ui/svelte/combobox';
|
|
11
|
+
import type { SelectItemData } from '@cloudvoyant/helix';
|
|
12
|
+
|
|
13
|
+
type Props = Omit<ComboboxRootProps<SelectItemData>, 'collection'> & {
|
|
14
|
+
items?: SelectItemData[];
|
|
15
|
+
collection?: ListCollection<SelectItemData>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
let { items, collection, openOnClick = true, lazyMount = true, unmountOnExit = true, children, ...rest }: Props = $props();
|
|
19
|
+
|
|
20
|
+
const resolvedCollection = $derived(collection ?? createListCollection({ items: items ?? [] }));
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<ComboboxRoot collection={resolvedCollection} {openOnClick} {lazyMount} {unmountOnExit} {...rest}>
|
|
24
|
+
{@render children?.()}
|
|
25
|
+
</ComboboxRoot>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComboboxRootProps, type ListCollection } from '@ark-ui/svelte/combobox';
|
|
2
|
+
import type { SelectItemData } from '@cloudvoyant/helix';
|
|
3
|
+
type Props = Omit<ComboboxRootProps<SelectItemData>, 'collection'> & {
|
|
4
|
+
items?: SelectItemData[];
|
|
5
|
+
collection?: ListCollection<SelectItemData>;
|
|
6
|
+
};
|
|
7
|
+
declare const Combobox: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type Combobox = ReturnType<typeof Combobox>;
|
|
9
|
+
export default Combobox;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/combobox/ComboboxClear.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI combobox (@ark-ui/svelte/combobox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { ComboboxClearTrigger, type ComboboxClearTriggerProps } from '@ark-ui/svelte/combobox';
|
|
5
|
+
import { comboboxClearTriggerBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
let { class: className = '', children, ...rest }: ComboboxClearTriggerProps = $props();
|
|
8
|
+
|
|
9
|
+
const classes = $derived(cn(comboboxClearTriggerBase, className));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<ComboboxClearTrigger aria-label="Clear" class={classes} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</ComboboxClearTrigger>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/combobox/ComboboxContent.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI combobox (@ark-ui/svelte/combobox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { Portal } from '@ark-ui/svelte/portal';
|
|
5
|
+
import { ComboboxPositioner, ComboboxContent, type ComboboxContentProps } from '@ark-ui/svelte/combobox';
|
|
6
|
+
import { comboboxContentBase, comboboxPositionerBase, cn } from '@cloudvoyant/helix';
|
|
7
|
+
|
|
8
|
+
let { class: className = '', children, ...rest }: ComboboxContentProps = $props();
|
|
9
|
+
|
|
10
|
+
const classes = $derived(cn(comboboxContentBase, className));
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<Portal>
|
|
14
|
+
<ComboboxPositioner class={comboboxPositionerBase}>
|
|
15
|
+
<ComboboxContent class={classes} {...rest}>
|
|
16
|
+
{@render children?.()}
|
|
17
|
+
</ComboboxContent>
|
|
18
|
+
</ComboboxPositioner>
|
|
19
|
+
</Portal>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useComboboxContext as useCombobox } from '@ark-ui/svelte/combobox';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/combobox/ComboboxControl.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI combobox (@ark-ui/svelte/combobox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { ComboboxControl, type ComboboxControlProps } from '@ark-ui/svelte/combobox';
|
|
5
|
+
import { comboboxControlBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
let { class: className = '', children, ...rest }: ComboboxControlProps = $props();
|
|
8
|
+
|
|
9
|
+
const classes = $derived(cn(comboboxControlBase, className));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<ComboboxControl class={classes} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</ComboboxControl>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/combobox/ComboboxEmpty.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI combobox (@ark-ui/svelte/combobox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { ComboboxEmpty, type ComboboxEmptyProps } from '@ark-ui/svelte/combobox';
|
|
5
|
+
import { comboboxEmptyBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
let { class: className = '', children, ...rest }: ComboboxEmptyProps = $props();
|
|
8
|
+
|
|
9
|
+
const classes = $derived(cn(comboboxEmptyBase, className));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<ComboboxEmpty class={classes} {...rest}>
|
|
13
|
+
{#if children}
|
|
14
|
+
{@render children()}
|
|
15
|
+
{:else}
|
|
16
|
+
No results found.
|
|
17
|
+
{/if}
|
|
18
|
+
</ComboboxEmpty>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/combobox/ComboboxInput.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI combobox (@ark-ui/svelte/combobox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { ComboboxInput, type ComboboxInputProps } from '@ark-ui/svelte/combobox';
|
|
5
|
+
import { inputVariants, comboboxInputBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
type Props = Omit<ComboboxInputProps, 'size'> & {
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
class?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
let { size = 'md', class: className = '', ...rest }: Props = $props();
|
|
13
|
+
|
|
14
|
+
const classes = $derived(cn(inputVariants({ size }), comboboxInputBase, className));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<ComboboxInput class={classes} {...rest} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComboboxInput, type ComboboxInputProps } from '@ark-ui/svelte/combobox';
|
|
2
|
+
type Props = Omit<ComboboxInputProps, 'size'> & {
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
class?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const ComboboxInput: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type ComboboxInput = ReturnType<typeof ComboboxInput>;
|
|
8
|
+
export default ComboboxInput;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/combobox/ComboboxItem.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI combobox (@ark-ui/svelte/combobox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<!-- Note: adapted to Ark UI v5 — ComboboxItem takes `item` (the collection item). -->
|
|
4
|
+
<script lang="ts">
|
|
5
|
+
import { ComboboxItem, type ComboboxItemProps } from '@ark-ui/svelte/combobox';
|
|
6
|
+
import { comboboxItemVariants, cn } from '@cloudvoyant/helix';
|
|
7
|
+
import type { SelectItemData } from '@cloudvoyant/helix';
|
|
8
|
+
|
|
9
|
+
type Props = Omit<ComboboxItemProps, 'item'> & {
|
|
10
|
+
item: SelectItemData;
|
|
11
|
+
showIndicator?: boolean;
|
|
12
|
+
class?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
let { item, showIndicator = true, class: className = '', children, ...rest }: Props = $props();
|
|
16
|
+
|
|
17
|
+
const classes = $derived(cn(comboboxItemVariants({ showIndicator }), className));
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<ComboboxItem {item} persistFocus class={classes} {...rest}>
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</ComboboxItem>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComboboxItem, type ComboboxItemProps } from '@ark-ui/svelte/combobox';
|
|
2
|
+
import type { SelectItemData } from '@cloudvoyant/helix';
|
|
3
|
+
type Props = Omit<ComboboxItemProps, 'item'> & {
|
|
4
|
+
item: SelectItemData;
|
|
5
|
+
showIndicator?: boolean;
|
|
6
|
+
class?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const ComboboxItem: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type ComboboxItem = ReturnType<typeof ComboboxItem>;
|
|
10
|
+
export default ComboboxItem;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/combobox/ComboboxItemGroup.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI combobox (@ark-ui/svelte/combobox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { ComboboxItemGroup, type ComboboxItemGroupProps } from '@ark-ui/svelte/combobox';
|
|
5
|
+
|
|
6
|
+
let { class: className = '', children, ...rest }: ComboboxItemGroupProps = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<ComboboxItemGroup class={className} {...rest}>
|
|
10
|
+
{@render children?.()}
|
|
11
|
+
</ComboboxItemGroup>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ComboboxItemGroup, type ComboboxItemGroupProps } from '@ark-ui/svelte/combobox';
|
|
2
|
+
declare const ComboboxItemGroup: import("svelte").Component<ComboboxItemGroupProps, {}, "">;
|
|
3
|
+
type ComboboxItemGroup = ReturnType<typeof ComboboxItemGroup>;
|
|
4
|
+
export default ComboboxItemGroup;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/combobox/ComboboxItemGroupLabel.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI combobox (@ark-ui/svelte/combobox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { ComboboxItemGroupLabel, type ComboboxItemGroupLabelProps } from '@ark-ui/svelte/combobox';
|
|
5
|
+
import { comboboxItemGroupLabelBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
let { class: className = '', children, ...rest }: ComboboxItemGroupLabelProps = $props();
|
|
8
|
+
|
|
9
|
+
const classes = $derived(cn(comboboxItemGroupLabelBase, className));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<ComboboxItemGroupLabel class={classes} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</ComboboxItemGroupLabel>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ComboboxItemGroupLabel, type ComboboxItemGroupLabelProps } from '@ark-ui/svelte/combobox';
|
|
2
|
+
declare const ComboboxItemGroupLabel: import("svelte").Component<ComboboxItemGroupLabelProps, {}, "">;
|
|
3
|
+
type ComboboxItemGroupLabel = ReturnType<typeof ComboboxItemGroupLabel>;
|
|
4
|
+
export default ComboboxItemGroupLabel;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/combobox/ComboboxItemIndicator.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI combobox (@ark-ui/svelte/combobox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { ComboboxItemIndicator, type ComboboxItemIndicatorProps } from '@ark-ui/svelte/combobox';
|
|
5
|
+
import { comboboxItemIndicatorBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
let { class: className = '', children, ...rest }: ComboboxItemIndicatorProps = $props();
|
|
8
|
+
|
|
9
|
+
const classes = $derived(cn(comboboxItemIndicatorBase, className));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<ComboboxItemIndicator class={classes} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</ComboboxItemIndicator>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ComboboxItemIndicator, type ComboboxItemIndicatorProps } from '@ark-ui/svelte/combobox';
|
|
2
|
+
declare const ComboboxItemIndicator: import("svelte").Component<ComboboxItemIndicatorProps, {}, "">;
|
|
3
|
+
type ComboboxItemIndicator = ReturnType<typeof ComboboxItemIndicator>;
|
|
4
|
+
export default ComboboxItemIndicator;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/combobox/ComboboxItemText.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI combobox (@ark-ui/svelte/combobox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { ComboboxItemText, type ComboboxItemTextProps } from '@ark-ui/svelte/combobox';
|
|
5
|
+
|
|
6
|
+
let { class: className = '', children, ...rest }: ComboboxItemTextProps = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<ComboboxItemText class={className} {...rest}>
|
|
10
|
+
{@render children?.()}
|
|
11
|
+
</ComboboxItemText>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ComboboxItemText, type ComboboxItemTextProps } from '@ark-ui/svelte/combobox';
|
|
2
|
+
declare const ComboboxItemText: import("svelte").Component<ComboboxItemTextProps, {}, "">;
|
|
3
|
+
type ComboboxItemText = ReturnType<typeof ComboboxItemText>;
|
|
4
|
+
export default ComboboxItemText;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/combobox/ComboboxList.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI combobox (@ark-ui/svelte/combobox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { ComboboxList, type ComboboxListProps } from '@ark-ui/svelte/combobox';
|
|
5
|
+
import { comboboxListBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
let { class: className = '', children, ...rest }: ComboboxListProps = $props();
|
|
8
|
+
|
|
9
|
+
const classes = $derived(cn(comboboxListBase, className));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<ComboboxList class={classes} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</ComboboxList>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/combobox/ComboboxTrigger.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI combobox (@ark-ui/svelte/combobox), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { ComboboxTrigger, type ComboboxTriggerProps } from '@ark-ui/svelte/combobox';
|
|
5
|
+
import { comboboxTriggerBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
let { class: className = '', children, ...rest }: ComboboxTriggerProps = $props();
|
|
8
|
+
|
|
9
|
+
const classes = $derived(cn(comboboxTriggerBase, className));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<ComboboxTrigger class={classes} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</ComboboxTrigger>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { default as Combobox } from './Combobox.svelte';
|
|
2
|
+
export { default as ComboboxControl } from './ComboboxControl.svelte';
|
|
3
|
+
export { default as ComboboxInput } from './ComboboxInput.svelte';
|
|
4
|
+
export { default as ComboboxTrigger } from './ComboboxTrigger.svelte';
|
|
5
|
+
export { default as ComboboxClear } from './ComboboxClear.svelte';
|
|
6
|
+
export { default as ComboboxContent } from './ComboboxContent.svelte';
|
|
7
|
+
export { default as ComboboxItemGroup } from './ComboboxItemGroup.svelte';
|
|
8
|
+
export { default as ComboboxItemGroupLabel } from './ComboboxItemGroupLabel.svelte';
|
|
9
|
+
export { default as ComboboxItem } from './ComboboxItem.svelte';
|
|
10
|
+
export { default as ComboboxItemText } from './ComboboxItemText.svelte';
|
|
11
|
+
export { default as ComboboxItemIndicator } from './ComboboxItemIndicator.svelte';
|
|
12
|
+
export { default as ComboboxList } from './ComboboxList.svelte';
|
|
13
|
+
export { default as ComboboxEmpty } from './ComboboxEmpty.svelte';
|
|
14
|
+
export { useCombobox } from './ComboboxContext.svelte';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// libs/helix-svelte/src/combobox/index.ts
|
|
2
|
+
export { default as Combobox } from './Combobox.svelte';
|
|
3
|
+
export { default as ComboboxControl } from './ComboboxControl.svelte';
|
|
4
|
+
export { default as ComboboxInput } from './ComboboxInput.svelte';
|
|
5
|
+
export { default as ComboboxTrigger } from './ComboboxTrigger.svelte';
|
|
6
|
+
export { default as ComboboxClear } from './ComboboxClear.svelte';
|
|
7
|
+
export { default as ComboboxContent } from './ComboboxContent.svelte';
|
|
8
|
+
export { default as ComboboxItemGroup } from './ComboboxItemGroup.svelte';
|
|
9
|
+
export { default as ComboboxItemGroupLabel } from './ComboboxItemGroupLabel.svelte';
|
|
10
|
+
export { default as ComboboxItem } from './ComboboxItem.svelte';
|
|
11
|
+
export { default as ComboboxItemText } from './ComboboxItemText.svelte';
|
|
12
|
+
export { default as ComboboxItemIndicator } from './ComboboxItemIndicator.svelte';
|
|
13
|
+
export { default as ComboboxList } from './ComboboxList.svelte';
|
|
14
|
+
export { default as ComboboxEmpty } from './ComboboxEmpty.svelte';
|
|
15
|
+
export { useCombobox } from './ComboboxContext.svelte';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/field/Field.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI field (@ark-ui/svelte/field), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { FieldRoot, type FieldRootProps } from '@ark-ui/svelte/field';
|
|
5
|
+
import { fieldRootBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
let { class: className = '', children, ...rest }: FieldRootProps = $props();
|
|
8
|
+
|
|
9
|
+
const classes = $derived(cn(fieldRootBase, className));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<FieldRoot class={classes} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</FieldRoot>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFieldContext as useField } from '@ark-ui/svelte/field';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- libs/helix-svelte/src/field/FieldError.svelte -->
|
|
2
|
+
<!-- Closely based on: Shark UI field (@ark-ui/svelte/field), mirrored from @cloudvoyant/helix-react -->
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { FieldErrorText, type FieldErrorTextProps } from '@ark-ui/svelte/field';
|
|
5
|
+
import { fieldErrorBase, cn } from '@cloudvoyant/helix';
|
|
6
|
+
|
|
7
|
+
let { class: className = '', children, ...rest }: FieldErrorTextProps = $props();
|
|
8
|
+
|
|
9
|
+
const classes = $derived(cn(fieldErrorBase, className));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<FieldErrorText class={classes} {...rest}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</FieldErrorText>
|