pgo-uiux2 1.0.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/.env +1 -0
- package/.env.production +1 -0
- package/.prettierrc +13 -0
- package/.vscode/extensions.json +3 -0
- package/BUTTON_GUIDE.md +257 -0
- package/README.md +49 -0
- package/THEME_REFERENCE.md +310 -0
- package/eslint.config.ts +27 -0
- package/index.html +13 -0
- package/package.json +85 -0
- package/public/favicon.ico +0 -0
- package/src/App.vue +368 -0
- package/src/assets/fonts/Faruma.ttf +0 -0
- package/src/components/examples/AppBarExample.vue +101 -0
- package/src/components/examples/AvatarExample.vue +47 -0
- package/src/components/examples/BannerExample.vue +287 -0
- package/src/components/examples/BaseInputExample.vue +25 -0
- package/src/components/examples/BreadcrumbExample.vue +53 -0
- package/src/components/examples/CardExample.vue +77 -0
- package/src/components/examples/ChipExample.vue +225 -0
- package/src/components/examples/DatePickerExample.vue +31 -0
- package/src/components/examples/DropdownExample.vue +84 -0
- package/src/components/examples/EditorExample.vue +200 -0
- package/src/components/examples/ExpansionPanelExample.vue +42 -0
- package/src/components/examples/FileUploadExample.vue +40 -0
- package/src/components/examples/FormExample.vue +121 -0
- package/src/components/examples/HugeTest.vue +8 -0
- package/src/components/examples/LayoutContainerExample.vue +80 -0
- package/src/components/examples/ModalExample.vue +82 -0
- package/src/components/examples/NavDrawerExample.vue +170 -0
- package/src/components/examples/NumberFieldExample.vue +145 -0
- package/src/components/examples/RadioButtonExample.vue +161 -0
- package/src/components/examples/SearchExample.vue +322 -0
- package/src/components/examples/SelectExample.vue +121 -0
- package/src/components/examples/StackedTableViewExample.vue +53 -0
- package/src/components/examples/TabExample.vue +336 -0
- package/src/components/examples/TableExample.vue +228 -0
- package/src/components/examples/TextFieldExample.vue +181 -0
- package/src/components/examples/TextareaExample.vue +173 -0
- package/src/components/examples/ThemeToggle.vue +50 -0
- package/src/components/examples/TimelineExample.vue +66 -0
- package/src/components/examples/TipTapEditorExample.vue +20 -0
- package/src/components/examples/TooltipExample.vue +53 -0
- package/src/components/examples/VueDatePickerShowcase.vue +214 -0
- package/src/components/examples/_DatePickerExample.vue +33 -0
- package/src/components/examples/__FormExample.vue +77 -0
- package/src/components/index.ts +25 -0
- package/src/components/pgo/AppBar.vue +347 -0
- package/src/components/pgo/Avatar.vue +139 -0
- package/src/components/pgo/Banner.vue +300 -0
- package/src/components/pgo/Breadcrumb.vue +101 -0
- package/src/components/pgo/Button.vue +171 -0
- package/src/components/pgo/Card.vue +178 -0
- package/src/components/pgo/ConfirmationModel.vue +32 -0
- package/src/components/pgo/DataTable.vue +845 -0
- package/src/components/pgo/DatePicker/CalendarPanel.vue +43 -0
- package/src/components/pgo/DatePicker/__DatePicker.vue +122 -0
- package/src/components/pgo/DatePicker/types.ts +11 -0
- package/src/components/pgo/DatePicker/useCalendar.ts +39 -0
- package/src/components/pgo/DatePicker/useDatePicker.ts +31 -0
- package/src/components/pgo/Deprecated/ToastContainer.vue +51 -0
- package/src/components/pgo/Deprecated/ToastItem.vue +55 -0
- package/src/components/pgo/Dropdown.vue +296 -0
- package/src/components/pgo/DropdownItem.vue +40 -0
- package/src/components/pgo/Editor.vue +511 -0
- package/src/components/pgo/ExpansionPanel.vue +185 -0
- package/src/components/pgo/Footer.vue +39 -0
- package/src/components/pgo/HeroIcon.vue +124 -0
- package/src/components/pgo/InputSearch.vue +194 -0
- package/src/components/pgo/LayoutContainer.vue +104 -0
- package/src/components/pgo/Main.vue +37 -0
- package/src/components/pgo/Modal.vue +273 -0
- package/src/components/pgo/NavDrawer.vue +127 -0
- package/src/components/pgo/NavDrawerItem.vue +161 -0
- package/src/components/pgo/NavigationDrawer.vue +849 -0
- package/src/components/pgo/OLDNavDrawer.vue +661 -0
- package/src/components/pgo/OldAppBar.vue +223 -0
- package/src/components/pgo/PApp.vue +102 -0
- package/src/components/pgo/Pagination.vue +242 -0
- package/src/components/pgo/Search copy.vue +310 -0
- package/src/components/pgo/Search.vue +411 -0
- package/src/components/pgo/StackedTableView.vue +167 -0
- package/src/components/pgo/Tab.vue +617 -0
- package/src/components/pgo/TestInput.vue +395 -0
- package/src/components/pgo/Timeline.vue +367 -0
- package/src/components/pgo/TimelineItem.vue +80 -0
- package/src/components/pgo/TipTapEditor.vue +315 -0
- package/src/components/pgo/Tooltip.NOTES.md +12 -0
- package/src/components/pgo/Tooltip.PROPS.md +21 -0
- package/src/components/pgo/Tooltip.vue +281 -0
- package/src/components/pgo/base/Base.vue +444 -0
- package/src/components/pgo/buttons/Chip.vue +324 -0
- package/src/components/pgo/buttons/ChipGroup.vue +224 -0
- package/src/components/pgo/buttons/Radio.vue +424 -0
- package/src/components/pgo/filters/FilterSection.vue +188 -0
- package/src/components/pgo/filters/Searchbar.vue +216 -0
- package/src/components/pgo/forms/DynamicForm.vue +45 -0
- package/src/components/pgo/forms/Form.vue +132 -0
- package/src/components/pgo/index.ts +15 -0
- package/src/components/pgo/inputs/Checkbox.vue +320 -0
- package/src/components/pgo/inputs/DatePicker.vue +395 -0
- package/src/components/pgo/inputs/FileUpload.vue +326 -0
- package/src/components/pgo/inputs/NumberField.vue +243 -0
- package/src/components/pgo/inputs/Radio.vue +162 -0
- package/src/components/pgo/inputs/RadioGroup.vue +188 -0
- package/src/components/pgo/inputs/Select.vue +535 -0
- package/src/components/pgo/inputs/TextField.vue +194 -0
- package/src/components/pgo/inputs/Textarea.vue +181 -0
- package/src/main.js +12 -0
- package/src/pgo-components/_index.js +31 -0
- package/src/pgo-components/assets/fonts/Faruma.ttf +0 -0
- package/src/pgo-components/assets/fonts/logo.png +0 -0
- package/src/pgo-components/composables/useTheme.js +10 -0
- package/src/pgo-components/directives/tooltip-directive.ts +393 -0
- package/src/pgo-components/index.js +96 -0
- package/src/pgo-components/lib/componentConfig.js +147 -0
- package/src/pgo-components/lib/core/composables/_useCalendar.ts +127 -0
- package/src/pgo-components/lib/core/composables/useDefaults.ts +15 -0
- package/src/pgo-components/lib/core/composables/useLanguageSelect.js +0 -0
- package/src/pgo-components/lib/core/composables/useRtl.ts +12 -0
- package/src/pgo-components/lib/core/defaults/createDefaults.ts +5 -0
- package/src/pgo-components/lib/core/defaults/defaults.ts +7 -0
- package/src/pgo-components/lib/core/rtl/rtl.ts +3 -0
- package/src/pgo-components/lib/core/rtl/setRtl.ts +19 -0
- package/src/pgo-components/lib/drawerState.ts +3 -0
- package/src/pgo-components/lib/i18n/defaultLables.js +71 -0
- package/src/pgo-components/lib/i18n/i18nPlugin.js +52 -0
- package/src/pgo-components/lib/i18n/useI18n.js +35 -0
- package/src/pgo-components/lib/index.ts +38 -0
- package/src/pgo-components/pages/Component.vue +7 -0
- package/src/pgo-components/pages/ComponentRenderer.vue +85 -0
- package/src/pgo-components/pages/Home.vue +130 -0
- package/src/pgo-components/pages/ListView.vue +370 -0
- package/src/pgo-components/pages/Page1.vue +296 -0
- package/src/pgo-components/pages/_Page1.vue +180 -0
- package/src/pgo-components/plugins/SnackBar.vue +251 -0
- package/src/pgo-components/plugins/SnackBarContainer.vue +53 -0
- package/src/pgo-components/plugins/SnackBarPlugin.ts +136 -0
- package/src/pgo-components/plugins/theme-plugin.js +114 -0
- package/src/pgo-components/plugins/types.ts +46 -0
- package/src/pgo-components/plugins/useSnackBar.js +11 -0
- package/src/pgo-components/plugins/useSnackBar.ts +21 -0
- package/src/pgo-components/plugins/validation-plugin.js +11 -0
- package/src/pgo-components/services/Entry.json +813 -0
- package/src/pgo-components/services/axios.js +54 -0
- package/src/pgo-components/services/data.json +90 -0
- package/src/pgo-components/services/person.json +260 -0
- package/src/pgo-components/services/toast.ts +44 -0
- package/src/pgo-components/styles/global.css +234 -0
- package/src/pgo-components/styles/reset.css +96 -0
- package/src/pgo-components/styles/tokens.css +18 -0
- package/src/pgo-components/styles/utilities/border-radius.css +57 -0
- package/src/pgo-components/styles/utilities/borders.css +85 -0
- package/src/pgo-components/styles/utilities/colors.css +38 -0
- package/src/pgo-components/styles/utilities/cursor.css +19 -0
- package/src/pgo-components/styles/utilities/display.css +78 -0
- package/src/pgo-components/styles/utilities/elevation.css +33 -0
- package/src/pgo-components/styles/utilities/flex.css +403 -0
- package/src/pgo-components/styles/utilities/float.css +41 -0
- package/src/pgo-components/styles/utilities/hover.css +9 -0
- package/src/pgo-components/styles/utilities/index.css +18 -0
- package/src/pgo-components/styles/utilities/opacity.css +27 -0
- package/src/pgo-components/styles/utilities/overflow.css +26 -0
- package/src/pgo-components/styles/utilities/palette.css +515 -0
- package/src/pgo-components/styles/utilities/position.css +14 -0
- package/src/pgo-components/styles/utilities/sizing.css +70 -0
- package/src/pgo-components/styles/utilities/spacing.css +578 -0
- package/src/pgo-components/styles/utilities/transitions.css +58 -0
- package/src/pgo-components/styles/utilities/typography.css +91 -0
- package/src/pgo-components/styles/utilities/z-index.css +11 -0
- package/src/pgo-components/tokens/index.js +337 -0
- package/src/router/index.js +88 -0
- package/src/shims-vue.d.ts +14 -0
- package/src/validations/validationRules.js +50 -0
- package/tailwind.config.js +73 -0
- package/test.php +5 -0
- package/tsconfig.json +25 -0
- package/ui +31 -0
- package/ui.pgo.mv.conf +18 -0
- package/vite.config.js +42 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="space-y-6 mx-auto max-w-4xl">
|
|
3
|
+
<h3 class="text-xl font-semibold">TextField Examples</h3>
|
|
4
|
+
|
|
5
|
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
6
|
+
<!-- Basic field with validation and clearable -->
|
|
7
|
+
<div>
|
|
8
|
+
<label class="block text-sm font-medium text-gray-700 mb-2"
|
|
9
|
+
>Basic (required, clearable, rules)</label
|
|
10
|
+
>
|
|
11
|
+
<TextField
|
|
12
|
+
v-model="modelBasic"
|
|
13
|
+
label="ފުރިހަމަ ނަން"
|
|
14
|
+
required
|
|
15
|
+
clearable
|
|
16
|
+
:rules="[
|
|
17
|
+
(v) => !!v || 'ނަމެއް ބޭނުން ވާނެ',
|
|
18
|
+
(v) => (v && v.length >= 3) || 'މަދުވެގެން 3 އަކުރު އިންނަންވާނެ',
|
|
19
|
+
]"
|
|
20
|
+
/>
|
|
21
|
+
<div class="mt-2 text-sm text-gray-500">Value: {{ modelBasic }}</div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<!-- Variant examples -->
|
|
25
|
+
<div>
|
|
26
|
+
<label class="block text-sm font-medium text-gray-700 mb-2"
|
|
27
|
+
>Variants</label
|
|
28
|
+
>
|
|
29
|
+
<div class="space-y-3">
|
|
30
|
+
<div v-for="v in variants" :key="v">
|
|
31
|
+
<TextField
|
|
32
|
+
v-model="variantValues[v]"
|
|
33
|
+
:variant="v"
|
|
34
|
+
:label="`Variant: ${v}`"
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<!-- Density examples -->
|
|
41
|
+
<div>
|
|
42
|
+
<label class="block text-sm font-medium text-gray-700 mb-2"
|
|
43
|
+
>Density</label
|
|
44
|
+
>
|
|
45
|
+
<div class="space-y-3">
|
|
46
|
+
<TextField v-model="modelDensityDefault" label="Default density" />
|
|
47
|
+
<TextField
|
|
48
|
+
v-model="modelDensityCompact"
|
|
49
|
+
label="Compact"
|
|
50
|
+
density="compact"
|
|
51
|
+
/>
|
|
52
|
+
<TextField
|
|
53
|
+
v-model="modelDensityComfortable"
|
|
54
|
+
label="Comfortable"
|
|
55
|
+
density="comfortable"
|
|
56
|
+
/>
|
|
57
|
+
<!-- <TextField label="With slot prepend">
|
|
58
|
+
<template #prepend>
|
|
59
|
+
<span class="text-blue-500">💡</span>
|
|
60
|
+
<HeroIcon name="light-bulb" />
|
|
61
|
+
</template>
|
|
62
|
+
</TextField> -->
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<!-- Icons & slots -->
|
|
67
|
+
<div>
|
|
68
|
+
<label class="block text-sm font-medium text-gray-700 mb-2"
|
|
69
|
+
>Icons & Slots</label
|
|
70
|
+
>
|
|
71
|
+
<div class="space-y-3">
|
|
72
|
+
<TextField v-model="modelIconSlot" label="With slot prepend">
|
|
73
|
+
<template #prepend>
|
|
74
|
+
<HeroIcon name="search" />
|
|
75
|
+
</template>
|
|
76
|
+
</TextField>
|
|
77
|
+
|
|
78
|
+
<TextField v-model="value" label="Custom control">
|
|
79
|
+
<template #control="{ attrs, events }">
|
|
80
|
+
<div class="flex items-center">
|
|
81
|
+
<HeroIcon name="user" />
|
|
82
|
+
<input v-bind="attrs" v-on="events" />
|
|
83
|
+
<HeroIcon name="check" />
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
</TextField>
|
|
87
|
+
|
|
88
|
+
<TextField v-model="modelAppend" label="With append" clearable>
|
|
89
|
+
<template #append>
|
|
90
|
+
<button class="ml-2 text-gray-600" @click="onAppendClick">
|
|
91
|
+
Go
|
|
92
|
+
</button>
|
|
93
|
+
asdf
|
|
94
|
+
</template>
|
|
95
|
+
</TextField>
|
|
96
|
+
|
|
97
|
+
<TextField v-model="modelInnerIcons" label="Inner icons">
|
|
98
|
+
<template #control="{ attrs, events }">
|
|
99
|
+
<div class="flex items-center gap-2">
|
|
100
|
+
<HeroIcon name="user" />
|
|
101
|
+
<input
|
|
102
|
+
class="w-full bg-transparent outline-none"
|
|
103
|
+
v-bind="attrs"
|
|
104
|
+
v-on="events"
|
|
105
|
+
/>
|
|
106
|
+
<HeroIcon name="check" />
|
|
107
|
+
</div>
|
|
108
|
+
</template>
|
|
109
|
+
</TextField>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<!-- Usage with messages and hints -->
|
|
114
|
+
<div>
|
|
115
|
+
<label class="block text-sm font-medium text-gray-700 mb-2"
|
|
116
|
+
>Hints & Messages</label
|
|
117
|
+
>
|
|
118
|
+
<div class="space-y-3">
|
|
119
|
+
<TextField
|
|
120
|
+
v-model="modelHint"
|
|
121
|
+
label="With hint"
|
|
122
|
+
hint="This is a hint"
|
|
123
|
+
persistentHint
|
|
124
|
+
/>
|
|
125
|
+
<!-- <TextField v-model="modelMessage" label="With message" hint="asdf" messages="We have a message" /> -->
|
|
126
|
+
<!-- <TextField v-model="modelError" label="With error" :error="true" errorMessages="Invalid name" /> -->
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<!-- Disabled and readonly -->
|
|
131
|
+
<div>
|
|
132
|
+
<label class="block text-sm font-medium text-gray-700 mb-2"
|
|
133
|
+
>State (disabled, readonly)</label
|
|
134
|
+
>
|
|
135
|
+
<div class="space-y-3">
|
|
136
|
+
<TextField
|
|
137
|
+
v-model="modelDisabled"
|
|
138
|
+
label="Disabled"
|
|
139
|
+
size="lg"
|
|
140
|
+
disabled
|
|
141
|
+
/>
|
|
142
|
+
<TextField v-model="modelReadonly" label="Readonly" readonly />
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</template>
|
|
148
|
+
|
|
149
|
+
<script setup>
|
|
150
|
+
import { ref, reactive } from "vue";
|
|
151
|
+
import TextField from "../pgo/inputs/TextField.vue";
|
|
152
|
+
import HeroIcon from "../pgo/HeroIcon.vue";
|
|
153
|
+
|
|
154
|
+
const modelBasic = ref("");
|
|
155
|
+
const variants = ["outlined", "filled"];
|
|
156
|
+
const variantValues = reactive({});
|
|
157
|
+
variants.forEach((v) => (variantValues[v] = ""));
|
|
158
|
+
|
|
159
|
+
const modelDensityDefault = ref("");
|
|
160
|
+
const modelDensityCompact = ref("");
|
|
161
|
+
const modelDensityComfortable = ref("");
|
|
162
|
+
|
|
163
|
+
const modelIconSlot = ref("");
|
|
164
|
+
const modelAppend = ref("");
|
|
165
|
+
const modelInnerIcons = ref("");
|
|
166
|
+
|
|
167
|
+
const modelHint = ref("");
|
|
168
|
+
const modelMessage = ref("");
|
|
169
|
+
const modelError = ref("");
|
|
170
|
+
|
|
171
|
+
const modelDisabled = ref("Disabled text");
|
|
172
|
+
const modelReadonly = ref("Readonly text");
|
|
173
|
+
|
|
174
|
+
function onAppendClick() {
|
|
175
|
+
alert("Append button clicked");
|
|
176
|
+
}
|
|
177
|
+
</script>
|
|
178
|
+
|
|
179
|
+
<style scoped>
|
|
180
|
+
/* Add small layout tweaks */
|
|
181
|
+
</style>
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="p-6 max-w-4xl mx-auto space-y-8">
|
|
3
|
+
<h2 class="text-3xl font-bold text-gray-800 mb-6">Textarea Components</h2>
|
|
4
|
+
|
|
5
|
+
<Card title="Basic Textarea">
|
|
6
|
+
<div class="space-y-6 grid grid-cols-3 gap-6 items-start">
|
|
7
|
+
<!-- Default -->
|
|
8
|
+
<Textarea
|
|
9
|
+
v-model="basicValue"
|
|
10
|
+
label="Default Textarea"
|
|
11
|
+
placeholder="Enter your text here..."
|
|
12
|
+
hint="This is a hint text"
|
|
13
|
+
/>
|
|
14
|
+
|
|
15
|
+
<!-- With character count -->
|
|
16
|
+
<Textarea
|
|
17
|
+
v-model="countValue"
|
|
18
|
+
label="With Character Count"
|
|
19
|
+
placeholder="Type something..."
|
|
20
|
+
:maxlength="200"
|
|
21
|
+
show-count
|
|
22
|
+
rows="4"
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
<!-- Required field -->
|
|
26
|
+
<Textarea
|
|
27
|
+
v-model="requiredValue"
|
|
28
|
+
label="Required Field"
|
|
29
|
+
placeholder="This field is required"
|
|
30
|
+
required
|
|
31
|
+
:error="requiredError"
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
</Card>
|
|
35
|
+
|
|
36
|
+
<Card title="Variants">
|
|
37
|
+
<div class="space-y-6 grid grid-cols-3 gap-6 items-start">
|
|
38
|
+
<!-- Default variant -->
|
|
39
|
+
<Textarea
|
|
40
|
+
v-model="variantValue"
|
|
41
|
+
label="Default Variant"
|
|
42
|
+
placeholder="Default style"
|
|
43
|
+
variant="default"
|
|
44
|
+
/>
|
|
45
|
+
|
|
46
|
+
<!-- Outlined variant -->
|
|
47
|
+
<Textarea
|
|
48
|
+
v-model="variantValue"
|
|
49
|
+
label="Outlined Variant"
|
|
50
|
+
placeholder="Outlined style"
|
|
51
|
+
variant="outlined"
|
|
52
|
+
/>
|
|
53
|
+
|
|
54
|
+
<!-- Filled variant -->
|
|
55
|
+
<Textarea
|
|
56
|
+
v-model="variantValue"
|
|
57
|
+
label="Filled Variant"
|
|
58
|
+
placeholder="Filled style"
|
|
59
|
+
variant="filled"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</Card>
|
|
63
|
+
|
|
64
|
+
<Card title="Sizes">
|
|
65
|
+
<div class="space-y-6 grid grid-cols-3 gap-6 items-start">
|
|
66
|
+
<Textarea
|
|
67
|
+
v-model="sizeValue"
|
|
68
|
+
label="Small Size"
|
|
69
|
+
placeholder="Small textarea"
|
|
70
|
+
size="sm"
|
|
71
|
+
/>
|
|
72
|
+
|
|
73
|
+
<Textarea
|
|
74
|
+
v-model="sizeValue"
|
|
75
|
+
label="Medium Size (Default)"
|
|
76
|
+
placeholder="Medium textarea"
|
|
77
|
+
size="md"
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
<Textarea
|
|
81
|
+
v-model="sizeValue"
|
|
82
|
+
label="Large Size"
|
|
83
|
+
placeholder="Large textarea"
|
|
84
|
+
size="lg"
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
</Card>
|
|
88
|
+
|
|
89
|
+
<Card title="States">
|
|
90
|
+
<div class="space-y-6 grid grid-cols-3 gap-6 items-start">
|
|
91
|
+
<!-- Disabled -->
|
|
92
|
+
<Textarea
|
|
93
|
+
v-model="stateValue"
|
|
94
|
+
label="Disabled"
|
|
95
|
+
placeholder="This is disabled"
|
|
96
|
+
disabled
|
|
97
|
+
/>
|
|
98
|
+
|
|
99
|
+
<!-- Readonly -->
|
|
100
|
+
<Textarea
|
|
101
|
+
v-model="readonlyValue"
|
|
102
|
+
label="Readonly"
|
|
103
|
+
placeholder="This is readonly"
|
|
104
|
+
readonly
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
<!-- Error state -->
|
|
108
|
+
<Textarea
|
|
109
|
+
v-model="errorValue"
|
|
110
|
+
label="With Error"
|
|
111
|
+
placeholder="This has an error"
|
|
112
|
+
error="This field is required"
|
|
113
|
+
/>
|
|
114
|
+
</div>
|
|
115
|
+
</Card>
|
|
116
|
+
|
|
117
|
+
<Card title="With Slots">
|
|
118
|
+
<div class="space-y-6 grid grid-cols-3 gap-6 items-start">
|
|
119
|
+
<!-- Custom label -->
|
|
120
|
+
<Textarea v-model="slotValue" placeholder="Custom label slot">
|
|
121
|
+
<template #label>
|
|
122
|
+
<span class="flex items-center gap-2">
|
|
123
|
+
📝 Custom Label
|
|
124
|
+
</span>
|
|
125
|
+
</template>
|
|
126
|
+
</Textarea>
|
|
127
|
+
|
|
128
|
+
<!-- Custom hint -->
|
|
129
|
+
<Textarea v-model="slotValue" label="Custom Hint" placeholder="Type here">
|
|
130
|
+
<template #hint>
|
|
131
|
+
<span class="flex items-center gap-1">
|
|
132
|
+
💡 This is a custom hint with icon
|
|
133
|
+
</span>
|
|
134
|
+
</template>
|
|
135
|
+
</Textarea>
|
|
136
|
+
</div>
|
|
137
|
+
</Card>
|
|
138
|
+
|
|
139
|
+
<!-- Preview -->
|
|
140
|
+
<Card title="Live Preview">
|
|
141
|
+
<div class="p-4 bg-muted rounded-lg">
|
|
142
|
+
<h3 class="font-semibold mb-2">Output:</h3>
|
|
143
|
+
<pre class="text-sm whitespace-pre-wrap">{{ basicValue || 'Type something above...' }}</pre>
|
|
144
|
+
</div>
|
|
145
|
+
</Card>
|
|
146
|
+
</div>
|
|
147
|
+
</template>
|
|
148
|
+
|
|
149
|
+
<script setup>
|
|
150
|
+
import { ref, watch } from 'vue'
|
|
151
|
+
import Card from '../pgo/Card.vue'
|
|
152
|
+
import Textarea from '../pgo/inputs/Textarea.vue'
|
|
153
|
+
|
|
154
|
+
const basicValue = ref('')
|
|
155
|
+
const countValue = ref('')
|
|
156
|
+
const requiredValue = ref('')
|
|
157
|
+
const requiredError = ref('')
|
|
158
|
+
const variantValue = ref('This is a sample text showing different variants.')
|
|
159
|
+
const sizeValue = ref('Sample text for different sizes.')
|
|
160
|
+
const stateValue = ref('This textarea is disabled')
|
|
161
|
+
const readonlyValue = ref('This content is readonly')
|
|
162
|
+
const errorValue = ref('')
|
|
163
|
+
const slotValue = ref('')
|
|
164
|
+
|
|
165
|
+
// Validate required field
|
|
166
|
+
watch(requiredValue, (val) => {
|
|
167
|
+
if (!val) {
|
|
168
|
+
requiredError.value = 'This field is required'
|
|
169
|
+
} else {
|
|
170
|
+
requiredError.value = ''
|
|
171
|
+
}
|
|
172
|
+
})
|
|
173
|
+
</script>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="vts-toggle">
|
|
3
|
+
<label>
|
|
4
|
+
Variant
|
|
5
|
+
<select v-model="selected" @change="apply">
|
|
6
|
+
<option v-for="o in options" :key="o.value" :value="o.value">{{ o.label }}</option>
|
|
7
|
+
</select>
|
|
8
|
+
</label>
|
|
9
|
+
|
|
10
|
+
<label style="margin-left: 1rem">
|
|
11
|
+
Theme
|
|
12
|
+
<select v-model="themeName" @change="applyName">
|
|
13
|
+
<option v-for="k in themeKeys" :key="k" :value="k">{{ k }}</option>
|
|
14
|
+
</select>
|
|
15
|
+
</label>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup>
|
|
20
|
+
import { ref, computed } from 'vue'
|
|
21
|
+
|
|
22
|
+
const options = [
|
|
23
|
+
{ label: 'System', value: 'system' },
|
|
24
|
+
{ label: 'Light', value: 'light' },
|
|
25
|
+
{ label: 'Dark', value: 'dark' }
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
// read global plugin getter (using window if dev demo) OR require app.config.globalProperties
|
|
29
|
+
const themeKeys = typeof window !== 'undefined' && window.__VTS_THEMES__ ? window.__VTS_THEMES__ : ['default', 'classic']
|
|
30
|
+
|
|
31
|
+
const selected = ref('system')
|
|
32
|
+
const themeName = ref(themeKeys[0])
|
|
33
|
+
|
|
34
|
+
function apply() {
|
|
35
|
+
if (window.__VTS_PLUGIN__) window.__VTS_PLUGIN__.setTheme(themeName.value, selected.value)
|
|
36
|
+
else console.warn('[vts] plugin not available on window')
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function applyName() {
|
|
40
|
+
if (window.__VTS_PLUGIN__) window.__VTS_PLUGIN__.setTheme(themeName.value, selected.value)
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style>
|
|
45
|
+
.vts-toggle {
|
|
46
|
+
display: flex;
|
|
47
|
+
gap: 1rem;
|
|
48
|
+
align-items: center;
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import Timeline, { type TimelineItem } from '../pgo/Timeline.vue'
|
|
3
|
+
import { ref } from 'vue'
|
|
4
|
+
|
|
5
|
+
const items = ref<TimelineItem[]>([
|
|
6
|
+
{ id: 1, title: 'Project Kickoff', time: '2025-01-05', content: 'Initial meeting and scope alignment.', status: 'primary' },
|
|
7
|
+
{ id: 2, title: 'Design Phase', time: '2025-01-20', content: 'Wireframes and visual design completed.', status: 'info' },
|
|
8
|
+
{ id: 3, title: 'Development', time: '2025-02-10', content: 'Core features implemented and tested.', status: 'success' },
|
|
9
|
+
{ id: 4, title: 'UAT', time: '2025-03-01', content: 'User acceptance tests and fixes.', status: 'warning' },
|
|
10
|
+
{ id: 5, title: 'Launch', time: '2025-03-15', content: 'Production release and monitoring.', status: 'primary' }
|
|
11
|
+
])
|
|
12
|
+
|
|
13
|
+
const dhivehiItems = ref<TimelineItem[]>([
|
|
14
|
+
{ id: 1, title: 'ފުރަތަމަ މަރުހަލާ', time: '2025-01-05', content: 'ފުރަތަމަ މަރުހަލާގެ ހިންގިކަންކަން', status: 'success' },
|
|
15
|
+
{ id: 2, title: 'ދެވަނަ މަރުހަލާ', time: '2025-01-20', content: 'ދެވަނަ މަރުހަލާގެ ހިންގިކަންކަން', status: 'success' },
|
|
16
|
+
{ id: 3, title: 'ތިންވަނަ މަރުހަލާ', time: '2025-02-10', content: 'ތިންވަނަ މަރުހަލާގެ ހިންގިކަންކަން', status: 'success' },
|
|
17
|
+
{ id: 4, title: 'ހަތަރުވަނަ މަރުހަލާ', time: '2025-03-01', content: 'ހަތަރުވަނަ މަރުހަލާގެ ހިންގިކަންކަން', status: 'success' },
|
|
18
|
+
{ id: 5, title: 'ފަސްވަނަ މަރުހަލާ', time: '2025-03-15', content: 'ފަސްވަނަ މަރުހަލާގެ ހިންގިކަންކަން', status: 'success' }
|
|
19
|
+
])
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div class="p-6 space-y-10">
|
|
24
|
+
<h2 class="text-xl font-semibold text-center">Timeline</h2>
|
|
25
|
+
|
|
26
|
+
<!-- Horizontal -->
|
|
27
|
+
<section>
|
|
28
|
+
<h3 class="mb-2 font-medium text-center">Horizontal</h3>
|
|
29
|
+
<Timeline :items="items" direction="horizontal" align="center" :elevation="1" clickable />
|
|
30
|
+
</section>
|
|
31
|
+
|
|
32
|
+
<!-- Vertical, both sides (alternate) -->
|
|
33
|
+
<div class="mb-20">
|
|
34
|
+
<h3 class="mb-2 font-medium text-center">Vertical (Both sides, alternate)</h3>
|
|
35
|
+
<Timeline :items="items" direction="vertical" side="both" :alternate="true" :elevation="0" clickable />
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<!-- Custom Card Slot -->
|
|
39
|
+
<section>
|
|
40
|
+
<h3 class="mb-2 font-medium text-center">Custom Card Slot</h3>
|
|
41
|
+
<Timeline :items="items" direction="vertical" side="both" :alternate="true" :elevation="1">
|
|
42
|
+
<template #default="{ item, index }">
|
|
43
|
+
<div>
|
|
44
|
+
<div class="timeline-title">#{{ index + 1 }} — {{ item.title }}</div>
|
|
45
|
+
<div v-if="item.time" class="timeline-time">{{ item.time }}</div>
|
|
46
|
+
<div class="timeline-content">Custom slot content: {{ item.content }}</div>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
</Timeline>
|
|
50
|
+
</section>
|
|
51
|
+
|
|
52
|
+
<!-- Vertical, one side (LTR/RTL aware) -->
|
|
53
|
+
<section>
|
|
54
|
+
<h3 class="mb-2 font-medium">Vertical (One side)</h3>
|
|
55
|
+
<Timeline :items="items" direction="vertical" side="one" :elevation="3" clickable condensed />
|
|
56
|
+
</section>
|
|
57
|
+
|
|
58
|
+
<!-- Vertical, one side (LTR/RTL aware) -->
|
|
59
|
+
<section dir="rtl">
|
|
60
|
+
<h3 class="mb-2 font-medium">Vertical (One side)</h3>
|
|
61
|
+
<Timeline class="faruma" :items="dhivehiItems" direction="vertical" side="one" :elevation="1" clickable condensed />
|
|
62
|
+
</section>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<style scoped></style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<TipTapEditor v-model="editorContent" :maximumLength="500" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import TipTapEditor from '../pgo/TipTapEditor.vue'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
components: {
|
|
12
|
+
TipTapEditor
|
|
13
|
+
},
|
|
14
|
+
data() {
|
|
15
|
+
return {
|
|
16
|
+
editorContent: ''
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="grid grid-cols-4 justify-center gap-20">
|
|
3
|
+
<!-- <Tooltip v-model="open" placement="bottom" :offset="{ x: 0, y: 8 }" :arrow="true">
|
|
4
|
+
<template #activator="{ props }">
|
|
5
|
+
<Button @mouseenter="props.open()" @mouseleave="props.close()">Hover me</Button>
|
|
6
|
+
</template>
|
|
7
|
+
Hovered
|
|
8
|
+
</Tooltip>
|
|
9
|
+
|
|
10
|
+
<Tooltip placement="right" :open-on-hover="true" :arrow="true">
|
|
11
|
+
<template #activator="{ props }">
|
|
12
|
+
<Button @click="props.open()">Hover again</Button>
|
|
13
|
+
</template>
|
|
14
|
+
Hovered
|
|
15
|
+
</Tooltip>
|
|
16
|
+
|
|
17
|
+
<Tooltip placement="top" :open-on-hover="true" :arrow="true">
|
|
18
|
+
<template #activator="{ props }">
|
|
19
|
+
<Button class="faruma" @click="props.open()">ބަޓަން</Button>
|
|
20
|
+
</template>
|
|
21
|
+
<p class="faruma">މިއީ އެހީތެރިކަމެއް</p>
|
|
22
|
+
</Tooltip>
|
|
23
|
+
|
|
24
|
+
<Tooltip placement="left" :open-on-hover="true" :arrow="true">
|
|
25
|
+
<template #activator="{ props }">
|
|
26
|
+
<Button class="faruma" @click="props.open()">ފިތް</Button>
|
|
27
|
+
</template>
|
|
28
|
+
<p class="faruma">މިއީވެސް އެހީތެރިކަމެއް</p>
|
|
29
|
+
</Tooltip> -->
|
|
30
|
+
|
|
31
|
+
<!-- Directive-based tooltips -->
|
|
32
|
+
|
|
33
|
+
<!-- Simple text tooltip -->
|
|
34
|
+
<Button v-tooltip.bottom="{en: 'Bottom', dv: 'ދެން'}">Bottom</Button>
|
|
35
|
+
|
|
36
|
+
<Button v-tooltip.top="'Top'">Top</Button>
|
|
37
|
+
|
|
38
|
+
<!-- Placement and offset options -->
|
|
39
|
+
<Button v-tooltip.left="'Left side'">Left</Button>
|
|
40
|
+
|
|
41
|
+
<!-- RTL text demonstrates left/right flipping -->
|
|
42
|
+
<Button v-tooltip.right="{en: 'Right', dv: 'ރައިޓް'}"></Button>
|
|
43
|
+
<div v-tooltip="{en: 'Hello', dv: 'ހެލޯ'}">Hover me</div>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script setup lang="ts">
|
|
48
|
+
import { ref } from 'vue'
|
|
49
|
+
import Tooltip from '../pgo/Tooltip.vue'
|
|
50
|
+
import Button from '../pgo/Button.vue'
|
|
51
|
+
|
|
52
|
+
const open = ref(false)
|
|
53
|
+
</script>
|