@stenajs-webui/forms 20.7.4 → 20.8.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/dist/index.es.js +61 -62
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('._switch_1d6s8_1{--swui-switch-width: 50px;--swui-switch-height: var(--swui-field-box-size-medium);--swui-switch-animation-time: var(--swui-animation-time-medium);--swui-switch-selected-highlight-color: var(--lhds-color-blue-500);--swui-switch-knob-width: calc(var(--swui-switch-height) - 2px);--swui-switch-knob-bg-color-enabled: var(--swui-handle-bg-enabled-color);--swui-switch-knob-bg-color-disabled: var(--swui-handle-bg-disabled-color);--swui-switch-container-bg-color-enabled: var(--swui-field-bg-enabled);--swui-switch-container-bg-color-disabled: var(--swui-field-bg-disabled);--swui-switch-knob-border-color-enabled: var(--swui-separator-color);--swui-switch-container-border-color: var(--swui-field-border-color);--swui-switch-container-border-color-hover: var( --swui-field-border-color-hover );--swui-switch-container-border-color-disabled: var( --swui-field-border-color-disabled );--swui-switch-knob-shadow-color: var(--swui-field-shadow-color);display:flex;flex-direction:row;border:1px solid var(--swui-switch-container-border-color);box-sizing:border-box;background-color:var(--swui-switch-container-bg-color-enabled);height:var(--swui-switch-height);width:var(--swui-switch-width);border-radius:calc(var(--swui-switch-height) / 2);padding:0;margin:0;cursor:pointer;transition:background-color var(--swui-switch-animation-time)}._switch_1d6s8_1:focus{outline:0}._switch_1d6s8_1:focus-visible{outline:var(--swui-focus-outline);outline-offset:2px;border:1px solid var(--swui-switch-selected-highlight-color)}._switch_1d6s8_1:hover{border:1px solid var(--swui-switch-selected-highlight-color)}._switch_1d6s8_1:disabled{cursor:default;background-color:var(--swui-switch-container-bg-color-disabled);border:1px solid var(--swui-switch-container-border-color-disabled)}._switch_1d6s8_1:disabled ._knob_1d6s8_56{background-color:var(--swui-switch-knob-bg-color-disabled)}._switch_1d6s8_1 ._filler_1d6s8_61{flex:none;transition:flex var(--swui-switch-animation-time)}._switch_1d6s8_1 ._knob_1d6s8_56{width:var(--swui-switch-knob-width);height:var(--swui-switch-knob-width);border-radius:50%;background-color:var(--swui-switch-knob-bg-color-enabled);box-shadow:var(--swui-switch-knob-shadow-color) 0 0 4px 1px}._checked_1d6s8_75{border:1px solid var(--swui-switch-selected-highlight-color);background-color:var(--swui-switch-selected-highlight-color)}._checked_1d6s8_75 ._filler_1d6s8_61{flex:1}._checkbox_1ndou_1{--swui-checkbox-height: var(--swui-field-box-size-medium);--swui-checkbox-height-small: var(--swui-field-box-size-small);--swui-checkbox-border-radius: var(--swui-field-border-radius);--swui-checkbox-animation-time: var(--swui-animation-time-medium);--swui-checkbox-icon-color: var(--swui-field-indicator-active-color);--swui-checkbox-disabled-icon-color: var(--swui-text-disabled-color);--swui-checkbox-unchecked-icon-color: var( --swui-field-indicator-inactive-color );--swui-checkbox-unchecked-bg-color: var(--swui-white);--swui-checkbox-checked-bg-color: var(--lhds-color-blue-500);--swui-checkbox-disabled-bg-color: var(--swui-field-bg-disabled);--swui-checkbox-disabled-checked-bg-color: var(--swui-field-bg-disabled);--swui-checkbox-border-color: var(--swui-field-border-color);--swui-checkbox-border-hover-color: var(--swui-field-border-color-hover);--swui-checkbox-disabled-border-color: var(--swui-checkbox-disabled-bg-color);-webkit-appearance:none;-moz-appearance:none;border-radius:var(--swui-checkbox-border-radius);outline:none;display:inline-block;vertical-align:top;position:relative;margin:0;cursor:pointer;border:1px solid var(--current-border-color, var(--swui-checkbox-border-color));background:var(--current-bg-color, var(--swui-checkbox-unchecked-bg-color));transition:background var(--swui-checkbox-animation-time),border-color var(--swui-checkbox-animation-time);flex-shrink:0}._checkbox_1ndou_1._standard_1ndou_39{width:var(--swui-checkbox-height);height:var(--swui-checkbox-height)}._checkbox_1ndou_1._standard_1ndou_39:after{width:3px;height:6px;left:9px;top:6px}._checkbox_1ndou_1._small_1ndou_51{width:var(--swui-checkbox-height-small);height:var(--swui-checkbox-height-small)}._checkbox_1ndou_1._small_1ndou_51:after{width:3px;height:6px;left:5px;top:2px}._checkbox_1ndou_1:after{content:"";display:block;position:absolute;transition:transform var(--swui-checkbox-animation-time) var(--d-t-e, ease),opacity var(--swui-checkbox-animation-time),width var(--swui-checkbox-animation-time),top var(--swui-checkbox-animation-time);border:2px solid var( --current-checkbox-icon-color, var(--swui-checkbox-unchecked-icon-color) );border-top:0;border-left:0;transform:rotate(var(--current-check-rotation, 20deg));box-sizing:content-box}._checkbox_1ndou_1:checked{--current-check-rotation: 43deg;--current-bg-color: var(--swui-checkbox-checked-bg-color);--current-border-color: var(--swui-checkbox-checked-bg-color);--d-t-e: cubic-bezier(.2, .85, .32, 1.2)}._checkbox_1ndou_1:checked:after{--current-checkbox-icon-color: var(--swui-checkbox-icon-color)}._checkbox_1ndou_1:disabled:not(:checked){--current-bg-color: var(--swui-checkbox-disabled-bg-color);--current-border-color: var(--swui-checkbox-disabled-border-color)}._checkbox_1ndou_1:disabled:not(:checked):after{--current-checkbox-icon-color: --swui-checkbox-unchecked-icon-color}._checkbox_1ndou_1:disabled:checked{--current-bg-color: var(--swui-checkbox-disabled-checked-bg-color);--current-border-color: var(--swui-checkbox-disabled-border-color)}._checkbox_1ndou_1:disabled:checked:after{--current-checkbox-icon-color: var(--swui-checkbox-disabled-icon-color)}._checkbox_1ndou_1:indeterminate{--current-check-rotation: 43deg;--current-bg-color: var(--swui-checkbox-checked-bg-color);--current-border-color: var(--swui-checkbox-checked-bg-color);--d-t-e: cubic-bezier(.2, .85, .32, 1.2)}._checkbox_1ndou_1:indeterminate:after{--current-checkbox-icon-color: var(--swui-checkbox-icon-color);border-right:0;transform:rotate(0);width:6px}._checkbox_1ndou_1:indeterminate._standard_1ndou_39:after{top:4px;left:8px}._checkbox_1ndou_1:indeterminate._small_1ndou_51:after{top:0;left:4px}._checkbox_1ndou_1:indeterminate:disabled:after{--current-checkbox-icon-color: var(--swui-checkbox-disabled-icon-color)}._checkbox_1ndou_1:hover:not(:checked):not(:disabled){--current-border-color: var(--swui-checkbox-border-hover-color)}._checkbox_1ndou_1:focus-visible{outline:var(--swui-focus-outline)}._checkbox_1ndou_1+label{font-size:1.4rem;line-height:var(--swui-checkbox-height);display:inline-block;vertical-align:top;cursor:pointer;margin-left:4px}._radiobutton_foy83_1{--swui-radiobutton-size-standard: var(--swui-field-box-size-medium);--swui-radiobutton-size-small: var(--swui-field-box-size-small);--swui-radiobutton-animation-time: var(--swui-animation-time-medium);--swui-radiobutton-icon-color: var(--swui-field-indicator-active-color);--swui-radiobutton-disabled-icon-color: var(--swui-field-text-color-disabled);--swui-radiobutton-unchecked-icon-color: var( --swui-field-indicator-inactive-color );--swui-radiobutton-checked-bg-color: var(--lhds-color-blue-500);--swui-radiobutton-checked-disabled-bg-color: var(--swui-field-bg-disabled);--swui-radiobutton-unchecked-bg-color: var(--swui-white);--swui-radiobutton-unchecked-disabled-bg-color: var(--swui-field-bg-disabled);--swui-radiobutton-unchecked-border-color: var(--swui-field-border-color);--swui-radiobutton-unchecked-hover-border-color: var( --swui-field-border-color-hover );--swui-radiobutton-disabled-border-color: var( --swui-radiobutton-checked-disabled-bg-color );-webkit-appearance:none;-moz-appearance:none;outline:none;display:inline-block;vertical-align:top;position:relative;margin:0;flex:none;cursor:pointer;border:1px solid var(--current-border-color, var(--swui-radiobutton-unchecked-border-color));border-radius:50%;background:var( --current-bg-color, var(--swui-radiobutton-unchecked-bg-color) );transition:background var(--swui-radiobutton-animation-time),border-color var(--swui-radiobutton-animation-time)}._radiobutton_foy83_1._standard_foy83_45{height:var(--swui-radiobutton-size-standard);width:var(--swui-radiobutton-size-standard)}._radiobutton_foy83_1._standard_foy83_45:after{left:7px;top:7px}._radiobutton_foy83_1._small_foy83_55{height:var(--swui-radiobutton-size-small);width:var(--swui-radiobutton-size-small)}._radiobutton_foy83_1._small_foy83_55:after{left:3px;top:3px}._radiobutton_foy83_1:after{content:"";display:block;position:absolute;transition:transform var(--current-transform-time, var(--swui-radiobutton-animation-time)) var(--current-transform-type, ease),opacity var(--current-opacity-time, var(--swui-radiobutton-animation-time)) var(--current-transform-type, ease);transform:scale(var(--current-scale, 0));width:8px;height:8px;border-radius:50%;background:var( --current-icon-color, var(--swui-radiobutton-unchecked-icon-color) );opacity:var(--current-opacity, 0)}._radiobutton_foy83_1:checked{--current-bg-color: var(--swui-radiobutton-checked-bg-color);--current-border-color: var(--swui-radiobutton-checked-bg-color);--current-opacity-time: var(--swui-radiobutton-animation-time);--current-transform-time: .6s;--current-transform-type: cubic-bezier(.2, .85, .32, 1.2);--current-opacity: 1;--current-scale: 1}._radiobutton_foy83_1:checked:after{--current-icon-color: var(--swui-radiobutton-icon-color)}._radiobutton_foy83_1:disabled{--current-bg-color: var(--swui-radiobutton-unchecked-disabled-bg-color);--current-border-color: var(--swui-radiobutton-disabled-border-color)}._radiobutton_foy83_1:disabled:checked{--current-bg-color: var(--swui-radiobutton-checked-disabled-bg-color)}._radiobutton_foy83_1:disabled:checked:after{--current-icon-color: var(--swui-radiobutton-disabled-icon-color)}._radiobutton_foy83_1:hover:not(:checked):not(:disabled){--current-border-color: var( --swui-radiobutton-unchecked-hover-border-color )}._radiobutton_foy83_1:focus-visible{outline:var(--swui-focus-outline)}._radiobutton_foy83_1+label{font-size:1.4rem;line-height:var(--swui-radiobutton-size-standard);display:inline-block;vertical-align:top;cursor:pointer;margin-left:4px}._radioButtonBox_vpn6v_1{box-sizing:border-box;background-color:var(--lhds-color-ui-200);position:relative;border:1px solid var(--silver-ui);width:100%;border-radius:16px;padding:var(--swui-metrics-space);font-size:var(--swui-font-size-inputs);align-items:center;display:flex;cursor:pointer;outline:none}._radioButtonBox_vpn6v_1:hover{border-color:var(--hav)}._radioButtonBox_vpn6v_1._danger_vpn6v_19{background-color:var(--snackskal-light);border-color:var(--snackskal-light)}._radioButtonBox_vpn6v_1._danger_vpn6v_19:hover{border-color:var(--lhds-color-red-500)}@media (max-width: 768px){._radioButtonWrapper_vpn6v_30{width:100%}}._textInput_1jb3g_1{display:flex;height:var(--swui-field-height);width:100%;align-items:center;background:var(--swui-field-bg-enabled);border:1px solid var(--swui-field-border-color);border-radius:var(--swui-field-border-radius);outline:none}._textInput_1jb3g_1._textInput_1jb3g_1:focus-within:not(._disabled_1jb3g_11){outline:var(--swui-focus-outline);border-color:transparent}._textInput_1jb3g_1 ._input_1jb3g_16{letter-spacing:var(--swui-field-letter-spacing);line-height:var(--swui-field-text-line-height);width:100%;padding:2px var(--swui-metrics-indent);color:var(--swui-field-text-color);font-size:var(--swui-font-size-inputs);font-family:var(--swui-font-input);font-weight:var(--swui-font-weight-inputs);background:var(--swui-hidden);border:none;min-width:0;margin:0;outline:none}._textInput_1jb3g_1 ._input_1jb3g_16:disabled{color:var(--swui-field-text-color-disabled)}._textInput_1jb3g_1 ._input_1jb3g_16::placeholder{color:var(--swui-field-placeholder-color);font-weight:var(--swui-field-placeholder-font-weight)}._textInput_1jb3g_1 ._input_1jb3g_16:focus::placeholder{opacity:0}._textInput_1jb3g_1 ._input_1jb3g_16::-webkit-calendar-picker-indicator{display:none}._textInput_1jb3g_1 ._icon_1jb3g_49{transition:color var(--swui-animation-time-medium);color:var(--swui-field-icon-color);font-size:var(--swui-field-icon-size)}._textInput_1jb3g_1._standard_1jb3g_59:hover:not(:focus-within):not(._disabled_1jb3g_11),._textInput_1jb3g_1._success_1jb3g_60:hover:not(:focus-within):not(._disabled_1jb3g_11){border-color:var(--swui-field-border-color-hover)}._textInput_1jb3g_1._success_1jb3g_60 ._icon_1jb3g_49{color:var(--swui-state-success-color)}._textInput_1jb3g_1._loading_1jb3g_72{background:var(--swui-state-loading-light-color);border-color:var(--swui-state-loading-color)}._textInput_1jb3g_1._modified_1jb3g_77{background:var(--swui-state-modified-light-color);border-color:var(--swui-state-modified-light-color)}._textInput_1jb3g_1._modified_1jb3g_77 ._icon_1jb3g_49{color:var(--lhds-color-blue-300)}._textInput_1jb3g_1._error_1jb3g_86{background:var(--swui-state-error-light-color);border-color:var(--swui-state-error-light-color)}._textInput_1jb3g_1._error_1jb3g_86 ._icon_1jb3g_49{color:var(--swui-state-error-light-color)}._textInput_1jb3g_1._warning_1jb3g_95{background:var(--swui-state-alert-light-color);border-color:var(--swui-state-alert-light-color)}._textInput_1jb3g_1._warning_1jb3g_95 ._icon_1jb3g_49{color:var(--swui-state-alert-light-color)}._textInput_1jb3g_1._disabled_1jb3g_11{background:var(--swui-field-bg-disabled);border-color:var(--swui-field-bg-disabled)}._textInput_1jb3g_1._textInput_1jb3g_1._hideBorder_1jb3g_109{border:none;box-shadow:none;background:none;outline:none}._textInput_1jb3g_1 ._clickable_1jb3g_116:hover{cursor:pointer}._textInput_1jb3g_1 ._clickable_1jb3g_116:hover ._icon_1jb3g_49{color:var(--swui-primary-action-color)}._numericTextInputInput_1tnr6_1{-moz-appearance:textfield}._numericTextInputInput_1tnr6_1::-webkit-outer-spin-button,._numericTextInputInput_1tnr6_1::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}._labelledSelect_1evxo_1{border:1px solid var(--swui-field-border-color);border-radius:var(--swui-border-radius-large);position:relative;overflow:hidden;cursor:pointer}._labelledSelect_1evxo_1._labelledSelect_1evxo_1._onlyTopBorder_1evxo_8{border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-color:transparent}._labelledSelect_1evxo_1._onlyBottomBorder_1evxo_14{border-top-left-radius:0;border-top-right-radius:0}._labelledSelect_1evxo_1._error_1evxo_19{border-color:var(--snackskal);background-color:var(--snackskal)}._labelledSelect_1evxo_1._normal_1evxo_24{border-color:var(--swui-field-border-color);background-color:var(--moln)}._labelledSelect_1evxo_1._labelledSelect_1evxo_1:focus-within{border-color:var(--swui-field-border-color-hover);outline:var(--swui-focus-outline);outline-offset:0;z-index:10}._labelledSelect_1evxo_1._labelledSelect_1evxo_1:hover{border-color:var(--swui-field-border-color-hover)}._labelledSelect_1evxo_1 ._label_1evxo_1{display:flex;position:absolute;top:var(--swui-metrics-space);left:calc(var(--swui-metrics-space) * 2);cursor:pointer}._labelledSelect_1evxo_1 ._select_1evxo_48{color:var(--swui-text-primary-color);display:block;margin:0;width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:none;font-size:var(--swui-font-size-inputs-large);line-height:1.5;box-sizing:border-box;cursor:pointer;padding:calc(var(--swui-metrics-space) * 5) calc(var(--swui-metrics-space) * 8) calc(var(--swui-metrics-space) * 2) calc(var(--swui-metrics-space) * 2)}._labelledSelect_1evxo_1 ._select_1evxo_48._error_1evxo_19{background-color:var(--snackskal)}._labelledSelect_1evxo_1 ._select_1evxo_48._normal_1evxo_24{background-color:var(--moln)}._labelledSelect_1evxo_1 ._iconWrapper_1evxo_73{border-radius:var(--swui-max-border-radius);width:40px;height:40px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;bottom:0;right:calc(var(--swui-metrics-space) * 2);margin-top:auto;margin-bottom:auto;padding:0;background:var(--silver-lighter);pointer-events:none}._labelledTextInput_lnht8_1{position:relative;background:var(--moln);overflow:hidden;cursor:text;border:1px solid var(--silver-light);border-radius:var(--swui-border-radius)}._labelledTextInput_lnht8_1 input{outline:none;border:none;margin:0;color:var(--swui-text-primary-color);background-color:transparent;line-height:var(--swui-line-height);width:100%;box-sizing:border-box;cursor:text}._labelledTextInput_lnht8_1._labelledTextInput_lnht8_1._onlyTop_lnht8_21{border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-color:transparent}._labelledTextInput_lnht8_1._labelledTextInput_lnht8_1._onlyBottom_lnht8_27{border-top-left-radius:0;border-top-right-radius:0}._labelledTextInput_lnht8_1:focus-within{outline:var(--swui-focus-outline);outline-offset:-1px;border-color:transparent}._labelledTextInput_lnht8_1:hover:not(:focus-within){border-color:var(--hav)}._labelledTextInput_lnht8_1._disabled_lnht8_42{background-color:var(--silver-lighter)}._labelledTextInput_lnht8_1._disabled_lnht8_42 input{color:var(--silver)}._labelledTextInput_lnht8_1._medium_lnht8_50:focus-within{outline-width:2px}._labelledTextInput_lnht8_1._medium_lnht8_50 input{font-size:var(--swui-font-size-inputs);padding:calc(var(--swui-metrics-space) * 4) calc(var(--swui-metrics-space) * 2) calc(var(--swui-metrics-space) * 1)}._labelledTextInput_lnht8_1._large_lnht8_62{border-radius:var(--swui-border-radius-large)}._labelledTextInput_lnht8_1._large_lnht8_62:focus-within{outline-width:3px}._labelledTextInput_lnht8_1._large_lnht8_62 input{font-size:var(--swui-font-size-inputs-large);padding:calc(var(--swui-metrics-space) * 5) calc(var(--swui-metrics-space) * 2) calc(var(--swui-metrics-space) * 2)}._labelledTextInput_lnht8_1._error_lnht8_76{border-color:var(--swui-state-error-light-color)}._labelledTextInput_lnht8_1._error_lnht8_76:hover:not(:focus-within){border-color:var(--modern-red)}._labelledTextInput_lnht8_1._error_lnht8_76 input{background-color:var(--swui-state-error-light-color)}._labelledTextInput_lnht8_1 label{display:flex;position:absolute;top:var(--swui-metrics-space);left:calc(var(--swui-metrics-space) * 2);cursor:text}._textArea_6n6nc_1{--swui-textarea-text-color: var(--swui-field-text-color);--swui-textarea-text-color-disabled: var(--swui-field-text-color-disabled);--swui-textarea-letter-spacing: var(--swui-field-letter-spacing);--swui-textarea-line-height: var(--swui-field-text-line-height);--swui-textarea-indent: var(--swui-metrics-indent);--swui-textarea-font-size: var(--swui-font-size-inputs);--swui-textarea-font-family: var(--swui-font-input);--swui-textarea-font-weight: var(--swui-font-weight-inputs);--swui-textarea-placeholder-color: var(--swui-text-disabled-color);--swui-textarea-animation-time: var(--swui-animation-time-medium);--swui-textarea-icon-color: var(--swui-field-border-color-disabled);--swui-textarea-icon-size: var(--swui-field-icon-size);--swui-textarea-icon-color-success: var(--swui-state-success-color);--swui-textarea-bg-loading: var(--swui-state-loading-light-color);--swui-textarea-border-color-loading: var(--swui-state-loading-color);--swui-textarea-bg-modified: var(--swui-state-modified-light-color);--swui-textarea-border-color-modified: var(--swui-state-modified-color);--swui-textarea-bg-warning: var(--swui-state-alert-light-color);--swui-textarea-border-color-warning: var(--swui-state-alert-color);--swui-textarea-bg-error: var(--swui-state-error-light-color);--swui-textarea-border-color-error: var(--swui-state-error-color);--swui-textarea-bg-color: var(--swui-field-bg-enabled);--swui-textarea-bg-color-disabled: var(--swui-field-bg-disabled);--swui-textarea-border-radius: var(--swui-field-border-radius);--swui-textarea-border-color: var(--swui-field-border-color);--swui-textarea-border-color-hover: var(--swui-field-border-color-hover);--swui-textarea-border-color-disabled: var( --swui-field-border-color-disabled );max-width:100%;letter-spacing:var(--swui-textarea-letter-spacing);line-height:var(--swui-textarea-line-height);padding:2px var(--swui-textarea-indent);color:var(--swui-textarea-text-color);font-size:var(--swui-textarea-font-size);font-family:var(--swui-textarea-font-family);font-weight:var(--swui-textarea-font-weight);background:var(--current-bg, var(--swui-textarea-bg-color));border:1px solid var(--current-border-color, var(--swui-textarea-border-color));border-radius:var(--swui-textarea-border-radius);transition:border var(--swui-textarea-animation-time);--current-icon-color: var(--swui-textarea-icon-color)}._textArea_6n6nc_1:focus:not(:focus-visible){outline:none}._textArea_6n6nc_1:focus{--current-border-color: var(--swui-textarea-border-color-hover);--current-bg: var(--swui-textarea-bg-color)}._textArea_6n6nc_1:focus-visible{outline:var(--swui-focus-outline)}._textArea_6n6nc_1:disabled{color:var(--swui-textarea-text-color-disabled);--current-bg: var(--swui-textarea-bg-color-disabled);--current-border-color: var(--swui-textarea-border-color-disabled)}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
2
|
import { jsx as o, jsxs as m, Fragment as v } from "react/jsx-runtime";
|
|
3
|
-
import { Box as pt, Space as x, Text as N, Row as T, ScreenReaderOnlyText as
|
|
3
|
+
import { Box as pt, Space as x, Text as N, Row as T, ScreenReaderOnlyText as M, parseFloatElseUndefined as H, getDataProps as ft } from "@stenajs-webui/core";
|
|
4
4
|
import * as mt from "react";
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import
|
|
7
|
-
import { Icon as
|
|
5
|
+
import { forwardRef as W, useRef as P, useCallback as g, useEffect as z, useMemo as bt, useState as ht, useId as O } from "react";
|
|
6
|
+
import h from "classnames";
|
|
7
|
+
import { Icon as D, stenaCheck as E, stenaExclamationTriangle as G, InputSpinner as X, UpDownButtons as xt, TextInputButton as $, stenaEyeShow as yt, stenaEyeHide as It, stenaAngleDown as gt } from "@stenajs-webui/elements";
|
|
8
8
|
import { FontAwesomeIcon as wt } from "@fortawesome/react-fontawesome";
|
|
9
9
|
import { cssColor as q } from "@stenajs-webui/theme";
|
|
10
10
|
const Bt = "_knob_1d6s8_56", Tt = "_filler_1d6s8_61", kt = "_checked_1d6s8_75", S = {
|
|
@@ -44,11 +44,11 @@ const Bt = "_knob_1d6s8_56", Tt = "_filler_1d6s8_61", kt = "_checked_1d6s8_75",
|
|
|
44
44
|
/* @__PURE__ */ o(St, { disabled: e, ...c }),
|
|
45
45
|
/* @__PURE__ */ o(x, {}),
|
|
46
46
|
/* @__PURE__ */ o(N, { userSelect: "none", color: n, children: t })
|
|
47
|
-
] }) }) }), Nt = "_checkbox_1ndou_1", Rt = "_standard_1ndou_39", jt = "_small_1ndou_51",
|
|
47
|
+
] }) }) }), Nt = "_checkbox_1ndou_1", Rt = "_standard_1ndou_39", jt = "_small_1ndou_51", F = {
|
|
48
48
|
checkbox: Nt,
|
|
49
49
|
standard: Rt,
|
|
50
50
|
small: jt
|
|
51
|
-
}, $t =
|
|
51
|
+
}, $t = W(
|
|
52
52
|
({
|
|
53
53
|
indeterminate: t = !1,
|
|
54
54
|
onChange: e,
|
|
@@ -58,7 +58,7 @@ const Bt = "_knob_1d6s8_56", Tt = "_filler_1d6s8_61", kt = "_checked_1d6s8_75",
|
|
|
58
58
|
className: s,
|
|
59
59
|
...i
|
|
60
60
|
}, d) => {
|
|
61
|
-
const l =
|
|
61
|
+
const l = P(), f = (u) => {
|
|
62
62
|
l.current = u, l.current && (l.current.indeterminate = !!t), d && (typeof d == "function" ? d(u) : d.current = u);
|
|
63
63
|
}, _ = g(
|
|
64
64
|
(u) => {
|
|
@@ -66,13 +66,13 @@ const Bt = "_knob_1d6s8_56", Tt = "_filler_1d6s8_61", kt = "_checked_1d6s8_75",
|
|
|
66
66
|
},
|
|
67
67
|
[e, n]
|
|
68
68
|
);
|
|
69
|
-
return
|
|
69
|
+
return z(() => {
|
|
70
70
|
l.current && (l.current.indeterminate = !!t);
|
|
71
71
|
}, [t, l]), /* @__PURE__ */ o(
|
|
72
72
|
"input",
|
|
73
73
|
{
|
|
74
74
|
type: "checkbox",
|
|
75
|
-
className:
|
|
75
|
+
className: h(F.checkbox, F[c], s),
|
|
76
76
|
checked: r,
|
|
77
77
|
onChange: _,
|
|
78
78
|
ref: f,
|
|
@@ -92,11 +92,11 @@ const Bt = "_knob_1d6s8_56", Tt = "_filler_1d6s8_61", kt = "_checked_1d6s8_75",
|
|
|
92
92
|
/* @__PURE__ */ o(x, {}),
|
|
93
93
|
e && /* @__PURE__ */ o(N, { userSelect: "none", color: c, children: e }),
|
|
94
94
|
t
|
|
95
|
-
] }) }) }), At = "_radiobutton_foy83_1", Ht = "_standard_foy83_45", Wt = "_small_foy83_55",
|
|
95
|
+
] }) }) }), At = "_radiobutton_foy83_1", Ht = "_standard_foy83_45", Wt = "_small_foy83_55", L = {
|
|
96
96
|
radiobutton: At,
|
|
97
97
|
standard: Ht,
|
|
98
98
|
small: Wt
|
|
99
|
-
}, J =
|
|
99
|
+
}, J = W(
|
|
100
100
|
({
|
|
101
101
|
onChange: t,
|
|
102
102
|
onValueChange: e,
|
|
@@ -116,14 +116,14 @@ const Bt = "_knob_1d6s8_56", Tt = "_filler_1d6s8_61", kt = "_checked_1d6s8_75",
|
|
|
116
116
|
{
|
|
117
117
|
type: "radio",
|
|
118
118
|
name: r,
|
|
119
|
-
className:
|
|
119
|
+
className: h(L.radiobutton, L[n], c),
|
|
120
120
|
onChange: d,
|
|
121
121
|
ref: i,
|
|
122
122
|
...s
|
|
123
123
|
}
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
|
-
), Pt = "_radioButtonBox_vpn6v_1", Ut = "_danger_vpn6v_19", Ft = "_radioButtonWrapper_vpn6v_30",
|
|
126
|
+
), Pt = "_radioButtonBox_vpn6v_1", Ut = "_danger_vpn6v_19", Ft = "_radioButtonWrapper_vpn6v_30", K = {
|
|
127
127
|
radioButtonBox: Pt,
|
|
128
128
|
danger: Ut,
|
|
129
129
|
radioButtonWrapper: Ft
|
|
@@ -140,15 +140,14 @@ const Bt = "_knob_1d6s8_56", Tt = "_filler_1d6s8_61", kt = "_checked_1d6s8_75",
|
|
|
140
140
|
}) => /* @__PURE__ */ o(
|
|
141
141
|
"label",
|
|
142
142
|
{
|
|
143
|
-
className:
|
|
143
|
+
className: h(K.radioButtonBox, K[n], r),
|
|
144
144
|
style: i,
|
|
145
145
|
children: /* @__PURE__ */ m(T, { justifyContent: "space-between", flexGrow: 1, children: [
|
|
146
146
|
/* @__PURE__ */ m(T, { alignItems: "center", children: [
|
|
147
147
|
/* @__PURE__ */ o(J, { ...l, className: d }),
|
|
148
148
|
/* @__PURE__ */ o(x, {}),
|
|
149
|
-
e ? /* @__PURE__ */ o(
|
|
150
|
-
/* @__PURE__ */ o(N, { "aria-hidden": !!e, children: t })
|
|
151
|
-
c && /* @__PURE__ */ o(T, { alignItems: "center", width: "48px", justifyContent: "center", children: /* @__PURE__ */ o($, { icon: c, size: 24 }) })
|
|
149
|
+
e ? /* @__PURE__ */ o(M, { children: e }) : null,
|
|
150
|
+
/* @__PURE__ */ o(N, { "aria-hidden": !!e, children: t })
|
|
152
151
|
] }),
|
|
153
152
|
/* @__PURE__ */ m(
|
|
154
153
|
T,
|
|
@@ -157,8 +156,8 @@ const Bt = "_knob_1d6s8_56", Tt = "_filler_1d6s8_61", kt = "_checked_1d6s8_75",
|
|
|
157
156
|
width: c ? "48px" : void 0,
|
|
158
157
|
justifyContent: "center",
|
|
159
158
|
children: [
|
|
160
|
-
c && /* @__PURE__ */ o(
|
|
161
|
-
s
|
|
159
|
+
c && /* @__PURE__ */ o(D, { icon: c, size: 24 }),
|
|
160
|
+
!c && s
|
|
162
161
|
]
|
|
163
162
|
}
|
|
164
163
|
)
|
|
@@ -175,7 +174,7 @@ const Bt = "_knob_1d6s8_56", Tt = "_filler_1d6s8_61", kt = "_checked_1d6s8_75",
|
|
|
175
174
|
/* @__PURE__ */ o(x, {}),
|
|
176
175
|
/* @__PURE__ */ o(N, { color: r, userSelect: "none", children: t })
|
|
177
176
|
] }) }) }), Lt = (t, e, n, r, c, s, i, d) => {
|
|
178
|
-
const l =
|
|
177
|
+
const l = P(!1), f = (a) => {
|
|
179
178
|
l.current || s == null || s(a.target.value ?? ""), i == null || i(a);
|
|
180
179
|
}, _ = (a) => {
|
|
181
180
|
l.current = !1, d == null || d(a);
|
|
@@ -189,10 +188,10 @@ const Bt = "_knob_1d6s8_56", Tt = "_filler_1d6s8_61", kt = "_checked_1d6s8_75",
|
|
|
189
188
|
else if (p === "Escape")
|
|
190
189
|
l.current = !0, r == null || r(), a.preventDefault(), a.stopPropagation();
|
|
191
190
|
else if (c) {
|
|
192
|
-
const
|
|
191
|
+
const b = (w, y) => {
|
|
193
192
|
l.current = !0, t.current.blur(), c(w), y.preventDefault(), y.stopPropagation();
|
|
194
193
|
};
|
|
195
|
-
a.shiftKey && p === "Tab" ?
|
|
194
|
+
a.shiftKey && p === "Tab" ? b("left", a) : p === "Tab" ? b("right", a) : p === "ArrowUp" ? b("up", a) : p === "ArrowDown" ? b("down", a) : p === "ArrowRight" ? t.current.value.length === t.current.selectionStart && b("right", a) : p === "ArrowLeft" && t.current.selectionStart === 0 && b("left", a);
|
|
196
195
|
}
|
|
197
196
|
e && e(a);
|
|
198
197
|
},
|
|
@@ -206,7 +205,7 @@ function Kt(t) {
|
|
|
206
205
|
return t.tagName === "TEXTAREA" || t.tagName === "INPUT" && (t.type === "text" || t.type === "search" || t.type === "url" || t.type === "tel" || t.type === "password");
|
|
207
206
|
}
|
|
208
207
|
const Mt = (t, e, n) => {
|
|
209
|
-
|
|
208
|
+
z(() => {
|
|
210
209
|
t.current && Kt(t.current) && (n ? t.current.setSelectionRange(0, t.current.value.length) : e && t.current.setSelectionRange(
|
|
211
210
|
t.current.value.length,
|
|
212
211
|
t.current.value.length
|
|
@@ -227,7 +226,7 @@ const Mt = (t, e, n) => {
|
|
|
227
226
|
autoFocus: a
|
|
228
227
|
}) => {
|
|
229
228
|
Mt(t, !!i, !!s);
|
|
230
|
-
const { onKeyDownHandler: p, onFocusHandler:
|
|
229
|
+
const { onKeyDownHandler: p, onFocusHandler: b, onBlurHandler: w } = Lt(
|
|
231
230
|
t,
|
|
232
231
|
u,
|
|
233
232
|
e,
|
|
@@ -245,7 +244,7 @@ const Mt = (t, e, n) => {
|
|
|
245
244
|
return {
|
|
246
245
|
onBlur: w,
|
|
247
246
|
onChange: y,
|
|
248
|
-
onFocus:
|
|
247
|
+
onFocus: b,
|
|
249
248
|
onKeyDown: p,
|
|
250
249
|
autoFocus: s || a
|
|
251
250
|
};
|
|
@@ -286,7 +285,7 @@ const Mt = (t, e, n) => {
|
|
|
286
285
|
wt,
|
|
287
286
|
{
|
|
288
287
|
icon: e,
|
|
289
|
-
className:
|
|
288
|
+
className: h(I.icon, n)
|
|
290
289
|
}
|
|
291
290
|
),
|
|
292
291
|
s ? /* @__PURE__ */ o(x, {}) : null
|
|
@@ -305,7 +304,7 @@ const Mt = (t, e, n) => {
|
|
|
305
304
|
disableContentPaddingRight: u,
|
|
306
305
|
iconLeft: a,
|
|
307
306
|
iconRight: p,
|
|
308
|
-
moveCursorToEndOnMount:
|
|
307
|
+
moveCursorToEndOnMount: b,
|
|
309
308
|
selectAllOnMount: w,
|
|
310
309
|
autoFocus: y,
|
|
311
310
|
onValueChange: R,
|
|
@@ -321,13 +320,13 @@ const Mt = (t, e, n) => {
|
|
|
321
320
|
onFocus: st,
|
|
322
321
|
onBlur: lt,
|
|
323
322
|
...it
|
|
324
|
-
} = t, dt =
|
|
323
|
+
} = t, dt = P(null), U = n ?? dt, at = zt(U, {
|
|
325
324
|
onEnter: tt,
|
|
326
325
|
onEsc: et,
|
|
327
326
|
onChange: nt,
|
|
328
327
|
onValueChange: R,
|
|
329
328
|
selectAllOnMount: w,
|
|
330
|
-
moveCursorToEndOnMount:
|
|
329
|
+
moveCursorToEndOnMount: b,
|
|
331
330
|
onDone: V,
|
|
332
331
|
onMove: rt,
|
|
333
332
|
onFocus: st,
|
|
@@ -338,7 +337,7 @@ const Mt = (t, e, n) => {
|
|
|
338
337
|
return /* @__PURE__ */ m(
|
|
339
338
|
"div",
|
|
340
339
|
{
|
|
341
|
-
className:
|
|
340
|
+
className: h(
|
|
342
341
|
I.textInput,
|
|
343
342
|
I[e],
|
|
344
343
|
{
|
|
@@ -366,10 +365,10 @@ const Mt = (t, e, n) => {
|
|
|
366
365
|
/* @__PURE__ */ o(
|
|
367
366
|
"input",
|
|
368
367
|
{
|
|
369
|
-
className:
|
|
368
|
+
className: h(I.input, c),
|
|
370
369
|
type: "text",
|
|
371
370
|
disabled: r,
|
|
372
|
-
ref:
|
|
371
|
+
ref: U,
|
|
373
372
|
autoFocus: y,
|
|
374
373
|
...it,
|
|
375
374
|
...at
|
|
@@ -401,10 +400,10 @@ const Mt = (t, e, n) => {
|
|
|
401
400
|
}) => {
|
|
402
401
|
if (t)
|
|
403
402
|
if (!e)
|
|
404
|
-
t(String(
|
|
403
|
+
t(String(A(n, r, c)));
|
|
405
404
|
else {
|
|
406
|
-
const i = (
|
|
407
|
-
t(String(
|
|
405
|
+
const i = (H(e) || 0) + n;
|
|
406
|
+
t(String(A(i, r, c)));
|
|
408
407
|
}
|
|
409
408
|
}, ne = ({
|
|
410
409
|
onValueChange: t,
|
|
@@ -416,10 +415,10 @@ const Mt = (t, e, n) => {
|
|
|
416
415
|
if (e === "")
|
|
417
416
|
t("");
|
|
418
417
|
else {
|
|
419
|
-
const s =
|
|
420
|
-
t(String(
|
|
418
|
+
const s = H(e) || 0;
|
|
419
|
+
t(String(A(s, n, r)));
|
|
421
420
|
}
|
|
422
|
-
},
|
|
421
|
+
}, A = (t, e, n) => {
|
|
423
422
|
let r = t;
|
|
424
423
|
return e != null && (r = Math.max(e, r)), n != null && (r = Math.min(n, r)), r;
|
|
425
424
|
}, He = ({
|
|
@@ -470,7 +469,7 @@ const Mt = (t, e, n) => {
|
|
|
470
469
|
min: r,
|
|
471
470
|
max: n,
|
|
472
471
|
step: c,
|
|
473
|
-
className:
|
|
472
|
+
className: h(ee.numericTextInputInput, d),
|
|
474
473
|
disabled: i,
|
|
475
474
|
...f
|
|
476
475
|
}
|
|
@@ -482,12 +481,12 @@ const Mt = (t, e, n) => {
|
|
|
482
481
|
if (!c)
|
|
483
482
|
e(void 0);
|
|
484
483
|
else {
|
|
485
|
-
const s =
|
|
484
|
+
const s = H(c);
|
|
486
485
|
s !== void 0 && e(s);
|
|
487
486
|
}
|
|
488
487
|
},
|
|
489
488
|
[e]
|
|
490
|
-
), r =
|
|
489
|
+
), r = bt(() => t === void 0 ? "" : String(t), [t]);
|
|
491
490
|
return {
|
|
492
491
|
onValueChange: n,
|
|
493
492
|
value: r
|
|
@@ -497,12 +496,12 @@ const Mt = (t, e, n) => {
|
|
|
497
496
|
visibleIcon: e = It,
|
|
498
497
|
...n
|
|
499
498
|
}) => {
|
|
500
|
-
const [r, c] =
|
|
499
|
+
const [r, c] = ht(!0);
|
|
501
500
|
return /* @__PURE__ */ o(
|
|
502
501
|
Q,
|
|
503
502
|
{
|
|
504
503
|
buttonRight: /* @__PURE__ */ o(
|
|
505
|
-
|
|
504
|
+
$,
|
|
506
505
|
{
|
|
507
506
|
icon: r ? t : e,
|
|
508
507
|
onClick: () => c((s) => !s)
|
|
@@ -532,7 +531,7 @@ const Mt = (t, e, n) => {
|
|
|
532
531
|
disabled: r,
|
|
533
532
|
className: c
|
|
534
533
|
}) => /* @__PURE__ */ m("label", { htmlFor: t, className: c, children: [
|
|
535
|
-
e ? /* @__PURE__ */ o(
|
|
534
|
+
e ? /* @__PURE__ */ o(M, { children: e }) : null,
|
|
536
535
|
/* @__PURE__ */ o(
|
|
537
536
|
oe,
|
|
538
537
|
{
|
|
@@ -561,7 +560,7 @@ const Mt = (t, e, n) => {
|
|
|
561
560
|
children: d,
|
|
562
561
|
...l
|
|
563
562
|
}) => {
|
|
564
|
-
const f =
|
|
563
|
+
const f = O(), _ = n ?? f, u = g(
|
|
565
564
|
(a) => {
|
|
566
565
|
t == null || t(a), e == null || e(a.target.value);
|
|
567
566
|
},
|
|
@@ -570,7 +569,7 @@ const Mt = (t, e, n) => {
|
|
|
570
569
|
return /* @__PURE__ */ m(
|
|
571
570
|
"div",
|
|
572
571
|
{
|
|
573
|
-
className:
|
|
572
|
+
className: h(
|
|
574
573
|
B.labelledSelect,
|
|
575
574
|
B[i],
|
|
576
575
|
B[s]
|
|
@@ -590,13 +589,13 @@ const Mt = (t, e, n) => {
|
|
|
590
589
|
{
|
|
591
590
|
id: _,
|
|
592
591
|
onChange: u,
|
|
593
|
-
className:
|
|
592
|
+
className: h(B.select, B[i]),
|
|
594
593
|
...l,
|
|
595
594
|
children: d
|
|
596
595
|
}
|
|
597
596
|
),
|
|
598
|
-
/* @__PURE__ */ o("div", { className:
|
|
599
|
-
|
|
597
|
+
/* @__PURE__ */ o("div", { className: h(B.iconWrapper), children: /* @__PURE__ */ o(
|
|
598
|
+
D,
|
|
600
599
|
{
|
|
601
600
|
icon: gt,
|
|
602
601
|
size: 24,
|
|
@@ -606,12 +605,12 @@ const Mt = (t, e, n) => {
|
|
|
606
605
|
]
|
|
607
606
|
}
|
|
608
607
|
);
|
|
609
|
-
}, pe = "_labelledTextInput_lnht8_1", fe = "_onlyTop_lnht8_21", me = "_onlyBottom_lnht8_27",
|
|
608
|
+
}, pe = "_labelledTextInput_lnht8_1", fe = "_onlyTop_lnht8_21", me = "_onlyBottom_lnht8_27", be = "_disabled_lnht8_42", he = "_medium_lnht8_50", xe = "_large_lnht8_62", ye = "_error_lnht8_76", k = {
|
|
610
609
|
labelledTextInput: pe,
|
|
611
610
|
onlyTop: fe,
|
|
612
611
|
onlyBottom: me,
|
|
613
|
-
disabled:
|
|
614
|
-
medium:
|
|
612
|
+
disabled: be,
|
|
613
|
+
medium: he,
|
|
615
614
|
large: xe,
|
|
616
615
|
error: ye
|
|
617
616
|
}, Fe = mt.forwardRef(
|
|
@@ -629,7 +628,7 @@ const Mt = (t, e, n) => {
|
|
|
629
628
|
variant: _ = "normal",
|
|
630
629
|
...u
|
|
631
630
|
}, a) => {
|
|
632
|
-
const p =
|
|
631
|
+
const p = O(), b = n ?? p, w = g(
|
|
633
632
|
(y) => {
|
|
634
633
|
i == null || i(y), l == null || l(y.target.value);
|
|
635
634
|
},
|
|
@@ -638,7 +637,7 @@ const Mt = (t, e, n) => {
|
|
|
638
637
|
return /* @__PURE__ */ m(
|
|
639
638
|
"div",
|
|
640
639
|
{
|
|
641
|
-
className:
|
|
640
|
+
className: h(
|
|
642
641
|
k.labelledTextInput,
|
|
643
642
|
k[_],
|
|
644
643
|
k[f],
|
|
@@ -649,7 +648,7 @@ const Mt = (t, e, n) => {
|
|
|
649
648
|
/* @__PURE__ */ o(
|
|
650
649
|
Y,
|
|
651
650
|
{
|
|
652
|
-
htmlFor:
|
|
651
|
+
htmlFor: b,
|
|
653
652
|
screenReaderLabel: r,
|
|
654
653
|
label: e
|
|
655
654
|
}
|
|
@@ -658,7 +657,7 @@ const Mt = (t, e, n) => {
|
|
|
658
657
|
"input",
|
|
659
658
|
{
|
|
660
659
|
ref: a,
|
|
661
|
-
id:
|
|
660
|
+
id: b,
|
|
662
661
|
autoComplete: t,
|
|
663
662
|
type: "text",
|
|
664
663
|
value: s,
|
|
@@ -687,11 +686,11 @@ const Mt = (t, e, n) => {
|
|
|
687
686
|
onClickRight: a,
|
|
688
687
|
children: p
|
|
689
688
|
}) => {
|
|
690
|
-
const
|
|
689
|
+
const b = t === "success" ? E : t === "warning" || t === "error" ? G : f, w = t === "loading" ? /* @__PURE__ */ o(X, {}) : s;
|
|
691
690
|
return /* @__PURE__ */ m(
|
|
692
691
|
"div",
|
|
693
692
|
{
|
|
694
|
-
className:
|
|
693
|
+
className: h(
|
|
695
694
|
I.textInput,
|
|
696
695
|
I.inputContainer,
|
|
697
696
|
I[t],
|
|
@@ -710,7 +709,7 @@ const Mt = (t, e, n) => {
|
|
|
710
709
|
disableContentPaddingLeft: d,
|
|
711
710
|
disableContentPaddingRight: l,
|
|
712
711
|
spaceOnLeft: !0,
|
|
713
|
-
button: _ ? /* @__PURE__ */ o(
|
|
712
|
+
button: _ ? /* @__PURE__ */ o($, { onClick: u, icon: _ }) : void 0
|
|
714
713
|
}
|
|
715
714
|
),
|
|
716
715
|
/* @__PURE__ */ o(T, { alignItems: "center", children: p }),
|
|
@@ -722,7 +721,7 @@ const Mt = (t, e, n) => {
|
|
|
722
721
|
disableContentPaddingLeft: d,
|
|
723
722
|
disableContentPaddingRight: l,
|
|
724
723
|
spaceOnRight: !0,
|
|
725
|
-
button:
|
|
724
|
+
button: b ? /* @__PURE__ */ o($, { onClick: a, icon: b }) : void 0
|
|
726
725
|
}
|
|
727
726
|
)
|
|
728
727
|
]
|
|
@@ -730,7 +729,7 @@ const Mt = (t, e, n) => {
|
|
|
730
729
|
);
|
|
731
730
|
}, Ie = "_textArea_6n6nc_1", ge = {
|
|
732
731
|
textArea: Ie
|
|
733
|
-
}, Ke =
|
|
732
|
+
}, Ke = W(
|
|
734
733
|
({
|
|
735
734
|
className: t,
|
|
736
735
|
value: e,
|
|
@@ -754,7 +753,7 @@ const Mt = (t, e, n) => {
|
|
|
754
753
|
disabled: d,
|
|
755
754
|
rows: i,
|
|
756
755
|
readOnly: s,
|
|
757
|
-
className:
|
|
756
|
+
className: h(ge.textArea, t),
|
|
758
757
|
style: { resize: c },
|
|
759
758
|
onChange: _,
|
|
760
759
|
value: e,
|