@spectrum-web-components/textfield 0.12.1-devmode.0 → 0.13.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/package.json +8 -8
- package/sp-textfield.js +1 -2
- package/sp-textfield.js.map +1 -1
- package/src/Textfield.js +23 -253
- package/src/Textfield.js.map +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/spectrum-textfield.css.js +2 -4
- package/src/spectrum-textfield.css.js.map +1 -1
- package/src/textfield.css.js +2 -4
- package/src/textfield.css.js.map +1 -1
- package/stories/textarea.stories.js +8 -25
- package/stories/textarea.stories.js.map +1 -1
- package/stories/textfield.stories.js +8 -31
- package/stories/textfield.stories.js.map +1 -1
- package/test/benchmark/test-basic.js +1 -4
- package/test/benchmark/test-basic.js.map +1 -1
- package/test/textarea.test-vrt.js +1 -3
- package/test/textarea.test-vrt.js.map +1 -1
- package/test/textfield.test-vrt.js +1 -3
- package/test/textfield.test-vrt.js.map +1 -1
- package/test/textfield.test.js +60 -522
- package/test/textfield.test.js.map +1 -1
package/src/textfield.css.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["textfield.css.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-textfield-texticon-padding-left:var(\n--spectrum-textfield-m-texticon-padding-left\n);--spectrum-textfield-quiet-texticon-border-bottom-size:var(\n--spectrum-textfield-m-quiet-texticon-border-bottom-size,var(--spectrum-alias-input-border-size)\n);--spectrum-textfield-quiet-texticon-success-icon-margin-left:var(\n--spectrum-textfield-m-quiet-texticon-success-icon-margin-left,var(--spectrum-global-dimension-size-150)\n);--spectrum-textfield-quiet-texticon-invalid-icon-margin-left:var(\n--spectrum-textfield-m-quiet-texticon-invalid-icon-margin-left,var(--spectrum-global-dimension-size-150)\n);--spectrum-textfield-quiet-texticon-border-radius:var(\n--spectrum-textfield-m-quiet-texticon-border-radius,var(--spectrum-global-dimension-size-0)\n);--spectrum-textfield-quiet-texticon-padding-left:var(\n--spectrum-textfield-m-quiet-texticon-padding-left,var(--spectrum-global-dimension-size-0)\n);--spectrum-textfield-quiet-texticon-padding-right:var(\n--spectrum-textfield-m-quiet-texticon-padding-right,var(--spectrum-global-dimension-size-0)\n);--spectrum-textfield-texticon-border-size:var(\n--spectrum-textfield-m-texticon-border-size,var(--spectrum-alias-input-border-size)\n);--spectrum-textfield-texticon-text-line-height:var(\n--spectrum-textfield-m-texticon-text-line-height,var(--spectrum-alias-component-text-line-height)\n);--spectrum-textfield-texticon-text-size:var(\n--spectrum-textfield-m-texticon-text-size,var(--spectrum-global-dimension-font-size-100)\n);--spectrum-textfield-texticon-placeholder-text-font-style:var(\n--spectrum-textfield-m-texticon-placeholder-text-font-style,var(--spectrum-global-font-style-italic)\n);--spectrum-textfield-texticon-placeholder-text-font-weight:var(\n--spectrum-textfield-m-texticon-placeholder-text-font-weight,var(--spectrum-global-font-weight-regular)\n);--spectrum-textfield-texticon-success-icon-height:var(\n--spectrum-textfield-m-texticon-success-icon-height,var(--spectrum-alias-ui-icon-checkmark-size-100)\n);--spectrum-textfield-texticon-success-icon-width:var(\n--spectrum-textfield-m-texticon-success-icon-width,var(--spectrum-alias-ui-icon-checkmark-size-100)\n);--spectrum-textfield-texticon-success-icon-margin-left:var(\n--spectrum-textfield-m-texticon-success-icon-margin-left,var(--spectrum-global-dimension-size-150)\n);--spectrum-textfield-texticon-invalid-icon-height:var(\n--spectrum-textfield-m-texticon-invalid-icon-height,var(--spectrum-alias-ui-icon-alert-size-100)\n);--spectrum-textfield-texticon-invalid-icon-width:var(\n--spectrum-textfield-m-texticon-invalid-icon-width,var(--spectrum-alias-ui-icon-alert-size-100)\n);--spectrum-textfield-texticon-invalid-icon-margin-left:var(\n--spectrum-textfield-m-texticon-invalid-icon-margin-left,var(--spectrum-global-dimension-size-150)\n);--spectrum-textfield-texticon-min-width:var(\n--spectrum-textfield-m-texticon-min-width,var(--spectrum-global-dimension-size-600)\n);--spectrum-textfield-texticon-border-radius:var(\n--spectrum-textfield-m-texticon-border-radius,var(--spectrum-alias-border-radius-regular)\n);--spectrum-textfield-texticon-padding-right:var(\n--spectrum-textfield-m-texticon-padding-right,var(--spectrum-global-dimension-size-150)\n);--spectrum-textfield-texticon-height:var(\n--spectrum-textfield-m-texticon-height,var(--spectrum-global-dimension-size-400)\n);--spectrum-textarea-text-padding-top:var(\n--spectrum-textarea-m-text-padding-top,var(--spectrum-global-dimension-size-75)\n);--spectrum-textarea-text-padding-bottom:var(\n--spectrum-textarea-m-text-padding-bottom,var(--spectrum-global-dimension-size-115)\n);--spectrum-textarea-padding-left:var(\n--spectrum-textarea-m-padding-left,var(--spectrum-global-dimension-size-150)\n);--spectrum-textarea-padding-right:var(\n--spectrum-textarea-m-padding-right,var(--spectrum-global-dimension-size-150)\n);--spectrum-textarea-height:var(\n--spectrum-textarea-m-height,var(--spectrum-global-dimension-size-400)\n);--spectrum-textfield-texticon-padding-top:3px;--spectrum-textfield-texticon-padding-bottom:5px;--spectrum-textfield-texticon-text-font-family:var(\n--spectrum-alias-body-text-font-family,var(--spectrum-global-font-family-base)\n);--spectrum-textfield-texticon-icon-gap:var(\n--spectrum-global-dimension-size-65\n);--spectrum-textfield-quiet-texticon-icon-gap:var(\n--spectrum-global-dimension-size-75\n);--spectrum-textarea-min-height:var(--spectrum-textarea-height);--spectrum-textarea-height-adjusted:auto;--spectrum-textarea-padding-top:var(--spectrum-textarea-text-padding-top);--spectrum-textarea-padding-bottom:var(\n--spectrum-textarea-text-padding-bottom\n)}#textfield{display:inline-flex;min-width:var(--spectrum-textfield-texticon-min-width);position:relative;width:var(\n--spectrum-alias-single-line-width,var(--spectrum-global-dimension-size-2400)\n)}:host([quiet][multiline]) #textfield .input{height:var(\n--spectrum-textfield-texticon-height\n);min-height:var(--spectrum-textfield-texticon-height)}#textfield:after{border-color:transparent;border-radius:calc(var(--spectrum-textfield-texticon-border-radius) + var(\n--spectrum-textfield-m-texticon-focus-ring-gap,\nvar(--spectrum-alias-input-focusring-gap)\n));bottom:0;content:\"\";left:0;margin:calc(var(\n--spectrum-textfield-m-texticon-focus-ring-gap,\nvar(--spectrum-alias-input-focusring-gap)\n)*-1);pointer-events:none;position:absolute;right:0;top:0;transition:box-shadow var(--spectrum-global-animation-duration-100,.13s) ease-in-out,border-color var(--spectrum-global-animation-duration-100,.13s) ease-in-out}:host([quiet]) #textfield:after{border-radius:0}.input{-webkit-appearance:none;-moz-appearance:textfield;border:var(--spectrum-textfield-texticon-border-size) solid;border-radius:var(--spectrum-textfield-texticon-border-radius);box-sizing:border-box;font-family:var(--spectrum-textfield-texticon-text-font-family);font-size:var(--spectrum-textfield-texticon-text-size);height:var(--spectrum-textfield-texticon-height);line-height:var(--spectrum-textfield-texticon-text-line-height);margin:0;outline:none;overflow:visible;padding:var(--spectrum-textfield-texticon-padding-top) var(--spectrum-textfield-texticon-padding-right) var(--spectrum-textfield-texticon-padding-bottom) calc(var(--spectrum-textfield-texticon-padding-left) + 1px);text-indent:0;text-overflow:ellipsis;transition:border-color var(--spectrum-global-animation-duration-100,.13s) ease-in-out;vertical-align:top;width:100%}.input::placeholder{font-style:var(--spectrum-textfield-texticon-placeholder-text-font-style);font-weight:var(\n--spectrum-textfield-texticon-placeholder-text-font-weight\n);opacity:1;transition:color var(--spectrum-global-animation-duration-100,.13s) ease-in-out}.input:lang(ja)::placeholder,.input:lang(ko)::placeholder,.input:lang(zh)::placeholder{font-style:normal}.input:hover::placeholder{font-weight:var(\n--spectrum-textfield-texticon-placeholder-text-font-weight\n)}.input:disabled{opacity:1;resize:none}.input:disabled::placeholder{font-weight:var(\n--spectrum-textfield-texticon-placeholder-text-font-weight\n)}.input::-ms-clear{height:0;width:0}.input::-webkit-inner-spin-button,.input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input:-moz-ui-invalid{box-shadow:none}:host([dir=ltr][valid]) #textfield .input{padding-right:calc(var(--spectrum-textfield-texticon-padding-right) + var(--spectrum-textfield-texticon-success-icon-width) + var(\n--spectrum-textfield-icon-inline-end-override,\nvar(--spectrum-textfield-texticon-success-icon-margin-left)\n))}:host([dir=rtl][valid]) #textfield .input{padding-left:calc(var(--spectrum-textfield-texticon-padding-right) + var(--spectrum-textfield-texticon-success-icon-width) + var(\n--spectrum-textfield-icon-inline-end-override,\nvar(--spectrum-textfield-texticon-success-icon-margin-left)\n))}:host([dir=ltr][invalid]) #textfield .input{padding-right:calc(var(--spectrum-textfield-texticon-padding-right) + var(--spectrum-textfield-texticon-invalid-icon-width) + var(\n--spectrum-textfield-icon-inline-end-override,\nvar(--spectrum-textfield-texticon-invalid-icon-margin-left)\n))}:host([dir=rtl][invalid]) #textfield .input{padding-left:calc(var(--spectrum-textfield-texticon-padding-right) + var(--spectrum-textfield-texticon-invalid-icon-width) + var(\n--spectrum-textfield-icon-inline-end-override,\nvar(--spectrum-textfield-texticon-invalid-icon-margin-left)\n))}:host([multiline]) .input{height:var(\n--spectrum-textarea-height-adjusted\n);min-height:var(--spectrum-textarea-min-height);overflow:auto;padding:var(--spectrum-textarea-padding-top) var(--spectrum-textarea-padding-right) var(--spectrum-textarea-padding-bottom) calc(var(--spectrum-textarea-padding-left) - 1px)}:host([dir=ltr][quiet]) .input{padding-left:var(\n--spectrum-textfield-quiet-texticon-padding-left\n)}:host([dir=rtl][quiet]) .input{padding-right:var(\n--spectrum-textfield-quiet-texticon-padding-left\n)}:host([dir=ltr][quiet]) .input{padding-right:var(\n--spectrum-textfield-quiet-texticon-padding-right\n)}:host([dir=rtl][quiet]) .input{padding-left:var(\n--spectrum-textfield-quiet-texticon-padding-right\n)}:host([quiet]) .input{border-bottom-width:var(\n--spectrum-textfield-quiet-texticon-border-bottom-size\n);border-left-width:0;border-radius:var(\n--spectrum-textfield-quiet-texticon-border-radius\n);border-right-width:0;border-top-width:0;overflow-y:hidden;resize:none}:host([dir=ltr][invalid][quiet]) .input{padding-right:calc(var(--spectrum-textfield-texticon-invalid-icon-width) + var(--spectrum-textfield-quiet-texticon-invalid-icon-margin-left))}:host([dir=rtl][invalid][quiet]) .input{padding-left:calc(var(--spectrum-textfield-texticon-invalid-icon-width) + var(--spectrum-textfield-quiet-texticon-invalid-icon-margin-left))}:host([dir=ltr][valid][quiet]) .input{padding-right:calc(var(--spectrum-textfield-texticon-success-icon-width) + var(--spectrum-textfield-quiet-texticon-success-icon-margin-left))}:host([dir=rtl][valid][quiet]) .input{padding-left:calc(var(--spectrum-textfield-texticon-success-icon-width) + var(--spectrum-textfield-quiet-texticon-success-icon-margin-left))}.icon{pointer-events:all;position:absolute}:host([dir=ltr][quiet]) .icon{padding-right:0}:host([dir=rtl][quiet]) .icon{padding-left:0}:host([dir=ltr][invalid]) #textfield .icon{right:var(\n--spectrum-textfield-icon-inline-end-override,var(--spectrum-textfield-texticon-invalid-icon-margin-left)\n)}:host([dir=rtl][invalid]) #textfield .icon{left:var(\n--spectrum-textfield-icon-inline-end-override,var(--spectrum-textfield-texticon-invalid-icon-margin-left)\n)}:host([invalid]) #textfield .icon{bottom:calc(var(--spectrum-textfield-texticon-height)/2 - var(--spectrum-textfield-texticon-invalid-icon-height)/2);height:var(--spectrum-textfield-texticon-invalid-icon-height);width:var(\n--spectrum-textfield-texticon-invalid-icon-width\n)}:host([dir=ltr][quiet][invalid]) #textfield .icon{right:var(\n--spectrum-textfield-icon-inline-end-override,0\n)}:host([dir=rtl][quiet][invalid]) #textfield .icon{left:var(\n--spectrum-textfield-icon-inline-end-override,0\n)}:host([dir=ltr][valid]) #textfield .icon{right:var(\n--spectrum-textfield-icon-inline-end-override,var(--spectrum-textfield-texticon-success-icon-margin-left)\n)}:host([dir=rtl][valid]) #textfield .icon{left:var(\n--spectrum-textfield-icon-inline-end-override,var(--spectrum-textfield-texticon-success-icon-margin-left)\n)}:host([valid]) #textfield .icon{bottom:calc(var(--spectrum-textfield-texticon-height)/2 - var(--spectrum-textfield-texticon-success-icon-height)/2);height:var(--spectrum-textfield-texticon-success-icon-height);width:var(\n--spectrum-textfield-texticon-success-icon-width\n)}:host([dir=ltr][quiet][valid]) #textfield .icon{right:var(\n--spectrum-textfield-icon-inline-end-override,0\n)}:host([dir=rtl][quiet][valid]) #textfield .icon{left:var(\n--spectrum-textfield-icon-inline-end-override,0\n)}:host([dir=ltr]) .icon-workflow{left:var(\n--spectrum-textfield-texticon-padding-left\n)}:host([dir=rtl]) .icon-workflow{right:var(\n--spectrum-textfield-texticon-padding-left\n)}.icon-workflow{display:block;height:var(\n--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)\n);position:absolute;top:calc(var(--spectrum-textfield-texticon-height)/2 - var(\n--spectrum-alias-workflow-icon-size-m,\nvar(--spectrum-global-dimension-size-225)\n)/2);width:var(\n--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)\n)}:host([dir=ltr][quiet]) .icon-workflow{left:0}:host([dir=rtl][quiet]) .icon-workflow{right:0}:host([dir=ltr][quiet]) .icon-workflow~.input{padding-left:calc(var(\n--spectrum-alias-workflow-icon-size-m,\nvar(--spectrum-global-dimension-size-225)\n) + var(--spectrum-textfield-quiet-texticon-icon-gap))}:host([dir=rtl][quiet]) .icon-workflow~.input{padding-right:calc(var(\n--spectrum-alias-workflow-icon-size-m,\nvar(--spectrum-global-dimension-size-225)\n) + var(--spectrum-textfield-quiet-texticon-icon-gap))}:host([dir=ltr]) .icon-workflow+.input{padding-left:calc(var(--spectrum-textfield-texticon-padding-left) + var(\n--spectrum-alias-workflow-icon-size-m,\nvar(--spectrum-global-dimension-size-225)\n) + var(--spectrum-textfield-texticon-icon-gap))}:host([dir=rtl]) .icon-workflow+.input{padding-right:calc(var(--spectrum-textfield-texticon-padding-left) + var(\n--spectrum-alias-workflow-icon-size-m,\nvar(--spectrum-global-dimension-size-225)\n) + var(--spectrum-textfield-texticon-icon-gap))}:host([multiline]) .icon-workflow~.input{height:var(\n--spectrum-textfield-texticon-height\n);min-height:var(--spectrum-textfield-texticon-height)}#textfield:hover .input{border-color:var(\n--spectrum-textfield-m-texticon-border-color-hover,var(--spectrum-alias-input-border-color-hover)\n);box-shadow:none}#textfield:hover .input::placeholder{color:var(\n--spectrum-textfield-m-texticon-placeholder-text-color-hover,var(--spectrum-alias-placeholder-text-color-hover)\n)}#textfield:hover .icon-workflow{color:var(\n--spectrum-textfield-m-texticon-icon-color-hover,var(--spectrum-alias-component-icon-color-hover)\n)}#textfield:active .input{border-color:var(\n--spectrum-textfield-m-texticon-border-color-down,var(--spectrum-alias-input-border-color-down)\n)}#textfield:active .icon-workflow{color:var(\n--spectrum-textfield-m-texticon-icon-color-down,var(--spectrum-alias-component-icon-color-down)\n)}:host([valid]) #textfield .icon{color:var(\n--spectrum-textfield-m-texticon-validation-icon-color-valid,var(--spectrum-semantic-positive-icon-color)\n)}:host([invalid]) #textfield .icon{color:var(\n--spectrum-textfield-m-texticon-validation-icon-color-invalid,var(--spectrum-semantic-negative-icon-color)\n)}:host([invalid]) #textfield:hover .input{border-color:var(\n--spectrum-textfield-m-texticon-border-color-invalid-hover,var(--spectrum-alias-input-border-color-invalid-hover)\n)}:host([disabled]) #textfield .icon{color:var(\n--spectrum-textfield-m-texticon-validation-icon-color-invalid-disabled,var(--spectrum-alias-background-color-transparent)\n)}:host([disabled]) #textfield .icon-workflow{color:var(\n--spectrum-textfield-m-texticon-icon-color-disabled,var(--spectrum-alias-component-icon-color-disabled)\n)}.icon-workflow{color:var(\n--spectrum-textfield-m-texticon-icon-color,var(--spectrum-alias-component-icon-color-default)\n)}:host([focused]) #textfield:after{box-shadow:0 0 0 var(\n--spectrum-textfield-m-texticon-focus-ring-border-width,var(--spectrum-alias-component-focusring-size)\n) var(\n--spectrum-textfield-m-textonly-focus-ring-border-color-key-focus,var(--spectrum-alias-focus-ring-color)\n)}:host([focused][quiet]) #textfield .input{box-shadow:none}:host([focused][quiet]) #textfield:after{border-bottom:2px solid var(\n--spectrum-textfield-m-textonly-focus-ring-border-color-key-focus,var(--spectrum-alias-focus-ring-color)\n);bottom:calc(var(\n--spectrum-alias-input-quiet-focusline-gap,\nvar(--spectrum-global-dimension-static-size-10)\n)*-1);box-shadow:none;margin:0}.input{background-color:var(\n--spectrum-textfield-m-texticon-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-textfield-m-texticon-border-color,var(--spectrum-alias-input-border-color-default)\n);color:var(\n--spectrum-textfield-m-texticon-text-color,var(--spectrum-alias-component-text-color-default)\n)}.input::placeholder{color:var(\n--spectrum-textfield-m-texticon-placeholder-text-color,var(--spectrum-global-color-gray-600)\n)}.input:focus,:host([focused]) #textfield .input{border-color:var(\n--spectrum-textfield-m-texticon-border-color-down,var(--spectrum-alias-input-border-color-down)\n)}.input.focus-visible,:host([focused]) #textfield .input{border-color:var(\n--spectrum-textfield-m-texticon-border-color-key-focus,var(--spectrum-alias-input-border-color-key-focus)\n)}.input:focus-visible,:host([focused]) #textfield .input{border-color:var(\n--spectrum-textfield-m-texticon-border-color-key-focus,var(--spectrum-alias-input-border-color-key-focus)\n)}:host([invalid]) #textfield .input{border-color:var(\n--spectrum-textfield-m-texticon-border-color-invalid,var(--spectrum-alias-input-border-color-invalid-default)\n)}:host([focused][invalid]) #textfield .input,:host([invalid]) #textfield .input:focus{border-color:var(\n--spectrum-textfield-m-texticon-border-color-invalid-mouse-focus,var(--spectrum-alias-input-border-color-invalid-mouse-focus)\n)}:host([focused][invalid]) #textfield .input,:host([invalid]) #textfield .input.focus-visible{border-color:var(\n--spectrum-textfield-m-texticon-border-color-invalid-key-focus,var(--spectrum-alias-input-border-color-invalid-key-focus)\n)}:host([focused][invalid]) #textfield .input,:host([invalid]) #textfield .input:focus-visible{border-color:var(\n--spectrum-textfield-m-texticon-border-color-invalid-key-focus,var(--spectrum-alias-input-border-color-invalid-key-focus)\n)}.input :disabled,:host([disabled]) #textfield .input,:host([disabled]) #textfield:hover .input{-webkit-text-fill-color:var(\n--spectrum-textfield-m-texticon-text-color-disabled,var(--spectrum-alias-component-text-color-disabled)\n);background-color:var(\n--spectrum-textfield-m-texticon-background-color-disabled,var(--spectrum-global-color-gray-200)\n);border-color:var(\n--spectrum-textfield-m-texticon-border-color-disabled,var(--spectrum-alias-input-border-color-disabled)\n);color:var(\n--spectrum-textfield-m-texticon-text-color-disabled,var(--spectrum-alias-component-text-color-disabled)\n)}.input :disabled::placeholder,:host([disabled]) #textfield .input::placeholder,:host([disabled]) #textfield:hover .input::placeholder{color:var(\n--spectrum-textfield-m-texticon-placeholder-text-color-disabled,var(--spectrum-alias-text-color-disabled)\n)}.input:read-only,:host([readonly]) #textfield .input,:host([readonly]) #textfield:hover .input{-webkit-text-fill-color:var(--spectrum-global-color-gray-800);background-color:var(\n--spectrum-alias-background-color-transparent,transparent\n);border-color:var(\n--spectrum-alias-background-color-transparent,transparent\n);color:var(--spectrum-global-color-gray-800)}:host([quiet]) .input{background-color:var(\n--spectrum-textfield-m-quiet-texticon-background-color,var(--spectrum-alias-background-color-transparent)\n);border-color:var(\n--spectrum-textfield-m-quiet-texticon-border-color,var(--spectrum-alias-input-border-color-default)\n)}:host([focused][quiet]) #textfield .input,:host([quiet]) .input:focus{border-color:var(\n--spectrum-textfield-m-quiet-texticon-border-color-mouse-focus,var(--spectrum-alias-input-border-color-mouse-focus)\n)}:host([focused][quiet]) #textfield .input,:host([quiet]) .input.focus-visible{border-color:var(\n--spectrum-textfield-m-texticon-border-color-key-focus,var(--spectrum-alias-input-border-color-key-focus)\n);box-shadow:0 1px 0 var(\n--spectrum-textfield-m-texticon-border-color-key-focus,var(--spectrum-alias-input-border-color-key-focus)\n)}:host([focused][quiet]) #textfield .input,:host([quiet]) .input:focus-visible{border-color:var(\n--spectrum-textfield-m-texticon-border-color-key-focus,var(--spectrum-alias-input-border-color-key-focus)\n);box-shadow:0 1px 0 var(\n--spectrum-textfield-m-texticon-border-color-key-focus,var(--spectrum-alias-input-border-color-key-focus)\n)}:host([invalid][quiet]) #textfield .input{border-color:var(\n--spectrum-textfield-m-quiet-texticon-border-color-invalid,var(--spectrum-alias-input-border-color-invalid-default)\n)}:host([focused][invalid][quiet]) #textfield .input,:host([invalid][quiet]) #textfield .input:focus{border-color:var(\n--spectrum-textfield-m-quiet-texticon-border-color-invalid-mouse-focus,var(--spectrum-alias-input-border-color-invalid-mouse-focus)\n)}:host([focused][invalid][quiet]) #textfield .input,:host([invalid][quiet]) #textfield .input.focus-visible{border-color:var(\n--spectrum-textfield-m-quiet-texticon-border-color-invalid-key-focus,var(--spectrum-alias-input-border-color-invalid-key-focus)\n);box-shadow:0 1px 0 var(\n--spectrum-textfield-m-quiet-texticon-border-color-invalid-key-focus,var(--spectrum-alias-input-border-color-invalid-key-focus)\n)}:host([focused][invalid][quiet]) #textfield .input,:host([invalid][quiet]) #textfield .input:focus-visible{border-color:var(\n--spectrum-textfield-m-quiet-texticon-border-color-invalid-key-focus,var(--spectrum-alias-input-border-color-invalid-key-focus)\n);box-shadow:0 1px 0 var(\n--spectrum-textfield-m-quiet-texticon-border-color-invalid-key-focus,var(--spectrum-alias-input-border-color-invalid-key-focus)\n)}:host([disabled][quiet]) #textfield .input,:host([disabled][quiet]) #textfield:hover .input,:host([quiet]) .input :disabled{background-color:var(\n--spectrum-textfield-m-quiet-texticon-background-color-disabled,var(--spectrum-alias-background-color-transparent)\n);border-color:var(\n--spectrum-textfield-m-quiet-texticon-border-color-disabled,var(--spectrum-alias-input-border-color-quiet-disabled)\n)}@media (forced-colors:active){#textfield{--spectrum-textfield-m-quiet-texticon-border-color-disabled:GrayText;--spectrum-textfield-m-quiet-texticon-border-color-down:Highlight;--spectrum-textfield-m-quiet-texticon-border-color-hover:Highlight;--spectrum-textfield-m-quiet-texticon-border-color-invalid:Highlight;--spectrum-textfield-m-quiet-texticon-border-color-invalid-key-focus:Highlight;--spectrum-textfield-m-quiet-texticon-border-color-invalid-mouse-focus:Highlight;--spectrum-textfield-m-quiet-texticon-border-color-mouse-focus:Highlight;--spectrum-textfield-m-texticon-border-color-disabled:GrayText;--spectrum-textfield-m-texticon-border-color-down:Highlight;--spectrum-textfield-m-texticon-border-color-hover:Highlight;--spectrum-textfield-m-texticon-border-color-invalid:Highlight;--spectrum-textfield-m-texticon-border-color-invalid-hover:Highlight;--spectrum-textfield-m-texticon-border-color-invalid-key-focus:Highlight;--spectrum-textfield-m-texticon-border-color-invalid-mouse-focus:Highlight;--spectrum-textfield-m-texticon-border-color-key-focus:Highlight;--spectrum-textfield-m-texticon-placeholder-text-color:GrayText;--spectrum-textfield-m-texticon-placeholder-text-color-disabled:GrayText;--spectrum-textfield-m-texticon-placeholder-text-color-hover:GrayText;--spectrum-textfield-m-texticon-text-color-disabled:GrayText;--spectrum-textfield-m-textonly-focus-ring-border-color-key-focus:Highlight;--spectrum-textfield-m-texticon-focus-ring-border-width:2px}:host([focused]) #textfield:after{forced-color-adjust:none}}:host{display:inline-flex;flex-direction:column;width:var(\n--spectrum-alias-single-line-width,var(--spectrum-global-dimension-size-2400)\n)}:host([multiline]){resize:both}:host([multiline][readonly]){resize:none}#textfield{width:100%}#textfield,textarea{resize:inherit}.input{min-width:var(--spectrum-textfield-texticon-min-width)}:host([focused]) .input{caret-color:var(--swc-test-caret-color);forced-color-adjust:var(--swc-test-forced-color-adjust)}:host([grows]) .input{height:100%;left:0;overflow:hidden;position:absolute;resize:none;top:0}:host([grows]) #sizer{-webkit-appearance:none;-moz-appearance:textfield;border:var(--spectrum-textfield-texticon-border-size) solid;border-radius:var(--spectrum-textfield-texticon-border-radius);box-sizing:border-box;font-family:var(--spectrum-textfield-texticon-text-font-family);font-size:var(--spectrum-textfield-texticon-text-size);line-height:var(--spectrum-textfield-texticon-text-line-height);margin:0;outline:none;overflow:visible;overflow-wrap:break-word;padding:var(--spectrum-textarea-padding-top) var(--spectrum-textarea-padding-right) var(--spectrum-textarea-padding-bottom) calc(var(--spectrum-textarea-padding-left) - 1px);text-indent:0;text-overflow:ellipsis;transition:border-color var(--spectrum-global-animation-duration-100,.13s) ease-in-out,box-shadow var(--spectrum-global-animation-duration-100,.13s) ease-in-out;vertical-align:top;white-space:pre-wrap;width:100%;word-break:break-word}:host([grows][quiet]) #sizer{border-bottom-width:var(--spectrum-textfield-quiet-texticon-border-size);border-left-width:0;border-radius:var(--spectrum-textfield-quiet-texticon-border-radius);border-right-width:0;border-top-width:0;overflow-y:hidden;resize:none}.icon,.icon-workflow{pointer-events:none}:host([multiline]) #textfield{display:inline-grid}:host([multiline]) textarea{transition:box-shadow var(--spectrum-global-animation-duration-100,.13s) ease-in-out,border-color var(--spectrum-global-animation-duration-100,.13s) ease-in-out}:host([multiline][focused]:not([quiet])) textarea,:host([multiline][focused]:not([quiet]):hover) textarea{box-shadow:0 0 0 calc(var(\n--spectrum-textfield-m-texticon-focus-ring-border-width,\nvar(--spectrum-alias-component-focusring-size)\n)) var(\n--spectrum-textfield-m-textonly-focus-ring-border-color-key-focus,var(--spectrum-alias-focus-ring-color)\n)!important}:host([multiline]:not([quiet])) #textfield:after{box-shadow:none}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,oDACA,KAAM,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgQf,cAAe",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "@spectrum-web-components/textfield/sp-textfield.js";
|
|
3
|
-
import "@spectrum-web-components/field-label/sp-field-label.js";
|
|
4
|
-
import "@spectrum-web-components/help-text/sp-help-text.js";
|
|
5
|
-
export default {
|
|
6
|
-
component: "sp-textfield",
|
|
7
|
-
title: "Textarea"
|
|
8
|
-
};
|
|
9
|
-
export const Default = () => {
|
|
10
|
-
return html`
|
|
1
|
+
import{html as e}from"@spectrum-web-components/base";import"@spectrum-web-components/textfield/sp-textfield.js";import"@spectrum-web-components/field-label/sp-field-label.js";import"@spectrum-web-components/help-text/sp-help-text.js";export default{component:"sp-textfield",title:"Textarea"};export const Default=()=>e`
|
|
11
2
|
<sp-textfield
|
|
12
3
|
multiline
|
|
13
4
|
label="Enter your life story"
|
|
@@ -55,9 +46,7 @@ export const Default = () => {
|
|
|
55
46
|
disabled
|
|
56
47
|
placeholder="Enter your life story"
|
|
57
48
|
></sp-textfield>
|
|
58
|
-
|
|
59
|
-
};
|
|
60
|
-
export const quiet = () => html`
|
|
49
|
+
`,quiet=()=>e`
|
|
61
50
|
<sp-field-label for="story">Enter your life story...</sp-field-label>
|
|
62
51
|
<sp-textfield
|
|
63
52
|
autofocus
|
|
@@ -66,8 +55,7 @@ export const quiet = () => html`
|
|
|
66
55
|
quiet
|
|
67
56
|
placeholder="Enter your life story"
|
|
68
57
|
></sp-textfield>
|
|
69
|
-
|
|
70
|
-
export const grows = () => html`
|
|
58
|
+
`,grows=()=>e`
|
|
71
59
|
<sp-field-label for="story">Enter your life story...</sp-field-label>
|
|
72
60
|
<sp-textfield
|
|
73
61
|
multiline
|
|
@@ -76,8 +64,7 @@ export const grows = () => html`
|
|
|
76
64
|
grows
|
|
77
65
|
placeholder="Enter your life story"
|
|
78
66
|
></sp-textfield>
|
|
79
|
-
|
|
80
|
-
export const growsEmpty = () => html`
|
|
67
|
+
`,growsEmpty=()=>e`
|
|
81
68
|
<sp-field-label for="empty">
|
|
82
69
|
This textfield hasn't been used yet
|
|
83
70
|
</sp-field-label>
|
|
@@ -92,8 +79,7 @@ export const growsEmpty = () => html`
|
|
|
92
79
|
Even empty Textfield display correctly while waiting for content.
|
|
93
80
|
</sp-help-text>
|
|
94
81
|
</sp-textfield>
|
|
95
|
-
|
|
96
|
-
export const growsWithLargeWords = () => html`
|
|
82
|
+
`,growsWithLargeWords=()=>e`
|
|
97
83
|
<sp-field-label for="story">
|
|
98
84
|
Enter your life story with very long words...
|
|
99
85
|
</sp-field-label>
|
|
@@ -104,8 +90,7 @@ export const growsWithLargeWords = () => html`
|
|
|
104
90
|
grows
|
|
105
91
|
placeholder="Enter your life story"
|
|
106
92
|
></sp-textfield>
|
|
107
|
-
|
|
108
|
-
export const readonly = () => html`
|
|
93
|
+
`,readonly=()=>e`
|
|
109
94
|
<sp-textfield
|
|
110
95
|
multiline
|
|
111
96
|
label="Enter your life story"
|
|
@@ -113,8 +98,7 @@ export const readonly = () => html`
|
|
|
113
98
|
readonly
|
|
114
99
|
placeholder="Enter your life story"
|
|
115
100
|
></sp-textfield>
|
|
116
|
-
|
|
117
|
-
export const resizeControls = () => html`
|
|
101
|
+
`,resizeControls=()=>e`
|
|
118
102
|
<sp-textfield
|
|
119
103
|
multiline
|
|
120
104
|
style="resize: none;"
|
|
@@ -135,8 +119,7 @@ export const resizeControls = () => html`
|
|
|
135
119
|
label="Horizontal resize control"
|
|
136
120
|
placeholder="Horizontal resize control"
|
|
137
121
|
></sp-textfield>
|
|
138
|
-
|
|
139
|
-
export const sized = () => html`
|
|
122
|
+
`,sized=()=>e`
|
|
140
123
|
<sp-field-label for="sized">
|
|
141
124
|
This textfield hasn't been used yet
|
|
142
125
|
</sp-field-label>
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["textarea.stories.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2018 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/textfield/sp-textfield.js';\nimport '@spectrum-web-components/field-label/sp-field-label.js';\nimport '@spectrum-web-components/help-text/sp-help-text.js';\n\nexport default {\n component: 'sp-textfield',\n title: 'Textarea',\n};\n\nexport const Default = (): TemplateResult => {\n return html`\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n disabled\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n pattern=\"[\\\\w\\\\s]+\"\n required\n valid\n value=\"A valid input\"\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n required\n valid\n value=\"A valid input\"\n disabled\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n pattern=\"[\\\\d]+\"\n required\n value=\"Not a valid input\"\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n pattern=\"[\\\\d]+\"\n invalid\n required\n value=\"Not a valid input\"\n disabled\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n `;\n};\n\nexport const quiet = (): TemplateResult => html`\n <sp-field-label for=\"story\">Enter your life story...</sp-field-label>\n <sp-textfield\n autofocus\n multiline\n id=\"story\"\n quiet\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n`;\n\nexport const grows = (): TemplateResult => html`\n <sp-field-label for=\"story\">Enter your life story...</sp-field-label>\n <sp-textfield\n multiline\n id=\"story\"\n value=\"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.\"\n grows\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n`;\n\nexport const growsEmpty = (): TemplateResult => html`\n <sp-field-label for=\"empty\">\n This textfield hasn't been used yet\n </sp-field-label>\n <sp-textfield\n multiline\n id=\"empty\"\n grows\n placeholder=\"You can type here\"\n autofocus\n >\n <sp-help-text slot=\"help-text\">\n Even empty Textfield display correctly while waiting for content.\n </sp-help-text>\n </sp-textfield>\n`;\n\nexport const growsWithLargeWords = (): TemplateResult => html`\n <sp-field-label for=\"story\">\n Enter your life story with very long words...\n </sp-field-label>\n <sp-textfield\n multiline\n id=\"story\"\n value=\"Sed utperspiciatisundeomnisistenatuserrorsitvoluptatemaccusantiumdoloremquelaudantium,totamemaperiam, eaque ipsa quae ab illo inventore veritatis etquasiarchitectobeataevitaedictasuntexplicabo. Nemo enimipsamvoluptatemquiavoluptassitaspernaturautoditautfugitsedquiaconsequunturmagnidoloreseosquirationevoluptatemsequinesciunt.\"\n grows\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n`;\n\nexport const readonly = (): TemplateResult => html`\n <sp-textfield\n multiline\n label=\"Enter your life story\"\n value=\"A readonly textarea\"\n readonly\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n`;\n\nexport const resizeControls = (): TemplateResult => html`\n <sp-textfield\n multiline\n style=\"resize: none;\"\n label=\"No resize control\"\n placeholder=\"No resize control\"\n ></sp-textfield>\n\n <sp-textfield\n multiline\n style=\"resize: vertical;\"\n label=\"Vertical resize control\"\n placeholder=\"Vertical resize control\"\n ></sp-textfield>\n\n <sp-textfield\n multiline\n style=\"resize: horizontal;\"\n label=\"Horizontal resize control\"\n placeholder=\"Horizontal resize control\"\n ></sp-textfield>\n`;\n\nexport const sized = (): TemplateResult => html`\n <sp-field-label for=\"sized\">\n This textfield hasn't been used yet\n </sp-field-label>\n <sp-textfield\n multiline\n id=\"sized\"\n placeholder=\"You can type here\"\n autofocus\n style=\"width: 400px\"\n >\n <sp-help-text slot=\"help-text\">\n Even empty Textfield display correctly while waiting for content.\n </sp-help-text>\n </sp-textfield>\n`;\n"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,qDAEA,2DACA,+DACA,2DAEA,cAAe,CACX,UAAW,eACX,MAAO,UACX,EAEO,YAAM,SAAU,IACZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAmDE,MAAQ,IAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW9B,MAAQ,IAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW9B,WAAa,IAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBnC,oBAAsB,IAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAa5C,SAAW,IAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUjC,eAAiB,IAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuBvC,MAAQ,IAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "@spectrum-web-components/textfield/sp-textfield.js";
|
|
3
|
-
import "@spectrum-web-components/field-label/sp-field-label.js";
|
|
4
|
-
import "@spectrum-web-components/help-text/sp-help-text.js";
|
|
5
|
-
export default {
|
|
6
|
-
component: "sp-textfield",
|
|
7
|
-
title: "Textfield"
|
|
8
|
-
};
|
|
9
|
-
export const Default = () => {
|
|
10
|
-
return html`
|
|
1
|
+
import{html as e}from"@spectrum-web-components/base";import"@spectrum-web-components/textfield/sp-textfield.js";import"@spectrum-web-components/field-label/sp-field-label.js";import"@spectrum-web-components/help-text/sp-help-text.js";export default{component:"sp-textfield",title:"Textfield"};export const Default=()=>e`
|
|
11
2
|
<sp-textfield placeholder="Enter your name"></sp-textfield>
|
|
12
3
|
<sp-textfield placeholder="Enter your name" disabled></sp-textfield>
|
|
13
4
|
<sp-textfield
|
|
@@ -35,10 +26,7 @@ export const Default = () => {
|
|
|
35
26
|
value="Not a valid input"
|
|
36
27
|
disabled
|
|
37
28
|
></sp-textfield>
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
export const quiet = () => {
|
|
41
|
-
return html`
|
|
29
|
+
`,quiet=()=>e`
|
|
42
30
|
<sp-field-label for="name">Enter your name</sp-field-label>
|
|
43
31
|
<sp-textfield
|
|
44
32
|
autofocus
|
|
@@ -46,33 +34,24 @@ export const quiet = () => {
|
|
|
46
34
|
placeholder="This Text Field doesn't make much noise"
|
|
47
35
|
quiet
|
|
48
36
|
></sp-textfield>
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
export const notRequiredWithPattern = () => {
|
|
52
|
-
return html`
|
|
37
|
+
`,notRequiredWithPattern=()=>e`
|
|
53
38
|
<sp-textfield
|
|
54
39
|
placeholder="Enter z, x, c, or v"
|
|
55
40
|
pattern="[zxcv]+"
|
|
56
41
|
></sp-textfield>
|
|
57
|
-
|
|
58
|
-
};
|
|
59
|
-
export const allowedKeys = () => {
|
|
60
|
-
return html`
|
|
42
|
+
`,allowedKeys=()=>e`
|
|
61
43
|
<sp-textfield
|
|
62
44
|
placeholder="Enter your name"
|
|
63
45
|
allowed-keys="a-z"
|
|
64
46
|
></sp-textfield>
|
|
65
|
-
|
|
66
|
-
};
|
|
67
|
-
export const readonly = () => html`
|
|
47
|
+
`,readonly=()=>e`
|
|
68
48
|
<sp-textfield
|
|
69
49
|
label="Enter your life story"
|
|
70
50
|
value="A readonly textfield"
|
|
71
51
|
readonly
|
|
72
52
|
placeholder="Enter your life story"
|
|
73
53
|
></sp-textfield>
|
|
74
|
-
|
|
75
|
-
export const types = () => html`
|
|
54
|
+
`,types=()=>e`
|
|
76
55
|
<sp-textfield label="Default" placeholder="default (text)"></sp-textfield>
|
|
77
56
|
<sp-textfield label="Text" type="text" placeholder="text"></sp-textfield>
|
|
78
57
|
<sp-textfield label="URL" type="url" placeholder="url"></sp-textfield>
|
|
@@ -87,8 +66,7 @@ export const types = () => html`
|
|
|
87
66
|
type="password"
|
|
88
67
|
placeholder="password"
|
|
89
68
|
></sp-textfield>
|
|
90
|
-
|
|
91
|
-
export const empty = () => html`
|
|
69
|
+
`,empty=()=>e`
|
|
92
70
|
<sp-field-label for="empty">
|
|
93
71
|
This textfield hasn't been used yet
|
|
94
72
|
</sp-field-label>
|
|
@@ -97,8 +75,7 @@ export const empty = () => html`
|
|
|
97
75
|
Even empty Textfield display correctly while waiting for content.
|
|
98
76
|
</sp-help-text>
|
|
99
77
|
</sp-textfield>
|
|
100
|
-
|
|
101
|
-
export const sized = () => html`
|
|
78
|
+
`,sized=()=>e`
|
|
102
79
|
<sp-field-label for="sized">
|
|
103
80
|
This textfield hasn't been used yet
|
|
104
81
|
</sp-field-label>
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["textfield.stories.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2018 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/textfield/sp-textfield.js';\nimport '@spectrum-web-components/field-label/sp-field-label.js';\nimport '@spectrum-web-components/help-text/sp-help-text.js';\n\nexport default {\n component: 'sp-textfield',\n title: 'Textfield',\n};\n\nexport const Default = (): TemplateResult => {\n return html`\n <sp-textfield placeholder=\"Enter your name\"></sp-textfield>\n <sp-textfield placeholder=\"Enter your name\" disabled></sp-textfield>\n <sp-textfield\n placeholder=\"Enter your name\"\n pattern=\"[\\\\w\\\\s]*\"\n required\n value=\"A valid input\"\n ></sp-textfield>\n <sp-textfield\n placeholder=\"Enter your name\"\n pattern=\"[\\\\w\\\\s]*\"\n required\n value=\"A valid input\"\n disabled\n ></sp-textfield>\n <sp-textfield\n placeholder=\"Enter your name\"\n pattern=\"[\\\\d]*\"\n value=\"Not a valid input\"\n ></sp-textfield>\n <sp-textfield\n placeholder=\"Enter your name\"\n pattern=\"^[\\\\d]$\"\n required\n value=\"Not a valid input\"\n disabled\n ></sp-textfield>\n `;\n};\n\nexport const quiet = (): TemplateResult => {\n return html`\n <sp-field-label for=\"name\">Enter your name</sp-field-label>\n <sp-textfield\n autofocus\n id=\"name\"\n placeholder=\"This Text Field doesn't make much noise\"\n quiet\n ></sp-textfield>\n `;\n};\n\nexport const notRequiredWithPattern = (): TemplateResult => {\n return html`\n <sp-textfield\n placeholder=\"Enter z, x, c, or v\"\n pattern=\"[zxcv]+\"\n ></sp-textfield>\n `;\n};\n\nexport const allowedKeys = (): TemplateResult => {\n return html`\n <sp-textfield\n placeholder=\"Enter your name\"\n allowed-keys=\"a-z\"\n ></sp-textfield>\n `;\n};\n\nexport const readonly = (): TemplateResult => html`\n <sp-textfield\n label=\"Enter your life story\"\n value=\"A readonly textfield\"\n readonly\n placeholder=\"Enter your life story\"\n ></sp-textfield>\n`;\n\nexport const types = (): TemplateResult => html`\n <sp-textfield label=\"Default\" placeholder=\"default (text)\"></sp-textfield>\n <sp-textfield label=\"Text\" type=\"text\" placeholder=\"text\"></sp-textfield>\n <sp-textfield label=\"URL\" type=\"url\" placeholder=\"url\"></sp-textfield>\n <sp-textfield label=\"Tel\" type=\"tel\" placeholder=\"tel\"></sp-textfield>\n <sp-textfield\n label=\"E-Mail\"\n type=\"email\"\n placeholder=\"email\"\n ></sp-textfield>\n <sp-textfield\n label=\"Password\"\n type=\"password\"\n placeholder=\"password\"\n ></sp-textfield>\n`;\n\nexport const empty = (): TemplateResult => html`\n <sp-field-label for=\"empty\">\n This textfield hasn't been used yet\n </sp-field-label>\n <sp-textfield id=\"empty\" placeholder=\"You can type here\" autofocus>\n <sp-help-text slot=\"help-text\">\n Even empty Textfield display correctly while waiting for content.\n </sp-help-text>\n </sp-textfield>\n`;\n\nexport const sized = (): TemplateResult => html`\n <sp-field-label for=\"sized\">\n This textfield hasn't been used yet\n </sp-field-label>\n <sp-textfield\n id=\"sized\"\n placeholder=\"You can type here\"\n autofocus\n style=\"width: 400px\"\n >\n <sp-help-text slot=\"help-text\">\n Even empty Textfield display correctly while waiting for content.\n </sp-help-text>\n </sp-textfield>\n`;\n"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,qDAEA,2DACA,+DACA,2DAEA,cAAe,CACX,UAAW,eACX,MAAO,WACX,EAEO,YAAM,SAAU,IACZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MA+BE,MAAQ,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAWE,uBAAyB,IAC3B;AAAA;AAAA;AAAA;AAAA;AAAA,MAQE,YAAc,IAChB;AAAA;AAAA;AAAA;AAAA;AAAA,MAQE,SAAW,IAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASjC,MAAQ,IAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiB9B,MAAQ,IAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW9B,MAAQ,IAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { html } from "lit";
|
|
3
|
-
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
|
4
|
-
measureFixtureCreation(html`
|
|
1
|
+
import"@spectrum-web-components/textfield/sp-textfield.js";import{html as e}from"lit";import{measureFixtureCreation as r}from"../../../../test/benchmark/helpers.js";r(e`
|
|
5
2
|
<sp-textfield placeholder="Enter your name"></sp-textfield>
|
|
6
3
|
`);
|
|
7
4
|
//# sourceMappingURL=test-basic.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["test-basic.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport '@spectrum-web-components/textfield/sp-textfield.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-textfield placeholder=\"Enter your name\"></sp-textfield>\n`);\n"],
|
|
5
|
-
"mappings": "AAYA
|
|
5
|
+
"mappings": "AAYA,2DACA,2BACA,+EAEA,EAAuB;AAAA;AAAA,CAEtB",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { regressVisuals } from "../../../test/visual/test.js";
|
|
3
|
-
regressVisuals("TextareaStories", stories);
|
|
1
|
+
import*as r from"../stories/textarea.stories.js";import{regressVisuals as s}from"../../../test/visual/test.js";s("TextareaStories",r);
|
|
4
2
|
//# sourceMappingURL=textarea.test-vrt.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["textarea.test-vrt.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/textarea.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('TextareaStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA
|
|
5
|
+
"mappings": "AAYA,iDACA,8DAEA,EAAe,kBAAmB,CAAO",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { regressVisuals } from "../../../test/visual/test.js";
|
|
3
|
-
regressVisuals("TextfieldStories", stories);
|
|
1
|
+
import*as r from"../stories/textfield.stories.js";import{regressVisuals as s}from"../../../test/visual/test.js";s("TextfieldStories",r);
|
|
4
2
|
//# sourceMappingURL=textfield.test-vrt.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["textfield.test-vrt.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/textfield.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('TextfieldStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA
|
|
5
|
+
"mappings": "AAYA,kDACA,8DAEA,EAAe,mBAAoB,CAAO",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|