@makolabs/ripple 1.0.2 → 1.0.4

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.
@@ -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 flex items-center justify-center transition-all duration-200',
32
- content: 'relative z-10 flex flex-col items-center justify-center px-4 text-center',
33
- label: 'font-medium text-gray-700 leading-tight',
34
- count: 'font-bold text-gray-900',
35
- chevron: 'absolute inset-0',
36
- chevronPath: 'fill-current'
31
+ stage: 'relative transition-all duration-300',
32
+ borderLayer: 'absolute inset-0 transition-all duration-300',
33
+ innerLayer: 'relative flex items-center justify-center bg-white transition-all duration-300',
34
+ content: 'text-center flex flex-col items-center justify-center',
35
+ label: 'font-medium text-gray-600 leading-tight break-words',
36
+ count: 'font-bold text-gray-900'
37
37
  },
38
38
  variants: {
39
39
  size: {
40
40
  sm: {
41
- stage: 'h-16 min-w-[120px]',
42
- label: 'text-xs',
43
- count: 'text-lg mt-1',
44
- content: 'px-3'
41
+ stage: 'min-w-[130px]',
42
+ borderLayer: 'h-20',
43
+ innerLayer: 'h-20',
44
+ label: 'text-[11px] max-w-[100px]',
45
+ count: 'text-xl mt-0.5',
46
+ content: 'px-4'
45
47
  },
46
48
  base: {
47
- stage: 'h-20 min-w-[150px]',
48
- label: 'text-sm',
49
+ stage: 'min-w-[150px]',
50
+ borderLayer: 'h-24',
51
+ innerLayer: 'h-24',
52
+ label: 'text-xs max-w-[120px]',
49
53
  count: 'text-2xl mt-1',
50
- content: 'px-4'
54
+ content: 'px-5'
51
55
  },
52
56
  lg: {
53
- stage: 'h-24 min-w-[180px]',
54
- label: 'text-base',
55
- count: 'text-3xl mt-2',
56
- content: 'px-5'
57
+ stage: 'min-w-[180px]',
58
+ borderLayer: 'h-28',
59
+ innerLayer: 'h-28',
60
+ label: 'text-sm max-w-[150px]',
61
+ count: 'text-3xl mt-1',
62
+ content: 'px-6'
57
63
  }
58
64
  },
59
65
  color: {
60
66
  default: {
61
- chevronPath: 'text-gray-100'
67
+ borderLayer: 'bg-gray-200'
62
68
  },
63
69
  primary: {
64
- chevronPath: 'text-blue-100',
65
- label: 'text-blue-900',
66
- count: 'text-blue-900'
70
+ borderLayer: 'bg-blue-500',
71
+ label: 'text-gray-700',
72
+ count: 'text-gray-900'
67
73
  },
68
74
  success: {
69
- chevronPath: 'text-green-100',
70
- label: 'text-green-900',
71
- count: 'text-green-900'
75
+ borderLayer: 'bg-green-500',
76
+ label: 'text-gray-700',
77
+ count: 'text-gray-900'
72
78
  },
73
79
  warning: {
74
- chevronPath: 'text-orange-100',
75
- label: 'text-orange-900',
76
- count: 'text-orange-900'
80
+ borderLayer: 'bg-amber-500',
81
+ label: 'text-gray-700',
82
+ count: 'text-gray-900'
77
83
  },
78
84
  danger: {
79
- chevronPath: 'text-red-100',
80
- label: 'text-red-900',
81
- count: 'text-red-900'
85
+ borderLayer: 'bg-rose-500',
86
+ label: 'text-gray-700',
87
+ count: 'text-gray-900'
82
88
  },
83
89
  info: {
84
- chevronPath: 'text-purple-100',
85
- label: 'text-purple-900',
86
- count: 'text-purple-900'
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
- stage: 'ring-2 ring-offset-2',
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
- <div
121
- class={getStageStyles(stage).stage()}
122
- >
123
- <!-- Chevron SVG Background -->
124
- <svg
125
- class={getStageStyles(stage).chevron()}
126
- viewBox="0 0 200 80"
127
- preserveAspectRatio="none"
128
- xmlns="http://www.w3.org/2000/svg"
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
- <!-- Content -->
170
- <div class={getStageStyles(stage).content()}>
171
- {#if children}
172
- {@render children(stage, index)}
173
- {:else}
174
- <span class={getStageStyles(stage).label()}>
175
- {stage.label}
176
- </span>
177
- {#if stage.count !== undefined}
178
- <span class={getStageStyles(stage).count()}>
179
- {stage.count}
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
- {/if}
154
+ </div>
183
155
  </div>
184
156
  </div>
185
157
  {/each}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makolabs/ripple",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Simple Svelte 5 powered component library ✨",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {