@42-central/ui-react 0.20.1 → 0.22.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/{chunk-45QRQKRC.js → chunk-3L5GLI67.js} +12 -8
- package/dist/chunk-3L5GLI67.js.map +1 -0
- package/dist/{chunk-BNWQ7IAZ.js → chunk-4FEOMQYR.js} +5 -5
- package/dist/{chunk-BNWQ7IAZ.js.map → chunk-4FEOMQYR.js.map} +1 -1
- package/dist/{chunk-POKLPMSB.js → chunk-D3JYDAUZ.js} +3 -3
- package/dist/{chunk-POKLPMSB.js.map → chunk-D3JYDAUZ.js.map} +1 -1
- package/dist/{chunk-KMZENCEP.js → chunk-DHJB4UJD.js} +4 -4
- package/dist/{chunk-KMZENCEP.js.map → chunk-DHJB4UJD.js.map} +1 -1
- package/dist/{chunk-IOYZC7SA.js → chunk-DJAXXLN6.js} +3 -3
- package/dist/{chunk-IOYZC7SA.js.map → chunk-DJAXXLN6.js.map} +1 -1
- package/dist/{chunk-3BXKTWWD.js → chunk-FB2G4LNH.js} +5 -5
- package/dist/{chunk-3BXKTWWD.js.map → chunk-FB2G4LNH.js.map} +1 -1
- package/dist/{chunk-E63VD25L.js → chunk-HQPU73WV.js} +4 -4
- package/dist/{chunk-E63VD25L.js.map → chunk-HQPU73WV.js.map} +1 -1
- package/dist/{chunk-RCF7HTG5.js → chunk-IRNF274I.js} +5 -5
- package/dist/chunk-IRNF274I.js.map +1 -0
- package/dist/{chunk-O5W3QWJ6.js → chunk-J44FJ7PH.js} +3 -3
- package/dist/{chunk-O5W3QWJ6.js.map → chunk-J44FJ7PH.js.map} +1 -1
- package/dist/{chunk-TWLJQE75.js → chunk-MRAJ45IM.js} +4 -4
- package/dist/{chunk-TWLJQE75.js.map → chunk-MRAJ45IM.js.map} +1 -1
- package/dist/{chunk-5HUEBSIS.js → chunk-N66NC6QK.js} +120 -24
- package/dist/chunk-N66NC6QK.js.map +1 -0
- package/dist/{chunk-SXNAUSEB.js → chunk-OZMSXYBX.js} +4 -4
- package/dist/{chunk-SXNAUSEB.js.map → chunk-OZMSXYBX.js.map} +1 -1
- package/dist/{chunk-LBAE6FP6.js → chunk-SZEOTXRZ.js} +4 -4
- package/dist/{chunk-LBAE6FP6.js.map → chunk-SZEOTXRZ.js.map} +1 -1
- package/dist/chunk-V6PY7C6S.js +18 -0
- package/dist/chunk-V6PY7C6S.js.map +1 -0
- package/dist/{chunk-MKKQE3TM.js → chunk-YPFSRZ3T.js} +4 -4
- package/dist/{chunk-MKKQE3TM.js.map → chunk-YPFSRZ3T.js.map} +1 -1
- package/dist/{chunk-NJPHZBLI.js → chunk-YWTOW7PZ.js} +5 -5
- package/dist/{chunk-NJPHZBLI.js.map → chunk-YWTOW7PZ.js.map} +1 -1
- package/dist/{chunk-VTDBWU6H.js → chunk-YZJUPYPO.js} +3 -3
- package/dist/{chunk-VTDBWU6H.js.map → chunk-YZJUPYPO.js.map} +1 -1
- package/dist/components/autocomplete/index.js +4 -3
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/calendar-heatmap/calendar-heatmap-grid.d.ts +94 -0
- package/dist/components/calendar-heatmap/calendar-heatmap-grid.d.ts.map +1 -0
- package/dist/components/calendar-heatmap/calendar-heatmap.d.ts +76 -0
- package/dist/components/calendar-heatmap/calendar-heatmap.d.ts.map +1 -0
- package/dist/components/calendar-heatmap/index.d.ts +2 -0
- package/dist/components/calendar-heatmap/index.d.ts.map +1 -0
- package/dist/components/calendar-heatmap/index.js +311 -0
- package/dist/components/calendar-heatmap/index.js.map +1 -0
- package/dist/components/camera/index.js +6 -5
- package/dist/components/clipboard/index.js +1 -1
- package/dist/components/code-block/chrome.js +4 -4
- package/dist/components/code-block/index.js +5 -5
- package/dist/components/combobox/index.js +4 -3
- package/dist/components/combobox-list/index.js +6 -5
- package/dist/components/data-table/index.js +16 -16
- package/dist/components/date-picker/index.js +7 -6
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/hover-card/hover-card.d.ts +44 -26
- package/dist/components/hover-card/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card/index.js +35 -53
- package/dist/components/hover-card/index.js.map +1 -1
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/menu/index.js +3 -3
- package/dist/components/menu/menu.d.ts +7 -5
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +6 -5
- package/dist/components/multi-select/index.js +5 -4
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/navigation-progress/index.d.ts +2 -0
- package/dist/components/navigation-progress/index.d.ts.map +1 -0
- package/dist/components/navigation-progress/index.js +133 -0
- package/dist/components/navigation-progress/index.js.map +1 -0
- package/dist/components/navigation-progress/navigation-progress.d.ts +46 -0
- package/dist/components/navigation-progress/navigation-progress.d.ts.map +1 -0
- package/dist/components/number-input/index.js +4 -3
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/password-input/index.js +1 -1
- package/dist/components/photo-capture/index.js +6 -5
- package/dist/components/photo-capture/index.js.map +1 -1
- package/dist/components/pills-input/index.js +2 -2
- package/dist/components/pin-input/index.js +1 -1
- package/dist/components/popover/index.d.ts +1 -1
- package/dist/components/popover/index.d.ts.map +1 -1
- package/dist/components/popover/index.js +2 -1
- package/dist/components/popover/popover.d.ts +44 -29
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/schedule/index.js +2 -2
- package/dist/components/select/index.js +5 -4
- package/dist/components/spotlight/index.js +5 -4
- package/dist/components/spotlight/index.js.map +1 -1
- package/dist/components/tags-input/index.js +4 -3
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/text-input/index.js +1 -1
- package/dist/components/textarea/index.js +1 -1
- package/dist/components/time-input/index.js +5 -4
- package/dist/components/time-input/index.js.map +1 -1
- package/dist/components/tooltip/index.js +2 -2
- package/dist/components/tree-multi-select/index.js +5 -4
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-select/index.js +4 -3
- package/dist/components/tree-select/index.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/placement.d.ts +42 -1
- package/dist/lib/placement.d.ts.map +1 -1
- package/dist/lib/slide-on-switch.d.ts +69 -0
- package/dist/lib/slide-on-switch.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/as-child.contract.test.tsx +4 -0
- package/src/components/calendar-heatmap/calendar-heatmap-grid.test.ts +186 -0
- package/src/components/calendar-heatmap/calendar-heatmap-grid.ts +192 -0
- package/src/components/calendar-heatmap/calendar-heatmap.test.tsx +180 -0
- package/src/components/calendar-heatmap/calendar-heatmap.tsx +385 -0
- package/src/components/calendar-heatmap/index.ts +11 -0
- package/src/components/hover-card/hover-card.tsx +89 -167
- package/src/components/input/input.test.tsx +23 -0
- package/src/components/input/input.tsx +10 -6
- package/src/components/menu/menu.tsx +16 -9
- package/src/components/navigation-progress/index.ts +14 -0
- package/src/components/navigation-progress/navigation-progress.test.tsx +184 -0
- package/src/components/navigation-progress/navigation-progress.tsx +228 -0
- package/src/components/number-input/number-input.tsx +3 -4
- package/src/components/popover/index.ts +2 -0
- package/src/components/popover/popover.test.tsx +131 -0
- package/src/components/popover/popover.tsx +191 -53
- package/src/lib/placement.test.ts +37 -0
- package/src/lib/placement.ts +60 -1
- package/src/lib/slide-on-switch.ts +99 -0
- package/dist/chunk-45QRQKRC.js.map +0 -1
- package/dist/chunk-5HUEBSIS.js.map +0 -1
- package/dist/chunk-G52U24GR.js +0 -10
- package/dist/chunk-G52U24GR.js.map +0 -1
- package/dist/chunk-RCF7HTG5.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CodeBlockButton, CodeBlockChrome } from '../../chunk-
|
|
2
|
-
export { CodeBlockButton } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
1
|
+
import { CodeBlockButton, CodeBlockChrome } from '../../chunk-HQPU73WV.js';
|
|
2
|
+
export { CodeBlockButton } from '../../chunk-HQPU73WV.js';
|
|
3
|
+
import '../../chunk-YZJUPYPO.js';
|
|
4
|
+
import '../../chunk-N66NC6QK.js';
|
|
5
|
+
import '../../chunk-V6PY7C6S.js';
|
|
6
6
|
import '../../chunk-7P32XCEU.js';
|
|
7
7
|
import '../../chunk-H7WOMZXO.js';
|
|
8
8
|
import '../../chunk-PMUCGFY5.js';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { Combobox } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
2
|
+
export { Combobox } from '../../chunk-YPFSRZ3T.js';
|
|
3
|
+
import '../../chunk-3L5GLI67.js';
|
|
4
4
|
import '../../chunk-VD6PB3VA.js';
|
|
5
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-N66NC6QK.js';
|
|
6
|
+
import '../../chunk-V6PY7C6S.js';
|
|
6
7
|
import '../../chunk-7P32XCEU.js';
|
|
7
8
|
import '../../chunk-H7WOMZXO.js';
|
|
8
9
|
import '../../chunk-PMUCGFY5.js';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { ComboboxList } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
2
|
+
export { ComboboxList } from '../../chunk-4FEOMQYR.js';
|
|
3
|
+
import '../../chunk-OZMSXYBX.js';
|
|
4
4
|
import '../../chunk-7TDHT3QD.js';
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-YPFSRZ3T.js';
|
|
6
|
+
import '../../chunk-3L5GLI67.js';
|
|
7
7
|
import '../../chunk-VD6PB3VA.js';
|
|
8
|
-
import '../../chunk-
|
|
8
|
+
import '../../chunk-N66NC6QK.js';
|
|
9
|
+
import '../../chunk-V6PY7C6S.js';
|
|
9
10
|
import '../../chunk-7P32XCEU.js';
|
|
10
11
|
import '../../chunk-H7WOMZXO.js';
|
|
11
12
|
import '../../chunk-PMUCGFY5.js';
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ThemeIcon } from '../../chunk-7CNDZZZ6.js';
|
|
3
|
-
import '../../chunk-
|
|
3
|
+
import '../../chunk-J2WSKRJW.js';
|
|
4
4
|
import { Table } from '../../chunk-SVKN5ZHX.js';
|
|
5
5
|
import { Text } from '../../chunk-XKDL4QS6.js';
|
|
6
|
-
import '../../chunk-J2WSKRJW.js';
|
|
7
6
|
import '../../chunk-R5GMMWAY.js';
|
|
8
7
|
import '../../chunk-BJZLQTAZ.js';
|
|
9
|
-
import { Root, Trigger, Content, CheckboxItem } from '../../chunk-
|
|
10
|
-
import { MultiComboboxList } from '../../chunk-
|
|
8
|
+
import { Root, Trigger, Content, CheckboxItem } from '../../chunk-IRNF274I.js';
|
|
9
|
+
import { MultiComboboxList } from '../../chunk-SZEOTXRZ.js';
|
|
11
10
|
import { Pill } from '../../chunk-6M6YZ3PQ.js';
|
|
12
11
|
import { Flex } from '../../chunk-UXPINIDN.js';
|
|
13
12
|
import '../../chunk-XFEPUGUZ.js';
|
|
14
|
-
import { ComboboxList } from '../../chunk-BNWQ7IAZ.js';
|
|
15
|
-
import '../../chunk-SXNAUSEB.js';
|
|
16
|
-
import { serializeDateValue, DatePicker } from '../../chunk-NJPHZBLI.js';
|
|
17
|
-
import { resolveHourCycle } from '../../chunk-POKLPMSB.js';
|
|
18
|
-
import '../../chunk-C4NFRSOR.js';
|
|
19
|
-
import { NUMBER_INPUT_DEFAULT_TRANSLATIONS, NumberInput } from '../../chunk-KMZENCEP.js';
|
|
20
13
|
import '../../chunk-FMMKEYHB.js';
|
|
14
|
+
import { ComboboxList } from '../../chunk-4FEOMQYR.js';
|
|
15
|
+
import '../../chunk-OZMSXYBX.js';
|
|
16
|
+
import { serializeDateValue, DatePicker } from '../../chunk-YWTOW7PZ.js';
|
|
17
|
+
import { resolveHourCycle } from '../../chunk-D3JYDAUZ.js';
|
|
18
|
+
import '../../chunk-C4NFRSOR.js';
|
|
19
|
+
import { NUMBER_INPUT_DEFAULT_TRANSLATIONS, NumberInput } from '../../chunk-DHJB4UJD.js';
|
|
21
20
|
import { Checkbox } from '../../chunk-6VYGK3Q3.js';
|
|
22
21
|
import '../../chunk-NLOBBJAA.js';
|
|
23
22
|
import { resolveCalendarTranslations } from '../../chunk-MXAACRWE.js';
|
|
24
23
|
import '../../chunk-ZB5VMGKB.js';
|
|
25
|
-
import
|
|
24
|
+
import '../../chunk-ZP6EBROY.js';
|
|
26
25
|
import { Skeleton } from '../../chunk-TWNIAF7K.js';
|
|
26
|
+
import { Select } from '../../chunk-FB2G4LNH.js';
|
|
27
27
|
import { Card } from '../../chunk-2MXWEIMD.js';
|
|
28
28
|
import { Drawer } from '../../chunk-O7LS6OZR.js';
|
|
29
29
|
import '../../chunk-DA4QII2N.js';
|
|
30
30
|
import '../../chunk-7TDHT3QD.js';
|
|
31
|
+
import { COMBOBOX_DEFAULT_TRANSLATIONS } from '../../chunk-YPFSRZ3T.js';
|
|
31
32
|
import '../../chunk-5FDOOG4J.js';
|
|
32
|
-
import {
|
|
33
|
-
import { Input } from '../../chunk-45QRQKRC.js';
|
|
33
|
+
import { Input } from '../../chunk-3L5GLI67.js';
|
|
34
34
|
import '../../chunk-VD6PB3VA.js';
|
|
35
35
|
import '../../chunk-DHM4IG2O.js';
|
|
36
36
|
import '../../chunk-SKPM2FRX.js';
|
|
@@ -39,9 +39,9 @@ import { Button } from '../../chunk-SWVUXEBT.js';
|
|
|
39
39
|
import { useDebouncedCallback } from '../../chunk-ZYX564HO.js';
|
|
40
40
|
import '../../chunk-HBWV5EPU.js';
|
|
41
41
|
import { useLocale, useTimeZone } from '../../chunk-IPYHTCFL.js';
|
|
42
|
-
import { Tooltip } from '../../chunk-
|
|
43
|
-
import '../../chunk-
|
|
44
|
-
import
|
|
42
|
+
import { Tooltip } from '../../chunk-YZJUPYPO.js';
|
|
43
|
+
import { Popover } from '../../chunk-N66NC6QK.js';
|
|
44
|
+
import '../../chunk-V6PY7C6S.js';
|
|
45
45
|
import '../../chunk-7P32XCEU.js';
|
|
46
46
|
import '../../chunk-H7WOMZXO.js';
|
|
47
47
|
import { ActionIcon } from '../../chunk-BE2LWUHY.js';
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { DatePicker } from '../../chunk-
|
|
3
|
-
export { DatePicker } from '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
2
|
+
import { DatePicker } from '../../chunk-YWTOW7PZ.js';
|
|
3
|
+
export { DatePicker } from '../../chunk-YWTOW7PZ.js';
|
|
4
|
+
import '../../chunk-D3JYDAUZ.js';
|
|
5
5
|
import '../../chunk-C4NFRSOR.js';
|
|
6
|
-
import '../../chunk-
|
|
6
|
+
import '../../chunk-DHJB4UJD.js';
|
|
7
7
|
import '../../chunk-MXAACRWE.js';
|
|
8
8
|
import { dateToCalendarValue } from '../../chunk-ZB5VMGKB.js';
|
|
9
9
|
import '../../chunk-5FDOOG4J.js';
|
|
10
|
-
import '../../chunk-
|
|
10
|
+
import '../../chunk-3L5GLI67.js';
|
|
11
11
|
import '../../chunk-VD6PB3VA.js';
|
|
12
12
|
import '../../chunk-DHM4IG2O.js';
|
|
13
13
|
import '../../chunk-SWVUXEBT.js';
|
|
14
14
|
import '../../chunk-HBWV5EPU.js';
|
|
15
15
|
import '../../chunk-IPYHTCFL.js';
|
|
16
|
-
import '../../chunk-
|
|
16
|
+
import '../../chunk-N66NC6QK.js';
|
|
17
|
+
import '../../chunk-V6PY7C6S.js';
|
|
17
18
|
import '../../chunk-7P32XCEU.js';
|
|
18
19
|
import '../../chunk-H7WOMZXO.js';
|
|
19
20
|
import '../../chunk-BE2LWUHY.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/date-predicates.ts","../../../src/components/date-picker/aliases.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/date-predicates.ts","../../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CAAA;AAC3F;AAGK,IAAM,KAAA,GACX,CAAA,GAAI,UAAA,KACJ,CAAC,IAAA,EAAM,QAAA,KACL,UAAA,CAAW,IAAA,CAAK,CAAC,SAAA,KAAc,SAAA,CAAU,IAAA,EAAM,QAAQ,CAAC;AAGrD,IAAM,KAAA,GACX,CAAA,GAAI,UAAA,KACJ,CAAC,IAAA,EAAM,QAAA,KACL,UAAA,CAAW,KAAA,CAAM,CAAC,SAAA,KAAc,SAAA,CAAU,IAAA,EAAM,QAAQ,CAAC;ACtEtD,IAAM,eAAA,GAAkB,CAAC,KAAA,qBAAgC,GAAA,CAAC,cAAY,GAAG,KAAA,EAAO,OAAK,IAAA,EAAC;AAItF,IAAM,cAAA,GAAiB,CAAC,KAAA,qBAA+B,GAAA,CAAC,cAAY,GAAG,KAAA,EAAO,UAAQ,IAAA,EAAC;AAIvF,IAAM,mBAAA,GAAsB,CAAC,KAAA,qBAClC,GAAA,CAAC,UAAA,EAAA,EAAY,GAAG,KAAA,EAAO,KAAA,EAAK,IAAA,EAAC,QAAA,EAAQ,IAAA,EAAC","file":"index.js","sourcesContent":["import { getLocalTimeZone, isSameDay, isWeekend, today } from \"@internationalized/date\"\nimport { dateToCalendarValue } from \"./date-value\"\n\n/**\n * RFC §7 (`docs/rfcs/date-picker.md`) restriction-predicate helpers — composable `DatePredicate`\n * callbacks for `Calendar`/`DatePicker`'s `isDateUnavailable`. They present a pure-`Date` surface,\n * converting internally via `lib/date-value.ts`'s boundary.\n *\n * isDateUnavailable={anyOf(disablePast(), disableWeekends())}\n *\n * The factories stay zero-arg (or value-only) so they read naturally at the call site; the zone\n * every conversion is interpreted in arrives as the predicate's *second argument*, which\n * `Calendar`/`DatePicker` fill in with the very `timeZone` they were given. A predicate therefore\n * can't disagree with the component restricting by it — `<Calendar timeZone=\"UTC\"\n * isDateUnavailable={disableWeekends()} />` disables UTC Saturdays whatever the host zone is,\n * instead of whichever days happened to be weekends where the code ran.\n */\n\n/** `isWeekend` needs a locale; these helpers don't take one, so the Gregorian Saturday/Sunday\n * convention is the v1 default. */\nconst WEEKEND_LOCALE = \"en-US\"\n\n/**\n * A day-restriction predicate: the candidate day, plus the `timeZone` to read it in.\n *\n * `Calendar`/`DatePicker` always pass their own resolved `timeZone` — the argument is optional\n * only so a predicate stays callable on its own (filtering a plain `Date[]`, a unit test), where\n * it falls back to the host zone exactly as before.\n */\nexport type DatePredicate = (date: Date, timeZone?: string) => boolean\n\n/** Disable every day before today, today itself included as available. Reads the clock on every\n * call rather than once at factory time, so a long-lived predicate's boundary keeps up as time\n * passes instead of going stale — same rationale as `schedule-predicates.ts`'s own `disablePast`. */\nexport const disablePast =\n (): DatePredicate =>\n (date, timeZone = getLocalTimeZone()) =>\n dateToCalendarValue(date, timeZone).compare(today(timeZone)) < 0\n\n/** Disable every day after today, today itself included as available. Same per-call clock read as\n * `disablePast`. */\nexport const disableFuture =\n (): DatePredicate =>\n (date, timeZone = getLocalTimeZone()) =>\n dateToCalendarValue(date, timeZone).compare(today(timeZone)) > 0\n\n/** Disable Saturdays/Sundays. */\nexport const disableWeekends =\n (): DatePredicate =>\n (date, timeZone = getLocalTimeZone()) =>\n isWeekend(dateToCalendarValue(date, timeZone), WEEKEND_LOCALE)\n\n/** Disable every day strictly before `boundary`. */\nexport const beforeDate =\n (boundary: Date): DatePredicate =>\n (date, timeZone = getLocalTimeZone()) =>\n dateToCalendarValue(date, timeZone).compare(dateToCalendarValue(boundary, timeZone)) < 0\n\n/** Disable every day strictly after `boundary`. */\nexport const afterDate =\n (boundary: Date): DatePredicate =>\n (date, timeZone = getLocalTimeZone()) =>\n dateToCalendarValue(date, timeZone).compare(dateToCalendarValue(boundary, timeZone)) > 0\n\n/** Disable an explicit set of days (matched by calendar day, not exact instant). */\nexport const disableDates =\n (dates: Date[]): DatePredicate =>\n (date, timeZone = getLocalTimeZone()) => {\n const value = dateToCalendarValue(date, timeZone)\n return dates.some((boundary) => isSameDay(value, dateToCalendarValue(boundary, timeZone)))\n }\n\n/** OR-combine predicates — unavailable if ANY predicate disables the day. */\nexport const anyOf =\n (...predicates: DatePredicate[]): DatePredicate =>\n (date, timeZone) =>\n predicates.some((predicate) => predicate(date, timeZone))\n\n/** AND-combine predicates — unavailable only if EVERY predicate disables the day. */\nexport const allOf =\n (...predicates: DatePredicate[]): DatePredicate =>\n (date, timeZone) =>\n predicates.every((predicate) => predicate(date, timeZone))\n","import { DatePicker, type DatePickerProps } from \"./date-picker\"\n\n/**\n * Named presets of `DatePicker`, not separate components. code-style.md's \"generic over\n * bespoke\" rule still holds: each one is a single line that pins `range` / `withTime`, with no\n * markup or behaviour of its own. They exist because these are the names people search for\n * (Mantine and MUI ship them), and because pinning `range` fixes the value type\n * (`DateRangeValue` instead of `Date | null`) without the caller writing the generic.\n */\n\nexport type DateRangePickerProps = Omit<DatePickerProps<true>, \"range\">\n/** `DateRangePicker` === `<DatePicker range />` — same component, narrowed value type. */\nexport const DateRangePicker = (props: DateRangePickerProps) => <DatePicker {...props} range />\n\nexport type DateTimePickerProps = Omit<DatePickerProps<false>, \"withTime\">\n/** `DateTimePicker` === `<DatePicker withTime />`. */\nexport const DateTimePicker = (props: DateTimePickerProps) => <DatePicker {...props} withTime />\n\nexport type DateTimeRangePickerProps = Omit<DatePickerProps<true>, \"range\" | \"withTime\">\n/** `DateTimeRangePicker` === `<DatePicker range withTime />`. */\nexport const DateTimeRangePicker = (props: DateTimeRangePickerProps) => (\n <DatePicker {...props} range withTime />\n)\n"]}
|
|
@@ -1,25 +1,52 @@
|
|
|
1
1
|
import { HoverCard as Ark } from "@ark-ui/react/hover-card";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
|
-
import { type LogicalPosition } from "../../lib/placement";
|
|
3
|
+
import { type LogicalPosition, type Placement, type PlacementProps } from "../../lib/placement";
|
|
4
4
|
import type { WithTestId } from "../../lib/test-id";
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* HoverCard — a rich preview panel on Ark UI's HoverCard, shown after a short
|
|
7
|
+
* hover/focus delay. It sits between `Popover` (a clickable, focus-trapping
|
|
8
|
+
* panel with no delay) and `Tooltip` (a delayed hint with no rich content):
|
|
9
|
+
* HoverCard is delayed *and* rich — the "hover a username, see a profile
|
|
10
|
+
* card" pattern. Ark owns the open/close state, the open/close delays,
|
|
11
|
+
* positioning, and dismiss-on-outside-interaction; the kit adds the portaled,
|
|
12
|
+
* animated panel chrome (reusing `Popover`'s surface).
|
|
13
|
+
*
|
|
14
|
+
* Unlike `Tooltip`, there's no single-call convenience form — a hover card's
|
|
15
|
+
* content is arbitrary rich markup, so it's compound-only, like `Popover`:
|
|
16
|
+
*
|
|
17
|
+
* <HoverCard.Root>
|
|
18
|
+
* <HoverCard.Trigger asChild>
|
|
19
|
+
* <a href="/norm">@the-norm</a>
|
|
20
|
+
* </HoverCard.Trigger>
|
|
21
|
+
* <HoverCard.Content>
|
|
22
|
+
* Rich <strong>preview</strong> content.
|
|
23
|
+
* </HoverCard.Content>
|
|
24
|
+
* </HoverCard.Root>
|
|
25
|
+
*
|
|
26
|
+
* Ark's machine defaults to a 600ms open delay and a 300ms close delay —
|
|
27
|
+
* long enough that an incidental pass of the cursor doesn't pop a card open.
|
|
28
|
+
* `HoverCard.Group` puts several trigger targets (e.g. a row of avatars) on
|
|
29
|
+
* one *shared* card instead: Ark's own HoverCard machine supports multiple
|
|
30
|
+
* named triggers under a single `Root`/`Content`, so hovering from one
|
|
31
|
+
* target to the next while the card is already open just repositions the
|
|
32
|
+
* same panel — no close/reopen, no delay replay — and it visibly slides
|
|
33
|
+
* between targets.
|
|
34
|
+
*
|
|
35
|
+
* Keep its content a preview. Ark's machine ignores touch, never lets focus
|
|
36
|
+
* into the card, and puts no `aria-expanded`/`aria-controls` on the trigger,
|
|
37
|
+
* because a hover card previews where its trigger *link* goes. For a card
|
|
38
|
+
* people act on (a copy button, a "View profile" link), use
|
|
39
|
+
* `<Popover.Root mode="hover">`. It keeps the delayed hover preview, and a
|
|
40
|
+
* click, tap or Enter pins it as a focusable, dismissable popover.
|
|
41
|
+
*/
|
|
6
42
|
/** `position` accepts Ark's physical placements plus the logical, RTL-aware
|
|
7
43
|
* horizontal sides `start` / `end` (resolved to `left` / `right` by direction). */
|
|
8
|
-
export type HoverCardPosition = LogicalPosition<
|
|
9
|
-
export type HoverCardRootProps = Omit<Ark.RootProps, "positioning" | "onOpenChange"> & {
|
|
44
|
+
export type HoverCardPosition = LogicalPosition<Placement>;
|
|
45
|
+
export type HoverCardRootProps = Omit<Ark.RootProps, "positioning" | "onOpenChange"> & PlacementProps & {
|
|
10
46
|
/** Match the trigger's width (`"target"`), or size to content (`"auto"`,
|
|
11
47
|
* default — a hover card's content is usually much larger than its
|
|
12
48
|
* trigger, unlike a dropdown). */
|
|
13
49
|
width?: "target" | "auto";
|
|
14
|
-
/** Panel placement relative to the trigger. Defaults to Ark's `"bottom"`. */
|
|
15
|
-
position?: HoverCardPosition;
|
|
16
|
-
/** Gap in px between the trigger and the panel. */
|
|
17
|
-
gutter?: number;
|
|
18
|
-
/** Positioner offset. */
|
|
19
|
-
offset?: {
|
|
20
|
-
mainAxis?: number | undefined;
|
|
21
|
-
crossAxis?: number | undefined;
|
|
22
|
-
} | undefined;
|
|
23
50
|
/** Render the panel in a Portal so it escapes clipping ancestors. Default `true`. */
|
|
24
51
|
withinPortal?: boolean;
|
|
25
52
|
/** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is
|
|
@@ -31,7 +58,7 @@ export type HoverCardRootProps = Omit<Ark.RootProps, "positioning" | "onOpenChan
|
|
|
31
58
|
* interaction, or a controlled `onOpenChange`. */
|
|
32
59
|
onClose?: () => void;
|
|
33
60
|
};
|
|
34
|
-
declare const Root: ({ width, position, gutter, offset, withinPortal, container, openDelay, children, onOpenChange, onClose, ...rest }: HoverCardRootProps) => import("react").JSX.Element;
|
|
61
|
+
declare const Root: ({ width, position, gutter, offset, hideWhenDetached, positioning, withinPortal, container, openDelay, children, onOpenChange, onClose, ...rest }: HoverCardRootProps) => import("react").JSX.Element;
|
|
35
62
|
export type HoverCardContentProps = Ark.ContentProps & WithTestId & {
|
|
36
63
|
/** Identifies which `HoverCard.Group` target this content belongs to —
|
|
37
64
|
* only meaningful inside `HoverCard.Group`, where several `Content`s
|
|
@@ -40,19 +67,10 @@ export type HoverCardContentProps = Ark.ContentProps & WithTestId & {
|
|
|
40
67
|
value?: string;
|
|
41
68
|
};
|
|
42
69
|
declare const Content: ({ className, children, testId, value: _value, ...rest }: HoverCardContentProps) => import("react").JSX.Element;
|
|
43
|
-
export type HoverCardGroupProps = Omit<Ark.RootProps, "positioning" | "onOpenChange" | "children"> & {
|
|
70
|
+
export type HoverCardGroupProps = Omit<Ark.RootProps, "positioning" | "onOpenChange" | "children"> & PlacementProps & {
|
|
44
71
|
/** Match every trigger's width (`"target"`), or size to content (`"auto"`,
|
|
45
72
|
* default). */
|
|
46
73
|
width?: "target" | "auto";
|
|
47
|
-
/** Panel placement relative to the active trigger. Defaults to Ark's `"bottom"`. */
|
|
48
|
-
position?: HoverCardPosition;
|
|
49
|
-
/** Gap in px between the active trigger and the panel. */
|
|
50
|
-
gutter?: number;
|
|
51
|
-
/** Positioner offset. */
|
|
52
|
-
offset?: {
|
|
53
|
-
mainAxis?: number | undefined;
|
|
54
|
-
crossAxis?: number | undefined;
|
|
55
|
-
} | undefined;
|
|
56
74
|
/** Render the panel in a Portal so it escapes clipping ancestors. Default `true`. */
|
|
57
75
|
withinPortal?: boolean;
|
|
58
76
|
/** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is
|
|
@@ -99,7 +117,7 @@ export type HoverCardGroupProps = Omit<Ark.RootProps, "positioning" | "onOpenCha
|
|
|
99
117
|
* as a props update on the *same* `Content`/`Positioner`/`Content` element
|
|
100
118
|
* tree, not an unmount-and-remount of a different one, which is what keeps
|
|
101
119
|
* it one real, continuous DOM node to slide. Paired with a CSS transition on
|
|
102
|
-
* the positioner's `transform` (`
|
|
120
|
+
* the positioner's `transform` (`slideStyle`, applied by `Content`
|
|
103
121
|
* whenever `sliding` is set), that reposition visibly slides the panel from
|
|
104
122
|
* one target to the next.
|
|
105
123
|
*
|
|
@@ -111,7 +129,7 @@ export type HoverCardGroupProps = Omit<Ark.RootProps, "positioning" | "onOpenCha
|
|
|
111
129
|
* trigger elements still land exactly there, since `Content` is portaled
|
|
112
130
|
* away separately.
|
|
113
131
|
*/
|
|
114
|
-
declare const Group: ({ width, position, gutter, offset, withinPortal, container, openDelay, children, onOpenChange, onClose, ...rest }: HoverCardGroupProps) => import("react").JSX.Element;
|
|
132
|
+
declare const Group: ({ width, position, gutter, offset, hideWhenDetached, positioning, withinPortal, container, openDelay, children, onOpenChange, onClose, ...rest }: HoverCardGroupProps) => import("react").JSX.Element;
|
|
115
133
|
export declare const HoverCard: {
|
|
116
134
|
Root: typeof Root;
|
|
117
135
|
Trigger: import("react").ForwardRefExoticComponent<Ark.TriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../../src/components/hover-card/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,IAAI,GAAG,EAAE,MAAM,0BAA0B,CAAA;AAG3D,OAAO,
|
|
1
|
+
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../../src/components/hover-card/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,IAAI,GAAG,EAAE,MAAM,0BAA0B,CAAA;AAG3D,OAAO,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAGjE,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAA;AAQ5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;oFACoF;AACpF,MAAM,MAAM,iBAAiB,GAAG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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,QAAA,MAAM,KAAK,qJAcR,mBAAmB,gCAqCrB,CAAA;AAED,eAAO,MAAM,SAAS;;;;;CAKrB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { slideStyle, popoverChrome, splitGroupChildren, useSlideAfterPlaced, activeGroupContent } from '../../chunk-N66NC6QK.js';
|
|
3
|
+
import { toPositioning } from '../../chunk-V6PY7C6S.js';
|
|
4
4
|
import { useOverlayContainer } from '../../chunk-7P32XCEU.js';
|
|
5
5
|
import '../../chunk-H7WOMZXO.js';
|
|
6
6
|
import '../../chunk-PMUCGFY5.js';
|
|
@@ -11,14 +11,9 @@ import { cn } from '../../chunk-4ASNIDV7.js';
|
|
|
11
11
|
import { HoverCard as HoverCard$1 } from '@ark-ui/react/hover-card';
|
|
12
12
|
import { useLocaleContext } from '@ark-ui/react/locale';
|
|
13
13
|
import { Portal } from '@ark-ui/react/portal';
|
|
14
|
-
import { createContext, useContext
|
|
14
|
+
import { createContext, useContext } from 'react';
|
|
15
15
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
16
16
|
|
|
17
|
-
var hoverCardSlideStyle = {
|
|
18
|
-
transitionProperty: "transform",
|
|
19
|
-
transitionDuration: "200ms",
|
|
20
|
-
transitionTimingFunction: "cubic-bezier(0.32, 0.72, 0, 1)"
|
|
21
|
-
};
|
|
22
17
|
var HoverCardContext = createContext({
|
|
23
18
|
width: "auto",
|
|
24
19
|
withinPortal: true,
|
|
@@ -26,9 +21,11 @@ var HoverCardContext = createContext({
|
|
|
26
21
|
});
|
|
27
22
|
var Root = ({
|
|
28
23
|
width = "auto",
|
|
29
|
-
position
|
|
24
|
+
position,
|
|
30
25
|
gutter,
|
|
31
26
|
offset,
|
|
27
|
+
hideWhenDetached,
|
|
28
|
+
positioning,
|
|
32
29
|
withinPortal = true,
|
|
33
30
|
container,
|
|
34
31
|
openDelay,
|
|
@@ -44,12 +41,11 @@ var Root = ({
|
|
|
44
41
|
lazyMount: true,
|
|
45
42
|
unmountOnExit: true,
|
|
46
43
|
openDelay,
|
|
47
|
-
positioning:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
44
|
+
positioning: toPositioning(
|
|
45
|
+
{ position, gutter, offset, hideWhenDetached, positioning },
|
|
46
|
+
dir,
|
|
47
|
+
width
|
|
48
|
+
),
|
|
53
49
|
onOpenChange: ({ open }) => {
|
|
54
50
|
onOpenChange?.(open);
|
|
55
51
|
if (!open) onClose?.();
|
|
@@ -68,7 +64,7 @@ var Content = ({
|
|
|
68
64
|
}) => {
|
|
69
65
|
const { width, withinPortal, container, sliding } = useContext(HoverCardContext);
|
|
70
66
|
const portalContainer = useOverlayContainer(container);
|
|
71
|
-
const panel = /* @__PURE__ */ jsx(HoverCard$1.Positioner, { style: sliding ?
|
|
67
|
+
const panel = /* @__PURE__ */ jsx(HoverCard$1.Positioner, { style: sliding ? slideStyle : void 0, children: /* @__PURE__ */ jsx(
|
|
72
68
|
HoverCard$1.Content,
|
|
73
69
|
{
|
|
74
70
|
tabIndex: -1,
|
|
@@ -81,12 +77,13 @@ var Content = ({
|
|
|
81
77
|
if (!withinPortal) return panel;
|
|
82
78
|
return /* @__PURE__ */ jsx(Portal, { container: portalContainer, children: panel });
|
|
83
79
|
};
|
|
84
|
-
var isGroupContent = (node) => isValidElement(node) && node.type === Content;
|
|
85
80
|
var Group = ({
|
|
86
81
|
width = "auto",
|
|
87
|
-
position
|
|
82
|
+
position,
|
|
88
83
|
gutter,
|
|
89
84
|
offset,
|
|
85
|
+
hideWhenDetached,
|
|
86
|
+
positioning,
|
|
90
87
|
withinPortal = true,
|
|
91
88
|
container,
|
|
92
89
|
openDelay,
|
|
@@ -96,52 +93,37 @@ var Group = ({
|
|
|
96
93
|
...rest
|
|
97
94
|
}) => {
|
|
98
95
|
const { dir } = useLocaleContext();
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
const [sliding, setSliding] = useState(false);
|
|
103
|
-
const slidingRafRef = useRef(null);
|
|
104
|
-
useEffect(
|
|
105
|
-
() => () => {
|
|
106
|
-
if (slidingRafRef.current != null) cancelAnimationFrame(slidingRafRef.current);
|
|
107
|
-
},
|
|
108
|
-
[]
|
|
109
|
-
);
|
|
110
|
-
return /* @__PURE__ */ jsx(HoverCardContext.Provider, { value: { width, withinPortal, container, sliding }, children: /* @__PURE__ */ jsxs(
|
|
96
|
+
const { contents, triggers } = splitGroupChildren(children, Content);
|
|
97
|
+
const slide = useSlideAfterPlaced();
|
|
98
|
+
return /* @__PURE__ */ jsx(HoverCardContext.Provider, { value: { width, withinPortal, container, sliding: slide.sliding }, children: /* @__PURE__ */ jsxs(
|
|
111
99
|
HoverCard$1.Root,
|
|
112
100
|
{
|
|
113
101
|
lazyMount: true,
|
|
114
102
|
unmountOnExit: true,
|
|
115
103
|
openDelay,
|
|
116
|
-
positioning:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
104
|
+
positioning: toPositioning(
|
|
105
|
+
{
|
|
106
|
+
position,
|
|
107
|
+
gutter,
|
|
108
|
+
offset,
|
|
109
|
+
hideWhenDetached,
|
|
110
|
+
positioning: {
|
|
111
|
+
...positioning,
|
|
112
|
+
updatePosition: slide.updatePosition(positioning?.updatePosition)
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
dir,
|
|
116
|
+
width
|
|
117
|
+
),
|
|
122
118
|
onOpenChange: ({ open }) => {
|
|
123
119
|
onOpenChange?.(open);
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
slidingRafRef.current = null;
|
|
127
|
-
setSliding(true);
|
|
128
|
-
});
|
|
129
|
-
} else {
|
|
130
|
-
if (slidingRafRef.current != null) {
|
|
131
|
-
cancelAnimationFrame(slidingRafRef.current);
|
|
132
|
-
slidingRafRef.current = null;
|
|
133
|
-
}
|
|
134
|
-
setSliding(false);
|
|
135
|
-
onClose?.();
|
|
136
|
-
}
|
|
120
|
+
slide.onOpenChange(open);
|
|
121
|
+
if (!open) onClose?.();
|
|
137
122
|
},
|
|
138
123
|
...rest,
|
|
139
124
|
children: [
|
|
140
125
|
triggers,
|
|
141
|
-
/* @__PURE__ */ jsx(HoverCard$1.Context, { children: (api) =>
|
|
142
|
-
const active = contents.find((c) => c.props.value === api.triggerValue);
|
|
143
|
-
return active ? cloneElement(active, { key: "hover-card-group-content" }) : null;
|
|
144
|
-
} })
|
|
126
|
+
/* @__PURE__ */ jsx(HoverCard$1.Context, { children: (api) => activeGroupContent(contents, api.triggerValue) })
|
|
145
127
|
]
|
|
146
128
|
}
|
|
147
129
|
) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/hover-card/hover-card.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;;AA+EA,IAAM,mBAAA,GAAsB;AAAA,EAC1B,kBAAA,EAAoB,WAAA;AAAA,EACpB,kBAAA,EAAoB,OAAA;AAAA,EACpB,wBAAA,EAA0B;AAC5B,CAAA;AAmBA,IAAM,mBAAmB,aAAA,CAAqC;AAAA,EAC5D,KAAA,EAAO,MAAA;AAAA,EACP,YAAA,EAAc,IAAA;AAAA,EACd,OAAA,EAAS;AACX,CAAC,CAAA;AA8BD,IAAM,OAAO,CAAC;AAAA,EACZ,KAAA,GAAQ,MAAA;AAAA,EACR,QAAA,GAAW,QAAA;AAAA,EACX,MAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA,GAAe,IAAA;AAAA,EACf,SAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA0B;AACxB,EAAA,MAAM,EAAE,GAAA,EAAI,GAAI,gBAAA,EAAiB;AAEjC,EAAA,uBACE,GAAA,CAAC,gBAAA,CAA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,EAAQ,EAAE,GAAA,EAAK,0BAAA,EAA4B,CAAA,GAAI,IAAA;AAAA,QAC9E,CAAA,EACF;AAAA;AAAA;AAAA,GACF,EACF,CAAA;AAEJ,CAAA;AAEO,IAAM,SAAA,GAAY;AAAA,EACvB,IAAA;AAAA,EACA,SAASA,WAAA,CAAI,OAAA;AAAA,EACb,OAAA;AAAA,EACA;AACF","file":"index.js","sourcesContent":["\"use client\"\n\nimport { HoverCard as Ark } from \"@ark-ui/react/hover-card\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport {\n Children,\n cloneElement,\n createContext,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { type LogicalPosition, resolveLogicalPlacement } from \"../../lib/placement\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { popoverChrome } from \"../popover/popover\"\n\n/**\n * HoverCard — a rich preview panel on Ark UI's HoverCard, shown after a short\n * hover/focus delay. It sits between `Popover` (a clickable, focus-trapping\n * panel with no delay) and `Tooltip` (a delayed hint with no rich content):\n * HoverCard is delayed *and* rich — the \"hover a username, see a profile\n * card\" pattern. Ark owns the open/close state, the open/close delays,\n * positioning, and dismiss-on-outside-interaction; the kit adds the portaled,\n * animated panel chrome (reusing `Popover`'s surface).\n *\n * Unlike `Tooltip`, there's no single-call convenience form — a hover card's\n * content is arbitrary rich markup, so it's compound-only, like `Popover`:\n *\n * <HoverCard.Root>\n * <HoverCard.Trigger asChild>\n * <a href=\"/norm\">@the-norm</a>\n * </HoverCard.Trigger>\n * <HoverCard.Content>\n * Rich <strong>preview</strong> content.\n * </HoverCard.Content>\n * </HoverCard.Root>\n *\n * Ark's machine defaults to a 600ms open delay and a 300ms close delay —\n * long enough that an incidental pass of the cursor doesn't pop a card open.\n * `HoverCard.Group` puts several trigger targets (e.g. a row of avatars) on\n * one *shared* card instead: Ark's own HoverCard machine supports multiple\n * named triggers under a single `Root`/`Content`, so hovering from one\n * target to the next while the card is already open just repositions the\n * same panel — no close/reopen, no delay replay — and it visibly slides\n * between targets.\n *\n * Keep its content a preview. Ark's machine ignores touch, never lets focus\n * into the card, and puts no `aria-expanded`/`aria-controls` on the trigger,\n * because a hover card previews where its trigger *link* goes. For a card\n * people act on (a copy button, a \"View profile\" link), use\n * `<Popover.Root mode=\"hover\">`. It keeps the delayed hover preview, and a\n * click, tap or Enter pins it as a focusable, dismissable popover.\n */\n\n/** Slide transition for `HoverCard.Group`'s shared positioner — Ark sets the\n * positioner's `transform: translate3d(var(--x), var(--y), 0)` inline\n * (`@zag-js/popper`); animating `transform` itself makes the browser\n * interpolate that translate smoothly between two trigger anchors when the\n * group's active trigger changes. Passed as `style` (not a class) so it\n * merges with — rather than replaces — Ark's own inline `transform`/\n * `position` (Ark's `mergeProps` shallow-merges style objects); same\n * override-the-real-style technique `Tabs.Indicator` / `SegmentGroup` use\n * for their sliding pill. Only applied inside `Group`, and only once\n * `HoverCardContextValue.sliding` is true (see `Group`) — never on the very\n * first open, where the positioner's `--x`/`--y` haven't been computed yet\n * (the panel briefly sits at its unset `transform: none` origin, the\n * viewport's top-left, before floating-ui places it); animating *that*\n * jump would read as the panel sliding in from the top of the screen\n * instead of just appearing. A standalone `Root` never gets this at all: it\n * also repositions on scroll/resize (`autoUpdate`), where an animated\n * `transform` would look laggy rather than responsive. */\nconst hoverCardSlideStyle = {\n transitionProperty: \"transform\",\n transitionDuration: \"200ms\",\n transitionTimingFunction: \"cubic-bezier(0.32, 0.72, 0, 1)\",\n} as const\n\ntype HoverCardPlacement = NonNullable<NonNullable<Ark.RootProps[\"positioning\"]>[\"placement\"]>\n\n/** `position` accepts Ark's physical placements plus the logical, RTL-aware\n * horizontal sides `start` / `end` (resolved to `left` / `right` by direction). */\nexport type HoverCardPosition = LogicalPosition<HoverCardPlacement>\n\ntype HoverCardContextValue = {\n width: \"target\" | \"auto\"\n withinPortal: boolean\n container?: HTMLElement | null\n /** Whether this `Content` is `HoverCard.Group`'s single shared panel *and*\n * has already completed its first open — `Group` flips this true one\n * frame after opening, once the panel has a real, computed position to\n * slide *from*. Gates the slide transition (see `hoverCardSlideStyle`) so\n * only a later switch between targets animates, never the initial reveal. */\n sliding: boolean\n}\nconst HoverCardContext = createContext<HoverCardContextValue>({\n width: \"auto\",\n withinPortal: true,\n sliding: false,\n})\n\nexport type HoverCardRootProps = Omit<Ark.RootProps, \"positioning\" | \"onOpenChange\"> & {\n /** Match the trigger's width (`\"target\"`), or size to content (`\"auto\"`,\n * default — a hover card's content is usually much larger than its\n * trigger, unlike a dropdown). */\n width?: \"target\" | \"auto\"\n /** Panel placement relative to the trigger. Defaults to Ark's `\"bottom\"`. */\n position?: HoverCardPosition\n /** Gap in px between the trigger and the panel. */\n gutter?: number\n /** Positioner offset. */\n offset?:\n | {\n mainAxis?: number | undefined\n crossAxis?: number | undefined\n }\n | undefined\n /** Render the panel in a Portal so it escapes clipping ancestors. Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n /** Fires when the card opens or closes (flattened from Ark's detail object). */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — pointer/focus leaving, Escape, outside\n * interaction, or a controlled `onOpenChange`. */\n onClose?: () => void\n}\n\nconst Root = ({\n width = \"auto\",\n position = \"bottom\",\n gutter,\n offset,\n withinPortal = true,\n container,\n openDelay,\n children,\n onOpenChange,\n onClose,\n ...rest\n}: HoverCardRootProps) => {\n const { dir } = useLocaleContext()\n\n return (\n <HoverCardContext.Provider value={{ width, withinPortal, container, sliding: false }}>\n <Ark.Root\n lazyMount\n unmountOnExit\n openDelay={openDelay}\n positioning={{\n sameWidth: width === \"target\",\n placement: resolveLogicalPlacement(position, dir),\n gutter,\n offset,\n }}\n onOpenChange={({ open }) => {\n onOpenChange?.(open)\n if (!open) onClose?.()\n }}\n {...rest}\n >\n {children}\n </Ark.Root>\n </HoverCardContext.Provider>\n )\n}\n\nexport type HoverCardContentProps = Ark.ContentProps &\n WithTestId & {\n /** Identifies which `HoverCard.Group` target this content belongs to —\n * only meaningful inside `HoverCard.Group`, where several `Content`s\n * share one panel and `Group` picks the one whose `value` matches the\n * active trigger. Ignored (and never forwarded to the DOM) otherwise. */\n value?: string\n }\n\nconst Content = ({\n className,\n children,\n testId,\n value: _value,\n ...rest\n}: HoverCardContentProps) => {\n const { width, withinPortal, container, sliding } = useContext(HoverCardContext)\n const portalContainer = useOverlayContainer(container)\n const panel = (\n <Ark.Positioner style={sliding ? hoverCardSlideStyle : undefined}>\n <Ark.Content\n tabIndex={-1}\n className={cn(popoverChrome, width === \"target\" ? \"w-full\" : \"w-max\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children}\n </Ark.Content>\n </Ark.Positioner>\n )\n if (!withinPortal) return panel\n return <Portal container={portalContainer}>{panel}</Portal>\n}\n\nconst isGroupContent = (node: ReactNode): node is ReactElement<HoverCardContentProps> =>\n isValidElement(node) && node.type === Content\n\nexport type HoverCardGroupProps = Omit<\n Ark.RootProps,\n \"positioning\" | \"onOpenChange\" | \"children\"\n> & {\n /** Match every trigger's width (`\"target\"`), or size to content (`\"auto\"`,\n * default). */\n width?: \"target\" | \"auto\"\n /** Panel placement relative to the active trigger. Defaults to Ark's `\"bottom\"`. */\n position?: HoverCardPosition\n /** Gap in px between the active trigger and the panel. */\n gutter?: number\n /** Positioner offset. */\n offset?:\n | {\n mainAxis?: number | undefined\n crossAxis?: number | undefined\n }\n | undefined\n /** Render the panel in a Portal so it escapes clipping ancestors. Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n /** Fires when the card opens or closes (flattened from Ark's detail object). */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — pointer/focus leaving the whole group,\n * Escape, outside interaction, or a controlled `onOpenChange`. */\n onClose?: () => void\n /** `HoverCard.Trigger` (one per hover target, each with its own `value`)\n * and `HoverCard.Content` (one per target's content, `value`-matched to\n * its trigger) — the same parts `HoverCard.Root` uses, just several of\n * each instead of one. */\n children?: ReactNode\n}\n\n/**\n * One shared card across several hover targets (e.g. a row of avatars) — the\n * same `HoverCard.Trigger` / `HoverCard.Content` parts `HoverCard.Root` uses,\n * just several of each, disambiguated by a shared `value`:\n *\n * <HoverCard.Group>\n * <HoverCard.Trigger value=\"ada\">\n * <Avatar name=\"Ada Lovelace\" />\n * </HoverCard.Trigger>\n * <HoverCard.Trigger value=\"grace\">\n * <Avatar name=\"Grace Hopper\" />\n * </HoverCard.Trigger>\n *\n * <HoverCard.Content value=\"ada\">Ada's card content</HoverCard.Content>\n * <HoverCard.Content value=\"grace\">Grace's card content</HoverCard.Content>\n * </HoverCard.Group>\n *\n * Ark's HoverCard machine natively supports several named triggers under a\n * single `Root`/`Content` (a `triggerValue`, which `HoverCard.Trigger`'s\n * `value` already sets — it's a plain `Ark.Trigger` re-export): hovering from\n * one target to the next while the card is already open just repositions the\n * *same* panel instead of closing one and opening another — no unmount, no\n * delay replay. `Group` renders every `Trigger` child as-is (they need no\n * help — the machine already treats each `value` as a distinct target), but\n * intercepts every `Content` child: only the one whose `value` matches the\n * live `triggerValue` (read via Ark's `Context` render prop) is ever\n * rendered, in that one shared position — so React reconciles a value change\n * as a props update on the *same* `Content`/`Positioner`/`Content` element\n * tree, not an unmount-and-remount of a different one, which is what keeps\n * it one real, continuous DOM node to slide. Paired with a CSS transition on\n * the positioner's `transform` (`hoverCardSlideStyle`, applied by `Content`\n * whenever `sliding` is set), that reposition visibly slides the panel from\n * one target to the next.\n *\n * `Trigger`/`Content` must be `Group`'s own direct children — it only scans\n * one level (like `Timeline`/`Breadcrumb`), so wrapping them in an inner\n * `<div>` hides them from it entirely. `Group` (like `Root`) renders no DOM\n * node of its own, so for row-level layout (e.g. overlapping avatars via\n * `-space-x-2`), wrap `Group` itself from the outside instead — the actual\n * trigger elements still land exactly there, since `Content` is portaled\n * away separately.\n */\nconst Group = ({\n width = \"auto\",\n position = \"bottom\",\n gutter,\n offset,\n withinPortal = true,\n container,\n openDelay,\n children,\n onOpenChange,\n onClose,\n ...rest\n}: HoverCardGroupProps) => {\n const { dir } = useLocaleContext()\n const items = Children.toArray(children)\n const contents = items.filter(isGroupContent)\n const triggers = items.filter((item) => !isGroupContent(item))\n\n // False until one frame after opening, once the panel has a real computed\n // position to slide *from* — see `hoverCardSlideStyle`'s doc comment.\n // Reset on every close so the *next* pioneer open doesn't animate either.\n const [sliding, setSliding] = useState(false)\n const slidingRafRef = useRef<number | null>(null)\n useEffect(\n () => () => {\n if (slidingRafRef.current != null) cancelAnimationFrame(slidingRafRef.current)\n },\n [],\n )\n\n return (\n <HoverCardContext.Provider value={{ width, withinPortal, container, sliding }}>\n <Ark.Root\n lazyMount\n unmountOnExit\n openDelay={openDelay}\n positioning={{\n sameWidth: width === \"target\",\n placement: resolveLogicalPlacement(position, dir),\n gutter,\n offset,\n }}\n onOpenChange={({ open }) => {\n onOpenChange?.(open)\n if (open) {\n slidingRafRef.current = requestAnimationFrame(() => {\n slidingRafRef.current = null\n setSliding(true)\n })\n } else {\n if (slidingRafRef.current != null) {\n cancelAnimationFrame(slidingRafRef.current)\n slidingRafRef.current = null\n }\n setSliding(false)\n onClose?.()\n }\n }}\n {...rest}\n >\n {triggers}\n <Ark.Context>\n {(api) => {\n const active = contents.find((c) => c.props.value === api.triggerValue)\n // Force a stable `key`, overriding whatever each `Content` was\n // authored with (e.g. `key={person.handle}` in a `.map()`) — this\n // slot only ever renders one at a time, but a *different* key\n // switching in here reads to React as a different component,\n // unmounting the real Positioner/Content DOM tree and mounting a\n // fresh one instead of updating it in place. That fresh mount is\n // exactly what breaks the \"one shared, sliding panel\" contract:\n // its position starts unset again, so every switch would look\n // like the panel jumping in from the top instead of sliding.\n return active ? cloneElement(active, { key: \"hover-card-group-content\" }) : null\n }}\n </Ark.Context>\n </Ark.Root>\n </HoverCardContext.Provider>\n )\n}\n\nexport const HoverCard = {\n Root,\n Trigger: Ark.Trigger,\n Content,\n Group,\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/hover-card/hover-card.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;;AA6EA,IAAM,mBAAmB,aAAA,CAAqC;AAAA,EAC5D,KAAA,EAAO,MAAA;AAAA,EACP,YAAA,EAAc,IAAA;AAAA,EACd,OAAA,EAAS;AACX,CAAC,CAAA;AAoBD,IAAM,OAAO,CAAC;AAAA,EACZ,KAAA,GAAQ,MAAA;AAAA,EACR,QAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,gBAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA,GAAe,IAAA;AAAA,EACf,SAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA0B;AACxB,EAAA,MAAM,EAAE,GAAA,EAAI,GAAI,gBAAA,EAAiB;AAEjC,EAAA,uBACE,GAAA,CAAC,gBAAA,CAAiB,QAAA,EAAjB,EAA0B,KAAA,EAAO,EAAE,KAAA,EAAO,YAAA,EAAc,SAAA,EAAW,OAAA,EAAS,KAAA,EAAM,EACjF,QAAA,kBAAA,GAAA;AAAA,IAACA,WAAA,CAAI,IAAA;AAAA,IAAJ;AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,aAAA,EAAa,IAAA;AAAA,MACb,SAAA;AAAA,MACA,WAAA,EAAa,aAAA;AAAA,QACX,EAAE,QAAA,EAAU,MAAA,EAAQ,MAAA,EAAQ,kBAAkB,WAAA,EAAY;AAAA,QAC1D,GAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,YAAA,EAAc,CAAC,EAAE,IAAA,EAAK,KAAM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CAAA,EAAE;AAAA;AAAA;AAAA,GACxE,EACF,CAAA;AAEJ,CAAA;AAEO,IAAM,SAAA,GAAY;AAAA,EACvB,IAAA;AAAA,EACA,SAASA,WAAA,CAAI,OAAA;AAAA,EACb,OAAA;AAAA,EACA;AACF","file":"index.js","sourcesContent":["\"use client\"\n\nimport { HoverCard as Ark } from \"@ark-ui/react/hover-card\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { createContext, type ReactNode, useContext } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport {\n type LogicalPosition,\n type Placement,\n type PlacementProps,\n toPositioning,\n} from \"../../lib/placement\"\nimport { props } from \"../../lib/props\"\nimport {\n activeGroupContent,\n slideStyle,\n splitGroupChildren,\n useSlideAfterPlaced,\n} from \"../../lib/slide-on-switch\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { popoverChrome } from \"../popover/popover\"\n\n/**\n * HoverCard — a rich preview panel on Ark UI's HoverCard, shown after a short\n * hover/focus delay. It sits between `Popover` (a clickable, focus-trapping\n * panel with no delay) and `Tooltip` (a delayed hint with no rich content):\n * HoverCard is delayed *and* rich — the \"hover a username, see a profile\n * card\" pattern. Ark owns the open/close state, the open/close delays,\n * positioning, and dismiss-on-outside-interaction; the kit adds the portaled,\n * animated panel chrome (reusing `Popover`'s surface).\n *\n * Unlike `Tooltip`, there's no single-call convenience form — a hover card's\n * content is arbitrary rich markup, so it's compound-only, like `Popover`:\n *\n * <HoverCard.Root>\n * <HoverCard.Trigger asChild>\n * <a href=\"/norm\">@the-norm</a>\n * </HoverCard.Trigger>\n * <HoverCard.Content>\n * Rich <strong>preview</strong> content.\n * </HoverCard.Content>\n * </HoverCard.Root>\n *\n * Ark's machine defaults to a 600ms open delay and a 300ms close delay —\n * long enough that an incidental pass of the cursor doesn't pop a card open.\n * `HoverCard.Group` puts several trigger targets (e.g. a row of avatars) on\n * one *shared* card instead: Ark's own HoverCard machine supports multiple\n * named triggers under a single `Root`/`Content`, so hovering from one\n * target to the next while the card is already open just repositions the\n * same panel — no close/reopen, no delay replay — and it visibly slides\n * between targets.\n *\n * Keep its content a preview. Ark's machine ignores touch, never lets focus\n * into the card, and puts no `aria-expanded`/`aria-controls` on the trigger,\n * because a hover card previews where its trigger *link* goes. For a card\n * people act on (a copy button, a \"View profile\" link), use\n * `<Popover.Root mode=\"hover\">`. It keeps the delayed hover preview, and a\n * click, tap or Enter pins it as a focusable, dismissable popover.\n */\n\n/** `position` accepts Ark's physical placements plus the logical, RTL-aware\n * horizontal sides `start` / `end` (resolved to `left` / `right` by direction). */\nexport type HoverCardPosition = LogicalPosition<Placement>\n\ntype HoverCardContextValue = {\n width: \"target\" | \"auto\"\n withinPortal: boolean\n container?: HTMLElement | null\n /** Whether this `Content` is `HoverCard.Group`'s single shared panel *and*\n * its open has been placed once — `Group` flips this true after the first\n * placement lands, once the panel has a real position to slide *from*\n * (see `useSlideAfterPlaced`). Gates the slide transition (`slideStyle`)\n * so only a later switch between targets animates, never the reveal. */\n sliding: boolean\n}\nconst HoverCardContext = createContext<HoverCardContextValue>({\n width: \"auto\",\n withinPortal: true,\n sliding: false,\n})\n\nexport type HoverCardRootProps = Omit<Ark.RootProps, \"positioning\" | \"onOpenChange\"> &\n PlacementProps & {\n /** Match the trigger's width (`\"target\"`), or size to content (`\"auto\"`,\n * default — a hover card's content is usually much larger than its\n * trigger, unlike a dropdown). */\n width?: \"target\" | \"auto\"\n /** Render the panel in a Portal so it escapes clipping ancestors. Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n /** Fires when the card opens or closes (flattened from Ark's detail object). */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — pointer/focus leaving, Escape, outside\n * interaction, or a controlled `onOpenChange`. */\n onClose?: () => void\n }\n\nconst Root = ({\n width = \"auto\",\n position,\n gutter,\n offset,\n hideWhenDetached,\n positioning,\n withinPortal = true,\n container,\n openDelay,\n children,\n onOpenChange,\n onClose,\n ...rest\n}: HoverCardRootProps) => {\n const { dir } = useLocaleContext()\n\n return (\n <HoverCardContext.Provider value={{ width, withinPortal, container, sliding: false }}>\n <Ark.Root\n lazyMount\n unmountOnExit\n openDelay={openDelay}\n positioning={toPositioning(\n { position, gutter, offset, hideWhenDetached, positioning },\n dir,\n width,\n )}\n onOpenChange={({ open }) => {\n onOpenChange?.(open)\n if (!open) onClose?.()\n }}\n {...rest}\n >\n {children}\n </Ark.Root>\n </HoverCardContext.Provider>\n )\n}\n\nexport type HoverCardContentProps = Ark.ContentProps &\n WithTestId & {\n /** Identifies which `HoverCard.Group` target this content belongs to —\n * only meaningful inside `HoverCard.Group`, where several `Content`s\n * share one panel and `Group` picks the one whose `value` matches the\n * active trigger. Ignored (and never forwarded to the DOM) otherwise. */\n value?: string\n }\n\nconst Content = ({\n className,\n children,\n testId,\n value: _value,\n ...rest\n}: HoverCardContentProps) => {\n const { width, withinPortal, container, sliding } = useContext(HoverCardContext)\n const portalContainer = useOverlayContainer(container)\n const panel = (\n <Ark.Positioner style={sliding ? slideStyle : undefined}>\n <Ark.Content\n tabIndex={-1}\n className={cn(popoverChrome, width === \"target\" ? \"w-full\" : \"w-max\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children}\n </Ark.Content>\n </Ark.Positioner>\n )\n if (!withinPortal) return panel\n return <Portal container={portalContainer}>{panel}</Portal>\n}\n\nexport type HoverCardGroupProps = Omit<Ark.RootProps, \"positioning\" | \"onOpenChange\" | \"children\"> &\n PlacementProps & {\n /** Match every trigger's width (`\"target\"`), or size to content (`\"auto\"`,\n * default). */\n width?: \"target\" | \"auto\"\n /** Render the panel in a Portal so it escapes clipping ancestors. Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n /** Fires when the card opens or closes (flattened from Ark's detail object). */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — pointer/focus leaving the whole group,\n * Escape, outside interaction, or a controlled `onOpenChange`. */\n onClose?: () => void\n /** `HoverCard.Trigger` (one per hover target, each with its own `value`)\n * and `HoverCard.Content` (one per target's content, `value`-matched to\n * its trigger) — the same parts `HoverCard.Root` uses, just several of\n * each instead of one. */\n children?: ReactNode\n }\n\n/**\n * One shared card across several hover targets (e.g. a row of avatars) — the\n * same `HoverCard.Trigger` / `HoverCard.Content` parts `HoverCard.Root` uses,\n * just several of each, disambiguated by a shared `value`:\n *\n * <HoverCard.Group>\n * <HoverCard.Trigger value=\"ada\">\n * <Avatar name=\"Ada Lovelace\" />\n * </HoverCard.Trigger>\n * <HoverCard.Trigger value=\"grace\">\n * <Avatar name=\"Grace Hopper\" />\n * </HoverCard.Trigger>\n *\n * <HoverCard.Content value=\"ada\">Ada's card content</HoverCard.Content>\n * <HoverCard.Content value=\"grace\">Grace's card content</HoverCard.Content>\n * </HoverCard.Group>\n *\n * Ark's HoverCard machine natively supports several named triggers under a\n * single `Root`/`Content` (a `triggerValue`, which `HoverCard.Trigger`'s\n * `value` already sets — it's a plain `Ark.Trigger` re-export): hovering from\n * one target to the next while the card is already open just repositions the\n * *same* panel instead of closing one and opening another — no unmount, no\n * delay replay. `Group` renders every `Trigger` child as-is (they need no\n * help — the machine already treats each `value` as a distinct target), but\n * intercepts every `Content` child: only the one whose `value` matches the\n * live `triggerValue` (read via Ark's `Context` render prop) is ever\n * rendered, in that one shared position — so React reconciles a value change\n * as a props update on the *same* `Content`/`Positioner`/`Content` element\n * tree, not an unmount-and-remount of a different one, which is what keeps\n * it one real, continuous DOM node to slide. Paired with a CSS transition on\n * the positioner's `transform` (`slideStyle`, applied by `Content`\n * whenever `sliding` is set), that reposition visibly slides the panel from\n * one target to the next.\n *\n * `Trigger`/`Content` must be `Group`'s own direct children — it only scans\n * one level (like `Timeline`/`Breadcrumb`), so wrapping them in an inner\n * `<div>` hides them from it entirely. `Group` (like `Root`) renders no DOM\n * node of its own, so for row-level layout (e.g. overlapping avatars via\n * `-space-x-2`), wrap `Group` itself from the outside instead — the actual\n * trigger elements still land exactly there, since `Content` is portaled\n * away separately.\n */\nconst Group = ({\n width = \"auto\",\n position,\n gutter,\n offset,\n hideWhenDetached,\n positioning,\n withinPortal = true,\n container,\n openDelay,\n children,\n onOpenChange,\n onClose,\n ...rest\n}: HoverCardGroupProps) => {\n const { dir } = useLocaleContext()\n const { contents, triggers } = splitGroupChildren(children, Content)\n const slide = useSlideAfterPlaced()\n\n return (\n <HoverCardContext.Provider value={{ width, withinPortal, container, sliding: slide.sliding }}>\n <Ark.Root\n lazyMount\n unmountOnExit\n openDelay={openDelay}\n positioning={toPositioning(\n {\n position,\n gutter,\n offset,\n hideWhenDetached,\n positioning: {\n ...positioning,\n updatePosition: slide.updatePosition(positioning?.updatePosition),\n },\n },\n dir,\n width,\n )}\n onOpenChange={({ open }) => {\n onOpenChange?.(open)\n slide.onOpenChange(open)\n if (!open) onClose?.()\n }}\n {...rest}\n >\n {triggers}\n <Ark.Context>{(api) => activeGroupContent(contents, api.triggerValue)}</Ark.Context>\n </Ark.Root>\n </HoverCardContext.Provider>\n )\n}\n\nexport const HoverCard = {\n Root,\n Trigger: Ark.Trigger,\n Content,\n Group,\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { Input, InputBase, inputControlClasses, inputSlot } from '../../chunk-
|
|
2
|
+
export { Input, InputBase, inputControlClasses, inputSlot } from '../../chunk-3L5GLI67.js';
|
|
3
3
|
import '../../chunk-VD6PB3VA.js';
|
|
4
4
|
import '../../chunk-WYCMIIRR.js';
|
|
5
5
|
import '../../chunk-GIPQUKCN.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"A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b,UAAU,GAAG;IACX;;;8CAG0C;IAC1C,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;IAC3B,UAAU,CAAC,EAAE,eAAe,GAAG;QAC7B,mCAAmC;QACnC,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;CACF,CAAA;AAEH,eAAO,MAAM,KAAK,wHAaf,UAAU,gCAwCZ,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Context, SubContent, SubTrigger, Sub, RadioItem, RadioGroup, CheckboxItem, Separator, Divider, ItemGroupLabel, ItemGroup, Label, Item, Content, ContextTrigger, Trigger, Root } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
2
|
+
import { Context, SubContent, SubTrigger, Sub, RadioItem, RadioGroup, CheckboxItem, Separator, Divider, ItemGroupLabel, ItemGroup, Label, Item, Content, ContextTrigger, Trigger, Root } from '../../chunk-IRNF274I.js';
|
|
3
|
+
import '../../chunk-N66NC6QK.js';
|
|
4
|
+
import '../../chunk-V6PY7C6S.js';
|
|
5
5
|
import '../../chunk-7P32XCEU.js';
|
|
6
6
|
import '../../chunk-H7WOMZXO.js';
|
|
7
7
|
import '../../chunk-6N6J2DOE.js';
|
|
@@ -100,17 +100,19 @@ declare const RadioItem: ({ startSection, startSlot, color, className, children,
|
|
|
100
100
|
export type MenuSubProps = Omit<ArkMenu.RootProps, "positioning"> & {
|
|
101
101
|
/** Gap in px between the trigger row and the submenu. Ark manages submenu
|
|
102
102
|
* *placement* itself (RTL-aware `right-start` / `left-start`, flush to the
|
|
103
|
-
* parent
|
|
103
|
+
* parent, flipping to `-end` when it doesn't fit below the row), so only this
|
|
104
|
+
* main-axis gap is adjustable. Defaults to `10`. */
|
|
104
105
|
offset?: number;
|
|
105
106
|
};
|
|
106
107
|
/** Submenu root — a nested Ark Menu whose triggering row is `Menu.SubTrigger`.
|
|
107
108
|
* Inherits the parent's portal settings via context (see `Menu.SubContent`).
|
|
108
109
|
*
|
|
109
110
|
* Ark's menu machine hard-overrides a submenu's placement and `gutter` (to `0`),
|
|
110
|
-
* so a `gutter`-based offset is silently dropped. It leaves `offset`
|
|
111
|
-
* and
|
|
112
|
-
* `
|
|
113
|
-
*
|
|
111
|
+
* so a `gutter`-based offset is silently dropped. It leaves `offset`, `shift`
|
|
112
|
+
* and `flip` untouched: zag resolves the gap as `offset.mainAxis ?? gutter` and
|
|
113
|
+
* passes `shift` as Floating UI's `alignmentAxis` (see `SUBMENU_ALIGN_OFFSET`).
|
|
114
|
+
* The default `flip` already falls back to the end-aligned placement, then the
|
|
115
|
+
* other side. */
|
|
114
116
|
declare const Sub: ({ offset, children, ...rest }: MenuSubProps) => import("react").JSX.Element;
|
|
115
117
|
export type MenuSubTriggerProps = ArkMenu.TriggerItemProps & WithTestId & MenuStartSlotProps & {
|
|
116
118
|
color?: Color;
|