@foldkit/ui 0.159.0 → 0.160.0-canary.1863b929fe7e

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.
@@ -35,6 +35,77 @@ export declare const Model: Schema.Struct<{
35
35
  readonly shortMonthNames: Schema.Tuple<readonly [Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String]>;
36
36
  readonly dayNames: Schema.Tuple<readonly [Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String]>;
37
37
  readonly shortDayNames: Schema.Tuple<readonly [Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String]>;
38
+ readonly longFormat: Schema.NonEmptyArray<import("foldkit/schema").TaggedUnion<{
39
+ readonly MonthName: {};
40
+ readonly ShortMonthName: {};
41
+ readonly MonthNumber: {};
42
+ readonly PaddedMonthNumber: {};
43
+ readonly DayNumber: {};
44
+ readonly PaddedDayNumber: {};
45
+ readonly DayName: {};
46
+ readonly ShortDayName: {};
47
+ readonly YearNumber: {};
48
+ readonly LiteralText: {
49
+ text: Schema.String;
50
+ };
51
+ }>>;
52
+ readonly shortFormat: Schema.NonEmptyArray<import("foldkit/schema").TaggedUnion<{
53
+ readonly MonthName: {};
54
+ readonly ShortMonthName: {};
55
+ readonly MonthNumber: {};
56
+ readonly PaddedMonthNumber: {};
57
+ readonly DayNumber: {};
58
+ readonly PaddedDayNumber: {};
59
+ readonly DayName: {};
60
+ readonly ShortDayName: {};
61
+ readonly YearNumber: {};
62
+ readonly LiteralText: {
63
+ text: Schema.String;
64
+ };
65
+ }>>;
66
+ readonly ariaLabelFormat: Schema.NonEmptyArray<import("foldkit/schema").TaggedUnion<{
67
+ readonly MonthName: {};
68
+ readonly ShortMonthName: {};
69
+ readonly MonthNumber: {};
70
+ readonly PaddedMonthNumber: {};
71
+ readonly DayNumber: {};
72
+ readonly PaddedDayNumber: {};
73
+ readonly DayName: {};
74
+ readonly ShortDayName: {};
75
+ readonly YearNumber: {};
76
+ readonly LiteralText: {
77
+ text: Schema.String;
78
+ };
79
+ }>>;
80
+ readonly monthYearFormat: Schema.NonEmptyArray<Schema.Union<readonly [Schema.TaggedStruct<"MonthName", {}> & ((value?: void | {
81
+ readonly _tag?: "MonthName";
82
+ } | undefined) => {
83
+ readonly _tag: "MonthName";
84
+ }), Schema.TaggedStruct<"ShortMonthName", {}> & ((value?: void | {
85
+ readonly _tag?: "ShortMonthName";
86
+ } | undefined) => {
87
+ readonly _tag: "ShortMonthName";
88
+ }), Schema.TaggedStruct<"MonthNumber", {}> & ((value?: void | {
89
+ readonly _tag?: "MonthNumber";
90
+ } | undefined) => {
91
+ readonly _tag: "MonthNumber";
92
+ }), Schema.TaggedStruct<"PaddedMonthNumber", {}> & ((value?: void | {
93
+ readonly _tag?: "PaddedMonthNumber";
94
+ } | undefined) => {
95
+ readonly _tag: "PaddedMonthNumber";
96
+ }), Schema.TaggedStruct<"YearNumber", {}> & ((value?: void | {
97
+ readonly _tag?: "YearNumber";
98
+ } | undefined) => {
99
+ readonly _tag: "YearNumber";
100
+ }), Schema.TaggedStruct<"LiteralText", {
101
+ readonly text: Schema.String;
102
+ }> & ((value: {
103
+ readonly _tag?: "LiteralText";
104
+ readonly text: string;
105
+ }) => {
106
+ readonly _tag: "LiteralText";
107
+ readonly text: string;
108
+ })]>>;
38
109
  }>;
39
110
  readonly maybeMinDate: Schema.Option<Schema.Struct<{
40
111
  readonly year: Schema.Int;
@@ -214,6 +285,162 @@ export declare const update: (model: Model, message: Message) => Readonly<{
214
285
  readonly shortMonthNames: readonly [string, string, string, string, string, string, string, string, string, string, string, string];
215
286
  readonly dayNames: readonly [string, string, string, string, string, string, string];
216
287
  readonly shortDayNames: readonly [string, string, string, string, string, string, string];
288
+ readonly longFormat: readonly [{
289
+ readonly _tag: "DayName";
290
+ } | {
291
+ readonly _tag: "DayNumber";
292
+ } | {
293
+ readonly _tag: "LiteralText";
294
+ readonly text: string;
295
+ } | {
296
+ readonly _tag: "MonthName";
297
+ } | {
298
+ readonly _tag: "MonthNumber";
299
+ } | {
300
+ readonly _tag: "PaddedDayNumber";
301
+ } | {
302
+ readonly _tag: "PaddedMonthNumber";
303
+ } | {
304
+ readonly _tag: "ShortDayName";
305
+ } | {
306
+ readonly _tag: "ShortMonthName";
307
+ } | {
308
+ readonly _tag: "YearNumber";
309
+ }, ...({
310
+ readonly _tag: "DayName";
311
+ } | {
312
+ readonly _tag: "DayNumber";
313
+ } | {
314
+ readonly _tag: "LiteralText";
315
+ readonly text: string;
316
+ } | {
317
+ readonly _tag: "MonthName";
318
+ } | {
319
+ readonly _tag: "MonthNumber";
320
+ } | {
321
+ readonly _tag: "PaddedDayNumber";
322
+ } | {
323
+ readonly _tag: "PaddedMonthNumber";
324
+ } | {
325
+ readonly _tag: "ShortDayName";
326
+ } | {
327
+ readonly _tag: "ShortMonthName";
328
+ } | {
329
+ readonly _tag: "YearNumber";
330
+ })[]];
331
+ readonly shortFormat: readonly [{
332
+ readonly _tag: "DayName";
333
+ } | {
334
+ readonly _tag: "DayNumber";
335
+ } | {
336
+ readonly _tag: "MonthName";
337
+ } | {
338
+ readonly _tag: "MonthNumber";
339
+ } | {
340
+ readonly _tag: "PaddedDayNumber";
341
+ } | {
342
+ readonly _tag: "PaddedMonthNumber";
343
+ } | {
344
+ readonly _tag: "ShortDayName";
345
+ } | {
346
+ readonly _tag: "ShortMonthName";
347
+ } | {
348
+ readonly _tag: "YearNumber";
349
+ } | {
350
+ readonly _tag: "LiteralText";
351
+ readonly text: string;
352
+ }, ...({
353
+ readonly _tag: "DayName";
354
+ } | {
355
+ readonly _tag: "DayNumber";
356
+ } | {
357
+ readonly _tag: "MonthName";
358
+ } | {
359
+ readonly _tag: "MonthNumber";
360
+ } | {
361
+ readonly _tag: "PaddedDayNumber";
362
+ } | {
363
+ readonly _tag: "PaddedMonthNumber";
364
+ } | {
365
+ readonly _tag: "ShortDayName";
366
+ } | {
367
+ readonly _tag: "ShortMonthName";
368
+ } | {
369
+ readonly _tag: "YearNumber";
370
+ } | {
371
+ readonly _tag: "LiteralText";
372
+ readonly text: string;
373
+ })[]];
374
+ readonly ariaLabelFormat: readonly [{
375
+ readonly _tag: "DayName";
376
+ } | {
377
+ readonly _tag: "DayNumber";
378
+ } | {
379
+ readonly _tag: "MonthName";
380
+ } | {
381
+ readonly _tag: "MonthNumber";
382
+ } | {
383
+ readonly _tag: "PaddedDayNumber";
384
+ } | {
385
+ readonly _tag: "PaddedMonthNumber";
386
+ } | {
387
+ readonly _tag: "ShortDayName";
388
+ } | {
389
+ readonly _tag: "ShortMonthName";
390
+ } | {
391
+ readonly _tag: "YearNumber";
392
+ } | {
393
+ readonly _tag: "LiteralText";
394
+ readonly text: string;
395
+ }, ...({
396
+ readonly _tag: "DayName";
397
+ } | {
398
+ readonly _tag: "DayNumber";
399
+ } | {
400
+ readonly _tag: "MonthName";
401
+ } | {
402
+ readonly _tag: "MonthNumber";
403
+ } | {
404
+ readonly _tag: "PaddedDayNumber";
405
+ } | {
406
+ readonly _tag: "PaddedMonthNumber";
407
+ } | {
408
+ readonly _tag: "ShortDayName";
409
+ } | {
410
+ readonly _tag: "ShortMonthName";
411
+ } | {
412
+ readonly _tag: "YearNumber";
413
+ } | {
414
+ readonly _tag: "LiteralText";
415
+ readonly text: string;
416
+ })[]];
417
+ readonly monthYearFormat: readonly [{
418
+ readonly _tag: "MonthName";
419
+ } | {
420
+ readonly _tag: "MonthNumber";
421
+ } | {
422
+ readonly _tag: "PaddedMonthNumber";
423
+ } | {
424
+ readonly _tag: "ShortMonthName";
425
+ } | {
426
+ readonly _tag: "YearNumber";
427
+ } | {
428
+ readonly _tag: "LiteralText";
429
+ readonly text: string;
430
+ }, ...({
431
+ readonly _tag: "MonthName";
432
+ } | {
433
+ readonly _tag: "MonthNumber";
434
+ } | {
435
+ readonly _tag: "PaddedMonthNumber";
436
+ } | {
437
+ readonly _tag: "ShortMonthName";
438
+ } | {
439
+ readonly _tag: "YearNumber";
440
+ } | {
441
+ readonly _tag: "LiteralText";
442
+ readonly text: string;
443
+ })[]];
217
444
  };
218
445
  readonly maybeMinDate: Option.Option<{
219
446
  readonly year: number;
@@ -408,7 +635,7 @@ export declare const triggerId: (id: string) => string;
408
635
  * The DatePicker emits a `SelectedDate({ date })` OutMessage when the
409
636
  * user commits a date. Handle it in the `foldOutMessage` of the
410
637
  * DatePicker's `Update.foldChild` config to lift the date into domain
411
- * state. */
638
+ * state. Calendar label fields are forwarded to the embedded Calendar. */
412
639
  export type ViewInputs = Readonly<{
413
640
  anchor: AnchorConfig;
414
641
  /** The selected date, read straight from the parent Model. The trigger
@@ -437,7 +664,7 @@ export type ViewInputs = Readonly<{
437
664
  panelAttributes?: ReadonlyArray<ChildAttribute>;
438
665
  backdropClassName?: string;
439
666
  backdropAttributes?: ReadonlyArray<ChildAttribute>;
440
- }>;
667
+ }> & UiCalendar.ViewLabels;
441
668
  /** Renders an accessible date picker: a trigger button that opens a popover
442
669
  * containing an accessible calendar grid. The date picker assembles the
443
670
  * embedded Calendar and Popover components into one flat API. Consumers
@@ -467,6 +694,162 @@ export declare const view: import("foldkit/submodel").View<{
467
694
  readonly shortMonthNames: readonly [string, string, string, string, string, string, string, string, string, string, string, string];
468
695
  readonly dayNames: readonly [string, string, string, string, string, string, string];
469
696
  readonly shortDayNames: readonly [string, string, string, string, string, string, string];
697
+ readonly longFormat: readonly [{
698
+ readonly _tag: "DayName";
699
+ } | {
700
+ readonly _tag: "DayNumber";
701
+ } | {
702
+ readonly _tag: "LiteralText";
703
+ readonly text: string;
704
+ } | {
705
+ readonly _tag: "MonthName";
706
+ } | {
707
+ readonly _tag: "MonthNumber";
708
+ } | {
709
+ readonly _tag: "PaddedDayNumber";
710
+ } | {
711
+ readonly _tag: "PaddedMonthNumber";
712
+ } | {
713
+ readonly _tag: "ShortDayName";
714
+ } | {
715
+ readonly _tag: "ShortMonthName";
716
+ } | {
717
+ readonly _tag: "YearNumber";
718
+ }, ...({
719
+ readonly _tag: "DayName";
720
+ } | {
721
+ readonly _tag: "DayNumber";
722
+ } | {
723
+ readonly _tag: "LiteralText";
724
+ readonly text: string;
725
+ } | {
726
+ readonly _tag: "MonthName";
727
+ } | {
728
+ readonly _tag: "MonthNumber";
729
+ } | {
730
+ readonly _tag: "PaddedDayNumber";
731
+ } | {
732
+ readonly _tag: "PaddedMonthNumber";
733
+ } | {
734
+ readonly _tag: "ShortDayName";
735
+ } | {
736
+ readonly _tag: "ShortMonthName";
737
+ } | {
738
+ readonly _tag: "YearNumber";
739
+ })[]];
740
+ readonly shortFormat: readonly [{
741
+ readonly _tag: "DayName";
742
+ } | {
743
+ readonly _tag: "DayNumber";
744
+ } | {
745
+ readonly _tag: "MonthName";
746
+ } | {
747
+ readonly _tag: "MonthNumber";
748
+ } | {
749
+ readonly _tag: "PaddedDayNumber";
750
+ } | {
751
+ readonly _tag: "PaddedMonthNumber";
752
+ } | {
753
+ readonly _tag: "ShortDayName";
754
+ } | {
755
+ readonly _tag: "ShortMonthName";
756
+ } | {
757
+ readonly _tag: "YearNumber";
758
+ } | {
759
+ readonly _tag: "LiteralText";
760
+ readonly text: string;
761
+ }, ...({
762
+ readonly _tag: "DayName";
763
+ } | {
764
+ readonly _tag: "DayNumber";
765
+ } | {
766
+ readonly _tag: "MonthName";
767
+ } | {
768
+ readonly _tag: "MonthNumber";
769
+ } | {
770
+ readonly _tag: "PaddedDayNumber";
771
+ } | {
772
+ readonly _tag: "PaddedMonthNumber";
773
+ } | {
774
+ readonly _tag: "ShortDayName";
775
+ } | {
776
+ readonly _tag: "ShortMonthName";
777
+ } | {
778
+ readonly _tag: "YearNumber";
779
+ } | {
780
+ readonly _tag: "LiteralText";
781
+ readonly text: string;
782
+ })[]];
783
+ readonly ariaLabelFormat: readonly [{
784
+ readonly _tag: "DayName";
785
+ } | {
786
+ readonly _tag: "DayNumber";
787
+ } | {
788
+ readonly _tag: "MonthName";
789
+ } | {
790
+ readonly _tag: "MonthNumber";
791
+ } | {
792
+ readonly _tag: "PaddedDayNumber";
793
+ } | {
794
+ readonly _tag: "PaddedMonthNumber";
795
+ } | {
796
+ readonly _tag: "ShortDayName";
797
+ } | {
798
+ readonly _tag: "ShortMonthName";
799
+ } | {
800
+ readonly _tag: "YearNumber";
801
+ } | {
802
+ readonly _tag: "LiteralText";
803
+ readonly text: string;
804
+ }, ...({
805
+ readonly _tag: "DayName";
806
+ } | {
807
+ readonly _tag: "DayNumber";
808
+ } | {
809
+ readonly _tag: "MonthName";
810
+ } | {
811
+ readonly _tag: "MonthNumber";
812
+ } | {
813
+ readonly _tag: "PaddedDayNumber";
814
+ } | {
815
+ readonly _tag: "PaddedMonthNumber";
816
+ } | {
817
+ readonly _tag: "ShortDayName";
818
+ } | {
819
+ readonly _tag: "ShortMonthName";
820
+ } | {
821
+ readonly _tag: "YearNumber";
822
+ } | {
823
+ readonly _tag: "LiteralText";
824
+ readonly text: string;
825
+ })[]];
826
+ readonly monthYearFormat: readonly [{
827
+ readonly _tag: "MonthName";
828
+ } | {
829
+ readonly _tag: "MonthNumber";
830
+ } | {
831
+ readonly _tag: "PaddedMonthNumber";
832
+ } | {
833
+ readonly _tag: "ShortMonthName";
834
+ } | {
835
+ readonly _tag: "YearNumber";
836
+ } | {
837
+ readonly _tag: "LiteralText";
838
+ readonly text: string;
839
+ }, ...({
840
+ readonly _tag: "MonthName";
841
+ } | {
842
+ readonly _tag: "MonthNumber";
843
+ } | {
844
+ readonly _tag: "PaddedMonthNumber";
845
+ } | {
846
+ readonly _tag: "ShortMonthName";
847
+ } | {
848
+ readonly _tag: "YearNumber";
849
+ } | {
850
+ readonly _tag: "LiteralText";
851
+ readonly text: string;
852
+ })[]];
470
853
  };
471
854
  readonly maybeMinDate: Option.Option<{
472
855
  readonly year: number;
@@ -597,34 +980,6 @@ export declare const view: import("foldkit/submodel").View<{
597
980
  readonly month: number;
598
981
  readonly day: number;
599
982
  };
600
- }, Readonly<{
601
- anchor: AnchorConfig;
602
- /** The selected date, read straight from the parent Model. The trigger
603
- * content, the calendar's selected-day marker, and the hidden form input all
604
- * derive from it. */
605
- maybeSelectedDate: Option.Option<CalendarDate>;
606
- /** Renders the trigger button's content (typically the formatted selected
607
- * date or a placeholder). Receives the current selection. */
608
- triggerContent: (maybeDate: Option.Option<CalendarDate>) => Html;
609
- /** Renders the calendar grid layout inside the popover panel. The
610
- * consumer lays out the attribute bundles exactly as they would for
611
- * an inline calendar. */
612
- toCalendarView: (attributes: UiCalendar.CalendarAttributes) => Html;
613
- isDisabled?: boolean;
614
- /** Name for the hidden form input. When provided, a hidden `<input>` is
615
- * rendered alongside the trigger so native form submission captures the
616
- * selected date as an ISO string (`YYYY-MM-DD`). */
617
- name?: string;
618
- className?: string;
619
- attributes?: ReadonlyArray<ChildAttribute>;
620
- triggerClassName?: string;
621
- triggerAttributes?: ReadonlyArray<ChildAttribute>;
622
- ariaLabel?: string;
623
- ariaLabelledBy?: string;
624
- panelClassName?: string;
625
- panelAttributes?: ReadonlyArray<ChildAttribute>;
626
- backdropClassName?: string;
627
- backdropAttributes?: ReadonlyArray<ChildAttribute>;
628
- }>>;
983
+ }, ViewInputs>;
629
984
  export {};
630
985
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/datePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAa,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC5D,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAGxD,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAExC,OAAO,KAAK,EAAE,YAAY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AAC,cAAc,CAAC,CAAA;CACnD,CAAC,GACA,UAAU,CAAC,UAAU,CAAA;AAEvB;;;;gEAIgE;AAChE,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiJhB,CAAA"}
@@ -208,11 +208,47 @@ export const view = defineView((model, viewInputs, h) => {
208
208
  }
209
209
  };
210
210
  const triggerLabelAttributes = resolveTriggerLabel();
211
+ const calendarViewLabels = {
212
+ ...(viewInputs.previousMonthLabel !== undefined && {
213
+ previousMonthLabel: viewInputs.previousMonthLabel,
214
+ }),
215
+ ...(viewInputs.nextMonthLabel !== undefined && {
216
+ nextMonthLabel: viewInputs.nextMonthLabel,
217
+ }),
218
+ ...(viewInputs.previousYearsPageLabel !== undefined && {
219
+ previousYearsPageLabel: viewInputs.previousYearsPageLabel,
220
+ }),
221
+ ...(viewInputs.nextYearsPageLabel !== undefined && {
222
+ nextYearsPageLabel: viewInputs.nextYearsPageLabel,
223
+ }),
224
+ ...(viewInputs.daysHeadingButtonLabel !== undefined && {
225
+ daysHeadingButtonLabel: viewInputs.daysHeadingButtonLabel,
226
+ }),
227
+ ...(viewInputs.monthsHeadingButtonLabel !== undefined && {
228
+ monthsHeadingButtonLabel: viewInputs.monthsHeadingButtonLabel,
229
+ }),
230
+ ...(viewInputs.toDaysGridLabel !== undefined && {
231
+ toDaysGridLabel: viewInputs.toDaysGridLabel,
232
+ }),
233
+ ...(viewInputs.toWeekLabel !== undefined && {
234
+ toWeekLabel: viewInputs.toWeekLabel,
235
+ }),
236
+ ...(viewInputs.toMonthsGridLabel !== undefined && {
237
+ toMonthsGridLabel: viewInputs.toMonthsGridLabel,
238
+ }),
239
+ ...(viewInputs.toYearsGridLabel !== undefined && {
240
+ toYearsGridLabel: viewInputs.toYearsGridLabel,
241
+ }),
242
+ };
211
243
  const calendarVNode = h.submodel({
212
244
  slotId: model.calendar.id,
213
245
  model: model.calendar,
214
246
  view: UiCalendar.view,
215
- viewInputs: { maybeSelectedDate, toView: toCalendarView },
247
+ viewInputs: {
248
+ maybeSelectedDate,
249
+ toView: toCalendarView,
250
+ ...calendarViewLabels,
251
+ },
216
252
  toParentMessage: message => __foldkitBrandViewResult((Message.GotCalendarMessage({ message })), "@foldkit/ui/datePicker/index.js#toParentMessage~3"),
217
253
  });
218
254
  const popoverVNode = h.submodel({
@@ -22,8 +22,21 @@ export type DisclosureAttributes<Message> = Readonly<{
22
22
  * disclosure opens and closes. The panel stays mounted while collapsed, so
23
23
  * the transition has something to animate from and to. Spread the `panel`
24
24
  * bundle onto the element you pass in, and render it unconditionally rather
25
- * than gating on `isOpen`. The collapsed content is marked `aria-hidden`. */
26
- animatePanel: (content: Html) => Html;
25
+ * than gating on `isOpen`.
26
+ *
27
+ * Without options the collapsed panel is fully hidden. With `peek`, it keeps
28
+ * that height as a visual preview of its content. In either case, the
29
+ * collapsed content is inert and hidden from assistive technology until the
30
+ * disclosure opens. */
31
+ animatePanel: (content: Html, options?: AnimatePanelOptions) => Html;
32
+ }>;
33
+ /** Options for {@link DisclosureAttributes.animatePanel}.
34
+ *
35
+ * - `peek`: a CSS height the collapsed panel keeps, such as `'7.5em'` for
36
+ * five lines at a 1.5 leading. The visible content is an inert preview;
37
+ * content becomes accessible and interactive when the disclosure opens. */
38
+ export type AnimatePanelOptions = Readonly<{
39
+ peek?: string;
27
40
  }>;
28
41
  /** Per-render view configuration for the stateless controlled {@link view}.
29
42
  * Generic over `Message` (the message `onToggle` dispatches).
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/disclosure/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAIhE;;;mCAGmC;AACnC,eAAO,MAAM,QAAQ,OAAQ,MAAM,KAAG,MAAwB,CAAA;AAM9D;;;;;;;;;sEASsE;AACtE,MAAM,MAAM,oBAAoB,CAAC,OAAO,IAAI,QAAQ,CAAC;IACnD,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACzC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACxC;;;;;kFAK8E;IAC9E,YAAY,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,IAAI,CAAA;CACtC,CAAC,CAAA;AAEF;;;;;;;;;;oBAUoB;AACpB,MAAM,MAAM,UAAU,CAAC,OAAO,IAAI,QAAQ,CAAC;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAA;IACtC,MAAM,EAAE,CAAC,UAAU,EAAE,oBAAoB,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;UAsBU;AACV,eAAO,MAAM,IAAI,GAAI,OAAO,UAClB,UAAU,CAAC,OAAO,CAAC,KACxB,WAAW,CAAC,OAAO,CAAC,KACtB,IAiFF,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/disclosure/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,I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open', '')] : []),
71
71
  ];
72
- const animatePanel = (content) => __foldkitBrandViewResult((h.div([
73
- h.Style({
74
- display: 'grid',
75
- gridTemplateRows: isOpen ? '1fr' : '0fr',
76
- transition: panelSizeTransition,
77
- overflow: 'hidden',
78
- }),
79
- ], [
80
- h.div([
81
- h.Style({ minHeight: '0px', overflow: 'hidden' }),
82
- ...(isOpen ? [] : [h.AriaHidden(true)]),
83
- ], [content]),
84
- ])), "@foldkit/ui/disclosure/index.js#animatePanel");
72
+ const animatePanel = (content, options = {}) => {
73
+ const collapsedMinHeight = options.peek ?? '0px';
74
+ return __foldkitBrandViewResult((h.div([
75
+ h.Style({
76
+ display: 'grid',
77
+ gridTemplateRows: isOpen ? '1fr' : '0fr',
78
+ transition: panelSizeTransition,
79
+ overflow: 'hidden',
80
+ }),
81
+ ], [
82
+ h.div([
83
+ h.Style({
84
+ minHeight: collapsedMinHeight,
85
+ overflow: 'hidden',
86
+ }),
87
+ ...(isOpen ? [] : [h.Inert(true), h.AriaHidden(true)]),
88
+ ], [content]),
89
+ ])), "@foldkit/ui/disclosure/index.js#animatePanel");
90
+ };
85
91
  return __foldkitBrandViewResult((toView({
86
92
  button: buttonAttributes,
87
93
  panel: panelAttributes,
@@ -1,3 +1,3 @@
1
1
  export { view, buttonId } from './index.js';
2
- export type { ViewConfig, DisclosureAttributes } from './index.js';
2
+ export type { ViewConfig, DisclosureAttributes, AnimatePanelOptions, } from './index.js';
3
3
  //# sourceMappingURL=public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/disclosure/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE3C,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/disclosure/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE3C,YAAY,EACV,UAAU,EACV,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,YAAY,CAAA"}
@@ -389,30 +389,23 @@ export const subscriptions = Subscription.make()(entry => (__foldkitBrandViewRes
389
389
  modelToDependencies: model => (__foldkitBrandViewResult(({
390
390
  dragActivity: keyboardDragActivityFromModel(model),
391
391
  }), "@foldkit/ui/dragAndDrop/index.js#modelToDependencies~3")),
392
- dependenciesToStream: ({ dragActivity }) => __foldkitBrandViewResult((Stream.when(Stream.fromEventListener(document, 'keydown').pipe(Stream.mapEffect((event) => __foldkitBrandViewResult((Effect.sync(() => {
393
- // NOTE: the draggable's OnKeyDownPreventDefault calls preventDefault on
394
- // the Space that activates keyboard drag. Skip it here so the same
395
- // keypress doesn't also confirm the drop in the same tick.
396
- if (event.defaultPrevented) {
397
- return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/dragAndDrop/index.js#anonymous~51");
398
- }
399
- if (event.key === 'Tab') {
400
- event.preventDefault();
401
- return __foldkitBrandViewResult((Option.some(Message.PressedArrowKey({
392
+ dependenciesToStream: ({ dragActivity }) => __foldkitBrandViewResult((Stream.when(Subscription.fromEventFilterMapPreventDefault({
393
+ target: document,
394
+ type: 'keydown',
395
+ toMessage: event => {
396
+ // NOTE: the draggable's OnKeyDownPreventDefault calls preventDefault on
397
+ // the Space that activates keyboard drag. Skip it here so the same
398
+ // keypress doesn't also confirm the drop in the same tick.
399
+ if (event.defaultPrevented) {
400
+ return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/dragAndDrop/index.js#toMessage");
401
+ }
402
+ return __foldkitBrandViewResult((Match.value(event.key).pipe(Match.withReturnType(), Match.when('Tab', () => __foldkitBrandViewResult((Option.some(Message.PressedArrowKey({
402
403
  direction: event.shiftKey
403
404
  ? 'PreviousContainer'
404
405
  : 'NextContainer',
405
- }))), "@foldkit/ui/dragAndDrop/index.js#anonymous~51");
406
- }
407
- if (event.key === ' ' || event.key === 'Enter') {
408
- event.preventDefault();
409
- return __foldkitBrandViewResult((Option.some(Message.ConfirmedKeyboardDrop())), "@foldkit/ui/dragAndDrop/index.js#anonymous~51");
410
- }
411
- return __foldkitBrandViewResult((Option.map(arrowKeyToDirection(event.key), direction => {
412
- event.preventDefault();
413
- return __foldkitBrandViewResult((Message.PressedArrowKey({ direction })), "@foldkit/ui/dragAndDrop/index.js#anonymous~52");
414
- })), "@foldkit/ui/dragAndDrop/index.js#anonymous~51");
415
- })), "@foldkit/ui/dragAndDrop/index.js#anonymous~50")), Stream.filter(Option.isSome), Stream.map(option => __foldkitBrandViewResult((option.value), "@foldkit/ui/dragAndDrop/index.js#anonymous~53"))), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/dragAndDrop/index.js#anonymous~54")))), "@foldkit/ui/dragAndDrop/index.js#dependenciesToStream~3"),
406
+ }))), "@foldkit/ui/dragAndDrop/index.js#anonymous~50")), Match.whenOr(' ', 'Enter', () => __foldkitBrandViewResult((Option.some(Message.ConfirmedKeyboardDrop())), "@foldkit/ui/dragAndDrop/index.js#anonymous~51")), Match.orElse(key => __foldkitBrandViewResult((Option.map(arrowKeyToDirection(key), direction => __foldkitBrandViewResult((Message.PressedArrowKey({ direction })), "@foldkit/ui/dragAndDrop/index.js#anonymous~53"))), "@foldkit/ui/dragAndDrop/index.js#anonymous~52")))), "@foldkit/ui/dragAndDrop/index.js#toMessage");
407
+ },
408
+ }), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/dragAndDrop/index.js#anonymous~54")))), "@foldkit/ui/dragAndDrop/index.js#dependenciesToStream~3"),
416
409
  }),
417
410
  autoScroll: entry({
418
411
  isDragging: Schema.Boolean,