@spscommerce/ds-react 5.21.3 → 5.22.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.
package/lib/index.es.js CHANGED
@@ -23469,14 +23469,14 @@ const SpsFocusedTaskExamples = {
23469
23469
  <div className="sfg-row">
23470
23470
  <div className="sfg-col-3"></div>
23471
23471
  <div className="sfg-col-6">
23472
- <SpsCard>
23472
+ <SpsCardV2>
23473
23473
  <i>pretend there's a form here</i>
23474
- </SpsCard>
23474
+ </SpsCardV2>
23475
23475
  </div>
23476
23476
  <div className="sfg-col-3"></div>
23477
23477
  </div>
23478
23478
  <SpsFocusedTaskActions>
23479
- <SpsButton kind="confirm" onClick={onFormSubmit}>
23479
+ <SpsButton kind={ButtonKind.CONFIRM} onClick={onFormSubmit}>
23480
23480
  Submit
23481
23481
  </SpsButton>
23482
23482
  </SpsFocusedTaskActions>
@@ -23510,14 +23510,14 @@ const SpsFocusedTaskExamples = {
23510
23510
  <div className="sfg-row">
23511
23511
  <div className="sfg-col-3"></div>
23512
23512
  <div className="sfg-col-6">
23513
- <SpsCard>
23513
+ <SpsCardV2>
23514
23514
  <i>pretend there's a form here</i>
23515
- </SpsCard>
23515
+ </SpsCardV2>
23516
23516
  </div>
23517
23517
  <div className="sfg-col-3"></div>
23518
23518
  </div>
23519
23519
  <SpsFocusedTaskActions>
23520
- <SpsButton kind="confirm" onClick={onFormSubmit}>
23520
+ <SpsButton kind={ButtonKind.CONFIRM} onClick={onFormSubmit}>
23521
23521
  Submit
23522
23522
  </SpsButton>
23523
23523
  </SpsFocusedTaskActions>
@@ -25238,27 +25238,27 @@ const SpsInsightTileExamples = {
25238
25238
  jsx: code`
25239
25239
  <SpsInsights>
25240
25240
  <SpsInsightTile
25241
- kind={SpsInsightCardKind.GENERAL}
25241
+ kind={SpsInsightTileKind.GENERAL}
25242
25242
  metric="1234"
25243
25243
  title="Insight Tile Title"
25244
25244
  />
25245
25245
  <SpsInsightTile
25246
- kind={SpsInsightCardKind.PROCESSING}
25246
+ kind={SpsInsightTileKind.PROCESSING}
25247
25247
  metric="1234"
25248
25248
  title="Insight Tile Title"
25249
25249
  />
25250
25250
  <SpsInsightTile
25251
- kind={SpsInsightCardKind.SUCCESS}
25251
+ kind={SpsInsightTileKind.SUCCESS}
25252
25252
  metric="1234"
25253
25253
  title="Insight Tile Title"
25254
25254
  />
25255
25255
  <SpsInsightTile
25256
- kind={SpsInsightCardKind.WARNING}
25256
+ kind={SpsInsightTileKind.WARNING}
25257
25257
  metric="1234"
25258
25258
  title="Insight Tile Title"
25259
25259
  />
25260
25260
  <SpsInsightTile
25261
- kind={SpsInsightCardKind.ERROR}
25261
+ kind={SpsInsightTileKind.ERROR}
25262
25262
  metric="1234"
25263
25263
  title="Insight Tile Title"
25264
25264
  />
@@ -25274,49 +25274,49 @@ const SpsInsightTileExamples = {
25274
25274
  jsx: code`
25275
25275
  <SpsInsights>
25276
25276
  <SpsInsightTile
25277
- kind={SpsInsightCardKind.GENERAL}
25277
+ kind={SpsInsightTileKind.GENERAL}
25278
25278
  metric="1234"
25279
25279
  title="Insight Tile Title"
25280
25280
  >
25281
25281
  <span className="gray600 font-weight-bold">Detail:</span> 792 units
25282
25282
  </SpsInsightTile>
25283
25283
  <SpsInsightTile
25284
- kind={SpsInsightCardKind.PROCESSING}
25284
+ kind={SpsInsightTileKind.PROCESSING}
25285
25285
  metric="1234"
25286
25286
  title="Insight Tile Title"
25287
25287
  >
25288
25288
  <span className="gray600 font-weight-bold">Detail:</span> 792 units
25289
25289
  </SpsInsightTile>
25290
25290
  <SpsInsightTile
25291
- kind={SpsInsightCardKind.SUCCESS}
25291
+ kind={SpsInsightTileKind.SUCCESS}
25292
25292
  metric="1234"
25293
25293
  title="Insight Tile Title"
25294
25294
  >
25295
25295
  <span className="gray600 font-weight-bold">Detail:</span> 792 units
25296
25296
  </SpsInsightTile>
25297
25297
  <SpsInsightTile
25298
- kind={SpsInsightCardKind.WARNING}
25298
+ kind={SpsInsightTileKind.WARNING}
25299
25299
  metric="1234"
25300
25300
  title="Insight Tile Title"
25301
25301
  >
25302
25302
  <span className="gray600 font-weight-bold">Detail:</span> 792 units
25303
25303
  </SpsInsightTile>
25304
25304
  <SpsInsightTile
25305
- kind={SpsInsightCardKind.ERROR}
25305
+ kind={SpsInsightTileKind.ERROR}
25306
25306
  metric="1234"
25307
25307
  title="Insight Tile Title"
25308
25308
  >
25309
25309
  <span className="gray600 font-weight-bold">Detail:</span> 792 units
25310
25310
  </SpsInsightTile>
25311
25311
  <SpsInsightTile
25312
- kind={SpsInsightCardKind.SUCCESS}
25312
+ kind={SpsInsightTileKind.SUCCESS}
25313
25313
  metric="1234"
25314
25314
  title="Insight Tile Title"
25315
25315
  >
25316
25316
  <span className="gray600 font-weight-bold">Detail:</span> 792 units
25317
25317
  </SpsInsightTile>
25318
25318
  <SpsInsightTile
25319
- kind={SpsInsightCardKind.ERROR}
25319
+ kind={SpsInsightTileKind.ERROR}
25320
25320
  metric="1234"
25321
25321
  title="Insight Tile Title"
25322
25322
  >
@@ -25334,35 +25334,35 @@ const SpsInsightTileExamples = {
25334
25334
  jsx: code`
25335
25335
  <SpsInsights>
25336
25336
  <SpsInsightTile
25337
- kind={SpsInsightCardKind.GENERAL}
25337
+ kind={SpsInsightTileKind.GENERAL}
25338
25338
  metric="1234"
25339
25339
  title="Insight Tile Title"
25340
25340
  partnerCount="250"
25341
25341
  totalPartners="250"
25342
25342
  />
25343
25343
  <SpsInsightTile
25344
- kind={SpsInsightCardKind.PROCESSING}
25344
+ kind={SpsInsightTileKind.PROCESSING}
25345
25345
  metric="1234"
25346
25346
  title="Insight Tile Title"
25347
25347
  partnerCount="122"
25348
25348
  totalPartners="250"
25349
25349
  />
25350
25350
  <SpsInsightTile
25351
- kind={SpsInsightCardKind.SUCCESS}
25351
+ kind={SpsInsightTileKind.SUCCESS}
25352
25352
  metric="1234"
25353
25353
  title="Insight Tile Title"
25354
25354
  partnerCount="207"
25355
25355
  totalPartners="250"
25356
25356
  />
25357
25357
  <SpsInsightTile
25358
- kind={SpsInsightCardKind.WARNING}
25358
+ kind={SpsInsightTileKind.WARNING}
25359
25359
  metric="1234"
25360
25360
  title="Insight Tile Title"
25361
25361
  partnerCount="12"
25362
25362
  totalPartners="250"
25363
25363
  />
25364
25364
  <SpsInsightTile
25365
- kind={SpsInsightCardKind.ERROR}
25365
+ kind={SpsInsightTileKind.ERROR}
25366
25366
  metric="1234"
25367
25367
  title="Insight Tile Title"
25368
25368
  partnerCount="94"
@@ -25380,19 +25380,19 @@ const SpsInsightTileExamples = {
25380
25380
  jsx: code`
25381
25381
  <SpsInsights>
25382
25382
  <SpsInsightTile
25383
- kind={SpsInsightCardKind.GENERAL}
25383
+ kind={SpsInsightTileKind.GENERAL}
25384
25384
  metric="1234"
25385
25385
  title="Insight Tile Title"
25386
25386
  onClick={() => console.log("insight tile 1 clicked!")}
25387
25387
  />
25388
25388
  <SpsInsightTile
25389
- kind={SpsInsightCardKind.GENERAL}
25389
+ kind={SpsInsightTileKind.GENERAL}
25390
25390
  metric="1234"
25391
25391
  title="Insight Tile Title"
25392
25392
  onClick={() => console.log("insight tile 2 clicked!")}
25393
25393
  />
25394
25394
  <SpsInsightTile
25395
- kind={SpsInsightCardKind.GENERAL}
25395
+ kind={SpsInsightTileKind.GENERAL}
25396
25396
  metric="1234"
25397
25397
  title="Insight Tile Title"
25398
25398
  onClick={() => console.log("insight tile 3 clicked!")}
@@ -25409,31 +25409,31 @@ const SpsInsightTileExamples = {
25409
25409
  jsx: code`
25410
25410
  <SpsInsights>
25411
25411
  <SpsInsightTile
25412
- kind={SpsInsightCardKind.GENERAL}
25412
+ kind={SpsInsightTileKind.GENERAL}
25413
25413
  metric="1234"
25414
25414
  title="Insight Tile Title"
25415
25415
  icon={SpsIcon.USER}
25416
25416
  />
25417
25417
  <SpsInsightTile
25418
- kind={SpsInsightCardKind.PROCESSING}
25418
+ kind={SpsInsightTileKind.PROCESSING}
25419
25419
  metric="1234"
25420
25420
  title="Insight Tile Title"
25421
25421
  icon={SpsIcon.ASTERISK}
25422
25422
  />
25423
25423
  <SpsInsightTile
25424
- kind={SpsInsightCardKind.SUCCESS}
25424
+ kind={SpsInsightTileKind.SUCCESS}
25425
25425
  metric="1234"
25426
25426
  title="Insight Tile Title"
25427
25427
  icon={SpsIcon.DOLLAR_SIGN}
25428
25428
  />
25429
25429
  <SpsInsightTile
25430
- kind={SpsInsightCardKind.WARNING}
25430
+ kind={SpsInsightTileKind.WARNING}
25431
25431
  metric="1234"
25432
25432
  title="Insight Tile Title"
25433
25433
  icon={SpsIcon.FOLDER_OPEN}
25434
25434
  />
25435
25435
  <SpsInsightTile
25436
- kind={SpsInsightCardKind.ERROR}
25436
+ kind={SpsInsightTileKind.ERROR}
25437
25437
  metric="1234"
25438
25438
  title="Insight Tile Title"
25439
25439
  icon={SpsIcon.BAN}
@@ -25450,7 +25450,7 @@ const SpsInsightTileExamples = {
25450
25450
  jsx: code`
25451
25451
  <SpsInsights>
25452
25452
  <SpsInsightTile
25453
- kind={SpsInsightCardKind.GENERAL}
25453
+ kind={SpsInsightTileKind.GENERAL}
25454
25454
  metric="1234"
25455
25455
  title="Insight Tile Title"
25456
25456
  partnerCount="100"
@@ -25460,7 +25460,7 @@ const SpsInsightTileExamples = {
25460
25460
  <span className="gray600 font-weight-bold">Detail:</span> 792 units
25461
25461
  </SpsInsightTile>
25462
25462
  <SpsInsightTile
25463
- kind={SpsInsightCardKind.PROCESSING}
25463
+ kind={SpsInsightTileKind.PROCESSING}
25464
25464
  metric="1234"
25465
25465
  title="Insight Tile Title"
25466
25466
  partnerCount="100"
@@ -25468,7 +25468,7 @@ const SpsInsightTileExamples = {
25468
25468
  horizontal
25469
25469
  />
25470
25470
  <SpsInsightTile
25471
- kind={SpsInsightCardKind.SUCCESS}
25471
+ kind={SpsInsightTileKind.SUCCESS}
25472
25472
  metric="1234"
25473
25473
  title="Insight Tile Title"
25474
25474
  partnerCount="100"
@@ -25478,7 +25478,7 @@ const SpsInsightTileExamples = {
25478
25478
  <span className="gray600 font-weight-bold">Detail:</span> 792 units
25479
25479
  </SpsInsightTile>
25480
25480
  <SpsInsightTile
25481
- kind={SpsInsightCardKind.WARNING}
25481
+ kind={SpsInsightTileKind.WARNING}
25482
25482
  metric="1234"
25483
25483
  title="Insight Tile Title"
25484
25484
  partnerCount="100"
@@ -25486,7 +25486,7 @@ const SpsInsightTileExamples = {
25486
25486
  horizontal
25487
25487
  />
25488
25488
  <SpsInsightTile
25489
- kind={SpsInsightCardKind.ERROR}
25489
+ kind={SpsInsightTileKind.ERROR}
25490
25490
  metric="1234"
25491
25491
  title="Insight Tile Title"
25492
25492
  partnerCount="100"
@@ -29190,7 +29190,7 @@ const SpsListToolbarExamples = {
29190
29190
  formMeta={formMeta.fields.searchText}
29191
29191
  placeholder="Search fields"
29192
29192
  />
29193
- <SpsButton kind="icon" icon="search" />
29193
+ <SpsButton kind={ButtonKind.ICON} icon={SpsIcon.SEARCH} />
29194
29194
  </SpsListToolbarSearch>
29195
29195
  </SpsListToolbar>
29196
29196
  );
@@ -34806,7 +34806,8 @@ const propsDoc$v = {
34806
34806
  name: "string",
34807
34807
  onChange: "ChangeEventHandler<HTMLInputElement>",
34808
34808
  placeholder: "string",
34809
- value: "string"
34809
+ value: "string",
34810
+ additionalText: "string"
34810
34811
  };
34811
34812
  const propTypes$x = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
34812
34813
  disabled: propTypes$1O.exports.bool,
@@ -34816,7 +34817,8 @@ const propTypes$x = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
34816
34817
  name: propTypes$1O.exports.string,
34817
34818
  onChange: fun(),
34818
34819
  placeholder: propTypes$1O.exports.string,
34819
- value: propTypes$1O.exports.string
34820
+ value: propTypes$1O.exports.string,
34821
+ additionalText: propTypes$1O.exports.string
34820
34822
  });
34821
34823
  const SpsTextInput = React.forwardRef((_G, ref2) => {
34822
34824
  var _H = _G, {
@@ -34832,7 +34834,8 @@ const SpsTextInput = React.forwardRef((_G, ref2) => {
34832
34834
  "data-testid": testId,
34833
34835
  title,
34834
34836
  unsafelyReplaceClassName,
34835
- value = ""
34837
+ value = "",
34838
+ additionalText
34836
34839
  } = _H, rest = __objRest(_H, [
34837
34840
  "className",
34838
34841
  "disabled",
@@ -34846,7 +34849,8 @@ const SpsTextInput = React.forwardRef((_G, ref2) => {
34846
34849
  "data-testid",
34847
34850
  "title",
34848
34851
  "unsafelyReplaceClassName",
34849
- "value"
34852
+ "value",
34853
+ "additionalText"
34850
34854
  ]);
34851
34855
  const meta = formMeta || formControl2;
34852
34856
  const { wrapperId, controlId } = useFormControlId(id2, meta);
@@ -34897,7 +34901,9 @@ const SpsTextInput = React.forwardRef((_G, ref2) => {
34897
34901
  "data-testid": `${testId}__input_clear`,
34898
34902
  className: "sps-icon sps-icon-x-circle sps-form-control__clear-btn",
34899
34903
  onClick: clear
34900
- })));
34904
+ })), additionalText && /* @__PURE__ */ React.createElement("p", {
34905
+ className: "sps-input__additional-text"
34906
+ }, additionalText));
34901
34907
  });
34902
34908
  Object.assign(SpsTextInput, {
34903
34909
  props: propsDoc$v,
@@ -34905,91 +34911,118 @@ Object.assign(SpsTextInput, {
34905
34911
  displayName: "SpsTextInput"
34906
34912
  });
34907
34913
  const SpsTextInputExamples = {
34908
- standard: {
34909
- label: "Standard",
34910
- description: "info about standard text inputs",
34914
+ general: {
34915
+ label: "General Usage",
34916
+ description: ({ NavigateTo }) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("h5", null, "Use a Text Input:"), /* @__PURE__ */ React.createElement("ul", null, /* @__PURE__ */ React.createElement("li", null, "When the value required is short (a single word or short phrase)."), /* @__PURE__ */ React.createElement("li", null, "When only one value is required or accepted.")), /* @__PURE__ */ React.createElement("h5", null, "Do Not Use a Text Input:"), /* @__PURE__ */ React.createElement("ul", null, /* @__PURE__ */ React.createElement("li", null, "When a value of considerable length (such as a sentence or paragraph) is required or accepted. Use a ", /* @__PURE__ */ React.createElement(NavigateTo, {
34917
+ to: "text-areas"
34918
+ }, "Text Area"), " instead."), /* @__PURE__ */ React.createElement("li", null, "When more than one value is required or accepted in the field. Use", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
34919
+ to: "multi-select"
34920
+ }, "Multi-Select"), " instead."), /* @__PURE__ */ React.createElement("li", null, "When a boolean selection is required (such as on/off, yes/no, etc). Use", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
34921
+ to: "checkbox"
34922
+ }, "Checkboxes"), ",", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
34923
+ to: "radio-buttons"
34924
+ }, "Radio Buttons"), " or", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
34925
+ to: "toggle"
34926
+ }, "Toggles"), " instead.")))
34927
+ },
34928
+ basic: {
34929
+ label: "Basic Text Inputs",
34930
+ description: () => /* @__PURE__ */ React.createElement("p", null, "Basic Text Inputs include a label and an input field."),
34911
34931
  examples: {
34912
34932
  standard: {
34913
34933
  react: code`
34914
34934
  function DemoComponent() {
34915
- const { formValue, formMeta, updateForm } = useSpsForm({ foo: "bar" });
34935
+ const { formValue, formMeta, updateForm } = useSpsForm({ companyName: "" });
34916
34936
 
34917
- return <>
34918
- <SpsLabel for={formMeta.fields.foo}>Foo</SpsLabel>
34919
- <SpsTextInput
34920
- value={formValue.foo}
34921
- formMeta={formMeta.fields.foo}
34922
- />
34923
- </>;
34937
+ return (
34938
+ <div className="sfg-row">
34939
+ <div className="sfg-col-4">
34940
+ <SpsLabel for={formMeta.fields.companyName}>Company Name</SpsLabel>
34941
+ <SpsTextInput
34942
+ value={formValue.companyName}
34943
+ formMeta={formMeta.fields.companyName}
34944
+ />
34945
+ </div>
34946
+ </div>
34947
+ );
34924
34948
  }
34925
34949
  `
34926
34950
  }
34927
34951
  }
34928
34952
  },
34929
- b_placeholder: {
34930
- label: "Placeholder",
34931
- description: "info about text input placeholders",
34953
+ placeholder: {
34954
+ label: "Placeholder Text",
34955
+ description: ({ NavigateTo }) => /* @__PURE__ */ React.createElement("p", null, "Certain inputs may benefit from placeholder text to aid the user in providing a valid value."),
34932
34956
  examples: {
34933
34957
  placeholder: {
34934
34958
  react: code`
34935
34959
  function DemoComponent() {
34936
- const { formValue, formMeta, updateForm } = useSpsForm({ foo: "bar" });
34960
+ const { formValue, formMeta, updateForm } = useSpsForm({ phoneNumber: "" });
34937
34961
 
34938
- return <>
34939
- <SpsLabel for={formMeta.fields.foo}>
34940
- Company Name
34941
- </SpsLabel>
34942
- <SpsTextInput formMeta={formMeta.fields.foo}
34943
- value={formValue.foo}
34944
- placeholder="Enter a company name"
34945
- ></SpsTextInput>
34946
- </>
34962
+ return (
34963
+ <div className="sfg-row">
34964
+ <div className="sfg-col-4">
34965
+ <SpsLabel for={formMeta.fields.phoneNumber}>Phone Number</SpsLabel>
34966
+ <SpsTextInput
34967
+ value={formValue.phoneNumber}
34968
+ formMeta={formMeta.fields.phoneNumber}
34969
+ placeholder="(000) 000-0000"
34970
+ />
34971
+ </div>
34972
+ </div>
34973
+ );
34947
34974
  }
34948
34975
  `
34949
34976
  }
34950
34977
  }
34951
34978
  },
34952
- c_description: {
34953
- label: "Description",
34954
- description: "info about text inputs with descriptions",
34979
+ additional_text: {
34980
+ label: "Additional Descriptive Text",
34981
+ description: ({ NavigateTo }) => /* @__PURE__ */ React.createElement("p", null, "For occasions when additional context beyond a placeholder is required, text in the form of a short phrase can appear below the input."),
34955
34982
  examples: {
34956
- description: {
34983
+ placeholder: {
34957
34984
  react: code`
34958
34985
  function DemoComponent() {
34959
- const { formValue, formMeta, updateForm } = useSpsForm({ foo: "bar" });
34986
+ const { formValue, formMeta, updateForm } = useSpsForm({ password: "" });
34960
34987
 
34961
- return <>
34962
- <SpsLabel for={formMeta.fields.foo}
34963
- value={formValue.foo}
34964
- description="This is a brief description of the field to provide additional context."
34965
- >
34966
- Label
34967
- </SpsLabel>
34968
- <SpsTextInput formMeta={formMeta.fields.foo}/>
34969
- </>
34988
+ return (
34989
+ <div className="sfg-row">
34990
+ <div className="sfg-col-4">
34991
+ <SpsLabel for={formMeta.fields.password}>Password</SpsLabel>
34992
+ <SpsTextInput
34993
+ value={formValue.password}
34994
+ formMeta={formMeta.fields.password}
34995
+ additionalText="Password must be 8-12 characters in length and include: 1 capital letter, 1 number and 1 special character"
34996
+ />
34997
+ </div>
34998
+ </div>
34999
+ );
34970
35000
  }
34971
35001
  `
34972
35002
  }
34973
35003
  }
34974
35004
  },
34975
- d_disabled: {
34976
- label: "Disabled",
34977
- description: "info about disabled text inputs",
35005
+ disabled: {
35006
+ label: "Disabled State",
35007
+ description: () => /* @__PURE__ */ React.createElement("p", null, "The Disabled State prevents a user from modifying the text input while still allowing visibility to its information."),
34978
35008
  examples: {
34979
- disabled: {
35009
+ standard: {
34980
35010
  react: code`
34981
35011
  function DemoComponent() {
34982
- const { formValue, formMeta, updateForm } = useSpsForm({ email: "foo@bar.com" });
35012
+ const { formValue, formMeta, updateForm } = useSpsForm({ companyName: "FGL Sports" });
34983
35013
 
34984
- return <>
34985
- <SpsLabel for={formMeta.fields.email}>
34986
- Email Address
34987
- </SpsLabel>
34988
- <SpsTextInput id="disabledTextInput" disabled
34989
- value={formValue.email}
34990
- formMeta={formMeta.fields.email}
34991
- ></SpsTextInput>
34992
- </>
35014
+ return (
35015
+ <div className="sfg-row">
35016
+ <div className="sfg-col-4">
35017
+ <SpsLabel for={formMeta.fields.companyName}>Company Name</SpsLabel>
35018
+ <SpsTextInput
35019
+ value={formValue.companyName}
35020
+ formMeta={formMeta.fields.companyName}
35021
+ disabled
35022
+ />
35023
+ </div>
35024
+ </div>
35025
+ );
34993
35026
  }
34994
35027
  `
34995
35028
  }
@@ -35003,7 +35036,8 @@ const propsDoc$u = {
35003
35036
  onChange: "ChangeEventHandler",
35004
35037
  placeholder: "string",
35005
35038
  rows: "number",
35006
- value: "string"
35039
+ value: "string",
35040
+ additionalText: "string"
35007
35041
  };
35008
35042
  const propTypes$w = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
35009
35043
  disabled: propTypes$1O.exports.bool,
@@ -35014,7 +35048,8 @@ const propTypes$w = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
35014
35048
  placeholder: propTypes$1O.exports.string,
35015
35049
  ref: ref(),
35016
35050
  rows: propTypes$1O.exports.number,
35017
- value: propTypes$1O.exports.string
35051
+ value: propTypes$1O.exports.string,
35052
+ additionalText: propTypes$1O.exports.string
35018
35053
  });
35019
35054
  function SpsTextarea(_I) {
35020
35055
  var _J = _I, {
@@ -35030,7 +35065,8 @@ function SpsTextarea(_I) {
35030
35065
  rows = 2,
35031
35066
  "data-testid": testId,
35032
35067
  unsafelyReplaceClassName,
35033
- value = ""
35068
+ value = "",
35069
+ additionalText
35034
35070
  } = _J, rest = __objRest(_J, [
35035
35071
  "className",
35036
35072
  "disabled",
@@ -35044,7 +35080,8 @@ function SpsTextarea(_I) {
35044
35080
  "rows",
35045
35081
  "data-testid",
35046
35082
  "unsafelyReplaceClassName",
35047
- "value"
35083
+ "value",
35084
+ "additionalText"
35048
35085
  ]);
35049
35086
  const meta = formMeta || formControl2;
35050
35087
  const { wrapperId, controlId } = useFormControlId(id2, meta);
@@ -35092,7 +35129,9 @@ function SpsTextarea(_I) {
35092
35129
  "data-testid": `${testId}__input_clear`,
35093
35130
  className: "sps-icon sps-icon-x-circle sps-form-control__clear-btn",
35094
35131
  onClick: clear
35095
- })));
35132
+ })), additionalText && /* @__PURE__ */ React.createElement("p", {
35133
+ className: "sps-input__additional-text"
35134
+ }, additionalText));
35096
35135
  }
35097
35136
  Object.assign(SpsTextarea, {
35098
35137
  props: propsDoc$u,
@@ -35100,101 +35139,119 @@ Object.assign(SpsTextarea, {
35100
35139
  displayName: "SpsTextarea"
35101
35140
  });
35102
35141
  const SpsTextareaExamples = {
35142
+ general: {
35143
+ label: "General Usage",
35144
+ description: ({ NavigateTo }) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("h5", null, "Use a Text Area:"), /* @__PURE__ */ React.createElement("ul", null, /* @__PURE__ */ React.createElement("li", null, "When a value of considerable length (such as a sentence or paragraph) is required or accepted.")), /* @__PURE__ */ React.createElement("h5", null, "Do Not Use a Text Area:"), /* @__PURE__ */ React.createElement("ul", null, /* @__PURE__ */ React.createElement("li", null, "When the value required is short (a single word or short phrase). Use a", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
35145
+ to: "text-inputs"
35146
+ }, "Text Input"), " instead."), /* @__PURE__ */ React.createElement("li", null, "When more than one value is required or accepted in the field. Use", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
35147
+ to: "multi-select"
35148
+ }, "Multi-Select"), " instead."), /* @__PURE__ */ React.createElement("li", null, "When a boolean selection is required (such as on/off, yes/no, etc). Use", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
35149
+ to: "checkbox"
35150
+ }, "Checkboxes"), ",", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
35151
+ to: "radio-buttons"
35152
+ }, "Radio Buttons"), " or", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
35153
+ to: "toggle"
35154
+ }, "Toggles"), " instead.")))
35155
+ },
35103
35156
  basic: {
35104
- label: "Basic",
35105
- description: "info about basic text areas",
35157
+ label: "Basic Text Areas",
35158
+ description: () => /* @__PURE__ */ React.createElement("p", null, "Basic Text Areas include a label and a large input field. By default a Text Area is three lines tall, but the height can be adjusted."),
35106
35159
  examples: {
35107
- basic: {
35160
+ standard: {
35108
35161
  react: code`
35109
35162
  function DemoComponent() {
35110
- function numLinesValidator(n) {
35111
- return function(value) {
35112
- const lines = typeof value === "string" ? value.split("\\n").length : 0;
35113
- if (lines !== n) {
35114
- return {
35115
- numLines: {
35116
- actualLines: lines,
35117
- requiredLines: n
35118
- }
35119
- };
35120
- }
35121
- return null;
35122
- };
35123
- }
35163
+ const { formValue, formMeta, updateForm } = useSpsForm({ notes: "" });
35124
35164
 
35125
- const { formValue, formMeta, updateForm } = useSpsForm({
35126
- haiku: ""
35127
- }, {
35128
- "haiku": [numLinesValidator(3)]
35129
- });
35165
+ return (
35166
+ <div className="sfg-row">
35167
+ <div className="sfg-col-4">
35168
+ <SpsLabel for={formMeta.fields.notes}>Notes</SpsLabel>
35169
+ <SpsTextarea
35170
+ value={formValue.notes}
35171
+ formMeta={formMeta.fields.notes}
35172
+ rows={5}
35173
+ />
35174
+ </div>
35175
+ </div>
35176
+ );
35177
+ }
35178
+ `
35179
+ }
35180
+ }
35181
+ },
35182
+ placeholder: {
35183
+ label: "Placeholder Text",
35184
+ description: ({ NavigateTo }) => /* @__PURE__ */ React.createElement("p", null, "Certain inputs may benefit from placeholder text to aid the user in providing a valid value."),
35185
+ examples: {
35186
+ placeholder: {
35187
+ react: code`
35188
+ function DemoComponent() {
35189
+ const { formValue, formMeta, updateForm } = useSpsForm({ companyDescription: "" });
35130
35190
 
35131
- return <>
35132
- <SpsLabel for={formMeta.fields.haiku}
35133
- help="A haiku is a three-line poem of 5, 7, and 5 syllables respectively."
35134
- errors={() =>
35135
- formMeta.fields.haiku.hasError("numLines") && (
35136
- <>
35137
- You need {formMeta.fields.haiku.errors["numLines"].requiredLines} lines,
35138
- but you've only written {formMeta.fields.haiku.errors["numLines"].actualLines} lines!
35139
- </>
35140
- )
35141
- }>
35142
- Haiku
35143
- </SpsLabel>
35144
- <SpsTextarea placeholder="Write a haiku" rows={3}
35145
- formMeta={formMeta.fields.haiku}
35146
- value={formValue.haiku}
35147
- ></SpsTextarea>
35148
- </>
35191
+ return (
35192
+ <div className="sfg-row">
35193
+ <div className="sfg-col-4">
35194
+ <SpsLabel for={formMeta.fields.companyDescription}>Company Description</SpsLabel>
35195
+ <SpsTextarea
35196
+ value={formValue.companyDescription}
35197
+ formMeta={formMeta.fields.companyDescription}
35198
+ placeholder="Describe your company"
35199
+ />
35200
+ </div>
35201
+ </div>
35202
+ );
35149
35203
  }
35150
35204
  `
35151
35205
  }
35152
35206
  }
35153
35207
  },
35154
- b_description: {
35155
- label: "Description",
35156
- description: "info about text areas with descriptions",
35208
+ additional_text: {
35209
+ label: "Additional Descriptive Text",
35210
+ description: ({ NavigateTo }) => /* @__PURE__ */ React.createElement("p", null, "For occasions when additional context beyond a placeholder is required, text in the form of a short phrase can appear below the input."),
35157
35211
  examples: {
35158
- description: {
35212
+ placeholder: {
35159
35213
  react: code`
35160
35214
  function DemoComponent() {
35161
- const { formValue, formMeta, updateForm } = useSpsForm({
35162
- textareaWithDescription: ""
35163
- });
35215
+ const { formValue, formMeta, updateForm } = useSpsForm({ campaignNotes: "" });
35164
35216
 
35165
- return <>
35166
- <SpsLabel for={formMeta.fields.textareaWithDescription}
35167
- description="This is a brief description of the field to provide additional context."
35168
- >
35169
- Label
35170
- </SpsLabel>
35171
- <SpsTextarea formMeta={formMeta.fields.textareaWithDescription}
35172
- value={formValue.textareaWithDescription}
35173
- />
35174
- </>
35217
+ return (
35218
+ <div className="sfg-row">
35219
+ <div className="sfg-col-4">
35220
+ <SpsLabel for={formMeta.fields.campaignNotes}>Campaign Notes</SpsLabel>
35221
+ <SpsTextarea
35222
+ value={formValue.campaignNotes}
35223
+ formMeta={formMeta.fields.campaignNotes}
35224
+ additionalText="List any additional comments, questions or information about this campaign."
35225
+ />
35226
+ </div>
35227
+ </div>
35228
+ );
35175
35229
  }
35176
35230
  `
35177
35231
  }
35178
35232
  }
35179
35233
  },
35180
- c_disabled: {
35181
- label: "Disabled",
35182
- description: "info about disabled text areas",
35234
+ disabled: {
35235
+ label: "Disabled State",
35236
+ description: () => /* @__PURE__ */ React.createElement("p", null, "The Disabled State prevents a user from modifying the text input while still allowing visibility to its information."),
35183
35237
  examples: {
35184
- disabled: {
35238
+ standard: {
35185
35239
  react: code`
35186
35240
  function DemoComponent() {
35187
- const { formValue, formMeta, updateForm } = useSpsForm({
35188
- notes: "This is the value of the textarea but you can't edit it right now"
35189
- });
35241
+ const { formValue, formMeta, updateForm } = useSpsForm({ notes: "Some notes here" });
35190
35242
 
35191
- return <>
35192
- <SpsLabel for={formMeta.fields.notes}>Notes</SpsLabel>
35193
- <SpsTextarea disabled rows={5}
35194
- formMeta={formMeta.fields.notes}
35195
- value={formValue.notes}
35196
- ></SpsTextarea>
35197
- </>
35243
+ return (
35244
+ <div className="sfg-row">
35245
+ <div className="sfg-col-4">
35246
+ <SpsLabel for={formMeta.fields.notes}>Notes</SpsLabel>
35247
+ <SpsTextarea
35248
+ value={formValue.notes}
35249
+ formMeta={formMeta.fields.notes}
35250
+ disabled
35251
+ />
35252
+ </div>
35253
+ </div>
35254
+ );
35198
35255
  }
35199
35256
  `
35200
35257
  }
@@ -36273,13 +36330,13 @@ const SpsWorkflowExamples = {
36273
36330
  basic: {
36274
36331
  jsx: code`
36275
36332
  <div className="col-4">
36276
- <SpsWorkflow icon="list-summary" title="Workflow">
36277
- <SpsWorkflowStep icon="heart" title="Name of Step">
36333
+ <SpsWorkflow icon={SpsIcon.LIST_SUMMARY} title="Workflow">
36334
+ <SpsWorkflowStep icon={SpsIcon.HEART} title="Name of Step">
36278
36335
  <SpsWorkflowDocument>
36279
36336
  <a href="https://github.com/SPSCommerce/ui-angular" target="_blank">
36280
36337
  Document Name
36281
36338
  </a>
36282
- <SpsWorkflowDocumentStatus icon="status-error">
36339
+ <SpsWorkflowDocumentStatus icon={SpsIcon.STATUS_ERROR}>
36283
36340
  Status
36284
36341
  </SpsWorkflowDocumentStatus>
36285
36342
  </SpsWorkflowDocument>
@@ -36290,7 +36347,7 @@ const SpsWorkflowExamples = {
36290
36347
  </SpsWorkflowDocumentStatus>
36291
36348
  </SpsWorkflowDocument>
36292
36349
  </SpsWorkflowStep>
36293
- <SpsWorkflowStep icon="heart" title="Done">
36350
+ <SpsWorkflowStep icon={SpsIcon.HEART} title="Done">
36294
36351
  </SpsWorkflowStep>
36295
36352
  </SpsWorkflow>
36296
36353
  </div>
@@ -36304,13 +36361,13 @@ const SpsWorkflowExamples = {
36304
36361
  withAlias: {
36305
36362
  jsx: code`
36306
36363
  <div className="col-4">
36307
- <SpsWf icon="list-summary" title="Workflow">
36308
- <SpsWfStep icon="heart" title="Name of Step">
36364
+ <SpsWf icon={SpsIcon.LIST_SUMMARY} title="Workflow">
36365
+ <SpsWfStep icon={SpsIcon.HEART} title="Name of Step">
36309
36366
  <SpsWfDoc>
36310
36367
  <a href="https://github.com/SPSCommerce/ui-angular" target="_blank">
36311
36368
  Document Name
36312
36369
  </a>
36313
- <SpsWfDs icon="status-error">Status</SpsWfDs>
36370
+ <SpsWfDs icon={SpsIcon.STATUS_ERROR}>Status</SpsWfDs>
36314
36371
  </SpsWfDoc>
36315
36372
  <SpsWfDoc>
36316
36373
  Document Name
@@ -36319,7 +36376,7 @@ const SpsWorkflowExamples = {
36319
36376
  </SpsWfDs>
36320
36377
  </SpsWfDoc>
36321
36378
  </SpsWfStep>
36322
- <SpsWfStep icon="heart" title="Done">
36379
+ <SpsWfStep icon={SpsIcon.HEART} title="Done">
36323
36380
  </SpsWfStep>
36324
36381
  </SpsWf>
36325
36382
  </div>
@@ -37557,11 +37614,13 @@ const MANIFEST = {
37557
37614
  components: [SpsTaskQueue],
37558
37615
  examples: SpsTaskQueueExamples
37559
37616
  },
37560
- "Text Input": {
37617
+ "Text Inputs": {
37618
+ description: () => /* @__PURE__ */ React.createElement("p", null, "Text Inputs consist of a Label and a field in which a user enters a short value."),
37561
37619
  components: [SpsTextInput],
37562
37620
  examples: SpsTextInputExamples
37563
37621
  },
37564
- Textarea: {
37622
+ "Text Areas": {
37623
+ description: () => /* @__PURE__ */ React.createElement("p", null, "Text Areas consist of a Label and a field in which a user enters a long value."),
37565
37624
  components: [SpsTextarea],
37566
37625
  examples: SpsTextareaExamples
37567
37626
  },