@ttoss/react-wizard 0.13.0 → 0.13.1

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/index.cjs CHANGED
@@ -194,25 +194,30 @@ var getWizardStepIndicatorSx = ({
194
194
  } : {})
195
195
  };
196
196
  };
197
- /**
198
- * A vertical list's separators share whatever height the content leaves, so
199
- * next to a short step they would shrink to nothing and the steps would touch:
200
- * each keeps at least this much, and the wizard grows instead.
201
- */
202
- var VERTICAL_SEPARATOR_MIN_HEIGHT = "1.5rem";
203
197
  var getWizardStepSeparatorSx = ({
204
198
  isCompleted,
205
- isVertical = false,
206
199
  variant = "spotlight-accent"
207
200
  }) => {
208
201
  return {
209
202
  backgroundColor: getVariantStyles(variant).accentTextColor,
210
- opacity: isCompleted ? 1 : .4,
211
- ...(isVertical ? {
212
- minHeight: VERTICAL_SEPARATOR_MIN_HEIGHT
213
- } : {})
203
+ opacity: isCompleted ? 1 : .4
214
204
  };
215
205
  };
206
+ /**
207
+ * In a vertical list the separator is absolute, as tall as its step's item
208
+ * less the indicator and its gutters, and the items share whatever height the
209
+ * content leaves: next to a short step they shrink to the indicator and the
210
+ * line disappears. Every item but the last keeps room for a visible line, and
211
+ * the wizard grows instead.
212
+ */
213
+ var getWizardStepItemSx = ({
214
+ isVertical,
215
+ isLast
216
+ }) => {
217
+ return isVertical && !isLast ? {
218
+ minHeight: "calc(var(--steps-size) + var(--steps-gutter) * 2 + 1.5rem)"
219
+ } : {};
220
+ };
216
221
  var getWizardStepTitleSx = ({
217
222
  status,
218
223
  variant = "spotlight-accent"
@@ -375,6 +380,10 @@ var WizardStepList = ({
375
380
  const isClickable = allowStepClick && status === "completed" && index !== currentStep;
376
381
  return /* @__PURE__ */(0, react_jsx_runtime.jsxs)(_chakra_ui_react.Steps.Item, {
377
382
  index,
383
+ css: getWizardStepItemSx({
384
+ isVertical: !isHorizontal,
385
+ isLast: index === steps.length - 1
386
+ }),
378
387
  children: [/* @__PURE__ */(0, react_jsx_runtime.jsxs)(_ttoss_ui.Flex, {
379
388
  role: "button",
380
389
  tabIndex: isClickable ? 0 : -1,
@@ -416,7 +425,6 @@ var WizardStepList = ({
416
425
  isCompleted: getStepStatus({
417
426
  stepIndex: index + 1
418
427
  }) !== "upcoming",
419
- isVertical: !isHorizontal,
420
428
  variant
421
429
  })
422
430
  })]
package/dist/index.mjs CHANGED
@@ -163,25 +163,30 @@ var getWizardStepIndicatorSx = ({
163
163
  } : {})
164
164
  };
165
165
  };
166
- /**
167
- * A vertical list's separators share whatever height the content leaves, so
168
- * next to a short step they would shrink to nothing and the steps would touch:
169
- * each keeps at least this much, and the wizard grows instead.
170
- */
171
- var VERTICAL_SEPARATOR_MIN_HEIGHT = "1.5rem";
172
166
  var getWizardStepSeparatorSx = ({
173
167
  isCompleted,
174
- isVertical = false,
175
168
  variant = "spotlight-accent"
176
169
  }) => {
177
170
  return {
178
171
  backgroundColor: getVariantStyles(variant).accentTextColor,
179
- opacity: isCompleted ? 1 : .4,
180
- ...(isVertical ? {
181
- minHeight: VERTICAL_SEPARATOR_MIN_HEIGHT
182
- } : {})
172
+ opacity: isCompleted ? 1 : .4
183
173
  };
184
174
  };
175
+ /**
176
+ * In a vertical list the separator is absolute, as tall as its step's item
177
+ * less the indicator and its gutters, and the items share whatever height the
178
+ * content leaves: next to a short step they shrink to the indicator and the
179
+ * line disappears. Every item but the last keeps room for a visible line, and
180
+ * the wizard grows instead.
181
+ */
182
+ var getWizardStepItemSx = ({
183
+ isVertical,
184
+ isLast
185
+ }) => {
186
+ return isVertical && !isLast ? {
187
+ minHeight: "calc(var(--steps-size) + var(--steps-gutter) * 2 + 1.5rem)"
188
+ } : {};
189
+ };
185
190
  var getWizardStepTitleSx = ({
186
191
  status,
187
192
  variant = "spotlight-accent"
@@ -347,6 +352,10 @@ var WizardStepList = ({
347
352
  const isClickable = allowStepClick && status === "completed" && index !== currentStep;
348
353
  return /* @__PURE__ */jsxs(Steps.Item, {
349
354
  index,
355
+ css: getWizardStepItemSx({
356
+ isVertical: !isHorizontal,
357
+ isLast: index === steps.length - 1
358
+ }),
350
359
  children: [/* @__PURE__ */jsxs(Flex, {
351
360
  role: "button",
352
361
  tabIndex: isClickable ? 0 : -1,
@@ -388,7 +397,6 @@ var WizardStepList = ({
388
397
  isCompleted: getStepStatus({
389
398
  stepIndex: index + 1
390
399
  }) !== "upcoming",
391
- isVertical: !isHorizontal,
392
400
  variant
393
401
  })
394
402
  })]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/react-wizard",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "A React wizard component for guiding users through multi-step flows with configurable step list layouts.",
5
5
  "keywords": [
6
6
  "React",
@@ -40,19 +40,19 @@
40
40
  "jest": "^30.5.2",
41
41
  "react": "^19.3.0",
42
42
  "tsdown": "^0.23.1",
43
- "@ttoss/config": "^4.0.1",
43
+ "@ttoss/i18n-cli": "^0.16.1",
44
44
  "@ttoss/react-i18n": "^4.0.2",
45
- "@ttoss/forms": "^0.53.3",
46
- "@ttoss/test-utils": "^7.1.1",
47
45
  "@ttoss/ui": "^9.0.2",
48
- "@ttoss/i18n-cli": "^0.16.1"
46
+ "@ttoss/config": "^4.0.1",
47
+ "@ttoss/test-utils": "^7.1.1",
48
+ "@ttoss/forms": "^0.53.3"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@chakra-ui/react": "^3",
52
52
  "react": ">=16.8.0",
53
53
  "react-icons": "^5",
54
- "@ttoss/ui": "^9.0.2",
55
- "@ttoss/react-i18n": "^4.0.2"
54
+ "@ttoss/react-i18n": "^4.0.2",
55
+ "@ttoss/ui": "^9.0.2"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public",