@poveste/controls 0.2.1 → 0.3.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/dist/index.es.css +2 -1
- package/dist/index.es.js +13222 -16350
- package/dist/style-standalone.css +877 -964
- package/package.json +11 -11
- package/postcss.config.cjs +3 -4
- package/src/components/HstCopyIcon.vue +1 -1
- package/src/components/HstWrapper.vue +4 -4
- package/src/components/button/HstButton.story.vue +1 -1
- package/src/components/button/HstButton.vue +7 -7
- package/src/components/button/HstButtonGroup.vue +7 -7
- package/src/components/checkbox/HstCheckbox.vue +1 -1
- package/src/components/checkbox/HstCheckboxList.vue +8 -8
- package/src/components/checkbox/HstSimpleCheckbox.vue +9 -9
- package/src/components/checkbox/__snapshots__/HstCheckbox.spec.ts.snap +2 -2
- package/src/components/colorselect/HstColorSelect.vue +3 -3
- package/src/components/design-tokens/HstColorShades.story.vue +3 -3
- package/src/components/design-tokens/HstColorShades.vue +9 -9
- package/src/components/design-tokens/HstTokenGrid.story.vue +1 -1
- package/src/components/design-tokens/HstTokenGrid.vue +9 -9
- package/src/components/design-tokens/HstTokenList.story.vue +2 -2
- package/src/components/design-tokens/HstTokenList.vue +8 -8
- package/src/components/json/HstJson.vue +3 -3
- package/src/components/number/HstNumber.vue +4 -4
- package/src/components/radio/HstRadio.vue +16 -16
- package/src/components/select/CustomSelect.vue +25 -18
- package/src/components/select/HstSelect.story.vue +4 -4
- package/src/components/select/HstSelect.vue +1 -1
- package/src/components/slider/HstSlider.vue +15 -12
- package/src/components/text/HstText.vue +2 -2
- package/src/components/textarea/HstTextarea.vue +2 -2
- package/src/style/main.css +52 -4
- package/tsconfig.json +1 -1
- package/tailwind.config.cjs +0 -13
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poveste/controls",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"description": "Prebuilt controls components",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Sorin Gitlan"
|
|
@@ -38,31 +38,31 @@
|
|
|
38
38
|
"@codemirror/state": "^6.4.1",
|
|
39
39
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
40
40
|
"@codemirror/view": "^6.35.0",
|
|
41
|
-
"@poveste/shared": "^0.
|
|
42
|
-
"@poveste/vendors": "^0.
|
|
41
|
+
"@poveste/shared": "^0.3.0",
|
|
42
|
+
"@poveste/vendors": "^0.3.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
+
"@tailwindcss/cli": "^4.3.3",
|
|
46
|
+
"@tailwindcss/postcss": "^4.3.3",
|
|
45
47
|
"@types/node": "^22.10.1",
|
|
46
48
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
47
49
|
"@vue/runtime-dom": "^3.5.26",
|
|
48
50
|
"@vue/test-utils": "^2.4.6",
|
|
49
|
-
"@vueuse/core": "^
|
|
50
|
-
"autoprefixer": "^10.4.20",
|
|
51
|
+
"@vueuse/core": "^14.4.0",
|
|
51
52
|
"concurrently": "^9.1.0",
|
|
52
53
|
"floating-vue": "5.2.2",
|
|
53
|
-
"jsdom": "^
|
|
54
|
+
"jsdom": "^30.0.1",
|
|
54
55
|
"postcss": "^8.4.49",
|
|
55
|
-
"
|
|
56
|
-
"tailwindcss": "^3.4.16",
|
|
56
|
+
"tailwindcss": "^4.3.3",
|
|
57
57
|
"typescript": "5.6.3",
|
|
58
|
-
"vite": "^
|
|
59
|
-
"vitest": "4.
|
|
58
|
+
"vite": "^8.2.0",
|
|
59
|
+
"vitest": "^4.1.10",
|
|
60
60
|
"vue": "^3.5.26",
|
|
61
61
|
"vue-tsc": "^2.1.10"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "rimraf dist && pnpm run build:css && vite build && pnpm run build:types",
|
|
65
|
-
"build:css": "tailwindcss -i src/style/main.css -o ./dist/style-standalone.css
|
|
65
|
+
"build:css": "tailwindcss -i src/style/main.css -o ./dist/style-standalone.css",
|
|
66
66
|
"build:types": "vue-tsc --declaration --emitDeclarationOnly",
|
|
67
67
|
"watch": "concurrently \"vite build --watch\" \"pnpm run build:types --watch\"",
|
|
68
68
|
"watch:full": "concurrently \"vite build --watch\" \"pnpm run build:css --watch\" \"pnpm run build:types --watch\"",
|
package/postcss.config.cjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
plugins: [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
require('tailwindcss')
|
|
6
|
-
require('autoprefixer'),
|
|
3
|
+
// Processes Tailwind in both the CSS entry and Vue SFC <style> blocks
|
|
4
|
+
// (@apply/@reference). @tailwindcss/vite misses SFC styles in lib builds.
|
|
5
|
+
require('@tailwindcss/postcss'),
|
|
7
6
|
],
|
|
8
7
|
}
|
|
@@ -32,7 +32,7 @@ async function action() {
|
|
|
32
32
|
delay: 0,
|
|
33
33
|
}"
|
|
34
34
|
icon="carbon:copy-file"
|
|
35
|
-
class="
|
|
35
|
+
class="w-4 h-4 opacity-50 hover:opacity-100 hover:text-primary-500 cursor-pointer"
|
|
36
36
|
@click="action()"
|
|
37
37
|
/>
|
|
38
38
|
</template>
|
|
@@ -19,7 +19,7 @@ withDefaults(defineProps<{
|
|
|
19
19
|
<template>
|
|
20
20
|
<component
|
|
21
21
|
:is="tag"
|
|
22
|
-
class="poveste-wrapper histoire-wrapper
|
|
22
|
+
class="poveste-wrapper histoire-wrapper p-2 hover:bg-primary-100 dark:hover:bg-primary-800 flex gap-2 flex-wrap"
|
|
23
23
|
>
|
|
24
24
|
<span
|
|
25
25
|
v-tooltip="{
|
|
@@ -27,12 +27,12 @@ withDefaults(defineProps<{
|
|
|
27
27
|
placement: 'left',
|
|
28
28
|
distance: 12,
|
|
29
29
|
}"
|
|
30
|
-
class="
|
|
30
|
+
class="w-28 whitespace-nowrap text-ellipsis overflow-hidden shrink-0"
|
|
31
31
|
>
|
|
32
32
|
{{ title }}
|
|
33
33
|
</span>
|
|
34
|
-
<span class="
|
|
35
|
-
<span class="
|
|
34
|
+
<span class="grow max-w-full flex items-center gap-1">
|
|
35
|
+
<span class="block grow max-w-full">
|
|
36
36
|
<slot />
|
|
37
37
|
</span>
|
|
38
38
|
<slot name="actions" />
|
|
@@ -5,20 +5,20 @@ export default {
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
|
-
const colors = {
|
|
9
|
-
default: 'ptw-bg-gray-200 dark:ptw-bg-gray-750 ptw-text-gray-900 dark:ptw-text-gray-100 hover:ptw-bg-primary-200 dark:hover:ptw-bg-primary-900',
|
|
10
|
-
primary: 'ptw-bg-primary-500 hover:ptw-bg-primary-600 ptw-text-white dark:ptw-text-black',
|
|
11
|
-
flat: 'ptw-bg-transparent hover:ptw-bg-gray-500/20 ptw-text-gray-900 dark:ptw-text-gray-100',
|
|
12
|
-
}
|
|
13
|
-
|
|
14
8
|
defineProps<{
|
|
15
9
|
color?: keyof typeof colors
|
|
16
10
|
}>()
|
|
11
|
+
|
|
12
|
+
const colors = {
|
|
13
|
+
default: 'bg-gray-200 dark:bg-gray-750 text-gray-900 dark:text-gray-100 hover:bg-primary-200 dark:hover:bg-primary-900',
|
|
14
|
+
primary: 'bg-primary-500 hover:bg-primary-600 text-white dark:text-black',
|
|
15
|
+
flat: 'bg-transparent hover:bg-gray-500/20 text-gray-900 dark:text-gray-100',
|
|
16
|
+
}
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<template>
|
|
20
20
|
<button
|
|
21
|
-
class="poveste-button
|
|
21
|
+
class="poveste-button cursor-pointer rounded-sm border-none"
|
|
22
22
|
:class="colors[color ?? 'default']"
|
|
23
23
|
>
|
|
24
24
|
<slot />
|
|
@@ -17,6 +17,10 @@ const props = defineProps<{
|
|
|
17
17
|
options: string[] | number[] | HstControlOption[] | Record<string, string | number>
|
|
18
18
|
}>()
|
|
19
19
|
|
|
20
|
+
const emit = defineEmits<{
|
|
21
|
+
(e: 'update:modelValue', value: string): void
|
|
22
|
+
}>()
|
|
23
|
+
|
|
20
24
|
const formattedOptions: ComputedRef<HstControlOption[]> = computed(() => {
|
|
21
25
|
if (Array.isArray(props.options)) {
|
|
22
26
|
return props.options.map((value: string | number | HstControlOption) => {
|
|
@@ -36,10 +40,6 @@ const formattedOptions: ComputedRef<HstControlOption[]> = computed(() => {
|
|
|
36
40
|
}
|
|
37
41
|
})
|
|
38
42
|
|
|
39
|
-
const emit = defineEmits<{
|
|
40
|
-
(e: 'update:modelValue', value: string): void
|
|
41
|
-
}>()
|
|
42
|
-
|
|
43
43
|
function selectOption(value: string) {
|
|
44
44
|
emit('update:modelValue', value)
|
|
45
45
|
}
|
|
@@ -50,13 +50,13 @@ function selectOption(value: string) {
|
|
|
50
50
|
tag="div"
|
|
51
51
|
role="group"
|
|
52
52
|
:title="title"
|
|
53
|
-
class="poveste-button-group
|
|
53
|
+
class="poveste-button-group flex-nowrap items-center"
|
|
54
54
|
>
|
|
55
|
-
<div class="
|
|
55
|
+
<div class="flex gap-px border border-solid border-black/25 dark:border-white/25 rounded-sm p-px">
|
|
56
56
|
<HstButton
|
|
57
57
|
v-for="{ label, value } of formattedOptions"
|
|
58
58
|
:key="value"
|
|
59
|
-
class="
|
|
59
|
+
class="px-1 h-[22px] flex-1 rounded-[3px]!"
|
|
60
60
|
:color="value === modelValue ? 'primary' : 'flat'"
|
|
61
61
|
:rounded="false"
|
|
62
62
|
@click="selectOption(value)"
|
|
@@ -42,7 +42,7 @@ const isTrue = computed(() => {
|
|
|
42
42
|
<HstWrapper
|
|
43
43
|
role="checkbox"
|
|
44
44
|
tabindex="0"
|
|
45
|
-
class="poveste-checkbox
|
|
45
|
+
class="poveste-checkbox cursor-pointer items-center"
|
|
46
46
|
:title="title"
|
|
47
47
|
@click="toggle()"
|
|
48
48
|
@keydown.enter.prevent="toggle()"
|
|
@@ -17,6 +17,10 @@ const props = defineProps<{
|
|
|
17
17
|
options: string[] | HstControlOption[]
|
|
18
18
|
}>()
|
|
19
19
|
|
|
20
|
+
const emit = defineEmits<{
|
|
21
|
+
(e: 'update:modelValue', value: Array<string>): void
|
|
22
|
+
}>()
|
|
23
|
+
|
|
20
24
|
const formattedOptions: ComputedRef<Record<string, string>> = computed(() => {
|
|
21
25
|
if (Array.isArray(props.options)) {
|
|
22
26
|
return Object.fromEntries(props.options.map((value: string | HstControlOption) => {
|
|
@@ -31,10 +35,6 @@ const formattedOptions: ComputedRef<Record<string, string>> = computed(() => {
|
|
|
31
35
|
return props.options
|
|
32
36
|
})
|
|
33
37
|
|
|
34
|
-
const emit = defineEmits<{
|
|
35
|
-
(e: 'update:modelValue', value: Array<string>): void
|
|
36
|
-
}>()
|
|
37
|
-
|
|
38
38
|
function toggleOption(value: string) {
|
|
39
39
|
if (props.modelValue.includes(value)) {
|
|
40
40
|
emit('update:modelValue', props.modelValue.filter(element => element !== value))
|
|
@@ -49,11 +49,11 @@ function toggleOption(value: string) {
|
|
|
49
49
|
<HstWrapper
|
|
50
50
|
role="group"
|
|
51
51
|
:title="title"
|
|
52
|
-
class="poveste-checkbox-list
|
|
52
|
+
class="poveste-checkbox-list cursor-text"
|
|
53
53
|
:class="$attrs.class"
|
|
54
54
|
:style="$attrs.style"
|
|
55
55
|
>
|
|
56
|
-
<div class="-
|
|
56
|
+
<div class="-my-1">
|
|
57
57
|
<template
|
|
58
58
|
v-for="(label, value) in formattedOptions"
|
|
59
59
|
:key="value"
|
|
@@ -61,14 +61,14 @@ function toggleOption(value: string) {
|
|
|
61
61
|
<label
|
|
62
62
|
tabindex="0"
|
|
63
63
|
:for="`${value}-radio`"
|
|
64
|
-
class="
|
|
64
|
+
class="cursor-pointer flex items-center relative py-1 group"
|
|
65
65
|
@keydown.enter.prevent="toggleOption(value)"
|
|
66
66
|
@keydown.space.prevent="toggleOption(value)"
|
|
67
67
|
@click="toggleOption(value)"
|
|
68
68
|
>
|
|
69
69
|
<HstSimpleCheckbox
|
|
70
70
|
:model-value="modelValue.includes(value)"
|
|
71
|
-
class="
|
|
71
|
+
class="mr-2"
|
|
72
72
|
/>
|
|
73
73
|
{{ label }}
|
|
74
74
|
</label>
|
|
@@ -45,33 +45,33 @@ watch(path, () => {
|
|
|
45
45
|
|
|
46
46
|
<template>
|
|
47
47
|
<div
|
|
48
|
-
class="poveste-simple-checkbox
|
|
49
|
-
:class="{ '
|
|
48
|
+
class="poveste-simple-checkbox group text-white w-[16px] h-[16px] relative"
|
|
49
|
+
:class="{ 'cursor-pointer': withToggle }"
|
|
50
50
|
@click="toggle"
|
|
51
51
|
>
|
|
52
52
|
<div
|
|
53
|
-
class="
|
|
53
|
+
class="border border-solid group-active:bg-gray-500/20 rounded-sm box-border absolute inset-0 transition-border duration-150 ease-out group-hover:border-primary-500 group-hover:dark:border-primary-500"
|
|
54
54
|
:class="[
|
|
55
55
|
modelValue
|
|
56
|
-
? '
|
|
57
|
-
: '
|
|
56
|
+
? 'border-primary-500 border-8'
|
|
57
|
+
: 'border-black/25 dark:border-white/25 delay-150',
|
|
58
58
|
]"
|
|
59
59
|
/>
|
|
60
60
|
<svg
|
|
61
61
|
width="16"
|
|
62
62
|
height="16"
|
|
63
63
|
viewBox="0 0 24 24"
|
|
64
|
-
class="
|
|
64
|
+
class="relative z-10"
|
|
65
65
|
>
|
|
66
66
|
<path
|
|
67
67
|
ref="path"
|
|
68
68
|
d="m 4 12 l 5 5 l 10 -10"
|
|
69
69
|
fill="none"
|
|
70
|
-
class="
|
|
70
|
+
class="stroke-white stroke-2 duration-200 ease-in-out"
|
|
71
71
|
:class="[
|
|
72
|
-
animationEnabled ? '
|
|
72
|
+
animationEnabled ? 'transition-all' : 'transition-none',
|
|
73
73
|
{
|
|
74
|
-
'
|
|
74
|
+
'delay-150': modelValue,
|
|
75
75
|
},
|
|
76
76
|
]"
|
|
77
77
|
:stroke-dasharray="dasharray"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`hstCheckbox > toggle to checked 1`] = `"<label class="poveste-wrapper histoire-wrapper
|
|
3
|
+
exports[`hstCheckbox > toggle to checked 1`] = `"<label class="poveste-wrapper histoire-wrapper p-2 hover:bg-primary-100 dark:hover:bg-primary-800 flex gap-2 flex-wrap poveste-checkbox cursor-pointer items-center" role="checkbox" tabindex="0"><span class="w-28 whitespace-nowrap text-ellipsis overflow-hidden shrink-0 v-popper--has-tooltip">Label</span><span class="grow max-w-full flex items-center gap-1"><span class="block grow max-w-full"><div class="poveste-simple-checkbox group text-white w-[16px] h-[16px] relative"><div class="border border-solid group-active:bg-gray-500/20 rounded-sm box-border absolute inset-0 transition-border duration-150 ease-out group-hover:border-primary-500 group-hover:dark:border-primary-500 border-black/25 dark:border-white/25 delay-150"></div><svg width="16" height="16" viewBox="0 0 24 24" class="relative z-10"><path d="m 4 12 l 5 5 l 10 -10" fill="none" class="stroke-white stroke-2 duration-200 ease-in-out transition-none" stroke-dasharray="21.21" stroke-dashoffset="21.21"></path></svg></div></span></span></label>"`;
|
|
4
4
|
|
|
5
|
-
exports[`hstCheckbox > toggle to unchecked 1`] = `"<label class="poveste-wrapper histoire-wrapper
|
|
5
|
+
exports[`hstCheckbox > toggle to unchecked 1`] = `"<label class="poveste-wrapper histoire-wrapper p-2 hover:bg-primary-100 dark:hover:bg-primary-800 flex gap-2 flex-wrap poveste-checkbox cursor-pointer items-center" role="checkbox" tabindex="0"><span class="w-28 whitespace-nowrap text-ellipsis overflow-hidden shrink-0 v-popper--has-tooltip">Label</span><span class="grow max-w-full flex items-center gap-1"><span class="block grow max-w-full"><div class="poveste-simple-checkbox group text-white w-[16px] h-[16px] relative"><div class="border border-solid group-active:bg-gray-500/20 rounded-sm box-border absolute inset-0 transition-border duration-150 ease-out group-hover:border-primary-500 group-hover:dark:border-primary-500 border-primary-500 border-8"></div><svg width="16" height="16" viewBox="0 0 24 24" class="relative z-10"><path d="m 4 12 l 5 5 l 10 -10" fill="none" class="stroke-white stroke-2 duration-200 ease-in-out transition-none delay-150" stroke-dasharray="21.21" stroke-dashoffset="0"></path></svg></div></span></span></label>"`;
|
|
@@ -64,16 +64,16 @@ function processChange(inp) {
|
|
|
64
64
|
<template>
|
|
65
65
|
<HstWrapper
|
|
66
66
|
:title="title"
|
|
67
|
-
class="poveste-select
|
|
67
|
+
class="poveste-select cursor-text items-center"
|
|
68
68
|
:class="$attrs.class"
|
|
69
69
|
:style="$attrs.style"
|
|
70
70
|
>
|
|
71
|
-
<div class="
|
|
71
|
+
<div class="flex flex-row gap-1">
|
|
72
72
|
<input
|
|
73
73
|
v-bind="{ ...$attrs, class: null, style: null }"
|
|
74
74
|
v-model="stringModel"
|
|
75
75
|
type="text"
|
|
76
|
-
class="
|
|
76
|
+
class="text-inherit bg-transparent w-full outline-none px-2 py-1 -my-1 border border-solid border-black/25 dark:border-white/25 focus:border-primary-500 dark:focus:border-primary-500 rounded-sm"
|
|
77
77
|
>
|
|
78
78
|
<input
|
|
79
79
|
type="color"
|
|
@@ -309,7 +309,7 @@ const colors = {
|
|
|
309
309
|
>
|
|
310
310
|
<template #default="{ color }">
|
|
311
311
|
<div
|
|
312
|
-
class="
|
|
312
|
+
class="rounded h-[100px]"
|
|
313
313
|
:style="{
|
|
314
314
|
backgroundColor: color,
|
|
315
315
|
} as CSSProperties"
|
|
@@ -327,7 +327,7 @@ const colors = {
|
|
|
327
327
|
>
|
|
328
328
|
<template #default="{ color }">
|
|
329
329
|
<div
|
|
330
|
-
class="
|
|
330
|
+
class="rounded h-[100px] text-5xl flex items-end"
|
|
331
331
|
:style="{
|
|
332
332
|
color,
|
|
333
333
|
} as CSSProperties"
|
|
@@ -347,7 +347,7 @@ const colors = {
|
|
|
347
347
|
>
|
|
348
348
|
<template #default="{ color }">
|
|
349
349
|
<div
|
|
350
|
-
class="
|
|
350
|
+
class="rounded h-[100px] border-solid border-2"
|
|
351
351
|
:style="{
|
|
352
352
|
borderColor: color,
|
|
353
353
|
} as CSSProperties"
|
|
@@ -53,12 +53,12 @@ const hover = ref<string>(null)
|
|
|
53
53
|
<template>
|
|
54
54
|
<div
|
|
55
55
|
v-if="displayedShades.length"
|
|
56
|
-
class="poveste-color-shades
|
|
56
|
+
class="poveste-color-shades grid gap-4 grid-cols-[repeat(auto-fill,minmax(200px,1fr))] m-4"
|
|
57
57
|
>
|
|
58
58
|
<div
|
|
59
59
|
v-for="shade of displayedShades"
|
|
60
60
|
:key="shade.key"
|
|
61
|
-
class="
|
|
61
|
+
class="flex flex-col gap-2"
|
|
62
62
|
@mouseenter="hover = shade.key"
|
|
63
63
|
@mouseleave="hover = null"
|
|
64
64
|
>
|
|
@@ -66,33 +66,33 @@ const hover = ref<string>(null)
|
|
|
66
66
|
:color="shade.color"
|
|
67
67
|
>
|
|
68
68
|
<div
|
|
69
|
-
class="
|
|
69
|
+
class="rounded-full w-16 h-16"
|
|
70
70
|
:style="{
|
|
71
71
|
backgroundColor: shade.color,
|
|
72
72
|
} as CSSProperties"
|
|
73
73
|
/>
|
|
74
74
|
</slot>
|
|
75
75
|
<div>
|
|
76
|
-
<div class="
|
|
76
|
+
<div class="flex gap-1">
|
|
77
77
|
<pre
|
|
78
78
|
v-tooltip="shade.name.length > 23 ? shade.name : ''"
|
|
79
|
-
class="
|
|
79
|
+
class="my-0 truncate shrink"
|
|
80
80
|
>{{ shade.name }}</pre>
|
|
81
81
|
<HstCopyIcon
|
|
82
82
|
v-if="hover === shade.key"
|
|
83
83
|
:content="shade.name"
|
|
84
|
-
class="
|
|
84
|
+
class="flex-none"
|
|
85
85
|
/>
|
|
86
86
|
</div>
|
|
87
|
-
<div class="
|
|
87
|
+
<div class="flex gap-1">
|
|
88
88
|
<pre
|
|
89
89
|
v-tooltip="shade.color.length > 23 ? shade.color : ''"
|
|
90
|
-
class="
|
|
90
|
+
class="my-0 opacity-50 truncate shrink"
|
|
91
91
|
>{{ shade.color }}</pre>
|
|
92
92
|
<HstCopyIcon
|
|
93
93
|
v-if="hover === shade.key"
|
|
94
94
|
:content="shade.color"
|
|
95
|
-
class="
|
|
95
|
+
class="flex-none"
|
|
96
96
|
/>
|
|
97
97
|
</div>
|
|
98
98
|
</div>
|
|
@@ -38,7 +38,7 @@ const hover = ref<string>(null)
|
|
|
38
38
|
|
|
39
39
|
<template>
|
|
40
40
|
<div
|
|
41
|
-
class="poveste-token-grid
|
|
41
|
+
class="poveste-token-grid bind-col-size grid gap-4 m-4"
|
|
42
42
|
:style="{
|
|
43
43
|
'--poveste-col-size': colSizePx,
|
|
44
44
|
}"
|
|
@@ -46,7 +46,7 @@ const hover = ref<string>(null)
|
|
|
46
46
|
<div
|
|
47
47
|
v-for="token of processedTokens"
|
|
48
48
|
:key="token.key"
|
|
49
|
-
class="
|
|
49
|
+
class="flex flex-col gap-2"
|
|
50
50
|
@mouseenter="hover = token.key"
|
|
51
51
|
@mouseleave="hover = null"
|
|
52
52
|
>
|
|
@@ -54,26 +54,26 @@ const hover = ref<string>(null)
|
|
|
54
54
|
:token="token"
|
|
55
55
|
/>
|
|
56
56
|
<div>
|
|
57
|
-
<div class="
|
|
57
|
+
<div class="flex gap-1">
|
|
58
58
|
<pre
|
|
59
59
|
v-tooltip="token.name.length > colSize / 8 ? token.name : ''"
|
|
60
|
-
class="
|
|
60
|
+
class="my-0 truncate shrink"
|
|
61
61
|
>{{ token.name }}</pre>
|
|
62
62
|
<HstCopyIcon
|
|
63
63
|
v-if="hover === token.key"
|
|
64
64
|
:content="token.name"
|
|
65
|
-
class="
|
|
65
|
+
class="flex-none"
|
|
66
66
|
/>
|
|
67
67
|
</div>
|
|
68
|
-
<div class="
|
|
68
|
+
<div class="flex gap-1">
|
|
69
69
|
<pre
|
|
70
70
|
v-tooltip="token.value.length > colSize / 8 ? token.value : ''"
|
|
71
|
-
class="
|
|
71
|
+
class="my-0 opacity-50 truncate shrink"
|
|
72
72
|
>{{ token.value }}</pre>
|
|
73
73
|
<HstCopyIcon
|
|
74
74
|
v-if="hover === token.key"
|
|
75
75
|
:content="typeof token.value === 'string' ? token.value : JSON.stringify(token.value)"
|
|
76
|
-
class="
|
|
76
|
+
class="flex-none"
|
|
77
77
|
/>
|
|
78
78
|
</div>
|
|
79
79
|
</div>
|
|
@@ -82,7 +82,7 @@ const hover = ref<string>(null)
|
|
|
82
82
|
</template>
|
|
83
83
|
|
|
84
84
|
<style>
|
|
85
|
-
.
|
|
85
|
+
.bind-col-size {
|
|
86
86
|
grid-template-columns: repeat(auto-fill, minmax(var(--poveste-col-size), 1fr));
|
|
87
87
|
}
|
|
88
88
|
</style>
|
|
@@ -66,9 +66,9 @@ const tokens = {
|
|
|
66
66
|
:get-name="key => `w-${key}`"
|
|
67
67
|
>
|
|
68
68
|
<template #default="{ token }">
|
|
69
|
-
<div class="
|
|
69
|
+
<div class="bg-gray-500/10">
|
|
70
70
|
<div
|
|
71
|
-
class="
|
|
71
|
+
class="h-20 bg-gray-500/50"
|
|
72
72
|
:style="{
|
|
73
73
|
width: token.value as string,
|
|
74
74
|
} as CSSProperties"
|
|
@@ -33,28 +33,28 @@ const hover = ref<string>(null)
|
|
|
33
33
|
<div
|
|
34
34
|
v-for="token of processedTokens"
|
|
35
35
|
:key="token.key"
|
|
36
|
-
class="poveste-token-list
|
|
36
|
+
class="poveste-token-list flex flex-col gap-2 my-8"
|
|
37
37
|
@mouseenter="hover = token.key"
|
|
38
38
|
@mouseleave="hover = null"
|
|
39
39
|
>
|
|
40
40
|
<slot
|
|
41
41
|
:token="token"
|
|
42
42
|
/>
|
|
43
|
-
<div class="
|
|
44
|
-
<div class="
|
|
45
|
-
<pre class="
|
|
43
|
+
<div class="mx-4">
|
|
44
|
+
<div class="flex gap-1">
|
|
45
|
+
<pre class="my-0 truncate shrink">{{ token.name }}</pre>
|
|
46
46
|
<HstCopyIcon
|
|
47
47
|
v-if="hover === token.key"
|
|
48
48
|
:content="token.name"
|
|
49
|
-
class="
|
|
49
|
+
class="flex-none"
|
|
50
50
|
/>
|
|
51
51
|
</div>
|
|
52
|
-
<div class="
|
|
53
|
-
<pre class="
|
|
52
|
+
<div class="flex gap-1">
|
|
53
|
+
<pre class="my-0 opacity-50 truncate shrink">{{ token.value }}</pre>
|
|
54
54
|
<HstCopyIcon
|
|
55
55
|
v-if="hover === token.key"
|
|
56
56
|
:content="typeof token.value === 'string' ? token.value : JSON.stringify(token.value)"
|
|
57
|
-
class="
|
|
57
|
+
class="flex-none"
|
|
58
58
|
/>
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
@@ -120,13 +120,13 @@ watch(() => internalValue.value, () => {
|
|
|
120
120
|
<template>
|
|
121
121
|
<HstWrapper
|
|
122
122
|
:title="title"
|
|
123
|
-
class="poveste-json
|
|
123
|
+
class="poveste-json cursor-text"
|
|
124
124
|
:class="$attrs.class"
|
|
125
125
|
:style="$attrs.style"
|
|
126
126
|
>
|
|
127
127
|
<div
|
|
128
128
|
ref="editorElement"
|
|
129
|
-
class="__poveste-json-code
|
|
129
|
+
class="__poveste-json-code w-full border border-solid border-black/25 dark:border-white/25 focus-within:border-primary-500 dark:focus-within:border-primary-500 rounded-sm box-border overflow-auto resize-y min-h-32 h-48 relative"
|
|
130
130
|
v-bind="{ ...$attrs, class: null, style: null }"
|
|
131
131
|
/>
|
|
132
132
|
|
|
@@ -135,7 +135,7 @@ watch(() => internalValue.value, () => {
|
|
|
135
135
|
v-if="invalidValue"
|
|
136
136
|
v-tooltip="'JSON error'"
|
|
137
137
|
icon="carbon:warning-alt"
|
|
138
|
-
class="
|
|
138
|
+
class="text-orange-500"
|
|
139
139
|
/>
|
|
140
140
|
|
|
141
141
|
<slot name="actions" />
|
|
@@ -67,11 +67,11 @@ onUnmounted(() => {
|
|
|
67
67
|
|
|
68
68
|
<template>
|
|
69
69
|
<HstWrapper
|
|
70
|
-
class="poveste-number
|
|
70
|
+
class="poveste-number cursor-ew-resize items-center"
|
|
71
71
|
:title="title"
|
|
72
72
|
:class="[
|
|
73
73
|
$attrs.class,
|
|
74
|
-
{ '
|
|
74
|
+
{ 'select-none': isDragging },
|
|
75
75
|
]"
|
|
76
76
|
:style="$attrs.style"
|
|
77
77
|
@click="focusAndSelect"
|
|
@@ -83,9 +83,9 @@ onUnmounted(() => {
|
|
|
83
83
|
v-model.number="numberModel"
|
|
84
84
|
type="number"
|
|
85
85
|
:class="{
|
|
86
|
-
'
|
|
86
|
+
'select-none': isDragging,
|
|
87
87
|
}"
|
|
88
|
-
class="
|
|
88
|
+
class="text-inherit bg-transparent w-full outline-none pl-2 py-1 -my-1 border border-solid border-black/25 dark:border-white/25 focus:border-primary-500 dark:focus:border-primary-500 rounded-sm cursor-ew-resize box-border"
|
|
89
89
|
>
|
|
90
90
|
|
|
91
91
|
<template #actions>
|