@meistrari/tela-build 1.0.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/README.md +75 -0
- package/app.config.ts +73 -0
- package/components/tela/animated/animated-calculating-number.vue +16 -0
- package/components/tela/animated/animated-number.mdx +248 -0
- package/components/tela/animated/animated-number.stories.ts +52 -0
- package/components/tela/animated/animated-number.vue +23 -0
- package/components/tela/animated/animated-text.vue +124 -0
- package/components/tela/animated/animated-value.vue +68 -0
- package/components/tela/avatar/avatar.mdx +117 -0
- package/components/tela/avatar/avatar.stories.ts +62 -0
- package/components/tela/avatar/avatar.vue +71 -0
- package/components/tela/avatar/group/avatar-group.stories.ts +78 -0
- package/components/tela/avatar/group/avatar-group.vue +46 -0
- package/components/tela/badge/badge.mdx +154 -0
- package/components/tela/badge/badge.stories.ts +82 -0
- package/components/tela/badge/badge.vue +41 -0
- package/components/tela/button/button.mdx +155 -0
- package/components/tela/button/button.stories.ts +202 -0
- package/components/tela/button/button.vue +107 -0
- package/components/tela/card.vue +30 -0
- package/components/tela/chart/chart-bar.vue +58 -0
- package/components/tela/chat/chat.mdx +268 -0
- package/components/tela/chat/chat.stories.ts +253 -0
- package/components/tela/chat/command/index.vue +41 -0
- package/components/tela/chat/command/mention/index.vue +138 -0
- package/components/tela/chat/index.vue +112 -0
- package/components/tela/chat/pure-text-input/chat-text-input.vue +190 -0
- package/components/tela/chat/text-input/chat-text-input.stories.ts +128 -0
- package/components/tela/chat/text-input/index.vue +217 -0
- package/components/tela/chat/text-message/chat-text-message.stories.ts +138 -0
- package/components/tela/chat/text-message/index.vue +355 -0
- package/components/tela/chat/types.ts +19 -0
- package/components/tela/checkbox/checkbox-card.vue +30 -0
- package/components/tela/checkbox/checkbox.mdx +164 -0
- package/components/tela/checkbox/checkbox.stories.ts +104 -0
- package/components/tela/checkbox/checkbox.vue +43 -0
- package/components/tela/collapsible/Collapsible.vue +15 -0
- package/components/tela/collapsible/CollapsibleContent.vue +59 -0
- package/components/tela/collapsible/CollapsibleTrigger.vue +12 -0
- package/components/tela/collapsible/collapsible.mdx +157 -0
- package/components/tela/collapsible-section/collapsible-section.mdx +180 -0
- package/components/tela/collapsible-section/collapsible-section.stories.ts +53 -0
- package/components/tela/collapsible-section/collapsible-section.vue +51 -0
- package/components/tela/collapsible-section-with-actions.vue +98 -0
- package/components/tela/combobox/combobox-anchor.vue +24 -0
- package/components/tela/combobox/combobox-empty.vue +19 -0
- package/components/tela/combobox/combobox-group.vue +24 -0
- package/components/tela/combobox/combobox-indicator.vue +22 -0
- package/components/tela/combobox/combobox-input.vue +31 -0
- package/components/tela/combobox/combobox-item.vue +28 -0
- package/components/tela/combobox/combobox-label.vue +24 -0
- package/components/tela/combobox/combobox-list.vue +90 -0
- package/components/tela/combobox/combobox-module-selector.vue +366 -0
- package/components/tela/combobox/combobox-root.vue +15 -0
- package/components/tela/combobox/combobox-trigger.vue +12 -0
- package/components/tela/combobox/combobox.mdx +285 -0
- package/components/tela/combobox/combobox.stories.ts +232 -0
- package/components/tela/combobox/combobox.vue +497 -0
- package/components/tela/command/command-dialog.vue +22 -0
- package/components/tela/command/command-empty.vue +25 -0
- package/components/tela/command/command-group.vue +46 -0
- package/components/tela/command/command-input.vue +38 -0
- package/components/tela/command/command-item.vue +78 -0
- package/components/tela/command/command-list.vue +78 -0
- package/components/tela/command/command-separator.vue +23 -0
- package/components/tela/command/command-shortcut.vue +13 -0
- package/components/tela/command/command.vue +88 -0
- package/components/tela/command/dialog-base.vue +15 -0
- package/components/tela/command/dialog-content.vue +50 -0
- package/components/tela/command/utils.ts +15 -0
- package/components/tela/complex-table/complex-table-cell.stories.ts +145 -0
- package/components/tela/complex-table/complex-table-cell.vue +45 -0
- package/components/tela/complex-table/complex-table-header-cell.stories.ts +103 -0
- package/components/tela/complex-table/complex-table-header-cell.vue +48 -0
- package/components/tela/complex-table/complex-table-header.stories.ts +89 -0
- package/components/tela/complex-table/complex-table-header.vue +70 -0
- package/components/tela/complex-table/complex-table-row.vue +199 -0
- package/components/tela/complex-table/complex-table-virtualized.vue +326 -0
- package/components/tela/complex-table/complex-table.stories.ts +358 -0
- package/components/tela/complex-table/complex-table.vue +237 -0
- package/components/tela/complex-table/composables/table-common.ts +93 -0
- package/components/tela/complex-table/composables/table-selection.ts +87 -0
- package/components/tela/complex-table/composables/virtual-scroll.ts +252 -0
- package/components/tela/complex-table/styles/table-shared.css +170 -0
- package/components/tela/complex-table/types.ts +63 -0
- package/components/tela/complex-table/utils.ts +35 -0
- package/components/tela/confirm-button/confirm-button.vue +137 -0
- package/components/tela/confirmation-modal/confirmation-modal.vue +72 -0
- package/components/tela/copy-button.vue +86 -0
- package/components/tela/date-range-picker.vue +221 -0
- package/components/tela/dialog/dialog.mdx +170 -0
- package/components/tela/dialog/dialog.vue +182 -0
- package/components/tela/disabled-area.vue +16 -0
- package/components/tela/disclaimer/disclaimer.mdx +238 -0
- package/components/tela/disclaimer/disclaimer.stories.ts +196 -0
- package/components/tela/disclaimer/disclaimer.vue +125 -0
- package/components/tela/dropdown-menu/DropdownMenu.vue +121 -0
- package/components/tela/dropdown-menu/DropdownMenuCheckboxItem.vue +40 -0
- package/components/tela/dropdown-menu/DropdownMenuContent.vue +75 -0
- package/components/tela/dropdown-menu/DropdownMenuGroup.vue +12 -0
- package/components/tela/dropdown-menu/DropdownMenuItem.vue +137 -0
- package/components/tela/dropdown-menu/DropdownMenuLabel.vue +26 -0
- package/components/tela/dropdown-menu/DropdownMenuRadioGroup.vue +18 -0
- package/components/tela/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
- package/components/tela/dropdown-menu/DropdownMenuRoot.vue +15 -0
- package/components/tela/dropdown-menu/DropdownMenuSeparator.vue +21 -0
- package/components/tela/dropdown-menu/DropdownMenuShortcut.vue +14 -0
- package/components/tela/dropdown-menu/DropdownMenuSub.vue +18 -0
- package/components/tela/dropdown-menu/DropdownMenuSubContent.vue +30 -0
- package/components/tela/dropdown-menu/DropdownMenuSubTrigger.vue +35 -0
- package/components/tela/dropdown-menu/DropdownMenuTrigger.vue +14 -0
- package/components/tela/dropdown-menu/dropdown-menu.mdx +265 -0
- package/components/tela/dropdown-menu/dropdown-menu.stories.ts +156 -0
- package/components/tela/expandable-input.vue +96 -0
- package/components/tela/file-drop.vue +37 -0
- package/components/tela/file-upload/file-upload.mdx +189 -0
- package/components/tela/file-upload/file-upload.stories.ts +48 -0
- package/components/tela/file-upload/file-upload.vue +205 -0
- package/components/tela/filters/checkbox-filter.stories.ts +218 -0
- package/components/tela/filters/checkbox-filter.vue +165 -0
- package/components/tela/filters/date-filter.stories.ts +258 -0
- package/components/tela/filters/date-filter.vue +200 -0
- package/components/tela/filters/user-filter.stories.ts +344 -0
- package/components/tela/filters/user-filter.vue +271 -0
- package/components/tela/hover-card/hover-card.mdx +221 -0
- package/components/tela/hover-card/hover-card.stories.ts +87 -0
- package/components/tela/hover-card/hover-card.vue +61 -0
- package/components/tela/icon/custom.vue +319 -0
- package/components/tela/icon/spinner.vue +12 -0
- package/components/tela/icon-button/icon-button.vue +114 -0
- package/components/tela/icon.vue +37 -0
- package/components/tela/initials.vue +28 -0
- package/components/tela/inline-input.vue +77 -0
- package/components/tela/input/input.mdx +182 -0
- package/components/tela/input/input.stories.ts +153 -0
- package/components/tela/input/tela-input.vue +240 -0
- package/components/tela/kbd/kbd-return.vue +6 -0
- package/components/tela/kbd/kbd.mdx +238 -0
- package/components/tela/kbd/kbd.vue +18 -0
- package/components/tela/label/label.mdx +121 -0
- package/components/tela/label/label.stories.ts +37 -0
- package/components/tela/label/label.vue +25 -0
- package/components/tela/link-decoration/link-decoration.vue +19 -0
- package/components/tela/live-label.vue +32 -0
- package/components/tela/long-press-button.vue +98 -0
- package/components/tela/menubar/menubar-content.vue +77 -0
- package/components/tela/menubar/menubar-item.vue +32 -0
- package/components/tela/menubar/menubar-label.vue +14 -0
- package/components/tela/menubar/menubar-menu.vue +12 -0
- package/components/tela/menubar/menubar-root.vue +30 -0
- package/components/tela/menubar/menubar-separator.vue +17 -0
- package/components/tela/menubar/menubar-shortcut.vue +14 -0
- package/components/tela/menubar/menubar-sub-content.vue +36 -0
- package/components/tela/menubar/menubar-sub-trigger.vue +28 -0
- package/components/tela/menubar/menubar-sub.vue +20 -0
- package/components/tela/menubar/menubar-trigger.vue +27 -0
- package/components/tela/menubar/menubar.vue +298 -0
- package/components/tela/modal/modal.mdx +145 -0
- package/components/tela/modal/modal.vue +242 -0
- package/components/tela/multiple-select/multiple-select.mdx +274 -0
- package/components/tela/multiple-select/multiple-select.stories.ts +325 -0
- package/components/tela/multiple-select/multiple-select.vue +666 -0
- package/components/tela/pane.vue +110 -0
- package/components/tela/popover/popover-content.vue +48 -0
- package/components/tela/popover/popover-trigger.vue +12 -0
- package/components/tela/popover/popover.mdx +239 -0
- package/components/tela/popover/popover.stories.ts +150 -0
- package/components/tela/popover/popover.vue +15 -0
- package/components/tela/popover-list/popover-list-nested.vue +104 -0
- package/components/tela/popover-list/popover-list.stories.ts +330 -0
- package/components/tela/popover-list/popover-list.vue +191 -0
- package/components/tela/radio-button.vue +66 -0
- package/components/tela/radio-group/radio-group-item.vue +40 -0
- package/components/tela/radio-group/radio-group-root.vue +26 -0
- package/components/tela/radio-group/radio-group.mdx +78 -0
- package/components/tela/radio-group/radio-group.stories.ts +106 -0
- package/components/tela/radio-group/radio-group.vue +23 -0
- package/components/tela/range-calendar.stories.ts +110 -0
- package/components/tela/range-calendar.vue +109 -0
- package/components/tela/scroll-area/scroll-area.mdx +183 -0
- package/components/tela/scroll-area/scroll-area.vue +30 -0
- package/components/tela/scroll-area/scroll-bar.vue +31 -0
- package/components/tela/segment-toggle.stories.ts +114 -0
- package/components/tela/segment-toggle.vue +66 -0
- package/components/tela/select-menu/select-menu-content.vue +106 -0
- package/components/tela/select-menu/select-menu-down-button.vue +20 -0
- package/components/tela/select-menu/select-menu-group.vue +16 -0
- package/components/tela/select-menu/select-menu-item.vue +40 -0
- package/components/tela/select-menu/select-menu-root.vue +15 -0
- package/components/tela/select-menu/select-menu-trigger.vue +34 -0
- package/components/tela/select-menu/select-menu-up-button.vue +20 -0
- package/components/tela/select-menu/select-menu-value.vue +12 -0
- package/components/tela/select-menu/select-menu.mdx +221 -0
- package/components/tela/select-menu/select-menu.stories.ts +91 -0
- package/components/tela/select-menu/select-menu.vue +165 -0
- package/components/tela/selector/selector.vue +47 -0
- package/components/tela/sheet/sheet-close.vue +12 -0
- package/components/tela/sheet/sheet-content.vue +57 -0
- package/components/tela/sheet/sheet-description.vue +23 -0
- package/components/tela/sheet/sheet-footer.vue +18 -0
- package/components/tela/sheet/sheet-header.vue +15 -0
- package/components/tela/sheet/sheet-root.vue +18 -0
- package/components/tela/sheet/sheet-title.vue +23 -0
- package/components/tela/sheet/sheet-trigger.vue +12 -0
- package/components/tela/sheet/sheet.client.vue +150 -0
- package/components/tela/sheet/sheet.mdx +176 -0
- package/components/tela/sheet/sheet.stories.ts +201 -0
- package/components/tela/sheet/variants.ts +22 -0
- package/components/tela/side-sheet/side-sheet.mdx +131 -0
- package/components/tela/side-sheet/side-sheet.stories.ts +134 -0
- package/components/tela/side-sheet/side-sheet.vue +106 -0
- package/components/tela/skeleton/skeleton.mdx +165 -0
- package/components/tela/skeleton/skeleton.stories.ts +35 -0
- package/components/tela/skeleton/skeleton.vue +45 -0
- package/components/tela/skeleton-icon.vue +24 -0
- package/components/tela/span.vue +24 -0
- package/components/tela/star-button.vue +70 -0
- package/components/tela/status/status-lean.vue +30 -0
- package/components/tela/status/status.mdx +187 -0
- package/components/tela/status/status.stories.ts +160 -0
- package/components/tela/status/status.vue +420 -0
- package/components/tela/status-bar/status-bar.mdx +178 -0
- package/components/tela/status-bar/status-bar.stories.ts +64 -0
- package/components/tela/status-bar/status-bar.vue +56 -0
- package/components/tela/status-bar/types.ts +5 -0
- package/components/tela/switch/switch.mdx +118 -0
- package/components/tela/switch/switch.stories.ts +80 -0
- package/components/tela/switch/switch.vue +56 -0
- package/components/tela/table/table-body.vue +13 -0
- package/components/tela/table/table-caption.vue +13 -0
- package/components/tela/table/table-cell.vue +20 -0
- package/components/tela/table/table-empty.vue +37 -0
- package/components/tela/table/table-footer.vue +13 -0
- package/components/tela/table/table-head.vue +13 -0
- package/components/tela/table/table-header.vue +13 -0
- package/components/tela/table/table-row.vue +13 -0
- package/components/tela/table/table.mdx +230 -0
- package/components/tela/table/table.stories.ts +384 -0
- package/components/tela/table/table.vue +15 -0
- package/components/tela/tabs/tabs-content.vue +20 -0
- package/components/tela/tabs/tabs-indicator.vue +22 -0
- package/components/tela/tabs/tabs-list.vue +23 -0
- package/components/tela/tabs/tabs-root.vue +15 -0
- package/components/tela/tabs/tabs-trigger.vue +27 -0
- package/components/tela/tabs/tabs.mdx +138 -0
- package/components/tela/tabs/tabs.stories.ts +72 -0
- package/components/tela/tabs/tabs.vue +61 -0
- package/components/tela/tags/tags-select.mdx +318 -0
- package/components/tela/tags/tags-select.stories.ts +47 -0
- package/components/tela/tags/tags-select.vue +637 -0
- package/components/tela/tags/tags.mdx +151 -0
- package/components/tela/tags/tags.stories.ts +118 -0
- package/components/tela/tags/tags.vue +112 -0
- package/components/tela/textarea/textarea.mdx +102 -0
- package/components/tela/textarea/textarea.stories.ts +50 -0
- package/components/tela/textarea/textarea.vue +34 -0
- package/components/tela/toggle-group.vue +91 -0
- package/components/tela/tooltip/tooltip-content.vue +45 -0
- package/components/tela/tooltip/tooltip-provider.vue +12 -0
- package/components/tela/tooltip/tooltip-root.vue +15 -0
- package/components/tela/tooltip/tooltip-trigger.vue +12 -0
- package/components/tela/tooltip/tooltip.mdx +196 -0
- package/components/tela/tooltip/tooltip.stories.ts +200 -0
- package/components/tela/tooltip/tooltip.vue +91 -0
- package/components/tela/tooltip-group/tooltip-group-trigger.vue +92 -0
- package/components/tela/tooltip-group/tooltip-group.mdx +236 -0
- package/components/tela/tooltip-group/tooltip-group.stories.ts +465 -0
- package/components/tela/tooltip-group/tooltip-group.vue +35 -0
- package/components/tela/transparent-input.vue +151 -0
- package/components/tela/variable-icon.vue +28 -0
- package/components/tela/variable-input.vue +77 -0
- package/components/tela/wide-button/wide-button.vue +40 -0
- package/components.json +18 -0
- package/composables/status-toast.ts +67 -0
- package/css/reset.css +386 -0
- package/css/text.css +22 -0
- package/lib/doc-generator.ts +903 -0
- package/lib/extractors/volar-extract.ts +186 -0
- package/lib/type-resolver.ts +402 -0
- package/lib/utils.ts +6 -0
- package/modules/tela-build-docs/index.ts +139 -0
- package/nuxt.config.ts +80 -0
- package/package.json +84 -0
- package/plugins/test-id.ts +7 -0
- package/tsconfig.json +7 -0
- package/types/custom-icon.ts +1 -0
- package/types/index.ts +2 -0
- package/types/status.ts +1 -0
- package/unocss.config.ts +89 -0
- package/utils/component-utils.ts +30 -0
- package/utils/design-tokens.ts +431 -0
- package/utils/fold.ts +8 -0
- package/utils/select-menu.ts +10 -0
- package/utils/status.ts +1 -0
- package/utils/without-keys.ts +34 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
DialogClose,
|
|
4
|
+
DialogContent,
|
|
5
|
+
DialogOverlay,
|
|
6
|
+
DialogPortal,
|
|
7
|
+
DialogRoot,
|
|
8
|
+
} from 'radix-vue'
|
|
9
|
+
|
|
10
|
+
defineOptions({
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
defineProps<{
|
|
15
|
+
overlayClass?: string
|
|
16
|
+
title?: string
|
|
17
|
+
}>()
|
|
18
|
+
|
|
19
|
+
const emit = defineEmits<{
|
|
20
|
+
close: []
|
|
21
|
+
}>()
|
|
22
|
+
|
|
23
|
+
const open = defineModel<boolean>()
|
|
24
|
+
|
|
25
|
+
watch(open, (value) => {
|
|
26
|
+
if (!value)
|
|
27
|
+
emit('close')
|
|
28
|
+
})
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<DialogRoot v-model:open="open">
|
|
33
|
+
<DialogPortal>
|
|
34
|
+
<DialogOverlay class="DialogOverlay" :class="overlayClass" bg="gray-700/70" z-600>
|
|
35
|
+
<DialogContent
|
|
36
|
+
:class="`DialogContent ${$attrs?.class}`"
|
|
37
|
+
z-101
|
|
38
|
+
flex="~ col"
|
|
39
|
+
class="h-100dvh"
|
|
40
|
+
bg-white
|
|
41
|
+
p-24px
|
|
42
|
+
v-bind="$attrs"
|
|
43
|
+
>
|
|
44
|
+
<DialogClose as-child>
|
|
45
|
+
<TelaIconButton absolute right-24px top-24px icon="i-ph-x" size="sm" color="secondary" outline-none />
|
|
46
|
+
</DialogClose>
|
|
47
|
+
|
|
48
|
+
<div v-if="title" body-16-semibold>
|
|
49
|
+
{{ title }}
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div mt-16px flex-1>
|
|
53
|
+
<slot />
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div
|
|
57
|
+
v-if="$slots.footer"
|
|
58
|
+
@click.stop
|
|
59
|
+
>
|
|
60
|
+
<slot name="footer" />
|
|
61
|
+
</div>
|
|
62
|
+
</DialogContent>
|
|
63
|
+
</DialogOverlay>
|
|
64
|
+
</DialogPortal>
|
|
65
|
+
</DialogRoot>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<style lang="css" scoped>
|
|
69
|
+
.DialogOverlay {
|
|
70
|
+
position: fixed;
|
|
71
|
+
inset: 0;
|
|
72
|
+
animation: overlayShow 150ms ease-in;
|
|
73
|
+
backdrop-filter: blur(4px);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.DialogContent {
|
|
77
|
+
box-shadow: hsl(206 22% 7% / 35%) 0px 10px 38px -10px, hsl(206 22% 7% / 20%) 0px 10px 20px -15px;
|
|
78
|
+
position: fixed;
|
|
79
|
+
width: 400px;
|
|
80
|
+
bottom: 0;
|
|
81
|
+
right: 0;
|
|
82
|
+
animation: contentShow 250ms ease-out;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.DialogContent:focus {
|
|
86
|
+
outline: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@keyframes overlayShow {
|
|
90
|
+
from {
|
|
91
|
+
opacity: 0;
|
|
92
|
+
}
|
|
93
|
+
to {
|
|
94
|
+
opacity: 1;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@keyframes contentShow {
|
|
99
|
+
from {
|
|
100
|
+
transform: translateX(100%);
|
|
101
|
+
}
|
|
102
|
+
to {
|
|
103
|
+
transform: translateX(0px);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
</style>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { Meta, Canvas, ArgTypes } from '@storybook/blocks';
|
|
2
|
+
import * as SkeletonStories from './skeleton.stories.ts';
|
|
3
|
+
|
|
4
|
+
<Meta of={SkeletonStories} />
|
|
5
|
+
|
|
6
|
+
# TelaSkeleton
|
|
7
|
+
|
|
8
|
+
A skeleton loading component that displays placeholder content while data is loading. Provides a shimmer effect to indicate loading state. Useful for improving perceived performance by showing content structure before actual data loads.
|
|
9
|
+
|
|
10
|
+
## Examples
|
|
11
|
+
|
|
12
|
+
### Basic Usage
|
|
13
|
+
|
|
14
|
+
```vue
|
|
15
|
+
<TelaSkeleton style="width: 300px; height: 40px;" />
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Text Lines
|
|
19
|
+
|
|
20
|
+
```vue
|
|
21
|
+
<div class="flex flex-col gap-2">
|
|
22
|
+
<TelaSkeleton style="width: 100%; height: 16px;" />
|
|
23
|
+
<TelaSkeleton style="width: 90%; height: 16px;" />
|
|
24
|
+
<TelaSkeleton style="width: 95%; height: 16px;" />
|
|
25
|
+
</div>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Avatar
|
|
29
|
+
|
|
30
|
+
```vue
|
|
31
|
+
<TelaSkeleton class="w-12 h-12 rounded-full" />
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Card Loading
|
|
35
|
+
|
|
36
|
+
```vue
|
|
37
|
+
<div class="border border-gray-200 rounded-lg p-4">
|
|
38
|
+
<div class="flex items-center gap-4">
|
|
39
|
+
<TelaSkeleton class="w-12 h-12 rounded-full" />
|
|
40
|
+
<div class="flex-1 flex flex-col gap-2">
|
|
41
|
+
<TelaSkeleton style="width: 60%; height: 16px;" />
|
|
42
|
+
<TelaSkeleton style="width: 40%; height: 14px;" />
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<TelaSkeleton class="mt-4" style="width: 100%; height: 100px;" />
|
|
46
|
+
</div>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Table Loading
|
|
50
|
+
|
|
51
|
+
```vue
|
|
52
|
+
<div class="flex flex-col gap-2">
|
|
53
|
+
<TelaSkeleton style="width: 100%; height: 40px;" />
|
|
54
|
+
<TelaSkeleton style="width: 100%; height: 40px;" />
|
|
55
|
+
<TelaSkeleton style="width: 100%; height: 40px;" />
|
|
56
|
+
<TelaSkeleton style="width: 100%; height: 40px;" />
|
|
57
|
+
</div>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Button
|
|
61
|
+
|
|
62
|
+
```vue
|
|
63
|
+
<TelaSkeleton class="rounded-lg" style="width: 100px; height: 36px;" />
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Custom Shapes
|
|
67
|
+
|
|
68
|
+
```vue
|
|
69
|
+
<!-- Rectangle -->
|
|
70
|
+
<TelaSkeleton class="rounded-lg" style="width: 200px; height: 120px;" />
|
|
71
|
+
|
|
72
|
+
<!-- Circle -->
|
|
73
|
+
<TelaSkeleton class="rounded-full" style="width: 80px; height: 80px;" />
|
|
74
|
+
|
|
75
|
+
<!-- Pill -->
|
|
76
|
+
<TelaSkeleton class="rounded-full" style="width: 120px; height: 32px;" />
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Form Loading
|
|
80
|
+
|
|
81
|
+
```vue
|
|
82
|
+
<div class="flex flex-col gap-4">
|
|
83
|
+
<div>
|
|
84
|
+
<TelaSkeleton class="mb-2" style="width: 80px; height: 14px;" />
|
|
85
|
+
<TelaSkeleton class="rounded-lg" style="width: 100%; height: 40px;" />
|
|
86
|
+
</div>
|
|
87
|
+
<div>
|
|
88
|
+
<TelaSkeleton class="mb-2" style="width: 100px; height: 14px;" />
|
|
89
|
+
<TelaSkeleton class="rounded-lg" style="width: 100%; height: 40px;" />
|
|
90
|
+
</div>
|
|
91
|
+
<TelaSkeleton class="rounded-lg" style="width: 120px; height: 36px;" />
|
|
92
|
+
</div>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### With Conditional Rendering
|
|
96
|
+
|
|
97
|
+
```vue
|
|
98
|
+
<script setup>
|
|
99
|
+
import { ref, onMounted } from 'vue'
|
|
100
|
+
|
|
101
|
+
const isLoading = ref(true)
|
|
102
|
+
const data = ref(null)
|
|
103
|
+
|
|
104
|
+
onMounted(async () => {
|
|
105
|
+
data.value = await fetchData()
|
|
106
|
+
isLoading.value = false
|
|
107
|
+
})
|
|
108
|
+
</script>
|
|
109
|
+
|
|
110
|
+
<template>
|
|
111
|
+
<div v-if="isLoading" class="flex flex-col gap-2">
|
|
112
|
+
<TelaSkeleton style="width: 100%; height: 20px;" />
|
|
113
|
+
<TelaSkeleton style="width: 90%; height: 20px;" />
|
|
114
|
+
</div>
|
|
115
|
+
<div v-else>
|
|
116
|
+
<h2>{{ data.title }}</h2>
|
|
117
|
+
<p>{{ data.content }}</p>
|
|
118
|
+
</div>
|
|
119
|
+
</template>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Props
|
|
123
|
+
|
|
124
|
+
<ArgTypes />
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
type SkeletonProps = {
|
|
128
|
+
class?: string
|
|
129
|
+
style?: CSSProperties
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Features
|
|
134
|
+
|
|
135
|
+
- **Shimmer Effect**: Animated pulse/shimmer effect
|
|
136
|
+
- **Flexible Sizing**: Control with inline styles or classes
|
|
137
|
+
- **Custom Shapes**: Round, square, or custom shapes
|
|
138
|
+
- **Responsive**: Works with responsive utilities
|
|
139
|
+
- **Lightweight**: Minimal performance impact
|
|
140
|
+
- **Composable**: Build complex loading states
|
|
141
|
+
|
|
142
|
+
## Use Cases
|
|
143
|
+
|
|
144
|
+
- **Text Loading**: Placeholder for titles and paragraphs
|
|
145
|
+
- **Images**: Placeholder for images and avatars
|
|
146
|
+
- **Cards**: Loading state for card components
|
|
147
|
+
- **Tables**: Placeholder rows in tables
|
|
148
|
+
- **Forms**: Loading state for form fields
|
|
149
|
+
- **Lists**: Placeholder items in lists
|
|
150
|
+
- **Profile Headers**: Combined avatar and text placeholders
|
|
151
|
+
|
|
152
|
+
## Best Practices
|
|
153
|
+
|
|
154
|
+
1. **Match Content Structure**: Skeleton should match the shape and layout of actual content
|
|
155
|
+
2. **Use Appropriate Sizes**: Match skeleton dimensions to loaded content
|
|
156
|
+
3. **Keep it Simple**: Don't over-complicate skeleton UI
|
|
157
|
+
4. **Show Progress**: Use skeletons for perceived performance
|
|
158
|
+
5. **Timeout**: Consider showing different UI if loading takes too long
|
|
159
|
+
|
|
160
|
+
## Accessibility
|
|
161
|
+
|
|
162
|
+
- Purely decorative loading indicator
|
|
163
|
+
- Should be hidden from screen readers (aria-hidden)
|
|
164
|
+
- Provide loading announcements separately
|
|
165
|
+
- Replace with actual content when loaded
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import Skeleton from './skeleton.vue'
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Skeleton> = {
|
|
5
|
+
title: 'Core/Skeleton',
|
|
6
|
+
component: Skeleton,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: 'A skeleton loading component that displays placeholder content while data is loading. Provides a shimmer effect to indicate loading state. Useful for improving perceived performance by showing content structure before actual data loads.',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
class: {
|
|
17
|
+
control: 'text',
|
|
18
|
+
description: 'Custom CSS classes to apply to the skeleton element.',
|
|
19
|
+
},
|
|
20
|
+
style: {
|
|
21
|
+
control: 'object',
|
|
22
|
+
description: 'Inline styles to apply to the skeleton element.',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default meta
|
|
28
|
+
type Story = StoryObj<typeof Skeleton>
|
|
29
|
+
|
|
30
|
+
export const Default: Story = {
|
|
31
|
+
render: () => ({
|
|
32
|
+
components: { Skeleton },
|
|
33
|
+
template: `<Skeleton style="width: 300px; height: 40px; border-radius: 8px;" />`,
|
|
34
|
+
}),
|
|
35
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
name: 'Skeleton',
|
|
4
|
+
}
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<div class="skeleton-wrapper">
|
|
9
|
+
<div class="skeleton-animation" />
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<style scoped>
|
|
14
|
+
.skeleton-wrapper {
|
|
15
|
+
position: relative;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
border-radius: 4px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.skeleton-animation {
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
border-radius: 4px;
|
|
24
|
+
background: var(--Grey-Grey60, #EFF1F3);
|
|
25
|
+
animation: skeleton-pulse 1.1s infinite linear;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@keyframes skeleton-pulse {
|
|
29
|
+
0% {
|
|
30
|
+
background: var(--Grey-Grey60, #EFF1F3);
|
|
31
|
+
}
|
|
32
|
+
22.73% { /* 250ms / 1100ms total */
|
|
33
|
+
background: var(--Grey-Grey60, #EFF1F3);
|
|
34
|
+
}
|
|
35
|
+
50% {
|
|
36
|
+
background: var(--Grey-Grey20, #FAFBFB);
|
|
37
|
+
}
|
|
38
|
+
77.27% { /* back to lighter for 300ms */
|
|
39
|
+
background: var(--Grey-Grey20, #FAFBFB);
|
|
40
|
+
}
|
|
41
|
+
100% {
|
|
42
|
+
background: var(--Grey-Grey60, #EFF1F3);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
icon: string
|
|
4
|
+
}>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<TelaStatus
|
|
9
|
+
:icon="icon"
|
|
10
|
+
only-icon
|
|
11
|
+
status="empty"
|
|
12
|
+
animate-pulse
|
|
13
|
+
class="text-gray-400 bg-gray-200 align-center justify-center !rounded-[5px] !w-[20px] !h-[20px] !p-[4px] ![&>div]:w-[10px] ![&>div]:h-[10px] ![&>div]:font-580"
|
|
14
|
+
/>
|
|
15
|
+
<div flex-item w-full>
|
|
16
|
+
<TelaSkeleton
|
|
17
|
+
v-for="width in ['100%', '50%']"
|
|
18
|
+
:key="width"
|
|
19
|
+
bg-gray-200
|
|
20
|
+
:style="{ width }"
|
|
21
|
+
h-6px m-2 rounded-4px
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
label: string
|
|
4
|
+
icon?: string
|
|
5
|
+
iconSize?: string
|
|
6
|
+
}>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<span
|
|
11
|
+
rounded-7px flex="~" items-center
|
|
12
|
+
body-12-medium
|
|
13
|
+
gap-4px
|
|
14
|
+
pl-5px pr-5px py-4px
|
|
15
|
+
bg-white
|
|
16
|
+
text-gray-500
|
|
17
|
+
border-1
|
|
18
|
+
cursor-default
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
<TelaIcon v-if="icon" :name="icon" :size="iconSize ?? 'md'" />
|
|
22
|
+
<span>{{ label }}</span>
|
|
23
|
+
</span>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, watch } from 'vue'
|
|
3
|
+
import type { HTMLAttributes } from 'vue'
|
|
4
|
+
import { cn } from '../../utils/component-utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
modelValue: boolean
|
|
8
|
+
size?: 'xs' | 'sm' | 'md'
|
|
9
|
+
class?: HTMLAttributes['class']
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const emit = defineEmits<{
|
|
13
|
+
'update:modelValue': [boolean]
|
|
14
|
+
}>()
|
|
15
|
+
|
|
16
|
+
const shouldExplode = ref(false)
|
|
17
|
+
|
|
18
|
+
watch(() => props.modelValue, (newValue, oldValue) => {
|
|
19
|
+
if (newValue && !oldValue) {
|
|
20
|
+
shouldExplode.value = true
|
|
21
|
+
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
shouldExplode.value = false
|
|
24
|
+
}, 600)
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<div relative inline-flex>
|
|
31
|
+
<TelaIconButton
|
|
32
|
+
:icon="modelValue ? 'i-ph-star-fill' : 'i-ph-star-light'"
|
|
33
|
+
color="secondary"
|
|
34
|
+
:size="size"
|
|
35
|
+
:class="cn(props.class)"
|
|
36
|
+
:icon-class="cn('relative z-1', modelValue ? 'text-amber-400!' : 'text-neutral-400!')"
|
|
37
|
+
@click.stop.prevent="emit('update:modelValue', !modelValue)"
|
|
38
|
+
/>
|
|
39
|
+
<div v-if="shouldExplode" absolute pointer-events-none z-0 class="top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2">
|
|
40
|
+
<span v-for="i in 8" :key="i" class="particle" :style="{ '--index': i }" />
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<style scoped>
|
|
46
|
+
.particle {
|
|
47
|
+
position: absolute;
|
|
48
|
+
width: 4px;
|
|
49
|
+
height: 4px;
|
|
50
|
+
border-radius: 50%;
|
|
51
|
+
background: radial-gradient(circle, #F2C351 0%, #E8A341 100%);
|
|
52
|
+
animation: explode 0.6s ease-out forwards;
|
|
53
|
+
--angle: calc(var(--index) * 45deg);
|
|
54
|
+
--distance: 20px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@keyframes explode {
|
|
58
|
+
0% {
|
|
59
|
+
transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) scale(1);
|
|
60
|
+
opacity: 1;
|
|
61
|
+
}
|
|
62
|
+
50% {
|
|
63
|
+
opacity: 0.8;
|
|
64
|
+
}
|
|
65
|
+
100% {
|
|
66
|
+
transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--distance)) scale(0);
|
|
67
|
+
opacity: 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
status: TelaStatusValue
|
|
4
|
+
icon?: string
|
|
5
|
+
}>()
|
|
6
|
+
|
|
7
|
+
const classes = {
|
|
8
|
+
empty: 'bg-gray-50 text-gray-500',
|
|
9
|
+
neutral: 'bg-#F0F0F1 text-#9A9DA1',
|
|
10
|
+
warning: 'bg-#FFF2DB text-yellow-700',
|
|
11
|
+
error: 'bg-#FFDBDB text-red-900',
|
|
12
|
+
success: 'bg-#DBFFEE text-emerald-600',
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div class="flex items-center space-x-2">
|
|
18
|
+
<div
|
|
19
|
+
v-if="icon"
|
|
20
|
+
class="flex items-center justify-center p-1 rounded-5px"
|
|
21
|
+
h-20px w-20px
|
|
22
|
+
:class="classes[status]"
|
|
23
|
+
>
|
|
24
|
+
<TelaIcon :name="icon" class="w-[10px]! h-[10px]!" />
|
|
25
|
+
</div>
|
|
26
|
+
<span :class="`text-xs font-medium ${classes[status].split(' ')[1]}`">
|
|
27
|
+
<slot />
|
|
28
|
+
</span>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { Meta, Canvas, ArgTypes } from '@storybook/blocks';
|
|
2
|
+
import * as StatusStories from './status.stories.ts';
|
|
3
|
+
|
|
4
|
+
<Meta of={StatusStories} />
|
|
5
|
+
|
|
6
|
+
# TelaStatus
|
|
7
|
+
|
|
8
|
+
A status component that displays different workflow and task statuses with appropriate icons, colors, and labels. Supports multiple status types including pending, running, completed, error, and review states. Features smooth animations and automatic width transitions for a polished user experience.
|
|
9
|
+
|
|
10
|
+
## Examples
|
|
11
|
+
|
|
12
|
+
### Default Status
|
|
13
|
+
|
|
14
|
+
<Canvas of={StatusStories.Default} />
|
|
15
|
+
|
|
16
|
+
### All Available Variants
|
|
17
|
+
|
|
18
|
+
<Canvas of={StatusStories.AllVariants} />
|
|
19
|
+
|
|
20
|
+
### Animated Transitions
|
|
21
|
+
|
|
22
|
+
<Canvas of={StatusStories.AnimatedTransitions} />
|
|
23
|
+
|
|
24
|
+
### Basic Usage
|
|
25
|
+
|
|
26
|
+
```vue
|
|
27
|
+
<TelaStatus variant="running" />
|
|
28
|
+
<TelaStatus variant="completed" />
|
|
29
|
+
<TelaStatus variant="error" />
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### With Custom Label
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<TelaStatus variant="running" label="Processing your request..." />
|
|
36
|
+
<TelaStatus variant="completed" label="Successfully uploaded" />
|
|
37
|
+
<TelaStatus variant="error" label="Upload failed" />
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### In Workflows
|
|
41
|
+
|
|
42
|
+
```vue
|
|
43
|
+
<div class="flex flex-col gap-2">
|
|
44
|
+
<TelaStatus variant="pending-run" />
|
|
45
|
+
<TelaStatus variant="running" />
|
|
46
|
+
<TelaStatus variant="completed" />
|
|
47
|
+
</div>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### In Tables
|
|
51
|
+
|
|
52
|
+
```vue
|
|
53
|
+
<table>
|
|
54
|
+
<tr>
|
|
55
|
+
<td>Task 1</td>
|
|
56
|
+
<td><TelaStatus variant="completed" /></td>
|
|
57
|
+
</tr>
|
|
58
|
+
<tr>
|
|
59
|
+
<td>Task 2</td>
|
|
60
|
+
<td><TelaStatus variant="running" /></td>
|
|
61
|
+
</tr>
|
|
62
|
+
<tr>
|
|
63
|
+
<td>Task 3</td>
|
|
64
|
+
<td><TelaStatus variant="pending-run" /></td>
|
|
65
|
+
</tr>
|
|
66
|
+
</table>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Props
|
|
70
|
+
|
|
71
|
+
<ArgTypes />
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
type Variant =
|
|
75
|
+
| 'pending-run' | 'preparing-run' | 'waiting' | 'on-hold' | 'queued'
|
|
76
|
+
| 'validation-error' | 'running' | 'executing' | 'processing' | 'verifying'
|
|
77
|
+
| 'initializing' | 'waiting-user' | 'awaiting-approval' | 'paused'
|
|
78
|
+
| 'stopped' | 'suspended' | 'running-issues' | 'warning' | 'low-coverage' | 'medium-coverage' | 'completed' | 'success'
|
|
79
|
+
| 'error' | 'failed' | 'cancelled' | 'archived' | 'reported' | 'expired'
|
|
80
|
+
| 'pending-review' | 'reviewing' | 'reviewed' | 'approved'
|
|
81
|
+
| 'approved-changes' | 'reproved' | 'partially-completed'
|
|
82
|
+
|
|
83
|
+
type StatusProps = {
|
|
84
|
+
variant?: Variant
|
|
85
|
+
label?: string
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Variant Categories
|
|
90
|
+
|
|
91
|
+
### Pending States (Gray)
|
|
92
|
+
- **pending-run**: Task is pending execution
|
|
93
|
+
- **preparing-run**: Preparing to start
|
|
94
|
+
- **waiting**: Waiting in queue
|
|
95
|
+
- **on-hold**: Temporarily on hold
|
|
96
|
+
- **queued**: Queued for processing
|
|
97
|
+
|
|
98
|
+
### Active/Running States (Neutral with spinner)
|
|
99
|
+
- **running**: Currently executing
|
|
100
|
+
- **executing**: Active execution
|
|
101
|
+
- **processing**: Processing data
|
|
102
|
+
- **verifying**: Verifying results
|
|
103
|
+
- **initializing**: Starting up
|
|
104
|
+
|
|
105
|
+
### Waiting for Input (Sky Blue)
|
|
106
|
+
- **waiting-user**: Waiting for user action
|
|
107
|
+
- **awaiting-approval**: Needs approval
|
|
108
|
+
|
|
109
|
+
### Paused States (Gray)
|
|
110
|
+
- **paused**: Temporarily paused
|
|
111
|
+
- **stopped**: Stopped execution
|
|
112
|
+
- **suspended**: Suspended state
|
|
113
|
+
|
|
114
|
+
### Warning States (Amber)
|
|
115
|
+
- **running-issues**: Running but with issues
|
|
116
|
+
- **warning**: Warning
|
|
117
|
+
- **low-coverage**: Low coverage
|
|
118
|
+
- **medium-coverage**: Medium coverage
|
|
119
|
+
- **validation-error**: Validation failed
|
|
120
|
+
|
|
121
|
+
### Success States (Green)
|
|
122
|
+
- **completed**: Successfully completed
|
|
123
|
+
- **success**: Success state
|
|
124
|
+
- **approved**: Approved
|
|
125
|
+
- **approved-changes**: Approved with changes
|
|
126
|
+
|
|
127
|
+
### Review States (Sky Blue)
|
|
128
|
+
- **pending-review**: Awaiting review
|
|
129
|
+
- **reviewing**: Currently under review
|
|
130
|
+
- **reviewed**: Review completed
|
|
131
|
+
|
|
132
|
+
### Error States (Red)
|
|
133
|
+
- **error**: Error occurred
|
|
134
|
+
- **failed**: Failed execution
|
|
135
|
+
- **validation-error**: Validation error
|
|
136
|
+
- **reproved**: Rejected/reproved
|
|
137
|
+
|
|
138
|
+
### Inactive States (Gray)
|
|
139
|
+
- **cancelled**: Cancelled by user
|
|
140
|
+
- **archived**: Archived
|
|
141
|
+
- **reported**: Reported
|
|
142
|
+
- **expired**: Expired
|
|
143
|
+
- **partially-completed**: Partially done
|
|
144
|
+
|
|
145
|
+
## Features
|
|
146
|
+
|
|
147
|
+
- **35+ Status Variants**: Comprehensive status types for different workflows
|
|
148
|
+
- **Animated Icons**: Smooth icon transitions using Framer Motion
|
|
149
|
+
- **Automatic Width Transitions**: Content animates smoothly between states
|
|
150
|
+
- **Custom Labels**: Override default labels with custom text
|
|
151
|
+
- **Color-Coded**: Intuitive color schemes for each status category
|
|
152
|
+
- **Compact Design**: Small footprint for inline use
|
|
153
|
+
- **Spring Animations**: Natural, spring-based motion for status changes
|
|
154
|
+
|
|
155
|
+
## Animation
|
|
156
|
+
|
|
157
|
+
The component uses Framer Motion for smooth animations:
|
|
158
|
+
- **Icon Transitions**: Icons fade and slide vertically when status changes
|
|
159
|
+
- **Width Adjustments**: Container width adapts smoothly to label length
|
|
160
|
+
- **Spring Physics**: Natural, bouncy motion with 0.3s duration
|
|
161
|
+
|
|
162
|
+
## Use Cases
|
|
163
|
+
|
|
164
|
+
- **Workflow Status**: Display task execution states in workflows
|
|
165
|
+
- **Task Management**: Show task progress and completion
|
|
166
|
+
- **Process Monitoring**: Indicate system process states
|
|
167
|
+
- **Review Workflows**: Track review and approval states
|
|
168
|
+
- **Form Submissions**: Display form processing states
|
|
169
|
+
- **API Operations**: Show request status (pending, loading, success, error)
|
|
170
|
+
- **Job Queues**: Display job execution states
|
|
171
|
+
- **Document Status**: Track document lifecycle states
|
|
172
|
+
|
|
173
|
+
## Accessibility
|
|
174
|
+
|
|
175
|
+
- Clear visual indicators with icons and colors
|
|
176
|
+
- Text labels provide context
|
|
177
|
+
- Color is not the sole indicator (icons included)
|
|
178
|
+
- Smooth animations respect user preferences
|
|
179
|
+
- Semantic HTML structure
|
|
180
|
+
|
|
181
|
+
## Styling
|
|
182
|
+
|
|
183
|
+
Each variant includes:
|
|
184
|
+
- **Background Color**: Contextual background matching the state
|
|
185
|
+
- **Text Color**: High-contrast text for readability
|
|
186
|
+
- **Icon**: Unique icon representing the state
|
|
187
|
+
- **Icon Color**: Coordinated with overall color scheme
|