@usefragments/ui 1.3.0 → 1.3.2

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 (132) hide show
  1. package/README.md +12 -11
  2. package/dist/assets/ui.css +1093 -0
  3. package/dist/chart.cjs +1 -0
  4. package/dist/chart.js +1 -0
  5. package/dist/codeblock.cjs +1 -0
  6. package/dist/codeblock.js +1 -0
  7. package/dist/colorpicker.cjs +1 -0
  8. package/dist/colorpicker.js +1 -0
  9. package/dist/components/Accordion/index.cjs +1 -0
  10. package/dist/components/Accordion/index.js +1 -0
  11. package/dist/components/Alert/index.cjs +1 -0
  12. package/dist/components/Alert/index.js +1 -0
  13. package/dist/components/AppShell/index.cjs +1 -0
  14. package/dist/components/AppShell/index.js +1 -0
  15. package/dist/components/Avatar/index.cjs +1 -0
  16. package/dist/components/Avatar/index.js +1 -0
  17. package/dist/components/Badge/index.cjs +1 -0
  18. package/dist/components/Badge/index.js +1 -0
  19. package/dist/components/Breadcrumbs/index.cjs +1 -0
  20. package/dist/components/Breadcrumbs/index.js +1 -0
  21. package/dist/components/Button/index.cjs +1 -0
  22. package/dist/components/Button/index.js +1 -0
  23. package/dist/components/Card/index.cjs +1 -0
  24. package/dist/components/Card/index.js +1 -0
  25. package/dist/components/Checkbox/index.cjs +1 -0
  26. package/dist/components/Checkbox/index.js +1 -0
  27. package/dist/components/Chip/index.cjs +1 -0
  28. package/dist/components/Chip/index.js +1 -0
  29. package/dist/components/Collapsible/index.cjs +1 -0
  30. package/dist/components/Collapsible/index.js +1 -0
  31. package/dist/components/Combobox/index.cjs +1 -0
  32. package/dist/components/Combobox/index.js +1 -0
  33. package/dist/components/Command/index.cjs +1 -0
  34. package/dist/components/Command/index.js +1 -0
  35. package/dist/components/ComponentDefaults/index.cjs +1 -0
  36. package/dist/components/ComponentDefaults/index.js +1 -0
  37. package/dist/components/ConversationList/index.cjs +1 -0
  38. package/dist/components/ConversationList/index.js +1 -0
  39. package/dist/components/DatePicker/index.d.ts +1 -1
  40. package/dist/components/DatePicker/index.d.ts.map +1 -1
  41. package/dist/components/Dialog/index.cjs +1 -0
  42. package/dist/components/Dialog/index.js +1 -0
  43. package/dist/components/Drawer/index.cjs +1 -0
  44. package/dist/components/Drawer/index.js +1 -0
  45. package/dist/components/EmptyState/index.cjs +1 -0
  46. package/dist/components/EmptyState/index.js +1 -0
  47. package/dist/components/Field/index.cjs +1 -0
  48. package/dist/components/Field/index.js +1 -0
  49. package/dist/components/Fieldset/index.cjs +1 -0
  50. package/dist/components/Fieldset/index.js +1 -0
  51. package/dist/components/Form/index.cjs +1 -0
  52. package/dist/components/Form/index.js +1 -0
  53. package/dist/components/Header/index.cjs +1 -0
  54. package/dist/components/Header/index.js +1 -0
  55. package/dist/components/Icon/index.cjs +1 -0
  56. package/dist/components/Icon/index.js +1 -0
  57. package/dist/components/IconButton/index.cjs +1 -0
  58. package/dist/components/IconButton/index.js +1 -0
  59. package/dist/components/Image/index.cjs +1 -0
  60. package/dist/components/Image/index.js +1 -0
  61. package/dist/components/Input/index.cjs +1 -0
  62. package/dist/components/Input/index.js +1 -0
  63. package/dist/components/List/index.cjs +1 -0
  64. package/dist/components/List/index.js +1 -0
  65. package/dist/components/Listbox/index.cjs +1 -0
  66. package/dist/components/Listbox/index.js +1 -0
  67. package/dist/components/Loading/index.cjs +1 -0
  68. package/dist/components/Loading/index.js +1 -0
  69. package/dist/components/Menu/index.cjs +1 -0
  70. package/dist/components/Menu/index.js +1 -0
  71. package/dist/components/Message/index.cjs +1 -0
  72. package/dist/components/Message/index.js +1 -0
  73. package/dist/components/NavigationMenu/NavigationMenuContext.cjs +1 -0
  74. package/dist/components/NavigationMenu/NavigationMenuContext.js +1 -0
  75. package/dist/components/NavigationMenu/index.cjs +1 -0
  76. package/dist/components/NavigationMenu/index.js +1 -0
  77. package/dist/components/NavigationMenu/useNavigationMenu.cjs +1 -0
  78. package/dist/components/NavigationMenu/useNavigationMenu.js +1 -0
  79. package/dist/components/Pagination/index.cjs +1 -0
  80. package/dist/components/Pagination/index.js +1 -0
  81. package/dist/components/Popover/index.cjs +1 -0
  82. package/dist/components/Popover/index.js +1 -0
  83. package/dist/components/Progress/index.cjs +1 -0
  84. package/dist/components/Progress/index.js +1 -0
  85. package/dist/components/Prompt/index.cjs +1 -0
  86. package/dist/components/Prompt/index.js +1 -0
  87. package/dist/components/RadioGroup/index.cjs +1 -0
  88. package/dist/components/RadioGroup/index.js +1 -0
  89. package/dist/components/ScrollArea/index.cjs +1 -0
  90. package/dist/components/ScrollArea/index.js +1 -0
  91. package/dist/components/Select/index.cjs +1 -0
  92. package/dist/components/Select/index.js +1 -0
  93. package/dist/components/Separator/index.cjs +1 -0
  94. package/dist/components/Separator/index.js +1 -0
  95. package/dist/components/Sidebar/index.cjs +1 -0
  96. package/dist/components/Sidebar/index.js +1 -0
  97. package/dist/components/Slider/index.cjs +1 -0
  98. package/dist/components/Slider/index.js +1 -0
  99. package/dist/components/TableOfContents/index.cjs +1 -0
  100. package/dist/components/TableOfContents/index.js +1 -0
  101. package/dist/components/Tabs/index.cjs +1 -0
  102. package/dist/components/Tabs/index.js +1 -0
  103. package/dist/components/Theme/index.cjs +1 -0
  104. package/dist/components/Theme/index.js +1 -0
  105. package/dist/components/ThinkingIndicator/index.cjs +1 -0
  106. package/dist/components/ThinkingIndicator/index.js +1 -0
  107. package/dist/components/Toast/index.cjs +1 -0
  108. package/dist/components/Toast/index.js +1 -0
  109. package/dist/components/Toggle/index.cjs +1 -0
  110. package/dist/components/Toggle/index.js +1 -0
  111. package/dist/components/ToggleGroup/index.cjs +1 -0
  112. package/dist/components/ToggleGroup/index.js +1 -0
  113. package/dist/components/Tooltip/index.cjs +1 -0
  114. package/dist/components/Tooltip/index.js +1 -0
  115. package/dist/data-table-virtual.cjs +1 -0
  116. package/dist/data-table-virtual.js +1 -0
  117. package/dist/data-table.cjs +1 -0
  118. package/dist/data-table.js +1 -0
  119. package/dist/datepicker.cjs +69 -32
  120. package/dist/datepicker.js +42 -5
  121. package/dist/editor.cjs +1 -0
  122. package/dist/editor.js +1 -0
  123. package/dist/markdown.cjs +1 -0
  124. package/dist/markdown.js +1 -0
  125. package/dist/table.cjs +1 -0
  126. package/dist/table.js +1 -0
  127. package/dist/utils/a11y.cjs +1 -0
  128. package/dist/utils/a11y.js +1 -0
  129. package/dist/utils/keyboard-shortcuts.cjs +1 -0
  130. package/dist/utils/keyboard-shortcuts.js +1 -0
  131. package/package.json +3 -2
  132. package/src/components/DatePicker/index.tsx +64 -5
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import { Field } from "@base-ui/react/field";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import styles from "./TableOfContents.module.scss.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import { ComponentDefaultsProvider, useResolvedControlSize } from "../ComponentDefaults/index.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import styles from "./ThinkingIndicator.module.scss.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import styles from "./Toast.module.scss.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import { Switch as Switch$1 } from "@base-ui/react/switch";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import { useResolvedControlSize } from "../ComponentDefaults/index.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import { useVirtualizer } from "@tanstack/react-virtual";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import { createElement } from "react";
@@ -1,10 +1,9 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
4
5
  const React = require("react");
5
6
  const popover = require("@base-ui/react/popover");
6
- const reactDayPicker = require("react-day-picker");
7
- const dateFns = require("date-fns");
8
7
  const aria = require("./utils/aria.cjs");
9
8
  const index = require("./components/ComponentDefaults/index.cjs");
10
9
  const DatePicker_module = require("./components/DatePicker/DatePicker.module.scss.cjs");
@@ -92,13 +91,23 @@ function useDatePickerContext() {
92
91
  }
93
92
  return context;
94
93
  }
94
+ const longDateFormatter = new Intl.DateTimeFormat("en-US", {
95
+ month: "long",
96
+ day: "numeric",
97
+ year: "numeric"
98
+ });
99
+ const mediumDateFormatter = new Intl.DateTimeFormat("en-US", {
100
+ month: "short",
101
+ day: "2-digit",
102
+ year: "numeric"
103
+ });
95
104
  function defaultFormatDate(date) {
96
- return dateFns.format(date, "PPP");
105
+ return longDateFormatter.format(date);
97
106
  }
98
107
  function defaultFormatRange(range) {
99
108
  if (!range.from) return "";
100
- if (!range.to) return dateFns.format(range.from, "LLL dd, y");
101
- return `${dateFns.format(range.from, "LLL dd, y")} - ${dateFns.format(range.to, "LLL dd, y")}`;
109
+ if (!range.to) return mediumDateFormatter.format(range.from);
110
+ return `${mediumDateFormatter.format(range.from)} - ${mediumDateFormatter.format(range.to)}`;
102
111
  }
103
112
  function formatDateForHiddenInput(date) {
104
113
  if (!date) return "";
@@ -107,32 +116,54 @@ function formatDateForHiddenInput(date) {
107
116
  const day = String(date.getDate()).padStart(2, "0");
108
117
  return `${year}-${month}-${day}`;
109
118
  }
119
+ let _DayPicker = null;
120
+ let _UI = null;
121
+ let _SelectionState = null;
122
+ let _DayFlag = null;
123
+ let _rdpLoaded = false;
124
+ let _rdpFailed = false;
125
+ function loadDayPickerDeps() {
126
+ if (_rdpLoaded) return;
127
+ _rdpLoaded = true;
128
+ try {
129
+ const rdp = require("react-day-picker");
130
+ _DayPicker = rdp.DayPicker;
131
+ _UI = rdp.UI;
132
+ _SelectionState = rdp.SelectionState;
133
+ _DayFlag = rdp.DayFlag;
134
+ } catch {
135
+ _rdpFailed = true;
136
+ }
137
+ }
110
138
  function getCalendarClassNames() {
139
+ const UI = _UI;
140
+ const SelectionState = _SelectionState;
141
+ const DayFlag = _DayFlag;
111
142
  return {
112
- [reactDayPicker.UI.Root]: DatePicker_module.default.calendar,
113
- [reactDayPicker.UI.Months]: DatePicker_module.default.months,
114
- [reactDayPicker.UI.Month]: DatePicker_module.default.month,
115
- [reactDayPicker.UI.MonthCaption]: DatePicker_module.default.monthCaption,
116
- [reactDayPicker.UI.CaptionLabel]: DatePicker_module.default.captionLabel,
117
- [reactDayPicker.UI.Nav]: DatePicker_module.default.nav,
118
- [reactDayPicker.UI.PreviousMonthButton]: DatePicker_module.default.navButton,
119
- [reactDayPicker.UI.NextMonthButton]: DatePicker_module.default.navButton,
120
- [reactDayPicker.UI.MonthGrid]: DatePicker_module.default.monthGrid,
121
- [reactDayPicker.UI.Weekdays]: DatePicker_module.default.weekdays,
122
- [reactDayPicker.UI.Weekday]: DatePicker_module.default.weekday,
123
- [reactDayPicker.UI.Weeks]: DatePicker_module.default.weeks,
124
- [reactDayPicker.UI.Week]: DatePicker_module.default.week,
125
- [reactDayPicker.UI.Day]: DatePicker_module.default.day,
126
- [reactDayPicker.UI.DayButton]: DatePicker_module.default.dayButton,
127
- [reactDayPicker.UI.Chevron]: DatePicker_module.default.chevron,
128
- [reactDayPicker.SelectionState.selected]: DatePicker_module.default.selected,
129
- [reactDayPicker.SelectionState.range_start]: DatePicker_module.default.rangeStart,
130
- [reactDayPicker.SelectionState.range_middle]: DatePicker_module.default.rangeMiddle,
131
- [reactDayPicker.SelectionState.range_end]: DatePicker_module.default.rangeEnd,
132
- [reactDayPicker.DayFlag.today]: DatePicker_module.default.today,
133
- [reactDayPicker.DayFlag.outside]: DatePicker_module.default.outside,
134
- [reactDayPicker.DayFlag.disabled]: DatePicker_module.default.disabled,
135
- [reactDayPicker.DayFlag.focused]: DatePicker_module.default.focused
143
+ [UI.Root]: DatePicker_module.default.calendar,
144
+ [UI.Months]: DatePicker_module.default.months,
145
+ [UI.Month]: DatePicker_module.default.month,
146
+ [UI.MonthCaption]: DatePicker_module.default.monthCaption,
147
+ [UI.CaptionLabel]: DatePicker_module.default.captionLabel,
148
+ [UI.Nav]: DatePicker_module.default.nav,
149
+ [UI.PreviousMonthButton]: DatePicker_module.default.navButton,
150
+ [UI.NextMonthButton]: DatePicker_module.default.navButton,
151
+ [UI.MonthGrid]: DatePicker_module.default.monthGrid,
152
+ [UI.Weekdays]: DatePicker_module.default.weekdays,
153
+ [UI.Weekday]: DatePicker_module.default.weekday,
154
+ [UI.Weeks]: DatePicker_module.default.weeks,
155
+ [UI.Week]: DatePicker_module.default.week,
156
+ [UI.Day]: DatePicker_module.default.day,
157
+ [UI.DayButton]: DatePicker_module.default.dayButton,
158
+ [UI.Chevron]: DatePicker_module.default.chevron,
159
+ [SelectionState.selected]: DatePicker_module.default.selected,
160
+ [SelectionState.range_start]: DatePicker_module.default.rangeStart,
161
+ [SelectionState.range_middle]: DatePicker_module.default.rangeMiddle,
162
+ [SelectionState.range_end]: DatePicker_module.default.rangeEnd,
163
+ [DayFlag.today]: DatePicker_module.default.today,
164
+ [DayFlag.outside]: DatePicker_module.default.outside,
165
+ [DayFlag.disabled]: DatePicker_module.default.disabled,
166
+ [DayFlag.focused]: DatePicker_module.default.focused
136
167
  };
137
168
  }
138
169
  const DatePickerRoot = React__namespace.forwardRef(function DatePickerRoot2({
@@ -339,12 +370,18 @@ function DatePickerCalendar({
339
370
  }),
340
371
  []
341
372
  );
373
+ loadDayPickerDeps();
374
+ if (_rdpFailed || !_DayPicker || !_UI) {
375
+ return null;
376
+ }
377
+ const DayPicker = _DayPicker;
378
+ const UI = _UI;
342
379
  const calendarClassNames = getCalendarClassNames();
343
- const calendarClasses = className ? { ...calendarClassNames, [reactDayPicker.UI.Root]: [DatePicker_module.default.calendar, className].join(" ") } : calendarClassNames;
380
+ const calendarClasses = className ? { ...calendarClassNames, [UI.Root]: [DatePicker_module.default.calendar, className].join(" ") } : calendarClassNames;
344
381
  if (ctx.mode === "range") {
345
382
  const rangeSelected = ctx.selectedRange ? { from: ctx.selectedRange.from ?? void 0, to: ctx.selectedRange.to ?? void 0 } : void 0;
346
383
  return /* @__PURE__ */ jsxRuntime.jsx(
347
- reactDayPicker.DayPicker,
384
+ DayPicker,
348
385
  {
349
386
  mode: "range",
350
387
  selected: rangeSelected,
@@ -364,7 +401,7 @@ function DatePickerCalendar({
364
401
  );
365
402
  }
366
403
  return /* @__PURE__ */ jsxRuntime.jsx(
367
- reactDayPicker.DayPicker,
404
+ DayPicker,
368
405
  {
369
406
  mode: "single",
370
407
  selected: ctx.selected ?? void 0,
@@ -1,8 +1,7 @@
1
+ "use client";
1
2
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import { Popover } from "@base-ui/react/popover";
4
- import { UI, DayPicker, DayFlag, SelectionState } from "react-day-picker";
5
- import { format } from "date-fns";
6
5
  import { useFormFieldIds } from "./utils/aria.js";
7
6
  import { useResolvedControlSize } from "./components/ComponentDefaults/index.js";
8
7
  import styles from "./components/DatePicker/DatePicker.module.scss.js";
@@ -73,13 +72,23 @@ function useDatePickerContext() {
73
72
  }
74
73
  return context;
75
74
  }
75
+ const longDateFormatter = new Intl.DateTimeFormat("en-US", {
76
+ month: "long",
77
+ day: "numeric",
78
+ year: "numeric"
79
+ });
80
+ const mediumDateFormatter = new Intl.DateTimeFormat("en-US", {
81
+ month: "short",
82
+ day: "2-digit",
83
+ year: "numeric"
84
+ });
76
85
  function defaultFormatDate(date) {
77
- return format(date, "PPP");
86
+ return longDateFormatter.format(date);
78
87
  }
79
88
  function defaultFormatRange(range) {
80
89
  if (!range.from) return "";
81
- if (!range.to) return format(range.from, "LLL dd, y");
82
- return `${format(range.from, "LLL dd, y")} - ${format(range.to, "LLL dd, y")}`;
90
+ if (!range.to) return mediumDateFormatter.format(range.from);
91
+ return `${mediumDateFormatter.format(range.from)} - ${mediumDateFormatter.format(range.to)}`;
83
92
  }
84
93
  function formatDateForHiddenInput(date) {
85
94
  if (!date) return "";
@@ -88,7 +97,29 @@ function formatDateForHiddenInput(date) {
88
97
  const day = String(date.getDate()).padStart(2, "0");
89
98
  return `${year}-${month}-${day}`;
90
99
  }
100
+ let _DayPicker = null;
101
+ let _UI = null;
102
+ let _SelectionState = null;
103
+ let _DayFlag = null;
104
+ let _rdpLoaded = false;
105
+ let _rdpFailed = false;
106
+ function loadDayPickerDeps() {
107
+ if (_rdpLoaded) return;
108
+ _rdpLoaded = true;
109
+ try {
110
+ const rdp = require("react-day-picker");
111
+ _DayPicker = rdp.DayPicker;
112
+ _UI = rdp.UI;
113
+ _SelectionState = rdp.SelectionState;
114
+ _DayFlag = rdp.DayFlag;
115
+ } catch {
116
+ _rdpFailed = true;
117
+ }
118
+ }
91
119
  function getCalendarClassNames() {
120
+ const UI = _UI;
121
+ const SelectionState = _SelectionState;
122
+ const DayFlag = _DayFlag;
92
123
  return {
93
124
  [UI.Root]: styles.calendar,
94
125
  [UI.Months]: styles.months,
@@ -320,6 +351,12 @@ function DatePickerCalendar({
320
351
  }),
321
352
  []
322
353
  );
354
+ loadDayPickerDeps();
355
+ if (_rdpFailed || !_DayPicker || !_UI) {
356
+ return null;
357
+ }
358
+ const DayPicker = _DayPicker;
359
+ const UI = _UI;
323
360
  const calendarClassNames = getCalendarClassNames();
324
361
  const calendarClasses = className ? { ...calendarClassNames, [UI.Root]: [styles.calendar, className].join(" ") } : calendarClassNames;
325
362
  if (ctx.mode === "range") {
package/dist/editor.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
package/dist/editor.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import styles from "./components/Editor/Editor.module.scss.js";
package/dist/markdown.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
package/dist/markdown.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import styles from "./components/Markdown/Markdown.module.scss.js";
package/dist/table.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
package/dist/table.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import styles from "./components/Table/Table.module.scss.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const jsxRuntime = require("react/jsx-runtime");
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  let idCounter = 0;
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
4
  const React = require("react");
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useRef, useEffect } from "react";
2
3
  const KEYBOARD_SHORTCUTS = {
3
4
  // ----- Sidebar -----
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usefragments/ui",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "license": "MIT",
5
5
  "description": "Customizable UI components built on Base UI headless primitives",
6
6
  "author": "Conan McNicholl",
@@ -233,6 +233,7 @@
233
233
  "react-colorful": "^5.6.1",
234
234
  "react-day-picker": "^9.0.0",
235
235
  "react-dom": "^19.0.0",
236
+ "rollup-plugin-preserve-directives": "0.4.0",
236
237
  "sass": "^1.83.0",
237
238
  "shiki": "^3.0.0",
238
239
  "storybook": "^8",
@@ -261,7 +262,7 @@
261
262
  ],
262
263
  "scripts": {
263
264
  "dev": "storybook dev -p 6006",
264
- "build": "vite build && tsc -p tsconfig.build.json",
265
+ "build": "vite build && node ./scripts/emit-complete-styles.mjs && tsc -p tsconfig.build.json",
265
266
  "lint": "eslint src",
266
267
  "test": "vitest run",
267
268
  "build-storybook": "storybook build",
@@ -2,8 +2,6 @@
2
2
 
3
3
  import * as React from "react";
4
4
  import { Popover as BasePopover } from "@base-ui/react/popover";
5
- import { DayFlag, DayPicker, SelectionState, UI } from "react-day-picker";
6
- import { format as formatDateWithPattern } from "date-fns";
7
5
  import { useFormFieldIds, type FormFieldProps } from "../../utils/aria";
8
6
  import { useResolvedControlSize } from "../ComponentDefaults";
9
7
  import styles from "./DatePicker.module.scss";
@@ -186,15 +184,30 @@ function useDatePickerContext() {
186
184
  // ============================================
187
185
  // Default formatters
188
186
  // ============================================
187
+ //
188
+ // Zero-dependency `Intl.DateTimeFormat` so the default trigger label needs no
189
+ // optional peer. `date-fns` remains an optional peer only for consumers who pass
190
+ // their own `formatDate`/`formatRange`; the default path never imports it, so a
191
+ // bundler that pulls DatePicker into the graph does not fail on a missing peer.
192
+ const longDateFormatter = new Intl.DateTimeFormat("en-US", {
193
+ month: "long",
194
+ day: "numeric",
195
+ year: "numeric",
196
+ });
197
+ const mediumDateFormatter = new Intl.DateTimeFormat("en-US", {
198
+ month: "short",
199
+ day: "2-digit",
200
+ year: "numeric",
201
+ });
189
202
 
190
203
  function defaultFormatDate(date: Date): string {
191
- return formatDateWithPattern(date, "PPP");
204
+ return longDateFormatter.format(date);
192
205
  }
193
206
 
194
207
  function defaultFormatRange(range: DateRange): string {
195
208
  if (!range.from) return "";
196
- if (!range.to) return formatDateWithPattern(range.from, "LLL dd, y");
197
- return `${formatDateWithPattern(range.from, "LLL dd, y")} - ${formatDateWithPattern(range.to, "LLL dd, y")}`;
209
+ if (!range.to) return mediumDateFormatter.format(range.from);
210
+ return `${mediumDateFormatter.format(range.from)} - ${mediumDateFormatter.format(range.to)}`;
198
211
  }
199
212
 
200
213
  function formatDateForHiddenInput(date?: Date): string {
@@ -205,11 +218,48 @@ function formatDateForHiddenInput(date?: Date): string {
205
218
  return `${year}-${month}-${day}`;
206
219
  }
207
220
 
221
+ // ============================================
222
+ // Lazy-loaded dependency (react-day-picker)
223
+ // ============================================
224
+ //
225
+ // Loaded on demand via require() so the barrel never statically references the
226
+ // optional `react-day-picker` peer. Importing anything else from
227
+ // @usefragments/ui must not drag the calendar (or its transitive `date-fns`
228
+ // dependency) into a consumer's build graph. Mirrors the Chart/recharts pattern.
229
+
230
+ type DayPickerComponent = React.ComponentType<Record<string, unknown>>;
231
+ type RdpEnum = Record<string, string>;
232
+
233
+ let _DayPicker: DayPickerComponent | null = null;
234
+ let _UI: RdpEnum | null = null;
235
+ let _SelectionState: RdpEnum | null = null;
236
+ let _DayFlag: RdpEnum | null = null;
237
+ let _rdpLoaded = false;
238
+ let _rdpFailed = false;
239
+
240
+ function loadDayPickerDeps(): void {
241
+ if (_rdpLoaded) return;
242
+ _rdpLoaded = true;
243
+ try {
244
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
245
+ const rdp = require("react-day-picker");
246
+ _DayPicker = rdp.DayPicker as DayPickerComponent;
247
+ _UI = rdp.UI as RdpEnum;
248
+ _SelectionState = rdp.SelectionState as RdpEnum;
249
+ _DayFlag = rdp.DayFlag as RdpEnum;
250
+ } catch {
251
+ _rdpFailed = true;
252
+ }
253
+ }
254
+
208
255
  // ============================================
209
256
  // ClassNames mapping (built lazily)
210
257
  // ============================================
211
258
 
212
259
  function getCalendarClassNames() {
260
+ const UI = _UI!;
261
+ const SelectionState = _SelectionState!;
262
+ const DayFlag = _DayFlag!;
213
263
  return {
214
264
  [UI.Root]: styles.calendar,
215
265
  [UI.Months]: styles.months,
@@ -517,6 +567,15 @@ function DatePickerCalendar({
517
567
  []
518
568
  );
519
569
 
570
+ loadDayPickerDeps();
571
+ if (_rdpFailed || !_DayPicker || !_UI) {
572
+ // react-day-picker is an optional peer: render nothing rather than crash
573
+ // when a consumer mounts <DatePicker> without installing the calendar dep.
574
+ return null;
575
+ }
576
+ const DayPicker = _DayPicker;
577
+ const UI = _UI;
578
+
520
579
  const calendarClassNames = getCalendarClassNames();
521
580
 
522
581
  const calendarClasses = className