@meistrari/tela-build 1.27.1 → 1.28.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/components/tela/header/center/center-steps-item.vue +45 -0
- package/components/tela/header/center/center-steps-separator.vue +3 -0
- package/components/tela/header/center/center-steps.vue +5 -0
- package/components/tela/header/center/center.vue +5 -0
- package/components/tela/header/header-label.vue +5 -0
- package/components/tela/header/header.mdx +294 -0
- package/components/tela/header/header.stories.ts +222 -0
- package/components/tela/header/header.vue +5 -0
- package/components/tela/header/leading/leading-content.vue +17 -0
- package/components/tela/header/leading/leading-title.vue +5 -0
- package/components/tela/header/leading/leading-trigger.vue +15 -0
- package/components/tela/header/leading/leading.vue +5 -0
- package/components/tela/header/leading/summary/summary-content.vue +5 -0
- package/components/tela/header/leading/summary/summary-separator.vue +3 -0
- package/components/tela/header/leading/summary/summary-status.vue +18 -0
- package/components/tela/header/leading/summary/summary.vue +5 -0
- package/components/tela/header/trailing/pagination/pagination-next-button.vue +21 -0
- package/components/tela/header/trailing/pagination/pagination-prev-button.vue +21 -0
- package/components/tela/header/trailing/pagination/pagination.vue +5 -0
- package/components/tela/header/trailing/trailing-actions.vue +24 -0
- package/components/tela/header/trailing/trailing-content.vue +5 -0
- package/components/tela/header/trailing/trailing.vue +5 -0
- package/components/tela/scroll-area/scroll-area.stories.ts +0 -1
- package/components/tela/segment-toggle/segment-toggle.stories.ts +0 -1
- package/components/tela/status/status.vue +9 -4
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{
|
|
3
|
+
index: number
|
|
4
|
+
label: string
|
|
5
|
+
disabled?: boolean
|
|
6
|
+
}>()
|
|
7
|
+
|
|
8
|
+
const stepColor = computed(() => {
|
|
9
|
+
if (props.disabled) {
|
|
10
|
+
return {
|
|
11
|
+
ring: 'ring-neutral-400',
|
|
12
|
+
text: 'text-tertiary',
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
ring: 'ring-neutral-700',
|
|
18
|
+
text: 'text-primary',
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const textColor = computed(() => {
|
|
23
|
+
if (props.disabled) {
|
|
24
|
+
return 'text-tertiary select-none'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return 'text-primary'
|
|
28
|
+
})
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div flex items-center gap-6px>
|
|
33
|
+
<div size-16px flex items-center justify-center shrink-0>
|
|
34
|
+
<div
|
|
35
|
+
size-12px flex items-center justify-center shrink-0 rounded-full ring-1.5px text-8px leading-none font-800
|
|
36
|
+
:class="[stepColor.ring, stepColor.text, textColor]"
|
|
37
|
+
>
|
|
38
|
+
<span translate-y="-0.2px">{{ index }}</span>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<p body-14-medium :class="textColor">
|
|
42
|
+
{{ label }}
|
|
43
|
+
</p>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { Meta } from '@storybook/blocks';
|
|
2
|
+
import * as HeaderStories from './header.stories.ts';
|
|
3
|
+
|
|
4
|
+
<Meta of={HeaderStories} />
|
|
5
|
+
|
|
6
|
+
# TelaHeader
|
|
7
|
+
|
|
8
|
+
A composable header component for fullscreen views. Provides a sticky top bar with three layout zones: leading (left), center, and trailing (right). Built with slot-based sub-components for maximum flexibility.
|
|
9
|
+
|
|
10
|
+
## Examples
|
|
11
|
+
|
|
12
|
+
### Basic Usage
|
|
13
|
+
|
|
14
|
+
```vue
|
|
15
|
+
<TelaHeader>
|
|
16
|
+
<TelaHeaderLeading>
|
|
17
|
+
<TelaHeaderLeadingTrigger @click="handleClose" />
|
|
18
|
+
<TelaHeaderLeadingContent>
|
|
19
|
+
<TelaHeaderLeadingTitle>Page Title</TelaHeaderLeadingTitle>
|
|
20
|
+
</TelaHeaderLeadingContent>
|
|
21
|
+
</TelaHeaderLeading>
|
|
22
|
+
|
|
23
|
+
<TelaHeaderTrailing>
|
|
24
|
+
<TelaHeaderTrailingContent>
|
|
25
|
+
<TelaButton variant="primary" size="sm">Save</TelaButton>
|
|
26
|
+
</TelaHeaderTrailingContent>
|
|
27
|
+
</TelaHeaderTrailing>
|
|
28
|
+
</TelaHeader>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### With Summary and Status
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<TelaHeader>
|
|
35
|
+
<TelaHeaderLeading>
|
|
36
|
+
<TelaHeaderLeadingTrigger @click="handleClose" />
|
|
37
|
+
<TelaHeaderLeadingContent>
|
|
38
|
+
<TelaHeaderLeadingTitle>Document Name</TelaHeaderLeadingTitle>
|
|
39
|
+
<TelaHeaderLeadingSummary>
|
|
40
|
+
<TelaHeaderLeadingSummaryStatus variant="completed" label="Completed" />
|
|
41
|
+
<TelaHeaderLeadingSummaryContent>
|
|
42
|
+
<TelaHeaderLabel>4 modules, 33 parsed files</TelaHeaderLabel>
|
|
43
|
+
<TelaHeaderLeadingSummarySeparator />
|
|
44
|
+
<TelaHeaderLabel>3m ago</TelaHeaderLabel>
|
|
45
|
+
</TelaHeaderLeadingSummaryContent>
|
|
46
|
+
</TelaHeaderLeadingSummary>
|
|
47
|
+
</TelaHeaderLeadingContent>
|
|
48
|
+
</TelaHeaderLeading>
|
|
49
|
+
</TelaHeader>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### With Center Steps
|
|
53
|
+
|
|
54
|
+
```vue
|
|
55
|
+
<TelaHeader>
|
|
56
|
+
<TelaHeaderLeading>
|
|
57
|
+
<TelaHeaderLeadingTrigger @click="handleClose" />
|
|
58
|
+
</TelaHeaderLeading>
|
|
59
|
+
|
|
60
|
+
<TelaHeaderCenter>
|
|
61
|
+
<TelaHeaderCenterSteps>
|
|
62
|
+
<TelaHeaderCenterStepsItem :index="1" label="Setup" />
|
|
63
|
+
<TelaHeaderCenterStepsSeparator />
|
|
64
|
+
<TelaHeaderCenterStepsItem :index="2" label="Review" disabled />
|
|
65
|
+
<TelaHeaderCenterStepsSeparator />
|
|
66
|
+
<TelaHeaderCenterStepsItem :index="3" label="Publish" disabled />
|
|
67
|
+
</TelaHeaderCenterSteps>
|
|
68
|
+
</TelaHeaderCenter>
|
|
69
|
+
</TelaHeader>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### With Pagination and Actions
|
|
73
|
+
|
|
74
|
+
```vue
|
|
75
|
+
<TelaHeader>
|
|
76
|
+
<TelaHeaderLeading>
|
|
77
|
+
<TelaHeaderLeadingTrigger @click="handleClose" />
|
|
78
|
+
<TelaHeaderLeadingContent>
|
|
79
|
+
<TelaHeaderLeadingTitle>Test Case Details</TelaHeaderLeadingTitle>
|
|
80
|
+
</TelaHeaderLeadingContent>
|
|
81
|
+
</TelaHeaderLeading>
|
|
82
|
+
|
|
83
|
+
<TelaHeaderTrailing>
|
|
84
|
+
<TelaHeaderTrailingContent>
|
|
85
|
+
<TelaHeaderLabel>1 of 1,820</TelaHeaderLabel>
|
|
86
|
+
<TelaHeaderTrailingPagination>
|
|
87
|
+
<TelaHeaderTrailingPaginationPrevButton
|
|
88
|
+
:disabled="isFirst"
|
|
89
|
+
@click="goToPrevious"
|
|
90
|
+
/>
|
|
91
|
+
<TelaHeaderTrailingPaginationNextButton
|
|
92
|
+
:disabled="isLast"
|
|
93
|
+
@click="goToNext"
|
|
94
|
+
/>
|
|
95
|
+
</TelaHeaderTrailingPagination>
|
|
96
|
+
</TelaHeaderTrailingContent>
|
|
97
|
+
|
|
98
|
+
<TelaHeaderTrailingActions
|
|
99
|
+
:items="[
|
|
100
|
+
{ label: 'Edit inputs', icon: 'i-ph-gear-bold', click: handleEdit },
|
|
101
|
+
{ label: 'Show code', icon: 'i-ph-code-bold', click: handleShowCode },
|
|
102
|
+
{ label: 'Delete', icon: 'i-ph-trash-bold', color: 'negative', click: handleDelete },
|
|
103
|
+
]"
|
|
104
|
+
/>
|
|
105
|
+
</TelaHeaderTrailing>
|
|
106
|
+
</TelaHeader>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Horizontal Leading Content
|
|
110
|
+
|
|
111
|
+
```vue
|
|
112
|
+
<TelaHeaderLeading>
|
|
113
|
+
<TelaHeaderLeadingTrigger @click="handleClose" />
|
|
114
|
+
<TelaHeaderLeadingContent direction="horizontal">
|
|
115
|
+
<TelaHeaderLeadingTitle>Title</TelaHeaderLeadingTitle>
|
|
116
|
+
<TelaHeaderLabel>Subtitle</TelaHeaderLabel>
|
|
117
|
+
</TelaHeaderLeadingContent>
|
|
118
|
+
</TelaHeaderLeading>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Components
|
|
122
|
+
|
|
123
|
+
### `TelaHeader`
|
|
124
|
+
|
|
125
|
+
Root header container. Sticky-positioned at the top with 64px height, bottom border, and full width.
|
|
126
|
+
|
|
127
|
+
- **Slots:** `default` - accepts `TelaHeaderLeading`, `TelaHeaderCenter`, and `TelaHeaderTrailing`
|
|
128
|
+
|
|
129
|
+
### `TelaHeaderLeading`
|
|
130
|
+
|
|
131
|
+
Left-side container with 12px gap between children.
|
|
132
|
+
|
|
133
|
+
- **Slots:** `default` - accepts `TelaHeaderLeadingTrigger`, `TelaHeaderLeadingContent`
|
|
134
|
+
|
|
135
|
+
### `TelaHeaderLeadingTrigger`
|
|
136
|
+
|
|
137
|
+
Close button (X icon) for the leading section.
|
|
138
|
+
|
|
139
|
+
- **Events:** `click` - emitted when the button is clicked
|
|
140
|
+
|
|
141
|
+
### `TelaHeaderLeadingContent`
|
|
142
|
+
|
|
143
|
+
Layout wrapper for leading content (title + summary).
|
|
144
|
+
|
|
145
|
+
| Prop | Type | Default | Description |
|
|
146
|
+
|------|------|---------|-------------|
|
|
147
|
+
| `direction` | `'vertical' \| 'horizontal'` | `'vertical'` | Layout direction for child elements |
|
|
148
|
+
|
|
149
|
+
### `TelaHeaderLeadingTitle`
|
|
150
|
+
|
|
151
|
+
H5 heading element with semibold weight and primary text color.
|
|
152
|
+
|
|
153
|
+
- **Slots:** `default` - heading text
|
|
154
|
+
|
|
155
|
+
### `TelaHeaderLeadingSummary`
|
|
156
|
+
|
|
157
|
+
Horizontal container (8px gap) for status and metadata items.
|
|
158
|
+
|
|
159
|
+
- **Slots:** `default` - accepts status, content, and separators
|
|
160
|
+
|
|
161
|
+
### `TelaHeaderLeadingSummaryStatus`
|
|
162
|
+
|
|
163
|
+
Status indicator using `TelaStatus` with 12px medium body text.
|
|
164
|
+
|
|
165
|
+
| Prop | Type | Default | Description |
|
|
166
|
+
|------|------|---------|-------------|
|
|
167
|
+
| `variant` | `TelaStatusVariant` | - | Status variant (e.g. `completed`, `running`, `error`) |
|
|
168
|
+
| `label` | `string` | - | Status label text |
|
|
169
|
+
| `labelClass` | `HTMLAttributes['class']` | - | Additional CSS class for the label |
|
|
170
|
+
|
|
171
|
+
### `TelaHeaderLeadingSummaryContent`
|
|
172
|
+
|
|
173
|
+
Inner wrapper for summary items with 6px gap.
|
|
174
|
+
|
|
175
|
+
- **Slots:** `default` - accepts `TelaHeaderLabel` and `TelaHeaderLeadingSummarySeparator`
|
|
176
|
+
|
|
177
|
+
### `TelaHeaderLeadingSummarySeparator`
|
|
178
|
+
|
|
179
|
+
Small circular dot separator (3px) for summary content. Has `aria-hidden="true"`.
|
|
180
|
+
|
|
181
|
+
### `TelaHeaderLabel`
|
|
182
|
+
|
|
183
|
+
12px regular body text with secondary color. Use for metadata labels (counts, timestamps, pagination indicators).
|
|
184
|
+
|
|
185
|
+
- **Slots:** `default` - label text
|
|
186
|
+
|
|
187
|
+
### `TelaHeaderCenter`
|
|
188
|
+
|
|
189
|
+
Absolutely positioned center section (horizontally centered via `left: 50%; transform: translateX(-50%)`).
|
|
190
|
+
|
|
191
|
+
- **Slots:** `default` - accepts `TelaHeaderCenterSteps`
|
|
192
|
+
|
|
193
|
+
### `TelaHeaderCenterSteps`
|
|
194
|
+
|
|
195
|
+
Container for step indicators with muted background and 12px gap.
|
|
196
|
+
|
|
197
|
+
- **Slots:** `default` - accepts `TelaHeaderCenterStepsItem` and `TelaHeaderCenterStepsSeparator`
|
|
198
|
+
|
|
199
|
+
### `TelaHeaderCenterStepsItem`
|
|
200
|
+
|
|
201
|
+
Individual step with a numbered circle indicator and label.
|
|
202
|
+
|
|
203
|
+
| Prop | Type | Default | Description |
|
|
204
|
+
|------|------|---------|-------------|
|
|
205
|
+
| `index` | `number` | - | Step number displayed in the circle |
|
|
206
|
+
| `label` | `string` | - | Step label text |
|
|
207
|
+
| `disabled` | `boolean` | `false` | Dims the step with tertiary colors |
|
|
208
|
+
|
|
209
|
+
### `TelaHeaderCenterStepsSeparator`
|
|
210
|
+
|
|
211
|
+
Horizontal line separator (16px wide, 1px height) between steps. Has `aria-hidden="true"`.
|
|
212
|
+
|
|
213
|
+
### `TelaHeaderTrailing`
|
|
214
|
+
|
|
215
|
+
Right-side container with 16px gap between children.
|
|
216
|
+
|
|
217
|
+
- **Slots:** `default` - accepts `TelaHeaderTrailingContent` and `TelaHeaderTrailingActions`
|
|
218
|
+
|
|
219
|
+
### `TelaHeaderTrailingContent`
|
|
220
|
+
|
|
221
|
+
Wrapper for trailing items with 12px gap.
|
|
222
|
+
|
|
223
|
+
- **Slots:** `default` - accepts labels, pagination, buttons
|
|
224
|
+
|
|
225
|
+
### `TelaHeaderTrailingPagination`
|
|
226
|
+
|
|
227
|
+
Tight container (2px gap) for prev/next navigation buttons.
|
|
228
|
+
|
|
229
|
+
- **Slots:** `default` - accepts `TelaHeaderTrailingPaginationPrevButton` and `TelaHeaderTrailingPaginationNextButton`
|
|
230
|
+
|
|
231
|
+
### `TelaHeaderTrailingPaginationPrevButton`
|
|
232
|
+
|
|
233
|
+
Previous navigation button with left caret icon.
|
|
234
|
+
|
|
235
|
+
| Prop | Type | Default | Description |
|
|
236
|
+
|------|------|---------|-------------|
|
|
237
|
+
| `disabled` | `boolean` | `false` | Disables the button and dims the icon |
|
|
238
|
+
|
|
239
|
+
- **Events:** `click` - emitted when the button is clicked
|
|
240
|
+
|
|
241
|
+
### `TelaHeaderTrailingPaginationNextButton`
|
|
242
|
+
|
|
243
|
+
Next navigation button with right caret icon.
|
|
244
|
+
|
|
245
|
+
| Prop | Type | Default | Description |
|
|
246
|
+
|------|------|---------|-------------|
|
|
247
|
+
| `disabled` | `boolean` | `false` | Disables the button and dims the icon |
|
|
248
|
+
|
|
249
|
+
- **Events:** `click` - emitted when the button is clicked
|
|
250
|
+
|
|
251
|
+
### `TelaHeaderTrailingActions`
|
|
252
|
+
|
|
253
|
+
Three-dot dropdown menu for contextual actions.
|
|
254
|
+
|
|
255
|
+
| Prop | Type | Default | Description |
|
|
256
|
+
|------|------|---------|-------------|
|
|
257
|
+
| `items` | `Item[]` | - | Array of action items |
|
|
258
|
+
|
|
259
|
+
```typescript
|
|
260
|
+
interface Item {
|
|
261
|
+
label: string
|
|
262
|
+
icon: string
|
|
263
|
+
color?: 'positive' | 'caution' | 'negative'
|
|
264
|
+
click: () => void
|
|
265
|
+
disabled?: boolean
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Component Tree
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
TelaHeader
|
|
273
|
+
├── TelaHeaderLeading
|
|
274
|
+
│ ├── TelaHeaderLeadingTrigger
|
|
275
|
+
│ └── TelaHeaderLeadingContent
|
|
276
|
+
│ ├── TelaHeaderLeadingTitle
|
|
277
|
+
│ └── TelaHeaderLeadingSummary
|
|
278
|
+
│ ├── TelaHeaderLeadingSummaryStatus
|
|
279
|
+
│ ├── TelaHeaderLeadingSummaryContent
|
|
280
|
+
│ │ ├── TelaHeaderLabel
|
|
281
|
+
│ │ └── TelaHeaderLeadingSummarySeparator
|
|
282
|
+
│ └── ...
|
|
283
|
+
├── TelaHeaderCenter
|
|
284
|
+
│ └── TelaHeaderCenterSteps
|
|
285
|
+
│ ├── TelaHeaderCenterStepsItem
|
|
286
|
+
│ └── TelaHeaderCenterStepsSeparator
|
|
287
|
+
└── TelaHeaderTrailing
|
|
288
|
+
├── TelaHeaderTrailingContent
|
|
289
|
+
│ ├── TelaHeaderLabel
|
|
290
|
+
│ └── TelaHeaderTrailingPagination
|
|
291
|
+
│ ├── TelaHeaderTrailingPaginationPrevButton
|
|
292
|
+
│ └── TelaHeaderTrailingPaginationNextButton
|
|
293
|
+
└── TelaHeaderTrailingActions
|
|
294
|
+
```
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
|
|
3
|
+
import Header from './header.vue'
|
|
4
|
+
import HeaderLabel from './header-label.vue'
|
|
5
|
+
import LeadingVue from './leading/leading.vue'
|
|
6
|
+
import LeadingTrigger from './leading/leading-trigger.vue'
|
|
7
|
+
import LeadingContent from './leading/leading-content.vue'
|
|
8
|
+
import LeadingTitle from './leading/leading-title.vue'
|
|
9
|
+
import Summary from './leading/summary/summary.vue'
|
|
10
|
+
import SummaryStatus from './leading/summary/summary-status.vue'
|
|
11
|
+
import SummaryContent from './leading/summary/summary-content.vue'
|
|
12
|
+
import SummarySeparator from './leading/summary/summary-separator.vue'
|
|
13
|
+
import Center from './center/center.vue'
|
|
14
|
+
import CenterSteps from './center/center-steps.vue'
|
|
15
|
+
import CenterStepsItem from './center/center-steps-item.vue'
|
|
16
|
+
import CenterStepsSeparator from './center/center-steps-separator.vue'
|
|
17
|
+
import Trailing from './trailing/trailing.vue'
|
|
18
|
+
import TrailingContent from './trailing/trailing-content.vue'
|
|
19
|
+
import TrailingActions from './trailing/trailing-actions.vue'
|
|
20
|
+
import Pagination from './trailing/pagination/pagination.vue'
|
|
21
|
+
import PaginationPrevButton from './trailing/pagination/pagination-prev-button.vue'
|
|
22
|
+
import PaginationNextButton from './trailing/pagination/pagination-next-button.vue'
|
|
23
|
+
|
|
24
|
+
const meta: Meta<typeof Header> = {
|
|
25
|
+
title: 'Patterns/Header',
|
|
26
|
+
component: Header,
|
|
27
|
+
parameters: {
|
|
28
|
+
layout: 'fullscreen',
|
|
29
|
+
docs: {
|
|
30
|
+
description: {
|
|
31
|
+
component: 'A composable header component for fullscreen views. Provides a sticky top bar with three layout zones: leading (left), center, and trailing (right). Built with slot-based sub-components for maximum flexibility.',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default meta
|
|
38
|
+
|
|
39
|
+
const headerComponents = {
|
|
40
|
+
Header,
|
|
41
|
+
HeaderLabel,
|
|
42
|
+
Leading: LeadingVue,
|
|
43
|
+
LeadingTrigger,
|
|
44
|
+
LeadingContent,
|
|
45
|
+
LeadingTitle,
|
|
46
|
+
Summary,
|
|
47
|
+
SummaryStatus,
|
|
48
|
+
SummaryContent,
|
|
49
|
+
SummarySeparator,
|
|
50
|
+
Center,
|
|
51
|
+
CenterSteps,
|
|
52
|
+
CenterStepsItem,
|
|
53
|
+
CenterStepsSeparator,
|
|
54
|
+
Trailing,
|
|
55
|
+
TrailingContent,
|
|
56
|
+
TrailingActions,
|
|
57
|
+
Pagination,
|
|
58
|
+
PaginationPrevButton,
|
|
59
|
+
PaginationNextButton,
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const Default: StoryObj<typeof Header> = {
|
|
63
|
+
render: () => ({
|
|
64
|
+
components: headerComponents,
|
|
65
|
+
template: `
|
|
66
|
+
<Header>
|
|
67
|
+
<Leading>
|
|
68
|
+
<LeadingTrigger @click="() => {}" />
|
|
69
|
+
<LeadingContent>
|
|
70
|
+
<LeadingTitle>Page Title</LeadingTitle>
|
|
71
|
+
</LeadingContent>
|
|
72
|
+
</Leading>
|
|
73
|
+
|
|
74
|
+
<Trailing>
|
|
75
|
+
<TrailingContent>
|
|
76
|
+
<HeaderLabel>1 of 100</HeaderLabel>
|
|
77
|
+
</TrailingContent>
|
|
78
|
+
</Trailing>
|
|
79
|
+
</Header>
|
|
80
|
+
`,
|
|
81
|
+
}),
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const WithSummary: StoryObj<typeof Header> = {
|
|
85
|
+
render: () => ({
|
|
86
|
+
components: headerComponents,
|
|
87
|
+
template: `
|
|
88
|
+
<Header>
|
|
89
|
+
<Leading>
|
|
90
|
+
<LeadingTrigger @click="() => {}" />
|
|
91
|
+
<LeadingContent>
|
|
92
|
+
<LeadingTitle>AMAZONAS ENERGIA - 0068669-56.2025.8.04.1000</LeadingTitle>
|
|
93
|
+
<Summary>
|
|
94
|
+
<SummaryStatus variant="completed" label="Completed" />
|
|
95
|
+
<SummaryContent>
|
|
96
|
+
<HeaderLabel>4 modules, 33 parsed files</HeaderLabel>
|
|
97
|
+
<SummarySeparator />
|
|
98
|
+
<HeaderLabel>3m ago</HeaderLabel>
|
|
99
|
+
</SummaryContent>
|
|
100
|
+
</Summary>
|
|
101
|
+
</LeadingContent>
|
|
102
|
+
</Leading>
|
|
103
|
+
</Header>
|
|
104
|
+
`,
|
|
105
|
+
}),
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const WithCenterSteps: StoryObj<typeof Header> = {
|
|
109
|
+
render: () => ({
|
|
110
|
+
components: headerComponents,
|
|
111
|
+
template: `
|
|
112
|
+
<Header>
|
|
113
|
+
<Leading>
|
|
114
|
+
<LeadingTrigger @click="() => {}" />
|
|
115
|
+
</Leading>
|
|
116
|
+
|
|
117
|
+
<Center>
|
|
118
|
+
<CenterSteps>
|
|
119
|
+
<CenterStepsItem :index="1" label="Cadastro" />
|
|
120
|
+
<CenterStepsSeparator />
|
|
121
|
+
<CenterStepsItem :index="2" label="Antifraude" disabled />
|
|
122
|
+
<CenterStepsSeparator />
|
|
123
|
+
<CenterStepsItem :index="3" label="Subsidios" disabled />
|
|
124
|
+
<CenterStepsSeparator />
|
|
125
|
+
<CenterStepsItem :index="4" label="Laudo para Defesa" disabled />
|
|
126
|
+
</CenterSteps>
|
|
127
|
+
</Center>
|
|
128
|
+
</Header>
|
|
129
|
+
`,
|
|
130
|
+
}),
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export const WithPaginationAndActions: StoryObj<typeof Header> = {
|
|
134
|
+
render: () => ({
|
|
135
|
+
components: headerComponents,
|
|
136
|
+
template: `
|
|
137
|
+
<Header>
|
|
138
|
+
<Leading>
|
|
139
|
+
<LeadingTrigger @click="() => {}" />
|
|
140
|
+
<LeadingContent>
|
|
141
|
+
<LeadingTitle>Test Case Details</LeadingTitle>
|
|
142
|
+
<Summary>
|
|
143
|
+
<SummaryStatus variant="running" label="Running" />
|
|
144
|
+
</Summary>
|
|
145
|
+
</LeadingContent>
|
|
146
|
+
</Leading>
|
|
147
|
+
|
|
148
|
+
<Trailing>
|
|
149
|
+
<TrailingContent>
|
|
150
|
+
<HeaderLabel>1 of 1,820</HeaderLabel>
|
|
151
|
+
<Pagination>
|
|
152
|
+
<PaginationPrevButton disabled @click="() => {}" />
|
|
153
|
+
<PaginationNextButton @click="() => {}" />
|
|
154
|
+
</Pagination>
|
|
155
|
+
</TrailingContent>
|
|
156
|
+
|
|
157
|
+
<TrailingActions
|
|
158
|
+
:items="[
|
|
159
|
+
{ label: 'Edit inputs', icon: 'i-ph-gear-bold', click: () => {} },
|
|
160
|
+
{ label: 'Show code', icon: 'i-ph-code-bold', click: () => {} },
|
|
161
|
+
{ label: 'Delete', icon: 'i-ph-trash-bold', color: 'negative', click: () => {} },
|
|
162
|
+
]"
|
|
163
|
+
/>
|
|
164
|
+
</Trailing>
|
|
165
|
+
</Header>
|
|
166
|
+
`,
|
|
167
|
+
}),
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export const FullExample: StoryObj<typeof Header> = {
|
|
171
|
+
render: () => ({
|
|
172
|
+
components: headerComponents,
|
|
173
|
+
template: `
|
|
174
|
+
<Header>
|
|
175
|
+
<Leading>
|
|
176
|
+
<LeadingTrigger @click="() => {}" />
|
|
177
|
+
<LeadingContent>
|
|
178
|
+
<LeadingTitle>AMAZONAS ENERGIA - 0068669-56.2025.8.04.1000</LeadingTitle>
|
|
179
|
+
<Summary>
|
|
180
|
+
<SummaryStatus variant="completed" label="Completed" />
|
|
181
|
+
<SummaryContent>
|
|
182
|
+
<HeaderLabel>4 modules, 33 parsed files</HeaderLabel>
|
|
183
|
+
<SummarySeparator />
|
|
184
|
+
<HeaderLabel>3m ago</HeaderLabel>
|
|
185
|
+
</SummaryContent>
|
|
186
|
+
</Summary>
|
|
187
|
+
</LeadingContent>
|
|
188
|
+
</Leading>
|
|
189
|
+
|
|
190
|
+
<Center>
|
|
191
|
+
<CenterSteps>
|
|
192
|
+
<CenterStepsItem :index="1" label="Cadastro" />
|
|
193
|
+
<CenterStepsSeparator />
|
|
194
|
+
<CenterStepsItem :index="2" label="Antifraude" disabled />
|
|
195
|
+
<CenterStepsSeparator />
|
|
196
|
+
<CenterStepsItem :index="3" label="Subsidios" disabled />
|
|
197
|
+
<CenterStepsSeparator />
|
|
198
|
+
<CenterStepsItem :index="4" label="Laudo para Defesa" disabled />
|
|
199
|
+
</CenterSteps>
|
|
200
|
+
</Center>
|
|
201
|
+
|
|
202
|
+
<Trailing>
|
|
203
|
+
<TrailingContent>
|
|
204
|
+
<HeaderLabel>1 of 1,820</HeaderLabel>
|
|
205
|
+
<Pagination>
|
|
206
|
+
<PaginationPrevButton disabled @click="() => {}" />
|
|
207
|
+
<PaginationNextButton @click="() => {}" />
|
|
208
|
+
</Pagination>
|
|
209
|
+
</TrailingContent>
|
|
210
|
+
|
|
211
|
+
<TrailingActions
|
|
212
|
+
:items="[
|
|
213
|
+
{ label: 'Edit inputs', icon: 'i-ph-gear-bold', click: () => {} },
|
|
214
|
+
{ label: 'Show code', icon: 'i-ph-code-bold', click: () => {} },
|
|
215
|
+
{ label: 'Delete', icon: 'i-ph-trash-bold', color: 'negative', click: () => {} },
|
|
216
|
+
]"
|
|
217
|
+
/>
|
|
218
|
+
</Trailing>
|
|
219
|
+
</Header>
|
|
220
|
+
`,
|
|
221
|
+
}),
|
|
222
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = withDefaults(defineProps<{
|
|
3
|
+
direction?: 'vertical' | 'horizontal'
|
|
4
|
+
}>(), {
|
|
5
|
+
direction: 'vertical',
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
const directionClass = computed(() => {
|
|
9
|
+
return props.direction === 'vertical' && 'flex-col'
|
|
10
|
+
})
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div flex gap-6px :class="directionClass">
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const emit = defineEmits<{
|
|
3
|
+
(e: 'click'): void
|
|
4
|
+
}>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<TelaIconButton
|
|
9
|
+
icon="i-ph-x"
|
|
10
|
+
size="md"
|
|
11
|
+
color="secondary"
|
|
12
|
+
icon-class="text-neutral-950"
|
|
13
|
+
@click="emit('click')"
|
|
14
|
+
/>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import type { TelaStatusVariant } from '@meistrari/tela-build/types'
|
|
4
|
+
|
|
5
|
+
defineProps<{
|
|
6
|
+
variant: TelaStatusVariant
|
|
7
|
+
label?: string
|
|
8
|
+
labelClass?: HTMLAttributes['class']
|
|
9
|
+
}>()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<TelaStatus
|
|
14
|
+
:variant="variant"
|
|
15
|
+
:label="label"
|
|
16
|
+
:label-class="cn('body-12-medium!', labelClass)"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
disabled?: boolean
|
|
4
|
+
}>()
|
|
5
|
+
|
|
6
|
+
const emit = defineEmits<{
|
|
7
|
+
(e: 'click'): void
|
|
8
|
+
}>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<TelaIconButton
|
|
13
|
+
icon="i-ph-caret-right-bold"
|
|
14
|
+
size="md"
|
|
15
|
+
color="secondary"
|
|
16
|
+
:icon-class="disabled ? 'text-icon-subtle' : 'text-icon'"
|
|
17
|
+
button-class="!disabled:bg-transparent"
|
|
18
|
+
:disabled="disabled"
|
|
19
|
+
@click="emit('click')"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
disabled?: boolean
|
|
4
|
+
}>()
|
|
5
|
+
|
|
6
|
+
const emit = defineEmits<{
|
|
7
|
+
(e: 'click'): void
|
|
8
|
+
}>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<TelaIconButton
|
|
13
|
+
icon="i-ph-caret-left-bold"
|
|
14
|
+
size="md"
|
|
15
|
+
color="secondary"
|
|
16
|
+
:icon-class="disabled ? 'text-icon-subtle' : 'text-icon'"
|
|
17
|
+
button-class="!disabled:bg-transparent"
|
|
18
|
+
:disabled="disabled"
|
|
19
|
+
@click="emit('click')"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface Item {
|
|
3
|
+
label: string
|
|
4
|
+
icon: string
|
|
5
|
+
color?: 'positive' | 'caution' | 'negative'
|
|
6
|
+
click: () => void
|
|
7
|
+
disabled?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
defineProps<{
|
|
11
|
+
items: Item[]
|
|
12
|
+
}>()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<TelaDropdownMenu :items="items" align="end">
|
|
17
|
+
<TelaIconButton
|
|
18
|
+
size="md"
|
|
19
|
+
color="secondary"
|
|
20
|
+
icon="i-ph-dots-three-bold"
|
|
21
|
+
icon-class="text-neutral-950"
|
|
22
|
+
/>
|
|
23
|
+
</TelaDropdownMenu>
|
|
24
|
+
</template>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
|
|
2
4
|
import type { TelaCustomIconName, TelaStatusVariant } from '@meistrari/tela-build/types'
|
|
3
5
|
|
|
4
6
|
type StatusConfig = {
|
|
@@ -14,6 +16,7 @@ const props = withDefaults(defineProps<{
|
|
|
14
16
|
label?: string
|
|
15
17
|
isIconAnimated?: boolean
|
|
16
18
|
isIconHidden?: boolean
|
|
19
|
+
labelClass?: HTMLAttributes['class']
|
|
17
20
|
}>(), {
|
|
18
21
|
variant: 'running',
|
|
19
22
|
isIconAnimated: true,
|
|
@@ -337,9 +340,7 @@ watch(
|
|
|
337
340
|
)
|
|
338
341
|
|
|
339
342
|
onMounted(() => {
|
|
340
|
-
|
|
341
|
-
requestAnimationFrame(measureContentWidth)
|
|
342
|
-
})
|
|
343
|
+
document.fonts.ready.then(measureContentWidth)
|
|
343
344
|
})
|
|
344
345
|
|
|
345
346
|
const shineClass = computed(() => {
|
|
@@ -423,7 +424,11 @@ const SPRING_CONFIG = {
|
|
|
423
424
|
:key="`text-${statusLabel}`"
|
|
424
425
|
as="span"
|
|
425
426
|
v-bind="textVariants()"
|
|
426
|
-
:class="cn(
|
|
427
|
+
:class="cn(
|
|
428
|
+
'body-14-medium whitespace-nowrap',
|
|
429
|
+
isShineVisible ? shineClass : textColor,
|
|
430
|
+
labelClass,
|
|
431
|
+
)"
|
|
427
432
|
>
|
|
428
433
|
{{ statusLabel }}
|
|
429
434
|
</Motion>
|