@meistrari/tela-build 1.34.0 → 1.34.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/components/tela/button/button.vue +2 -2
- package/components/tela/checkbox/checkbox.vue +16 -6
- package/components/tela/input/input.mdx +0 -8
- package/components/tela/input/input.stories.ts +1 -6
- package/components/tela/input/{tela-input.vue → input.vue} +0 -3
- package/components/tela/sidebar/sidebar-item.vue +2 -4
- package/composables/optimistic-async-data/stories/optimistic-async-data-action-demo.vue +0 -1
- package/composables/optimistic-async-data/stories/optimistic-async-data-shared-state-demo.vue +1 -3
- package/lib/doc-generator.ts +1 -1
- package/package.json +1 -1
|
@@ -27,8 +27,8 @@ const resolvedVariant = computed(() =>
|
|
|
27
27
|
|
|
28
28
|
const sizeStyle = computed(() => (({
|
|
29
29
|
sm: 'text-12px leading-16px font-580 tracking-normal px-10px py-4px rounded-9px',
|
|
30
|
-
md: 'text-14px leading-18px font-580 -tracking-0.
|
|
31
|
-
lg: 'text-16px leading-20px font-580 -tracking-0.
|
|
30
|
+
md: 'text-14px leading-18px font-580 -tracking-0.15px px-12px py-7px rounded-11px [&>svg]:text-10px',
|
|
31
|
+
lg: 'text-16px leading-20px font-580 -tracking-0.15px px-16px py-10px rounded-13px [&>svg]:text-12px',
|
|
32
32
|
}) as Record<ButtonSize, string>)[resolvedSize.value] ?? '')
|
|
33
33
|
|
|
34
34
|
const variantStyle = computed(() => (({
|
|
@@ -22,7 +22,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
22
22
|
props.class,
|
|
23
23
|
)"
|
|
24
24
|
>
|
|
25
|
-
<CheckboxIndicator class="grid place-content-center">
|
|
25
|
+
<CheckboxIndicator force-mount class="grid place-content-center">
|
|
26
26
|
<svg
|
|
27
27
|
viewBox="0 0 24 24"
|
|
28
28
|
fill="none"
|
|
@@ -30,14 +30,24 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
30
30
|
stroke-linejoin="round"
|
|
31
31
|
class="shrink-0 stroke-3 stroke-white-1000 w-14px h-11px"
|
|
32
32
|
>
|
|
33
|
-
<
|
|
34
|
-
|
|
33
|
+
<path
|
|
34
|
+
data-show-icon="true"
|
|
35
35
|
d="M5 13 L10 18 L20 6"
|
|
36
|
-
|
|
37
|
-
:animate="{ scale: 1, pathLength: 1 }"
|
|
38
|
-
:transition="{ duration: 0.2, ease: [0.645, 0.045, 0.355, 1] }"
|
|
36
|
+
pathLength="1"
|
|
39
37
|
/>
|
|
40
38
|
</svg>
|
|
41
39
|
</CheckboxIndicator>
|
|
42
40
|
</CheckboxRoot>
|
|
43
41
|
</template>
|
|
42
|
+
|
|
43
|
+
<style scoped>
|
|
44
|
+
[data-show-icon="true"] {
|
|
45
|
+
stroke-dasharray: 1;
|
|
46
|
+
stroke-dashoffset: 1;
|
|
47
|
+
transition: stroke-dashoffset 200ms cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[data-state="checked"] [data-show-icon="true"] {
|
|
51
|
+
stroke-dashoffset: 0;
|
|
52
|
+
}
|
|
53
|
+
</style>
|
|
@@ -145,8 +145,6 @@ const value = ref('')
|
|
|
145
145
|
<ArgTypes />
|
|
146
146
|
|
|
147
147
|
```typescript
|
|
148
|
-
type InputSize = 'sm' | 'md'
|
|
149
|
-
|
|
150
148
|
type InputProps = {
|
|
151
149
|
id?: string
|
|
152
150
|
modelValue?: string | number
|
|
@@ -154,7 +152,6 @@ type InputProps = {
|
|
|
154
152
|
placeholder?: string
|
|
155
153
|
hideLabel?: boolean
|
|
156
154
|
disabled?: boolean
|
|
157
|
-
size?: InputSize
|
|
158
155
|
error?: string | false
|
|
159
156
|
showClearButton?: boolean
|
|
160
157
|
tabindex?: number
|
|
@@ -184,11 +181,6 @@ type InputProps = {
|
|
|
184
181
|
- **Two-way Binding**: Full v-model support
|
|
185
182
|
- **Textarea Mode**: Multi-line input support
|
|
186
183
|
|
|
187
|
-
## Sizes
|
|
188
|
-
|
|
189
|
-
- **sm**: Small input with compact padding
|
|
190
|
-
- **md**: Medium input (default) with comfortable spacing
|
|
191
|
-
|
|
192
184
|
## Accessibility
|
|
193
185
|
|
|
194
186
|
- Proper label-input association with `for` and `id` attributes
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/vue3'
|
|
|
2
2
|
|
|
3
3
|
import { fn } from '@storybook/test'
|
|
4
4
|
|
|
5
|
-
import Input from './
|
|
5
|
+
import Input from './input.vue'
|
|
6
6
|
|
|
7
7
|
const meta: Meta<typeof Input> = {
|
|
8
8
|
title: 'Core/Input',
|
|
@@ -40,11 +40,6 @@ const meta: Meta<typeof Input> = {
|
|
|
40
40
|
control: 'boolean',
|
|
41
41
|
description: 'Disable the input, preventing user interaction.',
|
|
42
42
|
},
|
|
43
|
-
size: {
|
|
44
|
-
control: 'select',
|
|
45
|
-
options: ['sm', 'md'],
|
|
46
|
-
description: 'Size of the input field. Controls height and padding.',
|
|
47
|
-
},
|
|
48
43
|
error: {
|
|
49
44
|
control: 'text',
|
|
50
45
|
description: 'Error message to display below the input. Set to false to hide error state.',
|
|
@@ -8,7 +8,6 @@ const props = defineProps<{
|
|
|
8
8
|
placeholder?: string
|
|
9
9
|
hideLabel?: boolean
|
|
10
10
|
disabled?: boolean
|
|
11
|
-
size?: 'sm' | 'md'
|
|
12
11
|
error?: string | false
|
|
13
12
|
showClearButton?: boolean
|
|
14
13
|
tabindex?: number
|
|
@@ -31,7 +30,6 @@ const emit = defineEmits<{
|
|
|
31
30
|
|
|
32
31
|
const isTextarea = computed(() => props.type === 'textarea')
|
|
33
32
|
const attributes = computed(() => ({
|
|
34
|
-
size: isTextarea.value ? 'md' : undefined,
|
|
35
33
|
type: isTextarea.value ? undefined : props.type,
|
|
36
34
|
modelValue: props.modelValue,
|
|
37
35
|
value: props.modelValue,
|
|
@@ -128,7 +126,6 @@ defineExpose({
|
|
|
128
126
|
rounded-10px bg-white
|
|
129
127
|
class="focus-within-border-strong focus-within-ring-2 focus-within-ring-gray-100 [box-shadow:0_1px_4px_0_rgba(103,127,148,0.03)]"
|
|
130
128
|
:class="[
|
|
131
|
-
size === 'sm' && 'py-7px !px-12px',
|
|
132
129
|
disabled && '!bg-gray-50 cursor-not-allowed color-gray-600',
|
|
133
130
|
$attrs.class,
|
|
134
131
|
error && '!border-red-900 !text-red-900 !bg-[#FFDBDB66]',
|
|
@@ -43,10 +43,8 @@ const rootAttrs = computed(() => {
|
|
|
43
43
|
/>
|
|
44
44
|
<div
|
|
45
45
|
:class="cn(
|
|
46
|
-
'absolute inset-0 size-full rounded-[14px] z-0 border-[0.5px] border-transparent
|
|
47
|
-
'group-
|
|
48
|
-
'group-data-[active=true]:bg-neutral-200 group-focus-visible:border-strong group-[[data-active=false]:hover]:border-strong group-hover:scale-100 group-hover:opacity-100',
|
|
49
|
-
'group-focus-visible:border-strong group-focus-visible:scale-100 group-focus-visible:opacity-100',
|
|
46
|
+
'absolute inset-0 size-full rounded-[14px] z-0 border-[0.5px] border-transparent',
|
|
47
|
+
isActive ? 'bg-neutral-200 group-focus-visible:border-strong' : 'bg scale-10 opacity-0 duration-150 ease-out origin-center group-hover:border-strong group-hover:scale-100 group-hover:opacity-100 group-focus-visible:border-strong group-focus-visible:scale-100 group-focus-visible:opacity-100',
|
|
50
48
|
)"
|
|
51
49
|
/>
|
|
52
50
|
</div>
|
package/composables/optimistic-async-data/stories/optimistic-async-data-shared-state-demo.vue
CHANGED
|
@@ -4,7 +4,7 @@ import { useOptimisticAsyncData } from '..'
|
|
|
4
4
|
import { useOptimisticAsyncState } from '../useOptimisticAsyncState'
|
|
5
5
|
import OptimisticAsyncProvider from '../optimistic-async-provider.vue'
|
|
6
6
|
import TelaButton from '../../../components/tela/button/button.vue'
|
|
7
|
-
import TelaInput from '../../../components/tela/input/
|
|
7
|
+
import TelaInput from '../../../components/tela/input/input.vue'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* SHARED STATE DEMO (with OptimisticAsyncProvider)
|
|
@@ -204,13 +204,11 @@ const EditorComponent = defineComponent({
|
|
|
204
204
|
v-model="editName"
|
|
205
205
|
label="Name"
|
|
206
206
|
:placeholder="data.name"
|
|
207
|
-
size="sm"
|
|
208
207
|
/>
|
|
209
208
|
<TelaInput
|
|
210
209
|
v-model="editEmail"
|
|
211
210
|
label="Email"
|
|
212
211
|
:placeholder="data.email"
|
|
213
|
-
size="sm"
|
|
214
212
|
/>
|
|
215
213
|
<TelaButton
|
|
216
214
|
variant="primary"
|
package/lib/doc-generator.ts
CHANGED
|
@@ -235,7 +235,7 @@ async function globAsync(pattern: string, options: any): Promise<string[]> {
|
|
|
235
235
|
export function generateTagName(fileName: string): string {
|
|
236
236
|
// Convert file name to PascalCase tag name
|
|
237
237
|
// Components in tela/ directory should preserve the Tela prefix
|
|
238
|
-
// e.g.,
|
|
238
|
+
// e.g., input -> TelaInput, button -> TelaButton
|
|
239
239
|
|
|
240
240
|
let tagName: string
|
|
241
241
|
|