orio-ui 1.0.5 → 1.1.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/README.md +1 -1
- package/dist/module.json +1 -1
- package/dist/runtime/components/Button.vue +5 -3
- package/dist/runtime/components/Input.vue +1 -0
- package/dist/runtime/components/Selector.vue +1 -0
- package/dist/runtime/components/SwitchButton.vue +66 -0
- package/dist/runtime/components/Textarea.vue +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ That's it! All components and composables are now auto-imported.
|
|
|
41
41
|
```vue
|
|
42
42
|
<template>
|
|
43
43
|
<div>
|
|
44
|
-
<orio-button
|
|
44
|
+
<orio-button variant="primary" @click="handleClick"> Click Me </orio-button>
|
|
45
45
|
|
|
46
46
|
<orio-input v-model="email" label="Email" placeholder="you@example.com" />
|
|
47
47
|
|
package/dist/module.json
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { computed, toRefs, useAttrs, useSlots } from 'vue';
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
|
-
|
|
5
|
+
variant?: 'primary' | 'secondary' | 'subdued';
|
|
6
6
|
icon?: string;
|
|
7
7
|
loading?: boolean;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const props = withDefaults(defineProps<Props>(), {
|
|
12
|
-
|
|
12
|
+
variant: 'primary',
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
const { loading, disabled } = toRefs(props);
|
|
@@ -37,7 +37,7 @@ function click(event: PointerEvent) {
|
|
|
37
37
|
<orio-control-element>
|
|
38
38
|
<button
|
|
39
39
|
v-bind="attrs"
|
|
40
|
-
:class="[
|
|
40
|
+
:class="[variant, 'gradient-hover', { 'icon-only': isIconOnly }]"
|
|
41
41
|
@click="click"
|
|
42
42
|
>
|
|
43
43
|
<orio-loading-spinner v-if="loading" />
|
|
@@ -56,6 +56,8 @@ button {
|
|
|
56
56
|
border: 1px solid transparent;
|
|
57
57
|
border-radius: var(--border-radius-md);
|
|
58
58
|
padding: 8px 16px;
|
|
59
|
+
font-size: 1rem;
|
|
60
|
+
line-height: 1.5;
|
|
59
61
|
cursor: pointer;
|
|
60
62
|
display: inline-flex;
|
|
61
63
|
align-items: center;
|
|
@@ -19,6 +19,7 @@ const text = defineModel<string>({ default: '' });
|
|
|
19
19
|
border: 1px solid var(--color-border);
|
|
20
20
|
border-radius: var(--border-radius-md);
|
|
21
21
|
font-size: 1rem;
|
|
22
|
+
line-height: 1.5;
|
|
22
23
|
color: var(--color-text);
|
|
23
24
|
background-color: var(--color-bg);
|
|
24
25
|
box-sizing: border-box;
|
|
@@ -165,6 +165,7 @@ const selectorAttrs = computed(() => ({ getOptionKey, getOptionLabel }));
|
|
|
165
165
|
border-radius: var(--border-radius-md);
|
|
166
166
|
padding: 0.5rem 0.75rem;
|
|
167
167
|
font-size: 0.95rem;
|
|
168
|
+
line-height: 1.5;
|
|
168
169
|
color: var(--color-text);
|
|
169
170
|
transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
|
|
170
171
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
7
|
+
disabled: false,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const modelValue = defineModel<boolean>({ required: false });
|
|
11
|
+
|
|
12
|
+
function toggle() {
|
|
13
|
+
if (props.disabled) return;
|
|
14
|
+
modelValue.value = !modelValue.value;
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<orio-control-element>
|
|
20
|
+
<button
|
|
21
|
+
class="switch-button"
|
|
22
|
+
:class="{ active: modelValue, disabled: disabled }"
|
|
23
|
+
:disabled="disabled"
|
|
24
|
+
@click="toggle"
|
|
25
|
+
@keydown.enter.prevent="toggle"
|
|
26
|
+
@keydown.space.prevent="toggle"
|
|
27
|
+
>
|
|
28
|
+
<slot />
|
|
29
|
+
</button>
|
|
30
|
+
</orio-control-element>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<style scoped>
|
|
34
|
+
.switch-button {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
gap: 0.5rem;
|
|
39
|
+
border-radius: var(--border-radius-md);
|
|
40
|
+
background-color: var(--color-surface);
|
|
41
|
+
color: var(--color-muted);
|
|
42
|
+
border: 1px solid var(--color-border);
|
|
43
|
+
padding: 8px 16px;
|
|
44
|
+
font-size: 1rem;
|
|
45
|
+
line-height: 1.5;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
user-select: none;
|
|
48
|
+
transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
|
|
49
|
+
}
|
|
50
|
+
.switch-button:hover:not(.disabled) {
|
|
51
|
+
border-color: var(--color-accent);
|
|
52
|
+
}
|
|
53
|
+
.switch-button:focus-visible {
|
|
54
|
+
outline: 2px solid var(--color-accent);
|
|
55
|
+
outline-offset: 2px;
|
|
56
|
+
}
|
|
57
|
+
.switch-button.active {
|
|
58
|
+
background-color: var(--color-accent-soft);
|
|
59
|
+
color: var(--color-accent);
|
|
60
|
+
border-color: var(--color-accent);
|
|
61
|
+
}
|
|
62
|
+
.switch-button.disabled {
|
|
63
|
+
opacity: 0.5;
|
|
64
|
+
cursor: not-allowed;
|
|
65
|
+
}
|
|
66
|
+
</style>
|
|
@@ -22,6 +22,7 @@ const modelValue = defineModel<string>({ default: '' });
|
|
|
22
22
|
border: 1px solid var(--color-border);
|
|
23
23
|
border-radius: var(--border-radius-md);
|
|
24
24
|
font-size: 1rem;
|
|
25
|
+
line-height: 1.5;
|
|
25
26
|
color: var(--color-text);
|
|
26
27
|
background-color: var(--color-bg);
|
|
27
28
|
box-sizing: border-box;
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { default as Button } from './components/Button.vue.js';
|
|
|
2
2
|
export { default as Input } from './components/Input.vue.js';
|
|
3
3
|
export { default as Textarea } from './components/Textarea.vue.js';
|
|
4
4
|
export { default as CheckBox } from './components/CheckBox.vue.js';
|
|
5
|
+
export { default as SwitchButton } from './components/SwitchButton.vue.js';
|
|
5
6
|
export { default as DatePicker } from './components/DatePicker.vue.js';
|
|
6
7
|
export { default as DateRangePicker } from './components/DateRangePicker.vue.js';
|
|
7
8
|
export { default as Selector } from './components/Selector.vue.js';
|
package/dist/runtime/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { default as Button } from "./components/Button.vue";
|
|
|
2
2
|
export { default as Input } from "./components/Input.vue";
|
|
3
3
|
export { default as Textarea } from "./components/Textarea.vue";
|
|
4
4
|
export { default as CheckBox } from "./components/CheckBox.vue";
|
|
5
|
+
export { default as SwitchButton } from "./components/SwitchButton.vue";
|
|
5
6
|
export { default as DatePicker } from "./components/DatePicker.vue";
|
|
6
7
|
export { default as DateRangePicker } from "./components/DateRangePicker.vue";
|
|
7
8
|
export { default as Selector } from "./components/Selector.vue";
|