@spscommerce/ds-react 6.10.2 → 6.11.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.cjs.js +7 -7
- package/lib/index.es.js +21 -7
- package/package.json +11 -11
package/lib/index.cjs.js
CHANGED
|
@@ -6414,7 +6414,7 @@ var a=n.defineLocale("zh-tw",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u5
|
|
|
6414
6414
|
</SpsCard>
|
|
6415
6415
|
)
|
|
6416
6416
|
}
|
|
6417
|
-
`}}}},nM={checked:"boolean",disabled:"boolean",formMeta:"SpsFormFieldMeta<any>",inline:"boolean",centered:"boolean",label:"string",name:{type:"string",required:!0},onChange:"ChangeEventHandler",value:"any"},aM=$(I({},U),{checked:T.exports.bool,disabled:T.exports.bool,formControl:ie(),formMeta:ie(),inline:T.exports.bool,centered:T.exports.bool,label:T.exports.string,name:T.exports.string.isRequired,onChange:se(),ref:Kt(),value:T.exports.any});function rl(w){var y=w,{checked:e,className:t,"data-testid":n,disabled:a,formControl:o,formMeta:i,id:l,inline:c,centered:p,label:u,name:f,onChange:m,ref:g,unsafelyReplaceClassName:S,value:C}=y,N=z(y,["checked","className","data-testid","disabled","formControl","formMeta","id","inline","centered","label","name","onChange","ref","unsafelyReplaceClassName","value"]);const D=i||o,v=s.useRef(),{wrapperId:k,controlId:M}=Nt(l),L=F(S||"sps-radio-button","sps-checkable",c&&"sps-checkable--inline",p&&"sps-checkable--centered",!u&&"sps-checkable--no-label",t);function _(B){D&&(D.setValue(C),D.markAsDirty()),m&&m(B),v.current.focus()}return s.createElement(ut,{id:k,className:L,formControl:o,formMeta:i,inputRef:v,ref:g,"data-testid":`${n}`,onClick:()=>v.current.click()},s.createElement("input",I({type:"radio",ref:v,className:"sps-checkable__input","data-testid":`${n}__radio-input`,id:M,name:f,checked:e,disabled:a,onChange:_},N)),s.createElement("label",{className:"sps-checkable__label",htmlFor:M},u||""))}Object.assign(rl,{props:nM,propTypes:aM,displayName:"SpsRadioButton"});const Nf={general:{label:"General Usage",description:({NavigateTo:e})=>s.createElement(s.Fragment,null,s.createElement("h5",null,"Use Radio Buttons:"),s.createElement("ul",null,s.createElement("li",null,"When only one option can be selected from the available options.")),s.createElement("h5",null,"Do Not Use Radio Buttons:"),s.createElement("ul",null,s.createElement("li",null,"When a selection causes an immediate change in the system. Use a"," ",s.createElement(e,{to:"toggle"},"Toggle")," instead."),s.createElement("li",null,"When multiple options can be selected from the available options. Use"," ",s.createElement(e,{to:"checkbox"},"Checkboxes")," instead."),s.createElement("li",null,"When the list of available options requires too much space to list efficiently. Use"," ",s.createElement(e,{to:"dropdown"},"Dropdown")," instead.")))},basic:{label:"Basic Radio Buttons",description:()=>s.createElement("p",null,"Radio Buttons that represent related options are grouped together with a label. The groups can be arranged horizontally or vertically to best utilize available space."),examples:{horizontal:{description:()=>s.createElement("h4",null,"Horizontal Group"),react:E.code`
|
|
6417
|
+
`}}}},nM={checked:"boolean",disabled:"boolean",formMeta:"SpsFormFieldMeta<any>",inline:"boolean",centered:"boolean",label:"string",name:{type:"string",required:!0},onChange:"ChangeEventHandler",value:"any"},aM=$(I({},U),{checked:T.exports.bool,disabled:T.exports.bool,formControl:ie(),formMeta:ie(),inline:T.exports.bool,centered:T.exports.bool,label:T.exports.string,name:T.exports.string.isRequired,onChange:se(),ref:Kt(),value:T.exports.any});function rl(w){var y=w,{checked:e,className:t,"data-testid":n,disabled:a,formControl:o,formMeta:i,id:l,inline:c,centered:p,label:u,name:f,onChange:m,ref:g,unsafelyReplaceClassName:S,value:C}=y,N=z(y,["checked","className","data-testid","disabled","formControl","formMeta","id","inline","centered","label","name","onChange","ref","unsafelyReplaceClassName","value"]);const D=i||o,v=s.useRef(),{wrapperId:k,controlId:M}=Nt(l),L=F(S||"sps-radio-button","sps-checkable",c&&"sps-checkable--inline",p&&"sps-checkable--centered",!u&&"sps-checkable--no-label",t);function _(B){D&&(D.setValue(C),D.markAsDirty()),m&&m(B),v.current.focus()}return s.createElement(ut,{id:k,className:L,formControl:o,formMeta:i,inputRef:v,ref:g,"data-testid":`${n}`,onClick:()=>v.current.click()},s.createElement("input",I({type:"radio",ref:v,className:"sps-checkable__input","data-testid":`${n}__radio-input`,id:M,name:f,checked:e,disabled:a,onChange:_},N)),s.createElement("label",{className:"sps-checkable__label",htmlFor:M},u||""))}Object.assign(rl,{props:nM,propTypes:aM,displayName:"SpsRadioButton"});const Nf={general:{label:"General Usage",description:({NavigateTo:e})=>s.createElement(s.Fragment,null,s.createElement("h5",null,"Use Radio Buttons:"),s.createElement("ul",null,s.createElement("li",null,"When only one option can be selected from the available options.")),s.createElement("h5",null,"Do Not Use Radio Buttons:"),s.createElement("ul",null,s.createElement("li",null,"When a selection causes an immediate change in the system. Use a"," ",s.createElement(e,{to:"toggle"},"Toggle")," instead."),s.createElement("li",null,"When multiple options can be selected from the available options. Use"," ",s.createElement(e,{to:"checkbox"},"Checkboxes")," instead."),s.createElement("li",null,"When the list of available options requires too much space to list efficiently. Use"," ",s.createElement(e,{to:"dropdown"},"Dropdown")," instead.")),s.createElement("h5",null,"Using Radio Buttons in a Form"),s.createElement("p",null,"Reference the ",s.createElement(e,{to:"form"},"Forms")," page for guidelines for placing Radio Buttons in Form Layouts."))},basic:{label:"Basic Radio Buttons",description:()=>s.createElement("p",null,"Radio Buttons that represent related options are grouped together with a label. The groups can be arranged horizontally or vertically to best utilize available space."),examples:{horizontal:{description:()=>s.createElement("h4",null,"Horizontal Group"),react:E.code`
|
|
6418
6418
|
function DemoComponent() {
|
|
6419
6419
|
const { formValue, formMeta, updateForm } = useSpsForm({
|
|
6420
6420
|
option: "option1",
|
|
@@ -8104,7 +8104,7 @@ var a=n.defineLocale("zh-tw",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u5
|
|
|
8104
8104
|
</div>
|
|
8105
8105
|
);
|
|
8106
8106
|
}
|
|
8107
|
-
`}}}},wM={disabled:"boolean",formMeta:"SpsFormFieldMeta<string>",icon:"SpsIcon",name:"string",onChange:"ChangeEventHandler<HTMLInputElement>",placeholder:"string",value:"string",additionalText:"string"},EM=$(I({},U),{disabled:T.exports.bool,formControl:ie(),formMeta:ie(),icon:he(O.SpsIcon),name:T.exports.string,onChange:se(),placeholder:T.exports.string,value:T.exports.string,additionalText:T.exports.string}),kr=s.forwardRef((w,N)=>{var y=w,{className:e,disabled:t=!1,formControl:n,formMeta:a,icon:o,id:i,name:l,onChange:c,placeholder:p,"data-testid":u,title:f,unsafelyReplaceClassName:m,value:g="",additionalText:S}=y,C=z(y,["className","disabled","formControl","formMeta","icon","id","name","onChange","placeholder","data-testid","title","unsafelyReplaceClassName","value","additionalText"]);const D=a||n,{wrapperId:v,controlId:k}=Nt(i,D),M=s.useRef();function L(P,j){D&&(D.setValue(P),D.markAsDirty()),c&&c(j||new Tn(M.current))}function _(){M.current.value="",L("")}function B(P){L(P.target.value,P)}const A=F(m||"sps-text-input",e);return s.createElement(ut,{id:v,className:A,formControl:n,formMeta:a,inputRef:M,ref:N,focusInputOnClick:!0,"data-testid":`${u}`},s.createElement("div",{className:F("sps-form-control",t&&"disabled")},o&&s.createElement("i",{className:F("sps-text-input__icon","sps-icon",`sps-icon-${o}`)}),s.createElement("input",I({type:"text",ref:M,"data-testid":`${u}__input`,className:"sps-text-input__input",id:k,name:l,placeholder:p,onChange:B,title:f,value:g,disabled:t},C)),g&&!t&&s.createElement("i",{"data-testid":`${u}__input_clear`,className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:_})),S&&s.createElement("p",{className:"sps-input__additional-text"},S))});Object.assign(kr,{props:wM,propTypes:EM,displayName:"SpsTextInput"});const Ff={general:{label:"General Usage",description:({NavigateTo:e})=>s.createElement(s.Fragment,null,s.createElement("h5",null,"Use a Text Input:"),s.createElement("ul",null,s.createElement("li",null,"When the value required is short (a single word or short phrase)."),s.createElement("li",null,"When only one value is required or accepted.")),s.createElement("h5",null,"Do Not Use a Text Input:"),s.createElement("ul",null,s.createElement("li",null,"When a value of considerable length (such as a sentence or paragraph) is required or accepted. Use a ",s.createElement(e,{to:"text-areas"},"Text Area")," instead."),s.createElement("li",null,"When more than one value is required or accepted in the field. Use"," ",s.createElement(e,{to:"multi-select"},"Multi-Select")," instead."),s.createElement("li",null,"When a boolean selection is required (such as on/off, yes/no, etc). Use"," ",s.createElement(e,{to:"checkbox"},"Checkboxes"),","," ",s.createElement(e,{to:"radio-buttons"},"Radio Buttons")," or"," ",s.createElement(e,{to:"toggle"},"Toggles")," instead.")))},basic:{label:"Basic Text Inputs",description:()=>s.createElement("p",null,"Basic Text Inputs include a label and an input field."),examples:{standard:{react:E.code`
|
|
8107
|
+
`}}}},wM={disabled:"boolean",formMeta:"SpsFormFieldMeta<string>",icon:"SpsIcon",name:"string",onChange:"ChangeEventHandler<HTMLInputElement>",placeholder:"string",value:"string",additionalText:"string"},EM=$(I({},U),{disabled:T.exports.bool,formControl:ie(),formMeta:ie(),icon:he(O.SpsIcon),name:T.exports.string,onChange:se(),placeholder:T.exports.string,value:T.exports.string,additionalText:T.exports.string}),kr=s.forwardRef((w,N)=>{var y=w,{className:e,disabled:t=!1,formControl:n,formMeta:a,icon:o,id:i,name:l,onChange:c,placeholder:p,"data-testid":u,title:f,unsafelyReplaceClassName:m,value:g="",additionalText:S}=y,C=z(y,["className","disabled","formControl","formMeta","icon","id","name","onChange","placeholder","data-testid","title","unsafelyReplaceClassName","value","additionalText"]);const D=a||n,{wrapperId:v,controlId:k}=Nt(i,D),M=s.useRef();function L(P,j){D&&(D.setValue(P),D.markAsDirty()),c&&c(j||new Tn(M.current))}function _(){M.current.value="",L("")}function B(P){L(P.target.value,P)}const A=F(m||"sps-text-input",e);return s.createElement(ut,{id:v,className:A,formControl:n,formMeta:a,inputRef:M,ref:N,focusInputOnClick:!0,"data-testid":`${u}`},s.createElement("div",{className:F("sps-form-control",t&&"disabled")},o&&s.createElement("i",{className:F("sps-text-input__icon","sps-icon",`sps-icon-${o}`)}),s.createElement("input",I({type:"text",ref:M,"data-testid":`${u}__input`,className:"sps-text-input__input",id:k,name:l,placeholder:p,onChange:B,title:f,value:g,disabled:t},C)),g&&!t&&s.createElement("i",{"data-testid":`${u}__input_clear`,className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:_})),S&&s.createElement("p",{className:"sps-input__additional-text"},S))});Object.assign(kr,{props:wM,propTypes:EM,displayName:"SpsTextInput"});const Ff={general:{label:"General Usage",description:({NavigateTo:e})=>s.createElement(s.Fragment,null,s.createElement("h5",null,"Use a Text Input:"),s.createElement("ul",null,s.createElement("li",null,"When the value required is short (a single word or short phrase)."),s.createElement("li",null,"When only one value is required or accepted.")),s.createElement("h5",null,"Do Not Use a Text Input:"),s.createElement("ul",null,s.createElement("li",null,"When a value of considerable length (such as a sentence or paragraph) is required or accepted. Use a ",s.createElement(e,{to:"text-areas"},"Text Area")," instead."),s.createElement("li",null,"When more than one value is required or accepted in the field. Use"," ",s.createElement(e,{to:"multi-select"},"Multi-Select")," instead."),s.createElement("li",null,"When a boolean selection is required (such as on/off, yes/no, etc). Use"," ",s.createElement(e,{to:"checkbox"},"Checkboxes"),","," ",s.createElement(e,{to:"radio-buttons"},"Radio Buttons")," or"," ",s.createElement(e,{to:"toggle"},"Toggles")," instead.")),s.createElement("h5",null,"Using Text Inputs in a Form"),s.createElement("p",null,"Reference the ",s.createElement(e,{to:"form"},"Forms")," page for guidelines for placing Inputs in Form Layouts."))},basic:{label:"Basic Text Inputs",description:()=>s.createElement("p",null,"Basic Text Inputs include a label and an input field."),examples:{standard:{react:E.code`
|
|
8108
8108
|
function DemoComponent() {
|
|
8109
8109
|
const { formValue, formMeta, updateForm } = useSpsForm({ companyName: "" });
|
|
8110
8110
|
|
|
@@ -8120,7 +8120,7 @@ var a=n.defineLocale("zh-tw",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u5
|
|
|
8120
8120
|
</div>
|
|
8121
8121
|
);
|
|
8122
8122
|
}
|
|
8123
|
-
`}}},placeholder:{label:"Placeholder Text",description:({NavigateTo:e})=>s.createElement("p",null,"Certain inputs may benefit from placeholder text to aid the user in providing a valid value."),examples:{placeholder:{react:E.code`
|
|
8123
|
+
`}}},placeholder:{label:"Placeholder Text",description:({NavigateTo:e})=>s.createElement("p",null,"Certain inputs may benefit from placeholder text to aid the user in providing a valid value. For guidelines regarding writing placeholder text reference the Placeholder Text section on the ",s.createElement(e,{to:"form"},"Forms")," page."),examples:{placeholder:{react:E.code`
|
|
8124
8124
|
function DemoComponent() {
|
|
8125
8125
|
const { formValue, formMeta, updateForm } = useSpsForm({ phoneNumber: "" });
|
|
8126
8126
|
|
|
@@ -8137,7 +8137,7 @@ var a=n.defineLocale("zh-tw",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u5
|
|
|
8137
8137
|
</div>
|
|
8138
8138
|
);
|
|
8139
8139
|
}
|
|
8140
|
-
`}}},additional_text:{label:"Additional Descriptive Text",description:({NavigateTo:e})=>s.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."),examples:{placeholder:{react:E.code`
|
|
8140
|
+
`}}},additional_text:{label:"Additional Descriptive Text",description:({NavigateTo:e})=>s.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. For guidelines regarding writing descriptive text, reference the Additional Descriptive Text section on the"," ",s.createElement(e,{to:"form"},"Forms")," page."),examples:{placeholder:{react:E.code`
|
|
8141
8141
|
function DemoComponent() {
|
|
8142
8142
|
const { formValue, formMeta, updateForm } = useSpsForm({ password: "" });
|
|
8143
8143
|
|
|
@@ -8171,7 +8171,7 @@ var a=n.defineLocale("zh-tw",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u5
|
|
|
8171
8171
|
</div>
|
|
8172
8172
|
);
|
|
8173
8173
|
}
|
|
8174
|
-
`}}}},CM={disabled:"boolean",formMeta:"SpsFormFieldMeta<string>",name:"string",onChange:"ChangeEventHandler",placeholder:"string",rows:"number",value:"string",additionalText:"string"},xM=$(I({},U),{disabled:T.exports.bool,formControl:ie(),formMeta:ie(),name:T.exports.string,onChange:se(),placeholder:T.exports.string,ref:Kt(),rows:T.exports.number,value:T.exports.string,additionalText:T.exports.string});function ul(N){var w=N,{className:e,disabled:t=!1,formControl:n,formMeta:a,id:o,name:i,onChange:l,placeholder:c="",ref:p,rows:u=2,"data-testid":f,unsafelyReplaceClassName:m,value:g="",additionalText:S}=w,C=z(w,["className","disabled","formControl","formMeta","id","name","onChange","placeholder","ref","rows","data-testid","unsafelyReplaceClassName","value","additionalText"]);const y=a||n,{wrapperId:D,controlId:v}=Nt(o,y),k=s.useRef();function M(A,P){y&&(y.setValue(A),y.markAsDirty()),l&&l(P||new Tn(k.current))}function L(){k.current.value="",M("")}function _(A){M(A.target.value,A)}const B=F(m||"sps-textarea",e);return s.createElement(ut,{id:D,className:B,formControl:n,formMeta:a,inputRef:k,ref:p,"data-testid":f},s.createElement("div",{className:"position-relative"},s.createElement("textarea",I({ref:k,rows:u,"data-testid":`${f}__input`,className:"sps-form-control input--clearable",id:v,name:i,placeholder:c,onChange:_,"aria-label":c,value:g||"",disabled:t},C)),g&&!t&&s.createElement("i",{"data-testid":`${f}__input_clear`,className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:L})),S&&s.createElement("p",{className:"sps-input__additional-text"},S))}Object.assign(ul,{props:CM,propTypes:xM,displayName:"SpsTextarea"});const Kf={general:{label:"General Usage",description:({NavigateTo:e})=>s.createElement(s.Fragment,null,s.createElement("h5",null,"Use a Text Area:"),s.createElement("ul",null,s.createElement("li",null,"When a value of considerable length (such as a sentence or paragraph) is required or accepted.")),s.createElement("h5",null,"Do Not Use a Text Area:"),s.createElement("ul",null,s.createElement("li",null,"When the value required is short (a single word or short phrase). Use a"," ",s.createElement(e,{to:"text-inputs"},"Text Input")," instead."),s.createElement("li",null,"When more than one value is required or accepted in the field. Use"," ",s.createElement(e,{to:"multi-select"},"Multi-Select")," instead."),s.createElement("li",null,"When a boolean selection is required (such as on/off, yes/no, etc). Use"," ",s.createElement(e,{to:"checkbox"},"Checkboxes"),","," ",s.createElement(e,{to:"radio-buttons"},"Radio Buttons")," or"," ",s.createElement(e,{to:"toggle"},"Toggles")," instead.")))},basic:{label:"Basic Text Areas",description:()=>s.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."),examples:{standard:{react:E.code`
|
|
8174
|
+
`}}}},CM={disabled:"boolean",formMeta:"SpsFormFieldMeta<string>",name:"string",onChange:"ChangeEventHandler",placeholder:"string",rows:"number",value:"string",additionalText:"string"},xM=$(I({},U),{disabled:T.exports.bool,formControl:ie(),formMeta:ie(),name:T.exports.string,onChange:se(),placeholder:T.exports.string,ref:Kt(),rows:T.exports.number,value:T.exports.string,additionalText:T.exports.string});function ul(N){var w=N,{className:e,disabled:t=!1,formControl:n,formMeta:a,id:o,name:i,onChange:l,placeholder:c="",ref:p,rows:u=2,"data-testid":f,unsafelyReplaceClassName:m,value:g="",additionalText:S}=w,C=z(w,["className","disabled","formControl","formMeta","id","name","onChange","placeholder","ref","rows","data-testid","unsafelyReplaceClassName","value","additionalText"]);const y=a||n,{wrapperId:D,controlId:v}=Nt(o,y),k=s.useRef();function M(A,P){y&&(y.setValue(A),y.markAsDirty()),l&&l(P||new Tn(k.current))}function L(){k.current.value="",M("")}function _(A){M(A.target.value,A)}const B=F(m||"sps-textarea",e);return s.createElement(ut,{id:D,className:B,formControl:n,formMeta:a,inputRef:k,ref:p,"data-testid":f},s.createElement("div",{className:"position-relative"},s.createElement("textarea",I({ref:k,rows:u,"data-testid":`${f}__input`,className:"sps-form-control input--clearable",id:v,name:i,placeholder:c,onChange:_,"aria-label":c,value:g||"",disabled:t},C)),g&&!t&&s.createElement("i",{"data-testid":`${f}__input_clear`,className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:L})),S&&s.createElement("p",{className:"sps-input__additional-text"},S))}Object.assign(ul,{props:CM,propTypes:xM,displayName:"SpsTextarea"});const Kf={general:{label:"General Usage",description:({NavigateTo:e})=>s.createElement(s.Fragment,null,s.createElement("h5",null,"Use a Text Area:"),s.createElement("ul",null,s.createElement("li",null,"When a value of considerable length (such as a sentence or paragraph) is required or accepted.")),s.createElement("h5",null,"Do Not Use a Text Area:"),s.createElement("ul",null,s.createElement("li",null,"When the value required is short (a single word or short phrase). Use a"," ",s.createElement(e,{to:"text-inputs"},"Text Input")," instead."),s.createElement("li",null,"When more than one value is required or accepted in the field. Use"," ",s.createElement(e,{to:"multi-select"},"Multi-Select")," instead."),s.createElement("li",null,"When a boolean selection is required (such as on/off, yes/no, etc). Use"," ",s.createElement(e,{to:"checkbox"},"Checkboxes"),","," ",s.createElement(e,{to:"radio-buttons"},"Radio Buttons")," or"," ",s.createElement(e,{to:"toggle"},"Toggles")," instead.")),s.createElement("h5",null,"Using Text Areas in a Form"),s.createElement("p",null,"Reference the ",s.createElement(e,{to:"form"},"Forms")," page for guidelines for placing Inputs in Form Layouts."))},basic:{label:"Basic Text Areas",description:()=>s.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."),examples:{standard:{react:E.code`
|
|
8175
8175
|
function DemoComponent() {
|
|
8176
8176
|
const { formValue, formMeta, updateForm } = useSpsForm({ notes: "" });
|
|
8177
8177
|
|
|
@@ -8188,7 +8188,7 @@ var a=n.defineLocale("zh-tw",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u5
|
|
|
8188
8188
|
</div>
|
|
8189
8189
|
);
|
|
8190
8190
|
}
|
|
8191
|
-
`}}},placeholder:{label:"Placeholder Text",description:({NavigateTo:e})=>s.createElement("p",null,"Certain inputs may benefit from placeholder text to aid the user in providing a valid value."),examples:{placeholder:{react:E.code`
|
|
8191
|
+
`}}},placeholder:{label:"Placeholder Text",description:({NavigateTo:e})=>s.createElement("p",null,"Certain inputs may benefit from placeholder text to aid the user in providing a valid value. For guidelines regarding writing placeholder text reference the Placeholder Text section on the ",s.createElement(e,{to:"form"},"Forms")," page."),examples:{placeholder:{react:E.code`
|
|
8192
8192
|
function DemoComponent() {
|
|
8193
8193
|
const { formValue, formMeta, updateForm } = useSpsForm({ companyDescription: "" });
|
|
8194
8194
|
|
|
@@ -8205,7 +8205,7 @@ var a=n.defineLocale("zh-tw",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u5
|
|
|
8205
8205
|
</div>
|
|
8206
8206
|
);
|
|
8207
8207
|
}
|
|
8208
|
-
`}}},additional_text:{label:"Additional Descriptive Text",description:({NavigateTo:e})=>s.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."),examples:{placeholder:{react:E.code`
|
|
8208
|
+
`}}},additional_text:{label:"Additional Descriptive Text",description:({NavigateTo:e})=>s.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. For guidelines regarding writing descriptive text, reference the Additional Descriptive Text section on the"," ",s.createElement(e,{to:"form"},"Forms")," page."),examples:{placeholder:{react:E.code`
|
|
8209
8209
|
function DemoComponent() {
|
|
8210
8210
|
const { formValue, formMeta, updateForm } = useSpsForm({ campaignNotes: "" });
|
|
8211
8211
|
|
package/lib/index.es.js
CHANGED
|
@@ -32148,7 +32148,9 @@ const SpsRadioButtonExamples = {
|
|
|
32148
32148
|
to: "checkbox"
|
|
32149
32149
|
}, "Checkboxes"), " instead."), /* @__PURE__ */ React.createElement("li", null, "When the list of available options requires too much space to list efficiently. Use", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
|
|
32150
32150
|
to: "dropdown"
|
|
32151
|
-
}, "Dropdown"), " instead.")))
|
|
32151
|
+
}, "Dropdown"), " instead.")), /* @__PURE__ */ React.createElement("h5", null, "Using Radio Buttons in a Form"), /* @__PURE__ */ React.createElement("p", null, "Reference the ", /* @__PURE__ */ React.createElement(NavigateTo, {
|
|
32152
|
+
to: "form"
|
|
32153
|
+
}, "Forms"), " page for guidelines for placing Radio Buttons in Form Layouts."))
|
|
32152
32154
|
},
|
|
32153
32155
|
basic: {
|
|
32154
32156
|
label: "Basic Radio Buttons",
|
|
@@ -35115,7 +35117,9 @@ const SpsTextInputExamples = {
|
|
|
35115
35117
|
to: "radio-buttons"
|
|
35116
35118
|
}, "Radio Buttons"), " or", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
|
|
35117
35119
|
to: "toggle"
|
|
35118
|
-
}, "Toggles"), " instead.")))
|
|
35120
|
+
}, "Toggles"), " instead.")), /* @__PURE__ */ React.createElement("h5", null, "Using Text Inputs in a Form"), /* @__PURE__ */ React.createElement("p", null, "Reference the ", /* @__PURE__ */ React.createElement(NavigateTo, {
|
|
35121
|
+
to: "form"
|
|
35122
|
+
}, "Forms"), " page for guidelines for placing Inputs in Form Layouts."))
|
|
35119
35123
|
},
|
|
35120
35124
|
basic: {
|
|
35121
35125
|
label: "Basic Text Inputs",
|
|
@@ -35144,7 +35148,9 @@ const SpsTextInputExamples = {
|
|
|
35144
35148
|
},
|
|
35145
35149
|
placeholder: {
|
|
35146
35150
|
label: "Placeholder Text",
|
|
35147
|
-
description: ({ NavigateTo }) => /* @__PURE__ */ React.createElement("p", null, "Certain inputs may benefit from placeholder text to aid the user in providing a valid value."
|
|
35151
|
+
description: ({ NavigateTo }) => /* @__PURE__ */ React.createElement("p", null, "Certain inputs may benefit from placeholder text to aid the user in providing a valid value. For guidelines regarding writing placeholder text reference the Placeholder Text section on the ", /* @__PURE__ */ React.createElement(NavigateTo, {
|
|
35152
|
+
to: "form"
|
|
35153
|
+
}, "Forms"), " page."),
|
|
35148
35154
|
examples: {
|
|
35149
35155
|
placeholder: {
|
|
35150
35156
|
react: code`
|
|
@@ -35170,7 +35176,9 @@ const SpsTextInputExamples = {
|
|
|
35170
35176
|
},
|
|
35171
35177
|
additional_text: {
|
|
35172
35178
|
label: "Additional Descriptive Text",
|
|
35173
|
-
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."
|
|
35179
|
+
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. For guidelines regarding writing descriptive text, reference the Additional Descriptive Text section on the", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
|
|
35180
|
+
to: "form"
|
|
35181
|
+
}, "Forms"), " page."),
|
|
35174
35182
|
examples: {
|
|
35175
35183
|
placeholder: {
|
|
35176
35184
|
react: code`
|
|
@@ -35343,7 +35351,9 @@ const SpsTextareaExamples = {
|
|
|
35343
35351
|
to: "radio-buttons"
|
|
35344
35352
|
}, "Radio Buttons"), " or", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
|
|
35345
35353
|
to: "toggle"
|
|
35346
|
-
}, "Toggles"), " instead.")))
|
|
35354
|
+
}, "Toggles"), " instead.")), /* @__PURE__ */ React.createElement("h5", null, "Using Text Areas in a Form"), /* @__PURE__ */ React.createElement("p", null, "Reference the ", /* @__PURE__ */ React.createElement(NavigateTo, {
|
|
35355
|
+
to: "form"
|
|
35356
|
+
}, "Forms"), " page for guidelines for placing Inputs in Form Layouts."))
|
|
35347
35357
|
},
|
|
35348
35358
|
basic: {
|
|
35349
35359
|
label: "Basic Text Areas",
|
|
@@ -35373,7 +35383,9 @@ const SpsTextareaExamples = {
|
|
|
35373
35383
|
},
|
|
35374
35384
|
placeholder: {
|
|
35375
35385
|
label: "Placeholder Text",
|
|
35376
|
-
description: ({ NavigateTo }) => /* @__PURE__ */ React.createElement("p", null, "Certain inputs may benefit from placeholder text to aid the user in providing a valid value."
|
|
35386
|
+
description: ({ NavigateTo }) => /* @__PURE__ */ React.createElement("p", null, "Certain inputs may benefit from placeholder text to aid the user in providing a valid value. For guidelines regarding writing placeholder text reference the Placeholder Text section on the ", /* @__PURE__ */ React.createElement(NavigateTo, {
|
|
35387
|
+
to: "form"
|
|
35388
|
+
}, "Forms"), " page."),
|
|
35377
35389
|
examples: {
|
|
35378
35390
|
placeholder: {
|
|
35379
35391
|
react: code`
|
|
@@ -35399,7 +35411,9 @@ const SpsTextareaExamples = {
|
|
|
35399
35411
|
},
|
|
35400
35412
|
additional_text: {
|
|
35401
35413
|
label: "Additional Descriptive Text",
|
|
35402
|
-
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."
|
|
35414
|
+
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. For guidelines regarding writing descriptive text, reference the Additional Descriptive Text section on the", " ", /* @__PURE__ */ React.createElement(NavigateTo, {
|
|
35415
|
+
to: "form"
|
|
35416
|
+
}, "Forms"), " page."),
|
|
35403
35417
|
examples: {
|
|
35404
35418
|
placeholder: {
|
|
35405
35419
|
react: code`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spscommerce/ds-react",
|
|
3
3
|
"description": "SPS Design System React components",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.11.0",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/ds-react",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@react-stately/collections": "^3.3.3",
|
|
31
|
-
"@spscommerce/ds-colors": "6.
|
|
32
|
-
"@spscommerce/ds-illustrations": "6.
|
|
33
|
-
"@spscommerce/ds-shared": "6.
|
|
34
|
-
"@spscommerce/positioning": "6.
|
|
35
|
-
"@spscommerce/utils": "6.
|
|
31
|
+
"@spscommerce/ds-colors": "6.11.0",
|
|
32
|
+
"@spscommerce/ds-illustrations": "6.11.0",
|
|
33
|
+
"@spscommerce/ds-shared": "6.11.0",
|
|
34
|
+
"@spscommerce/positioning": "6.11.0",
|
|
35
|
+
"@spscommerce/utils": "6.11.0",
|
|
36
36
|
"moment": "^2.25.3",
|
|
37
37
|
"moment-timezone": "^0.5.28",
|
|
38
38
|
"react": "^16.9.0",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@react-stately/collections": "^3.3.3",
|
|
43
|
-
"@spscommerce/ds-colors": "6.
|
|
44
|
-
"@spscommerce/ds-illustrations": "6.
|
|
45
|
-
"@spscommerce/ds-shared": "6.
|
|
46
|
-
"@spscommerce/positioning": "6.
|
|
47
|
-
"@spscommerce/utils": "6.
|
|
43
|
+
"@spscommerce/ds-colors": "6.11.0",
|
|
44
|
+
"@spscommerce/ds-illustrations": "6.11.0",
|
|
45
|
+
"@spscommerce/ds-shared": "6.11.0",
|
|
46
|
+
"@spscommerce/positioning": "6.11.0",
|
|
47
|
+
"@spscommerce/utils": "6.11.0",
|
|
48
48
|
"@testing-library/react": "^9.3.2",
|
|
49
49
|
"@types/prop-types": "^15.7.1",
|
|
50
50
|
"@types/react": "^16.9.0",
|