@poveste/controls 0.1.3 → 0.2.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 +1 -1
- package/dist/index.es.js +76 -76
- package/dist/style-standalone.css +148 -148
- package/package.json +3 -3
- 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 +4 -4
- package/src/components/button/HstButtonGroup.vue +3 -3
- package/src/components/checkbox/HstCheckbox.vue +1 -1
- package/src/components/checkbox/HstCheckboxList.vue +4 -4
- 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 +12 -12
- package/src/components/select/CustomSelect.vue +10 -10
- package/src/components/select/HstSelect.story.vue +4 -4
- package/src/components/select/HstSelect.vue +1 -1
- package/src/components/slider/HstSlider.vue +12 -12
- package/src/components/text/HstText.vue +2 -2
- package/src/components/textarea/HstTextarea.vue +2 -2
- package/src/end.d.ts +2 -2
- package/src/style/main.css +1 -1
- package/src/utils.ts +4 -4
- package/tailwind.config.cjs +1 -1
|
@@ -79,7 +79,7 @@ function initState() {
|
|
|
79
79
|
:init-state="initState"
|
|
80
80
|
>
|
|
81
81
|
<template #default="{ state }">
|
|
82
|
-
<pre class="
|
|
82
|
+
<pre class="ptw-text-xs ptw-bg-gray-50 dark:ptw-bg-gray-600 ptw-rounded ptw-p-4">{{ options }}</pre>
|
|
83
83
|
<HstSelect
|
|
84
84
|
v-model="state.select"
|
|
85
85
|
title="Games"
|
|
@@ -100,7 +100,7 @@ function initState() {
|
|
|
100
100
|
:init-state="initState"
|
|
101
101
|
>
|
|
102
102
|
<template #default="{ state }">
|
|
103
|
-
<pre class="
|
|
103
|
+
<pre class="ptw-text-xs ptw-bg-gray-50 dark:ptw-bg-gray-600 ptw-rounded ptw-p-4">{{ objectOptions }}</pre>
|
|
104
104
|
<HstSelect
|
|
105
105
|
v-model="state.select"
|
|
106
106
|
title="Games"
|
|
@@ -121,7 +121,7 @@ function initState() {
|
|
|
121
121
|
:init-state="initState"
|
|
122
122
|
>
|
|
123
123
|
<template #default="{ state }">
|
|
124
|
-
<pre class="
|
|
124
|
+
<pre class="ptw-text-xs ptw-bg-gray-50 dark:ptw-bg-gray-600 ptw-rounded ptw-p-4">{{ flatOptions }}</pre>
|
|
125
125
|
<HstSelect
|
|
126
126
|
v-model="state.select"
|
|
127
127
|
title="Select"
|
|
@@ -142,7 +142,7 @@ function initState() {
|
|
|
142
142
|
:init-state="initState"
|
|
143
143
|
>
|
|
144
144
|
<template #default="{ state }">
|
|
145
|
-
<pre class="
|
|
145
|
+
<pre class="ptw-text-xs ptw-bg-gray-50 dark:ptw-bg-gray-600 ptw-rounded ptw-p-4">{{ numberOptions }}</pre>
|
|
146
146
|
<HstSelect
|
|
147
147
|
v-model="state.count"
|
|
148
148
|
title="Select"
|
|
@@ -50,19 +50,19 @@ const tooltipStyle = computed<CSSProperties>(() => {
|
|
|
50
50
|
|
|
51
51
|
<template>
|
|
52
52
|
<HstWrapper
|
|
53
|
-
class="poveste-slider
|
|
53
|
+
class="poveste-slider ptw-items-center"
|
|
54
54
|
:title="title"
|
|
55
55
|
:class="$attrs.class"
|
|
56
56
|
:style="$attrs.style"
|
|
57
57
|
>
|
|
58
|
-
<div class="
|
|
59
|
-
<div class="
|
|
60
|
-
<div class="
|
|
58
|
+
<div class="ptw-relative ptw-w-full ptw-flex ptw-items-center">
|
|
59
|
+
<div class="ptw-absolute ptw-inset-0 ptw-flex ptw-items-center">
|
|
60
|
+
<div class="ptw-border ptw-border-black/25 dark:ptw-border-white/25 ptw-h-1 ptw-w-full ptw-rounded-full" />
|
|
61
61
|
</div>
|
|
62
62
|
<input
|
|
63
63
|
ref="input"
|
|
64
64
|
v-model.number="numberModel"
|
|
65
|
-
class="
|
|
65
|
+
class="ptw-range-input ptw-appearance-none ptw-border-0 ptw-bg-transparent ptw-cursor-pointer ptw-relative ptw-w-full ptw-m-0 ptw-text-gray-700"
|
|
66
66
|
type="range"
|
|
67
67
|
v-bind="{ ...$attrs, class: null, style: null, min, max }"
|
|
68
68
|
@mouseover="showTooltip = true"
|
|
@@ -71,7 +71,7 @@ const tooltipStyle = computed<CSSProperties>(() => {
|
|
|
71
71
|
<div
|
|
72
72
|
v-if="showTooltip"
|
|
73
73
|
v-tooltip="{ content: modelValue.toString(), shown: true, distance: 16, delay: 0 }"
|
|
74
|
-
class="
|
|
74
|
+
class="ptw-absolute"
|
|
75
75
|
:style="tooltipStyle"
|
|
76
76
|
/>
|
|
77
77
|
</div>
|
|
@@ -79,25 +79,25 @@ const tooltipStyle = computed<CSSProperties>(() => {
|
|
|
79
79
|
</template>
|
|
80
80
|
|
|
81
81
|
<style lang="pcss">
|
|
82
|
-
.
|
|
82
|
+
.ptw-range-input {
|
|
83
83
|
&::-webkit-slider-thumb {
|
|
84
|
-
@apply
|
|
84
|
+
@apply ptw-appearance-none ptw-h-3 ptw-w-3 ptw-bg-white dark:ptw-bg-gray-700 ptw-border ptw-border-solid ptw-border-black/25 dark:ptw-border-white/25 ptw-rounded-full;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
&:hover::-webkit-slider-thumb {
|
|
88
|
-
@apply !
|
|
88
|
+
@apply !ptw-bg-primary-500 !ptw-border-primary-500;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/* Separate rules for -moz-range-thumb to prevent a bug with Safari that causes it to ignore custom style */
|
|
93
93
|
|
|
94
|
-
.
|
|
94
|
+
.ptw-range-input {
|
|
95
95
|
&::-moz-range-thumb {
|
|
96
|
-
@apply
|
|
96
|
+
@apply ptw-appearance-none ptw-h-3 ptw-w-3 ptw-bg-white dark:ptw-bg-gray-700 ptw-border ptw-border-solid ptw-border-black/25 dark:ptw-border-white/25 ptw-rounded-full;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
&:hover::-moz-range-thumb {
|
|
100
|
-
@apply !
|
|
100
|
+
@apply !ptw-bg-primary-500 !ptw-border-primary-500;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
</style>
|
|
@@ -23,7 +23,7 @@ const input = ref<HTMLInputElement>()
|
|
|
23
23
|
<template>
|
|
24
24
|
<HstWrapper
|
|
25
25
|
:title="title"
|
|
26
|
-
class="poveste-text
|
|
26
|
+
class="poveste-text ptw-cursor-text ptw-items-center"
|
|
27
27
|
:class="$attrs.class"
|
|
28
28
|
:style="$attrs.style"
|
|
29
29
|
@click="input.focus()"
|
|
@@ -33,7 +33,7 @@ const input = ref<HTMLInputElement>()
|
|
|
33
33
|
v-bind="{ ...$attrs, class: null, style: null }"
|
|
34
34
|
type="text"
|
|
35
35
|
:value="modelValue"
|
|
36
|
-
class="
|
|
36
|
+
class="ptw-text-inherit ptw-bg-transparent ptw-w-full ptw-outline-none ptw-px-2 ptw-py-1 -ptw-my-1 ptw-border ptw-border-solid ptw-border-black/25 dark:ptw-border-white/25 focus:ptw-border-primary-500 dark:focus:ptw-border-primary-500 ptw-rounded-sm"
|
|
37
37
|
@input="emit('update:modelValue', ($event.target as HTMLInputElement).value)"
|
|
38
38
|
>
|
|
39
39
|
|
|
@@ -24,7 +24,7 @@ const input = ref<HTMLInputElement>()
|
|
|
24
24
|
<template>
|
|
25
25
|
<HstWrapper
|
|
26
26
|
:title="title"
|
|
27
|
-
class="poveste-textarea
|
|
27
|
+
class="poveste-textarea ptw-cursor-text"
|
|
28
28
|
:class="$attrs.class"
|
|
29
29
|
:style="$attrs.style"
|
|
30
30
|
@click="input.focus()"
|
|
@@ -33,7 +33,7 @@ const input = ref<HTMLInputElement>()
|
|
|
33
33
|
ref="input"
|
|
34
34
|
v-bind="{ ...$attrs, class: null, style: null }"
|
|
35
35
|
:value="modelValue"
|
|
36
|
-
class="
|
|
36
|
+
class="ptw-text-inherit ptw-bg-transparent ptw-w-full ptw-outline-none ptw-px-2 ptw-py-1 -ptw-my-1 ptw-border ptw-border-solid ptw-border-black/25 dark:ptw-border-white/25 focus:ptw-border-primary-500 dark:focus:ptw-border-primary-500 ptw-rounded-sm ptw-box-border ptw-resize-y ptw-min-h-[26px]"
|
|
37
37
|
@input="emit('update:modelValue', ($event.target as HTMLInputElement).value)"
|
|
38
38
|
/>
|
|
39
39
|
|
package/src/end.d.ts
CHANGED
package/src/style/main.css
CHANGED
package/src/utils.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { ref } from 'vue'
|
|
|
2
2
|
|
|
3
3
|
export const isDark = ref(false)
|
|
4
4
|
|
|
5
|
-
if (!window.
|
|
6
|
-
window.
|
|
5
|
+
if (!window.__pvt_controls_dark) {
|
|
6
|
+
window.__pvt_controls_dark = []
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
// There could be multiple instances of the controls lib (in the controls book https://controls.poveste.dev)
|
|
10
|
-
window.
|
|
10
|
+
window.__pvt_controls_dark.push(isDark)
|
|
11
11
|
|
|
12
|
-
window.
|
|
12
|
+
window.__pvt_controls_dark_ready?.()
|