@tempots/beatui 0.94.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ar-CuI1Jgt6.cjs +1 -0
- package/dist/{ar-8Cko5i-Z.js → ar-DaKbK_t8.js} +88 -11
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-Rt0WDKAe.js → auth-divider-BQIhr3-R.js} +99 -98
- package/dist/auth-divider-DvnUModP.cjs +1 -0
- package/dist/beatui.css +1628 -541
- package/dist/beatui.tailwind.css +1629 -542
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +9 -9
- package/dist/codehighlight/index.cjs.js +22 -0
- package/dist/codehighlight/index.es.js +76 -0
- package/dist/colors-B-p6IzX9.cjs +1 -0
- package/dist/{colors-BY0Ja_bf.js → colors-DwufPN8S.js} +18 -18
- package/dist/{de-Bt-d2iKj.js → de-3MTPDS1i.js} +83 -6
- package/dist/de-DthHehbh.cjs +1 -0
- package/dist/{deep-merge-CoLO4id0.js → deep-merge-BzIheQtH.js} +511 -517
- package/dist/deep-merge-EkjEgK0N.cjs +1 -0
- package/dist/{duration-input-47x7nbGh.cjs → duration-input-ClgYjeBa.cjs} +1 -1
- package/dist/{duration-input-DrVonjKK.js → duration-input-DGzmIImj.js} +5 -5
- package/dist/{editor-toolbar-group-CzdBZ1yr.js → editor-toolbar-group-Crlu1QJw.js} +3 -3
- package/dist/{editor-toolbar-group-DhKJdqER.cjs → editor-toolbar-group-mkL4QozO.cjs} +1 -1
- package/dist/es-B6GJLk9h.cjs +1 -0
- package/dist/{es-2llfNFX2.js → es-DwMUvBeU.js} +95 -18
- package/dist/{fa-CQVIBjKP.js → fa-0rvQiKrJ.js} +88 -11
- package/dist/fa-BwgP93iV.cjs +1 -0
- package/dist/{fr-CC3smTlW.js → fr-B4i6NzLl.js} +87 -10
- package/dist/fr-CQzk5zqY.cjs +1 -0
- package/dist/{he-CZilsN75.js → he-C71n-hsn.js} +88 -11
- package/dist/he-DcxxvRfs.cjs +1 -0
- package/dist/hi-D-KHVWg4.cjs +1 -0
- package/dist/{hi-CAZjwGv-.js → hi-xmrXpeVU.js} +88 -11
- package/dist/index-B5MAsOC-.cjs +1 -0
- package/dist/{index-B8cqD9ny.js → index-C3o9GSH6.js} +106 -105
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +8055 -5285
- package/dist/input-container-BvEcp7FU.js +275 -0
- package/dist/input-container-Di1YvVB_.cjs +1 -0
- package/dist/{it-D6RXFIL6.js → it-CDZTtOBC.js} +84 -7
- package/dist/it-D344Dutu.cjs +1 -0
- package/dist/ja-BNgnDZ27.cjs +1 -0
- package/dist/{ja-D7zsz4Ij.js → ja-Zz1LzidW.js} +92 -15
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +261 -257
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +2 -2
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +132 -133
- package/dist/{ko-taN2Npr4.js → ko-9laUsZDL.js} +91 -14
- package/dist/ko-D-WJ9NK7.cjs +1 -0
- package/dist/lexical/index.cjs.js +2 -39
- package/dist/lexical/index.es.js +2102 -20521
- package/dist/markdown/index.cjs.js +1 -1
- package/dist/markdown/index.es.js +41 -4
- package/dist/{menu-CV85y3Xf.js → menu-B8yoDMRS.js} +23 -23
- package/dist/menu-B92oSDct.cjs +1 -0
- package/dist/modal-BT0jjDqX.cjs +1 -0
- package/dist/{modal-ZitwUeXx.js → modal-DBguyX-b.js} +9 -9
- package/dist/monaco/index.cjs.js +2 -2
- package/dist/monaco/index.es.js +7 -7
- package/dist/nl-CrqUlFie.cjs +1 -0
- package/dist/{nl-CRC6r4Q4.js → nl-Dcll9fVA.js} +87 -10
- package/dist/{notice-E_p2hg1G.js → notice-E19wu9lA.js} +51 -51
- package/dist/notice-_9XhdrFw.cjs +1 -0
- package/dist/oneof-branch-detection-J_DYEEcD.js +1077 -0
- package/dist/oneof-branch-detection-ZUBZ6hqy.cjs +1 -0
- package/dist/pl-9UksIrvX.cjs +1 -0
- package/dist/{pl-C6qNs0Lq.js → pl-Dm9N9Gbr.js} +84 -7
- package/dist/prosemirror/index.cjs.js +3 -1
- package/dist/prosemirror/index.es.js +636 -4
- package/dist/{pt-CcWPLqBh.js → pt-CFi5cn0k.js} +89 -12
- package/dist/pt-_kfdzwqi.cjs +1 -0
- package/dist/{ru-Dt9-9m0E.js → ru-CEhZUw8R.js} +92 -15
- package/dist/ru-CW1WNNlr.cjs +1 -0
- package/dist/stack-BLMteGTn.js +15 -0
- package/dist/stack-dwLevGa2.cjs +1 -0
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +2 -2
- package/dist/tailwind/vite-plugin.cjs.js +1 -1
- package/dist/tailwind/vite-plugin.es.js +1 -1
- package/dist/text-input-DfqXolVe.js +55 -0
- package/dist/text-input-X_q01NsY.cjs +1 -0
- package/dist/toolbar-DY0ax2Qd.js +130 -0
- package/dist/toolbar-DoKdYXIL.cjs +1 -0
- package/dist/tr-B6GIRegf.cjs +1 -0
- package/dist/{tr-CDTWeRY0.js → tr-ZmnVDhLP.js} +83 -6
- package/dist/{translations-NBY7SubC.js → translations-A4kR7CW8.js} +1 -1
- package/dist/{translations-CiBhB2FV.js → translations-B1_yyDUK.js} +185 -106
- package/dist/{translations-BdCtLBZt.cjs → translations-C81buKAw.cjs} +1 -1
- package/dist/translations-Dbx7L7Q1.cjs +1 -0
- package/dist/types/beatui-i18n/default.d.ts +72 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +72 -0
- package/dist/types/beatui-i18n/translations.d.ts +72 -0
- package/dist/types/codehighlight/code-highlight.d.ts +21 -0
- package/dist/types/codehighlight/index.d.ts +14 -0
- package/dist/types/components/button/toggle-button.d.ts +4 -4
- package/dist/types/components/data/avatar.d.ts +3 -1
- package/dist/types/components/data/badge.d.ts +10 -18
- package/dist/types/components/data/column-filter-panel.d.ts +31 -0
- package/dist/types/components/data/column-filter.d.ts +110 -0
- package/dist/types/components/data/column-header-menu.d.ts +42 -0
- package/dist/types/components/data/data-source.d.ts +190 -0
- package/dist/types/components/data/data-table-body.d.ts +12 -0
- package/dist/types/components/data/data-table-column-toggle.d.ts +4 -0
- package/dist/types/components/data/data-table-context.d.ts +53 -0
- package/dist/types/components/data/data-table-header.d.ts +6 -0
- package/dist/types/components/data/data-table-resolve.d.ts +26 -0
- package/dist/types/components/data/data-table-types.d.ts +201 -0
- package/dist/types/components/data/data-table.d.ts +38 -0
- package/dist/types/components/data/data-toolbar.d.ts +44 -0
- package/dist/types/components/data/date-picker-shared.d.ts +55 -0
- package/dist/types/components/data/date-picker.d.ts +58 -0
- package/dist/types/components/data/date-range-picker.d.ts +56 -0
- package/dist/types/components/data/filter.d.ts +268 -0
- package/dist/types/components/data/index.d.ts +13 -4
- package/dist/types/components/data/indicator.d.ts +41 -0
- package/dist/types/components/data/progress-bar.d.ts +2 -2
- package/dist/types/components/data/selection-checkbox.d.ts +63 -0
- package/dist/types/components/data/skeleton.d.ts +1 -1
- package/dist/types/components/data/sortable-header.d.ts +55 -0
- package/dist/types/components/data/unstyled-drop-zone.d.ts +2 -2
- package/dist/types/components/form/control/control.d.ts +9 -9
- package/dist/types/components/form/input/advanced-slider.d.ts +6 -6
- package/dist/types/components/form/input/appearance-selector.d.ts +9 -2
- package/dist/types/components/form/input/checkbox-input.d.ts +6 -7
- package/dist/types/components/form/input/color-input.d.ts +1 -1
- package/dist/types/components/form/input/color-swatch-input.d.ts +3 -3
- package/dist/types/components/form/input/combobox-input.d.ts +5 -5
- package/dist/types/components/form/input/combobox-tags-input.d.ts +5 -5
- package/dist/types/components/form/input/create-nullable-string-input.d.ts +2 -2
- package/dist/types/components/form/input/date-input.d.ts +4 -4
- package/dist/types/components/form/input/dropdown-input.d.ts +5 -5
- package/dist/types/components/form/input/editable-text.d.ts +2 -2
- package/dist/types/components/form/input/email-input.d.ts +4 -4
- package/dist/types/components/form/input/index.d.ts +1 -0
- package/dist/types/components/form/input/input-container.d.ts +1 -1
- package/dist/types/components/form/input/input-options.d.ts +28 -1
- package/dist/types/components/form/input/mask-input.d.ts +8 -2
- package/dist/types/components/form/input/native-select.d.ts +3 -3
- package/dist/types/components/form/input/nullable-date-input.d.ts +2 -2
- package/dist/types/components/form/input/nullable-email-input.d.ts +3 -3
- package/dist/types/components/form/input/nullable-rating-input.d.ts +8 -8
- package/dist/types/components/form/input/nullable-uuid-input.d.ts +4 -4
- package/dist/types/components/form/input/number-input.d.ts +3 -3
- package/dist/types/components/form/input/otp-input.d.ts +12 -12
- package/dist/types/components/form/input/rating-input.d.ts +7 -8
- package/dist/types/components/form/input/select-tags-input.d.ts +5 -5
- package/dist/types/components/form/input/switch.d.ts +2 -2
- package/dist/types/components/form/input/tri-state-checkbox-input.d.ts +82 -0
- package/dist/types/components/form/input/uuid-input.d.ts +2 -2
- package/dist/types/components/json-structure/controls/uuid-control.d.ts +1 -1
- package/dist/types/components/layout/card.d.ts +66 -0
- package/dist/types/components/layout/collapse.d.ts +2 -2
- package/dist/types/components/layout/flex.d.ts +26 -0
- package/dist/types/components/layout/index.d.ts +1 -0
- package/dist/types/components/lexical/floating/slash-command-palette.d.ts +2 -2
- package/dist/types/components/lexical/toolbar/toolbar-registry.d.ts +2 -1
- package/dist/types/components/media/pdf-page-viewer.d.ts +8 -5
- package/dist/types/components/misc/index.d.ts +1 -0
- package/dist/types/components/misc/loading-overlay.d.ts +29 -0
- package/dist/types/components/misc/notice.d.ts +4 -4
- package/dist/types/components/misc/notification-provider.d.ts +9 -3
- package/dist/types/components/misc/notification.d.ts +9 -9
- package/dist/types/components/navigation/breadcrumbs.d.ts +1 -1
- package/dist/types/components/navigation/menu.d.ts +6 -6
- package/dist/types/components/navigation/pagination.d.ts +17 -4
- package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +2 -2
- package/dist/types/components/navigation/tabs/tabs.d.ts +17 -8
- package/dist/types/components/navigation/toolbar/toolbar.d.ts +12 -6
- package/dist/types/components/overlay/announcement-bar.d.ts +12 -4
- package/dist/types/components/overlay/dialogs.d.ts +2 -2
- package/dist/types/components/overlay/modal.d.ts +9 -2
- package/dist/types/components/overlay/tooltip.d.ts +6 -6
- package/dist/types/components/theme/types.d.ts +15 -4
- package/dist/types/lexical/index.d.ts +2 -2
- package/dist/types/lexical/plugins/index.d.ts +1 -1
- package/dist/types/lexical/plugins/slash-commands.d.ts +1 -1
- package/dist/types/lexical/plugins/text.d.ts +5 -0
- package/dist/types/lexical/types.d.ts +126 -5
- package/dist/types/lexical-i18n/default.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ar.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/de.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/en.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/es.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/fa.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/fr.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/he.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/hi.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/it.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ja.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ko.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/nl.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/pl.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/pt.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ru.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/tr.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ur.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/vi.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/zh.d.ts +1 -0
- package/dist/types/tokens/z-index.d.ts +18 -18
- package/dist/types/utils/use-animated-toggle.d.ts +12 -4
- package/dist/ur-CtFl_tz6.cjs +1 -0
- package/dist/{ur-CLrK5FPQ.js → ur-yYgj3NmT.js} +88 -11
- package/dist/use-animated-toggle-C3asw_Sg.js +207 -0
- package/dist/use-animated-toggle-cKcuItmz.cjs +1 -0
- package/dist/use-form-CaW192gw.cjs +2 -0
- package/dist/{use-form-BQRVnIp9.js → use-form-Dn6v2tEh.js} +153 -152
- package/dist/utils-DmEuG3Np.cjs +1 -0
- package/dist/utils-vUtP6iPG.js +165 -0
- package/dist/{vi-B1_QDUQJ.js → vi-D5u4CLQO.js} +89 -12
- package/dist/vi-DyCZSpsk.cjs +1 -0
- package/dist/widget-customization-DgW1SXN6.cjs +1 -0
- package/dist/{widget-customization-C-fSx3RB.js → widget-customization-Dkx7kNSe.js} +413 -398
- package/dist/{zh-rDtQ92Pp.js → zh-B0kwMMer.js} +91 -14
- package/dist/zh-C3ZxMQKb.cjs +1 -0
- package/package.json +209 -38
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/ar-D2DjoXta.cjs +0 -1
- package/dist/auth-divider-C3E16pml.cjs +0 -1
- package/dist/colors-BI0YhONJ.cjs +0 -1
- package/dist/de-Cdf3432J.cjs +0 -1
- package/dist/deep-merge-Blrucd-E.cjs +0 -1
- package/dist/es-6fFPkKHL.cjs +0 -1
- package/dist/fa-GXyNzAXz.cjs +0 -1
- package/dist/fr-C6EYTwSH.cjs +0 -1
- package/dist/he-CJUgxvi8.cjs +0 -1
- package/dist/hi-DqIR4VtX.cjs +0 -1
- package/dist/hls.light.min-C6xKDzRR.cjs +0 -27
- package/dist/hls.light.min-hEMf_E8u.js +0 -8311
- package/dist/index-1JaBwDB-.js +0 -921
- package/dist/index-B-cwxUsP.cjs +0 -1
- package/dist/index-BFzxpY7y.js +0 -68
- package/dist/index-BOC0cVoY.cjs +0 -36
- package/dist/index-CN10Cyqr.cjs +0 -1
- package/dist/index-CTcbhnPw.cjs +0 -4
- package/dist/index-DF7RFzD9.cjs +0 -1
- package/dist/index-DJ9YIJcG.js +0 -14308
- package/dist/index-DfPkCwdC.js +0 -2709
- package/dist/input-container-9r1F3KuX.js +0 -263
- package/dist/input-container-DiYEl_y8.cjs +0 -1
- package/dist/it-BvHsJ7fH.cjs +0 -1
- package/dist/ja-B2gP7OHY.cjs +0 -1
- package/dist/ko-BddhddIA.cjs +0 -1
- package/dist/menu-De_-sGeb.cjs +0 -1
- package/dist/modal-DUlqGUW7.cjs +0 -1
- package/dist/nl-COrtZUnH.cjs +0 -1
- package/dist/notice-DAVOTnfA.cjs +0 -1
- package/dist/oneof-branch-detection-D6Xa8qNR.cjs +0 -8
- package/dist/oneof-branch-detection-DCPwyutI.js +0 -6290
- package/dist/pl-BHI4zBgV.cjs +0 -1
- package/dist/pt-BGzC9MhU.cjs +0 -1
- package/dist/ru-CXeFbIPb.cjs +0 -1
- package/dist/stack-4VUGISn6.cjs +0 -1
- package/dist/stack-Bm-UZosx.js +0 -879
- package/dist/string-B9vVyfq3.cjs +0 -1
- package/dist/string-DYyMxBl-.js +0 -19
- package/dist/text-input-BgPx8BbG.js +0 -45
- package/dist/text-input-DUnhBUd6.cjs +0 -1
- package/dist/timer-BJHOsuS6.cjs +0 -1
- package/dist/timer-Rd2sKnvH.js +0 -65
- package/dist/toolbar-DKOh_gbA.js +0 -118
- package/dist/toolbar-Dkc2y1dI.cjs +0 -1
- package/dist/tr-CdOtQAtA.cjs +0 -1
- package/dist/translations-Cy9hoMGV.cjs +0 -1
- package/dist/types/components/data/calendar-shared.d.ts +0 -59
- package/dist/types/components/data/calendar.d.ts +0 -107
- package/dist/types/components/data/icon-badge.d.ts +0 -14
- package/dist/types/components/data/range-calendar.d.ts +0 -104
- package/dist/types/components/data/tag.d.ts +0 -51
- package/dist/ur-C7itXvnC.cjs +0 -1
- package/dist/use-animated-toggle-C7PTmnZi.js +0 -195
- package/dist/use-animated-toggle-DrqK7nUS.cjs +0 -1
- package/dist/use-form-DTyNw0kM.cjs +0 -2
- package/dist/utils-DEbsp9Q9.js +0 -129
- package/dist/utils-DIUEhA-Z.cjs +0 -1
- package/dist/vi-CQrUWB3y.cjs +0 -1
- package/dist/widget-customization-xEBfEPhQ.cjs +0 -1
- package/dist/zh-DWswYYTS.cjs +0 -1
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { Value as p, prop as
|
|
2
|
-
import { F as
|
|
3
|
-
import {
|
|
4
|
-
import { I as
|
|
5
|
-
import { C as
|
|
6
|
-
import { B as
|
|
7
|
-
import { AutoSelect as
|
|
8
|
-
import {
|
|
9
|
-
import { s as
|
|
10
|
-
import { r as
|
|
11
|
-
function
|
|
1
|
+
import { Value as p, prop as lt, computedOf as D, html as _, attr as u, svg as rt, svgAttr as Q, Empty as S, on as I, When as H, Fragment as j, aria as B, emitValue as st, Use as gt, input as ut, emitValueAsNullableDate as ot, emitValueAsNullableDateTime as ct, Repeat as ft, style as mt, emit as bt, emitValueAsNumber as E } from "@tempots/dom";
|
|
2
|
+
import { F as wt, N as X, T as yt, U as Mt, a as It } from "./deep-merge-BzIheQtH.js";
|
|
3
|
+
import { decodeBase64 as $t } from "@tempots/std";
|
|
4
|
+
import { I as L } from "./input-container-BvEcp7FU.js";
|
|
5
|
+
import { C as O, m as pt, T as xt } from "./text-input-DfqXolVe.js";
|
|
6
|
+
import { B as _t, I as tt, b as it, a as kt } from "./translations-B1_yyDUK.js";
|
|
7
|
+
import { AutoSelect as Ft } from "@tempots/ui";
|
|
8
|
+
import { N as Ct, P as Tt } from "./notice-E19wu9lA.js";
|
|
9
|
+
import { s as St } from "./session-id-3KiilioY.js";
|
|
10
|
+
import { r as At } from "./utils-vUtP6iPG.js";
|
|
11
|
+
function dt(t) {
|
|
12
12
|
if (typeof t != "string") return !1;
|
|
13
13
|
const e = t.startsWith("#") ? t.slice(1) : t;
|
|
14
14
|
return /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(e);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function vt(t) {
|
|
17
17
|
if (typeof t != "string") return !1;
|
|
18
18
|
const e = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i, a = t.match(e);
|
|
19
19
|
if (!a) return !1;
|
|
20
|
-
const [, n, r, s] = a, o = parseInt(n, 10),
|
|
21
|
-
return o >= 0 && o <= 255 &&
|
|
20
|
+
const [, n, r, s] = a, o = parseInt(n, 10), c = parseInt(r, 10), i = parseInt(s, 10);
|
|
21
|
+
return o >= 0 && o <= 255 && c >= 0 && c <= 255 && i >= 0 && i <= 255;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Nt(t) {
|
|
24
24
|
if (typeof t != "string") return !1;
|
|
25
25
|
const e = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i, a = t.match(e);
|
|
26
26
|
if (!a) return !1;
|
|
27
|
-
const [, n, r, s, o] = a,
|
|
28
|
-
return
|
|
27
|
+
const [, n, r, s, o] = a, c = parseInt(n, 10), i = parseInt(r, 10), l = parseInt(s, 10), d = parseFloat(o);
|
|
28
|
+
return c >= 0 && c <= 255 && i >= 0 && i <= 255 && l >= 0 && l <= 255 && d >= 0 && d <= 1;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function Rt(t) {
|
|
31
31
|
if (typeof t != "string") return !1;
|
|
32
32
|
const e = /^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/i, a = t.match(e);
|
|
33
33
|
if (!a) return !1;
|
|
34
|
-
const [, n, r, s] = a, o = parseInt(n, 10),
|
|
35
|
-
return o >= 0 && o <= 360 &&
|
|
34
|
+
const [, n, r, s] = a, o = parseInt(n, 10), c = parseInt(r, 10), i = parseInt(s, 10);
|
|
35
|
+
return o >= 0 && o <= 360 && c >= 0 && c <= 100 && i >= 0 && i <= 100;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function pe(t) {
|
|
38
|
+
return dt(t) || vt(t) || Nt(t) || Rt(t);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
if (!
|
|
40
|
+
function Bt(t) {
|
|
41
|
+
if (!dt(t)) return null;
|
|
42
42
|
let e = t.startsWith("#") ? t.slice(1) : t;
|
|
43
43
|
return e.length === 3 && (e = e.split("").map((a) => a + a).join("")), `#${e.toLowerCase()}`;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function et(t, e, a) {
|
|
46
46
|
const n = (r) => {
|
|
47
47
|
const s = Math.round(Math.max(0, Math.min(255, r))).toString(16);
|
|
48
48
|
return s.length === 1 ? "0" + s : s;
|
|
49
49
|
};
|
|
50
50
|
return `#${n(t)}${n(e)}${n(a)}`;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
const e =
|
|
52
|
+
function z(t) {
|
|
53
|
+
const e = Bt(t);
|
|
54
54
|
if (!e) return null;
|
|
55
55
|
const a = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
|
|
56
56
|
return a ? {
|
|
@@ -59,16 +59,16 @@ function H(t) {
|
|
|
59
59
|
b: parseInt(a[3], 16)
|
|
60
60
|
} : null;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const a =
|
|
62
|
+
function de(t, e) {
|
|
63
|
+
const a = z(t), n = z(e);
|
|
64
64
|
if (!a || !n) return null;
|
|
65
|
-
const r = (l, d,
|
|
66
|
-
const [m,
|
|
67
|
-
return 0.2126 * m + 0.7152 *
|
|
68
|
-
}, s = r(a.r, a.g, a.b), o = r(n.r, n.g, n.b),
|
|
69
|
-
return (
|
|
65
|
+
const r = (l, d, g) => {
|
|
66
|
+
const [m, h, b] = [l, d, g].map((M) => (M = M / 255, M <= 0.03928 ? M / 12.92 : Math.pow((M + 0.055) / 1.055, 2.4)));
|
|
67
|
+
return 0.2126 * m + 0.7152 * h + 0.0722 * b;
|
|
68
|
+
}, s = r(a.r, a.g, a.b), o = r(n.r, n.g, n.b), c = Math.max(s, o), i = Math.min(s, o);
|
|
69
|
+
return (c + 0.05) / (i + 0.05);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function Dt(t) {
|
|
72
72
|
if (!t) return [0, 0, 0, 1];
|
|
73
73
|
const a = t.trim().match(
|
|
74
74
|
/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/
|
|
@@ -76,8 +76,8 @@ function St(t) {
|
|
|
76
76
|
if (a) {
|
|
77
77
|
const l = a[1];
|
|
78
78
|
if (l.length === 8) {
|
|
79
|
-
const d = parseInt(l.slice(0, 2), 16),
|
|
80
|
-
return [d,
|
|
79
|
+
const d = parseInt(l.slice(0, 2), 16), g = parseInt(l.slice(2, 4), 16), m = parseInt(l.slice(4, 6), 16), h = parseInt(l.slice(6, 8), 16) / 255;
|
|
80
|
+
return [d, g, m, h];
|
|
81
81
|
}
|
|
82
82
|
if (l.length === 6)
|
|
83
83
|
return [
|
|
@@ -87,12 +87,12 @@ function St(t) {
|
|
|
87
87
|
1
|
|
88
88
|
];
|
|
89
89
|
if (l.length === 4) {
|
|
90
|
-
const d = parseInt(l[0] + l[0], 16),
|
|
91
|
-
return [d,
|
|
90
|
+
const d = parseInt(l[0] + l[0], 16), g = parseInt(l[1] + l[1], 16), m = parseInt(l[2] + l[2], 16), h = parseInt(l[3] + l[3], 16) / 255;
|
|
91
|
+
return [d, g, m, h];
|
|
92
92
|
}
|
|
93
93
|
if (l.length === 3) {
|
|
94
|
-
const d = parseInt(l[0] + l[0], 16),
|
|
95
|
-
return [d,
|
|
94
|
+
const d = parseInt(l[0] + l[0], 16), g = parseInt(l[1] + l[1], 16), m = parseInt(l[2] + l[2], 16);
|
|
95
|
+
return [d, g, m, 1];
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
const n = t.match(
|
|
@@ -114,130 +114,130 @@ function St(t) {
|
|
|
114
114
|
/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
115
115
|
);
|
|
116
116
|
if (s) {
|
|
117
|
-
const l = parseFloat(s[1]), d = parseFloat(s[2]),
|
|
118
|
-
return [
|
|
117
|
+
const l = parseFloat(s[1]), d = parseFloat(s[2]), g = parseFloat(s[3]), m = s[4] != null ? parseFloat(s[4]) : 1, [h, b, M] = ht(l, d / 100, g / 100);
|
|
118
|
+
return [h, b, M, m];
|
|
119
119
|
}
|
|
120
120
|
const o = t.match(
|
|
121
121
|
/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
122
122
|
);
|
|
123
123
|
if (o) {
|
|
124
|
-
const l = parseFloat(o[1]), d = parseFloat(o[2]) / 100,
|
|
125
|
-
return [
|
|
124
|
+
const l = parseFloat(o[1]), d = parseFloat(o[2]) / 100, g = parseFloat(o[3]) / 100, m = o[4] != null ? parseFloat(o[4]) : 1, [h, b, M] = Lt(l, d, g);
|
|
125
|
+
return [h, b, M, m];
|
|
126
126
|
}
|
|
127
|
-
const
|
|
127
|
+
const c = t.match(
|
|
128
128
|
/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
129
129
|
);
|
|
130
|
-
if (
|
|
131
|
-
const l =
|
|
132
|
-
return [b,
|
|
130
|
+
if (c) {
|
|
131
|
+
const l = c[1], d = parseFloat(c[2]), g = parseFloat(c[3]), m = c[4] != null ? parseFloat(c[4]) : 1, h = l.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(l) / 100)) : Math.max(0, Math.min(1, parseFloat(l))), [b, M, $] = Pt(h, d, g);
|
|
132
|
+
return [b, M, $, m];
|
|
133
133
|
}
|
|
134
|
-
const
|
|
135
|
-
return
|
|
134
|
+
const i = z(t);
|
|
135
|
+
return i ? [i.r, i.g, i.b, 1] : [0, 0, 0, 1];
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function Vt(t, e, a, n) {
|
|
138
138
|
return `rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(a)}, ${Math.max(
|
|
139
139
|
0,
|
|
140
140
|
Math.min(1, Math.round(n * 100) / 100)
|
|
141
141
|
)})`;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function Et(t) {
|
|
144
144
|
let e = t + 1831565813;
|
|
145
145
|
return function() {
|
|
146
146
|
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function ht(t, e, a) {
|
|
150
150
|
t = (t % 360 + 360) % 360;
|
|
151
151
|
const n = (1 - Math.abs(2 * a - 1)) * e, r = n * (1 - Math.abs(t / 60 % 2 - 1)), s = a - n / 2;
|
|
152
|
-
let o,
|
|
153
|
-
return 0 <= t && t < 60 ? [o,
|
|
152
|
+
let o, c, i;
|
|
153
|
+
return 0 <= t && t < 60 ? [o, c, i] = [n, r, 0] : 60 <= t && t < 120 ? [o, c, i] = [r, n, 0] : 120 <= t && t < 180 ? [o, c, i] = [0, n, r] : 180 <= t && t < 240 ? [o, c, i] = [0, r, n] : 240 <= t && t < 300 ? [o, c, i] = [r, 0, n] : [o, c, i] = [n, 0, r], [
|
|
154
154
|
Math.round((o + s) * 255),
|
|
155
|
-
Math.round((
|
|
156
|
-
Math.round((
|
|
155
|
+
Math.round((c + s) * 255),
|
|
156
|
+
Math.round((i + s) * 255)
|
|
157
157
|
];
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Lt(t, e, a) {
|
|
160
160
|
t = (t % 360 + 360) % 360;
|
|
161
161
|
const n = e + a;
|
|
162
162
|
n > 1 && (e /= n, a /= n);
|
|
163
|
-
const [r, s, o] =
|
|
164
|
-
return [Math.round(
|
|
163
|
+
const [r, s, o] = ht(t, 1, 0.5).map((g) => g / 255), c = 1 - e - a, i = r * c + e, l = s * c + e, d = o * c + e;
|
|
164
|
+
return [Math.round(i * 255), Math.round(l * 255), Math.round(d * 255)];
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function nt(t, e, a) {
|
|
167
167
|
t /= 255, e /= 255, a /= 255;
|
|
168
168
|
const n = Math.max(t, e, a), r = Math.min(t, e, a);
|
|
169
169
|
let s = 0, o = 0;
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
172
|
-
switch (o =
|
|
170
|
+
const c = (n + r) / 2, i = n - r;
|
|
171
|
+
if (i !== 0) {
|
|
172
|
+
switch (o = c > 0.5 ? i / (2 - n - r) : i / (n + r), n) {
|
|
173
173
|
case t:
|
|
174
|
-
s = (e - a) /
|
|
174
|
+
s = (e - a) / i + (e < a ? 6 : 0);
|
|
175
175
|
break;
|
|
176
176
|
case e:
|
|
177
|
-
s = (a - t) /
|
|
177
|
+
s = (a - t) / i + 2;
|
|
178
178
|
break;
|
|
179
179
|
default:
|
|
180
|
-
s = (t - e) /
|
|
180
|
+
s = (t - e) / i + 4;
|
|
181
181
|
}
|
|
182
182
|
s *= 60;
|
|
183
183
|
}
|
|
184
|
-
return [Math.round(s), Math.round(o * 100), Math.round(
|
|
184
|
+
return [Math.round(s), Math.round(o * 100), Math.round(c * 100)];
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
const [n] =
|
|
188
|
-
return [n, Math.round(
|
|
186
|
+
function Ot(t, e, a) {
|
|
187
|
+
const [n] = nt(t, e, a), r = t / 255, s = e / 255, o = a / 255, c = Math.min(r, s, o), i = 1 - Math.max(r, s, o);
|
|
188
|
+
return [n, Math.round(c * 100), Math.round(i * 100)];
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function J(t) {
|
|
191
191
|
const e = t / 255;
|
|
192
192
|
return e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function Z(t) {
|
|
195
195
|
const e = t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 0.4166666666666667) - 0.055;
|
|
196
196
|
return Math.round(Math.max(0, Math.min(1, e)) * 255);
|
|
197
197
|
}
|
|
198
|
-
function
|
|
199
|
-
const n = a * Math.PI / 180, r = Math.cos(n) * e, s = Math.sin(n) * e, o = t + 0.3963377774 * r + 0.2158037573 * s,
|
|
200
|
-
return [
|
|
198
|
+
function Pt(t, e, a) {
|
|
199
|
+
const n = a * Math.PI / 180, r = Math.cos(n) * e, s = Math.sin(n) * e, o = t + 0.3963377774 * r + 0.2158037573 * s, c = t - 0.1055613458 * r - 0.0638541728 * s, i = t - 0.0894841775 * r - 1.291485548 * s, l = o * o * o, d = c * c * c, g = i * i * i, m = 4.0767416621 * l - 3.3077115913 * d + 0.2309699292 * g, h = -1.2684380046 * l + 2.6097574011 * d - 0.3413193965 * g, b = -0.0041960863 * l - 0.7034186147 * d + 1.707614701 * g;
|
|
200
|
+
return [Z(m), Z(h), Z(b)];
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
const n =
|
|
204
|
-
let
|
|
205
|
-
return
|
|
202
|
+
function Ut(t, e, a) {
|
|
203
|
+
const n = J(t), r = J(e), s = J(a), o = 0.4122214708 * n + 0.5363325363 * r + 0.0514459929 * s, c = 0.2119034982 * n + 0.6806995451 * r + 0.1073969566 * s, i = 0.0883024619 * n + 0.2817188376 * r + 0.6299787005 * s, l = Math.cbrt(o), d = Math.cbrt(c), g = Math.cbrt(i), m = 0.2104542553 * l + 0.793617785 * d - 0.0040720468 * g, h = 1.9779984951 * l - 2.428592205 * d + 0.4505937099 * g, b = 0.0259040371 * l + 0.7827717662 * d - 0.808675766 * g, M = Math.sqrt(h * h + b * b);
|
|
204
|
+
let $ = Math.atan2(b, h) * 180 / Math.PI;
|
|
205
|
+
return $ < 0 && ($ += 360), [m, M, $];
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function U(t, e, a, n, r, s) {
|
|
208
208
|
switch (r) {
|
|
209
209
|
case "hex":
|
|
210
210
|
if (s) {
|
|
211
|
-
const o = (
|
|
212
|
-
return `#${o(t)}${o(e)}${o(a)}${o(
|
|
211
|
+
const o = (i) => i.toString(16).padStart(2, "0"), c = Math.max(0, Math.min(255, Math.round(n * 255)));
|
|
212
|
+
return `#${o(t)}${o(e)}${o(a)}${o(c)}`;
|
|
213
213
|
}
|
|
214
|
-
return
|
|
214
|
+
return et(t, e, a);
|
|
215
215
|
case "rgb":
|
|
216
216
|
return `rgb(${t}, ${e}, ${a})`;
|
|
217
217
|
case "rgba":
|
|
218
218
|
return `rgba(${t}, ${e}, ${a}, ${Math.round(n * 100) / 100})`;
|
|
219
219
|
case "hsl": {
|
|
220
|
-
const [o,
|
|
221
|
-
return `hsl(${o}, ${
|
|
220
|
+
const [o, c, i] = nt(t, e, a);
|
|
221
|
+
return `hsl(${o}, ${c}%, ${i}%)`;
|
|
222
222
|
}
|
|
223
223
|
case "hsla": {
|
|
224
|
-
const [o,
|
|
225
|
-
return `hsla(${o}, ${
|
|
224
|
+
const [o, c, i] = nt(t, e, a);
|
|
225
|
+
return `hsla(${o}, ${c}%, ${i}%, ${Math.round(n * 100) / 100})`;
|
|
226
226
|
}
|
|
227
227
|
case "hwb": {
|
|
228
|
-
const [o,
|
|
229
|
-
return n < 1 ? `hwb(${o} ${
|
|
228
|
+
const [o, c, i] = Ot(t, e, a);
|
|
229
|
+
return n < 1 ? `hwb(${o} ${c}% ${i}% / ${Math.round(n * 100) / 100})` : `hwb(${o} ${c}% ${i}%)`;
|
|
230
230
|
}
|
|
231
231
|
case "oklch": {
|
|
232
|
-
const [o,
|
|
233
|
-
return s || n < 1 ? `oklch(${l} ${d} ${
|
|
232
|
+
const [o, c, i] = Ut(t, e, a), l = (Math.round(o * 1e3) / 1e3).toFixed(3), d = (Math.round(c * 1e3) / 1e3).toFixed(3), g = (Math.round(i * 10) / 10).toFixed(1), m = Math.round(n * 100) / 100;
|
|
233
|
+
return s || n < 1 ? `oklch(${l} ${d} ${g} / ${m})` : `oklch(${l} ${d} ${g})`;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function W(t, e) {
|
|
238
238
|
return e ? t === "rgb" ? "rgba" : t === "hsl" ? "hsla" : t : t === "rgba" ? "rgb" : t === "hsla" ? "hsl" : t;
|
|
239
239
|
}
|
|
240
|
-
async function
|
|
240
|
+
async function Wt(t) {
|
|
241
241
|
return new Promise((e, a) => {
|
|
242
242
|
const n = new FileReader();
|
|
243
243
|
n.readAsDataURL(t), n.onload = () => {
|
|
@@ -246,10 +246,10 @@ async function Et(t) {
|
|
|
246
246
|
}, n.onerror = (r) => a(r);
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
return Promise.all(t.map(
|
|
249
|
+
function Ht(t) {
|
|
250
|
+
return Promise.all(t.map(Wt));
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function zt(t) {
|
|
253
253
|
if (t.length >= 4) {
|
|
254
254
|
if (t[0] === 137 && t[1] === 80 && t[2] === 78 && t[3] === 71)
|
|
255
255
|
return "image/png";
|
|
@@ -265,45 +265,45 @@ function Lt(t) {
|
|
|
265
265
|
}
|
|
266
266
|
return "application/octet-stream";
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
const e =
|
|
268
|
+
function jt(t) {
|
|
269
|
+
const e = $t(t ?? ""), a = e.length, n = new Uint8Array(a);
|
|
270
270
|
for (let r = 0; r < a; r++) n[r] = e.charCodeAt(r);
|
|
271
271
|
return n;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function Xt(t) {
|
|
274
274
|
const {
|
|
275
275
|
value: e,
|
|
276
276
|
onChange: a,
|
|
277
277
|
onInput: n,
|
|
278
278
|
...r
|
|
279
|
-
} = t, s = /* @__PURE__ */ new Map(), o = p.toSignal(e).map((d) => d.map((
|
|
280
|
-
const
|
|
279
|
+
} = t, s = /* @__PURE__ */ new Map(), o = p.toSignal(e).map((d) => d.map((g, m) => {
|
|
280
|
+
const h = s.get(g), b = jt(g ?? ""), M = h?.type || zt(b), $ = h?.name ?? `file-${m}`, y = b.buffer.slice(
|
|
281
281
|
b.byteOffset,
|
|
282
282
|
b.byteOffset + b.byteLength
|
|
283
|
-
), F = new Blob([y], { type:
|
|
284
|
-
return new File([F],
|
|
285
|
-
})),
|
|
286
|
-
d &&
|
|
287
|
-
for (const [
|
|
288
|
-
s.set(b, { name:
|
|
283
|
+
), F = new Blob([y], { type: M });
|
|
284
|
+
return new File([F], $, { type: M });
|
|
285
|
+
})), c = (d) => (g) => {
|
|
286
|
+
d && Ht(g).then((m) => {
|
|
287
|
+
for (const [h, b] of m.entries())
|
|
288
|
+
s.set(b, { name: g[h].name, type: g[h].type });
|
|
289
289
|
d(m);
|
|
290
290
|
});
|
|
291
|
-
},
|
|
292
|
-
return
|
|
291
|
+
}, i = c(a), l = c(n);
|
|
292
|
+
return wt({
|
|
293
293
|
...r,
|
|
294
294
|
value: o,
|
|
295
|
-
onChange:
|
|
295
|
+
onChange: i,
|
|
296
296
|
onInput: l
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function he(t) {
|
|
300
300
|
const {
|
|
301
301
|
value: e,
|
|
302
302
|
onInput: a,
|
|
303
303
|
onChange: n,
|
|
304
304
|
...r
|
|
305
305
|
} = t;
|
|
306
|
-
return
|
|
306
|
+
return Xt({
|
|
307
307
|
...r,
|
|
308
308
|
maxFiles: 1,
|
|
309
309
|
value: p.map(e, (s) => s == null ? [] : [s]),
|
|
@@ -315,250 +315,263 @@ function ie(t) {
|
|
|
315
315
|
}
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
const [a, n, r] = t, s = a << 16 ^ n << 8 ^ r, o =
|
|
320
|
-
for (let
|
|
321
|
-
const b =
|
|
322
|
-
l.push({ x
|
|
318
|
+
function Yt(t, e) {
|
|
319
|
+
const [a, n, r] = t, s = a << 16 ^ n << 8 ^ r, o = Et(s), c = 6 + Math.floor(o() * 5), i = 0.18 + o() * 0.06, l = [];
|
|
320
|
+
for (let h = 0; h < c; h++) {
|
|
321
|
+
const b = h / c * Math.PI * 2, M = e * (1 + (o() * 2 - 1) * i), $ = Math.cos(b) * M, y = Math.sin(b) * M;
|
|
322
|
+
l.push({ x: $, y });
|
|
323
323
|
}
|
|
324
|
-
const d = (l[0].x + l[
|
|
325
|
-
let m = `M ${d.toFixed(3)} ${
|
|
326
|
-
for (let
|
|
327
|
-
const b = l[
|
|
328
|
-
m += ` Q ${b.x.toFixed(3)} ${b.y.toFixed(3)} ${
|
|
324
|
+
const d = (l[0].x + l[c - 1].x) / 2, g = (l[0].y + l[c - 1].y) / 2;
|
|
325
|
+
let m = `M ${d.toFixed(3)} ${g.toFixed(3)}`;
|
|
326
|
+
for (let h = 0; h < c; h++) {
|
|
327
|
+
const b = l[h], M = l[(h + 1) % c], $ = (b.x + M.x) / 2, y = (b.y + M.y) / 2;
|
|
328
|
+
m += ` Q ${b.x.toFixed(3)} ${b.y.toFixed(3)} ${$.toFixed(3)} ${y.toFixed(3)}`;
|
|
329
329
|
}
|
|
330
330
|
return m += " Z", m;
|
|
331
331
|
}
|
|
332
|
-
const
|
|
333
|
-
const {
|
|
332
|
+
const ge = (t) => {
|
|
333
|
+
const {
|
|
334
|
+
value: e,
|
|
335
|
+
onBlur: a,
|
|
336
|
+
onChange: n,
|
|
337
|
+
onInput: r,
|
|
338
|
+
displayValue: s,
|
|
339
|
+
swatchSize: o,
|
|
340
|
+
withAlpha: c
|
|
341
|
+
} = t, i = p.map(o ?? 32, (f) => f), l = p.map(e, (f) => Dt(f ?? "#000000")), d = p.map(
|
|
334
342
|
l,
|
|
335
|
-
([
|
|
336
|
-
),
|
|
343
|
+
([f, x, C]) => [f, x, C]
|
|
344
|
+
), g = p.map(l, ([, , , f]) => f), m = lt(p.get(g) ?? 1), h = p.map(c ?? !1, (f) => f), b = p.map(
|
|
337
345
|
t.colorTextFormat ?? "rgb",
|
|
338
|
-
(
|
|
339
|
-
),
|
|
346
|
+
(f) => f
|
|
347
|
+
), M = D(
|
|
340
348
|
d,
|
|
341
349
|
m,
|
|
342
350
|
b,
|
|
343
|
-
|
|
351
|
+
h
|
|
344
352
|
)(
|
|
345
|
-
([
|
|
346
|
-
),
|
|
353
|
+
([f, x, C], v, N, R) => U(f, x, C, v ?? 1, W(N, R), R)
|
|
354
|
+
), $ = p.map(
|
|
347
355
|
t.colorTextFormat ?? "hex",
|
|
348
|
-
(
|
|
349
|
-
), y = p.map(
|
|
356
|
+
(f) => f
|
|
357
|
+
), y = p.map(i, (f) => `${-f / 2} ${-f / 2} ${f} ${f}`), F = D(
|
|
350
358
|
d,
|
|
351
|
-
|
|
352
|
-
)((
|
|
359
|
+
i
|
|
360
|
+
)((f, x) => Yt(f, x / 2)), w = D(
|
|
353
361
|
d,
|
|
354
362
|
m,
|
|
355
|
-
|
|
363
|
+
h
|
|
356
364
|
)(
|
|
357
|
-
([
|
|
358
|
-
),
|
|
365
|
+
([f, x, C], v, N) => N || v < 1 ? Vt(f, x, C, v) : et(f, x, C)
|
|
366
|
+
), A = _.div(
|
|
359
367
|
u.class("bc-color-swatch-input__control"),
|
|
360
368
|
u.class(
|
|
361
369
|
p.map(
|
|
362
|
-
|
|
363
|
-
(
|
|
370
|
+
h,
|
|
371
|
+
(f) => f ? "bc-color-swatch-input__control--alpha" : ""
|
|
364
372
|
)
|
|
365
373
|
),
|
|
366
374
|
u.style(
|
|
367
|
-
D(
|
|
375
|
+
D(i)((f) => `min-width:${f + 2}px;height:${f + 2}px`)
|
|
368
376
|
),
|
|
369
377
|
// The SVG blob preview
|
|
370
|
-
|
|
378
|
+
rt.svg(
|
|
371
379
|
u.class("bc-color-swatch-input__svg"),
|
|
372
|
-
|
|
373
|
-
|
|
380
|
+
Q.viewBox(y),
|
|
381
|
+
rt.path(Q.d(F), Q.fill(w))
|
|
374
382
|
),
|
|
375
383
|
// Invisible native input overlays the blob for picker and accessibility
|
|
376
384
|
_.input(
|
|
377
385
|
u.type("color"),
|
|
378
|
-
|
|
386
|
+
O(t),
|
|
379
387
|
// Native color input needs hex without alpha
|
|
380
|
-
u.value(p.map(d, ([
|
|
388
|
+
u.value(p.map(d, ([f, x, C]) => et(f, x, C))),
|
|
381
389
|
u.class(
|
|
382
390
|
"bc-input bc-color-swatch-input bc-color-swatch-input__native"
|
|
383
391
|
),
|
|
384
|
-
a != null ?
|
|
385
|
-
n != null ?
|
|
386
|
-
const
|
|
392
|
+
a != null ? I.blur(a) : S,
|
|
393
|
+
n != null ? I.change((f) => {
|
|
394
|
+
const x = f.target.value;
|
|
387
395
|
if (!n) return;
|
|
388
|
-
const { r:
|
|
389
|
-
p.get(
|
|
390
|
-
p.get(
|
|
391
|
-
),
|
|
392
|
-
n(
|
|
393
|
-
}) :
|
|
394
|
-
r != null ?
|
|
395
|
-
const
|
|
396
|
+
const { r: C, g: v, b: N } = z(x) ?? { r: 0, g: 0, b: 0 }, R = p.get(m) ?? 1, V = W(
|
|
397
|
+
p.get($),
|
|
398
|
+
p.get(h)
|
|
399
|
+
), q = U(C, v, N, R, V, p.get(h));
|
|
400
|
+
n(q);
|
|
401
|
+
}) : S,
|
|
402
|
+
r != null ? I.input((f) => {
|
|
403
|
+
const x = f.target.value;
|
|
396
404
|
if (!r) return;
|
|
397
|
-
const { r:
|
|
398
|
-
p.get(
|
|
399
|
-
p.get(
|
|
400
|
-
),
|
|
401
|
-
r(
|
|
402
|
-
}) :
|
|
405
|
+
const { r: C, g: v, b: N } = z(x) ?? { r: 0, g: 0, b: 0 }, R = p.get(m) ?? 1, V = W(
|
|
406
|
+
p.get($),
|
|
407
|
+
p.get(h)
|
|
408
|
+
), q = U(C, v, N, R, V, p.get(h));
|
|
409
|
+
r(q);
|
|
410
|
+
}) : S
|
|
403
411
|
)
|
|
404
|
-
),
|
|
405
|
-
|
|
412
|
+
), T = H(
|
|
413
|
+
h,
|
|
406
414
|
() => _.input(
|
|
407
415
|
u.type("range"),
|
|
408
416
|
u.class("bc-color-swatch-input__alpha"),
|
|
409
417
|
u.min(0),
|
|
410
418
|
u.max(1),
|
|
411
419
|
u.step(0.01),
|
|
412
|
-
u.value(p.map(m, (
|
|
420
|
+
u.value(p.map(m, (f) => String(f ?? 1))),
|
|
413
421
|
u.disabled(t.disabled),
|
|
414
|
-
|
|
415
|
-
const
|
|
416
|
-
m.set(
|
|
417
|
-
const [
|
|
418
|
-
p.get(
|
|
419
|
-
p.get(
|
|
420
|
-
),
|
|
421
|
-
r?.(
|
|
422
|
+
I.input((f) => {
|
|
423
|
+
const x = parseFloat(f.target.value);
|
|
424
|
+
m.set(x);
|
|
425
|
+
const [C, v, N] = p.get(d), R = W(
|
|
426
|
+
p.get($),
|
|
427
|
+
p.get(h)
|
|
428
|
+
), V = U(C, v, N, x, R, p.get(h));
|
|
429
|
+
r?.(V);
|
|
422
430
|
}),
|
|
423
|
-
|
|
424
|
-
const
|
|
425
|
-
m.set(
|
|
426
|
-
const [
|
|
427
|
-
p.get(
|
|
428
|
-
p.get(
|
|
429
|
-
),
|
|
430
|
-
n?.(
|
|
431
|
+
I.change((f) => {
|
|
432
|
+
const x = parseFloat(f.target.value);
|
|
433
|
+
m.set(x);
|
|
434
|
+
const [C, v, N] = p.get(d), R = W(
|
|
435
|
+
p.get($),
|
|
436
|
+
p.get(h)
|
|
437
|
+
), V = U(C, v, N, x, R, p.get(h));
|
|
438
|
+
n?.(V);
|
|
431
439
|
})
|
|
432
440
|
)
|
|
433
|
-
)
|
|
434
|
-
|
|
441
|
+
), {
|
|
442
|
+
swatchSize: k,
|
|
443
|
+
displayValue: Y,
|
|
444
|
+
withAlpha: at,
|
|
445
|
+
colorTextFormat: G,
|
|
446
|
+
...K
|
|
447
|
+
} = t;
|
|
448
|
+
return L({
|
|
435
449
|
baseContainer: !0,
|
|
436
|
-
...
|
|
450
|
+
...K,
|
|
437
451
|
// ensure our control does not try to grow
|
|
438
452
|
growInput: !1,
|
|
439
|
-
input:
|
|
453
|
+
input: A,
|
|
440
454
|
// If caller provided an `after`, append RGB before it
|
|
441
455
|
after: j(
|
|
442
|
-
|
|
456
|
+
H(
|
|
443
457
|
s ?? !1,
|
|
444
|
-
() => _.span(u.class("bc-color-swatch-input__rgb"),
|
|
458
|
+
() => _.span(u.class("bc-color-swatch-input__rgb"), M)
|
|
445
459
|
),
|
|
446
|
-
|
|
460
|
+
T,
|
|
447
461
|
t.after
|
|
448
462
|
)
|
|
449
463
|
});
|
|
450
|
-
},
|
|
451
|
-
function
|
|
464
|
+
}, Gt = (t) => typeof t == "string" && t.trim() === "" ? null : t, Kt = (t) => t ?? "";
|
|
465
|
+
function P(t) {
|
|
452
466
|
return (e) => {
|
|
453
|
-
const {
|
|
467
|
+
const { after: a, disabled: n } = e, r = pt(e, Kt, Gt), s = X(
|
|
468
|
+
e.value,
|
|
469
|
+
n,
|
|
470
|
+
e.onChange ?? e.onInput
|
|
471
|
+
);
|
|
454
472
|
return t({
|
|
455
|
-
...
|
|
456
|
-
|
|
457
|
-
value: p.map(a, Ht),
|
|
458
|
-
onChange: r != null ? (d) => r(at(d)) : void 0,
|
|
459
|
-
onInput: s != null ? (d) => s(at(d)) : void 0,
|
|
460
|
-
onBlur: n,
|
|
461
|
-
after: o != null ? j(l, o) : l
|
|
473
|
+
...r,
|
|
474
|
+
after: a != null ? j(s, a) : s
|
|
462
475
|
});
|
|
463
476
|
};
|
|
464
477
|
}
|
|
465
|
-
const
|
|
478
|
+
const fe = ({
|
|
466
479
|
startEditing: t,
|
|
467
480
|
value: e,
|
|
468
481
|
onChange: a,
|
|
469
482
|
placeholder: n,
|
|
470
483
|
disabled: r
|
|
471
484
|
}) => {
|
|
472
|
-
const s = p.deriveProp(t ?? !1), o =
|
|
485
|
+
const s = p.deriveProp(t ?? !1), o = lt(!1), c = p.map(r ?? !1, (i) => i);
|
|
473
486
|
return _.div(
|
|
474
487
|
u.class("bc-editable-text"),
|
|
475
488
|
u.class(
|
|
476
489
|
p.map(
|
|
477
|
-
|
|
478
|
-
(
|
|
490
|
+
c,
|
|
491
|
+
(i) => i ? "bc-editable-text--disabled" : ""
|
|
479
492
|
)
|
|
480
493
|
),
|
|
481
|
-
|
|
482
|
-
|
|
494
|
+
B.disabled(c),
|
|
495
|
+
H(
|
|
483
496
|
s,
|
|
484
497
|
() => _.input(
|
|
485
498
|
u.placeholder(n),
|
|
486
499
|
u.value(e),
|
|
487
500
|
u.class("bc-editable-text__input"),
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
501
|
+
Ft(),
|
|
502
|
+
I.keydown((i) => {
|
|
503
|
+
i.key === "Enter" ? s.set(!1) : i.key === "Escape" && (o.set(!0), s.set(!1));
|
|
491
504
|
}),
|
|
492
|
-
|
|
493
|
-
|
|
505
|
+
I.blur(
|
|
506
|
+
st((i) => {
|
|
494
507
|
if (s.set(!1), o.value) {
|
|
495
508
|
o.set(!1);
|
|
496
509
|
return;
|
|
497
510
|
}
|
|
498
|
-
a(
|
|
511
|
+
a(i);
|
|
499
512
|
})
|
|
500
513
|
)
|
|
501
514
|
),
|
|
502
515
|
() => _.span(
|
|
503
|
-
|
|
504
|
-
p.get(
|
|
516
|
+
I.click(() => {
|
|
517
|
+
p.get(c) || s.set(!0);
|
|
505
518
|
}),
|
|
506
519
|
u.class("bc-editable-text__display"),
|
|
507
|
-
|
|
508
|
-
p.map(e, (
|
|
520
|
+
H(
|
|
521
|
+
p.map(e, (i) => i != null && i.trim() !== ""),
|
|
509
522
|
() => _.span(u.class("bc-editable-text__text"), e),
|
|
510
523
|
() => _.span(
|
|
511
524
|
u.class("bc-editable-text__placeholder"),
|
|
512
525
|
n
|
|
513
526
|
)
|
|
514
527
|
),
|
|
515
|
-
|
|
516
|
-
p.map(
|
|
528
|
+
H(
|
|
529
|
+
p.map(c, (i) => !i),
|
|
517
530
|
() => _.button(
|
|
518
531
|
u.type("button"),
|
|
519
532
|
u.class("bc-editable-text__edit-button"),
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
533
|
+
gt(_t, (i) => B.label(i.$.editLabel)),
|
|
534
|
+
I.click(() => s.set(!0)),
|
|
535
|
+
tt({ icon: "line-md/pencil", color: "neutral" })
|
|
523
536
|
)
|
|
524
537
|
)
|
|
525
538
|
)
|
|
526
539
|
)
|
|
527
540
|
);
|
|
528
|
-
},
|
|
529
|
-
const { value: e, onBlur: a, onChange: n, onInput: r, after: s, disabled: o } = t,
|
|
530
|
-
return
|
|
541
|
+
}, me = (t) => {
|
|
542
|
+
const { value: e, onBlur: a, onChange: n, onInput: r, after: s, disabled: o } = t, c = X(e, o, n ?? r);
|
|
543
|
+
return L({
|
|
531
544
|
...t,
|
|
532
|
-
input:
|
|
533
|
-
|
|
545
|
+
input: ut.date(
|
|
546
|
+
O(t),
|
|
534
547
|
u.valueAsDate(e),
|
|
535
548
|
u.class("bc-input"),
|
|
536
|
-
a != null ?
|
|
537
|
-
n != null ?
|
|
538
|
-
r != null ?
|
|
549
|
+
a != null ? I.blur(st(a)) : S,
|
|
550
|
+
n != null ? I.change(ot(n)) : S,
|
|
551
|
+
r != null ? I.input(ot(r)) : S
|
|
539
552
|
),
|
|
540
|
-
after: s != null ? j(
|
|
553
|
+
after: s != null ? j(c, s) : c
|
|
541
554
|
});
|
|
542
|
-
},
|
|
555
|
+
}, qt = (t) => {
|
|
543
556
|
const e = t.getFullYear(), a = t.getMonth() + 1, n = t.getDate(), r = t.getHours(), s = t.getMinutes(), o = t.getSeconds();
|
|
544
557
|
return `${e}-${a.toString().padStart(2, "0")}-${n.toString().padStart(2, "0")}T${r.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}`;
|
|
545
|
-
},
|
|
546
|
-
const { value: e, onBlur: a, onChange: n, onInput: r, after: s, disabled: o } = t,
|
|
547
|
-
return
|
|
558
|
+
}, be = (t) => {
|
|
559
|
+
const { value: e, onBlur: a, onChange: n, onInput: r, after: s, disabled: o } = t, c = p.map(e, (l) => l != null ? qt(l) : null), i = X(e, o, n ?? r);
|
|
560
|
+
return L({
|
|
548
561
|
...t,
|
|
549
|
-
input:
|
|
550
|
-
|
|
551
|
-
u.value(p.map(
|
|
562
|
+
input: ut["datetime-local"](
|
|
563
|
+
O(t),
|
|
564
|
+
u.value(p.map(c, (l) => l ?? null)),
|
|
552
565
|
u.class("bc-input"),
|
|
553
|
-
a != null ?
|
|
554
|
-
n != null ?
|
|
555
|
-
r != null ?
|
|
566
|
+
a != null ? I.blur(st(a)) : S,
|
|
567
|
+
n != null ? I.change(ct(n)) : S,
|
|
568
|
+
r != null ? I.input(ct(r)) : S
|
|
556
569
|
),
|
|
557
|
-
after: s != null ? j(
|
|
570
|
+
after: s != null ? j(i, s) : i
|
|
558
571
|
});
|
|
559
|
-
},
|
|
560
|
-
|
|
561
|
-
),
|
|
572
|
+
}, we = P(Ct), ye = P(xt), Me = P(Tt), Ie = P(
|
|
573
|
+
yt
|
|
574
|
+
), $e = ({
|
|
562
575
|
value: t,
|
|
563
576
|
onChange: e,
|
|
564
577
|
onInput: a,
|
|
@@ -566,40 +579,40 @@ const le = ({
|
|
|
566
579
|
offLabel: r,
|
|
567
580
|
onLabel: s,
|
|
568
581
|
disabled: o = !1,
|
|
569
|
-
size:
|
|
570
|
-
id:
|
|
582
|
+
size: c = "md",
|
|
583
|
+
id: i,
|
|
571
584
|
color: l = "primary",
|
|
572
585
|
tabIndex: d = 0,
|
|
573
|
-
matchInputHeight:
|
|
586
|
+
matchInputHeight: g = !0
|
|
574
587
|
}) => {
|
|
575
|
-
const m =
|
|
576
|
-
function
|
|
588
|
+
const m = i ?? St("switch");
|
|
589
|
+
function h(y, F) {
|
|
577
590
|
const w = [
|
|
578
591
|
"bc-switch",
|
|
579
592
|
`bc-switch--size-${F}`,
|
|
580
593
|
`bc-switch--${F}`
|
|
581
594
|
];
|
|
582
|
-
return
|
|
595
|
+
return g && w.push("bc-switch--match-input"), y && w.push("bc-switch--disabled"), w.join(" ");
|
|
583
596
|
}
|
|
584
597
|
function b(y) {
|
|
585
|
-
const F = y ?? "primary", w = /* @__PURE__ */ new Map(),
|
|
586
|
-
return w.set("--switch-track-on-bg",
|
|
598
|
+
const F = y ?? "primary", w = /* @__PURE__ */ new Map(), A = it(F, "solid", "light"), T = it(F, "solid", "dark");
|
|
599
|
+
return w.set("--switch-track-on-bg", A.backgroundColor), w.set("--switch-track-on-label", A.textColor), w.set("--switch-track-on-bg-dark", T.backgroundColor), w.set("--switch-track-on-label-dark", T.textColor), w.set(
|
|
587
600
|
"--switch-track-on-border-dark",
|
|
588
|
-
|
|
589
|
-
), Array.from(w.entries()).map(([
|
|
601
|
+
kt(F, "dark")
|
|
602
|
+
), Array.from(w.entries()).map(([k, Y]) => `${k}: ${Y}`).join("; ");
|
|
590
603
|
}
|
|
591
|
-
const
|
|
604
|
+
const M = () => {
|
|
592
605
|
p.get(o) || (e?.(!p.get(t)), a?.(!p.get(t)));
|
|
593
|
-
},
|
|
594
|
-
p.get(o) || (y.key === " " || y.key === "Enter") && (y.preventDefault(),
|
|
606
|
+
}, $ = (y) => {
|
|
607
|
+
p.get(o) || (y.key === " " || y.key === "Enter") && (y.preventDefault(), M());
|
|
595
608
|
};
|
|
596
609
|
return _.div(
|
|
597
610
|
u.class(
|
|
598
611
|
D(
|
|
599
612
|
o ?? !1,
|
|
600
|
-
|
|
613
|
+
c
|
|
601
614
|
)(
|
|
602
|
-
(y, F) =>
|
|
615
|
+
(y, F) => h(y ?? !1, F ?? "md")
|
|
603
616
|
)
|
|
604
617
|
),
|
|
605
618
|
u.style(
|
|
@@ -615,11 +628,11 @@ const le = ({
|
|
|
615
628
|
d
|
|
616
629
|
)((y, F) => y ? -1 : F ?? 0)
|
|
617
630
|
),
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
n != null ?
|
|
631
|
+
B.checked(t),
|
|
632
|
+
B.disabled(o),
|
|
633
|
+
I.click(M),
|
|
634
|
+
I.keydown($),
|
|
635
|
+
n != null ? I.blur(n) : null,
|
|
623
636
|
_.div(
|
|
624
637
|
u.class("bc-switch__track"),
|
|
625
638
|
u.class(
|
|
@@ -629,7 +642,7 @@ const le = ({
|
|
|
629
642
|
)
|
|
630
643
|
),
|
|
631
644
|
r != null ? _.div(
|
|
632
|
-
|
|
645
|
+
B.hidden(!0),
|
|
633
646
|
u.class("bc-switch__track-label bc-switch__track-label--off"),
|
|
634
647
|
u.class(
|
|
635
648
|
p.map(
|
|
@@ -660,7 +673,7 @@ const le = ({
|
|
|
660
673
|
)
|
|
661
674
|
)
|
|
662
675
|
);
|
|
663
|
-
},
|
|
676
|
+
}, xe = P(Mt), Qt = "line-md:star-alt-filled", Jt = "line-md:star-alt", Zt = (t) => {
|
|
664
677
|
const {
|
|
665
678
|
value: e,
|
|
666
679
|
onChange: a,
|
|
@@ -668,50 +681,50 @@ const le = ({
|
|
|
668
681
|
disabled: r,
|
|
669
682
|
max: s = 5,
|
|
670
683
|
fullColor: o = "yellow",
|
|
671
|
-
emptyColor:
|
|
672
|
-
|
|
673
|
-
|
|
684
|
+
emptyColor: c = "neutral",
|
|
685
|
+
activeIcon: i = Qt,
|
|
686
|
+
inactiveIcon: l = Jt,
|
|
674
687
|
size: d = "md",
|
|
675
|
-
onBlur:
|
|
688
|
+
onBlur: g,
|
|
676
689
|
rounding: m = 1
|
|
677
|
-
} = t,
|
|
690
|
+
} = t, h = () => {
|
|
678
691
|
const w = p.get(m);
|
|
679
692
|
return w > 0 ? w : 1;
|
|
680
|
-
}, b = (w) => Math.min(Math.max(w, 0), p.get(s)),
|
|
693
|
+
}, b = (w) => Math.min(Math.max(w, 0), p.get(s)), M = (w, A) => {
|
|
681
694
|
if (p.get(r ?? !1)) return;
|
|
682
|
-
const
|
|
683
|
-
a?.(
|
|
684
|
-
},
|
|
695
|
+
const k = w.currentTarget.getBoundingClientRect(), Y = (w.clientX - k.left) / k.width, at = A - 1 + Y, G = h(), K = Math.ceil(at / G) * G, f = b(K);
|
|
696
|
+
a?.(f), n?.(f);
|
|
697
|
+
}, $ = (w) => {
|
|
685
698
|
if (p.get(r ?? !1)) return;
|
|
686
|
-
const
|
|
687
|
-
let
|
|
699
|
+
const A = h(), T = p.get(e) ?? 0;
|
|
700
|
+
let k;
|
|
688
701
|
switch (w.key) {
|
|
689
702
|
case "ArrowRight":
|
|
690
703
|
case "ArrowUp":
|
|
691
|
-
|
|
704
|
+
k = b(T + A);
|
|
692
705
|
break;
|
|
693
706
|
case "ArrowLeft":
|
|
694
707
|
case "ArrowDown":
|
|
695
|
-
|
|
708
|
+
k = b(T - A);
|
|
696
709
|
break;
|
|
697
710
|
case "Home":
|
|
698
|
-
|
|
711
|
+
k = 0;
|
|
699
712
|
break;
|
|
700
713
|
case "End":
|
|
701
|
-
|
|
714
|
+
k = p.get(s);
|
|
702
715
|
break;
|
|
703
716
|
default:
|
|
704
717
|
return;
|
|
705
718
|
}
|
|
706
|
-
w.preventDefault(), a?.(
|
|
707
|
-
}, y = p.map(d, (w) => `bc-icon--${w}`), F = ({ index: w, counter:
|
|
719
|
+
w.preventDefault(), a?.(k), n?.(k);
|
|
720
|
+
}, y = p.map(d, (w) => `bc-icon--${w}`), F = ({ index: w, counter: A }) => _.span(
|
|
708
721
|
u.class("bc-rating-input__icon-container"),
|
|
709
722
|
u.class(y),
|
|
710
|
-
|
|
723
|
+
tt(
|
|
711
724
|
{
|
|
712
725
|
icon: l,
|
|
713
726
|
size: d,
|
|
714
|
-
color:
|
|
727
|
+
color: c,
|
|
715
728
|
tone: "soft"
|
|
716
729
|
},
|
|
717
730
|
u.class("bc-rating-input__icon-empty")
|
|
@@ -719,15 +732,15 @@ const le = ({
|
|
|
719
732
|
_.span(
|
|
720
733
|
u.class("bc-rating-input__icon-clipper"),
|
|
721
734
|
u.class(y),
|
|
722
|
-
|
|
723
|
-
p.map(e, (
|
|
724
|
-
const
|
|
725
|
-
return
|
|
735
|
+
mt.width(
|
|
736
|
+
p.map(e, (T) => {
|
|
737
|
+
const k = Math.floor(T);
|
|
738
|
+
return k > w ? "100%" : k < w ? "0%" : `${(T - w) * 100}%`;
|
|
726
739
|
})
|
|
727
740
|
),
|
|
728
|
-
|
|
741
|
+
tt(
|
|
729
742
|
{
|
|
730
|
-
icon:
|
|
743
|
+
icon: i,
|
|
731
744
|
size: d,
|
|
732
745
|
color: o,
|
|
733
746
|
tone: "soft"
|
|
@@ -735,113 +748,115 @@ const le = ({
|
|
|
735
748
|
u.class("bc-rating-input__icon-full")
|
|
736
749
|
)
|
|
737
750
|
),
|
|
738
|
-
|
|
739
|
-
|
|
751
|
+
I.click(
|
|
752
|
+
bt((T) => M(T, A), {
|
|
740
753
|
preventDefault: !0,
|
|
741
754
|
stopPropagation: !0
|
|
742
755
|
})
|
|
743
756
|
)
|
|
744
757
|
);
|
|
745
|
-
return
|
|
758
|
+
return L({
|
|
746
759
|
baseContainer: !0,
|
|
747
760
|
growInput: !1,
|
|
748
761
|
focusableSelector: '[role="slider"]',
|
|
749
762
|
...t,
|
|
750
763
|
input: _.div(
|
|
751
764
|
// Common input attributes (id, required, invalid, custom classes, etc.)
|
|
752
|
-
|
|
765
|
+
O(t),
|
|
753
766
|
u.class("bc-rating-input"),
|
|
754
767
|
// ARIA slider semantics
|
|
755
768
|
u.role("slider"),
|
|
756
769
|
u.tabindex(p.map(r ?? !1, (w) => w ? -1 : 0)),
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
770
|
+
B.disabled(r ?? !1),
|
|
771
|
+
B.valuemin(0),
|
|
772
|
+
B.valuemax(p.map(s, (w) => w ?? 0)),
|
|
773
|
+
B.valuenow(p.map(e, (w) => w ?? 0)),
|
|
774
|
+
B.valuetext(
|
|
762
775
|
D(
|
|
763
776
|
e,
|
|
764
777
|
s
|
|
765
|
-
)((w,
|
|
766
|
-
const
|
|
767
|
-
return `${String(
|
|
778
|
+
)((w, A) => {
|
|
779
|
+
const T = w ?? 0, k = A ?? 0;
|
|
780
|
+
return `${String(T)} / ${String(k)}`;
|
|
768
781
|
})
|
|
769
782
|
),
|
|
770
783
|
// Keyboard & focus handlers
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
784
|
+
I.keydown($),
|
|
785
|
+
g != null ? I.blur(g) : null,
|
|
786
|
+
ft(s, F)
|
|
774
787
|
)
|
|
775
788
|
});
|
|
776
|
-
},
|
|
777
|
-
const {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
onInput
|
|
785
|
-
|
|
786
|
-
|
|
789
|
+
}, _e = (t) => {
|
|
790
|
+
const { after: e, disabled: a } = t, n = pt(
|
|
791
|
+
t,
|
|
792
|
+
(s) => s ?? 0,
|
|
793
|
+
(s) => s
|
|
794
|
+
), r = X(
|
|
795
|
+
t.value,
|
|
796
|
+
a,
|
|
797
|
+
t.onChange ?? t.onInput
|
|
798
|
+
);
|
|
799
|
+
return Zt({
|
|
800
|
+
...n,
|
|
801
|
+
after: e != null ? j(r, e) : r
|
|
787
802
|
});
|
|
788
|
-
},
|
|
789
|
-
const { value: e, step: a, min: n, max: r, onBlur: s, onChange: o, onInput:
|
|
790
|
-
return
|
|
803
|
+
}, ke = (t) => {
|
|
804
|
+
const { value: e, step: a, min: n, max: r, onBlur: s, onChange: o, onInput: c } = t;
|
|
805
|
+
return L({
|
|
791
806
|
...t,
|
|
792
807
|
// Make sure clicks anywhere focus the range input
|
|
793
808
|
focusableSelector: 'input[type="range"]',
|
|
794
809
|
input: _.input(
|
|
795
810
|
u.type("range"),
|
|
796
|
-
|
|
811
|
+
O(t),
|
|
797
812
|
u.min(n),
|
|
798
813
|
u.max(r),
|
|
799
814
|
u.step(a),
|
|
800
815
|
// Using value as number to keep it in sync
|
|
801
816
|
u.valueAsNumber(e),
|
|
802
817
|
u.class("bc-input bc-slider-input"),
|
|
803
|
-
s != null ?
|
|
804
|
-
o != null ?
|
|
805
|
-
|
|
818
|
+
s != null ? I.blur(E(s)) : S,
|
|
819
|
+
o != null ? I.change(E(o)) : S,
|
|
820
|
+
c != null ? I.input(E(c)) : S
|
|
806
821
|
)
|
|
807
822
|
});
|
|
808
|
-
},
|
|
809
|
-
const { value: e, step: a, min: n, max: r, onBlur: s, onChange: o, onInput:
|
|
823
|
+
}, Fe = (t) => {
|
|
824
|
+
const { value: e, step: a, min: n, max: r, onBlur: s, onChange: o, onInput: c } = t, i = p.map(e, (d) => {
|
|
810
825
|
if (d != null) return d;
|
|
811
|
-
const
|
|
812
|
-
return typeof
|
|
813
|
-
}), l =
|
|
826
|
+
const g = n != null ? p.get(n) : void 0;
|
|
827
|
+
return typeof g == "number" ? g : 0;
|
|
828
|
+
}), l = X(
|
|
814
829
|
e,
|
|
815
830
|
t.disabled,
|
|
816
|
-
o ??
|
|
831
|
+
o ?? c
|
|
817
832
|
);
|
|
818
|
-
return
|
|
833
|
+
return L({
|
|
819
834
|
...t,
|
|
820
835
|
focusableSelector: 'input[type="range"]',
|
|
821
836
|
after: l,
|
|
822
837
|
input: _.input(
|
|
823
838
|
u.type("range"),
|
|
824
|
-
|
|
839
|
+
O(t),
|
|
825
840
|
u.min(n),
|
|
826
841
|
u.max(r),
|
|
827
842
|
u.step(a),
|
|
828
|
-
u.valueAsNumber(
|
|
843
|
+
u.valueAsNumber(i),
|
|
829
844
|
u.class("bc-input bc-slider-input"),
|
|
830
|
-
s != null ?
|
|
831
|
-
o != null ?
|
|
832
|
-
|
|
845
|
+
s != null ? I.blur(E(s)) : S,
|
|
846
|
+
o != null ? I.change(
|
|
847
|
+
E((d) => {
|
|
833
848
|
o(d);
|
|
834
849
|
})
|
|
835
|
-
) :
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
850
|
+
) : S,
|
|
851
|
+
c != null ? I.input(
|
|
852
|
+
E((d) => {
|
|
853
|
+
c(d);
|
|
839
854
|
})
|
|
840
|
-
) :
|
|
855
|
+
) : S
|
|
841
856
|
)
|
|
842
857
|
});
|
|
843
|
-
},
|
|
844
|
-
class
|
|
858
|
+
}, Ce = P(It);
|
|
859
|
+
class te {
|
|
845
860
|
widgets = /* @__PURE__ */ new Map();
|
|
846
861
|
typeMapping = /* @__PURE__ */ new Map();
|
|
847
862
|
// JSON Schema type -> widget names
|
|
@@ -892,7 +907,7 @@ class Gt {
|
|
|
892
907
|
* Find the best widget for a schema context
|
|
893
908
|
*/
|
|
894
909
|
findBestWidget(e) {
|
|
895
|
-
const a =
|
|
910
|
+
const a = At(e.definition, e.name);
|
|
896
911
|
if (a?.widget) {
|
|
897
912
|
const r = this.widgets.get(a.widget);
|
|
898
913
|
if (r)
|
|
@@ -933,8 +948,8 @@ class Gt {
|
|
|
933
948
|
return null;
|
|
934
949
|
}
|
|
935
950
|
}
|
|
936
|
-
const
|
|
937
|
-
function
|
|
951
|
+
const Te = new te();
|
|
952
|
+
function Se(t, e, a) {
|
|
938
953
|
return {
|
|
939
954
|
factory: e,
|
|
940
955
|
matcher: (n) => {
|
|
@@ -947,7 +962,7 @@ function xe(t, e, a) {
|
|
|
947
962
|
...a
|
|
948
963
|
};
|
|
949
964
|
}
|
|
950
|
-
function
|
|
965
|
+
function Ae(t, e, a) {
|
|
951
966
|
return {
|
|
952
967
|
factory: e,
|
|
953
968
|
matcher: (n) => n.definition.format === t,
|
|
@@ -956,7 +971,7 @@ function _e(t, e, a) {
|
|
|
956
971
|
...a
|
|
957
972
|
};
|
|
958
973
|
}
|
|
959
|
-
function
|
|
974
|
+
function ve(t, e, a, n) {
|
|
960
975
|
return {
|
|
961
976
|
factory: a,
|
|
962
977
|
matcher: (r) => {
|
|
@@ -968,7 +983,7 @@ function ke(t, e, a, n) {
|
|
|
968
983
|
...n
|
|
969
984
|
};
|
|
970
985
|
}
|
|
971
|
-
function
|
|
986
|
+
function Ne(t) {
|
|
972
987
|
const e = t?.logPrefix ?? "WIDGET_DIAG", a = t?.filterFn ?? (() => !0);
|
|
973
988
|
return {
|
|
974
989
|
factory: () => null,
|
|
@@ -991,52 +1006,52 @@ function Fe(t) {
|
|
|
991
1006
|
};
|
|
992
1007
|
}
|
|
993
1008
|
export {
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1009
|
+
Lt as A,
|
|
1010
|
+
he as B,
|
|
1011
|
+
ge as C,
|
|
1012
|
+
Rt as D,
|
|
1013
|
+
fe as E,
|
|
1014
|
+
vt as F,
|
|
1015
|
+
Nt as G,
|
|
1016
|
+
Z as H,
|
|
1017
|
+
Et as I,
|
|
1018
|
+
Pt as J,
|
|
1019
|
+
Dt as K,
|
|
1020
|
+
W as L,
|
|
1021
|
+
et as M,
|
|
1022
|
+
ye as N,
|
|
1023
|
+
nt as O,
|
|
1024
|
+
Ot as P,
|
|
1025
|
+
Ut as Q,
|
|
1026
|
+
Zt as R,
|
|
1027
|
+
ke as S,
|
|
1028
|
+
J as T,
|
|
1029
|
+
Vt as U,
|
|
1030
|
+
te as W,
|
|
1031
|
+
Ie as a,
|
|
1032
|
+
xe as b,
|
|
1033
|
+
Ce as c,
|
|
1034
|
+
Me as d,
|
|
1035
|
+
be as e,
|
|
1036
|
+
me as f,
|
|
1037
|
+
Te as g,
|
|
1038
|
+
we as h,
|
|
1039
|
+
Fe as i,
|
|
1040
|
+
_e as j,
|
|
1041
|
+
$e as k,
|
|
1042
|
+
Ne as l,
|
|
1043
|
+
Ae as m,
|
|
1044
|
+
ve as n,
|
|
1045
|
+
Se as o,
|
|
1046
|
+
Gt as p,
|
|
1047
|
+
Kt as q,
|
|
1048
|
+
pe as r,
|
|
1049
|
+
dt as s,
|
|
1050
|
+
Bt as t,
|
|
1051
|
+
Xt as u,
|
|
1052
|
+
Wt as v,
|
|
1053
|
+
U as w,
|
|
1054
|
+
de as x,
|
|
1055
|
+
z as y,
|
|
1056
|
+
ht as z
|
|
1042
1057
|
};
|