@bquery/bquery 1.3.0 → 1.5.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.
Files changed (138) hide show
  1. package/README.md +546 -501
  2. package/dist/component/component.d.ts.map +1 -1
  3. package/dist/component/index.d.ts +2 -0
  4. package/dist/component/index.d.ts.map +1 -1
  5. package/dist/component/library.d.ts +34 -0
  6. package/dist/component/library.d.ts.map +1 -0
  7. package/dist/component/types.d.ts +10 -6
  8. package/dist/component/types.d.ts.map +1 -1
  9. package/dist/component-CY5MVoYN.js +531 -0
  10. package/dist/component-CY5MVoYN.js.map +1 -0
  11. package/dist/component.es.mjs +6 -184
  12. package/dist/config-DRmZZno3.js +40 -0
  13. package/dist/config-DRmZZno3.js.map +1 -0
  14. package/dist/core/collection.d.ts +19 -3
  15. package/dist/core/collection.d.ts.map +1 -1
  16. package/dist/core/element.d.ts +23 -4
  17. package/dist/core/element.d.ts.map +1 -1
  18. package/dist/core/index.d.ts +1 -0
  19. package/dist/core/index.d.ts.map +1 -1
  20. package/dist/core/utils/function.d.ts +21 -4
  21. package/dist/core/utils/function.d.ts.map +1 -1
  22. package/dist/core-CK2Mfpf4.js +648 -0
  23. package/dist/core-CK2Mfpf4.js.map +1 -0
  24. package/dist/core-DPdbItcq.js +112 -0
  25. package/dist/core-DPdbItcq.js.map +1 -0
  26. package/dist/core.es.mjs +45 -1218
  27. package/dist/full.d.ts +6 -6
  28. package/dist/full.d.ts.map +1 -1
  29. package/dist/full.es.mjs +98 -92
  30. package/dist/full.iife.js +173 -3
  31. package/dist/full.iife.js.map +1 -1
  32. package/dist/full.umd.js +173 -3
  33. package/dist/full.umd.js.map +1 -1
  34. package/dist/index.es.mjs +143 -139
  35. package/dist/motion/transition.d.ts +1 -1
  36. package/dist/motion/transition.d.ts.map +1 -1
  37. package/dist/motion/types.d.ts +11 -1
  38. package/dist/motion/types.d.ts.map +1 -1
  39. package/dist/motion-C5DRdPnO.js +415 -0
  40. package/dist/motion-C5DRdPnO.js.map +1 -0
  41. package/dist/motion.es.mjs +25 -361
  42. package/dist/object-qGpWr6-J.js +38 -0
  43. package/dist/object-qGpWr6-J.js.map +1 -0
  44. package/dist/platform/announcer.d.ts +59 -0
  45. package/dist/platform/announcer.d.ts.map +1 -0
  46. package/dist/platform/config.d.ts +92 -0
  47. package/dist/platform/config.d.ts.map +1 -0
  48. package/dist/platform/cookies.d.ts +45 -0
  49. package/dist/platform/cookies.d.ts.map +1 -0
  50. package/dist/platform/index.d.ts +8 -0
  51. package/dist/platform/index.d.ts.map +1 -1
  52. package/dist/platform/meta.d.ts +62 -0
  53. package/dist/platform/meta.d.ts.map +1 -0
  54. package/dist/platform/storage.d.ts.map +1 -1
  55. package/dist/platform-B7JhGBc7.js +361 -0
  56. package/dist/platform-B7JhGBc7.js.map +1 -0
  57. package/dist/platform.es.mjs +11 -243
  58. package/dist/reactive/async-data.d.ts +114 -0
  59. package/dist/reactive/async-data.d.ts.map +1 -0
  60. package/dist/reactive/core.d.ts +12 -0
  61. package/dist/reactive/core.d.ts.map +1 -1
  62. package/dist/reactive/effect.d.ts.map +1 -1
  63. package/dist/reactive/index.d.ts +2 -2
  64. package/dist/reactive/index.d.ts.map +1 -1
  65. package/dist/reactive/internals.d.ts +6 -0
  66. package/dist/reactive/internals.d.ts.map +1 -1
  67. package/dist/reactive/signal.d.ts +2 -0
  68. package/dist/reactive/signal.d.ts.map +1 -1
  69. package/dist/reactive-BDya-ia8.js +253 -0
  70. package/dist/reactive-BDya-ia8.js.map +1 -0
  71. package/dist/reactive.es.mjs +18 -34
  72. package/dist/router-CijiICxt.js +188 -0
  73. package/dist/router-CijiICxt.js.map +1 -0
  74. package/dist/router.es.mjs +11 -200
  75. package/dist/sanitize-jyJ2ryE2.js +302 -0
  76. package/dist/sanitize-jyJ2ryE2.js.map +1 -0
  77. package/dist/security/constants.d.ts.map +1 -1
  78. package/dist/security/sanitize-core.d.ts.map +1 -1
  79. package/dist/security.es.mjs +10 -56
  80. package/dist/store-CPK9E62U.js +262 -0
  81. package/dist/store-CPK9E62U.js.map +1 -0
  82. package/dist/store.es.mjs +12 -25
  83. package/dist/view/evaluate.d.ts.map +1 -1
  84. package/dist/view-Cdi0g-qo.js +396 -0
  85. package/dist/view-Cdi0g-qo.js.map +1 -0
  86. package/dist/view.es.mjs +10 -424
  87. package/package.json +136 -132
  88. package/src/component/component.ts +319 -289
  89. package/src/component/index.ts +42 -40
  90. package/src/component/library.ts +504 -0
  91. package/src/component/types.ts +91 -85
  92. package/src/core/collection.ts +44 -4
  93. package/src/core/element.ts +33 -5
  94. package/src/core/index.ts +1 -0
  95. package/src/core/utils/function.ts +56 -15
  96. package/src/full.ts +223 -187
  97. package/src/motion/transition.ts +97 -51
  98. package/src/motion/types.ts +208 -198
  99. package/src/platform/announcer.ts +208 -0
  100. package/src/platform/config.ts +163 -0
  101. package/src/platform/cookies.ts +165 -0
  102. package/src/platform/index.ts +39 -18
  103. package/src/platform/meta.ts +168 -0
  104. package/src/platform/storage.ts +8 -1
  105. package/src/reactive/async-data.ts +486 -0
  106. package/src/reactive/core.ts +21 -0
  107. package/src/reactive/effect.ts +18 -7
  108. package/src/reactive/index.ts +37 -23
  109. package/src/reactive/internals.ts +18 -1
  110. package/src/reactive/signal.ts +29 -20
  111. package/src/security/constants.ts +211 -209
  112. package/src/security/sanitize-core.ts +22 -1
  113. package/src/view/evaluate.ts +29 -13
  114. package/dist/batch-4LAvfLE7.js +0 -13
  115. package/dist/batch-4LAvfLE7.js.map +0 -1
  116. package/dist/component.es.mjs.map +0 -1
  117. package/dist/core-COenAZjD.js +0 -145
  118. package/dist/core-COenAZjD.js.map +0 -1
  119. package/dist/core.es.mjs.map +0 -1
  120. package/dist/full.es.mjs.map +0 -1
  121. package/dist/index.es.mjs.map +0 -1
  122. package/dist/motion.es.mjs.map +0 -1
  123. package/dist/persisted-Dz_ryNuC.js +0 -278
  124. package/dist/persisted-Dz_ryNuC.js.map +0 -1
  125. package/dist/platform.es.mjs.map +0 -1
  126. package/dist/reactive.es.mjs.map +0 -1
  127. package/dist/router.es.mjs.map +0 -1
  128. package/dist/sanitize-1FBEPAFH.js +0 -272
  129. package/dist/sanitize-1FBEPAFH.js.map +0 -1
  130. package/dist/security.es.mjs.map +0 -1
  131. package/dist/store.es.mjs.map +0 -1
  132. package/dist/type-guards-DRma3-Kc.js +0 -16
  133. package/dist/type-guards-DRma3-Kc.js.map +0 -1
  134. package/dist/untrack-BuEQKH7_.js +0 -6
  135. package/dist/untrack-BuEQKH7_.js.map +0 -1
  136. package/dist/view.es.mjs.map +0 -1
  137. package/dist/watch-CXyaBC_9.js +0 -58
  138. package/dist/watch-CXyaBC_9.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/component/component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,SAAS,CAAC;AAEnE;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpE,SAAS,MAAM,EACf,YAAY,mBAAmB,CAAC,MAAM,CAAC,KACtC,OAAO,WA4MT,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9D,SAAS,MAAM,EACf,YAAY,mBAAmB,CAAC,MAAM,CAAC,KACtC,IAMF,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/component/component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,SAAS,CAAC;AAEnE;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpE,SAAS,MAAM,EACf,YAAY,mBAAmB,CAAC,MAAM,CAAC,KACtC,OAAO,WA0OT,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9D,SAAS,MAAM,EACf,YAAY,mBAAmB,CAAC,MAAM,CAAC,KACtC,IAMF,CAAC"}
@@ -36,5 +36,7 @@
36
36
  */
37
37
  export { component, defineComponent } from './component';
38
38
  export { html, safeHtml } from './html';
39
+ export { registerDefaultComponents } from './library';
40
+ export type { DefaultComponentLibraryOptions, RegisteredDefaultComponents } from './library';
39
41
  export type { ComponentDefinition, ComponentRenderContext, PropDefinition } from './types';
40
42
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/component/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACxC,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/component/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,YAAY,EAAE,8BAA8B,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAC7F,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Default component library based on native Web Components.
3
+ *
4
+ * @module bquery/component
5
+ */
6
+ /** Options for registering the default component library. */
7
+ export interface DefaultComponentLibraryOptions {
8
+ /** Prefix used for all registered component tags. Defaults to `bq`. */
9
+ prefix?: string;
10
+ }
11
+ /** Tag names returned by registerDefaultComponents(). */
12
+ export interface RegisteredDefaultComponents {
13
+ /** Button component tag name. */
14
+ button: string;
15
+ /** Card component tag name. */
16
+ card: string;
17
+ /** Input component tag name. */
18
+ input: string;
19
+ /** Textarea component tag name. */
20
+ textarea: string;
21
+ /** Checkbox component tag name. */
22
+ checkbox: string;
23
+ }
24
+ /**
25
+ * Register a default set of foundational UI components.
26
+ *
27
+ * The library is intentionally small and dependency-free, providing common
28
+ * primitives that can be themed via shadow parts and CSS custom properties.
29
+ *
30
+ * @param options - Optional registration settings such as a custom tag prefix
31
+ * @returns The registered tag names for each component
32
+ */
33
+ export declare const registerDefaultComponents: (options?: DefaultComponentLibraryOptions) => RegisteredDefaultComponents;
34
+ //# sourceMappingURL=library.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../src/component/library.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,6DAA6D;AAC7D,MAAM,WAAW,8BAA8B;IAC7C,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,yDAAyD;AACzD,MAAM,WAAW,2BAA2B;IAC1C,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAwJD;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,GACpC,UAAS,8BAAmC,KAC3C,2BAuTF,CAAC"}
@@ -52,6 +52,9 @@ export type ComponentRenderContext<TProps extends Record<string, unknown>> = {
52
52
  *
53
53
  * @template TProps - Type of the component's props
54
54
  */
55
+ type ComponentHook<TResult = void> = ((this: HTMLElement) => TResult) | (() => TResult);
56
+ type ComponentHookWithProps<TProps extends Record<string, unknown>, TResult = void> = ((this: HTMLElement, props: TProps) => TResult) | ((props: TProps) => TResult);
57
+ type ComponentErrorHook = ((this: HTMLElement, error: Error) => void) | ((error: Error) => void);
55
58
  export type ComponentDefinition<TProps extends Record<string, unknown> = Record<string, unknown>> = {
56
59
  /** Prop definitions with types and defaults */
57
60
  props?: Record<keyof TProps, PropDefinition>;
@@ -60,18 +63,19 @@ export type ComponentDefinition<TProps extends Record<string, unknown> = Record<
60
63
  /** CSS styles scoped to the component's shadow DOM */
61
64
  styles?: string;
62
65
  /** Lifecycle hook called before the component mounts (before first render) */
63
- beforeMount?: () => void;
66
+ beforeMount?: ComponentHook;
64
67
  /** Lifecycle hook called when component is added to DOM */
65
- connected?: () => void;
68
+ connected?: ComponentHook;
66
69
  /** Lifecycle hook called when component is removed from DOM */
67
- disconnected?: () => void;
70
+ disconnected?: ComponentHook;
68
71
  /** Lifecycle hook called before an update render; return false to prevent */
69
- beforeUpdate?: (props: TProps) => boolean | void;
72
+ beforeUpdate?: ComponentHookWithProps<TProps, boolean | void>;
70
73
  /** Lifecycle hook called after reactive updates trigger a render */
71
- updated?: () => void;
74
+ updated?: ComponentHook;
72
75
  /** Error handler for errors during rendering or lifecycle */
73
- onError?: (error: Error) => void;
76
+ onError?: ComponentErrorHook;
74
77
  /** Render function returning HTML string */
75
78
  render: (context: ComponentRenderContext<TProps>) => string;
76
79
  };
80
+ export {};
77
81
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/component/types.ts"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AAC,EAAE,aAAa,CAAC;IAC5B,2DAA2D;IAC3D,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,+DAA+D;IAC/D,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC,CAAC;IAC9D,oEAAoE;IACpE,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,4CAA4C;IAC5C,MAAM,EAAE,CAAC,OAAO,EAAE,sBAAsB,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC;CAC7D,CAAC"}
@@ -0,0 +1,531 @@
1
+ import { n as v, t as x } from "./sanitize-jyJ2ryE2.js";
2
+ import { n as $ } from "./config-DRmZZno3.js";
3
+ var w = (r, t) => {
4
+ const { type: a } = t;
5
+ if (a === String) return r;
6
+ if (a === Number) return Number(r);
7
+ if (a === Boolean) {
8
+ const e = r.trim().toLowerCase();
9
+ return e === "" || e === "true" || e === "1" ? !0 : e === "false" || e === "0" ? !1 : !!r;
10
+ }
11
+ if (a === Object || a === Array) try {
12
+ return JSON.parse(r);
13
+ } catch {
14
+ return r;
15
+ }
16
+ if (typeof a == "function") {
17
+ const e = a, o = a;
18
+ if (t.construct === !0) return Reflect.construct(o, [r]);
19
+ if (t.construct === !1) return e(r);
20
+ const n = a.prototype !== void 0 && a.prototype !== null, l = (n ? Object.getOwnPropertyNames(a.prototype) : []).length > 1, i = n && a.prototype.constructor !== a, d = /^class\s/.test(Function.prototype.toString.call(a));
21
+ if (l || i || d) try {
22
+ return Reflect.construct(o, [r]);
23
+ } catch {
24
+ return e(r);
25
+ }
26
+ try {
27
+ const c = e(r);
28
+ if (c === void 0 && n) try {
29
+ return Reflect.construct(o, [r]);
30
+ } catch {
31
+ return c;
32
+ }
33
+ return c;
34
+ } catch (c) {
35
+ if (c instanceof TypeError && /cannot be invoked without 'new'|is not a function/i.test(c.message)) return Reflect.construct(o, [r]);
36
+ throw c;
37
+ }
38
+ }
39
+ return r;
40
+ }, S = (r, t) => {
41
+ class a extends HTMLElement {
42
+ constructor() {
43
+ super(), this.state = { ...t.state ?? {} }, this.props = {}, this.missingRequiredProps = /* @__PURE__ */ new Set(), this.hasMounted = !1, this.attachShadow({ mode: "open" }), this.syncProps();
44
+ }
45
+ static get observedAttributes() {
46
+ return Object.keys(t.props ?? {});
47
+ }
48
+ connectedCallback() {
49
+ try {
50
+ if (this.missingRequiredProps.size > 0) return;
51
+ this.mount();
52
+ } catch (o) {
53
+ this.handleError(o);
54
+ }
55
+ }
56
+ mount() {
57
+ this.hasMounted || (t.beforeMount?.call(this), t.connected?.call(this), this.render(), this.hasMounted = !0);
58
+ }
59
+ disconnectedCallback() {
60
+ try {
61
+ t.disconnected?.call(this);
62
+ } catch (o) {
63
+ this.handleError(o);
64
+ }
65
+ }
66
+ attributeChangedCallback(o, n, l) {
67
+ try {
68
+ this.syncProps(), this.hasMounted ? this.render(!0) : this.isConnected && this.missingRequiredProps.size === 0 && this.mount();
69
+ } catch (i) {
70
+ this.handleError(i);
71
+ }
72
+ }
73
+ handleError(o) {
74
+ t.onError ? t.onError.call(this, o) : console.error(`bQuery component error in <${r}>:`, o);
75
+ }
76
+ setState(o, n) {
77
+ this.state[o] = n, this.render(!0);
78
+ }
79
+ getState(o) {
80
+ return this.state[o];
81
+ }
82
+ syncProps() {
83
+ const o = t.props ?? {};
84
+ for (const [n, l] of Object.entries(o)) {
85
+ const i = this.getAttribute(n);
86
+ let d;
87
+ if (i == null ? l.required && l.default === void 0 ? (this.missingRequiredProps.add(n), d = void 0) : d = l.default ?? void 0 : (this.missingRequiredProps.has(n) && this.missingRequiredProps.delete(n), d = w(i, l)), l.validator && d !== void 0 && !l.validator(d))
88
+ throw new Error(`bQuery component: validation failed for prop "${n}" with value ${JSON.stringify(d)}`);
89
+ this.props[n] = d;
90
+ }
91
+ }
92
+ render(o = !1) {
93
+ try {
94
+ if (o && t.beforeUpdate && t.beforeUpdate.call(this, this.props) === !1)
95
+ return;
96
+ const n = (i, d) => {
97
+ this.dispatchEvent(new CustomEvent(i, {
98
+ detail: d,
99
+ bubbles: !0,
100
+ composed: !0
101
+ }));
102
+ };
103
+ if (!this.shadowRoot) return;
104
+ const l = v(t.render({
105
+ props: this.props,
106
+ state: this.state,
107
+ emit: n
108
+ }), {
109
+ allowTags: ["slot"],
110
+ allowAttributes: [
111
+ "part",
112
+ "disabled",
113
+ "checked",
114
+ "placeholder",
115
+ "value",
116
+ "rows",
117
+ "cols",
118
+ "readonly",
119
+ "required",
120
+ "maxlength",
121
+ "minlength",
122
+ "max",
123
+ "min",
124
+ "step",
125
+ "pattern",
126
+ "autocomplete",
127
+ "autofocus",
128
+ "for",
129
+ "multiple",
130
+ "selected",
131
+ "wrap"
132
+ ]
133
+ });
134
+ if (this.shadowRoot.innerHTML = l, t.styles) {
135
+ const i = document.createElement("style");
136
+ i.textContent = t.styles, this.shadowRoot.prepend(i);
137
+ }
138
+ o && t.updated?.call(this);
139
+ } catch (n) {
140
+ this.handleError(n);
141
+ }
142
+ }
143
+ }
144
+ return a;
145
+ }, u = (r, t) => {
146
+ const a = S(r, t);
147
+ customElements.get(r) || customElements.define(r, a);
148
+ }, h = (r, ...t) => r.reduce((a, e, o) => `${a}${e}${t[o] ?? ""}`, ""), P = (r, ...t) => {
149
+ const a = {
150
+ "&": "&amp;",
151
+ "<": "&lt;",
152
+ ">": "&gt;",
153
+ '"': "&quot;",
154
+ "'": "&#x27;",
155
+ "`": "&#x60;"
156
+ }, e = (o) => String(o ?? "").replace(/[&<>"'`]/g, (n) => a[n]);
157
+ return r.reduce((o, n, l) => `${o}${n}${e(t[l])}`, "");
158
+ }, f = `
159
+ :host {
160
+ color: inherit;
161
+ font: inherit;
162
+ }
163
+ `, y = `
164
+ ${f}
165
+ .field {
166
+ display: inline-flex;
167
+ flex-direction: column;
168
+ gap: 0.375rem;
169
+ width: 100%;
170
+ }
171
+ .label {
172
+ color: #334155;
173
+ font-size: 0.875rem;
174
+ font-weight: 600;
175
+ }
176
+ .control {
177
+ border: 1px solid #cbd5e1;
178
+ border-radius: 0.75rem;
179
+ box-sizing: border-box;
180
+ font: inherit;
181
+ min-height: 2.75rem;
182
+ outline: none;
183
+ padding: 0.75rem 0.875rem;
184
+ width: 100%;
185
+ background: #fff;
186
+ color: #0f172a;
187
+ transition: border-color 160ms ease, box-shadow 160ms ease;
188
+ }
189
+ .control:focus {
190
+ border-color: #2563eb;
191
+ box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
192
+ }
193
+ .control:disabled {
194
+ background: #f8fafc;
195
+ color: #94a3b8;
196
+ cursor: not-allowed;
197
+ }
198
+ `, s = (r) => x(r), m = /* @__PURE__ */ new WeakMap(), b = (r, t) => m.get(r)?.[t], p = (r, t, a) => {
199
+ const e = m.get(r) ?? {};
200
+ e[t] = a, m.set(r, e);
201
+ }, g = (r) => r.shadowRoot?.querySelector(".label")?.textContent ?? "", k = (r, t) => {
202
+ const a = r.shadowRoot?.querySelector("input.control");
203
+ return !a || g(r) !== t.label || (a.getAttribute("type") ?? "text") !== t.type || (a.getAttribute("placeholder") ?? "") !== t.placeholder || (a.getAttribute("name") ?? "") !== t.name || a.disabled !== t.disabled ? !1 : (a.value !== t.value && (a.value = t.value), !0);
204
+ }, E = (r, t) => {
205
+ const a = r.shadowRoot?.querySelector("textarea.control");
206
+ return !a || g(r) !== t.label || (a.getAttribute("placeholder") ?? "") !== t.placeholder || (a.getAttribute("name") ?? "") !== t.name || a.getAttribute("rows") !== String(t.rows) || a.disabled !== t.disabled ? !1 : (a.value !== t.value && (a.value = t.value), !0);
207
+ }, C = (r) => [
208
+ "<textarea",
209
+ ' part="control"',
210
+ ' class="control"',
211
+ ` placeholder="${s(r.placeholder)}"`,
212
+ ` name="${s(r.name)}"`,
213
+ ` rows="${r.rows}"`,
214
+ r.disabled ? " disabled" : "",
215
+ `>${s(r.value)}</textarea>`
216
+ ].join(""), z = (r = {}) => {
217
+ const t = r.prefix ?? $().components?.prefix ?? "bq", a = {
218
+ button: `${t}-button`,
219
+ card: `${t}-card`,
220
+ input: `${t}-input`,
221
+ textarea: `${t}-textarea`,
222
+ checkbox: `${t}-checkbox`
223
+ };
224
+ return u(a.button, {
225
+ props: {
226
+ label: {
227
+ type: String,
228
+ default: ""
229
+ },
230
+ variant: {
231
+ type: String,
232
+ default: "primary"
233
+ },
234
+ size: {
235
+ type: String,
236
+ default: "md"
237
+ },
238
+ type: {
239
+ type: String,
240
+ default: "button"
241
+ },
242
+ disabled: {
243
+ type: Boolean,
244
+ default: !1
245
+ }
246
+ },
247
+ styles: `
248
+ ${f}
249
+ button {
250
+ appearance: none;
251
+ border: 0;
252
+ border-radius: 999px;
253
+ cursor: pointer;
254
+ display: inline-flex;
255
+ align-items: center;
256
+ justify-content: center;
257
+ font: inherit;
258
+ font-weight: 600;
259
+ gap: 0.5rem;
260
+ min-height: 2.5rem;
261
+ padding: 0.65rem 1rem;
262
+ transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
263
+ background: #2563eb;
264
+ color: #fff;
265
+ }
266
+ button[data-variant='secondary'] {
267
+ background: #e2e8f0;
268
+ color: #0f172a;
269
+ }
270
+ button[data-size='sm'] {
271
+ min-height: 2.125rem;
272
+ padding: 0.5rem 0.875rem;
273
+ }
274
+ button[data-size='lg'] {
275
+ min-height: 3rem;
276
+ padding: 0.875rem 1.25rem;
277
+ }
278
+ button:hover:not(:disabled) {
279
+ transform: translateY(-1px);
280
+ }
281
+ button:disabled {
282
+ cursor: not-allowed;
283
+ opacity: 0.6;
284
+ }
285
+ `,
286
+ render: ({ props: e }) => h`
287
+ <button
288
+ part="button"
289
+ type="${s(e.type)}"
290
+ data-variant="${s(e.variant)}"
291
+ data-size="${s(e.size)}"
292
+ ${e.disabled ? "disabled" : ""}
293
+ >
294
+ <slot>${s(e.label)}</slot>
295
+ </button>
296
+ `
297
+ }), u(a.card, {
298
+ props: {
299
+ title: {
300
+ type: String,
301
+ default: ""
302
+ },
303
+ footer: {
304
+ type: String,
305
+ default: ""
306
+ },
307
+ elevated: {
308
+ type: Boolean,
309
+ default: !0
310
+ }
311
+ },
312
+ styles: `
313
+ ${f}
314
+ article {
315
+ background: #fff;
316
+ border: 1px solid #e2e8f0;
317
+ border-radius: 1rem;
318
+ box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
319
+ color: #0f172a;
320
+ display: block;
321
+ padding: 1rem;
322
+ }
323
+ article[data-elevated='false'] {
324
+ box-shadow: none;
325
+ }
326
+ header, footer {
327
+ color: #475569;
328
+ font-size: 0.95rem;
329
+ font-weight: 600;
330
+ }
331
+ header {
332
+ margin-bottom: 0.75rem;
333
+ }
334
+ footer {
335
+ margin-top: 0.75rem;
336
+ }
337
+ `,
338
+ render: ({ props: e }) => h`
339
+ <article part="card" data-elevated="${String(e.elevated)}">
340
+ ${e.title ? `<header part="header">${s(e.title)}</header>` : ""}
341
+ <section part="body"><slot></slot></section>
342
+ ${e.footer ? `<footer part="footer">${s(e.footer)}</footer>` : ""}
343
+ </article>
344
+ `
345
+ }), u(a.input, {
346
+ props: {
347
+ label: {
348
+ type: String,
349
+ default: ""
350
+ },
351
+ type: {
352
+ type: String,
353
+ default: "text"
354
+ },
355
+ value: {
356
+ type: String,
357
+ default: ""
358
+ },
359
+ placeholder: {
360
+ type: String,
361
+ default: ""
362
+ },
363
+ name: {
364
+ type: String,
365
+ default: ""
366
+ },
367
+ disabled: {
368
+ type: Boolean,
369
+ default: !1
370
+ }
371
+ },
372
+ styles: y,
373
+ beforeUpdate(e) {
374
+ return !k(this, e);
375
+ },
376
+ connected() {
377
+ const e = (o) => {
378
+ const n = o.target;
379
+ n?.matches("input") && (o.stopPropagation(), this.setAttribute("value", n.value), this.dispatchEvent(new CustomEvent("input", {
380
+ detail: { value: n.value },
381
+ bubbles: !0,
382
+ composed: !0
383
+ })));
384
+ };
385
+ p(this, "__bqueryInputHandler", e), this.shadowRoot?.addEventListener("input", e);
386
+ },
387
+ disconnected() {
388
+ const e = b(this, "__bqueryInputHandler");
389
+ e && this.shadowRoot?.removeEventListener("input", e);
390
+ },
391
+ render: ({ props: e }) => h`
392
+ <label part="field" class="field">
393
+ ${e.label ? `<span part="label" class="label">${s(e.label)}</span>` : ""}
394
+ <input
395
+ part="control"
396
+ class="control"
397
+ type="${s(e.type)}"
398
+ value="${s(e.value)}"
399
+ placeholder="${s(e.placeholder)}"
400
+ name="${s(e.name)}"
401
+ ${e.disabled ? "disabled" : ""}
402
+ />
403
+ </label>
404
+ `
405
+ }), u(a.textarea, {
406
+ props: {
407
+ label: {
408
+ type: String,
409
+ default: ""
410
+ },
411
+ value: {
412
+ type: String,
413
+ default: ""
414
+ },
415
+ placeholder: {
416
+ type: String,
417
+ default: ""
418
+ },
419
+ name: {
420
+ type: String,
421
+ default: ""
422
+ },
423
+ rows: {
424
+ type: Number,
425
+ default: 4
426
+ },
427
+ disabled: {
428
+ type: Boolean,
429
+ default: !1
430
+ }
431
+ },
432
+ styles: `${y}
433
+ textarea.control {
434
+ min-height: 6rem;
435
+ resize: vertical;
436
+ }
437
+ `,
438
+ beforeUpdate(e) {
439
+ return !E(this, e);
440
+ },
441
+ connected() {
442
+ const e = (o) => {
443
+ const n = o.target;
444
+ n?.matches("textarea") && (o.stopPropagation(), this.setAttribute("value", n.value), this.dispatchEvent(new CustomEvent("input", {
445
+ detail: { value: n.value },
446
+ bubbles: !0,
447
+ composed: !0
448
+ })));
449
+ };
450
+ p(this, "__bqueryTextareaHandler", e), this.shadowRoot?.addEventListener("input", e);
451
+ },
452
+ disconnected() {
453
+ const e = b(this, "__bqueryTextareaHandler");
454
+ e && this.shadowRoot?.removeEventListener("input", e);
455
+ },
456
+ render: ({ props: e }) => h`
457
+ <label part="field" class="field">
458
+ ${e.label ? `<span part="label" class="label">${s(e.label)}</span>` : ""}
459
+ ${C(e)}
460
+ </label>
461
+ `
462
+ }), u(a.checkbox, {
463
+ props: {
464
+ label: {
465
+ type: String,
466
+ default: ""
467
+ },
468
+ checked: {
469
+ type: Boolean,
470
+ default: !1
471
+ },
472
+ disabled: {
473
+ type: Boolean,
474
+ default: !1
475
+ }
476
+ },
477
+ styles: `
478
+ ${f}
479
+ label {
480
+ align-items: center;
481
+ color: #0f172a;
482
+ cursor: pointer;
483
+ display: inline-flex;
484
+ gap: 0.625rem;
485
+ }
486
+ input {
487
+ accent-color: #2563eb;
488
+ block-size: 1rem;
489
+ inline-size: 1rem;
490
+ }
491
+ input:disabled {
492
+ cursor: not-allowed;
493
+ }
494
+ `,
495
+ connected() {
496
+ const e = (o) => {
497
+ const n = o.target;
498
+ n?.matches('input[type="checkbox"]') && (o.stopPropagation(), n.checked ? this.setAttribute("checked", "true") : this.removeAttribute("checked"), this.dispatchEvent(new CustomEvent("change", {
499
+ detail: { checked: n.checked },
500
+ bubbles: !0,
501
+ composed: !0
502
+ })));
503
+ };
504
+ p(this, "__bqueryCheckboxHandler", e), this.shadowRoot?.addEventListener("change", e);
505
+ },
506
+ disconnected() {
507
+ const e = b(this, "__bqueryCheckboxHandler");
508
+ e && this.shadowRoot?.removeEventListener("change", e);
509
+ },
510
+ render: ({ props: e }) => h`
511
+ <label part="label">
512
+ <input
513
+ part="control"
514
+ type="checkbox"
515
+ ${e.checked ? "checked" : ""}
516
+ ${e.disabled ? "disabled" : ""}
517
+ />
518
+ <span part="text"><slot>${s(e.label)}</slot></span>
519
+ </label>
520
+ `
521
+ }), a;
522
+ };
523
+ export {
524
+ S as a,
525
+ u as i,
526
+ h as n,
527
+ P as r,
528
+ z as t
529
+ };
530
+
531
+ //# sourceMappingURL=component-CY5MVoYN.js.map