@pathscale/ui 0.0.109 → 0.0.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/colorpicker/AlphaSlider.d.ts +7 -0
- package/dist/components/colorpicker/ColorInput.d.ts +7 -0
- package/dist/components/colorpicker/ColorPicker.d.ts +18 -0
- package/dist/components/colorpicker/ColorPickerFlowerSelector.d.ts +3 -0
- package/dist/components/colorpicker/ColorPickerGradientSelector.d.ts +3 -0
- package/dist/components/colorpicker/ColorPickerWheelSelector.d.ts +3 -0
- package/dist/components/colorpicker/ColorPreview.d.ts +11 -0
- package/dist/components/colorpicker/ColorSwatches.d.ts +8 -0
- package/dist/components/colorpicker/ColorUtils.d.ts +58 -0
- package/dist/components/colorpicker/ColorWheel.d.ts +7 -0
- package/dist/components/colorpicker/ColorWheelFlower.d.ts +7 -0
- package/dist/components/colorpicker/HueSlider.d.ts +7 -0
- package/dist/components/colorpicker/LightnessSlider.d.ts +7 -0
- package/dist/components/colorpicker/SaturationBrightness.d.ts +7 -0
- package/dist/components/colorpicker/colorpickerContext.d.ts +11 -0
- package/dist/components/colorpicker/index.d.ts +26 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2536 -1047
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4794,7 +4794,7 @@ const xt = globalThis[ot], Se = {
|
|
|
4794
4794
|
cloneNode: 1,
|
|
4795
4795
|
children: 1,
|
|
4796
4796
|
key: 1
|
|
4797
|
-
},
|
|
4797
|
+
}, cally_q = {}, rt = [];
|
|
4798
4798
|
class at extends Text {
|
|
4799
4799
|
}
|
|
4800
4800
|
const Ce = A("atomico/id"), $ = A("atomico/type"), X = A("atomico/ref"), zt = A("atomico/vnode"), Pe = ()=>{};
|
|
@@ -4802,7 +4802,7 @@ function Ne(e, t, n) {
|
|
|
4802
4802
|
return Kt(this, e, t, n);
|
|
4803
4803
|
}
|
|
4804
4804
|
const Ht = (e, t, ...n)=>{
|
|
4805
|
-
const s = t ||
|
|
4805
|
+
const s = t || cally_q;
|
|
4806
4806
|
let { children: r } = s;
|
|
4807
4807
|
if (r = r ?? (n.length ? n : rt), e === Pe) return r;
|
|
4808
4808
|
const o = e ? e instanceof Node ? 1 : e.prototype instanceof HTMLElement && 2 : 0;
|
|
@@ -4831,9 +4831,9 @@ function Kt(e, t, n = Ce, s, r) {
|
|
|
4831
4831
|
(e || !t) && (r = r || "svg" == e.type, o = "host" != e.type && (1 == e.raw ? (t && e.clone ? t[X] : t) != e.type : 2 == e.raw ? !(t instanceof e.type) : t ? t[X] || t.localName != e.type : !t), o && null != e.type && (1 == e.raw && e.clone ? (s = !0, t = e.type.cloneNode(!0), t[X] = e.type) : t = 1 == e.raw ? e.type : 2 == e.raw ? new e.type() : r ? document.createElementNS("http://www.w3.org/2000/svg", e.type) : document.createElement(e.type, e.is ? {
|
|
4832
4832
|
is: e.is
|
|
4833
4833
|
} : void 0)));
|
|
4834
|
-
const a = t[n] ? t[n] :
|
|
4834
|
+
const a = t[n] ? t[n] : cally_q, { vnode: u = cally_q, cycle: i = 0 } = a;
|
|
4835
4835
|
let { fragment: l, handlers: c } = a;
|
|
4836
|
-
const { children: d = rt, props: f =
|
|
4836
|
+
const { children: d = rt, props: f = cally_q } = u;
|
|
4837
4837
|
if (c = o ? {} : c || {}, e.static && !o) return t;
|
|
4838
4838
|
if (e.shadow && !t.shadowRoot && t.attachShadow({
|
|
4839
4839
|
mode: "open",
|
|
@@ -4992,9 +4992,9 @@ const Re = Ht("host", {
|
|
|
4992
4992
|
}
|
|
4993
4993
|
});
|
|
4994
4994
|
return t.value = e, t;
|
|
4995
|
-
},
|
|
4995
|
+
}, cally_p = (e, t, n)=>(null == t ? t = {
|
|
4996
4996
|
key: n
|
|
4997
|
-
} : t.key = n, Ht(e, t)), I =
|
|
4997
|
+
} : t.key = n, Ht(e, t)), I = cally_p, Wt = H`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation;cursor:pointer;user-select:none}`, Jt = H`.vh{position:absolute;transform:scale(0)}`;
|
|
4998
4998
|
function lt() {
|
|
4999
4999
|
const e = /* @__PURE__ */ new Date();
|
|
5000
5000
|
return new cally_v(e.getFullYear(), e.getMonth() + 1, e.getDate());
|
|
@@ -5284,7 +5284,7 @@ const We = (e, t)=>(t + e) % 7, Je = cally_j((e)=>{
|
|
|
5284
5284
|
shadowDom: !0,
|
|
5285
5285
|
focus: r,
|
|
5286
5286
|
children: [
|
|
5287
|
-
/* @__PURE__ */
|
|
5287
|
+
/* @__PURE__ */ cally_p("div", {
|
|
5288
5288
|
id: "h",
|
|
5289
5289
|
part: "heading",
|
|
5290
5290
|
children: s.formatter.format(w(s.yearMonth))
|
|
@@ -5294,18 +5294,18 @@ const We = (e, t)=>(t + e) % 7, Je = cally_j((e)=>{
|
|
|
5294
5294
|
"aria-labelledby": "h",
|
|
5295
5295
|
part: "table",
|
|
5296
5296
|
children: [
|
|
5297
|
-
/* @__PURE__ */
|
|
5298
|
-
children: /* @__PURE__ */
|
|
5297
|
+
/* @__PURE__ */ cally_p("thead", {
|
|
5298
|
+
children: /* @__PURE__ */ cally_p("tr", {
|
|
5299
5299
|
part: "tr head",
|
|
5300
5300
|
children: s.daysLong.map((o, a)=>/* @__PURE__ */ I("th", {
|
|
5301
5301
|
part: `th day day-${We(t.firstDayOfWeek, a)}`,
|
|
5302
5302
|
scope: "col",
|
|
5303
5303
|
children: [
|
|
5304
|
-
/* @__PURE__ */
|
|
5304
|
+
/* @__PURE__ */ cally_p("span", {
|
|
5305
5305
|
class: "vh",
|
|
5306
5306
|
children: o
|
|
5307
5307
|
}),
|
|
5308
|
-
/* @__PURE__ */
|
|
5308
|
+
/* @__PURE__ */ cally_p("span", {
|
|
5309
5309
|
"aria-hidden": "true",
|
|
5310
5310
|
children: s.daysVisible[a]
|
|
5311
5311
|
})
|
|
@@ -5313,14 +5313,14 @@ const We = (e, t)=>(t + e) % 7, Je = cally_j((e)=>{
|
|
|
5313
5313
|
}))
|
|
5314
5314
|
})
|
|
5315
5315
|
}),
|
|
5316
|
-
/* @__PURE__ */
|
|
5317
|
-
children: s.weeks.map((o, a)=>/* @__PURE__ */
|
|
5316
|
+
/* @__PURE__ */ cally_p("tbody", {
|
|
5317
|
+
children: s.weeks.map((o, a)=>/* @__PURE__ */ cally_p("tr", {
|
|
5318
5318
|
part: "tr week",
|
|
5319
5319
|
children: o.map((u, i)=>{
|
|
5320
5320
|
const l = s.getDayProps(u);
|
|
5321
|
-
return /* @__PURE__ */
|
|
5321
|
+
return /* @__PURE__ */ cally_p("td", {
|
|
5322
5322
|
part: "td",
|
|
5323
|
-
children: l && /* @__PURE__ */
|
|
5323
|
+
children: l && /* @__PURE__ */ cally_p("button", {
|
|
5324
5324
|
...l,
|
|
5325
5325
|
children: u.day
|
|
5326
5326
|
})
|
|
@@ -5347,11 +5347,11 @@ const We = (e, t)=>(t + e) % 7, Je = cally_j((e)=>{
|
|
|
5347
5347
|
});
|
|
5348
5348
|
customElements.define("calendar-month", Je);
|
|
5349
5349
|
function kt(e) {
|
|
5350
|
-
return /* @__PURE__ */
|
|
5350
|
+
return /* @__PURE__ */ cally_p("button", {
|
|
5351
5351
|
part: `button ${e.name} ${e.onclick ? "" : "disabled"}`,
|
|
5352
5352
|
onclick: e.onclick,
|
|
5353
5353
|
"aria-disabled": e.onclick ? null : "true",
|
|
5354
|
-
children: /* @__PURE__ */
|
|
5354
|
+
children: /* @__PURE__ */ cally_p("slot", {
|
|
5355
5355
|
name: e.name,
|
|
5356
5356
|
children: e.children
|
|
5357
5357
|
})
|
|
@@ -5364,7 +5364,7 @@ function dt(e) {
|
|
|
5364
5364
|
"aria-labelledby": "h",
|
|
5365
5365
|
part: "container",
|
|
5366
5366
|
children: [
|
|
5367
|
-
/* @__PURE__ */
|
|
5367
|
+
/* @__PURE__ */ cally_p("div", {
|
|
5368
5368
|
id: "h",
|
|
5369
5369
|
class: "vh",
|
|
5370
5370
|
"aria-live": "polite",
|
|
@@ -5374,32 +5374,32 @@ function dt(e) {
|
|
|
5374
5374
|
/* @__PURE__ */ I("div", {
|
|
5375
5375
|
part: "header",
|
|
5376
5376
|
children: [
|
|
5377
|
-
/* @__PURE__ */
|
|
5377
|
+
/* @__PURE__ */ cally_p(kt, {
|
|
5378
5378
|
name: "previous",
|
|
5379
5379
|
onclick: e.previous,
|
|
5380
5380
|
children: "Previous"
|
|
5381
5381
|
}),
|
|
5382
|
-
/* @__PURE__ */
|
|
5382
|
+
/* @__PURE__ */ cally_p("slot", {
|
|
5383
5383
|
part: "heading",
|
|
5384
5384
|
name: "heading",
|
|
5385
|
-
children: /* @__PURE__ */
|
|
5385
|
+
children: /* @__PURE__ */ cally_p("div", {
|
|
5386
5386
|
"aria-hidden": "true",
|
|
5387
5387
|
children: e.format.formatRange(t, n)
|
|
5388
5388
|
})
|
|
5389
5389
|
}),
|
|
5390
|
-
/* @__PURE__ */
|
|
5390
|
+
/* @__PURE__ */ cally_p(kt, {
|
|
5391
5391
|
name: "next",
|
|
5392
5392
|
onclick: e.next,
|
|
5393
5393
|
children: "Next"
|
|
5394
5394
|
})
|
|
5395
5395
|
]
|
|
5396
5396
|
}),
|
|
5397
|
-
/* @__PURE__ */
|
|
5397
|
+
/* @__PURE__ */ cally_p(ft, {
|
|
5398
5398
|
value: e,
|
|
5399
5399
|
onselectday: e.onSelect,
|
|
5400
5400
|
onfocusday: e.onFocus,
|
|
5401
5401
|
onhoverday: e.onHover,
|
|
5402
|
-
children: /* @__PURE__ */
|
|
5402
|
+
children: /* @__PURE__ */ cally_p("slot", {})
|
|
5403
5403
|
})
|
|
5404
5404
|
]
|
|
5405
5405
|
});
|
|
@@ -5553,10 +5553,10 @@ const Qe = cally_j((e)=>{
|
|
|
5553
5553
|
function a(u) {
|
|
5554
5554
|
n(u.detail), o.dispatch();
|
|
5555
5555
|
}
|
|
5556
|
-
return /* @__PURE__ */
|
|
5556
|
+
return /* @__PURE__ */ cally_p("host", {
|
|
5557
5557
|
shadowDom: !0,
|
|
5558
5558
|
focus: o.focus,
|
|
5559
|
-
children: /* @__PURE__ */
|
|
5559
|
+
children: /* @__PURE__ */ cally_p(dt, {
|
|
5560
5560
|
...e,
|
|
5561
5561
|
...o,
|
|
5562
5562
|
type: "date",
|
|
@@ -5595,10 +5595,10 @@ const Mt = (e, t)=>cally_v.compare(e, t) < 0 ? [
|
|
|
5595
5595
|
y.stopPropagation(), i ? (n(Mt(i, h)), l(void 0), u(w(h)), o.dispatch()) : (l(h), a(w(h)));
|
|
5596
5596
|
}
|
|
5597
5597
|
const g = i ? Mt(i, c ?? i) : t;
|
|
5598
|
-
return /* @__PURE__ */
|
|
5598
|
+
return /* @__PURE__ */ cally_p("host", {
|
|
5599
5599
|
shadowDom: !0,
|
|
5600
5600
|
focus: o.focus,
|
|
5601
|
-
children: /* @__PURE__ */
|
|
5601
|
+
children: /* @__PURE__ */ cally_p(dt, {
|
|
5602
5602
|
...e,
|
|
5603
5603
|
...o,
|
|
5604
5604
|
type: "range",
|
|
@@ -5631,10 +5631,10 @@ const tn = cally_j((e)=>{
|
|
|
5631
5631
|
], l = t.findIndex((c)=>c.equals(u.detail));
|
|
5632
5632
|
l < 0 ? i.push(u.detail) : i.splice(l, 1), n(i), o.dispatch();
|
|
5633
5633
|
}
|
|
5634
|
-
return /* @__PURE__ */
|
|
5634
|
+
return /* @__PURE__ */ cally_p("host", {
|
|
5635
5635
|
shadowDom: !0,
|
|
5636
5636
|
focus: o.focus,
|
|
5637
|
-
children: /* @__PURE__ */
|
|
5637
|
+
children: /* @__PURE__ */ cally_p(dt, {
|
|
5638
5638
|
...e,
|
|
5639
5639
|
...o,
|
|
5640
5640
|
type: "multi",
|
|
@@ -6250,292 +6250,2206 @@ const Checkbox = (props)=>{
|
|
|
6250
6250
|
})();
|
|
6251
6251
|
};
|
|
6252
6252
|
const checkbox_Checkbox = Checkbox;
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
const
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6253
|
+
const ColorPickerContext = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createContext)(void 0);
|
|
6254
|
+
function useColorPickerContext() {
|
|
6255
|
+
const context = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.useContext)(ColorPickerContext);
|
|
6256
|
+
if (!context) throw new Error("useColorPickerContext must be used within a ColorPickerContext.Provider");
|
|
6257
|
+
return context;
|
|
6258
|
+
}
|
|
6259
|
+
function hexToRgb(hex) {
|
|
6260
|
+
const cleaned = hex.replace(/^#/, "");
|
|
6261
|
+
if (3 === cleaned.length) {
|
|
6262
|
+
const r = Number.parseInt(cleaned[0] + cleaned[0], 16);
|
|
6263
|
+
const g = Number.parseInt(cleaned[1] + cleaned[1], 16);
|
|
6264
|
+
const b = Number.parseInt(cleaned[2] + cleaned[2], 16);
|
|
6265
|
+
return {
|
|
6266
|
+
r,
|
|
6267
|
+
g,
|
|
6268
|
+
b
|
|
6269
|
+
};
|
|
6270
|
+
}
|
|
6271
|
+
if (6 === cleaned.length) {
|
|
6272
|
+
const r = Number.parseInt(cleaned.substring(0, 2), 16);
|
|
6273
|
+
const g = Number.parseInt(cleaned.substring(2, 4), 16);
|
|
6274
|
+
const b = Number.parseInt(cleaned.substring(4, 6), 16);
|
|
6275
|
+
return {
|
|
6276
|
+
r,
|
|
6277
|
+
g,
|
|
6278
|
+
b
|
|
6279
|
+
};
|
|
6280
|
+
}
|
|
6281
|
+
return null;
|
|
6282
|
+
}
|
|
6283
|
+
function rgbToHex(r, g, b) {
|
|
6284
|
+
const toHex = (n)=>{
|
|
6285
|
+
const hex = Math.max(0, Math.min(255, Math.round(n))).toString(16);
|
|
6286
|
+
return 1 === hex.length ? `0${hex}` : hex;
|
|
6287
|
+
};
|
|
6288
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
6289
|
+
}
|
|
6290
|
+
function rgbToHsl(r, g, b) {
|
|
6291
|
+
const rNorm = r / 255;
|
|
6292
|
+
const gNorm = g / 255;
|
|
6293
|
+
const bNorm = b / 255;
|
|
6294
|
+
const max = Math.max(rNorm, gNorm, bNorm);
|
|
6295
|
+
const min = Math.min(rNorm, gNorm, bNorm);
|
|
6296
|
+
const delta = max - min;
|
|
6297
|
+
let h = 0;
|
|
6298
|
+
let s = 0;
|
|
6299
|
+
const l = (max + min) / 2;
|
|
6300
|
+
if (0 !== delta) {
|
|
6301
|
+
s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
6302
|
+
switch(max){
|
|
6303
|
+
case rNorm:
|
|
6304
|
+
h = ((gNorm - bNorm) / delta + (gNorm < bNorm ? 6 : 0)) / 6;
|
|
6305
|
+
break;
|
|
6306
|
+
case gNorm:
|
|
6307
|
+
h = ((bNorm - rNorm) / delta + 2) / 6;
|
|
6308
|
+
break;
|
|
6309
|
+
case bNorm:
|
|
6310
|
+
h = ((rNorm - gNorm) / delta + 4) / 6;
|
|
6311
|
+
break;
|
|
6312
|
+
}
|
|
6313
|
+
}
|
|
6314
|
+
return {
|
|
6315
|
+
h: Math.round(360 * h),
|
|
6316
|
+
s: Math.round(100 * s),
|
|
6317
|
+
l: Math.round(100 * l)
|
|
6318
|
+
};
|
|
6319
|
+
}
|
|
6320
|
+
function hslToRgb(h, s, l) {
|
|
6321
|
+
const hNorm = h / 360;
|
|
6322
|
+
const sNorm = s / 100;
|
|
6323
|
+
const lNorm = l / 100;
|
|
6324
|
+
const hue2rgb = (p, q, t)=>{
|
|
6325
|
+
let tNorm = t;
|
|
6326
|
+
if (tNorm < 0) tNorm += 1;
|
|
6327
|
+
if (tNorm > 1) tNorm -= 1;
|
|
6328
|
+
if (tNorm < 1 / 6) return p + (q - p) * 6 * tNorm;
|
|
6329
|
+
if (tNorm < 0.5) return q;
|
|
6330
|
+
if (tNorm < 2 / 3) return p + (q - p) * (2 / 3 - tNorm) * 6;
|
|
6331
|
+
return p;
|
|
6332
|
+
};
|
|
6333
|
+
if (0 === sNorm) {
|
|
6334
|
+
const gray = Math.round(255 * lNorm);
|
|
6335
|
+
return {
|
|
6336
|
+
r: gray,
|
|
6337
|
+
g: gray,
|
|
6338
|
+
b: gray
|
|
6339
|
+
};
|
|
6340
|
+
}
|
|
6341
|
+
const q = lNorm < 0.5 ? lNorm * (1 + sNorm) : lNorm + sNorm - lNorm * sNorm;
|
|
6342
|
+
const p = 2 * lNorm - q;
|
|
6343
|
+
return {
|
|
6344
|
+
r: Math.round(255 * hue2rgb(p, q, hNorm + 1 / 3)),
|
|
6345
|
+
g: Math.round(255 * hue2rgb(p, q, hNorm)),
|
|
6346
|
+
b: Math.round(255 * hue2rgb(p, q, hNorm - 1 / 3))
|
|
6347
|
+
};
|
|
6348
|
+
}
|
|
6349
|
+
function parseColor(color) {
|
|
6350
|
+
const trimmed = color.trim();
|
|
6351
|
+
if (trimmed.startsWith("#")) {
|
|
6352
|
+
const rgb = hexToRgb(trimmed);
|
|
6353
|
+
if (!rgb) return null;
|
|
6354
|
+
const hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);
|
|
6355
|
+
return {
|
|
6356
|
+
rgb: {
|
|
6357
|
+
...rgb,
|
|
6358
|
+
a: 1
|
|
6269
6359
|
},
|
|
6270
|
-
|
|
6271
|
-
|
|
6360
|
+
hsl: {
|
|
6361
|
+
...hsl,
|
|
6362
|
+
a: 1
|
|
6272
6363
|
},
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
const
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(merged, [
|
|
6290
|
-
"dataPrefix",
|
|
6291
|
-
"status",
|
|
6292
|
-
"innerProps",
|
|
6293
|
-
"innerRef",
|
|
6294
|
-
"class",
|
|
6295
|
-
"children",
|
|
6296
|
-
"dataTheme"
|
|
6297
|
-
]);
|
|
6298
|
-
const statusClass = ()=>twMerge(dist_clsx({
|
|
6299
|
-
"bg-info": "info" === local.status,
|
|
6300
|
-
"bg-success": "success" === local.status,
|
|
6301
|
-
"bg-warning": "warning" === local.status,
|
|
6302
|
-
"bg-error": "error" === local.status,
|
|
6303
|
-
"text-info-content": "info" === local.status,
|
|
6304
|
-
"text-success-content": "success" === local.status,
|
|
6305
|
-
"text-warning-content": "warning" === local.status,
|
|
6306
|
-
"text-error-content": "error" === local.status
|
|
6307
|
-
}), local.class);
|
|
6308
|
-
const prefix = ()=>false !== local.dataPrefix ? local.dataPrefix || ">" : void 0;
|
|
6309
|
-
return (()=>{
|
|
6310
|
-
var _el$ = CodeMockupLine_tmpl$(), _el$2 = _el$.firstChild;
|
|
6311
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
6312
|
-
get ["class"] () {
|
|
6313
|
-
return statusClass();
|
|
6364
|
+
hex: trimmed
|
|
6365
|
+
};
|
|
6366
|
+
}
|
|
6367
|
+
const rgbMatch = trimmed.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)/);
|
|
6368
|
+
if (rgbMatch) {
|
|
6369
|
+
const r = Number.parseInt(rgbMatch[1], 10);
|
|
6370
|
+
const g = Number.parseInt(rgbMatch[2], 10);
|
|
6371
|
+
const b = Number.parseInt(rgbMatch[3], 10);
|
|
6372
|
+
const a = rgbMatch[4] ? Number.parseFloat(rgbMatch[4]) : 1;
|
|
6373
|
+
const hsl = rgbToHsl(r, g, b);
|
|
6374
|
+
return {
|
|
6375
|
+
rgb: {
|
|
6376
|
+
r,
|
|
6377
|
+
g,
|
|
6378
|
+
b,
|
|
6379
|
+
a
|
|
6314
6380
|
},
|
|
6315
|
-
|
|
6316
|
-
|
|
6381
|
+
hsl: {
|
|
6382
|
+
...hsl,
|
|
6383
|
+
a
|
|
6317
6384
|
},
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6385
|
+
hex: rgbToHex(r, g, b)
|
|
6386
|
+
};
|
|
6387
|
+
}
|
|
6388
|
+
const hslMatch = trimmed.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);
|
|
6389
|
+
if (hslMatch) {
|
|
6390
|
+
const h = Number.parseFloat(hslMatch[1]);
|
|
6391
|
+
const s = Number.parseFloat(hslMatch[2]);
|
|
6392
|
+
const l = Number.parseFloat(hslMatch[3]);
|
|
6393
|
+
const a = hslMatch[4] ? Number.parseFloat(hslMatch[4]) : 1;
|
|
6394
|
+
const rgb = hslToRgb(h, s, l);
|
|
6395
|
+
return {
|
|
6396
|
+
rgb: {
|
|
6397
|
+
...rgb,
|
|
6398
|
+
a
|
|
6399
|
+
},
|
|
6400
|
+
hsl: {
|
|
6401
|
+
h,
|
|
6402
|
+
s,
|
|
6403
|
+
l,
|
|
6404
|
+
a
|
|
6405
|
+
},
|
|
6406
|
+
hex: rgbToHex(rgb.r, rgb.g, rgb.b)
|
|
6407
|
+
};
|
|
6408
|
+
}
|
|
6409
|
+
return null;
|
|
6338
6410
|
}
|
|
6339
|
-
function
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6411
|
+
function formatColor(color, format) {
|
|
6412
|
+
switch(format){
|
|
6413
|
+
case "hex":
|
|
6414
|
+
return color.hex;
|
|
6415
|
+
case "rgb":
|
|
6416
|
+
return `rgb(${color.rgb.r}, ${color.rgb.g}, ${color.rgb.b})`;
|
|
6417
|
+
case "rgba":
|
|
6418
|
+
return `rgba(${color.rgb.r}, ${color.rgb.g}, ${color.rgb.b}, ${color.rgb.a})`;
|
|
6419
|
+
case "hsl":
|
|
6420
|
+
return `hsl(${color.hsl.h}, ${color.hsl.s}%, ${color.hsl.l}%)`;
|
|
6421
|
+
case "hsla":
|
|
6422
|
+
return `hsla(${color.hsl.h}, ${color.hsl.s}%, ${color.hsl.l}%, ${color.hsl.a})`;
|
|
6423
|
+
default:
|
|
6424
|
+
return color.hex;
|
|
6425
|
+
}
|
|
6426
|
+
}
|
|
6427
|
+
function setAlpha(color, alpha) {
|
|
6428
|
+
const clampedAlpha = Math.max(0, Math.min(1, alpha));
|
|
6429
|
+
return {
|
|
6430
|
+
...color,
|
|
6431
|
+
rgb: {
|
|
6432
|
+
...color.rgb,
|
|
6433
|
+
a: clampedAlpha
|
|
6434
|
+
},
|
|
6435
|
+
hsl: {
|
|
6436
|
+
...color.hsl,
|
|
6437
|
+
a: clampedAlpha
|
|
6438
|
+
}
|
|
6439
|
+
};
|
|
6440
|
+
}
|
|
6441
|
+
function createColorFromHsl(h, s, l, a = 1) {
|
|
6442
|
+
const rgb = hslToRgb(h, s, l);
|
|
6443
|
+
return {
|
|
6444
|
+
rgb: {
|
|
6445
|
+
...rgb,
|
|
6446
|
+
a
|
|
6447
|
+
},
|
|
6448
|
+
hsl: {
|
|
6449
|
+
h,
|
|
6450
|
+
s,
|
|
6451
|
+
l,
|
|
6452
|
+
a
|
|
6453
|
+
},
|
|
6454
|
+
hex: rgbToHex(rgb.r, rgb.g, rgb.b)
|
|
6455
|
+
};
|
|
6456
|
+
}
|
|
6457
|
+
function getDefaultColor() {
|
|
6458
|
+
return {
|
|
6459
|
+
rgb: {
|
|
6460
|
+
r: 255,
|
|
6461
|
+
g: 255,
|
|
6462
|
+
b: 255,
|
|
6463
|
+
a: 1
|
|
6464
|
+
},
|
|
6465
|
+
hsl: {
|
|
6466
|
+
h: 0,
|
|
6467
|
+
s: 0,
|
|
6468
|
+
l: 100,
|
|
6469
|
+
a: 1
|
|
6470
|
+
},
|
|
6471
|
+
hex: "#ffffff"
|
|
6472
|
+
};
|
|
6473
|
+
}
|
|
6474
|
+
var AlphaSlider_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div role=slider aria-label="Alpha (opacity)"aria-valuemin=0 aria-valuemax=1><div class="absolute inset-0"></div><div class="absolute inset-0"></div><div>');
|
|
6475
|
+
const AlphaSlider_AlphaSlider = (props)=>{
|
|
6476
|
+
const context = useColorPickerContext();
|
|
6477
|
+
const [isDragging, setIsDragging] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
|
|
6478
|
+
let sliderRef;
|
|
6479
|
+
const alpha = ()=>context.color().hsl.a;
|
|
6480
|
+
const updateAlpha = (clientX)=>{
|
|
6481
|
+
if (!sliderRef || context.disabled()) return;
|
|
6482
|
+
const rect = sliderRef.getBoundingClientRect();
|
|
6483
|
+
const percentage = Math.max(0, Math.min(1, (clientX - rect.left) / rect.width));
|
|
6484
|
+
const newAlpha = Math.round(100 * percentage) / 100;
|
|
6485
|
+
const newColor = setAlpha(context.color(), newAlpha);
|
|
6486
|
+
context.onChange(newColor);
|
|
6487
|
+
};
|
|
6488
|
+
const handleMouseDown = (e)=>{
|
|
6489
|
+
if (context.disabled()) return;
|
|
6490
|
+
setIsDragging(true);
|
|
6491
|
+
updateAlpha(e.clientX);
|
|
6492
|
+
e.preventDefault();
|
|
6493
|
+
};
|
|
6494
|
+
const handleMouseMove = (e)=>{
|
|
6495
|
+
if (isDragging()) {
|
|
6496
|
+
updateAlpha(e.clientX);
|
|
6497
|
+
e.preventDefault();
|
|
6498
|
+
}
|
|
6499
|
+
};
|
|
6500
|
+
const handleMouseUp = ()=>{
|
|
6501
|
+
setIsDragging(false);
|
|
6502
|
+
};
|
|
6503
|
+
const handleKeyDown = (e)=>{
|
|
6504
|
+
if (context.disabled()) return;
|
|
6505
|
+
const step = e.shiftKey ? 0.1 : 0.01;
|
|
6506
|
+
let newAlpha = alpha();
|
|
6507
|
+
switch(e.key){
|
|
6508
|
+
case "ArrowLeft":
|
|
6509
|
+
case "ArrowDown":
|
|
6510
|
+
newAlpha = Math.max(0, alpha() - step);
|
|
6511
|
+
e.preventDefault();
|
|
6512
|
+
break;
|
|
6513
|
+
case "ArrowRight":
|
|
6514
|
+
case "ArrowUp":
|
|
6515
|
+
newAlpha = Math.min(1, alpha() + step);
|
|
6516
|
+
e.preventDefault();
|
|
6517
|
+
break;
|
|
6518
|
+
default:
|
|
6519
|
+
return;
|
|
6520
|
+
}
|
|
6521
|
+
const newColor = setAlpha(context.color(), newAlpha);
|
|
6522
|
+
context.onChange(newColor);
|
|
6523
|
+
};
|
|
6524
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onMount)(()=>{
|
|
6525
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
6526
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
6527
|
+
});
|
|
6528
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
6529
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
6530
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
6344
6531
|
});
|
|
6532
|
+
const classes = ()=>twMerge("relative w-full h-6 rounded cursor-pointer select-none overflow-hidden", clsx({
|
|
6533
|
+
"opacity-50 cursor-not-allowed": context.disabled()
|
|
6534
|
+
}), props.class, props.className);
|
|
6535
|
+
const thumbClasses = ()=>twMerge("absolute top-1/2 w-4 h-4 border-2 border-white rounded-full shadow-lg transform -translate-x-1/2 -translate-y-1/2 pointer-events-none", clsx({
|
|
6536
|
+
"ring-2 ring-primary": isDragging()
|
|
6537
|
+
}));
|
|
6345
6538
|
return (()=>{
|
|
6346
|
-
var _el$ =
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
(0,
|
|
6539
|
+
var _el$ = AlphaSlider_tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling;
|
|
6540
|
+
_el$.$$keydown = handleKeyDown;
|
|
6541
|
+
_el$.$$mousedown = handleMouseDown;
|
|
6542
|
+
var _ref$ = sliderRef;
|
|
6543
|
+
"function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$) : sliderRef = _el$;
|
|
6544
|
+
_el$2.style.setProperty("background-image", "linear-gradient(45deg, hsl(var(--b3)) 25%, transparent 25%), linear-gradient(-45deg, hsl(var(--b3)) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, hsl(var(--b3)) 75%), linear-gradient(-45deg, transparent 75%, hsl(var(--b3)) 75%)");
|
|
6545
|
+
_el$2.style.setProperty("background-size", "8px 8px");
|
|
6546
|
+
_el$2.style.setProperty("background-position", "0 0, 0 4px, 4px -4px, -4px 0px");
|
|
6547
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
6548
|
+
var _v$ = classes(), _v$2 = context.disabled() ? -1 : 0, _v$3 = alpha(), _v$4 = context.disabled(), _v$5 = `linear-gradient(to right, transparent, ${context.color().hex})`, _v$6 = thumbClasses(), _v$7 = `${100 * alpha()}%`;
|
|
6549
|
+
_v$ !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$, _p$.e = _v$);
|
|
6550
|
+
_v$2 !== _p$.t && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "tabindex", _p$.t = _v$2);
|
|
6551
|
+
_v$3 !== _p$.a && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "aria-valuenow", _p$.a = _v$3);
|
|
6552
|
+
_v$4 !== _p$.o && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "aria-disabled", _p$.o = _v$4);
|
|
6553
|
+
_v$5 !== _p$.i && (null != (_p$.i = _v$5) ? _el$3.style.setProperty("background", _v$5) : _el$3.style.removeProperty("background"));
|
|
6554
|
+
_v$6 !== _p$.n && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$4, _p$.n = _v$6);
|
|
6555
|
+
_v$7 !== _p$.s && (null != (_p$.s = _v$7) ? _el$4.style.setProperty("left", _v$7) : _el$4.style.removeProperty("left"));
|
|
6556
|
+
return _p$;
|
|
6557
|
+
}, {
|
|
6558
|
+
e: void 0,
|
|
6559
|
+
t: void 0,
|
|
6560
|
+
a: void 0,
|
|
6561
|
+
o: void 0,
|
|
6562
|
+
i: void 0,
|
|
6563
|
+
n: void 0,
|
|
6564
|
+
s: void 0
|
|
6565
|
+
});
|
|
6354
6566
|
return _el$;
|
|
6355
6567
|
})();
|
|
6356
|
-
}
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
const
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
"style"
|
|
6378
|
-
]);
|
|
6379
|
-
const [internalOpen, setInternalOpen] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
|
|
6380
|
-
const isControlled = void 0 !== local.open;
|
|
6381
|
-
const isChecked = ()=>isControlled ? local.open : internalOpen();
|
|
6382
|
-
const handleCheckboxChange = ()=>{
|
|
6383
|
-
if (local.onToggle) local.onToggle();
|
|
6384
|
-
if (isControlled) {
|
|
6385
|
-
if (local.open && local.onClose) local.onClose();
|
|
6386
|
-
if (!local.open && local.onOpen) local.onOpen();
|
|
6387
|
-
} else {
|
|
6388
|
-
const next = !internalOpen();
|
|
6389
|
-
setInternalOpen(next);
|
|
6390
|
-
if (next && local.onOpen) local.onOpen();
|
|
6391
|
-
if (!next && local.onClose) local.onClose();
|
|
6392
|
-
}
|
|
6568
|
+
};
|
|
6569
|
+
const AlphaSlider = AlphaSlider_AlphaSlider;
|
|
6570
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
6571
|
+
"mousedown",
|
|
6572
|
+
"keydown"
|
|
6573
|
+
]);
|
|
6574
|
+
var SaturationBrightness_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div role=slider aria-label="Saturation and brightness"aria-valuemin=0 aria-valuemax=100><div>');
|
|
6575
|
+
const SaturationBrightness = (props)=>{
|
|
6576
|
+
const context = useColorPickerContext();
|
|
6577
|
+
const [isDragging, setIsDragging] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
|
|
6578
|
+
let containerRef;
|
|
6579
|
+
let cursorRef;
|
|
6580
|
+
const saturation = ()=>context.color().hsl.s;
|
|
6581
|
+
const brightness = ()=>100 - context.color().hsl.l;
|
|
6582
|
+
const updateColor = (x, y)=>{
|
|
6583
|
+
if (!containerRef || context.disabled()) return;
|
|
6584
|
+
const rect = containerRef.getBoundingClientRect();
|
|
6585
|
+
const s = Math.max(0, Math.min(100, (x - rect.left) / rect.width * 100));
|
|
6586
|
+
const l = Math.max(0, Math.min(100, 100 - (y - rect.top) / rect.height * 100));
|
|
6587
|
+
const newColor = createColorFromHsl(context.color().hsl.h, s, l, context.color().hsl.a);
|
|
6588
|
+
context.onChange(newColor);
|
|
6393
6589
|
};
|
|
6394
|
-
const
|
|
6395
|
-
if (
|
|
6396
|
-
|
|
6397
|
-
|
|
6590
|
+
const handleMouseDown = (e)=>{
|
|
6591
|
+
if (context.disabled()) return;
|
|
6592
|
+
setIsDragging(true);
|
|
6593
|
+
updateColor(e.clientX, e.clientY);
|
|
6594
|
+
e.preventDefault();
|
|
6595
|
+
};
|
|
6596
|
+
const handleMouseMove = (e)=>{
|
|
6597
|
+
if (isDragging()) {
|
|
6598
|
+
updateColor(e.clientX, e.clientY);
|
|
6599
|
+
e.preventDefault();
|
|
6398
6600
|
}
|
|
6399
|
-
if ("function" == typeof others.onBlur) others.onBlur(e);
|
|
6400
6601
|
};
|
|
6401
|
-
const
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6602
|
+
const handleMouseUp = ()=>{
|
|
6603
|
+
setIsDragging(false);
|
|
6604
|
+
};
|
|
6605
|
+
const handleKeyDown = (e)=>{
|
|
6606
|
+
if (context.disabled()) return;
|
|
6607
|
+
const step = e.shiftKey ? 10 : 1;
|
|
6608
|
+
let s = saturation();
|
|
6609
|
+
let l = 100 - brightness();
|
|
6610
|
+
switch(e.key){
|
|
6611
|
+
case "ArrowLeft":
|
|
6612
|
+
s = Math.max(0, s - step);
|
|
6613
|
+
e.preventDefault();
|
|
6614
|
+
break;
|
|
6615
|
+
case "ArrowRight":
|
|
6616
|
+
s = Math.min(100, s + step);
|
|
6617
|
+
e.preventDefault();
|
|
6618
|
+
break;
|
|
6619
|
+
case "ArrowUp":
|
|
6620
|
+
l = Math.min(100, l + step);
|
|
6621
|
+
e.preventDefault();
|
|
6622
|
+
break;
|
|
6623
|
+
case "ArrowDown":
|
|
6624
|
+
l = Math.max(0, l - step);
|
|
6625
|
+
e.preventDefault();
|
|
6626
|
+
break;
|
|
6627
|
+
default:
|
|
6628
|
+
return;
|
|
6405
6629
|
}
|
|
6406
|
-
|
|
6630
|
+
const newColor = createColorFromHsl(context.color().hsl.h, s, l, context.color().hsl.a);
|
|
6631
|
+
context.onChange(newColor);
|
|
6407
6632
|
};
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
(0,
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6633
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onMount)(()=>{
|
|
6634
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
6635
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
6636
|
+
});
|
|
6637
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
6638
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
6639
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
6640
|
+
});
|
|
6641
|
+
const classes = ()=>twMerge("relative w-full h-48 rounded cursor-crosshair select-none", clsx({
|
|
6642
|
+
"opacity-50 cursor-not-allowed": context.disabled()
|
|
6643
|
+
}), props.class, props.className);
|
|
6644
|
+
const cursorClasses = ()=>twMerge("absolute w-4 h-4 border-2 border-white rounded-full shadow-lg pointer-events-none transform -translate-x-1/2 -translate-y-1/2", clsx({
|
|
6645
|
+
"ring-2 ring-primary": isDragging()
|
|
6646
|
+
}));
|
|
6647
|
+
return (()=>{
|
|
6648
|
+
var _el$ = SaturationBrightness_tmpl$(), _el$2 = _el$.firstChild;
|
|
6649
|
+
_el$.$$keydown = handleKeyDown;
|
|
6650
|
+
_el$.$$mousedown = handleMouseDown;
|
|
6651
|
+
var _ref$ = containerRef;
|
|
6652
|
+
"function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$) : containerRef = _el$;
|
|
6653
|
+
var _ref$2 = cursorRef;
|
|
6654
|
+
"function" == typeof _ref$2 ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$2, _el$2) : cursorRef = _el$2;
|
|
6655
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
6656
|
+
var _v$ = classes(), _v$2 = `
|
|
6657
|
+
linear-gradient(to top, #000, transparent),
|
|
6658
|
+
linear-gradient(to right, #fff, hsl(${context.color().hsl.h}, 100%, 50%))
|
|
6659
|
+
`, _v$3 = context.disabled() ? -1 : 0, _v$4 = saturation(), _v$5 = context.disabled(), _v$6 = cursorClasses(), _v$7 = `${saturation()}%`, _v$8 = `${brightness()}%`;
|
|
6660
|
+
_v$ !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$, _p$.e = _v$);
|
|
6661
|
+
_v$2 !== _p$.t && (null != (_p$.t = _v$2) ? _el$.style.setProperty("background", _v$2) : _el$.style.removeProperty("background"));
|
|
6662
|
+
_v$3 !== _p$.a && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "tabindex", _p$.a = _v$3);
|
|
6663
|
+
_v$4 !== _p$.o && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "aria-valuenow", _p$.o = _v$4);
|
|
6664
|
+
_v$5 !== _p$.i && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "aria-disabled", _p$.i = _v$5);
|
|
6665
|
+
_v$6 !== _p$.n && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$2, _p$.n = _v$6);
|
|
6666
|
+
_v$7 !== _p$.s && (null != (_p$.s = _v$7) ? _el$2.style.setProperty("left", _v$7) : _el$2.style.removeProperty("left"));
|
|
6667
|
+
_v$8 !== _p$.h && (null != (_p$.h = _v$8) ? _el$2.style.setProperty("top", _v$8) : _el$2.style.removeProperty("top"));
|
|
6668
|
+
return _p$;
|
|
6669
|
+
}, {
|
|
6670
|
+
e: void 0,
|
|
6671
|
+
t: void 0,
|
|
6672
|
+
a: void 0,
|
|
6673
|
+
o: void 0,
|
|
6674
|
+
i: void 0,
|
|
6675
|
+
n: void 0,
|
|
6676
|
+
s: void 0,
|
|
6677
|
+
h: void 0
|
|
6678
|
+
});
|
|
6445
6679
|
return _el$;
|
|
6446
6680
|
})();
|
|
6447
6681
|
};
|
|
6448
|
-
const
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6682
|
+
const colorpicker_SaturationBrightness = SaturationBrightness;
|
|
6683
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
6684
|
+
"mousedown",
|
|
6685
|
+
"keydown"
|
|
6686
|
+
]);
|
|
6687
|
+
var HueSlider_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div role=slider aria-label=Hue aria-valuemin=0 aria-valuemax=360><div>");
|
|
6688
|
+
const HueSlider = (props)=>{
|
|
6689
|
+
const context = useColorPickerContext();
|
|
6690
|
+
const [isDragging, setIsDragging] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
|
|
6691
|
+
let sliderRef;
|
|
6692
|
+
const hue = ()=>context.color().hsl.h;
|
|
6693
|
+
const updateHue = (clientX)=>{
|
|
6694
|
+
if (!sliderRef || context.disabled()) return;
|
|
6695
|
+
const rect = sliderRef.getBoundingClientRect();
|
|
6696
|
+
const percentage = Math.max(0, Math.min(1, (clientX - rect.left) / rect.width));
|
|
6697
|
+
const newHue = Math.round(360 * percentage);
|
|
6698
|
+
const newColor = createColorFromHsl(newHue, context.color().hsl.s, context.color().hsl.l, context.color().hsl.a);
|
|
6699
|
+
context.onChange(newColor);
|
|
6700
|
+
};
|
|
6701
|
+
const handleMouseDown = (e)=>{
|
|
6702
|
+
if (context.disabled()) return;
|
|
6703
|
+
setIsDragging(true);
|
|
6704
|
+
updateHue(e.clientX);
|
|
6705
|
+
e.preventDefault();
|
|
6706
|
+
};
|
|
6707
|
+
const handleMouseMove = (e)=>{
|
|
6708
|
+
if (isDragging()) {
|
|
6709
|
+
updateHue(e.clientX);
|
|
6710
|
+
e.preventDefault();
|
|
6711
|
+
}
|
|
6712
|
+
};
|
|
6713
|
+
const handleMouseUp = ()=>{
|
|
6714
|
+
setIsDragging(false);
|
|
6715
|
+
};
|
|
6716
|
+
const handleKeyDown = (e)=>{
|
|
6717
|
+
if (context.disabled()) return;
|
|
6718
|
+
const step = e.shiftKey ? 10 : 1;
|
|
6719
|
+
let newHue = hue();
|
|
6720
|
+
switch(e.key){
|
|
6721
|
+
case "ArrowLeft":
|
|
6722
|
+
case "ArrowDown":
|
|
6723
|
+
newHue = (hue() - step + 360) % 360;
|
|
6724
|
+
e.preventDefault();
|
|
6725
|
+
break;
|
|
6726
|
+
case "ArrowRight":
|
|
6727
|
+
case "ArrowUp":
|
|
6728
|
+
newHue = (hue() + step) % 360;
|
|
6729
|
+
e.preventDefault();
|
|
6730
|
+
break;
|
|
6731
|
+
default:
|
|
6732
|
+
return;
|
|
6733
|
+
}
|
|
6734
|
+
const newColor = createColorFromHsl(newHue, context.color().hsl.s, context.color().hsl.l, context.color().hsl.a);
|
|
6735
|
+
context.onChange(newColor);
|
|
6736
|
+
};
|
|
6737
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onMount)(()=>{
|
|
6738
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
6739
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
6469
6740
|
});
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
if ("string" == typeof prop || "boolean" == typeof prop) return [
|
|
6474
|
-
classMap[String(prop)]
|
|
6475
|
-
];
|
|
6476
|
-
return breakpoints.flatMap((bp)=>{
|
|
6477
|
-
const value = prop[bp];
|
|
6478
|
-
if (void 0 === value) return [];
|
|
6479
|
-
const className = classMap[String(value)];
|
|
6480
|
-
return "base" === bp ? [
|
|
6481
|
-
className
|
|
6482
|
-
] : [
|
|
6483
|
-
`${bp}:${className}`
|
|
6484
|
-
];
|
|
6741
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
6742
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
6743
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
6485
6744
|
});
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
const
|
|
6490
|
-
|
|
6491
|
-
|
|
6745
|
+
const classes = ()=>twMerge("relative w-full h-6 rounded cursor-pointer select-none", clsx({
|
|
6746
|
+
"opacity-50 cursor-not-allowed": context.disabled()
|
|
6747
|
+
}), props.class, props.className);
|
|
6748
|
+
const thumbClasses = ()=>twMerge("absolute top-1/2 w-4 h-4 border-2 border-white rounded-full shadow-lg transform -translate-x-1/2 -translate-y-1/2 pointer-events-none", clsx({
|
|
6749
|
+
"ring-2 ring-primary": isDragging()
|
|
6750
|
+
}));
|
|
6751
|
+
return (()=>{
|
|
6752
|
+
var _el$ = HueSlider_tmpl$(), _el$2 = _el$.firstChild;
|
|
6753
|
+
_el$.$$keydown = handleKeyDown;
|
|
6754
|
+
_el$.$$mousedown = handleMouseDown;
|
|
6755
|
+
var _ref$ = sliderRef;
|
|
6756
|
+
"function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$) : sliderRef = _el$;
|
|
6757
|
+
_el$.style.setProperty("background", "linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)");
|
|
6758
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
6759
|
+
var _v$ = classes(), _v$2 = context.disabled() ? -1 : 0, _v$3 = hue(), _v$4 = context.disabled(), _v$5 = thumbClasses(), _v$6 = `${hue() / 360 * 100}%`, _v$7 = `hsl(${hue()}, 100%, 50%)`;
|
|
6760
|
+
_v$ !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$, _p$.e = _v$);
|
|
6761
|
+
_v$2 !== _p$.t && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "tabindex", _p$.t = _v$2);
|
|
6762
|
+
_v$3 !== _p$.a && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "aria-valuenow", _p$.a = _v$3);
|
|
6763
|
+
_v$4 !== _p$.o && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "aria-disabled", _p$.o = _v$4);
|
|
6764
|
+
_v$5 !== _p$.i && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$2, _p$.i = _v$5);
|
|
6765
|
+
_v$6 !== _p$.n && (null != (_p$.n = _v$6) ? _el$2.style.setProperty("left", _v$6) : _el$2.style.removeProperty("left"));
|
|
6766
|
+
_v$7 !== _p$.s && (null != (_p$.s = _v$7) ? _el$2.style.setProperty("background-color", _v$7) : _el$2.style.removeProperty("background-color"));
|
|
6767
|
+
return _p$;
|
|
6768
|
+
}, {
|
|
6769
|
+
e: void 0,
|
|
6770
|
+
t: void 0,
|
|
6771
|
+
a: void 0,
|
|
6772
|
+
o: void 0,
|
|
6773
|
+
i: void 0,
|
|
6774
|
+
n: void 0,
|
|
6775
|
+
s: void 0
|
|
6776
|
+
});
|
|
6777
|
+
return _el$;
|
|
6778
|
+
})();
|
|
6779
|
+
};
|
|
6780
|
+
const colorpicker_HueSlider = HueSlider;
|
|
6781
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
6782
|
+
"mousedown",
|
|
6783
|
+
"keydown"
|
|
6784
|
+
]);
|
|
6785
|
+
const ColorPickerGradientSelector = ()=>[
|
|
6786
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(colorpicker_SaturationBrightness, {}),
|
|
6787
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(colorpicker_HueSlider, {})
|
|
6788
|
+
];
|
|
6789
|
+
const colorpicker_ColorPickerGradientSelector = ColorPickerGradientSelector;
|
|
6790
|
+
var ColorWheel_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div role=slider aria-label="Color Wheel"><div>');
|
|
6791
|
+
const ColorWheel_ColorWheel = (props)=>{
|
|
6792
|
+
const context = useColorPickerContext();
|
|
6793
|
+
const [isDragging, setIsDragging] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
|
|
6794
|
+
let containerRef;
|
|
6795
|
+
let cursorRef;
|
|
6796
|
+
const hue = ()=>context.color().hsl.h;
|
|
6797
|
+
const saturation = ()=>context.color().hsl.s;
|
|
6798
|
+
const lightness = ()=>context.color().hsl.l;
|
|
6799
|
+
const updateColor = (x, y)=>{
|
|
6800
|
+
if (!containerRef || context.disabled()) return;
|
|
6801
|
+
const rect = containerRef.getBoundingClientRect();
|
|
6802
|
+
const centerX = rect.width / 2;
|
|
6803
|
+
const centerY = rect.height / 2;
|
|
6804
|
+
const dx = x - rect.left - centerX;
|
|
6805
|
+
const dy = y - rect.top - centerY;
|
|
6806
|
+
let angle = 180 / Math.PI * Math.atan2(dy, dx) + 90;
|
|
6807
|
+
if (angle < 0) angle += 360;
|
|
6808
|
+
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
6809
|
+
const radius = rect.width / 2;
|
|
6810
|
+
const s = Math.min(100, distance / radius * 100);
|
|
6811
|
+
const newColor = createColorFromHsl(Math.round(angle), Math.round(s), lightness(), context.color().hsl.a);
|
|
6812
|
+
context.onChange(newColor);
|
|
6813
|
+
};
|
|
6814
|
+
const handleMouseDown = (e)=>{
|
|
6815
|
+
if (context.disabled()) return;
|
|
6816
|
+
setIsDragging(true);
|
|
6817
|
+
updateColor(e.clientX, e.clientY);
|
|
6818
|
+
e.preventDefault();
|
|
6819
|
+
};
|
|
6820
|
+
const handleMouseMove = (e)=>{
|
|
6821
|
+
if (isDragging()) {
|
|
6822
|
+
updateColor(e.clientX, e.clientY);
|
|
6823
|
+
e.preventDefault();
|
|
6824
|
+
}
|
|
6825
|
+
};
|
|
6826
|
+
const handleMouseUp = ()=>{
|
|
6827
|
+
setIsDragging(false);
|
|
6492
6828
|
};
|
|
6493
6829
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onMount)(()=>{
|
|
6494
|
-
|
|
6495
|
-
|
|
6830
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
6831
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
6496
6832
|
});
|
|
6497
6833
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
6498
|
-
|
|
6834
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
6835
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
6499
6836
|
});
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6837
|
+
const classes = ()=>twMerge("relative w-48 h-48 rounded-full cursor-crosshair select-none overflow-hidden mx-auto", clsx({
|
|
6838
|
+
"opacity-50 cursor-not-allowed": context.disabled()
|
|
6839
|
+
}), props.class, props.className);
|
|
6840
|
+
const cursorPosition = ()=>{
|
|
6841
|
+
const hRad = (hue() - 90) * (Math.PI / 180);
|
|
6842
|
+
const sNorm = saturation() / 100;
|
|
6843
|
+
const x = 50 + 50 * sNorm * Math.cos(hRad);
|
|
6844
|
+
const y = 50 + 50 * sNorm * Math.sin(hRad);
|
|
6845
|
+
return {
|
|
6846
|
+
x,
|
|
6847
|
+
y
|
|
6848
|
+
};
|
|
6849
|
+
};
|
|
6850
|
+
const cursorClasses = ()=>twMerge("absolute w-4 h-4 border-2 border-white rounded-full shadow-lg pointer-events-none transform -translate-x-1/2 -translate-y-1/2", clsx({
|
|
6851
|
+
"ring-2 ring-primary": isDragging()
|
|
6852
|
+
}));
|
|
6853
|
+
return (()=>{
|
|
6854
|
+
var _el$ = ColorWheel_tmpl$(), _el$2 = _el$.firstChild;
|
|
6855
|
+
_el$.$$mousedown = handleMouseDown;
|
|
6856
|
+
var _ref$ = containerRef;
|
|
6857
|
+
"function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$) : containerRef = _el$;
|
|
6858
|
+
_el$.style.setProperty("background", "\n radial-gradient(circle, white 0%, transparent 100%),\n conic-gradient(\n from 0deg,\n hsl(0, 100%, 50%),\n hsl(60, 100%, 50%),\n hsl(120, 100%, 50%),\n hsl(180, 100%, 50%),\n hsl(240, 100%, 50%),\n hsl(300, 100%, 50%),\n hsl(360, 100%, 50%)\n )\n ");
|
|
6859
|
+
var _ref$2 = cursorRef;
|
|
6860
|
+
"function" == typeof _ref$2 ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$2, _el$2) : cursorRef = _el$2;
|
|
6861
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
6862
|
+
var _v$ = classes(), _v$2 = context.disabled() ? -1 : 0, _v$3 = `Hue ${Math.round(hue())}deg, Saturation ${Math.round(saturation())}%`, _v$4 = context.disabled(), _v$5 = cursorClasses(), _v$6 = `${cursorPosition().x}%`, _v$7 = `${cursorPosition().y}%`, _v$8 = `hsl(${hue()}, ${saturation()}%, 50%)`;
|
|
6863
|
+
_v$ !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$, _p$.e = _v$);
|
|
6864
|
+
_v$2 !== _p$.t && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "tabindex", _p$.t = _v$2);
|
|
6865
|
+
_v$3 !== _p$.a && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "aria-valuetext", _p$.a = _v$3);
|
|
6866
|
+
_v$4 !== _p$.o && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "aria-disabled", _p$.o = _v$4);
|
|
6867
|
+
_v$5 !== _p$.i && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$2, _p$.i = _v$5);
|
|
6868
|
+
_v$6 !== _p$.n && (null != (_p$.n = _v$6) ? _el$2.style.setProperty("left", _v$6) : _el$2.style.removeProperty("left"));
|
|
6869
|
+
_v$7 !== _p$.s && (null != (_p$.s = _v$7) ? _el$2.style.setProperty("top", _v$7) : _el$2.style.removeProperty("top"));
|
|
6870
|
+
_v$8 !== _p$.h && (null != (_p$.h = _v$8) ? _el$2.style.setProperty("background-color", _v$8) : _el$2.style.removeProperty("background-color"));
|
|
6871
|
+
return _p$;
|
|
6872
|
+
}, {
|
|
6873
|
+
e: void 0,
|
|
6874
|
+
t: void 0,
|
|
6875
|
+
a: void 0,
|
|
6876
|
+
o: void 0,
|
|
6877
|
+
i: void 0,
|
|
6878
|
+
n: void 0,
|
|
6879
|
+
s: void 0,
|
|
6880
|
+
h: void 0
|
|
6881
|
+
});
|
|
6882
|
+
return _el$;
|
|
6883
|
+
})();
|
|
6507
6884
|
};
|
|
6508
|
-
const
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6885
|
+
const ColorWheel = ColorWheel_ColorWheel;
|
|
6886
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
6887
|
+
"mousedown"
|
|
6888
|
+
]);
|
|
6889
|
+
var LightnessSlider_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div role=slider aria-label=Lightness aria-valuemin=0 aria-valuemax=100><div>");
|
|
6890
|
+
const LightnessSlider_LightnessSlider = (props)=>{
|
|
6891
|
+
const context = useColorPickerContext();
|
|
6892
|
+
const [isDragging, setIsDragging] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
|
|
6893
|
+
let sliderRef;
|
|
6894
|
+
const lightness = ()=>context.color().hsl.l;
|
|
6895
|
+
const updateLightness = (clientX)=>{
|
|
6896
|
+
if (!sliderRef || context.disabled()) return;
|
|
6897
|
+
const rect = sliderRef.getBoundingClientRect();
|
|
6898
|
+
const percentage = Math.max(0, Math.min(1, (clientX - rect.left) / rect.width));
|
|
6899
|
+
const newLightness = Math.round(100 * percentage);
|
|
6900
|
+
const newColor = createColorFromHsl(context.color().hsl.h, context.color().hsl.s, newLightness, context.color().hsl.a);
|
|
6901
|
+
context.onChange(newColor);
|
|
6902
|
+
};
|
|
6903
|
+
const handleMouseDown = (e)=>{
|
|
6904
|
+
if (context.disabled()) return;
|
|
6905
|
+
setIsDragging(true);
|
|
6906
|
+
updateLightness(e.clientX);
|
|
6907
|
+
e.preventDefault();
|
|
6908
|
+
};
|
|
6909
|
+
const handleMouseMove = (e)=>{
|
|
6910
|
+
if (isDragging()) {
|
|
6911
|
+
updateLightness(e.clientX);
|
|
6912
|
+
e.preventDefault();
|
|
6913
|
+
}
|
|
6914
|
+
};
|
|
6915
|
+
const handleMouseUp = ()=>{
|
|
6916
|
+
setIsDragging(false);
|
|
6917
|
+
};
|
|
6918
|
+
const handleKeyDown = (e)=>{
|
|
6919
|
+
if (context.disabled()) return;
|
|
6920
|
+
const step = e.shiftKey ? 10 : 1;
|
|
6921
|
+
let newL = lightness();
|
|
6922
|
+
switch(e.key){
|
|
6923
|
+
case "ArrowLeft":
|
|
6924
|
+
case "ArrowDown":
|
|
6925
|
+
newL = Math.max(0, newL - step);
|
|
6926
|
+
e.preventDefault();
|
|
6927
|
+
break;
|
|
6928
|
+
case "ArrowRight":
|
|
6929
|
+
case "ArrowUp":
|
|
6930
|
+
newL = Math.min(100, newL + step);
|
|
6931
|
+
e.preventDefault();
|
|
6932
|
+
break;
|
|
6933
|
+
default:
|
|
6934
|
+
return;
|
|
6935
|
+
}
|
|
6936
|
+
const newColor = createColorFromHsl(context.color().hsl.h, context.color().hsl.s, newL, context.color().hsl.a);
|
|
6937
|
+
context.onChange(newColor);
|
|
6938
|
+
};
|
|
6939
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onMount)(()=>{
|
|
6940
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
6941
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
6942
|
+
});
|
|
6943
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
6944
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
6945
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
6946
|
+
});
|
|
6947
|
+
const classes = ()=>twMerge("relative w-full h-6 rounded cursor-pointer select-none", clsx({
|
|
6948
|
+
"opacity-50 cursor-not-allowed": context.disabled()
|
|
6949
|
+
}), props.class, props.className);
|
|
6950
|
+
const thumbClasses = ()=>twMerge("absolute top-1/2 w-4 h-4 border-2 border-white rounded-full shadow-lg transform -translate-x-1/2 -translate-y-1/2 pointer-events-none", clsx({
|
|
6951
|
+
"ring-2 ring-primary": isDragging()
|
|
6952
|
+
}));
|
|
6953
|
+
const gradientStyle = ()=>{
|
|
6954
|
+
const h = context.color().hsl.h;
|
|
6955
|
+
const s = context.color().hsl.s;
|
|
6956
|
+
return `linear-gradient(to right, hsl(${h}, ${s}%, 0%), hsl(${h}, ${s}%, 50%), hsl(${h}, ${s}%, 100%))`;
|
|
6957
|
+
};
|
|
6958
|
+
return (()=>{
|
|
6959
|
+
var _el$ = LightnessSlider_tmpl$(), _el$2 = _el$.firstChild;
|
|
6960
|
+
_el$.$$keydown = handleKeyDown;
|
|
6961
|
+
_el$.$$mousedown = handleMouseDown;
|
|
6962
|
+
var _ref$ = sliderRef;
|
|
6963
|
+
"function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$) : sliderRef = _el$;
|
|
6964
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
6965
|
+
var _v$ = classes(), _v$2 = gradientStyle(), _v$3 = context.disabled() ? -1 : 0, _v$4 = lightness(), _v$5 = context.disabled(), _v$6 = thumbClasses(), _v$7 = `${lightness()}%`, _v$8 = `hsl(${context.color().hsl.h}, ${context.color().hsl.s}%, ${lightness()}%)`;
|
|
6966
|
+
_v$ !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$, _p$.e = _v$);
|
|
6967
|
+
_v$2 !== _p$.t && (null != (_p$.t = _v$2) ? _el$.style.setProperty("background", _v$2) : _el$.style.removeProperty("background"));
|
|
6968
|
+
_v$3 !== _p$.a && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "tabindex", _p$.a = _v$3);
|
|
6969
|
+
_v$4 !== _p$.o && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "aria-valuenow", _p$.o = _v$4);
|
|
6970
|
+
_v$5 !== _p$.i && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "aria-disabled", _p$.i = _v$5);
|
|
6971
|
+
_v$6 !== _p$.n && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$2, _p$.n = _v$6);
|
|
6972
|
+
_v$7 !== _p$.s && (null != (_p$.s = _v$7) ? _el$2.style.setProperty("left", _v$7) : _el$2.style.removeProperty("left"));
|
|
6973
|
+
_v$8 !== _p$.h && (null != (_p$.h = _v$8) ? _el$2.style.setProperty("background-color", _v$8) : _el$2.style.removeProperty("background-color"));
|
|
6974
|
+
return _p$;
|
|
6975
|
+
}, {
|
|
6976
|
+
e: void 0,
|
|
6977
|
+
t: void 0,
|
|
6978
|
+
a: void 0,
|
|
6979
|
+
o: void 0,
|
|
6980
|
+
i: void 0,
|
|
6981
|
+
n: void 0,
|
|
6982
|
+
s: void 0,
|
|
6983
|
+
h: void 0
|
|
6984
|
+
});
|
|
6985
|
+
return _el$;
|
|
6986
|
+
})();
|
|
6515
6987
|
};
|
|
6516
|
-
const
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6988
|
+
const LightnessSlider = LightnessSlider_LightnessSlider;
|
|
6989
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
6990
|
+
"mousedown",
|
|
6991
|
+
"keydown"
|
|
6992
|
+
]);
|
|
6993
|
+
const ColorPickerWheelSelector_ColorPickerWheelSelector = ()=>[
|
|
6994
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(ColorWheel, {}),
|
|
6995
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(LightnessSlider, {})
|
|
6996
|
+
];
|
|
6997
|
+
const ColorPickerWheelSelector = ColorPickerWheelSelector_ColorPickerWheelSelector;
|
|
6998
|
+
const prefersReducedMotion = ()=>globalThis.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches ?? false;
|
|
6999
|
+
const motionDurations = {
|
|
7000
|
+
route: 0.18,
|
|
7001
|
+
routeAuth: 0.35,
|
|
7002
|
+
fast: 0.2,
|
|
7003
|
+
base: 0.3,
|
|
7004
|
+
slow: 0.45
|
|
6522
7005
|
};
|
|
6523
|
-
const
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
"wrap-reverse": "flex-wrap-reverse"
|
|
7006
|
+
const motionEasings = {
|
|
7007
|
+
out: "ease-out",
|
|
7008
|
+
inOut: "ease-in-out"
|
|
6527
7009
|
};
|
|
6528
|
-
const
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
xl: "gap-8"
|
|
7010
|
+
const motionDistances = {
|
|
7011
|
+
sm: 6,
|
|
7012
|
+
md: 12,
|
|
7013
|
+
lg: 20,
|
|
7014
|
+
slideIn: 40
|
|
6534
7015
|
};
|
|
6535
|
-
const
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
7016
|
+
const defaultMotionTokens = {
|
|
7017
|
+
durations: {
|
|
7018
|
+
...motionDurations
|
|
7019
|
+
},
|
|
7020
|
+
easings: {
|
|
7021
|
+
...motionEasings
|
|
7022
|
+
},
|
|
7023
|
+
distances: {
|
|
7024
|
+
...motionDistances
|
|
7025
|
+
}
|
|
7026
|
+
};
|
|
7027
|
+
const mergeDefined = (base, overrides)=>{
|
|
7028
|
+
const next = {
|
|
7029
|
+
...base
|
|
7030
|
+
};
|
|
7031
|
+
if (!overrides) return next;
|
|
7032
|
+
for (const [key, value] of Object.entries(overrides))if (void 0 !== value) next[key] = value;
|
|
7033
|
+
return next;
|
|
7034
|
+
};
|
|
7035
|
+
const mergeMotionTokens = (base, overrides)=>({
|
|
7036
|
+
durations: mergeDefined(base.durations, overrides?.durations),
|
|
7037
|
+
easings: mergeDefined(base.easings, overrides?.easings),
|
|
7038
|
+
distances: mergeDefined(base.distances, overrides?.distances)
|
|
7039
|
+
});
|
|
7040
|
+
const immediateDriver = ({ to, onUpdate, onComplete })=>{
|
|
7041
|
+
onUpdate(to);
|
|
7042
|
+
onComplete?.();
|
|
7043
|
+
return {
|
|
7044
|
+
stop: ()=>{}
|
|
7045
|
+
};
|
|
7046
|
+
};
|
|
7047
|
+
let activeDriver = immediateDriver;
|
|
7048
|
+
const setMotionDriver = (driver)=>{
|
|
7049
|
+
activeDriver = driver;
|
|
7050
|
+
};
|
|
7051
|
+
const getMotionDriver = ()=>activeDriver;
|
|
7052
|
+
const easeOutCubic = (t)=>1 - Math.pow(1 - t, 3);
|
|
7053
|
+
const easeInCubic = (t)=>t * t * t;
|
|
7054
|
+
const easeInOutCubic = (t)=>t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
|
|
7055
|
+
const resolveEase = (easing)=>{
|
|
7056
|
+
if ("function" == typeof easing) return easing;
|
|
7057
|
+
switch(easing){
|
|
7058
|
+
case "ease-in":
|
|
7059
|
+
return easeInCubic;
|
|
7060
|
+
case "ease-in-out":
|
|
7061
|
+
return easeInOutCubic;
|
|
7062
|
+
case "linear":
|
|
7063
|
+
return (t)=>t;
|
|
7064
|
+
case "ease-out":
|
|
7065
|
+
default:
|
|
7066
|
+
return easeOutCubic;
|
|
7067
|
+
}
|
|
7068
|
+
};
|
|
7069
|
+
const resolveDuration = (transition)=>Math.max(0, (transition?.duration ?? 0) * 1000);
|
|
7070
|
+
const resolveDelay = (transition)=>Math.max(0, (transition?.delay ?? 0) * 1000);
|
|
7071
|
+
const readOpacity = (el)=>{
|
|
7072
|
+
const value = Number.parseFloat(getComputedStyle(el).opacity);
|
|
7073
|
+
return Number.isFinite(value) ? value : 1;
|
|
7074
|
+
};
|
|
7075
|
+
const runMotion = (el, from, to, transition, onComplete)=>{
|
|
7076
|
+
const duration = resolveDuration(transition);
|
|
7077
|
+
const delay = resolveDelay(transition);
|
|
7078
|
+
const ease = resolveEase(transition?.easing);
|
|
7079
|
+
const driver = getMotionDriver();
|
|
7080
|
+
const controls = [];
|
|
7081
|
+
const shouldTransform = void 0 !== from.x || void 0 !== from.y || void 0 !== from.scale || void 0 !== to.x || void 0 !== to.y || void 0 !== to.scale;
|
|
7082
|
+
const transformState = {
|
|
7083
|
+
x: from.x ?? 0,
|
|
7084
|
+
y: from.y ?? 0,
|
|
7085
|
+
scale: from.scale ?? 1
|
|
7086
|
+
};
|
|
7087
|
+
const applyTransform = ()=>{
|
|
7088
|
+
if (!shouldTransform) return;
|
|
7089
|
+
el.style.transform = `translate3d(${transformState.x}px, ${transformState.y}px, 0) scale(${transformState.scale})`;
|
|
7090
|
+
};
|
|
7091
|
+
if (void 0 !== from.opacity) el.style.opacity = String(from.opacity);
|
|
7092
|
+
applyTransform();
|
|
7093
|
+
const animationTargets = Object.keys(to);
|
|
7094
|
+
if (0 === animationTargets.length) {
|
|
7095
|
+
onComplete?.();
|
|
7096
|
+
return {
|
|
7097
|
+
stop: ()=>{}
|
|
7098
|
+
};
|
|
7099
|
+
}
|
|
7100
|
+
let remaining = animationTargets.length;
|
|
7101
|
+
const handleComplete = ()=>{
|
|
7102
|
+
remaining -= 1;
|
|
7103
|
+
if (remaining <= 0) onComplete?.();
|
|
7104
|
+
};
|
|
7105
|
+
const start = ()=>{
|
|
7106
|
+
animationTargets.forEach((key)=>{
|
|
7107
|
+
if ("opacity" === key) {
|
|
7108
|
+
const fromValue = from.opacity ?? (void 0 !== to.opacity ? readOpacity(el) : 1);
|
|
7109
|
+
const control = driver({
|
|
7110
|
+
from: fromValue,
|
|
7111
|
+
to: to.opacity ?? fromValue,
|
|
7112
|
+
duration,
|
|
7113
|
+
ease,
|
|
7114
|
+
onUpdate: (latest)=>{
|
|
7115
|
+
el.style.opacity = String(latest);
|
|
7116
|
+
},
|
|
7117
|
+
onComplete: handleComplete
|
|
7118
|
+
});
|
|
7119
|
+
controls.push(control);
|
|
7120
|
+
return;
|
|
7121
|
+
}
|
|
7122
|
+
const fromValue = "scale" === key ? from.scale ?? 1 : "x" === key ? from.x ?? 0 : from.y ?? 0;
|
|
7123
|
+
const toValue = to[key] ?? fromValue;
|
|
7124
|
+
const control = driver({
|
|
7125
|
+
from: fromValue,
|
|
7126
|
+
to: toValue,
|
|
7127
|
+
duration,
|
|
7128
|
+
ease,
|
|
7129
|
+
onUpdate: (latest)=>{
|
|
7130
|
+
if (!shouldTransform) return;
|
|
7131
|
+
if ("x" === key) transformState.x = latest;
|
|
7132
|
+
if ("y" === key) transformState.y = latest;
|
|
7133
|
+
if ("scale" === key) transformState.scale = latest;
|
|
7134
|
+
applyTransform();
|
|
7135
|
+
},
|
|
7136
|
+
onComplete: handleComplete
|
|
7137
|
+
});
|
|
7138
|
+
controls.push(control);
|
|
7139
|
+
});
|
|
7140
|
+
};
|
|
7141
|
+
let timeoutId = null;
|
|
7142
|
+
if (delay > 0) timeoutId = window.setTimeout(start, delay);
|
|
7143
|
+
else start();
|
|
7144
|
+
return {
|
|
7145
|
+
stop: ()=>{
|
|
7146
|
+
if (null !== timeoutId) clearTimeout(timeoutId);
|
|
7147
|
+
controls.forEach((control)=>control.stop());
|
|
7148
|
+
}
|
|
7149
|
+
};
|
|
7150
|
+
};
|
|
7151
|
+
var ColorWheelFlower_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div><div class="absolute inset-0"><div class="absolute inset-0"><div class="absolute inset-0 rounded-full"></div></div><div class="absolute inset-0"><div class="absolute inset-0 rounded-full"></div></div></div><div class="relative z-10 w-[calc(100%-5px)] h-[calc(100%-5px)] rounded-full">'), ColorWheelFlower_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class=absolute><div class="w-[32px] h-[32px]"><button type=button><span>');
|
|
7152
|
+
const parseRgbToHsl = (rgbString)=>{
|
|
7153
|
+
const match = rgbString.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
|
|
7154
|
+
if (!match) return {
|
|
7155
|
+
hue: 0,
|
|
7156
|
+
saturation: 0,
|
|
7157
|
+
lightness: 100
|
|
7158
|
+
};
|
|
7159
|
+
const r = parseInt(match[1]);
|
|
7160
|
+
const g = parseInt(match[2]);
|
|
7161
|
+
const b = parseInt(match[3]);
|
|
7162
|
+
const hsl = rgbToHsl(r, g, b);
|
|
7163
|
+
return {
|
|
7164
|
+
hue: hsl.h,
|
|
7165
|
+
saturation: hsl.s,
|
|
7166
|
+
lightness: hsl.l
|
|
7167
|
+
};
|
|
7168
|
+
};
|
|
7169
|
+
const createColorItem = (rgb, offsetX, offsetY)=>({
|
|
7170
|
+
rgb,
|
|
7171
|
+
offsetX,
|
|
7172
|
+
offsetY,
|
|
7173
|
+
...parseRgbToHsl(rgb)
|
|
7174
|
+
});
|
|
7175
|
+
const readMotionState = (el)=>{
|
|
7176
|
+
const styles = getComputedStyle(el);
|
|
7177
|
+
const opacityValue = Number.parseFloat(styles.opacity);
|
|
7178
|
+
const opacity = Number.isFinite(opacityValue) ? opacityValue : 1;
|
|
7179
|
+
const transform = styles.transform;
|
|
7180
|
+
if (!transform || "none" === transform) return {
|
|
7181
|
+
opacity,
|
|
7182
|
+
x: 0,
|
|
7183
|
+
y: 0,
|
|
7184
|
+
scale: 1
|
|
7185
|
+
};
|
|
7186
|
+
if ("undefined" != typeof DOMMatrixReadOnly) {
|
|
7187
|
+
const matrix = new DOMMatrixReadOnly(transform);
|
|
7188
|
+
return {
|
|
7189
|
+
opacity,
|
|
7190
|
+
x: matrix.m41,
|
|
7191
|
+
y: matrix.m42,
|
|
7192
|
+
scale: matrix.a
|
|
7193
|
+
};
|
|
7194
|
+
}
|
|
7195
|
+
const matrixMatch = transform.match(/matrix\(([^)]+)\)/);
|
|
7196
|
+
if (!matrixMatch) return {
|
|
7197
|
+
opacity,
|
|
7198
|
+
x: 0,
|
|
7199
|
+
y: 0,
|
|
7200
|
+
scale: 1
|
|
7201
|
+
};
|
|
7202
|
+
const values = matrixMatch[1].split(",").map((value)=>Number.parseFloat(value.trim()));
|
|
7203
|
+
return {
|
|
7204
|
+
opacity,
|
|
7205
|
+
scale: Number.isFinite(values[0]) ? values[0] : 1,
|
|
7206
|
+
x: Number.isFinite(values[4]) ? values[4] : 0,
|
|
7207
|
+
y: Number.isFinite(values[5]) ? values[5] : 0
|
|
7208
|
+
};
|
|
7209
|
+
};
|
|
7210
|
+
const getLiftOffset = (item, distance)=>{
|
|
7211
|
+
const radius = Math.sqrt(item.offsetX ** 2 + item.offsetY ** 2);
|
|
7212
|
+
if (!Number.isFinite(radius) || 0 === radius) return {
|
|
7213
|
+
x: 0,
|
|
7214
|
+
y: 0
|
|
7215
|
+
};
|
|
7216
|
+
return {
|
|
7217
|
+
x: item.offsetX / radius * distance,
|
|
7218
|
+
y: item.offsetY / radius * distance
|
|
7219
|
+
};
|
|
7220
|
+
};
|
|
7221
|
+
const COLORS = [
|
|
7222
|
+
createColorItem("rgb(245,245,61)", 34.641, -20),
|
|
7223
|
+
createColorItem("rgb(245,153,61)", 20, -34.641),
|
|
7224
|
+
createColorItem("rgb(245,61,61)", 0, -40),
|
|
7225
|
+
createColorItem("rgb(245,61,153)", -20, -34.641),
|
|
7226
|
+
createColorItem("rgb(245,61,245)", -34.641, -20),
|
|
7227
|
+
createColorItem("rgb(153,61,245)", -40, 0),
|
|
7228
|
+
createColorItem("rgb(61,61,245)", -34.641, 20),
|
|
7229
|
+
createColorItem("rgb(61,153,245)", -20, 34.641),
|
|
7230
|
+
createColorItem("rgb(61,245,245)", 0, 40),
|
|
7231
|
+
createColorItem("rgb(61,245,153)", 20, 34.641),
|
|
7232
|
+
createColorItem("rgb(61,245,61)", 34.641, 20),
|
|
7233
|
+
createColorItem("rgb(153,245,61)", 40, 0),
|
|
7234
|
+
createColorItem("rgb(240,217,194)", 10, -17.3205),
|
|
7235
|
+
createColorItem("rgb(240,194,217)", -10, -17.3205),
|
|
7236
|
+
createColorItem("rgb(217,194,240)", -20, 0),
|
|
7237
|
+
createColorItem("rgb(194,217,240)", -10, 17.3205),
|
|
7238
|
+
createColorItem("rgb(194,240,217)", 10, 17.3205),
|
|
7239
|
+
createColorItem("rgb(217,240,194)", 20, 0),
|
|
7240
|
+
createColorItem("rgb(255,255,255)", 0, 0)
|
|
7241
|
+
];
|
|
7242
|
+
const RAINBOW_GRADIENT = `conic-gradient(
|
|
7243
|
+
from 0deg,
|
|
7244
|
+
rgb(245,61,61) 0deg,
|
|
7245
|
+
rgb(245,153,61) 30deg,
|
|
7246
|
+
rgb(245,245,61) 60deg,
|
|
7247
|
+
rgb(61,245,61) 120deg,
|
|
7248
|
+
rgb(61,245,245) 180deg,
|
|
7249
|
+
rgb(61,61,245) 240deg,
|
|
7250
|
+
rgb(245,61,245) 300deg,
|
|
7251
|
+
rgb(245,61,61) 360deg
|
|
7252
|
+
)`;
|
|
7253
|
+
const ColorWheelFlower = (props)=>{
|
|
7254
|
+
const context = useColorPickerContext();
|
|
7255
|
+
const [selectedIndex, setSelectedIndex] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(null);
|
|
7256
|
+
const [hoveredIndex, setHoveredIndex] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(null);
|
|
7257
|
+
const reduceMotion = prefersReducedMotion();
|
|
7258
|
+
const dotTransition = reduceMotion ? {
|
|
7259
|
+
duration: 0
|
|
7260
|
+
} : {
|
|
7261
|
+
duration: motionDurations.fast,
|
|
7262
|
+
easing: motionEasings.out
|
|
7263
|
+
};
|
|
7264
|
+
const ringTransition = reduceMotion ? {
|
|
7265
|
+
duration: 0
|
|
7266
|
+
} : {
|
|
7267
|
+
duration: motionDurations.base,
|
|
7268
|
+
easing: motionEasings.out
|
|
7269
|
+
};
|
|
7270
|
+
const hoverLift = reduceMotion ? 0 : motionDistances.sm / 2;
|
|
7271
|
+
const selectLift = reduceMotion ? 0 : motionDistances.sm;
|
|
7272
|
+
let outerRingRef;
|
|
7273
|
+
let outerRingControl = null;
|
|
7274
|
+
const handleDotClick = (index)=>{
|
|
7275
|
+
if (context.disabled()) return;
|
|
7276
|
+
if (selectedIndex() === index) {
|
|
7277
|
+
setSelectedIndex(null);
|
|
7278
|
+
const whiteColor = createColorFromHsl(0, 0, 100, context.color().hsl.a);
|
|
7279
|
+
context.onChange(whiteColor);
|
|
7280
|
+
} else {
|
|
7281
|
+
setSelectedIndex(index);
|
|
7282
|
+
const color = COLORS[index];
|
|
7283
|
+
const newColor = createColorFromHsl(color.hue, color.saturation, color.lightness, context.color().hsl.a);
|
|
7284
|
+
context.onChange(newColor);
|
|
7285
|
+
}
|
|
7286
|
+
};
|
|
7287
|
+
const containerClasses = ()=>twMerge("relative w-[140px] h-[140px] flex items-center justify-center", clsx({
|
|
7288
|
+
"opacity-50 cursor-not-allowed": context.disabled()
|
|
7289
|
+
}), props.class, props.className);
|
|
7290
|
+
const outerRingBackground = ()=>{
|
|
7291
|
+
const idx = selectedIndex();
|
|
7292
|
+
return null === idx ? RAINBOW_GRADIENT : `conic-gradient(${COLORS[idx].rgb}, ${COLORS[idx].rgb})`;
|
|
7293
|
+
};
|
|
7294
|
+
const outerRingTarget = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
7295
|
+
if (context.disabled()) return {
|
|
7296
|
+
opacity: 0.5,
|
|
7297
|
+
scale: 1
|
|
7298
|
+
};
|
|
7299
|
+
if (null !== selectedIndex()) return {
|
|
7300
|
+
opacity: 1,
|
|
7301
|
+
scale: 1.04
|
|
7302
|
+
};
|
|
7303
|
+
if (null !== hoveredIndex()) return {
|
|
7304
|
+
opacity: 0.96,
|
|
7305
|
+
scale: 1.02
|
|
7306
|
+
};
|
|
7307
|
+
return {
|
|
7308
|
+
opacity: 0.9,
|
|
7309
|
+
scale: 1
|
|
7310
|
+
};
|
|
7311
|
+
});
|
|
7312
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
|
|
7313
|
+
if (!outerRingRef) return;
|
|
7314
|
+
const target = outerRingTarget();
|
|
7315
|
+
outerRingControl?.stop();
|
|
7316
|
+
outerRingControl = runMotion(outerRingRef, readMotionState(outerRingRef), target, ringTransition);
|
|
7317
|
+
});
|
|
7318
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
7319
|
+
outerRingControl?.stop();
|
|
7320
|
+
});
|
|
7321
|
+
return (()=>{
|
|
7322
|
+
var _el$ = ColorWheelFlower_tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$2.nextSibling;
|
|
7323
|
+
_el$3.style.setProperty("transform", "scale(1.1)");
|
|
7324
|
+
var _ref$ = outerRingRef;
|
|
7325
|
+
"function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$4) : outerRingRef = _el$4;
|
|
7326
|
+
_el$4.style.setProperty("transition", reduceMotion ? "none" : "background 500ms ease-out");
|
|
7327
|
+
_el$5.style.setProperty("transform", "scale(0.9)");
|
|
7328
|
+
_el$6.style.setProperty("background", "#0b1012");
|
|
7329
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$7, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
|
|
7330
|
+
each: COLORS,
|
|
7331
|
+
children: (item, index)=>{
|
|
7332
|
+
let motionRef;
|
|
7333
|
+
let dotControl = null;
|
|
7334
|
+
const isSelected = ()=>selectedIndex() === index();
|
|
7335
|
+
const isHovered = ()=>hoveredIndex() === index();
|
|
7336
|
+
const hasSelection = ()=>null !== selectedIndex();
|
|
7337
|
+
const hasHover = ()=>null !== hoveredIndex();
|
|
7338
|
+
const dotTarget = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
7339
|
+
if (context.disabled()) return {
|
|
7340
|
+
opacity: 0.5,
|
|
7341
|
+
scale: 1,
|
|
7342
|
+
x: 0,
|
|
7343
|
+
y: 0
|
|
7344
|
+
};
|
|
7345
|
+
if (isSelected()) {
|
|
7346
|
+
const lift = getLiftOffset(item, selectLift);
|
|
7347
|
+
return {
|
|
7348
|
+
opacity: 1,
|
|
7349
|
+
scale: 1.18,
|
|
7350
|
+
x: lift.x,
|
|
7351
|
+
y: lift.y
|
|
7352
|
+
};
|
|
7353
|
+
}
|
|
7354
|
+
if (isHovered()) {
|
|
7355
|
+
const lift = getLiftOffset(item, hoverLift);
|
|
7356
|
+
return {
|
|
7357
|
+
opacity: 1,
|
|
7358
|
+
scale: 1.1,
|
|
7359
|
+
x: lift.x,
|
|
7360
|
+
y: lift.y
|
|
7361
|
+
};
|
|
7362
|
+
}
|
|
7363
|
+
if (hasSelection()) return {
|
|
7364
|
+
opacity: 0.65,
|
|
7365
|
+
scale: 0.92,
|
|
7366
|
+
x: 0,
|
|
7367
|
+
y: 0
|
|
7368
|
+
};
|
|
7369
|
+
if (hasHover()) return {
|
|
7370
|
+
opacity: 0.85,
|
|
7371
|
+
scale: 0.96,
|
|
7372
|
+
x: 0,
|
|
7373
|
+
y: 0
|
|
7374
|
+
};
|
|
7375
|
+
return {
|
|
7376
|
+
opacity: 0.95,
|
|
7377
|
+
scale: 1,
|
|
7378
|
+
x: 0,
|
|
7379
|
+
y: 0
|
|
7380
|
+
};
|
|
7381
|
+
});
|
|
7382
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
|
|
7383
|
+
if (!motionRef) return;
|
|
7384
|
+
const target = dotTarget();
|
|
7385
|
+
dotControl?.stop();
|
|
7386
|
+
dotControl = runMotion(motionRef, readMotionState(motionRef), target, dotTransition);
|
|
7387
|
+
});
|
|
7388
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
7389
|
+
dotControl?.stop();
|
|
7390
|
+
});
|
|
7391
|
+
return (()=>{
|
|
7392
|
+
var _el$8 = ColorWheelFlower_tmpl$2(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild;
|
|
7393
|
+
_el$8.style.setProperty("transform", "translate(-50%, -50%)");
|
|
7394
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)((el)=>{
|
|
7395
|
+
motionRef = el;
|
|
7396
|
+
}, _el$9);
|
|
7397
|
+
_el$0.addEventListener("blur", ()=>{
|
|
7398
|
+
if (!context.disabled()) setHoveredIndex(null);
|
|
7399
|
+
});
|
|
7400
|
+
_el$0.addEventListener("focus", ()=>{
|
|
7401
|
+
if (!context.disabled()) setHoveredIndex(index());
|
|
7402
|
+
});
|
|
7403
|
+
_el$0.addEventListener("mouseleave", ()=>{
|
|
7404
|
+
if (!context.disabled()) setHoveredIndex(null);
|
|
7405
|
+
});
|
|
7406
|
+
_el$0.addEventListener("mouseenter", ()=>{
|
|
7407
|
+
if (!context.disabled()) setHoveredIndex(index());
|
|
7408
|
+
});
|
|
7409
|
+
_el$0.$$click = ()=>handleDotClick(index());
|
|
7410
|
+
_el$0.style.setProperty("box-shadow", "0 2px 8px rgba(0,0,0,0.3)");
|
|
7411
|
+
_el$1.style.setProperty("mix-blend-mode", "overlay");
|
|
7412
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
7413
|
+
var _v$3 = `calc(50% + ${item.offsetX}px)`, _v$4 = `calc(50% + ${item.offsetY}px)`, _v$5 = context.disabled() ? -1 : 0, _v$6 = clsx("w-full h-full rounded-full", "transition-shadow duration-200 ease-out", "focus:outline-none focus:ring-2 focus:ring-white/50", "relative z-10", {
|
|
7414
|
+
"cursor-not-allowed": context.disabled(),
|
|
7415
|
+
"cursor-pointer": !context.disabled()
|
|
7416
|
+
}), _v$7 = item.rgb, _v$8 = `Select color ${item.rgb}`, _v$9 = selectedIndex() === index(), _v$0 = clsx("absolute inset-0 rounded-full border-2 border-white", "transition-opacity duration-300 ease-out"), _v$1 = selectedIndex() === index() ? "1" : "0";
|
|
7417
|
+
_v$3 !== _p$.e && (null != (_p$.e = _v$3) ? _el$8.style.setProperty("left", _v$3) : _el$8.style.removeProperty("left"));
|
|
7418
|
+
_v$4 !== _p$.t && (null != (_p$.t = _v$4) ? _el$8.style.setProperty("top", _v$4) : _el$8.style.removeProperty("top"));
|
|
7419
|
+
_v$5 !== _p$.a && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$0, "tabindex", _p$.a = _v$5);
|
|
7420
|
+
_v$6 !== _p$.o && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$0, _p$.o = _v$6);
|
|
7421
|
+
_v$7 !== _p$.i && (null != (_p$.i = _v$7) ? _el$0.style.setProperty("background", _v$7) : _el$0.style.removeProperty("background"));
|
|
7422
|
+
_v$8 !== _p$.n && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$0, "aria-label", _p$.n = _v$8);
|
|
7423
|
+
_v$9 !== _p$.s && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$0, "aria-pressed", _p$.s = _v$9);
|
|
7424
|
+
_v$0 !== _p$.h && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$1, _p$.h = _v$0);
|
|
7425
|
+
_v$1 !== _p$.r && (null != (_p$.r = _v$1) ? _el$1.style.setProperty("opacity", _v$1) : _el$1.style.removeProperty("opacity"));
|
|
7426
|
+
return _p$;
|
|
7427
|
+
}, {
|
|
7428
|
+
e: void 0,
|
|
7429
|
+
t: void 0,
|
|
7430
|
+
a: void 0,
|
|
7431
|
+
o: void 0,
|
|
7432
|
+
i: void 0,
|
|
7433
|
+
n: void 0,
|
|
7434
|
+
s: void 0,
|
|
7435
|
+
h: void 0,
|
|
7436
|
+
r: void 0
|
|
7437
|
+
});
|
|
7438
|
+
return _el$8;
|
|
7439
|
+
})();
|
|
7440
|
+
}
|
|
7441
|
+
}));
|
|
7442
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
7443
|
+
var _v$ = containerClasses(), _v$2 = outerRingBackground();
|
|
7444
|
+
_v$ !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$, _p$.e = _v$);
|
|
7445
|
+
_v$2 !== _p$.t && (null != (_p$.t = _v$2) ? _el$4.style.setProperty("background", _v$2) : _el$4.style.removeProperty("background"));
|
|
7446
|
+
return _p$;
|
|
7447
|
+
}, {
|
|
7448
|
+
e: void 0,
|
|
7449
|
+
t: void 0
|
|
7450
|
+
});
|
|
7451
|
+
return _el$;
|
|
7452
|
+
})();
|
|
7453
|
+
};
|
|
7454
|
+
const colorpicker_ColorWheelFlower = ColorWheelFlower;
|
|
7455
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
7456
|
+
"click"
|
|
7457
|
+
]);
|
|
7458
|
+
const ColorPickerFlowerSelector_ColorPickerFlowerSelector = ()=>[
|
|
7459
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(colorpicker_ColorWheelFlower, {}),
|
|
7460
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(LightnessSlider, {})
|
|
7461
|
+
];
|
|
7462
|
+
const ColorPickerFlowerSelector = ColorPickerFlowerSelector_ColorPickerFlowerSelector;
|
|
7463
|
+
var ColorSwatches_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>"), ColorSwatches_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<button type=button>");
|
|
7464
|
+
const ColorSwatches = (props)=>{
|
|
7465
|
+
const context = useColorPickerContext();
|
|
7466
|
+
const handleSwatchClick = (swatch)=>{
|
|
7467
|
+
if (context.disabled()) return;
|
|
7468
|
+
const color = parseColor(swatch);
|
|
7469
|
+
if (color) context.onChange(color);
|
|
7470
|
+
};
|
|
7471
|
+
const handleKeyDown = (e, swatch)=>{
|
|
7472
|
+
if (context.disabled()) return;
|
|
7473
|
+
if ("Enter" === e.key || " " === e.key) {
|
|
7474
|
+
e.preventDefault();
|
|
7475
|
+
handleSwatchClick(swatch);
|
|
7476
|
+
}
|
|
7477
|
+
};
|
|
7478
|
+
const classes = ()=>twMerge("grid grid-cols-8 gap-2 w-full", clsx({
|
|
7479
|
+
"opacity-50 pointer-events-none": context.disabled()
|
|
7480
|
+
}), props.class, props.className);
|
|
7481
|
+
const swatchClasses = (swatch)=>{
|
|
7482
|
+
const isSelected = context.color().hex.toLowerCase() === swatch.toLowerCase();
|
|
7483
|
+
return twMerge("w-8 h-8 rounded cursor-pointer border-2 transition-all duration-150", clsx({
|
|
7484
|
+
"border-primary ring-2 ring-primary ring-offset-2 ring-offset-base-100": isSelected,
|
|
7485
|
+
"border-base-300 hover:scale-110 hover:shadow-lg": !isSelected
|
|
7486
|
+
}));
|
|
7487
|
+
};
|
|
7488
|
+
return (()=>{
|
|
7489
|
+
var _el$ = ColorSwatches_tmpl$();
|
|
7490
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
|
|
7491
|
+
get each () {
|
|
7492
|
+
return props.swatches;
|
|
7493
|
+
},
|
|
7494
|
+
children: (swatch)=>(()=>{
|
|
7495
|
+
var _el$2 = ColorSwatches_tmpl$2();
|
|
7496
|
+
_el$2.$$keydown = (e)=>handleKeyDown(e, swatch);
|
|
7497
|
+
_el$2.$$click = ()=>handleSwatchClick(swatch);
|
|
7498
|
+
null != swatch ? _el$2.style.setProperty("background-color", swatch) : _el$2.style.removeProperty("background-color");
|
|
7499
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$2, "aria-label", `Select color ${swatch}`);
|
|
7500
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
7501
|
+
var _v$ = swatchClasses(swatch), _v$2 = context.disabled(), _v$3 = context.disabled() ? -1 : 0;
|
|
7502
|
+
_v$ !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$2, _p$.e = _v$);
|
|
7503
|
+
_v$2 !== _p$.t && (_el$2.disabled = _p$.t = _v$2);
|
|
7504
|
+
_v$3 !== _p$.a && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$2, "tabindex", _p$.a = _v$3);
|
|
7505
|
+
return _p$;
|
|
7506
|
+
}, {
|
|
7507
|
+
e: void 0,
|
|
7508
|
+
t: void 0,
|
|
7509
|
+
a: void 0
|
|
7510
|
+
});
|
|
7511
|
+
return _el$2;
|
|
7512
|
+
})()
|
|
7513
|
+
}));
|
|
7514
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$, classes()));
|
|
7515
|
+
return _el$;
|
|
7516
|
+
})();
|
|
7517
|
+
};
|
|
7518
|
+
const colorpicker_ColorSwatches = ColorSwatches;
|
|
7519
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
7520
|
+
"click",
|
|
7521
|
+
"keydown"
|
|
7522
|
+
]);
|
|
7523
|
+
var ColorInput_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div><input type=text aria-label="Color value"><select aria-label="Color format"><option value=hex>HEX</option><option value=rgb>RGB</option><option value=rgba>RGBA</option><option value=hsl>HSL</option><option value=hsla>HSLA');
|
|
7524
|
+
const ColorInput = (props)=>{
|
|
7525
|
+
const context = useColorPickerContext();
|
|
7526
|
+
const [inputValue, setInputValue] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)("");
|
|
7527
|
+
const [isValid, setIsValid] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(true);
|
|
7528
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
|
|
7529
|
+
const formatted = formatColor(context.color(), context.format());
|
|
7530
|
+
setInputValue(formatted);
|
|
7531
|
+
setIsValid(true);
|
|
7532
|
+
});
|
|
7533
|
+
const handleInput = (e)=>{
|
|
7534
|
+
const target = e.target;
|
|
7535
|
+
const value = target.value;
|
|
7536
|
+
setInputValue(value);
|
|
7537
|
+
const parsed = parseColor(value);
|
|
7538
|
+
parsed ? setIsValid(true) : setIsValid(false);
|
|
7539
|
+
};
|
|
7540
|
+
const handleKeyDown = (e)=>{
|
|
7541
|
+
if ("Enter" === e.key) applyColor();
|
|
7542
|
+
};
|
|
7543
|
+
const handleBlur = ()=>{
|
|
7544
|
+
applyColor();
|
|
7545
|
+
};
|
|
7546
|
+
const applyColor = ()=>{
|
|
7547
|
+
const parsed = parseColor(inputValue());
|
|
7548
|
+
if (parsed) {
|
|
7549
|
+
context.onChange(parsed);
|
|
7550
|
+
setIsValid(true);
|
|
7551
|
+
} else {
|
|
7552
|
+
const formatted = formatColor(context.color(), context.format());
|
|
7553
|
+
setInputValue(formatted);
|
|
7554
|
+
setIsValid(true);
|
|
7555
|
+
}
|
|
7556
|
+
};
|
|
7557
|
+
const handleFormatChange = (e)=>{
|
|
7558
|
+
const target = e.target;
|
|
7559
|
+
const newFormat = target.value;
|
|
7560
|
+
context.onFormatChange(newFormat);
|
|
7561
|
+
};
|
|
7562
|
+
const inputClasses = ()=>twMerge("flex-1 px-3 py-2 text-sm border rounded-l focus:outline-none focus:ring-2 focus:ring-primary", clsx({
|
|
7563
|
+
"border-error focus:ring-error": !isValid(),
|
|
7564
|
+
"border-base-300": isValid(),
|
|
7565
|
+
"bg-base-200 cursor-not-allowed": context.disabled(),
|
|
7566
|
+
"bg-base-100 text-base-content": !context.disabled()
|
|
7567
|
+
}));
|
|
7568
|
+
const selectClasses = ()=>twMerge("px-3 py-2 text-sm border border-l-0 rounded-r focus:outline-none focus:ring-2 focus:ring-primary bg-base-100 text-base-content border-base-300", clsx({
|
|
7569
|
+
"bg-base-200 cursor-not-allowed": context.disabled()
|
|
7570
|
+
}));
|
|
7571
|
+
return (()=>{
|
|
7572
|
+
var _el$ = ColorInput_tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
7573
|
+
_el$2.addEventListener("blur", handleBlur);
|
|
7574
|
+
_el$2.$$keydown = handleKeyDown;
|
|
7575
|
+
_el$2.$$input = handleInput;
|
|
7576
|
+
_el$3.addEventListener("change", handleFormatChange);
|
|
7577
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
7578
|
+
var _v$ = twMerge("flex w-full", props.class, props.className), _v$2 = context.disabled(), _v$3 = inputClasses(), _v$4 = !isValid(), _v$5 = context.disabled(), _v$6 = selectClasses();
|
|
7579
|
+
_v$ !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$, _p$.e = _v$);
|
|
7580
|
+
_v$2 !== _p$.t && (_el$2.disabled = _p$.t = _v$2);
|
|
7581
|
+
_v$3 !== _p$.a && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$2, _p$.a = _v$3);
|
|
7582
|
+
_v$4 !== _p$.o && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$2, "aria-invalid", _p$.o = _v$4);
|
|
7583
|
+
_v$5 !== _p$.i && (_el$3.disabled = _p$.i = _v$5);
|
|
7584
|
+
_v$6 !== _p$.n && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$3, _p$.n = _v$6);
|
|
7585
|
+
return _p$;
|
|
7586
|
+
}, {
|
|
7587
|
+
e: void 0,
|
|
7588
|
+
t: void 0,
|
|
7589
|
+
a: void 0,
|
|
7590
|
+
o: void 0,
|
|
7591
|
+
i: void 0,
|
|
7592
|
+
n: void 0
|
|
7593
|
+
});
|
|
7594
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>_el$2.value = inputValue());
|
|
7595
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>_el$3.value = context.format());
|
|
7596
|
+
return _el$;
|
|
7597
|
+
})();
|
|
7598
|
+
};
|
|
7599
|
+
const colorpicker_ColorInput = ColorInput;
|
|
7600
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
7601
|
+
"input",
|
|
7602
|
+
"keydown"
|
|
7603
|
+
]);
|
|
7604
|
+
var ColorPreview_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<button type=button><div class="w-full h-full relative">'), ColorPreview_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="absolute inset-0">');
|
|
7605
|
+
const ColorPreview = (props)=>{
|
|
7606
|
+
const classes = ()=>twMerge("w-10 h-10 rounded border-2 cursor-pointer transition-all duration-150 overflow-hidden", clsx({
|
|
7607
|
+
"border-base-300 hover:scale-110 hover:shadow-lg": !props.disabled,
|
|
7608
|
+
"border-base-200 opacity-50 cursor-not-allowed": props.disabled
|
|
7609
|
+
}), props.class, props.className);
|
|
7610
|
+
const hasAlpha = ()=>props.color.hsl.a < 1;
|
|
7611
|
+
return (()=>{
|
|
7612
|
+
var _el$ = ColorPreview_tmpl$(), _el$2 = _el$.firstChild;
|
|
7613
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.addEventListener)(_el$, "click", props.onClick, true);
|
|
7614
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (()=>{
|
|
7615
|
+
var _c$ = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>!!hasAlpha());
|
|
7616
|
+
return ()=>_c$() && (()=>{
|
|
7617
|
+
var _el$3 = ColorPreview_tmpl$2();
|
|
7618
|
+
_el$3.style.setProperty("background-image", "linear-gradient(45deg, hsl(var(--b3)) 25%, transparent 25%), linear-gradient(-45deg, hsl(var(--b3)) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, hsl(var(--b3)) 75%), linear-gradient(-45deg, transparent 75%, hsl(var(--b3)) 75%)");
|
|
7619
|
+
_el$3.style.setProperty("background-size", "8px 8px");
|
|
7620
|
+
_el$3.style.setProperty("background-position", "0 0, 0 4px, 4px -4px, -4px 0px");
|
|
7621
|
+
return _el$3;
|
|
7622
|
+
})();
|
|
7623
|
+
})(), _el$2);
|
|
7624
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
7625
|
+
var _v$ = classes(), _v$2 = props.disabled, _v$3 = `Current color: ${formatColor(props.color, "hex")}`, _v$4 = props.disabled ? -1 : 0, _v$5 = `rgba(${props.color.rgb.r}, ${props.color.rgb.g}, ${props.color.rgb.b}, ${props.color.rgb.a})`;
|
|
7626
|
+
_v$ !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$, _p$.e = _v$);
|
|
7627
|
+
_v$2 !== _p$.t && (_el$.disabled = _p$.t = _v$2);
|
|
7628
|
+
_v$3 !== _p$.a && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "aria-label", _p$.a = _v$3);
|
|
7629
|
+
_v$4 !== _p$.o && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "tabindex", _p$.o = _v$4);
|
|
7630
|
+
_v$5 !== _p$.i && (null != (_p$.i = _v$5) ? _el$2.style.setProperty("background-color", _v$5) : _el$2.style.removeProperty("background-color"));
|
|
7631
|
+
return _p$;
|
|
7632
|
+
}, {
|
|
7633
|
+
e: void 0,
|
|
7634
|
+
t: void 0,
|
|
7635
|
+
a: void 0,
|
|
7636
|
+
o: void 0,
|
|
7637
|
+
i: void 0
|
|
7638
|
+
});
|
|
7639
|
+
return _el$;
|
|
7640
|
+
})();
|
|
7641
|
+
};
|
|
7642
|
+
const colorpicker_ColorPreview = ColorPreview;
|
|
7643
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
7644
|
+
"click"
|
|
7645
|
+
]);
|
|
7646
|
+
var MotionDiv_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>");
|
|
7647
|
+
const MotionDiv_MotionDiv = (props)=>{
|
|
7648
|
+
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
7649
|
+
"initial",
|
|
7650
|
+
"animate",
|
|
7651
|
+
"exit",
|
|
7652
|
+
"transition",
|
|
7653
|
+
"isExiting",
|
|
7654
|
+
"onExitComplete",
|
|
7655
|
+
"animateKey",
|
|
7656
|
+
"children",
|
|
7657
|
+
"ref"
|
|
7658
|
+
]);
|
|
7659
|
+
const [elementRef, setElementRef] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(void 0);
|
|
7660
|
+
let activeControl = null;
|
|
7661
|
+
let lastTrigger;
|
|
7662
|
+
let lastIsExiting = false;
|
|
7663
|
+
let hasAnimated = false;
|
|
7664
|
+
const stopActive = ()=>{
|
|
7665
|
+
activeControl?.stop();
|
|
7666
|
+
activeControl = null;
|
|
7667
|
+
};
|
|
7668
|
+
const runEnter = (target, from, to, transition)=>{
|
|
7669
|
+
if (!to) return;
|
|
7670
|
+
stopActive();
|
|
7671
|
+
activeControl = runMotion(target, from ?? {}, to ?? {}, transition);
|
|
7672
|
+
};
|
|
7673
|
+
const runExit = (target, from, to, transition, onComplete)=>{
|
|
7674
|
+
if (!to) return void onComplete?.();
|
|
7675
|
+
stopActive();
|
|
7676
|
+
activeControl = runMotion(target, from ?? {}, to ?? {}, transition, onComplete);
|
|
7677
|
+
};
|
|
7678
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
|
|
7679
|
+
const target = elementRef();
|
|
7680
|
+
if (!target) return;
|
|
7681
|
+
const isExiting = Boolean(local.isExiting);
|
|
7682
|
+
const trigger = local.animateKey;
|
|
7683
|
+
const initial = local.initial;
|
|
7684
|
+
const animate = local.animate;
|
|
7685
|
+
const exit = local.exit;
|
|
7686
|
+
const transition = local.transition;
|
|
7687
|
+
const onComplete = local.onExitComplete;
|
|
7688
|
+
if (isExiting) {
|
|
7689
|
+
if (!lastIsExiting) {
|
|
7690
|
+
lastIsExiting = true;
|
|
7691
|
+
hasAnimated = false;
|
|
7692
|
+
runExit(target, animate ?? initial, exit, transition, onComplete);
|
|
7693
|
+
}
|
|
7694
|
+
return;
|
|
7695
|
+
}
|
|
7696
|
+
lastIsExiting = false;
|
|
7697
|
+
if (!hasAnimated || trigger !== lastTrigger) {
|
|
7698
|
+
lastTrigger = trigger;
|
|
7699
|
+
hasAnimated = true;
|
|
7700
|
+
runEnter(target, initial, animate, transition);
|
|
7701
|
+
}
|
|
7702
|
+
});
|
|
7703
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
7704
|
+
stopActive();
|
|
7705
|
+
});
|
|
7706
|
+
return (()=>{
|
|
7707
|
+
var _el$ = MotionDiv_tmpl$();
|
|
7708
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)((el)=>{
|
|
7709
|
+
setElementRef(el);
|
|
7710
|
+
if ("function" == typeof local.ref) local.ref(el);
|
|
7711
|
+
}, _el$);
|
|
7712
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, rest, false, true);
|
|
7713
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.children);
|
|
7714
|
+
return _el$;
|
|
7715
|
+
})();
|
|
7716
|
+
};
|
|
7717
|
+
const MotionDiv = MotionDiv_MotionDiv;
|
|
7718
|
+
const createMotionPresets = (tokens)=>{
|
|
7719
|
+
const durations = tokens.durations;
|
|
7720
|
+
const easings = tokens.easings;
|
|
7721
|
+
const distances = tokens.distances;
|
|
7722
|
+
return {
|
|
7723
|
+
route: {
|
|
7724
|
+
initial: {
|
|
7725
|
+
opacity: 0
|
|
7726
|
+
},
|
|
7727
|
+
animate: {
|
|
7728
|
+
opacity: 1
|
|
7729
|
+
},
|
|
7730
|
+
exit: {
|
|
7731
|
+
opacity: 0
|
|
7732
|
+
},
|
|
7733
|
+
transition: {
|
|
7734
|
+
duration: durations.route,
|
|
7735
|
+
easing: easings.out
|
|
7736
|
+
}
|
|
7737
|
+
},
|
|
7738
|
+
routeAuth: {
|
|
7739
|
+
initial: {
|
|
7740
|
+
opacity: 0,
|
|
7741
|
+
x: distances.slideIn
|
|
7742
|
+
},
|
|
7743
|
+
animate: {
|
|
7744
|
+
opacity: 1,
|
|
7745
|
+
x: 0
|
|
7746
|
+
},
|
|
7747
|
+
exit: {
|
|
7748
|
+
opacity: 0,
|
|
7749
|
+
x: -distances.slideIn
|
|
7750
|
+
},
|
|
7751
|
+
transition: {
|
|
7752
|
+
duration: durations.routeAuth,
|
|
7753
|
+
easing: easings.inOut
|
|
7754
|
+
}
|
|
7755
|
+
},
|
|
7756
|
+
routeAuthBack: {
|
|
7757
|
+
initial: {
|
|
7758
|
+
opacity: 0,
|
|
7759
|
+
x: -distances.slideIn
|
|
7760
|
+
},
|
|
7761
|
+
animate: {
|
|
7762
|
+
opacity: 1,
|
|
7763
|
+
x: 0
|
|
7764
|
+
},
|
|
7765
|
+
exit: {
|
|
7766
|
+
opacity: 0,
|
|
7767
|
+
x: distances.slideIn
|
|
7768
|
+
},
|
|
7769
|
+
transition: {
|
|
7770
|
+
duration: durations.routeAuth,
|
|
7771
|
+
easing: easings.inOut
|
|
7772
|
+
}
|
|
7773
|
+
},
|
|
7774
|
+
authSwap: {
|
|
7775
|
+
initial: {
|
|
7776
|
+
opacity: 0.92
|
|
7777
|
+
},
|
|
7778
|
+
animate: {
|
|
7779
|
+
opacity: 1
|
|
7780
|
+
},
|
|
7781
|
+
exit: {
|
|
7782
|
+
opacity: 0.92
|
|
7783
|
+
},
|
|
7784
|
+
transition: {
|
|
7785
|
+
duration: durations.fast,
|
|
7786
|
+
easing: easings.out
|
|
7787
|
+
}
|
|
7788
|
+
},
|
|
7789
|
+
fade: {
|
|
7790
|
+
initial: {
|
|
7791
|
+
opacity: 0
|
|
7792
|
+
},
|
|
7793
|
+
animate: {
|
|
7794
|
+
opacity: 1
|
|
7795
|
+
},
|
|
7796
|
+
exit: {
|
|
7797
|
+
opacity: 0
|
|
7798
|
+
},
|
|
7799
|
+
transition: {
|
|
7800
|
+
duration: durations.base,
|
|
7801
|
+
easing: easings.out,
|
|
7802
|
+
delay: 0.08
|
|
7803
|
+
}
|
|
7804
|
+
},
|
|
7805
|
+
fadeUp: {
|
|
7806
|
+
initial: {
|
|
7807
|
+
opacity: 0,
|
|
7808
|
+
y: distances.sm
|
|
7809
|
+
},
|
|
7810
|
+
animate: {
|
|
7811
|
+
opacity: 1,
|
|
7812
|
+
y: 0
|
|
7813
|
+
},
|
|
7814
|
+
exit: {
|
|
7815
|
+
opacity: 0,
|
|
7816
|
+
y: -distances.sm
|
|
7817
|
+
},
|
|
7818
|
+
transition: {
|
|
7819
|
+
duration: durations.base,
|
|
7820
|
+
easing: easings.out,
|
|
7821
|
+
delay: 0.08
|
|
7822
|
+
}
|
|
7823
|
+
},
|
|
7824
|
+
scaleIn: {
|
|
7825
|
+
initial: {
|
|
7826
|
+
opacity: 0,
|
|
7827
|
+
scale: 0.96
|
|
7828
|
+
},
|
|
7829
|
+
animate: {
|
|
7830
|
+
opacity: 1,
|
|
7831
|
+
scale: 1
|
|
7832
|
+
},
|
|
7833
|
+
exit: {
|
|
7834
|
+
opacity: 0,
|
|
7835
|
+
scale: 0.96
|
|
7836
|
+
},
|
|
7837
|
+
transition: {
|
|
7838
|
+
duration: durations.fast,
|
|
7839
|
+
easing: easings.out,
|
|
7840
|
+
delay: 0.08
|
|
7841
|
+
}
|
|
7842
|
+
},
|
|
7843
|
+
toast: {
|
|
7844
|
+
initial: {
|
|
7845
|
+
opacity: 0,
|
|
7846
|
+
y: distances.sm
|
|
7847
|
+
},
|
|
7848
|
+
animate: {
|
|
7849
|
+
opacity: 1,
|
|
7850
|
+
y: 0
|
|
7851
|
+
},
|
|
7852
|
+
exit: {
|
|
7853
|
+
opacity: 0,
|
|
7854
|
+
y: -distances.sm
|
|
7855
|
+
},
|
|
7856
|
+
transition: {
|
|
7857
|
+
duration: durations.fast,
|
|
7858
|
+
easing: easings.out
|
|
7859
|
+
}
|
|
7860
|
+
},
|
|
7861
|
+
routeDashboard: {
|
|
7862
|
+
initial: {
|
|
7863
|
+
opacity: 0,
|
|
7864
|
+
y: distances.md,
|
|
7865
|
+
scale: 0.985
|
|
7866
|
+
},
|
|
7867
|
+
animate: {
|
|
7868
|
+
opacity: 1,
|
|
7869
|
+
y: 0,
|
|
7870
|
+
scale: 1
|
|
7871
|
+
},
|
|
7872
|
+
exit: {
|
|
7873
|
+
opacity: 0,
|
|
7874
|
+
y: -distances.sm,
|
|
7875
|
+
scale: 0.985
|
|
7876
|
+
},
|
|
7877
|
+
transition: {
|
|
7878
|
+
duration: durations.route,
|
|
7879
|
+
easing: easings.out
|
|
7880
|
+
}
|
|
7881
|
+
}
|
|
7882
|
+
};
|
|
7883
|
+
};
|
|
7884
|
+
const motionPresets = createMotionPresets(defaultMotionTokens);
|
|
7885
|
+
const routeTransition = motionPresets.route;
|
|
7886
|
+
const noMotion = {
|
|
7887
|
+
initial: {
|
|
7888
|
+
opacity: 1,
|
|
7889
|
+
y: 0,
|
|
7890
|
+
x: 0,
|
|
7891
|
+
scale: 1
|
|
7892
|
+
},
|
|
7893
|
+
animate: {
|
|
7894
|
+
opacity: 1,
|
|
7895
|
+
y: 0,
|
|
7896
|
+
x: 0,
|
|
7897
|
+
scale: 1
|
|
7898
|
+
},
|
|
7899
|
+
exit: {
|
|
7900
|
+
opacity: 1,
|
|
7901
|
+
y: 0,
|
|
7902
|
+
x: 0,
|
|
7903
|
+
scale: 1
|
|
7904
|
+
},
|
|
7905
|
+
transition: {
|
|
7906
|
+
duration: 0
|
|
7907
|
+
}
|
|
7908
|
+
};
|
|
7909
|
+
const presets_getPreset = (name)=>motionPresets[name];
|
|
7910
|
+
const presets_registerPreset = (name, preset)=>{
|
|
7911
|
+
motionPresets[name] = preset;
|
|
7912
|
+
};
|
|
7913
|
+
const presets_resolvePreset = (name, options)=>{
|
|
7914
|
+
const reduce = options?.reduceMotion ?? prefersReducedMotion();
|
|
7915
|
+
if (reduce) return noMotion;
|
|
7916
|
+
return motionPresets[name] ?? noMotion;
|
|
7917
|
+
};
|
|
7918
|
+
var ColorPicker_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="flex p-1 mb-3 bg-base-200 rounded-md"><button type=button>Gradient</button><button type=button>Wheel</button><button type=button>Flower'), ColorPicker_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="pt-2 border-t border-base-300">'), ColorPicker_tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div class=space-y-4>"), ColorPicker_tmpl$4 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="fixed inset-0 z-40"aria-hidden=true>'), _tmpl$5 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>");
|
|
7919
|
+
const DEFAULT_SWATCHES = [
|
|
7920
|
+
"#FF6B6B",
|
|
7921
|
+
"#4ECDC4",
|
|
7922
|
+
"#45B7D1",
|
|
7923
|
+
"#FFA07A",
|
|
7924
|
+
"#98D8C8",
|
|
7925
|
+
"#F7DC6F",
|
|
7926
|
+
"#BB8FCE",
|
|
7927
|
+
"#85929E",
|
|
7928
|
+
"#FF5733",
|
|
7929
|
+
"#C70039",
|
|
7930
|
+
"#900C3F",
|
|
7931
|
+
"#581845",
|
|
7932
|
+
"#2ECC71",
|
|
7933
|
+
"#3498DB",
|
|
7934
|
+
"#9B59B6",
|
|
7935
|
+
"#E74C3C"
|
|
7936
|
+
];
|
|
7937
|
+
const ColorPicker = (props)=>{
|
|
7938
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
7939
|
+
"value",
|
|
7940
|
+
"onChange",
|
|
7941
|
+
"format",
|
|
7942
|
+
"disabled",
|
|
7943
|
+
"swatches",
|
|
7944
|
+
"showAlpha",
|
|
7945
|
+
"placement",
|
|
7946
|
+
"initialMode",
|
|
7947
|
+
"class",
|
|
7948
|
+
"className",
|
|
7949
|
+
"dataTheme",
|
|
7950
|
+
"style",
|
|
7951
|
+
"aria-label"
|
|
7952
|
+
]);
|
|
7953
|
+
const [isOpen, setIsOpen] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
|
|
7954
|
+
const [internalColor, setInternalColor] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(getDefaultColor());
|
|
7955
|
+
const [currentFormat, setCurrentFormat] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(local.format || "hex");
|
|
7956
|
+
const [mode, setMode] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(local.initialMode || "picker");
|
|
7957
|
+
let containerRef;
|
|
7958
|
+
const color = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
7959
|
+
if (local.value) {
|
|
7960
|
+
const parsed = parseColor(local.value);
|
|
7961
|
+
if (parsed) {
|
|
7962
|
+
setInternalColor(parsed);
|
|
7963
|
+
return parsed;
|
|
7964
|
+
}
|
|
7965
|
+
}
|
|
7966
|
+
return internalColor();
|
|
7967
|
+
});
|
|
7968
|
+
const handleColorChange = (newColor)=>{
|
|
7969
|
+
setInternalColor(newColor);
|
|
7970
|
+
if (local.onChange) {
|
|
7971
|
+
const formatted = formatColor(newColor, currentFormat());
|
|
7972
|
+
local.onChange(formatted);
|
|
7973
|
+
}
|
|
7974
|
+
};
|
|
7975
|
+
const handleFormatChange = (newFormat)=>{
|
|
7976
|
+
setCurrentFormat(newFormat);
|
|
7977
|
+
if (local.onChange) {
|
|
7978
|
+
const formatted = formatColor(color(), newFormat);
|
|
7979
|
+
local.onChange(formatted);
|
|
7980
|
+
}
|
|
7981
|
+
};
|
|
7982
|
+
const togglePicker = ()=>{
|
|
7983
|
+
if (!local.disabled) setIsOpen(!isOpen());
|
|
7984
|
+
};
|
|
7985
|
+
const handleKeyDown = (e)=>{
|
|
7986
|
+
if ("Escape" === e.key && isOpen()) {
|
|
7987
|
+
setIsOpen(false);
|
|
7988
|
+
e.preventDefault();
|
|
7989
|
+
}
|
|
7990
|
+
};
|
|
7991
|
+
const contextValue = {
|
|
7992
|
+
color,
|
|
7993
|
+
format: currentFormat,
|
|
7994
|
+
disabled: ()=>local.disabled || false,
|
|
7995
|
+
onChange: handleColorChange,
|
|
7996
|
+
onFormatChange: handleFormatChange
|
|
7997
|
+
};
|
|
7998
|
+
const containerClasses = ()=>twMerge("relative inline-block", clsx({
|
|
7999
|
+
"opacity-50": local.disabled
|
|
8000
|
+
}), local.class, local.className);
|
|
8001
|
+
const popoverClasses = ()=>{
|
|
8002
|
+
const base = "z-50 p-4 bg-base-100 rounded-lg shadow-xl border border-base-300 min-w-[280px]";
|
|
8003
|
+
return twMerge(base, "absolute mt-2", clsx({
|
|
8004
|
+
"bottom-full mb-2 mt-0": "top" === local.placement,
|
|
8005
|
+
"top-full mt-2": "bottom" === local.placement || !local.placement,
|
|
8006
|
+
"right-full mr-2": "left" === local.placement,
|
|
8007
|
+
"left-full ml-2": "right" === local.placement
|
|
8008
|
+
}));
|
|
8009
|
+
};
|
|
8010
|
+
const ModeSwitcher = ()=>(()=>{
|
|
8011
|
+
var _el$ = ColorPicker_tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling;
|
|
8012
|
+
_el$2.$$click = ()=>setMode("picker");
|
|
8013
|
+
_el$3.$$click = ()=>setMode("wheel");
|
|
8014
|
+
_el$4.$$click = ()=>setMode("flower");
|
|
8015
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
8016
|
+
var _v$ = clsx("flex-1 px-3 py-1 text-xs font-medium rounded-sm transition-colors", {
|
|
8017
|
+
"bg-base-100 shadow-sm text-base-content": "picker" === mode(),
|
|
8018
|
+
"text-base-content/60 hover:text-base-content": "picker" !== mode()
|
|
8019
|
+
}), _v$2 = clsx("flex-1 px-3 py-1 text-xs font-medium rounded-sm transition-colors", {
|
|
8020
|
+
"bg-base-100 shadow-sm text-base-content": "wheel" === mode(),
|
|
8021
|
+
"text-base-content/60 hover:text-base-content": "wheel" !== mode()
|
|
8022
|
+
}), _v$3 = clsx("flex-1 px-3 py-1 text-xs font-medium rounded-sm transition-colors", {
|
|
8023
|
+
"bg-base-100 shadow-sm text-base-content": "flower" === mode(),
|
|
8024
|
+
"text-base-content/60 hover:text-base-content": "flower" !== mode()
|
|
8025
|
+
});
|
|
8026
|
+
_v$ !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$2, _p$.e = _v$);
|
|
8027
|
+
_v$2 !== _p$.t && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$3, _p$.t = _v$2);
|
|
8028
|
+
_v$3 !== _p$.a && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$4, _p$.a = _v$3);
|
|
8029
|
+
return _p$;
|
|
8030
|
+
}, {
|
|
8031
|
+
e: void 0,
|
|
8032
|
+
t: void 0,
|
|
8033
|
+
a: void 0
|
|
8034
|
+
});
|
|
8035
|
+
return _el$;
|
|
8036
|
+
})();
|
|
8037
|
+
const PopoverContent = ()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(MotionDiv, {
|
|
8038
|
+
get initial () {
|
|
8039
|
+
return motionPresets.fadeUp.initial;
|
|
8040
|
+
},
|
|
8041
|
+
get animate () {
|
|
8042
|
+
return motionPresets.fadeUp.animate;
|
|
8043
|
+
},
|
|
8044
|
+
get exit () {
|
|
8045
|
+
return motionPresets.fadeUp.exit;
|
|
8046
|
+
},
|
|
8047
|
+
get transition () {
|
|
8048
|
+
return motionPresets.fadeUp.transition;
|
|
8049
|
+
},
|
|
8050
|
+
get ["class"] () {
|
|
8051
|
+
return popoverClasses();
|
|
8052
|
+
},
|
|
8053
|
+
get children () {
|
|
8054
|
+
return [
|
|
8055
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(ModeSwitcher, {}),
|
|
8056
|
+
(()=>{
|
|
8057
|
+
var _el$5 = ColorPicker_tmpl$3();
|
|
8058
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$5, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
8059
|
+
get when () {
|
|
8060
|
+
return "picker" === mode();
|
|
8061
|
+
},
|
|
8062
|
+
get children () {
|
|
8063
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(colorpicker_ColorPickerGradientSelector, {});
|
|
8064
|
+
}
|
|
8065
|
+
}), null);
|
|
8066
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$5, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
8067
|
+
get when () {
|
|
8068
|
+
return "wheel" === mode();
|
|
8069
|
+
},
|
|
8070
|
+
get children () {
|
|
8071
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(ColorPickerWheelSelector, {});
|
|
8072
|
+
}
|
|
8073
|
+
}), null);
|
|
8074
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$5, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
8075
|
+
get when () {
|
|
8076
|
+
return "flower" === mode();
|
|
8077
|
+
},
|
|
8078
|
+
get children () {
|
|
8079
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(ColorPickerFlowerSelector, {});
|
|
8080
|
+
}
|
|
8081
|
+
}), null);
|
|
8082
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$5, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
8083
|
+
get when () {
|
|
8084
|
+
return local.showAlpha;
|
|
8085
|
+
},
|
|
8086
|
+
get children () {
|
|
8087
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(AlphaSlider, {});
|
|
8088
|
+
}
|
|
8089
|
+
}), null);
|
|
8090
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$5, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(colorpicker_ColorInput, {}), null);
|
|
8091
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$5, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
8092
|
+
get when () {
|
|
8093
|
+
return local.swatches || DEFAULT_SWATCHES;
|
|
8094
|
+
},
|
|
8095
|
+
get children () {
|
|
8096
|
+
var _el$6 = ColorPicker_tmpl$2();
|
|
8097
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$6, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(colorpicker_ColorSwatches, {
|
|
8098
|
+
get swatches () {
|
|
8099
|
+
return local.swatches || DEFAULT_SWATCHES;
|
|
8100
|
+
}
|
|
8101
|
+
}));
|
|
8102
|
+
return _el$6;
|
|
8103
|
+
}
|
|
8104
|
+
}), null);
|
|
8105
|
+
return _el$5;
|
|
8106
|
+
})()
|
|
8107
|
+
];
|
|
8108
|
+
}
|
|
8109
|
+
});
|
|
8110
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(ColorPickerContext.Provider, {
|
|
8111
|
+
value: contextValue,
|
|
8112
|
+
get children () {
|
|
8113
|
+
var _el$7 = _tmpl$5();
|
|
8114
|
+
_el$7.$$keydown = handleKeyDown;
|
|
8115
|
+
var _ref$ = containerRef;
|
|
8116
|
+
"function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$7) : containerRef = _el$7;
|
|
8117
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$7, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
8118
|
+
get ["class"] () {
|
|
8119
|
+
return containerClasses();
|
|
8120
|
+
},
|
|
8121
|
+
get ["data-theme"] () {
|
|
8122
|
+
return local.dataTheme;
|
|
8123
|
+
},
|
|
8124
|
+
get style () {
|
|
8125
|
+
return local.style;
|
|
8126
|
+
}
|
|
8127
|
+
}, others), false, true);
|
|
8128
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$7, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(colorpicker_ColorPreview, {
|
|
8129
|
+
get color () {
|
|
8130
|
+
return color();
|
|
8131
|
+
},
|
|
8132
|
+
get disabled () {
|
|
8133
|
+
return local.disabled;
|
|
8134
|
+
},
|
|
8135
|
+
onClick: togglePicker,
|
|
8136
|
+
get ["aria-label"] () {
|
|
8137
|
+
return local["aria-label"] || "Color picker";
|
|
8138
|
+
}
|
|
8139
|
+
}), null);
|
|
8140
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$7, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
8141
|
+
get when () {
|
|
8142
|
+
return isOpen() && !local.disabled;
|
|
8143
|
+
},
|
|
8144
|
+
get children () {
|
|
8145
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(PopoverContent, {});
|
|
8146
|
+
}
|
|
8147
|
+
}), null);
|
|
8148
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$7, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
8149
|
+
get when () {
|
|
8150
|
+
return isOpen() && !local.disabled;
|
|
8151
|
+
},
|
|
8152
|
+
get children () {
|
|
8153
|
+
var _el$8 = ColorPicker_tmpl$4();
|
|
8154
|
+
_el$8.$$click = ()=>setIsOpen(false);
|
|
8155
|
+
return _el$8;
|
|
8156
|
+
}
|
|
8157
|
+
}), null);
|
|
8158
|
+
return _el$7;
|
|
8159
|
+
}
|
|
8160
|
+
});
|
|
8161
|
+
};
|
|
8162
|
+
const colorpicker_ColorPicker = ColorPicker;
|
|
8163
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
8164
|
+
"click",
|
|
8165
|
+
"keydown"
|
|
8166
|
+
]);
|
|
8167
|
+
var CodeMockup_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>");
|
|
8168
|
+
const CodeMockup = (props)=>{
|
|
8169
|
+
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
8170
|
+
"class",
|
|
8171
|
+
"className",
|
|
8172
|
+
"children",
|
|
8173
|
+
"dataTheme",
|
|
8174
|
+
"aria-label"
|
|
8175
|
+
]);
|
|
8176
|
+
const resolvedChildren = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.children)(()=>local.children);
|
|
8177
|
+
const classes = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>twMerge("mockup-code w-full", local.class, local.className));
|
|
8178
|
+
return (()=>{
|
|
8179
|
+
var _el$ = CodeMockup_tmpl$();
|
|
8180
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
8181
|
+
get ["class"] () {
|
|
8182
|
+
return classes();
|
|
8183
|
+
},
|
|
8184
|
+
get ["data-theme"] () {
|
|
8185
|
+
return local.dataTheme;
|
|
8186
|
+
},
|
|
8187
|
+
get ["aria-label"] () {
|
|
8188
|
+
return local["aria-label"] || "Code mockup";
|
|
8189
|
+
}
|
|
8190
|
+
}, rest), false, true);
|
|
8191
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, resolvedChildren);
|
|
8192
|
+
return _el$;
|
|
8193
|
+
})();
|
|
8194
|
+
};
|
|
8195
|
+
const codemockup_CodeMockup = CodeMockup;
|
|
8196
|
+
var CodeMockupLine_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<pre><code>");
|
|
8197
|
+
const CodeMockupLine_CodeMockupLine = (props)=>{
|
|
8198
|
+
const merged = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.mergeProps)({
|
|
8199
|
+
dataPrefix: ">",
|
|
8200
|
+
status: null,
|
|
8201
|
+
class: ""
|
|
8202
|
+
}, props);
|
|
8203
|
+
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(merged, [
|
|
8204
|
+
"dataPrefix",
|
|
8205
|
+
"status",
|
|
8206
|
+
"innerProps",
|
|
8207
|
+
"innerRef",
|
|
8208
|
+
"class",
|
|
8209
|
+
"children",
|
|
8210
|
+
"dataTheme"
|
|
8211
|
+
]);
|
|
8212
|
+
const statusClass = ()=>twMerge(dist_clsx({
|
|
8213
|
+
"bg-info": "info" === local.status,
|
|
8214
|
+
"bg-success": "success" === local.status,
|
|
8215
|
+
"bg-warning": "warning" === local.status,
|
|
8216
|
+
"bg-error": "error" === local.status,
|
|
8217
|
+
"text-info-content": "info" === local.status,
|
|
8218
|
+
"text-success-content": "success" === local.status,
|
|
8219
|
+
"text-warning-content": "warning" === local.status,
|
|
8220
|
+
"text-error-content": "error" === local.status
|
|
8221
|
+
}), local.class);
|
|
8222
|
+
const prefix = ()=>false !== local.dataPrefix ? local.dataPrefix || ">" : void 0;
|
|
8223
|
+
return (()=>{
|
|
8224
|
+
var _el$ = CodeMockupLine_tmpl$(), _el$2 = _el$.firstChild;
|
|
8225
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
8226
|
+
get ["class"] () {
|
|
8227
|
+
return statusClass();
|
|
8228
|
+
},
|
|
8229
|
+
get ["data-prefix"] () {
|
|
8230
|
+
return prefix();
|
|
8231
|
+
},
|
|
8232
|
+
get ["data-theme"] () {
|
|
8233
|
+
return local.dataTheme;
|
|
8234
|
+
}
|
|
8235
|
+
}, rest), false, true);
|
|
8236
|
+
var _ref$ = local.innerRef;
|
|
8237
|
+
"function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$2) : local.innerRef = _el$2;
|
|
8238
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$2, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>local.innerProps), false, true);
|
|
8239
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$2, ()=>local.children);
|
|
8240
|
+
return _el$;
|
|
8241
|
+
})();
|
|
8242
|
+
};
|
|
8243
|
+
const CodeMockupLine = CodeMockupLine_CodeMockupLine;
|
|
8244
|
+
var CollapseDetails_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<details>");
|
|
8245
|
+
function CollapseDetails_classesFn({ className, icon, open }) {
|
|
8246
|
+
return twMerge("collapse", className, clsx({
|
|
8247
|
+
"collapse-arrow": "arrow" === icon,
|
|
8248
|
+
"collapse-plus": "plus" === icon,
|
|
8249
|
+
"collapse-open": true === open,
|
|
8250
|
+
"collapse-close": false === open
|
|
8251
|
+
}));
|
|
8252
|
+
}
|
|
8253
|
+
function CollapseDetails(props) {
|
|
8254
|
+
const classes = CollapseDetails_classesFn({
|
|
8255
|
+
className: props.class,
|
|
8256
|
+
icon: props.icon,
|
|
8257
|
+
open: props.open
|
|
8258
|
+
});
|
|
8259
|
+
return (()=>{
|
|
8260
|
+
var _el$ = CollapseDetails_tmpl$();
|
|
8261
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(props, {
|
|
8262
|
+
class: classes,
|
|
8263
|
+
get open () {
|
|
8264
|
+
return props.open;
|
|
8265
|
+
}
|
|
8266
|
+
}), false, true);
|
|
8267
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>props.children);
|
|
8268
|
+
return _el$;
|
|
8269
|
+
})();
|
|
8270
|
+
}
|
|
8271
|
+
CollapseDetails.Title = Summary;
|
|
8272
|
+
var Collapse_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>"), Collapse_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<input type=checkbox class=peer>");
|
|
8273
|
+
const Collapse_classesFn = ({ className, icon, open })=>twMerge("collapse", className, clsx({
|
|
8274
|
+
"collapse-arrow": "arrow" === icon,
|
|
8275
|
+
"collapse-plus": "plus" === icon,
|
|
8276
|
+
"collapse-open": true === open,
|
|
8277
|
+
"collapse-close": false === open
|
|
8278
|
+
}));
|
|
8279
|
+
const Collapse = (props)=>{
|
|
8280
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
8281
|
+
"children",
|
|
8282
|
+
"checkbox",
|
|
8283
|
+
"icon",
|
|
8284
|
+
"open",
|
|
8285
|
+
"onOpen",
|
|
8286
|
+
"onClose",
|
|
8287
|
+
"onToggle",
|
|
8288
|
+
"dataTheme",
|
|
8289
|
+
"class",
|
|
8290
|
+
"className",
|
|
8291
|
+
"style"
|
|
8292
|
+
]);
|
|
8293
|
+
const [internalOpen, setInternalOpen] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
|
|
8294
|
+
const isControlled = void 0 !== local.open;
|
|
8295
|
+
const isChecked = ()=>isControlled ? local.open : internalOpen();
|
|
8296
|
+
const handleCheckboxChange = ()=>{
|
|
8297
|
+
if (local.onToggle) local.onToggle();
|
|
8298
|
+
if (isControlled) {
|
|
8299
|
+
if (local.open && local.onClose) local.onClose();
|
|
8300
|
+
if (!local.open && local.onOpen) local.onOpen();
|
|
8301
|
+
} else {
|
|
8302
|
+
const next = !internalOpen();
|
|
8303
|
+
setInternalOpen(next);
|
|
8304
|
+
if (next && local.onOpen) local.onOpen();
|
|
8305
|
+
if (!next && local.onClose) local.onClose();
|
|
8306
|
+
}
|
|
8307
|
+
};
|
|
8308
|
+
const handleBlur = (e)=>{
|
|
8309
|
+
if (!local.checkbox) {
|
|
8310
|
+
local.onToggle?.();
|
|
8311
|
+
local.onClose?.();
|
|
8312
|
+
}
|
|
8313
|
+
if ("function" == typeof others.onBlur) others.onBlur(e);
|
|
8314
|
+
};
|
|
8315
|
+
const handleFocus = (e)=>{
|
|
8316
|
+
if (!local.checkbox) {
|
|
8317
|
+
local.onToggle?.();
|
|
8318
|
+
local.onOpen?.();
|
|
8319
|
+
}
|
|
8320
|
+
if ("function" == typeof others.onFocus) others.onFocus(e);
|
|
8321
|
+
};
|
|
8322
|
+
return (()=>{
|
|
8323
|
+
var _el$ = Collapse_tmpl$();
|
|
8324
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
8325
|
+
get ["aria-expanded"] () {
|
|
8326
|
+
return local.open;
|
|
8327
|
+
}
|
|
8328
|
+
}, others, {
|
|
8329
|
+
get ["data-theme"] () {
|
|
8330
|
+
return local.dataTheme;
|
|
8331
|
+
},
|
|
8332
|
+
get ["class"] () {
|
|
8333
|
+
return Collapse_classesFn({
|
|
8334
|
+
className: twMerge(local.class, local.className),
|
|
8335
|
+
icon: local.icon,
|
|
8336
|
+
open: local.open
|
|
8337
|
+
});
|
|
8338
|
+
},
|
|
8339
|
+
get style () {
|
|
8340
|
+
return local.style;
|
|
8341
|
+
},
|
|
8342
|
+
get tabIndex () {
|
|
8343
|
+
return local.checkbox || isChecked() ? void 0 : 0;
|
|
8344
|
+
},
|
|
8345
|
+
onBlur: handleBlur,
|
|
8346
|
+
onFocus: handleFocus
|
|
8347
|
+
}), false, true);
|
|
8348
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (()=>{
|
|
8349
|
+
var _c$ = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>!!local.checkbox);
|
|
8350
|
+
return ()=>_c$() && (()=>{
|
|
8351
|
+
var _el$2 = Collapse_tmpl$2();
|
|
8352
|
+
_el$2.addEventListener("change", handleCheckboxChange);
|
|
8353
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)((el)=>el, _el$2);
|
|
8354
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$2, "tabindex", isChecked() ? 0 : void 0));
|
|
8355
|
+
return _el$2;
|
|
8356
|
+
})();
|
|
8357
|
+
})(), null);
|
|
8358
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.children, null);
|
|
8359
|
+
return _el$;
|
|
8360
|
+
})();
|
|
8361
|
+
};
|
|
8362
|
+
const collapse_Collapse = Object.assign(Collapse, {
|
|
8363
|
+
Details: CollapseDetails,
|
|
8364
|
+
Title: CollapseTitle,
|
|
8365
|
+
Content: CollapseContent
|
|
8366
|
+
});
|
|
8367
|
+
const breakpoints = [
|
|
8368
|
+
"base",
|
|
8369
|
+
"sm",
|
|
8370
|
+
"md",
|
|
8371
|
+
"lg",
|
|
8372
|
+
"xl"
|
|
8373
|
+
];
|
|
8374
|
+
function isJSXElement(node) {
|
|
8375
|
+
return "object" == typeof node && null !== node;
|
|
8376
|
+
}
|
|
8377
|
+
function wrapWithElementIfInvalid({ node, wrapper = "div", className = "" }) {
|
|
8378
|
+
null == node || "string" == typeof node || "number" == typeof node || isJSXElement(node);
|
|
8379
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.Dynamic, {
|
|
8380
|
+
component: wrapper,
|
|
8381
|
+
class: className,
|
|
8382
|
+
children: node
|
|
8383
|
+
});
|
|
8384
|
+
}
|
|
8385
|
+
function mapResponsiveProp(prop, classMap) {
|
|
8386
|
+
if (void 0 === prop) return [];
|
|
8387
|
+
if ("string" == typeof prop || "boolean" == typeof prop) return [
|
|
8388
|
+
classMap[String(prop)]
|
|
8389
|
+
];
|
|
8390
|
+
return breakpoints.flatMap((bp)=>{
|
|
8391
|
+
const value = prop[bp];
|
|
8392
|
+
if (void 0 === value) return [];
|
|
8393
|
+
const className = classMap[String(value)];
|
|
8394
|
+
return "base" === bp ? [
|
|
8395
|
+
className
|
|
8396
|
+
] : [
|
|
8397
|
+
`${bp}:${className}`
|
|
8398
|
+
];
|
|
8399
|
+
});
|
|
8400
|
+
}
|
|
8401
|
+
function useDesktop(breakpoint = 1024) {
|
|
8402
|
+
const [isDesktop, setIsDesktop] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
|
|
8403
|
+
const checkIfDesktop = ()=>{
|
|
8404
|
+
const width = window.innerWidth;
|
|
8405
|
+
setIsDesktop(width >= breakpoint);
|
|
8406
|
+
};
|
|
8407
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onMount)(()=>{
|
|
8408
|
+
checkIfDesktop();
|
|
8409
|
+
window.addEventListener("resize", checkIfDesktop);
|
|
8410
|
+
});
|
|
8411
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
8412
|
+
window.removeEventListener("resize", checkIfDesktop);
|
|
8413
|
+
});
|
|
8414
|
+
return isDesktop;
|
|
8415
|
+
}
|
|
8416
|
+
const directionMap = {
|
|
8417
|
+
row: "flex-row",
|
|
8418
|
+
col: "flex-col",
|
|
8419
|
+
"row-reverse": "flex-row-reverse",
|
|
8420
|
+
"col-reverse": "flex-col-reverse"
|
|
8421
|
+
};
|
|
8422
|
+
const justifyMap = {
|
|
8423
|
+
start: "justify-start",
|
|
8424
|
+
center: "justify-center",
|
|
8425
|
+
end: "justify-end",
|
|
8426
|
+
between: "justify-between",
|
|
8427
|
+
around: "justify-around",
|
|
8428
|
+
evenly: "justify-evenly"
|
|
8429
|
+
};
|
|
8430
|
+
const alignMap = {
|
|
8431
|
+
start: "items-start",
|
|
8432
|
+
center: "items-center",
|
|
8433
|
+
end: "items-end",
|
|
8434
|
+
stretch: "items-stretch",
|
|
8435
|
+
baseline: "items-baseline"
|
|
8436
|
+
};
|
|
8437
|
+
const wrapMap = {
|
|
8438
|
+
wrap: "flex-wrap",
|
|
8439
|
+
nowrap: "flex-nowrap",
|
|
8440
|
+
"wrap-reverse": "flex-wrap-reverse"
|
|
8441
|
+
};
|
|
8442
|
+
const gapMap = {
|
|
8443
|
+
none: "gap-0",
|
|
8444
|
+
sm: "gap-2",
|
|
8445
|
+
md: "gap-4",
|
|
8446
|
+
lg: "gap-6",
|
|
8447
|
+
xl: "gap-8"
|
|
8448
|
+
};
|
|
8449
|
+
const gapXMap = {
|
|
8450
|
+
none: "gap-x-0",
|
|
8451
|
+
sm: "gap-x-2",
|
|
8452
|
+
md: "gap-x-4",
|
|
6539
8453
|
lg: "gap-x-6",
|
|
6540
8454
|
xl: "gap-x-8"
|
|
6541
8455
|
};
|
|
@@ -7045,7 +8959,7 @@ const dividerStyles = cva("flex items-center whitespace-nowrap relative", {
|
|
|
7045
8959
|
position: "center"
|
|
7046
8960
|
}
|
|
7047
8961
|
});
|
|
7048
|
-
const
|
|
8962
|
+
const Divider = (props)=>{
|
|
7049
8963
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
7050
8964
|
"children",
|
|
7051
8965
|
"text",
|
|
@@ -7080,8 +8994,8 @@ const Divider_Divider = (props)=>{
|
|
|
7080
8994
|
children: content
|
|
7081
8995
|
}));
|
|
7082
8996
|
};
|
|
7083
|
-
const
|
|
7084
|
-
const divider =
|
|
8997
|
+
const divider_Divider = Divider;
|
|
8998
|
+
const divider = divider_Divider;
|
|
7085
8999
|
var DockItem_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<button>");
|
|
7086
9000
|
const DockItem_DockItem = (props)=>{
|
|
7087
9001
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
@@ -8181,7 +10095,7 @@ const NumberField = (props)=>{
|
|
|
8181
10095
|
})();
|
|
8182
10096
|
};
|
|
8183
10097
|
const form_NumberField = NumberField;
|
|
8184
|
-
var FormDropdown_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<span>"), FormDropdown_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<p>"), FormDropdown_tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>"), FormDropdown_tmpl$4 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<span class="text-error ml-1">*'),
|
|
10098
|
+
var FormDropdown_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<span>"), FormDropdown_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<p>"), FormDropdown_tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>"), FormDropdown_tmpl$4 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<span class="text-error ml-1">*'), FormDropdown_tmpl$5 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<span class=ml-2>");
|
|
8185
10099
|
const FormDropdown_FormDropdown = (props)=>{
|
|
8186
10100
|
const { errors, touched, setData } = useFormValidation();
|
|
8187
10101
|
const [local, _] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
@@ -8262,7 +10176,7 @@ const FormDropdown_FormDropdown = (props)=>{
|
|
|
8262
10176
|
return _el$2;
|
|
8263
10177
|
})(),
|
|
8264
10178
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>local.icon || (()=>{
|
|
8265
|
-
var _el$6 =
|
|
10179
|
+
var _el$6 = FormDropdown_tmpl$5();
|
|
8266
10180
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$6, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(icon_Icon, {
|
|
8267
10181
|
name: "icon-[mdi-light--chevron-down]",
|
|
8268
10182
|
width: 20,
|
|
@@ -9853,7 +11767,7 @@ const Select = (props)=>{
|
|
|
9853
11767
|
};
|
|
9854
11768
|
const select_Select = Select;
|
|
9855
11769
|
var ShowcaseSection_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<span class="opacity-0 group-hover/title:opacity-100 text-base-content/70 transition-opacity">#'), ShowcaseSection_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<h2 class="text-xl font-semibold group/title">'), ShowcaseSection_tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div><div class=space-y-3>");
|
|
9856
|
-
const
|
|
11770
|
+
const ShowcaseSection_ShowcaseSection = (props)=>{
|
|
9857
11771
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
9858
11772
|
"id",
|
|
9859
11773
|
"title",
|
|
@@ -9918,7 +11832,7 @@ const ShowcaseSection = (props)=>{
|
|
|
9918
11832
|
return _el$;
|
|
9919
11833
|
})();
|
|
9920
11834
|
};
|
|
9921
|
-
const
|
|
11835
|
+
const ShowcaseSection = ShowcaseSection_ShowcaseSection;
|
|
9922
11836
|
var ShowcaseBlock_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<p class="text-base-content/70 mb-4">'), ShowcaseBlock_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="bg-base-200 shadow-sm p-6 rounded-lg"><h3 class="text-lg font-semibold mb-2 text-base-content"></h3><div>');
|
|
9923
11837
|
const ShowcaseBlock = (props)=>{
|
|
9924
11838
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
@@ -10611,7 +12525,7 @@ const steps_Steps = Object.assign(Steps, {
|
|
|
10611
12525
|
});
|
|
10612
12526
|
const steps = steps_Steps;
|
|
10613
12527
|
var SvgBackground_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<svg><ellipse></svg>", false, true, false), SvgBackground_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<svg><circle></svg>", false, true, false), SvgBackground_tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<svg><circle cx=0 cy=0 r=100 opacity=0.7></svg>", false, true, false), SvgBackground_tmpl$4 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<svg><circle cx=400 cy=0 r=120></svg>", false, true, false), SvgBackground_tmpl$5 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<svg><circle cx=0 cy=400 r=100 opacity=0.7></svg>", false, true, false), _tmpl$6 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<svg><circle cx=400 cy=400 r=120></svg>", false, true, false), _tmpl$7 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<svg><circle cx=0 cy=200 r=70 opacity=0.6></svg>", false, true, false), _tmpl$8 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<svg><circle cx=200 cy=0 r=100></svg>", false, true, false), _tmpl$9 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<svg><circle cx=400 cy=200 r=100></svg>", false, true, false), _tmpl$0 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<svg><circle cx=200 cy=400 r=100></svg>", false, true, false), _tmpl$1 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div><div><svg viewBox="0 0 400 400"xmlns=http://www.w3.org/2000/svg><rect width=400 height=400></rect></svg></div><canvas></canvas><div class="relative z-10 h-full w-full">'), _tmpl$10 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="absolute inset-0 z-5">');
|
|
10614
|
-
function
|
|
12528
|
+
function SvgBackground_hexToRgb(hex) {
|
|
10615
12529
|
hex = hex.replace(/^#/, "");
|
|
10616
12530
|
const bigint = Number.parseInt(hex, 16);
|
|
10617
12531
|
const r = bigint >> 16 & 255;
|
|
@@ -10630,8 +12544,8 @@ function SvgBackground(props) {
|
|
|
10630
12544
|
let canvasRef;
|
|
10631
12545
|
const [isBackgroundReady, setBackgroundReady] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
|
|
10632
12546
|
const getIntermediateColor = (t)=>{
|
|
10633
|
-
const start =
|
|
10634
|
-
const end =
|
|
12547
|
+
const start = SvgBackground_hexToRgb(colorStart);
|
|
12548
|
+
const end = SvgBackground_hexToRgb(colorEnd);
|
|
10635
12549
|
const r = Math.round(start.r + (end.r - start.r) * t);
|
|
10636
12550
|
const g = Math.round(start.g + (end.g - start.g) * t);
|
|
10637
12551
|
const b = Math.round(start.b + (end.b - start.b) * t);
|
|
@@ -12313,64 +14227,26 @@ const StreamingTable = (props)=>{
|
|
|
12313
14227
|
get disabled () {
|
|
12314
14228
|
return currentPage() === totalPages() - 1;
|
|
12315
14229
|
},
|
|
12316
|
-
size: "sm",
|
|
12317
|
-
children: "\xBB"
|
|
12318
|
-
})
|
|
12319
|
-
];
|
|
12320
|
-
}
|
|
12321
|
-
}), _el$4);
|
|
12322
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$4, ()=>currentPage() + 1, _el$7);
|
|
12323
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$4, totalPages, null);
|
|
12324
|
-
return _el$3;
|
|
12325
|
-
}
|
|
12326
|
-
}), null);
|
|
12327
|
-
return _el$;
|
|
12328
|
-
})();
|
|
12329
|
-
};
|
|
12330
|
-
const streaming_table_StreamingTable = StreamingTable;
|
|
12331
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
12332
|
-
"click"
|
|
12333
|
-
]);
|
|
12334
|
-
var Tab_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<a role=tab>");
|
|
12335
|
-
const Tab = (props)=>{
|
|
12336
|
-
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
12337
|
-
"children",
|
|
12338
|
-
"class",
|
|
12339
|
-
"className",
|
|
12340
|
-
"color",
|
|
12341
|
-
"bgColor",
|
|
12342
|
-
"borderColor",
|
|
12343
|
-
"active",
|
|
12344
|
-
"disabled"
|
|
12345
|
-
]);
|
|
12346
|
-
const classes = ()=>twMerge("tab", local.class, local.className, clsx({
|
|
12347
|
-
[`[--tab-bg:${local.bgColor}]`]: local.bgColor,
|
|
12348
|
-
[`[--tab-border-color:${local.borderColor}]`]: local.borderColor,
|
|
12349
|
-
"text-neutral": "neutral" === local.color,
|
|
12350
|
-
"text-primary": "primary" === local.color,
|
|
12351
|
-
"text-secondary": "secondary" === local.color,
|
|
12352
|
-
"text-accent": "accent" === local.color,
|
|
12353
|
-
"text-info": "info" === local.color,
|
|
12354
|
-
"text-success": "success" === local.color,
|
|
12355
|
-
"text-warning": "warning" === local.color,
|
|
12356
|
-
"text-error": "error" === local.color,
|
|
12357
|
-
"tab-active": local.active,
|
|
12358
|
-
"tab-disabled": local.disabled
|
|
12359
|
-
}));
|
|
12360
|
-
return (()=>{
|
|
12361
|
-
var _el$ = Tab_tmpl$();
|
|
12362
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
12363
|
-
get ["class"] () {
|
|
12364
|
-
return classes();
|
|
14230
|
+
size: "sm",
|
|
14231
|
+
children: "\xBB"
|
|
14232
|
+
})
|
|
14233
|
+
];
|
|
14234
|
+
}
|
|
14235
|
+
}), _el$4);
|
|
14236
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$4, ()=>currentPage() + 1, _el$7);
|
|
14237
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$4, totalPages, null);
|
|
14238
|
+
return _el$3;
|
|
12365
14239
|
}
|
|
12366
|
-
}
|
|
12367
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.children);
|
|
14240
|
+
}), null);
|
|
12368
14241
|
return _el$;
|
|
12369
14242
|
})();
|
|
12370
14243
|
};
|
|
12371
|
-
const
|
|
12372
|
-
|
|
12373
|
-
|
|
14244
|
+
const streaming_table_StreamingTable = StreamingTable;
|
|
14245
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
14246
|
+
"click"
|
|
14247
|
+
]);
|
|
14248
|
+
var Tab_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<a role=tab>");
|
|
14249
|
+
const Tab = (props)=>{
|
|
12374
14250
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
12375
14251
|
"children",
|
|
12376
14252
|
"class",
|
|
@@ -12379,10 +14255,7 @@ const RadioTab = (props)=>{
|
|
|
12379
14255
|
"bgColor",
|
|
12380
14256
|
"borderColor",
|
|
12381
14257
|
"active",
|
|
12382
|
-
"disabled"
|
|
12383
|
-
"label",
|
|
12384
|
-
"name",
|
|
12385
|
-
"contentClassName"
|
|
14258
|
+
"disabled"
|
|
12386
14259
|
]);
|
|
12387
14260
|
const classes = ()=>twMerge("tab", local.class, local.className, clsx({
|
|
12388
14261
|
[`[--tab-bg:${local.bgColor}]`]: local.bgColor,
|
|
@@ -12398,740 +14271,356 @@ const RadioTab = (props)=>{
|
|
|
12398
14271
|
"tab-active": local.active,
|
|
12399
14272
|
"tab-disabled": local.disabled
|
|
12400
14273
|
}));
|
|
12401
|
-
const contentClasses = ()=>twMerge("tab-content", local.contentClassName);
|
|
12402
|
-
return [
|
|
12403
|
-
(()=>{
|
|
12404
|
-
var _el$ = RadioTab_tmpl$();
|
|
12405
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
12406
|
-
get ["class"] () {
|
|
12407
|
-
return classes();
|
|
12408
|
-
},
|
|
12409
|
-
get name () {
|
|
12410
|
-
return local.name;
|
|
12411
|
-
},
|
|
12412
|
-
get ["aria-label"] () {
|
|
12413
|
-
return local.label;
|
|
12414
|
-
},
|
|
12415
|
-
get disabled () {
|
|
12416
|
-
return local.disabled;
|
|
12417
|
-
}
|
|
12418
|
-
}, others), false, false);
|
|
12419
|
-
return _el$;
|
|
12420
|
-
})(),
|
|
12421
|
-
(()=>{
|
|
12422
|
-
var _el$2 = RadioTab_tmpl$2();
|
|
12423
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$2, ()=>local.children);
|
|
12424
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$2, contentClasses()));
|
|
12425
|
-
return _el$2;
|
|
12426
|
-
})()
|
|
12427
|
-
];
|
|
12428
|
-
};
|
|
12429
|
-
const tabs_RadioTab = RadioTab;
|
|
12430
|
-
var Tabs_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div role=tablist>");
|
|
12431
|
-
const Tabs = (props)=>{
|
|
12432
|
-
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
12433
|
-
"children",
|
|
12434
|
-
"class",
|
|
12435
|
-
"className",
|
|
12436
|
-
"variant",
|
|
12437
|
-
"size",
|
|
12438
|
-
"position"
|
|
12439
|
-
]);
|
|
12440
|
-
const classes = ()=>twMerge("tabs", local.class, local.className, clsx({
|
|
12441
|
-
"tabs-boxed": "boxed" === local.variant,
|
|
12442
|
-
"tabs-bordered": "bordered" === local.variant,
|
|
12443
|
-
"tabs-lift": "lift" === local.variant,
|
|
12444
|
-
"tabs-xl": "xl" === local.size,
|
|
12445
|
-
"tabs-lg": "lg" === local.size,
|
|
12446
|
-
"tabs-md": "md" === local.size,
|
|
12447
|
-
"tabs-sm": "sm" === local.size,
|
|
12448
|
-
"tabs-xs": "xs" === local.size,
|
|
12449
|
-
"tabs-top": "top" === local.position,
|
|
12450
|
-
"tabs-bottom": "bottom" === local.position
|
|
12451
|
-
}));
|
|
12452
14274
|
return (()=>{
|
|
12453
|
-
var _el$ =
|
|
14275
|
+
var _el$ = Tab_tmpl$();
|
|
12454
14276
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
12455
14277
|
get ["class"] () {
|
|
12456
14278
|
return classes();
|
|
12457
|
-
}
|
|
12458
|
-
}, others), false, true);
|
|
12459
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.children);
|
|
12460
|
-
return _el$;
|
|
12461
|
-
})();
|
|
12462
|
-
};
|
|
12463
|
-
const tabs_Tabs = Object.assign(Tabs, {
|
|
12464
|
-
Tab: tabs_Tab,
|
|
12465
|
-
RadioTab: tabs_RadioTab
|
|
12466
|
-
});
|
|
12467
|
-
var Textarea_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<textarea>");
|
|
12468
|
-
const Textarea = (props)=>{
|
|
12469
|
-
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
12470
|
-
"color",
|
|
12471
|
-
"size",
|
|
12472
|
-
"dataTheme",
|
|
12473
|
-
"class",
|
|
12474
|
-
"className",
|
|
12475
|
-
"style",
|
|
12476
|
-
"resize"
|
|
12477
|
-
]);
|
|
12478
|
-
const classes = ()=>twMerge("textarea", local.class, local.className, clsx({
|
|
12479
|
-
"textarea-xl": "xl" === local.size,
|
|
12480
|
-
"textarea-lg": "lg" === local.size,
|
|
12481
|
-
"textarea-md": "md" === local.size,
|
|
12482
|
-
"textarea-sm": "sm" === local.size,
|
|
12483
|
-
"textarea-xs": "xs" === local.size,
|
|
12484
|
-
"textarea-primary": "primary" === local.color,
|
|
12485
|
-
"textarea-secondary": "secondary" === local.color,
|
|
12486
|
-
"textarea-accent": "accent" === local.color,
|
|
12487
|
-
"textarea-ghost": "ghost" === local.color,
|
|
12488
|
-
"textarea-info": "info" === local.color,
|
|
12489
|
-
"textarea-success": "success" === local.color,
|
|
12490
|
-
"textarea-warning": "warning" === local.color,
|
|
12491
|
-
"textarea-error": "error" === local.color,
|
|
12492
|
-
"resize-y": "y" === local.resize,
|
|
12493
|
-
"resize-x": "x" === local.resize,
|
|
12494
|
-
"resize-none": "none" === local.resize,
|
|
12495
|
-
"resize-both": "both" === local.resize
|
|
12496
|
-
}));
|
|
12497
|
-
return (()=>{
|
|
12498
|
-
var _el$ = Textarea_tmpl$();
|
|
12499
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
12500
|
-
get ["data-theme"] () {
|
|
12501
|
-
return local.dataTheme;
|
|
12502
|
-
},
|
|
12503
|
-
get ["class"] () {
|
|
12504
|
-
return classes();
|
|
12505
|
-
},
|
|
12506
|
-
get style () {
|
|
12507
|
-
return local.style;
|
|
12508
|
-
}
|
|
12509
|
-
}), false, false);
|
|
12510
|
-
return _el$;
|
|
12511
|
-
})();
|
|
12512
|
-
};
|
|
12513
|
-
const textarea_Textarea = Textarea;
|
|
12514
|
-
var Timeline_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<ul>");
|
|
12515
|
-
const Timeline_Timeline = (props)=>{
|
|
12516
|
-
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
12517
|
-
"vertical",
|
|
12518
|
-
"horizontal",
|
|
12519
|
-
"responsive",
|
|
12520
|
-
"snap",
|
|
12521
|
-
"compact",
|
|
12522
|
-
"class",
|
|
12523
|
-
"className",
|
|
12524
|
-
"style",
|
|
12525
|
-
"dataTheme"
|
|
12526
|
-
]);
|
|
12527
|
-
const classes = twMerge("timeline", dist_clsx({
|
|
12528
|
-
"timeline-vertical": local.vertical,
|
|
12529
|
-
"timeline-horizontal": local.horizontal,
|
|
12530
|
-
"timeline-vertical lg:timeline-horizontal": local.responsive,
|
|
12531
|
-
"timeline-snap-icon": local.snap,
|
|
12532
|
-
"timeline-compact": local.compact
|
|
12533
|
-
}), local.class, local.className);
|
|
12534
|
-
return (()=>{
|
|
12535
|
-
var _el$ = Timeline_tmpl$();
|
|
12536
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
12537
|
-
class: classes,
|
|
12538
|
-
get ["data-theme"] () {
|
|
12539
|
-
return local.dataTheme;
|
|
12540
|
-
},
|
|
12541
|
-
get style () {
|
|
12542
|
-
return local.style;
|
|
12543
|
-
}
|
|
12544
|
-
}), false, true);
|
|
12545
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>props.children);
|
|
12546
|
-
return _el$;
|
|
12547
|
-
})();
|
|
12548
|
-
};
|
|
12549
|
-
const Timeline = Timeline_Timeline;
|
|
12550
|
-
var TimelineEnd_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>");
|
|
12551
|
-
const TimelineEnd = (props)=>{
|
|
12552
|
-
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
12553
|
-
"box",
|
|
12554
|
-
"class",
|
|
12555
|
-
"style"
|
|
12556
|
-
]);
|
|
12557
|
-
const classes = twMerge("timeline-end", clsx({
|
|
12558
|
-
"timeline-box": local.box ?? true
|
|
12559
|
-
}), local.class);
|
|
12560
|
-
return (()=>{
|
|
12561
|
-
var _el$ = TimelineEnd_tmpl$();
|
|
12562
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
12563
|
-
class: classes,
|
|
12564
|
-
get style () {
|
|
12565
|
-
return local.style;
|
|
12566
|
-
}
|
|
12567
|
-
}), false, true);
|
|
12568
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>props.children);
|
|
12569
|
-
return _el$;
|
|
12570
|
-
})();
|
|
12571
|
-
};
|
|
12572
|
-
const timeline_TimelineEnd = TimelineEnd;
|
|
12573
|
-
var TimelineItem_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<hr>"), TimelineItem_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<li>");
|
|
12574
|
-
const TimelineItem = (props)=>{
|
|
12575
|
-
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
12576
|
-
"connect",
|
|
12577
|
-
"startClassName",
|
|
12578
|
-
"endClassName",
|
|
12579
|
-
"class",
|
|
12580
|
-
"style"
|
|
12581
|
-
]);
|
|
12582
|
-
return (()=>{
|
|
12583
|
-
var _el$ = TimelineItem_tmpl$2();
|
|
12584
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
12585
|
-
get ["class"] () {
|
|
12586
|
-
return local.class;
|
|
12587
|
-
},
|
|
12588
|
-
get style () {
|
|
12589
|
-
return local.style;
|
|
12590
|
-
}
|
|
12591
|
-
}), false, true);
|
|
12592
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
12593
|
-
get when () {
|
|
12594
|
-
return "both" === local.connect || "start" === local.connect;
|
|
12595
|
-
},
|
|
12596
|
-
get children () {
|
|
12597
|
-
var _el$2 = TimelineItem_tmpl$();
|
|
12598
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$2, local.startClassName));
|
|
12599
|
-
return _el$2;
|
|
12600
|
-
}
|
|
12601
|
-
}), null);
|
|
12602
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>props.children, null);
|
|
12603
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
12604
|
-
get when () {
|
|
12605
|
-
return "both" === local.connect || "end" === local.connect;
|
|
12606
|
-
},
|
|
12607
|
-
get children () {
|
|
12608
|
-
var _el$3 = TimelineItem_tmpl$();
|
|
12609
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$3, local.endClassName));
|
|
12610
|
-
return _el$3;
|
|
12611
|
-
}
|
|
12612
|
-
}), null);
|
|
12613
|
-
return _el$;
|
|
12614
|
-
})();
|
|
12615
|
-
};
|
|
12616
|
-
const timeline_TimelineItem = TimelineItem;
|
|
12617
|
-
var TimelineMiddle_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>"), TimelineMiddle_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 20 20"fill=currentColor class="w-5 h-5"><path fill-rule=evenodd d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z"clip-rule=evenodd>');
|
|
12618
|
-
const TimelineMiddle = (props)=>{
|
|
12619
|
-
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
12620
|
-
"class",
|
|
12621
|
-
"style",
|
|
12622
|
-
"children"
|
|
12623
|
-
]);
|
|
12624
|
-
const classes = twMerge("timeline-middle", local.class);
|
|
12625
|
-
return (()=>{
|
|
12626
|
-
var _el$ = TimelineMiddle_tmpl$();
|
|
12627
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
12628
|
-
class: classes,
|
|
12629
|
-
get style () {
|
|
12630
|
-
return local.style;
|
|
12631
|
-
}
|
|
12632
|
-
}), false, true);
|
|
12633
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.children ?? TimelineMiddle_tmpl$2());
|
|
14279
|
+
}
|
|
14280
|
+
}, others), false, true);
|
|
14281
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.children);
|
|
12634
14282
|
return _el$;
|
|
12635
14283
|
})();
|
|
12636
14284
|
};
|
|
12637
|
-
const
|
|
12638
|
-
var
|
|
12639
|
-
const
|
|
14285
|
+
const tabs_Tab = Tab;
|
|
14286
|
+
var RadioTab_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<input role=tab type=radio>"), RadioTab_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>");
|
|
14287
|
+
const RadioTab = (props)=>{
|
|
12640
14288
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
12641
|
-
"
|
|
14289
|
+
"children",
|
|
12642
14290
|
"class",
|
|
12643
|
-
"
|
|
14291
|
+
"className",
|
|
14292
|
+
"color",
|
|
14293
|
+
"bgColor",
|
|
14294
|
+
"borderColor",
|
|
14295
|
+
"active",
|
|
14296
|
+
"disabled",
|
|
14297
|
+
"label",
|
|
14298
|
+
"name",
|
|
14299
|
+
"contentClassName"
|
|
12644
14300
|
]);
|
|
12645
|
-
const classes = twMerge("
|
|
12646
|
-
|
|
12647
|
-
|
|
12648
|
-
|
|
12649
|
-
|
|
12650
|
-
|
|
12651
|
-
|
|
12652
|
-
|
|
12653
|
-
|
|
12654
|
-
|
|
12655
|
-
|
|
12656
|
-
|
|
12657
|
-
|
|
12658
|
-
|
|
12659
|
-
|
|
12660
|
-
|
|
12661
|
-
|
|
12662
|
-
|
|
12663
|
-
|
|
12664
|
-
|
|
12665
|
-
|
|
12666
|
-
}
|
|
12667
|
-
|
|
12668
|
-
|
|
12669
|
-
|
|
12670
|
-
|
|
14301
|
+
const classes = ()=>twMerge("tab", local.class, local.className, clsx({
|
|
14302
|
+
[`[--tab-bg:${local.bgColor}]`]: local.bgColor,
|
|
14303
|
+
[`[--tab-border-color:${local.borderColor}]`]: local.borderColor,
|
|
14304
|
+
"text-neutral": "neutral" === local.color,
|
|
14305
|
+
"text-primary": "primary" === local.color,
|
|
14306
|
+
"text-secondary": "secondary" === local.color,
|
|
14307
|
+
"text-accent": "accent" === local.color,
|
|
14308
|
+
"text-info": "info" === local.color,
|
|
14309
|
+
"text-success": "success" === local.color,
|
|
14310
|
+
"text-warning": "warning" === local.color,
|
|
14311
|
+
"text-error": "error" === local.color,
|
|
14312
|
+
"tab-active": local.active,
|
|
14313
|
+
"tab-disabled": local.disabled
|
|
14314
|
+
}));
|
|
14315
|
+
const contentClasses = ()=>twMerge("tab-content", local.contentClassName);
|
|
14316
|
+
return [
|
|
14317
|
+
(()=>{
|
|
14318
|
+
var _el$ = RadioTab_tmpl$();
|
|
14319
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
14320
|
+
get ["class"] () {
|
|
14321
|
+
return classes();
|
|
14322
|
+
},
|
|
14323
|
+
get name () {
|
|
14324
|
+
return local.name;
|
|
14325
|
+
},
|
|
14326
|
+
get ["aria-label"] () {
|
|
14327
|
+
return local.label;
|
|
14328
|
+
},
|
|
14329
|
+
get disabled () {
|
|
14330
|
+
return local.disabled;
|
|
14331
|
+
}
|
|
14332
|
+
}, others), false, false);
|
|
14333
|
+
return _el$;
|
|
14334
|
+
})(),
|
|
14335
|
+
(()=>{
|
|
14336
|
+
var _el$2 = RadioTab_tmpl$2();
|
|
14337
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$2, ()=>local.children);
|
|
14338
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$2, contentClasses()));
|
|
14339
|
+
return _el$2;
|
|
14340
|
+
})()
|
|
14341
|
+
];
|
|
12671
14342
|
};
|
|
12672
|
-
const
|
|
14343
|
+
const tabs_RadioTab = RadioTab;
|
|
14344
|
+
var Tabs_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div role=tablist>");
|
|
14345
|
+
const Tabs = (props)=>{
|
|
12673
14346
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
12674
|
-
"
|
|
12675
|
-
"vertical",
|
|
14347
|
+
"children",
|
|
12676
14348
|
"class",
|
|
12677
14349
|
"className",
|
|
12678
|
-
"
|
|
12679
|
-
"
|
|
12680
|
-
"
|
|
14350
|
+
"variant",
|
|
14351
|
+
"size",
|
|
14352
|
+
"position"
|
|
12681
14353
|
]);
|
|
12682
|
-
const
|
|
12683
|
-
|
|
12684
|
-
|
|
12685
|
-
|
|
12686
|
-
|
|
12687
|
-
|
|
12688
|
-
|
|
12689
|
-
|
|
12690
|
-
|
|
14354
|
+
const classes = ()=>twMerge("tabs", local.class, local.className, clsx({
|
|
14355
|
+
"tabs-boxed": "boxed" === local.variant,
|
|
14356
|
+
"tabs-bordered": "bordered" === local.variant,
|
|
14357
|
+
"tabs-lift": "lift" === local.variant,
|
|
14358
|
+
"tabs-xl": "xl" === local.size,
|
|
14359
|
+
"tabs-lg": "lg" === local.size,
|
|
14360
|
+
"tabs-md": "md" === local.size,
|
|
14361
|
+
"tabs-sm": "sm" === local.size,
|
|
14362
|
+
"tabs-xs": "xs" === local.size,
|
|
14363
|
+
"tabs-top": "top" === local.position,
|
|
14364
|
+
"tabs-bottom": "bottom" === local.position
|
|
14365
|
+
}));
|
|
12691
14366
|
return (()=>{
|
|
12692
|
-
var _el$ =
|
|
12693
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(
|
|
12694
|
-
role: "status",
|
|
14367
|
+
var _el$ = Tabs_tmpl$();
|
|
14368
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
12695
14369
|
get ["class"] () {
|
|
12696
|
-
return
|
|
12697
|
-
},
|
|
12698
|
-
get ["data-theme"] () {
|
|
12699
|
-
return local.dataTheme;
|
|
12700
|
-
},
|
|
12701
|
-
get style () {
|
|
12702
|
-
return local.style;
|
|
14370
|
+
return classes();
|
|
12703
14371
|
}
|
|
12704
|
-
}), false, true);
|
|
12705
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$,
|
|
14372
|
+
}, others), false, true);
|
|
14373
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.children);
|
|
12706
14374
|
return _el$;
|
|
12707
14375
|
})();
|
|
12708
14376
|
};
|
|
12709
|
-
const
|
|
12710
|
-
|
|
12711
|
-
|
|
12712
|
-
|
|
12713
|
-
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
|
|
12727
|
-
|
|
12728
|
-
|
|
12729
|
-
|
|
12730
|
-
|
|
12731
|
-
|
|
12732
|
-
|
|
12733
|
-
|
|
12734
|
-
|
|
12735
|
-
|
|
12736
|
-
|
|
12737
|
-
|
|
12738
|
-
|
|
12739
|
-
|
|
12740
|
-
|
|
12741
|
-
|
|
12742
|
-
|
|
12743
|
-
|
|
12744
|
-
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
durations: mergeDefined(base.durations, overrides?.durations),
|
|
12749
|
-
easings: mergeDefined(base.easings, overrides?.easings),
|
|
12750
|
-
distances: mergeDefined(base.distances, overrides?.distances)
|
|
12751
|
-
});
|
|
12752
|
-
const createMotionPresets = (tokens)=>{
|
|
12753
|
-
const durations = tokens.durations;
|
|
12754
|
-
const easings = tokens.easings;
|
|
12755
|
-
const distances = tokens.distances;
|
|
12756
|
-
return {
|
|
12757
|
-
route: {
|
|
12758
|
-
initial: {
|
|
12759
|
-
opacity: 0
|
|
12760
|
-
},
|
|
12761
|
-
animate: {
|
|
12762
|
-
opacity: 1
|
|
12763
|
-
},
|
|
12764
|
-
exit: {
|
|
12765
|
-
opacity: 0
|
|
12766
|
-
},
|
|
12767
|
-
transition: {
|
|
12768
|
-
duration: durations.route,
|
|
12769
|
-
easing: easings.out
|
|
12770
|
-
}
|
|
12771
|
-
},
|
|
12772
|
-
routeAuth: {
|
|
12773
|
-
initial: {
|
|
12774
|
-
opacity: 0,
|
|
12775
|
-
x: distances.slideIn
|
|
12776
|
-
},
|
|
12777
|
-
animate: {
|
|
12778
|
-
opacity: 1,
|
|
12779
|
-
x: 0
|
|
12780
|
-
},
|
|
12781
|
-
exit: {
|
|
12782
|
-
opacity: 0,
|
|
12783
|
-
x: -distances.slideIn
|
|
12784
|
-
},
|
|
12785
|
-
transition: {
|
|
12786
|
-
duration: durations.routeAuth,
|
|
12787
|
-
easing: easings.inOut
|
|
12788
|
-
}
|
|
12789
|
-
},
|
|
12790
|
-
routeAuthBack: {
|
|
12791
|
-
initial: {
|
|
12792
|
-
opacity: 0,
|
|
12793
|
-
x: -distances.slideIn
|
|
12794
|
-
},
|
|
12795
|
-
animate: {
|
|
12796
|
-
opacity: 1,
|
|
12797
|
-
x: 0
|
|
12798
|
-
},
|
|
12799
|
-
exit: {
|
|
12800
|
-
opacity: 0,
|
|
12801
|
-
x: distances.slideIn
|
|
12802
|
-
},
|
|
12803
|
-
transition: {
|
|
12804
|
-
duration: durations.routeAuth,
|
|
12805
|
-
easing: easings.inOut
|
|
12806
|
-
}
|
|
12807
|
-
},
|
|
12808
|
-
authSwap: {
|
|
12809
|
-
initial: {
|
|
12810
|
-
opacity: 0.92
|
|
12811
|
-
},
|
|
12812
|
-
animate: {
|
|
12813
|
-
opacity: 1
|
|
14377
|
+
const tabs_Tabs = Object.assign(Tabs, {
|
|
14378
|
+
Tab: tabs_Tab,
|
|
14379
|
+
RadioTab: tabs_RadioTab
|
|
14380
|
+
});
|
|
14381
|
+
var Textarea_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<textarea>");
|
|
14382
|
+
const Textarea = (props)=>{
|
|
14383
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
14384
|
+
"color",
|
|
14385
|
+
"size",
|
|
14386
|
+
"dataTheme",
|
|
14387
|
+
"class",
|
|
14388
|
+
"className",
|
|
14389
|
+
"style",
|
|
14390
|
+
"resize"
|
|
14391
|
+
]);
|
|
14392
|
+
const classes = ()=>twMerge("textarea", local.class, local.className, clsx({
|
|
14393
|
+
"textarea-xl": "xl" === local.size,
|
|
14394
|
+
"textarea-lg": "lg" === local.size,
|
|
14395
|
+
"textarea-md": "md" === local.size,
|
|
14396
|
+
"textarea-sm": "sm" === local.size,
|
|
14397
|
+
"textarea-xs": "xs" === local.size,
|
|
14398
|
+
"textarea-primary": "primary" === local.color,
|
|
14399
|
+
"textarea-secondary": "secondary" === local.color,
|
|
14400
|
+
"textarea-accent": "accent" === local.color,
|
|
14401
|
+
"textarea-ghost": "ghost" === local.color,
|
|
14402
|
+
"textarea-info": "info" === local.color,
|
|
14403
|
+
"textarea-success": "success" === local.color,
|
|
14404
|
+
"textarea-warning": "warning" === local.color,
|
|
14405
|
+
"textarea-error": "error" === local.color,
|
|
14406
|
+
"resize-y": "y" === local.resize,
|
|
14407
|
+
"resize-x": "x" === local.resize,
|
|
14408
|
+
"resize-none": "none" === local.resize,
|
|
14409
|
+
"resize-both": "both" === local.resize
|
|
14410
|
+
}));
|
|
14411
|
+
return (()=>{
|
|
14412
|
+
var _el$ = Textarea_tmpl$();
|
|
14413
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
14414
|
+
get ["data-theme"] () {
|
|
14415
|
+
return local.dataTheme;
|
|
12814
14416
|
},
|
|
12815
|
-
|
|
12816
|
-
|
|
14417
|
+
get ["class"] () {
|
|
14418
|
+
return classes();
|
|
12817
14419
|
},
|
|
12818
|
-
|
|
12819
|
-
|
|
12820
|
-
easing: easings.out
|
|
14420
|
+
get style () {
|
|
14421
|
+
return local.style;
|
|
12821
14422
|
}
|
|
12822
|
-
},
|
|
12823
|
-
|
|
12824
|
-
|
|
12825
|
-
|
|
12826
|
-
|
|
12827
|
-
|
|
12828
|
-
|
|
12829
|
-
|
|
12830
|
-
|
|
12831
|
-
|
|
14423
|
+
}), false, false);
|
|
14424
|
+
return _el$;
|
|
14425
|
+
})();
|
|
14426
|
+
};
|
|
14427
|
+
const textarea_Textarea = Textarea;
|
|
14428
|
+
var Timeline_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<ul>");
|
|
14429
|
+
const Timeline_Timeline = (props)=>{
|
|
14430
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
14431
|
+
"vertical",
|
|
14432
|
+
"horizontal",
|
|
14433
|
+
"responsive",
|
|
14434
|
+
"snap",
|
|
14435
|
+
"compact",
|
|
14436
|
+
"class",
|
|
14437
|
+
"className",
|
|
14438
|
+
"style",
|
|
14439
|
+
"dataTheme"
|
|
14440
|
+
]);
|
|
14441
|
+
const classes = twMerge("timeline", dist_clsx({
|
|
14442
|
+
"timeline-vertical": local.vertical,
|
|
14443
|
+
"timeline-horizontal": local.horizontal,
|
|
14444
|
+
"timeline-vertical lg:timeline-horizontal": local.responsive,
|
|
14445
|
+
"timeline-snap-icon": local.snap,
|
|
14446
|
+
"timeline-compact": local.compact
|
|
14447
|
+
}), local.class, local.className);
|
|
14448
|
+
return (()=>{
|
|
14449
|
+
var _el$ = Timeline_tmpl$();
|
|
14450
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
14451
|
+
class: classes,
|
|
14452
|
+
get ["data-theme"] () {
|
|
14453
|
+
return local.dataTheme;
|
|
12832
14454
|
},
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
|
-
easing: easings.out,
|
|
12836
|
-
delay: 0.08
|
|
14455
|
+
get style () {
|
|
14456
|
+
return local.style;
|
|
12837
14457
|
}
|
|
12838
|
-
},
|
|
12839
|
-
|
|
12840
|
-
|
|
12841
|
-
|
|
12842
|
-
|
|
12843
|
-
|
|
12844
|
-
|
|
12845
|
-
|
|
12846
|
-
|
|
12847
|
-
|
|
12848
|
-
|
|
12849
|
-
|
|
12850
|
-
|
|
12851
|
-
|
|
12852
|
-
|
|
12853
|
-
|
|
12854
|
-
|
|
12855
|
-
|
|
14458
|
+
}), false, true);
|
|
14459
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>props.children);
|
|
14460
|
+
return _el$;
|
|
14461
|
+
})();
|
|
14462
|
+
};
|
|
14463
|
+
const Timeline = Timeline_Timeline;
|
|
14464
|
+
var TimelineEnd_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>");
|
|
14465
|
+
const TimelineEnd = (props)=>{
|
|
14466
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
14467
|
+
"box",
|
|
14468
|
+
"class",
|
|
14469
|
+
"style"
|
|
14470
|
+
]);
|
|
14471
|
+
const classes = twMerge("timeline-end", clsx({
|
|
14472
|
+
"timeline-box": local.box ?? true
|
|
14473
|
+
}), local.class);
|
|
14474
|
+
return (()=>{
|
|
14475
|
+
var _el$ = TimelineEnd_tmpl$();
|
|
14476
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
14477
|
+
class: classes,
|
|
14478
|
+
get style () {
|
|
14479
|
+
return local.style;
|
|
12856
14480
|
}
|
|
12857
|
-
},
|
|
12858
|
-
|
|
12859
|
-
|
|
12860
|
-
|
|
12861
|
-
|
|
12862
|
-
|
|
12863
|
-
|
|
12864
|
-
|
|
12865
|
-
|
|
12866
|
-
|
|
12867
|
-
|
|
12868
|
-
|
|
12869
|
-
|
|
14481
|
+
}), false, true);
|
|
14482
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>props.children);
|
|
14483
|
+
return _el$;
|
|
14484
|
+
})();
|
|
14485
|
+
};
|
|
14486
|
+
const timeline_TimelineEnd = TimelineEnd;
|
|
14487
|
+
var TimelineItem_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<hr>"), TimelineItem_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<li>");
|
|
14488
|
+
const TimelineItem = (props)=>{
|
|
14489
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
14490
|
+
"connect",
|
|
14491
|
+
"startClassName",
|
|
14492
|
+
"endClassName",
|
|
14493
|
+
"class",
|
|
14494
|
+
"style"
|
|
14495
|
+
]);
|
|
14496
|
+
return (()=>{
|
|
14497
|
+
var _el$ = TimelineItem_tmpl$2();
|
|
14498
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
14499
|
+
get ["class"] () {
|
|
14500
|
+
return local.class;
|
|
12870
14501
|
},
|
|
12871
|
-
|
|
12872
|
-
|
|
12873
|
-
easing: easings.out,
|
|
12874
|
-
delay: 0.08
|
|
14502
|
+
get style () {
|
|
14503
|
+
return local.style;
|
|
12875
14504
|
}
|
|
12876
|
-
},
|
|
12877
|
-
|
|
12878
|
-
|
|
12879
|
-
|
|
12880
|
-
y: distances.sm
|
|
12881
|
-
},
|
|
12882
|
-
animate: {
|
|
12883
|
-
opacity: 1,
|
|
12884
|
-
y: 0
|
|
12885
|
-
},
|
|
12886
|
-
exit: {
|
|
12887
|
-
opacity: 0,
|
|
12888
|
-
y: -distances.sm
|
|
14505
|
+
}), false, true);
|
|
14506
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
14507
|
+
get when () {
|
|
14508
|
+
return "both" === local.connect || "start" === local.connect;
|
|
12889
14509
|
},
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
|
|
14510
|
+
get children () {
|
|
14511
|
+
var _el$2 = TimelineItem_tmpl$();
|
|
14512
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$2, local.startClassName));
|
|
14513
|
+
return _el$2;
|
|
12893
14514
|
}
|
|
12894
|
-
},
|
|
12895
|
-
|
|
12896
|
-
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
scale: 0.985
|
|
12900
|
-
},
|
|
12901
|
-
animate: {
|
|
12902
|
-
opacity: 1,
|
|
12903
|
-
y: 0,
|
|
12904
|
-
scale: 1
|
|
12905
|
-
},
|
|
12906
|
-
exit: {
|
|
12907
|
-
opacity: 0,
|
|
12908
|
-
y: -distances.sm,
|
|
12909
|
-
scale: 0.985
|
|
14515
|
+
}), null);
|
|
14516
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>props.children, null);
|
|
14517
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
14518
|
+
get when () {
|
|
14519
|
+
return "both" === local.connect || "end" === local.connect;
|
|
12910
14520
|
},
|
|
12911
|
-
|
|
12912
|
-
|
|
12913
|
-
|
|
12914
|
-
|
|
12915
|
-
|
|
12916
|
-
|
|
12917
|
-
|
|
12918
|
-
|
|
12919
|
-
const routeTransition = motionPresets.route;
|
|
12920
|
-
const noMotion = {
|
|
12921
|
-
initial: {
|
|
12922
|
-
opacity: 1,
|
|
12923
|
-
y: 0,
|
|
12924
|
-
x: 0,
|
|
12925
|
-
scale: 1
|
|
12926
|
-
},
|
|
12927
|
-
animate: {
|
|
12928
|
-
opacity: 1,
|
|
12929
|
-
y: 0,
|
|
12930
|
-
x: 0,
|
|
12931
|
-
scale: 1
|
|
12932
|
-
},
|
|
12933
|
-
exit: {
|
|
12934
|
-
opacity: 1,
|
|
12935
|
-
y: 0,
|
|
12936
|
-
x: 0,
|
|
12937
|
-
scale: 1
|
|
12938
|
-
},
|
|
12939
|
-
transition: {
|
|
12940
|
-
duration: 0
|
|
12941
|
-
}
|
|
12942
|
-
};
|
|
12943
|
-
const presets_getPreset = (name)=>motionPresets[name];
|
|
12944
|
-
const presets_registerPreset = (name, preset)=>{
|
|
12945
|
-
motionPresets[name] = preset;
|
|
12946
|
-
};
|
|
12947
|
-
const presets_resolvePreset = (name, options)=>{
|
|
12948
|
-
const reduce = options?.reduceMotion ?? prefersReducedMotion();
|
|
12949
|
-
if (reduce) return noMotion;
|
|
12950
|
-
return motionPresets[name] ?? noMotion;
|
|
12951
|
-
};
|
|
12952
|
-
const immediateDriver = ({ to, onUpdate, onComplete })=>{
|
|
12953
|
-
onUpdate(to);
|
|
12954
|
-
onComplete?.();
|
|
12955
|
-
return {
|
|
12956
|
-
stop: ()=>{}
|
|
12957
|
-
};
|
|
14521
|
+
get children () {
|
|
14522
|
+
var _el$3 = TimelineItem_tmpl$();
|
|
14523
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$3, local.endClassName));
|
|
14524
|
+
return _el$3;
|
|
14525
|
+
}
|
|
14526
|
+
}), null);
|
|
14527
|
+
return _el$;
|
|
14528
|
+
})();
|
|
12958
14529
|
};
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
14530
|
+
const timeline_TimelineItem = TimelineItem;
|
|
14531
|
+
var TimelineMiddle_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>"), TimelineMiddle_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 20 20"fill=currentColor class="w-5 h-5"><path fill-rule=evenodd d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z"clip-rule=evenodd>');
|
|
14532
|
+
const TimelineMiddle = (props)=>{
|
|
14533
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
14534
|
+
"class",
|
|
14535
|
+
"style",
|
|
14536
|
+
"children"
|
|
14537
|
+
]);
|
|
14538
|
+
const classes = twMerge("timeline-middle", local.class);
|
|
14539
|
+
return (()=>{
|
|
14540
|
+
var _el$ = TimelineMiddle_tmpl$();
|
|
14541
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
14542
|
+
class: classes,
|
|
14543
|
+
get style () {
|
|
14544
|
+
return local.style;
|
|
14545
|
+
}
|
|
14546
|
+
}), false, true);
|
|
14547
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.children ?? TimelineMiddle_tmpl$2());
|
|
14548
|
+
return _el$;
|
|
14549
|
+
})();
|
|
12962
14550
|
};
|
|
12963
|
-
const
|
|
12964
|
-
|
|
12965
|
-
const
|
|
12966
|
-
const
|
|
12967
|
-
|
|
12968
|
-
|
|
12969
|
-
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
12975
|
-
|
|
12976
|
-
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
|
|
14551
|
+
const timeline_TimelineMiddle = TimelineMiddle;
|
|
14552
|
+
var TimelineStart_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>");
|
|
14553
|
+
const TimelineStart = (props)=>{
|
|
14554
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
14555
|
+
"box",
|
|
14556
|
+
"class",
|
|
14557
|
+
"style"
|
|
14558
|
+
]);
|
|
14559
|
+
const classes = twMerge("timeline-start", clsx({
|
|
14560
|
+
"timeline-box": local.box
|
|
14561
|
+
}), local.class);
|
|
14562
|
+
return (()=>{
|
|
14563
|
+
var _el$ = TimelineStart_tmpl$();
|
|
14564
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
14565
|
+
class: classes,
|
|
14566
|
+
get style () {
|
|
14567
|
+
return local.style;
|
|
14568
|
+
}
|
|
14569
|
+
}), false, true);
|
|
14570
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>props.children);
|
|
14571
|
+
return _el$;
|
|
14572
|
+
})();
|
|
12980
14573
|
};
|
|
12981
|
-
const
|
|
12982
|
-
|
|
12983
|
-
const
|
|
12984
|
-
|
|
12985
|
-
|
|
14574
|
+
const timeline_TimelineStart = TimelineStart;
|
|
14575
|
+
var Toast_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>");
|
|
14576
|
+
const horizontalOptions = {
|
|
14577
|
+
start: "toast-start",
|
|
14578
|
+
center: "toast-center",
|
|
14579
|
+
end: "toast-end"
|
|
12986
14580
|
};
|
|
12987
|
-
const
|
|
12988
|
-
|
|
12989
|
-
|
|
12990
|
-
|
|
12991
|
-
const driver = getMotionDriver();
|
|
12992
|
-
const controls = [];
|
|
12993
|
-
const shouldTransform = void 0 !== from.x || void 0 !== from.y || void 0 !== from.scale || void 0 !== to.x || void 0 !== to.y || void 0 !== to.scale;
|
|
12994
|
-
const transformState = {
|
|
12995
|
-
x: from.x ?? 0,
|
|
12996
|
-
y: from.y ?? 0,
|
|
12997
|
-
scale: from.scale ?? 1
|
|
12998
|
-
};
|
|
12999
|
-
const applyTransform = ()=>{
|
|
13000
|
-
if (!shouldTransform) return;
|
|
13001
|
-
el.style.transform = `translate3d(${transformState.x}px, ${transformState.y}px, 0) scale(${transformState.scale})`;
|
|
13002
|
-
};
|
|
13003
|
-
if (void 0 !== from.opacity) el.style.opacity = String(from.opacity);
|
|
13004
|
-
applyTransform();
|
|
13005
|
-
const animationTargets = Object.keys(to);
|
|
13006
|
-
if (0 === animationTargets.length) {
|
|
13007
|
-
onComplete?.();
|
|
13008
|
-
return {
|
|
13009
|
-
stop: ()=>{}
|
|
13010
|
-
};
|
|
13011
|
-
}
|
|
13012
|
-
let remaining = animationTargets.length;
|
|
13013
|
-
const handleComplete = ()=>{
|
|
13014
|
-
remaining -= 1;
|
|
13015
|
-
if (remaining <= 0) onComplete?.();
|
|
13016
|
-
};
|
|
13017
|
-
const start = ()=>{
|
|
13018
|
-
animationTargets.forEach((key)=>{
|
|
13019
|
-
if ("opacity" === key) {
|
|
13020
|
-
const fromValue = from.opacity ?? (void 0 !== to.opacity ? readOpacity(el) : 1);
|
|
13021
|
-
const control = driver({
|
|
13022
|
-
from: fromValue,
|
|
13023
|
-
to: to.opacity ?? fromValue,
|
|
13024
|
-
duration,
|
|
13025
|
-
ease,
|
|
13026
|
-
onUpdate: (latest)=>{
|
|
13027
|
-
el.style.opacity = String(latest);
|
|
13028
|
-
},
|
|
13029
|
-
onComplete: handleComplete
|
|
13030
|
-
});
|
|
13031
|
-
controls.push(control);
|
|
13032
|
-
return;
|
|
13033
|
-
}
|
|
13034
|
-
const fromValue = "scale" === key ? from.scale ?? 1 : "x" === key ? from.x ?? 0 : from.y ?? 0;
|
|
13035
|
-
const toValue = to[key] ?? fromValue;
|
|
13036
|
-
const control = driver({
|
|
13037
|
-
from: fromValue,
|
|
13038
|
-
to: toValue,
|
|
13039
|
-
duration,
|
|
13040
|
-
ease,
|
|
13041
|
-
onUpdate: (latest)=>{
|
|
13042
|
-
if (!shouldTransform) return;
|
|
13043
|
-
if ("x" === key) transformState.x = latest;
|
|
13044
|
-
if ("y" === key) transformState.y = latest;
|
|
13045
|
-
if ("scale" === key) transformState.scale = latest;
|
|
13046
|
-
applyTransform();
|
|
13047
|
-
},
|
|
13048
|
-
onComplete: handleComplete
|
|
13049
|
-
});
|
|
13050
|
-
controls.push(control);
|
|
13051
|
-
});
|
|
13052
|
-
};
|
|
13053
|
-
let timeoutId = null;
|
|
13054
|
-
if (delay > 0) timeoutId = window.setTimeout(start, delay);
|
|
13055
|
-
else start();
|
|
13056
|
-
return {
|
|
13057
|
-
stop: ()=>{
|
|
13058
|
-
if (null !== timeoutId) clearTimeout(timeoutId);
|
|
13059
|
-
controls.forEach((control)=>control.stop());
|
|
13060
|
-
}
|
|
13061
|
-
};
|
|
14581
|
+
const verticalOptions = {
|
|
14582
|
+
top: "toast-top",
|
|
14583
|
+
middle: "toast-middle",
|
|
14584
|
+
bottom: "toast-bottom"
|
|
13062
14585
|
};
|
|
13063
|
-
|
|
13064
|
-
const
|
|
13065
|
-
|
|
13066
|
-
"
|
|
13067
|
-
"
|
|
13068
|
-
"
|
|
13069
|
-
"
|
|
13070
|
-
"
|
|
13071
|
-
"
|
|
13072
|
-
"animateKey",
|
|
13073
|
-
"children",
|
|
13074
|
-
"ref"
|
|
14586
|
+
const Toast = (props)=>{
|
|
14587
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
14588
|
+
"horizontal",
|
|
14589
|
+
"vertical",
|
|
14590
|
+
"class",
|
|
14591
|
+
"className",
|
|
14592
|
+
"style",
|
|
14593
|
+
"dataTheme",
|
|
14594
|
+
"max"
|
|
13075
14595
|
]);
|
|
13076
|
-
const
|
|
13077
|
-
|
|
13078
|
-
|
|
13079
|
-
|
|
13080
|
-
|
|
13081
|
-
|
|
13082
|
-
|
|
13083
|
-
|
|
13084
|
-
};
|
|
13085
|
-
const runEnter = (target, from, to, transition)=>{
|
|
13086
|
-
if (!to) return;
|
|
13087
|
-
stopActive();
|
|
13088
|
-
activeControl = runMotion(target, from ?? {}, to ?? {}, transition);
|
|
13089
|
-
};
|
|
13090
|
-
const runExit = (target, from, to, transition, onComplete)=>{
|
|
13091
|
-
if (!to) return void onComplete?.();
|
|
13092
|
-
stopActive();
|
|
13093
|
-
activeControl = runMotion(target, from ?? {}, to ?? {}, transition, onComplete);
|
|
13094
|
-
};
|
|
13095
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
|
|
13096
|
-
const target = elementRef();
|
|
13097
|
-
if (!target) return;
|
|
13098
|
-
const isExiting = Boolean(local.isExiting);
|
|
13099
|
-
const trigger = local.animateKey;
|
|
13100
|
-
const initial = local.initial;
|
|
13101
|
-
const animate = local.animate;
|
|
13102
|
-
const exit = local.exit;
|
|
13103
|
-
const transition = local.transition;
|
|
13104
|
-
const onComplete = local.onExitComplete;
|
|
13105
|
-
if (isExiting) {
|
|
13106
|
-
if (!lastIsExiting) {
|
|
13107
|
-
lastIsExiting = true;
|
|
13108
|
-
hasAnimated = false;
|
|
13109
|
-
runExit(target, animate ?? initial, exit, transition, onComplete);
|
|
13110
|
-
}
|
|
13111
|
-
return;
|
|
13112
|
-
}
|
|
13113
|
-
lastIsExiting = false;
|
|
13114
|
-
if (!hasAnimated || trigger !== lastTrigger) {
|
|
13115
|
-
lastTrigger = trigger;
|
|
13116
|
-
hasAnimated = true;
|
|
13117
|
-
runEnter(target, initial, animate, transition);
|
|
13118
|
-
}
|
|
13119
|
-
});
|
|
13120
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
13121
|
-
stopActive();
|
|
14596
|
+
const positionClasses = [
|
|
14597
|
+
horizontalOptions[local.horizontal || "end"],
|
|
14598
|
+
verticalOptions[local.vertical || "bottom"]
|
|
14599
|
+
];
|
|
14600
|
+
const limitedChildren = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
14601
|
+
const childrenArray = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.children)(()=>props.children).toArray();
|
|
14602
|
+
if (local.max && local.max > 0) return childrenArray.slice(-local.max);
|
|
14603
|
+
return childrenArray;
|
|
13122
14604
|
});
|
|
13123
14605
|
return (()=>{
|
|
13124
|
-
var _el$ =
|
|
13125
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.
|
|
13126
|
-
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
14606
|
+
var _el$ = Toast_tmpl$();
|
|
14607
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
14608
|
+
role: "status",
|
|
14609
|
+
get ["class"] () {
|
|
14610
|
+
return twMerge("toast", ...positionClasses, local.class, local.className);
|
|
14611
|
+
},
|
|
14612
|
+
get ["data-theme"] () {
|
|
14613
|
+
return local.dataTheme;
|
|
14614
|
+
},
|
|
14615
|
+
get style () {
|
|
14616
|
+
return local.style;
|
|
14617
|
+
}
|
|
14618
|
+
}), false, true);
|
|
14619
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, limitedChildren);
|
|
13131
14620
|
return _el$;
|
|
13132
14621
|
})();
|
|
13133
14622
|
};
|
|
13134
|
-
const
|
|
14623
|
+
const toast_Toast = Toast;
|
|
13135
14624
|
const [toasts, setToasts] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)([]);
|
|
13136
14625
|
let toastCounter = 0;
|
|
13137
14626
|
const toastTimers = new Map();
|
|
@@ -13582,4 +15071,4 @@ const createRouteTransitionResolver = (options)=>{
|
|
|
13582
15071
|
return fallback ?? noMotion;
|
|
13583
15072
|
};
|
|
13584
15073
|
};
|
|
13585
|
-
export { accordion_Accordion as Accordion, alert_Alert as Alert, artboard_Artboard as Artboard, avatar as Avatar, background_Background as Background, Badge, bottom_sheet_BottomSheet as BottomSheet, Breadcrumbs, breadcrumbs_BreadcrumbsItem as BreadcrumbsItem, browsermockup_BrowserMockup as BrowserMockup, button_Button as Button, Calendar, card_Card as Card, carousel_Carousel as Carousel, chatbubble_ChatBubble as ChatBubble, checkbox_Checkbox as Checkbox, codemockup_CodeMockup as CodeMockup, CodeMockupLine, collapse_Collapse as Collapse, CollapseContent, CollapseDetails, CollapseTitle, connectionstatus_ConnectionStatus as ConnectionStatus, CopyButton, countdown_Countdown as Countdown, diff_Diff as Diff, divider as Divider, dock as Dock, Drawer, dropdown as Dropdown, EnhancedTable, FileInput, flex_Flex as Flex, footer_Footer as Footer, form_Form as Form, Grid, hero_Hero as Hero, icon_Icon as Icon, indicator_Indicator as Indicator, input as Input, join_Join as Join, kbd_Kbd as Kbd, link_Link as Link, loading_Loading as Loading, mask as Mask, menu_Menu as Menu, modal_Modal as Modal, MotionDiv, navbar_Navbar as Navbar, pagination_Pagination as Pagination, phonemockup_PhoneMockup as PhoneMockup, Progress, props_table_PropsTable as PropsTable, radialprogress_RadialProgress as RadialProgress, radio_Radio as Radio, range_Range as Range, Rating, select_Select as Select, showcase_ShowcaseBlock as ShowcaseBlock,
|
|
15074
|
+
export { accordion_Accordion as Accordion, alert_Alert as Alert, AlphaSlider, artboard_Artboard as Artboard, avatar as Avatar, background_Background as Background, Badge, bottom_sheet_BottomSheet as BottomSheet, Breadcrumbs, breadcrumbs_BreadcrumbsItem as BreadcrumbsItem, browsermockup_BrowserMockup as BrowserMockup, button_Button as Button, Calendar, card_Card as Card, carousel_Carousel as Carousel, chatbubble_ChatBubble as ChatBubble, checkbox_Checkbox as Checkbox, codemockup_CodeMockup as CodeMockup, CodeMockupLine, collapse_Collapse as Collapse, CollapseContent, CollapseDetails, CollapseTitle, colorpicker_ColorInput as ColorInput, colorpicker_ColorPicker as ColorPicker, ColorPickerContext, ColorPickerFlowerSelector, colorpicker_ColorPickerGradientSelector as ColorPickerGradientSelector, ColorPickerWheelSelector, colorpicker_ColorPreview as ColorPreview, colorpicker_ColorSwatches as ColorSwatches, ColorWheel, colorpicker_ColorWheelFlower as ColorWheelFlower, connectionstatus_ConnectionStatus as ConnectionStatus, CopyButton, countdown_Countdown as Countdown, diff_Diff as Diff, divider as Divider, dock as Dock, Drawer, dropdown as Dropdown, EnhancedTable, FileInput, flex_Flex as Flex, footer_Footer as Footer, form_Form as Form, Grid, hero_Hero as Hero, colorpicker_HueSlider as HueSlider, icon_Icon as Icon, indicator_Indicator as Indicator, input as Input, join_Join as Join, kbd_Kbd as Kbd, LightnessSlider, link_Link as Link, loading_Loading as Loading, mask as Mask, menu_Menu as Menu, modal_Modal as Modal, MotionDiv, navbar_Navbar as Navbar, pagination_Pagination as Pagination, phonemockup_PhoneMockup as PhoneMockup, Progress, props_table_PropsTable as PropsTable, radialprogress_RadialProgress as RadialProgress, radio_Radio as Radio, range_Range as Range, Rating, colorpicker_SaturationBrightness as SaturationBrightness, select_Select as Select, showcase_ShowcaseBlock as ShowcaseBlock, ShowcaseSection, sidenav_Sidenav as Sidenav, sidenav_SidenavButton as SidenavButton, sidenav_SidenavGroup as SidenavGroup, sidenav_SidenavItem as SidenavItem, sidenav_SidenavLink as SidenavLink, sidenav_SidenavMenu as SidenavMenu, skeleton_Skeleton as Skeleton, Stack, stat_card_StatCard as StatCard, stats_Stats as Stats, status_Status as Status, steps as Steps, streaming_table_StreamingTable as StreamingTable, Summary, SvgBackground, Swap, table_Table as Table, tabs_Tabs as Tabs, textarea_Textarea as Textarea, Timeline, timeline_TimelineEnd as TimelineEnd, timeline_TimelineItem as TimelineItem, timeline_TimelineMiddle as TimelineMiddle, timeline_TimelineStart as TimelineStart, toast_Toast as Toast, ToastContainer, ToastStack_ToastStack as ToastStack, toggle_Toggle as Toggle, tooltip_Tooltip as Tooltip, windowmockup_WindowMockup as WindowMockup, createMotionPresets, createMotionSystem, createPopmotionDriver, createRouteTransitionResolver, createStreamingTableStore, connectionstatus_ConnectionStatus as default, defaultMotionTokens, enablePopmotion, getMotionDriver, presets_getPreset as getPreset, immediateDriver, mergeMotionTokens, motionDistances, motionDurations, motionEasings, motionPresets, noMotion, prefersReducedMotion, presets_registerPreset as registerPreset, resolveEase, presets_resolvePreset as resolvePreset, routeTransition, runMotion, setMotionDriver, toastStore, useColorPickerContext, useDesktop, useFormValidation };
|