@commenda/pathfinder 0.1.0 → 0.2.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.
Files changed (133) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/accordion/AccordionSection.js +9 -3
  3. package/dist/components/address-input/AddressInput.js +1 -1
  4. package/dist/components/artifact-card/ArtifactCard.js +1 -1
  5. package/dist/components/artifact-panel/ArtifactPanel.js +81 -55
  6. package/dist/components/attachment/Attachment.d.ts +2 -6
  7. package/dist/components/attachment/Attachment.js +59 -36
  8. package/dist/components/attachment/AttachmentCard.d.ts +1 -1
  9. package/dist/components/attachment/AttachmentCard.js +56 -43
  10. package/dist/components/attachment/attachment-class-names.d.ts +1 -1
  11. package/dist/components/attachment/attachment-class-names.js +1 -1
  12. package/dist/components/attachment-group/AttachmentGroup.js +1 -1
  13. package/dist/components/avatar/avatar-helper.d.ts +1 -1
  14. package/dist/components/banner/Banner.js +5 -2
  15. package/dist/components/button/Button.js +1 -1
  16. package/dist/components/calendar/CalendarAgenda.js +1 -1
  17. package/dist/components/calendar/CalendarArtwork.js +16 -22
  18. package/dist/components/calendar/CalendarEventContent.js +2 -2
  19. package/dist/components/calendar/CalendarPopup.js +102 -82
  20. package/dist/components/calendar/CalendarToolbar.js +10 -10
  21. package/dist/components/card/Card.js +47 -41
  22. package/dist/components/checkbox/Checkbox.js +31 -13
  23. package/dist/components/choices/choice-motion.d.ts +12 -0
  24. package/dist/components/choices/choice-motion.js +22 -0
  25. package/dist/components/code-block/CodeBlock.js +3 -2
  26. package/dist/components/controls/control-class-names.d.ts +1 -0
  27. package/dist/components/controls/control-class-names.js +8 -8
  28. package/dist/components/controls/useHoverHighlight.d.ts +12 -0
  29. package/dist/components/controls/useHoverHighlight.js +51 -0
  30. package/dist/components/controls/useSelectionIndicator.d.ts +3 -4
  31. package/dist/components/controls/useSelectionIndicator.js +43 -28
  32. package/dist/components/data-grid/DataGrid.js +7 -7
  33. package/dist/components/data-grid/DataGridHeaders.js +1 -1
  34. package/dist/components/date-picker/DateCalendar.js +3 -3
  35. package/dist/components/date-picker/DatePicker.js +10 -10
  36. package/dist/components/date-picker/field/DateField.js +1 -1
  37. package/dist/components/description-list/DescriptionList.js +2 -2
  38. package/dist/components/dialog/ConfirmDialog.js +1 -1
  39. package/dist/components/dialog/Dialog.js +1 -1
  40. package/dist/components/distribution-bar/DistributionBar.js +45 -35
  41. package/dist/components/drag-handle/DragHandle.d.ts +1 -1
  42. package/dist/components/dropdown/Dropdown.js +27 -26
  43. package/dist/components/dropdown/MenuContent.js +100 -69
  44. package/dist/components/dropdown/dropdown-types.d.ts +1 -0
  45. package/dist/components/dropdown/menu-motion.d.ts +2 -0
  46. package/dist/components/dropdown/menu-motion.js +4 -0
  47. package/dist/components/feedback/FeedbackIcon.d.ts +2 -1
  48. package/dist/components/feedback/FeedbackIcon.js +4 -4
  49. package/dist/components/feedback/FeedbackSurface.d.ts +3 -3
  50. package/dist/components/feedback/FeedbackSurface.js +49 -21
  51. package/dist/components/fields/FieldAction.d.ts +1 -0
  52. package/dist/components/fields/FieldAction.js +2 -2
  53. package/dist/components/icon-button/IconButton.js +37 -37
  54. package/dist/components/icons/index.js +776 -776
  55. package/dist/components/inline-reference/InlineReference.js +1 -8
  56. package/dist/components/list/List.js +2 -2
  57. package/dist/components/list/ListGroup.js +35 -30
  58. package/dist/components/list/ListTask.js +1 -1
  59. package/dist/components/list/SettingRow.js +1 -1
  60. package/dist/components/markdown/Markdown.js +11 -10
  61. package/dist/components/markdown/MarkdownTable.d.ts +1 -1
  62. package/dist/components/markdown/MarkdownTable.js +71 -54
  63. package/dist/components/otp/OTP.js +44 -43
  64. package/dist/components/output-sections/OutputRow.js +2 -3
  65. package/dist/components/overlays/OverlayFrame.js +2 -2
  66. package/dist/components/overlays/overlay-class-names.d.ts +3 -3
  67. package/dist/components/overlays/overlay-class-names.js +1 -1
  68. package/dist/components/phone-input/CountryPicker.js +11 -8
  69. package/dist/components/popover/Popover.js +2 -2
  70. package/dist/components/question-card/QuestionOptions.js +3 -3
  71. package/dist/components/radio-group/RadioGroup.js +59 -50
  72. package/dist/components/search/Search.js +51 -47
  73. package/dist/components/segmented-control/SegmentedControl.js +7 -6
  74. package/dist/components/selection/ChoiceField.js +1 -1
  75. package/dist/components/selection/ChoiceList.js +2 -1
  76. package/dist/components/selection/SearchableChoice.js +129 -114
  77. package/dist/components/selection/SelectedTags.js +1 -1
  78. package/dist/components/selection/SimpleChoice.js +95 -77
  79. package/dist/components/selection/choice-styles.d.ts +2 -2
  80. package/dist/components/selection/choice-styles.js +1 -1
  81. package/dist/components/sheet/Sheet.js +7 -7
  82. package/dist/components/side-nav/SideNav.d.ts +2 -5
  83. package/dist/components/side-nav/SideNav.js +98 -56
  84. package/dist/components/side-nav/SideNavItemView.d.ts +1 -1
  85. package/dist/components/side-nav/SideNavItemView.js +83 -98
  86. package/dist/components/side-nav/index.d.ts +2 -0
  87. package/dist/components/side-nav/index.js +1 -1
  88. package/dist/components/split-button/SplitButton.js +3 -2
  89. package/dist/components/stepper/StepMarker.js +32 -28
  90. package/dist/components/stepper/Stepper.js +30 -22
  91. package/dist/components/suggested-prompt/SuggestedPrompt.js +1 -1
  92. package/dist/components/switch/Switch.d.ts +1 -1
  93. package/dist/components/switch/Switch.js +38 -28
  94. package/dist/components/table/Table.js +134 -110
  95. package/dist/components/table/TableColumnHeader.js +20 -2
  96. package/dist/components/table/TableColumnResize.js +1 -1
  97. package/dist/components/table/TableColumnsMenu.js +1 -0
  98. package/dist/components/table/TableFilterChip.js +1 -1
  99. package/dist/components/table/TableFilterEditor.js +6 -6
  100. package/dist/components/table/TableFilters.js +1 -0
  101. package/dist/components/table/TableOptionMenu.d.ts +1 -1
  102. package/dist/components/table/TableOptionMenu.js +16 -17
  103. package/dist/components/table/TablePagination.js +1 -0
  104. package/dist/components/table/TableSelectionBar.js +4 -1
  105. package/dist/components/table/index.js +6 -6
  106. package/dist/components/table/table-column-style.js +0 -1
  107. package/dist/components/table/table-types.d.ts +5 -0
  108. package/dist/components/table/useTableData.js +2 -2
  109. package/dist/components/tabs/Tabs.js +61 -53
  110. package/dist/components/tabs/tab-class-names.d.ts +1 -1
  111. package/dist/components/tabs/tab-class-names.js +1 -1
  112. package/dist/components/tabular/TableEditCell.js +3 -1
  113. package/dist/components/tabular/tabular-class-names.d.ts +1 -0
  114. package/dist/components/tabular/tabular-class-names.js +1 -0
  115. package/dist/components/tabular/useCellEdit.js +1 -1
  116. package/dist/components/tabular/useTabularPinning.js +7 -6
  117. package/dist/components/tag/Tag.js +1 -1
  118. package/dist/components/tag-input/TagInput.js +64 -53
  119. package/dist/components/tag-input/useTagMotion.d.ts +6 -0
  120. package/dist/components/tag-input/useTagMotion.js +36 -0
  121. package/dist/components/text-area/TextArea.js +2 -1
  122. package/dist/components/thread/ThreadReply.js +10 -7
  123. package/dist/components/tool-call/ToolCall.js +2 -2
  124. package/dist/components/tree/TreeItemView.js +3 -3
  125. package/dist/index.d.ts +2 -2
  126. package/dist/index.js +37 -37
  127. package/dist/styles.css +1 -1
  128. package/package.json +5 -1
  129. package/dist/_virtual/_rolldown/runtime.js +0 -11
  130. package/dist/components/date-picker/date-values.d.ts +0 -23
  131. package/dist/components/date-picker/date-values.js +0 -52
  132. package/dist/components/table/TableHeaderPin.d.ts +0 -6
  133. package/dist/components/table/TableHeaderPin.js +0 -66
@@ -1,168 +1,183 @@
1
1
  "use client";
2
- import { SearchMdIcon as e } from "../icons/SearchMdIcon.js";
3
- import { Checkbox as t } from "../checkbox/Checkbox.js";
4
- import { choicePopupClass as n } from "./choice-styles.js";
5
- import { ChoiceField as r } from "./ChoiceField.js";
6
- import { ChoiceList as i } from "./ChoiceList.js";
7
- import { useMemo as a, useRef as o, useState as s } from "react";
8
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
9
- import { Combobox as d } from "@base-ui/react/combobox";
2
+ import { hoverHighlightClass as e, useHoverHighlight as t } from "../controls/useHoverHighlight.js";
3
+ import { SearchMdIcon as n } from "../icons/SearchMdIcon.js";
4
+ import { choiceIndicatorMotionProps as r } from "../choices/choice-motion.js";
5
+ import { Checkbox as i } from "../checkbox/Checkbox.js";
6
+ import { choicePopupClass as a } from "./choice-styles.js";
7
+ import { ChoiceField as o } from "./ChoiceField.js";
8
+ import { ChoiceList as s } from "./ChoiceList.js";
9
+ import c from "clsx";
10
+ import { useMemo as l, useRef as u, useState as d } from "react";
11
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
12
+ import { Combobox as h } from "@base-ui/react/combobox";
10
13
  //#region src/components/selection/SearchableChoice.tsx
11
- function f({ config: f, multiple: p, values: m, onChange: h, forwardedRef: g, field: _ }) {
12
- let [v, y] = s(!1), b = o(null), [x, S] = s(""), [C, w] = s(), [T, E] = s([]), D = f.searchConfig?.mode === "remote" ? f.searchConfig : void 0, O = D?.query ?? x, k = a(() => f.options ?? f.groups.flatMap((e) => e.options), [f.options, f.groups]), A = new Set(m), j = new Map([
13
- ...T,
14
- ...f.selectedOptions ?? [],
15
- ...k
16
- ].map((e) => [e.value, e])), M = m.map((e) => j.get(e) ?? {
14
+ function g({ config: g, multiple: _, values: v, onChange: y, forwardedRef: b, field: x }) {
15
+ let S = t(), [C, w] = d(!1), T = u(null), [E, D] = d(""), [O, k] = d(), [A, j] = d([]), M = g.searchConfig?.mode === "remote" ? g.searchConfig : void 0, N = M?.query ?? E, P = l(() => g.options ?? g.groups.flatMap((e) => e.options), [g.options, g.groups]), F = new Set(v), I = new Map([
16
+ ...A,
17
+ ...g.selectedOptions ?? [],
18
+ ...P
19
+ ].map((e) => [e.value, e])), L = v.map((e) => I.get(e) ?? {
17
20
  value: e,
18
21
  label: "Selected value unavailable"
19
- }), N = !!D && (D.isLoading || O !== D.resultsQuery), P = a(() => N || D?.error ? [] : D ? k : k.filter((e) => `${e.label} ${e.keywords?.join(" ") ?? ""}`.toLocaleLowerCase().includes(O.toLocaleLowerCase())), [
20
- N,
21
- D,
22
- k,
23
- O
24
- ]), F = f.selectionLimitConfig?.max, I = F !== void 0 && m.length >= F, L = (e) => {
25
- if (f.disableConfig?.isDisabled) return;
26
- let t = m.filter((e) => j.get(e)?.disableConfig?.isDisabled), n = [.../* @__PURE__ */ new Set([...e, ...t])];
27
- F !== void 0 && n.length > F && n.length > m.length || (E(n.flatMap((e) => {
28
- let t = j.get(e);
22
+ }), R = !!M && (M.isLoading || N !== M.resultsQuery), z = l(() => R || M?.error ? [] : M ? P : P.filter((e) => `${e.label} ${e.keywords?.join(" ") ?? ""}`.toLocaleLowerCase().includes(N.toLocaleLowerCase())), [
23
+ R,
24
+ M,
25
+ P,
26
+ N
27
+ ]), B = g.selectionLimitConfig?.max, V = B !== void 0 && v.length >= B, H = (e) => {
28
+ if (g.disableConfig?.isDisabled) return;
29
+ let t = v.filter((e) => I.get(e)?.disableConfig?.isDisabled), n = [.../* @__PURE__ */ new Set([...e, ...t])];
30
+ B !== void 0 && n.length > B && n.length > v.length || (j(n.flatMap((e) => {
31
+ let t = I.get(e);
29
32
  return t ? [t] : [];
30
- })), h(n));
31
- }, R = o(null), z = `${D?.resultsQuery ?? ""}:${String(k.length)}`, B = () => {
32
- let e = f.paginationConfig;
33
- !e || !e.hasMore || e.isLoadingMore || e.error || N || D?.error || R.current === z || (R.current = z, e.onLoadMore());
34
- }, V = P.filter((e) => !e.disableConfig?.isDisabled).map((e) => e.value), H = V.length > 0 && V.every((e) => A.has(e)), U = [.../* @__PURE__ */ new Set([...m, ...V])], W = !H && F !== void 0 && U.length > F;
35
- return /* @__PURE__ */ u(d.Root, {
36
- multiple: p,
37
- items: P.map((e) => e.value),
38
- value: p ? m : m[0] ?? null,
33
+ })), y(n));
34
+ }, U = u(null), W = `${M?.resultsQuery ?? ""}:${String(P.length)}`, G = () => {
35
+ let e = g.paginationConfig;
36
+ !e || !e.hasMore || e.isLoadingMore || e.error || R || M?.error || U.current === W || (U.current = W, e.onLoadMore());
37
+ }, K = z.filter((e) => !e.disableConfig?.isDisabled).map((e) => e.value), q = K.length > 0 && K.every((e) => F.has(e)), J = [.../* @__PURE__ */ new Set([...v, ...K])], Y = !q && B !== void 0 && J.length > B;
38
+ return /* @__PURE__ */ m(h.Root, {
39
+ multiple: _,
40
+ items: z.map((e) => e.value),
41
+ value: _ ? v : v[0] ?? null,
39
42
  onValueChange: (e) => {
40
- L(Array.isArray(e) ? e : e === null ? [] : [e]);
43
+ H(Array.isArray(e) ? e : e === null ? [] : [e]);
41
44
  },
42
- itemToStringLabel: (e) => j.get(e)?.label ?? "Selected value unavailable",
45
+ itemToStringLabel: (e) => I.get(e)?.label ?? "Selected value unavailable",
43
46
  filter: null,
44
- inputValue: O,
47
+ inputValue: N,
45
48
  onInputValueChange: (e, t) => {
46
- e !== O && t.reason !== "item-press" && t.reason !== "input-clear" && (D ? D.onQueryChange(e) : S(e));
49
+ e !== N && t.reason !== "item-press" && t.reason !== "input-clear" && (M ? M.onQueryChange(e) : D(e));
47
50
  },
48
- open: v,
51
+ open: C,
49
52
  onOpenChange: (e) => {
50
- y(e), e || (_.blur(), D || S(""));
53
+ w(e), e || (x.blur(), M || D(""));
51
54
  },
52
- disabled: f.disableConfig?.isDisabled,
53
- autoComplete: f.autoComplete,
54
- name: f.name,
55
- form: f.form,
56
- required: f.required,
57
- virtualized: f.listConfig?.virtualized,
55
+ disabled: g.disableConfig?.isDisabled,
56
+ autoComplete: g.autoComplete,
57
+ name: g.name,
58
+ form: g.form,
59
+ required: g.required,
60
+ virtualized: g.listConfig?.virtualized,
58
61
  onItemHighlighted: (e) => {
59
- w(e);
62
+ k(e);
60
63
  },
61
- children: [/* @__PURE__ */ l(r, {
62
- config: f,
63
- field: _,
64
- multiple: p,
65
- resolved: M,
66
- open: v,
67
- anchorRef: b,
64
+ children: [/* @__PURE__ */ p(o, {
65
+ config: g,
66
+ field: x,
67
+ multiple: _,
68
+ resolved: L,
69
+ open: C,
70
+ anchorRef: T,
68
71
  onRemove: (e) => {
69
- L(m.filter((t) => t !== e));
72
+ H(v.filter((t) => t !== e));
70
73
  },
71
74
  onClear: () => {
72
- L([]);
75
+ H([]);
73
76
  },
74
- trigger: /* @__PURE__ */ l(d.Trigger, {
75
- id: _.id,
76
- form: f.form,
77
- ref: g,
78
- "aria-label": f.label ?? f["aria-label"],
79
- "aria-describedby": _.describedBy,
80
- "aria-invalid": !!_.error,
77
+ trigger: /* @__PURE__ */ p(h.Trigger, {
78
+ id: x.id,
79
+ form: g.form,
80
+ ref: b,
81
+ "aria-label": g.label ?? g["aria-label"],
82
+ "aria-describedby": x.describedBy,
83
+ "aria-invalid": !!x.error,
81
84
  onBlur: (e) => {
82
- v || _.blur(), f.onBlur?.(e);
85
+ C || x.blur(), g.onBlur?.(e);
83
86
  },
84
- onFocus: f.onFocus
87
+ onFocus: g.onFocus
85
88
  })
86
- }), /* @__PURE__ */ l(d.Portal, { children: /* @__PURE__ */ l(d.Positioner, {
87
- anchor: b,
89
+ }), /* @__PURE__ */ p(h.Portal, { children: /* @__PURE__ */ p(h.Positioner, {
90
+ anchor: T,
88
91
  align: "start",
89
92
  sideOffset: 4,
90
93
  className: "pf:z-[60]",
91
- children: /* @__PURE__ */ u(d.Popup, {
92
- className: n,
93
- "aria-label": f.label ?? f["aria-label"],
94
+ children: /* @__PURE__ */ m(h.Popup, {
95
+ ...S.props,
96
+ onPointerDownCapture: r.onPointerDownCapture,
97
+ onKeyDownCapture: (e) => {
98
+ S.props.onKeyDownCapture(), r.onKeyDownCapture(e);
99
+ },
100
+ className: c(a, e),
101
+ "aria-label": g.label ?? g["aria-label"],
94
102
  children: [
95
- /* @__PURE__ */ u("div", {
103
+ S.highlight,
104
+ /* @__PURE__ */ m("div", {
96
105
  className: "pf:box-border pf:flex pf:h-[36px] pf:items-center pf:gap-md pf:px-lg pf:border-b-[0.5px] pf:border-solid pf:border-soft-pearl-300",
97
- children: [/* @__PURE__ */ l("span", {
106
+ children: [/* @__PURE__ */ p("span", {
98
107
  "aria-hidden": "true",
99
108
  className: "pf:flex pf:size-[16px] pf:shrink-0 pf:items-center pf:justify-center pf:text-soft-pearl-800",
100
- children: /* @__PURE__ */ l(e, {
109
+ children: /* @__PURE__ */ p(n, {
101
110
  size: 16,
102
111
  tone: "inherit"
103
112
  })
104
- }), /* @__PURE__ */ l(d.Input, {
105
- "aria-label": `Search ${f.label ?? f["aria-label"]}`,
106
- placeholder: f.searchConfig?.placeholder ?? "Search options",
113
+ }), /* @__PURE__ */ p(h.Input, {
114
+ "aria-label": `Search ${g.label ?? g["aria-label"]}`,
115
+ placeholder: g.searchConfig?.placeholder ?? "Search options",
107
116
  className: "pf:box-border pf:w-full pf:min-w-0 pf:h-full pf:border-0 pf:bg-transparent pf:p-0 pf:font-body pf:text-label-13 pf:font-normal pf:text-soft-pearl-1000 pf:placeholder:text-soft-pearl-800 pf:outline-none"
108
117
  })]
109
118
  }),
110
- p && f.selectAllConfig && /* @__PURE__ */ l(t, {
111
- checked: H,
112
- indeterminate: !H && V.some((e) => A.has(e)),
113
- className: "pf:mx-sm pf:mt-sm pf:mb-xxs pf:px-md pf:py-sm pf:min-h-[32px] pf:w-[calc(100%_-_12px)] pf:[&.pf-choice]:items-center pf:[&.pf-choice]:gap-sm pf:[&_.pf-choice-label]:font-medium pf:[&_.pf-choice-label]:leading-[20px] pf:rounded-sm pf:hover:bg-soft-pearl-200",
114
- disabled: !V.length || W,
115
- title: W ? "Selection limit would be exceeded" : void 0,
119
+ _ && g.selectAllConfig && /* @__PURE__ */ p(i, {
120
+ checked: q,
121
+ indeterminate: !q && K.some((e) => F.has(e)),
122
+ className: "pf:select-none pf:mx-sm pf:mt-sm pf:mb-xxs pf:px-md pf:py-sm pf:min-h-[32px] pf:w-[calc(100%_-_12px)] pf:[&.pf-choice]:items-center pf:[&.pf-choice]:gap-sm pf:[&_.pf-choice-label]:font-medium pf:[&_.pf-choice-label]:leading-[20px] pf:rounded-sm pf:hover:bg-soft-pearl-200",
123
+ disabled: !K.length || Y,
124
+ title: Y ? "Selection limit would be exceeded" : void 0,
116
125
  onCheckedChange: () => {
117
- L(H ? m.filter((e) => !V.includes(e)) : U);
126
+ H(q ? v.filter((e) => !K.includes(e)) : J);
118
127
  },
119
- label: H ? "Deselect listed options" : f.selectAllConfig.label ?? "Select listed options"
128
+ label: q ? "Clear selection" : g.selectAllConfig.label ?? "Select all"
120
129
  }),
121
- /* @__PURE__ */ l(i, {
122
- multiple: p,
123
- options: P,
124
- selected: A,
125
- config: f,
126
- highlighted: C,
127
- atLimit: I,
128
- onLoadMore: B
129
- }, D?.resultsQuery ?? O),
130
- /* @__PURE__ */ l(d.Status, {
131
- className: "pf:text-copy-12 pf:text-soft-pearl-800 pf:px-md",
132
- children: N ? "Searching…" : D?.error ?? (P.length ? I ? f.selectionLimitConfig?.message ?? `Select up to ${String(F)} options.` : "" : f.emptyLabel ?? "No results.")
130
+ /* @__PURE__ */ p(s, {
131
+ multiple: _,
132
+ options: z,
133
+ selected: F,
134
+ config: g,
135
+ highlighted: O,
136
+ atLimit: V,
137
+ onLoadMore: G
138
+ }, M?.resultsQuery ?? N),
139
+ /* @__PURE__ */ p(h.Status, {
140
+ className: c("pf:text-copy-12 pf:text-soft-pearl-800", !R && !M?.error && !z.length ? "pf:px-lg pf:py-xl pf:text-center pf:wrap-anywhere" : "pf:px-md"),
141
+ children: R ? "Searching…" : M?.error ?? (z.length ? V ? g.selectionLimitConfig?.message ?? `Select up to ${String(B)} options.` : "" : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
142
+ className: "pf:block pf:text-label-13 pf:font-medium pf:text-soft-pearl-1000",
143
+ children: g.emptyLabel ?? (N.trim() ? `No matches for “${N.trim()}”` : "No options available")
144
+ }), N.trim() && /* @__PURE__ */ p("span", {
145
+ className: "pf:block pf:mt-xs",
146
+ children: "Try a different search."
147
+ })] }))
133
148
  }),
134
- D?.error && D.onRetry && /* @__PURE__ */ l("button", {
149
+ M?.error && M.onRetry && /* @__PURE__ */ p("button", {
135
150
  type: "button",
136
- className: "pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700",
137
- onClick: D.onRetry,
151
+ className: "pf:cursor-pointer pf:disabled:cursor-default pf:select-none pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700",
152
+ onClick: M.onRetry,
138
153
  children: "Retry search"
139
154
  }),
140
- f.paginationConfig && !N && !D?.error && /* @__PURE__ */ l("div", { children: f.paginationConfig.error ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("span", {
155
+ g.paginationConfig && !R && !M?.error && /* @__PURE__ */ p("div", { children: g.paginationConfig.error ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
141
156
  role: "status",
142
157
  className: "pf:text-copy-12 pf:text-red-700",
143
- children: f.paginationConfig.error
144
- }), /* @__PURE__ */ l("button", {
158
+ children: g.paginationConfig.error
159
+ }), /* @__PURE__ */ p("button", {
145
160
  type: "button",
146
- className: "pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700",
161
+ className: "pf:cursor-pointer pf:disabled:cursor-default pf:select-none pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700",
147
162
  onClick: () => {
148
- R.current = null, f.paginationConfig?.onRetry?.();
163
+ U.current = null, g.paginationConfig?.onRetry?.();
149
164
  },
150
165
  children: "Retry loading more"
151
- })] }) : f.paginationConfig.hasMore && /* @__PURE__ */ l("button", {
166
+ })] }) : g.paginationConfig.hasMore && /* @__PURE__ */ p("button", {
152
167
  type: "button",
153
- className: "pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700",
154
- disabled: f.paginationConfig.isLoadingMore,
155
- onClick: B,
156
- children: f.paginationConfig.isLoadingMore ? "Loading more…" : "Load more"
168
+ className: "pf:cursor-pointer pf:disabled:cursor-default pf:select-none pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700",
169
+ disabled: g.paginationConfig.isLoadingMore,
170
+ onClick: G,
171
+ children: g.paginationConfig.isLoadingMore ? "Loading more…" : "Load more"
157
172
  }) }),
158
- f.addItemConfig && /* @__PURE__ */ l("button", {
173
+ g.addItemConfig && /* @__PURE__ */ p("button", {
159
174
  type: "button",
160
- className: "pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700",
161
- disabled: f.addItemConfig.isDisabled,
175
+ className: "pf:cursor-pointer pf:disabled:cursor-default pf:select-none pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700",
176
+ disabled: g.addItemConfig.isDisabled,
162
177
  onClick: () => {
163
- f.addItemConfig?.onAddItem(O), y(!1);
178
+ g.addItemConfig?.onAddItem(N), w(!1);
164
179
  },
165
- children: f.addItemConfig.label
180
+ children: g.addItemConfig.label
166
181
  })
167
182
  ]
168
183
  })
@@ -170,4 +185,4 @@ function f({ config: f, multiple: p, values: m, onChange: h, forwardedRef: g, fi
170
185
  });
171
186
  }
172
187
  //#endregion
173
- export { f as SearchableChoice };
188
+ export { g as SearchableChoice };
@@ -59,7 +59,7 @@ function u({ options: u, disabled: d, onRemove: f, onOpen: p }) {
59
59
  onClick: () => {
60
60
  f(n.value);
61
61
  },
62
- className: "pf:pointer-events-auto pf:shrink-0 pf:flex pf:size-[12px] pf:items-center pf:justify-center pf:border-0 pf:bg-transparent pf:p-0 pf:text-soft-pearl-800 pf:rounded-xs pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:opacity-50",
62
+ className: "pf:pointer-events-auto pf:shrink-0 pf:flex pf:size-[12px] pf:items-center pf:justify-center pf:border-0 pf:bg-transparent pf:p-0 pf:text-soft-pearl-800 pf:rounded-xs pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:opacity-50 pf:cursor-pointer pf:disabled:cursor-default",
63
63
  children: /* @__PURE__ */ c(t, {
64
64
  size: 12,
65
65
  tone: "inherit"
@@ -1,122 +1,140 @@
1
1
  "use client";
2
- import { Checkbox as e } from "../checkbox/Checkbox.js";
3
- import { choiceItemClass as t, choicePopupClass as n } from "./choice-styles.js";
4
- import { ChoiceField as r } from "./ChoiceField.js";
5
- import { ChoiceIndicator as i } from "./ChoiceIndicator.js";
6
- import { OptionContent as a } from "./OptionContent.js";
7
- import { useRef as o, useState as s } from "react";
8
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
- import { Select as u } from "@base-ui/react/select";
2
+ import { hoverHighlightClass as e, useHoverHighlight as t } from "../controls/useHoverHighlight.js";
3
+ import { choiceIndicatorMotionProps as n } from "../choices/choice-motion.js";
4
+ import { Checkbox as r } from "../checkbox/Checkbox.js";
5
+ import { choiceItemClass as i, choicePopupClass as a } from "./choice-styles.js";
6
+ import { ChoiceField as o } from "./ChoiceField.js";
7
+ import { ChoiceIndicator as s } from "./ChoiceIndicator.js";
8
+ import { OptionContent as c } from "./OptionContent.js";
9
+ import l from "clsx";
10
+ import { useRef as u, useState as d } from "react";
11
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
12
+ import { Select as m } from "@base-ui/react/select";
10
13
  //#region src/components/selection/SimpleChoice.tsx
11
- function d({ config: d, multiple: f, values: p, onChange: m, forwardedRef: h, field: g }) {
12
- let _ = o(null), [v, y] = s(!1), b = d.options ?? d.groups.flatMap((e) => e.options), x = new Map(b.map((e) => [e.value, e])), S = new Set(p), C = p.map((e) => x.get(e) ?? {
14
+ function h({ config: h, multiple: g, values: _, onChange: v, forwardedRef: y, field: b }) {
15
+ let x = t(), S = u(null), [C, w] = d(!1), T = h.options ?? h.groups.flatMap((e) => e.options), E = new Map(T.map((e) => [e.value, e])), D = new Set(_), O = _.map((e) => E.get(e) ?? {
13
16
  value: e,
14
17
  label: "Selected value unavailable"
15
- }), w = d.selectionLimitConfig?.max, T = (e) => {
16
- let t = p.filter((e) => x.get(e)?.disableConfig?.isDisabled), n = [.../* @__PURE__ */ new Set([...e, ...t])];
17
- w !== void 0 && n.length > w && n.length > p.length || m(n);
18
- }, E = b.filter((e) => !e.disableConfig?.isDisabled).map((e) => e.value), D = E.length > 0 && E.every((e) => S.has(e)), O = [.../* @__PURE__ */ new Set([...p, ...E])], k = (e) => e.map((e) => /* @__PURE__ */ l(u.Item, {
18
+ }), k = h.selectionLimitConfig?.max, A = (e) => {
19
+ let t = _.filter((e) => E.get(e)?.disableConfig?.isDisabled), n = [.../* @__PURE__ */ new Set([...e, ...t])];
20
+ k !== void 0 && n.length > k && n.length > _.length || v(n);
21
+ }, j = T.filter((e) => !e.disableConfig?.isDisabled).map((e) => e.value), M = j.length > 0 && j.every((e) => D.has(e)), N = [.../* @__PURE__ */ new Set([..._, ...j])], P = (e) => e.map((e) => /* @__PURE__ */ p(m.Item, {
19
22
  value: e.value,
20
- disabled: e.disableConfig?.isDisabled || w !== void 0 && p.length >= w && !S.has(e.value),
21
- className: t,
23
+ disabled: e.disableConfig?.isDisabled || k !== void 0 && _.length >= k && !D.has(e.value),
24
+ className: i,
22
25
  children: [
23
- f && /* @__PURE__ */ c(i, {
26
+ g && /* @__PURE__ */ f(s, {
24
27
  multiple: !0,
25
- selected: S.has(e.value),
26
- disabled: e.disableConfig?.isDisabled || w !== void 0 && p.length >= w && !S.has(e.value)
28
+ selected: D.has(e.value),
29
+ disabled: e.disableConfig?.isDisabled || k !== void 0 && _.length >= k && !D.has(e.value)
27
30
  }),
28
- /* @__PURE__ */ c(u.ItemText, {
31
+ /* @__PURE__ */ f(m.ItemText, {
29
32
  className: "pf:flex pf:flex-1 pf:min-w-0 pf:items-center pf:gap-sm",
30
- children: d.renderConfig?.optionContent?.(e, { isSelected: S.has(e.value) }) ?? /* @__PURE__ */ c(a, { option: e })
33
+ children: h.renderConfig?.optionContent?.(e, { isSelected: D.has(e.value) }) ?? /* @__PURE__ */ f(c, { option: e })
31
34
  }),
32
- !f && /* @__PURE__ */ c(i, { selected: S.has(e.value) })
35
+ !g && /* @__PURE__ */ f(s, { selected: D.has(e.value) })
33
36
  ]
34
37
  }, e.value));
35
- return /* @__PURE__ */ l(u.Root, {
36
- multiple: f,
37
- open: v,
38
+ return /* @__PURE__ */ p(m.Root, {
39
+ multiple: g,
40
+ open: C,
38
41
  onOpenChange: (e) => {
39
- y(e), e || g.blur();
42
+ w(e), e || b.blur();
40
43
  },
41
- items: b.map(({ value: e, label: t }) => ({
44
+ items: T.map(({ value: e, label: t }) => ({
42
45
  value: e,
43
46
  label: t
44
47
  })),
45
- value: f ? p : p[0] ?? null,
48
+ value: g ? _ : _[0] ?? null,
46
49
  onValueChange: (e) => {
47
- T(Array.isArray(e) ? e : e === null ? [] : [e]);
50
+ A(Array.isArray(e) ? e : e === null ? [] : [e]);
48
51
  },
49
- disabled: d.disableConfig?.isDisabled,
50
- autoComplete: d.autoComplete,
51
- name: d.name,
52
- form: d.form,
53
- required: d.required,
54
- children: [/* @__PURE__ */ c(r, {
55
- config: d,
56
- field: g,
57
- multiple: f,
58
- resolved: C,
59
- open: v,
60
- anchorRef: _,
52
+ disabled: h.disableConfig?.isDisabled,
53
+ autoComplete: h.autoComplete,
54
+ name: h.name,
55
+ form: h.form,
56
+ required: h.required,
57
+ children: [/* @__PURE__ */ f(o, {
58
+ config: h,
59
+ field: b,
60
+ multiple: g,
61
+ resolved: O,
62
+ open: C,
63
+ anchorRef: S,
61
64
  onRemove: (e) => {
62
- T(p.filter((t) => t !== e));
65
+ A(_.filter((t) => t !== e));
63
66
  },
64
67
  onClear: () => {
65
- T([]);
68
+ A([]);
66
69
  },
67
- trigger: /* @__PURE__ */ c(u.Trigger, {
68
- id: g.id,
69
- form: d.form,
70
- ref: h,
71
- "aria-label": d.label ?? d["aria-label"],
72
- "aria-describedby": g.describedBy,
73
- "aria-invalid": !!g.error,
70
+ trigger: /* @__PURE__ */ f(m.Trigger, {
71
+ id: b.id,
72
+ form: h.form,
73
+ ref: y,
74
+ "aria-label": h.label ?? h["aria-label"],
75
+ "aria-describedby": b.describedBy,
76
+ "aria-invalid": !!b.error,
74
77
  onBlur: (e) => {
75
- v || g.blur(), d.onBlur?.(e);
78
+ C || b.blur(), h.onBlur?.(e);
76
79
  },
77
- onFocus: d.onFocus
80
+ onFocus: h.onFocus
78
81
  })
79
- }), /* @__PURE__ */ c(u.Portal, { children: /* @__PURE__ */ c(u.Positioner, {
80
- anchor: _,
82
+ }), /* @__PURE__ */ f(m.Portal, { children: /* @__PURE__ */ f(m.Positioner, {
83
+ anchor: S,
81
84
  align: "start",
82
85
  sideOffset: 4,
83
86
  className: "pf:z-[60]",
84
87
  alignItemWithTrigger: !1,
85
- children: /* @__PURE__ */ l(u.Popup, {
86
- className: n,
88
+ children: /* @__PURE__ */ p(m.Popup, {
89
+ ...x.props,
90
+ onPointerDownCapture: n.onPointerDownCapture,
91
+ onKeyDownCapture: (e) => {
92
+ if (x.props.onKeyDownCapture(), n.onKeyDownCapture(e), ![
93
+ "ArrowDown",
94
+ "ArrowUp",
95
+ "Home",
96
+ "End"
97
+ ].includes(e.key) || e.target.closest("button, [role=\"checkbox\"]")) return;
98
+ let t = Array.from(e.currentTarget.querySelectorAll("[role=\"option\"]:not([aria-disabled=\"true\"])"));
99
+ if (!t.length) return;
100
+ let r = t.findIndex((e) => e === document.activeElement || e.hasAttribute("data-highlighted")), i = e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : e.key === "ArrowDown" ? (r + 1) % t.length : (r <= 0 ? t.length : r) - 1;
101
+ e.preventDefault(), e.stopPropagation(), t[i].focus();
102
+ },
103
+ className: l(a, e),
87
104
  children: [
88
- f && d.selectAllConfig && /* @__PURE__ */ c(e, {
89
- checked: D,
90
- indeterminate: !D && E.some((e) => S.has(e)),
91
- className: "pf:mx-sm pf:mt-sm pf:mb-xxs pf:px-md pf:py-sm pf:min-h-[32px] pf:w-[calc(100%_-_12px)] pf:[&.pf-choice]:items-center pf:[&.pf-choice]:gap-sm pf:[&_.pf-choice-label]:font-medium pf:[&_.pf-choice-label]:leading-[20px] pf:rounded-sm pf:hover:bg-soft-pearl-200",
92
- disabled: !E.length || !D && w !== void 0 && O.length > w,
105
+ x.highlight,
106
+ g && h.selectAllConfig && /* @__PURE__ */ f(r, {
107
+ checked: M,
108
+ indeterminate: !M && j.some((e) => D.has(e)),
109
+ className: "pf:select-none pf:mx-sm pf:mt-sm pf:mb-xxs pf:px-md pf:py-sm pf:min-h-[32px] pf:w-[calc(100%_-_12px)] pf:[&.pf-choice]:items-center pf:[&.pf-choice]:gap-sm pf:[&_.pf-choice-label]:font-medium pf:[&_.pf-choice-label]:leading-[20px] pf:rounded-sm pf:hover:bg-soft-pearl-200",
110
+ disabled: !j.length || !M && k !== void 0 && N.length > k,
93
111
  onCheckedChange: () => {
94
- T(D ? p.filter((e) => !E.includes(e)) : O);
112
+ A(M ? _.filter((e) => !j.includes(e)) : N);
95
113
  },
96
- label: D ? "Deselect listed options" : d.selectAllConfig.label ?? "Select listed options"
114
+ label: M ? "Clear selection" : h.selectAllConfig.label ?? "Select all"
97
115
  }),
98
- /* @__PURE__ */ l(u.List, {
99
- style: { maxHeight: d.listConfig?.maxHeight ?? 320 },
116
+ /* @__PURE__ */ p(m.List, {
117
+ style: { maxHeight: h.listConfig?.maxHeight ?? 320 },
100
118
  className: "pf:overflow-y-auto pf:flex pf:flex-col pf:gap-xxs pf:p-sm",
101
- children: [d.groups ? d.groups.map((e) => /* @__PURE__ */ l(u.Group, {
119
+ children: [h.groups ? h.groups.map((e) => /* @__PURE__ */ p(m.Group, {
102
120
  className: "pf:flex pf:flex-col pf:gap-xxs",
103
- children: [/* @__PURE__ */ c(u.GroupLabel, {
121
+ children: [/* @__PURE__ */ f(m.GroupLabel, {
104
122
  className: "pf:px-md pf:py-xs pf:text-copy-12 pf:text-soft-pearl-800",
105
123
  children: e.label
106
- }), k(e.options)]
107
- }, e.id)) : k(b), !b.length && /* @__PURE__ */ c("div", {
108
- className: "pf:p-md pf:text-soft-pearl-800",
109
- children: d.emptyLabel ?? "No options available."
124
+ }), P(e.options)]
125
+ }, e.id)) : P(T), !T.length && /* @__PURE__ */ f("div", {
126
+ className: "pf:px-lg pf:py-xl pf:text-copy-13 pf:text-soft-pearl-800",
127
+ children: h.emptyLabel ?? "No options available."
110
128
  })]
111
129
  }),
112
- d.addItemConfig && /* @__PURE__ */ c("button", {
130
+ h.addItemConfig && /* @__PURE__ */ f("button", {
113
131
  type: "button",
114
- disabled: d.addItemConfig.isDisabled,
115
- className: "pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700",
132
+ disabled: h.addItemConfig.isDisabled,
133
+ className: "pf:cursor-pointer pf:disabled:cursor-default pf:select-none pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700",
116
134
  onClick: () => {
117
- d.addItemConfig?.onAddItem("");
135
+ h.addItemConfig?.onAddItem("");
118
136
  },
119
- children: d.addItemConfig.label
137
+ children: h.addItemConfig.label
120
138
  })
121
139
  ]
122
140
  })
@@ -124,4 +142,4 @@ function d({ config: d, multiple: f, values: p, onChange: m, forwardedRef: h, fi
124
142
  });
125
143
  }
126
144
  //#endregion
127
- export { d as SimpleChoice };
145
+ export { h as SimpleChoice };
@@ -1,3 +1,3 @@
1
1
  export declare const choicePopupClass = "pf:box-border pf:w-[var(--anchor-width)] pf:min-w-[min(200px,calc(100vw-24px))] pf:max-w-[calc(100vw-24px)] pf:rounded-lg pf:border-[0.5px] pf:border-solid pf:border-soft-pearl-300 pf:bg-background pf:p-0 pf:shadow-[0_1px_2px_#12121205,0_4px_20px_#12121214] pf:font-body pf:text-label-13 pf:leading-[20px] pf:font-medium pf:text-soft-pearl-1000 pf:outline-none";
2
- export declare const choiceItemClass = "pf:box-border pf:flex pf:items-center pf:gap-sm pf:min-h-[32px] pf:ps-md pf:pe-lg pf:py-sm pf:rounded-sm pf:cursor-default pf:outline-none pf:data-highlighted:bg-soft-pearl-200 pf:data-disabled:text-soft-pearl-700 pf:data-disabled:cursor-not-allowed";
3
- export declare const choiceActionClass = "pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700";
2
+ export declare const choiceItemClass = "pf:relative pf:select-none pf:box-border pf:flex pf:items-center pf:gap-sm pf:min-h-[32px] pf:ps-md pf:pe-lg pf:py-sm pf:rounded-sm pf:cursor-default pf:outline-none pf:data-highlighted:not-data-disabled:bg-soft-pearl-200 pf:data-disabled:text-soft-pearl-700 pf:data-disabled:cursor-default";
3
+ export declare const choiceActionClass = "pf:cursor-pointer pf:disabled:cursor-default pf:select-none pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700";
@@ -1,4 +1,4 @@
1
1
  //#region src/components/selection/choice-styles.ts
2
- var e = "pf:box-border pf:w-[var(--anchor-width)] pf:min-w-[min(200px,calc(100vw-24px))] pf:max-w-[calc(100vw-24px)] pf:rounded-lg pf:border-[0.5px] pf:border-solid pf:border-soft-pearl-300 pf:bg-background pf:p-0 pf:shadow-[0_1px_2px_#12121205,0_4px_20px_#12121214] pf:font-body pf:text-label-13 pf:leading-[20px] pf:font-medium pf:text-soft-pearl-1000 pf:outline-none", t = "pf:box-border pf:flex pf:items-center pf:gap-sm pf:min-h-[32px] pf:ps-md pf:pe-lg pf:py-sm pf:rounded-sm pf:cursor-default pf:outline-none pf:data-highlighted:bg-soft-pearl-200 pf:data-disabled:text-soft-pearl-700 pf:data-disabled:cursor-not-allowed", n = "pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700";
2
+ var e = "pf:box-border pf:w-[var(--anchor-width)] pf:min-w-[min(200px,calc(100vw-24px))] pf:max-w-[calc(100vw-24px)] pf:rounded-lg pf:border-[0.5px] pf:border-solid pf:border-soft-pearl-300 pf:bg-background pf:p-0 pf:shadow-[0_1px_2px_#12121205,0_4px_20px_#12121214] pf:font-body pf:text-label-13 pf:leading-[20px] pf:font-medium pf:text-soft-pearl-1000 pf:outline-none", t = "pf:relative pf:select-none pf:box-border pf:flex pf:items-center pf:gap-sm pf:min-h-[32px] pf:ps-md pf:pe-lg pf:py-sm pf:rounded-sm pf:cursor-default pf:outline-none pf:data-highlighted:not-data-disabled:bg-soft-pearl-200 pf:data-disabled:text-soft-pearl-700 pf:data-disabled:cursor-default", n = "pf:cursor-pointer pf:disabled:cursor-default pf:select-none pf:box-border pf:w-full pf:text-start pf:px-md pf:py-sm pf:border-0 pf:bg-transparent pf:text-label-13 pf:text-blue-700 pf:font-body pf:rounded-xs pf:hover:bg-soft-pearl-200 pf:focus-visible:outline-2 pf:focus-visible:outline-blue-700 pf:disabled:text-soft-pearl-700";
3
3
  //#endregion
4
4
  export { n as choiceActionClass, t as choiceItemClass, e as choicePopupClass };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { overlaySurfaceClassNames as e, overlayTitleClassNames as t } from "../overlays/overlay-class-names.js";
3
3
  import { OverlayFrame as n } from "../overlays/OverlayFrame.js";
4
- import { motionRecipe as r } from "../../foundations/motion/motion-tokens.js";
5
- import { useOverlayState as i } from "../overlays/useOverlayState.js";
4
+ import { useOverlayState as r } from "../overlays/useOverlayState.js";
5
+ import { motionRecipe as i } from "../../foundations/motion/motion-tokens.js";
6
6
  import { useSheetDrag as a } from "./useSheetDrag.js";
7
7
  import o from "clsx";
8
8
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
@@ -14,7 +14,7 @@ var u = {
14
14
  lg: "pf:w-[720px]"
15
15
  };
16
16
  function d(d) {
17
- let { trigger: f, title: p, description: m, side: h = "right", size: g = "md", modal: _ = !1, children: v, footerConfig: y, dismissConfig: b, focusConfig: x, className: S } = d, C = i(d, b), w = h === "bottom", T = w && d.dragConfig?.dismissible !== !1, { popup: E, ...D } = a(T && !C.pending, C.open, () => {
17
+ let { trigger: f, title: p, description: m, side: h = "right", size: g = "md", modal: _ = !1, children: v, footerConfig: y, dismissConfig: b, focusConfig: x, className: S } = d, C = r(d, b), w = h === "bottom", T = w && d.dragConfig?.dismissible !== !1, { popup: E, ...D } = a(T && !C.pending, C.open, () => {
18
18
  C.requestClose("swipe");
19
19
  });
20
20
  return /* @__PURE__ */ c(l.Root, {
@@ -23,15 +23,15 @@ function d(d) {
23
23
  onOpenChange: C.handleOpenChange,
24
24
  disablePointerDismissal: !_ || b?.outsidePress !== !0,
25
25
  children: [f && /* @__PURE__ */ s(l.Trigger, { render: f }), /* @__PURE__ */ c(l.Portal, { children: [_ && /* @__PURE__ */ s(l.Backdrop, {
26
- className: o("pf:fixed pf:inset-0 pf:z-40 pf:bg-soft-pearl-1000/10 pf:transition-opacity pf:duration-200 pf:ease-(--pf-easing-out) pf:data-[starting-style]:opacity-0 pf:data-[ending-style]:opacity-0", "pf:duration-500", !w && "pf:data-[ending-style]:duration-300", !C.animate && "pf:transition-none"),
27
- style: { transitionTimingFunction: r.sheetEasing }
26
+ className: o("pf:fixed pf:inset-0 pf:z-40 pf:bg-soft-pearl-1000/10 pf:transition-opacity pf:duration-180 pf:data-[ending-style]:duration-120 pf:ease-[cubic-bezier(0.23,1,0.32,1)] pf:motion-reduce:transition-none pf:data-[starting-style]:opacity-0 pf:data-[ending-style]:opacity-0", "pf:duration-250", !w && "pf:data-[ending-style]:duration-180", !C.animate && "pf:transition-none"),
27
+ style: { transitionTimingFunction: i.sheetEasing }
28
28
  }), /* @__PURE__ */ c(l.Popup, {
29
29
  ref: E,
30
30
  initialFocus: x?.initialFocusRef ?? (() => E.current?.querySelector("[data-overlay-body] input:not(:disabled), [data-overlay-body] textarea:not(:disabled), [data-overlay-body] button:not(:disabled), [data-overlay-body] a[href]") ?? E.current),
31
31
  finalFocus: x?.returnFocusRef,
32
32
  "aria-busy": C.pending || void 0,
33
- className: o(e, "pf:fixed pf:z-50", w ? "pf:bottom-0 pf:inset-x-0 pf:max-h-[96dvh] pf:rounded-b-none pf:bg-soft-pearl-100 pf:pb-[env(safe-area-inset-bottom)]" : `pf:top-xl pf:right-xl pf:h-[calc(100dvh-32px)] pf:max-w-[calc(100vw-32px)] ${u[g]}`, C.animate && "pf:transition-transform pf:motion-reduce:transition-none", C.animate && (w ? "pf:duration-500 pf:motion-safe:data-[starting-style]:[transform:translateY(100%)] pf:motion-safe:data-[ending-style]:[transform:translateY(100%)]" : "pf:duration-500 pf:data-[ending-style]:duration-300 pf:motion-safe:data-[starting-style]:[transform:translateX(calc(100%+16px))] pf:motion-safe:data-[ending-style]:[transform:translateX(calc(100%+16px))]"), S),
34
- style: { transitionTimingFunction: r.sheetEasing },
33
+ className: o(e, "pf:fixed pf:z-50", w ? "pf:bottom-0 pf:inset-x-0 pf:max-h-[96dvh] pf:rounded-b-none pf:bg-soft-pearl-100 pf:pb-[env(safe-area-inset-bottom)]" : `pf:top-xl pf:right-xl pf:h-[calc(100dvh-32px)] pf:max-w-[calc(100vw-32px)] ${u[g]}`, C.animate && "pf:transition-transform pf:motion-reduce:transition-none", C.animate && (w ? "pf:duration-250 pf:data-[ending-style]:duration-180 pf:motion-safe:data-[starting-style]:[transform:translateY(100%)] pf:motion-safe:data-[ending-style]:[transform:translateY(100%)]" : "pf:duration-250 pf:data-[ending-style]:duration-180 pf:motion-safe:data-[starting-style]:[transform:translateX(calc(100%+16px))] pf:motion-safe:data-[ending-style]:[transform:translateX(calc(100%+16px))]"), S),
34
+ style: { transitionTimingFunction: i.sheetEasing },
35
35
  children: [w && /* @__PURE__ */ s("button", {
36
36
  type: "button",
37
37
  disabled: !T || C.pending,