@alfadocs/ui-kit-debug 0.93.0 → 0.94.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/_chunks/apexcharts-theme-fAQXLIMW.js +67 -0
- package/dist/_chunks/apexcharts-theme-fAQXLIMW.js.map +1 -0
- package/dist/_chunks/{chart-CNaLgvx4.js → chart-DqxVCm1I.js} +288 -257
- package/dist/_chunks/chart-DqxVCm1I.js.map +1 -0
- package/dist/_chunks/{date-range-picker-Cc4DLAL2.js → date-range-picker-Cfv4Sr63.js} +231 -223
- package/dist/_chunks/date-range-picker-Cfv4Sr63.js.map +1 -0
- package/dist/_chunks/{link-cell-renderer-DQjZeoAr.js → link-cell-renderer-_LDZhY4r.js} +2 -2
- package/dist/_chunks/{link-cell-renderer-DQjZeoAr.js.map → link-cell-renderer-_LDZhY4r.js.map} +1 -1
- package/dist/_chunks/{patient-table-DU_zFZoq.js → patient-table-CFM92QqU.js} +2 -2
- package/dist/_chunks/{patient-table-DU_zFZoq.js.map → patient-table-CFM92QqU.js.map} +1 -1
- package/dist/_chunks/{radiograph-panel.agent-rnrQZtK3.js → radiograph-panel.agent-DDnDGVpN.js} +2 -2
- package/dist/_chunks/{radiograph-panel.agent-rnrQZtK3.js.map → radiograph-panel.agent-DDnDGVpN.js.map} +1 -1
- package/dist/_chunks/{sparkline-iOXYgvJe.js → sparkline-o6JH4O66.js} +2 -2
- package/dist/_chunks/{sparkline-iOXYgvJe.js.map → sparkline-o6JH4O66.js.map} +1 -1
- package/dist/agent-catalog.json +9 -1
- package/dist/components/chart/chart.agent.d.ts.map +1 -1
- package/dist/components/chart/chart.d.ts +20 -0
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts +12 -0
- package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/index.js +6 -6
- package/dist/tokens/apexcharts-theme.d.ts +36 -1
- package/dist/tokens/apexcharts-theme.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/_chunks/apexcharts-theme-BJigns_V.js +0 -53
- package/dist/_chunks/apexcharts-theme-BJigns_V.js.map +0 -1
- package/dist/_chunks/chart-CNaLgvx4.js.map +0 -1
- package/dist/_chunks/date-range-picker-Cc4DLAL2.js.map +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useEffect as u } from "react";
|
|
2
|
+
const s = [
|
|
3
|
+
"a[href]",
|
|
4
|
+
"button",
|
|
5
|
+
"input",
|
|
6
|
+
"select",
|
|
7
|
+
"textarea",
|
|
8
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
9
|
+
].join(",");
|
|
10
|
+
function i(t) {
|
|
11
|
+
u(() => {
|
|
12
|
+
const e = t.current;
|
|
13
|
+
if (!e) return;
|
|
14
|
+
const r = () => {
|
|
15
|
+
e.querySelectorAll('[aria-hidden="true"]').forEach((n) => {
|
|
16
|
+
n.querySelectorAll(s).forEach((c) => {
|
|
17
|
+
c.setAttribute("tabindex", "-1");
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
r();
|
|
22
|
+
const o = new MutationObserver(r);
|
|
23
|
+
return o.observe(e, {
|
|
24
|
+
childList: !0,
|
|
25
|
+
subtree: !0,
|
|
26
|
+
attributes: !0,
|
|
27
|
+
attributeFilter: ["aria-hidden", "tabindex"]
|
|
28
|
+
}), () => o.disconnect();
|
|
29
|
+
}, [t]);
|
|
30
|
+
}
|
|
31
|
+
function a(t) {
|
|
32
|
+
if (typeof document > "u" || !t) return t;
|
|
33
|
+
const e = document.createElement("span");
|
|
34
|
+
e.style.backgroundColor = t, document.documentElement.appendChild(e);
|
|
35
|
+
const r = getComputedStyle(e).backgroundColor;
|
|
36
|
+
return e.remove(), r || t;
|
|
37
|
+
}
|
|
38
|
+
function l() {
|
|
39
|
+
const t = getComputedStyle(document.documentElement), e = (o) => t.getPropertyValue(o).trim();
|
|
40
|
+
return {
|
|
41
|
+
theme: { mode: document.documentElement.classList.contains("theme-dark") ? "dark" : "light" },
|
|
42
|
+
colors: [
|
|
43
|
+
e("--primary"),
|
|
44
|
+
e("--accent"),
|
|
45
|
+
e("--success"),
|
|
46
|
+
e("--warning")
|
|
47
|
+
],
|
|
48
|
+
chart: {
|
|
49
|
+
background: e("--background"),
|
|
50
|
+
foreColor: e("--foreground"),
|
|
51
|
+
fontFamily: e("--font-sans")
|
|
52
|
+
},
|
|
53
|
+
grid: { borderColor: e("--border") },
|
|
54
|
+
compare: {
|
|
55
|
+
// `--muted-foreground` is a plain `var(--color-blue-*)` chain — already a
|
|
56
|
+
// usable colour, so no probe is needed.
|
|
57
|
+
mark: e("--muted-foreground"),
|
|
58
|
+
// `--calendar-compare-fill` is a `color-mix()` string — resolve it.
|
|
59
|
+
wash: a(e("--calendar-compare-fill"))
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
l as g,
|
|
65
|
+
i as u
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=apexcharts-theme-fAQXLIMW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apexcharts-theme-fAQXLIMW.js","sources":["../../src/components/_shared/use-neutralize-hidden-focus.ts","../../src/tokens/apexcharts-theme.ts"],"sourcesContent":["import { useEffect, type RefObject } from 'react';\n\n/* -------------------------------------------------------------------- */\n/* useNeutraliseHiddenFocus */\n/* */\n/* axe's `aria-hidden-focus` rule (correctly) flags focusable */\n/* descendants of `aria-hidden=\"true\"` subtrees. Several DS components */\n/* embed third-party renders (ApexCharts, FullCalendar) that inject */\n/* focusable elements (canvases with tabindex, anchor wrappers) inside */\n/* a wrapper that we deliberately mark `aria-hidden` because the outer */\n/* element carries the accessible name (`role=\"img\"` + `aria-label`). */\n/* */\n/* This hook walks the ref tree on mount and on subtree mutation, and */\n/* sets `tabindex=\"-1\"` on focusable descendants of any aria-hidden */\n/* ancestor. Cheaper than forking the third-party render and keeps the */\n/* fix scoped to the component using it. */\n/* -------------------------------------------------------------------- */\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button',\n 'input',\n 'select',\n 'textarea',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\nexport function useNeutraliseHiddenFocus<T extends HTMLElement>(\n containerRef: RefObject<T | null>,\n): void {\n useEffect(() => {\n const root = containerRef.current;\n if (!root) return undefined;\n\n const neutralise = () => {\n root\n .querySelectorAll<HTMLElement>('[aria-hidden=\"true\"]')\n .forEach((hidden) => {\n hidden\n .querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)\n .forEach((el) => {\n el.setAttribute('tabindex', '-1');\n });\n });\n };\n\n neutralise();\n const observer = new MutationObserver(neutralise);\n observer.observe(root, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['aria-hidden', 'tabindex'],\n });\n return () => observer.disconnect();\n }, [containerRef]);\n}\n","import type ApexCharts from 'apexcharts';\n\n/**\n * Resolved colours for a `ChartSeries` `role: 'compare'` overlay (see\n * `src/components/chart/chart.tsx`). ApexCharts cannot read `var(--…)` or a\n * `color-mix()` string, so both are resolved to a usable colour value here —\n * the same native way the ramp resolves `--primary` — and re-read on the\n * chart's existing theme MutationObserver, so they retint per theme with no\n * new observer and no hex literal in component code.\n */\nexport interface ApexCompareColors {\n /**\n * Load-bearing solid neutral grey — the compare line stroke, the compare bar\n * fill base, the area gradient source, and the greyed legend swatch. Sourced\n * from `--muted-foreground` (a plain `var(--color-blue-*)` chain), which\n * `getPropertyValue` already returns as a usable colour. Solid so it clears\n * WCAG 1.4.11 3:1 as a graphical object — which the 55% `--calendar-compare-edge`\n * mix does not.\n */\n mark: string;\n /**\n * Decorative faint grey wash for the compare area gradient tint only.\n * Sourced from `--calendar-compare-fill`, which is a `color-mix()` string\n * that `getPropertyValue` returns UNRESOLVED, so it is resolved via a\n * detached probe (see `resolveColour`).\n */\n wash: string;\n}\n\n/** The theme-bridge output, plus resolved compare-overlay colours. */\nexport interface ApexChartsTheme extends ApexCharts.ApexOptions {\n /**\n * Resolved compare-overlay colours. Read ONLY inside the chart's\n * `hasCompare` branches and never spread into the ApexCharts options object,\n * so a chart with no compare series emits byte-identical options.\n */\n compare?: ApexCompareColors;\n}\n\n/**\n * Resolve a colour-accepting token value the ApexCharts way: set it on a real\n * colour property of a detached probe appended to `document.documentElement`\n * (which carries the active `theme-*` class, so a per-theme `color-mix()`\n * resolves to the correct grey), read the computed value back, then remove the\n * probe. Returns the input untouched when there is no DOM (SSR) or when the\n * browser rejected the value.\n *\n * The probe mutates only `documentElement`'s child list, never its `class`\n * attribute, so it does not trip the chart's class-only MutationObserver.\n */\nfunction resolveColour(value: string): string {\n if (typeof document === 'undefined' || !value) return value;\n const probe = document.createElement('span');\n probe.style.backgroundColor = value;\n document.documentElement.appendChild(probe);\n const resolved = getComputedStyle(probe).backgroundColor;\n probe.remove();\n return resolved || value;\n}\n\nexport function getApexChartsTheme(): ApexChartsTheme {\n const styles = getComputedStyle(document.documentElement);\n const get = (v: string) => styles.getPropertyValue(v).trim();\n const isDark = document.documentElement.classList.contains('theme-dark');\n return {\n theme: { mode: isDark ? 'dark' : 'light' },\n colors: [\n get('--primary'),\n get('--accent'),\n get('--success'),\n get('--warning'),\n ],\n chart: {\n background: get('--background'),\n foreColor: get('--foreground'),\n fontFamily: get('--font-sans'),\n },\n grid: { borderColor: get('--border') },\n compare: {\n // `--muted-foreground` is a plain `var(--color-blue-*)` chain — already a\n // usable colour, so no probe is needed.\n mark: get('--muted-foreground'),\n // `--calendar-compare-fill` is a `color-mix()` string — resolve it.\n wash: resolveColour(get('--calendar-compare-fill')),\n },\n };\n}\n"],"names":["FOCUSABLE_SELECTOR","useNeutraliseHiddenFocus","containerRef","useEffect","root","neutralise","hidden","el","observer","resolveColour","value","probe","resolved","getApexChartsTheme","styles","get","v"],"mappings":";AAkBA,MAAMA,IAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG;AAEH,SAASC,EACdC,GACM;AACN,EAAAC,EAAU,MAAM;AACd,UAAMC,IAAOF,EAAa;AAC1B,QAAI,CAACE,EAAM;AAEX,UAAMC,IAAa,MAAM;AACvB,MAAAD,EACG,iBAA8B,sBAAsB,EACpD,QAAQ,CAACE,MAAW;AACnB,QAAAA,EACG,iBAA8BN,CAAkB,EAChD,QAAQ,CAACO,MAAO;AACf,UAAAA,EAAG,aAAa,YAAY,IAAI;AAAA,QAClC,CAAC;AAAA,MACL,CAAC;AAAA,IACL;AAEA,IAAAF,EAAA;AACA,UAAMG,IAAW,IAAI,iBAAiBH,CAAU;AAChD,WAAAG,EAAS,QAAQJ,GAAM;AAAA,MACrB,WAAW;AAAA,MACX,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,iBAAiB,CAAC,eAAe,UAAU;AAAA,IAAA,CAC5C,GACM,MAAMI,EAAS,WAAA;AAAA,EACxB,GAAG,CAACN,CAAY,CAAC;AACnB;ACNA,SAASO,EAAcC,GAAuB;AAC5C,MAAI,OAAO,WAAa,OAAe,CAACA,EAAO,QAAOA;AACtD,QAAMC,IAAQ,SAAS,cAAc,MAAM;AAC3C,EAAAA,EAAM,MAAM,kBAAkBD,GAC9B,SAAS,gBAAgB,YAAYC,CAAK;AAC1C,QAAMC,IAAW,iBAAiBD,CAAK,EAAE;AACzC,SAAAA,EAAM,OAAA,GACCC,KAAYF;AACrB;AAEO,SAASG,IAAsC;AACpD,QAAMC,IAAS,iBAAiB,SAAS,eAAe,GAClDC,IAAM,CAACC,MAAcF,EAAO,iBAAiBE,CAAC,EAAE,KAAA;AAEtD,SAAO;AAAA,IACL,OAAO,EAAE,MAFI,SAAS,gBAAgB,UAAU,SAAS,YAAY,IAE7C,SAAS,QAAA;AAAA,IACjC,QAAQ;AAAA,MACND,EAAI,WAAW;AAAA,MACfA,EAAI,UAAU;AAAA,MACdA,EAAI,WAAW;AAAA,MACfA,EAAI,WAAW;AAAA,IAAA;AAAA,IAEjB,OAAO;AAAA,MACL,YAAYA,EAAI,cAAc;AAAA,MAC9B,WAAWA,EAAI,cAAc;AAAA,MAC7B,YAAYA,EAAI,aAAa;AAAA,IAAA;AAAA,IAE/B,MAAM,EAAE,aAAaA,EAAI,UAAU,EAAA;AAAA,IACnC,SAAS;AAAA;AAAA;AAAA,MAGP,MAAMA,EAAI,oBAAoB;AAAA;AAAA,MAE9B,MAAMN,EAAcM,EAAI,yBAAyB,CAAC;AAAA,IAAA;AAAA,EACpD;AAEJ;"}
|