@vielzeug/refine 2.1.3 → 2.2.3

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.
@@ -1,2 +1,2 @@
1
- var e=`@layer refine.base{:host{--_bg:var(--skeleton-bg,var(--color-contrast-200));--_highlight:var(--skeleton-highlight,var(--color-contrast-100));--_radius:var(--skeleton-radius,var(--rounded-lg));--_circle-size:var(--skeleton-size,var(--size-10));--_width:var(--skeleton-width,100%);--_height:var(--skeleton-height,var(--size-4));--_line-gap:var(--skeleton-line-gap,var(--size-2));--_last-line-width:var(--skeleton-last-line-width,60%);--_duration:var(--skeleton-duration,1.6s);--_stripe-size:var(--skeleton-stripe-size,8px);width:var(--_width);height:var(--_height);display:inline-block}.stack{gap:var(--_line-gap);width:100%;height:100%;display:grid}.bone{background:var(--_bg);border-radius:var(--_radius);width:100%;height:100%;position:relative;overflow:hidden}.bone:after{content:"";background:linear-gradient(90deg, var(--_bg) 0%, var(--_highlight) 50%, var(--_bg) 100%);animation:var(--_motion-animation,ore-skeleton-shimmer var(--_duration) linear infinite);position:absolute;inset:0;transform:translate(-100%)}:host([data-animated=false]) .bone:after{display:none}:host([data-paused]) .bone:after{animation-play-state:paused}@keyframes ore-skeleton-shimmer{to{transform:translate(100%)}}:host(:dir(rtl)) .bone:after{animation-direction:reverse}}@layer refine.variants{:host([variant=circle]){--_radius:var(--rounded-full);width:var(--skeleton-width,var(--_circle-size));height:var(--skeleton-height,var(--_circle-size));aspect-ratio:1}:host([variant=text]){--_height:var(--size-3);--_radius:var(--rounded-sm);height:auto}:host([variant=text]) .stack{height:auto}:host([variant=text]) .bone{height:var(--_height)}:host([variant=text]) .bone[data-last=true]{width:var(--_last-line-width)}}@layer refine.striped{:host([striped]) .stack{width:99%}:host([striped]) .bone{--_stripe-color:var(--skeleton-stripe-color,var(--color-contrast-400));border:var(--border) dashed var(--_stripe-color);background-color:#0000}:host([striped]) .bone:before{--_stripe-color:var(--skeleton-stripe-color,var(--color-contrast-300));content:"";background-color:var(--_stripe-color);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='white' stroke-width='1'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='white' stroke-width='1'/%3E%3C/svg%3E");-webkit-mask-size:var(--_stripe-size) var(--_stripe-size);-webkit-mask-size:var(--_stripe-size) var(--_stripe-size);mask-size:var(--_stripe-size) var(--_stripe-size);position:absolute;inset:0}:host([striped]) .bone:after{display:none}}@layer refine.utilities{:host([size=sm]){--_height:var(--size-3);--_circle-size:var(--size-8)}:host([size=md]){--_height:var(--size-4);--_circle-size:var(--size-10)}:host([size=lg]){--_height:var(--size-6);--_circle-size:var(--size-14)}}@media (forced-colors:active){.bone{background:buttonface;border:1px solid buttontext}.bone:after{display:none}}`;exports.default=e;
1
+ var e=`@layer refine.base{:host{--_bg:var(--skeleton-bg,var(--color-contrast-200));--_highlight:var(--skeleton-highlight,var(--color-contrast-100));--_radius:var(--skeleton-radius,var(--rounded-lg));--_circle-size:var(--skeleton-size,var(--size-10));--_width:var(--skeleton-width,100%);--_height:var(--skeleton-height,var(--size-4));--_line-gap:var(--skeleton-line-gap,var(--size-2));--_last-line-width:var(--skeleton-last-line-width,60%);--_duration:var(--skeleton-duration,1.6s);--_stripe-size:var(--skeleton-stripe-size,8px);width:var(--_width);height:var(--_height);display:inline-block}.stack{gap:var(--_line-gap);width:100%;height:100%;display:grid}.bone{background:var(--_bg);border-radius:var(--_radius);width:100%;height:100%;position:relative;overflow:hidden}.bone:after{content:"";background:linear-gradient(90deg, var(--_bg) 0%, var(--_highlight) 50%, var(--_bg) 100%);animation:var(--_motion-animation,ore-skeleton-shimmer var(--_duration) linear infinite);position:absolute;inset:0;transform:translate(-100%)}:host([data-animated=false]) .bone:after{display:none}:host([data-paused]) .bone:after{animation-play-state:paused}@keyframes ore-skeleton-shimmer{to{transform:translate(100%)}}:host(:dir(rtl)) .bone:after{animation-direction:reverse}}@layer refine.variants{:host([variant=circle]){--_radius:var(--rounded-full);width:var(--skeleton-width,var(--_circle-size));height:var(--skeleton-height,var(--_circle-size));aspect-ratio:1}:host([variant=text]){--_height:var(--size-3);--_radius:var(--rounded-sm);height:auto}:host([variant=text]) .stack{height:auto}:host([variant=text]) .bone{height:var(--_height)}:host([variant=text]) .bone[data-last=true]{width:var(--_last-line-width)}}@layer refine.striped{:host([striped]) .stack{width:calc(100% - 2px)}:host([striped]) .bone{--_stripe-color:var(--skeleton-stripe-color,var(--color-contrast-400));border:var(--border) dashed var(--_stripe-color);background-color:#0000}:host([striped]) .bone:before{--_stripe-color:var(--skeleton-stripe-color,var(--color-contrast-300));content:"";background-color:var(--_stripe-color);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='white' stroke-width='1'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='white' stroke-width='1'/%3E%3C/svg%3E");-webkit-mask-size:var(--_stripe-size) var(--_stripe-size);-webkit-mask-size:var(--_stripe-size) var(--_stripe-size);mask-size:var(--_stripe-size) var(--_stripe-size);position:absolute;inset:0}:host([striped]) .bone:after{display:none}}@layer refine.utilities{:host([size=sm]){--_height:var(--size-3);--_circle-size:var(--size-8)}:host([size=md]){--_height:var(--size-4);--_circle-size:var(--size-10)}:host([size=lg]){--_height:var(--size-6);--_circle-size:var(--size-14)}}@media (forced-colors:active){.bone{background:buttonface;border:1px solid buttontext}.bone:after{display:none}}`;exports.default=e;
2
2
  //# sourceMappingURL=skeleton.css.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton.css.cjs","names":[],"sources":["../../../src/feedback/skeleton/skeleton.css?inline"],"sourcesContent":["@layer refine.base {\n :host {\n --_bg: var(--skeleton-bg, var(--color-contrast-200));\n --_highlight: var(--skeleton-highlight, var(--color-contrast-100));\n --_radius: var(--skeleton-radius, var(--rounded-lg));\n --_circle-size: var(--skeleton-size, var(--size-10));\n --_width: var(--skeleton-width, 100%);\n --_height: var(--skeleton-height, var(--size-4));\n --_line-gap: var(--skeleton-line-gap, var(--size-2));\n --_last-line-width: var(--skeleton-last-line-width, 60%);\n --_duration: var(--skeleton-duration, 1.6s);\n --_stripe-size: var(--skeleton-stripe-size, 8px);\n\n display: inline-block;\n width: var(--_width);\n height: var(--_height);\n }\n\n .stack {\n display: grid;\n gap: var(--_line-gap);\n width: 100%;\n height: 100%;\n }\n\n .bone {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n background: var(--_bg);\n border-radius: var(--_radius);\n }\n\n .bone::after {\n position: absolute;\n inset: 0;\n content: '';\n background: linear-gradient(90deg, var(--_bg) 0%, var(--_highlight) 50%, var(--_bg) 100%);\n transform: translateX(-100%);\n animation: var(--_motion-animation, ore-skeleton-shimmer var(--_duration) linear infinite);\n }\n\n :host([data-animated='false']) .bone::after {\n display: none;\n }\n\n /* Pause shimmer when scrolled out of the viewport — no visible effect, saves GPU */\n :host([data-paused]) .bone::after {\n animation-play-state: paused;\n }\n\n @keyframes ore-skeleton-shimmer {\n to {\n transform: translateX(100%);\n }\n }\n\n /* In RTL the shimmer should sweep right-to-left */\n :host(:dir(rtl)) .bone::after {\n animation-direction: reverse;\n }\n}\n\n@layer refine.variants {\n /* Circle variant — avatars, icons */\n :host([variant='circle']) {\n --_radius: var(--rounded-full);\n\n width: var(--skeleton-width, var(--_circle-size));\n height: var(--skeleton-height, var(--_circle-size));\n aspect-ratio: 1 / 1;\n }\n\n /* Text variant — thinner, for inline text lines */\n :host([variant='text']) {\n --_height: var(--size-3);\n --_radius: var(--rounded-sm);\n\n height: auto;\n }\n\n :host([variant='text']) .stack {\n height: auto;\n }\n\n :host([variant='text']) .bone {\n height: var(--_height);\n }\n\n :host([variant='text']) .bone[data-last='true'] {\n width: var(--_last-line-width);\n }\n}\n\n@layer refine.striped {\n :host([striped]) .stack {\n width: 99%;\n }\n\n :host([striped]) .bone {\n --_stripe-color: var(--skeleton-stripe-color, var(--color-contrast-400));\n\n background-color: transparent;\n border: var(--border) dashed var(--_stripe-color);\n }\n\n :host([striped]) .bone::before {\n --_stripe-color: var(--skeleton-stripe-color, var(--color-contrast-300));\n\n position: absolute;\n inset: 0;\n content: '';\n background-color: var(--_stripe-color);\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='white' stroke-width='1'/%3E%3C/svg%3E\");\n mask-size: var(--_stripe-size) var(--_stripe-size);\n }\n\n :host([striped]) .bone::after {\n display: none;\n }\n}\n\n@layer refine.utilities {\n :host([size='sm']) {\n --_height: var(--size-3);\n --_circle-size: var(--size-8);\n }\n\n :host([size='md']) {\n --_height: var(--size-4);\n --_circle-size: var(--size-10);\n }\n\n :host([size='lg']) {\n --_height: var(--size-6);\n --_circle-size: var(--size-14);\n }\n}\n\n@media (forced-colors: active) {\n .bone {\n background: ButtonFace;\n border: 1px solid ButtonText;\n }\n\n .bone::after {\n display: none;\n }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"skeleton.css.cjs","names":[],"sources":["../../../src/feedback/skeleton/skeleton.css?inline"],"sourcesContent":["@layer refine.base {\n :host {\n --_bg: var(--skeleton-bg, var(--color-contrast-200));\n --_highlight: var(--skeleton-highlight, var(--color-contrast-100));\n --_radius: var(--skeleton-radius, var(--rounded-lg));\n --_circle-size: var(--skeleton-size, var(--size-10));\n --_width: var(--skeleton-width, 100%);\n --_height: var(--skeleton-height, var(--size-4));\n --_line-gap: var(--skeleton-line-gap, var(--size-2));\n --_last-line-width: var(--skeleton-last-line-width, 60%);\n --_duration: var(--skeleton-duration, 1.6s);\n --_stripe-size: var(--skeleton-stripe-size, 8px);\n\n display: inline-block;\n width: var(--_width);\n height: var(--_height);\n }\n\n .stack {\n display: grid;\n gap: var(--_line-gap);\n width: 100%;\n height: 100%;\n }\n\n .bone {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n background: var(--_bg);\n border-radius: var(--_radius);\n }\n\n .bone::after {\n position: absolute;\n inset: 0;\n content: '';\n background: linear-gradient(90deg, var(--_bg) 0%, var(--_highlight) 50%, var(--_bg) 100%);\n transform: translateX(-100%);\n animation: var(--_motion-animation, ore-skeleton-shimmer var(--_duration) linear infinite);\n }\n\n :host([data-animated='false']) .bone::after {\n display: none;\n }\n\n /* Pause shimmer when scrolled out of the viewport — no visible effect, saves GPU */\n :host([data-paused]) .bone::after {\n animation-play-state: paused;\n }\n\n @keyframes ore-skeleton-shimmer {\n to {\n transform: translateX(100%);\n }\n }\n\n /* In RTL the shimmer should sweep right-to-left */\n :host(:dir(rtl)) .bone::after {\n animation-direction: reverse;\n }\n}\n\n@layer refine.variants {\n /* Circle variant — avatars, icons */\n :host([variant='circle']) {\n --_radius: var(--rounded-full);\n\n width: var(--skeleton-width, var(--_circle-size));\n height: var(--skeleton-height, var(--_circle-size));\n aspect-ratio: 1 / 1;\n }\n\n /* Text variant — thinner, for inline text lines */\n :host([variant='text']) {\n --_height: var(--size-3);\n --_radius: var(--rounded-sm);\n\n height: auto;\n }\n\n :host([variant='text']) .stack {\n height: auto;\n }\n\n :host([variant='text']) .bone {\n height: var(--_height);\n }\n\n :host([variant='text']) .bone[data-last='true'] {\n width: var(--_last-line-width);\n }\n}\n\n@layer refine.striped {\n :host([striped]) .stack {\n width: calc(100% - 2px);\n }\n\n :host([striped]) .bone {\n --_stripe-color: var(--skeleton-stripe-color, var(--color-contrast-400));\n\n background-color: transparent;\n border: var(--border) dashed var(--_stripe-color);\n }\n\n :host([striped]) .bone::before {\n --_stripe-color: var(--skeleton-stripe-color, var(--color-contrast-300));\n\n position: absolute;\n inset: 0;\n content: '';\n background-color: var(--_stripe-color);\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='white' stroke-width='1'/%3E%3C/svg%3E\");\n mask-size: var(--_stripe-size) var(--_stripe-size);\n }\n\n :host([striped]) .bone::after {\n display: none;\n }\n}\n\n@layer refine.utilities {\n :host([size='sm']) {\n --_height: var(--size-3);\n --_circle-size: var(--size-8);\n }\n\n :host([size='md']) {\n --_height: var(--size-4);\n --_circle-size: var(--size-10);\n }\n\n :host([size='lg']) {\n --_height: var(--size-6);\n --_circle-size: var(--size-14);\n }\n}\n\n@media (forced-colors: active) {\n .bone {\n background: ButtonFace;\n border: 1px solid ButtonText;\n }\n\n .bone::after {\n display: none;\n }\n}\n"],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  //#region src/feedback/skeleton/skeleton.css?inline
2
- var e = "@layer refine.base{:host{--_bg:var(--skeleton-bg,var(--color-contrast-200));--_highlight:var(--skeleton-highlight,var(--color-contrast-100));--_radius:var(--skeleton-radius,var(--rounded-lg));--_circle-size:var(--skeleton-size,var(--size-10));--_width:var(--skeleton-width,100%);--_height:var(--skeleton-height,var(--size-4));--_line-gap:var(--skeleton-line-gap,var(--size-2));--_last-line-width:var(--skeleton-last-line-width,60%);--_duration:var(--skeleton-duration,1.6s);--_stripe-size:var(--skeleton-stripe-size,8px);width:var(--_width);height:var(--_height);display:inline-block}.stack{gap:var(--_line-gap);width:100%;height:100%;display:grid}.bone{background:var(--_bg);border-radius:var(--_radius);width:100%;height:100%;position:relative;overflow:hidden}.bone:after{content:\"\";background:linear-gradient(90deg, var(--_bg) 0%, var(--_highlight) 50%, var(--_bg) 100%);animation:var(--_motion-animation,ore-skeleton-shimmer var(--_duration) linear infinite);position:absolute;inset:0;transform:translate(-100%)}:host([data-animated=false]) .bone:after{display:none}:host([data-paused]) .bone:after{animation-play-state:paused}@keyframes ore-skeleton-shimmer{to{transform:translate(100%)}}:host(:dir(rtl)) .bone:after{animation-direction:reverse}}@layer refine.variants{:host([variant=circle]){--_radius:var(--rounded-full);width:var(--skeleton-width,var(--_circle-size));height:var(--skeleton-height,var(--_circle-size));aspect-ratio:1}:host([variant=text]){--_height:var(--size-3);--_radius:var(--rounded-sm);height:auto}:host([variant=text]) .stack{height:auto}:host([variant=text]) .bone{height:var(--_height)}:host([variant=text]) .bone[data-last=true]{width:var(--_last-line-width)}}@layer refine.striped{:host([striped]) .stack{width:99%}:host([striped]) .bone{--_stripe-color:var(--skeleton-stripe-color,var(--color-contrast-400));border:var(--border) dashed var(--_stripe-color);background-color:#0000}:host([striped]) .bone:before{--_stripe-color:var(--skeleton-stripe-color,var(--color-contrast-300));content:\"\";background-color:var(--_stripe-color);-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='white' stroke-width='1'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='white' stroke-width='1'/%3E%3C/svg%3E\");-webkit-mask-size:var(--_stripe-size) var(--_stripe-size);-webkit-mask-size:var(--_stripe-size) var(--_stripe-size);mask-size:var(--_stripe-size) var(--_stripe-size);position:absolute;inset:0}:host([striped]) .bone:after{display:none}}@layer refine.utilities{:host([size=sm]){--_height:var(--size-3);--_circle-size:var(--size-8)}:host([size=md]){--_height:var(--size-4);--_circle-size:var(--size-10)}:host([size=lg]){--_height:var(--size-6);--_circle-size:var(--size-14)}}@media (forced-colors:active){.bone{background:buttonface;border:1px solid buttontext}.bone:after{display:none}}";
2
+ var e = "@layer refine.base{:host{--_bg:var(--skeleton-bg,var(--color-contrast-200));--_highlight:var(--skeleton-highlight,var(--color-contrast-100));--_radius:var(--skeleton-radius,var(--rounded-lg));--_circle-size:var(--skeleton-size,var(--size-10));--_width:var(--skeleton-width,100%);--_height:var(--skeleton-height,var(--size-4));--_line-gap:var(--skeleton-line-gap,var(--size-2));--_last-line-width:var(--skeleton-last-line-width,60%);--_duration:var(--skeleton-duration,1.6s);--_stripe-size:var(--skeleton-stripe-size,8px);width:var(--_width);height:var(--_height);display:inline-block}.stack{gap:var(--_line-gap);width:100%;height:100%;display:grid}.bone{background:var(--_bg);border-radius:var(--_radius);width:100%;height:100%;position:relative;overflow:hidden}.bone:after{content:\"\";background:linear-gradient(90deg, var(--_bg) 0%, var(--_highlight) 50%, var(--_bg) 100%);animation:var(--_motion-animation,ore-skeleton-shimmer var(--_duration) linear infinite);position:absolute;inset:0;transform:translate(-100%)}:host([data-animated=false]) .bone:after{display:none}:host([data-paused]) .bone:after{animation-play-state:paused}@keyframes ore-skeleton-shimmer{to{transform:translate(100%)}}:host(:dir(rtl)) .bone:after{animation-direction:reverse}}@layer refine.variants{:host([variant=circle]){--_radius:var(--rounded-full);width:var(--skeleton-width,var(--_circle-size));height:var(--skeleton-height,var(--_circle-size));aspect-ratio:1}:host([variant=text]){--_height:var(--size-3);--_radius:var(--rounded-sm);height:auto}:host([variant=text]) .stack{height:auto}:host([variant=text]) .bone{height:var(--_height)}:host([variant=text]) .bone[data-last=true]{width:var(--_last-line-width)}}@layer refine.striped{:host([striped]) .stack{width:calc(100% - 2px)}:host([striped]) .bone{--_stripe-color:var(--skeleton-stripe-color,var(--color-contrast-400));border:var(--border) dashed var(--_stripe-color);background-color:#0000}:host([striped]) .bone:before{--_stripe-color:var(--skeleton-stripe-color,var(--color-contrast-300));content:\"\";background-color:var(--_stripe-color);-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='white' stroke-width='1'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='white' stroke-width='1'/%3E%3C/svg%3E\");-webkit-mask-size:var(--_stripe-size) var(--_stripe-size);-webkit-mask-size:var(--_stripe-size) var(--_stripe-size);mask-size:var(--_stripe-size) var(--_stripe-size);position:absolute;inset:0}:host([striped]) .bone:after{display:none}}@layer refine.utilities{:host([size=sm]){--_height:var(--size-3);--_circle-size:var(--size-8)}:host([size=md]){--_height:var(--size-4);--_circle-size:var(--size-10)}:host([size=lg]){--_height:var(--size-6);--_circle-size:var(--size-14)}}@media (forced-colors:active){.bone{background:buttonface;border:1px solid buttontext}.bone:after{display:none}}";
3
3
  //#endregion
4
4
  export { e as default };
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton.css.js","names":[],"sources":["../../../src/feedback/skeleton/skeleton.css?inline"],"sourcesContent":["@layer refine.base {\n :host {\n --_bg: var(--skeleton-bg, var(--color-contrast-200));\n --_highlight: var(--skeleton-highlight, var(--color-contrast-100));\n --_radius: var(--skeleton-radius, var(--rounded-lg));\n --_circle-size: var(--skeleton-size, var(--size-10));\n --_width: var(--skeleton-width, 100%);\n --_height: var(--skeleton-height, var(--size-4));\n --_line-gap: var(--skeleton-line-gap, var(--size-2));\n --_last-line-width: var(--skeleton-last-line-width, 60%);\n --_duration: var(--skeleton-duration, 1.6s);\n --_stripe-size: var(--skeleton-stripe-size, 8px);\n\n display: inline-block;\n width: var(--_width);\n height: var(--_height);\n }\n\n .stack {\n display: grid;\n gap: var(--_line-gap);\n width: 100%;\n height: 100%;\n }\n\n .bone {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n background: var(--_bg);\n border-radius: var(--_radius);\n }\n\n .bone::after {\n position: absolute;\n inset: 0;\n content: '';\n background: linear-gradient(90deg, var(--_bg) 0%, var(--_highlight) 50%, var(--_bg) 100%);\n transform: translateX(-100%);\n animation: var(--_motion-animation, ore-skeleton-shimmer var(--_duration) linear infinite);\n }\n\n :host([data-animated='false']) .bone::after {\n display: none;\n }\n\n /* Pause shimmer when scrolled out of the viewport — no visible effect, saves GPU */\n :host([data-paused]) .bone::after {\n animation-play-state: paused;\n }\n\n @keyframes ore-skeleton-shimmer {\n to {\n transform: translateX(100%);\n }\n }\n\n /* In RTL the shimmer should sweep right-to-left */\n :host(:dir(rtl)) .bone::after {\n animation-direction: reverse;\n }\n}\n\n@layer refine.variants {\n /* Circle variant — avatars, icons */\n :host([variant='circle']) {\n --_radius: var(--rounded-full);\n\n width: var(--skeleton-width, var(--_circle-size));\n height: var(--skeleton-height, var(--_circle-size));\n aspect-ratio: 1 / 1;\n }\n\n /* Text variant — thinner, for inline text lines */\n :host([variant='text']) {\n --_height: var(--size-3);\n --_radius: var(--rounded-sm);\n\n height: auto;\n }\n\n :host([variant='text']) .stack {\n height: auto;\n }\n\n :host([variant='text']) .bone {\n height: var(--_height);\n }\n\n :host([variant='text']) .bone[data-last='true'] {\n width: var(--_last-line-width);\n }\n}\n\n@layer refine.striped {\n :host([striped]) .stack {\n width: 99%;\n }\n\n :host([striped]) .bone {\n --_stripe-color: var(--skeleton-stripe-color, var(--color-contrast-400));\n\n background-color: transparent;\n border: var(--border) dashed var(--_stripe-color);\n }\n\n :host([striped]) .bone::before {\n --_stripe-color: var(--skeleton-stripe-color, var(--color-contrast-300));\n\n position: absolute;\n inset: 0;\n content: '';\n background-color: var(--_stripe-color);\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='white' stroke-width='1'/%3E%3C/svg%3E\");\n mask-size: var(--_stripe-size) var(--_stripe-size);\n }\n\n :host([striped]) .bone::after {\n display: none;\n }\n}\n\n@layer refine.utilities {\n :host([size='sm']) {\n --_height: var(--size-3);\n --_circle-size: var(--size-8);\n }\n\n :host([size='md']) {\n --_height: var(--size-4);\n --_circle-size: var(--size-10);\n }\n\n :host([size='lg']) {\n --_height: var(--size-6);\n --_circle-size: var(--size-14);\n }\n}\n\n@media (forced-colors: active) {\n .bone {\n background: ButtonFace;\n border: 1px solid ButtonText;\n }\n\n .bone::after {\n display: none;\n }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"skeleton.css.js","names":[],"sources":["../../../src/feedback/skeleton/skeleton.css?inline"],"sourcesContent":["@layer refine.base {\n :host {\n --_bg: var(--skeleton-bg, var(--color-contrast-200));\n --_highlight: var(--skeleton-highlight, var(--color-contrast-100));\n --_radius: var(--skeleton-radius, var(--rounded-lg));\n --_circle-size: var(--skeleton-size, var(--size-10));\n --_width: var(--skeleton-width, 100%);\n --_height: var(--skeleton-height, var(--size-4));\n --_line-gap: var(--skeleton-line-gap, var(--size-2));\n --_last-line-width: var(--skeleton-last-line-width, 60%);\n --_duration: var(--skeleton-duration, 1.6s);\n --_stripe-size: var(--skeleton-stripe-size, 8px);\n\n display: inline-block;\n width: var(--_width);\n height: var(--_height);\n }\n\n .stack {\n display: grid;\n gap: var(--_line-gap);\n width: 100%;\n height: 100%;\n }\n\n .bone {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n background: var(--_bg);\n border-radius: var(--_radius);\n }\n\n .bone::after {\n position: absolute;\n inset: 0;\n content: '';\n background: linear-gradient(90deg, var(--_bg) 0%, var(--_highlight) 50%, var(--_bg) 100%);\n transform: translateX(-100%);\n animation: var(--_motion-animation, ore-skeleton-shimmer var(--_duration) linear infinite);\n }\n\n :host([data-animated='false']) .bone::after {\n display: none;\n }\n\n /* Pause shimmer when scrolled out of the viewport — no visible effect, saves GPU */\n :host([data-paused]) .bone::after {\n animation-play-state: paused;\n }\n\n @keyframes ore-skeleton-shimmer {\n to {\n transform: translateX(100%);\n }\n }\n\n /* In RTL the shimmer should sweep right-to-left */\n :host(:dir(rtl)) .bone::after {\n animation-direction: reverse;\n }\n}\n\n@layer refine.variants {\n /* Circle variant — avatars, icons */\n :host([variant='circle']) {\n --_radius: var(--rounded-full);\n\n width: var(--skeleton-width, var(--_circle-size));\n height: var(--skeleton-height, var(--_circle-size));\n aspect-ratio: 1 / 1;\n }\n\n /* Text variant — thinner, for inline text lines */\n :host([variant='text']) {\n --_height: var(--size-3);\n --_radius: var(--rounded-sm);\n\n height: auto;\n }\n\n :host([variant='text']) .stack {\n height: auto;\n }\n\n :host([variant='text']) .bone {\n height: var(--_height);\n }\n\n :host([variant='text']) .bone[data-last='true'] {\n width: var(--_last-line-width);\n }\n}\n\n@layer refine.striped {\n :host([striped]) .stack {\n width: calc(100% - 2px);\n }\n\n :host([striped]) .bone {\n --_stripe-color: var(--skeleton-stripe-color, var(--color-contrast-400));\n\n background-color: transparent;\n border: var(--border) dashed var(--_stripe-color);\n }\n\n :host([striped]) .bone::before {\n --_stripe-color: var(--skeleton-stripe-color, var(--color-contrast-300));\n\n position: absolute;\n inset: 0;\n content: '';\n background-color: var(--_stripe-color);\n mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cline x1='0' y1='8' x2='8' y2='0' stroke='white' stroke-width='1'/%3E%3C/svg%3E\");\n mask-size: var(--_stripe-size) var(--_stripe-size);\n }\n\n :host([striped]) .bone::after {\n display: none;\n }\n}\n\n@layer refine.utilities {\n :host([size='sm']) {\n --_height: var(--size-3);\n --_circle-size: var(--size-8);\n }\n\n :host([size='md']) {\n --_height: var(--size-4);\n --_circle-size: var(--size-10);\n }\n\n :host([size='lg']) {\n --_height: var(--size-6);\n --_circle-size: var(--size-14);\n }\n}\n\n@media (forced-colors: active) {\n .bone {\n background: ButtonFace;\n border: 1px solid ButtonText;\n }\n\n .bone::after {\n display: none;\n }\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"input.cjs","names":[],"sources":["../src/inputs/input/input.ts"],"sourcesContent":["import { bind, define, getHost, html, live, onCleanup, onElement, prop, ref, useField, useSlots } from '@vielzeug/ore';\nimport { computed, signal } from '@vielzeug/ripple';\nimport { bindRefCallback, createTextField, lifecycleSignal } from '../../core';\nimport type { TextFieldProps } from '../../shared';\nimport { disablableBundle, FIELD_SIZE_PRESET, roundableBundle, sizableBundle, themableBundle } from '../../shared';\nimport type { InputType, VisualVariant } from '../../types';\nimport '../../content/icon/icon';\nimport {\n coarsePointerMixin,\n colorThemeMixin,\n disabledLoadingMixin,\n fieldVariantMixin,\n forcedColorsFocusMixin,\n reducedMotionMixin,\n roundedVariantMixin,\n sizeVariantMixin,\n} from '../../styles';\nimport { errorAttr } from '../shared/field-binding';\nimport { defineFieldValue, dispatchNativeFieldEvent, setFieldValue } from '../shared/native-field-event';\nimport { renderStatusIcon } from '../shared/templates';\nimport componentStyles from './input.css?inline';\n\n/** Input component properties */\n\nexport type OreInputEvents = {\n change: Event;\n input: InputEvent;\n};\n\nexport type OreInputProps = TextFieldProps<Exclude<VisualVariant, 'frost'>> & {\n /** Autocomplete hint */\n autocomplete?: string;\n /** Show a clear (×) button when the field has a value */\n clearable?: boolean;\n /** Virtual keyboard hint for mobile devices */\n inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n /**\n * Shows an inline spinner inside the field and forces the inner `<input>` into\n * `disabled` for the duration — use while an async validation/submission request\n * is in flight (e.g. checking username availability) to prevent double-submits.\n */\n loading?: boolean;\n /** Maximum character length — shows a counter below the input */\n maxlength?: number;\n /** Minimum character length */\n minlength?: number;\n /** HTML pattern attribute for client-side validation */\n pattern?: string;\n /**\n * JS-only callback fired with the inner `<input>` element when it mounts,\n * and with `null` when it unmounts. Intended for composed components that\n * need imperative access to the raw input element.\n * Set as a JS property: `bitInput.ref = (el) => { ... }`.\n */\n ref?: ((el: HTMLInputElement | null) => void) | null;\n /** HTML input type */\n type?: InputType;\n};\n\nconst VALID_INPUT_TYPES = [\n 'text',\n 'email',\n 'password',\n 'search',\n 'url',\n 'tel',\n 'number',\n 'date',\n 'time',\n 'datetime-local',\n 'month',\n 'week',\n] as const;\n\n/**\n * A customizable text input component with multiple variants, label placements, and form features.\n *\n * @element ore-input\n *\n * @attr {string} label - Label text\n * @attr {string} label-placement - Label placement: 'inset' | 'outside'\n * @attr {string} type - HTML input type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search'\n * @attr {string} value - Current input value\n * @attr {string} placeholder - Placeholder text\n * @attr {string} name - Form field name\n * @attr {string} helper - Helper text displayed below the input (fallback when the `helper` slot is empty)\n * @attr {string} error - Error message — marks the field as invalid (fallback when the `error` slot is empty)\n * @attr {boolean} disabled - Disable input interaction\n * @attr {boolean} readonly - Make the input read-only\n * @attr {boolean} required - Mark the field as required\n * @attr {boolean} loading - Show an inline spinner and force the field disabled\n * @attr {boolean} success - Show an inline success check icon (suppressed while `error` is set)\n * @attr {string} color - Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'\n * @attr {string} variant - Visual variant: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text'\n * @attr {string} size - Input size: 'sm' | 'md' | 'lg'\n * @attr {string} rounded - Border radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'\n *\n * @fires input - Emitted when input value changes (on every keystroke).\n * @fires change - Emitted when input loses focus with changed value.\n *\n * @slot prefix - Content before the input (e.g., icons)\n * @slot suffix - Content after the input (e.g., clear button, validation icon)\n * @slot label - Replaces the label text — slotted content takes precedence over the `label` prop\n * @slot helper - Replaces the helper text — slotted content takes precedence over the `helper` prop\n * @slot error - Replaces the error text — slotted content takes precedence over the `error` prop\n *\n * @part wrapper - The input wrapper element\n * @part label - The label element (inset or outside)\n * @part field - The field container element\n * @part input-row - The input row container element\n * @part input - The input element\n * @part status-icon - The inline error/success icon shown inside the field\n * @part spinner - The inline loading spinner shown inside the field while `loading`\n * @part helper - The helper text element\n *\n * @cssprop --input-bg - Background color\n * @cssprop --input-color - Text color\n * @cssprop --input-border-color - Border color\n * @cssprop --input-placeholder-color - Placeholder text color\n * @cssprop --input-radius - Border radius\n * @cssprop --input-padding - Inner padding (block inline)\n * @cssprop --input-gap - Gap between prefix/suffix icons and input text\n * @cssprop --input-font-size - Font size\n * @cssprop --input-height - Field height\n * @cssprop --input-hover-bg - Field background on hover (flat/ghost variants)\n * @cssprop --input-hover-border-color - Field border on hover (flat/bordered variants)\n * @cssprop --input-focus-bg - Field background when focused (flat variant)\n * @cssprop --input-focus-border-color - Field border when focused (flat/text variants)\n *\n * @example\n * ```html\n * <ore-input type=\"email\" label=\"Email\" placeholder=\"you@example.com\" />\n * <ore-input label=\"Name\" variant=\"bordered\" color=\"primary\" />\n * <ore-input label=\"Username\" error=\"That username is taken\" />\n * <ore-input label=\"Username\" success />\n * <ore-input label=\"Username\" loading />\n * ```\n */\nexport const INPUT_TAG = 'ore-input' as const;\ndefine<OreInputProps>(INPUT_TAG, {\n formAssociated: true,\n props: {\n ...themableBundle,\n ...sizableBundle,\n ...disablableBundle,\n ...roundableBundle,\n autocomplete: prop.string(),\n clearable: prop.bool(false),\n error: prop.string(),\n fullwidth: prop.bool(false),\n helper: prop.string(),\n inputmode: prop.string<'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'>(),\n label: prop.string(),\n 'label-placement': prop.oneOf(['inset', 'outside'] as const, 'inset'),\n loading: prop.bool(false),\n maxlength: prop.json(undefined as number | undefined),\n minlength: prop.json(undefined as number | undefined),\n name: prop.string(),\n pattern: prop.string(),\n placeholder: prop.string(),\n readonly: prop.bool(false),\n ref: prop.data<((el: HTMLInputElement | null) => void) | null>(),\n required: prop.bool(false),\n success: prop.bool(false),\n type: prop.oneOf(VALID_INPUT_TYPES, 'text'),\n value: prop.string(),\n variant: prop.string<'flat' | 'text' | 'solid' | 'bordered' | 'outline' | 'ghost'>(),\n },\n setup(props) {\n const el = getHost();\n const slots = useSlots();\n\n const showPassword = signal(false);\n const inputRef = ref<HTMLInputElement>();\n\n const hasLabel = computed(() => !!props.label.value || slots.has('label').value);\n // `loading` behaves like a temporary `disabled` — forces the inner <input> out of\n // constraint validation and interaction for the duration, layered on top of any real\n // `loading` is layered on top of the consumer's explicit `disabled` prop.\n const isDisabled = computed(() => props.disabled.value || props.loading.value);\n\n const abortSignal = lifecycleSignal(onCleanup);\n const tf = createTextField({\n disabled: isDisabled,\n error: props.error,\n hasLabel,\n helper: props.helper,\n label: props.label,\n labelPlacement: props['label-placement'],\n maxLength: props.maxlength,\n onChange: (_event: Event, value: string) => {\n setFieldValue(el, value);\n dispatchNativeFieldEvent(el, 'change');\n },\n onInput: (_event: Event, value: string) => {\n setFieldValue(el, value);\n dispatchNativeFieldEvent(el, 'input');\n },\n prefix: 'input',\n readonly: props.readonly,\n required: props.required,\n signal: abortSignal,\n value: props.value,\n });\n\n defineFieldValue(\n el,\n () => tf.value.value,\n (value) => {\n tf.value.value = value;\n },\n );\n\n tf.attachFormField(\n useField<string>({\n disabled: tf.disabled,\n onReset: tf.reset,\n toFormValue: (v) => v,\n validationMessage: tf.validationMessage,\n validity: tf.validity,\n value: tf.value,\n }),\n );\n\n const {\n ariaDescribedBy,\n ariaErrorMessage,\n ariaInvalid,\n ariaLabelledBy,\n assistiveId,\n clear: clearValue,\n counter,\n errorId,\n errorText,\n fieldId: inputId,\n helperText,\n labelId,\n labelVisible,\n value: fieldValue,\n wire,\n } = tf;\n\n onElement(inputRef, (el) => {\n wire(el, abortSignal);\n\n const unwireRef = bindRefCallback(props.ref, el);\n\n return () => {\n unwireRef();\n };\n });\n\n const clear = (event?: Event): void => {\n clearValue(event);\n inputRef.value?.focus();\n };\n\n const resolvedInputType = (): string =>\n props.type.value === 'password' && showPassword.value ? 'text' : (props.type.value ?? 'text');\n\n bind({\n attr: {\n error: errorAttr(errorText),\n 'has-value': () => (fieldValue.value ? true : undefined),\n size: props.size,\n // Reflects `success` only once `error` is confirmed empty — keeps the two host\n // attributes mutually exclusive even if a consumer sets both props at once.\n success: () => (props.success.value && !errorText.value ? true : undefined),\n variant: props.variant,\n },\n });\n\n const labelHidden = () => !labelVisible.value;\n const passwordToggleLabel = () => (showPassword.value ? 'Hide password' : 'Show password');\n const passwordTogglePressed = () => String(showPassword.value);\n const passwordToggleIcon = () =>\n showPassword.value\n ? html`\n <ore-icon name=\"eye-off\" size=\"14\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n `\n : html`\n <ore-icon name=\"eye\" size=\"14\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n `;\n const helperHidden = () => !!errorText.value || !helperText.value;\n const errorHidden = () => !errorText.value;\n const counterNearLimit = () => (counter?.value.counterNearLimit && !counter?.value.counterAtLimit ? '' : null);\n const counterAtLimit = () => (counter?.value.counterAtLimit ? '' : null);\n const counterHidden = () => !counter;\n const counterText = () => counter?.value.counterText ?? '';\n\n const clearTabIndex = () => (fieldValue.value ? '0' : '-1');\n const pwdToggleTabIndex = () => (props.type.value === 'password' ? '0' : '-1');\n\n const togglePassword = () => {\n showPassword.value = !showPassword.value;\n inputRef.value?.focus();\n };\n\n return html`\n <div class=\"input-wrapper\" part=\"wrapper\">\n <label class=\"label\" for=\"${inputId}\" id=\"${labelId}\" part=\"label\" ?hidden=\"${labelHidden}\">\n <slot name=\"label\">${props.label}</slot>\n </label>\n <div class=\"field\" part=\"field\">\n <div class=\"input-row\" part=\"input-row\">\n <slot name=\"prefix\"></slot>\n <input\n part=\"input\"\n id=\"${inputId}\"\n type=\"${resolvedInputType}\"\n name=\"${props.name}\"\n placeholder=\"${props.placeholder}\"\n autocomplete=\"${props.autocomplete}\"\n inputmode=\"${props.inputmode}\"\n maxlength=\"${props.maxlength}\"\n minlength=\"${props.minlength}\"\n pattern=\"${props.pattern}\"\n ?disabled=\"${isDisabled}\"\n ?readonly=\"${props.readonly}\"\n ?required=\"${props.required}\"\n value=\"${live(fieldValue)}\"\n aria-labelledby=\"${ariaLabelledBy}\"\n aria-describedby=\"${ariaDescribedBy}\"\n aria-errormessage=\"${ariaErrorMessage}\"\n aria-invalid=\"${ariaInvalid}\"\n aria-busy=\"${() => (props.loading.value ? 'true' : null)}\"\n ref=\"${inputRef}\" />\n <slot name=\"suffix\"></slot>\n ${renderStatusIcon(errorText)}\n <span class=\"field-spinner\" part=\"spinner\" role=\"status\" aria-label=\"Loading\"></span>\n <button\n class=\"pwd-toggle-btn\"\n part=\"pwd-toggle\"\n type=\"button\"\n aria-label=\"${passwordToggleLabel}\"\n aria-pressed=\"${passwordTogglePressed}\"\n tabindex=\"${pwdToggleTabIndex}\"\n @click=\"${togglePassword}\">\n ${passwordToggleIcon}\n </button>\n <button\n aria-label=\"Clear\"\n class=\"clear-btn\"\n part=\"clear\"\n type=\"button\"\n tabindex=\"${clearTabIndex}\"\n @click=\"${clear}\">\n <ore-icon aria-hidden=\"true\" name=\"x\" size=\"12\" stroke-width=\"2.5\"></ore-icon>\n </button>\n </div>\n </div>\n <div class=\"helper-text\" aria-live=\"polite\" id=\"${assistiveId}\" part=\"helper\" ?hidden=\"${helperHidden}\">\n <slot name=\"helper\">${() => helperText.value}</slot>\n </div>\n <div class=\"helper-text\" id=\"${errorId}\" role=\"alert\" part=\"error\" ?hidden=\"${errorHidden}\">\n <slot name=\"error\">${() => errorText.value}</slot>\n </div>\n <div\n class=\"char-counter\"\n part=\"char-counter\"\n data-near-limit=\"${counterNearLimit}\"\n data-at-limit=\"${counterAtLimit}\"\n ?hidden=\"${counterHidden}\">\n ${counterText}\n </div>\n </div>\n `;\n },\n shadow: { delegatesFocus: true },\n styles: [\n colorThemeMixin,\n coarsePointerMixin,\n reducedMotionMixin,\n roundedVariantMixin,\n disabledLoadingMixin,\n sizeVariantMixin(FIELD_SIZE_PRESET),\n forcedColorsFocusMixin('input'),\n componentStyles,\n // Must come after `componentStyles` — `@layer` precedence is fixed by which layer name is\n // *first* referenced across this whole array, and `componentStyles` is what establishes\n // `refine.base` (the unconditional `--_bg`/`--_border-color` defaults this mixin's\n // `refine.variants` rules need to win over). Placed earlier, `refine.variants` would end up\n // registered as the *lower*-priority layer, and every variant would silently render as the\n // base default — exactly the bug this ordering fixes.\n fieldVariantMixin({ container: '.field', text: 'input', tokenPrefix: 'input' }),\n ],\n});\n"],"mappings":"ytBA2DA,IAAM,EAAoB,CACxB,OACA,QACA,WACA,SACA,MACA,MACA,SACA,OACA,OACA,iBACA,QACA,MACF,EAkEa,EAAY,aACzB,EAAA,EAAA,OAAA,CAAsB,EAAW,CAC/B,eAAgB,GAChB,MAAO,CACL,GAAG,EAAA,eACH,GAAG,EAAA,cACH,GAAG,EAAA,iBACH,GAAG,EAAA,gBACH,aAAc,EAAA,KAAK,OAAO,EAC1B,UAAW,EAAA,KAAK,KAAK,EAAK,EAC1B,MAAO,EAAA,KAAK,OAAO,EACnB,UAAW,EAAA,KAAK,KAAK,EAAK,EAC1B,OAAQ,EAAA,KAAK,OAAO,EACpB,UAAW,EAAA,KAAK,OAAqF,EACrG,MAAO,EAAA,KAAK,OAAO,EACnB,kBAAmB,EAAA,KAAK,MAAM,CAAC,QAAS,SAAS,EAAY,OAAO,EACpE,QAAS,EAAA,KAAK,KAAK,EAAK,EACxB,UAAW,EAAA,KAAK,KAAK,IAAA,EAA+B,EACpD,UAAW,EAAA,KAAK,KAAK,IAAA,EAA+B,EACpD,KAAM,EAAA,KAAK,OAAO,EAClB,QAAS,EAAA,KAAK,OAAO,EACrB,YAAa,EAAA,KAAK,OAAO,EACzB,SAAU,EAAA,KAAK,KAAK,EAAK,EACzB,IAAK,EAAA,KAAK,KAAqD,EAC/D,SAAU,EAAA,KAAK,KAAK,EAAK,EACzB,QAAS,EAAA,KAAK,KAAK,EAAK,EACxB,KAAM,EAAA,KAAK,MAAM,EAAmB,MAAM,EAC1C,MAAO,EAAA,KAAK,OAAO,EACnB,QAAS,EAAA,KAAK,OAAqE,CACrF,EACA,MAAM,EAAO,CACX,IAAM,GAAA,EAAK,EAAA,QAAA,CAAQ,EACb,GAAA,EAAQ,EAAA,SAAA,CAAS,EAEjB,GAAA,EAAe,EAAA,OAAA,CAAO,EAAK,EAC3B,GAAA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AEhB,EAAQ,2CAtEjB,CAAC,EAAU,MAsEyD;mCAC7D,EAAU,MAAM;;;;;iCAtEjB,GAAS,MAAM,kBAAoB,CAAC,GAAS,MAAM,eAAiB,GAAK,KA2E/D;+BA1EZ,GAAS,MAAM,eAAiB,GAAK,KA2E7B;yBA1EV,CAAC,EA2EE;gBA1EL,GAAS,MAAM,aAAe,GA2EpC;;;KAItB,EACA,OAAQ,CAAE,eAAgB,EAAK,EAC/B,OAAQ,CACN,EAAA,gBACA,EAAA,mBACA,EAAA,mBACA,EAAA,oBACA,EAAA,qBACA,EAAA,iBAAiB,EAAA,iBAAiB,EAClC,EAAA,uBAAuB,OAAO,EAC9B,EAAA,QAOA,EAAA,kBAAkB,CAAE,UAAW,SAAU,KAAM,QAAS,YAAa,OAAQ,CAAC,CAChF,CACF,CAAC"}
1
+ {"version":3,"file":"input.cjs","names":[],"sources":["../src/inputs/input/input.ts"],"sourcesContent":["import { bind, define, getHost, html, live, onCleanup, onElement, prop, ref, useField, useSlots } from '@vielzeug/ore';\nimport { computed, signal } from '@vielzeug/ripple';\nimport { bindRefCallback, createTextField, lifecycleSignal } from '../../core';\nimport type { TextFieldProps } from '../../shared';\nimport { disablableBundle, FIELD_SIZE_PRESET, roundableBundle, sizableBundle, themableBundle } from '../../shared';\nimport type { InputType, VisualVariant } from '../../types';\nimport '../../content/icon/icon';\nimport {\n coarsePointerMixin,\n colorThemeMixin,\n disabledLoadingMixin,\n fieldVariantMixin,\n forcedColorsFocusMixin,\n reducedMotionMixin,\n roundedVariantMixin,\n sizeVariantMixin,\n} from '../../styles';\nimport { errorAttr } from '../shared/field-binding';\nimport { defineFieldValue, dispatchNativeFieldEvent, setFieldValue } from '../shared/native-field-event';\nimport { renderStatusIcon } from '../shared/templates';\nimport componentStyles from './input.css?inline';\n\n/** Input component properties */\n\nexport type OreInputEvents = {\n change: Event;\n input: InputEvent;\n};\n\nexport type OreInputProps = TextFieldProps<Exclude<VisualVariant, 'frost'>> & {\n /** Autocomplete hint */\n autocomplete?: string;\n /** Show a clear (×) button when the field has a value */\n clearable?: boolean;\n /** Virtual keyboard hint for mobile devices */\n inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n /**\n * Shows an inline spinner inside the field and forces the inner `<input>` into\n * `disabled` for the duration — use while an async validation/submission request\n * is in flight (e.g. checking username availability) to prevent double-submits.\n */\n loading?: boolean;\n /** Maximum character length — shows a counter below the input */\n maxlength?: number;\n /** Minimum character length */\n minlength?: number;\n /** HTML pattern attribute for client-side validation */\n pattern?: string;\n /**\n * JS-only callback fired with the inner `<input>` element when it mounts,\n * and with `null` when it unmounts. Intended for composed components that\n * need imperative access to the raw input element.\n * Set as a JS property: `bitInput.ref = (el) => { ... }`.\n */\n ref?: ((el: HTMLInputElement | null) => void) | null;\n /** HTML input type */\n type?: InputType;\n};\n\nconst VALID_INPUT_TYPES = [\n 'text',\n 'email',\n 'password',\n 'search',\n 'url',\n 'tel',\n 'number',\n 'date',\n 'time',\n 'datetime-local',\n 'month',\n 'week',\n] as const;\n\n/**\n * A customizable text input component with multiple variants, label placements, and form features.\n *\n * @element ore-input\n *\n * @attr {string} label - Label text\n * @attr {string} label-placement - Label placement: 'inset' | 'outside'\n * @attr {string} type - HTML input type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search'\n * @attr {string} value - Current input value\n * @attr {string} placeholder - Placeholder text\n * @attr {string} name - Form field name\n * @attr {string} helper - Helper text displayed below the input (fallback when the `helper` slot is empty)\n * @attr {string} error - Error message — marks the field as invalid (fallback when the `error` slot is empty)\n * @attr {boolean} disabled - Disable input interaction\n * @attr {boolean} readonly - Make the input read-only\n * @attr {boolean} required - Mark the field as required\n * @attr {boolean} loading - Show an inline spinner and force the field disabled\n * @attr {boolean} success - Show an inline success check icon (suppressed while `error` is set)\n * @attr {string} color - Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'\n * @attr {string} variant - Visual variant: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text'\n * @attr {string} size - Input size: 'sm' | 'md' | 'lg'\n * @attr {string} rounded - Border radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'\n *\n * @fires input - Emitted when input value changes (on every keystroke).\n * @fires change - Emitted when input loses focus with changed value.\n *\n * @slot prefix - Content before the input (e.g., icons)\n * @slot suffix - Content after the input (e.g., clear button, validation icon)\n * @slot label - Replaces the label text — slotted content takes precedence over the `label` prop\n * @slot helper - Replaces the helper text — slotted content takes precedence over the `helper` prop\n * @slot error - Replaces the error text — slotted content takes precedence over the `error` prop\n *\n * @part wrapper - The input wrapper element\n * @part label - The label element (inset or outside)\n * @part field - The field container element\n * @part input-row - The input row container element\n * @part input - The input element\n * @part status-icon - The inline error/success icon shown inside the field\n * @part spinner - The inline loading spinner shown inside the field while `loading`\n * @part helper - The helper text element\n *\n * @cssprop --input-bg - Background color\n * @cssprop --input-color - Text color\n * @cssprop --input-border-color - Border color\n * @cssprop --input-placeholder-color - Placeholder text color\n * @cssprop --input-radius - Border radius\n * @cssprop --input-padding - Inner padding (block inline)\n * @cssprop --input-label-block-inset - Inset from the field block start for an inset label\n * @cssprop --input-label-inset - Inset from the field inline start for an inset label\n * @cssprop --input-gap - Gap between prefix/suffix icons and input text\n * @cssprop --input-font-size - Font size\n * @cssprop --input-height - Field height\n * @cssprop --input-hover-bg - Field background on hover (flat/ghost variants)\n * @cssprop --input-hover-border-color - Field border on hover (flat/bordered variants)\n * @cssprop --input-focus-bg - Field background when focused (flat variant)\n * @cssprop --input-focus-border-color - Field border when focused (flat/text variants)\n *\n * @example\n * ```html\n * <ore-input type=\"email\" label=\"Email\" placeholder=\"you@example.com\" />\n * <ore-input label=\"Name\" variant=\"bordered\" color=\"primary\" />\n * <ore-input label=\"Username\" error=\"That username is taken\" />\n * <ore-input label=\"Username\" success />\n * <ore-input label=\"Username\" loading />\n * ```\n */\nexport const INPUT_TAG = 'ore-input' as const;\ndefine<OreInputProps>(INPUT_TAG, {\n formAssociated: true,\n props: {\n ...themableBundle,\n ...sizableBundle,\n ...disablableBundle,\n ...roundableBundle,\n autocomplete: prop.string(),\n clearable: prop.bool(false),\n error: prop.string(),\n fullwidth: prop.bool(false),\n helper: prop.string(),\n inputmode: prop.string<'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'>(),\n label: prop.string(),\n 'label-placement': prop.oneOf(['inset', 'outside'] as const, 'inset'),\n loading: prop.bool(false),\n maxlength: prop.json(undefined as number | undefined),\n minlength: prop.json(undefined as number | undefined),\n name: prop.string(),\n pattern: prop.string(),\n placeholder: prop.string(),\n readonly: prop.bool(false),\n ref: prop.data<((el: HTMLInputElement | null) => void) | null>(),\n required: prop.bool(false),\n success: prop.bool(false),\n type: prop.oneOf(VALID_INPUT_TYPES, 'text'),\n value: prop.string(),\n variant: prop.string<'flat' | 'text' | 'solid' | 'bordered' | 'outline' | 'ghost'>(),\n },\n setup(props) {\n const el = getHost();\n const slots = useSlots();\n\n const showPassword = signal(false);\n const inputRef = ref<HTMLInputElement>();\n\n const hasLabel = computed(() => !!props.label.value || slots.has('label').value);\n // `loading` behaves like a temporary `disabled` — forces the inner <input> out of\n // constraint validation and interaction for the duration, layered on top of any real\n // `loading` is layered on top of the consumer's explicit `disabled` prop.\n const isDisabled = computed(() => props.disabled.value || props.loading.value);\n\n const abortSignal = lifecycleSignal(onCleanup);\n const tf = createTextField({\n disabled: isDisabled,\n error: props.error,\n hasLabel,\n helper: props.helper,\n label: props.label,\n labelPlacement: props['label-placement'],\n maxLength: props.maxlength,\n onChange: (_event: Event, value: string) => {\n setFieldValue(el, value);\n dispatchNativeFieldEvent(el, 'change');\n },\n onInput: (_event: Event, value: string) => {\n setFieldValue(el, value);\n dispatchNativeFieldEvent(el, 'input');\n },\n prefix: 'input',\n readonly: props.readonly,\n required: props.required,\n signal: abortSignal,\n value: props.value,\n });\n\n defineFieldValue(\n el,\n () => tf.value.value,\n (value) => {\n tf.value.value = value;\n },\n );\n\n tf.attachFormField(\n useField<string>({\n disabled: tf.disabled,\n onReset: tf.reset,\n toFormValue: (v) => v,\n validationMessage: tf.validationMessage,\n validity: tf.validity,\n value: tf.value,\n }),\n );\n\n const {\n ariaDescribedBy,\n ariaErrorMessage,\n ariaInvalid,\n ariaLabelledBy,\n assistiveId,\n clear: clearValue,\n counter,\n errorId,\n errorText,\n fieldId: inputId,\n helperText,\n labelId,\n labelVisible,\n value: fieldValue,\n wire,\n } = tf;\n\n onElement(inputRef, (el) => {\n wire(el, abortSignal);\n\n const unwireRef = bindRefCallback(props.ref, el);\n\n return () => {\n unwireRef();\n };\n });\n\n const clear = (event?: Event): void => {\n clearValue(event);\n inputRef.value?.focus();\n };\n\n const resolvedInputType = (): string =>\n props.type.value === 'password' && showPassword.value ? 'text' : (props.type.value ?? 'text');\n\n bind({\n attr: {\n error: errorAttr(errorText),\n 'has-value': () => (fieldValue.value ? true : undefined),\n size: props.size,\n // Reflects `success` only once `error` is confirmed empty — keeps the two host\n // attributes mutually exclusive even if a consumer sets both props at once.\n success: () => (props.success.value && !errorText.value ? true : undefined),\n variant: props.variant,\n },\n });\n\n const labelHidden = () => !labelVisible.value;\n const passwordToggleLabel = () => (showPassword.value ? 'Hide password' : 'Show password');\n const passwordTogglePressed = () => String(showPassword.value);\n const passwordToggleIcon = () =>\n showPassword.value\n ? html`\n <ore-icon name=\"eye-off\" size=\"14\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n `\n : html`\n <ore-icon name=\"eye\" size=\"14\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n `;\n const helperHidden = () => !!errorText.value || !helperText.value;\n const errorHidden = () => !errorText.value;\n const counterNearLimit = () => (counter?.value.counterNearLimit && !counter?.value.counterAtLimit ? '' : null);\n const counterAtLimit = () => (counter?.value.counterAtLimit ? '' : null);\n const counterHidden = () => !counter;\n const counterText = () => counter?.value.counterText ?? '';\n\n const clearTabIndex = () => (fieldValue.value ? '0' : '-1');\n const pwdToggleTabIndex = () => (props.type.value === 'password' ? '0' : '-1');\n\n const togglePassword = () => {\n showPassword.value = !showPassword.value;\n inputRef.value?.focus();\n };\n\n return html`\n <div class=\"input-wrapper\" part=\"wrapper\">\n <label class=\"label\" for=\"${inputId}\" id=\"${labelId}\" part=\"label\" ?hidden=\"${labelHidden}\">\n <slot name=\"label\">${props.label}</slot>\n </label>\n <div class=\"field\" part=\"field\">\n <div class=\"input-row\" part=\"input-row\">\n <slot name=\"prefix\"></slot>\n <input\n part=\"input\"\n id=\"${inputId}\"\n type=\"${resolvedInputType}\"\n name=\"${props.name}\"\n placeholder=\"${props.placeholder}\"\n autocomplete=\"${props.autocomplete}\"\n inputmode=\"${props.inputmode}\"\n maxlength=\"${props.maxlength}\"\n minlength=\"${props.minlength}\"\n pattern=\"${props.pattern}\"\n ?disabled=\"${isDisabled}\"\n ?readonly=\"${props.readonly}\"\n ?required=\"${props.required}\"\n value=\"${live(fieldValue)}\"\n aria-labelledby=\"${ariaLabelledBy}\"\n aria-describedby=\"${ariaDescribedBy}\"\n aria-errormessage=\"${ariaErrorMessage}\"\n aria-invalid=\"${ariaInvalid}\"\n aria-busy=\"${() => (props.loading.value ? 'true' : null)}\"\n ref=\"${inputRef}\" />\n <slot name=\"suffix\"></slot>\n ${renderStatusIcon(errorText)}\n <span class=\"field-spinner\" part=\"spinner\" role=\"status\" aria-label=\"Loading\"></span>\n <button\n class=\"pwd-toggle-btn\"\n part=\"pwd-toggle\"\n type=\"button\"\n aria-label=\"${passwordToggleLabel}\"\n aria-pressed=\"${passwordTogglePressed}\"\n tabindex=\"${pwdToggleTabIndex}\"\n @click=\"${togglePassword}\">\n ${passwordToggleIcon}\n </button>\n <button\n aria-label=\"Clear\"\n class=\"clear-btn\"\n part=\"clear\"\n type=\"button\"\n tabindex=\"${clearTabIndex}\"\n @click=\"${clear}\">\n <ore-icon aria-hidden=\"true\" name=\"x\" size=\"12\" stroke-width=\"2.5\"></ore-icon>\n </button>\n </div>\n </div>\n <div class=\"helper-text\" aria-live=\"polite\" id=\"${assistiveId}\" part=\"helper\" ?hidden=\"${helperHidden}\">\n <slot name=\"helper\">${() => helperText.value}</slot>\n </div>\n <div class=\"helper-text\" id=\"${errorId}\" role=\"alert\" part=\"error\" ?hidden=\"${errorHidden}\">\n <slot name=\"error\">${() => errorText.value}</slot>\n </div>\n <div\n class=\"char-counter\"\n part=\"char-counter\"\n data-near-limit=\"${counterNearLimit}\"\n data-at-limit=\"${counterAtLimit}\"\n ?hidden=\"${counterHidden}\">\n ${counterText}\n </div>\n </div>\n `;\n },\n shadow: { delegatesFocus: true },\n styles: [\n colorThemeMixin,\n coarsePointerMixin,\n reducedMotionMixin,\n roundedVariantMixin,\n disabledLoadingMixin,\n sizeVariantMixin(FIELD_SIZE_PRESET),\n forcedColorsFocusMixin('input'),\n componentStyles,\n // Must come after `componentStyles` — `@layer` precedence is fixed by which layer name is\n // *first* referenced across this whole array, and `componentStyles` is what establishes\n // `refine.base` (the unconditional `--_bg`/`--_border-color` defaults this mixin's\n // `refine.variants` rules need to win over). Placed earlier, `refine.variants` would end up\n // registered as the *lower*-priority layer, and every variant would silently render as the\n // base default — exactly the bug this ordering fixes.\n fieldVariantMixin({ container: '.field', text: 'input', tokenPrefix: 'input' }),\n ],\n});\n"],"mappings":"ytBA2DA,IAAM,EAAoB,CACxB,OACA,QACA,WACA,SACA,MACA,MACA,SACA,OACA,OACA,iBACA,QACA,MACF,EAoEa,EAAY,aACzB,EAAA,EAAA,OAAA,CAAsB,EAAW,CAC/B,eAAgB,GAChB,MAAO,CACL,GAAG,EAAA,eACH,GAAG,EAAA,cACH,GAAG,EAAA,iBACH,GAAG,EAAA,gBACH,aAAc,EAAA,KAAK,OAAO,EAC1B,UAAW,EAAA,KAAK,KAAK,EAAK,EAC1B,MAAO,EAAA,KAAK,OAAO,EACnB,UAAW,EAAA,KAAK,KAAK,EAAK,EAC1B,OAAQ,EAAA,KAAK,OAAO,EACpB,UAAW,EAAA,KA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}
package/dist/input.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","names":[],"sources":["../src/inputs/input/input.ts"],"sourcesContent":["import { bind, define, getHost, html, live, onCleanup, onElement, prop, ref, useField, useSlots } from '@vielzeug/ore';\nimport { computed, signal } from '@vielzeug/ripple';\nimport { bindRefCallback, createTextField, lifecycleSignal } from '../../core';\nimport type { TextFieldProps } from '../../shared';\nimport { disablableBundle, FIELD_SIZE_PRESET, roundableBundle, sizableBundle, themableBundle } from '../../shared';\nimport type { InputType, VisualVariant } from '../../types';\nimport '../../content/icon/icon';\nimport {\n coarsePointerMixin,\n colorThemeMixin,\n disabledLoadingMixin,\n fieldVariantMixin,\n forcedColorsFocusMixin,\n reducedMotionMixin,\n roundedVariantMixin,\n sizeVariantMixin,\n} from '../../styles';\nimport { errorAttr } from '../shared/field-binding';\nimport { defineFieldValue, dispatchNativeFieldEvent, setFieldValue } from '../shared/native-field-event';\nimport { renderStatusIcon } from '../shared/templates';\nimport componentStyles from './input.css?inline';\n\n/** Input component properties */\n\nexport type OreInputEvents = {\n change: Event;\n input: InputEvent;\n};\n\nexport type OreInputProps = TextFieldProps<Exclude<VisualVariant, 'frost'>> & {\n /** Autocomplete hint */\n autocomplete?: string;\n /** Show a clear (×) button when the field has a value */\n clearable?: boolean;\n /** Virtual keyboard hint for mobile devices */\n inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n /**\n * Shows an inline spinner inside the field and forces the inner `<input>` into\n * `disabled` for the duration — use while an async validation/submission request\n * is in flight (e.g. checking username availability) to prevent double-submits.\n */\n loading?: boolean;\n /** Maximum character length — shows a counter below the input */\n maxlength?: number;\n /** Minimum character length */\n minlength?: number;\n /** HTML pattern attribute for client-side validation */\n pattern?: string;\n /**\n * JS-only callback fired with the inner `<input>` element when it mounts,\n * and with `null` when it unmounts. Intended for composed components that\n * need imperative access to the raw input element.\n * Set as a JS property: `bitInput.ref = (el) => { ... }`.\n */\n ref?: ((el: HTMLInputElement | null) => void) | null;\n /** HTML input type */\n type?: InputType;\n};\n\nconst VALID_INPUT_TYPES = [\n 'text',\n 'email',\n 'password',\n 'search',\n 'url',\n 'tel',\n 'number',\n 'date',\n 'time',\n 'datetime-local',\n 'month',\n 'week',\n] as const;\n\n/**\n * A customizable text input component with multiple variants, label placements, and form features.\n *\n * @element ore-input\n *\n * @attr {string} label - Label text\n * @attr {string} label-placement - Label placement: 'inset' | 'outside'\n * @attr {string} type - HTML input type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search'\n * @attr {string} value - Current input value\n * @attr {string} placeholder - Placeholder text\n * @attr {string} name - Form field name\n * @attr {string} helper - Helper text displayed below the input (fallback when the `helper` slot is empty)\n * @attr {string} error - Error message — marks the field as invalid (fallback when the `error` slot is empty)\n * @attr {boolean} disabled - Disable input interaction\n * @attr {boolean} readonly - Make the input read-only\n * @attr {boolean} required - Mark the field as required\n * @attr {boolean} loading - Show an inline spinner and force the field disabled\n * @attr {boolean} success - Show an inline success check icon (suppressed while `error` is set)\n * @attr {string} color - Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'\n * @attr {string} variant - Visual variant: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text'\n * @attr {string} size - Input size: 'sm' | 'md' | 'lg'\n * @attr {string} rounded - Border radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'\n *\n * @fires input - Emitted when input value changes (on every keystroke).\n * @fires change - Emitted when input loses focus with changed value.\n *\n * @slot prefix - Content before the input (e.g., icons)\n * @slot suffix - Content after the input (e.g., clear button, validation icon)\n * @slot label - Replaces the label text — slotted content takes precedence over the `label` prop\n * @slot helper - Replaces the helper text — slotted content takes precedence over the `helper` prop\n * @slot error - Replaces the error text — slotted content takes precedence over the `error` prop\n *\n * @part wrapper - The input wrapper element\n * @part label - The label element (inset or outside)\n * @part field - The field container element\n * @part input-row - The input row container element\n * @part input - The input element\n * @part status-icon - The inline error/success icon shown inside the field\n * @part spinner - The inline loading spinner shown inside the field while `loading`\n * @part helper - The helper text element\n *\n * @cssprop --input-bg - Background color\n * @cssprop --input-color - Text color\n * @cssprop --input-border-color - Border color\n * @cssprop --input-placeholder-color - Placeholder text color\n * @cssprop --input-radius - Border radius\n * @cssprop --input-padding - Inner padding (block inline)\n * @cssprop --input-gap - Gap between prefix/suffix icons and input text\n * @cssprop --input-font-size - Font size\n * @cssprop --input-height - Field height\n * @cssprop --input-hover-bg - Field background on hover (flat/ghost variants)\n * @cssprop --input-hover-border-color - Field border on hover (flat/bordered variants)\n * @cssprop --input-focus-bg - Field background when focused (flat variant)\n * @cssprop --input-focus-border-color - Field border when focused (flat/text variants)\n *\n * @example\n * ```html\n * <ore-input type=\"email\" label=\"Email\" placeholder=\"you@example.com\" />\n * <ore-input label=\"Name\" variant=\"bordered\" color=\"primary\" />\n * <ore-input label=\"Username\" error=\"That username is taken\" />\n * <ore-input label=\"Username\" success />\n * <ore-input label=\"Username\" loading />\n * ```\n */\nexport const INPUT_TAG = 'ore-input' as const;\ndefine<OreInputProps>(INPUT_TAG, {\n formAssociated: true,\n props: {\n ...themableBundle,\n ...sizableBundle,\n ...disablableBundle,\n ...roundableBundle,\n autocomplete: prop.string(),\n clearable: prop.bool(false),\n error: prop.string(),\n fullwidth: prop.bool(false),\n helper: prop.string(),\n inputmode: prop.string<'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'>(),\n label: prop.string(),\n 'label-placement': prop.oneOf(['inset', 'outside'] as const, 'inset'),\n loading: prop.bool(false),\n maxlength: prop.json(undefined as number | undefined),\n minlength: prop.json(undefined as number | undefined),\n name: prop.string(),\n pattern: prop.string(),\n placeholder: prop.string(),\n readonly: prop.bool(false),\n ref: prop.data<((el: HTMLInputElement | null) => void) | null>(),\n required: prop.bool(false),\n success: prop.bool(false),\n type: prop.oneOf(VALID_INPUT_TYPES, 'text'),\n value: prop.string(),\n variant: prop.string<'flat' | 'text' | 'solid' | 'bordered' | 'outline' | 'ghost'>(),\n },\n setup(props) {\n const el = getHost();\n const slots = useSlots();\n\n const showPassword = signal(false);\n const inputRef = ref<HTMLInputElement>();\n\n const hasLabel = computed(() => !!props.label.value || slots.has('label').value);\n // `loading` behaves like a temporary `disabled` — forces the inner <input> out of\n // constraint validation and interaction for the duration, layered on top of any real\n // `loading` is layered on top of the consumer's explicit `disabled` prop.\n const isDisabled = computed(() => props.disabled.value || props.loading.value);\n\n const abortSignal = lifecycleSignal(onCleanup);\n const tf = createTextField({\n disabled: isDisabled,\n error: props.error,\n hasLabel,\n helper: props.helper,\n label: props.label,\n labelPlacement: props['label-placement'],\n maxLength: props.maxlength,\n onChange: (_event: Event, value: string) => {\n setFieldValue(el, value);\n dispatchNativeFieldEvent(el, 'change');\n },\n onInput: (_event: Event, value: string) => {\n setFieldValue(el, value);\n dispatchNativeFieldEvent(el, 'input');\n },\n prefix: 'input',\n readonly: props.readonly,\n required: props.required,\n signal: abortSignal,\n value: props.value,\n });\n\n defineFieldValue(\n el,\n () => tf.value.value,\n (value) => {\n tf.value.value = value;\n },\n );\n\n tf.attachFormField(\n useField<string>({\n disabled: tf.disabled,\n onReset: tf.reset,\n toFormValue: (v) => v,\n validationMessage: tf.validationMessage,\n validity: tf.validity,\n value: tf.value,\n }),\n );\n\n const {\n ariaDescribedBy,\n ariaErrorMessage,\n ariaInvalid,\n ariaLabelledBy,\n assistiveId,\n clear: clearValue,\n counter,\n errorId,\n errorText,\n fieldId: inputId,\n helperText,\n labelId,\n labelVisible,\n value: fieldValue,\n wire,\n } = tf;\n\n onElement(inputRef, (el) => {\n wire(el, abortSignal);\n\n const unwireRef = bindRefCallback(props.ref, el);\n\n return () => {\n unwireRef();\n };\n });\n\n const clear = (event?: Event): void => {\n clearValue(event);\n inputRef.value?.focus();\n };\n\n const resolvedInputType = (): string =>\n props.type.value === 'password' && showPassword.value ? 'text' : (props.type.value ?? 'text');\n\n bind({\n attr: {\n error: errorAttr(errorText),\n 'has-value': () => (fieldValue.value ? true : undefined),\n size: props.size,\n // Reflects `success` only once `error` is confirmed empty — keeps the two host\n // attributes mutually exclusive even if a consumer sets both props at once.\n success: () => (props.success.value && !errorText.value ? true : undefined),\n variant: props.variant,\n },\n });\n\n const labelHidden = () => !labelVisible.value;\n const passwordToggleLabel = () => (showPassword.value ? 'Hide password' : 'Show password');\n const passwordTogglePressed = () => String(showPassword.value);\n const passwordToggleIcon = () =>\n showPassword.value\n ? html`\n <ore-icon name=\"eye-off\" size=\"14\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n `\n : html`\n <ore-icon name=\"eye\" size=\"14\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n `;\n const helperHidden = () => !!errorText.value || !helperText.value;\n const errorHidden = () => !errorText.value;\n const counterNearLimit = () => (counter?.value.counterNearLimit && !counter?.value.counterAtLimit ? '' : null);\n const counterAtLimit = () => (counter?.value.counterAtLimit ? '' : null);\n const counterHidden = () => !counter;\n const counterText = () => counter?.value.counterText ?? '';\n\n const clearTabIndex = () => (fieldValue.value ? '0' : '-1');\n const pwdToggleTabIndex = () => (props.type.value === 'password' ? '0' : '-1');\n\n const togglePassword = () => {\n showPassword.value = !showPassword.value;\n inputRef.value?.focus();\n };\n\n return html`\n <div class=\"input-wrapper\" part=\"wrapper\">\n <label class=\"label\" for=\"${inputId}\" id=\"${labelId}\" part=\"label\" ?hidden=\"${labelHidden}\">\n <slot name=\"label\">${props.label}</slot>\n </label>\n <div class=\"field\" part=\"field\">\n <div class=\"input-row\" part=\"input-row\">\n <slot name=\"prefix\"></slot>\n <input\n part=\"input\"\n id=\"${inputId}\"\n type=\"${resolvedInputType}\"\n name=\"${props.name}\"\n placeholder=\"${props.placeholder}\"\n autocomplete=\"${props.autocomplete}\"\n inputmode=\"${props.inputmode}\"\n maxlength=\"${props.maxlength}\"\n minlength=\"${props.minlength}\"\n pattern=\"${props.pattern}\"\n ?disabled=\"${isDisabled}\"\n ?readonly=\"${props.readonly}\"\n ?required=\"${props.required}\"\n value=\"${live(fieldValue)}\"\n aria-labelledby=\"${ariaLabelledBy}\"\n aria-describedby=\"${ariaDescribedBy}\"\n aria-errormessage=\"${ariaErrorMessage}\"\n aria-invalid=\"${ariaInvalid}\"\n aria-busy=\"${() => (props.loading.value ? 'true' : null)}\"\n ref=\"${inputRef}\" />\n <slot name=\"suffix\"></slot>\n ${renderStatusIcon(errorText)}\n <span class=\"field-spinner\" part=\"spinner\" role=\"status\" aria-label=\"Loading\"></span>\n <button\n class=\"pwd-toggle-btn\"\n part=\"pwd-toggle\"\n type=\"button\"\n aria-label=\"${passwordToggleLabel}\"\n aria-pressed=\"${passwordTogglePressed}\"\n tabindex=\"${pwdToggleTabIndex}\"\n @click=\"${togglePassword}\">\n ${passwordToggleIcon}\n </button>\n <button\n aria-label=\"Clear\"\n class=\"clear-btn\"\n part=\"clear\"\n type=\"button\"\n tabindex=\"${clearTabIndex}\"\n @click=\"${clear}\">\n <ore-icon aria-hidden=\"true\" name=\"x\" size=\"12\" stroke-width=\"2.5\"></ore-icon>\n </button>\n </div>\n </div>\n <div class=\"helper-text\" aria-live=\"polite\" id=\"${assistiveId}\" part=\"helper\" ?hidden=\"${helperHidden}\">\n <slot name=\"helper\">${() => helperText.value}</slot>\n </div>\n <div class=\"helper-text\" id=\"${errorId}\" role=\"alert\" part=\"error\" ?hidden=\"${errorHidden}\">\n <slot name=\"error\">${() => errorText.value}</slot>\n </div>\n <div\n class=\"char-counter\"\n part=\"char-counter\"\n data-near-limit=\"${counterNearLimit}\"\n data-at-limit=\"${counterAtLimit}\"\n ?hidden=\"${counterHidden}\">\n ${counterText}\n </div>\n </div>\n `;\n },\n shadow: { delegatesFocus: true },\n styles: [\n colorThemeMixin,\n coarsePointerMixin,\n reducedMotionMixin,\n roundedVariantMixin,\n disabledLoadingMixin,\n sizeVariantMixin(FIELD_SIZE_PRESET),\n forcedColorsFocusMixin('input'),\n componentStyles,\n // Must come after `componentStyles` — `@layer` precedence is fixed by which layer name is\n // *first* referenced across this whole array, and `componentStyles` is what establishes\n // `refine.base` (the unconditional `--_bg`/`--_border-color` defaults this mixin's\n // `refine.variants` rules need to win over). Placed earlier, `refine.variants` would end up\n // registered as the *lower*-priority layer, and every variant would silently render as the\n // base default — exactly the bug this ordering fixes.\n fieldVariantMixin({ container: '.field', text: 'input', tokenPrefix: 'input' }),\n ],\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AA2DA,IAAM,IAAoB;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAkEa,IAAY;AACzB,EAAsB,GAAW;CAC/B,gBAAgB;CAChB,OAAO;EACL,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,cAAc,EAAK,OAAO;EAC1B,WAAW,EAAK,KAAK,EAAK;EAC1B,OAAO,EAAK,OAAO;EACnB,WAAW,EAAK,KAAK,EAAK;EAC1B,QAAQ,EAAK,OAAO;EACpB,WAAW,EAAK,OAAqF;EACrG,OAAO,EAAK,OAAO;EACnB,mBAAmB,EAAK,MAAM,CAAC,SAAS,SAAS,GAAY,OAAO;EACpE,SAAS,EAAK,KAAK,EAAK;EACxB,WAAW,EAAK,KAAK,KAAA,CAA+B;EACpD,WAAW,EAAK,KAAK,KAAA,CAA+B;EACpD,MAAM,EAAK,OAAO;EAClB,SAAS,EAAK,OAAO;EACrB,aAAa,EAAK,OAAO;EACzB,UAAU,EAAK,KAAK,EAAK;EACzB,KAAK,EAAK,KAAqD;EAC/D,UAAU,EAAK,KAAK,EAAK;EACzB,SAAS,EAAK,KAAK,EAAK;EACxB,MAAM,EAAK,MAAM,GAAmB,MAAM;EAC1C,OAAO,EAAK,OAAO;EACnB,SAAS,EAAK,OAAqE;CACrF;CACA,MAAM,GAAO;EACX,IAAM,IAAK,EAAQ,GACb,IAAQ,EAAS,GAEjB,IAAe,EAAO,EAAK,GAC3B,IAAW,EAAsB,GAEjC,IAAW,QAAe,CAAC,CAAC,EAAM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2EpC;;;;CAItB;CACA,QAAQ,EAAE,gBAAgB,GAAK;CAC/B,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA,EAAiB,CAAiB;EAClC,EAAuB,OAAO;EAC9B;EAOA,EAAkB;GAAE,WAAW;GAAU,MAAM;GAAS,aAAa;EAAQ,CAAC;CAChF;AACF,CAAC"}
1
+ {"version":3,"file":"input.js","names":[],"sources":["../src/inputs/input/input.ts"],"sourcesContent":["import { bind, define, getHost, html, live, onCleanup, onElement, prop, ref, useField, useSlots } from '@vielzeug/ore';\nimport { computed, signal } from '@vielzeug/ripple';\nimport { bindRefCallback, createTextField, lifecycleSignal } from '../../core';\nimport type { TextFieldProps } from '../../shared';\nimport { disablableBundle, FIELD_SIZE_PRESET, roundableBundle, sizableBundle, themableBundle } from '../../shared';\nimport type { InputType, VisualVariant } from '../../types';\nimport '../../content/icon/icon';\nimport {\n coarsePointerMixin,\n colorThemeMixin,\n disabledLoadingMixin,\n fieldVariantMixin,\n forcedColorsFocusMixin,\n reducedMotionMixin,\n roundedVariantMixin,\n sizeVariantMixin,\n} from '../../styles';\nimport { errorAttr } from '../shared/field-binding';\nimport { defineFieldValue, dispatchNativeFieldEvent, setFieldValue } from '../shared/native-field-event';\nimport { renderStatusIcon } from '../shared/templates';\nimport componentStyles from './input.css?inline';\n\n/** Input component properties */\n\nexport type OreInputEvents = {\n change: Event;\n input: InputEvent;\n};\n\nexport type OreInputProps = TextFieldProps<Exclude<VisualVariant, 'frost'>> & {\n /** Autocomplete hint */\n autocomplete?: string;\n /** Show a clear (×) button when the field has a value */\n clearable?: boolean;\n /** Virtual keyboard hint for mobile devices */\n inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n /**\n * Shows an inline spinner inside the field and forces the inner `<input>` into\n * `disabled` for the duration — use while an async validation/submission request\n * is in flight (e.g. checking username availability) to prevent double-submits.\n */\n loading?: boolean;\n /** Maximum character length — shows a counter below the input */\n maxlength?: number;\n /** Minimum character length */\n minlength?: number;\n /** HTML pattern attribute for client-side validation */\n pattern?: string;\n /**\n * JS-only callback fired with the inner `<input>` element when it mounts,\n * and with `null` when it unmounts. Intended for composed components that\n * need imperative access to the raw input element.\n * Set as a JS property: `bitInput.ref = (el) => { ... }`.\n */\n ref?: ((el: HTMLInputElement | null) => void) | null;\n /** HTML input type */\n type?: InputType;\n};\n\nconst VALID_INPUT_TYPES = [\n 'text',\n 'email',\n 'password',\n 'search',\n 'url',\n 'tel',\n 'number',\n 'date',\n 'time',\n 'datetime-local',\n 'month',\n 'week',\n] as const;\n\n/**\n * A customizable text input component with multiple variants, label placements, and form features.\n *\n * @element ore-input\n *\n * @attr {string} label - Label text\n * @attr {string} label-placement - Label placement: 'inset' | 'outside'\n * @attr {string} type - HTML input type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search'\n * @attr {string} value - Current input value\n * @attr {string} placeholder - Placeholder text\n * @attr {string} name - Form field name\n * @attr {string} helper - Helper text displayed below the input (fallback when the `helper` slot is empty)\n * @attr {string} error - Error message — marks the field as invalid (fallback when the `error` slot is empty)\n * @attr {boolean} disabled - Disable input interaction\n * @attr {boolean} readonly - Make the input read-only\n * @attr {boolean} required - Mark the field as required\n * @attr {boolean} loading - Show an inline spinner and force the field disabled\n * @attr {boolean} success - Show an inline success check icon (suppressed while `error` is set)\n * @attr {string} color - Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'\n * @attr {string} variant - Visual variant: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text'\n * @attr {string} size - Input size: 'sm' | 'md' | 'lg'\n * @attr {string} rounded - Border radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'\n *\n * @fires input - Emitted when input value changes (on every keystroke).\n * @fires change - Emitted when input loses focus with changed value.\n *\n * @slot prefix - Content before the input (e.g., icons)\n * @slot suffix - Content after the input (e.g., clear button, validation icon)\n * @slot label - Replaces the label text — slotted content takes precedence over the `label` prop\n * @slot helper - Replaces the helper text — slotted content takes precedence over the `helper` prop\n * @slot error - Replaces the error text — slotted content takes precedence over the `error` prop\n *\n * @part wrapper - The input wrapper element\n * @part label - The label element (inset or outside)\n * @part field - The field container element\n * @part input-row - The input row container element\n * @part input - The input element\n * @part status-icon - The inline error/success icon shown inside the field\n * @part spinner - The inline loading spinner shown inside the field while `loading`\n * @part helper - The helper text element\n *\n * @cssprop --input-bg - Background color\n * @cssprop --input-color - Text color\n * @cssprop --input-border-color - Border color\n * @cssprop --input-placeholder-color - Placeholder text color\n * @cssprop --input-radius - Border radius\n * @cssprop --input-padding - Inner padding (block inline)\n * @cssprop --input-label-block-inset - Inset from the field block start for an inset label\n * @cssprop --input-label-inset - Inset from the field inline start for an inset label\n * @cssprop --input-gap - Gap between prefix/suffix icons and input text\n * @cssprop --input-font-size - Font size\n * @cssprop --input-height - Field height\n * @cssprop --input-hover-bg - Field background on hover (flat/ghost variants)\n * @cssprop --input-hover-border-color - Field border on hover (flat/bordered variants)\n * @cssprop --input-focus-bg - Field background when focused (flat variant)\n * @cssprop --input-focus-border-color - Field border when focused (flat/text variants)\n *\n * @example\n * ```html\n * <ore-input type=\"email\" label=\"Email\" placeholder=\"you@example.com\" />\n * <ore-input label=\"Name\" variant=\"bordered\" color=\"primary\" />\n * <ore-input label=\"Username\" error=\"That username is taken\" />\n * <ore-input label=\"Username\" success />\n * <ore-input label=\"Username\" loading />\n * ```\n */\nexport const INPUT_TAG = 'ore-input' as const;\ndefine<OreInputProps>(INPUT_TAG, {\n formAssociated: true,\n props: {\n ...themableBundle,\n ...sizableBundle,\n ...disablableBundle,\n ...roundableBundle,\n autocomplete: prop.string(),\n clearable: prop.bool(false),\n error: prop.string(),\n fullwidth: prop.bool(false),\n helper: prop.string(),\n inputmode: prop.string<'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'>(),\n label: prop.string(),\n 'label-placement': prop.oneOf(['inset', 'outside'] as const, 'inset'),\n loading: prop.bool(false),\n maxlength: prop.json(undefined as number | undefined),\n minlength: prop.json(undefined as number | undefined),\n name: prop.string(),\n pattern: prop.string(),\n placeholder: prop.string(),\n readonly: prop.bool(false),\n ref: prop.data<((el: HTMLInputElement | null) => void) | null>(),\n required: prop.bool(false),\n success: prop.bool(false),\n type: prop.oneOf(VALID_INPUT_TYPES, 'text'),\n value: prop.string(),\n variant: prop.string<'flat' | 'text' | 'solid' | 'bordered' | 'outline' | 'ghost'>(),\n },\n setup(props) {\n const el = getHost();\n const slots = useSlots();\n\n const showPassword = signal(false);\n const inputRef = ref<HTMLInputElement>();\n\n const hasLabel = computed(() => !!props.label.value || slots.has('label').value);\n // `loading` behaves like a temporary `disabled` — forces the inner <input> out of\n // constraint validation and interaction for the duration, layered on top of any real\n // `loading` is layered on top of the consumer's explicit `disabled` prop.\n const isDisabled = computed(() => props.disabled.value || props.loading.value);\n\n const abortSignal = lifecycleSignal(onCleanup);\n const tf = createTextField({\n disabled: isDisabled,\n error: props.error,\n hasLabel,\n helper: props.helper,\n label: props.label,\n labelPlacement: props['label-placement'],\n maxLength: props.maxlength,\n onChange: (_event: Event, value: string) => {\n setFieldValue(el, value);\n dispatchNativeFieldEvent(el, 'change');\n },\n onInput: (_event: Event, value: string) => {\n setFieldValue(el, value);\n dispatchNativeFieldEvent(el, 'input');\n },\n prefix: 'input',\n readonly: props.readonly,\n required: props.required,\n signal: abortSignal,\n value: props.value,\n });\n\n defineFieldValue(\n el,\n () => tf.value.value,\n (value) => {\n tf.value.value = value;\n },\n );\n\n tf.attachFormField(\n useField<string>({\n disabled: tf.disabled,\n onReset: tf.reset,\n toFormValue: (v) => v,\n validationMessage: tf.validationMessage,\n validity: tf.validity,\n value: tf.value,\n }),\n );\n\n const {\n ariaDescribedBy,\n ariaErrorMessage,\n ariaInvalid,\n ariaLabelledBy,\n assistiveId,\n clear: clearValue,\n counter,\n errorId,\n errorText,\n fieldId: inputId,\n helperText,\n labelId,\n labelVisible,\n value: fieldValue,\n wire,\n } = tf;\n\n onElement(inputRef, (el) => {\n wire(el, abortSignal);\n\n const unwireRef = bindRefCallback(props.ref, el);\n\n return () => {\n unwireRef();\n };\n });\n\n const clear = (event?: Event): void => {\n clearValue(event);\n inputRef.value?.focus();\n };\n\n const resolvedInputType = (): string =>\n props.type.value === 'password' && showPassword.value ? 'text' : (props.type.value ?? 'text');\n\n bind({\n attr: {\n error: errorAttr(errorText),\n 'has-value': () => (fieldValue.value ? true : undefined),\n size: props.size,\n // Reflects `success` only once `error` is confirmed empty — keeps the two host\n // attributes mutually exclusive even if a consumer sets both props at once.\n success: () => (props.success.value && !errorText.value ? true : undefined),\n variant: props.variant,\n },\n });\n\n const labelHidden = () => !labelVisible.value;\n const passwordToggleLabel = () => (showPassword.value ? 'Hide password' : 'Show password');\n const passwordTogglePressed = () => String(showPassword.value);\n const passwordToggleIcon = () =>\n showPassword.value\n ? html`\n <ore-icon name=\"eye-off\" size=\"14\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n `\n : html`\n <ore-icon name=\"eye\" size=\"14\" stroke-width=\"2\" aria-hidden=\"true\"></ore-icon>\n `;\n const helperHidden = () => !!errorText.value || !helperText.value;\n const errorHidden = () => !errorText.value;\n const counterNearLimit = () => (counter?.value.counterNearLimit && !counter?.value.counterAtLimit ? '' : null);\n const counterAtLimit = () => (counter?.value.counterAtLimit ? '' : null);\n const counterHidden = () => !counter;\n const counterText = () => counter?.value.counterText ?? '';\n\n const clearTabIndex = () => (fieldValue.value ? '0' : '-1');\n const pwdToggleTabIndex = () => (props.type.value === 'password' ? '0' : '-1');\n\n const togglePassword = () => {\n showPassword.value = !showPassword.value;\n inputRef.value?.focus();\n };\n\n return html`\n <div class=\"input-wrapper\" part=\"wrapper\">\n <label class=\"label\" for=\"${inputId}\" id=\"${labelId}\" part=\"label\" ?hidden=\"${labelHidden}\">\n <slot name=\"label\">${props.label}</slot>\n </label>\n <div class=\"field\" part=\"field\">\n <div class=\"input-row\" part=\"input-row\">\n <slot name=\"prefix\"></slot>\n <input\n part=\"input\"\n id=\"${inputId}\"\n type=\"${resolvedInputType}\"\n name=\"${props.name}\"\n placeholder=\"${props.placeholder}\"\n autocomplete=\"${props.autocomplete}\"\n inputmode=\"${props.inputmode}\"\n maxlength=\"${props.maxlength}\"\n minlength=\"${props.minlength}\"\n pattern=\"${props.pattern}\"\n ?disabled=\"${isDisabled}\"\n ?readonly=\"${props.readonly}\"\n ?required=\"${props.required}\"\n value=\"${live(fieldValue)}\"\n aria-labelledby=\"${ariaLabelledBy}\"\n aria-describedby=\"${ariaDescribedBy}\"\n aria-errormessage=\"${ariaErrorMessage}\"\n aria-invalid=\"${ariaInvalid}\"\n aria-busy=\"${() => (props.loading.value ? 'true' : null)}\"\n ref=\"${inputRef}\" />\n <slot name=\"suffix\"></slot>\n ${renderStatusIcon(errorText)}\n <span class=\"field-spinner\" part=\"spinner\" role=\"status\" aria-label=\"Loading\"></span>\n <button\n class=\"pwd-toggle-btn\"\n part=\"pwd-toggle\"\n type=\"button\"\n aria-label=\"${passwordToggleLabel}\"\n aria-pressed=\"${passwordTogglePressed}\"\n tabindex=\"${pwdToggleTabIndex}\"\n @click=\"${togglePassword}\">\n ${passwordToggleIcon}\n </button>\n <button\n aria-label=\"Clear\"\n class=\"clear-btn\"\n part=\"clear\"\n type=\"button\"\n tabindex=\"${clearTabIndex}\"\n @click=\"${clear}\">\n <ore-icon aria-hidden=\"true\" name=\"x\" size=\"12\" stroke-width=\"2.5\"></ore-icon>\n </button>\n </div>\n </div>\n <div class=\"helper-text\" aria-live=\"polite\" id=\"${assistiveId}\" part=\"helper\" ?hidden=\"${helperHidden}\">\n <slot name=\"helper\">${() => helperText.value}</slot>\n </div>\n <div class=\"helper-text\" id=\"${errorId}\" role=\"alert\" part=\"error\" ?hidden=\"${errorHidden}\">\n <slot name=\"error\">${() => errorText.value}</slot>\n </div>\n <div\n class=\"char-counter\"\n part=\"char-counter\"\n data-near-limit=\"${counterNearLimit}\"\n data-at-limit=\"${counterAtLimit}\"\n ?hidden=\"${counterHidden}\">\n ${counterText}\n </div>\n </div>\n `;\n },\n shadow: { delegatesFocus: true },\n styles: [\n colorThemeMixin,\n coarsePointerMixin,\n reducedMotionMixin,\n roundedVariantMixin,\n disabledLoadingMixin,\n sizeVariantMixin(FIELD_SIZE_PRESET),\n forcedColorsFocusMixin('input'),\n componentStyles,\n // Must come after `componentStyles` — `@layer` precedence is fixed by which layer name is\n // *first* referenced across this whole array, and `componentStyles` is what establishes\n // `refine.base` (the unconditional `--_bg`/`--_border-color` defaults this mixin's\n // `refine.variants` rules need to win over). Placed earlier, `refine.variants` would end up\n // registered as the *lower*-priority layer, and every variant would silently render as the\n // base default — exactly the bug this ordering fixes.\n fieldVariantMixin({ container: '.field', text: 'input', tokenPrefix: 'input' }),\n ],\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AA2DA,IAAM,IAAoB;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAoEa,IAAY;AACzB,EAAsB,GAAW;CAC/B,gBAAgB;CAChB,OAAO;EACL,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,cAAc,EAAK,OAAO;EAC1B,WAAW,EAAK,KAAK,EAAK;EAC1B,OAAO,EAAK,OAAO;EACnB,WAAW,EAAK,KAAK,EAAK;EAC1B,QAAQ,EAAK,OAAO;EACpB,WAAW,EAAK,OAAqF;EACrG,OAAO,EAAK,OAAO;EACnB,mBAAmB,EAAK,MAAM,CAAC,SAAS,SAAS,GAAY,OAAO;EACpE,SAAS,EAAK,KAAK,EAAK;EACxB,WAAW,EAAK,KAAK,KAAA,CAA+B;EACpD,WAAW,EAAK,KAAK,KAAA,CAA+B;EACpD,MAAM,EAAK,OAAO;EAClB,SAAS,EAAK,OAAO;EACrB,aAAa,EAAK,OAAO;EACzB,UAAU,EAAK,KAAK,EAAK;EACzB,KAAK,EAAK,KAAqD;EAC/D,UAAU,EAAK,KAAK,EAAK;EACzB,SAAS,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E,EAAW,MAAM;;uCAEhB,EAAQ,6CAtEjB,CAAC,EAAU,MAsEyD;qCAC7D,EAAU,MAAM;;;;;mCAtEjB,GAAS,MAAM,oBAAoB,CAAC,GAAS,MAAM,iBAAiB,KAAK,KA2E/D;iCA1EZ,GAAS,MAAM,iBAAiB,KAAK,KA2E7B;2BA1EV,CAAC,EA2EE;kBA1EL,GAAS,MAAM,eAAe,GA2EpC;;;;CAItB;CACA,QAAQ,EAAE,gBAAgB,GAAK;CAC/B,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA,EAAiB,CAAiB;EAClC,EAAuB,OAAO;EAC9B;EAOA,EAAkB;GAAE,WAAW;GAAU,MAAM;GAAS,aAAa;EAAQ,CAAC;CAChF;AACF,CAAC"}
@@ -1,2 +1,2 @@
1
- var e=`@layer refine.base{:host{--_font-size:var(--input-font-size,var(--text-sm));--_gap:var(--input-gap,var(--size-2));--_field-height:var(--input-height,var(--size-10));--_padding:var(--input-padding,var(--size-1-5) var(--size-3));--_radius:var(--input-radius,var(--rounded-lg));--_placeholder:var(--input-placeholder-color,var(--color-contrast-500));--_bg:var(--input-bg,var(--color-contrast-100));--_border-color:var(--input-border-color,var(--color-contrast-300));min-width:var(--input-min-width,12rem);flex-direction:column;align-items:stretch;display:inline-flex}.input-wrapper{flex-direction:column;gap:0;width:100%;display:flex}.field{box-sizing:border-box;height:var(--_field-height);min-height:var(--_field-height);padding:var(--_padding);background:var(--_bg);border:var(--border) solid var(--_border-color);border-radius:var(--_radius);box-shadow:var(--shadow-2xs);transition:var(--_motion-transition,background var(--transition-fast), backdrop-filter var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast));flex-direction:column;justify-content:center;align-items:stretch;gap:0;display:flex}.input-wrapper:has(.label:not([hidden])) .field{height:auto}:host(:not([label-placement=outside])) .input-wrapper{position:relative}:host(:not([label-placement=outside])) .label{z-index:1;pointer-events:none;top:var(--size-2);position:absolute}:host(:not([label-placement=outside])) .label:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:var(--_padding-x,var(--size-3))}:host(:not([label-placement=outside])) .label:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:var(--_padding-x,var(--size-3))}:host(:not([label-placement=outside])) .input-wrapper:has(.label:not([hidden])) .field{padding-top:calc(var(--size-2) + 1lh + 2px)}.input-row{gap:var(--_gap);flex:1;align-items:center;display:flex}.label,label.label{text-overflow:ellipsis;font-size:var(--text-xs);font-weight:var(--font-medium);line-height:var(--leading-tight);color:var(--color-contrast-500);white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;transition:var(--_motion-transition,color var(--transition-fast));margin-bottom:2px;overflow:hidden}:host([label-placement=outside]) .label,:host([label-placement=outside]) label.label{font-size:var(--text-xs);line-height:var(--leading-loose);order:-1}.helper-text{margin-top:var(--size-1-5);font-size:var(--text-xs);line-height:var(--leading-tight);color:color-mix(in oklch, var(--color-contrast-500) 80%, var(--color-canvas));overflow-wrap:anywhere;padding-left:2px;padding-right:2px}.helper-text[hidden]{display:none}::slotted(svg){width:var(--_icon-size,var(--leading-6));height:var(--_icon-size,var(--leading-6));flex-shrink:0}}@layer refine.overrides{input{min-width:0;font:inherit;font-size:var(--_font-size);line-height:var(--leading-normal);color:var(--color-contrast-900);background:0 0;border:none;outline:none;flex:1}input::placeholder{color:var(--_placeholder);transition:color var(--transition-fast)}input:focus-visible{outline:none}:host(:not([disabled],[variant=bordered],[variant=flat])) .field:hover{border-color:var(--color-contrast-400)}:host(:not([disabled])) .field:focus-within .label,:host(:not([disabled])) .field:focus-within ::slotted([slot=prefix]),:host(:not([disabled])) .field:focus-within ::slotted([slot=suffix]){color:var(--_theme-focus)}.clear-btn{width:var(--size-5);min-width:var(--_touch-target);height:var(--size-5);min-height:var(--_touch-target);color:var(--color-contrast-500);cursor:pointer;border-radius:var(--rounded-sm);transition:var(--_motion-transition,color var(--transition-fast));background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:none}.clear-btn:hover{color:var(--color-contrast-900)}.clear-btn:focus-visible{outline:var(--border-2) solid var(--_theme-focus);outline-offset:var(--border)}:host([clearable]) .clear-btn{display:flex}:host([clearable]:not([has-value])) .clear-btn{visibility:hidden;pointer-events:none}.pwd-toggle-btn{width:var(--size-5);min-width:var(--_touch-target);height:var(--size-5);min-height:var(--_touch-target);color:var(--color-contrast-500);cursor:pointer;border-radius:var(--rounded-sm);transition:var(--_motion-transition,color var(--transition-fast));background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:none}.pwd-toggle-btn:hover{color:var(--color-contrast-900)}.pwd-toggle-btn:focus-visible{outline:var(--border-2) solid var(--_theme-focus);outline-offset:var(--border)}:host([type=password]) .pwd-toggle-btn{display:flex}.char-counter{font-size:var(--text-xs);line-height:var(--leading-tight);color:var(--color-contrast-400);white-space:nowrap;padding-left:2px;padding-right:2px}.char-counter:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){text-align:right}.char-counter:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){text-align:left}.char-counter[data-near-limit]{color:var(--color-warning,#f59e0b)}.char-counter[data-at-limit]{color:var(--color-error)}:host([error]:not([error=""])) .field{border-color:var(--color-error)}:host([error]:not([error=""])) .label,.helper-text[role=alert]{color:var(--color-error)}:host([success]) .field{border-color:var(--color-success)}.status-icon{width:var(--size-5);height:var(--size-5);flex-shrink:0;justify-content:center;align-items:center;display:none}:host([error]:not([error=""])) .status-icon,:host([success]) .status-icon{display:flex}.status-icon[data-status=error]{color:var(--color-error)}.status-icon[data-status=success]{color:var(--color-success)}@keyframes spin{to{transform:rotate(360deg)}}.field-spinner{width:var(--size-4);height:var(--size-4);border:var(--border-2) solid var(--_theme-focus,currentcolor);animation:var(--_motion-animation,spin var(--transition-loader) infinite);border-radius:50%;flex-shrink:0;display:none}.field-spinner:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-right-color:#0000}.field-spinner:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-left-color:#0000}:host([loading]) .field-spinner{display:inline-block}}@layer refine.variants{:host([variant=text]){--_bg:var(--input-bg,transparent);--_border-color:var(--input-border-color,var(--color-contrast-300))}:host([variant=text]) .field{border:none;border-bottom:var(--border) solid var(--_border-color);box-shadow:none;border-radius:0}:host([variant=text]) .field:focus-within{border-bottom:var(--border-2) solid var(--input-focus-border-color,var(--_theme-focus))}:host(:not([disabled],[variant=text],[variant=flat])) .field:focus-within{background:var(--color-canvas);border-color:var(--_theme-focus);box-shadow:var(--_theme-shadow,var(--color-primary-focus-shadow))}:host([error]:not([error=""])) .field:focus-within{border-color:var(--color-error);box-shadow:var(--color-error-focus-shadow)}:host([success]) .field:focus-within{border-color:var(--color-success);box-shadow:var(--color-success-focus-shadow)}}@layer refine.utilities{:host([fullwidth]){width:100%}}:host([disabled]){opacity:1}:host([disabled]) .field{background:var(--color-contrast-100);border-color:var(--color-contrast-200);box-shadow:none}:host([disabled]) input{color:var(--color-contrast-400)}:host([disabled]) input::placeholder{color:var(--color-contrast-300)}:host([disabled]) .label{color:var(--color-contrast-400)}`;exports.default=e;
1
+ var e=`@layer refine.base{:host{--_font-size:var(--input-font-size,var(--text-sm));--_gap:var(--input-gap,var(--size-2));--_field-height:var(--input-height,var(--size-10));--_padding:var(--input-padding,var(--size-1-5) var(--size-3));--_label-block-inset:var(--input-label-block-inset,var(--size-2));--_label-inset:var(--input-label-inset,var(--size-3));--_radius:var(--input-radius,var(--rounded-lg));--_placeholder:var(--input-placeholder-color,var(--color-contrast-500));--_bg:var(--input-bg,var(--color-contrast-100));--_border-color:var(--input-border-color,var(--color-contrast-300));min-width:var(--input-min-width,12rem);flex-direction:column;align-items:stretch;display:inline-flex}.input-wrapper{flex-direction:column;gap:0;width:100%;display:flex}.field{box-sizing:border-box;height:var(--_field-height);min-height:var(--_field-height);padding:var(--_padding);background:var(--_bg);border:var(--border) solid var(--_border-color);border-radius:var(--_radius);box-shadow:var(--shadow-2xs);transition:var(--_motion-transition,background var(--transition-fast), backdrop-filter var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast));flex-direction:column;justify-content:center;align-items:stretch;gap:0;display:flex}.input-wrapper:has(.label:not([hidden])) .field{height:auto}:host(:not([label-placement=outside])) .input-wrapper{position:relative}:host(:not([label-placement=outside])) .label{z-index:1;pointer-events:none;top:var(--_label-block-inset);position:absolute}:host(:not([label-placement=outside])) .label:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:var(--_label-inset)}:host(:not([label-placement=outside])) .label:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:var(--_label-inset)}:host(:not([label-placement=outside])) .input-wrapper:has(.label:not([hidden])) .field{padding-top:calc(var(--_label-block-inset) + 1lh + 2px)}.input-row{gap:var(--_gap);flex:1;align-items:center;display:flex}.label,label.label{text-overflow:ellipsis;font-size:var(--text-xs);font-weight:var(--font-medium);line-height:var(--leading-tight);color:var(--color-contrast-500);white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;transition:var(--_motion-transition,color var(--transition-fast));margin-bottom:2px;overflow:hidden}:host([label-placement=outside]) .label,:host([label-placement=outside]) label.label{font-size:var(--text-xs);line-height:var(--leading-loose);order:-1}.helper-text{margin-top:var(--size-1-5);font-size:var(--text-xs);line-height:var(--leading-tight);color:color-mix(in oklch, var(--color-contrast-500) 80%, var(--color-canvas));overflow-wrap:anywhere;padding-left:2px;padding-right:2px}.helper-text[hidden]{display:none}::slotted(svg){width:var(--_icon-size,var(--leading-6));height:var(--_icon-size,var(--leading-6));flex-shrink:0}}@layer refine.overrides{input{min-width:0;font:inherit;font-size:var(--_font-size);line-height:var(--leading-normal);color:var(--color-contrast-900);background:0 0;border:none;outline:none;flex:1}input::placeholder{color:var(--_placeholder);transition:color var(--transition-fast)}input:focus-visible{outline:none}:host(:not([disabled],[variant=bordered],[variant=flat])) .field:hover{border-color:var(--color-contrast-400)}:host(:not([disabled])) .field:focus-within .label,:host(:not([disabled])) .field:focus-within ::slotted([slot=prefix]),:host(:not([disabled])) .field:focus-within ::slotted([slot=suffix]){color:var(--_theme-focus)}.clear-btn{width:var(--size-5);min-width:var(--_touch-target);height:var(--size-5);min-height:var(--_touch-target);color:var(--color-contrast-500);cursor:pointer;border-radius:var(--rounded-sm);transition:var(--_motion-transition,color var(--transition-fast));background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:none}.clear-btn:hover{color:var(--color-contrast-900)}.clear-btn:focus-visible{outline:var(--border-2) solid var(--_theme-focus);outline-offset:var(--border)}:host([clearable]) .clear-btn{display:flex}:host([clearable]:not([has-value])) .clear-btn{visibility:hidden;pointer-events:none}.pwd-toggle-btn{width:var(--size-5);min-width:var(--_touch-target);height:var(--size-5);min-height:var(--_touch-target);color:var(--color-contrast-500);cursor:pointer;border-radius:var(--rounded-sm);transition:var(--_motion-transition,color var(--transition-fast));background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:none}.pwd-toggle-btn:hover{color:var(--color-contrast-900)}.pwd-toggle-btn:focus-visible{outline:var(--border-2) solid var(--_theme-focus);outline-offset:var(--border)}:host([type=password]) .pwd-toggle-btn{display:flex}.char-counter{font-size:var(--text-xs);line-height:var(--leading-tight);color:var(--color-contrast-400);white-space:nowrap;padding-left:2px;padding-right:2px}.char-counter:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){text-align:right}.char-counter:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){text-align:left}.char-counter[data-near-limit]{color:var(--color-warning,#f59e0b)}.char-counter[data-at-limit]{color:var(--color-error)}:host([error]:not([error=""])) .field{border-color:var(--color-error)}:host([error]:not([error=""])) .label,.helper-text[role=alert]{color:var(--color-error)}:host([success]) .field{border-color:var(--color-success)}.status-icon{width:var(--size-5);height:var(--size-5);flex-shrink:0;justify-content:center;align-items:center;display:none}:host([error]:not([error=""])) .status-icon,:host([success]) .status-icon{display:flex}.status-icon[data-status=error]{color:var(--color-error)}.status-icon[data-status=success]{color:var(--color-success)}@keyframes spin{to{transform:rotate(360deg)}}.field-spinner{width:var(--size-4);height:var(--size-4);border:var(--border-2) solid var(--_theme-focus,currentcolor);animation:var(--_motion-animation,spin var(--transition-loader) infinite);border-radius:50%;flex-shrink:0;display:none}.field-spinner:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-right-color:#0000}.field-spinner:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-left-color:#0000}:host([loading]) .field-spinner{display:inline-block}}@layer refine.variants{:host([variant=text]){--_bg:var(--input-bg,transparent);--_border-color:var(--input-border-color,var(--color-contrast-300))}:host([variant=text]) .field{box-shadow:none;background:0 0;border:none;border-radius:0}:host([variant=text]) .field:focus-within{box-shadow:none}:host(:not([disabled],[variant=text],[variant=flat])) .field:focus-within{background:var(--color-canvas);border-color:var(--_theme-focus);box-shadow:var(--_theme-shadow,var(--color-primary-focus-shadow))}:host([error]:not([error=""])) .field:focus-within{border-color:var(--color-error);box-shadow:var(--color-error-focus-shadow)}:host([success]) .field:focus-within{border-color:var(--color-success);box-shadow:var(--color-success-focus-shadow)}}@layer refine.utilities{:host([fullwidth]){width:100%}}:host([disabled]){opacity:1}:host([disabled]) .field{background:var(--color-contrast-100);border-color:var(--color-contrast-200);box-shadow:none}:host([disabled]) input{color:var(--color-contrast-400)}:host([disabled]) input::placeholder{color:var(--color-contrast-300)}:host([disabled]) .label{color:var(--color-contrast-400)}`;exports.default=e;
2
2
  //# sourceMappingURL=input.css.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.css.cjs","names":[],"sources":["../../../src/inputs/input/input.css?inline"],"sourcesContent":["@layer refine.base {\n /* ========================================\n Base Styles & Defaults\n ======================================== */\n\n :host {\n --_font-size: var(--input-font-size, var(--text-sm));\n --_gap: var(--input-gap, var(--size-2));\n --_field-height: var(--input-height, var(--size-10));\n --_padding: var(--input-padding, var(--size-1-5) var(--size-3));\n --_radius: var(--input-radius, var(--rounded-lg));\n --_placeholder: var(--input-placeholder-color, var(--color-contrast-500));\n --_bg: var(--input-bg, var(--color-contrast-100));\n --_border-color: var(--input-border-color, var(--color-contrast-300));\n\n display: inline-flex;\n flex-direction: column;\n align-items: stretch;\n min-width: var(--input-min-width, 12rem);\n }\n\n .input-wrapper {\n display: flex;\n flex-direction: column;\n gap: 0;\n width: 100%;\n }\n\n .field {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: 0;\n align-items: stretch;\n justify-content: center;\n height: var(--_field-height);\n min-height: var(--_field-height);\n padding: var(--_padding);\n background: var(--_bg);\n border: var(--border) solid var(--_border-color);\n border-radius: var(--_radius);\n box-shadow: var(--shadow-2xs);\n transition: var(\n --_motion-transition,\n background var(--transition-fast),\n backdrop-filter var(--transition-fast),\n border-color var(--transition-fast),\n box-shadow var(--transition-fast)\n );\n }\n\n /* Expand height to fit inset label + input row */\n .input-wrapper:has(.label:not([hidden])) .field {\n height: auto;\n }\n\n /* Outside placement: label is above the field (natural flow) */\n\n /* Inset placement (default): label appears inside the field border */\n :host(:not([label-placement='outside'])) .input-wrapper {\n position: relative;\n }\n\n :host(:not([label-placement='outside'])) .label {\n position: absolute;\n inset-block-start: var(--size-2);\n inset-inline-start: var(--_padding-x, var(--size-3));\n z-index: 1;\n pointer-events: none;\n }\n\n :host(:not([label-placement='outside'])) .input-wrapper:has(.label:not([hidden])) .field {\n padding-block-start: calc(var(--size-2) + 1lh + 2px);\n }\n\n .input-row {\n display: flex;\n flex: 1;\n gap: var(--_gap);\n align-items: center;\n }\n\n /* ========================================\n Label Styles\n ======================================== */\n\n .label,\n label.label {\n margin-bottom: 2px;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--text-xs);\n font-weight: var(--font-medium);\n line-height: var(--leading-tight);\n color: var(--color-contrast-500);\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n transition: var(--_motion-transition, color var(--transition-fast));\n }\n\n /* Outside placement: label moves outside the field via CSS */\n :host([label-placement='outside']) .label,\n :host([label-placement='outside']) label.label {\n order: -1;\n font-size: var(--text-xs);\n line-height: var(--leading-loose);\n }\n\n /* ========================================\n Helper Text\n ======================================== */\n\n .helper-text {\n padding-inline: 2px;\n margin-top: var(--size-1-5);\n font-size: var(--text-xs);\n line-height: var(--leading-tight);\n color: color-mix(in oklch, var(--color-contrast-500) 80%, var(--color-canvas));\n overflow-wrap: anywhere;\n }\n\n .helper-text[hidden] {\n display: none;\n }\n\n /* ========================================\n Slotted Prefix/Suffix Icons\n ======================================== */\n\n ::slotted(svg) {\n flex-shrink: 0;\n width: var(--_icon-size, var(--leading-6));\n height: var(--_icon-size, var(--leading-6));\n }\n}\n\n@layer refine.overrides {\n /* ========================================\n Input Element\n ======================================== */\n\n input {\n flex: 1;\n min-width: 0;\n font: inherit;\n font-size: var(--_font-size);\n line-height: var(--leading-normal);\n\n /* No all: unset needed - reset layer handles it */\n color: var(--color-contrast-900);\n outline: none;\n background: transparent;\n border: none;\n }\n\n input::placeholder {\n color: var(--_placeholder);\n transition: color var(--transition-fast);\n }\n\n input:focus-visible {\n outline: none;\n }\n\n /* ========================================\n Hover & Focus States\n ======================================== */\n\n :host(:not([disabled], [variant='bordered'], [variant='flat'])) .field:hover {\n border-color: var(--color-contrast-400);\n }\n\n :host(:not([disabled])) .field:focus-within .label {\n color: var(--_theme-focus);\n }\n\n :host(:not([disabled])) .field:focus-within ::slotted([slot='prefix']),\n :host(:not([disabled])) .field:focus-within ::slotted([slot='suffix']) {\n color: var(--_theme-focus);\n }\n\n /* ========================================\n Clear button\n ======================================== */\n\n .clear-btn {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--size-5);\n min-width: var(--_touch-target);\n height: var(--size-5);\n min-height: var(--_touch-target);\n padding: 0;\n color: var(--color-contrast-500);\n cursor: pointer;\n background: transparent;\n border: none;\n border-radius: var(--rounded-sm);\n transition: var(--_motion-transition, color var(--transition-fast));\n }\n\n .clear-btn:hover {\n color: var(--color-contrast-900);\n }\n\n .clear-btn:focus-visible {\n outline: var(--border-2) solid var(--_theme-focus);\n outline-offset: var(--border);\n }\n\n :host([clearable]) .clear-btn {\n display: flex;\n }\n\n :host([clearable]:not([has-value])) .clear-btn {\n visibility: hidden;\n pointer-events: none;\n }\n\n /* ========================================\n Password visibility toggle\n ======================================== */\n\n .pwd-toggle-btn {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--size-5);\n min-width: var(--_touch-target);\n height: var(--size-5);\n min-height: var(--_touch-target);\n padding: 0;\n color: var(--color-contrast-500);\n cursor: pointer;\n background: transparent;\n border: none;\n border-radius: var(--rounded-sm);\n transition: var(--_motion-transition, color var(--transition-fast));\n }\n\n .pwd-toggle-btn:hover {\n color: var(--color-contrast-900);\n }\n\n .pwd-toggle-btn:focus-visible {\n outline: var(--border-2) solid var(--_theme-focus);\n outline-offset: var(--border);\n }\n\n :host([type='password']) .pwd-toggle-btn {\n display: flex;\n }\n\n /* ========================================\n Character counter\n ======================================== */\n\n .char-counter {\n padding-inline: 2px;\n font-size: var(--text-xs);\n line-height: var(--leading-tight);\n color: var(--color-contrast-400);\n text-align: end;\n white-space: nowrap;\n }\n\n .char-counter[data-near-limit] {\n color: var(--color-warning, #f59e0b);\n }\n\n .char-counter[data-at-limit] {\n color: var(--color-error);\n }\n\n /* ========================================\n Error State\n ======================================== */\n\n :host([error]:not([error=''])) .field {\n border-color: var(--color-error);\n }\n\n :host([error]:not([error=''])) .label {\n color: var(--color-error);\n }\n\n .helper-text[role='alert'] {\n color: var(--color-error);\n }\n\n /* ========================================\n Success State (Signal 04)\n ======================================== */\n\n :host([success]) .field {\n border-color: var(--color-success);\n }\n\n /* ========================================\n Status Icon (Signals 03/04: error/success — never color alone)\n ======================================== */\n\n .status-icon {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--size-5);\n height: var(--size-5);\n }\n\n :host([error]:not([error=''])) .status-icon,\n :host([success]) .status-icon {\n display: flex;\n }\n\n .status-icon[data-status='error'] {\n color: var(--color-error);\n }\n\n .status-icon[data-status='success'] {\n color: var(--color-success);\n }\n\n /* ========================================\n Loading Spinner (Signal 06)\n ======================================== */\n\n /* Keyframe must live in shadow DOM — @keyframes don't inherit across shadow roots */\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .field-spinner {\n display: none;\n flex-shrink: 0;\n width: var(--size-4);\n height: var(--size-4);\n border: var(--border-2) solid var(--_theme-focus, currentcolor);\n border-inline-end-color: transparent;\n border-radius: 50%;\n animation: var(--_motion-animation, spin var(--transition-loader) infinite);\n }\n\n :host([loading]) .field-spinner {\n display: inline-block;\n }\n}\n\n/*\n * The solid/flat/bordered/outline/ghost variant switch (previously here) now lives in\n * `fieldVariantMixin({ container: '.field', tokenPrefix: 'input' })` in `input.ts`'s `styles`\n * array — shared with `ore-textarea`/`ore-message-composer` instead of hand-duplicated across\n * all three (see the mixin's own doc comment for what it covers and why). `ore-input`'s extra\n * `text` variant (below) is not part of that shared set, so it keeps its own block here.\n */\n@layer refine.variants {\n /* Text — underline style */\n :host([variant='text']) {\n --_bg: var(--input-bg, transparent);\n --_border-color: var(--input-border-color, var(--color-contrast-300));\n }\n\n :host([variant='text']) .field {\n border: none;\n border-bottom: var(--border) solid var(--_border-color);\n border-radius: 0;\n box-shadow: none;\n }\n\n :host([variant='text']) .field:focus-within {\n border-bottom: var(--border-2) solid var(--input-focus-border-color, var(--_theme-focus));\n }\n\n /*\n * Focus/error/success `box-shadow` on `.field` — kept here in `refine.variants` (alongside\n * `fieldVariantMixin`'s rest-state `box-shadow` for solid/outline/ghost) rather than\n * `refine.overrides`, so normal specificity decides the winner. Cascade layers beat\n * specificity outright, so a `refine.overrides` box-shadow always lost to every variant's\n * unconditional rest-state `box-shadow`, focused/error/success or not — the same bug class\n * fixed for `ore-otp-input`'s focus ring.\n */\n :host(:not([disabled], [variant='text'], [variant='flat'])) .field:focus-within {\n background: var(--color-canvas);\n border-color: var(--_theme-focus);\n box-shadow: var(--_theme-shadow, var(--color-primary-focus-shadow));\n }\n\n :host([error]:not([error=''])) .field:focus-within {\n border-color: var(--color-error);\n box-shadow: var(--color-error-focus-shadow);\n }\n\n :host([success]) .field:focus-within {\n border-color: var(--color-success);\n box-shadow: var(--color-success-focus-shadow);\n }\n}\n\n@layer refine.utilities {\n /* Full width */\n :host([fullwidth]) {\n width: 100%;\n }\n}\n\n/* ========================================\n Disabled State (Signal 05) — intentionally unlayered\n ======================================== */\n\n/*\n * The shared `disabledLoadingMixin` (pulled in via `fieldMixins`) dims `:host([disabled])`\n * with `opacity: 0.5` as bare, unlayered CSS. Cascade layers always lose to unlayered rules\n * regardless of source order or specificity, so overriding that from inside any `@layer`\n * block in this file (including `refine.overrides`) would be a no-op — this has to stay\n * unlayered too, to actually win.\n *\n * Per the field-state UX review: opacity-based dimming reads as a washed-out/loading look\n * and can mimic reduced-contrast content for low-vision users, rather than a clearly locked\n * field. Swapped for an explicit grayscale surface + `not-allowed` cursor (the cursor already\n * comes from the shared mixin, left untouched here).\n */\n:host([disabled]) {\n opacity: 1;\n}\n\n:host([disabled]) .field {\n background: var(--color-contrast-100);\n border-color: var(--color-contrast-200);\n box-shadow: none;\n}\n\n:host([disabled]) input {\n color: var(--color-contrast-400);\n}\n\n:host([disabled]) input::placeholder {\n color: var(--color-contrast-300);\n}\n\n:host([disabled]) .label {\n color: var(--color-contrast-400);\n}\n"],"mappings":""}
1
+ {"version":3,"file":"input.css.cjs","names":[],"sources":["../../../src/inputs/input/input.css?inline"],"sourcesContent":["@layer refine.base {\n /* ========================================\n Base Styles & Defaults\n ======================================== */\n\n :host {\n --_font-size: var(--input-font-size, var(--text-sm));\n --_gap: var(--input-gap, var(--size-2));\n --_field-height: var(--input-height, var(--size-10));\n --_padding: var(--input-padding, var(--size-1-5) var(--size-3));\n --_label-block-inset: var(--input-label-block-inset, var(--size-2));\n --_label-inset: var(--input-label-inset, var(--size-3));\n --_radius: var(--input-radius, var(--rounded-lg));\n --_placeholder: var(--input-placeholder-color, var(--color-contrast-500));\n --_bg: var(--input-bg, var(--color-contrast-100));\n --_border-color: var(--input-border-color, var(--color-contrast-300));\n\n display: inline-flex;\n flex-direction: column;\n align-items: stretch;\n min-width: var(--input-min-width, 12rem);\n }\n\n .input-wrapper {\n display: flex;\n flex-direction: column;\n gap: 0;\n width: 100%;\n }\n\n .field {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: 0;\n align-items: stretch;\n justify-content: center;\n height: var(--_field-height);\n min-height: var(--_field-height);\n padding: var(--_padding);\n background: var(--_bg);\n border: var(--border) solid var(--_border-color);\n border-radius: var(--_radius);\n box-shadow: var(--shadow-2xs);\n transition: var(\n --_motion-transition,\n background var(--transition-fast),\n backdrop-filter var(--transition-fast),\n border-color var(--transition-fast),\n box-shadow var(--transition-fast)\n );\n }\n\n /* Expand height to fit inset label + input row */\n .input-wrapper:has(.label:not([hidden])) .field {\n height: auto;\n }\n\n /* Outside placement: label is above the field (natural flow) */\n\n /* Inset placement (default): label appears inside the field border */\n :host(:not([label-placement='outside'])) .input-wrapper {\n position: relative;\n }\n\n :host(:not([label-placement='outside'])) .label {\n position: absolute;\n inset-block-start: var(--_label-block-inset);\n inset-inline-start: var(--_label-inset);\n z-index: 1;\n pointer-events: none;\n }\n\n :host(:not([label-placement='outside'])) .input-wrapper:has(.label:not([hidden])) .field {\n padding-block-start: calc(var(--_label-block-inset) + 1lh + 2px);\n }\n\n .input-row {\n display: flex;\n flex: 1;\n gap: var(--_gap);\n align-items: center;\n }\n\n /* ========================================\n Label Styles\n ======================================== */\n\n .label,\n label.label {\n margin-bottom: 2px;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--text-xs);\n font-weight: var(--font-medium);\n line-height: var(--leading-tight);\n color: var(--color-contrast-500);\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n transition: var(--_motion-transition, color var(--transition-fast));\n }\n\n /* Outside placement: label moves outside the field via CSS */\n :host([label-placement='outside']) .label,\n :host([label-placement='outside']) label.label {\n order: -1;\n font-size: var(--text-xs);\n line-height: var(--leading-loose);\n }\n\n /* ========================================\n Helper Text\n ======================================== */\n\n .helper-text {\n padding-inline: 2px;\n margin-top: var(--size-1-5);\n font-size: var(--text-xs);\n line-height: var(--leading-tight);\n color: color-mix(in oklch, var(--color-contrast-500) 80%, var(--color-canvas));\n overflow-wrap: anywhere;\n }\n\n .helper-text[hidden] {\n display: none;\n }\n\n /* ========================================\n Slotted Prefix/Suffix Icons\n ======================================== */\n\n ::slotted(svg) {\n flex-shrink: 0;\n width: var(--_icon-size, var(--leading-6));\n height: var(--_icon-size, var(--leading-6));\n }\n}\n\n@layer refine.overrides {\n /* ========================================\n Input Element\n ======================================== */\n\n input {\n flex: 1;\n min-width: 0;\n font: inherit;\n font-size: var(--_font-size);\n line-height: var(--leading-normal);\n\n /* No all: unset needed - reset layer handles it */\n color: var(--color-contrast-900);\n outline: none;\n background: transparent;\n border: none;\n }\n\n input::placeholder {\n color: var(--_placeholder);\n transition: color var(--transition-fast);\n }\n\n input:focus-visible {\n outline: none;\n }\n\n /* ========================================\n Hover & Focus States\n ======================================== */\n\n :host(:not([disabled], [variant='bordered'], [variant='flat'])) .field:hover {\n border-color: var(--color-contrast-400);\n }\n\n :host(:not([disabled])) .field:focus-within .label {\n color: var(--_theme-focus);\n }\n\n :host(:not([disabled])) .field:focus-within ::slotted([slot='prefix']),\n :host(:not([disabled])) .field:focus-within ::slotted([slot='suffix']) {\n color: var(--_theme-focus);\n }\n\n /* ========================================\n Clear button\n ======================================== */\n\n .clear-btn {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--size-5);\n min-width: var(--_touch-target);\n height: var(--size-5);\n min-height: var(--_touch-target);\n padding: 0;\n color: var(--color-contrast-500);\n cursor: pointer;\n background: transparent;\n border: none;\n border-radius: var(--rounded-sm);\n transition: var(--_motion-transition, color var(--transition-fast));\n }\n\n .clear-btn:hover {\n color: var(--color-contrast-900);\n }\n\n .clear-btn:focus-visible {\n outline: var(--border-2) solid var(--_theme-focus);\n outline-offset: var(--border);\n }\n\n :host([clearable]) .clear-btn {\n display: flex;\n }\n\n :host([clearable]:not([has-value])) .clear-btn {\n visibility: hidden;\n pointer-events: none;\n }\n\n /* ========================================\n Password visibility toggle\n ======================================== */\n\n .pwd-toggle-btn {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--size-5);\n min-width: var(--_touch-target);\n height: var(--size-5);\n min-height: var(--_touch-target);\n padding: 0;\n color: var(--color-contrast-500);\n cursor: pointer;\n background: transparent;\n border: none;\n border-radius: var(--rounded-sm);\n transition: var(--_motion-transition, color var(--transition-fast));\n }\n\n .pwd-toggle-btn:hover {\n color: var(--color-contrast-900);\n }\n\n .pwd-toggle-btn:focus-visible {\n outline: var(--border-2) solid var(--_theme-focus);\n outline-offset: var(--border);\n }\n\n :host([type='password']) .pwd-toggle-btn {\n display: flex;\n }\n\n /* ========================================\n Character counter\n ======================================== */\n\n .char-counter {\n padding-inline: 2px;\n font-size: var(--text-xs);\n line-height: var(--leading-tight);\n color: var(--color-contrast-400);\n text-align: end;\n white-space: nowrap;\n }\n\n .char-counter[data-near-limit] {\n color: var(--color-warning, #f59e0b);\n }\n\n .char-counter[data-at-limit] {\n color: var(--color-error);\n }\n\n /* ========================================\n Error State\n ======================================== */\n\n :host([error]:not([error=''])) .field {\n border-color: var(--color-error);\n }\n\n :host([error]:not([error=''])) .label {\n color: var(--color-error);\n }\n\n .helper-text[role='alert'] {\n color: var(--color-error);\n }\n\n /* ========================================\n Success State (Signal 04)\n ======================================== */\n\n :host([success]) .field {\n border-color: var(--color-success);\n }\n\n /* ========================================\n Status Icon (Signals 03/04: error/success — never color alone)\n ======================================== */\n\n .status-icon {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--size-5);\n height: var(--size-5);\n }\n\n :host([error]:not([error=''])) .status-icon,\n :host([success]) .status-icon {\n display: flex;\n }\n\n .status-icon[data-status='error'] {\n color: var(--color-error);\n }\n\n .status-icon[data-status='success'] {\n color: var(--color-success);\n }\n\n /* ========================================\n Loading Spinner (Signal 06)\n ======================================== */\n\n /* Keyframe must live in shadow DOM — @keyframes don't inherit across shadow roots */\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .field-spinner {\n display: none;\n flex-shrink: 0;\n width: var(--size-4);\n height: var(--size-4);\n border: var(--border-2) solid var(--_theme-focus, currentcolor);\n border-inline-end-color: transparent;\n border-radius: 50%;\n animation: var(--_motion-animation, spin var(--transition-loader) infinite);\n }\n\n :host([loading]) .field-spinner {\n display: inline-block;\n }\n}\n\n/*\n * The solid/flat/bordered/outline/ghost variant switch (previously here) now lives in\n * `fieldVariantMixin({ container: '.field', tokenPrefix: 'input' })` in `input.ts`'s `styles`\n * array — shared with `ore-textarea`/`ore-message-composer` instead of hand-duplicated across\n * all three (see the mixin's own doc comment for what it covers and why). `ore-input`'s extra\n * `text` variant (below) is not part of that shared set, so it keeps its own block here.\n */\n@layer refine.variants {\n /* Text — underline style */\n :host([variant='text']) {\n --_bg: var(--input-bg, transparent);\n --_border-color: var(--input-border-color, var(--color-contrast-300));\n }\n\n :host([variant='text']) .field {\n background: transparent;\n border: none;\n border-radius: 0;\n box-shadow: none;\n }\n\n :host([variant='text']) .field:focus-within {\n box-shadow: none;\n }\n\n /*\n * Focus/error/success `box-shadow` on `.field` — kept here in `refine.variants` (alongside\n * `fieldVariantMixin`'s rest-state `box-shadow` for solid/outline/ghost) rather than\n * `refine.overrides`, so normal specificity decides the winner. Cascade layers beat\n * specificity outright, so a `refine.overrides` box-shadow always lost to every variant's\n * unconditional rest-state `box-shadow`, focused/error/success or not — the same bug class\n * fixed for `ore-otp-input`'s focus ring.\n */\n :host(:not([disabled], [variant='text'], [variant='flat'])) .field:focus-within {\n background: var(--color-canvas);\n border-color: var(--_theme-focus);\n box-shadow: var(--_theme-shadow, var(--color-primary-focus-shadow));\n }\n\n :host([error]:not([error=''])) .field:focus-within {\n border-color: var(--color-error);\n box-shadow: var(--color-error-focus-shadow);\n }\n\n :host([success]) .field:focus-within {\n border-color: var(--color-success);\n box-shadow: var(--color-success-focus-shadow);\n }\n}\n\n@layer refine.utilities {\n /* Full width */\n :host([fullwidth]) {\n width: 100%;\n }\n}\n\n/* ========================================\n Disabled State (Signal 05) — intentionally unlayered\n ======================================== */\n\n/*\n * The shared `disabledLoadingMixin` (pulled in via `fieldMixins`) dims `:host([disabled])`\n * with `opacity: 0.5` as bare, unlayered CSS. Cascade layers always lose to unlayered rules\n * regardless of source order or specificity, so overriding that from inside any `@layer`\n * block in this file (including `refine.overrides`) would be a no-op — this has to stay\n * unlayered too, to actually win.\n *\n * Per the field-state UX review: opacity-based dimming reads as a washed-out/loading look\n * and can mimic reduced-contrast content for low-vision users, rather than a clearly locked\n * field. Swapped for an explicit grayscale surface + `not-allowed` cursor (the cursor already\n * comes from the shared mixin, left untouched here).\n */\n:host([disabled]) {\n opacity: 1;\n}\n\n:host([disabled]) .field {\n background: var(--color-contrast-100);\n border-color: var(--color-contrast-200);\n box-shadow: none;\n}\n\n:host([disabled]) input {\n color: var(--color-contrast-400);\n}\n\n:host([disabled]) input::placeholder {\n color: var(--color-contrast-300);\n}\n\n:host([disabled]) .label {\n color: var(--color-contrast-400);\n}\n"],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  //#region src/inputs/input/input.css?inline
2
- var e = "@layer refine.base{:host{--_font-size:var(--input-font-size,var(--text-sm));--_gap:var(--input-gap,var(--size-2));--_field-height:var(--input-height,var(--size-10));--_padding:var(--input-padding,var(--size-1-5) var(--size-3));--_radius:var(--input-radius,var(--rounded-lg));--_placeholder:var(--input-placeholder-color,var(--color-contrast-500));--_bg:var(--input-bg,var(--color-contrast-100));--_border-color:var(--input-border-color,var(--color-contrast-300));min-width:var(--input-min-width,12rem);flex-direction:column;align-items:stretch;display:inline-flex}.input-wrapper{flex-direction:column;gap:0;width:100%;display:flex}.field{box-sizing:border-box;height:var(--_field-height);min-height:var(--_field-height);padding:var(--_padding);background:var(--_bg);border:var(--border) solid var(--_border-color);border-radius:var(--_radius);box-shadow:var(--shadow-2xs);transition:var(--_motion-transition,background var(--transition-fast), backdrop-filter var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast));flex-direction:column;justify-content:center;align-items:stretch;gap:0;display:flex}.input-wrapper:has(.label:not([hidden])) .field{height:auto}:host(:not([label-placement=outside])) .input-wrapper{position:relative}:host(:not([label-placement=outside])) .label{z-index:1;pointer-events:none;top:var(--size-2);position:absolute}:host(:not([label-placement=outside])) .label:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:var(--_padding-x,var(--size-3))}:host(:not([label-placement=outside])) .label:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:var(--_padding-x,var(--size-3))}:host(:not([label-placement=outside])) .input-wrapper:has(.label:not([hidden])) .field{padding-top:calc(var(--size-2) + 1lh + 2px)}.input-row{gap:var(--_gap);flex:1;align-items:center;display:flex}.label,label.label{text-overflow:ellipsis;font-size:var(--text-xs);font-weight:var(--font-medium);line-height:var(--leading-tight);color:var(--color-contrast-500);white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;transition:var(--_motion-transition,color var(--transition-fast));margin-bottom:2px;overflow:hidden}:host([label-placement=outside]) .label,:host([label-placement=outside]) label.label{font-size:var(--text-xs);line-height:var(--leading-loose);order:-1}.helper-text{margin-top:var(--size-1-5);font-size:var(--text-xs);line-height:var(--leading-tight);color:color-mix(in oklch, var(--color-contrast-500) 80%, var(--color-canvas));overflow-wrap:anywhere;padding-left:2px;padding-right:2px}.helper-text[hidden]{display:none}::slotted(svg){width:var(--_icon-size,var(--leading-6));height:var(--_icon-size,var(--leading-6));flex-shrink:0}}@layer refine.overrides{input{min-width:0;font:inherit;font-size:var(--_font-size);line-height:var(--leading-normal);color:var(--color-contrast-900);background:0 0;border:none;outline:none;flex:1}input::placeholder{color:var(--_placeholder);transition:color var(--transition-fast)}input:focus-visible{outline:none}:host(:not([disabled],[variant=bordered],[variant=flat])) .field:hover{border-color:var(--color-contrast-400)}:host(:not([disabled])) .field:focus-within .label,:host(:not([disabled])) .field:focus-within ::slotted([slot=prefix]),:host(:not([disabled])) .field:focus-within ::slotted([slot=suffix]){color:var(--_theme-focus)}.clear-btn{width:var(--size-5);min-width:var(--_touch-target);height:var(--size-5);min-height:var(--_touch-target);color:var(--color-contrast-500);cursor:pointer;border-radius:var(--rounded-sm);transition:var(--_motion-transition,color var(--transition-fast));background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:none}.clear-btn:hover{color:var(--color-contrast-900)}.clear-btn:focus-visible{outline:var(--border-2) solid var(--_theme-focus);outline-offset:var(--border)}:host([clearable]) .clear-btn{display:flex}:host([clearable]:not([has-value])) .clear-btn{visibility:hidden;pointer-events:none}.pwd-toggle-btn{width:var(--size-5);min-width:var(--_touch-target);height:var(--size-5);min-height:var(--_touch-target);color:var(--color-contrast-500);cursor:pointer;border-radius:var(--rounded-sm);transition:var(--_motion-transition,color var(--transition-fast));background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:none}.pwd-toggle-btn:hover{color:var(--color-contrast-900)}.pwd-toggle-btn:focus-visible{outline:var(--border-2) solid var(--_theme-focus);outline-offset:var(--border)}:host([type=password]) .pwd-toggle-btn{display:flex}.char-counter{font-size:var(--text-xs);line-height:var(--leading-tight);color:var(--color-contrast-400);white-space:nowrap;padding-left:2px;padding-right:2px}.char-counter:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){text-align:right}.char-counter:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){text-align:left}.char-counter[data-near-limit]{color:var(--color-warning,#f59e0b)}.char-counter[data-at-limit]{color:var(--color-error)}:host([error]:not([error=\"\"])) .field{border-color:var(--color-error)}:host([error]:not([error=\"\"])) .label,.helper-text[role=alert]{color:var(--color-error)}:host([success]) .field{border-color:var(--color-success)}.status-icon{width:var(--size-5);height:var(--size-5);flex-shrink:0;justify-content:center;align-items:center;display:none}:host([error]:not([error=\"\"])) .status-icon,:host([success]) .status-icon{display:flex}.status-icon[data-status=error]{color:var(--color-error)}.status-icon[data-status=success]{color:var(--color-success)}@keyframes spin{to{transform:rotate(360deg)}}.field-spinner{width:var(--size-4);height:var(--size-4);border:var(--border-2) solid var(--_theme-focus,currentcolor);animation:var(--_motion-animation,spin var(--transition-loader) infinite);border-radius:50%;flex-shrink:0;display:none}.field-spinner:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-right-color:#0000}.field-spinner:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-left-color:#0000}:host([loading]) .field-spinner{display:inline-block}}@layer refine.variants{:host([variant=text]){--_bg:var(--input-bg,transparent);--_border-color:var(--input-border-color,var(--color-contrast-300))}:host([variant=text]) .field{border:none;border-bottom:var(--border) solid var(--_border-color);box-shadow:none;border-radius:0}:host([variant=text]) .field:focus-within{border-bottom:var(--border-2) solid var(--input-focus-border-color,var(--_theme-focus))}:host(:not([disabled],[variant=text],[variant=flat])) .field:focus-within{background:var(--color-canvas);border-color:var(--_theme-focus);box-shadow:var(--_theme-shadow,var(--color-primary-focus-shadow))}:host([error]:not([error=\"\"])) .field:focus-within{border-color:var(--color-error);box-shadow:var(--color-error-focus-shadow)}:host([success]) .field:focus-within{border-color:var(--color-success);box-shadow:var(--color-success-focus-shadow)}}@layer refine.utilities{:host([fullwidth]){width:100%}}:host([disabled]){opacity:1}:host([disabled]) .field{background:var(--color-contrast-100);border-color:var(--color-contrast-200);box-shadow:none}:host([disabled]) input{color:var(--color-contrast-400)}:host([disabled]) input::placeholder{color:var(--color-contrast-300)}:host([disabled]) .label{color:var(--color-contrast-400)}";
2
+ var e = "@layer refine.base{:host{--_font-size:var(--input-font-size,var(--text-sm));--_gap:var(--input-gap,var(--size-2));--_field-height:var(--input-height,var(--size-10));--_padding:var(--input-padding,var(--size-1-5) var(--size-3));--_label-block-inset:var(--input-label-block-inset,var(--size-2));--_label-inset:var(--input-label-inset,var(--size-3));--_radius:var(--input-radius,var(--rounded-lg));--_placeholder:var(--input-placeholder-color,var(--color-contrast-500));--_bg:var(--input-bg,var(--color-contrast-100));--_border-color:var(--input-border-color,var(--color-contrast-300));min-width:var(--input-min-width,12rem);flex-direction:column;align-items:stretch;display:inline-flex}.input-wrapper{flex-direction:column;gap:0;width:100%;display:flex}.field{box-sizing:border-box;height:var(--_field-height);min-height:var(--_field-height);padding:var(--_padding);background:var(--_bg);border:var(--border) solid var(--_border-color);border-radius:var(--_radius);box-shadow:var(--shadow-2xs);transition:var(--_motion-transition,background var(--transition-fast), backdrop-filter var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast));flex-direction:column;justify-content:center;align-items:stretch;gap:0;display:flex}.input-wrapper:has(.label:not([hidden])) .field{height:auto}:host(:not([label-placement=outside])) .input-wrapper{position:relative}:host(:not([label-placement=outside])) .label{z-index:1;pointer-events:none;top:var(--_label-block-inset);position:absolute}:host(:not([label-placement=outside])) .label:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){left:var(--_label-inset)}:host(:not([label-placement=outside])) .label:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){right:var(--_label-inset)}:host(:not([label-placement=outside])) .input-wrapper:has(.label:not([hidden])) .field{padding-top:calc(var(--_label-block-inset) + 1lh + 2px)}.input-row{gap:var(--_gap);flex:1;align-items:center;display:flex}.label,label.label{text-overflow:ellipsis;font-size:var(--text-xs);font-weight:var(--font-medium);line-height:var(--leading-tight);color:var(--color-contrast-500);white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;transition:var(--_motion-transition,color var(--transition-fast));margin-bottom:2px;overflow:hidden}:host([label-placement=outside]) .label,:host([label-placement=outside]) label.label{font-size:var(--text-xs);line-height:var(--leading-loose);order:-1}.helper-text{margin-top:var(--size-1-5);font-size:var(--text-xs);line-height:var(--leading-tight);color:color-mix(in oklch, var(--color-contrast-500) 80%, var(--color-canvas));overflow-wrap:anywhere;padding-left:2px;padding-right:2px}.helper-text[hidden]{display:none}::slotted(svg){width:var(--_icon-size,var(--leading-6));height:var(--_icon-size,var(--leading-6));flex-shrink:0}}@layer refine.overrides{input{min-width:0;font:inherit;font-size:var(--_font-size);line-height:var(--leading-normal);color:var(--color-contrast-900);background:0 0;border:none;outline:none;flex:1}input::placeholder{color:var(--_placeholder);transition:color var(--transition-fast)}input:focus-visible{outline:none}:host(:not([disabled],[variant=bordered],[variant=flat])) .field:hover{border-color:var(--color-contrast-400)}:host(:not([disabled])) .field:focus-within .label,:host(:not([disabled])) .field:focus-within ::slotted([slot=prefix]),:host(:not([disabled])) .field:focus-within ::slotted([slot=suffix]){color:var(--_theme-focus)}.clear-btn{width:var(--size-5);min-width:var(--_touch-target);height:var(--size-5);min-height:var(--_touch-target);color:var(--color-contrast-500);cursor:pointer;border-radius:var(--rounded-sm);transition:var(--_motion-transition,color var(--transition-fast));background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:none}.clear-btn:hover{color:var(--color-contrast-900)}.clear-btn:focus-visible{outline:var(--border-2) solid var(--_theme-focus);outline-offset:var(--border)}:host([clearable]) .clear-btn{display:flex}:host([clearable]:not([has-value])) .clear-btn{visibility:hidden;pointer-events:none}.pwd-toggle-btn{width:var(--size-5);min-width:var(--_touch-target);height:var(--size-5);min-height:var(--_touch-target);color:var(--color-contrast-500);cursor:pointer;border-radius:var(--rounded-sm);transition:var(--_motion-transition,color var(--transition-fast));background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:none}.pwd-toggle-btn:hover{color:var(--color-contrast-900)}.pwd-toggle-btn:focus-visible{outline:var(--border-2) solid var(--_theme-focus);outline-offset:var(--border)}:host([type=password]) .pwd-toggle-btn{display:flex}.char-counter{font-size:var(--text-xs);line-height:var(--leading-tight);color:var(--color-contrast-400);white-space:nowrap;padding-left:2px;padding-right:2px}.char-counter:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){text-align:right}.char-counter:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){text-align:left}.char-counter[data-near-limit]{color:var(--color-warning,#f59e0b)}.char-counter[data-at-limit]{color:var(--color-error)}:host([error]:not([error=\"\"])) .field{border-color:var(--color-error)}:host([error]:not([error=\"\"])) .label,.helper-text[role=alert]{color:var(--color-error)}:host([success]) .field{border-color:var(--color-success)}.status-icon{width:var(--size-5);height:var(--size-5);flex-shrink:0;justify-content:center;align-items:center;display:none}:host([error]:not([error=\"\"])) .status-icon,:host([success]) .status-icon{display:flex}.status-icon[data-status=error]{color:var(--color-error)}.status-icon[data-status=success]{color:var(--color-success)}@keyframes spin{to{transform:rotate(360deg)}}.field-spinner{width:var(--size-4);height:var(--size-4);border:var(--border-2) solid var(--_theme-focus,currentcolor);animation:var(--_motion-animation,spin var(--transition-loader) infinite);border-radius:50%;flex-shrink:0;display:none}.field-spinner:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-right-color:#0000}.field-spinner:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-left-color:#0000}:host([loading]) .field-spinner{display:inline-block}}@layer refine.variants{:host([variant=text]){--_bg:var(--input-bg,transparent);--_border-color:var(--input-border-color,var(--color-contrast-300))}:host([variant=text]) .field{box-shadow:none;background:0 0;border:none;border-radius:0}:host([variant=text]) .field:focus-within{box-shadow:none}:host(:not([disabled],[variant=text],[variant=flat])) .field:focus-within{background:var(--color-canvas);border-color:var(--_theme-focus);box-shadow:var(--_theme-shadow,var(--color-primary-focus-shadow))}:host([error]:not([error=\"\"])) .field:focus-within{border-color:var(--color-error);box-shadow:var(--color-error-focus-shadow)}:host([success]) .field:focus-within{border-color:var(--color-success);box-shadow:var(--color-success-focus-shadow)}}@layer refine.utilities{:host([fullwidth]){width:100%}}:host([disabled]){opacity:1}:host([disabled]) .field{background:var(--color-contrast-100);border-color:var(--color-contrast-200);box-shadow:none}:host([disabled]) input{color:var(--color-contrast-400)}:host([disabled]) input::placeholder{color:var(--color-contrast-300)}:host([disabled]) .label{color:var(--color-contrast-400)}";
3
3
  //#endregion
4
4
  export { e as default };
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"input.css.js","names":[],"sources":["../../../src/inputs/input/input.css?inline"],"sourcesContent":["@layer refine.base {\n /* ========================================\n Base Styles & Defaults\n ======================================== */\n\n :host {\n --_font-size: var(--input-font-size, var(--text-sm));\n --_gap: var(--input-gap, var(--size-2));\n --_field-height: var(--input-height, var(--size-10));\n --_padding: var(--input-padding, var(--size-1-5) var(--size-3));\n --_radius: var(--input-radius, var(--rounded-lg));\n --_placeholder: var(--input-placeholder-color, var(--color-contrast-500));\n --_bg: var(--input-bg, var(--color-contrast-100));\n --_border-color: var(--input-border-color, var(--color-contrast-300));\n\n display: inline-flex;\n flex-direction: column;\n align-items: stretch;\n min-width: var(--input-min-width, 12rem);\n }\n\n .input-wrapper {\n display: flex;\n flex-direction: column;\n gap: 0;\n width: 100%;\n }\n\n .field {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: 0;\n align-items: stretch;\n justify-content: center;\n height: var(--_field-height);\n min-height: var(--_field-height);\n padding: var(--_padding);\n background: var(--_bg);\n border: var(--border) solid var(--_border-color);\n border-radius: var(--_radius);\n box-shadow: var(--shadow-2xs);\n transition: var(\n --_motion-transition,\n background var(--transition-fast),\n backdrop-filter var(--transition-fast),\n border-color var(--transition-fast),\n box-shadow var(--transition-fast)\n );\n }\n\n /* Expand height to fit inset label + input row */\n .input-wrapper:has(.label:not([hidden])) .field {\n height: auto;\n }\n\n /* Outside placement: label is above the field (natural flow) */\n\n /* Inset placement (default): label appears inside the field border */\n :host(:not([label-placement='outside'])) .input-wrapper {\n position: relative;\n }\n\n :host(:not([label-placement='outside'])) .label {\n position: absolute;\n inset-block-start: var(--size-2);\n inset-inline-start: var(--_padding-x, var(--size-3));\n z-index: 1;\n pointer-events: none;\n }\n\n :host(:not([label-placement='outside'])) .input-wrapper:has(.label:not([hidden])) .field {\n padding-block-start: calc(var(--size-2) + 1lh + 2px);\n }\n\n .input-row {\n display: flex;\n flex: 1;\n gap: var(--_gap);\n align-items: center;\n }\n\n /* ========================================\n Label Styles\n ======================================== */\n\n .label,\n label.label {\n margin-bottom: 2px;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--text-xs);\n font-weight: var(--font-medium);\n line-height: var(--leading-tight);\n color: var(--color-contrast-500);\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n transition: var(--_motion-transition, color var(--transition-fast));\n }\n\n /* Outside placement: label moves outside the field via CSS */\n :host([label-placement='outside']) .label,\n :host([label-placement='outside']) label.label {\n order: -1;\n font-size: var(--text-xs);\n line-height: var(--leading-loose);\n }\n\n /* ========================================\n Helper Text\n ======================================== */\n\n .helper-text {\n padding-inline: 2px;\n margin-top: var(--size-1-5);\n font-size: var(--text-xs);\n line-height: var(--leading-tight);\n color: color-mix(in oklch, var(--color-contrast-500) 80%, var(--color-canvas));\n overflow-wrap: anywhere;\n }\n\n .helper-text[hidden] {\n display: none;\n }\n\n /* ========================================\n Slotted Prefix/Suffix Icons\n ======================================== */\n\n ::slotted(svg) {\n flex-shrink: 0;\n width: var(--_icon-size, var(--leading-6));\n height: var(--_icon-size, var(--leading-6));\n }\n}\n\n@layer refine.overrides {\n /* ========================================\n Input Element\n ======================================== */\n\n input {\n flex: 1;\n min-width: 0;\n font: inherit;\n font-size: var(--_font-size);\n line-height: var(--leading-normal);\n\n /* No all: unset needed - reset layer handles it */\n color: var(--color-contrast-900);\n outline: none;\n background: transparent;\n border: none;\n }\n\n input::placeholder {\n color: var(--_placeholder);\n transition: color var(--transition-fast);\n }\n\n input:focus-visible {\n outline: none;\n }\n\n /* ========================================\n Hover & Focus States\n ======================================== */\n\n :host(:not([disabled], [variant='bordered'], [variant='flat'])) .field:hover {\n border-color: var(--color-contrast-400);\n }\n\n :host(:not([disabled])) .field:focus-within .label {\n color: var(--_theme-focus);\n }\n\n :host(:not([disabled])) .field:focus-within ::slotted([slot='prefix']),\n :host(:not([disabled])) .field:focus-within ::slotted([slot='suffix']) {\n color: var(--_theme-focus);\n }\n\n /* ========================================\n Clear button\n ======================================== */\n\n .clear-btn {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--size-5);\n min-width: var(--_touch-target);\n height: var(--size-5);\n min-height: var(--_touch-target);\n padding: 0;\n color: var(--color-contrast-500);\n cursor: pointer;\n background: transparent;\n border: none;\n border-radius: var(--rounded-sm);\n transition: var(--_motion-transition, color var(--transition-fast));\n }\n\n .clear-btn:hover {\n color: var(--color-contrast-900);\n }\n\n .clear-btn:focus-visible {\n outline: var(--border-2) solid var(--_theme-focus);\n outline-offset: var(--border);\n }\n\n :host([clearable]) .clear-btn {\n display: flex;\n }\n\n :host([clearable]:not([has-value])) .clear-btn {\n visibility: hidden;\n pointer-events: none;\n }\n\n /* ========================================\n Password visibility toggle\n ======================================== */\n\n .pwd-toggle-btn {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--size-5);\n min-width: var(--_touch-target);\n height: var(--size-5);\n min-height: var(--_touch-target);\n padding: 0;\n color: var(--color-contrast-500);\n cursor: pointer;\n background: transparent;\n border: none;\n border-radius: var(--rounded-sm);\n transition: var(--_motion-transition, color var(--transition-fast));\n }\n\n .pwd-toggle-btn:hover {\n color: var(--color-contrast-900);\n }\n\n .pwd-toggle-btn:focus-visible {\n outline: var(--border-2) solid var(--_theme-focus);\n outline-offset: var(--border);\n }\n\n :host([type='password']) .pwd-toggle-btn {\n display: flex;\n }\n\n /* ========================================\n Character counter\n ======================================== */\n\n .char-counter {\n padding-inline: 2px;\n font-size: var(--text-xs);\n line-height: var(--leading-tight);\n color: var(--color-contrast-400);\n text-align: end;\n white-space: nowrap;\n }\n\n .char-counter[data-near-limit] {\n color: var(--color-warning, #f59e0b);\n }\n\n .char-counter[data-at-limit] {\n color: var(--color-error);\n }\n\n /* ========================================\n Error State\n ======================================== */\n\n :host([error]:not([error=''])) .field {\n border-color: var(--color-error);\n }\n\n :host([error]:not([error=''])) .label {\n color: var(--color-error);\n }\n\n .helper-text[role='alert'] {\n color: var(--color-error);\n }\n\n /* ========================================\n Success State (Signal 04)\n ======================================== */\n\n :host([success]) .field {\n border-color: var(--color-success);\n }\n\n /* ========================================\n Status Icon (Signals 03/04: error/success — never color alone)\n ======================================== */\n\n .status-icon {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--size-5);\n height: var(--size-5);\n }\n\n :host([error]:not([error=''])) .status-icon,\n :host([success]) .status-icon {\n display: flex;\n }\n\n .status-icon[data-status='error'] {\n color: var(--color-error);\n }\n\n .status-icon[data-status='success'] {\n color: var(--color-success);\n }\n\n /* ========================================\n Loading Spinner (Signal 06)\n ======================================== */\n\n /* Keyframe must live in shadow DOM — @keyframes don't inherit across shadow roots */\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .field-spinner {\n display: none;\n flex-shrink: 0;\n width: var(--size-4);\n height: var(--size-4);\n border: var(--border-2) solid var(--_theme-focus, currentcolor);\n border-inline-end-color: transparent;\n border-radius: 50%;\n animation: var(--_motion-animation, spin var(--transition-loader) infinite);\n }\n\n :host([loading]) .field-spinner {\n display: inline-block;\n }\n}\n\n/*\n * The solid/flat/bordered/outline/ghost variant switch (previously here) now lives in\n * `fieldVariantMixin({ container: '.field', tokenPrefix: 'input' })` in `input.ts`'s `styles`\n * array — shared with `ore-textarea`/`ore-message-composer` instead of hand-duplicated across\n * all three (see the mixin's own doc comment for what it covers and why). `ore-input`'s extra\n * `text` variant (below) is not part of that shared set, so it keeps its own block here.\n */\n@layer refine.variants {\n /* Text — underline style */\n :host([variant='text']) {\n --_bg: var(--input-bg, transparent);\n --_border-color: var(--input-border-color, var(--color-contrast-300));\n }\n\n :host([variant='text']) .field {\n border: none;\n border-bottom: var(--border) solid var(--_border-color);\n border-radius: 0;\n box-shadow: none;\n }\n\n :host([variant='text']) .field:focus-within {\n border-bottom: var(--border-2) solid var(--input-focus-border-color, var(--_theme-focus));\n }\n\n /*\n * Focus/error/success `box-shadow` on `.field` — kept here in `refine.variants` (alongside\n * `fieldVariantMixin`'s rest-state `box-shadow` for solid/outline/ghost) rather than\n * `refine.overrides`, so normal specificity decides the winner. Cascade layers beat\n * specificity outright, so a `refine.overrides` box-shadow always lost to every variant's\n * unconditional rest-state `box-shadow`, focused/error/success or not — the same bug class\n * fixed for `ore-otp-input`'s focus ring.\n */\n :host(:not([disabled], [variant='text'], [variant='flat'])) .field:focus-within {\n background: var(--color-canvas);\n border-color: var(--_theme-focus);\n box-shadow: var(--_theme-shadow, var(--color-primary-focus-shadow));\n }\n\n :host([error]:not([error=''])) .field:focus-within {\n border-color: var(--color-error);\n box-shadow: var(--color-error-focus-shadow);\n }\n\n :host([success]) .field:focus-within {\n border-color: var(--color-success);\n box-shadow: var(--color-success-focus-shadow);\n }\n}\n\n@layer refine.utilities {\n /* Full width */\n :host([fullwidth]) {\n width: 100%;\n }\n}\n\n/* ========================================\n Disabled State (Signal 05) — intentionally unlayered\n ======================================== */\n\n/*\n * The shared `disabledLoadingMixin` (pulled in via `fieldMixins`) dims `:host([disabled])`\n * with `opacity: 0.5` as bare, unlayered CSS. Cascade layers always lose to unlayered rules\n * regardless of source order or specificity, so overriding that from inside any `@layer`\n * block in this file (including `refine.overrides`) would be a no-op — this has to stay\n * unlayered too, to actually win.\n *\n * Per the field-state UX review: opacity-based dimming reads as a washed-out/loading look\n * and can mimic reduced-contrast content for low-vision users, rather than a clearly locked\n * field. Swapped for an explicit grayscale surface + `not-allowed` cursor (the cursor already\n * comes from the shared mixin, left untouched here).\n */\n:host([disabled]) {\n opacity: 1;\n}\n\n:host([disabled]) .field {\n background: var(--color-contrast-100);\n border-color: var(--color-contrast-200);\n box-shadow: none;\n}\n\n:host([disabled]) input {\n color: var(--color-contrast-400);\n}\n\n:host([disabled]) input::placeholder {\n color: var(--color-contrast-300);\n}\n\n:host([disabled]) .label {\n color: var(--color-contrast-400);\n}\n"],"mappings":""}
1
+ {"version":3,"file":"input.css.js","names":[],"sources":["../../../src/inputs/input/input.css?inline"],"sourcesContent":["@layer refine.base {\n /* ========================================\n Base Styles & Defaults\n ======================================== */\n\n :host {\n --_font-size: var(--input-font-size, var(--text-sm));\n --_gap: var(--input-gap, var(--size-2));\n --_field-height: var(--input-height, var(--size-10));\n --_padding: var(--input-padding, var(--size-1-5) var(--size-3));\n --_label-block-inset: var(--input-label-block-inset, var(--size-2));\n --_label-inset: var(--input-label-inset, var(--size-3));\n --_radius: var(--input-radius, var(--rounded-lg));\n --_placeholder: var(--input-placeholder-color, var(--color-contrast-500));\n --_bg: var(--input-bg, var(--color-contrast-100));\n --_border-color: var(--input-border-color, var(--color-contrast-300));\n\n display: inline-flex;\n flex-direction: column;\n align-items: stretch;\n min-width: var(--input-min-width, 12rem);\n }\n\n .input-wrapper {\n display: flex;\n flex-direction: column;\n gap: 0;\n width: 100%;\n }\n\n .field {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: 0;\n align-items: stretch;\n justify-content: center;\n height: var(--_field-height);\n min-height: var(--_field-height);\n padding: var(--_padding);\n background: var(--_bg);\n border: var(--border) solid var(--_border-color);\n border-radius: var(--_radius);\n box-shadow: var(--shadow-2xs);\n transition: var(\n --_motion-transition,\n background var(--transition-fast),\n backdrop-filter var(--transition-fast),\n border-color var(--transition-fast),\n box-shadow var(--transition-fast)\n );\n }\n\n /* Expand height to fit inset label + input row */\n .input-wrapper:has(.label:not([hidden])) .field {\n height: auto;\n }\n\n /* Outside placement: label is above the field (natural flow) */\n\n /* Inset placement (default): label appears inside the field border */\n :host(:not([label-placement='outside'])) .input-wrapper {\n position: relative;\n }\n\n :host(:not([label-placement='outside'])) .label {\n position: absolute;\n inset-block-start: var(--_label-block-inset);\n inset-inline-start: var(--_label-inset);\n z-index: 1;\n pointer-events: none;\n }\n\n :host(:not([label-placement='outside'])) .input-wrapper:has(.label:not([hidden])) .field {\n padding-block-start: calc(var(--_label-block-inset) + 1lh + 2px);\n }\n\n .input-row {\n display: flex;\n flex: 1;\n gap: var(--_gap);\n align-items: center;\n }\n\n /* ========================================\n Label Styles\n ======================================== */\n\n .label,\n label.label {\n margin-bottom: 2px;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: var(--text-xs);\n font-weight: var(--font-medium);\n line-height: var(--leading-tight);\n color: var(--color-contrast-500);\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n transition: var(--_motion-transition, color var(--transition-fast));\n }\n\n /* Outside placement: label moves outside the field via CSS */\n :host([label-placement='outside']) .label,\n :host([label-placement='outside']) label.label {\n order: -1;\n font-size: var(--text-xs);\n line-height: var(--leading-loose);\n }\n\n /* ========================================\n Helper Text\n ======================================== */\n\n .helper-text {\n padding-inline: 2px;\n margin-top: var(--size-1-5);\n font-size: var(--text-xs);\n line-height: var(--leading-tight);\n color: color-mix(in oklch, var(--color-contrast-500) 80%, var(--color-canvas));\n overflow-wrap: anywhere;\n }\n\n .helper-text[hidden] {\n display: none;\n }\n\n /* ========================================\n Slotted Prefix/Suffix Icons\n ======================================== */\n\n ::slotted(svg) {\n flex-shrink: 0;\n width: var(--_icon-size, var(--leading-6));\n height: var(--_icon-size, var(--leading-6));\n }\n}\n\n@layer refine.overrides {\n /* ========================================\n Input Element\n ======================================== */\n\n input {\n flex: 1;\n min-width: 0;\n font: inherit;\n font-size: var(--_font-size);\n line-height: var(--leading-normal);\n\n /* No all: unset needed - reset layer handles it */\n color: var(--color-contrast-900);\n outline: none;\n background: transparent;\n border: none;\n }\n\n input::placeholder {\n color: var(--_placeholder);\n transition: color var(--transition-fast);\n }\n\n input:focus-visible {\n outline: none;\n }\n\n /* ========================================\n Hover & Focus States\n ======================================== */\n\n :host(:not([disabled], [variant='bordered'], [variant='flat'])) .field:hover {\n border-color: var(--color-contrast-400);\n }\n\n :host(:not([disabled])) .field:focus-within .label {\n color: var(--_theme-focus);\n }\n\n :host(:not([disabled])) .field:focus-within ::slotted([slot='prefix']),\n :host(:not([disabled])) .field:focus-within ::slotted([slot='suffix']) {\n color: var(--_theme-focus);\n }\n\n /* ========================================\n Clear button\n ======================================== */\n\n .clear-btn {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--size-5);\n min-width: var(--_touch-target);\n height: var(--size-5);\n min-height: var(--_touch-target);\n padding: 0;\n color: var(--color-contrast-500);\n cursor: pointer;\n background: transparent;\n border: none;\n border-radius: var(--rounded-sm);\n transition: var(--_motion-transition, color var(--transition-fast));\n }\n\n .clear-btn:hover {\n color: var(--color-contrast-900);\n }\n\n .clear-btn:focus-visible {\n outline: var(--border-2) solid var(--_theme-focus);\n outline-offset: var(--border);\n }\n\n :host([clearable]) .clear-btn {\n display: flex;\n }\n\n :host([clearable]:not([has-value])) .clear-btn {\n visibility: hidden;\n pointer-events: none;\n }\n\n /* ========================================\n Password visibility toggle\n ======================================== */\n\n .pwd-toggle-btn {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--size-5);\n min-width: var(--_touch-target);\n height: var(--size-5);\n min-height: var(--_touch-target);\n padding: 0;\n color: var(--color-contrast-500);\n cursor: pointer;\n background: transparent;\n border: none;\n border-radius: var(--rounded-sm);\n transition: var(--_motion-transition, color var(--transition-fast));\n }\n\n .pwd-toggle-btn:hover {\n color: var(--color-contrast-900);\n }\n\n .pwd-toggle-btn:focus-visible {\n outline: var(--border-2) solid var(--_theme-focus);\n outline-offset: var(--border);\n }\n\n :host([type='password']) .pwd-toggle-btn {\n display: flex;\n }\n\n /* ========================================\n Character counter\n ======================================== */\n\n .char-counter {\n padding-inline: 2px;\n font-size: var(--text-xs);\n line-height: var(--leading-tight);\n color: var(--color-contrast-400);\n text-align: end;\n white-space: nowrap;\n }\n\n .char-counter[data-near-limit] {\n color: var(--color-warning, #f59e0b);\n }\n\n .char-counter[data-at-limit] {\n color: var(--color-error);\n }\n\n /* ========================================\n Error State\n ======================================== */\n\n :host([error]:not([error=''])) .field {\n border-color: var(--color-error);\n }\n\n :host([error]:not([error=''])) .label {\n color: var(--color-error);\n }\n\n .helper-text[role='alert'] {\n color: var(--color-error);\n }\n\n /* ========================================\n Success State (Signal 04)\n ======================================== */\n\n :host([success]) .field {\n border-color: var(--color-success);\n }\n\n /* ========================================\n Status Icon (Signals 03/04: error/success — never color alone)\n ======================================== */\n\n .status-icon {\n display: none;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--size-5);\n height: var(--size-5);\n }\n\n :host([error]:not([error=''])) .status-icon,\n :host([success]) .status-icon {\n display: flex;\n }\n\n .status-icon[data-status='error'] {\n color: var(--color-error);\n }\n\n .status-icon[data-status='success'] {\n color: var(--color-success);\n }\n\n /* ========================================\n Loading Spinner (Signal 06)\n ======================================== */\n\n /* Keyframe must live in shadow DOM — @keyframes don't inherit across shadow roots */\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .field-spinner {\n display: none;\n flex-shrink: 0;\n width: var(--size-4);\n height: var(--size-4);\n border: var(--border-2) solid var(--_theme-focus, currentcolor);\n border-inline-end-color: transparent;\n border-radius: 50%;\n animation: var(--_motion-animation, spin var(--transition-loader) infinite);\n }\n\n :host([loading]) .field-spinner {\n display: inline-block;\n }\n}\n\n/*\n * The solid/flat/bordered/outline/ghost variant switch (previously here) now lives in\n * `fieldVariantMixin({ container: '.field', tokenPrefix: 'input' })` in `input.ts`'s `styles`\n * array — shared with `ore-textarea`/`ore-message-composer` instead of hand-duplicated across\n * all three (see the mixin's own doc comment for what it covers and why). `ore-input`'s extra\n * `text` variant (below) is not part of that shared set, so it keeps its own block here.\n */\n@layer refine.variants {\n /* Text — underline style */\n :host([variant='text']) {\n --_bg: var(--input-bg, transparent);\n --_border-color: var(--input-border-color, var(--color-contrast-300));\n }\n\n :host([variant='text']) .field {\n background: transparent;\n border: none;\n border-radius: 0;\n box-shadow: none;\n }\n\n :host([variant='text']) .field:focus-within {\n box-shadow: none;\n }\n\n /*\n * Focus/error/success `box-shadow` on `.field` — kept here in `refine.variants` (alongside\n * `fieldVariantMixin`'s rest-state `box-shadow` for solid/outline/ghost) rather than\n * `refine.overrides`, so normal specificity decides the winner. Cascade layers beat\n * specificity outright, so a `refine.overrides` box-shadow always lost to every variant's\n * unconditional rest-state `box-shadow`, focused/error/success or not — the same bug class\n * fixed for `ore-otp-input`'s focus ring.\n */\n :host(:not([disabled], [variant='text'], [variant='flat'])) .field:focus-within {\n background: var(--color-canvas);\n border-color: var(--_theme-focus);\n box-shadow: var(--_theme-shadow, var(--color-primary-focus-shadow));\n }\n\n :host([error]:not([error=''])) .field:focus-within {\n border-color: var(--color-error);\n box-shadow: var(--color-error-focus-shadow);\n }\n\n :host([success]) .field:focus-within {\n border-color: var(--color-success);\n box-shadow: var(--color-success-focus-shadow);\n }\n}\n\n@layer refine.utilities {\n /* Full width */\n :host([fullwidth]) {\n width: 100%;\n }\n}\n\n/* ========================================\n Disabled State (Signal 05) — intentionally unlayered\n ======================================== */\n\n/*\n * The shared `disabledLoadingMixin` (pulled in via `fieldMixins`) dims `:host([disabled])`\n * with `opacity: 0.5` as bare, unlayered CSS. Cascade layers always lose to unlayered rules\n * regardless of source order or specificity, so overriding that from inside any `@layer`\n * block in this file (including `refine.overrides`) would be a no-op — this has to stay\n * unlayered too, to actually win.\n *\n * Per the field-state UX review: opacity-based dimming reads as a washed-out/loading look\n * and can mimic reduced-contrast content for low-vision users, rather than a clearly locked\n * field. Swapped for an explicit grayscale surface + `not-allowed` cursor (the cursor already\n * comes from the shared mixin, left untouched here).\n */\n:host([disabled]) {\n opacity: 1;\n}\n\n:host([disabled]) .field {\n background: var(--color-contrast-100);\n border-color: var(--color-contrast-200);\n box-shadow: none;\n}\n\n:host([disabled]) input {\n color: var(--color-contrast-400);\n}\n\n:host([disabled]) input::placeholder {\n color: var(--color-contrast-300);\n}\n\n:host([disabled]) .label {\n color: var(--color-contrast-400);\n}\n"],"mappings":""}
@@ -82,6 +82,8 @@ export type OreInputProps = TextFieldProps<Exclude<VisualVariant, 'frost'>> & {
82
82
  * @cssprop --input-placeholder-color - Placeholder text color
83
83
  * @cssprop --input-radius - Border radius
84
84
  * @cssprop --input-padding - Inner padding (block inline)
85
+ * @cssprop --input-label-block-inset - Inset from the field block start for an inset label
86
+ * @cssprop --input-label-inset - Inset from the field inline start for an inset label
85
87
  * @cssprop --input-gap - Gap between prefix/suffix icons and input text
86
88
  * @cssprop --input-font-size - Font size
87
89
  * @cssprop --input-height - Field height
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/inputs/input/input.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,yBAAyB,CAAC;AAgBjC,iCAAiC;AAEjC,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,KAAK,CAAC;IAC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AAEF,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,GAAG;IAC5E,wBAAwB;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;IACzF;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IACrD,sBAAsB;IACtB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAiBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,eAAO,MAAM,SAAS,EAAG,WAAoB,CAAC"}
@@ -16,7 +16,7 @@ export type OreSelectEvents = {
16
16
  input: Event;
17
17
  'open-change': OverlayOpenChangeDetail;
18
18
  };
19
- export type OreSelectProps = SelectableFieldProps<Exclude<VisualVariant, 'text' | 'frost'>> & {
19
+ export type OreSelectProps = SelectableFieldProps<Exclude<VisualVariant, 'frost'>> & {
20
20
  /** Show loading state in dropdown */
21
21
  loading?: boolean;
22
22
  /** Allow selecting multiple options */
@@ -44,7 +44,7 @@ export type OreSelectProps = SelectableFieldProps<Exclude<VisualVariant, 'text'
44
44
  * @attr {string} error - Error message
45
45
  * @attr {boolean} success - Show an inline success check icon (suppressed while `error` is set)
46
46
  * @attr {string} color - Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'
47
- * @attr {string} variant - Visual variant: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost'
47
+ * @attr {string} variant - Visual variant: 'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text'
48
48
  * @attr {string} size - Component size: 'sm' | 'md' | 'lg'
49
49
  * @attr {string} rounded - Border radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'
50
50
  * @attr {boolean} fullwidth - Expand to full width
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/inputs/select/select.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAqB,MAAM,YAAY,CAAC;AAE7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,0BAA0B,CAAC;AAClC,OAAO,yBAAyB,CAAC;AACjC,OAAO,gBAAgB,CAAC;AAexB,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAiBF,kCAAkC;AAElC,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,EAAE,uBAAuB,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,oBAAoB,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG;IAC5F,qCAAqC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,eAAO,MAAM,UAAU,EAAG,YAAqB,CAAC"}
package/dist/marquee.cjs CHANGED
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./content/marquee/marquee.css.cjs");let t=require("@vielzeug/ore"),n=require("@vielzeug/ripple");var r=`ore-marquee`;(0,t.define)(r,{props:{color:t.prop.string(),direction:t.prop.string(`left`),duration:t.prop.number(20),"pause-on-hover":t.prop.bool(!1),"show-controls":t.prop.bool(!0)},setup(e){let r=(0,t.getHost)(),i=0,a=[],o=[],s=null,c=0,l=null,u=null,d=t=>{if(!u||o.length===0)return;i=(t+o.length)%o.length;let n=o[i];if(!n||c===0)return;let r=e.duration.value??20,a=-(n.offsetLeft/c*r);u.style.setProperty(`animation-delay`,`${a}s`)};return(0,n.watch)(e.duration,e=>{r.style.setProperty(`--_marquee-duration`,`${e??20}s`)},{immediate:!0}),(0,t.onMounted)(()=>{u=r.shadowRoot?.querySelector(`.track`)??null;let e=r.shadowRoot?.querySelector(`slot`)??null,t=()=>{a.forEach(e=>e.remove()),a=[]},n=()=>{a.push(...o.map(e=>{let t=e.cloneNode(!0);return t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`data-marquee-clone`,``),t.setAttribute(`inert`,``),r.appendChild(t),t}))},d=()=>{if(!u||o.length===0)return;let e=u;s!==null&&cancelAnimationFrame(s),t(),c=0,e.style.removeProperty(`--_marquee-translate`),n(),s=requestAnimationFrame(()=>{s=null;let t=a[0],i=o[0];if(!t||!i||(c=t.offsetLeft-i.offsetLeft,c<=0))return;let l=Math.max(2,Math.ceil((r.clientWidth+c)/c));for(let e=2;e<l;e+=1)n();e.style.setProperty(`--_marquee-translate`,`-${c}px`)})},f=()=>{let t=(e?.assignedElements()??[]).filter(e=>e instanceof HTMLElement&&!e.hasAttribute(`data-marquee-clone`));(t.length!==o.length||t.some((e,t)=>e!==o[t]))&&(o=t,i=Math.min(i,Math.max(o.length-1,0)),d())};return l=typeof ResizeObserver>`u`?null:new ResizeObserver(d),l?.observe(r),e?.addEventListener(`slotchange`,f),f(),()=>{s!==null&&cancelAnimationFrame(s),l?.disconnect(),e?.removeEventListener(`slotchange`,f),t(),u=null,o=[],c=0}}),t.html`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./content/marquee/marquee.css.cjs");let t=require("@vielzeug/ore"),n=require("@vielzeug/ripple");var r=`ore-marquee`;(0,t.define)(r,{props:{color:t.prop.string(),direction:t.prop.string(`left`),duration:t.prop.number(20),"pause-on-hover":t.prop.bool(!1),"show-controls":t.prop.bool(!0)},setup(e){let r=(0,t.getHost)(),i=0,a=[],o=[],s=null,c=0,l=null,u=null,d=t=>{if(!u||o.length===0)return;i=(t+o.length)%o.length;let n=o[i];if(!n||c===0)return;let r=e.duration.value??20,a=-(n.offsetLeft/c*r);u.style.setProperty(`animation-delay`,`${a}s`)};return(0,n.watch)(e.duration,e=>{r.style.setProperty(`--_marquee-duration`,`${e??20}s`)},{immediate:!0}),(0,t.onMounted)(()=>{u=r.shadowRoot?.querySelector(`.track`)??null;let e=r.shadowRoot?.querySelector(`slot`)??null,t=()=>{a.forEach(e=>{e.remove()}),a=[]},n=()=>{a.push(...o.map(e=>{let t=e.cloneNode(!0);return t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`data-marquee-clone`,``),t.setAttribute(`inert`,``),r.appendChild(t),t}))},d=()=>{if(!u||o.length===0)return;let e=u;s!==null&&cancelAnimationFrame(s),t(),c=0,e.style.removeProperty(`--_marquee-translate`),n(),s=requestAnimationFrame(()=>{s=null;let t=a[0],i=o[0];if(!t||!i||(c=t.offsetLeft-i.offsetLeft,c<=0))return;let l=Math.max(2,Math.ceil((r.clientWidth+c)/c));for(let e=2;e<l;e+=1)n();e.style.setProperty(`--_marquee-translate`,`-${c}px`)})},f=()=>{let t=(e?.assignedElements()??[]).filter(e=>e instanceof HTMLElement&&!e.hasAttribute(`data-marquee-clone`));(t.length!==o.length||t.some((e,t)=>e!==o[t]))&&(o=t,i=Math.min(i,Math.max(o.length-1,0)),d())};return l=typeof ResizeObserver>`u`?null:new ResizeObserver(d),l?.observe(r),e?.addEventListener(`slotchange`,f),f(),()=>{s!==null&&cancelAnimationFrame(s),l?.disconnect(),e?.removeEventListener(`slotchange`,f),t(),u=null,o=[],c=0}}),t.html`
2
2
  <div class="track" part="track" aria-live="off">
3
3
  <slot></slot>
4
4
  </div>