orio-ui 0.1.1 → 1.0.2
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/README.md +9 -7
- package/dist/module.cjs +5 -0
- package/dist/module.d.mts +3 -0
- package/dist/module.d.ts +3 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +24 -0
- package/dist/runtime/assets/css/animation.css +1 -0
- package/dist/runtime/assets/css/colors.css +1 -0
- package/{src/runtime/assets/css/cool-gradient-hover.scss → dist/runtime/assets/css/cool-gradient-hover.css} +4 -14
- package/dist/runtime/assets/css/main.css +1 -0
- package/dist/runtime/assets/css/scroll.css +1 -0
- package/{src → dist}/runtime/components/Button.vue +38 -46
- package/dist/runtime/components/CheckBox.vue +93 -0
- package/{src → dist}/runtime/components/ControlElement.vue +15 -18
- package/{src → dist}/runtime/components/DashedContainer.vue +7 -13
- package/dist/runtime/components/DatePicker.vue +30 -0
- package/{src → dist}/runtime/components/DateRangePicker.vue +14 -15
- package/{src → dist}/runtime/components/EmptyState.vue +22 -28
- package/{src → dist}/runtime/components/Icon.vue +12 -23
- package/dist/runtime/components/Input.vue +43 -0
- package/{src → dist}/runtime/components/Modal.vue +2 -44
- package/{src → dist}/runtime/components/Popover.vue +9 -2
- package/{src → dist}/runtime/components/Selector.vue +58 -58
- package/dist/runtime/components/Tag.vue +21 -0
- package/{src → dist}/runtime/components/Textarea.vue +19 -30
- package/{src → dist}/runtime/components/view/Dates.vue +1 -3
- package/{src → dist}/runtime/components/view/Separator.vue +1 -5
- package/{src → dist}/runtime/components/view/Text.vue +38 -42
- package/dist/runtime/composables/index.d.ts +4 -0
- package/dist/runtime/composables/index.js +6 -0
- package/dist/runtime/composables/useApi.d.ts +10 -0
- package/dist/runtime/composables/useApi.js +9 -0
- package/dist/runtime/composables/useFuzzySearch.d.ts +10 -0
- package/dist/runtime/composables/useFuzzySearch.js +22 -0
- package/dist/runtime/composables/useModal.d.ts +15 -0
- package/dist/runtime/composables/useModal.js +28 -0
- package/dist/runtime/composables/useTheme.d.ts +6 -0
- package/dist/runtime/composables/useTheme.js +23 -0
- package/dist/runtime/index.d.ts +20 -0
- package/dist/runtime/index.js +20 -0
- package/dist/runtime/utils/icon-registry.d.ts +2 -0
- package/{src/runtime/utils/icon-registry.ts → dist/runtime/utils/icon-registry.js} +14 -29
- package/dist/types.d.mts +7 -0
- package/dist/types.d.ts +7 -0
- package/package.json +12 -16
- package/nuxt.config.ts +0 -38
- package/src/module.ts +0 -16
- package/src/runtime/assets/css/animation.css +0 -88
- package/src/runtime/assets/css/colors.css +0 -142
- package/src/runtime/assets/css/main.css +0 -11
- package/src/runtime/assets/css/scroll.css +0 -46
- package/src/runtime/components/CheckBox.vue +0 -103
- package/src/runtime/components/DatePicker.vue +0 -84
- package/src/runtime/components/Input.vue +0 -54
- package/src/runtime/components/Tag.vue +0 -45
- package/src/runtime/composables/index.ts +0 -4
- package/src/runtime/composables/useApi.ts +0 -26
- package/src/runtime/composables/useFuzzySearch.ts +0 -51
- package/src/runtime/composables/useModal.ts +0 -47
- package/src/runtime/composables/useTheme.ts +0 -31
- package/src/runtime/index.ts +0 -25
- /package/{src → dist}/runtime/components/LoadingSpinner.vue +0 -0
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
defineEmits<{
|
|
3
|
-
(e: 'input', value: string): void;
|
|
4
|
-
}>();
|
|
5
|
-
|
|
6
|
-
const text = defineModel<string>({ default: '' });
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<orio-control-element v-bind="$attrs">
|
|
11
|
-
<input
|
|
12
|
-
v-bind="$attrs"
|
|
13
|
-
v-model="text"
|
|
14
|
-
type="text"
|
|
15
|
-
class="text-input"
|
|
16
|
-
>
|
|
17
|
-
</orio-control-element>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<style lang="scss" scoped>
|
|
21
|
-
.text-input {
|
|
22
|
-
width: 100%;
|
|
23
|
-
padding: 0.5rem 0.75rem;
|
|
24
|
-
border: 1px solid var(--color-border);
|
|
25
|
-
border-radius: 4px;
|
|
26
|
-
font-size: 1rem;
|
|
27
|
-
color: var(--color-text);
|
|
28
|
-
background-color: var(--color-bg);
|
|
29
|
-
box-sizing: border-box;
|
|
30
|
-
transition:
|
|
31
|
-
border-color 0.2s ease,
|
|
32
|
-
box-shadow 0.2s ease;
|
|
33
|
-
|
|
34
|
-
&::placeholder {
|
|
35
|
-
color: var(--color-muted);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&:hover {
|
|
39
|
-
border-color: var(--color-accent);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&:focus {
|
|
43
|
-
border-color: var(--color-accent);
|
|
44
|
-
box-shadow: 0 0 0 2px var(--color-accent-soft);
|
|
45
|
-
outline: none;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&:disabled {
|
|
49
|
-
background-color: var(--color-surface);
|
|
50
|
-
color: var(--color-muted);
|
|
51
|
-
cursor: not-allowed;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
</style>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
export type TagStyle = 'neutral' | 'accent';
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
text: string;
|
|
6
|
-
variant?: TagStyle;
|
|
7
|
-
}
|
|
8
|
-
withDefaults(defineProps<Props>(), {
|
|
9
|
-
variant: 'neutral',
|
|
10
|
-
});
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<template>
|
|
14
|
-
<span class="tag" :class="`tag--${variant}`">
|
|
15
|
-
{{ text }}
|
|
16
|
-
</span>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<style scoped>
|
|
20
|
-
.tag {
|
|
21
|
-
max-height: 1rem;
|
|
22
|
-
display: inline-block;
|
|
23
|
-
padding: 0.25rem 0.6rem;
|
|
24
|
-
border-radius: 1rem;
|
|
25
|
-
font-size: 0.8rem;
|
|
26
|
-
font-weight: 500;
|
|
27
|
-
line-height: 1;
|
|
28
|
-
border: 1px solid transparent;
|
|
29
|
-
user-select: none;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/* Neutral (gray chip) */
|
|
33
|
-
.tag--neutral {
|
|
34
|
-
background-color: var(--color-surface);
|
|
35
|
-
border-color: color-mix(in srgb, var(--color-border) 80%, var(--color-accent) 20%);
|
|
36
|
-
color: var(--color-muted);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/* Accent (themed chip) */
|
|
40
|
-
.tag--accent {
|
|
41
|
-
background-color: var(--color-accent-soft);
|
|
42
|
-
border-color: var(--color-accent-border);
|
|
43
|
-
color: var(--color-accent);
|
|
44
|
-
}
|
|
45
|
-
</style>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { $fetch } from 'ofetch';
|
|
2
|
-
|
|
3
|
-
export type RequestBody = Record<string, unknown>;
|
|
4
|
-
export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
5
|
-
|
|
6
|
-
export interface ApiOptions {
|
|
7
|
-
method?: RequestMethod;
|
|
8
|
-
body?: RequestBody;
|
|
9
|
-
signal?: AbortSignal;
|
|
10
|
-
query?: Record<string, unknown>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Overload 1: Just URL (GET request)
|
|
14
|
-
export async function useApi<T = unknown>(url: string): Promise<T>;
|
|
15
|
-
|
|
16
|
-
// Overload 2: URL + options
|
|
17
|
-
export async function useApi<T = unknown>(url: string, options: ApiOptions): Promise<T>;
|
|
18
|
-
|
|
19
|
-
export async function useApi<T = unknown>(url: string, options?: ApiOptions): Promise<T> {
|
|
20
|
-
return (await $fetch(url, {
|
|
21
|
-
method: options?.method || 'GET',
|
|
22
|
-
body: options?.body,
|
|
23
|
-
signal: options?.signal,
|
|
24
|
-
query: options?.query,
|
|
25
|
-
})) as T;
|
|
26
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { computed, unref, type MaybeRef } from 'vue';
|
|
2
|
-
import { useFuse, type FuseOptions } from '@vueuse/integrations/useFuse';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Search using Fuse.js fuzzy search
|
|
6
|
-
* @param dataSource - Array of strings or objects to search
|
|
7
|
-
* @param search - Search query string
|
|
8
|
-
* @param options - Fuse.js options (e.g., { keys: ['name'] })
|
|
9
|
-
*/
|
|
10
|
-
export function useFuzzySearch(
|
|
11
|
-
dataSource: MaybeRef<string[]>,
|
|
12
|
-
search: MaybeRef<string>
|
|
13
|
-
): ReturnType<typeof useFuse>;
|
|
14
|
-
|
|
15
|
-
export function useFuzzySearch<T extends object>(
|
|
16
|
-
dataSource: MaybeRef<T[]>,
|
|
17
|
-
search: MaybeRef<string>,
|
|
18
|
-
options: FuseOptions<T>
|
|
19
|
-
): ReturnType<typeof useFuse>;
|
|
20
|
-
|
|
21
|
-
export function useFuzzySearch<T extends object>(
|
|
22
|
-
dataSource: MaybeRef<string[] | T[]>,
|
|
23
|
-
search: MaybeRef<string>,
|
|
24
|
-
options?: FuseOptions<T>
|
|
25
|
-
) {
|
|
26
|
-
// If options are provided, treat as object array; otherwise string array
|
|
27
|
-
const isObjectArray = !!options;
|
|
28
|
-
|
|
29
|
-
if (!isObjectArray) {
|
|
30
|
-
// String array handling
|
|
31
|
-
const wrappedData = computed(() => {
|
|
32
|
-
const data = unref(dataSource) as string[];
|
|
33
|
-
return data.map((str) => ({ value: str }));
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const { results } = useFuse(search, wrappedData, {
|
|
37
|
-
fuseOptions: { keys: ['value'] },
|
|
38
|
-
matchAllWhenSearchEmpty: true,
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
return computed(() => results.value.map(({ item }) => item.value));
|
|
42
|
-
} else {
|
|
43
|
-
// Object array handling
|
|
44
|
-
const { results } = useFuse(search, dataSource as MaybeRef<T[]>, {
|
|
45
|
-
fuseOptions: options,
|
|
46
|
-
matchAllWhenSearchEmpty: true,
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
return computed(() => results.value.map(({ item }) => item));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ref } from 'vue';
|
|
2
|
-
|
|
3
|
-
export interface OriginRect {
|
|
4
|
-
x: number;
|
|
5
|
-
y: number;
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface ModalProps {
|
|
11
|
-
show: Boolean;
|
|
12
|
-
origin: OriginRect | null;
|
|
13
|
-
'onUpdate:show': (state: boolean) => void;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function useModal() {
|
|
17
|
-
const modalProps = ref<ModalProps>({
|
|
18
|
-
show: false,
|
|
19
|
-
origin: null,
|
|
20
|
-
'onUpdate:show': (state: Boolean) => updateShow(state),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
function updateShow(state: Boolean) {
|
|
24
|
-
modalProps.value.show = state;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function openModal(event?: MouseEvent) {
|
|
28
|
-
modalProps.value.origin = null;
|
|
29
|
-
if (!event) {
|
|
30
|
-
modalProps.value.show = true;
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const target = event.target as HTMLElement;
|
|
34
|
-
const rect = target.getBoundingClientRect();
|
|
35
|
-
|
|
36
|
-
modalProps.value.origin = {
|
|
37
|
-
x: rect.left,
|
|
38
|
-
y: rect.top,
|
|
39
|
-
width: rect.width,
|
|
40
|
-
height: rect.height,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
modalProps.value.show = true;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return { modalProps, openModal };
|
|
47
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { onMounted } from 'vue';
|
|
2
|
-
import { useLocalStorage } from '@vueuse/core';
|
|
3
|
-
|
|
4
|
-
export function useTheme() {
|
|
5
|
-
// Namespace storage keys to avoid conflicts with consumer apps
|
|
6
|
-
const theme = useLocalStorage<string>('orio-theme', 'navy');
|
|
7
|
-
const mode = useLocalStorage<string>('orio-mode', 'dark');
|
|
8
|
-
|
|
9
|
-
function setTheme(name: string) {
|
|
10
|
-
theme.value = name;
|
|
11
|
-
// Only set DOM attributes on client side
|
|
12
|
-
if (typeof document !== 'undefined') {
|
|
13
|
-
document.documentElement.setAttribute('data-theme', name);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function setMode(name: string) {
|
|
18
|
-
mode.value = name;
|
|
19
|
-
// Only set DOM attributes on client side
|
|
20
|
-
if (typeof document !== 'undefined') {
|
|
21
|
-
document.documentElement.setAttribute('data-mode', name);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
onMounted(() => {
|
|
26
|
-
setTheme(theme.value);
|
|
27
|
-
setMode(mode.value);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return { theme, setTheme, mode, setMode };
|
|
31
|
-
}
|
package/src/runtime/index.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Export all components
|
|
2
|
-
export { default as Button } from './components/Button.vue'
|
|
3
|
-
export { default as Input } from './components/Input.vue'
|
|
4
|
-
export { default as Textarea } from './components/Textarea.vue'
|
|
5
|
-
export { default as CheckBox } from './components/CheckBox.vue'
|
|
6
|
-
export { default as DatePicker } from './components/DatePicker.vue'
|
|
7
|
-
export { default as DateRangePicker } from './components/DateRangePicker.vue'
|
|
8
|
-
export { default as Selector } from './components/Selector.vue'
|
|
9
|
-
export { default as Tag } from './components/Tag.vue'
|
|
10
|
-
export { default as Icon } from './components/Icon.vue'
|
|
11
|
-
export { default as LoadingSpinner } from './components/LoadingSpinner.vue'
|
|
12
|
-
export { default as Modal } from './components/Modal.vue'
|
|
13
|
-
export { default as Popover } from './components/Popover.vue'
|
|
14
|
-
export { default as EmptyState } from './components/EmptyState.vue'
|
|
15
|
-
export { default as DashedContainer } from './components/DashedContainer.vue'
|
|
16
|
-
export { default as ControlElement } from './components/ControlElement.vue'
|
|
17
|
-
export { default as ViewText } from './components/view/Text.vue'
|
|
18
|
-
export { default as ViewDates } from './components/view/Dates.vue'
|
|
19
|
-
export { default as ViewSeparator } from './components/view/Separator.vue'
|
|
20
|
-
|
|
21
|
-
// Export all composables
|
|
22
|
-
export * from './composables'
|
|
23
|
-
|
|
24
|
-
// Export utils
|
|
25
|
-
export { iconRegistry, type IconName } from './utils/icon-registry'
|
|
File without changes
|