@plumile/ui 0.1.185 → 0.1.188

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 (214) hide show
  1. package/lib/esm/admin/organisms/admin_sidebar/AdminSidebar.js +1 -1
  2. package/lib/esm/admin/organisms/admin_sidebar/adminSidebar.css.js +4 -2
  3. package/lib/esm/admin/organisms/admin_topbar/adminTopbar.css.js +1 -3
  4. package/lib/esm/atomic/atoms/badge/badge.css.js +7 -7
  5. package/lib/esm/atomic/atoms/button/button.css.js +38 -38
  6. package/lib/esm/atomic/atoms/checkbox/checkbox.css.js +6 -6
  7. package/lib/esm/atomic/atoms/error_message/errorMessage.css.js +1 -1
  8. package/lib/esm/atomic/atoms/input/input.css.js +9 -9
  9. package/lib/esm/atomic/atoms/label/label.css.js +3 -3
  10. package/lib/esm/atomic/atoms/modal/Modal.js +1 -1
  11. package/lib/esm/atomic/atoms/modal/modal.css.js +1 -1
  12. package/lib/esm/atomic/atoms/overlay/overlay.css.js +1 -1
  13. package/lib/esm/atomic/atoms/textarea/textarea.css.js +8 -8
  14. package/lib/esm/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuPopover.js +1 -1
  15. package/lib/esm/atomic/molecules/breadcrumb_navigation/breadcrumbNavigation.css.js +1 -1
  16. package/lib/esm/atomic/molecules/checkbox_field/checkboxField.css.js +1 -1
  17. package/lib/esm/atomic/molecules/dropdown/Dropdown.js +75 -95
  18. package/lib/esm/atomic/molecules/dropdown/Dropdown.js.map +1 -1
  19. package/lib/esm/atomic/molecules/dropdown/dropdown.css.js +1 -1
  20. package/lib/esm/atomic/molecules/empty-state/EmptyState.css.js +17 -17
  21. package/lib/esm/atomic/molecules/form/formStyles.css.js +1 -1
  22. package/lib/esm/atomic/molecules/form_error/formError.css.js +1 -1
  23. package/lib/esm/atomic/molecules/form_field/formField.css.js +1 -1
  24. package/lib/esm/atomic/molecules/form_field_layout/FormFieldLayout.js +55 -0
  25. package/lib/esm/atomic/molecules/form_field_layout/FormFieldLayout.js.map +1 -0
  26. package/lib/esm/atomic/molecules/form_field_layout/formFieldLayout.css.js +8 -0
  27. package/lib/esm/atomic/molecules/form_field_layout/formFieldLayout.css.js.map +1 -0
  28. package/lib/esm/atomic/molecules/form_grid/FormGrid.css.js +11 -2
  29. package/lib/esm/atomic/molecules/form_grid/FormGrid.css.js.map +1 -1
  30. package/lib/esm/atomic/molecules/form_grid/FormGrid.js +10 -6
  31. package/lib/esm/atomic/molecules/form_grid/FormGrid.js.map +1 -1
  32. package/lib/esm/atomic/molecules/highlight/HighlightCode.css.js +1 -1
  33. package/lib/esm/atomic/molecules/highlight/highlightStyles.css.js +1 -1
  34. package/lib/esm/atomic/molecules/markdown/LazyMarkdownRenderer.css.js +1 -1
  35. package/lib/esm/atomic/molecules/markdown/LazyMarkdownRenderer.css.js.map +1 -1
  36. package/lib/esm/atomic/molecules/markdown/components/MarkdownArticleContainer.css.js +1 -0
  37. package/lib/esm/atomic/molecules/markdown/components/MarkdownBlockquote.css.js +1 -1
  38. package/lib/esm/atomic/molecules/markdown/components/MarkdownCodeCopyButton.css.js +1 -1
  39. package/lib/esm/atomic/molecules/markdown/components/MarkdownFootnoteDefinition.css.js +1 -1
  40. package/lib/esm/atomic/molecules/markdown/components/MarkdownFootnotesSection.css.js +1 -1
  41. package/lib/esm/atomic/molecules/markdown/components/MarkdownHeading.css.js +1 -1
  42. package/lib/esm/atomic/molecules/markdown/components/MarkdownHtmlFallback.css.js +1 -1
  43. package/lib/esm/atomic/molecules/markdown/components/MarkdownImage.css.js +1 -1
  44. package/lib/esm/atomic/molecules/markdown/components/MarkdownInlineCode.css.js +1 -2
  45. package/lib/esm/atomic/molecules/markdown/components/MarkdownInlineCode.css.js.map +1 -1
  46. package/lib/esm/atomic/molecules/markdown/components/MarkdownLink.css.js +1 -1
  47. package/lib/esm/atomic/molecules/markdown/components/MarkdownList.css.js +1 -1
  48. package/lib/esm/atomic/molecules/markdown/components/MarkdownMark.css.js +1 -1
  49. package/lib/esm/atomic/molecules/markdown/components/MarkdownMermaidBlock.css.js +1 -1
  50. package/lib/esm/atomic/molecules/markdown/components/MarkdownTable.css.js +1 -1
  51. package/lib/esm/atomic/molecules/markdown/components/MarkdownTableCaption.css.js +1 -1
  52. package/lib/esm/atomic/molecules/markdown/components/MarkdownTableCell.css.js +1 -1
  53. package/lib/esm/atomic/molecules/markdown/components/MarkdownTableHead.css.js +1 -1
  54. package/lib/esm/atomic/molecules/markdown/components/MarkdownTableHeaderCell.css.js +1 -1
  55. package/lib/esm/atomic/molecules/markdown/components/MarkdownTaskListItem.css.js +1 -1
  56. package/lib/esm/atomic/molecules/markdown/components/MarkdownText.css.js +1 -1
  57. package/lib/esm/atomic/molecules/markdown/components/MarkdownThematicBreak.css.js +1 -1
  58. package/lib/esm/atomic/molecules/tabs/tabs.css.js +14 -14
  59. package/lib/esm/atomic/molecules/toast/ToastViewport.js +3 -1
  60. package/lib/esm/atomic/molecules/toast/ToastViewport.js.map +1 -1
  61. package/lib/esm/atomic/molecules/toast/toast.css.js +2 -2
  62. package/lib/esm/atomic/organisms/login_form/loginForm.css.js +1 -1
  63. package/lib/esm/atomic/organisms/sidebar/SidebarContainer.js +1 -1
  64. package/lib/esm/atomic/organisms/sidebar/navigationSidebar.css.js +7 -7
  65. package/lib/esm/atomic/organisms/sidebar/sidebar.css.js +2 -2
  66. package/lib/esm/atomic/templates/auth_layout/authLayout.css.js +1 -1
  67. package/lib/esm/atomic/templates/page-container/pageContainer.css.js +1 -1
  68. package/lib/esm/backoffice/atoms/copyable_text/copyableText.css.js +1 -1
  69. package/lib/esm/backoffice/atoms/shortcut_hint/shortcutHint.css.js +1 -1
  70. package/lib/esm/backoffice/atoms/status_badge/statusBadge.css.js +1 -1
  71. package/lib/esm/backoffice/atoms/tag/tag.css.js +7 -7
  72. package/lib/esm/backoffice/molecules/backoffice_detail_field/backofficeDetailField.css.js +1 -1
  73. package/lib/esm/backoffice/molecules/backoffice_detail_section/backofficeDetailSection.css.js +1 -1
  74. package/lib/esm/backoffice/molecules/backoffice_filter_drawer/BackofficeFilterDrawer.js +3 -3
  75. package/lib/esm/backoffice/molecules/backoffice_filter_drawer/backofficeFilterDrawer.css.js +1 -1
  76. package/lib/esm/backoffice/molecules/backoffice_filter_field/backofficeFilterField.css.js +1 -1
  77. package/lib/esm/backoffice/molecules/backoffice_json_viewer/LazyBackofficeJsonViewer.css.js +1 -1
  78. package/lib/esm/backoffice/molecules/backoffice_json_viewer/LazyBackofficeJsonViewer.js +1 -1
  79. package/lib/esm/backoffice/molecules/backoffice_json_viewer/backofficeJsonViewer.css.js +1 -1
  80. package/lib/esm/backoffice/molecules/backoffice_key_value_list/backofficeKeyValueList.css.js +1 -1
  81. package/lib/esm/backoffice/molecules/backoffice_key_value_section/backofficeKeyValueSection.css.js +1 -1
  82. package/lib/esm/backoffice/molecules/backoffice_list_footer/BackofficeListFooter.js +2 -2
  83. package/lib/esm/backoffice/molecules/backoffice_list_footer/backofficeListFooter.css.js +1 -1
  84. package/lib/esm/backoffice/molecules/backoffice_page_header/BackofficePageHeader.js +1 -1
  85. package/lib/esm/backoffice/molecules/backoffice_page_header/backofficePageHeader.css.js +1 -1
  86. package/lib/esm/backoffice/molecules/backoffice_payload_section/backofficePayloadSection.css.js +1 -1
  87. package/lib/esm/backoffice/molecules/backoffice_payload_viewer/BackofficePayloadViewer.js +1 -1
  88. package/lib/esm/backoffice/molecules/backoffice_payload_viewer/backofficePayloadViewer.css.js +1 -1
  89. package/lib/esm/backoffice/molecules/backoffice_picker/backofficePicker.css.js +1 -1
  90. package/lib/esm/backoffice/molecules/backoffice_relations_menu/BackofficeRelationsMenu.js +3 -3
  91. package/lib/esm/backoffice/molecules/backoffice_relations_menu/backofficeRelationsMenu.css.js +1 -1
  92. package/lib/esm/backoffice/molecules/backoffice_status_meta_badge/backofficeStatusMetaBadge.css.js +1 -1
  93. package/lib/esm/backoffice/molecules/backoffice_sticky_disclosure/BackofficeStickyDisclosure.js +1 -1
  94. package/lib/esm/backoffice/molecules/backoffice_sticky_disclosure/backofficeStickyDisclosure.css.js +4 -4
  95. package/lib/esm/backoffice/molecules/backoffice_table_skeleton/backofficeTableSkeleton.css.js +2 -2
  96. package/lib/esm/backoffice/molecules/backoffice_tool_call_frame/BackofficeToolCallFrame.js +2 -2
  97. package/lib/esm/backoffice/molecules/backoffice_tool_call_frame/backofficeToolCallFrame.css.js +1 -1
  98. package/lib/esm/backoffice/molecules/backoffice_toolbar/BackofficeToolbar.js +6 -6
  99. package/lib/esm/backoffice/molecules/backoffice_toolbar/backofficeToolbar.css.js +2 -2
  100. package/lib/esm/backoffice/molecules/bulk_actions_bar/bulkActionsBar.css.js +1 -1
  101. package/lib/esm/backoffice/molecules/filter_chip_row/filterChipRow.css.js +1 -1
  102. package/lib/esm/backoffice/molecules/global_search_input/globalSearchInput.css.js +1 -1
  103. package/lib/esm/backoffice/molecules/sidebar_collapse_toggle/sidebarCollapseToggle.css.js +1 -1
  104. package/lib/esm/backoffice/molecules/sidebar_nav_item/sidebarNavItem.css.js +1 -1
  105. package/lib/esm/backoffice/molecules/sidebar_nav_section/SidebarNavSection.js +2 -2
  106. package/lib/esm/backoffice/molecules/sidebar_nav_section/sidebarNavSection.css.js +1 -1
  107. package/lib/esm/backoffice/molecules/sidebar_profile_menu/BackofficeSidebarProfileMenu.js +2 -2
  108. package/lib/esm/backoffice/molecules/sidebar_profile_menu/sidebarProfileMenu.css.js +5 -5
  109. package/lib/esm/backoffice/organisms/audit_timeline/auditTimeline.css.js +3 -3
  110. package/lib/esm/backoffice/organisms/entity_header/entityHeader.css.js +1 -1
  111. package/lib/esm/backoffice/templates/detail_page_template/DetailPageTemplate.js +1 -1
  112. package/lib/esm/backoffice/templates/detail_page_template/detailPageTemplate.css.js +4 -4
  113. package/lib/esm/backoffice/templates/list_page_template/listPageTemplate.css.js +1 -1
  114. package/lib/esm/components/agent/AgentMarkdownCard.css.js +1 -1
  115. package/lib/esm/components/charts/metricHistoryChart.css.js +1 -1
  116. package/lib/esm/components/charts/timeSeriesLineChart.css.js +1 -1
  117. package/lib/esm/components/dashboard/activity_card/ActivityCard.css.js +1 -1
  118. package/lib/esm/components/dashboard/activity_card/ActivityCard.js +2 -2
  119. package/lib/esm/components/dashboard/dashboard_grid/DashboardGrid.css.js +1 -1
  120. package/lib/esm/components/dashboard/dashboard_metric_group/DashboardMetricGroup.css.js +1 -1
  121. package/lib/esm/components/dashboard/dashboard_operational/DashboardEntitySpotlight.css.js +1 -1
  122. package/lib/esm/components/dashboard/dashboard_operational/DashboardEntitySpotlight.js +2 -2
  123. package/lib/esm/components/dashboard/dashboard_operational/DashboardHealthMatrix.css.js +1 -1
  124. package/lib/esm/components/dashboard/dashboard_operational/DashboardItemList.css.js +1 -1
  125. package/lib/esm/components/dashboard/dashboard_operational/DashboardItemList.js +1 -1
  126. package/lib/esm/components/dashboard/dashboard_operational/DashboardLinkedSurface.css.js +1 -1
  127. package/lib/esm/components/dashboard/dashboard_operational/DashboardProgressBar.css.js +1 -1
  128. package/lib/esm/components/dashboard/dashboard_operational/DashboardSlaGauge.css.js +1 -1
  129. package/lib/esm/components/dashboard/dashboard_operational/DashboardToneBadge.css.js +1 -1
  130. package/lib/esm/components/dashboard/dashboard_operational/DashboardTrendMetric.css.js +1 -1
  131. package/lib/esm/components/dashboard/dashboard_operational/DashboardTrendMetric.js +1 -1
  132. package/lib/esm/components/dashboard/dashboard_operational/DashboardWindowControl.css.js +1 -1
  133. package/lib/esm/components/dashboard/dashboard_panel/DashboardPanel.css.js +1 -1
  134. package/lib/esm/components/dashboard/dashboard_quick_actions/DashboardQuickActions.css.js +1 -1
  135. package/lib/esm/components/dashboard/dashboard_status_list/DashboardStatusList.css.js +1 -1
  136. package/lib/esm/components/dashboard/metadata_strip/MetadataStrip.css.js +1 -1
  137. package/lib/esm/components/dashboard/metric_card/MetricCard.css.js +2 -2
  138. package/lib/esm/components/dashboard/metric_card/MetricCard.js +2 -2
  139. package/lib/esm/components/dashboard/metric_tile_group/MetricTileGroup.css.js +1 -1
  140. package/lib/esm/components/dashboard/page_hero/PageHero.css.js +1 -1
  141. package/lib/esm/components/dashboard/page_hero/PageHero.js +2 -2
  142. package/lib/esm/components/dashboard/selectable_card/SelectableCard.css.js +1 -1
  143. package/lib/esm/components/dashboard/selectable_card/SelectableCard.js +1 -1
  144. package/lib/esm/components/dashboard/status_summary_panel/StatusSummaryPanel.css.js +1 -1
  145. package/lib/esm/components/dashboard/status_summary_panel/StatusSummaryPanel.js +1 -1
  146. package/lib/esm/components/dashboard/timeline_event_row/TimelineEventRow.css.js +2 -2
  147. package/lib/esm/components/dashboard/timeline_event_row/TimelineEventRow.js +7 -7
  148. package/lib/esm/components/data-table/DataTable.css.js +23 -23
  149. package/lib/esm/components/data-table/DataTable.js +1 -1
  150. package/lib/esm/components/data-table/ResponsiveRecordList.css.js +5 -5
  151. package/lib/esm/components/data-table/TableCell.css.js +2 -2
  152. package/lib/esm/components/data-table/VirtualizedConnectionTable.css.js +1 -1
  153. package/lib/esm/components/feedback/OperationFeedback.css.js +1 -1
  154. package/lib/esm/components/feedback/inlineBanner.css.js +6 -6
  155. package/lib/esm/components/infinite/InfiniteScrollTrigger.js +1 -1
  156. package/lib/esm/components/infinite/infiniteScrollTrigger.css.js +1 -1
  157. package/lib/esm/components/layout/ActionPanel.css.js +1 -1
  158. package/lib/esm/components/layout/ActionPanel.js +1 -1
  159. package/lib/esm/components/layout/AppHeader.css.js +1 -1
  160. package/lib/esm/components/layout/AppHeader.js +2 -2
  161. package/lib/esm/components/layout/ContentLayout.css.js +1 -1
  162. package/lib/esm/components/layout/DetailSummaryHeader.css.js +1 -1
  163. package/lib/esm/components/layout/DetailSummaryHeader.js +2 -2
  164. package/lib/esm/components/layout/PageShell.css.js +1 -1
  165. package/lib/esm/components/layout/PageShell.js +4 -4
  166. package/lib/esm/components/layout/ResizableSplitView.css.js +1 -1
  167. package/lib/esm/components/layout/ResizableSplitView.js +1 -1
  168. package/lib/esm/components/layout/SettingsLayout.css.js +1 -1
  169. package/lib/esm/components/layout/Surface.css.js +9 -9
  170. package/lib/esm/components/layout/Surface.js +2 -2
  171. package/lib/esm/components/layout/toolbar/Toolbar.css.js +3 -3
  172. package/lib/esm/components/layout/top_navigation_shell/TopNavigationShell.css.js +3 -3
  173. package/lib/esm/components/media/imagePreviewModal.css.js +5 -5
  174. package/lib/esm/components/navigation/sidebar/SidebarNavigation.js +1 -1
  175. package/lib/esm/components/navigation/sidebar/sidebarNavigation.css.js +1 -1
  176. package/lib/esm/components/responsive/ResponsiveCollectionRenderer.css.js +1 -1
  177. package/lib/esm/components/routing/routeFallback.css.js +1 -1
  178. package/lib/esm/components/routing/routePendingBar.css.js +1 -1
  179. package/lib/esm/components/select/SimpleSelect.css.js +13 -13
  180. package/lib/esm/components/select/SimpleSelect.css.js.map +1 -1
  181. package/lib/esm/components/select/SimpleSelect.js +141 -96
  182. package/lib/esm/components/select/SimpleSelect.js.map +1 -1
  183. package/lib/esm/components/tile/InfoTile.css.js +1 -1
  184. package/lib/esm/components/tile/InfoTile.js +1 -1
  185. package/lib/esm/index.js +245 -244
  186. package/lib/esm/node_modules/dompurify/dist/purify.es.js +127 -125
  187. package/lib/esm/node_modules/dompurify/dist/purify.es.js.map +1 -1
  188. package/lib/esm/shared/anchoredFloatingPosition.js +27 -0
  189. package/lib/esm/shared/anchoredFloatingPosition.js.map +1 -0
  190. package/lib/esm/style.css +1 -1
  191. package/lib/esm/theme/accessibility.css.js +1 -1
  192. package/lib/esm/theme/sprinkles.css.js +8252 -8216
  193. package/lib/esm/theme/sprinkles.css.js.map +1 -1
  194. package/lib/esm/theme/styleRecipes.css.js +7 -7
  195. package/lib/types/atomic/molecules/dropdown/Dropdown.d.ts +2 -1
  196. package/lib/types/atomic/molecules/dropdown/Dropdown.d.ts.map +1 -1
  197. package/lib/types/atomic/molecules/form_field_layout/FormFieldLayout.d.ts +20 -0
  198. package/lib/types/atomic/molecules/form_field_layout/FormFieldLayout.d.ts.map +1 -0
  199. package/lib/types/atomic/molecules/form_field_layout/formFieldLayout.css.d.ts +8 -0
  200. package/lib/types/atomic/molecules/form_field_layout/formFieldLayout.css.d.ts.map +1 -0
  201. package/lib/types/atomic/molecules/form_grid/FormGrid.css.d.ts +6 -1
  202. package/lib/types/atomic/molecules/form_grid/FormGrid.css.d.ts.map +1 -1
  203. package/lib/types/atomic/molecules/form_grid/FormGrid.d.ts +2 -1
  204. package/lib/types/atomic/molecules/form_grid/FormGrid.d.ts.map +1 -1
  205. package/lib/types/atomic/molecules/toast/ToastViewport.d.ts +1 -0
  206. package/lib/types/atomic/molecules/toast/ToastViewport.d.ts.map +1 -1
  207. package/lib/types/components/select/SimpleSelect.css.d.ts.map +1 -1
  208. package/lib/types/components/select/SimpleSelect.d.ts.map +1 -1
  209. package/lib/types/index.d.ts +1 -0
  210. package/lib/types/index.d.ts.map +1 -1
  211. package/lib/types/shared/anchoredFloatingPosition.d.ts +23 -0
  212. package/lib/types/shared/anchoredFloatingPosition.d.ts.map +1 -0
  213. package/lib/types/theme/sprinkles.css.d.ts +28 -28
  214. package/package.json +3 -3
@@ -1,10 +1,11 @@
1
1
  import { cx as e } from "../../../theme/tools.js";
2
- import { container as t, content as n, contentPositioned as r } from "./dropdown.css.js";
3
- import { cloneElement as i, createContext as a, isValidElement as o, useCallback as s, useContext as c, useEffect as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
4
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
5
- import { createPortal as h } from "react-dom";
2
+ import { container as t, content as ee, contentPositioned as n } from "./dropdown.css.js";
3
+ import { getAnchoredFloatingPosition as r } from "../../../shared/anchoredFloatingPosition.js";
4
+ import { cloneElement as i, createContext as a, isValidElement as o, useCallback as s, useContext as c, useEffect as l, useLayoutEffect as te, useRef as u, useState as d } from "react";
5
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
6
+ import { createPortal as m } from "react-dom";
6
7
  //#region src/atomic/molecules/dropdown/Dropdown.tsx
7
- var ee = new Set([
8
+ var h = new Set([
8
9
  "menu",
9
10
  "listbox",
10
11
  "tree",
@@ -15,136 +16,115 @@ var ee = new Set([
15
16
  if (e == null) throw Error("useDropdown must be used within a <Dropdown />");
16
17
  return e;
17
18
  }, v = (e) => typeof e != "object" || !e ? !1 : e.$$typeof === Symbol.for("react.forward_ref"), y = ({ trigger: a, children: c, className: _, contentClassName: y, placement: b = "bottom-start", offset: x = 4, matchTriggerWidth: S = !0, open: C, defaultOpen: w = !1, onOpenChange: T, closeOnItemClick: E = !1, portalContainer: D, contentRole: O = "menu", contentAriaLabel: k, ariaLabel: A }) => {
18
- let j = C != null, [M, N] = f(w), P = M;
19
- j && (P = !!C);
20
- let F = d(null), I = d(null), L = d(null), [R, z] = f(null), B = s((e) => {
21
- j || N(e), T?.(e);
22
- }, [j, T]), V = s(() => {
23
- B(!P);
24
- }, [P, B]), H = s(() => {
25
- B(!1);
26
- }, [B]), U = s(() => {
27
- B(!0);
28
- }, [B]), W = s(() => {
29
- let e = I.current, t = L.current;
30
- if (e == null || t == null) return;
31
- let n = e.getBoundingClientRect(), r = 0, i = 0;
32
- switch (b) {
33
- case "bottom-start":
34
- r = n.bottom + x, i = n.left;
35
- break;
36
- case "bottom-end":
37
- r = n.bottom + x, i = n.right - t.offsetWidth;
38
- break;
39
- case "top-start":
40
- r = n.top - t.offsetHeight - x, i = n.left;
41
- break;
42
- case "top-end":
43
- r = n.top - t.offsetHeight - x, i = n.right - t.offsetWidth;
44
- break;
45
- default: r = n.bottom + x, i = n.left;
46
- }
47
- let a = window.innerWidth, o = window.innerHeight, s;
48
- S && (s = n.width);
49
- let c = s ?? t.offsetWidth;
50
- i + c > a - 4 && (i = Math.max(4, a - c - 4)), i < 4 && (i = 4);
51
- let l = t.offsetHeight;
52
- if (r + l > o - 4) if (b.startsWith("bottom")) {
53
- let e = n.top - l - x;
54
- r = e >= 4 ? e : Math.max(4, o - l - 4);
55
- } else r = Math.max(4, o - l - 4);
56
- r < 4 && (r = 4), z({
57
- top: r,
58
- left: i,
59
- width: s
60
- });
19
+ let j = C != null, [ne, re] = d(w), M = ne;
20
+ j && (M = !!C);
21
+ let N = u(null), P = u(null), F = u(null), [I, L] = d(null), R = s((e) => {
22
+ j || re(e), T?.(e);
23
+ }, [j, T]), z = s(() => {
24
+ R(!M);
25
+ }, [M, R]), B = s(() => {
26
+ R(!1);
27
+ }, [R]), V = s(() => {
28
+ R(!0);
29
+ }, [R]), H = s(() => {
30
+ let e = P.current, t = F.current;
31
+ e != null && t != null && L(r({
32
+ anchorRect: e.getBoundingClientRect(),
33
+ floatingWidth: t.offsetWidth,
34
+ floatingHeight: t.offsetHeight,
35
+ placement: b,
36
+ offset: x,
37
+ matchAnchorWidth: S,
38
+ viewportWidth: window.innerWidth,
39
+ viewportHeight: window.innerHeight
40
+ }));
61
41
  }, [
62
42
  b,
63
43
  x,
64
44
  S
65
45
  ]);
66
- u(() => {
67
- P && W();
46
+ te(() => {
47
+ M && H();
68
48
  }, [
69
- P,
70
- W,
49
+ M,
50
+ H,
71
51
  c
72
52
  ]), l(() => {
73
- if (!P) return;
53
+ if (!M) return;
74
54
  let e = () => {
75
- W();
55
+ H();
76
56
  };
77
57
  return window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
78
58
  window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
79
59
  };
80
- }, [P, W]), l(() => {
81
- if (!P) return;
60
+ }, [M, H]), l(() => {
61
+ if (!M) return;
82
62
  let e = (e) => {
83
63
  let t = e.target;
84
- F.current != null && L.current != null && !F.current.contains(t) && !L.current.contains(t) && H();
64
+ N.current != null && F.current != null && !N.current.contains(t) && !F.current.contains(t) && B();
85
65
  }, t = (e) => {
86
- e.key === "Escape" && (H(), I.current?.focus());
66
+ e.key === "Escape" && (B(), P.current?.focus());
87
67
  };
88
68
  return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
89
69
  document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
90
70
  };
91
- }, [P, H]), l(() => {
92
- P && (L.current?.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])"))?.focus();
93
- }, [P]), l(() => {
94
- if (!P || !E) return;
71
+ }, [M, B]), l(() => {
72
+ M && (F.current?.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])"))?.focus();
73
+ }, [M]), l(() => {
74
+ if (!M || !E) return;
95
75
  let e = (e) => {
96
- L.current?.contains(e.target) && H();
76
+ F.current?.contains(e.target) && B();
97
77
  };
98
78
  return document.addEventListener("click", e, { capture: !0 }), () => {
99
79
  document.removeEventListener("click", e, !0);
100
80
  };
101
81
  }, [
102
- P,
82
+ M,
103
83
  E,
104
- H
84
+ B
105
85
  ]);
106
- let G = a;
107
- if (typeof a == "function" && (G = a(P)), !o(G)) throw Error("Dropdown trigger must be a React element.");
108
- let K = typeof G.type == "string", q = K && G.type === "button";
109
- if (!(K || typeof G.type == "function" || v(G.type))) throw Error("Dropdown trigger must be a DOM element or component that accepts a ref.");
110
- let J = G.props.ref ?? G.ref, te = (e) => {
111
- I.current = e, typeof J == "function" ? J(e) : J != null && (J.current = e);
112
- }, Y = G.props, ne = (e) => {
113
- Y.onClick?.(e), !e.defaultPrevented && V();
114
- }, re = (e) => {
115
- Y.onKeyDown?.(e), !e.defaultPrevented && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), V());
86
+ let U = a;
87
+ if (typeof a == "function" && (U = a(M)), !o(U)) throw Error("Dropdown trigger must be a React element.");
88
+ let W = typeof U.type == "string", G = W && U.type === "button";
89
+ if (!(W || typeof U.type == "function" || v(U.type))) throw Error("Dropdown trigger must be a DOM element or component that accepts a ref.");
90
+ let K = U.props.ref ?? U.ref, q = (e) => {
91
+ P.current = e, typeof K == "function" ? K(e) : K != null && (K.current = e);
92
+ }, J = U.props, Y = (e) => {
93
+ J.onClick?.(e), !e.defaultPrevented && z();
94
+ }, ie = (e) => {
95
+ J.onKeyDown?.(e), !e.defaultPrevented && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), z());
116
96
  }, X = !0;
117
- ee.has(O) && (X = O);
97
+ h.has(O) && (X = O);
118
98
  let Z = {
119
- onClick: ne,
99
+ onClick: Y,
120
100
  "aria-haspopup": X,
121
- "aria-expanded": P
101
+ "aria-expanded": M
122
102
  };
123
- A != null && A !== "" && (Z["aria-label"] = A), q ? Y.type ?? (Z.type = "button") : (Z.onKeyDown = re, Y.role ?? (Z.role = "button"), Y.tabIndex ?? (Z.tabIndex = 0)), Z.ref = te;
103
+ A != null && A !== "" && (Z["aria-label"] = A), G ? J.type ?? (Z.type = "button") : (Z.onKeyDown = ie, J.role ?? (Z.role = "button"), J.tabIndex ?? (Z.tabIndex = 0)), Z.ref = q;
124
104
  let Q = {};
125
- R != null && (Q = {
126
- top: R.top,
127
- left: R.left,
128
- width: R.width
105
+ I != null && (Q = {
106
+ top: I.top,
107
+ left: I.left,
108
+ width: I.width
129
109
  });
130
- let ie = D ?? document.body, ae = {
131
- close: H,
132
- open: U,
133
- isOpen: P
110
+ let ae = D ?? document.body, oe = {
111
+ close: B,
112
+ open: V,
113
+ isOpen: M
134
114
  }, $ = null;
135
- return P && ($ = h(/* @__PURE__ */ p("div", {
136
- ref: L,
115
+ return M && ($ = m(/* @__PURE__ */ f("div", {
116
+ ref: F,
137
117
  role: O,
138
118
  "aria-label": k,
139
- className: e(n, r, y),
119
+ className: e(ee, n, y),
140
120
  style: Q,
141
121
  children: c
142
- }), ie)), /* @__PURE__ */ m(g.Provider, {
143
- value: ae,
144
- children: [/* @__PURE__ */ p("div", {
122
+ }), ae)), /* @__PURE__ */ p(g.Provider, {
123
+ value: oe,
124
+ children: [/* @__PURE__ */ f("div", {
145
125
  className: e(t, _),
146
- ref: F,
147
- children: i(G, Z)
126
+ ref: N,
127
+ children: i(U, Z)
148
128
  }), $]
149
129
  });
150
130
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.js","names":[],"sources":["../../../../../src/atomic/molecules/dropdown/Dropdown.tsx"],"sourcesContent":["import {\n useState,\n useRef,\n useEffect,\n useLayoutEffect,\n useCallback,\n type ReactNode,\n type ReactElement,\n type JSX,\n type Ref,\n type AriaRole,\n type HTMLAttributes,\n type MouseEvent as ReactMouseEvent,\n type KeyboardEvent as ReactKeyboardEvent,\n createContext,\n useContext,\n isValidElement,\n cloneElement,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport * as classes from './dropdown.css.js';\nimport { cx } from '../../../theme/tools.js';\n\n// Types\nexport type DropdownPlacement =\n | 'bottom-start'\n | 'bottom-end'\n | 'top-start'\n | 'top-end';\n\ntype TriggerAriaHaspopup =\n | true\n | 'menu'\n | 'listbox'\n | 'tree'\n | 'grid'\n | 'dialog';\n\nconst triggerAriaHaspopupRoles: ReadonlySet<string> = new Set([\n 'menu',\n 'listbox',\n 'tree',\n 'grid',\n 'dialog',\n]);\n\ninterface DropdownContextValue {\n close: () => void;\n open: () => void;\n isOpen: boolean;\n}\n\nconst DropdownContext = createContext<DropdownContextValue | null>(null);\n/**\n * Access the nearest Dropdown context. Throws if used outside a <Dropdown />.\n */\nexport const useDropdown = (): DropdownContextValue => {\n const ctx = useContext(DropdownContext);\n if (ctx == null) {\n throw new Error('useDropdown must be used within a <Dropdown />');\n }\n return ctx;\n};\n\nexport interface DropdownProps {\n trigger: ReactElement | ((isOpen: boolean) => ReactElement);\n children: ReactNode;\n className?: string;\n contentClassName?: string;\n placement?: DropdownPlacement;\n offset?: number;\n matchTriggerWidth?: boolean;\n open?: boolean; // controlled\n defaultOpen?: boolean; // uncontrolled\n onOpenChange?: (open: boolean) => void;\n closeOnItemClick?: boolean;\n portalContainer?: HTMLElement | null;\n contentRole?: AriaRole;\n contentAriaLabel?: string;\n // Accessible label if trigger is an icon only\n ariaLabel?: string;\n}\n\ninterface PositionState {\n top: number;\n left: number;\n width?: number;\n}\n\nconst isForwardRefComponent = (type: unknown): boolean => {\n if (type == null || typeof type !== 'object') {\n return false;\n }\n return (\n (type as { $$typeof?: symbol }).$$typeof === Symbol.for('react.forward_ref')\n );\n};\n\n/**\n * A scalable, portal-based dropdown component with basic collision handling,\n * controlled/uncontrolled modes, accessibility attributes, and optional\n * trigger width matching. Content is rendered in a React portal (default: document.body).\n */\nexport const Dropdown = ({\n trigger,\n children,\n className,\n contentClassName,\n placement = 'bottom-start',\n offset = 4,\n matchTriggerWidth = true,\n open,\n defaultOpen = false,\n onOpenChange,\n closeOnItemClick = false,\n portalContainer,\n contentRole = 'menu',\n contentAriaLabel,\n ariaLabel,\n}: DropdownProps): JSX.Element => {\n const isControlled = open != null;\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n let isOpen = uncontrolledOpen;\n if (isControlled) {\n isOpen = Boolean(open);\n }\n\n const containerRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const [position, setPosition] = useState<PositionState | null>(null);\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(next);\n }\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange],\n );\n\n const toggle = useCallback(() => {\n setOpen(!isOpen);\n }, [isOpen, setOpen]);\n const close = useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n const openFn = useCallback(() => {\n setOpen(true);\n }, [setOpen]);\n\n // Positioning logic\n const computePosition = useCallback(() => {\n const triggerEl = triggerRef.current;\n const contentEl = contentRef.current;\n if (triggerEl == null) {\n return;\n }\n if (contentEl == null) {\n return;\n }\n\n const rect = triggerEl.getBoundingClientRect();\n let top = 0;\n let left = 0;\n\n switch (placement) {\n case 'bottom-start':\n top = rect.bottom + offset;\n left = rect.left;\n break;\n case 'bottom-end':\n top = rect.bottom + offset;\n left = rect.right - contentEl.offsetWidth;\n break;\n case 'top-start':\n top = rect.top - contentEl.offsetHeight - offset;\n left = rect.left;\n break;\n case 'top-end':\n top = rect.top - contentEl.offsetHeight - offset;\n left = rect.right - contentEl.offsetWidth;\n break;\n default:\n top = rect.bottom + offset;\n left = rect.left;\n }\n\n // Keep within viewport (basic collision handling)\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n let width: number | undefined;\n if (matchTriggerWidth) {\n width = rect.width;\n }\n const contentWidth = width ?? contentEl.offsetWidth;\n\n if (left + contentWidth > vw - 4) {\n left = Math.max(4, vw - contentWidth - 4);\n }\n if (left < 4) left = 4;\n const contentHeight = contentEl.offsetHeight;\n if (top + contentHeight > vh - 4) {\n // Try flip to top if bottom overflows and initial was bottom\n if (placement.startsWith('bottom')) {\n const flippedTop = rect.top - contentHeight - offset;\n if (flippedTop >= 4) {\n top = flippedTop;\n } else {\n top = Math.max(4, vh - contentHeight - 4);\n }\n } else {\n top = Math.max(4, vh - contentHeight - 4);\n }\n }\n if (top < 4) top = 4;\n\n setPosition({ top, left, width });\n }, [placement, offset, matchTriggerWidth]);\n\n useLayoutEffect(() => {\n if (isOpen) computePosition();\n }, [isOpen, computePosition, children]);\n\n useEffect(() => {\n if (!isOpen) {\n return undefined;\n }\n const handle = () => {\n computePosition();\n };\n window.addEventListener('resize', handle);\n window.addEventListener('scroll', handle, true);\n\n return () => {\n window.removeEventListener('resize', handle);\n window.removeEventListener('scroll', handle, true);\n };\n }, [isOpen, computePosition]);\n\n // Outside click & Escape\n useEffect(() => {\n if (!isOpen) {\n return undefined;\n }\n const onDocMouseDown = (e: globalThis.MouseEvent) => {\n const target = e.target as Node;\n if (\n containerRef.current != null &&\n contentRef.current != null &&\n !containerRef.current.contains(target) &&\n !contentRef.current.contains(target)\n ) {\n close();\n }\n };\n const onKey = (e: globalThis.KeyboardEvent) => {\n if (e.key === 'Escape') {\n close();\n triggerRef.current?.focus();\n }\n };\n document.addEventListener('mousedown', onDocMouseDown);\n document.addEventListener('keydown', onKey);\n\n return () => {\n document.removeEventListener('mousedown', onDocMouseDown);\n document.removeEventListener('keydown', onKey);\n };\n }, [isOpen, close]);\n\n // Keyboard navigation basic (ArrowDown focuses first focusable)\n useEffect(() => {\n if (!isOpen) return;\n const firstFocusable = contentRef.current?.querySelector<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n firstFocusable?.focus();\n }, [isOpen]);\n\n // Close on item click if enabled\n useEffect(() => {\n if (!isOpen || !closeOnItemClick) {\n return undefined;\n }\n const handler = (e: globalThis.MouseEvent) => {\n if (contentRef.current?.contains(e.target as Node)) {\n close();\n }\n };\n document.addEventListener('click', handler, { capture: true });\n\n return () => {\n document.removeEventListener('click', handler, true);\n };\n }, [isOpen, closeOnItemClick, close]);\n\n let triggerElement = trigger;\n if (typeof trigger === 'function') {\n triggerElement = trigger(isOpen);\n }\n\n if (!isValidElement(triggerElement)) {\n throw new Error('Dropdown trigger must be a React element.');\n }\n\n const isHostElement = typeof triggerElement.type === 'string';\n const isButtonElement = isHostElement && triggerElement.type === 'button';\n const canAttachRef =\n isHostElement ||\n typeof triggerElement.type === 'function' ||\n isForwardRefComponent(triggerElement.type);\n\n if (!canAttachRef) {\n throw new Error(\n 'Dropdown trigger must be a DOM element or component that accepts a ref.',\n );\n }\n\n const triggerElementRef =\n (triggerElement.props as { ref?: Ref<HTMLElement> }).ref ??\n (triggerElement as ReactElement & { ref?: Ref<HTMLElement> }).ref;\n const setTriggerRef = (node: HTMLElement | null) => {\n triggerRef.current = node;\n if (typeof triggerElementRef === 'function') {\n triggerElementRef(node);\n } else if (triggerElementRef != null) {\n triggerElementRef.current = node;\n }\n };\n\n const triggerProps = triggerElement.props as HTMLAttributes<HTMLElement> & {\n type?: string;\n };\n\n const handleTriggerClick = (event: ReactMouseEvent<HTMLElement>) => {\n triggerProps.onClick?.(event);\n if (event.defaultPrevented) {\n return;\n }\n toggle();\n };\n\n const handleTriggerKeyDown = (event: ReactKeyboardEvent<HTMLElement>) => {\n triggerProps.onKeyDown?.(event);\n if (event.defaultPrevented) {\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n toggle();\n }\n };\n\n let triggerAriaHaspopup: TriggerAriaHaspopup = true;\n if (triggerAriaHaspopupRoles.has(contentRole)) {\n triggerAriaHaspopup = contentRole as TriggerAriaHaspopup;\n }\n\n const mergedTriggerProps: Record<string, unknown> = {\n onClick: handleTriggerClick,\n 'aria-haspopup': triggerAriaHaspopup,\n 'aria-expanded': isOpen,\n };\n\n if (ariaLabel != null && ariaLabel !== '') {\n mergedTriggerProps['aria-label'] = ariaLabel;\n }\n\n if (isButtonElement) {\n if (triggerProps.type == null) {\n mergedTriggerProps.type = 'button';\n }\n } else {\n mergedTriggerProps.onKeyDown = handleTriggerKeyDown;\n if (triggerProps.role == null) {\n mergedTriggerProps.role = 'button';\n }\n if (triggerProps.tabIndex == null) {\n mergedTriggerProps.tabIndex = 0;\n }\n }\n\n mergedTriggerProps.ref = setTriggerRef;\n\n let contentStyles: React.CSSProperties = {};\n if (position != null) {\n contentStyles = {\n top: position.top,\n left: position.left,\n width: position.width,\n };\n }\n\n const portalTarget = portalContainer ?? document.body;\n\n const contextValue: DropdownContextValue = {\n close,\n open: openFn,\n isOpen,\n };\n\n let dropdownContent: JSX.Element | null = null;\n if (isOpen) {\n dropdownContent = createPortal(\n <div\n ref={contentRef}\n role={contentRole}\n aria-label={contentAriaLabel}\n className={cx(\n classes.content,\n classes.contentPositioned,\n contentClassName,\n )}\n style={contentStyles}\n >\n {children}\n </div>,\n portalTarget,\n );\n }\n\n return (\n <DropdownContext.Provider value={contextValue}>\n <div className={cx(classes.container, className)} ref={containerRef}>\n {cloneElement(triggerElement, mergedTriggerProps)}\n </div>\n {dropdownContent}\n </DropdownContext.Provider>\n );\n};\n"],"mappings":";;;;;;AAuCA,IAAM,KAAgD,IAAI,IAAI;CAC5D;CACA;CACA;CACA;CACA;AACF,CAAC,GAQK,IAAkB,EAA2C,IAAI,GAI1D,UAA0C;CACrD,IAAM,IAAM,EAAW,CAAe;CACtC,IAAI,KAAO,MACT,MAAU,MAAM,gDAAgD;CAElE,OAAO;AACT,GA2BM,KAAyB,MACT,OAAO,KAAS,aAA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M,MAAwB,MAA2C;EACvE,EAAa,YAAY,CAAK,GAC1B,GAAM,qBAGN,EAAM,QAAQ,WAAW,EAAM,QAAQ,SACzC,EAAM,eAAe,GACrB,EAAO;CAEX,GAEI,IAA2C;CAC/C,AAAI,GAAyB,IAAI,CAAW,MAC1C,IAAsB;CAGxB,IAAM,IAA8C;EAClD,SAAS;EACT,iBAAiB;EACjB,iBAAiB;CACnB;CAoBA,AAlBI,KAAa,QAAQ,MAAc,OACrC,EAAmB,gBAAgB,IAGjC,IACE,EAAa,SACf,EAAmB,OAAO,aAG5B,EAAmB,YAAY,IAC3B,EAAa,SACf,EAAmB,OAAO,WAExB,EAAa,aACf,EAAmB,WAAW,KAIlC,EAAmB,MAAM;CAEzB,IAAI,IAAqC,CAAC;CAC1C,AAAI,KAAY,SACd,IAAgB;EACd,KAAK,EAAS;EACd,MAAM,EAAS;EACf,OAAO,EAAS;CAClB;CAGF,IAAM,KAAe,KAAmB,SAAS,MAE3C,KAAqC;EACzC;EACA,MAAM;EACN;CACF,GAEI,IAAsC;CAoB1C,OAnBI,MACF,IAAkB,EAChB,kBAAC,OAAD;EACE,KAAK;EACL,MAAM;EACN,cAAY;EACZ,WAAW,EACT,GACA,GACA,CACF;EACA,OAAO;EAEN;CACE,CAAA,GACL,EACF,IAIA,kBAAC,EAAgB,UAAjB;EAA0B,OAAO;YAAjC,CACE,kBAAC,OAAD;GAAK,WAAW,EAAG,GAAmB,CAAS;GAAG,KAAK;aACpD,EAAa,GAAgB,CAAkB;EAC7C,CAAA,GACJ,CACuB;;AAE9B"}
1
+ {"version":3,"file":"Dropdown.js","names":[],"sources":["../../../../../src/atomic/molecules/dropdown/Dropdown.tsx"],"sourcesContent":["import {\n useState,\n useRef,\n useEffect,\n useLayoutEffect,\n useCallback,\n type ReactNode,\n type ReactElement,\n type JSX,\n type Ref,\n type AriaRole,\n type HTMLAttributes,\n type MouseEvent as ReactMouseEvent,\n type KeyboardEvent as ReactKeyboardEvent,\n createContext,\n useContext,\n isValidElement,\n cloneElement,\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport * as classes from './dropdown.css.js';\nimport { cx } from '../../../theme/tools.js';\nimport {\n getAnchoredFloatingPosition,\n type AnchoredFloatingPlacement,\n} from '../../../shared/anchoredFloatingPosition.js';\n\n// Types\nexport type DropdownPlacement = AnchoredFloatingPlacement;\n\ntype TriggerAriaHaspopup =\n | true\n | 'menu'\n | 'listbox'\n | 'tree'\n | 'grid'\n | 'dialog';\n\nconst triggerAriaHaspopupRoles: ReadonlySet<string> = new Set([\n 'menu',\n 'listbox',\n 'tree',\n 'grid',\n 'dialog',\n]);\n\ninterface DropdownContextValue {\n close: () => void;\n open: () => void;\n isOpen: boolean;\n}\n\nconst DropdownContext = createContext<DropdownContextValue | null>(null);\n/**\n * Access the nearest Dropdown context. Throws if used outside a <Dropdown />.\n */\nexport const useDropdown = (): DropdownContextValue => {\n const ctx = useContext(DropdownContext);\n if (ctx == null) {\n throw new Error('useDropdown must be used within a <Dropdown />');\n }\n return ctx;\n};\n\nexport interface DropdownProps {\n trigger: ReactElement | ((isOpen: boolean) => ReactElement);\n children: ReactNode;\n className?: string;\n contentClassName?: string;\n placement?: DropdownPlacement;\n offset?: number;\n matchTriggerWidth?: boolean;\n open?: boolean; // controlled\n defaultOpen?: boolean; // uncontrolled\n onOpenChange?: (open: boolean) => void;\n closeOnItemClick?: boolean;\n portalContainer?: HTMLElement | null;\n contentRole?: AriaRole;\n contentAriaLabel?: string;\n // Accessible label if trigger is an icon only\n ariaLabel?: string;\n}\n\nconst isForwardRefComponent = (type: unknown): boolean => {\n if (type == null || typeof type !== 'object') {\n return false;\n }\n return (\n (type as { $$typeof?: symbol }).$$typeof === Symbol.for('react.forward_ref')\n );\n};\n\n/**\n * A scalable, portal-based dropdown component with basic collision handling,\n * controlled/uncontrolled modes, accessibility attributes, and optional\n * trigger width matching. Content is rendered in a React portal (default: document.body).\n */\nexport const Dropdown = ({\n trigger,\n children,\n className,\n contentClassName,\n placement = 'bottom-start',\n offset = 4,\n matchTriggerWidth = true,\n open,\n defaultOpen = false,\n onOpenChange,\n closeOnItemClick = false,\n portalContainer,\n contentRole = 'menu',\n contentAriaLabel,\n ariaLabel,\n}: DropdownProps): JSX.Element => {\n const isControlled = open != null;\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n let isOpen = uncontrolledOpen;\n if (isControlled) {\n isOpen = Boolean(open);\n }\n\n const containerRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const [position, setPosition] = useState<React.CSSProperties | null>(null);\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(next);\n }\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange],\n );\n\n const toggle = useCallback(() => {\n setOpen(!isOpen);\n }, [isOpen, setOpen]);\n const close = useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n const openFn = useCallback(() => {\n setOpen(true);\n }, [setOpen]);\n\n // Positioning logic\n const computePosition = useCallback(() => {\n const triggerEl = triggerRef.current;\n const contentEl = contentRef.current;\n if (triggerEl == null) {\n return;\n }\n if (contentEl == null) {\n return;\n }\n\n setPosition(\n getAnchoredFloatingPosition({\n anchorRect: triggerEl.getBoundingClientRect(),\n floatingWidth: contentEl.offsetWidth,\n floatingHeight: contentEl.offsetHeight,\n placement,\n offset,\n matchAnchorWidth: matchTriggerWidth,\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n }),\n );\n }, [placement, offset, matchTriggerWidth]);\n\n useLayoutEffect(() => {\n if (isOpen) computePosition();\n }, [isOpen, computePosition, children]);\n\n useEffect(() => {\n if (!isOpen) {\n return undefined;\n }\n const handle = () => {\n computePosition();\n };\n window.addEventListener('resize', handle);\n window.addEventListener('scroll', handle, true);\n\n return () => {\n window.removeEventListener('resize', handle);\n window.removeEventListener('scroll', handle, true);\n };\n }, [isOpen, computePosition]);\n\n // Outside click & Escape\n useEffect(() => {\n if (!isOpen) {\n return undefined;\n }\n const onDocMouseDown = (e: globalThis.MouseEvent) => {\n const target = e.target as Node;\n if (\n containerRef.current != null &&\n contentRef.current != null &&\n !containerRef.current.contains(target) &&\n !contentRef.current.contains(target)\n ) {\n close();\n }\n };\n const onKey = (e: globalThis.KeyboardEvent) => {\n if (e.key === 'Escape') {\n close();\n triggerRef.current?.focus();\n }\n };\n document.addEventListener('mousedown', onDocMouseDown);\n document.addEventListener('keydown', onKey);\n\n return () => {\n document.removeEventListener('mousedown', onDocMouseDown);\n document.removeEventListener('keydown', onKey);\n };\n }, [isOpen, close]);\n\n // Keyboard navigation basic (ArrowDown focuses first focusable)\n useEffect(() => {\n if (!isOpen) return;\n const firstFocusable = contentRef.current?.querySelector<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n firstFocusable?.focus();\n }, [isOpen]);\n\n // Close on item click if enabled\n useEffect(() => {\n if (!isOpen || !closeOnItemClick) {\n return undefined;\n }\n const handler = (e: globalThis.MouseEvent) => {\n if (contentRef.current?.contains(e.target as Node)) {\n close();\n }\n };\n document.addEventListener('click', handler, { capture: true });\n\n return () => {\n document.removeEventListener('click', handler, true);\n };\n }, [isOpen, closeOnItemClick, close]);\n\n let triggerElement = trigger;\n if (typeof trigger === 'function') {\n triggerElement = trigger(isOpen);\n }\n\n if (!isValidElement(triggerElement)) {\n throw new Error('Dropdown trigger must be a React element.');\n }\n\n const isHostElement = typeof triggerElement.type === 'string';\n const isButtonElement = isHostElement && triggerElement.type === 'button';\n const canAttachRef =\n isHostElement ||\n typeof triggerElement.type === 'function' ||\n isForwardRefComponent(triggerElement.type);\n\n if (!canAttachRef) {\n throw new Error(\n 'Dropdown trigger must be a DOM element or component that accepts a ref.',\n );\n }\n\n const triggerElementRef =\n (triggerElement.props as { ref?: Ref<HTMLElement> }).ref ??\n (triggerElement as ReactElement & { ref?: Ref<HTMLElement> }).ref;\n const setTriggerRef = (node: HTMLElement | null) => {\n triggerRef.current = node;\n if (typeof triggerElementRef === 'function') {\n triggerElementRef(node);\n } else if (triggerElementRef != null) {\n triggerElementRef.current = node;\n }\n };\n\n const triggerProps = triggerElement.props as HTMLAttributes<HTMLElement> & {\n type?: string;\n };\n\n const handleTriggerClick = (event: ReactMouseEvent<HTMLElement>) => {\n triggerProps.onClick?.(event);\n if (event.defaultPrevented) {\n return;\n }\n toggle();\n };\n\n const handleTriggerKeyDown = (event: ReactKeyboardEvent<HTMLElement>) => {\n triggerProps.onKeyDown?.(event);\n if (event.defaultPrevented) {\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n toggle();\n }\n };\n\n let triggerAriaHaspopup: TriggerAriaHaspopup = true;\n if (triggerAriaHaspopupRoles.has(contentRole)) {\n triggerAriaHaspopup = contentRole as TriggerAriaHaspopup;\n }\n\n const mergedTriggerProps: Record<string, unknown> = {\n onClick: handleTriggerClick,\n 'aria-haspopup': triggerAriaHaspopup,\n 'aria-expanded': isOpen,\n };\n\n if (ariaLabel != null && ariaLabel !== '') {\n mergedTriggerProps['aria-label'] = ariaLabel;\n }\n\n if (isButtonElement) {\n if (triggerProps.type == null) {\n mergedTriggerProps.type = 'button';\n }\n } else {\n mergedTriggerProps.onKeyDown = handleTriggerKeyDown;\n if (triggerProps.role == null) {\n mergedTriggerProps.role = 'button';\n }\n if (triggerProps.tabIndex == null) {\n mergedTriggerProps.tabIndex = 0;\n }\n }\n\n mergedTriggerProps.ref = setTriggerRef;\n\n let contentStyles: React.CSSProperties = {};\n if (position != null) {\n contentStyles = {\n top: position.top,\n left: position.left,\n width: position.width,\n };\n }\n\n const portalTarget = portalContainer ?? document.body;\n\n const contextValue: DropdownContextValue = {\n close,\n open: openFn,\n isOpen,\n };\n\n let dropdownContent: JSX.Element | null = null;\n if (isOpen) {\n dropdownContent = createPortal(\n <div\n ref={contentRef}\n role={contentRole}\n aria-label={contentAriaLabel}\n className={cx(\n classes.content,\n classes.contentPositioned,\n contentClassName,\n )}\n style={contentStyles}\n >\n {children}\n </div>,\n portalTarget,\n );\n }\n\n return (\n <DropdownContext.Provider value={contextValue}>\n <div className={cx(classes.container, className)} ref={containerRef}>\n {cloneElement(triggerElement, mergedTriggerProps)}\n </div>\n {dropdownContent}\n </DropdownContext.Provider>\n );\n};\n"],"mappings":";;;;;;;AAuCA,IAAM,IAAgD,IAAI,IAAI;CAC5D;CACA;CACA;CACA;CACA;AACF,CAAC,GAQK,IAAkB,EAA2C,IAAI,GAI1D,UAA0C;CACrD,IAAM,IAAM,EAAW,CAAe;CACtC,IAAI,KAAO,MACT,MAAU,MAAM,gDAAgD;CAElE,OAAO;AACT,GAqBM,KAAyB,MACT,OAAO,KAAS,aAAhC,IACK,KAGN,EAA+B,aAAa,OAAO,IAAI,mBAAmB,GASlE,KAAY,EACvB,YACA,aACA,cACA,qBACA,eAAY,gBACZ,YAAS,GACT,uBAAoB,IACpB,SACA,iBAAc,IACd,iBACA,sBAAmB,IACnB,oBACA,iBAAc,QACd,qBACA,mBACgC;CAChC,IAAM,IAAe,KAAQ,MACvB,CAAC,IAAkB,MAAuB,EAAS,CAAW,GAChE,IAAS;CACb,AAAI,MACF,IAAS,EAAQ;CAGnB,IAAM,IAAe,EAAuB,IAAI,GAC1C,IAAa,EAAoB,IAAI,GACrC,IAAa,EAAuB,IAAI,GACxC,CAAC,GAAU,KAAe,EAAqC,IAAI,GAEnE,IAAU,GACb,MAAkB;EAIjB,AAHK,KACH,GAAoB,CAAI,GAE1B,IAAe,CAAI;CACrB,GACA,CAAC,GAAc,CAAY,CAC7B,GAEM,IAAS,QAAkB;EAC/B,EAAQ,CAAC,CAAM;CACjB,GAAG,CAAC,GAAQ,CAAO,CAAC,GACd,IAAQ,QAAkB;EAC9B,EAAQ,EAAK;CACf,GAAG,CAAC,CAAO,CAAC,GACN,IAAS,QAAkB;EAC/B,EAAQ,EAAI;CACd,GAAG,CAAC,CAAO,CAAC,GAGN,IAAkB,QAAkB;EACxC,IAAM,I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mB,OAAO,WAExB,EAAa,aACf,EAAmB,WAAW,KAIlC,EAAmB,MAAM;CAEzB,IAAI,IAAqC,CAAC;CAC1C,AAAI,KAAY,SACd,IAAgB;EACd,KAAK,EAAS;EACd,MAAM,EAAS;EACf,OAAO,EAAS;CAClB;CAGF,IAAM,KAAe,KAAmB,SAAS,MAE3C,KAAqC;EACzC;EACA,MAAM;EACN;CACF,GAEI,IAAsC;CAoB1C,OAnBI,MACF,IAAkB,EAChB,kBAAC,OAAD;EACE,KAAK;EACL,MAAM;EACN,cAAY;EACZ,WAAW,EACT,IACA,GACA,CACF;EACA,OAAO;EAEN;CACE,CAAA,GACL,EACF,IAIA,kBAAC,EAAgB,UAAjB;EAA0B,OAAO;YAAjC,CACE,kBAAC,OAAD;GAAK,WAAW,EAAG,GAAmB,CAAS;GAAG,KAAK;aACpD,EAAa,GAAgB,CAAkB;EAC7C,CAAA,GACJ,CACuB;;AAE9B"}
@@ -1,7 +1,7 @@
1
1
  /* empty css */
2
2
  /* empty css */
3
3
  //#region src/atomic/molecules/dropdown/dropdown.css.ts
4
- var e = "mr2gir0 txvbqb13i7", t = "mr2gir1 txvbqb1b85 txvbqb28o txvbqb2sj txvbqb1d9 txvbqb2up txvbqb1avm txvbqbwr6", n = "mr2gir2 txvbqb13ik txvbqb18f5 txvbqblvq", r = "mr2gir3 txvbqbfok", i = "mr2gir4 txvbqbwlr", a = "mr2gir5 txvbqbo6s txvbqbo7v txvbqbwvi", o = "mr2gir6 txvbqbv";
4
+ var e = "mr2gir0 txvbqb13ik", t = "mr2gir1 txvbqb1b8v txvbqb28o txvbqb2sj txvbqb1d9 txvbqb2up txvbqb1awc txvbqbwr6", n = "mr2gir2 txvbqb13ix txvbqb18fi txvbqblvq", r = "mr2gir3 txvbqbfok", i = "mr2gir4 txvbqbwlr", a = "mr2gir5 txvbqbo6s txvbqbo7v txvbqbwvv", o = "mr2gir6 txvbqbv";
5
5
  //#endregion
6
6
  export { e as container, t as content, n as contentPositioned, i as focusOutlineReset, r as hidden, a as menu, o as menuItem };
7
7
 
@@ -3,36 +3,36 @@
3
3
  import { createRuntimeFn as e } from "@vanilla-extract/recipes/createRuntimeFn";
4
4
  //#region src/atomic/molecules/empty-state/EmptyState.css.ts
5
5
  var t = e({
6
- defaultClassName: "_1lrdacm7 _1lrdacm0 txvbqb19uf",
6
+ defaultClassName: "_1lrdacm7 _1lrdacm0 txvbqb19us",
7
7
  variantClassNames: {
8
8
  variant: {
9
9
  framed: "_1lrdacm8",
10
- plain: "_1lrdacm9 _1lrdacm1 txvbqbfpn txvbqbh4x txvbqbls4 txvbqb1bg3"
10
+ plain: "_1lrdacm9 _1lrdacm1 txvbqbfpn txvbqbh4x txvbqbls4 txvbqb1bgt"
11
11
  },
12
12
  density: {
13
13
  default: "_1lrdacma _1lrdacm2 txvbqbhdl",
14
- compact: "_1lrdacmb _1lrdacm3 txvbqb10na txvbqb11kv txvbqb12km txvbqbxwp txvbqbhdy"
14
+ compact: "_1lrdacmb _1lrdacm3 txvbqb10nn txvbqb11l8 txvbqb12kz txvbqbxx2 txvbqbhdy"
15
15
  },
16
16
  align: {
17
- center: "_1lrdacmc _1lrdacm4 txvbqbey txvbqb18dp",
18
- start: "_1lrdacmd _1lrdacm5 txvbqbel txvbqb18dc"
17
+ center: "_1lrdacmc _1lrdacm4 txvbqbey txvbqb18e2",
18
+ start: "_1lrdacmd _1lrdacm5 txvbqbel txvbqb18dp"
19
19
  }
20
20
  },
21
21
  defaultVariants: {},
22
22
  compoundVariants: [[{
23
23
  variant: "plain",
24
24
  density: "default"
25
- }, "_1lrdacm6 txvbqb10o0 txvbqb11ll txvbqb12lc txvbqbxxf"]]
25
+ }, "_1lrdacm6 txvbqb10od txvbqb11ly txvbqb12lp txvbqbxxs"]]
26
26
  }), n = e({
27
- defaultClassName: "_1lrdacmj _1lrdacme txvbqb19uf txvbqbfpn txvbqbh4x txvbqbls4",
27
+ defaultClassName: "_1lrdacmj _1lrdacme txvbqb19us txvbqbfpn txvbqbh4x txvbqbls4",
28
28
  variantClassNames: {
29
29
  density: {
30
30
  default: "_1lrdacmk _1lrdacmf txvbqbhdl",
31
31
  compact: "_1lrdacml _1lrdacmg txvbqbhdy"
32
32
  },
33
33
  align: {
34
- center: "_1lrdacmm _1lrdacmh txvbqbey txvbqb18dp",
35
- start: "_1lrdacmn _1lrdacmi txvbqbel txvbqb18dc"
34
+ center: "_1lrdacmm _1lrdacmh txvbqbey txvbqb18e2",
35
+ start: "_1lrdacmn _1lrdacmi txvbqbel txvbqb18dp"
36
36
  }
37
37
  },
38
38
  defaultVariants: {},
@@ -40,17 +40,17 @@ var t = e({
40
40
  }), r = e({
41
41
  defaultClassName: "_1lrdacmv _1lrdacmo txvbqbfpn txvbqbey txvbqbls4 txvbqbam",
42
42
  variantClassNames: { tone: {
43
- neutral: "_1lrdacmw _1lrdacmp txvbqb1bg1",
44
- muted: "_1lrdacmx _1lrdacmq txvbqb1bg3",
45
- info: "_1lrdacmy _1lrdacmr txvbqb1bj1",
46
- success: "_1lrdacmz _1lrdacms txvbqb1bit",
47
- warning: "_1lrdacm10 _1lrdacmt txvbqb1bix",
48
- danger: "_1lrdacm11 _1lrdacmu txvbqb1bij"
43
+ neutral: "_1lrdacmw _1lrdacmp txvbqb1bgr",
44
+ muted: "_1lrdacmx _1lrdacmq txvbqb1bgt",
45
+ info: "_1lrdacmy _1lrdacmr txvbqb1bjr",
46
+ success: "_1lrdacmz _1lrdacms txvbqb1bjj",
47
+ warning: "_1lrdacm10 _1lrdacmt txvbqb1bjn",
48
+ danger: "_1lrdacm11 _1lrdacmu txvbqb1bj9"
49
49
  } },
50
50
  defaultVariants: {},
51
51
  compoundVariants: []
52
52
  }), i = e({
53
- defaultClassName: "_1lrdacm15 _1lrdacm12 txvbqbo7v txvbqbhbf txvbqb1bg1",
53
+ defaultClassName: "_1lrdacm15 _1lrdacm12 txvbqbo7v txvbqbhbf txvbqb1bgr",
54
54
  variantClassNames: { density: {
55
55
  default: "_1lrdacm16 _1lrdacm13 txvbqba9",
56
56
  compact: "_1lrdacm17 _1lrdacm14 txvbqba9"
@@ -58,7 +58,7 @@ var t = e({
58
58
  defaultVariants: {},
59
59
  compoundVariants: []
60
60
  }), a = e({
61
- defaultClassName: "_1lrdacm1b _1lrdacm18 txvbqbo7v txvbqb9j txvbqb1bg3",
61
+ defaultClassName: "_1lrdacm1b _1lrdacm18 txvbqbo7v txvbqb9j txvbqb1bgt",
62
62
  variantClassNames: { density: {
63
63
  default: "_1lrdacm1c _1lrdacm19 txvbqbu5n",
64
64
  compact: "_1lrdacm1d _1lrdacm1a txvbqbu4x"
@@ -2,7 +2,7 @@
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  //#region src/atomic/molecules/form/formStyles.css.ts
5
- var e = "_14h3k5k0 txvbqbfpn txvbqbh4x txvbqbhf1", t = "_14h3k5k1", n = "_14h3k5k2 txvbqbfpn txvbqbh4x txvbqbhd8", r = "_14h3k5k4 _14h3k5k3 txvbqb1b87 txvbqb1cw txvbqb2up txvbqb2sj txvbqb28o txvbqb1bg1 txvbqb9j txvbqbwwy txvbqb7g txvbqb76 txvbqb7t", i = "_14h3k5k5 txvbqb1bij txvbqb96 txvbqbryk", a = "_14h3k5k6 txvbqbfpn txvbqblsh txvbqbhdy txvbqbryx", o = "_14h3k5k8 _14h3k5k7 txvbqb10o0 txvbqb11ll txvbqb12hq txvbqbxtt txvbqb2tz txvbqbv txvbqb9j txvbqbhb2 txvbqb7h txvbqb76 txvbqb7t", s = "_14h3k5ka txvbqbfpn txvbqbey txvbqbhd8", c = "_14h3k5kc _14h3k5kb txvbqbfr3 txvbqb19fm txvbqbjl1 txvbqb1i txvbqb2w5 txvbqb2z1", l = "_14h3k5ke _14h3k5kd txvbqbfpn txvbqbh4x", u = "_14h3k5kg _14h3k5kf txvbqb10lu txvbqb11jf txvbqb12i3 txvbqbxu6";
5
+ var e = "_14h3k5k0 txvbqbfpn txvbqbh4x txvbqbhf1", t = "_14h3k5k1", n = "_14h3k5k2 txvbqbfpn txvbqbh4x txvbqbhd8", r = "_14h3k5k4 _14h3k5k3 txvbqb1b8x txvbqb1cw txvbqb2up txvbqb2sj txvbqb28o txvbqb1bgr txvbqb9j txvbqbwxb txvbqb7g txvbqb76 txvbqb7t", i = "_14h3k5k5 txvbqb1bj9 txvbqb96 txvbqbryk", a = "_14h3k5k6 txvbqbfpn txvbqblsh txvbqbhdy txvbqbryx", o = "_14h3k5k8 _14h3k5k7 txvbqb10od txvbqb11ly txvbqb12i3 txvbqbxu6 txvbqb2tz txvbqbv txvbqb9j txvbqbhb2 txvbqb7h txvbqb76 txvbqb7t", s = "_14h3k5ka txvbqbfpn txvbqbey txvbqbhd8", c = "_14h3k5kc _14h3k5kb txvbqbfr3 txvbqb19fz txvbqbjl1 txvbqb1i txvbqb2w5 txvbqb2z1", l = "_14h3k5ke _14h3k5kd txvbqbfpn txvbqbh4x", u = "_14h3k5kg _14h3k5kf txvbqb10m7 txvbqb11js txvbqb12ig txvbqbxuj";
6
6
  //#endregion
7
7
  export { o as button, u as checkboxItem, l as checkboxSection, t as createProjectTheme, i as errorMessage, e as form, a as formActions, n as formGroup, r as input, c as spinner, s as spinnerContainer };
8
8
 
@@ -1,7 +1,7 @@
1
1
  /* empty css */
2
2
  /* empty css */
3
3
  //#region src/atomic/molecules/form_error/formError.css.ts
4
- var e = "jc43j0 txvbqbey txvbqb2tz txvbqb1bij txvbqbfpn txvbqbhdl txvbqbh7g txvbqb9j txvbqbhb2 txvbqbp7m txvbqbwwy txvbqb1bb1", t = "jc43j1 txvbqbh6d", n = "jc43j2 txvbqbh60 txvbqbv7x";
4
+ var e = "jc43j0 txvbqbey txvbqb2tz txvbqb1bj9 txvbqbfpn txvbqbhdl txvbqbh7g txvbqb9j txvbqbhb2 txvbqbp7m txvbqbwxb txvbqb1bbr", t = "jc43j1 txvbqbh6d", n = "jc43j2 txvbqbh60 txvbqbv7x";
5
5
  //#endregion
6
6
  export { e as formError, t as icon, n as message };
7
7
 
@@ -1,7 +1,7 @@
1
1
  /* empty css */
2
2
  /* empty css */
3
3
  //#region src/atomic/molecules/form_field/formField.css.ts
4
- var e = "_1p1qs5o0 txvbqbp7m txvbqb19uf";
4
+ var e = "_1p1qs5o0 txvbqbp7m txvbqb19us";
5
5
  //#endregion
6
6
  export { e as formField };
7
7
 
@@ -0,0 +1,55 @@
1
+ import { cx as e } from "../../../theme/tools.js";
2
+ import { Label as t } from "../../atoms/label/Label.js";
3
+ import { control as n, description as r, error as i, fieldset as a, legend as o, root as s } from "./formFieldLayout.css.js";
4
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
5
+ //#region src/atomic/molecules/form_field_layout/FormFieldLayout.tsx
6
+ var d = ({ as: d = "div", children: f, className: p, controlClassName: m, description: h, descriptionId: g, error: _, errorId: v, label: y, labelFor: b, labelId: x, required: S = !1, ...C }) => {
7
+ let w = null;
8
+ y != null && (w = d === "fieldset" ? /* @__PURE__ */ u("legend", {
9
+ id: x,
10
+ className: o,
11
+ children: [y, S && /* @__PURE__ */ l("span", {
12
+ className: "_95x9ml3 txvbqb1bj9 txvbqbqyg",
13
+ children: "*"
14
+ })]
15
+ }) : /* @__PURE__ */ l(t, {
16
+ htmlFor: b,
17
+ id: x,
18
+ required: S,
19
+ children: y
20
+ }));
21
+ let T = null;
22
+ h != null && (T = /* @__PURE__ */ l("div", {
23
+ id: g,
24
+ className: r,
25
+ children: h
26
+ }));
27
+ let E = null;
28
+ _ != null && (E = /* @__PURE__ */ l("div", {
29
+ id: v,
30
+ className: i,
31
+ children: _
32
+ }));
33
+ let D = /* @__PURE__ */ u(c, { children: [
34
+ w,
35
+ T,
36
+ /* @__PURE__ */ l("div", {
37
+ className: e(n, m),
38
+ children: f
39
+ }),
40
+ E
41
+ ] });
42
+ return d === "fieldset" ? /* @__PURE__ */ l("fieldset", {
43
+ ...C,
44
+ className: e(a, s, p),
45
+ children: D
46
+ }) : /* @__PURE__ */ l("div", {
47
+ ...C,
48
+ className: e(s, p),
49
+ children: D
50
+ });
51
+ };
52
+ //#endregion
53
+ export { d as FormFieldLayout, d as default };
54
+
55
+ //# sourceMappingURL=FormFieldLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormFieldLayout.js","names":[],"sources":["../../../../../src/atomic/molecules/form_field_layout/FormFieldLayout.tsx"],"sourcesContent":["import { type ComponentPropsWithoutRef, type JSX, type ReactNode } from 'react';\n\nimport { Label } from '../../atoms/label/Label.js';\nimport { cx } from '../../../theme/tools.js';\n\nimport * as styles from './formFieldLayout.css.js';\n\ntype FieldContainerProps = Omit<\n ComponentPropsWithoutRef<'div'>,\n 'className' | 'children'\n>;\n\ntype FieldsetContainerProps = Omit<\n ComponentPropsWithoutRef<'fieldset'>,\n 'className' | 'children'\n>;\n\nexport type FormFieldLayoutProps = {\n as?: 'div' | 'fieldset';\n children: ReactNode;\n className?: string;\n controlClassName?: string;\n description?: ReactNode;\n descriptionId?: string;\n error?: ReactNode;\n errorId?: string;\n label?: ReactNode;\n labelFor?: string;\n labelId?: string;\n required?: boolean;\n} & (FieldContainerProps | FieldsetContainerProps);\n\nexport const FormFieldLayout = ({\n as = 'div',\n children,\n className,\n controlClassName,\n description,\n descriptionId,\n error,\n errorId,\n label,\n labelFor,\n labelId,\n required = false,\n ...rest\n}: FormFieldLayoutProps): JSX.Element => {\n let labelNode: JSX.Element | null = null;\n if (label != null) {\n if (as === 'fieldset') {\n labelNode = (\n <legend id={labelId} className={styles.legend}>\n {label}\n {required && <span className={styles.requiredMark}>*</span>}\n </legend>\n );\n } else {\n labelNode = (\n <Label htmlFor={labelFor} id={labelId} required={required}>\n {label}\n </Label>\n );\n }\n }\n\n let descriptionNode: JSX.Element | null = null;\n if (description != null) {\n descriptionNode = (\n <div id={descriptionId} className={styles.description}>\n {description}\n </div>\n );\n }\n\n let errorNode: JSX.Element | null = null;\n if (error != null) {\n errorNode = (\n <div id={errorId} className={styles.error}>\n {error}\n </div>\n );\n }\n\n const content = (\n <>\n {labelNode}\n {descriptionNode}\n <div className={cx(styles.control, controlClassName)}>{children}</div>\n {errorNode}\n </>\n );\n\n if (as === 'fieldset') {\n return (\n <fieldset\n {...(rest as FieldsetContainerProps)}\n className={cx(styles.fieldset, styles.root, className)}\n >\n {content}\n </fieldset>\n );\n }\n\n return (\n <div\n {...(rest as FieldContainerProps)}\n className={cx(styles.root, className)}\n >\n {content}\n </div>\n );\n};\n\nexport default FormFieldLayout;\n"],"mappings":";;;;;AAgCA,IAAa,KAAmB,EAC9B,QAAK,OACL,aACA,cACA,qBACA,aAAA,GACA,kBACA,OAAA,GACA,YACA,UACA,aACA,YACA,cAAW,IACX,GAAG,QACoC;CACvC,IAAI,IAAgC;CACpC,AAAI,KAAS,SACX,AAQE,IARE,MAAO,aAEP,kBAAC,UAAD;EAAQ,IAAI;EAAS,WAAW;YAAhC,CACG,GACA,KAAY,kBAAC,QAAD;GAAM,WAAW;aAAqB;EAAO,CAAA,CACpD;MAIR,kBAAC,GAAD;EAAO,SAAS;EAAU,IAAI;EAAmB;YAC9C;CACI,CAAA;CAKb,IAAI,IAAsC;CAC1C,AAAI,KAAe,SACjB,IACE,kBAAC,OAAD;EAAK,IAAI;EAAe,WAAW;YAChC;CACE,CAAA;CAIT,IAAI,IAAgC;CACpC,AAAI,KAAS,SACX,IACE,kBAAC,OAAD;EAAK,IAAI;EAAS,WAAW;YAC1B;CACE,CAAA;CAIT,IAAM,IACJ,kBAAA,GAAA,EAAA,UAAA;EACG;EACA;EACD,kBAAC,OAAD;GAAK,WAAW,EAAG,GAAgB,CAAgB;GAAI;EAAc,CAAA;EACpE;CACD,EAAA,CAAA;CAcJ,OAXI,MAAO,aAEP,kBAAC,YAAD;EACE,GAAK;EACL,WAAW,EAAG,GAAiB,GAAa,CAAS;YAEpD;CACO,CAAA,IAKZ,kBAAC,OAAD;EACE,GAAK;EACL,WAAW,EAAG,GAAa,CAAS;YAEnC;CACE,CAAA;AAET"}
@@ -0,0 +1,8 @@
1
+ /* empty css */
2
+ /* empty css */
3
+ //#region src/atomic/molecules/form_field_layout/formFieldLayout.css.ts
4
+ var e = "_95x9ml0 txvbqbfpn txvbqbh4x txvbqbhd8 txvbqbv7x", t = "_95x9ml1 txvbqb1tv txvbqbo7v txvbqbwvv", n = "_95x9ml2 txvbqbfox txvbqb9j txvbqbhb2 txvbqb1bgr txvbqbwvv", r = "_95x9ml3 txvbqb1bj9 txvbqbqyg", i = "_95x9ml4 txvbqb96 txvbqb1bg5", a = "_95x9ml5 txvbqbv7x", o = "_95x9ml6 txvbqb96 txvbqb1bj9";
5
+ //#endregion
6
+ export { a as control, i as description, o as error, t as fieldset, n as legend, r as requiredMark, e as root };
7
+
8
+ //# sourceMappingURL=formFieldLayout.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formFieldLayout.css.js","names":[],"sources":["../../../../../src/atomic/molecules/form_field_layout/formFieldLayout.css.ts"],"sourcesContent":["import { sprinkles } from '../../../theme/sprinkles.css.js';\n\nexport const root = sprinkles({\n display: 'flex',\n flexDirection: 'column',\n gap: 1,\n minWidth: 0,\n});\n\nexport const fieldset = sprinkles({\n borderWidth: 0,\n margin: 0,\n padding: 0,\n});\n\nexport const legend = sprinkles({\n display: 'block',\n fontSize: 'sm',\n fontWeight: 'medium',\n color: 'text',\n padding: 0,\n});\n\nexport const requiredMark = sprinkles({\n color: 'error',\n marginLeft: 0.5,\n});\n\nexport const description = sprinkles({\n fontSize: 'xs',\n color: 'secondary',\n});\n\nexport const control = sprinkles({\n minWidth: 0,\n});\n\nexport const error = sprinkles({\n fontSize: 'xs',\n color: 'error',\n});\n"],"mappings":""}
@@ -1,8 +1,17 @@
1
1
  /* empty css */
2
2
  /* empty css */
3
+ import { createRuntimeFn as e } from "@vanilla-extract/recipes/createRuntimeFn";
3
4
  //#region src/atomic/molecules/form_grid/FormGrid.css.ts
4
- var e = "var(--_1nx8f960)", t = "_1nx8f962 _1nx8f961 txvbqbfq0 txvbqbhdy txvbqb19uf";
5
+ var t = "var(--_1nx8f960)", n = e({
6
+ defaultClassName: "_1nx8f964 _1nx8f961 txvbqbfq0 txvbqbheb txvbqb19us",
7
+ variantClassNames: { layout: {
8
+ auto: "_1nx8f965 _1nx8f962",
9
+ vertical: "_1nx8f966 _1nx8f963"
10
+ } },
11
+ defaultVariants: { layout: "auto" },
12
+ compoundVariants: []
13
+ });
5
14
  //#endregion
6
- export { t as grid, e as minColumnWidthVar };
15
+ export { n as grid, t as minColumnWidthVar };
7
16
 
8
17
  //# sourceMappingURL=FormGrid.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormGrid.css.js","names":[],"sources":["../../../../../src/atomic/molecules/form_grid/FormGrid.css.ts"],"sourcesContent":["import { createVar, style } from '@vanilla-extract/css';\n\nimport { sprinkles } from '../../../theme/sprinkles.css.js';\n\nexport const minColumnWidthVar = createVar();\n\nexport const grid = style([\n sprinkles({\n display: 'grid',\n gap: 3,\n width: 'full',\n }),\n {\n gridTemplateColumns: `repeat(auto-fit, minmax(${minColumnWidthVar}, 1fr))`,\n },\n]);\n"],"mappings":""}
1
+ {"version":3,"file":"FormGrid.css.js","names":[],"sources":["../../../../../src/atomic/molecules/form_grid/FormGrid.css.ts"],"sourcesContent":["import { createVar, style } from '@vanilla-extract/css';\nimport { recipe } from '@vanilla-extract/recipes';\n\nimport { sprinkles } from '../../../theme/sprinkles.css.js';\n\nexport const minColumnWidthVar = createVar();\n\nconst gridBase = sprinkles({\n display: 'grid',\n gap: 4,\n width: 'full',\n});\n\nconst autoGrid = style({\n gridTemplateColumns: `repeat(auto-fit, minmax(min(100%, ${minColumnWidthVar}), 1fr))`,\n});\n\nconst verticalGrid = style({\n gridTemplateColumns: 'minmax(0, 1fr)',\n});\n\nexport const grid = recipe({\n base: gridBase,\n variants: {\n layout: {\n auto: autoGrid,\n vertical: verticalGrid,\n },\n },\n defaultVariants: {\n layout: 'auto',\n },\n});\n"],"mappings":""}
@@ -2,15 +2,19 @@ import { cx as e } from "../../../theme/tools.js";
2
2
  import { grid as t, minColumnWidthVar as n } from "./FormGrid.css.js";
3
3
  import { jsx as r } from "react/jsx-runtime";
4
4
  //#region src/atomic/molecules/form_grid/FormGrid.tsx
5
- var i = ({ children: i, className: a, minColumnWidth: o = "220px" }) => {
6
- let s = { [n]: o };
5
+ var i = (e) => {
6
+ let t = /^var\((--[^)]+)\)$/.exec(e);
7
+ if (t == null) throw Error(`Invalid Vanilla Extract variable: ${e}`);
8
+ return t[1];
9
+ }, a = ({ children: a, className: o, layout: s = "auto", minColumnWidth: c = "220px" }) => {
10
+ let l = { [i(n)]: c };
7
11
  return /* @__PURE__ */ r("div", {
8
- className: e(t, a),
9
- style: s,
10
- children: i
12
+ className: e(t({ layout: s }), o),
13
+ style: l,
14
+ children: a
11
15
  });
12
16
  };
13
17
  //#endregion
14
- export { i as FormGrid, i as default };
18
+ export { a as FormGrid, a as default };
15
19
 
16
20
  //# sourceMappingURL=FormGrid.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormGrid.js","names":[],"sources":["../../../../../src/atomic/molecules/form_grid/FormGrid.tsx"],"sourcesContent":["import { type CSSProperties, type JSX, type ReactNode } from 'react';\n\nimport { cx } from '../../../theme/tools.js';\n\nimport * as styles from './FormGrid.css.js';\n\nexport type FormGridProps = {\n children: ReactNode;\n minColumnWidth?: string;\n className?: string;\n};\n\nexport const FormGrid = ({\n children,\n className,\n minColumnWidth = '220px',\n}: FormGridProps): JSX.Element => {\n const style = {\n [styles.minColumnWidthVar]: minColumnWidth,\n } as CSSProperties;\n\n return (\n <div className={cx(styles.grid, className)} style={style}>\n {children}\n </div>\n );\n};\n\nexport default FormGrid;\n"],"mappings":";;;;AAYA,IAAa,KAAY,EACvB,aACA,cACA,oBAAiB,cACe;CAChC,IAAM,IAAQ,GACX,IAA2B,EAC9B;CAEA,OACE,kBAAC,OAAD;EAAK,WAAW,EAAG,GAAa,CAAS;EAAU;EAChD;CACE,CAAA;AAET"}
1
+ {"version":3,"file":"FormGrid.js","names":[],"sources":["../../../../../src/atomic/molecules/form_grid/FormGrid.tsx"],"sourcesContent":["import { type CSSProperties, type JSX, type ReactNode } from 'react';\n\nimport { cx } from '../../../theme/tools.js';\n\nimport * as styles from './FormGrid.css.js';\n\nexport type FormGridProps = {\n children: ReactNode;\n minColumnWidth?: string;\n layout?: 'auto' | 'vertical';\n className?: string;\n};\n\nconst getInlineVarName = (variable: string): `--${string}` => {\n const match = /^var\\((--[^)]+)\\)$/.exec(variable);\n if (match == null) {\n throw new Error(`Invalid Vanilla Extract variable: ${variable}`);\n }\n return match[1] as `--${string}`;\n};\n\nexport const FormGrid = ({\n children,\n className,\n layout = 'auto',\n minColumnWidth = '220px',\n}: FormGridProps): JSX.Element => {\n const style = {\n [getInlineVarName(styles.minColumnWidthVar)]: minColumnWidth,\n } as CSSProperties;\n\n return (\n <div className={cx(styles.grid({ layout }), className)} style={style}>\n {children}\n </div>\n );\n};\n\nexport default FormGrid;\n"],"mappings":";;;;AAaA,IAAM,KAAoB,MAAoC;CAC5D,IAAM,IAAQ,qBAAqB,KAAK,CAAQ;CAChD,IAAI,KAAS,MACX,MAAU,MAAM,qCAAqC,GAAU;CAEjE,OAAO,EAAM;AACf,GAEa,KAAY,EACvB,aACA,cACA,YAAS,QACT,oBAAiB,cACe;CAChC,IAAM,IAAQ,GACX,EAAiB,CAAwB,IAAI,EAChD;CAEA,OACE,kBAAC,OAAD;EAAK,WAAW,EAAG,EAAY,EAAE,UAAO,CAAC,GAAG,CAAS;EAAU;EAC5D;CACE,CAAA;AAET"}
@@ -1,7 +1,7 @@
1
1
  /* empty css */
2
2
  /* empty css */
3
3
  //#region src/atomic/molecules/highlight/HighlightCode.css.ts
4
- var e = "_14wey9t0 txvbqbp6w txvbqb1b97 txvbqb28o txvbqb2sj txvbqb1d9 txvbqb2uc txvbqb1bgv txvbqbu4k txvbqbv7x txvbqbwr6 txvbqb13i7 txvbqb19uf", t = "_14wey9t1 txvbqbey txvbqbfpn txvbqblt7 txvbqb10mx txvbqb11ki txvbqb12i3 txvbqbxu6 txvbqb1b9b txvbqbhdl", n = "_14wey9t2 txvbqb10mk txvbqb11k5 txvbqb13cf txvbqbyoi txvbqb1b9n txvbqb2wi txvbqb1bhb txvbqb96 txvbqbhb2 txvbqb6a", r = "_14wey9t3 txvbqb10mx txvbqb11ki txvbqb12i3 txvbqbxu6 txvbqbtay txvbqbu4k txvbqbv7x txvbqbwu2 txvbqb19uf", i = "_14wey9t4 txvbqb10mx txvbqb11ki txvbqb12i3 txvbqbxu6 txvbqbtay txvbqbu4k txvbqbv7x txvbqbwuf txvbqb19uf", a = "_14wey9t5 ", o = "_14wey9t6 txvbqbo7v", s = "_14wey9t7 txvbqb1bgv txvbqbh99 txvbqb9j txvbqbny4 txvbqbo7v txvbqb1awp", c = "_14wey9t8 txvbqb1bgv txvbqbh99 txvbqb9j txvbqbny4 txvbqbo7v txvbqbws9 txvbqb1ax2 txvbqb1ara", l = "_14wey9t9 txvbqb1bg3 txvbqb9j txvbqb1o";
4
+ var e = "_14wey9t0 txvbqbp6w txvbqb1b9x txvbqb28o txvbqb2sj txvbqb1d9 txvbqb2uc txvbqb1bhl txvbqbu4k txvbqbv7x txvbqbwr6 txvbqb13ik txvbqb19us", t = "_14wey9t1 txvbqbey txvbqbfpn txvbqblt7 txvbqb10na txvbqb11kv txvbqb12ig txvbqbxuj txvbqb1ba1 txvbqbhdl", n = "_14wey9t2 txvbqb10mx txvbqb11ki txvbqb13cs txvbqbyov txvbqb1bad txvbqb2wi txvbqb1bi1 txvbqb96 txvbqbhb2 txvbqb6a", r = "_14wey9t3 txvbqb10na txvbqb11kv txvbqb12ig txvbqbxuj txvbqbtay txvbqbu4k txvbqbv7x txvbqbwuf txvbqb19us", i = "_14wey9t4 txvbqb10na txvbqb11kv txvbqb12ig txvbqbxuj txvbqbtay txvbqbu4k txvbqbv7x txvbqbwus txvbqb19us", a = "_14wey9t5 ", o = "_14wey9t6 txvbqbo7v", s = "_14wey9t7 txvbqb1bhl txvbqbh99 txvbqb9j txvbqbny4 txvbqbo7v txvbqb1axf", c = "_14wey9t8 txvbqb1bhl txvbqbh99 txvbqb9j txvbqbny4 txvbqbo7v txvbqbws9 txvbqb1axs txvbqb1arn", l = "_14wey9t9 txvbqb1bgt txvbqb9j txvbqb1o";
5
5
  //#endregion
6
6
  export { n as badge, e as container, r as content, i as contentWrapped, s as fallbackCode, c as fallbackCodeWrapped, l as placeholder, o as shikiPre, a as shikiWrapper, t as toolbar };
7
7
 
@@ -1,7 +1,7 @@
1
1
  /* empty css */
2
2
  /* empty css */
3
3
  //#region src/atomic/molecules/highlight/highlightStyles.css.ts
4
- var e = "_1ke2cro0 txvbqbp6w txvbqb1b97 txvbqb28o txvbqb2sj txvbqb1d9 txvbqb2uc txvbqb1bgv txvbqbwr6 txvbqb13i7", t = "_1ke2cro1 txvbqbey txvbqbfpn txvbqblt7 txvbqb10mx txvbqb11ki txvbqb12i3 txvbqbxu6 txvbqb1b9b txvbqbhdl", n = "_1ke2cro2 txvbqb10mk txvbqb11k5 txvbqb13cf txvbqbyoi txvbqb1b9n txvbqb2wi txvbqb1bhb txvbqb96 txvbqbhb2 txvbqb6a", r = "_1ke2cro3 txvbqb10mx txvbqb11ki txvbqb12i3 txvbqbxu6 txvbqbtay txvbqbwu2", i = "_1ke2cro4 ", a = "_1ke2cro5 txvbqbo7v", o = "_1ke2cro6 txvbqb1bgv txvbqbh99 txvbqb9j txvbqbny4 txvbqbo7v txvbqb1awp";
4
+ var e = "_1ke2cro0 txvbqbp6w txvbqb1b9x txvbqb28o txvbqb2sj txvbqb1d9 txvbqb2uc txvbqb1bhl txvbqbwr6 txvbqb13ik", t = "_1ke2cro1 txvbqbey txvbqbfpn txvbqblt7 txvbqb10na txvbqb11kv txvbqb12ig txvbqbxuj txvbqb1ba1 txvbqbhdl", n = "_1ke2cro2 txvbqb10mx txvbqb11ki txvbqb13cs txvbqbyov txvbqb1bad txvbqb2wi txvbqb1bi1 txvbqb96 txvbqbhb2 txvbqb6a", r = "_1ke2cro3 txvbqb10na txvbqb11kv txvbqb12ig txvbqbxuj txvbqbtay txvbqbwuf", i = "_1ke2cro4 ", a = "_1ke2cro5 txvbqbo7v", o = "_1ke2cro6 txvbqb1bhl txvbqbh99 txvbqb9j txvbqbny4 txvbqbo7v txvbqb1axf";
5
5
  //#endregion
6
6
  export { n as highlightBadge, e as highlightContainer, r as highlightContent, o as highlightFallbackCode, a as highlightShikiPre, i as highlightShikiWrapper, t as highlightToolbar };
7
7
 
@@ -6,7 +6,7 @@
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  //#region src/atomic/molecules/markdown/LazyMarkdownRenderer.css.ts
9
- var e = "_1ltp1xc0 txvbqbws9 txvbqb1ax2";
9
+ var e = "_1ltp1xc0 txvbqbwsm txvbqb1axs";
10
10
  //#endregion
11
11
  export { e as fallback };
12
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"LazyMarkdownRenderer.css.js","names":[],"sources":["../../../../../src/atomic/molecules/markdown/LazyMarkdownRenderer.css.ts"],"sourcesContent":["import { sprinkles } from '../../../theme/index.js';\n\nexport const fallback = sprinkles({\n overflowWrap: 'anywhere',\n whiteSpace: 'pre-wrap',\n});\n"],"mappings":""}
1
+ {"version":3,"file":"LazyMarkdownRenderer.css.js","names":[],"sources":["../../../../../src/atomic/molecules/markdown/LazyMarkdownRenderer.css.ts"],"sourcesContent":["import { sprinkles } from '../../../theme/index.js';\n\nexport const fallback = sprinkles({\n overflowWrap: 'break-word',\n whiteSpace: 'pre-wrap',\n});\n"],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  /* empty css */
2
+ /* empty css */
2
3
  /* empty css */
3
4
  //#region src/atomic/molecules/markdown/components/MarkdownArticleContainer.css.ts
4
5
  var e = "_7ez1431 _7ez1430 txvbqbfpn txvbqbh4x txvbqbheb";