@wise/dynamic-flow-client 3.20.1 → 3.20.2

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/build/main.mjs CHANGED
@@ -6123,12 +6123,6 @@ var decisionLayoutOptionSchema = z.object({
6123
6123
  icon: iconSchema.optional(),
6124
6124
  image: imageLayoutSchema.optional()
6125
6125
  });
6126
- var statusListLayoutItemSchema = z.object({
6127
- title: z.string(),
6128
- description: z.string().optional(),
6129
- icon: iconSchema,
6130
- status: statusListLayoutStatusSchema.optional()
6131
- });
6132
6126
  var instructionsLayoutSchema = z.object({
6133
6127
  type: z.literal("instructions"),
6134
6128
  title: z.string().optional(),
@@ -6136,6 +6130,10 @@ var instructionsLayoutSchema = z.object({
6136
6130
  control: z.string().optional(),
6137
6131
  margin: sizeSchema.optional()
6138
6132
  });
6133
+ var behaviorSchema = z.object({
6134
+ action: actionSchema.optional(),
6135
+ link: linkSchema.optional()
6136
+ });
6139
6137
  var buttonLayoutSchema = z.object({
6140
6138
  type: z.literal("button"),
6141
6139
  size: sizeSchema.optional(),
@@ -6152,10 +6150,6 @@ var reviewLayoutFieldSchema = z.object({
6152
6150
  value: z.string(),
6153
6151
  help: helpSchema.optional()
6154
6152
  });
6155
- var behaviorSchema = z.object({
6156
- action: actionSchema.optional(),
6157
- link: linkSchema.optional()
6158
- });
6159
6153
  var searchResultSearchSchema = z.object({
6160
6154
  type: z.literal("search"),
6161
6155
  title: z.string(),
@@ -6216,12 +6210,10 @@ var decisionLayoutSchema = z.object({
6216
6210
  control: z.string().optional(),
6217
6211
  margin: sizeSchema.optional()
6218
6212
  });
6219
- var statusListLayoutSchema = z.object({
6220
- type: z.literal("status-list"),
6221
- items: z.array(statusListLayoutItemSchema),
6222
- title: z.string().optional(),
6223
- control: z.string().optional(),
6224
- margin: sizeSchema.optional()
6213
+ var itemCallToActionSchema = z.object({
6214
+ title: z.string(),
6215
+ accessibilityDescription: z.string().optional(),
6216
+ behavior: behaviorSchema
6225
6217
  });
6226
6218
  var reviewLayoutSchema = z.object({
6227
6219
  type: z.literal("review"),
@@ -6255,6 +6247,13 @@ var alertLayoutSchema = z.object({
6255
6247
  margin: sizeSchema.optional(),
6256
6248
  callToAction: alertLayoutCallToActionSchema.optional()
6257
6249
  });
6250
+ var statusListLayoutItemSchema = z.object({
6251
+ title: z.string(),
6252
+ description: z.string().optional(),
6253
+ icon: iconSchema,
6254
+ status: statusListLayoutStatusSchema.optional(),
6255
+ callToAction: itemCallToActionSchema.optional()
6256
+ });
6258
6257
  var searchResponseBodySchema = z.object({
6259
6258
  results: z.array(searchResultSchema)
6260
6259
  });
@@ -6296,6 +6295,13 @@ var constSchemaSchema = z.object({
6296
6295
  analyticsId: z.string().optional(),
6297
6296
  disabled: z.boolean().optional()
6298
6297
  });
6298
+ var statusListLayoutSchema = z.object({
6299
+ type: z.literal("status-list"),
6300
+ items: z.array(statusListLayoutItemSchema),
6301
+ title: z.string().optional(),
6302
+ control: z.string().optional(),
6303
+ margin: sizeSchema.optional()
6304
+ });
6299
6305
  var layoutSchema = z.lazy(
6300
6306
  () => z.union([
6301
6307
  alertLayoutSchema,
@@ -16311,7 +16317,7 @@ var _FormControl = class _FormControl extends PureComponent {
16311
16317
  UNSAFE_inputAttributes: {
16312
16318
  id,
16313
16319
  "aria-invalid": invalid,
16314
- "aria-labelledby": void 0,
16320
+ "aria-labelledby": labelledBy,
16315
16321
  "aria-describedby": describedBy
16316
16322
  },
16317
16323
  onChange: this.handleOnChange
@@ -16343,7 +16349,7 @@ var _FormControl = class _FormControl extends PureComponent {
16343
16349
  UNSAFE_triggerButtonProps: {
16344
16350
  id,
16345
16351
  "aria-invalid": invalid,
16346
- "aria-labelledby": void 0,
16352
+ "aria-labelledby": labelledBy,
16347
16353
  "aria-describedby": describedBy
16348
16354
  },
16349
16355
  items: items.map((value2) => ({
@@ -16864,11 +16870,12 @@ function OneOfSchema(props) {
16864
16870
  "has-error": !changed && props.errors && !isEmpty(props.errors) || (props.submitted || changed && blurred) && validations.length
16865
16871
  };
16866
16872
  const feedbackId = `${id}-feedback`;
16873
+ const labelId = `${id}-label`;
16867
16874
  return /* @__PURE__ */ jsxs32(Fragment15, { children: [
16868
16875
  (props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ jsxs32(Fragment15, { children: [
16869
16876
  props.schema.alert && /* @__PURE__ */ jsx91(DynamicAlert_default, { component: props.schema.alert }),
16870
16877
  /* @__PURE__ */ jsxs32("div", { className: (0, import_classnames11.default)(formGroupClasses), children: [
16871
- getTitleAndHelp(props.schema, id),
16878
+ getTitleAndHelp(props.schema, id, labelId),
16872
16879
  /* @__PURE__ */ jsx91(
16873
16880
  SchemaFormControl_default,
16874
16881
  {
@@ -16878,6 +16885,7 @@ function OneOfSchema(props) {
16878
16885
  disabled,
16879
16886
  invalid: !isEmpty(props.errors) || validations.length > 0,
16880
16887
  describedBy: feedbackId,
16888
+ labelledBy: labelId,
16881
16889
  required,
16882
16890
  onChange: onChooseNewSchema,
16883
16891
  onFocus,
@@ -16916,10 +16924,10 @@ function OneOfSchema(props) {
16916
16924
  )
16917
16925
  ] });
16918
16926
  }
16919
- function getTitleAndHelp(schema, forId) {
16927
+ function getTitleAndHelp(schema, forId, labelId) {
16920
16928
  var _a;
16921
16929
  const helpElement = schema.help ? /* @__PURE__ */ jsx91(Help_default2, { help: schema.help }) : null;
16922
- const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ jsx91("div", { className: "m-b-1", children: /* @__PURE__ */ jsxs32("label", { className: "control-label d-inline", htmlFor: forId, children: [
16930
+ const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ jsx91("div", { className: "m-b-1", children: /* @__PURE__ */ jsxs32("label", { className: "control-label d-inline", id: labelId, htmlFor: forId, children: [
16923
16931
  schema.title,
16924
16932
  " ",
16925
16933
  helpElement
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "3.20.1",
3
+ "version": "3.20.2",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -103,7 +103,7 @@
103
103
  "nanoid": "5.0.7",
104
104
  "react-webcam": "^7.2.0",
105
105
  "screenfull": "^5.2.0",
106
- "@wise/dynamic-flow-types": "2.22.4"
106
+ "@wise/dynamic-flow-types": "2.23.0"
107
107
  },
108
108
  "scripts": {
109
109
  "dev": "pnpm build:visual-tests && storybook dev -p 3003",