@foldkit/ui 0.128.1 → 0.130.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 (58) hide show
  1. package/dist/anchor.js +12 -11
  2. package/dist/animation/index.js +11 -10
  3. package/dist/animation/schema.js +3 -2
  4. package/dist/animation/update.js +26 -25
  5. package/dist/button/index.js +3 -2
  6. package/dist/calendar/index.js +159 -158
  7. package/dist/checkbox/index.js +9 -8
  8. package/dist/combobox/multi.d.ts +1 -0
  9. package/dist/combobox/multi.d.ts.map +1 -1
  10. package/dist/combobox/multi.js +20 -19
  11. package/dist/combobox/shared.d.ts +1 -0
  12. package/dist/combobox/shared.d.ts.map +1 -1
  13. package/dist/combobox/shared.js +169 -168
  14. package/dist/combobox/single.d.ts +1 -0
  15. package/dist/combobox/single.d.ts.map +1 -1
  16. package/dist/combobox/single.js +23 -22
  17. package/dist/datePicker/index.js +69 -68
  18. package/dist/dialog/index.js +52 -51
  19. package/dist/disclosure/index.js +11 -10
  20. package/dist/dragAndDrop/index.js +122 -121
  21. package/dist/fieldset/index.js +5 -4
  22. package/dist/fileDrop/index.js +23 -22
  23. package/dist/group.js +7 -6
  24. package/dist/input/index.js +4 -3
  25. package/dist/internal/optionExtensions.js +2 -1
  26. package/dist/internal/selectors.js +2 -1
  27. package/dist/keyboard.js +5 -4
  28. package/dist/listbox/multi.d.ts +1 -0
  29. package/dist/listbox/multi.d.ts.map +1 -1
  30. package/dist/listbox/multi.js +12 -11
  31. package/dist/listbox/shared.d.ts +1 -0
  32. package/dist/listbox/shared.d.ts.map +1 -1
  33. package/dist/listbox/shared.js +171 -170
  34. package/dist/listbox/single.d.ts +1 -0
  35. package/dist/listbox/single.d.ts.map +1 -1
  36. package/dist/listbox/single.js +13 -12
  37. package/dist/menu/index.js +167 -166
  38. package/dist/nav/index.js +7 -6
  39. package/dist/popover/index.js +87 -86
  40. package/dist/radioGroup/index.js +23 -22
  41. package/dist/select/index.js +4 -3
  42. package/dist/slider/index.js +72 -71
  43. package/dist/switch/index.js +6 -5
  44. package/dist/tabs/index.js +34 -33
  45. package/dist/test/apps/disabledButton.js +17 -16
  46. package/dist/textarea/index.js +4 -3
  47. package/dist/toast/index.d.ts +4 -0
  48. package/dist/toast/index.d.ts.map +1 -1
  49. package/dist/toast/index.js +19 -18
  50. package/dist/toast/schema.js +10 -9
  51. package/dist/toast/test.js +2 -1
  52. package/dist/toast/update.d.ts +4 -0
  53. package/dist/toast/update.d.ts.map +1 -1
  54. package/dist/toast/update.js +79 -78
  55. package/dist/tooltip/index.js +59 -58
  56. package/dist/typeahead.js +6 -5
  57. package/dist/virtualList/index.js +66 -65
  58. package/package.json +4 -3
@@ -73,6 +73,7 @@ export declare const update: (model: S.Struct.ReadonlySide<{
73
73
  }, "Type">, readonly Readonly<{
74
74
  name: string;
75
75
  args?: Record<string, unknown>;
76
+ key?: string;
76
77
  effect: import("effect/Effect").Effect<S.Struct.ReadonlySide<{
77
78
  readonly _tag: S.tag<"CompletedLockScroll">;
78
79
  }, "Type"> | S.Struct.ReadonlySide<{
@@ -1 +1 @@
1
- {"version":3,"file":"single.d.ts","sourceRoot":"","sources":["../../src/combobox/single.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,IAAI,CAAC,EAAQ,MAAM,QAAQ,CAAA;AACzD,OAAO,KAAK,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE/C,OAAO,EAAE,KAAK,IAAI,IAAI,YAAY,EAAc,MAAM,kBAAkB,CAAA;AAExE,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,oBAAoB,EAGzB,KAAK,OAAO,EAEZ,KAAK,UAAU,EAOhB,MAAM,aAAa,CAAA;AAIpB,0OAA0O;AAC1O,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;EAEhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,oOAAoO;AACpO,MAAM,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CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAChC,CAAA;IACD,UAAU,EAAE,CACV,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,KAChB,SAAS,CACZ,KAAK,EACL,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EACvC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAChC,CAAA;IACD,IAAI,EAAE,CACJ,KAAK,EAAE,KAAK,KACT,SAAS,CACZ,KAAK,EACL,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EACvC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAChC,CAAA;IACD,KAAK,EAAE,CACL,KAAK,EAAE,KAAK,EACZ,iBAAiB,EAAE,MAAM,KACtB,SAAS,CACZ,KAAK,EACL,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EACvC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAChC,CAAA;CACF,CA6BA,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
1
2
  import { Array, Option, Schema as S, pipe } from 'effect';
2
3
  import { evo } from 'foldkit/struct';
3
4
  import { defineView } from 'foldkit/submodel';
@@ -8,52 +9,52 @@ export const Model = S.Struct({
8
9
  ...BaseModel.fields,
9
10
  });
10
11
  /** Creates an initial single-select combobox model from a config. Defaults to closed with no active item and an empty input. */
11
- export const init = (config) => baseInit(config);
12
+ export const init = (config) => __foldkitBrandViewResult((baseInit(config)), "@foldkit/ui/combobox/single.js#init");
12
13
  // UPDATE
13
14
  /** Processes a combobox message and returns the next model, commands, and optional OutMessage. Closes the combobox on selection (single-select behavior); emits `Selected({ value })` for the parent to store, and `ClearedSelection` when a nullable combobox closes with an empty input. */
14
15
  export const update = makeUpdate({
15
16
  handleClose: (model, restingInputValue) => {
16
17
  if (model.nullable && model.inputValue === '') {
17
- return [
18
- evo(closedBaseModel(model), { inputValue: () => '' }),
18
+ return __foldkitBrandViewResult(([
19
+ evo(closedBaseModel(model), { inputValue: () => __foldkitBrandViewResult((''), "@foldkit/ui/combobox/single.js#inputValue") }),
19
20
  Option.some(ClearedSelection()),
20
- ];
21
+ ]), "@foldkit/ui/combobox/single.js#handleClose");
21
22
  }
22
- return [
23
- evo(closedBaseModel(model), { inputValue: () => restingInputValue }),
23
+ return __foldkitBrandViewResult(([
24
+ evo(closedBaseModel(model), { inputValue: () => __foldkitBrandViewResult((restingInputValue), "@foldkit/ui/combobox/single.js#inputValue~2") }),
24
25
  Option.none(),
25
- ];
26
+ ]), "@foldkit/ui/combobox/single.js#handleClose");
26
27
  },
27
28
  handleSelectedItem: (model, item, displayText, wasSelected, context) => {
28
29
  const nullableDeselect = model.nullable && wasSelected;
29
- return [
30
+ return __foldkitBrandViewResult(([
30
31
  evo(closedBaseModel(model), {
31
- inputValue: () => (nullableDeselect ? '' : displayText),
32
+ inputValue: () => (__foldkitBrandViewResult((nullableDeselect ? '' : displayText), "@foldkit/ui/combobox/single.js#inputValue~3")),
32
33
  }),
33
34
  pipe(Array.getSomes([context.maybeUnlockScroll, context.maybeRestoreInert]), Array.prepend(context.focusInput)),
34
35
  Option.some(SharedSelected({ value: item })),
35
- ];
36
+ ]), "@foldkit/ui/combobox/single.js#handleSelectedItem");
36
37
  },
37
- handleImmediateActivation: (model, item) => [
38
+ handleImmediateActivation: (model, item) => __foldkitBrandViewResult(([
38
39
  model,
39
40
  Option.some(SharedSelected({ value: item })),
40
- ],
41
+ ]), "@foldkit/ui/combobox/single.js#handleImmediateActivation"),
41
42
  });
42
43
  /** Programmatically opens the combobox, updating the model and returning
43
44
  * focus and modal commands. Use this in domain-event handlers to open the combobox. */
44
- export const open = (model) => update(model, Opened({ maybeActiveItemIndex: Option.none() }));
45
+ export const open = (model) => __foldkitBrandViewResult((update(model, Opened({ maybeActiveItemIndex: Option.none() }))), "@foldkit/ui/combobox/single.js#open");
45
46
  /** Programmatically closes the combobox, updating the model and returning
46
47
  * focus and modal commands. `restingInputValue` is the text the input
47
48
  * returns to (the parent-owned selection's display text, or empty). Use
48
49
  * this in domain-event handlers to close the combobox. */
49
- export const close = (model, restingInputValue) => update(model, Closed({ restingInputValue }));
50
+ export const close = (model, restingInputValue) => __foldkitBrandViewResult((update(model, Closed({ restingInputValue }))), "@foldkit/ui/combobox/single.js#close");
50
51
  /** Programmatically selects an item in the single-select combobox, closing
51
52
  * the combobox and emitting `Selected({ value })`. The Submodel treats the
52
53
  * select as fresh (`wasSelected: false`), so the input rests on
53
54
  * `displayText`; what the selection becomes is the parent's fold to decide,
54
55
  * and a parent that toggles on its own state will still deselect an
55
56
  * already-selected value. */
56
- export const selectItem = (model, item, displayText) => update(model, SelectedItem({ item, displayText, wasSelected: false }));
57
+ export const selectItem = (model, item, displayText) => __foldkitBrandViewResult((update(model, SelectedItem({ item, displayText, wasSelected: false }))), "@foldkit/ui/combobox/single.js#selectItem");
57
58
  const internalView = makeView({ ariaMultiSelectable: false });
58
59
  /** Pairs the single-select combobox's `view` and `update` (and programmatic
59
60
  * helpers) behind a single Item-typed entry point. See `Listbox.create`
@@ -65,15 +66,15 @@ export const create = () => {
65
66
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
66
67
  const typedUpdate = update;
67
68
  const arrayBasedView = internalView();
68
- const view = defineView((model, { maybeSelectedValue, ...baseInputs }) => arrayBasedView(model, {
69
+ const view = defineView((model, { maybeSelectedValue, ...baseInputs }) => __foldkitBrandViewResult((arrayBasedView(model, {
69
70
  ...baseInputs,
70
71
  selectedValues: Option.toArray(maybeSelectedValue),
71
- }));
72
- return {
72
+ })), "@foldkit/ui/combobox/single.js#anonymous"));
73
+ return __foldkitBrandViewResult(({
73
74
  view,
74
75
  update: typedUpdate,
75
- selectItem: (model, item, displayText) => typedUpdate(model, SelectedItem({ item, displayText, wasSelected: false })),
76
- open: model => typedUpdate(model, Opened({ maybeActiveItemIndex: Option.none() })),
77
- close: (model, restingInputValue) => typedUpdate(model, Closed({ restingInputValue })),
78
- };
76
+ selectItem: (model, item, displayText) => __foldkitBrandViewResult((typedUpdate(model, SelectedItem({ item, displayText, wasSelected: false }))), "@foldkit/ui/combobox/single.js#selectItem~2"),
77
+ open: model => __foldkitBrandViewResult((typedUpdate(model, Opened({ maybeActiveItemIndex: Option.none() }))), "@foldkit/ui/combobox/single.js#open~2"),
78
+ close: (model, restingInputValue) => __foldkitBrandViewResult((typedUpdate(model, Closed({ restingInputValue }))), "@foldkit/ui/combobox/single.js#close~2"),
79
+ }), "@foldkit/ui/combobox/single.js#create");
79
80
  };
@@ -1,3 +1,4 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
1
2
  import { Function, Match as M, Option, Predicate, Schema as S } from 'effect';
2
3
  import * as Calendar from 'foldkit/calendar';
3
4
  import * as Command from 'foldkit/command';
@@ -74,7 +75,7 @@ export const OutMessage = S.Union([ChangedViewMonth, SelectedDate, ClearedDate])
74
75
  * with derived ids so their DOM elements stay addressable. The popover is
75
76
  * opened in `contentFocus` mode so focus lands on the calendar grid instead of
76
77
  * the panel. */
77
- export const init = (config) => ({
78
+ export const init = (config) => (__foldkitBrandViewResult(({
78
79
  id: config.id,
79
80
  calendar: UiCalendar.init({
80
81
  id: `${config.id}-calendar`,
@@ -97,120 +98,120 @@ export const init = (config) => ({
97
98
  contentFocus: true,
98
99
  ...(config.isAnimated !== undefined && { isAnimated: config.isAnimated }),
99
100
  }),
100
- });
101
+ }), "@foldkit/ui/datePicker/index.js#init"));
101
102
  const withUpdateReturn = M.withReturnType();
102
- const mapCalendarCommands = (commands) => Command.mapMessages(commands, message => GotCalendarMessage({ message }));
103
- const mapPopoverCommands = (commands) => Command.mapMessages(commands, message => GotPopoverMessage({ message }));
103
+ const mapCalendarCommands = (commands) => __foldkitBrandViewResult((Command.mapMessages(commands, message => __foldkitBrandViewResult((GotCalendarMessage({ message })), "@foldkit/ui/datePicker/index.js#anonymous"))), "@foldkit/ui/datePicker/index.js#mapCalendarCommands");
104
+ const mapPopoverCommands = (commands) => __foldkitBrandViewResult((Command.mapMessages(commands, message => __foldkitBrandViewResult((GotPopoverMessage({ message })), "@foldkit/ui/datePicker/index.js#anonymous~2"))), "@foldkit/ui/datePicker/index.js#mapPopoverCommands");
104
105
  const delegateToCalendar = (model, calendarMessage) => {
105
106
  const [nextCalendar, calendarCommands, maybeCalendarOutMessage] = UiCalendar.update(model.calendar, calendarMessage);
106
- const modelWithCalendar = evo(model, { calendar: () => nextCalendar });
107
- return Option.match(maybeCalendarOutMessage, {
108
- onNone: () => [
107
+ const modelWithCalendar = evo(model, { calendar: () => __foldkitBrandViewResult((nextCalendar), "@foldkit/ui/datePicker/index.js#calendar") });
108
+ return __foldkitBrandViewResult((Option.match(maybeCalendarOutMessage, {
109
+ onNone: () => __foldkitBrandViewResult(([
109
110
  modelWithCalendar,
110
111
  mapCalendarCommands(calendarCommands),
111
112
  Option.none(),
112
- ],
113
+ ]), "@foldkit/ui/datePicker/index.js#onNone"),
113
114
  onSome: M.type().pipe(M.withReturnType(), M.tagsExhaustive({
114
- ChangedViewMonth: ({ year, month }) => [
115
+ ChangedViewMonth: ({ year, month }) => __foldkitBrandViewResult(([
115
116
  modelWithCalendar,
116
117
  mapCalendarCommands(calendarCommands),
117
118
  Option.some(ChangedViewMonth({ year, month })),
118
- ],
119
+ ]), "@foldkit/ui/datePicker/index.js#ChangedViewMonth"),
119
120
  SelectedDate: ({ date }) => {
120
121
  const [nextPopover, popoverCommands] = Popover.close(model.popover);
121
- return [
122
+ return __foldkitBrandViewResult(([
122
123
  evo(modelWithCalendar, {
123
- popover: () => nextPopover,
124
+ popover: () => __foldkitBrandViewResult((nextPopover), "@foldkit/ui/datePicker/index.js#popover"),
124
125
  }),
125
126
  [
126
127
  ...mapCalendarCommands(calendarCommands),
127
128
  ...mapPopoverCommands(popoverCommands),
128
129
  ],
129
130
  Option.some(SelectedDate({ date })),
130
- ];
131
+ ]), "@foldkit/ui/datePicker/index.js#SelectedDate");
131
132
  },
132
133
  })),
133
- });
134
+ })), "@foldkit/ui/datePicker/index.js#delegateToCalendar");
134
135
  };
135
136
  const delegateToPopover = (model, popoverMessage) => {
136
137
  const [nextPopover, popoverCommands, maybePopoverOutMessage] = Popover.update(model.popover, popoverMessage);
137
- const modelWithPopover = evo(model, { popover: () => nextPopover });
138
- return Option.match(maybePopoverOutMessage, {
139
- onNone: () => [
138
+ const modelWithPopover = evo(model, { popover: () => __foldkitBrandViewResult((nextPopover), "@foldkit/ui/datePicker/index.js#popover~2") });
139
+ return __foldkitBrandViewResult((Option.match(maybePopoverOutMessage, {
140
+ onNone: () => __foldkitBrandViewResult(([
140
141
  modelWithPopover,
141
142
  mapPopoverCommands(popoverCommands),
142
143
  Option.none(),
143
- ],
144
- onSome: () => [
144
+ ]), "@foldkit/ui/datePicker/index.js#onNone~2"),
145
+ onSome: () => __foldkitBrandViewResult(([
145
146
  evo(modelWithPopover, {
146
- calendar: () => UiCalendar.dropToDays(modelWithPopover.calendar),
147
+ calendar: () => __foldkitBrandViewResult((UiCalendar.dropToDays(modelWithPopover.calendar)), "@foldkit/ui/datePicker/index.js#calendar~2"),
147
148
  }),
148
149
  mapPopoverCommands(popoverCommands),
149
150
  Option.none(),
150
- ],
151
- });
151
+ ]), "@foldkit/ui/datePicker/index.js#onSome"),
152
+ })), "@foldkit/ui/datePicker/index.js#delegateToPopover");
152
153
  };
153
154
  /** Processes a date picker message and returns the next model, commands, and
154
155
  * optional OutMessage. */
155
- export const update = (model, message) => M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
156
- GotCalendarMessage: ({ message: calendarMessage }) => delegateToCalendar(model, calendarMessage),
157
- GotPopoverMessage: ({ message: popoverMessage }) => delegateToPopover(model, popoverMessage),
156
+ export const update = (model, message) => __foldkitBrandViewResult((M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
157
+ GotCalendarMessage: ({ message: calendarMessage }) => __foldkitBrandViewResult((delegateToCalendar(model, calendarMessage)), "@foldkit/ui/datePicker/index.js#GotCalendarMessage"),
158
+ GotPopoverMessage: ({ message: popoverMessage }) => __foldkitBrandViewResult((delegateToPopover(model, popoverMessage)), "@foldkit/ui/datePicker/index.js#GotPopoverMessage"),
158
159
  Opened: () => {
159
160
  const [nextPopover, popoverCommands] = Popover.open(model.popover);
160
- return [
161
+ return __foldkitBrandViewResult(([
161
162
  evo(model, {
162
- popover: () => nextPopover,
163
- calendar: () => UiCalendar.dropToDays(model.calendar),
163
+ popover: () => __foldkitBrandViewResult((nextPopover), "@foldkit/ui/datePicker/index.js#popover~3"),
164
+ calendar: () => __foldkitBrandViewResult((UiCalendar.dropToDays(model.calendar)), "@foldkit/ui/datePicker/index.js#calendar~3"),
164
165
  }),
165
166
  mapPopoverCommands(popoverCommands),
166
167
  Option.none(),
167
- ];
168
+ ]), "@foldkit/ui/datePicker/index.js#Opened");
168
169
  },
169
170
  Closed: () => {
170
171
  const [nextPopover, popoverCommands] = Popover.close(model.popover);
171
- return [
172
+ return __foldkitBrandViewResult(([
172
173
  evo(model, {
173
- popover: () => nextPopover,
174
- calendar: () => UiCalendar.dropToDays(model.calendar),
174
+ popover: () => __foldkitBrandViewResult((nextPopover), "@foldkit/ui/datePicker/index.js#popover~4"),
175
+ calendar: () => __foldkitBrandViewResult((UiCalendar.dropToDays(model.calendar)), "@foldkit/ui/datePicker/index.js#calendar~4"),
175
176
  }),
176
177
  mapPopoverCommands(popoverCommands),
177
178
  Option.none(),
178
- ];
179
+ ]), "@foldkit/ui/datePicker/index.js#Closed");
179
180
  },
180
181
  RequestedSelectDate: ({ date }) => {
181
182
  const [nextCalendar, calendarCommands] = UiCalendar.selectDate(model.calendar, date);
182
183
  const [nextPopover, popoverCommands] = Popover.close(model.popover);
183
- return [
184
+ return __foldkitBrandViewResult(([
184
185
  evo(model, {
185
- calendar: () => nextCalendar,
186
- popover: () => nextPopover,
186
+ calendar: () => __foldkitBrandViewResult((nextCalendar), "@foldkit/ui/datePicker/index.js#calendar~5"),
187
+ popover: () => __foldkitBrandViewResult((nextPopover), "@foldkit/ui/datePicker/index.js#popover~5"),
187
188
  }),
188
189
  [
189
190
  ...mapCalendarCommands(calendarCommands),
190
191
  ...mapPopoverCommands(popoverCommands),
191
192
  ],
192
193
  Option.some(SelectedDate({ date })),
193
- ];
194
+ ]), "@foldkit/ui/datePicker/index.js#RequestedSelectDate");
194
195
  },
195
- Cleared: () => [model, [], Option.some(ClearedDate())],
196
- }));
196
+ Cleared: () => __foldkitBrandViewResult(([model, [], Option.some(ClearedDate())]), "@foldkit/ui/datePicker/index.js#Cleared"),
197
+ }))), "@foldkit/ui/datePicker/index.js#update");
197
198
  /** Programmatically opens the date picker, updating the model and returning
198
199
  * focus and popover commands. Use this in domain-event handlers. */
199
- export const open = (model) => update(model, Opened());
200
+ export const open = (model) => __foldkitBrandViewResult((update(model, Opened())), "@foldkit/ui/datePicker/index.js#open");
200
201
  /** Programmatically closes the date picker. Use this in domain-event handlers. */
201
- export const close = (model) => update(model, Closed());
202
+ export const close = (model) => __foldkitBrandViewResult((update(model, Closed())), "@foldkit/ui/datePicker/index.js#close");
202
203
  /** Programmatically selects a date, committing it and closing the popover. Emits a `SelectedDate` OutMessage just like a user-initiated selection. */
203
- export const selectDate = (model, date) => update(model, RequestedSelectDate({ date }));
204
+ export const selectDate = (model, date) => __foldkitBrandViewResult((update(model, RequestedSelectDate({ date }))), "@foldkit/ui/datePicker/index.js#selectDate");
204
205
  /** Programmatically clears the selected date. */
205
- export const clear = (model) => update(model, Cleared());
206
+ export const clear = (model) => __foldkitBrandViewResult((update(model, Cleared())), "@foldkit/ui/datePicker/index.js#clear");
206
207
  /** Moves the embedded calendar's view and cursor to a date without changing
207
208
  * the selection (which the parent owns). Use it to navigate the picker onto a
208
209
  * known date, for example after the parent sets its value externally (a URL
209
210
  * parameter, a saved draft) so opening the picker shows that month. Returns
210
211
  * the model directly because it produces no commands and no OutMessage. */
211
- export const focusDate = Function.dual(2, (model, date) => evo(model, {
212
- calendar: () => UiCalendar.focusDate(model.calendar, date),
213
- }));
212
+ export const focusDate = Function.dual(2, (model, date) => __foldkitBrandViewResult((evo(model, {
213
+ calendar: () => __foldkitBrandViewResult((UiCalendar.focusDate(model.calendar, date)), "@foldkit/ui/datePicker/index.js#calendar~6"),
214
+ })), "@foldkit/ui/datePicker/index.js#anonymous~3"));
214
215
  /** Reflects the minimum selectable date onto the embedded calendar. Pass
215
216
  * `Option.none()` to remove the minimum. Use this when the minimum derives
216
217
  * from other Model state (e.g. a start date field whose current selection
@@ -219,34 +220,34 @@ export const focusDate = Function.dual(2, (model, date) => evo(model, {
219
220
  * Does NOT reconcile the current selection. If a previously-selected date
220
221
  * is now below the new minimum, it remains selected. Callers should `clear`
221
222
  * or reassign the selection explicitly if their domain requires it. */
222
- export const reflectMinDate = Function.dual(2, (model, maybeMinDate) => evo(model, {
223
- calendar: () => UiCalendar.reflectMinDate(model.calendar, maybeMinDate),
224
- }));
223
+ export const reflectMinDate = Function.dual(2, (model, maybeMinDate) => __foldkitBrandViewResult((evo(model, {
224
+ calendar: () => __foldkitBrandViewResult((UiCalendar.reflectMinDate(model.calendar, maybeMinDate)), "@foldkit/ui/datePicker/index.js#calendar~7"),
225
+ })), "@foldkit/ui/datePicker/index.js#anonymous~4"));
225
226
  /** Reflects the maximum selectable date onto the embedded calendar. Pass
226
227
  * `Option.none()` to remove the maximum. Does NOT reconcile the current
227
228
  * selection. */
228
- export const reflectMaxDate = Function.dual(2, (model, maybeMaxDate) => evo(model, {
229
- calendar: () => UiCalendar.reflectMaxDate(model.calendar, maybeMaxDate),
230
- }));
229
+ export const reflectMaxDate = Function.dual(2, (model, maybeMaxDate) => __foldkitBrandViewResult((evo(model, {
230
+ calendar: () => __foldkitBrandViewResult((UiCalendar.reflectMaxDate(model.calendar, maybeMaxDate)), "@foldkit/ui/datePicker/index.js#calendar~8"),
231
+ })), "@foldkit/ui/datePicker/index.js#anonymous~5"));
231
232
  /** Reflects the list of individually-disabled dates onto the embedded
232
233
  * calendar. Pass an empty array to clear. Does NOT reconcile the current
233
234
  * selection. */
234
- export const reflectDisabledDates = Function.dual(2, (model, disabledDates) => evo(model, {
235
- calendar: () => UiCalendar.reflectDisabledDates(model.calendar, disabledDates),
236
- }));
235
+ export const reflectDisabledDates = Function.dual(2, (model, disabledDates) => __foldkitBrandViewResult((evo(model, {
236
+ calendar: () => __foldkitBrandViewResult((UiCalendar.reflectDisabledDates(model.calendar, disabledDates)), "@foldkit/ui/datePicker/index.js#calendar~9"),
237
+ })), "@foldkit/ui/datePicker/index.js#anonymous~6"));
237
238
  /** Reflects the days of the week that are disabled onto the embedded calendar
238
239
  * (e.g. weekends). Pass an empty array to clear. Does NOT reconcile the
239
240
  * current selection. */
240
- export const reflectDisabledDaysOfWeek = Function.dual(2, (model, disabledDaysOfWeek) => evo(model, {
241
- calendar: () => UiCalendar.reflectDisabledDaysOfWeek(model.calendar, disabledDaysOfWeek),
242
- }));
241
+ export const reflectDisabledDaysOfWeek = Function.dual(2, (model, disabledDaysOfWeek) => __foldkitBrandViewResult((evo(model, {
242
+ calendar: () => __foldkitBrandViewResult((UiCalendar.reflectDisabledDaysOfWeek(model.calendar, disabledDaysOfWeek)), "@foldkit/ui/datePicker/index.js#calendar~10"),
243
+ })), "@foldkit/ui/datePicker/index.js#anonymous~7"));
243
244
  // SELECTORS
244
245
  /** Returns the bare DOM id of the date picker trigger button, derived from
245
246
  * the date picker's base id. The trigger is the embedded Popover's button,
246
247
  * so the id is suffixed `-popover-button`. Use this to associate an external
247
248
  * label with the trigger via a native `<label for={DatePicker.triggerId(id)}>`
248
249
  * or an `aria-labelledby` reference. */
249
- export const triggerId = (id) => `${id}-popover-button`;
250
+ export const triggerId = (id) => __foldkitBrandViewResult((`${id}-popover-button`), "@foldkit/ui/datePicker/index.js#triggerId");
250
251
  // VIEW
251
252
  const encodeIsoDate = S.encodeSync(Calendar.CalendarDateFromIsoString);
252
253
  /** Renders an accessible date picker: a trigger button that opens a popover
@@ -259,13 +260,13 @@ export const view = defineView((model, viewInputs) => {
259
260
  const { anchor, maybeSelectedDate, triggerContent, toCalendarView, isDisabled, name, className, attributes = [], triggerClassName, triggerAttributes = [], ariaLabel, ariaLabelledBy, panelClassName, panelAttributes = [], backdropClassName, backdropAttributes = [], } = viewInputs;
260
261
  const resolveTriggerLabel = () => {
261
262
  if (Predicate.isNotUndefined(ariaLabel)) {
262
- return [h.AriaLabel(ariaLabel)];
263
+ return __foldkitBrandViewResult(([h.AriaLabel(ariaLabel)]), "@foldkit/ui/datePicker/index.js#resolveTriggerLabel");
263
264
  }
264
265
  else if (Predicate.isNotUndefined(ariaLabelledBy)) {
265
- return [h.AriaLabelledBy(ariaLabelledBy)];
266
+ return __foldkitBrandViewResult(([h.AriaLabelledBy(ariaLabelledBy)]), "@foldkit/ui/datePicker/index.js#resolveTriggerLabel");
266
267
  }
267
268
  else {
268
- return [];
269
+ return __foldkitBrandViewResult(([]), "@foldkit/ui/datePicker/index.js#resolveTriggerLabel");
269
270
  }
270
271
  };
271
272
  const triggerLabelAttributes = resolveTriggerLabel();
@@ -274,7 +275,7 @@ export const view = defineView((model, viewInputs) => {
274
275
  model: model.calendar,
275
276
  view: UiCalendar.view,
276
277
  viewInputs: { maybeSelectedDate, toView: toCalendarView },
277
- toParentMessage: message => GotCalendarMessage({ message }),
278
+ toParentMessage: message => __foldkitBrandViewResult((GotCalendarMessage({ message })), "@foldkit/ui/datePicker/index.js#toParentMessage"),
278
279
  });
279
280
  const popoverVNode = h.submodel({
280
281
  slotId: model.popover.id,
@@ -284,7 +285,7 @@ export const view = defineView((model, viewInputs) => {
284
285
  anchor,
285
286
  ...(isDisabled !== undefined && { isDisabled }),
286
287
  focusSelector: idSelector(`${model.calendar.id}-grid`),
287
- toView: ({ button, panel, backdrop, isVisible }) => h.div([], [
288
+ toView: ({ button, panel, backdrop, isVisible }) => __foldkitBrandViewResult((h.div([], [
288
289
  h.button([
289
290
  ...button,
290
291
  ...triggerLabelAttributes,
@@ -311,12 +312,12 @@ export const view = defineView((model, viewInputs) => {
311
312
  ], [calendarVNode]),
312
313
  ]
313
314
  : []),
314
- ]),
315
+ ])), "@foldkit/ui/datePicker/index.js#toView"),
315
316
  },
316
- toParentMessage: message => GotPopoverMessage({ message }),
317
+ toParentMessage: message => __foldkitBrandViewResult((GotPopoverMessage({ message })), "@foldkit/ui/datePicker/index.js#toParentMessage~2"),
317
318
  });
318
319
  const hiddenInputValue = Option.match(maybeSelectedDate, {
319
- onNone: () => '',
320
+ onNone: () => __foldkitBrandViewResult((''), "@foldkit/ui/datePicker/index.js#onNone~3"),
320
321
  onSome: encodeIsoDate,
321
322
  });
322
323
  const maybeHiddenInput = name !== undefined
@@ -326,5 +327,5 @@ export const view = defineView((model, viewInputs) => {
326
327
  ...(className !== undefined ? [h.Class(className)] : []),
327
328
  ...attributes,
328
329
  ];
329
- return h.div(wrapperAttributes, [popoverVNode, ...maybeHiddenInput]);
330
+ return __foldkitBrandViewResult((h.div(wrapperAttributes, [popoverVNode, ...maybeHiddenInput])), "@foldkit/ui/datePicker/index.js#anonymous~8");
330
331
  });