@makolabs/ripple 1.0.2 → 1.0.3
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/pipeline/Pipeline.svelte +64 -92
- package/package.json +1 -1
|
@@ -28,68 +28,73 @@
|
|
|
28
28
|
const pipeline = tv({
|
|
29
29
|
slots: {
|
|
30
30
|
container: 'flex items-center gap-0 w-full',
|
|
31
|
-
stage: 'relative
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
stage: 'relative transition-all duration-300',
|
|
32
|
+
borderLayer: 'absolute inset-0 h-20 transition-all duration-300',
|
|
33
|
+
innerLayer: 'relative h-20 flex items-center justify-center bg-white transition-all duration-300',
|
|
34
|
+
content: 'text-center px-4',
|
|
35
|
+
label: 'text-xs mb-1 leading-tight font-medium tracking-wide text-gray-600',
|
|
36
|
+
count: 'text-2xl font-bold tracking-tight text-gray-900'
|
|
37
37
|
},
|
|
38
38
|
variants: {
|
|
39
39
|
size: {
|
|
40
40
|
sm: {
|
|
41
|
-
stage: '
|
|
41
|
+
stage: 'min-w-[100px]',
|
|
42
|
+
borderLayer: 'h-16',
|
|
43
|
+
innerLayer: 'h-16',
|
|
42
44
|
label: 'text-xs',
|
|
43
|
-
count: 'text-lg
|
|
45
|
+
count: 'text-lg',
|
|
44
46
|
content: 'px-3'
|
|
45
47
|
},
|
|
46
48
|
base: {
|
|
47
|
-
stage: '
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
stage: 'min-w-[120px]',
|
|
50
|
+
borderLayer: 'h-20',
|
|
51
|
+
innerLayer: 'h-20',
|
|
52
|
+
label: 'text-xs',
|
|
53
|
+
count: 'text-2xl',
|
|
50
54
|
content: 'px-4'
|
|
51
55
|
},
|
|
52
56
|
lg: {
|
|
53
|
-
stage: '
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
stage: 'min-w-[140px]',
|
|
58
|
+
borderLayer: 'h-24',
|
|
59
|
+
innerLayer: 'h-24',
|
|
60
|
+
label: 'text-sm',
|
|
61
|
+
count: 'text-3xl',
|
|
56
62
|
content: 'px-5'
|
|
57
63
|
}
|
|
58
64
|
},
|
|
59
65
|
color: {
|
|
60
66
|
default: {
|
|
61
|
-
|
|
67
|
+
borderLayer: 'bg-gray-200'
|
|
62
68
|
},
|
|
63
69
|
primary: {
|
|
64
|
-
|
|
65
|
-
label: 'text-
|
|
66
|
-
count: 'text-
|
|
70
|
+
borderLayer: 'bg-blue-500',
|
|
71
|
+
label: 'text-gray-700',
|
|
72
|
+
count: 'text-gray-900'
|
|
67
73
|
},
|
|
68
74
|
success: {
|
|
69
|
-
|
|
70
|
-
label: 'text-
|
|
71
|
-
count: 'text-
|
|
75
|
+
borderLayer: 'bg-green-500',
|
|
76
|
+
label: 'text-gray-700',
|
|
77
|
+
count: 'text-gray-900'
|
|
72
78
|
},
|
|
73
79
|
warning: {
|
|
74
|
-
|
|
75
|
-
label: 'text-
|
|
76
|
-
count: 'text-
|
|
80
|
+
borderLayer: 'bg-amber-500',
|
|
81
|
+
label: 'text-gray-700',
|
|
82
|
+
count: 'text-gray-900'
|
|
77
83
|
},
|
|
78
84
|
danger: {
|
|
79
|
-
|
|
80
|
-
label: 'text-
|
|
81
|
-
count: 'text-
|
|
85
|
+
borderLayer: 'bg-rose-500',
|
|
86
|
+
label: 'text-gray-700',
|
|
87
|
+
count: 'text-gray-900'
|
|
82
88
|
},
|
|
83
89
|
info: {
|
|
84
|
-
|
|
85
|
-
label: 'text-
|
|
86
|
-
count: 'text-
|
|
90
|
+
borderLayer: 'bg-purple-500',
|
|
91
|
+
label: 'text-gray-700',
|
|
92
|
+
count: 'text-gray-900'
|
|
87
93
|
}
|
|
88
94
|
},
|
|
89
95
|
active: {
|
|
90
96
|
true: {
|
|
91
|
-
|
|
92
|
-
chevronPath: 'brightness-110'
|
|
97
|
+
borderLayer: 'ring-2 ring-blue-500 ring-offset-2'
|
|
93
98
|
}
|
|
94
99
|
},
|
|
95
100
|
equalWidth: {
|
|
@@ -117,69 +122,36 @@
|
|
|
117
122
|
|
|
118
123
|
<div class="{styles.container()} {className}">
|
|
119
124
|
{#each stages as stage, index}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
>
|
|
130
|
-
{#if index === 0}
|
|
131
|
-
<!-- First item - no tail -->
|
|
132
|
-
<path
|
|
133
|
-
d="M 0 0 L 160 0 L 200 40 L 160 80 L 0 80 Z"
|
|
134
|
-
class={getStageStyles(stage).chevronPath()}
|
|
135
|
-
/>
|
|
136
|
-
<path
|
|
137
|
-
d="M 0 0 L 160 0 L 200 40 L 160 80 L 0 80 Z"
|
|
138
|
-
fill="none"
|
|
139
|
-
stroke={stage.active ? 'rgb(59 130 246)' : 'rgb(209 213 219)'}
|
|
140
|
-
stroke-width="2"
|
|
141
|
-
/>
|
|
142
|
-
{:else if index === stages.length - 1}
|
|
143
|
-
<!-- Last item - no arrow -->
|
|
144
|
-
<path
|
|
145
|
-
d="M 0 0 L 200 0 L 200 80 L 0 80 L 40 40 Z"
|
|
146
|
-
class={getStageStyles(stage).chevronPath()}
|
|
147
|
-
/>
|
|
148
|
-
<path
|
|
149
|
-
d="M 0 0 L 200 0 L 200 80 L 0 80 L 40 40 Z"
|
|
150
|
-
fill="none"
|
|
151
|
-
stroke={stage.active ? 'rgb(59 130 246)' : 'rgb(209 213 219)'}
|
|
152
|
-
stroke-width="2"
|
|
153
|
-
/>
|
|
154
|
-
{:else}
|
|
155
|
-
<!-- Middle items - full chevron -->
|
|
156
|
-
<path
|
|
157
|
-
d="M 0 0 L 160 0 L 200 40 L 160 80 L 0 80 L 40 40 Z"
|
|
158
|
-
class={getStageStyles(stage).chevronPath()}
|
|
159
|
-
/>
|
|
160
|
-
<path
|
|
161
|
-
d="M 0 0 L 160 0 L 200 40 L 160 80 L 0 80 L 40 40 Z"
|
|
162
|
-
fill="none"
|
|
163
|
-
stroke={stage.active ? 'rgb(59 130 246)' : 'rgb(209 213 219)'}
|
|
164
|
-
stroke-width="2"
|
|
165
|
-
/>
|
|
166
|
-
{/if}
|
|
167
|
-
</svg>
|
|
125
|
+
{@const isFirst = index === 0}
|
|
126
|
+
{@const isLast = index === stages.length - 1}
|
|
127
|
+
{@const chevronWidth = 20}
|
|
128
|
+
|
|
129
|
+
<div class={getStageStyles(stage).stage()} style="{!isFirst ? `margin-left: -${chevronWidth}px; z-index: ${stages.length - index}` : `z-index: ${stages.length - index}`}">
|
|
130
|
+
<!-- BACKGROUND LAYER (Border color - larger) -->
|
|
131
|
+
<div
|
|
132
|
+
class="{getStageStyles(stage).borderLayer()}"
|
|
133
|
+
style="clip-path: polygon({isFirst ? '0' : '0'} 0%, calc(100% - {chevronWidth}px) 0%, 100% 50%, calc(100% - {chevronWidth}px) 100%, {isFirst ? '0' : '0'} 100%, {isFirst ? '0' : `${chevronWidth}px`} 50%);"
|
|
134
|
+
></div>
|
|
168
135
|
|
|
169
|
-
<!--
|
|
170
|
-
<div
|
|
171
|
-
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
{
|
|
178
|
-
<span class={getStageStyles(stage).
|
|
179
|
-
{stage.
|
|
136
|
+
<!-- FOREGROUND LAYER (White - smaller, creates border effect) -->
|
|
137
|
+
<div
|
|
138
|
+
class="{getStageStyles(stage).innerLayer()}"
|
|
139
|
+
style="clip-path: polygon({isFirst ? '2px' : '2px'} 2px, calc(100% - {chevronWidth}px - 2px) 2px, calc(100% - 2px) 50%, calc(100% - {chevronWidth}px - 2px) calc(100% - 2px), {isFirst ? '2px' : '2px'} calc(100% - 2px), {isFirst ? '2px' : `${chevronWidth + 2}px`} 50%);"
|
|
140
|
+
>
|
|
141
|
+
<div class={getStageStyles(stage).content()}>
|
|
142
|
+
{#if children}
|
|
143
|
+
{@render children(stage, index)}
|
|
144
|
+
{:else}
|
|
145
|
+
<span class={getStageStyles(stage).label()}>
|
|
146
|
+
{stage.label}
|
|
180
147
|
</span>
|
|
148
|
+
{#if stage.count !== undefined}
|
|
149
|
+
<span class={getStageStyles(stage).count()}>
|
|
150
|
+
{stage.count}
|
|
151
|
+
</span>
|
|
152
|
+
{/if}
|
|
181
153
|
{/if}
|
|
182
|
-
|
|
154
|
+
</div>
|
|
183
155
|
</div>
|
|
184
156
|
</div>
|
|
185
157
|
{/each}
|