@blotoutio/providers-evo-search-sdk 1.48.1 → 1.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +75 -14
- package/index.js +75 -14
- package/index.mjs +75 -14
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -898,33 +898,88 @@ const e$1=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&"object"
|
|
|
898
898
|
|
|
899
899
|
var css_248z = "@import 'tailwindcss';\n\n@layer base {\n :root,\n :host {\n font-family: 'Inter', sans-serif;\n }\n}\n\n@theme {\n --color-primary: #18181b;\n --color-primary-foreground: #fafafa;\n\n /* button colors */\n --color-secondary: #f4f4f5;\n --color-secondary-foreground: #18181b;\n --color-destructive: #dc2626;\n --color-destructive-foreground: #fef2f2;\n --color-background: #ffffff;\n --color-input: #e4e4e7;\n --color-accent: #f4f4f5;\n --color-accent-foreground: #18181b;\n\n --color-card: #ffffff;\n --color-card-foreground: #09090b;\n --color-border: #e4e4e7;\n\n --color-sidebar-ring: #a1a1aa;\n\n --color-muted: #f7f7f6;\n --color-muted-foreground: #74716e;\n\n --color-orange-10: #fff3e6;\n --color-orange-20: #ffdfbf;\n --color-orange-30: #ffb47f;\n --color-orange-40: #ff8446;\n --color-orange-50: #f25c2b;\n --color-orange-60: #cd4b27;\n --color-orange-70: #b03719;\n --color-orange-80: #892c0f;\n --color-orange-90: #61170d;\n --color-orange-100: #520c03;\n\n --color-neutral-10: #f1f4f8;\n --color-neutral-20: #dbe2eb;\n --color-neutral-30: #bfccda;\n --color-neutral-40: #a3b2c6;\n --color-neutral-50: #8799af;\n --color-neutral-60: #677c95;\n --color-neutral-70: #4e647f;\n --color-neutral-80: #394d66;\n --color-neutral-90: #293b51;\n --color-neutral-100: #172a41;\n\n --color-blue-10: #dbeafe;\n --color-blue-20: #bfdbfe;\n --color-blue-30: #93c5fd;\n --color-blue-40: #60a5fa;\n --color-blue-50: #3b82f6;\n --color-blue-60: #2563eb;\n --color-blue-70: #1d4ed8;\n --color-blue-80: #1e40af;\n --color-blue-90: #1e3a8a;\n --color-blue-100: #172554;\n\n --shadow-base: 0px 1px 3px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.06);\n\n --radius-default: 16px;\n}\n";
|
|
900
900
|
|
|
901
|
-
|
|
902
|
-
stylesheet
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
901
|
+
/**
|
|
902
|
+
* Global stylesheet registry (shared across independently-bundled SDKs via
|
|
903
|
+
* globalThis so both bundles read/write the same Map).
|
|
904
|
+
*/
|
|
905
|
+
const REGISTRY_KEY = Symbol.for('__tw_stylesheet_registry__');
|
|
906
|
+
function getRegistry() {
|
|
907
|
+
const g = globalThis;
|
|
908
|
+
if (!g[REGISTRY_KEY]) {
|
|
909
|
+
g[REGISTRY_KEY] = new Map();
|
|
910
|
+
}
|
|
911
|
+
return g[REGISTRY_KEY];
|
|
912
|
+
}
|
|
913
|
+
function createProcessedStylesheet(cssText) {
|
|
914
|
+
const sheet = new CSSStyleSheet();
|
|
915
|
+
sheet.replaceSync(cssText);
|
|
916
|
+
if (typeof CSSPropertyRule !== 'undefined' && isIterable(sheet.cssRules)) {
|
|
917
|
+
const properties = [];
|
|
918
|
+
for (const rule of sheet.cssRules) {
|
|
919
|
+
if (rule instanceof CSSPropertyRule && rule.initialValue) {
|
|
908
920
|
properties.push(`${rule.name}: ${rule.initialValue}`);
|
|
909
921
|
}
|
|
910
922
|
}
|
|
923
|
+
if (properties.length > 0) {
|
|
924
|
+
sheet.insertRule(`:host { ${properties.join('; ')} }`);
|
|
925
|
+
}
|
|
911
926
|
}
|
|
912
|
-
|
|
927
|
+
return sheet;
|
|
913
928
|
}
|
|
929
|
+
// Default stylesheet for standalone lit-ui-kit usage (no namespace context).
|
|
930
|
+
const defaultStylesheet = createProcessedStylesheet(css_248z);
|
|
931
|
+
/**
|
|
932
|
+
* Namespace resolution — walks up through shadow DOM boundaries to find the
|
|
933
|
+
* nearest ancestor with a `data-tw-namespace` attribute.
|
|
934
|
+
*/
|
|
935
|
+
function resolveStylesheet(element) {
|
|
936
|
+
const registry = getRegistry();
|
|
937
|
+
if (registry.size === 0) {
|
|
938
|
+
return defaultStylesheet;
|
|
939
|
+
}
|
|
940
|
+
let node = element;
|
|
941
|
+
while (node) {
|
|
942
|
+
if (node instanceof HTMLElement && node.dataset['twNamespace']) {
|
|
943
|
+
const sheet = registry.get(node.dataset['twNamespace']);
|
|
944
|
+
if (sheet) {
|
|
945
|
+
return sheet;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
const root = node.getRootNode();
|
|
949
|
+
if (root instanceof ShadowRoot) {
|
|
950
|
+
node = root.host;
|
|
951
|
+
}
|
|
952
|
+
else {
|
|
953
|
+
node = node.parentElement;
|
|
954
|
+
if (!node) {
|
|
955
|
+
break;
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
return defaultStylesheet;
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* TW Mixin — adopts the context-appropriate stylesheet into each component's
|
|
963
|
+
* shadow root.
|
|
964
|
+
*/
|
|
914
965
|
const TW = (superClass) => class extends superClass {
|
|
966
|
+
constructor() {
|
|
967
|
+
super(...arguments);
|
|
968
|
+
this.twStylesheet = null;
|
|
969
|
+
}
|
|
915
970
|
connectedCallback() {
|
|
916
971
|
super.connectedCallback();
|
|
917
972
|
if (this.shadowRoot) {
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
973
|
+
const sheet = resolveStylesheet(this);
|
|
974
|
+
const adopted = this.shadowRoot.adoptedStyleSheets.filter((currentSheet) => currentSheet !== this.twStylesheet);
|
|
975
|
+
this.shadowRoot.adoptedStyleSheets = [sheet, ...adopted];
|
|
976
|
+
this.twStylesheet = sheet;
|
|
922
977
|
}
|
|
923
978
|
}
|
|
924
979
|
};
|
|
925
980
|
function isIterable(obj) {
|
|
926
981
|
return (obj != null &&
|
|
927
|
-
typeof obj
|
|
982
|
+
typeof obj === 'object' &&
|
|
928
983
|
Symbol.iterator in obj &&
|
|
929
984
|
typeof obj[Symbol.iterator] === 'function');
|
|
930
985
|
}
|
|
@@ -4924,7 +4979,7 @@ if (!customElements.get('bt-helper-text')) {
|
|
|
4924
4979
|
}
|
|
4925
4980
|
|
|
4926
4981
|
const TwLitElement$3 = TW(i);
|
|
4927
|
-
const inputVariants = cva('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm');
|
|
4982
|
+
const inputVariants = cva('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40');
|
|
4928
4983
|
class BTInput extends TwLitElement$3 {
|
|
4929
4984
|
constructor() {
|
|
4930
4985
|
super(...arguments);
|
|
@@ -4934,6 +4989,7 @@ class BTInput extends TwLitElement$3 {
|
|
|
4934
4989
|
this.value = '';
|
|
4935
4990
|
this.disabled = false;
|
|
4936
4991
|
this.required = false;
|
|
4992
|
+
this.invalid = false;
|
|
4937
4993
|
}
|
|
4938
4994
|
render() {
|
|
4939
4995
|
var _a, _b, _c, _d, _e;
|
|
@@ -4949,6 +5005,7 @@ class BTInput extends TwLitElement$3 {
|
|
|
4949
5005
|
?disabled=${(_d = this.disabled) !== null && _d !== void 0 ? _d : false}
|
|
4950
5006
|
?required=${(_e = this.required) !== null && _e !== void 0 ? _e : false}
|
|
4951
5007
|
@input=${(e) => (this.value = e.target.value)}
|
|
5008
|
+
aria-invalid=${this.invalid}
|
|
4952
5009
|
/>
|
|
4953
5010
|
<slot name="helper-text"></slot>
|
|
4954
5011
|
</div>`;
|
|
@@ -4978,6 +5035,10 @@ __decorate([
|
|
|
4978
5035
|
n$1({ type: Boolean }),
|
|
4979
5036
|
__metadata("design:type", Object)
|
|
4980
5037
|
], BTInput.prototype, "required", void 0);
|
|
5038
|
+
__decorate([
|
|
5039
|
+
n$1({ type: Boolean }),
|
|
5040
|
+
__metadata("design:type", Object)
|
|
5041
|
+
], BTInput.prototype, "invalid", void 0);
|
|
4981
5042
|
if (!customElements.get('bt-input')) {
|
|
4982
5043
|
customElements.define('bt-input', BTInput);
|
|
4983
5044
|
}
|
package/index.js
CHANGED
|
@@ -899,33 +899,88 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
899
899
|
|
|
900
900
|
var css_248z = "@import 'tailwindcss';\n\n@layer base {\n :root,\n :host {\n font-family: 'Inter', sans-serif;\n }\n}\n\n@theme {\n --color-primary: #18181b;\n --color-primary-foreground: #fafafa;\n\n /* button colors */\n --color-secondary: #f4f4f5;\n --color-secondary-foreground: #18181b;\n --color-destructive: #dc2626;\n --color-destructive-foreground: #fef2f2;\n --color-background: #ffffff;\n --color-input: #e4e4e7;\n --color-accent: #f4f4f5;\n --color-accent-foreground: #18181b;\n\n --color-card: #ffffff;\n --color-card-foreground: #09090b;\n --color-border: #e4e4e7;\n\n --color-sidebar-ring: #a1a1aa;\n\n --color-muted: #f7f7f6;\n --color-muted-foreground: #74716e;\n\n --color-orange-10: #fff3e6;\n --color-orange-20: #ffdfbf;\n --color-orange-30: #ffb47f;\n --color-orange-40: #ff8446;\n --color-orange-50: #f25c2b;\n --color-orange-60: #cd4b27;\n --color-orange-70: #b03719;\n --color-orange-80: #892c0f;\n --color-orange-90: #61170d;\n --color-orange-100: #520c03;\n\n --color-neutral-10: #f1f4f8;\n --color-neutral-20: #dbe2eb;\n --color-neutral-30: #bfccda;\n --color-neutral-40: #a3b2c6;\n --color-neutral-50: #8799af;\n --color-neutral-60: #677c95;\n --color-neutral-70: #4e647f;\n --color-neutral-80: #394d66;\n --color-neutral-90: #293b51;\n --color-neutral-100: #172a41;\n\n --color-blue-10: #dbeafe;\n --color-blue-20: #bfdbfe;\n --color-blue-30: #93c5fd;\n --color-blue-40: #60a5fa;\n --color-blue-50: #3b82f6;\n --color-blue-60: #2563eb;\n --color-blue-70: #1d4ed8;\n --color-blue-80: #1e40af;\n --color-blue-90: #1e3a8a;\n --color-blue-100: #172554;\n\n --shadow-base: 0px 1px 3px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.06);\n\n --radius-default: 16px;\n}\n";
|
|
901
901
|
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
902
|
+
/**
|
|
903
|
+
* Global stylesheet registry (shared across independently-bundled SDKs via
|
|
904
|
+
* globalThis so both bundles read/write the same Map).
|
|
905
|
+
*/
|
|
906
|
+
const REGISTRY_KEY = Symbol.for('__tw_stylesheet_registry__');
|
|
907
|
+
function getRegistry() {
|
|
908
|
+
const g = globalThis;
|
|
909
|
+
if (!g[REGISTRY_KEY]) {
|
|
910
|
+
g[REGISTRY_KEY] = new Map();
|
|
911
|
+
}
|
|
912
|
+
return g[REGISTRY_KEY];
|
|
913
|
+
}
|
|
914
|
+
function createProcessedStylesheet(cssText) {
|
|
915
|
+
const sheet = new CSSStyleSheet();
|
|
916
|
+
sheet.replaceSync(cssText);
|
|
917
|
+
if (typeof CSSPropertyRule !== 'undefined' && isIterable(sheet.cssRules)) {
|
|
918
|
+
const properties = [];
|
|
919
|
+
for (const rule of sheet.cssRules) {
|
|
920
|
+
if (rule instanceof CSSPropertyRule && rule.initialValue) {
|
|
909
921
|
properties.push(`${rule.name}: ${rule.initialValue}`);
|
|
910
922
|
}
|
|
911
923
|
}
|
|
924
|
+
if (properties.length > 0) {
|
|
925
|
+
sheet.insertRule(`:host { ${properties.join('; ')} }`);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
return sheet;
|
|
929
|
+
}
|
|
930
|
+
// Default stylesheet for standalone lit-ui-kit usage (no namespace context).
|
|
931
|
+
const defaultStylesheet = createProcessedStylesheet(css_248z);
|
|
932
|
+
/**
|
|
933
|
+
* Namespace resolution — walks up through shadow DOM boundaries to find the
|
|
934
|
+
* nearest ancestor with a `data-tw-namespace` attribute.
|
|
935
|
+
*/
|
|
936
|
+
function resolveStylesheet(element) {
|
|
937
|
+
const registry = getRegistry();
|
|
938
|
+
if (registry.size === 0) {
|
|
939
|
+
return defaultStylesheet;
|
|
940
|
+
}
|
|
941
|
+
let node = element;
|
|
942
|
+
while (node) {
|
|
943
|
+
if (node instanceof HTMLElement && node.dataset['twNamespace']) {
|
|
944
|
+
const sheet = registry.get(node.dataset['twNamespace']);
|
|
945
|
+
if (sheet) {
|
|
946
|
+
return sheet;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
const root = node.getRootNode();
|
|
950
|
+
if (root instanceof ShadowRoot) {
|
|
951
|
+
node = root.host;
|
|
952
|
+
}
|
|
953
|
+
else {
|
|
954
|
+
node = node.parentElement;
|
|
955
|
+
if (!node) {
|
|
956
|
+
break;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
912
959
|
}
|
|
913
|
-
|
|
960
|
+
return defaultStylesheet;
|
|
914
961
|
}
|
|
962
|
+
/**
|
|
963
|
+
* TW Mixin — adopts the context-appropriate stylesheet into each component's
|
|
964
|
+
* shadow root.
|
|
965
|
+
*/
|
|
915
966
|
const TW = (superClass) => class extends superClass {
|
|
967
|
+
constructor() {
|
|
968
|
+
super(...arguments);
|
|
969
|
+
this.twStylesheet = null;
|
|
970
|
+
}
|
|
916
971
|
connectedCallback() {
|
|
917
972
|
super.connectedCallback();
|
|
918
973
|
if (this.shadowRoot) {
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
974
|
+
const sheet = resolveStylesheet(this);
|
|
975
|
+
const adopted = this.shadowRoot.adoptedStyleSheets.filter((currentSheet) => currentSheet !== this.twStylesheet);
|
|
976
|
+
this.shadowRoot.adoptedStyleSheets = [sheet, ...adopted];
|
|
977
|
+
this.twStylesheet = sheet;
|
|
923
978
|
}
|
|
924
979
|
}
|
|
925
980
|
};
|
|
926
981
|
function isIterable(obj) {
|
|
927
982
|
return (obj != null &&
|
|
928
|
-
typeof obj
|
|
983
|
+
typeof obj === 'object' &&
|
|
929
984
|
Symbol.iterator in obj &&
|
|
930
985
|
typeof obj[Symbol.iterator] === 'function');
|
|
931
986
|
}
|
|
@@ -4925,7 +4980,7 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
4925
4980
|
}
|
|
4926
4981
|
|
|
4927
4982
|
const TwLitElement$3 = TW(i);
|
|
4928
|
-
const inputVariants = cva('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm');
|
|
4983
|
+
const inputVariants = cva('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40');
|
|
4929
4984
|
class BTInput extends TwLitElement$3 {
|
|
4930
4985
|
constructor() {
|
|
4931
4986
|
super(...arguments);
|
|
@@ -4935,6 +4990,7 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
4935
4990
|
this.value = '';
|
|
4936
4991
|
this.disabled = false;
|
|
4937
4992
|
this.required = false;
|
|
4993
|
+
this.invalid = false;
|
|
4938
4994
|
}
|
|
4939
4995
|
render() {
|
|
4940
4996
|
var _a, _b, _c, _d, _e;
|
|
@@ -4950,6 +5006,7 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
4950
5006
|
?disabled=${(_d = this.disabled) !== null && _d !== void 0 ? _d : false}
|
|
4951
5007
|
?required=${(_e = this.required) !== null && _e !== void 0 ? _e : false}
|
|
4952
5008
|
@input=${(e) => (this.value = e.target.value)}
|
|
5009
|
+
aria-invalid=${this.invalid}
|
|
4953
5010
|
/>
|
|
4954
5011
|
<slot name="helper-text"></slot>
|
|
4955
5012
|
</div>`;
|
|
@@ -4979,6 +5036,10 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
4979
5036
|
n$1({ type: Boolean }),
|
|
4980
5037
|
__metadata("design:type", Object)
|
|
4981
5038
|
], BTInput.prototype, "required", void 0);
|
|
5039
|
+
__decorate([
|
|
5040
|
+
n$1({ type: Boolean }),
|
|
5041
|
+
__metadata("design:type", Object)
|
|
5042
|
+
], BTInput.prototype, "invalid", void 0);
|
|
4982
5043
|
if (!customElements.get('bt-input')) {
|
|
4983
5044
|
customElements.define('bt-input', BTInput);
|
|
4984
5045
|
}
|
package/index.mjs
CHANGED
|
@@ -896,33 +896,88 @@ const e$1=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&"object"
|
|
|
896
896
|
|
|
897
897
|
var css_248z = "@import 'tailwindcss';\n\n@layer base {\n :root,\n :host {\n font-family: 'Inter', sans-serif;\n }\n}\n\n@theme {\n --color-primary: #18181b;\n --color-primary-foreground: #fafafa;\n\n /* button colors */\n --color-secondary: #f4f4f5;\n --color-secondary-foreground: #18181b;\n --color-destructive: #dc2626;\n --color-destructive-foreground: #fef2f2;\n --color-background: #ffffff;\n --color-input: #e4e4e7;\n --color-accent: #f4f4f5;\n --color-accent-foreground: #18181b;\n\n --color-card: #ffffff;\n --color-card-foreground: #09090b;\n --color-border: #e4e4e7;\n\n --color-sidebar-ring: #a1a1aa;\n\n --color-muted: #f7f7f6;\n --color-muted-foreground: #74716e;\n\n --color-orange-10: #fff3e6;\n --color-orange-20: #ffdfbf;\n --color-orange-30: #ffb47f;\n --color-orange-40: #ff8446;\n --color-orange-50: #f25c2b;\n --color-orange-60: #cd4b27;\n --color-orange-70: #b03719;\n --color-orange-80: #892c0f;\n --color-orange-90: #61170d;\n --color-orange-100: #520c03;\n\n --color-neutral-10: #f1f4f8;\n --color-neutral-20: #dbe2eb;\n --color-neutral-30: #bfccda;\n --color-neutral-40: #a3b2c6;\n --color-neutral-50: #8799af;\n --color-neutral-60: #677c95;\n --color-neutral-70: #4e647f;\n --color-neutral-80: #394d66;\n --color-neutral-90: #293b51;\n --color-neutral-100: #172a41;\n\n --color-blue-10: #dbeafe;\n --color-blue-20: #bfdbfe;\n --color-blue-30: #93c5fd;\n --color-blue-40: #60a5fa;\n --color-blue-50: #3b82f6;\n --color-blue-60: #2563eb;\n --color-blue-70: #1d4ed8;\n --color-blue-80: #1e40af;\n --color-blue-90: #1e3a8a;\n --color-blue-100: #172554;\n\n --shadow-base: 0px 1px 3px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.06);\n\n --radius-default: 16px;\n}\n";
|
|
898
898
|
|
|
899
|
-
|
|
900
|
-
stylesheet
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
899
|
+
/**
|
|
900
|
+
* Global stylesheet registry (shared across independently-bundled SDKs via
|
|
901
|
+
* globalThis so both bundles read/write the same Map).
|
|
902
|
+
*/
|
|
903
|
+
const REGISTRY_KEY = Symbol.for('__tw_stylesheet_registry__');
|
|
904
|
+
function getRegistry() {
|
|
905
|
+
const g = globalThis;
|
|
906
|
+
if (!g[REGISTRY_KEY]) {
|
|
907
|
+
g[REGISTRY_KEY] = new Map();
|
|
908
|
+
}
|
|
909
|
+
return g[REGISTRY_KEY];
|
|
910
|
+
}
|
|
911
|
+
function createProcessedStylesheet(cssText) {
|
|
912
|
+
const sheet = new CSSStyleSheet();
|
|
913
|
+
sheet.replaceSync(cssText);
|
|
914
|
+
if (typeof CSSPropertyRule !== 'undefined' && isIterable(sheet.cssRules)) {
|
|
915
|
+
const properties = [];
|
|
916
|
+
for (const rule of sheet.cssRules) {
|
|
917
|
+
if (rule instanceof CSSPropertyRule && rule.initialValue) {
|
|
906
918
|
properties.push(`${rule.name}: ${rule.initialValue}`);
|
|
907
919
|
}
|
|
908
920
|
}
|
|
921
|
+
if (properties.length > 0) {
|
|
922
|
+
sheet.insertRule(`:host { ${properties.join('; ')} }`);
|
|
923
|
+
}
|
|
909
924
|
}
|
|
910
|
-
|
|
925
|
+
return sheet;
|
|
911
926
|
}
|
|
927
|
+
// Default stylesheet for standalone lit-ui-kit usage (no namespace context).
|
|
928
|
+
const defaultStylesheet = createProcessedStylesheet(css_248z);
|
|
929
|
+
/**
|
|
930
|
+
* Namespace resolution — walks up through shadow DOM boundaries to find the
|
|
931
|
+
* nearest ancestor with a `data-tw-namespace` attribute.
|
|
932
|
+
*/
|
|
933
|
+
function resolveStylesheet(element) {
|
|
934
|
+
const registry = getRegistry();
|
|
935
|
+
if (registry.size === 0) {
|
|
936
|
+
return defaultStylesheet;
|
|
937
|
+
}
|
|
938
|
+
let node = element;
|
|
939
|
+
while (node) {
|
|
940
|
+
if (node instanceof HTMLElement && node.dataset['twNamespace']) {
|
|
941
|
+
const sheet = registry.get(node.dataset['twNamespace']);
|
|
942
|
+
if (sheet) {
|
|
943
|
+
return sheet;
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
const root = node.getRootNode();
|
|
947
|
+
if (root instanceof ShadowRoot) {
|
|
948
|
+
node = root.host;
|
|
949
|
+
}
|
|
950
|
+
else {
|
|
951
|
+
node = node.parentElement;
|
|
952
|
+
if (!node) {
|
|
953
|
+
break;
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
return defaultStylesheet;
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* TW Mixin — adopts the context-appropriate stylesheet into each component's
|
|
961
|
+
* shadow root.
|
|
962
|
+
*/
|
|
912
963
|
const TW = (superClass) => class extends superClass {
|
|
964
|
+
constructor() {
|
|
965
|
+
super(...arguments);
|
|
966
|
+
this.twStylesheet = null;
|
|
967
|
+
}
|
|
913
968
|
connectedCallback() {
|
|
914
969
|
super.connectedCallback();
|
|
915
970
|
if (this.shadowRoot) {
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
971
|
+
const sheet = resolveStylesheet(this);
|
|
972
|
+
const adopted = this.shadowRoot.adoptedStyleSheets.filter((currentSheet) => currentSheet !== this.twStylesheet);
|
|
973
|
+
this.shadowRoot.adoptedStyleSheets = [sheet, ...adopted];
|
|
974
|
+
this.twStylesheet = sheet;
|
|
920
975
|
}
|
|
921
976
|
}
|
|
922
977
|
};
|
|
923
978
|
function isIterable(obj) {
|
|
924
979
|
return (obj != null &&
|
|
925
|
-
typeof obj
|
|
980
|
+
typeof obj === 'object' &&
|
|
926
981
|
Symbol.iterator in obj &&
|
|
927
982
|
typeof obj[Symbol.iterator] === 'function');
|
|
928
983
|
}
|
|
@@ -4922,7 +4977,7 @@ if (!customElements.get('bt-helper-text')) {
|
|
|
4922
4977
|
}
|
|
4923
4978
|
|
|
4924
4979
|
const TwLitElement$3 = TW(i);
|
|
4925
|
-
const inputVariants = cva('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm');
|
|
4980
|
+
const inputVariants = cva('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40');
|
|
4926
4981
|
class BTInput extends TwLitElement$3 {
|
|
4927
4982
|
constructor() {
|
|
4928
4983
|
super(...arguments);
|
|
@@ -4932,6 +4987,7 @@ class BTInput extends TwLitElement$3 {
|
|
|
4932
4987
|
this.value = '';
|
|
4933
4988
|
this.disabled = false;
|
|
4934
4989
|
this.required = false;
|
|
4990
|
+
this.invalid = false;
|
|
4935
4991
|
}
|
|
4936
4992
|
render() {
|
|
4937
4993
|
var _a, _b, _c, _d, _e;
|
|
@@ -4947,6 +5003,7 @@ class BTInput extends TwLitElement$3 {
|
|
|
4947
5003
|
?disabled=${(_d = this.disabled) !== null && _d !== void 0 ? _d : false}
|
|
4948
5004
|
?required=${(_e = this.required) !== null && _e !== void 0 ? _e : false}
|
|
4949
5005
|
@input=${(e) => (this.value = e.target.value)}
|
|
5006
|
+
aria-invalid=${this.invalid}
|
|
4950
5007
|
/>
|
|
4951
5008
|
<slot name="helper-text"></slot>
|
|
4952
5009
|
</div>`;
|
|
@@ -4976,6 +5033,10 @@ __decorate([
|
|
|
4976
5033
|
n$1({ type: Boolean }),
|
|
4977
5034
|
__metadata("design:type", Object)
|
|
4978
5035
|
], BTInput.prototype, "required", void 0);
|
|
5036
|
+
__decorate([
|
|
5037
|
+
n$1({ type: Boolean }),
|
|
5038
|
+
__metadata("design:type", Object)
|
|
5039
|
+
], BTInput.prototype, "invalid", void 0);
|
|
4979
5040
|
if (!customElements.get('bt-input')) {
|
|
4980
5041
|
customElements.define('bt-input', BTInput);
|
|
4981
5042
|
}
|