orio-ui 0.1.0 → 0.1.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/package.json +11 -16
- package/dist/module.cjs +0 -5
- package/dist/module.d.mts +0 -3
- package/dist/module.d.ts +0 -3
- package/dist/module.json +0 -12
- package/dist/module.mjs +0 -16
- package/dist/runtime/assets/css/animation.css +0 -1
- package/dist/runtime/assets/css/colors.css +0 -1
- package/dist/runtime/assets/css/cool-gradient-hover.css +0 -23
- package/dist/runtime/assets/css/main.css +0 -1
- package/dist/runtime/assets/css/scroll.css +0 -1
- package/dist/runtime/components/Button.vue +0 -102
- package/dist/runtime/components/CheckBox.vue +0 -93
- package/dist/runtime/components/ControlElement.vue +0 -39
- package/dist/runtime/components/DashedContainer.vue +0 -59
- package/dist/runtime/components/DatePicker.vue +0 -30
- package/dist/runtime/components/DateRangePicker.vue +0 -73
- package/dist/runtime/components/EmptyState.vue +0 -81
- package/dist/runtime/components/Icon.vue +0 -40
- package/dist/runtime/components/Input.vue +0 -48
- package/dist/runtime/components/LoadingSpinner.vue +0 -6
- package/dist/runtime/components/Modal.vue +0 -69
- package/dist/runtime/components/Popover.vue +0 -249
- package/dist/runtime/components/Selector.vue +0 -208
- package/dist/runtime/components/Tag.vue +0 -21
- package/dist/runtime/components/Textarea.vue +0 -53
- package/dist/runtime/components/view/Dates.vue +0 -59
- package/dist/runtime/components/view/Separator.vue +0 -26
- package/dist/runtime/components/view/Text.vue +0 -79
- package/dist/runtime/composables/index.d.ts +0 -4
- package/dist/runtime/composables/index.js +0 -4
- package/dist/runtime/composables/useApi.d.ts +0 -10
- package/dist/runtime/composables/useApi.js +0 -9
- package/dist/runtime/composables/useFuzzySearch.d.ts +0 -10
- package/dist/runtime/composables/useFuzzySearch.js +0 -22
- package/dist/runtime/composables/useModal.d.ts +0 -15
- package/dist/runtime/composables/useModal.js +0 -28
- package/dist/runtime/composables/useTheme.d.ts +0 -6
- package/dist/runtime/composables/useTheme.js +0 -23
- package/dist/runtime/index.d.ts +0 -20
- package/dist/runtime/index.js +0 -20
- package/dist/runtime/utils/icon-registry.d.ts +0 -2
- package/dist/runtime/utils/icon-registry.js +0 -26
- package/dist/types.d.mts +0 -7
- package/dist/types.d.ts +0 -7
package/package.json
CHANGED
|
@@ -1,35 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orio-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Modern Nuxt component library with theme support",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./
|
|
7
|
-
"types": "./
|
|
6
|
+
"main": "./src/runtime/index.ts",
|
|
7
|
+
"types": "./src/runtime/index.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./
|
|
11
|
-
"import": "./
|
|
12
|
-
},
|
|
13
|
-
"./nuxt": {
|
|
14
|
-
"types": "./dist/module.d.ts",
|
|
15
|
-
"import": "./dist/module.mjs"
|
|
10
|
+
"types": "./src/runtime/index.ts",
|
|
11
|
+
"import": "./src/runtime/index.ts"
|
|
16
12
|
},
|
|
17
13
|
"./composables": {
|
|
18
|
-
"types": "./
|
|
19
|
-
"import": "./
|
|
14
|
+
"types": "./src/runtime/composables/index.ts",
|
|
15
|
+
"import": "./src/runtime/composables/index.ts"
|
|
20
16
|
},
|
|
21
|
-
"./styles": "./
|
|
22
|
-
"./theme": "./
|
|
17
|
+
"./styles": "./src/runtime/assets/css/main.css",
|
|
18
|
+
"./theme": "./src/runtime/assets/css/colors.css"
|
|
23
19
|
},
|
|
24
20
|
"files": [
|
|
25
|
-
"dist",
|
|
26
21
|
"nuxt.config.ts",
|
|
27
22
|
"src"
|
|
28
23
|
],
|
|
29
24
|
"scripts": {
|
|
30
25
|
"dev": "vitepress dev docs",
|
|
31
|
-
"build": "
|
|
32
|
-
"prepack": "
|
|
26
|
+
"build": "echo 'Build not needed for Nuxt layer'",
|
|
27
|
+
"prepack": "echo 'Using source files directly'",
|
|
33
28
|
"test": "vitest",
|
|
34
29
|
"test:unit": "vitest run",
|
|
35
30
|
"test:watch": "vitest watch",
|
package/dist/module.cjs
DELETED
package/dist/module.d.mts
DELETED
package/dist/module.d.ts
DELETED
package/dist/module.json
DELETED
package/dist/module.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineNuxtModule } from '@nuxt/kit';
|
|
2
|
-
|
|
3
|
-
const module = defineNuxtModule({
|
|
4
|
-
meta: {
|
|
5
|
-
name: "orio-ui",
|
|
6
|
-
configKey: "orioUi",
|
|
7
|
-
compatibility: {
|
|
8
|
-
nuxt: "^3.0.0 || ^4.0.0"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
defaults: {},
|
|
12
|
-
setup() {
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export { module as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--motion-duration-short:0.05s;--motion-duration-medium:0.15s;--motion-distance-small:0.15rem;--motion-distance-medium:2rem;--motion-distance-large:1rem;--motion-ease-default:ease-in;--motion-ease-smooth:cubic-bezier(0.22,1,0.36,1)}.animate-fade-enter-active,.animate-fade-leave-active{transition:opacity var(--motion-duration-short) var(--motion-ease-default),transform var(--motion-duration-short) var(--motion-ease-default)}.animate-fade-enter-from,.animate-fade-leave-to{opacity:0;transform:translateY(calc(var(--motion-distance-small)*-1))}.animate-fade-slide-appear-active,.animate-fade-slide-enter-active,.animate-fade-slide-leave-active{transition:opacity var(--motion-duration-medium) var(--motion-ease-smooth),transform var(--motion-duration-medium) var(--motion-ease-smooth);transition-delay:calc(var(--index, 0)*.08s)}.animate-fade-slide-appear-from,.animate-fade-slide-enter-from{opacity:0;transform:translateY(var(--motion-distance-medium))}.animate-fade-slide-leave-to{opacity:0;transform:translateY(calc(var(--motion-distance-large)*-1))}.animate-fade-slide-move{transition:transform var(--motion-duration-medium) ease}.animate-fade-reverse-enter-active,.animate-fade-reverse-leave-active{transition:opacity var(--motion-duration-short) var(--motion-ease-default),transform var(--motion-duration-short) var(--motion-ease-default)}.animate-fade-reverse-enter-from,.animate-fade-reverse-leave-to{opacity:0;transform:translateY(var(--motion-distance-small))}.animate-fade-slide-reverse-appear-active,.animate-fade-slide-reverse-enter-active,.animate-fade-slide-reverse-leave-active{transition:opacity var(--motion-duration-medium) var(--motion-ease-smooth),transform var(--motion-duration-medium) var(--motion-ease-smooth);transition-delay:calc(var(--index, 0)*.08s)}.animate-fade-slide-reverse-appear-from,.animate-fade-slide-reverse-enter-from{opacity:0;transform:translateY(calc(var(--motion-distance-medium)*-1))}.animate-fade-slide-reverse-leave-to{opacity:0;transform:translateY(var(--motion-distance-large))}.animate-fade-slide-reverse-move{transition:transform var(--motion-duration-medium) ease}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--color-bg:#fff;--color-surface:#f7f8fa;--color-text:#0e1116;--color-muted:#626a78;--color-border:#bfbfc2;--color-accent:#1f3a8a;--color-accent-ink:#fff;--color-accent-soft:#eef2ff;--color-accent-border:#c7d2fe;--color-accent-hover:color-mix(in srgb,var(--color-accent) 85%,#000 15%);--color-accent-active:color-mix(in srgb,var(--color-accent) 75%,#000 25%)}:root[data-mode=light]{--color-bg:#fff;--color-surface:#f7f8fa;--color-text:#0e1116;--color-muted:#626a78;--color-border:#bfbfc2}:root[data-mode=dark]{--color-bg:#0e1116;--color-surface:#1a1d23;--color-text:#fff;--color-muted:#a0a7b5;--color-border:#2e333d;--color-accent-ink:#fff;--color-accent-soft:color-mix(in srgb,var(--color-accent) 12%,#0e1116);--color-accent-border:color-mix(in srgb,var(--color-accent) 40%,#0e1116);--color-accent-hover:color-mix(in srgb,var(--color-accent) 30%,#fff 70%);--color-accent-active:color-mix(in srgb,var(--color-accent) 80%,#fff 25%)}:root[data-theme=navy]{--color-accent:#333c4d;--color-accent-soft:#f0f5ff;--color-accent-border:#bdcdef}:root[data-theme=teal]{--color-accent:#147b71;--color-accent-soft:#e7f8f6;--color-accent-border:#a6d9d4}:root[data-theme=forest]{--color-accent:#235c42;--color-accent-soft:#e9f7f0;--color-accent-border:#a2cdb9}:root[data-theme=wine]{--color-accent:#862737;--color-accent-soft:#fbeff1;--color-accent-border:#dbb3ba}:root[data-theme=royal]{--color-accent:#293da3;--color-accent-soft:#eef0fb;--color-accent-border:#b3badb}:root{--color-red:#dc2626;--color-red-ink:#fff;--color-red-soft:#fef2f2;--color-red-border:#fecaca;--color-red-hover:color-mix(in srgb,var(--color-red) 85%,#000 15%);--color-red-active:color-mix(in srgb,var(--color-red) 75%,#000 25%);--color-orange:#ea580c;--color-orange-ink:#fff;--color-orange-soft:#fff7ed;--color-orange-border:#fed7aa;--color-orange-hover:color-mix(in srgb,var(--color-orange) 85%,#000 15%);--color-orange-active:color-mix(in srgb,var(--color-orange) 75%,#000 25%);--color-yellow:#ca8a04;--color-yellow-ink:#fff;--color-yellow-soft:#fefce8;--color-yellow-border:#fef08a;--color-yellow-hover:color-mix(in srgb,var(--color-yellow) 85%,#000 15%);--color-yellow-active:color-mix(in srgb,var(--color-yellow) 75%,#000 25%);--color-green:#15803d;--color-green-ink:#fff;--color-green-soft:#f0fdf4;--color-green-border:#bbf7d0;--color-green-hover:color-mix(in srgb,var(--color-green) 85%,#000 15%);--color-green-active:color-mix(in srgb,var(--color-green) 75%,#000 25%);--color-teal:#0d9488;--color-teal-ink:#fff;--color-teal-soft:#f0fdfa;--color-teal-border:#99f6e4;--color-teal-hover:color-mix(in srgb,var(--color-teal) 85%,#000 15%);--color-teal-active:color-mix(in srgb,var(--color-teal) 75%,#000 25%);--color-blue:#2563eb;--color-blue-ink:#fff;--color-blue-soft:#eff6ff;--color-blue-border:#bfdbfe;--color-blue-hover:color-mix(in srgb,var(--color-blue) 85%,#000 15%);--color-blue-active:color-mix(in srgb,var(--color-blue) 75%,#000 25%);--color-purple:#7e22ce;--color-purple-ink:#fff;--color-purple-soft:#faf5ff;--color-purple-border:#e9d5ff;--color-purple-hover:color-mix(in srgb,var(--color-purple) 85%,#000 15%);--color-purple-active:color-mix(in srgb,var(--color-purple) 75%,#000 25%);--color-pink:#db2777;--color-pink-ink:#fff;--color-pink-soft:#fdf2f8;--color-pink-border:#fbcfe8;--color-pink-hover:color-mix(in srgb,var(--color-pink) 85%,#000 15%);--color-pink-active:color-mix(in srgb,var(--color-pink) 75%,#000 25%)}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
.gradient-hover {
|
|
2
|
-
--gh-color: #fff;
|
|
3
|
-
--gh-angle: 120deg;
|
|
4
|
-
--gh-peek-x: 95%;
|
|
5
|
-
--gh-mix-base: black;
|
|
6
|
-
background-image: linear-gradient(var(--gh-angle), color-mix(in srgb, var(--gh-color) 90%, var(--gh-mix-base)) 0%, var(--gh-color) 40%, color-mix(in srgb, var(--gh-color) 90%, var(--gh-mix-base)) 80%);
|
|
7
|
-
background-repeat: no-repeat;
|
|
8
|
-
background-size: 0% 0%;
|
|
9
|
-
background-position: 0% 0%;
|
|
10
|
-
transition: background-position 0.8s ease, border-color 0.2s ease;
|
|
11
|
-
will-change: background-size, background-position;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.gradient-hover:hover {
|
|
15
|
-
background-size: 200% 100%;
|
|
16
|
-
background-position: var(--gh-peek-x) 0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/* Dark mode: now theme-aware */
|
|
20
|
-
:root[data-mode=dark] .gradient-hover {
|
|
21
|
-
--gh-color: var(--color-accent); /* switch from static white to theme accent */
|
|
22
|
-
--gh-mix-base: var(--color-bg); /* blend into dark background */
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "./colors.css";@import "./animation.css";@import "./scroll.css";*,:after,:before{box-sizing:border-box}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
::-webkit-scrollbar{height:12px;width:12px}::-webkit-scrollbar-track{background:var(--color-surface);border-left:1px solid var(--color-border)}::-webkit-scrollbar-thumb{background-color:var(--color-accent-border);border:3px solid var(--color-surface);border-radius:8px;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}::-webkit-scrollbar-thumb:hover{background-color:var(--color-accent)}::-webkit-scrollbar-corner{background:var(--color-surface)}*{scrollbar-color:var(--color-accent-border) var(--color-surface);scrollbar-width:thin}:root[data-mode=dark] ::-webkit-scrollbar-track{background:var(--color-bg);border-left:1px solid var(--color-border)}:root[data-mode=dark] ::-webkit-scrollbar-thumb{background-color:var(--color-accent-border);border:3px solid var(--color-bg)}:root[data-mode=dark] *{scrollbar-color:var(--color-accent-border) var(--color-bg)}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, toRefs, useAttrs, useSlots } from 'vue';
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
type?: 'primary' | 'secondary' | 'subdued';
|
|
6
|
-
icon?: string;
|
|
7
|
-
loading?: boolean;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
12
|
-
type: 'primary',
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const { loading, disabled } = toRefs(props);
|
|
16
|
-
|
|
17
|
-
const attrs = useAttrs();
|
|
18
|
-
const slots = useSlots();
|
|
19
|
-
|
|
20
|
-
const isIconOnly = computed(() => {
|
|
21
|
-
const hasIcon = !!props.icon || !!slots.icon;
|
|
22
|
-
const hasDefault = !!slots.default;
|
|
23
|
-
return hasIcon && !hasDefault;
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const emit = defineEmits<{
|
|
27
|
-
(e: 'click', event: PointerEvent): void;
|
|
28
|
-
}>();
|
|
29
|
-
|
|
30
|
-
function click(event: PointerEvent) {
|
|
31
|
-
if (loading.value || disabled.value) return;
|
|
32
|
-
emit('click', event);
|
|
33
|
-
}
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<template>
|
|
37
|
-
<orio-control-element>
|
|
38
|
-
<button
|
|
39
|
-
v-bind="attrs"
|
|
40
|
-
:class="[type, 'gradient-hover', { 'icon-only': isIconOnly }]"
|
|
41
|
-
@click="click"
|
|
42
|
-
>
|
|
43
|
-
<orio-loading-spinner v-if="loading" />
|
|
44
|
-
<slot v-else name="icon">
|
|
45
|
-
<orio-icon v-if="icon" :name="icon" />
|
|
46
|
-
</slot>
|
|
47
|
-
<slot />
|
|
48
|
-
</button>
|
|
49
|
-
</orio-control-element>
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<style scoped>
|
|
53
|
-
button {
|
|
54
|
-
background-color: var(--color-accent);
|
|
55
|
-
color: var(--color-accent-ink);
|
|
56
|
-
border: 1px solid transparent;
|
|
57
|
-
border-radius: 4px;
|
|
58
|
-
padding: 8px 16px;
|
|
59
|
-
cursor: pointer;
|
|
60
|
-
display: inline-flex;
|
|
61
|
-
align-items: center;
|
|
62
|
-
gap: 0.5rem;
|
|
63
|
-
user-select: none;
|
|
64
|
-
}
|
|
65
|
-
button.icon-only {
|
|
66
|
-
padding: 0;
|
|
67
|
-
border-radius: 50%;
|
|
68
|
-
}
|
|
69
|
-
button:disabled {
|
|
70
|
-
background-color: var(--color-accent-soft);
|
|
71
|
-
color: var(--color-muted);
|
|
72
|
-
border-color: var(--color-accent-border);
|
|
73
|
-
cursor: not-allowed;
|
|
74
|
-
}
|
|
75
|
-
button:active {
|
|
76
|
-
border: 1px solid var(--color-accent-border);
|
|
77
|
-
}
|
|
78
|
-
button.primary {
|
|
79
|
-
--gh-color: var(--color-accent);
|
|
80
|
-
}
|
|
81
|
-
button.secondary {
|
|
82
|
-
background-color: transparent;
|
|
83
|
-
border: 1px solid var(--color-accent);
|
|
84
|
-
color: var(--color-accent);
|
|
85
|
-
}
|
|
86
|
-
button.secondary:hover {
|
|
87
|
-
color: var(--color-accent-hover);
|
|
88
|
-
}
|
|
89
|
-
button.subdued {
|
|
90
|
-
background-color: transparent;
|
|
91
|
-
color: var(--color-accent);
|
|
92
|
-
}
|
|
93
|
-
button.subdued:hover {
|
|
94
|
-
color: var(--color-accent-hover);
|
|
95
|
-
}
|
|
96
|
-
button:active {
|
|
97
|
-
border-color: var(--color-accent-border) !important;
|
|
98
|
-
}
|
|
99
|
-
button:hover {
|
|
100
|
-
color: var(--color-accent-ink);
|
|
101
|
-
}
|
|
102
|
-
</style>
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
const modelValue = defineModel<boolean>({ required: false });
|
|
3
|
-
|
|
4
|
-
defineProps<{
|
|
5
|
-
checkedIcon?: string; // optional: pass icon name for checked state
|
|
6
|
-
uncheckedIcon?: string; // optional: pass icon name for unchecked state
|
|
7
|
-
}>();
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<template>
|
|
11
|
-
<orio-control-element class="checkbox">
|
|
12
|
-
<label class="checkbox-label">
|
|
13
|
-
<input
|
|
14
|
-
v-model="modelValue"
|
|
15
|
-
type="checkbox"
|
|
16
|
-
class="checkbox-input"
|
|
17
|
-
tabindex="-1"
|
|
18
|
-
/>
|
|
19
|
-
<span
|
|
20
|
-
class="checkbox-box"
|
|
21
|
-
:class="{
|
|
22
|
-
defaultChecked: !checkedIcon,
|
|
23
|
-
defaultUnchecked: !uncheckedIcon,
|
|
24
|
-
}"
|
|
25
|
-
>
|
|
26
|
-
<slot name="icon" :checked="modelValue">
|
|
27
|
-
<orio-icon v-if="modelValue && checkedIcon" :name="checkedIcon" />
|
|
28
|
-
<orio-icon
|
|
29
|
-
v-else-if="!modelValue && uncheckedIcon"
|
|
30
|
-
:name="uncheckedIcon"
|
|
31
|
-
/>
|
|
32
|
-
</slot>
|
|
33
|
-
</span>
|
|
34
|
-
<slot />
|
|
35
|
-
</label>
|
|
36
|
-
</orio-control-element>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<style scoped>
|
|
40
|
-
.checkbox {
|
|
41
|
-
--box-size: 1rem;
|
|
42
|
-
}
|
|
43
|
-
.checkbox-label {
|
|
44
|
-
position: relative;
|
|
45
|
-
user-select: none;
|
|
46
|
-
display: inline-flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
gap: 0.4rem;
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
font-size: 0.9rem;
|
|
51
|
-
color: var(--color-text);
|
|
52
|
-
}
|
|
53
|
-
.checkbox-input {
|
|
54
|
-
position: absolute;
|
|
55
|
-
inset: 0;
|
|
56
|
-
width: var(--box-size);
|
|
57
|
-
height: 1rem;
|
|
58
|
-
margin: 0;
|
|
59
|
-
opacity: 0;
|
|
60
|
-
}
|
|
61
|
-
.checkbox-box {
|
|
62
|
-
width: var(--box-size);
|
|
63
|
-
height: var(--box-size);
|
|
64
|
-
border: 2px solid var(--color-border);
|
|
65
|
-
border-radius: 4px;
|
|
66
|
-
background-color: var(--color-bg);
|
|
67
|
-
display: inline-flex;
|
|
68
|
-
align-items: center;
|
|
69
|
-
justify-content: center;
|
|
70
|
-
transition: background-color 0.2s ease, border-color 0.2s ease;
|
|
71
|
-
}
|
|
72
|
-
.checkbox .checkbox-input:checked + .checkbox-box {
|
|
73
|
-
background-color: var(--color-accent);
|
|
74
|
-
border-color: var(--color-accent);
|
|
75
|
-
}
|
|
76
|
-
.checkbox .checkbox-input:checked + .checkbox-box.defaultChecked::after {
|
|
77
|
-
content: "";
|
|
78
|
-
width: 0.3rem;
|
|
79
|
-
height: 0.6rem;
|
|
80
|
-
position: relative;
|
|
81
|
-
bottom: 0.1rem;
|
|
82
|
-
border: solid var(--color-accent-ink);
|
|
83
|
-
border-width: 0 2px 2px 0;
|
|
84
|
-
transform: rotate(45deg);
|
|
85
|
-
}
|
|
86
|
-
.checkbox-label:hover .checkbox-box {
|
|
87
|
-
border-color: var(--color-accent);
|
|
88
|
-
}
|
|
89
|
-
.checkbox .checkbox-input:focus-visible + .checkbox-box {
|
|
90
|
-
outline: 2px solid var(--color-accent);
|
|
91
|
-
outline-offset: 2px;
|
|
92
|
-
}
|
|
93
|
-
</style>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
export interface ControlProps {
|
|
3
|
-
/**
|
|
4
|
-
* Minimal will reset margin and remove border and box shadow from every element inside the slot
|
|
5
|
-
*/
|
|
6
|
-
appearance?: "normal" | "minimal";
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
withDefaults(defineProps<ControlProps>(), {
|
|
10
|
-
appearance: "normal",
|
|
11
|
-
});
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<div class="control" :class="[appearance]">
|
|
16
|
-
<label v-if="$attrs.label" class="control-label">{{ $attrs.label }}</label>
|
|
17
|
-
<div class="slot-wrapper" v-bind="$attrs">
|
|
18
|
-
<slot />
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<style scoped>
|
|
24
|
-
.control {
|
|
25
|
-
margin: 0.5rem;
|
|
26
|
-
}
|
|
27
|
-
.control .control-label {
|
|
28
|
-
user-select: none;
|
|
29
|
-
}
|
|
30
|
-
.control.minimal {
|
|
31
|
-
margin: 0;
|
|
32
|
-
}
|
|
33
|
-
.control.minimal .slot-wrapper :first-child {
|
|
34
|
-
border: 0;
|
|
35
|
-
}
|
|
36
|
-
.control.minimal .slot-wrapper :first-child:focus {
|
|
37
|
-
box-shadow: none;
|
|
38
|
-
}
|
|
39
|
-
</style>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
icon?: string;
|
|
6
|
-
text?: string;
|
|
7
|
-
size?: 'small' | 'medium' | 'large';
|
|
8
|
-
}
|
|
9
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
10
|
-
size: 'medium',
|
|
11
|
-
});
|
|
12
|
-
defineEmits(['click']);
|
|
13
|
-
|
|
14
|
-
const iconSize = computed(() => {
|
|
15
|
-
switch (props.size) {
|
|
16
|
-
case 'small':
|
|
17
|
-
return '2rem';
|
|
18
|
-
case 'large':
|
|
19
|
-
return '5rem';
|
|
20
|
-
default:
|
|
21
|
-
return '3rem';
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
</script>
|
|
25
|
-
<template>
|
|
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
|
-
/>
|
|
33
|
-
<span v-if="text" class="text-class" :size>{{ text }}</span>
|
|
34
|
-
</div>
|
|
35
|
-
</template>
|
|
36
|
-
|
|
37
|
-
<style scoped>
|
|
38
|
-
.dashed-container {
|
|
39
|
-
cursor: pointer;
|
|
40
|
-
border: 3px dashed var(--color-border);
|
|
41
|
-
border-radius: 4px;
|
|
42
|
-
padding: 0.5rem;
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
justify-content: center;
|
|
46
|
-
align-items: center;
|
|
47
|
-
}
|
|
48
|
-
.dashed-container:hover .text-class {
|
|
49
|
-
color: var(--color-accent-hover);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.icon-class {
|
|
53
|
-
color: var(--color-muted);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.text-class {
|
|
57
|
-
color: var(--color-accent);
|
|
58
|
-
}
|
|
59
|
-
</style>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { nanoid } from 'nanoid';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
month?: boolean;
|
|
7
|
-
}
|
|
8
|
-
defineProps<Props>();
|
|
9
|
-
|
|
10
|
-
const date = defineModel<string | null | undefined>('date', {
|
|
11
|
-
required: true,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const randomName = computed(() => `date-${nanoid(8)}`);
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<template>
|
|
18
|
-
<orio-control-element class="date-picker" v-bind="$attrs">
|
|
19
|
-
<input
|
|
20
|
-
v-model="date"
|
|
21
|
-
:type="month ? 'month' : 'date'"
|
|
22
|
-
class="date-input"
|
|
23
|
-
:name="randomName"
|
|
24
|
-
/>
|
|
25
|
-
</orio-control-element>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<style scoped>
|
|
29
|
-
.date-picker *{cursor:pointer;width:100%}.date-picker-label{color:var(--color-text);display:inline-flex;flex-direction:column;font-size:.9rem;gap:.25rem}.date-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;box-sizing:border-box;color:var(--color-text);font-size:.95rem;padding:.4rem .6rem;transition:border-color .2s ease,box-shadow .2s ease}.date-input:focus,.date-input:hover{border-color:var(--color-accent)}.date-input:focus{box-shadow:0 0 0 2px var(--color-accent-soft);outline:none}.date-input:disabled{background-color:var(--color-surface);color:var(--color-muted);cursor:not-allowed}.date-input::-webkit-calendar-picker-indicator{cursor:pointer;filter:invert(36%) sepia(65%) saturate(325%) hue-rotate(180deg);opacity:.7;-webkit-transition:opacity .2s ease;transition:opacity .2s ease}.date-input::-webkit-calendar-picker-indicator:hover{opacity:1}
|
|
30
|
-
</style>
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref, watch, computed } from 'vue';
|
|
3
|
-
import type { ResumeDate } from './view/Dates.vue';
|
|
4
|
-
|
|
5
|
-
export interface DateRangePickerProps {
|
|
6
|
-
month?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
defineProps<DateRangePickerProps>();
|
|
10
|
-
|
|
11
|
-
const dates = defineModel<ResumeDate>('dates', { required: true });
|
|
12
|
-
|
|
13
|
-
const present = ref(dates.value.endDate !== '' && !dates.value.endDate);
|
|
14
|
-
|
|
15
|
-
watch(present, (value) => {
|
|
16
|
-
if (value) {
|
|
17
|
-
dates.value.endDate = null; // Set end date to null when present is checked
|
|
18
|
-
} else {
|
|
19
|
-
dates.value.endDate = ''; // Reset end date when present is unchecked
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const dateIsCorrect = computed(() => {
|
|
24
|
-
// Ensure that the start date is before the end date
|
|
25
|
-
if (dates.value.startDate && dates.value.endDate) {
|
|
26
|
-
return new Date(dates.value.startDate) <= new Date(dates.value.endDate);
|
|
27
|
-
}
|
|
28
|
-
return true; // If one of the dates is empty, consider it correct
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
defineExpose({ dateIsCorrect });
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<template>
|
|
35
|
-
<div>
|
|
36
|
-
<orio-control-element>
|
|
37
|
-
<div class="date-range-picker">
|
|
38
|
-
<orio-date-picker v-model:date="dates.startDate" :month />
|
|
39
|
-
<orio-date-picker v-model:date="dates.endDate" :month />
|
|
40
|
-
<orio-check-box v-model="present"> Present </orio-check-box>
|
|
41
|
-
</div>
|
|
42
|
-
</orio-control-element>
|
|
43
|
-
<div v-if="!dateIsCorrect" class="error-message">
|
|
44
|
-
<p>Start date must be before end date.</p>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</template>
|
|
48
|
-
|
|
49
|
-
<style scoped>
|
|
50
|
-
.date-range-picker {
|
|
51
|
-
display: flex;
|
|
52
|
-
align-items: center;
|
|
53
|
-
flex-wrap: wrap;
|
|
54
|
-
}
|
|
55
|
-
.date-range-picker > * {
|
|
56
|
-
min-width: 0;
|
|
57
|
-
}
|
|
58
|
-
.date-range-picker .date-picker {
|
|
59
|
-
margin-inline: 0;
|
|
60
|
-
}
|
|
61
|
-
.date-range-picker .date-picker:first-child {
|
|
62
|
-
margin-inline-end: 0.5rem;
|
|
63
|
-
}
|
|
64
|
-
.date-range-picker .checkbox {
|
|
65
|
-
margin-inline-start: 0.25rem;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.error-message {
|
|
69
|
-
color: red;
|
|
70
|
-
font-size: 0.875rem;
|
|
71
|
-
margin-top: 0.5rem;
|
|
72
|
-
}
|
|
73
|
-
</style>
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
interface Props {
|
|
3
|
-
icon?: string;
|
|
4
|
-
title: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
size?: 'small' | 'medium' | 'large';
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
10
|
-
size: 'medium',
|
|
11
|
-
});
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<div class="empty-state" :class="size">
|
|
16
|
-
<orio-icon v-if="icon" :name="icon" class="empty-state-icon" />
|
|
17
|
-
<orio-view-text
|
|
18
|
-
type="title"
|
|
19
|
-
:size="size === 'large' ? 'medium' : 'small'"
|
|
20
|
-
class="empty-state-title"
|
|
21
|
-
>
|
|
22
|
-
{{ title }}
|
|
23
|
-
</orio-view-text>
|
|
24
|
-
<orio-view-text
|
|
25
|
-
v-if="description"
|
|
26
|
-
type="subtitle"
|
|
27
|
-
class="empty-state-description"
|
|
28
|
-
>
|
|
29
|
-
{{ description }}
|
|
30
|
-
</orio-view-text>
|
|
31
|
-
<slot />
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
|
|
35
|
-
<style scoped>
|
|
36
|
-
.empty-state {
|
|
37
|
-
display: flex;
|
|
38
|
-
flex-direction: column;
|
|
39
|
-
align-items: center;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
text-align: center;
|
|
42
|
-
gap: 0.5rem;
|
|
43
|
-
padding: 2rem;
|
|
44
|
-
color: var(--color-text-secondary);
|
|
45
|
-
}
|
|
46
|
-
.empty-state.small {
|
|
47
|
-
padding: 1rem;
|
|
48
|
-
gap: 0.25rem;
|
|
49
|
-
}
|
|
50
|
-
.empty-state.small .empty-state-icon {
|
|
51
|
-
font-size: 2rem;
|
|
52
|
-
}
|
|
53
|
-
.empty-state.medium {
|
|
54
|
-
padding: 2rem;
|
|
55
|
-
gap: 0.5rem;
|
|
56
|
-
}
|
|
57
|
-
.empty-state.medium .empty-state-icon {
|
|
58
|
-
font-size: 3rem;
|
|
59
|
-
}
|
|
60
|
-
.empty-state.large {
|
|
61
|
-
padding: 3rem;
|
|
62
|
-
gap: 1rem;
|
|
63
|
-
}
|
|
64
|
-
.empty-state.large .empty-state-icon {
|
|
65
|
-
font-size: 4rem;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.empty-state-icon {
|
|
69
|
-
color: var(--color-text-tertiary);
|
|
70
|
-
opacity: 0.5;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.empty-state-title {
|
|
74
|
-
color: var(--color-text-secondary);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.empty-state-description {
|
|
78
|
-
color: var(--color-text-tertiary);
|
|
79
|
-
max-width: 30ch;
|
|
80
|
-
}
|
|
81
|
-
</style>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
import { iconRegistry, type IconName } from '../utils/icon-registry'
|
|
4
|
-
|
|
5
|
-
export interface IconProps {
|
|
6
|
-
name: IconName | string
|
|
7
|
-
size?: string | number
|
|
8
|
-
color?: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const props = withDefaults(defineProps<IconProps>(), {
|
|
12
|
-
size: '1em',
|
|
13
|
-
color: 'currentColor'
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
const iconSvg = computed(() => iconRegistry[props.name] || '')
|
|
17
|
-
const sizeValue = computed(() =>
|
|
18
|
-
typeof props.size === 'number' ? `${props.size}px` : props.size
|
|
19
|
-
)
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<template>
|
|
23
|
-
<span
|
|
24
|
-
class="orio-icon"
|
|
25
|
-
:style="{
|
|
26
|
-
width: sizeValue,
|
|
27
|
-
height: sizeValue,
|
|
28
|
-
color: color,
|
|
29
|
-
display: 'inline-flex',
|
|
30
|
-
alignItems: 'center',
|
|
31
|
-
justifyContent: 'center',
|
|
32
|
-
flexShrink: 0
|
|
33
|
-
}"
|
|
34
|
-
v-html="iconSvg"
|
|
35
|
-
/>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<style scoped>
|
|
39
|
-
.orio-icon{align-items:center;display:inline-flex;flex-shrink:0;justify-content:center}.orio-icon :deep(svg){fill:currentColor;height:100%;width:100%}
|
|
40
|
-
</style>
|