@alfadocs/ui-kit-debug 0.66.0 → 0.67.1
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/{agenda-card-Bl-SBiCh.js → agenda-card-BxSFkqgY.js} +2 -2
- package/dist/_chunks/{agenda-card-Bl-SBiCh.js.map → agenda-card-BxSFkqgY.js.map} +1 -1
- package/dist/_chunks/{agenda-tray-Bh1KfEOG.js → agenda-tray-T-BumlGZ.js} +2 -2
- package/dist/_chunks/{agenda-tray-Bh1KfEOG.js.map → agenda-tray-T-BumlGZ.js.map} +1 -1
- package/dist/_chunks/{ai-consent-banner-Btzmk8OH.js → ai-consent-banner-Dxtx_WAh.js} +2 -2
- package/dist/_chunks/{ai-consent-banner-Btzmk8OH.js.map → ai-consent-banner-Dxtx_WAh.js.map} +1 -1
- package/dist/_chunks/{ai-tools-rail-DAfaW8eA.js → ai-tools-rail-CInA_1-E.js} +57 -50
- package/dist/_chunks/ai-tools-rail-CInA_1-E.js.map +1 -0
- package/dist/_chunks/{alia-sidebar-CN8pA6c-.js → alia-sidebar-Ckv0yCKi.js} +2 -2
- package/dist/_chunks/{alia-sidebar-CN8pA6c-.js.map → alia-sidebar-Ckv0yCKi.js.map} +1 -1
- package/dist/_chunks/{anamnesis-card-qeLYRG79.js → anamnesis-card-N8pIKWuS.js} +2 -2
- package/dist/_chunks/{anamnesis-card-qeLYRG79.js.map → anamnesis-card-N8pIKWuS.js.map} +1 -1
- package/dist/_chunks/{antenatal-schedule-timeline-BfzFjEyb.js → antenatal-schedule-timeline-35ebkcZT.js} +2 -2
- package/dist/_chunks/{antenatal-schedule-timeline-BfzFjEyb.js.map → antenatal-schedule-timeline-35ebkcZT.js.map} +1 -1
- package/dist/_chunks/{appointment-tray-BQnJEora.js → appointment-tray-BMl89NPW.js} +4 -4
- package/dist/_chunks/{appointment-tray-BQnJEora.js.map → appointment-tray-BMl89NPW.js.map} +1 -1
- package/dist/_chunks/{badge-zsf5i5bH.js → badge-CqGsX32l.js} +46 -42
- package/dist/_chunks/badge-CqGsX32l.js.map +1 -0
- package/dist/_chunks/{bishop-score-DPN4Ched.js → bishop-score-CjsB9bM-.js} +2 -2
- package/dist/_chunks/{bishop-score-DPN4Ched.js.map → bishop-score-CjsB9bM-.js.map} +1 -1
- package/dist/_chunks/{bmi-calculator-DuUneHuZ.js → bmi-calculator-n-823_1V.js} +2 -2
- package/dist/_chunks/{bmi-calculator-DuUneHuZ.js.map → bmi-calculator-n-823_1V.js.map} +1 -1
- package/dist/_chunks/{care-plan-card-D42WD4-T.js → care-plan-card-BwVUyUBb.js} +4 -4
- package/dist/_chunks/{care-plan-card-D42WD4-T.js.map → care-plan-card-BwVUyUBb.js.map} +1 -1
- package/dist/_chunks/{care-plan-entry-card-BukNI7Uy.js → care-plan-entry-card-VzdQHcOL.js} +4 -4
- package/dist/_chunks/{care-plan-entry-card-BukNI7Uy.js.map → care-plan-entry-card-VzdQHcOL.js.map} +1 -1
- package/dist/_chunks/{clinical-note-card-BYo437dU.js → clinical-note-card-gtrxv6zn.js} +2 -2
- package/dist/_chunks/{clinical-note-card-BYo437dU.js.map → clinical-note-card-gtrxv6zn.js.map} +1 -1
- package/dist/_chunks/{color-picker-9tL7pz5y.js → color-picker-FXpItIaF.js} +198 -175
- package/dist/_chunks/color-picker-FXpItIaF.js.map +1 -0
- package/dist/_chunks/{contact-profile-card-CCeJmjbd.js → contact-profile-card-7BMB85T6.js} +2 -2
- package/dist/_chunks/{contact-profile-card-CCeJmjbd.js.map → contact-profile-card-7BMB85T6.js.map} +1 -1
- package/dist/_chunks/{cycle-calculator-D6LTmtQt.js → cycle-calculator-BF0ointe.js} +2 -2
- package/dist/_chunks/{cycle-calculator-D6LTmtQt.js.map → cycle-calculator-BF0ointe.js.map} +1 -1
- package/dist/_chunks/{dependent-selector-CRWgieHm.js → dependent-selector-DpzGtr_J.js} +2 -2
- package/dist/_chunks/{dependent-selector-CRWgieHm.js.map → dependent-selector-DpzGtr_J.js.map} +1 -1
- package/dist/_chunks/{document-scanner-biBS_f6c.js → document-scanner-D2qehl3-.js} +53 -53
- package/dist/_chunks/{document-scanner-biBS_f6c.js.map → document-scanner-D2qehl3-.js.map} +1 -1
- package/dist/_chunks/{due-date-calculator-CIG194vq.js → due-date-calculator-DU9AEWNy.js} +3 -3
- package/dist/_chunks/{due-date-calculator-CIG194vq.js.map → due-date-calculator-DU9AEWNy.js.map} +1 -1
- package/dist/_chunks/{editable-currency-cell-renderer-f3d0Rhue.js → editable-currency-cell-renderer-D1ewvJKO.js} +875 -809
- package/dist/_chunks/editable-currency-cell-renderer-D1ewvJKO.js.map +1 -0
- package/dist/_chunks/{fetal-weight-Xf8-ZoDy.js → fetal-weight-BVSzOhuR.js} +2 -2
- package/dist/_chunks/{fetal-weight-Xf8-ZoDy.js.map → fetal-weight-BVSzOhuR.js.map} +1 -1
- package/dist/_chunks/{gestational-age-calculator-BGsZaWXW.js → gestational-age-calculator-DBlFdoiP.js} +3 -3
- package/dist/_chunks/{gestational-age-calculator-BGsZaWXW.js.map → gestational-age-calculator-DBlFdoiP.js.map} +1 -1
- package/dist/_chunks/{hcg-doubling-LH5i6oM7.js → hcg-doubling-if4Q8aSX.js} +2 -2
- package/dist/_chunks/{hcg-doubling-LH5i6oM7.js.map → hcg-doubling-if4Q8aSX.js.map} +1 -1
- package/dist/_chunks/{marketplace-app-shell-Cou6XnMJ.js → marketplace-app-shell-D4-T9Qzz.js} +3 -3
- package/dist/_chunks/{marketplace-app-shell-Cou6XnMJ.js.map → marketplace-app-shell-D4-T9Qzz.js.map} +1 -1
- package/dist/_chunks/{message-card-Bgcvfj6-.js → message-card-Bx4GmLvf.js} +9 -9
- package/dist/_chunks/{message-card-Bgcvfj6-.js.map → message-card-Bx4GmLvf.js.map} +1 -1
- package/dist/_chunks/{message-tray-saAVMeHP.js → message-tray-CVyJajVJ.js} +2 -2
- package/dist/_chunks/{message-tray-saAVMeHP.js.map → message-tray-CVyJajVJ.js.map} +1 -1
- package/dist/_chunks/{operator-hero-CM8949Hd.js → operator-hero-f_KaRhw5.js} +2 -2
- package/dist/_chunks/{operator-hero-CM8949Hd.js.map → operator-hero-f_KaRhw5.js.map} +1 -1
- package/dist/_chunks/{patient-search-Bw9ONucF.js → patient-search-DR9XUYRQ.js} +2 -2
- package/dist/_chunks/{patient-search-Bw9ONucF.js.map → patient-search-DR9XUYRQ.js.map} +1 -1
- package/dist/_chunks/{patient-shell-Tgpv0HND.js → patient-shell-BfgufL_q.js} +2 -2
- package/dist/_chunks/{patient-shell-Tgpv0HND.js.map → patient-shell-BfgufL_q.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-Bgso0p_l.js → patient-summary-card-hEmr4eTW.js} +4 -4
- package/dist/_chunks/{patient-summary-card-Bgso0p_l.js.map → patient-summary-card-hEmr4eTW.js.map} +1 -1
- package/dist/_chunks/{payment-request-card-DBz3hVDz.js → payment-request-card-CYE5vhZ0.js} +3 -3
- package/dist/_chunks/{payment-request-card-DBz3hVDz.js.map → payment-request-card-CYE5vhZ0.js.map} +1 -1
- package/dist/_chunks/{periodontal-chart-card-AYyHtU9K.js → periodontal-chart-card-Dh3KgvYG.js} +2 -2
- package/dist/_chunks/{periodontal-chart-card-AYyHtU9K.js.map → periodontal-chart-card-Dh3KgvYG.js.map} +1 -1
- package/dist/_chunks/{practice-results-CVAgY2RZ.js → practice-results-DND2SAt7.js} +2 -2
- package/dist/_chunks/{practice-results-CVAgY2RZ.js.map → practice-results-DND2SAt7.js.map} +1 -1
- package/dist/_chunks/{pregnancy-dating-f9aJbiAk.js → pregnancy-dating-QY-sqpvj.js} +3 -3
- package/dist/_chunks/{pregnancy-dating-f9aJbiAk.js.map → pregnancy-dating-QY-sqpvj.js.map} +1 -1
- package/dist/_chunks/{pregnancy-weight-gain-BMRBeA8V.js → pregnancy-weight-gain-DOJXXNYP.js} +2 -2
- package/dist/_chunks/{pregnancy-weight-gain-BMRBeA8V.js.map → pregnancy-weight-gain-DOJXXNYP.js.map} +1 -1
- package/dist/_chunks/rich-text-editor-DAeCXiQG.js +1973 -0
- package/dist/_chunks/rich-text-editor-DAeCXiQG.js.map +1 -0
- package/dist/_chunks/{scroll-area-BWqCkEGz.js → scroll-area-5wNK0Cyz.js} +40 -30
- package/dist/_chunks/scroll-area-5wNK0Cyz.js.map +1 -0
- package/dist/_chunks/{sidebar-BFwbx74W.js → sidebar-DaB4ulxH.js} +351 -344
- package/dist/_chunks/sidebar-DaB4ulxH.js.map +1 -0
- package/dist/_chunks/{suggestion-chip-C4kxWUIs.js → suggestion-chip-Bk4PmYTg.js} +30 -30
- package/dist/_chunks/suggestion-chip-Bk4PmYTg.js.map +1 -0
- package/dist/_chunks/{tab-bar-Xetknddo.js → tab-bar-B1ovILzh.js} +2 -2
- package/dist/_chunks/{tab-bar-Xetknddo.js.map → tab-bar-B1ovILzh.js.map} +1 -1
- package/dist/_chunks/{tag-CdA0s_VV.js → tag-BQXwuJq1.js} +41 -38
- package/dist/_chunks/tag-BQXwuJq1.js.map +1 -0
- package/dist/_chunks/{transaction-chip-BZCa6XDn.js → transaction-chip-DK84XCBU.js} +46 -33
- package/dist/_chunks/transaction-chip-DK84XCBU.js.map +1 -0
- package/dist/_chunks/{workflow-map-Bt4Of5dT.js → workflow-map-JAZryZJr.js} +2 -2
- package/dist/_chunks/{workflow-map-Bt4Of5dT.js.map → workflow-map-JAZryZJr.js.map} +1 -1
- package/dist/agent-catalog.json +1 -1
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-consent-banner/index.js +1 -1
- package/dist/components/ai-tools-rail/ai-tools-rail.d.ts.map +1 -1
- package/dist/components/ai-tools-rail/index.js +1 -1
- package/dist/components/anamnesis-card/index.js +1 -1
- package/dist/components/appointment-card/index.js +1 -1
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/clinical-note-card/index.js +1 -1
- package/dist/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/cell-renderers/actions-cell-renderer.d.ts +16 -0
- package/dist/components/data-table/cell-renderers/actions-cell-renderer.d.ts.map +1 -1
- package/dist/components/data-table/cell-renderers/tooth-cell-renderer.d.ts +12 -0
- package/dist/components/data-table/cell-renderers/tooth-cell-renderer.d.ts.map +1 -0
- package/dist/components/data-table/data-table.d.ts +1 -1
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/data-table/index.d.ts.map +1 -1
- package/dist/components/data-table/index.js +13 -12
- package/dist/components/data-table/toolbar.d.ts +5 -1
- package/dist/components/data-table/toolbar.d.ts.map +1 -1
- package/dist/components/dependent-selector/index.js +1 -1
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +2 -2
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/periodontal-chart-card/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts +25 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
- package/dist/components/rich-text-editor/help-me-write-overlay.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +2 -0
- package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/components/suggestion-chip/index.js +1 -1
- package/dist/components/tab-bar/index.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/tag/tag.d.ts.map +1 -1
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/components/transaction-chip/transaction-chip.d.ts.map +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +14 -1
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +16 -3
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +14 -1
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +16 -3
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +14 -1
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +16 -3
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +14 -1
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +16 -3
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +14 -1
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +16 -3
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +14 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +16 -3
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +14 -1
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +16 -3
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +14 -1
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +16 -3
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +14 -1
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +16 -3
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +14 -1
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +14 -3
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +14 -1
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +16 -3
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +14 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +16 -3
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +14 -1
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +16 -3
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +14 -1
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +16 -3
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +14 -1
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +16 -3
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +14 -1
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +14 -3
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +14 -1
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +16 -3
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +14 -1
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +14 -3
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +508 -507
- package/dist/locales/ar.json +16 -3
- package/dist/locales/de.json +16 -3
- package/dist/locales/el.json +16 -3
- package/dist/locales/en.json +16 -3
- package/dist/locales/es.json +16 -3
- package/dist/locales/fr.json +16 -3
- package/dist/locales/hi.json +16 -3
- package/dist/locales/it.json +16 -3
- package/dist/locales/ja.json +16 -3
- package/dist/locales/nl.json +16 -3
- package/dist/locales/pl.json +16 -3
- package/dist/locales/pt.json +16 -3
- package/dist/locales/ro.json +16 -3
- package/dist/locales/ru.json +16 -3
- package/dist/locales/sq.json +16 -3
- package/dist/locales/sv.json +16 -3
- package/dist/locales/tr.json +16 -3
- package/dist/locales/zh.json +16 -3
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +6 -3
- package/package.json +1 -1
- package/dist/_chunks/ai-tools-rail-DAfaW8eA.js.map +0 -1
- package/dist/_chunks/badge-zsf5i5bH.js.map +0 -1
- package/dist/_chunks/color-picker-9tL7pz5y.js.map +0 -1
- package/dist/_chunks/editable-currency-cell-renderer-f3d0Rhue.js.map +0 -1
- package/dist/_chunks/rich-text-editor-B5XQNxe8.js +0 -1586
- package/dist/_chunks/rich-text-editor-B5XQNxe8.js.map +0 -1
- package/dist/_chunks/scroll-area-BWqCkEGz.js.map +0 -1
- package/dist/_chunks/sidebar-BFwbx74W.js.map +0 -1
- package/dist/_chunks/suggestion-chip-C4kxWUIs.js.map +0 -1
- package/dist/_chunks/tag-CdA0s_VV.js.map +0 -1
- package/dist/_chunks/transaction-chip-BZCa6XDn.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as l, jsxs as h, Fragment as
|
|
2
|
-
import { forwardRef as $e, useId as
|
|
3
|
-
import * as
|
|
1
|
+
import { jsx as l, jsxs as h, Fragment as ke } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as $e, useId as ye, useState as z, useMemo as T, useCallback as Ne, useRef as G, useEffect as Z } from "react";
|
|
3
|
+
import * as H from "@radix-ui/react-popover";
|
|
4
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
7
|
import { S as ae } from "./slider-BHWzXdjt.js";
|
|
8
|
-
import { u as
|
|
8
|
+
import { u as Se } from "./registry-nPAVE19X.js";
|
|
9
9
|
import { C as re } from "./check-DPdL_Sm7.js";
|
|
10
|
-
import { X as
|
|
11
|
-
const
|
|
10
|
+
import { X as Me } from "./x-CCcI3eJp.js";
|
|
11
|
+
const ze = {
|
|
12
12
|
id: "color-picker",
|
|
13
13
|
capabilities: ["pick"],
|
|
14
14
|
state: {
|
|
@@ -43,65 +43,65 @@ const Te = {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
function
|
|
46
|
+
function Te(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
|
-
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,
|
|
50
|
-
return ne(r, a, n,
|
|
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, d = t.length === 8 ? parseInt(t.slice(6, 8), 16) / 255 : 1;
|
|
50
|
+
return ne(r, a, n, d);
|
|
51
51
|
}
|
|
52
52
|
function ne(e, t, r, a) {
|
|
53
|
-
const n = Math.max(e, t, r),
|
|
54
|
-
let m = 0,
|
|
55
|
-
if (n !==
|
|
56
|
-
const
|
|
57
|
-
|
|
53
|
+
const n = Math.max(e, t, r), d = Math.min(e, t, r), c = (n + d) / 2;
|
|
54
|
+
let m = 0, w = 0;
|
|
55
|
+
if (n !== d) {
|
|
56
|
+
const x = n - d;
|
|
57
|
+
w = c > 0.5 ? x / (2 - n - d) : x / (n + d), n === e ? m = ((t - r) / x + (t < r ? 6 : 0)) / 6 : n === t ? m = ((r - e) / x + 2) / 6 : m = ((e - t) / x + 4) / 6;
|
|
58
58
|
}
|
|
59
59
|
return {
|
|
60
60
|
h: Math.round(m * 360),
|
|
61
|
-
s: Math.round(
|
|
61
|
+
s: Math.round(w * 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 } =
|
|
68
|
-
return e.a < 1 ? `${
|
|
66
|
+
function C(e) {
|
|
67
|
+
const { r: t, g: r, b: a } = W(e), n = (c) => Math.round(c * 255).toString(16).padStart(2, "0"), d = `#${n(t)}${n(r)}${n(a)}`;
|
|
68
|
+
return e.a < 1 ? `${d}${n(e.a)}` : d;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const { r: t, g: r, b: a } =
|
|
72
|
-
return e.a < 1 ? `rgba(${n}, ${
|
|
70
|
+
function Ee(e) {
|
|
71
|
+
const { r: t, g: r, b: a } = W(e), n = Math.round(t * 255), d = Math.round(r * 255), c = Math.round(a * 255);
|
|
72
|
+
return e.a < 1 ? `rgba(${n}, ${d}, ${c}, ${e.a})` : `rgba(${n}, ${d}, ${c}, 1)`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function W(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
|
-
const n = a < 0.5 ? a * (1 + r) : a + r - a * r,
|
|
78
|
+
const n = a < 0.5 ? a * (1 + r) : a + r - a * r, d = 2 * a - n;
|
|
79
79
|
return {
|
|
80
|
-
r:
|
|
81
|
-
g:
|
|
82
|
-
b:
|
|
80
|
+
r: j(d, n, t + 1 / 3),
|
|
81
|
+
g: j(d, n, t),
|
|
82
|
+
b: j(d, n, t - 1 / 3)
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function j(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
89
|
function D(e, t) {
|
|
90
90
|
switch (t) {
|
|
91
91
|
case "hex":
|
|
92
|
-
return
|
|
92
|
+
return C(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 Ee(e);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function $(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 : Te(t);
|
|
105
105
|
}
|
|
106
106
|
const r = t.match(
|
|
107
107
|
/^hsla?\(\s*([\d.]+)\s*[,/]\s*([\d.]+)%?\s*[,/]\s*([\d.]+)%?\s*(?:[,/]\s*([\d.]+))?\s*\)$/
|
|
@@ -117,26 +117,26 @@ function k(e) {
|
|
|
117
117
|
/^rgba?\(\s*([\d.]+)\s*[,/]\s*([\d.]+)\s*[,/]\s*([\d.]+)\s*(?:[,/]\s*([\d.]+))?\s*\)$/
|
|
118
118
|
);
|
|
119
119
|
if (a) {
|
|
120
|
-
const n = parseFloat(a[1]) / 255,
|
|
121
|
-
return ne(n,
|
|
120
|
+
const n = parseFloat(a[1]) / 255, d = parseFloat(a[2]) / 255, c = parseFloat(a[3]) / 255, m = a[4] !== void 0 ? parseFloat(a[4]) : 1;
|
|
121
|
+
return ne(n, d, c, m);
|
|
122
122
|
}
|
|
123
123
|
return null;
|
|
124
124
|
}
|
|
125
125
|
function ee(e) {
|
|
126
|
-
const { r: t, g: r, b: a } =
|
|
126
|
+
const { r: t, g: r, b: a } = W(e), n = (d) => d <= 0.03928 ? d / 12.92 : Math.pow((d + 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 = ee(e), a = ee(t), n = Math.max(r, a),
|
|
131
|
-
return Math.round((n + 0.05) / (
|
|
129
|
+
function Ie(e, t) {
|
|
130
|
+
const r = ee(e), a = ee(t), n = Math.max(r, a), d = Math.min(r, a);
|
|
131
|
+
return Math.round((n + 0.05) / (d + 0.05) * 100) / 100;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Le(e) {
|
|
134
134
|
return e >= 4.5;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Re(e) {
|
|
137
137
|
return e >= 7;
|
|
138
138
|
}
|
|
139
|
-
const
|
|
139
|
+
const He = [
|
|
140
140
|
{ name: "Pink 500", hex: "#e91e63", textColor: "#ffffff" },
|
|
141
141
|
{ name: "Black", hex: "#000000", textColor: "#ffffff" },
|
|
142
142
|
{ name: "Blue 500", hex: "#2196f3", textColor: "#ffffff" },
|
|
@@ -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
|
+
], ts = [
|
|
171
171
|
{ name: "Blue 300", hex: "#70738c" },
|
|
172
172
|
{ name: "Blue 500", hex: "#292e53" },
|
|
173
173
|
{ name: "Blue 700", hex: "#1d213b" },
|
|
@@ -205,10 +205,9 @@ const Re = [
|
|
|
205
205
|
},
|
|
206
206
|
defaultVariants: { size: "md" }
|
|
207
207
|
}
|
|
208
|
-
),
|
|
208
|
+
), _e = te(
|
|
209
209
|
[
|
|
210
210
|
"ds:relative ds:rounded-[var(--radius-sm)] ds:border-2 ds:cursor-pointer",
|
|
211
|
-
"ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]",
|
|
212
211
|
"ds:transition-[transform,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
213
212
|
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
214
213
|
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
@@ -223,21 +222,38 @@ const Re = [
|
|
|
223
222
|
selected: {
|
|
224
223
|
true: "ds:border-[var(--primary)] ds:shadow-[var(--shadow-md)]",
|
|
225
224
|
false: "ds:border-transparent"
|
|
225
|
+
},
|
|
226
|
+
// Swatch footprint. md/lg honour --min-target-size (44/48px) for touch.
|
|
227
|
+
// sm is a denser 28px swatch for toolbar/inline use — comfortably above
|
|
228
|
+
// the WCAG 2.5.8 (AA) 24px minimum, with the grid gap providing spacing.
|
|
229
|
+
// sm intentionally does NOT take the accessible-theme --min-target-size
|
|
230
|
+
// bump (48px) — a dense colour grid is opt-in and the full roving-tabindex
|
|
231
|
+
// keyboard path is the mitigation for the sub-AAA pointer target.
|
|
232
|
+
size: {
|
|
233
|
+
// sm = 28px: clears WCAG 2.5.8 (AA, 24px) but intentionally opts out of
|
|
234
|
+
// the accessible-theme 48px min-target bump — a conscious, signed-off
|
|
235
|
+
// trade-off (dense opt-in grid; keyboard roving-tabindex is the mitigation).
|
|
236
|
+
sm: "ds:min-w-7 ds:min-h-7",
|
|
237
|
+
md: "ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]",
|
|
238
|
+
lg: "ds:min-w-[var(--min-target-size)] ds:min-h-[var(--min-target-size)]"
|
|
226
239
|
}
|
|
227
240
|
},
|
|
228
|
-
defaultVariants: { selected: !1 }
|
|
241
|
+
defaultVariants: { selected: !1, size: "md" }
|
|
229
242
|
}
|
|
230
|
-
),
|
|
243
|
+
), Ve = [
|
|
231
244
|
"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
232
245
|
"ds:rounded-[var(--radius-md)] ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
233
246
|
"ds:p-[var(--spacing-md)]"
|
|
234
|
-
].join(" "),
|
|
247
|
+
].join(" "), Oe = [
|
|
235
248
|
"ds:bg-[image:repeating-conic-gradient(var(--color-grey-700)_0%_25%,transparent_0%_50%)]",
|
|
236
249
|
"ds:bg-[size:8px_8px]"
|
|
237
|
-
].join(" "),
|
|
250
|
+
].join(" "), Be = [
|
|
238
251
|
"ds:rounded-[var(--radius-md)] ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
239
252
|
"ds:p-[var(--spacing-sm)]"
|
|
240
253
|
].join(" "), Ge = [
|
|
254
|
+
"ds:rounded-[var(--radius-md)] ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
255
|
+
"ds:p-[var(--spacing-xs)]"
|
|
256
|
+
].join(" "), je = [
|
|
241
257
|
"ds:z-[var(--z-popover)] ds:rounded-[var(--radius-md)]",
|
|
242
258
|
"ds:border ds:border-[color:var(--border)] ds:bg-[var(--background)] ds:shadow-[var(--shadow-lg)]",
|
|
243
259
|
"ds:w-72",
|
|
@@ -247,85 +263,86 @@ const Re = [
|
|
|
247
263
|
"ds:data-[side=left]:slide-in-from-right-2 ds:data-[side=right]:slide-in-from-left-2"
|
|
248
264
|
].join(" "), De = [
|
|
249
265
|
"ds:w-full ds:rounded-[var(--radius-sm)] ds:border ds:bg-[var(--background)] ds:text-[var(--foreground)]",
|
|
250
|
-
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:text-[var(--font-size-sm)]",
|
|
266
|
+
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)]",
|
|
251
267
|
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
252
268
|
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
253
269
|
"ds:disabled:cursor-not-allowed ds:disabled:opacity-50",
|
|
254
270
|
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
255
|
-
].join(" "), oe = "ds:[&>span:first-child]:bg-transparent ds:[&>span:first-child>span]:bg-transparent",
|
|
271
|
+
].join(" "), oe = "ds:[&>span:first-child]:bg-transparent ds:[&>span:first-child>span]:bg-transparent", Ke = $e(
|
|
256
272
|
(e, t) => {
|
|
257
273
|
const {
|
|
258
274
|
value: r,
|
|
259
275
|
defaultValue: a,
|
|
260
276
|
onChange: n,
|
|
261
|
-
format:
|
|
277
|
+
format: d = "hex",
|
|
262
278
|
allowOpacity: c = !1,
|
|
263
279
|
palette: m,
|
|
264
|
-
against:
|
|
265
|
-
size:
|
|
280
|
+
against: w,
|
|
281
|
+
size: x = "md",
|
|
266
282
|
disabled: ie = !1,
|
|
267
283
|
variant: de = "inline",
|
|
268
|
-
compact:
|
|
269
|
-
className:
|
|
270
|
-
} = e, { t: g } = Pe(),
|
|
284
|
+
compact: M = !0,
|
|
285
|
+
className: U
|
|
286
|
+
} = e, { t: g } = Pe(), P = Ae(), le = ye(), y = P.id || le, v = P.disabled || ie, E = r !== void 0, [X, ce] = z(() => {
|
|
271
287
|
const s = r ?? a;
|
|
272
288
|
if (s) {
|
|
273
|
-
const
|
|
274
|
-
if (
|
|
289
|
+
const i = $(s);
|
|
290
|
+
if (i) return i;
|
|
275
291
|
}
|
|
276
292
|
return { h: 0, s: 100, l: 50, a: 1 };
|
|
277
|
-
}), o =
|
|
278
|
-
if (
|
|
279
|
-
const s =
|
|
293
|
+
}), o = T(() => {
|
|
294
|
+
if (E && r) {
|
|
295
|
+
const s = $(r);
|
|
280
296
|
if (s) return s;
|
|
281
297
|
}
|
|
282
|
-
return
|
|
283
|
-
}, [
|
|
298
|
+
return X;
|
|
299
|
+
}, [E, r, X]), b = Ne(
|
|
284
300
|
(s) => {
|
|
285
|
-
const
|
|
286
|
-
|
|
301
|
+
const i = c ? s : { ...s, a: 1 };
|
|
302
|
+
E || ce(i), n == null || n(D(i, d));
|
|
287
303
|
},
|
|
288
|
-
[c,
|
|
289
|
-
), [
|
|
290
|
-
|
|
291
|
-
|
|
304
|
+
[c, d, E, n]
|
|
305
|
+
), [Y, F] = z(() => C(o)), [fe, I] = z(!1), N = G(void 0), _ = G(o);
|
|
306
|
+
_.current = o, Z(() => {
|
|
307
|
+
F(C(o)), I(!1), N.current !== void 0 && (clearTimeout(N.current), N.current = void 0);
|
|
292
308
|
}, [o]), Z(() => () => {
|
|
293
309
|
N.current !== void 0 && clearTimeout(N.current);
|
|
294
310
|
}, []);
|
|
295
311
|
const ue = () => {
|
|
296
|
-
const s =
|
|
297
|
-
s ? (
|
|
298
|
-
N.current = void 0,
|
|
312
|
+
const s = $(Y);
|
|
313
|
+
s ? (I(!1), b(s)) : (I(!0), N.current = setTimeout(() => {
|
|
314
|
+
N.current = void 0, I(!1), F(C(_.current));
|
|
299
315
|
}, 800));
|
|
300
|
-
},
|
|
316
|
+
}, A = T(() => m ? m.map(
|
|
301
317
|
(s) => typeof s == "string" ? { name: s.toUpperCase(), hex: s } : s
|
|
302
|
-
) :
|
|
303
|
-
() =>
|
|
304
|
-
const
|
|
305
|
-
return
|
|
318
|
+
) : He, [m]), he = C(o), V = T(
|
|
319
|
+
() => A.map((s) => {
|
|
320
|
+
const i = $(s.hex);
|
|
321
|
+
return i ? C(i).toLowerCase() : null;
|
|
306
322
|
}),
|
|
307
|
-
[
|
|
323
|
+
[A]
|
|
308
324
|
).findIndex(
|
|
309
325
|
(s) => s !== null && s === he.toLowerCase()
|
|
310
|
-
),
|
|
326
|
+
), L = G(null), [p, q] = z(
|
|
311
327
|
V >= 0 ? V : 0
|
|
312
328
|
), me = (s) => {
|
|
313
329
|
var f;
|
|
314
|
-
const
|
|
315
|
-
|
|
330
|
+
const i = (f = L.current) == null ? void 0 : f.querySelectorAll('[role="gridcell"]');
|
|
331
|
+
i != null && i[s] && (i[s].focus(), q(s));
|
|
316
332
|
}, ge = (s) => {
|
|
317
|
-
if (
|
|
318
|
-
const
|
|
333
|
+
if (v) return;
|
|
334
|
+
const i = A.length;
|
|
319
335
|
let f = p;
|
|
336
|
+
const k = (typeof window < "u" && L.current ? window.getComputedStyle(L.current).direction === "rtl" : !1) ? -1 : 1;
|
|
320
337
|
switch (s.key) {
|
|
321
338
|
case "ArrowRight":
|
|
322
|
-
f = (p +
|
|
339
|
+
f = (p + k + i) % i;
|
|
323
340
|
break;
|
|
324
341
|
case "ArrowLeft":
|
|
325
|
-
f = (p -
|
|
342
|
+
f = (p - k + i) % i;
|
|
326
343
|
break;
|
|
327
344
|
case "ArrowDown":
|
|
328
|
-
f = Math.min(p + u,
|
|
345
|
+
f = Math.min(p + u, i - 1);
|
|
329
346
|
break;
|
|
330
347
|
case "ArrowUp":
|
|
331
348
|
f = Math.max(p - u, 0);
|
|
@@ -336,59 +353,59 @@ const Re = [
|
|
|
336
353
|
case "End":
|
|
337
354
|
f = Math.min(
|
|
338
355
|
Math.floor(p / u) * u + u - 1,
|
|
339
|
-
|
|
356
|
+
i - 1
|
|
340
357
|
);
|
|
341
358
|
break;
|
|
342
359
|
case "PageUp":
|
|
343
360
|
f = p % u;
|
|
344
361
|
break;
|
|
345
362
|
case "PageDown": {
|
|
346
|
-
const
|
|
347
|
-
f = Math.min(
|
|
363
|
+
const S = Math.floor((i - 1) / u) * u;
|
|
364
|
+
f = Math.min(S + p % u, i - 1);
|
|
348
365
|
break;
|
|
349
366
|
}
|
|
350
367
|
case "Enter":
|
|
351
368
|
case " ": {
|
|
352
369
|
s.preventDefault();
|
|
353
|
-
const
|
|
354
|
-
|
|
370
|
+
const S = $(A[p].hex);
|
|
371
|
+
S && b(S);
|
|
355
372
|
return;
|
|
356
373
|
}
|
|
357
374
|
default:
|
|
358
375
|
return;
|
|
359
376
|
}
|
|
360
377
|
s.preventDefault(), me(f);
|
|
361
|
-
}, [pe, xe] =
|
|
378
|
+
}, [pe, xe] = z(!1), ve = T(
|
|
362
379
|
() => ({
|
|
363
|
-
getValue: () =>
|
|
380
|
+
getValue: () => C(_.current),
|
|
364
381
|
setValue: (s) => {
|
|
365
|
-
const
|
|
366
|
-
|
|
382
|
+
const i = $(s);
|
|
383
|
+
i && b(i);
|
|
367
384
|
}
|
|
368
385
|
}),
|
|
369
|
-
[
|
|
386
|
+
[b]
|
|
370
387
|
);
|
|
371
|
-
|
|
372
|
-
const
|
|
373
|
-
if (!
|
|
374
|
-
const s =
|
|
388
|
+
Se(ze, ve, y);
|
|
389
|
+
const R = T(() => {
|
|
390
|
+
if (!w) return null;
|
|
391
|
+
const s = $(w);
|
|
375
392
|
if (!s) return null;
|
|
376
|
-
const
|
|
377
|
-
return { ratio:
|
|
378
|
-
}, [
|
|
393
|
+
const i = Ie(o, s);
|
|
394
|
+
return { ratio: i, aa: Le(i), aaa: Re(i) };
|
|
395
|
+
}, [w, o]), be = (
|
|
379
396
|
// eslint-disable-next-line jsx-a11y/interactive-supports-focus -- inner gridcells are individually focusable via roving tabindex
|
|
380
397
|
/* @__PURE__ */ l(
|
|
381
398
|
"div",
|
|
382
399
|
{
|
|
383
|
-
ref:
|
|
400
|
+
ref: L,
|
|
384
401
|
role: "grid",
|
|
385
|
-
"aria-label": g("inputs.colorPicker.paletteLabel", "Colour
|
|
402
|
+
"aria-label": g("inputs.colorPicker.paletteLabel", "Colour palette"),
|
|
386
403
|
onKeyDown: ge,
|
|
387
404
|
className: "ds:grid ds:grid-cols-6 ds:gap-[var(--spacing-xs)]",
|
|
388
|
-
children:
|
|
389
|
-
const f = Math.floor(
|
|
390
|
-
return
|
|
391
|
-
const
|
|
405
|
+
children: A.map((s, i) => {
|
|
406
|
+
const f = Math.floor(i / u) * u;
|
|
407
|
+
return i === f ? /* @__PURE__ */ l("div", { role: "row", className: "ds:contents", children: A.slice(f, f + u).map((k, S) => {
|
|
408
|
+
const O = f + S, B = O === V;
|
|
392
409
|
return (
|
|
393
410
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events -- parent grid handles keyboard navigation via onKeyDown
|
|
394
411
|
/* @__PURE__ */ l(
|
|
@@ -397,17 +414,17 @@ const Re = [
|
|
|
397
414
|
role: "gridcell",
|
|
398
415
|
"aria-selected": B,
|
|
399
416
|
"aria-label": g("inputs.colorPicker.swatchLabel", {
|
|
400
|
-
name:
|
|
401
|
-
hex:
|
|
417
|
+
name: k.name,
|
|
418
|
+
hex: k.hex
|
|
402
419
|
}),
|
|
403
|
-
tabIndex:
|
|
420
|
+
tabIndex: O === p ? 0 : -1,
|
|
404
421
|
onClick: () => {
|
|
405
|
-
if (
|
|
406
|
-
const Q = k
|
|
407
|
-
Q &&
|
|
422
|
+
if (v) return;
|
|
423
|
+
const Q = $(k.hex);
|
|
424
|
+
Q && b(Q), q(O);
|
|
408
425
|
},
|
|
409
|
-
className:
|
|
410
|
-
style: { "--swatch-bg":
|
|
426
|
+
className: _e({ selected: B, size: x }),
|
|
427
|
+
style: { "--swatch-bg": k.hex },
|
|
411
428
|
children: B ? /* @__PURE__ */ l(
|
|
412
429
|
re,
|
|
413
430
|
{
|
|
@@ -416,19 +433,19 @@ const Re = [
|
|
|
416
433
|
}
|
|
417
434
|
) : null
|
|
418
435
|
},
|
|
419
|
-
|
|
436
|
+
k.hex
|
|
420
437
|
)
|
|
421
438
|
);
|
|
422
|
-
}) },
|
|
439
|
+
}) }, i) : null;
|
|
423
440
|
})
|
|
424
441
|
}
|
|
425
442
|
)
|
|
426
|
-
), Ce =
|
|
443
|
+
), Ce = M ? null : /* @__PURE__ */ h(ke, { children: [
|
|
427
444
|
/* @__PURE__ */ h("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
428
445
|
/* @__PURE__ */ l(
|
|
429
446
|
"label",
|
|
430
447
|
{
|
|
431
|
-
htmlFor: `${
|
|
448
|
+
htmlFor: `${y}-hex`,
|
|
432
449
|
className: "ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]",
|
|
433
450
|
children: g("inputs.colorPicker.hex", "Hex")
|
|
434
451
|
}
|
|
@@ -436,11 +453,11 @@ const Re = [
|
|
|
436
453
|
/* @__PURE__ */ l("bdi", { dir: "ltr", children: /* @__PURE__ */ l(
|
|
437
454
|
"input",
|
|
438
455
|
{
|
|
439
|
-
id: `${
|
|
456
|
+
id: `${y}-hex`,
|
|
440
457
|
type: "text",
|
|
441
|
-
value:
|
|
442
|
-
disabled:
|
|
443
|
-
onChange: (s) =>
|
|
458
|
+
value: Y,
|
|
459
|
+
disabled: v,
|
|
460
|
+
onChange: (s) => F(s.target.value),
|
|
444
461
|
onBlur: ue,
|
|
445
462
|
className: `${De} ${fe ? "ds:border-[var(--destructive)]" : "ds:border-[color:var(--border)]"}`
|
|
446
463
|
}
|
|
@@ -448,42 +465,42 @@ const Re = [
|
|
|
448
465
|
] }),
|
|
449
466
|
/* @__PURE__ */ h("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
450
467
|
/* @__PURE__ */ l(
|
|
451
|
-
|
|
468
|
+
K,
|
|
452
469
|
{
|
|
453
470
|
label: g("inputs.colorPicker.hue", "Hue"),
|
|
454
471
|
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%))",
|
|
455
472
|
min: 0,
|
|
456
473
|
max: 360,
|
|
457
474
|
value: o.h,
|
|
458
|
-
onChange: (s) =>
|
|
475
|
+
onChange: (s) => b({ ...o, h: s }),
|
|
459
476
|
formatValue: (s) => `H ${s}°`,
|
|
460
|
-
disabled:
|
|
477
|
+
disabled: v
|
|
461
478
|
}
|
|
462
479
|
),
|
|
463
480
|
/* @__PURE__ */ l(
|
|
464
|
-
|
|
481
|
+
K,
|
|
465
482
|
{
|
|
466
483
|
label: g("inputs.colorPicker.saturation", "Saturation"),
|
|
467
484
|
gradient: `linear-gradient(to right, hsl(${o.h},0%,${o.l}%), hsl(${o.h},100%,${o.l}%))`,
|
|
468
485
|
min: 0,
|
|
469
486
|
max: 100,
|
|
470
487
|
value: o.s,
|
|
471
|
-
onChange: (s) =>
|
|
488
|
+
onChange: (s) => b({ ...o, s }),
|
|
472
489
|
formatValue: (s) => `S ${s}%`,
|
|
473
|
-
disabled:
|
|
490
|
+
disabled: v
|
|
474
491
|
}
|
|
475
492
|
),
|
|
476
493
|
/* @__PURE__ */ l(
|
|
477
|
-
|
|
494
|
+
K,
|
|
478
495
|
{
|
|
479
496
|
label: g("inputs.colorPicker.lightness", "Lightness"),
|
|
480
497
|
gradient: `linear-gradient(to right, hsl(${o.h},${o.s}%,0%), hsl(${o.h},${o.s}%,50%), hsl(${o.h},${o.s}%,100%))`,
|
|
481
498
|
min: 0,
|
|
482
499
|
max: 100,
|
|
483
500
|
value: o.l,
|
|
484
|
-
onChange: (s) =>
|
|
501
|
+
onChange: (s) => b({ ...o, l: s }),
|
|
485
502
|
formatValue: (s) => `L ${s}%`,
|
|
486
|
-
disabled:
|
|
503
|
+
disabled: v
|
|
487
504
|
}
|
|
488
505
|
),
|
|
489
506
|
c ? /* @__PURE__ */ h("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
@@ -492,7 +509,7 @@ const Re = [
|
|
|
492
509
|
/* @__PURE__ */ l(
|
|
493
510
|
"div",
|
|
494
511
|
{
|
|
495
|
-
className: `ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ${
|
|
512
|
+
className: `ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)] ds:pointer-events-none ${Oe}`,
|
|
496
513
|
"aria-hidden": "true"
|
|
497
514
|
}
|
|
498
515
|
),
|
|
@@ -513,17 +530,17 @@ const Re = [
|
|
|
513
530
|
max: 100,
|
|
514
531
|
step: 1,
|
|
515
532
|
value: [Math.round(o.a * 100)],
|
|
516
|
-
onValueChange: ([s]) =>
|
|
533
|
+
onValueChange: ([s]) => b({ ...o, a: s / 100 }),
|
|
517
534
|
"aria-label": g("inputs.colorPicker.opacity", "Opacity"),
|
|
518
535
|
formatValue: (s) => `${s}%`,
|
|
519
|
-
disabled:
|
|
536
|
+
disabled: v,
|
|
520
537
|
className: oe
|
|
521
538
|
}
|
|
522
539
|
)
|
|
523
540
|
] })
|
|
524
541
|
] }) : null
|
|
525
542
|
] }),
|
|
526
|
-
|
|
543
|
+
R ? /* @__PURE__ */ h(
|
|
527
544
|
"div",
|
|
528
545
|
{
|
|
529
546
|
className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:text-[length:var(--font-size-sm)]",
|
|
@@ -531,10 +548,10 @@ const Re = [
|
|
|
531
548
|
"aria-live": "polite",
|
|
532
549
|
children: [
|
|
533
550
|
/* @__PURE__ */ l("span", { className: "ds:tabular-nums", children: g("inputs.colorPicker.contrastRatio", {
|
|
534
|
-
ratio:
|
|
551
|
+
ratio: R.ratio.toFixed(1)
|
|
535
552
|
}) }),
|
|
536
|
-
/* @__PURE__ */ l(se, { level: "AA", passes:
|
|
537
|
-
/* @__PURE__ */ l(se, { level: "AAA", passes:
|
|
553
|
+
/* @__PURE__ */ l(se, { level: "AA", passes: R.aa, t: g }),
|
|
554
|
+
/* @__PURE__ */ l(se, { level: "AAA", passes: R.aaa, t: g })
|
|
538
555
|
]
|
|
539
556
|
}
|
|
540
557
|
) : null,
|
|
@@ -543,70 +560,76 @@ const Re = [
|
|
|
543
560
|
"div",
|
|
544
561
|
{
|
|
545
562
|
className: "ds:size-8 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--swatch-bg)]",
|
|
546
|
-
style: { "--swatch-bg":
|
|
563
|
+
style: { "--swatch-bg": C(o) },
|
|
547
564
|
"aria-hidden": "true"
|
|
548
565
|
}
|
|
549
566
|
),
|
|
550
|
-
/* @__PURE__ */ l("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:tabular-nums", children: D(o,
|
|
567
|
+
/* @__PURE__ */ l("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:tabular-nums", children: D(o, d) })
|
|
551
568
|
] })
|
|
552
|
-
] }), J = /* @__PURE__ */ h(
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
569
|
+
] }), J = /* @__PURE__ */ h(
|
|
570
|
+
"div",
|
|
571
|
+
{
|
|
572
|
+
className: M ? x === "sm" ? Ge : Be : Ve,
|
|
573
|
+
children: [
|
|
574
|
+
be,
|
|
575
|
+
Ce
|
|
576
|
+
]
|
|
577
|
+
}
|
|
578
|
+
);
|
|
556
579
|
return de === "inline" ? /* @__PURE__ */ l(
|
|
557
580
|
"div",
|
|
558
581
|
{
|
|
559
582
|
ref: t,
|
|
560
|
-
id:
|
|
561
|
-
className:
|
|
562
|
-
"aria-describedby":
|
|
563
|
-
"aria-invalid":
|
|
564
|
-
"aria-disabled":
|
|
583
|
+
id: y,
|
|
584
|
+
className: U,
|
|
585
|
+
"aria-describedby": P.describedBy || void 0,
|
|
586
|
+
"aria-invalid": P.invalid || void 0,
|
|
587
|
+
"aria-disabled": v || void 0,
|
|
565
588
|
"data-component": "color-picker",
|
|
566
|
-
"data-component-id":
|
|
589
|
+
"data-component-id": y,
|
|
567
590
|
"data-testid": "color-picker",
|
|
568
591
|
children: J
|
|
569
592
|
}
|
|
570
|
-
) : /* @__PURE__ */ h(
|
|
571
|
-
/* @__PURE__ */ l(
|
|
593
|
+
) : /* @__PURE__ */ h(H.Root, { open: pe, onOpenChange: xe, children: [
|
|
594
|
+
/* @__PURE__ */ l(H.Trigger, { asChild: !0, disabled: v, children: /* @__PURE__ */ h(
|
|
572
595
|
"button",
|
|
573
596
|
{
|
|
574
597
|
ref: t,
|
|
575
598
|
type: "button",
|
|
576
|
-
id:
|
|
577
|
-
"aria-describedby":
|
|
578
|
-
"aria-invalid":
|
|
579
|
-
"aria-label":
|
|
580
|
-
className: Fe({ size:
|
|
599
|
+
id: y,
|
|
600
|
+
"aria-describedby": P.describedBy || void 0,
|
|
601
|
+
"aria-invalid": P.invalid || void 0,
|
|
602
|
+
"aria-label": M ? g("inputs.colorPicker.triggerLabel", "Choose colour") : void 0,
|
|
603
|
+
className: Fe({ size: x, className: U }),
|
|
581
604
|
"data-component": "color-picker",
|
|
582
|
-
"data-component-id":
|
|
605
|
+
"data-component-id": y,
|
|
583
606
|
"data-testid": "color-picker-trigger",
|
|
584
607
|
children: [
|
|
585
608
|
/* @__PURE__ */ l(
|
|
586
609
|
"span",
|
|
587
610
|
{
|
|
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)]${
|
|
611
|
+
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)]${M ? "" : " ds:me-[var(--spacing-sm)]"}`,
|
|
589
612
|
"aria-hidden": "true",
|
|
590
|
-
style: { "--swatch-bg":
|
|
613
|
+
style: { "--swatch-bg": C(o) }
|
|
591
614
|
}
|
|
592
615
|
),
|
|
593
|
-
|
|
616
|
+
M ? null : /* @__PURE__ */ l("span", { className: "ds:text-start ds:truncate ds:tabular-nums", children: D(o, d) })
|
|
594
617
|
]
|
|
595
618
|
}
|
|
596
619
|
) }),
|
|
597
|
-
/* @__PURE__ */ l(
|
|
598
|
-
|
|
620
|
+
/* @__PURE__ */ l(H.Portal, { children: /* @__PURE__ */ l(
|
|
621
|
+
H.Content,
|
|
599
622
|
{
|
|
600
623
|
sideOffset: 4,
|
|
601
624
|
align: "start",
|
|
602
|
-
className:
|
|
625
|
+
className: je,
|
|
603
626
|
children: J
|
|
604
627
|
}
|
|
605
628
|
) })
|
|
606
629
|
] });
|
|
607
630
|
}
|
|
608
631
|
);
|
|
609
|
-
|
|
632
|
+
Ke.displayName = "ColorPicker";
|
|
610
633
|
function se({
|
|
611
634
|
level: e,
|
|
612
635
|
passes: t,
|
|
@@ -628,7 +651,7 @@ function se({
|
|
|
628
651
|
className: "ds:size-4 ds:text-[var(--success)]"
|
|
629
652
|
}
|
|
630
653
|
) : /* @__PURE__ */ l(
|
|
631
|
-
|
|
654
|
+
Me,
|
|
632
655
|
{
|
|
633
656
|
"aria-hidden": "true",
|
|
634
657
|
className: "ds:size-4 ds:text-[var(--destructive)]"
|
|
@@ -637,13 +660,13 @@ function se({
|
|
|
637
660
|
/* @__PURE__ */ l("span", { className: "ds:sr-only", children: t ? r("inputs.colorPicker.contrastPass", "Pass") : r("inputs.colorPicker.contrastFail", "Fail") })
|
|
638
661
|
] });
|
|
639
662
|
}
|
|
640
|
-
function
|
|
663
|
+
function K({
|
|
641
664
|
label: e,
|
|
642
665
|
gradient: t,
|
|
643
666
|
min: r,
|
|
644
667
|
max: a,
|
|
645
668
|
value: n,
|
|
646
|
-
onChange:
|
|
669
|
+
onChange: d,
|
|
647
670
|
formatValue: c,
|
|
648
671
|
disabled: m
|
|
649
672
|
}) {
|
|
@@ -665,7 +688,7 @@ function j({
|
|
|
665
688
|
max: a,
|
|
666
689
|
step: 1,
|
|
667
690
|
value: [n],
|
|
668
|
-
onValueChange: ([
|
|
691
|
+
onValueChange: ([w]) => d(w),
|
|
669
692
|
"aria-label": e,
|
|
670
693
|
formatValue: c,
|
|
671
694
|
disabled: m,
|
|
@@ -676,8 +699,8 @@ function j({
|
|
|
676
699
|
] });
|
|
677
700
|
}
|
|
678
701
|
export {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
702
|
+
He as A,
|
|
703
|
+
ts as B,
|
|
704
|
+
Ke as C
|
|
682
705
|
};
|
|
683
|
-
//# sourceMappingURL=color-picker-
|
|
706
|
+
//# sourceMappingURL=color-picker-FXpItIaF.js.map
|