orio-ui 0.1.1 → 1.0.1

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/nuxt.config.ts CHANGED
@@ -11,28 +11,28 @@ export default defineNuxtConfig({
11
11
  {
12
12
  path: './src/runtime/components',
13
13
  prefix: 'Orio',
14
- pathPrefix: false
15
- }
16
- ]
14
+ pathPrefix: false,
15
+ },
16
+ ],
17
17
  },
18
18
 
19
19
  // Auto-import composables
20
20
  imports: {
21
- dirs: ['./src/runtime/composables']
21
+ dirs: ['./src/runtime/composables'],
22
22
  },
23
23
 
24
24
  typescript: {
25
25
  strict: true,
26
- typeCheck: true
26
+ typeCheck: true,
27
27
  },
28
28
 
29
29
  vite: {
30
30
  css: {
31
31
  preprocessorOptions: {
32
- scss: {}
33
- }
34
- }
32
+ scss: {},
33
+ },
34
+ },
35
35
  },
36
36
 
37
- compatibilityDate: '2025-01-15'
38
- })
37
+ compatibilityDate: '2025-01-15',
38
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orio-ui",
3
- "version": "0.1.1",
3
+ "version": "1.0.1",
4
4
  "description": "Modern Nuxt component library with theme support",
5
5
  "type": "module",
6
6
  "main": "./src/runtime/index.ts",
@@ -32,7 +32,7 @@
32
32
  "docs:build": "vitepress build docs",
33
33
  "docs:preview": "vitepress preview docs",
34
34
  "lint": "eslint .",
35
- "typecheck": "nuxt typecheck"
35
+ "typecheck": "vue-tsc --noEmit"
36
36
  },
37
37
  "dependencies": {
38
38
  "@nuxt/kit": "^3.15.3",
package/src/module.ts CHANGED
@@ -1,16 +1,16 @@
1
- import { defineNuxtModule } from '@nuxt/kit'
1
+ import { defineNuxtModule } from '@nuxt/kit';
2
2
 
3
3
  export default defineNuxtModule({
4
4
  meta: {
5
5
  name: 'orio-ui',
6
6
  configKey: 'orioUi',
7
7
  compatibility: {
8
- nuxt: '^3.0.0 || ^4.0.0'
9
- }
8
+ nuxt: '^3.0.0 || ^4.0.0',
9
+ },
10
10
  },
11
11
  defaults: {},
12
12
  setup() {
13
13
  // Module setup is handled by the layer (nuxt.config.ts)
14
14
  // This module entry is required for the build process
15
- }
16
- })
15
+ },
16
+ });
@@ -3,11 +3,11 @@ export interface ControlProps {
3
3
  /**
4
4
  * Minimal will reset margin and remove border and box shadow from every element inside the slot
5
5
  */
6
- appearance?: "normal" | "minimal";
6
+ appearance?: 'normal' | 'minimal';
7
7
  }
8
8
 
9
9
  withDefaults(defineProps<ControlProps>(), {
10
- appearance: "normal",
10
+ appearance: 'normal',
11
11
  });
12
12
  </script>
13
13
 
@@ -24,12 +24,7 @@ const iconSize = computed(() => {
24
24
  </script>
25
25
  <template>
26
26
  <div class="dashed-container gradient-hover" @click="$emit('click')">
27
- <orio-icon
28
- v-if="icon"
29
- :name="icon"
30
- class="icon-class"
31
- :size="iconSize"
32
- />
27
+ <orio-icon v-if="icon" :name="icon" class="icon-class" :size="iconSize" />
33
28
  <span v-if="text" class="text-class" :size>{{ text }}</span>
34
29
  </div>
35
30
  </template>
@@ -1,22 +1,22 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue'
3
- import { iconRegistry, type IconName } from '../utils/icon-registry'
2
+ import { computed } from 'vue';
3
+ import { iconRegistry, type IconName } from '../utils/icon-registry';
4
4
 
5
5
  export interface IconProps {
6
- name: IconName | string
7
- size?: string | number
8
- color?: string
6
+ name: IconName | string;
7
+ size?: string | number;
8
+ color?: string;
9
9
  }
10
10
 
11
11
  const props = withDefaults(defineProps<IconProps>(), {
12
12
  size: '1em',
13
- color: 'currentColor'
14
- })
13
+ color: 'currentColor',
14
+ });
15
15
 
16
- const iconSvg = computed(() => iconRegistry[props.name] || '')
16
+ const iconSvg = computed(() => iconRegistry[props.name] || '');
17
17
  const sizeValue = computed(() =>
18
- typeof props.size === 'number' ? `${props.size}px` : props.size
19
- )
18
+ typeof props.size === 'number' ? `${props.size}px` : props.size,
19
+ );
20
20
  </script>
21
21
 
22
22
  <template>
@@ -29,7 +29,7 @@ const sizeValue = computed(() =>
29
29
  display: 'inline-flex',
30
30
  alignItems: 'center',
31
31
  justifyContent: 'center',
32
- flexShrink: 0
32
+ flexShrink: 0,
33
33
  }"
34
34
  v-html="iconSvg"
35
35
  />
@@ -8,12 +8,7 @@ const text = defineModel<string>({ default: '' });
8
8
 
9
9
  <template>
10
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
- >
11
+ <input v-bind="$attrs" v-model="text" type="text" class="text-input" />
17
12
  </orio-control-element>
18
13
  </template>
19
14
 
@@ -13,7 +13,7 @@ const props = defineProps<{
13
13
  origin: OriginRect | null;
14
14
  }>();
15
15
 
16
- const show = defineModel<Boolean>('show');
16
+ const show = defineModel<boolean>('show');
17
17
 
18
18
  const wrapper = ref<HTMLDivElement | null>(null);
19
19
 
@@ -20,7 +20,14 @@
20
20
  </template>
21
21
 
22
22
  <script setup lang="ts">
23
- import { ref, computed, nextTick, onMounted, onBeforeUnmount, watch } from 'vue';
23
+ import {
24
+ ref,
25
+ computed,
26
+ nextTick,
27
+ onMounted,
28
+ onBeforeUnmount,
29
+ watch,
30
+ } from 'vue';
24
31
  import { useElementBounding } from '@vueuse/core';
25
32
 
26
33
  const props = defineProps({
@@ -18,7 +18,9 @@ const props = withDefaults(defineProps<SelectProps>(), {
18
18
 
19
19
  const { field, optionName, placeholder } = toRefs(props);
20
20
 
21
- const modelValue = defineModel<SelectableOption | SelectableOption[] | null | undefined>({
21
+ const modelValue = defineModel<
22
+ SelectableOption | SelectableOption[] | null | undefined
23
+ >({
22
24
  required: true,
23
25
  });
24
26
 
@@ -33,7 +35,7 @@ const flatModalValue = computed(() => {
33
35
  ? modelValue.value
34
36
  : (modelValue.value as T)[key.value];
35
37
  return modelValue.value.map((option) =>
36
- typeof option === 'string' ? option : (option as T)[key.value]
38
+ typeof option === 'string' ? option : (option as T)[key.value],
37
39
  );
38
40
  });
39
41
 
@@ -41,7 +43,9 @@ function toggleOption(option: SelectableOption, toggle: () => void) {
41
43
  if (props.multiple) {
42
44
  if (Array.isArray(modelValue.value)) {
43
45
  const index = modelValue.value.findIndex((opt) =>
44
- typeof option === 'string' ? option === opt : opt[key.value] === (option as T)[key.value]
46
+ typeof option === 'string'
47
+ ? option === opt
48
+ : opt[key.value] === (option as T)[key.value],
45
49
  );
46
50
  if (index > -1) {
47
51
  modelValue.value.splice(index, 1);
@@ -63,7 +67,9 @@ function isOptionSelected(option: SelectableOption): boolean {
63
67
  return !!(
64
68
  flatModalValue.value &&
65
69
  (flatModalValue.value === (option as T)[key.value] ||
66
- (flatModalValue.value as string[]).includes((option as T)[key.value] as string))
70
+ (flatModalValue.value as string[]).includes(
71
+ (option as T)[key.value] as string,
72
+ ))
67
73
  );
68
74
  }
69
75
 
@@ -88,9 +94,19 @@ const selectorAttrs = computed(() => ({ getOptionKey, getOptionLabel }));
88
94
  <template #default="{ toggle }">
89
95
  <slot name="trigger" :toggle>
90
96
  <div class="selector-trigger">
91
- <slot name="trigger-content" :toggle v-bind="selectorAttrs" :attrs="$attrs">
97
+ <slot
98
+ name="trigger-content"
99
+ :toggle
100
+ v-bind="selectorAttrs"
101
+ :attrs="$attrs"
102
+ >
92
103
  <div class="trigger-content">
93
- <slot name="trigger-label" :toggle v-bind="selectorAttrs" :attrs="$attrs">
104
+ <slot
105
+ name="trigger-label"
106
+ :toggle
107
+ v-bind="selectorAttrs"
108
+ :attrs="$attrs"
109
+ >
94
110
  <template v-if="!props.multiple">
95
111
  {{ getOptionLabel(modelValue as T) }}
96
112
  </template>
@@ -32,7 +32,11 @@ withDefaults(defineProps<Props>(), {
32
32
  /* Neutral (gray chip) */
33
33
  .tag--neutral {
34
34
  background-color: var(--color-surface);
35
- border-color: color-mix(in srgb, var(--color-border) 80%, var(--color-accent) 20%);
35
+ border-color: color-mix(
36
+ in srgb,
37
+ var(--color-border) 80%,
38
+ var(--color-accent) 20%
39
+ );
36
40
  color: var(--color-muted);
37
41
  }
38
42
 
@@ -11,12 +11,7 @@ const modelValue = defineModel<string>({ default: '' });
11
11
 
12
12
  <template>
13
13
  <orio-control-element v-bind="attrs">
14
- <textarea
15
- v-bind="attrs"
16
- v-model="modelValue"
17
- rows="4"
18
- class="textarea"
19
- />
14
+ <textarea v-bind="attrs" v-model="modelValue" rows="4" class="textarea" />
20
15
  </orio-control-element>
21
16
  </template>
22
17
 
@@ -1,4 +1,9 @@
1
- export { useApi, type ApiOptions, type RequestBody, type RequestMethod } from './useApi';
1
+ export {
2
+ useApi,
3
+ type ApiOptions,
4
+ type RequestBody,
5
+ type RequestMethod,
6
+ } from './useApi';
2
7
  export { useFuzzySearch } from './useFuzzySearch';
3
8
  export { useModal, type ModalProps, type OriginRect } from './useModal';
4
9
  export { useTheme } from './useTheme';
@@ -14,9 +14,15 @@ export interface ApiOptions {
14
14
  export async function useApi<T = unknown>(url: string): Promise<T>;
15
15
 
16
16
  // Overload 2: URL + options
17
- export async function useApi<T = unknown>(url: string, options: ApiOptions): Promise<T>;
17
+ export async function useApi<T = unknown>(
18
+ url: string,
19
+ options: ApiOptions,
20
+ ): Promise<T>;
18
21
 
19
- export async function useApi<T = unknown>(url: string, options?: ApiOptions): Promise<T> {
22
+ export async function useApi<T = unknown>(
23
+ url: string,
24
+ options?: ApiOptions,
25
+ ): Promise<T> {
20
26
  return (await $fetch(url, {
21
27
  method: options?.method || 'GET',
22
28
  body: options?.body,
@@ -9,19 +9,19 @@ import { useFuse, type FuseOptions } from '@vueuse/integrations/useFuse';
9
9
  */
10
10
  export function useFuzzySearch(
11
11
  dataSource: MaybeRef<string[]>,
12
- search: MaybeRef<string>
12
+ search: MaybeRef<string>,
13
13
  ): ReturnType<typeof useFuse>;
14
14
 
15
15
  export function useFuzzySearch<T extends object>(
16
16
  dataSource: MaybeRef<T[]>,
17
17
  search: MaybeRef<string>,
18
- options: FuseOptions<T>
18
+ options: FuseOptions<T>,
19
19
  ): ReturnType<typeof useFuse>;
20
20
 
21
21
  export function useFuzzySearch<T extends object>(
22
22
  dataSource: MaybeRef<string[] | T[]>,
23
23
  search: MaybeRef<string>,
24
- options?: FuseOptions<T>
24
+ options?: FuseOptions<T>,
25
25
  ) {
26
26
  // If options are provided, treat as object array; otherwise string array
27
27
  const isObjectArray = !!options;
@@ -8,7 +8,7 @@ export interface OriginRect {
8
8
  }
9
9
 
10
10
  export interface ModalProps {
11
- show: Boolean;
11
+ show: boolean;
12
12
  origin: OriginRect | null;
13
13
  'onUpdate:show': (state: boolean) => void;
14
14
  }
@@ -17,10 +17,10 @@ export function useModal() {
17
17
  const modalProps = ref<ModalProps>({
18
18
  show: false,
19
19
  origin: null,
20
- 'onUpdate:show': (state: Boolean) => updateShow(state),
20
+ 'onUpdate:show': (state: boolean) => updateShow(state),
21
21
  });
22
22
 
23
- function updateShow(state: Boolean) {
23
+ function updateShow(state: boolean) {
24
24
  modalProps.value.show = state;
25
25
  }
26
26
 
@@ -1,25 +1,25 @@
1
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'
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
20
 
21
21
  // Export all composables
22
- export * from './composables'
22
+ export * from './composables';
23
23
 
24
24
  // Export utils
25
- export { iconRegistry, type IconName } from './utils/icon-registry'
25
+ export { iconRegistry, type IconName } from './utils/icon-registry';
@@ -11,31 +11,31 @@ export const iconRegistry: Record<string, string> = {
11
11
  'chevron-up': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z"/></svg>`,
12
12
 
13
13
  // Edit (material-symbols:edit-sharp)
14
- 'edit': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M3 21v-4.25L16.2 3.575q.3-.275.663-.425t.762-.15t.775.15t.65.45L20.425 5q.3.275.438.65T21 6.4q0 .4-.137.763t-.438.662L7.25 21zM17.6 7.8L19 6.4L17.6 5l-1.4 1.4z"/></svg>`,
14
+ edit: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M3 21v-4.25L16.2 3.575q.3-.275.663-.425t.762-.15t.775.15t.65.45L20.425 5q.3.275.438.65T21 6.4q0 .4-.137.763t-.438.662L7.25 21zM17.6 7.8L19 6.4L17.6 5l-1.4 1.4z"/></svg>`,
15
15
 
16
16
  // Check / Checkmark
17
- 'check': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z"/></svg>`,
17
+ check: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z"/></svg>`,
18
18
 
19
19
  // Plus / Add
20
- 'plus': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>`,
20
+ plus: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>`,
21
21
 
22
22
  // Calendar
23
- 'calendar': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V10h14zm0-12H5V6h14zM7 12h5v5H7z"/></svg>`,
23
+ calendar: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V10h14zm0-12H5V6h14zM7 12h5v5H7z"/></svg>`,
24
24
 
25
25
  // Close / X
26
- 'close': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"/></svg>`,
26
+ close: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"/></svg>`,
27
27
 
28
28
  // Search / Magnifying glass
29
- 'search': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14"/></svg>`,
29
+ search: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14"/></svg>`,
30
30
 
31
31
  // Upload
32
- 'upload': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M9 16h6v-6h4l-7-7l-7 7h4zm-4 2h14v2H5z"/></svg>`,
32
+ upload: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M9 16h6v-6h4l-7-7l-7 7h4zm-4 2h14v2H5z"/></svg>`,
33
33
 
34
34
  // Download
35
- 'download': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"/></svg>`,
35
+ download: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"/></svg>`,
36
36
 
37
37
  // Delete / Trash
38
- 'delete': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12l1.41 1.41L13.41 14l2.12 2.12l-1.41 1.41L12 15.41l-2.12 2.12l-1.41-1.41L10.59 14zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"/></svg>`,
39
- }
38
+ delete: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12l1.41 1.41L13.41 14l2.12 2.12l-1.41 1.41L12 15.41l-2.12 2.12l-1.41-1.41L10.59 14zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"/></svg>`,
39
+ };
40
40
 
41
- export type IconName = keyof typeof iconRegistry
41
+ export type IconName = keyof typeof iconRegistry;