@makolabs/ripple 1.11.0 → 1.12.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.
@@ -10,6 +10,7 @@
10
10
  class: className = '',
11
11
  size = 'base',
12
12
  equalWidth = true,
13
+ chevronGap = 0,
13
14
  selectedClass,
14
15
  unselectedClass,
15
16
  disabledClass,
@@ -33,8 +34,11 @@
33
34
  });
34
35
  }
35
36
 
36
- function borderClassesFor(stage: PipelineStage, base: string): string {
37
- return cn(base, stage.active ? selectedClass : unselectedClass);
37
+ function stateClassesFor(stage: PipelineStage): string | undefined {
38
+ if (stage.disabled) return undefined; // disabledClass applied separately
39
+ return stage.active
40
+ ? (selectedClass as string | undefined)
41
+ : (unselectedClass as string | undefined);
38
42
  }
39
43
 
40
44
  function borderClipPath(isFirst: boolean): string {
@@ -81,12 +85,18 @@
81
85
  {@const s = getStageStyles(stage)}
82
86
  {@const isFirst = index === 0}
83
87
  {@const renderAsButton = !!onstageclick}
88
+ {@const marginLeft = chevronGap - CHEVRON_WIDTH}
84
89
  {@const stageStyle = isFirst
85
90
  ? `z-index: ${stages.length - index}`
86
- : `margin-left: -${CHEVRON_WIDTH}px; z-index: ${stages.length - index}`}
91
+ : `margin-left: ${marginLeft}px; z-index: ${stages.length - index}`}
87
92
 
88
93
  <div
89
- class={cn('flex flex-col', s.stage(), stage.disabled ? disabledClass : undefined)}
94
+ class={cn(
95
+ 'flex flex-col',
96
+ s.stage(),
97
+ stateClassesFor(stage),
98
+ stage.disabled ? disabledClass : undefined
99
+ )}
90
100
  style={stageStyle}
91
101
  data-pipeline-stage=""
92
102
  role={onstagehover || onstageleave ? 'group' : undefined}
@@ -96,7 +106,7 @@
96
106
  onmouseleave={onstageleave ? (e) => handleStageMouseLeave(stage, index, e) : undefined}
97
107
  >
98
108
  <div
99
- class={borderClassesFor(stage, s.borderLayer())}
109
+ class={s.borderLayer()}
100
110
  data-pipeline-border=""
101
111
  style="clip-path: {borderClipPath(isFirst)};"
102
112
  ></div>
@@ -106,6 +116,7 @@
106
116
  type="button"
107
117
  class={s.innerLayer()}
108
118
  style="clip-path: {innerClipPath(isFirst)};"
119
+ data-pipeline-inner=""
109
120
  disabled={stage.disabled}
110
121
  aria-disabled={stage.disabled ? 'true' : undefined}
111
122
  onclick={(e) => handleStageClick(stage, index, e)}
@@ -113,7 +124,11 @@
113
124
  {@render stageContent(stage, index, s)}
114
125
  </button>
115
126
  {:else}
116
- <div class={s.innerLayer()} style="clip-path: {innerClipPath(isFirst)};">
127
+ <div
128
+ class={s.innerLayer()}
129
+ style="clip-path: {innerClipPath(isFirst)};"
130
+ data-pipeline-inner=""
131
+ >
117
132
  {@render stageContent(stage, index, s)}
118
133
  </div>
119
134
  {/if}
@@ -20,6 +20,13 @@ export type PipelineProps = {
20
20
  class?: ClassValue;
21
21
  size?: 'sm' | 'base' | 'lg';
22
22
  equalWidth?: boolean;
23
+ /**
24
+ * Pixels of visible gap between chevrons. Independent of the chevron tip width.
25
+ * - `0` (default): tips tuck into notches, no visible gap
26
+ * - positive: visible gap between stages (reduces overlap)
27
+ * - negative: more overlap than default (tips extend past notches)
28
+ */
29
+ chevronGap?: number;
23
30
  children?: Snippet<[PipelineStage, number]>;
24
31
  beneathChildren?: Snippet<[PipelineStage, number]>;
25
32
  selectedClass?: ClassValue;
@@ -57,7 +57,7 @@ export declare const pipelineVariants: import("tailwind-variants").TVReturnType<
57
57
  };
58
58
  active: {
59
59
  true: {
60
- borderLayer: string;
60
+ innerLayer: string;
61
61
  };
62
62
  };
63
63
  equalWidth: {
@@ -142,7 +142,7 @@ export declare const pipelineVariants: import("tailwind-variants").TVReturnType<
142
142
  };
143
143
  active: {
144
144
  true: {
145
- borderLayer: string;
145
+ innerLayer: string;
146
146
  };
147
147
  };
148
148
  equalWidth: {
@@ -227,7 +227,7 @@ export declare const pipelineVariants: import("tailwind-variants").TVReturnType<
227
227
  };
228
228
  active: {
229
229
  true: {
230
- borderLayer: string;
230
+ innerLayer: string;
231
231
  };
232
232
  };
233
233
  equalWidth: {
@@ -66,7 +66,7 @@ export const pipelineVariants = tv({
66
66
  },
67
67
  active: {
68
68
  true: {
69
- borderLayer: 'ring-2 ring-blue-500 ring-offset-2'
69
+ innerLayer: 'bg-blue-50 hover:bg-blue-100'
70
70
  }
71
71
  },
72
72
  equalWidth: {
@@ -74,7 +74,7 @@ export const pipelineVariants = tv({
74
74
  },
75
75
  interactive: {
76
76
  true: {
77
- innerLayer: 'cursor-pointer focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2'
77
+ innerLayer: 'cursor-pointer hover:bg-default-100 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2'
78
78
  }
79
79
  },
80
80
  disabled: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makolabs/ripple",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Simple Svelte 5 powered component library ✨",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {