@slipstream-ui/core 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/dist/index.d.mts +32 -3
  2. package/dist/index.d.ts +32 -3
  3. package/dist/index.js +242 -11
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +242 -11
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/manifests/accordion.manifest.json +1 -1
  8. package/dist/manifests/alert.manifest.json +1 -1
  9. package/dist/manifests/announcement-bar.manifest.json +1 -1
  10. package/dist/manifests/app-shell.manifest.json +1 -1
  11. package/dist/manifests/applied-filters.manifest.json +1 -1
  12. package/dist/manifests/article-card.manifest.json +1 -1
  13. package/dist/manifests/auth-layout.manifest.json +1 -1
  14. package/dist/manifests/autocomplete.manifest.json +1 -1
  15. package/dist/manifests/avatar.manifest.json +1 -1
  16. package/dist/manifests/badge.manifest.json +1 -1
  17. package/dist/manifests/block.manifest.json +1 -1
  18. package/dist/manifests/bottom-nav.manifest.json +1 -1
  19. package/dist/manifests/breadcrumb.manifest.json +1 -1
  20. package/dist/manifests/button-group.manifest.json +1 -1
  21. package/dist/manifests/button.manifest.json +1 -1
  22. package/dist/manifests/calendar.manifest.json +1 -1
  23. package/dist/manifests/card.manifest.json +1 -1
  24. package/dist/manifests/checkbox.manifest.json +1 -1
  25. package/dist/manifests/comparison-table.manifest.json +1 -1
  26. package/dist/manifests/confirm-dialog.manifest.json +1 -1
  27. package/dist/manifests/consent-banner.manifest.json +1 -1
  28. package/dist/manifests/contact-strip.manifest.json +1 -1
  29. package/dist/manifests/container.manifest.json +1 -1
  30. package/dist/manifests/cover-image.manifest.json +1 -1
  31. package/dist/manifests/cta-section.manifest.json +1 -1
  32. package/dist/manifests/data-table.manifest.json +1 -1
  33. package/dist/manifests/date-picker-popover.manifest.json +1 -1
  34. package/dist/manifests/date-picker.manifest.json +1 -1
  35. package/dist/manifests/date-range-picker.manifest.json +1 -1
  36. package/dist/manifests/deal-card.manifest.json +1 -1
  37. package/dist/manifests/dialog.manifest.json +1 -1
  38. package/dist/manifests/document-card.manifest.json +1 -1
  39. package/dist/manifests/drawer.manifest.json +1 -1
  40. package/dist/manifests/empty-state.manifest.json +1 -1
  41. package/dist/manifests/entity-card.manifest.json +1 -1
  42. package/dist/manifests/feature-grid.manifest.json +1 -1
  43. package/dist/manifests/feature-row.manifest.json +1 -1
  44. package/dist/manifests/fieldset.manifest.json +1 -1
  45. package/dist/manifests/figure.manifest.json +1 -1
  46. package/dist/manifests/file-upload.manifest.json +1 -1
  47. package/dist/manifests/filter-bar.manifest.json +1 -1
  48. package/dist/manifests/filter-chips.manifest.json +1 -1
  49. package/dist/manifests/filter-panel.manifest.json +1 -1
  50. package/dist/manifests/flex.manifest.json +1 -1
  51. package/dist/manifests/form-field.manifest.json +1 -1
  52. package/dist/manifests/form-layout.manifest.json +1 -1
  53. package/dist/manifests/form.manifest.json +1 -1
  54. package/dist/manifests/grid.manifest.json +1 -1
  55. package/dist/manifests/heading.manifest.json +1 -1
  56. package/dist/manifests/hero.manifest.json +1 -1
  57. package/dist/manifests/icon-button.manifest.json +1 -1
  58. package/dist/manifests/icon-tile.manifest.json +1 -1
  59. package/dist/manifests/icon.manifest.json +1 -1
  60. package/dist/manifests/image.manifest.json +1 -1
  61. package/dist/manifests/input-group.manifest.json +1 -1
  62. package/dist/manifests/input.manifest.json +1 -1
  63. package/dist/manifests/label.manifest.json +1 -1
  64. package/dist/manifests/link-tabs.manifest.json +1 -1
  65. package/dist/manifests/link.manifest.json +1 -1
  66. package/dist/manifests/list-toolbar.manifest.json +1 -1
  67. package/dist/manifests/list.manifest.json +1 -1
  68. package/dist/manifests/load-more.manifest.json +1 -1
  69. package/dist/manifests/logo-cloud.manifest.json +1 -1
  70. package/dist/manifests/media-card.manifest.json +1 -1
  71. package/dist/manifests/media.manifest.json +1 -1
  72. package/dist/manifests/menu.manifest.json +1 -1
  73. package/dist/manifests/metric-card.manifest.json +1 -1
  74. package/dist/manifests/month-schedule.manifest.json +1 -1
  75. package/dist/manifests/multi-select.manifest.json +1 -1
  76. package/dist/manifests/newsletter.manifest.json +1 -1
  77. package/dist/manifests/page-header.manifest.json +1 -1
  78. package/dist/manifests/pagination.manifest.json +1 -1
  79. package/dist/manifests/password-input.manifest.json +1 -1
  80. package/dist/manifests/popover.manifest.json +1 -1
  81. package/dist/manifests/process-steps.manifest.json +1 -1
  82. package/dist/manifests/progress.manifest.json +1 -1
  83. package/dist/manifests/prose.manifest.json +1 -1
  84. package/dist/manifests/radio.manifest.json +1 -1
  85. package/dist/manifests/range-slider.manifest.json +1 -1
  86. package/dist/manifests/search.manifest.json +1 -1
  87. package/dist/manifests/section-heading.manifest.json +1 -1
  88. package/dist/manifests/section.manifest.json +1 -1
  89. package/dist/manifests/segmented-control.manifest.json +1 -1
  90. package/dist/manifests/select-menu.manifest.json +1 -1
  91. package/dist/manifests/select.manifest.json +1 -1
  92. package/dist/manifests/separator.manifest.json +1 -1
  93. package/dist/manifests/site-footer.manifest.json +1 -1
  94. package/dist/manifests/site-header.manifest.json +1 -1
  95. package/dist/manifests/skeleton.manifest.json +1 -1
  96. package/dist/manifests/social-links.manifest.json +1 -1
  97. package/dist/manifests/spinner.manifest.json +1 -1
  98. package/dist/manifests/stat-band.manifest.json +1 -1
  99. package/dist/manifests/stepper.manifest.json +1 -1
  100. package/dist/manifests/switch.manifest.json +1 -1
  101. package/dist/manifests/table-card.manifest.json +1 -1
  102. package/dist/manifests/table-of-contents.manifest.json +1 -1
  103. package/dist/manifests/table.manifest.json +1 -1
  104. package/dist/manifests/tabs.manifest.json +1 -1
  105. package/dist/manifests/testimonial.manifest.json +1 -1
  106. package/dist/manifests/text.manifest.json +1 -1
  107. package/dist/manifests/textarea.manifest.json +1 -1
  108. package/dist/manifests/theme-toggle.manifest.json +1 -1
  109. package/dist/manifests/time-picker.manifest.json +49 -6
  110. package/dist/manifests/timeline.manifest.json +1 -1
  111. package/dist/manifests/toast.manifest.json +1 -1
  112. package/dist/manifests/tombstone-card.manifest.json +1 -1
  113. package/dist/manifests/tooltip.manifest.json +1 -1
  114. package/dist/src/components/time-picker/TimePicker.d.ts +31 -2
  115. package/dist/src/components/time-picker/TimePicker.js +244 -11
  116. package/dist/src/components/time-picker/TimePicker.js.map +1 -1
  117. package/dist/src/components/time-picker/TimePicker.mjs +244 -11
  118. package/dist/src/components/time-picker/TimePicker.mjs.map +1 -1
  119. package/package.json +4 -4
  120. package/src/components/time-picker/TimePicker.test.tsx +77 -0
  121. package/src/components/time-picker/TimePicker.tsx +315 -12
  122. package/src/manifests/accordion.manifest.json +1 -1
  123. package/src/manifests/alert.manifest.json +1 -1
  124. package/src/manifests/announcement-bar.manifest.json +1 -1
  125. package/src/manifests/app-shell.manifest.json +1 -1
  126. package/src/manifests/applied-filters.manifest.json +1 -1
  127. package/src/manifests/article-card.manifest.json +1 -1
  128. package/src/manifests/auth-layout.manifest.json +1 -1
  129. package/src/manifests/autocomplete.manifest.json +1 -1
  130. package/src/manifests/avatar.manifest.json +1 -1
  131. package/src/manifests/badge.manifest.json +1 -1
  132. package/src/manifests/block.manifest.json +1 -1
  133. package/src/manifests/bottom-nav.manifest.json +1 -1
  134. package/src/manifests/breadcrumb.manifest.json +1 -1
  135. package/src/manifests/button-group.manifest.json +1 -1
  136. package/src/manifests/button.manifest.json +1 -1
  137. package/src/manifests/calendar.manifest.json +1 -1
  138. package/src/manifests/card.manifest.json +1 -1
  139. package/src/manifests/checkbox.manifest.json +1 -1
  140. package/src/manifests/comparison-table.manifest.json +1 -1
  141. package/src/manifests/confirm-dialog.manifest.json +1 -1
  142. package/src/manifests/consent-banner.manifest.json +1 -1
  143. package/src/manifests/contact-strip.manifest.json +1 -1
  144. package/src/manifests/container.manifest.json +1 -1
  145. package/src/manifests/cover-image.manifest.json +1 -1
  146. package/src/manifests/cta-section.manifest.json +1 -1
  147. package/src/manifests/data-table.manifest.json +1 -1
  148. package/src/manifests/date-picker-popover.manifest.json +1 -1
  149. package/src/manifests/date-picker.manifest.json +1 -1
  150. package/src/manifests/date-range-picker.manifest.json +1 -1
  151. package/src/manifests/deal-card.manifest.json +1 -1
  152. package/src/manifests/dialog.manifest.json +1 -1
  153. package/src/manifests/document-card.manifest.json +1 -1
  154. package/src/manifests/drawer.manifest.json +1 -1
  155. package/src/manifests/empty-state.manifest.json +1 -1
  156. package/src/manifests/entity-card.manifest.json +1 -1
  157. package/src/manifests/feature-grid.manifest.json +1 -1
  158. package/src/manifests/feature-row.manifest.json +1 -1
  159. package/src/manifests/fieldset.manifest.json +1 -1
  160. package/src/manifests/figure.manifest.json +1 -1
  161. package/src/manifests/file-upload.manifest.json +1 -1
  162. package/src/manifests/filter-bar.manifest.json +1 -1
  163. package/src/manifests/filter-chips.manifest.json +1 -1
  164. package/src/manifests/filter-panel.manifest.json +1 -1
  165. package/src/manifests/flex.manifest.json +1 -1
  166. package/src/manifests/form-field.manifest.json +1 -1
  167. package/src/manifests/form-layout.manifest.json +1 -1
  168. package/src/manifests/form.manifest.json +1 -1
  169. package/src/manifests/grid.manifest.json +1 -1
  170. package/src/manifests/heading.manifest.json +1 -1
  171. package/src/manifests/hero.manifest.json +1 -1
  172. package/src/manifests/icon-button.manifest.json +1 -1
  173. package/src/manifests/icon-tile.manifest.json +1 -1
  174. package/src/manifests/icon.manifest.json +1 -1
  175. package/src/manifests/image.manifest.json +1 -1
  176. package/src/manifests/input-group.manifest.json +1 -1
  177. package/src/manifests/input.manifest.json +1 -1
  178. package/src/manifests/label.manifest.json +1 -1
  179. package/src/manifests/link-tabs.manifest.json +1 -1
  180. package/src/manifests/link.manifest.json +1 -1
  181. package/src/manifests/list-toolbar.manifest.json +1 -1
  182. package/src/manifests/list.manifest.json +1 -1
  183. package/src/manifests/load-more.manifest.json +1 -1
  184. package/src/manifests/logo-cloud.manifest.json +1 -1
  185. package/src/manifests/media-card.manifest.json +1 -1
  186. package/src/manifests/media.manifest.json +1 -1
  187. package/src/manifests/menu.manifest.json +1 -1
  188. package/src/manifests/metric-card.manifest.json +1 -1
  189. package/src/manifests/month-schedule.manifest.json +1 -1
  190. package/src/manifests/multi-select.manifest.json +1 -1
  191. package/src/manifests/newsletter.manifest.json +1 -1
  192. package/src/manifests/page-header.manifest.json +1 -1
  193. package/src/manifests/pagination.manifest.json +1 -1
  194. package/src/manifests/password-input.manifest.json +1 -1
  195. package/src/manifests/popover.manifest.json +1 -1
  196. package/src/manifests/process-steps.manifest.json +1 -1
  197. package/src/manifests/progress.manifest.json +1 -1
  198. package/src/manifests/prose.manifest.json +1 -1
  199. package/src/manifests/radio.manifest.json +1 -1
  200. package/src/manifests/range-slider.manifest.json +1 -1
  201. package/src/manifests/search.manifest.json +1 -1
  202. package/src/manifests/section-heading.manifest.json +1 -1
  203. package/src/manifests/section.manifest.json +1 -1
  204. package/src/manifests/segmented-control.manifest.json +1 -1
  205. package/src/manifests/select-menu.manifest.json +1 -1
  206. package/src/manifests/select.manifest.json +1 -1
  207. package/src/manifests/separator.manifest.json +1 -1
  208. package/src/manifests/site-footer.manifest.json +1 -1
  209. package/src/manifests/site-header.manifest.json +1 -1
  210. package/src/manifests/skeleton.manifest.json +1 -1
  211. package/src/manifests/social-links.manifest.json +1 -1
  212. package/src/manifests/spinner.manifest.json +1 -1
  213. package/src/manifests/stat-band.manifest.json +1 -1
  214. package/src/manifests/stepper.manifest.json +1 -1
  215. package/src/manifests/switch.manifest.json +1 -1
  216. package/src/manifests/table-card.manifest.json +1 -1
  217. package/src/manifests/table-of-contents.manifest.json +1 -1
  218. package/src/manifests/table.manifest.json +1 -1
  219. package/src/manifests/tabs.manifest.json +1 -1
  220. package/src/manifests/testimonial.manifest.json +1 -1
  221. package/src/manifests/text.manifest.json +1 -1
  222. package/src/manifests/textarea.manifest.json +1 -1
  223. package/src/manifests/theme-toggle.manifest.json +1 -1
  224. package/src/manifests/time-picker.manifest.json +49 -6
  225. package/src/manifests/timeline.manifest.json +1 -1
  226. package/src/manifests/toast.manifest.json +1 -1
  227. package/src/manifests/tombstone-card.manifest.json +1 -1
  228. package/src/manifests/tooltip.manifest.json +1 -1
package/dist/index.mjs CHANGED
@@ -6178,13 +6178,108 @@ DatePickerPopover.displayName = "DatePickerPopover";
6178
6178
  // src/components/time-picker/TimePicker.tsx
6179
6179
  import * as React66 from "react";
6180
6180
  import { jsx as jsx67, jsxs as jsxs47 } from "react/jsx-runtime";
6181
- var TimePicker = React66.forwardRef(function TimePicker2({ value, defaultValue, onValueChange, onChange, clearable = false, clearLabel = "Clear time", className, ...props }, ref) {
6181
+ var pad2 = (n) => String(n).padStart(2, "0");
6182
+ function toMinutes(value) {
6183
+ if (!value) return null;
6184
+ const match = /^(\d{1,2}):(\d{2})/.exec(value.trim());
6185
+ if (!match) return null;
6186
+ const minutes = Number(match[1]) * 60 + Number(match[2]);
6187
+ return minutes >= 0 && minutes <= 1439 ? minutes : null;
6188
+ }
6189
+ function fromMinutes(total) {
6190
+ return `${pad2(Math.floor(total / 60))}:${pad2(total % 60)}`;
6191
+ }
6192
+ function minuteChoices(step) {
6193
+ const out = [];
6194
+ for (let m = 0; m < 60; m += step) out.push(m);
6195
+ return out;
6196
+ }
6197
+ function allowedMinutes(hour24, minBound, maxBound, step) {
6198
+ const base = hour24 * 60;
6199
+ return minuteChoices(step).filter((m) => {
6200
+ const total = base + m;
6201
+ return total >= minBound && total <= maxBound;
6202
+ });
6203
+ }
6204
+ function hourHasValidMinute(hour24, minBound, maxBound, step) {
6205
+ return allowedMinutes(hour24, minBound, maxBound, step).length > 0;
6206
+ }
6207
+ function to12(hour24, minute) {
6208
+ const period = hour24 >= 12 ? "PM" : "AM";
6209
+ const hour12 = hour24 % 12 === 0 ? 12 : hour24 % 12;
6210
+ return { hour12, minute, period };
6211
+ }
6212
+ function from12(hour12, minute, period) {
6213
+ const hour24 = hour12 % 12 + (period === "PM" ? 12 : 0);
6214
+ return hour24 * 60 + minute;
6215
+ }
6216
+ function format12(value) {
6217
+ const total = toMinutes(value);
6218
+ if (total === null) return "";
6219
+ const { hour12, minute, period } = to12(Math.floor(total / 60), total % 60);
6220
+ return `${hour12}:${pad2(minute)} ${period}`;
6221
+ }
6222
+ var PERIODS = ["AM", "PM"];
6223
+ var TimePicker = React66.forwardRef(function TimePicker2({
6224
+ value,
6225
+ defaultValue,
6226
+ onValueChange,
6227
+ onChange,
6228
+ clearable = false,
6229
+ clearLabel = "Clear time",
6230
+ format = "24h",
6231
+ minuteStep = 1,
6232
+ min,
6233
+ max,
6234
+ placeholder,
6235
+ className,
6236
+ name,
6237
+ id,
6238
+ disabled,
6239
+ required,
6240
+ "aria-label": ariaLabel,
6241
+ "aria-describedby": ariaDescribedBy,
6242
+ "aria-invalid": ariaInvalid,
6243
+ ...props
6244
+ }, ref) {
6182
6245
  const [internal, setInternal] = React66.useState(defaultValue ?? "");
6183
6246
  const current = value ?? internal;
6247
+ const step = Math.min(60, Math.max(1, Math.floor(minuteStep)));
6184
6248
  const commit = (next) => {
6185
6249
  if (value === void 0) setInternal(next);
6186
6250
  onValueChange?.(next);
6187
6251
  };
6252
+ const clearButton = clearable && current ? /* @__PURE__ */ jsx67(
6253
+ "button",
6254
+ {
6255
+ type: "button",
6256
+ onClick: () => commit(""),
6257
+ "aria-label": clearLabel,
6258
+ className: "absolute right-1.5 top-1/2 z-10 inline-flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
6259
+ children: "\u2715"
6260
+ }
6261
+ ) : null;
6262
+ if (format === "12h") {
6263
+ return /* @__PURE__ */ jsx67(
6264
+ TimePicker12h,
6265
+ {
6266
+ current,
6267
+ commit,
6268
+ clearButton,
6269
+ step,
6270
+ min,
6271
+ max,
6272
+ placeholder: placeholder ?? "Pick a time",
6273
+ className,
6274
+ name,
6275
+ id,
6276
+ disabled,
6277
+ ariaLabel,
6278
+ ariaDescribedBy,
6279
+ ariaInvalid
6280
+ }
6281
+ );
6282
+ }
6188
6283
  return /* @__PURE__ */ jsxs47("div", { className: cn("relative flex items-center", className), children: [
6189
6284
  /* @__PURE__ */ jsx67(
6190
6285
  Input,
@@ -6192,6 +6287,17 @@ var TimePicker = React66.forwardRef(function TimePicker2({ value, defaultValue,
6192
6287
  ref,
6193
6288
  type: "time",
6194
6289
  value: current,
6290
+ min,
6291
+ max,
6292
+ step: step * 60,
6293
+ placeholder,
6294
+ name,
6295
+ id,
6296
+ disabled,
6297
+ required,
6298
+ "aria-label": ariaLabel,
6299
+ "aria-describedby": ariaDescribedBy,
6300
+ "aria-invalid": ariaInvalid,
6195
6301
  onChange: (event) => {
6196
6302
  commit(event.target.value);
6197
6303
  onChange?.(event);
@@ -6200,18 +6306,143 @@ var TimePicker = React66.forwardRef(function TimePicker2({ value, defaultValue,
6200
6306
  ...props
6201
6307
  }
6202
6308
  ),
6203
- clearable && current && /* @__PURE__ */ jsx67(
6204
- "button",
6205
- {
6206
- type: "button",
6207
- onClick: () => commit(""),
6208
- "aria-label": clearLabel,
6209
- className: "absolute right-1.5 inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
6210
- children: "\u2715"
6211
- }
6212
- )
6309
+ clearButton
6213
6310
  ] });
6214
6311
  });
6312
+ TimePicker.displayName = "TimePicker";
6313
+ function TimePicker12h({
6314
+ current,
6315
+ commit,
6316
+ clearButton,
6317
+ step,
6318
+ min,
6319
+ max,
6320
+ placeholder,
6321
+ className,
6322
+ name,
6323
+ id,
6324
+ disabled,
6325
+ ariaLabel,
6326
+ ariaDescribedBy,
6327
+ ariaInvalid
6328
+ }) {
6329
+ const [open, setOpen] = React66.useState(false);
6330
+ const total = toMinutes(current);
6331
+ const minBound = toMinutes(min) ?? 0;
6332
+ const maxBound = toMinutes(max) ?? 1439;
6333
+ const draft = React66.useMemo(() => {
6334
+ if (total !== null) {
6335
+ const hour242 = Math.floor(total / 60);
6336
+ const { hour12: hour122, minute: minute2, period: period2 } = to12(hour242, total % 60);
6337
+ return { hour12: hour122, minute: minute2, period: period2 };
6338
+ }
6339
+ const anchor = minBound;
6340
+ const hour24 = Math.floor(anchor / 60);
6341
+ const { hour12, minute, period } = to12(hour24, anchor % 60);
6342
+ return { hour12, minute, period };
6343
+ }, [total, minBound]);
6344
+ const minutesFor = (hour12, period) => {
6345
+ const hour24 = hour12 % 12 + (period === "PM" ? 12 : 0);
6346
+ return allowedMinutes(hour24, minBound, maxBound, step);
6347
+ };
6348
+ const hours12 = Array.from({ length: 12 }, (_, i) => i + 1);
6349
+ const hour24Of = (h12, p) => h12 % 12 + (p === "PM" ? 12 : 0);
6350
+ const isHourEnabled = (h12) => minutesFor(h12, draft.period).length > 0;
6351
+ const isPeriodEnabled = (p) => hours12.some((h) => hourHasValidMinute(hour24Of(h, p), minBound, maxBound, step));
6352
+ const minuteOptions = minutesFor(draft.hour12, draft.period);
6353
+ const validMinute = minuteOptions.includes(draft.minute) ? draft.minute : minuteOptions[0];
6354
+ const emit2 = (h12, minute, p) => {
6355
+ commit(fromMinutes(from12(h12, minute, p)));
6356
+ };
6357
+ const onHour = (h12) => {
6358
+ const options = minutesFor(h12, draft.period);
6359
+ if (options.length === 0) return;
6360
+ const minute = options.includes(draft.minute) ? draft.minute : options[0];
6361
+ emit2(h12, minute, draft.period);
6362
+ };
6363
+ const onPeriod = (p) => {
6364
+ let hour = draft.hour12;
6365
+ let options = minutesFor(hour, p);
6366
+ if (options.length === 0) {
6367
+ hour = hours12.find((h) => minutesFor(h, p).length > 0) ?? hour;
6368
+ options = minutesFor(hour, p);
6369
+ if (options.length === 0) return;
6370
+ }
6371
+ const minute = options.includes(draft.minute) ? draft.minute : options[0];
6372
+ emit2(hour, minute, p);
6373
+ };
6374
+ const label = total !== null ? format12(current) : placeholder;
6375
+ return /* @__PURE__ */ jsxs47("div", { className: cn("relative flex items-center", className), children: [
6376
+ /* @__PURE__ */ jsxs47(Popover, { open, onOpenChange: setOpen, children: [
6377
+ /* @__PURE__ */ jsxs47(
6378
+ PopoverTrigger,
6379
+ {
6380
+ id,
6381
+ type: "button",
6382
+ disabled,
6383
+ "aria-label": ariaLabel,
6384
+ "aria-describedby": ariaDescribedBy,
6385
+ "aria-invalid": ariaInvalid,
6386
+ className: cn(
6387
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-left text-sm",
6388
+ "hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
6389
+ total === null && "text-muted-foreground",
6390
+ clearButton && "pr-9"
6391
+ ),
6392
+ children: [
6393
+ /* @__PURE__ */ jsx67("span", { children: label }),
6394
+ /* @__PURE__ */ jsx67("span", { "aria-hidden": "true", className: "text-muted-foreground", children: "\u25BE" })
6395
+ ]
6396
+ }
6397
+ ),
6398
+ /* @__PURE__ */ jsx67(PopoverContent, { side: "bottom", align: "start", matchTriggerWidth: true, className: "p-3", children: /* @__PURE__ */ jsxs47("div", { className: "flex items-end gap-2", children: [
6399
+ /* @__PURE__ */ jsx67(
6400
+ Select,
6401
+ {
6402
+ label: "Hour",
6403
+ labelHidden: true,
6404
+ className: "flex-1",
6405
+ value: String(draft.hour12),
6406
+ onValueChange: (v) => onHour(Number(Array.isArray(v) ? v[0] : v)),
6407
+ options: hours12.map((h) => ({
6408
+ value: String(h),
6409
+ label: pad2(h),
6410
+ disabled: !isHourEnabled(h)
6411
+ }))
6412
+ }
6413
+ ),
6414
+ /* @__PURE__ */ jsx67(
6415
+ Select,
6416
+ {
6417
+ label: "Minute",
6418
+ labelHidden: true,
6419
+ className: "flex-1",
6420
+ value: String(validMinute),
6421
+ onValueChange: (v) => emit2(draft.hour12, Number(Array.isArray(v) ? v[0] : v), draft.period),
6422
+ options: minuteOptions.map((m) => ({ value: String(m), label: pad2(m) }))
6423
+ }
6424
+ ),
6425
+ /* @__PURE__ */ jsx67(
6426
+ Select,
6427
+ {
6428
+ label: "AM or PM",
6429
+ labelHidden: true,
6430
+ className: "flex-1",
6431
+ value: draft.period,
6432
+ onValueChange: (v) => onPeriod(Array.isArray(v) ? v[0] : v),
6433
+ options: PERIODS.map((p) => ({
6434
+ value: p,
6435
+ label: p,
6436
+ disabled: !isPeriodEnabled(p)
6437
+ }))
6438
+ }
6439
+ )
6440
+ ] }) })
6441
+ ] }),
6442
+ clearButton,
6443
+ name ? /* @__PURE__ */ jsx67("input", { type: "hidden", name, value: current }) : null
6444
+ ] });
6445
+ }
6215
6446
 
6216
6447
  // src/components/stepper/Stepper.tsx
6217
6448
  import * as React67 from "react";