@myelophone/nuxt 0.18.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/.devcontainer/Dockerfile +7 -0
- package/.devcontainer/devcontainer.json +21 -0
- package/.editorconfig +43 -0
- package/.github/workflows/package.yml +73 -0
- package/.nuxtignore +6 -0
- package/.releaserc.js +132 -0
- package/.yarn/releases/yarn-4.18.0.cjs +1000 -0
- package/.yarnrc.yml +8 -0
- package/CHANGELOG.md +141 -0
- package/LICENSE +77 -0
- package/README.md +3004 -0
- package/app/app.vue +455 -0
- package/app/assets/css/animation.css +81 -0
- package/app/assets/css/backgrounds.css +57 -0
- package/app/assets/css/base.css +182 -0
- package/app/assets/css/index.css +9 -0
- package/app/assets/css/links.css +12 -0
- package/app/assets/css/multimedia.css +102 -0
- package/app/assets/css/preloader.css +68 -0
- package/app/assets/css/print.css +40 -0
- package/app/assets/css/tailwind.css +20 -0
- package/app/assets/css/theme.css +29 -0
- package/app/components/consent/GoogleMap.vue +59 -0
- package/app/components/consent/Youtube.vue +27 -0
- package/app/components/cookie/Banner.vue +70 -0
- package/app/components/cookie/ConsentWrapper.vue +71 -0
- package/app/components/cookie/PrivacyPolicy.vue +179 -0
- package/app/components/cookie/SettingsModal.vue +387 -0
- package/app/components/grid/Col.vue +262 -0
- package/app/components/grid/Container.vue +236 -0
- package/app/components/grid/Row.vue +248 -0
- package/app/components/grid/Stack.vue +233 -0
- package/app/components/myelophone/Copyright.vue +5 -0
- package/app/components/myelophone/Welcome.vue +107 -0
- package/app/components/page/FullscreenPreloader.vue +177 -0
- package/app/components/page/Preloader.vue +18 -0
- package/app/components/page/ReadyLocalized.vue +19 -0
- package/app/components/ready/.gitkeep +0 -0
- package/app/components/safe/Email.vue +52 -0
- package/app/components/safe/ImgWithLoader.vue +180 -0
- package/app/components/safe/NuxtImg.vue +25 -0
- package/app/components/safe/NuxtPicture.vue +29 -0
- package/app/components/section/.gitkeep +0 -0
- package/app/components/seo/BrandInfo.vue +76 -0
- package/app/components/seo/ContentNoIndex.vue +35 -0
- package/app/components/seo/NoIndex.vue +22 -0
- package/app/components/seo/OrgInfo.vue +130 -0
- package/app/components/seo/ProfileInfo.vue +137 -0
- package/app/components/ui/Accordion.vue +163 -0
- package/app/components/ui/Alert.vue +179 -0
- package/app/components/ui/Avatar.vue +88 -0
- package/app/components/ui/Badge.vue +150 -0
- package/app/components/ui/Banner.vue +133 -0
- package/app/components/ui/Button.vue +175 -0
- package/app/components/ui/Card.vue +66 -0
- package/app/components/ui/Checkbox.vue +134 -0
- package/app/components/ui/Chip.vue +136 -0
- package/app/components/ui/CommandPalette.vue +434 -0
- package/app/components/ui/Console.vue +583 -0
- package/app/components/ui/CursorCreative.vue +148 -0
- package/app/components/ui/FeatureAccordion.vue +165 -0
- package/app/components/ui/FileUpload.vue +705 -0
- package/app/components/ui/GeoDependent.vue +72 -0
- package/app/components/ui/Heading.vue +51 -0
- package/app/components/ui/Icon.vue +42 -0
- package/app/components/ui/Icon8.vue +39 -0
- package/app/components/ui/Input.vue +88 -0
- package/app/components/ui/LangLink.vue +34 -0
- package/app/components/ui/LangVisible.vue +33 -0
- package/app/components/ui/LanguageSelect.vue +202 -0
- package/app/components/ui/LightBox.vue +155 -0
- package/app/components/ui/LocalTime.vue +170 -0
- package/app/components/ui/Modal.vue +161 -0
- package/app/components/ui/Popup.vue +200 -0
- package/app/components/ui/PostContent.server.vue +23 -0
- package/app/components/ui/ProtectedEmail.vue +52 -0
- package/app/components/ui/RelativeTime.vue +141 -0
- package/app/components/ui/ScheduledContent.vue +150 -0
- package/app/components/ui/ScrollToTop.client.vue +48 -0
- package/app/components/ui/SegmentedControl.vue +148 -0
- package/app/components/ui/SiteSearch.vue +1191 -0
- package/app/components/ui/Skeleton.vue +91 -0
- package/app/components/ui/SmartContrast.vue +74 -0
- package/app/components/ui/SnapContainer.vue +222 -0
- package/app/components/ui/SnapSection.vue +294 -0
- package/app/components/ui/SonnerStyle.vue +7 -0
- package/app/components/ui/SplitSection.vue +99 -0
- package/app/components/ui/Steps.vue +858 -0
- package/app/components/ui/StickyWrapper.vue +46 -0
- package/app/components/ui/Table.vue +251 -0
- package/app/components/ui/Tabs.vue +451 -0
- package/app/components/ui/TextColumn.vue +36 -0
- package/app/components/ui/Textarea.vue +251 -0
- package/app/components/ui/Toggler.vue +40 -0
- package/app/components/ui/Tooltip.vue +524 -0
- package/app/components/ui/TruncateText.vue +105 -0
- package/app/components/ui/ViewportSpacer.vue +72 -0
- package/app/components/view/AnimatedCounter.vue +121 -0
- package/app/components/view/AnnouncementBar.vue +104 -0
- package/app/components/view/AvatarGroup.vue +104 -0
- package/app/components/view/Breadcrumbs.vue +97 -0
- package/app/components/view/ContentWithToc.vue +152 -0
- package/app/components/view/Copyright.vue +68 -0
- package/app/components/view/CountdownTimer.vue +184 -0
- package/app/components/view/CreativeCTA.vue +143 -0
- package/app/components/view/CurrencySelect.vue +254 -0
- package/app/components/view/FeatureBoxGrid.vue +142 -0
- package/app/components/view/HorizontalMenu.vue +97 -0
- package/app/components/view/ImageCompare.vue +141 -0
- package/app/components/view/ImgSlider.vue +333 -0
- package/app/components/view/InfiniteMarquee.vue +147 -0
- package/app/components/view/InfoBar.vue +86 -0
- package/app/components/view/LogoGrid.vue +106 -0
- package/app/components/view/LogoSlider.vue +83 -0
- package/app/components/view/NotFound.vue +81 -0
- package/app/components/view/PartialBackground.vue +313 -0
- package/app/components/view/QuoteBig.vue +111 -0
- package/app/components/view/ResponsiveMenu.vue +219 -0
- package/app/components/view/ReviewsSlider.vue +230 -0
- package/app/components/view/SocialBar.vue +78 -0
- package/app/components/view/StickyHeadingContent.vue +158 -0
- package/app/components/view/TallyForm.vue +295 -0
- package/app/components/view/WarningOutdated.vue +113 -0
- package/app/composables/useApi.ts +88 -0
- package/app/composables/useAppSeo.ts +78 -0
- package/app/composables/useBreadcrumbs.ts +106 -0
- package/app/composables/useChangeUrl.ts +73 -0
- package/app/composables/useCommand.ts +28 -0
- package/app/composables/useCookieControl.ts +111 -0
- package/app/composables/useCookieModal.ts +9 -0
- package/app/composables/useDevice.ts +109 -0
- package/app/composables/useGeoFetch.ts +139 -0
- package/app/composables/useLoadScript.ts +36 -0
- package/app/composables/useModalState.ts +37 -0
- package/app/composables/useMultiLang.ts +278 -0
- package/app/composables/useNetwork.ts +49 -0
- package/app/composables/useNuxtVersion.ts +5 -0
- package/app/composables/usePiniaStore.ts +5 -0
- package/app/composables/usePopupControl.ts +57 -0
- package/app/composables/useQuery.ts +307 -0
- package/app/composables/useReadyPage.ts +182 -0
- package/app/composables/useSafeList.ts +90 -0
- package/app/composables/useScriptLoader.ts +221 -0
- package/app/composables/useSiteSearch.ts +32 -0
- package/app/composables/useSnapScroll.ts +24 -0
- package/app/composables/useStatic.ts +5 -0
- package/app/composables/useStorage.ts +252 -0
- package/app/composables/useStoreBroadcast.ts +146 -0
- package/app/composables/useThemeSync.ts +81 -0
- package/app/constants/layout.ts +109 -0
- package/app/constants/predefinedCookieScripts.ts +1222 -0
- package/app/constants/ui-events.ts +1 -0
- package/app/error.vue +169 -0
- package/app/layouts/default-blog.vue +5 -0
- package/app/layouts/default.vue +3 -0
- package/app/locales/en/commands.json +5 -0
- package/app/locales/en/cookies.json +182 -0
- package/app/locales/en/error.json +4 -0
- package/app/locales/en/interface.json +33 -0
- package/app/locales/en/myelophone.json +8 -0
- package/app/locales/en/outdated.json +5 -0
- package/app/locales/en/times.json +18 -0
- package/app/locales/pl/commands.json +5 -0
- package/app/locales/pl/cookies.json +182 -0
- package/app/locales/pl/error.json +4 -0
- package/app/locales/pl/interface.json +33 -0
- package/app/locales/pl/myelophone.json +8 -0
- package/app/locales/pl/outdated.json +5 -0
- package/app/locales/pl/times.json +18 -0
- package/app/locales/ru/commands.json +5 -0
- package/app/locales/ru/cookies.json +182 -0
- package/app/locales/ru/error.json +4 -0
- package/app/locales/ru/interface.json +33 -0
- package/app/locales/ru/myelophone.json +8 -0
- package/app/locales/ru/outdated.json +5 -0
- package/app/locales/ru/times.json +18 -0
- package/app/middleware/blog-layout.ts +28 -0
- package/app/middleware/i18n.global.ts +17 -0
- package/app/middleware/not-found-status.ts +11 -0
- package/app/modules/default-blog/index.ts +39 -0
- package/app/modules/default-blog/posts.ts +80 -0
- package/app/modules/default-sitemap/index.ts +116 -0
- package/app/modules/default-sitemap/runtime/sitemap.get.ts +42 -0
- package/app/modules/fullscreen-preloader/module.ts +43 -0
- package/app/modules/htaccess/.htaccess +38 -0
- package/app/modules/htaccess/index.ts +23 -0
- package/app/modules/i18n-shaker.mjs +221 -0
- package/app/modules/multi18n/module.ts +71 -0
- package/app/modules/myelophone-config/module.ts +241 -0
- package/app/pages/[...all].vue +9 -0
- package/app/pages/index.vue +3 -0
- package/app/pages/post/[...slug].vue +30 -0
- package/app/plugins/bfcache-refresh.client.ts +9 -0
- package/app/plugins/canonical.ts +30 -0
- package/app/plugins/csp-nonce.server.ts +41 -0
- package/app/plugins/multi18n.client.ts +21 -0
- package/app/plugins/multi18n.server.ts +15 -0
- package/app/plugins/nuxt-version.client.ts +4 -0
- package/app/plugins/restore.client.ts +21 -0
- package/app/plugins/reveal.ts +89 -0
- package/app/plugins/url-helper.client.ts +66 -0
- package/app/server/api/exchange-rates.get.ts +216 -0
- package/app/server/api/healthz.ts +1 -0
- package/app/server/api/logout.post.ts +6 -0
- package/app/server/middleware/normalize-url.ts +14 -0
- package/app/server/middleware/security-headers.ts +147 -0
- package/app/server/middleware/url-helper.ts +43 -0
- package/app/server/plugins/clean-html-spaces.ts +15 -0
- package/app/server/plugins/clean-styles.ts +94 -0
- package/app/server/plugins/compression.ts +122 -0
- package/app/server/plugins/css-preload.ts +26 -0
- package/app/server/plugins/early-hints.ts +31 -0
- package/app/server/plugins/force-noindex.ts +43 -0
- package/app/server/plugins/html-one-line.ts +17 -0
- package/app/server/plugins/inline-style.ts +7 -0
- package/app/server/routes/healthz.get.ts +1 -0
- package/app/server/tsconfig.json +3 -0
- package/app/stores/cart.ts +945 -0
- package/app/stores/commands.ts +43 -0
- package/app/stores/device.ts +156 -0
- package/app/stores/querySync.ts +5 -0
- package/app/stores/settings.ts +145 -0
- package/app/stores/user.ts +607 -0
- package/app/types/cookie.ts +89 -0
- package/app/types/myelophone.d.ts +87 -0
- package/app/types/site-search.ts +110 -0
- package/app/utils/asyncRefresh.ts +4 -0
- package/app/utils/blog.server.ts +142 -0
- package/app/utils/jsonLd.ts +56 -0
- package/app/utils/myelophoneConfig.ts +4 -0
- package/app/utils/sortBy.ts +18 -0
- package/app/utils/transliterate.ts +75 -0
- package/app/utils/ytVideo.ts +37 -0
- package/app/workers/site-search.worker.ts +661 -0
- package/biome.json +94 -0
- package/commitlint.config.js +3 -0
- package/nuxt.config.ts +539 -0
- package/package.json +101 -0
- package/playground/content/.gitkeep +0 -0
- package/playground/locales/.gitkeep +0 -0
- package/playground/myelophone.dev.ts +45 -0
- package/playground/nuxt.config.ts +105 -0
- package/playground/package.json +5 -0
- package/playground/pages/.gitkeep +0 -0
- package/playground/tsconfig.json +3 -0
- package/playwright.config.ts +23 -0
- package/public/browsers/chrome.svg +77 -0
- package/public/browsers/edge.svg +98 -0
- package/public/browsers/firefox.svg +300 -0
- package/public/favicon.ico +0 -0
- package/public/myelophone_eng.png +0 -0
- package/public/myelophone_eng_white.png +0 -0
- package/spa-loading-template.html +72 -0
- package/tests/home.spec.ts +9 -0
- package/tests/utils.ts +23 -0
- package/tsconfig.json +16 -0
- package/vite/plugins/clean-css.ts +190 -0
- package/vite/plugins/postcss-add-viewportunits.ts +33 -0
- package/vite/plugins/postcss-viewport-fallback.ts +49 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<label
|
|
4
|
+
v-if="label"
|
|
5
|
+
:for="id"
|
|
6
|
+
class="block text-sm font-medium mb-1"
|
|
7
|
+
:style="{ color: 'var(--ui-text)' }"
|
|
8
|
+
>
|
|
9
|
+
{{ label }}
|
|
10
|
+
</label>
|
|
11
|
+
|
|
12
|
+
<div
|
|
13
|
+
v-if="buttonsPosition === 'inside'"
|
|
14
|
+
class="relative rounded-md border transition-all peer"
|
|
15
|
+
:class="containerClasses"
|
|
16
|
+
@focusin="isFocused = true"
|
|
17
|
+
@focusout="isFocused = false"
|
|
18
|
+
>
|
|
19
|
+
<textarea
|
|
20
|
+
:id="id"
|
|
21
|
+
ref="textarea"
|
|
22
|
+
v-model="internalValue"
|
|
23
|
+
:rows="rows"
|
|
24
|
+
:placeholder="placeholder"
|
|
25
|
+
:class="insideTextareaClasses"
|
|
26
|
+
v-bind="$attrs"
|
|
27
|
+
@input="$emit('update:modelValue', $event.target.value)"
|
|
28
|
+
/>
|
|
29
|
+
|
|
30
|
+
<div class="flex items-center justify-end gap-2 p-1.5">
|
|
31
|
+
<slot name="buttons">
|
|
32
|
+
<button
|
|
33
|
+
v-if="showClear"
|
|
34
|
+
type="button"
|
|
35
|
+
:class="clearButtonClasses"
|
|
36
|
+
@click="clear"
|
|
37
|
+
>
|
|
38
|
+
{{ clearText }}
|
|
39
|
+
</button>
|
|
40
|
+
|
|
41
|
+
<button
|
|
42
|
+
v-if="showSave"
|
|
43
|
+
type="button"
|
|
44
|
+
:class="saveButtonClasses"
|
|
45
|
+
@click="$emit('save', internalValue)"
|
|
46
|
+
>
|
|
47
|
+
{{ saveText }}
|
|
48
|
+
</button>
|
|
49
|
+
</slot>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div v-else>
|
|
54
|
+
<textarea
|
|
55
|
+
:id="id"
|
|
56
|
+
ref="textarea"
|
|
57
|
+
v-model="internalValue"
|
|
58
|
+
:rows="rows"
|
|
59
|
+
:placeholder="placeholder"
|
|
60
|
+
:class="outsideTextareaClasses"
|
|
61
|
+
v-bind="$attrs"
|
|
62
|
+
@input="$emit('update:modelValue', $event.target.value)"
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
<div
|
|
66
|
+
v-if="buttonsPosition === 'outside' && hasButtons"
|
|
67
|
+
class="mt-2 flex items-center justify-end gap-2"
|
|
68
|
+
>
|
|
69
|
+
<slot name="buttons">
|
|
70
|
+
<button
|
|
71
|
+
v-if="showClear"
|
|
72
|
+
type="button"
|
|
73
|
+
:class="clearButtonClasses"
|
|
74
|
+
@click="clear"
|
|
75
|
+
>
|
|
76
|
+
{{ clearText }}
|
|
77
|
+
</button>
|
|
78
|
+
|
|
79
|
+
<button
|
|
80
|
+
v-if="showSave"
|
|
81
|
+
type="button"
|
|
82
|
+
:class="saveButtonClasses"
|
|
83
|
+
@click="$emit('save', internalValue)"
|
|
84
|
+
>
|
|
85
|
+
{{ saveText }}
|
|
86
|
+
</button>
|
|
87
|
+
</slot>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
|
92
|
+
|
|
93
|
+
<script setup>
|
|
94
|
+
const props = defineProps({
|
|
95
|
+
modelValue: { type: String, default: "" },
|
|
96
|
+
label: { type: String, default: "" },
|
|
97
|
+
id: { type: String, required: true },
|
|
98
|
+
rows: { type: [Number, String], default: 4 },
|
|
99
|
+
placeholder: { type: String, default: "" },
|
|
100
|
+
error: { type: Boolean, default: false },
|
|
101
|
+
buttonsPosition: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: "none",
|
|
104
|
+
validator: (v) => ["none", "inside", "outside"].includes(v),
|
|
105
|
+
},
|
|
106
|
+
showClear: { type: Boolean, default: true },
|
|
107
|
+
showSave: { type: Boolean, default: true },
|
|
108
|
+
clearText: { type: String, default: "Clear" },
|
|
109
|
+
saveText: { type: String, default: "Save" },
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const emit = defineEmits(["update:modelValue", "save", "clear"]);
|
|
113
|
+
|
|
114
|
+
const internalValue = ref(props.modelValue);
|
|
115
|
+
const textarea = ref(null);
|
|
116
|
+
const isFocused = ref(false);
|
|
117
|
+
|
|
118
|
+
watch(
|
|
119
|
+
() => props.modelValue,
|
|
120
|
+
(val) => {
|
|
121
|
+
internalValue.value = val;
|
|
122
|
+
},
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
const clear = () => {
|
|
126
|
+
internalValue.value = "";
|
|
127
|
+
emit("update:modelValue", "");
|
|
128
|
+
emit("clear");
|
|
129
|
+
nextTick(() => textarea.value?.focus());
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const outsideTextareaClasses = computed(() => {
|
|
133
|
+
const base = [
|
|
134
|
+
"peer",
|
|
135
|
+
"w-full",
|
|
136
|
+
"rounded-md",
|
|
137
|
+
"border",
|
|
138
|
+
"bg-[var(--ui-bg)]",
|
|
139
|
+
"text-[var(--ui-text)]",
|
|
140
|
+
"transition-all",
|
|
141
|
+
"sm:text-sm",
|
|
142
|
+
"disabled:opacity-60",
|
|
143
|
+
"disabled:cursor-not-allowed",
|
|
144
|
+
"py-2.5",
|
|
145
|
+
"px-3",
|
|
146
|
+
"pb-2.5",
|
|
147
|
+
"focus:outline-none",
|
|
148
|
+
"focus:ring-1",
|
|
149
|
+
"focus:ring-blue-500",
|
|
150
|
+
"dark:focus:ring-blue-400",
|
|
151
|
+
"focus:border-blue-500",
|
|
152
|
+
"dark:focus:border-blue-400",
|
|
153
|
+
];
|
|
154
|
+
|
|
155
|
+
if (props.error) {
|
|
156
|
+
base.push(
|
|
157
|
+
"border-red-500",
|
|
158
|
+
"focus-within:border-blue-500",
|
|
159
|
+
"dark:focus-within:border-blue-400",
|
|
160
|
+
"focus-within:ring-1",
|
|
161
|
+
"focus-within:ring-blue-500",
|
|
162
|
+
"dark:focus-within:ring-blue-400",
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return base;
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
const insideTextareaClasses = computed(() => [
|
|
170
|
+
"w-full",
|
|
171
|
+
"resize-none",
|
|
172
|
+
"bg-transparent",
|
|
173
|
+
"text-[var(--ui-text)]",
|
|
174
|
+
"sm:text-sm",
|
|
175
|
+
"py-2.5",
|
|
176
|
+
"px-3",
|
|
177
|
+
"pb-2.5",
|
|
178
|
+
"pr-36",
|
|
179
|
+
"border-0",
|
|
180
|
+
"outline-none",
|
|
181
|
+
"ring-0",
|
|
182
|
+
"focus:outline-none",
|
|
183
|
+
"focus:ring-0",
|
|
184
|
+
"focus:border-0",
|
|
185
|
+
"transition-all",
|
|
186
|
+
]);
|
|
187
|
+
|
|
188
|
+
const containerClasses = computed(() => {
|
|
189
|
+
const base = ["transition-all", "peer"];
|
|
190
|
+
|
|
191
|
+
if (props.error) {
|
|
192
|
+
base.push(
|
|
193
|
+
"border-red-500",
|
|
194
|
+
"focus-within:border-red-500",
|
|
195
|
+
"focus-within:ring-1",
|
|
196
|
+
"focus-within:ring-red-500",
|
|
197
|
+
);
|
|
198
|
+
} else {
|
|
199
|
+
base.push(
|
|
200
|
+
"focus-within:border-blue-500",
|
|
201
|
+
"dark:focus-within:border-blue-400",
|
|
202
|
+
"focus-within:ring-1",
|
|
203
|
+
"focus-within:ring-blue-500",
|
|
204
|
+
"dark:focus-within:ring-blue-400",
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return base;
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
const hasButtons = computed(() => {
|
|
212
|
+
return props.showClear || props.showSave || !!$slots.buttons;
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
const clearButtonClasses = computed(() => [
|
|
216
|
+
"rounded-md",
|
|
217
|
+
"border",
|
|
218
|
+
"border-transparent",
|
|
219
|
+
"px-3",
|
|
220
|
+
"py-1.5",
|
|
221
|
+
"text-sm",
|
|
222
|
+
"font-medium",
|
|
223
|
+
"text-[var(--ui-text)]",
|
|
224
|
+
"transition-opacity",
|
|
225
|
+
"hover:opacity-80",
|
|
226
|
+
"focus:outline-none",
|
|
227
|
+
]);
|
|
228
|
+
|
|
229
|
+
const saveButtonClasses = computed(() => [
|
|
230
|
+
"rounded-md",
|
|
231
|
+
"border",
|
|
232
|
+
"border-gray-300",
|
|
233
|
+
"dark:border-gray-600",
|
|
234
|
+
"px-3",
|
|
235
|
+
"py-1.5",
|
|
236
|
+
"text-sm",
|
|
237
|
+
"font-medium",
|
|
238
|
+
"shadow-sm",
|
|
239
|
+
"text-[var(--ui-text)]",
|
|
240
|
+
"bg-[var(--ui-bg)]",
|
|
241
|
+
"transition-opacity",
|
|
242
|
+
"hover:opacity-90",
|
|
243
|
+
"focus:outline-none",
|
|
244
|
+
]);
|
|
245
|
+
</script>
|
|
246
|
+
|
|
247
|
+
<style scoped>
|
|
248
|
+
textarea::placeholder {
|
|
249
|
+
color: color-mix(in srgb, var(--ui-text), transparent 60%);
|
|
250
|
+
}
|
|
251
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
modelValue: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const props = defineProps<Props>();
|
|
9
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
10
|
+
|
|
11
|
+
const toggle = () => {
|
|
12
|
+
if (props.disabled) return;
|
|
13
|
+
emit("update:modelValue", !props.modelValue);
|
|
14
|
+
};
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<button
|
|
19
|
+
type="button"
|
|
20
|
+
role="switch"
|
|
21
|
+
:aria-checked="modelValue"
|
|
22
|
+
:disabled="disabled"
|
|
23
|
+
@click="toggle"
|
|
24
|
+
class="group relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-neutral-400 focus:ring-offset-2"
|
|
25
|
+
:class="[
|
|
26
|
+
modelValue
|
|
27
|
+
? 'bg-(--ui-text)'
|
|
28
|
+
: 'bg-neutral-200 dark:bg-neutral-700',
|
|
29
|
+
disabled ? 'cursor-not-allowed opacity-50' : '',
|
|
30
|
+
]"
|
|
31
|
+
>
|
|
32
|
+
<span class="sr-only">{{ label || "Переключить" }}</span>
|
|
33
|
+
|
|
34
|
+
<span
|
|
35
|
+
aria-hidden="true"
|
|
36
|
+
class="pointer-events-none inline-block h-5 w-5 transform rounded-full shadow ring-0 transition duration-200 ease-in-out bg-(--ui-bg)"
|
|
37
|
+
:class="[modelValue ? 'translate-x-5' : 'translate-x-0']"
|
|
38
|
+
/>
|
|
39
|
+
</button>
|
|
40
|
+
</template>
|