tera-system-ui 0.0.2 → 0.0.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.
- package/dist/actions/clickOutside.d.ts +6 -0
- package/dist/{components/side-navigation → actions}/clickOutside.js +3 -2
- package/dist/components/button/Button.d.ts +2 -2
- package/dist/components/button/Button.js +5 -5
- package/dist/components/button/Button.svelte +10 -8
- package/dist/components/button/Button.svelte.d.ts +3 -1
- package/dist/components/combobox/Combobox.d.ts +8 -0
- package/dist/components/combobox/Combobox.js +7 -0
- package/dist/components/combobox/Combobox.svelte +8 -0
- package/dist/components/combobox/Combobox.svelte.d.ts +3 -0
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/combobox/index.js +1 -0
- package/dist/components/command/command.d.ts +33 -0
- package/dist/components/command/command.js +512 -0
- package/dist/components/command/command.scss +73 -0
- package/dist/components/command/components/Command.svelte +120 -0
- package/dist/components/command/components/Command.svelte.d.ts +3 -0
- package/dist/components/command/components/CommandEmpty.svelte +30 -0
- package/dist/components/command/components/CommandEmpty.svelte.d.ts +3 -0
- package/dist/components/command/components/CommandGroup.svelte +110 -0
- package/dist/components/command/components/CommandGroup.svelte.d.ts +3 -0
- package/dist/components/command/components/CommandInput.svelte +93 -0
- package/dist/components/command/components/CommandInput.svelte.d.ts +7 -0
- package/dist/components/command/components/CommandItem.svelte +110 -0
- package/dist/components/command/components/CommandItem.svelte.d.ts +3 -0
- package/dist/components/command/components/CommandList.svelte +56 -0
- package/dist/components/command/components/CommandList.svelte.d.ts +5 -0
- package/dist/components/command/components/CommandLoading.svelte +29 -0
- package/dist/components/command/components/CommandLoading.svelte.d.ts +8 -0
- package/dist/components/command/components/CommandSeparator.svelte +21 -0
- package/dist/components/command/components/CommandSeparator.svelte.d.ts +3 -0
- package/dist/components/command/index.d.ts +12 -0
- package/dist/components/command/index.js +19 -0
- package/dist/components/command/types.d.ts +227 -0
- package/dist/components/command/types.js +1 -0
- package/dist/components/dialog/Dialog.d.ts +52 -0
- package/dist/components/dialog/Dialog.js +6 -0
- package/dist/components/dialog/Dialog.svelte +71 -118
- package/dist/components/dialog/Dialog.svelte.d.ts +2 -8
- package/dist/components/dialog/dialog.scss +78 -0
- package/dist/components/icons/IconArrowBigRightFilled.svelte +10 -0
- package/dist/components/icons/IconArrowBigRightFilled.svelte.d.ts +4 -0
- package/dist/components/icons/IconBookmarkPlus.svelte +10 -0
- package/dist/components/icons/IconBookmarkPlus.svelte.d.ts +4 -0
- package/dist/components/icons/IconChevronDown.svelte +10 -0
- package/dist/components/icons/IconChevronDown.svelte.d.ts +4 -0
- package/dist/components/icons/IconCopy.svelte +10 -0
- package/dist/components/icons/IconCopy.svelte.d.ts +4 -0
- package/dist/components/icons/IconCopyCheckFilled.svelte +10 -0
- package/dist/components/icons/IconCopyCheckFilled.svelte.d.ts +4 -0
- package/dist/components/icons/IconLoader2.svelte +10 -0
- package/dist/components/icons/IconLoader2.svelte.d.ts +4 -0
- package/dist/components/icons/IconPointFilled.svelte +10 -0
- package/dist/components/icons/IconPointFilled.svelte.d.ts +4 -0
- package/dist/components/icons/IconSearch.svelte +10 -0
- package/dist/components/icons/IconSearch.svelte.d.ts +4 -0
- package/dist/components/icons/IconSwitchHorizontal.svelte +10 -0
- package/dist/components/icons/IconSwitchHorizontal.svelte.d.ts +4 -0
- package/dist/components/icons/IconSwitchVertical.svelte +10 -0
- package/dist/components/icons/IconSwitchVertical.svelte.d.ts +4 -0
- package/dist/components/icons/index.d.ts +17 -0
- package/dist/components/icons/index.js +17 -0
- package/dist/components/input/Input.d.ts +116 -0
- package/dist/components/input/Input.js +36 -0
- package/dist/components/input/Input.svelte +19 -8
- package/dist/components/input/Input.svelte.d.ts +2 -22
- package/dist/components/language-picker-button/LanguagePickerButton.svelte +13 -10
- package/dist/components/language-picker-button/LanguagePickerButton.svelte.d.ts +0 -2
- package/dist/components/light-dark-toggle/LightDarkToggle.svelte +10 -10
- package/dist/components/popover/Popover.d.ts +15 -0
- package/dist/components/popover/Popover.js +8 -0
- package/dist/components/popover/Popover.svelte +137 -0
- package/dist/components/popover/Popover.svelte.d.ts +3 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/popover-responsive/PopoverResponsive.d.ts +8 -0
- package/dist/components/popover-responsive/PopoverResponsive.js +7 -0
- package/dist/components/popover-responsive/PopoverResponsive.svelte +87 -0
- package/dist/components/popover-responsive/PopoverResponsive.svelte.d.ts +11 -0
- package/dist/components/popover-responsive/index.d.ts +1 -0
- package/dist/components/popover-responsive/index.js +1 -0
- package/dist/components/side-navigation/SideNavigation.d.ts +2 -1
- package/dist/components/side-navigation/SideNavigation.js +8 -6
- package/dist/components/side-navigation/SideNavigation.svelte +44 -24
- package/dist/components/tera-ui-context/TeraUiContext.d.ts +11 -0
- package/dist/components/tera-ui-context/TeraUiContext.js +1 -0
- package/dist/components/tera-ui-context/TeraUiContext.svelte +21 -0
- package/dist/components/tera-ui-context/TeraUiContext.svelte.d.ts +3 -0
- package/dist/components/tera-ui-context/global-context.d.ts +3 -0
- package/dist/components/tera-ui-context/global-context.js +15 -0
- package/dist/components/tera-ui-context/index.d.ts +1 -0
- package/dist/components/tera-ui-context/index.js +1 -0
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/language.d.ts +2 -0
- package/dist/i18n/language.js +10 -0
- package/dist/i18n.d.ts +1 -0
- package/dist/i18n.js +4 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +14 -2
- package/dist/internal/command-score.d.ts +1 -0
- package/dist/internal/command-score.js +119 -0
- package/dist/internal/helpers/callbacks.d.ts +12 -0
- package/dist/internal/helpers/callbacks.js +15 -0
- package/dist/internal/helpers/event.d.ts +14 -0
- package/dist/internal/helpers/event.js +17 -0
- package/dist/internal/helpers/id.d.ts +1 -0
- package/dist/internal/helpers/id.js +4 -0
- package/dist/internal/helpers/index.d.ts +8 -0
- package/dist/internal/helpers/index.js +8 -0
- package/dist/internal/helpers/is.d.ts +4 -0
- package/dist/internal/helpers/is.js +10 -0
- package/dist/internal/helpers/kbd.d.ts +35 -0
- package/dist/internal/helpers/kbd.js +35 -0
- package/dist/internal/helpers/object.d.ts +2 -0
- package/dist/internal/helpers/object.js +19 -0
- package/dist/internal/helpers/sleep.d.ts +1 -0
- package/dist/internal/helpers/sleep.js +3 -0
- package/dist/internal/helpers/store.d.ts +29 -0
- package/dist/internal/helpers/store.js +80 -0
- package/dist/internal/helpers/style.d.ts +12 -0
- package/dist/internal/helpers/style.js +18 -0
- package/dist/internal/index.d.ts +3 -0
- package/dist/internal/index.js +3 -0
- package/dist/internal/types.d.ts +18 -0
- package/dist/internal/types.js +1 -0
- package/dist/themes/scrollbar.scss +37 -0
- package/dist/themes/tera-ui-base.css +25 -0
- package/package.json +39 -18
- package/scripts/generate-ts-index.js +137 -0
- package/dist/components/input/input.d.ts +0 -49
- package/dist/components/input/input.js +0 -14
- package/dist/components/side-navigation/clickOutside.d.ts +0 -4
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** Dispatch event on click outside of node */
|
|
2
|
-
export function clickOutside(node) {
|
|
2
|
+
export function clickOutside(node, data) {
|
|
3
3
|
const handleClick = (event) => {
|
|
4
|
-
if (node && !node.contains(event.target) && !event.defaultPrevented
|
|
4
|
+
if (node && !node.contains(event.target) && !event.defaultPrevented
|
|
5
|
+
&& (!(data?.exceptElement) || !data.exceptElement.contains(event.target))) {
|
|
5
6
|
node.dispatchEvent(new CustomEvent('click_outside', node));
|
|
6
7
|
}
|
|
7
8
|
};
|
|
@@ -19,7 +19,7 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
19
19
|
dangerous: {
|
|
20
20
|
true: string;
|
|
21
21
|
};
|
|
22
|
-
}, undefined, "relative overflow-clip rounded inline-flex items-center justify-center !leading-[0.1rem] [&>svg]:stroke-icon transition-all duration-element-react focus:ring-2
|
|
22
|
+
}, undefined, "relative overflow-clip rounded inline-flex items-center justify-center !leading-[0.1rem] [&>svg]:stroke-icon transition-all duration-element-react select-none focus-visible:ring-2 outline-none", import("tailwind-variants/dist/config").TVConfig<{
|
|
23
23
|
variant: {
|
|
24
24
|
primary: string;
|
|
25
25
|
secondary: string;
|
|
@@ -99,7 +99,7 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
99
99
|
dangerous: {
|
|
100
100
|
true: string;
|
|
101
101
|
};
|
|
102
|
-
}, undefined, "relative overflow-clip rounded inline-flex items-center justify-center !leading-[0.1rem] [&>svg]:stroke-icon transition-all duration-element-react focus:ring-2
|
|
102
|
+
}, undefined, "relative overflow-clip rounded inline-flex items-center justify-center !leading-[0.1rem] [&>svg]:stroke-icon transition-all duration-element-react select-none focus-visible:ring-2 outline-none", import("tailwind-variants/dist/config").TVConfig<{
|
|
103
103
|
variant: {
|
|
104
104
|
primary: string;
|
|
105
105
|
secondary: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { tv } from "tailwind-variants";
|
|
2
2
|
export const styles = tv({
|
|
3
|
-
base: 'relative overflow-clip rounded inline-flex items-center justify-center !leading-[0.1rem] [&>svg]:stroke-icon transition-all duration-element-react focus:ring-2
|
|
3
|
+
base: 'relative overflow-clip rounded inline-flex items-center justify-center !leading-[0.1rem] [&>svg]:stroke-icon transition-all duration-element-react select-none focus-visible:ring-2 outline-none',
|
|
4
4
|
variants: {
|
|
5
5
|
variant: {
|
|
6
|
-
primary: 'bg-primary-600 text-neutral-1 border border-primary-600 hover:bg-primary-700 focus:ring-primary-
|
|
7
|
-
secondary: 'bg-neutral-token-1 text-neutral-token-13 border-neutral-token-7 border hover:bg-neutral-token-3 focus:ring-neutral-token-
|
|
8
|
-
ghost: 'text-neutral-token-13 hover:bg-neutral-token-3 focus:ring-neutral-token-
|
|
6
|
+
primary: 'bg-primary-600 text-neutral-1 border border-primary-600 hover:bg-primary-700 focus:ring-primary-token-9 [&:after]:bg-black',
|
|
7
|
+
secondary: 'bg-neutral-token-1 text-neutral-token-13 border-neutral-token-7 border hover:bg-neutral-token-3 focus:ring-neutral-token-7',
|
|
8
|
+
ghost: 'text-neutral-token-13 hover:bg-neutral-token-3 focus:ring-neutral-token-7',
|
|
9
9
|
},
|
|
10
10
|
size: {
|
|
11
11
|
sm: 'h-6 px-2 gap-1 text-sm [&>svg]:size-icon-xs',
|
|
@@ -20,7 +20,7 @@ export const styles = tv({
|
|
|
20
20
|
},
|
|
21
21
|
dangerous: {
|
|
22
22
|
true: ''
|
|
23
|
-
}
|
|
23
|
+
}
|
|
24
24
|
},
|
|
25
25
|
compoundVariants: [
|
|
26
26
|
{
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import {type ButtonProps, styles} from "./Button";
|
|
3
3
|
|
|
4
|
-
let {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
let {
|
|
5
|
+
children, disabled, variant = 'primary', icon, size, dangerous, class: className,
|
|
6
|
+
ref = $bindable(),
|
|
7
|
+
...props
|
|
8
|
+
}: ButtonProps & {ref: HTMLButtonElement} = $props();
|
|
7
9
|
|
|
8
10
|
$effect(() => {
|
|
9
|
-
|
|
11
|
+
ref.addEventListener('click', function (e) {
|
|
10
12
|
const ripple = document.createElement('span');
|
|
11
|
-
const size = Math.max(
|
|
12
|
-
const rect =
|
|
13
|
+
const size = Math.max(ref.clientWidth, ref.clientHeight);
|
|
14
|
+
const rect = ref.getBoundingClientRect();
|
|
13
15
|
const x = e.clientX - rect.left - size / 2;
|
|
14
16
|
const y = e.clientY - rect.top - size / 2;
|
|
15
17
|
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
|
|
28
30
|
ripple.classList.add('ripple');
|
|
29
31
|
ripple.classList.add(rippleColor);
|
|
30
|
-
|
|
32
|
+
ref.appendChild(ripple);
|
|
31
33
|
|
|
32
34
|
// Remove the ripple after animation completes
|
|
33
35
|
ripple.addEventListener('animationend', () => {
|
|
@@ -38,7 +40,7 @@
|
|
|
38
40
|
</script>
|
|
39
41
|
|
|
40
42
|
<button
|
|
41
|
-
bind:this={
|
|
43
|
+
bind:this={ref}
|
|
42
44
|
class={styles({ disabled, variant, icon, size, dangerous, className })}
|
|
43
45
|
{...props}
|
|
44
46
|
disabled={disabled}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
export declare const styles: import("tailwind-variants").TVReturnType<{}, undefined, "", import("tailwind-variants/dist/config").TVConfig<{}, {}>, {}, undefined, import("tailwind-variants").TVReturnType<{}, undefined, "", import("tailwind-variants/dist/config").TVConfig<{}, {}>, unknown, unknown, undefined>>;
|
|
3
|
+
type ComboboxVariants = VariantProps<typeof styles>;
|
|
4
|
+
export interface ComboboxProps extends ComboboxVariants {
|
|
5
|
+
children?: any;
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Combobox } from './Combobox.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Combobox } from './Combobox.svelte';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CommandProps, Context, Group, State, StateStore } from './types.js';
|
|
2
|
+
import './command.scss';
|
|
3
|
+
export declare const LIST_SELECTOR = "[data-cmdk-list-sizer]";
|
|
4
|
+
export declare const GROUP_SELECTOR = "[data-cmdk-group]";
|
|
5
|
+
export declare const GROUP_ITEMS_SELECTOR = "[data-cmdk-group-items]";
|
|
6
|
+
export declare const GROUP_HEADING_SELECTOR = "[data-cmdk-group-heading]";
|
|
7
|
+
export declare const ITEM_SELECTOR = "[data-cmdk-item]";
|
|
8
|
+
export declare const VALID_ITEM_SELECTOR = "[data-cmdk-item]:not([aria-disabled=\"true\"])";
|
|
9
|
+
export declare const VALUE_ATTR = "data-value";
|
|
10
|
+
export declare const defaultFilter: (value: string, search: string) => number;
|
|
11
|
+
export declare function getCtx(): Context;
|
|
12
|
+
export declare function getState(): StateStore;
|
|
13
|
+
export declare function createGroup(alwaysRender: boolean | undefined): {
|
|
14
|
+
id: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function getGroup(): Group | undefined;
|
|
17
|
+
export declare function createState(initialValues?: Partial<State>): import("svelte/store").Writable<State>;
|
|
18
|
+
export declare function createCommand(props: CommandProps): {
|
|
19
|
+
state: {
|
|
20
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<State>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
21
|
+
update: (this: void, updater: import("svelte/store").Updater<State>) => void;
|
|
22
|
+
set: (this: void, value: State) => void;
|
|
23
|
+
updateState: <K extends keyof State>(key: K, value: State[K], preventScroll?: boolean) => void;
|
|
24
|
+
};
|
|
25
|
+
handleRootKeydown: (e: KeyboardEvent) => void;
|
|
26
|
+
commandEl: import("svelte/store").Writable<HTMLDivElement | null>;
|
|
27
|
+
ids: {
|
|
28
|
+
input: string;
|
|
29
|
+
label: string;
|
|
30
|
+
root: string;
|
|
31
|
+
list: string;
|
|
32
|
+
};
|
|
33
|
+
};
|