@ttoss/react-wizard 0.8.6 → 0.8.8

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
@@ -208,6 +208,38 @@ var useWizard = () => {
208
208
 
209
209
  //#endregion
210
210
  //#region src/WizardStepList.tsx
211
+ var messages$1 = (0, _ttoss_react_i18n.defineMessages)({
212
+ stepListLabel: {
213
+ defaultMessage: "Wizard steps",
214
+ description: "Wizard: accessible name of the list of steps."
215
+ }
216
+ });
217
+ var WizardStepText = ({
218
+ step,
219
+ status,
220
+ variant
221
+ }) => {
222
+ if (!step.title && !step.description) return null;
223
+ return /* @__PURE__ */(0, react_jsx_runtime.jsxs)(_ttoss_ui.Box, {
224
+ sx: WizardStepTextWrapperSx,
225
+ children: [step.title && /* @__PURE__ */(0, react_jsx_runtime.jsx)(_chakra_ui_react.Steps.Title, {
226
+ css: getWizardStepTitleSx({
227
+ status,
228
+ variant
229
+ }),
230
+ children: step.title
231
+ }), step.description && /* @__PURE__ */(0, react_jsx_runtime.jsx)(_ttoss_ui.Flex, {
232
+ sx: WizardStepDescriptionFlexSx,
233
+ children: /* @__PURE__ */(0, react_jsx_runtime.jsx)(_chakra_ui_react.Steps.Description, {
234
+ css: getWizardStepDescriptionSx({
235
+ status,
236
+ variant
237
+ }),
238
+ children: step.description
239
+ })
240
+ })]
241
+ });
242
+ };
211
243
  var WizardStepList = ({
212
244
  steps,
213
245
  currentStep,
@@ -217,11 +249,14 @@ var WizardStepList = ({
217
249
  getStepStatus,
218
250
  onStepClick
219
251
  }) => {
252
+ const {
253
+ intl
254
+ } = (0, _ttoss_react_i18n.useI18n)();
220
255
  const isHorizontal = layout === "top" || layout === "bottom";
221
256
  const orientation = isHorizontal ? "horizontal" : "vertical";
222
257
  return /* @__PURE__ */(0, react_jsx_runtime.jsx)(_ttoss_ui.Flex, {
223
258
  role: "navigation",
224
- "aria-label": "Wizard steps",
259
+ "aria-label": intl.formatMessage(messages$1.stepListLabel),
225
260
  "data-variant": variant,
226
261
  sx: getWizardStepListSx({
227
262
  layout,
@@ -276,24 +311,10 @@ var WizardStepList = ({
276
311
  incomplete: /* @__PURE__ */(0, react_jsx_runtime.jsx)(_chakra_ui_react.Steps.Number, {})
277
312
  })
278
313
  })
279
- }), (step.title || step.description) && /* @__PURE__ */(0, react_jsx_runtime.jsxs)(_ttoss_ui.Box, {
280
- sx: WizardStepTextWrapperSx,
281
- children: [step.title && /* @__PURE__ */(0, react_jsx_runtime.jsx)(_chakra_ui_react.Steps.Title, {
282
- css: getWizardStepTitleSx({
283
- status,
284
- variant
285
- }),
286
- children: step.title
287
- }), step.description && /* @__PURE__ */(0, react_jsx_runtime.jsx)(_ttoss_ui.Flex, {
288
- sx: WizardStepDescriptionFlexSx,
289
- children: /* @__PURE__ */(0, react_jsx_runtime.jsx)(_chakra_ui_react.Steps.Description, {
290
- css: getWizardStepDescriptionSx({
291
- status,
292
- variant
293
- }),
294
- children: step.description
295
- })
296
- })]
314
+ }), /* @__PURE__ */(0, react_jsx_runtime.jsx)(WizardStepText, {
315
+ step,
316
+ status,
317
+ variant
297
318
  })]
298
319
  }), index < steps.length - 1 && /* @__PURE__ */(0, react_jsx_runtime.jsx)(_chakra_ui_react.Steps.Separator, {
299
320
  css: getWizardStepSeparatorSx({
package/dist/index.mjs CHANGED
@@ -176,6 +176,41 @@ var useWizard = () => {
176
176
 
177
177
  //#endregion
178
178
  //#region src/WizardStepList.tsx
179
+ var messages$1 = defineMessages({
180
+ stepListLabel: {
181
+ id: "mVLnY8",
182
+ defaultMessage: [{
183
+ "type": 0,
184
+ "value": "Wizard steps"
185
+ }]
186
+ }
187
+ });
188
+ var WizardStepText = ({
189
+ step,
190
+ status,
191
+ variant
192
+ }) => {
193
+ if (!step.title && !step.description) return null;
194
+ return /* @__PURE__ */jsxs(Box, {
195
+ sx: WizardStepTextWrapperSx,
196
+ children: [step.title && /* @__PURE__ */jsx(Steps.Title, {
197
+ css: getWizardStepTitleSx({
198
+ status,
199
+ variant
200
+ }),
201
+ children: step.title
202
+ }), step.description && /* @__PURE__ */jsx(Flex, {
203
+ sx: WizardStepDescriptionFlexSx,
204
+ children: /* @__PURE__ */jsx(Steps.Description, {
205
+ css: getWizardStepDescriptionSx({
206
+ status,
207
+ variant
208
+ }),
209
+ children: step.description
210
+ })
211
+ })]
212
+ });
213
+ };
179
214
  var WizardStepList = ({
180
215
  steps,
181
216
  currentStep,
@@ -185,11 +220,14 @@ var WizardStepList = ({
185
220
  getStepStatus,
186
221
  onStepClick
187
222
  }) => {
223
+ const {
224
+ intl
225
+ } = useI18n();
188
226
  const isHorizontal = layout === "top" || layout === "bottom";
189
227
  const orientation = isHorizontal ? "horizontal" : "vertical";
190
228
  return /* @__PURE__ */jsx(Flex, {
191
229
  role: "navigation",
192
- "aria-label": "Wizard steps",
230
+ "aria-label": intl.formatMessage(messages$1.stepListLabel),
193
231
  "data-variant": variant,
194
232
  sx: getWizardStepListSx({
195
233
  layout,
@@ -244,24 +282,10 @@ var WizardStepList = ({
244
282
  incomplete: /* @__PURE__ */jsx(Steps.Number, {})
245
283
  })
246
284
  })
247
- }), (step.title || step.description) && /* @__PURE__ */jsxs(Box, {
248
- sx: WizardStepTextWrapperSx,
249
- children: [step.title && /* @__PURE__ */jsx(Steps.Title, {
250
- css: getWizardStepTitleSx({
251
- status,
252
- variant
253
- }),
254
- children: step.title
255
- }), step.description && /* @__PURE__ */jsx(Flex, {
256
- sx: WizardStepDescriptionFlexSx,
257
- children: /* @__PURE__ */jsx(Steps.Description, {
258
- css: getWizardStepDescriptionSx({
259
- status,
260
- variant
261
- }),
262
- children: step.description
263
- })
264
- })]
285
+ }), /* @__PURE__ */jsx(WizardStepText, {
286
+ step,
287
+ status,
288
+ variant
265
289
  })]
266
290
  }), index < steps.length - 1 && /* @__PURE__ */jsx(Steps.Separator, {
267
291
  css: getWizardStepSeparatorSx({
@@ -22,5 +22,11 @@
22
22
  "type": 0,
23
23
  "value": "Next"
24
24
  }
25
+ ],
26
+ "mVLnY8": [
27
+ {
28
+ "type": 0,
29
+ "value": "Wizard steps"
30
+ }
25
31
  ]
26
32
  }
@@ -22,5 +22,11 @@
22
22
  "type": 0,
23
23
  "value": "Avançar"
24
24
  }
25
+ ],
26
+ "mVLnY8": [
27
+ {
28
+ "type": 0,
29
+ "value": "Etapas do assistente"
30
+ }
25
31
  ]
26
32
  }
package/i18n/lang/en.json CHANGED
@@ -14,5 +14,9 @@
14
14
  "FmaVut": {
15
15
  "defaultMessage": "Next",
16
16
  "description": "Label for the next step button in the wizard."
17
+ },
18
+ "mVLnY8": {
19
+ "defaultMessage": "Wizard steps",
20
+ "description": "Wizard: accessible name of the list of steps."
17
21
  }
18
22
  }
@@ -14,5 +14,9 @@
14
14
  "FmaVut": {
15
15
  "defaultMessage": "Avançar",
16
16
  "description": "Label for the next step button in the wizard."
17
+ },
18
+ "mVLnY8": {
19
+ "defaultMessage": "Etapas do assistente",
20
+ "description": "Wizard: accessible name of the list of steps."
17
21
  }
18
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/react-wizard",
3
- "version": "0.8.6",
3
+ "version": "0.8.8",
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",
@@ -41,18 +41,18 @@
41
41
  "react": "^19.2.6",
42
42
  "tsdown": "^0.22.2",
43
43
  "@ttoss/config": "^1.41.0",
44
- "@ttoss/forms": "^0.50.6",
45
44
  "@ttoss/i18n-cli": "^0.13.0",
46
- "@ttoss/react-i18n": "^2.7.2",
47
- "@ttoss/test-utils": "^4.4.0",
48
- "@ttoss/ui": "^6.11.1"
45
+ "@ttoss/react-i18n": "^2.8.0",
46
+ "@ttoss/test-utils": "^4.5.0",
47
+ "@ttoss/ui": "^6.12.0",
48
+ "@ttoss/forms": "^0.50.8"
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": "^6.11.1",
55
- "@ttoss/react-i18n": "^2.7.2"
54
+ "@ttoss/react-i18n": "^2.8.0",
55
+ "@ttoss/ui": "^6.12.0"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public",