@alfadocs/ui-kit 0.31.0 → 0.31.2
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/_chunks/{accordion-CNcodXuO.js → accordion-bSU21uTV.js} +3 -3
- package/dist/_chunks/{agenda-card-DO9_yogb.js → agenda-card-UJA6Arbs.js} +3 -3
- package/dist/_chunks/{agenda-tray-WLbfMip6.js → agenda-tray-1fAxNOMz.js} +4 -4
- package/dist/_chunks/{ai-prompt-input-BXlwNnWe.js → ai-prompt-input-C6sCr1Vi.js} +11 -10
- package/dist/_chunks/{alia-sidebar-C-232sD7.js → alia-sidebar-BEoMl6UL.js} +9 -9
- package/dist/_chunks/ar-CEpIJtcO.js +399 -0
- package/dist/_chunks/{audio-recorder-DL800PE_.js → audio-recorder-C1rhKhSN.js} +114 -114
- package/dist/_chunks/audio-visualiser-l6zPd0AG.js +162 -0
- package/dist/_chunks/{autocomplete-CUh0f7Dj.js → autocomplete-DIgdhCGJ.js} +2 -2
- package/dist/_chunks/{avatar-D_H4emLo.js → avatar-BNQNhoyL.js} +19 -18
- package/dist/_chunks/{badge-CIjQ1Us1.js → badge-CptERaHx.js} +2 -2
- package/dist/_chunks/{booking-Bhk9IYm3.js → booking-BIZ9GSer.js} +15 -15
- package/dist/_chunks/{breadcrumb--YI7lcHA.js → breadcrumb-CLlhx7qo.js} +2 -2
- package/dist/_chunks/{button-group-Bh2g_Ng-.js → button-group-Ciq6J4IW.js} +15 -14
- package/dist/_chunks/{calendar-WWNx448i.js → calendar-YHFknAGv.js} +22 -22
- package/dist/_chunks/{carousel.agent-C2Icc9_T.js → carousel.agent-DrX96W-1.js} +2 -2
- package/dist/_chunks/{chart-BLvFl169.js → chart-DLkVn_ex.js} +2 -2
- package/dist/_chunks/{chat-container-izziXViv.js → chat-container-ogB4OskO.js} +24 -23
- package/dist/_chunks/{chat-input-cyl_y9bh.js → chat-input-CQe7nR_v.js} +132 -118
- package/dist/_chunks/{chat-message-fg221-yx.js → chat-message-D53_fH2w.js} +2 -2
- package/dist/_chunks/{checkbox-Dgp_cfUr.js → checkbox-DRcOdmXv.js} +3 -3
- package/dist/_chunks/{checkbox-group-eVowqKcT.js → checkbox-group-CpUwlHug.js} +3 -3
- package/dist/_chunks/{collapsible-hHiyZp0b.js → collapsible-CERONory.js} +2 -2
- package/dist/_chunks/{color-picker-Bm-gzpsh.js → color-picker-9tL7pz5y.js} +192 -181
- package/dist/_chunks/{combobox-Da9eq00i.js → combobox-BC-DFx8G.js} +31 -30
- package/dist/_chunks/{command-palette-11BieSNq.js → command-palette-BiPAAno-.js} +125 -123
- package/dist/_chunks/{copy-field-BAF4mt9h.js → copy-field-CCq7j6Zc.js} +2 -2
- package/dist/_chunks/{date-picker-D0Ry1dMz.js → date-picker-B94HAV4A.js} +4 -4
- package/dist/_chunks/{date-range-picker-DYgHzMOo.js → date-range-picker-D4dgDlLU.js} +73 -73
- package/dist/_chunks/{date-time-picker-CGmGtcyc.js → date-time-picker-D1GEzf8p.js} +5 -5
- package/dist/_chunks/de-Dfbeau59.js +477 -0
- package/dist/_chunks/{description-list-CWjnaDGn.js → description-list-BEbK2g93.js} +2 -2
- package/dist/_chunks/{dialog-C-lTGVkB.js → dialog-Cee13rHU.js} +3 -3
- package/dist/_chunks/{dropdown-menu-DZxwF23X.js → dropdown-menu-BC5ZdOMo.js} +3 -3
- package/dist/_chunks/{editable-currency-cell-renderer-Od3Q-Y8J.js → editable-currency-cell-renderer-BpicmolK.js} +314 -317
- package/dist/_chunks/el-Dro3J7CP.js +373 -0
- package/dist/_chunks/{email-input-DvJ_kPKL.js → email-input-lQivsFrw.js} +3 -3
- package/dist/_chunks/es-Dvg8u70B.js +373 -0
- package/dist/_chunks/{file-upload-DxAQprcU.js → file-upload-CdozCPct.js} +226 -233
- package/dist/_chunks/fr-VOGjBSPP.js +338 -0
- package/dist/_chunks/{freemium-paywall-B9c8Ylww.js → freemium-paywall-D1N02Oam.js} +4 -4
- package/dist/_chunks/{header-DDj7uGD-.js → header-CTZWX-tm.js} +2 -2
- package/dist/_chunks/hi-BSDxWU_y.js +433 -0
- package/dist/_chunks/{icon-button-DPEqBKBQ.js → icon-button-CKEOrN37.js} +2 -2
- package/dist/_chunks/{icon-button-group-DeV3FpNY.js → icon-button-group-C48khLE0.js} +23 -22
- package/dist/_chunks/{isSameDay-DHG8Xade.js → isSameDay-DUEiAT0G.js} +2 -2
- package/dist/_chunks/isSameWeek-Dfzu29cW.js +14 -0
- package/dist/_chunks/it-CuonvcI_.js +401 -0
- package/dist/_chunks/ja-DO57gIOT.js +366 -0
- package/dist/_chunks/{key-value-pair-BvDY3zuc.js → key-value-pair-C8DaR3Xs.js} +2 -2
- package/dist/_chunks/{list-BdvDctBz.js → list-BOwqwy03.js} +44 -43
- package/dist/_chunks/{locale-picker-CY89MChR.js → locale-picker-D99UyZVJ.js} +4 -4
- package/dist/_chunks/{map-view-DyB8tr6c.js → map-view-WEWqXzof.js} +569 -557
- package/dist/_chunks/{message-card-D6iyPacd.js → message-card-BbRhZkDI.js} +3 -3
- package/dist/_chunks/{message-tray-Bh-0ra-Y.js → message-tray-B762TKuv.js} +11 -10
- package/dist/_chunks/{multi-select-dSe6Xtc4.js → multi-select-DOLO3K_z.js} +26 -25
- package/dist/_chunks/{navigation-menu-CyS1fBJ7.js → navigation-menu-C6lBYVv9.js} +3 -3
- package/dist/_chunks/nl-DjPaaWaW.js +326 -0
- package/dist/_chunks/{notification-card-vaMaA7Wa.js → notification-card-DMdO4g54.js} +2 -2
- package/dist/_chunks/{notification-tray-Cnum6LwM.js → notification-tray-Dl3FTleW.js} +17 -16
- package/dist/_chunks/{number-input-BZXu6bPY.js → number-input-Dj5L3pXK.js} +2 -2
- package/dist/_chunks/{otp-input-BDF_iNpa.js → otp-input-BEg_sn8A.js} +2 -2
- package/dist/_chunks/{pagination-BWaXF7W0.js → pagination-DQOgnxxw.js} +2 -2
- package/dist/_chunks/{parseISO-Dk4xa7q6.js → parseISO-DEpUNwxZ.js} +2 -2
- package/dist/_chunks/{patient-search-ZpHN-pgJ.js → patient-search-hFiYbqcl.js} +8 -8
- package/dist/_chunks/{patient-shell-CYaNkbA1.js → patient-shell-CDvMw_Nk.js} +6 -6
- package/dist/_chunks/{payment-form-Ds3rxvad.js → payment-form-D5rgnZu7.js} +2 -2
- package/dist/_chunks/{pdf-viewer-CIuaocnq.js → pdf-viewer-DvtEHcEP.js} +347 -320
- package/dist/_chunks/{phone-input-DKSHX7NQ.js → phone-input-DfZbPPvh.js} +217 -201
- package/dist/_chunks/pl-Cl4lOx2N.js +514 -0
- package/dist/_chunks/{popover-BfHSBEKq.js → popover-Devce-tT.js} +3 -3
- package/dist/_chunks/practice-results-JQunxBIg.js +1618 -0
- package/dist/_chunks/{privacy-lock-C6Ra5m3p.js → privacy-lock-DD-wHxBg.js} +3 -3
- package/dist/_chunks/{progress-B-PSO5OS.js → progress-kzIRcdaq.js} +11 -10
- package/dist/_chunks/pt-D7qO5CzD.js +370 -0
- package/dist/_chunks/{public-footer.agent-Bc99tE5Z.js → public-footer.agent-Bh0rnx4i.js} +21 -14
- package/dist/_chunks/{public-header.agent-B-B0WDAi.js → public-header.agent-B2dDg2_d.js} +3 -3
- package/dist/_chunks/{radio-i4ogu3cq.js → radio-TWf9Q-mp.js} +2 -2
- package/dist/_chunks/{radio-group-CTlGc36r.js → radio-group-BcF92GEF.js} +4 -4
- package/dist/_chunks/{react-day-picker-D3yzgvDB.js → react-day-picker-DsjfS7uI.js} +662 -615
- package/dist/_chunks/recaptcha-widget-CFYyLSEX.js +221 -0
- package/dist/_chunks/registry-nPAVE19X.js +21 -0
- package/dist/_chunks/{resizable-COV-cnth.js → resizable-3vzqDlg6.js} +29 -28
- package/dist/_chunks/{reviews-panel-bKEUKSic.js → reviews-panel-yanuBZs-.js} +4 -4
- package/dist/_chunks/{rich-text-editor-J-wAz9eN.js → rich-text-editor-CHmr9Bz8.js} +2 -2
- package/dist/_chunks/ro-CP2-VJ_O.js +361 -0
- package/dist/_chunks/ru-RPn9_Lpq.js +561 -0
- package/dist/_chunks/{scroll-area-DEDU-lp-.js → scroll-area-BWqCkEGz.js} +2 -2
- package/dist/_chunks/{search-bar-BRMW1-WG.js → search-bar-CP6wUJFY.js} +3 -3
- package/dist/_chunks/{search-input-CIA6pPfn.js → search-input-C1C3jQpD.js} +24 -23
- package/dist/_chunks/{select-C92AT_OZ.js → select-hsCaJSX3.js} +3 -3
- package/dist/_chunks/{sheet-D8Yl0nKR.js → sheet-BV-yuLE2.js} +3 -3
- package/dist/_chunks/{sidebar-DkyC6GvS.js → sidebar-BbR8f6oe.js} +3 -3
- package/dist/_chunks/{signature-capture-DjMlFOzS.js → signature-capture-C-fF71xI.js} +213 -205
- package/dist/_chunks/{slider-CfEzeseL.js → slider-BHWzXdjt.js} +3 -3
- package/dist/_chunks/{slot-grid-Q94gVmhn.js → slot-grid-Dz13dH82.js} +4 -4
- package/dist/_chunks/{sparkline-B5Ms55PZ.js → sparkline-DEROcSl0.js} +2 -2
- package/dist/_chunks/sq-AQvefouo.js +355 -0
- package/dist/_chunks/{stepper-progress-jFY8BSf7.js → stepper-progress-DDjq5nei.js} +16 -15
- package/dist/_chunks/streaming-text-GH07yIYh.js +127 -0
- package/dist/_chunks/sv-zkx9eBtD.js +376 -0
- package/dist/_chunks/{switch-D916VW86.js → switch-BJ6HD3Mn.js} +2 -2
- package/dist/_chunks/{tabs-aEQfQV3x.js → tabs-BpPYVme_.js} +4 -4
- package/dist/_chunks/{tag-bBPAvXyh.js → tag-CyoaEmf_.js} +2 -2
- package/dist/_chunks/{task-tray-6NlryfMJ.js → task-tray-DRK0b0Qb.js} +3 -3
- package/dist/_chunks/{text-area-D5GAe8pV.js → text-area-BIx0tZ05.js} +27 -26
- package/dist/_chunks/{text-input-CakysYnD.js → text-input-BaClJL8Y.js} +2 -2
- package/dist/_chunks/{theme-toggle-JoeMs_ws.js → theme-toggle-DpC28kt5.js} +6 -6
- package/dist/_chunks/{time-picker-DeVZkIY2.js → time-picker-B5umYwfv.js} +2 -2
- package/dist/_chunks/{timeline-CR7HjZCK.js → timeline-D0Wo7v_o.js} +3 -3
- package/dist/_chunks/{toast.agent-DVpKt38p.js → toast.agent-WHHfw5VX.js} +322 -320
- package/dist/_chunks/{tooltip-ClJd0ciy.js → tooltip-DvmfrNvB.js} +29 -20
- package/dist/_chunks/{tooth-scheme-3mITSXiZ.js → tooth-scheme-CxlsLjfN.js} +2 -2
- package/dist/_chunks/tr-Dmr412Ac.js +378 -0
- package/dist/_chunks/{transcript-panel-QUQ9XJmf.js → transcript-panel-DyhTpAP7.js} +21 -20
- package/dist/_chunks/{use-direction-D6rvvG9G.js → use-direction-Dp8h70PP.js} +7 -6
- package/dist/_chunks/use-isomorphic-layout-effect-BGfaCOP1.js +6 -0
- package/dist/_chunks/use-media-query-CcAx5SMM.js +16 -0
- package/dist/_chunks/{use-password-requirements-E0sSfx5X.js → use-password-requirements-DsgduV1x.js} +3 -3
- package/dist/_chunks/use-scroll-to-first-error-4Za-u5Nw.js +43 -0
- package/dist/_chunks/{workflow-map-DlWBJJBt.js → workflow-map-BSvQS3be.js} +6 -6
- package/dist/_chunks/zh-CN-DxVt64Zk.js +388 -0
- package/dist/agent/registry.d.ts +1 -6
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/date-locale.d.ts +7 -2
- package/dist/components/_shared/index.d.ts +1 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/audio-visualiser/index.js +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/chat-container/index.js +1 -1
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/index.js +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/email-input/index.js +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/header/index.js +1 -1
- package/dist/components/header-settings/index.js +6 -6
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/icon-button-group/index.js +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/list/index.js +1 -1
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/map-view/map-view.d.ts +10 -0
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/password-input/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/practice-results/practice-results.d.ts +23 -1
- package/dist/components/privacy-lock/index.js +1 -1
- package/dist/components/progress/index.js +1 -1
- package/dist/components/public-footer/index.js +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/radio/index.js +1 -1
- package/dist/components/radio-group/index.js +2 -2
- package/dist/components/recaptcha-widget/index.js +1 -1
- package/dist/components/resizable/index.js +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/search-bar/index.js +1 -1
- package/dist/components/search-input/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/signature-capture/index.js +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/stepper-progress/index.js +1 -1
- package/dist/components/streaming-text/index.js +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/text-area/index.js +1 -1
- package/dist/components/text-input/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/index.js +69 -66
- package/dist/i18n/locales/ar.d.ts +92 -0
- package/dist/i18n/locales/ar.js +82 -0
- package/dist/i18n/locales/de.d.ts +92 -0
- package/dist/i18n/locales/de.js +81 -0
- package/dist/i18n/locales/el.d.ts +92 -0
- package/dist/i18n/locales/el.js +82 -0
- package/dist/i18n/locales/en.d.ts +27 -0
- package/dist/i18n/locales/en.js +27 -0
- package/dist/i18n/locales/es.d.ts +92 -0
- package/dist/i18n/locales/es.js +81 -0
- package/dist/i18n/locales/fr.d.ts +92 -0
- package/dist/i18n/locales/fr.js +81 -0
- package/dist/i18n/locales/hi.d.ts +92 -0
- package/dist/i18n/locales/hi.js +82 -0
- package/dist/i18n/locales/it.d.ts +92 -0
- package/dist/i18n/locales/it.js +81 -0
- package/dist/i18n/locales/ja.d.ts +92 -0
- package/dist/i18n/locales/ja.js +82 -0
- package/dist/i18n/locales/nl.d.ts +92 -0
- package/dist/i18n/locales/nl.js +81 -0
- package/dist/i18n/locales/pl.d.ts +92 -0
- package/dist/i18n/locales/pl.js +82 -0
- package/dist/i18n/locales/pt.d.ts +92 -0
- package/dist/i18n/locales/pt.js +83 -0
- package/dist/i18n/locales/ro.d.ts +92 -0
- package/dist/i18n/locales/ro.js +82 -0
- package/dist/i18n/locales/ru.d.ts +92 -0
- package/dist/i18n/locales/ru.js +82 -0
- package/dist/i18n/locales/sq.d.ts +92 -0
- package/dist/i18n/locales/sq.js +82 -0
- package/dist/i18n/locales/sv.d.ts +92 -0
- package/dist/i18n/locales/sv.js +82 -0
- package/dist/i18n/locales/tr.d.ts +92 -0
- package/dist/i18n/locales/tr.js +82 -0
- package/dist/i18n/locales/zh.d.ts +92 -0
- package/dist/i18n/locales/zh.js +82 -0
- package/dist/index.js +541 -540
- package/dist/locales/ar.json +92 -0
- package/dist/locales/de.json +92 -0
- package/dist/locales/el.json +92 -0
- package/dist/locales/en.json +27 -0
- package/dist/locales/es.json +92 -0
- package/dist/locales/fr.json +92 -0
- package/dist/locales/hi.json +92 -0
- package/dist/locales/it.json +92 -0
- package/dist/locales/ja.json +92 -0
- package/dist/locales/nl.json +92 -0
- package/dist/locales/pl.json +92 -0
- package/dist/locales/pt.json +92 -0
- package/dist/locales/ro.json +92 -0
- package/dist/locales/ru.json +92 -0
- package/dist/locales/sq.json +92 -0
- package/dist/locales/sv.json +92 -0
- package/dist/locales/tr.json +92 -0
- package/dist/locales/zh.json +92 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -2
- package/dist/_chunks/audio-visualiser-I-T4Z7EU.js +0 -145
- package/dist/_chunks/practice-results-CEKjwsgS.js +0 -1441
- package/dist/_chunks/recaptcha-widget-BtBNb6tB.js +0 -192
- package/dist/_chunks/registry-C9nwlNyL.js +0 -21
- package/dist/_chunks/streaming-text-BgjCTVOw.js +0 -105
- package/dist/_chunks/use-scroll-to-first-error-BrK7dKB_.js +0 -55
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as $e, useId as Ne, useState as
|
|
3
|
-
import * as
|
|
4
|
-
import { c as
|
|
1
|
+
import { jsx as l, jsxs as h, Fragment as we } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as $e, useId as Ne, useState as T, useMemo as I, useCallback as ye, useRef as O, useEffect as Z } from "react";
|
|
3
|
+
import * as L from "@radix-ui/react-popover";
|
|
4
|
+
import { c as te } from "./index-D2ZczOXr.js";
|
|
5
5
|
import { useTranslation as Pe } from "react-i18next";
|
|
6
6
|
import { u as Ae } from "./form-field-context-B3APVHKx.js";
|
|
7
|
-
import { S as
|
|
8
|
-
import { u as Me } from "./registry-
|
|
9
|
-
import { C as
|
|
7
|
+
import { S as ae } from "./slider-BHWzXdjt.js";
|
|
8
|
+
import { u as Me } from "./registry-nPAVE19X.js";
|
|
9
|
+
import { C as re } from "./check-DPdL_Sm7.js";
|
|
10
10
|
import { X as Se } from "./x-CCcI3eJp.js";
|
|
11
11
|
const Te = {
|
|
12
12
|
id: "color-picker",
|
|
@@ -43,65 +43,65 @@ const Te = {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
function
|
|
46
|
+
function Ie(e) {
|
|
47
47
|
let t = e.startsWith("#") ? e.slice(1) : e;
|
|
48
48
|
(t.length === 3 || t.length === 4) && (t = t.split("").map((c) => c + c).join(""));
|
|
49
49
|
const r = parseInt(t.slice(0, 2), 16) / 255, a = parseInt(t.slice(2, 4), 16) / 255, n = parseInt(t.slice(4, 6), 16) / 255, i = t.length === 8 ? parseInt(t.slice(6, 8), 16) / 255 : 1;
|
|
50
|
-
return
|
|
50
|
+
return ne(r, a, n, i);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function ne(e, t, r, a) {
|
|
53
53
|
const n = Math.max(e, t, r), i = Math.min(e, t, r), c = (n + i) / 2;
|
|
54
|
-
let m = 0,
|
|
54
|
+
let m = 0, C = 0;
|
|
55
55
|
if (n !== i) {
|
|
56
|
-
const
|
|
57
|
-
|
|
56
|
+
const w = n - i;
|
|
57
|
+
C = c > 0.5 ? w / (2 - n - i) : w / (n + i), n === e ? m = ((t - r) / w + (t < r ? 6 : 0)) / 6 : n === t ? m = ((r - e) / w + 2) / 6 : m = ((e - t) / w + 4) / 6;
|
|
58
58
|
}
|
|
59
59
|
return {
|
|
60
60
|
h: Math.round(m * 360),
|
|
61
|
-
s: Math.round(
|
|
61
|
+
s: Math.round(C * 100),
|
|
62
62
|
l: Math.round(c * 100),
|
|
63
63
|
a: Math.round(a * 100) / 100
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
const { r: t, g: r, b: a } =
|
|
66
|
+
function b(e) {
|
|
67
|
+
const { r: t, g: r, b: a } = K(e), n = (c) => Math.round(c * 255).toString(16).padStart(2, "0"), i = `#${n(t)}${n(r)}${n(a)}`;
|
|
68
68
|
return e.a < 1 ? `${i}${n(e.a)}` : i;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const { r: t, g: r, b: a } =
|
|
70
|
+
function ze(e) {
|
|
71
|
+
const { r: t, g: r, b: a } = K(e), n = Math.round(t * 255), i = Math.round(r * 255), c = Math.round(a * 255);
|
|
72
72
|
return e.a < 1 ? `rgba(${n}, ${i}, ${c}, ${e.a})` : `rgba(${n}, ${i}, ${c}, 1)`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function K(e) {
|
|
75
75
|
const t = e.h / 360, r = e.s / 100, a = e.l / 100;
|
|
76
76
|
if (r === 0)
|
|
77
77
|
return { r: a, g: a, b: a };
|
|
78
78
|
const n = a < 0.5 ? a * (1 + r) : a + r - a * r, i = 2 * a - n;
|
|
79
79
|
return {
|
|
80
|
-
r:
|
|
81
|
-
g:
|
|
82
|
-
b:
|
|
80
|
+
r: G(i, n, t + 1 / 3),
|
|
81
|
+
g: G(i, n, t),
|
|
82
|
+
b: G(i, n, t - 1 / 3)
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function G(e, t, r) {
|
|
86
86
|
let a = r;
|
|
87
87
|
return a < 0 && (a += 1), a > 1 && (a -= 1), a < 1 / 6 ? e + (t - e) * 6 * a : a < 1 / 2 ? t : a < 2 / 3 ? e + (t - e) * (2 / 3 - a) * 6 : e;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function D(e, t) {
|
|
90
90
|
switch (t) {
|
|
91
91
|
case "hex":
|
|
92
|
-
return
|
|
92
|
+
return b(e);
|
|
93
93
|
case "hsl":
|
|
94
94
|
return e.a < 1 ? `hsla(${e.h}, ${e.s}%, ${e.l}%, ${e.a})` : `hsl(${e.h}, ${e.s}%, ${e.l}%)`;
|
|
95
95
|
case "rgba":
|
|
96
|
-
return
|
|
96
|
+
return ze(e);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function k(e) {
|
|
100
100
|
const t = e.trim();
|
|
101
101
|
if (!t) return null;
|
|
102
102
|
if (t.startsWith("#")) {
|
|
103
103
|
const n = t.slice(1);
|
|
104
|
-
return !/^[0-9a-fA-F]{3,8}$/.test(n) || ![3, 4, 6, 8].includes(n.length) ? null :
|
|
104
|
+
return !/^[0-9a-fA-F]{3,8}$/.test(n) || ![3, 4, 6, 8].includes(n.length) ? null : Ie(t);
|
|
105
105
|
}
|
|
106
106
|
const r = t.match(
|
|
107
107
|
/^hsla?\(\s*([\d.]+)\s*[,/]\s*([\d.]+)%?\s*[,/]\s*([\d.]+)%?\s*(?:[,/]\s*([\d.]+))?\s*\)$/
|
|
@@ -118,22 +118,22 @@ function S(e) {
|
|
|
118
118
|
);
|
|
119
119
|
if (a) {
|
|
120
120
|
const n = parseFloat(a[1]) / 255, i = parseFloat(a[2]) / 255, c = parseFloat(a[3]) / 255, m = a[4] !== void 0 ? parseFloat(a[4]) : 1;
|
|
121
|
-
return
|
|
121
|
+
return ne(n, i, c, m);
|
|
122
122
|
}
|
|
123
123
|
return null;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
const { r: t, g: r, b: a } =
|
|
125
|
+
function ee(e) {
|
|
126
|
+
const { r: t, g: r, b: a } = K(e), n = (i) => i <= 0.03928 ? i / 12.92 : Math.pow((i + 0.055) / 1.055, 2.4);
|
|
127
127
|
return 0.2126 * n(t) + 0.7152 * n(r) + 0.0722 * n(a);
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
const r =
|
|
129
|
+
function Ee(e, t) {
|
|
130
|
+
const r = ee(e), a = ee(t), n = Math.max(r, a), i = Math.min(r, a);
|
|
131
131
|
return Math.round((n + 0.05) / (i + 0.05) * 100) / 100;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function He(e) {
|
|
134
134
|
return e >= 4.5;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Le(e) {
|
|
137
137
|
return e >= 7;
|
|
138
138
|
}
|
|
139
139
|
const Re = [
|
|
@@ -167,7 +167,7 @@ const Re = [
|
|
|
167
167
|
{ name: "Orange 900", hex: "#e65100", textColor: "#000000" },
|
|
168
168
|
{ name: "White", hex: "#ffffff", textColor: "#000000" },
|
|
169
169
|
{ name: "Yellow 500", hex: "#ffeb3b", textColor: "#000000" }
|
|
170
|
-
],
|
|
170
|
+
], ss = [
|
|
171
171
|
{ name: "Blue 300", hex: "#70738c" },
|
|
172
172
|
{ name: "Blue 500", hex: "#292e53" },
|
|
173
173
|
{ name: "Blue 700", hex: "#1d213b" },
|
|
@@ -186,7 +186,7 @@ const Re = [
|
|
|
186
186
|
{ name: "Grey 300", hex: "#f9f6f3" },
|
|
187
187
|
{ name: "Grey 500", hex: "#f6f1ed" },
|
|
188
188
|
{ name: "Grey 700", hex: "#afaba8" }
|
|
189
|
-
], u = 6, Fe =
|
|
189
|
+
], u = 6, Fe = te(
|
|
190
190
|
[
|
|
191
191
|
"ds:inline-flex ds:items-center ds:w-full",
|
|
192
192
|
"ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
@@ -205,7 +205,7 @@ const Re = [
|
|
|
205
205
|
},
|
|
206
206
|
defaultVariants: { size: "md" }
|
|
207
207
|
}
|
|
208
|
-
),
|
|
208
|
+
), Ve = te(
|
|
209
209
|
[
|
|
210
210
|
"ds:relative ds:rounded-[var(--radius-sm)] ds:border-2 ds:cursor-pointer",
|
|
211
211
|
"ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]",
|
|
@@ -227,17 +227,17 @@ const Re = [
|
|
|
227
227
|
},
|
|
228
228
|
defaultVariants: { selected: !1 }
|
|
229
229
|
}
|
|
230
|
-
),
|
|
230
|
+
), _e = [
|
|
231
231
|
"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
232
232
|
"ds:rounded-[var(--radius-md)] ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
233
233
|
"ds:p-[var(--spacing-md)]"
|
|
234
|
-
].join(" "),
|
|
234
|
+
].join(" "), Be = [
|
|
235
235
|
"ds:bg-[image:repeating-conic-gradient(var(--color-grey-700)_0%_25%,transparent_0%_50%)]",
|
|
236
236
|
"ds:bg-[size:8px_8px]"
|
|
237
|
-
].join(" "),
|
|
237
|
+
].join(" "), Oe = [
|
|
238
238
|
"ds:rounded-[var(--radius-md)] ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
239
239
|
"ds:p-[var(--spacing-sm)]"
|
|
240
|
-
].join(" "),
|
|
240
|
+
].join(" "), Ge = [
|
|
241
241
|
"ds:z-[var(--z-popover)] ds:rounded-[var(--radius-md)]",
|
|
242
242
|
"ds:border ds:border-[color:var(--border)] ds:bg-[var(--background)] ds:shadow-[var(--shadow-lg)]",
|
|
243
243
|
"ds:w-72",
|
|
@@ -245,14 +245,14 @@ const Re = [
|
|
|
245
245
|
"ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out-0 ds:data-[state=closed]:zoom-out-95",
|
|
246
246
|
"ds:data-[side=bottom]:slide-in-from-top-2 ds:data-[side=top]:slide-in-from-bottom-2",
|
|
247
247
|
"ds:data-[side=left]:slide-in-from-right-2 ds:data-[side=right]:slide-in-from-left-2"
|
|
248
|
-
].join(" "),
|
|
248
|
+
].join(" "), De = [
|
|
249
249
|
"ds:w-full ds:rounded-[var(--radius-sm)] ds:border ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
250
250
|
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:text-[var(--font-size-sm)]",
|
|
251
251
|
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
252
252
|
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
253
253
|
"ds:disabled:cursor-not-allowed ds:disabled:opacity-50",
|
|
254
254
|
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
255
|
-
].join(" "),
|
|
255
|
+
].join(" "), oe = "ds:[&>span:first-child]:bg-transparent ds:[&>span:first-child>span]:bg-transparent", je = $e(
|
|
256
256
|
(e, t) => {
|
|
257
257
|
const {
|
|
258
258
|
value: r,
|
|
@@ -261,65 +261,71 @@ const Re = [
|
|
|
261
261
|
format: i = "hex",
|
|
262
262
|
allowOpacity: c = !1,
|
|
263
263
|
palette: m,
|
|
264
|
-
against:
|
|
265
|
-
size:
|
|
266
|
-
disabled:
|
|
267
|
-
variant:
|
|
268
|
-
compact:
|
|
269
|
-
className:
|
|
270
|
-
} = e, { t: g } = Pe(),
|
|
264
|
+
against: C,
|
|
265
|
+
size: w = "md",
|
|
266
|
+
disabled: ie = !1,
|
|
267
|
+
variant: de = "inline",
|
|
268
|
+
compact: A = !0,
|
|
269
|
+
className: W
|
|
270
|
+
} = e, { t: g } = Pe(), y = Ae(), le = Ne(), $ = y.id || le, x = y.disabled || ie, z = r !== void 0, [U, ce] = T(() => {
|
|
271
271
|
const s = r ?? a;
|
|
272
272
|
if (s) {
|
|
273
|
-
const
|
|
274
|
-
if (
|
|
273
|
+
const d = k(s);
|
|
274
|
+
if (d) return d;
|
|
275
275
|
}
|
|
276
276
|
return { h: 0, s: 100, l: 50, a: 1 };
|
|
277
|
-
}), o =
|
|
278
|
-
if (
|
|
279
|
-
const s =
|
|
277
|
+
}), o = I(() => {
|
|
278
|
+
if (z && r) {
|
|
279
|
+
const s = k(r);
|
|
280
280
|
if (s) return s;
|
|
281
281
|
}
|
|
282
|
-
return
|
|
283
|
-
}, [
|
|
282
|
+
return U;
|
|
283
|
+
}, [z, r, U]), v = ye(
|
|
284
284
|
(s) => {
|
|
285
|
-
const
|
|
286
|
-
|
|
285
|
+
const d = c ? s : { ...s, a: 1 };
|
|
286
|
+
z || ce(d), n == null || n(D(d, i));
|
|
287
287
|
},
|
|
288
|
-
[c, i,
|
|
289
|
-
), [
|
|
290
|
-
F.current = o,
|
|
291
|
-
R(
|
|
292
|
-
}, [o]),
|
|
293
|
-
|
|
288
|
+
[c, i, z, n]
|
|
289
|
+
), [X, R] = T(() => b(o)), [fe, E] = T(!1), N = O(void 0), F = O(o);
|
|
290
|
+
F.current = o, Z(() => {
|
|
291
|
+
R(b(o)), E(!1), N.current !== void 0 && (clearTimeout(N.current), N.current = void 0);
|
|
292
|
+
}, [o]), Z(() => () => {
|
|
293
|
+
N.current !== void 0 && clearTimeout(N.current);
|
|
294
294
|
}, []);
|
|
295
|
-
const
|
|
296
|
-
const s =
|
|
297
|
-
s ? (
|
|
298
|
-
|
|
295
|
+
const ue = () => {
|
|
296
|
+
const s = k(X);
|
|
297
|
+
s ? (E(!1), v(s)) : (E(!0), N.current = setTimeout(() => {
|
|
298
|
+
N.current = void 0, E(!1), R(b(F.current));
|
|
299
299
|
}, 800));
|
|
300
|
-
},
|
|
300
|
+
}, P = I(() => m ? m.map(
|
|
301
301
|
(s) => typeof s == "string" ? { name: s.toUpperCase(), hex: s } : s
|
|
302
|
-
) : Re, [m]),
|
|
303
|
-
(
|
|
304
|
-
|
|
305
|
-
|
|
302
|
+
) : Re, [m]), he = b(o), V = I(
|
|
303
|
+
() => P.map((s) => {
|
|
304
|
+
const d = k(s.hex);
|
|
305
|
+
return d ? b(d).toLowerCase() : null;
|
|
306
|
+
}),
|
|
307
|
+
[P]
|
|
308
|
+
).findIndex(
|
|
309
|
+
(s) => s !== null && s === he.toLowerCase()
|
|
310
|
+
), Y = O(null), [p, q] = T(
|
|
311
|
+
V >= 0 ? V : 0
|
|
306
312
|
), me = (s) => {
|
|
307
313
|
var f;
|
|
308
|
-
const
|
|
309
|
-
|
|
314
|
+
const d = (f = Y.current) == null ? void 0 : f.querySelectorAll('[role="gridcell"]');
|
|
315
|
+
d != null && d[s] && (d[s].focus(), q(s));
|
|
310
316
|
}, ge = (s) => {
|
|
311
317
|
if (x) return;
|
|
312
|
-
const
|
|
318
|
+
const d = P.length;
|
|
313
319
|
let f = p;
|
|
314
320
|
switch (s.key) {
|
|
315
321
|
case "ArrowRight":
|
|
316
|
-
f = (p + 1) %
|
|
322
|
+
f = (p + 1) % d;
|
|
317
323
|
break;
|
|
318
324
|
case "ArrowLeft":
|
|
319
|
-
f = (p - 1 +
|
|
325
|
+
f = (p - 1 + d) % d;
|
|
320
326
|
break;
|
|
321
327
|
case "ArrowDown":
|
|
322
|
-
f = Math.min(p + u,
|
|
328
|
+
f = Math.min(p + u, d - 1);
|
|
323
329
|
break;
|
|
324
330
|
case "ArrowUp":
|
|
325
331
|
f = Math.max(p - u, 0);
|
|
@@ -330,45 +336,48 @@ const Re = [
|
|
|
330
336
|
case "End":
|
|
331
337
|
f = Math.min(
|
|
332
338
|
Math.floor(p / u) * u + u - 1,
|
|
333
|
-
|
|
339
|
+
d - 1
|
|
334
340
|
);
|
|
335
341
|
break;
|
|
336
342
|
case "PageUp":
|
|
337
343
|
f = p % u;
|
|
338
344
|
break;
|
|
339
345
|
case "PageDown": {
|
|
340
|
-
const
|
|
341
|
-
f = Math.min(
|
|
346
|
+
const M = Math.floor((d - 1) / u) * u;
|
|
347
|
+
f = Math.min(M + p % u, d - 1);
|
|
342
348
|
break;
|
|
343
349
|
}
|
|
344
350
|
case "Enter":
|
|
345
|
-
case " ":
|
|
346
|
-
s.preventDefault()
|
|
351
|
+
case " ": {
|
|
352
|
+
s.preventDefault();
|
|
353
|
+
const M = k(P[p].hex);
|
|
354
|
+
M && v(M);
|
|
347
355
|
return;
|
|
356
|
+
}
|
|
348
357
|
default:
|
|
349
358
|
return;
|
|
350
359
|
}
|
|
351
360
|
s.preventDefault(), me(f);
|
|
352
|
-
}, [pe, xe] =
|
|
361
|
+
}, [pe, xe] = T(!1), ve = I(
|
|
353
362
|
() => ({
|
|
354
|
-
getValue: () =>
|
|
363
|
+
getValue: () => b(F.current),
|
|
355
364
|
setValue: (s) => {
|
|
356
|
-
const
|
|
357
|
-
|
|
365
|
+
const d = k(s);
|
|
366
|
+
d && v(d);
|
|
358
367
|
}
|
|
359
368
|
}),
|
|
360
369
|
[v]
|
|
361
370
|
);
|
|
362
|
-
Me(Te, ve,
|
|
363
|
-
const
|
|
364
|
-
if (!
|
|
365
|
-
const s =
|
|
371
|
+
Me(Te, ve, $);
|
|
372
|
+
const H = I(() => {
|
|
373
|
+
if (!C) return null;
|
|
374
|
+
const s = k(C);
|
|
366
375
|
if (!s) return null;
|
|
367
|
-
const
|
|
368
|
-
return { ratio:
|
|
369
|
-
}, [
|
|
376
|
+
const d = Ee(o, s);
|
|
377
|
+
return { ratio: d, aa: He(d), aaa: Le(d) };
|
|
378
|
+
}, [C, o]), be = (
|
|
370
379
|
// eslint-disable-next-line jsx-a11y/interactive-supports-focus -- inner gridcells are individually focusable via roving tabindex
|
|
371
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ l(
|
|
372
381
|
"div",
|
|
373
382
|
{
|
|
374
383
|
ref: Y,
|
|
@@ -376,68 +385,70 @@ const Re = [
|
|
|
376
385
|
"aria-label": g("inputs.colorPicker.paletteLabel", "Colour swatches"),
|
|
377
386
|
onKeyDown: ge,
|
|
378
387
|
className: "ds:grid ds:grid-cols-6 ds:gap-[var(--spacing-xs)]",
|
|
379
|
-
children:
|
|
380
|
-
const f = Math.floor(
|
|
381
|
-
return
|
|
382
|
-
const
|
|
388
|
+
children: P.map((s, d) => {
|
|
389
|
+
const f = Math.floor(d / u) * u;
|
|
390
|
+
return d === f ? /* @__PURE__ */ l("div", { role: "row", className: "ds:contents", children: P.slice(f, f + u).map((S, ke) => {
|
|
391
|
+
const _ = f + ke, B = _ === V;
|
|
383
392
|
return (
|
|
384
393
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events -- parent grid handles keyboard navigation via onKeyDown
|
|
385
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ l(
|
|
386
395
|
"div",
|
|
387
396
|
{
|
|
388
397
|
role: "gridcell",
|
|
389
|
-
"aria-selected":
|
|
398
|
+
"aria-selected": B,
|
|
390
399
|
"aria-label": g("inputs.colorPicker.swatchLabel", {
|
|
391
|
-
name:
|
|
392
|
-
hex:
|
|
400
|
+
name: S.name,
|
|
401
|
+
hex: S.hex
|
|
393
402
|
}),
|
|
394
|
-
tabIndex:
|
|
403
|
+
tabIndex: _ === p ? 0 : -1,
|
|
395
404
|
onClick: () => {
|
|
396
|
-
|
|
405
|
+
if (x) return;
|
|
406
|
+
const Q = k(S.hex);
|
|
407
|
+
Q && v(Q), q(_);
|
|
397
408
|
},
|
|
398
|
-
className:
|
|
399
|
-
style: { "--swatch-bg":
|
|
400
|
-
children:
|
|
401
|
-
|
|
409
|
+
className: Ve({ selected: B }),
|
|
410
|
+
style: { "--swatch-bg": S.hex },
|
|
411
|
+
children: B ? /* @__PURE__ */ l(
|
|
412
|
+
re,
|
|
402
413
|
{
|
|
403
414
|
"aria-hidden": "true",
|
|
404
415
|
className: "ds:absolute ds:inset-0 ds:m-auto ds:size-4 ds:text-[var(--background)] ds:mix-blend-difference"
|
|
405
416
|
}
|
|
406
417
|
) : null
|
|
407
418
|
},
|
|
408
|
-
|
|
419
|
+
S.hex
|
|
409
420
|
)
|
|
410
421
|
);
|
|
411
|
-
}) },
|
|
422
|
+
}) }, d) : null;
|
|
412
423
|
})
|
|
413
424
|
}
|
|
414
425
|
)
|
|
415
|
-
), Ce =
|
|
426
|
+
), Ce = A ? null : /* @__PURE__ */ h(we, { children: [
|
|
416
427
|
/* @__PURE__ */ h("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
417
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ l(
|
|
418
429
|
"label",
|
|
419
430
|
{
|
|
420
|
-
htmlFor: `${
|
|
431
|
+
htmlFor: `${$}-hex`,
|
|
421
432
|
className: "ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]",
|
|
422
433
|
children: g("inputs.colorPicker.hex", "Hex")
|
|
423
434
|
}
|
|
424
435
|
),
|
|
425
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ l("bdi", { dir: "ltr", children: /* @__PURE__ */ l(
|
|
426
437
|
"input",
|
|
427
438
|
{
|
|
428
|
-
id: `${
|
|
439
|
+
id: `${$}-hex`,
|
|
429
440
|
type: "text",
|
|
430
|
-
value:
|
|
441
|
+
value: X,
|
|
431
442
|
disabled: x,
|
|
432
443
|
onChange: (s) => R(s.target.value),
|
|
433
|
-
onBlur:
|
|
434
|
-
className: `${
|
|
444
|
+
onBlur: ue,
|
|
445
|
+
className: `${De} ${fe ? "ds:border-[var(--destructive)]" : "ds:border-[color:var(--border)]"}`
|
|
435
446
|
}
|
|
436
447
|
) })
|
|
437
448
|
] }),
|
|
438
449
|
/* @__PURE__ */ h("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
439
|
-
/* @__PURE__ */
|
|
440
|
-
|
|
450
|
+
/* @__PURE__ */ l(
|
|
451
|
+
j,
|
|
441
452
|
{
|
|
442
453
|
label: g("inputs.colorPicker.hue", "Hue"),
|
|
443
454
|
gradient: "linear-gradient(to right, hsl(0,100%,50%), hsl(60,100%,50%), hsl(120,100%,50%), hsl(180,100%,50%), hsl(240,100%,50%), hsl(300,100%,50%), hsl(360,100%,50%))",
|
|
@@ -449,8 +460,8 @@ const Re = [
|
|
|
449
460
|
disabled: x
|
|
450
461
|
}
|
|
451
462
|
),
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
|
|
463
|
+
/* @__PURE__ */ l(
|
|
464
|
+
j,
|
|
454
465
|
{
|
|
455
466
|
label: g("inputs.colorPicker.saturation", "Saturation"),
|
|
456
467
|
gradient: `linear-gradient(to right, hsl(${o.h},0%,${o.l}%), hsl(${o.h},100%,${o.l}%))`,
|
|
@@ -462,8 +473,8 @@ const Re = [
|
|
|
462
473
|
disabled: x
|
|
463
474
|
}
|
|
464
475
|
),
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
|
|
476
|
+
/* @__PURE__ */ l(
|
|
477
|
+
j,
|
|
467
478
|
{
|
|
468
479
|
label: g("inputs.colorPicker.lightness", "Lightness"),
|
|
469
480
|
gradient: `linear-gradient(to right, hsl(${o.h},${o.s}%,0%), hsl(${o.h},${o.s}%,50%), hsl(${o.h},${o.s}%,100%))`,
|
|
@@ -476,16 +487,16 @@ const Re = [
|
|
|
476
487
|
}
|
|
477
488
|
),
|
|
478
489
|
c ? /* @__PURE__ */ h("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
479
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ l("label", { className: "ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]", children: g("inputs.colorPicker.opacity", "Opacity") }),
|
|
480
491
|
/* @__PURE__ */ h("div", { className: "ds:relative", children: [
|
|
481
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ l(
|
|
482
493
|
"div",
|
|
483
494
|
{
|
|
484
|
-
className: `ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ${
|
|
495
|
+
className: `ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ${Be}`,
|
|
485
496
|
"aria-hidden": "true"
|
|
486
497
|
}
|
|
487
498
|
),
|
|
488
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ l(
|
|
489
500
|
"div",
|
|
490
501
|
{
|
|
491
502
|
className: "ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ds:bg-[image:var(--opacity-gradient)]",
|
|
@@ -495,8 +506,8 @@ const Re = [
|
|
|
495
506
|
"aria-hidden": "true"
|
|
496
507
|
}
|
|
497
508
|
),
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
-
|
|
509
|
+
/* @__PURE__ */ l(
|
|
510
|
+
ae,
|
|
500
511
|
{
|
|
501
512
|
min: 0,
|
|
502
513
|
max: 100,
|
|
@@ -506,103 +517,103 @@ const Re = [
|
|
|
506
517
|
"aria-label": g("inputs.colorPicker.opacity", "Opacity"),
|
|
507
518
|
formatValue: (s) => `${s}%`,
|
|
508
519
|
disabled: x,
|
|
509
|
-
className:
|
|
520
|
+
className: oe
|
|
510
521
|
}
|
|
511
522
|
)
|
|
512
523
|
] })
|
|
513
524
|
] }) : null
|
|
514
525
|
] }),
|
|
515
|
-
|
|
526
|
+
H ? /* @__PURE__ */ h(
|
|
516
527
|
"div",
|
|
517
528
|
{
|
|
518
529
|
className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:text-[length:var(--font-size-sm)]",
|
|
519
530
|
role: "status",
|
|
520
531
|
"aria-live": "polite",
|
|
521
532
|
children: [
|
|
522
|
-
/* @__PURE__ */
|
|
523
|
-
ratio:
|
|
533
|
+
/* @__PURE__ */ l("span", { className: "ds:tabular-nums", children: g("inputs.colorPicker.contrastRatio", {
|
|
534
|
+
ratio: H.ratio.toFixed(1)
|
|
524
535
|
}) }),
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
/* @__PURE__ */
|
|
536
|
+
/* @__PURE__ */ l(se, { level: "AA", passes: H.aa, t: g }),
|
|
537
|
+
/* @__PURE__ */ l(se, { level: "AAA", passes: H.aaa, t: g })
|
|
527
538
|
]
|
|
528
539
|
}
|
|
529
540
|
) : null,
|
|
530
541
|
/* @__PURE__ */ h("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
531
|
-
/* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ l(
|
|
532
543
|
"div",
|
|
533
544
|
{
|
|
534
545
|
className: "ds:size-8 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--swatch-bg)]",
|
|
535
|
-
style: { "--swatch-bg":
|
|
546
|
+
style: { "--swatch-bg": b(o) },
|
|
536
547
|
"aria-hidden": "true"
|
|
537
548
|
}
|
|
538
549
|
),
|
|
539
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ l("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:tabular-nums", children: D(o, i) })
|
|
540
551
|
] })
|
|
541
|
-
] }), J = /* @__PURE__ */ h("div", { className:
|
|
552
|
+
] }), J = /* @__PURE__ */ h("div", { className: A ? Oe : _e, children: [
|
|
542
553
|
be,
|
|
543
554
|
Ce
|
|
544
555
|
] });
|
|
545
|
-
return
|
|
556
|
+
return de === "inline" ? /* @__PURE__ */ l(
|
|
546
557
|
"div",
|
|
547
558
|
{
|
|
548
559
|
ref: t,
|
|
549
|
-
id:
|
|
550
|
-
className:
|
|
551
|
-
"aria-describedby":
|
|
552
|
-
"aria-invalid":
|
|
560
|
+
id: $,
|
|
561
|
+
className: W,
|
|
562
|
+
"aria-describedby": y.describedBy || void 0,
|
|
563
|
+
"aria-invalid": y.invalid || void 0,
|
|
553
564
|
"aria-disabled": x || void 0,
|
|
554
565
|
"data-component": "color-picker",
|
|
555
|
-
"data-component-id":
|
|
566
|
+
"data-component-id": $,
|
|
556
567
|
"data-testid": "color-picker",
|
|
557
568
|
children: J
|
|
558
569
|
}
|
|
559
|
-
) : /* @__PURE__ */ h(
|
|
560
|
-
/* @__PURE__ */
|
|
570
|
+
) : /* @__PURE__ */ h(L.Root, { open: pe, onOpenChange: xe, children: [
|
|
571
|
+
/* @__PURE__ */ l(L.Trigger, { asChild: !0, disabled: x, children: /* @__PURE__ */ h(
|
|
561
572
|
"button",
|
|
562
573
|
{
|
|
563
574
|
ref: t,
|
|
564
575
|
type: "button",
|
|
565
|
-
id:
|
|
566
|
-
"aria-describedby":
|
|
567
|
-
"aria-invalid":
|
|
568
|
-
"aria-label":
|
|
569
|
-
className: Fe({ size:
|
|
576
|
+
id: $,
|
|
577
|
+
"aria-describedby": y.describedBy || void 0,
|
|
578
|
+
"aria-invalid": y.invalid || void 0,
|
|
579
|
+
"aria-label": A ? g("inputs.colorPicker.triggerLabel", "Choose a colour") : void 0,
|
|
580
|
+
className: Fe({ size: w, className: W }),
|
|
570
581
|
"data-component": "color-picker",
|
|
571
|
-
"data-component-id":
|
|
582
|
+
"data-component-id": $,
|
|
572
583
|
"data-testid": "color-picker-trigger",
|
|
573
584
|
children: [
|
|
574
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ l(
|
|
575
586
|
"span",
|
|
576
587
|
{
|
|
577
|
-
className: `ds:inline-block ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:shrink-0 ds:bg-[var(--swatch-bg)]${
|
|
588
|
+
className: `ds:inline-block ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:shrink-0 ds:bg-[var(--swatch-bg)]${A ? "" : " ds:me-[var(--spacing-sm)]"}`,
|
|
578
589
|
"aria-hidden": "true",
|
|
579
|
-
style: { "--swatch-bg":
|
|
590
|
+
style: { "--swatch-bg": b(o) }
|
|
580
591
|
}
|
|
581
592
|
),
|
|
582
|
-
|
|
593
|
+
A ? null : /* @__PURE__ */ l("span", { className: "ds:text-start ds:truncate ds:tabular-nums", children: D(o, i) })
|
|
583
594
|
]
|
|
584
595
|
}
|
|
585
596
|
) }),
|
|
586
|
-
/* @__PURE__ */
|
|
587
|
-
|
|
597
|
+
/* @__PURE__ */ l(L.Portal, { children: /* @__PURE__ */ l(
|
|
598
|
+
L.Content,
|
|
588
599
|
{
|
|
589
600
|
sideOffset: 4,
|
|
590
601
|
align: "start",
|
|
591
|
-
className:
|
|
602
|
+
className: Ge,
|
|
592
603
|
children: J
|
|
593
604
|
}
|
|
594
605
|
) })
|
|
595
606
|
] });
|
|
596
607
|
}
|
|
597
608
|
);
|
|
598
|
-
|
|
609
|
+
je.displayName = "ColorPicker";
|
|
599
610
|
function se({
|
|
600
611
|
level: e,
|
|
601
612
|
passes: t,
|
|
602
613
|
t: r
|
|
603
614
|
}) {
|
|
604
615
|
return /* @__PURE__ */ h("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
605
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ l(
|
|
606
617
|
"abbr",
|
|
607
618
|
{
|
|
608
619
|
title: `Web Content Accessibility Guidelines Level ${e}`,
|
|
@@ -610,23 +621,23 @@ function se({
|
|
|
610
621
|
children: e
|
|
611
622
|
}
|
|
612
623
|
),
|
|
613
|
-
t ? /* @__PURE__ */
|
|
614
|
-
|
|
624
|
+
t ? /* @__PURE__ */ l(
|
|
625
|
+
re,
|
|
615
626
|
{
|
|
616
627
|
"aria-hidden": "true",
|
|
617
628
|
className: "ds:size-4 ds:text-[var(--success)]"
|
|
618
629
|
}
|
|
619
|
-
) : /* @__PURE__ */
|
|
630
|
+
) : /* @__PURE__ */ l(
|
|
620
631
|
Se,
|
|
621
632
|
{
|
|
622
633
|
"aria-hidden": "true",
|
|
623
634
|
className: "ds:size-4 ds:text-[var(--destructive)]"
|
|
624
635
|
}
|
|
625
636
|
),
|
|
626
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ l("span", { className: "ds:sr-only", children: t ? r("inputs.colorPicker.contrastPass", "Pass") : r("inputs.colorPicker.contrastFail", "Fail") })
|
|
627
638
|
] });
|
|
628
639
|
}
|
|
629
|
-
function
|
|
640
|
+
function j({
|
|
630
641
|
label: e,
|
|
631
642
|
gradient: t,
|
|
632
643
|
min: r,
|
|
@@ -637,9 +648,9 @@ function O({
|
|
|
637
648
|
disabled: m
|
|
638
649
|
}) {
|
|
639
650
|
return /* @__PURE__ */ h("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
640
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ l("label", { className: "ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]", children: e }),
|
|
641
652
|
/* @__PURE__ */ h("div", { className: "ds:relative", children: [
|
|
642
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ l(
|
|
643
654
|
"div",
|
|
644
655
|
{
|
|
645
656
|
className: "ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ds:bg-[image:var(--slider-gradient)]",
|
|
@@ -647,18 +658,18 @@ function O({
|
|
|
647
658
|
"aria-hidden": "true"
|
|
648
659
|
}
|
|
649
660
|
),
|
|
650
|
-
/* @__PURE__ */
|
|
651
|
-
|
|
661
|
+
/* @__PURE__ */ l(
|
|
662
|
+
ae,
|
|
652
663
|
{
|
|
653
664
|
min: r,
|
|
654
665
|
max: a,
|
|
655
666
|
step: 1,
|
|
656
667
|
value: [n],
|
|
657
|
-
onValueChange: ([
|
|
668
|
+
onValueChange: ([C]) => i(C),
|
|
658
669
|
"aria-label": e,
|
|
659
670
|
formatValue: c,
|
|
660
671
|
disabled: m,
|
|
661
|
-
className:
|
|
672
|
+
className: oe
|
|
662
673
|
}
|
|
663
674
|
)
|
|
664
675
|
] })
|
|
@@ -666,7 +677,7 @@ function O({
|
|
|
666
677
|
}
|
|
667
678
|
export {
|
|
668
679
|
Re as A,
|
|
669
|
-
|
|
670
|
-
|
|
680
|
+
ss as B,
|
|
681
|
+
je as C
|
|
671
682
|
};
|
|
672
|
-
//# sourceMappingURL=color-picker-
|
|
683
|
+
//# sourceMappingURL=color-picker-9tL7pz5y.js.map
|