@base-framework/ui 1.2.15 → 1.2.17

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,69 +0,0 @@
1
- import { Div as a, Header as l, H1 as r, P as c } from "@base-framework/atoms";
2
- import { Component as i, Atom as t } from "@base-framework/base";
3
- import { F as o } from "./aside-template-B9V-0xle.js";
4
- class n extends i {
5
- /**
6
- * This will declare the props for the compiler.
7
- *
8
- * @returns {void}
9
- */
10
- declareProps() {
11
- this.class = "";
12
- }
13
- /**
14
- * This will render the page.
15
- *
16
- * @returns {object}
17
- */
18
- render() {
19
- return a({ class: `${this.class || ""}` }, this.children);
20
- }
21
- }
22
- class d extends n {
23
- /**
24
- * This will be called every time the route
25
- * is activated.
26
- *
27
- * @param {object} params
28
- */
29
- update(s) {
30
- }
31
- }
32
- const p = t((e, s) => (e.class = "basic-page pt-[80px] sm:pt-0 flex flex-auto flex-col " + (e.class || ""), {
33
- tag: "section",
34
- ...e,
35
- children: s
36
- })), x = t(({ title: e, description: s }) => l({ class: "sm:py-8 px-6 md:px-5 flex flex-col" }, [
37
- r({ class: "scroll-m-20 text-3xl font-bold tracking-tight" }, e),
38
- s && c({ class: "text-base text-muted-foreground py-2 max-w-[700px]" }, s)
39
- ]));
40
- class u extends d {
41
- /**
42
- * This will declare the props for the compiler.
43
- *
44
- * @returns {void}
45
- */
46
- declareProps() {
47
- super.declareProps(), this.title = "", this.description = "";
48
- }
49
- /**
50
- * This will render the page.
51
- *
52
- * @returns {object}
53
- */
54
- render() {
55
- return p([
56
- x({
57
- title: this.title,
58
- description: this.description
59
- }),
60
- o(this.children)
61
- ]);
62
- }
63
- }
64
- export {
65
- d as B,
66
- u as F,
67
- p as M,
68
- n as P
69
- };
@@ -1,255 +0,0 @@
1
- import { Div as h, Label as f, Checkbox as m, Span as p, OnState as x, I as k, Input as n, Textarea as g, Img as y } from "@base-framework/atoms";
2
- import { Jot as b, Atom as s, Component as I } from "@base-framework/base";
3
- import { Icons as C } from "./icons.es.js";
4
- const v = "flex h-10 w-full px-3 py-2 text-sm", r = "rounded-md border border-border bg-input", l = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background", c = "disabled:cursor-not-allowed disabled:opacity-50 [&:user-invalid]:border-destructive", o = "placeholder:text-muted-foreground", $ = `${v} ${r} ${l} ${o} ${c}`, w = ({ id: e, checked: a, bind: t, required: d }) => m({
5
- id: e,
6
- cache: "checkbox",
7
- class: "absolute opacity-0 w-full h-full cursor-pointer pointer-events-none",
8
- aria: {
9
- checked: ["checked"]
10
- },
11
- required: d,
12
- checked: a,
13
- bind: t
14
- }), T = () => p({ class: "absolute text-xs pointer-events-none" }, [
15
- x(
16
- "checked",
17
- (e) => e ? k({
18
- class: "w-2 h-2 pointer-events-none",
19
- html: C.check
20
- }) : null
21
- )
22
- ]), H = ({ id: e, bind: a, checked: t, required: d, clickHandler: u }) => h({
23
- class: `relative flex items-center justify-center w-5 h-5 transition-colors duration-200 hover:border-accent-foreground
24
- rounded-md border
25
- ${l}
26
- ${c}`.trim(),
27
- onState: [
28
- "checked",
29
- {
30
- "bg-primary": !0,
31
- "text-primary-foreground": !0,
32
- "border-primary": !0
33
- }
34
- ],
35
- role: "checkbox",
36
- aria: {
37
- checked: ["checked"]
38
- },
39
- tabIndex: 0,
40
- click: u
41
- }, [
42
- w({ bind: a, checked: t, id: e, required: d }),
43
- T()
44
- ]), D = ({ id: e, label: a, clickHandler: t }) => f({
45
- class: "text-base cursor-pointer",
46
- htmlFor: e,
47
- click: t
48
- }, a), V = b(
49
- {
50
- /**
51
- * This will initialize the state of the checkbox.
52
- *
53
- * @returns {object}
54
- */
55
- state() {
56
- return {
57
- // @ts-ignore
58
- checked: this.checked ?? !1
59
- };
60
- },
61
- /**
62
- * This is added to check the checkbox after the component is rendered
63
- * to see if the bind updated the checked value.
64
- *
65
- * @returns {void}
66
- */
67
- after() {
68
- this.state.checked = this.checkbox.checked;
69
- },
70
- /**
71
- * This will handle the click event for the checkbox.
72
- *
73
- * @param {object} e
74
- * @returns {void}
75
- */
76
- clickHandler(e) {
77
- e.preventDefault(), e.stopPropagation(), this.state.toggle("checked"), this.checkbox.checked = this.state.checked, typeof this.onChange == "function" && this.onChange(this.state.checked, this);
78
- },
79
- /**
80
- * This will render the checkbox component.
81
- *
82
- * @returns {object}
83
- */
84
- render() {
85
- const e = this.getId(), a = (t) => this.clickHandler(t);
86
- return h({ class: `flex items-center gap-x-2 cursor-pointer ${this.class || ""}` }, [
87
- H({
88
- id: e,
89
- // @ts-ignore
90
- bind: this.bind,
91
- // @ts-ignore
92
- checked: this.state.checked,
93
- // @ts-ignore
94
- required: this.required,
95
- // @ts-ignore
96
- clickHandler: a
97
- }),
98
- // @ts-ignore
99
- this.label && D({ id: e, label: this.label, clickHandler: a })
100
- ]);
101
- }
102
- }
103
- ), E = (e) => {
104
- if (!e || e.length === 0) return "";
105
- const t = e.replace(/\D/g, "").match(/^(\d{0,3})(\d{0,3})(\d{0,4})$/);
106
- return t ? t[2] ? `(${t[1]}) ${t[2]}${t[3] ? "-" + t[3] : ""}` : t[1] || "" : e;
107
- }, P = (e) => {
108
- const a = e.target, t = E(a.value);
109
- t && (a.value = t);
110
- }, i = s((e) => n({
111
- ...e,
112
- // @ts-ignore
113
- class: `${$} ${e.class || ""}`.trim()
114
- })), j = s((e) => i({
115
- ...e,
116
- type: "tel",
117
- // @ts-ignore
118
- name: e.name || "Phone",
119
- // @ts-ignore
120
- label: e.label || "Phone",
121
- placeholder: "(555) 555-5555",
122
- // @ts-ignore
123
- pattern: e.pattern || "\\(\\d{3}\\) \\d{3}-\\d{4}",
124
- keyup: P
125
- })), q = s((e) => i({
126
- ...e,
127
- type: "email",
128
- // @ts-ignore
129
- name: e.name || "Email",
130
- // @ts-ignore
131
- label: e.label || "Email",
132
- placeholder: "Email address"
133
- })), J = s((e) => g({
134
- ...e,
135
- as: "textarea",
136
- // @ts-ignore
137
- class: `flex w-full h-24 px-3 py-2 text-sm ${r} ${l} ${o} ${c} ${e.class || ""}`.trim()
138
- })), N = (e = {}) => h({ class: "flex items-center gap-x-2" }, [
139
- n({
140
- ...e,
141
- type: "radio",
142
- class: "cursor-pointer appearance-none h-4 w-4 border rounded-full checked:border-primary checked:bg-primary focus:ring focus:ring-primary".trim()
143
- }),
144
- e.label && f({ forHTML: e.value, class: "cursor-pointer" }, e.label)
145
- ]), R = s((e) => n({
146
- ...e,
147
- type: "date",
148
- // @ts-ignore
149
- class: `${r} ${l} ${o} ${c} px-3 py-2 text-sm ring-offset-background ${e.class || ""}`.trim()
150
- })), U = s((e) => n({
151
- ...e,
152
- type: "time",
153
- // @ts-ignore
154
- class: `${r} ${l} ${o} ${c} px-3 py-2 text-sm ring-offset-background ${e.class || ""}`.trim()
155
- })), W = s((e) => n({
156
- ...e,
157
- type: "datetime-local",
158
- // @ts-ignore
159
- class: `${r} ${l} ${o} ${c} px-3 py-2 text-sm ring-offset-background ${e.class || ""}`.trim()
160
- })), z = s((e) => n({
161
- ...e,
162
- type: "month",
163
- // @ts-ignore
164
- class: `${r} ${l} ${o} ${c} px-3 py-2 text-sm ring-offset-background ${e.class || ""}`.trim()
165
- })), A = s((e) => n({
166
- ...e,
167
- type: "week",
168
- // @ts-ignore
169
- class: `${r} ${l} ${o} ${c} px-3 py-2 text-sm ring-offset-background ${e.class || ""}`.trim()
170
- })), B = s((e) => i({
171
- ...e,
172
- type: "number"
173
- })), G = s((e) => i({
174
- ...e,
175
- type: "password"
176
- }));
177
- s((e) => i({
178
- ...e,
179
- type: "search"
180
- }));
181
- const K = s((e) => i({
182
- ...e,
183
- type: "url"
184
- })), Q = s((e) => i({
185
- ...e,
186
- type: "hidden"
187
- })), X = s((e) => n({
188
- ...e,
189
- type: "color",
190
- // @ts-ignore
191
- class: `${r} text-foreground p-0 ${c} ${e.class || ""}`.trim()
192
- }));
193
- s((e) => m({
194
- ...e,
195
- // @ts-ignore
196
- class: `flex h-4 w-4 text-foreground ${r} ${l} ${c} ${e.class || ""}`.trim()
197
- }));
198
- const F = "file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground", Y = s((e) => n({
199
- ...e,
200
- type: "file",
201
- // @ts-ignore
202
- class: `${$} ${F} ${e.class || ""}`.trim()
203
- }));
204
- class L extends I {
205
- /**
206
- * This will set the component context.
207
- *
208
- * @param {object|null} context
209
- * @returns {object|null}
210
- */
211
- setContext(a) {
212
- if (this.data)
213
- return null;
214
- const t = this?.parent?.data ?? this?.parent?.context?.data ?? this?.parent?.state ?? null;
215
- return t ? { data: t } : null;
216
- }
217
- }
218
- const Z = (e) => (
219
- /** @type {VeilComponentConstructor} */
220
- b(e, L)
221
- ), _ = s(({ src: e, alt: a, class: t, checkPath: d = !0 }) => !e || (t = t || "", d && e.indexOf(".") === -1 && e.indexOf("[[") === -1) ? null : y({
222
- class: `absolute w-full h-full object-cover fadeIn ${t}`,
223
- src: e,
224
- alt: a,
225
- load: (u) => u.target.style.visibility = "visible",
226
- /**
227
- * If there's an error loading the image, hide it.
228
- */
229
- error: (u) => u.target.style.visibility = "hidden"
230
- }));
231
- export {
232
- V as C,
233
- R as D,
234
- q as E,
235
- Y as F,
236
- Q as H,
237
- _ as I,
238
- z as M,
239
- B as N,
240
- G as P,
241
- N as R,
242
- j as T,
243
- K as U,
244
- L as V,
245
- A as W,
246
- X as a,
247
- W as b,
248
- i as c,
249
- J as d,
250
- U as e,
251
- Z as f,
252
- l as g,
253
- c as h,
254
- $ as i
255
- };