@foldkit/ui 0.129.0 → 0.131.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 (42) 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.js +20 -19
  9. package/dist/combobox/shared.js +169 -168
  10. package/dist/combobox/single.js +23 -22
  11. package/dist/datePicker/index.js +69 -68
  12. package/dist/dialog/index.js +52 -51
  13. package/dist/disclosure/index.js +11 -10
  14. package/dist/dragAndDrop/index.js +122 -121
  15. package/dist/fieldset/index.js +5 -4
  16. package/dist/fileDrop/index.js +23 -22
  17. package/dist/group.js +7 -6
  18. package/dist/input/index.js +4 -3
  19. package/dist/internal/optionExtensions.js +2 -1
  20. package/dist/internal/selectors.js +2 -1
  21. package/dist/keyboard.js +5 -4
  22. package/dist/listbox/multi.js +12 -11
  23. package/dist/listbox/shared.js +171 -170
  24. package/dist/listbox/single.js +13 -12
  25. package/dist/menu/index.js +167 -166
  26. package/dist/nav/index.js +7 -6
  27. package/dist/popover/index.js +87 -86
  28. package/dist/radioGroup/index.js +23 -22
  29. package/dist/select/index.js +4 -3
  30. package/dist/slider/index.js +72 -71
  31. package/dist/switch/index.js +6 -5
  32. package/dist/tabs/index.js +34 -33
  33. package/dist/test/apps/disabledButton.js +17 -16
  34. package/dist/textarea/index.js +4 -3
  35. package/dist/toast/index.js +19 -18
  36. package/dist/toast/schema.js +10 -9
  37. package/dist/toast/test.js +2 -1
  38. package/dist/toast/update.js +79 -78
  39. package/dist/tooltip/index.js +59 -58
  40. package/dist/typeahead.js +6 -5
  41. package/dist/virtualList/index.js +66 -65
  42. package/package.json +4 -3
@@ -1,3 +1,4 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
1
2
  import { Effect, Equal, Function, Match as M, Option, Schema as S, Stream, String as String_, pipe, } from 'effect';
2
3
  import { childAttributes, html, } from 'foldkit/html';
3
4
  import { m } from 'foldkit/message';
@@ -71,171 +72,171 @@ export const ChangedValue = m('ChangedValue', { value: S.Number });
71
72
  export const OutMessage = S.Union([ChangedValue]);
72
73
  /** Creates an initial slider model from a config. The value lives in the
73
74
  * parent Model; initialize it there and snap it with {@link snapAndClamp}. */
74
- export const init = (config) => ({
75
+ export const init = (config) => (__foldkitBrandViewResult(({
75
76
  id: config.id,
76
77
  min: config.min,
77
78
  max: config.max,
78
79
  step: config.step,
79
80
  dragState: Idle(),
80
- });
81
+ }), "@foldkit/ui/slider/index.js#init"));
81
82
  // HELPERS
82
83
  const stepDecimals = (step) => {
83
84
  const text = step.toString();
84
- return pipe(text, String_.indexOf('.'), Option.match({
85
- onNone: () => 0,
86
- onSome: dotIndex => text.length - dotIndex - 1,
87
- }));
85
+ return __foldkitBrandViewResult((pipe(text, String_.indexOf('.'), Option.match({
86
+ onNone: () => __foldkitBrandViewResult((0), "@foldkit/ui/slider/index.js#onNone"),
87
+ onSome: dotIndex => __foldkitBrandViewResult((text.length - dotIndex - 1), "@foldkit/ui/slider/index.js#onSome"),
88
+ }))), "@foldkit/ui/slider/index.js#stepDecimals");
88
89
  };
89
90
  const roundToStepPrecision = (value, step) => {
90
91
  const decimals = stepDecimals(step);
91
- return Number(value.toFixed(decimals));
92
+ return __foldkitBrandViewResult((Number(value.toFixed(decimals))), "@foldkit/ui/slider/index.js#roundToStepPrecision");
92
93
  };
93
- const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
94
+ const clamp = (value, min, max) => __foldkitBrandViewResult((Math.min(Math.max(value, min), max)), "@foldkit/ui/slider/index.js#clamp");
94
95
  /** Snaps a value to the nearest step and clamps it into `[min, max]`. Exported
95
96
  * so a parent can conform the value it owns to the slider's range, for example
96
97
  * when seeding the initial value or reacting to an external update. */
97
98
  export const snapAndClamp = (value, min, max, step) => {
98
99
  const snapped = min + Math.round((value - min) / step) * step;
99
- return roundToStepPrecision(clamp(snapped, min, max), step);
100
+ return __foldkitBrandViewResult((roundToStepPrecision(clamp(snapped, min, max), step)), "@foldkit/ui/slider/index.js#snapAndClamp");
100
101
  };
101
102
  /** Computes the fraction (0–1) of a value between min and max. Returns 0 when
102
103
  * the range has zero width. */
103
104
  export const fractionOfValue = (value, min, max) => {
104
105
  const range = max - min;
105
106
  if (range <= 0) {
106
- return 0;
107
+ return __foldkitBrandViewResult((0), "@foldkit/ui/slider/index.js#fractionOfValue");
107
108
  }
108
109
  else {
109
- return clamp((value - min) / range, 0, 1);
110
+ return __foldkitBrandViewResult((clamp((value - min) / range, 0, 1)), "@foldkit/ui/slider/index.js#fractionOfValue");
110
111
  }
111
112
  };
112
113
  const PAGE_STEP_MULTIPLIER = 10;
113
- const nextValueForDirection = (value, min, max, step, direction) => M.value(direction).pipe(M.withReturnType(), M.when('StepIncrement', () => snapAndClamp(value + step, min, max, step)), M.when('StepDecrement', () => snapAndClamp(value - step, min, max, step)), M.when('PageIncrement', () => snapAndClamp(value + step * PAGE_STEP_MULTIPLIER, min, max, step)), M.when('PageDecrement', () => snapAndClamp(value - step * PAGE_STEP_MULTIPLIER, min, max, step)), M.when('Min', () => min), M.when('Max', () => max), M.exhaustive);
114
+ const nextValueForDirection = (value, min, max, step, direction) => __foldkitBrandViewResult((M.value(direction).pipe(M.withReturnType(), M.when('StepIncrement', () => __foldkitBrandViewResult((snapAndClamp(value + step, min, max, step)), "@foldkit/ui/slider/index.js#anonymous")), M.when('StepDecrement', () => __foldkitBrandViewResult((snapAndClamp(value - step, min, max, step)), "@foldkit/ui/slider/index.js#anonymous~2")), M.when('PageIncrement', () => __foldkitBrandViewResult((snapAndClamp(value + step * PAGE_STEP_MULTIPLIER, min, max, step)), "@foldkit/ui/slider/index.js#anonymous~3")), M.when('PageDecrement', () => __foldkitBrandViewResult((snapAndClamp(value - step * PAGE_STEP_MULTIPLIER, min, max, step)), "@foldkit/ui/slider/index.js#anonymous~4")), M.when('Min', () => __foldkitBrandViewResult((min), "@foldkit/ui/slider/index.js#anonymous~5")), M.when('Max', () => __foldkitBrandViewResult((max), "@foldkit/ui/slider/index.js#anonymous~6")), M.exhaustive)), "@foldkit/ui/slider/index.js#nextValueForDirection");
114
115
  const withUpdateReturn = M.withReturnType();
115
- const changedValueOption = (currentValue, nextValue) => nextValue === currentValue
116
+ const changedValueOption = (currentValue, nextValue) => __foldkitBrandViewResult((nextValue === currentValue
116
117
  ? Option.none()
117
- : Option.some(ChangedValue({ value: nextValue }));
118
+ : Option.some(ChangedValue({ value: nextValue }))), "@foldkit/ui/slider/index.js#changedValueOption");
118
119
  /** Processes a slider message and returns the next model, commands, and an
119
120
  * optional out-message for the parent. The value lives in the parent Model:
120
121
  * the view supplies the current value on the messages that need it, and value
121
122
  * changes surface as `ChangedValue` rather than mutating this Model. */
122
- export const update = (model, message) => M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
123
- PressedThumb: ({ originValue }) => M.value(model.dragState).pipe(withUpdateReturn, M.tag('Dragging', () => [model, [], Option.none()]), M.orElse(() => [
124
- evo(model, { dragState: () => Dragging({ originValue }) }),
123
+ export const update = (model, message) => __foldkitBrandViewResult((M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
124
+ PressedThumb: ({ originValue }) => __foldkitBrandViewResult((M.value(model.dragState).pipe(withUpdateReturn, M.tag('Dragging', () => __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/slider/index.js#anonymous~7")), M.orElse(() => __foldkitBrandViewResult(([
125
+ evo(model, { dragState: () => __foldkitBrandViewResult((Dragging({ originValue })), "@foldkit/ui/slider/index.js#dragState") }),
125
126
  [],
126
127
  Option.none(),
127
- ])),
128
+ ]), "@foldkit/ui/slider/index.js#anonymous~8")))), "@foldkit/ui/slider/index.js#PressedThumb"),
128
129
  // NOTE: the pointerdown event on the thumb bubbles to the track, so a
129
130
  // thumb press also dispatches PressedPointer. Short-circuit when already
130
131
  // Dragging so the bubbled track handler cannot shift the value away
131
132
  // from the thumb's current position. Fine-grained sliders (e.g. step
132
133
  // 0.05) see a visible jump without this guard, because the cursor sits
133
134
  // off-center on a non-zero-width thumb.
134
- PressedPointer: ({ value, originValue }) => M.value(model.dragState).pipe(withUpdateReturn, M.tag('Dragging', () => [model, [], Option.none()]), M.orElse(() => {
135
+ PressedPointer: ({ value, originValue }) => __foldkitBrandViewResult((M.value(model.dragState).pipe(withUpdateReturn, M.tag('Dragging', () => __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/slider/index.js#anonymous~9")), M.orElse(() => {
135
136
  const snapped = snapAndClamp(value, model.min, model.max, model.step);
136
- return [
137
- evo(model, { dragState: () => Dragging({ originValue }) }),
137
+ return __foldkitBrandViewResult(([
138
+ evo(model, { dragState: () => __foldkitBrandViewResult((Dragging({ originValue })), "@foldkit/ui/slider/index.js#dragState~2") }),
138
139
  [],
139
140
  changedValueOption(originValue, snapped),
140
- ];
141
- })),
142
- MovedDragPointer: ({ value }) => M.value(model.dragState).pipe(withUpdateReturn, M.tag('Dragging', () => [
141
+ ]), "@foldkit/ui/slider/index.js#anonymous~10");
142
+ }))), "@foldkit/ui/slider/index.js#PressedPointer"),
143
+ MovedDragPointer: ({ value }) => __foldkitBrandViewResult((M.value(model.dragState).pipe(withUpdateReturn, M.tag('Dragging', () => __foldkitBrandViewResult(([
143
144
  model,
144
145
  [],
145
146
  Option.some(ChangedValue({
146
147
  value: snapAndClamp(value, model.min, model.max, model.step),
147
148
  })),
148
- ]), M.orElse(() => [model, [], Option.none()])),
149
- ReleasedDragPointer: () => M.value(model.dragState).pipe(withUpdateReturn, M.tag('Dragging', () => [
150
- evo(model, { dragState: () => Idle() }),
149
+ ]), "@foldkit/ui/slider/index.js#anonymous~11")), M.orElse(() => __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/slider/index.js#anonymous~12")))), "@foldkit/ui/slider/index.js#MovedDragPointer"),
150
+ ReleasedDragPointer: () => __foldkitBrandViewResult((M.value(model.dragState).pipe(withUpdateReturn, M.tag('Dragging', () => __foldkitBrandViewResult(([
151
+ evo(model, { dragState: () => __foldkitBrandViewResult((Idle()), "@foldkit/ui/slider/index.js#dragState~3") }),
151
152
  [],
152
153
  Option.none(),
153
- ]), M.orElse(() => [model, [], Option.none()])),
154
- CancelledDrag: () => M.value(model.dragState).pipe(withUpdateReturn, M.tag('Dragging', ({ originValue }) => [
155
- evo(model, { dragState: () => Idle() }),
154
+ ]), "@foldkit/ui/slider/index.js#anonymous~13")), M.orElse(() => __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/slider/index.js#anonymous~14")))), "@foldkit/ui/slider/index.js#ReleasedDragPointer"),
155
+ CancelledDrag: () => __foldkitBrandViewResult((M.value(model.dragState).pipe(withUpdateReturn, M.tag('Dragging', ({ originValue }) => __foldkitBrandViewResult(([
156
+ evo(model, { dragState: () => __foldkitBrandViewResult((Idle()), "@foldkit/ui/slider/index.js#dragState~4") }),
156
157
  [],
157
158
  Option.some(ChangedValue({ value: originValue })),
158
- ]), M.orElse(() => [model, [], Option.none()])),
159
- PressedKeyboardNavigation: ({ direction, value }) => [
159
+ ]), "@foldkit/ui/slider/index.js#anonymous~15")), M.orElse(() => __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/slider/index.js#anonymous~16")))), "@foldkit/ui/slider/index.js#CancelledDrag"),
160
+ PressedKeyboardNavigation: ({ direction, value }) => __foldkitBrandViewResult(([
160
161
  model,
161
162
  [],
162
163
  changedValueOption(value, nextValueForDirection(value, model.min, model.max, model.step, direction)),
163
- ],
164
- }));
164
+ ]), "@foldkit/ui/slider/index.js#PressedKeyboardNavigation"),
165
+ }))), "@foldkit/ui/slider/index.js#update");
165
166
  /** Reflects an externally-driven range onto the slider. Use this when min/max
166
167
  * derive from external state (e.g. a bounded buffer whose first/last index
167
168
  * shifts over time). The parent owns the value, so conform it to the new range
168
169
  * in the same update with {@link snapAndClamp}. */
169
- export const reflectRange = Function.dual(2, (model, range) => evo(model, {
170
- min: () => range.min,
171
- max: () => range.max,
172
- }));
170
+ export const reflectRange = Function.dual(2, (model, range) => __foldkitBrandViewResult((evo(model, {
171
+ min: () => __foldkitBrandViewResult((range.min), "@foldkit/ui/slider/index.js#min"),
172
+ max: () => __foldkitBrandViewResult((range.max), "@foldkit/ui/slider/index.js#max"),
173
+ })), "@foldkit/ui/slider/index.js#anonymous~17"));
173
174
  // SUBSCRIPTION
174
175
  const DragActivity = S.Literals(['Idle', 'Active']);
175
- const dragActivityFromModel = (model) => M.value(model.dragState).pipe(M.withReturnType(), M.tag('Dragging', () => 'Active'), M.orElse(() => 'Idle'));
176
- const trackElement = (id, root) => Option.fromNullishOr(root.querySelector(`[data-slider-track-id="${id}"]`));
176
+ const dragActivityFromModel = (model) => __foldkitBrandViewResult((M.value(model.dragState).pipe(M.withReturnType(), M.tag('Dragging', () => __foldkitBrandViewResult(('Active'), "@foldkit/ui/slider/index.js#anonymous~18")), M.orElse(() => __foldkitBrandViewResult(('Idle'), "@foldkit/ui/slider/index.js#anonymous~19")))), "@foldkit/ui/slider/index.js#dragActivityFromModel");
177
+ const trackElement = (id, root) => __foldkitBrandViewResult((Option.fromNullishOr(root.querySelector(`[data-slider-track-id="${id}"]`))), "@foldkit/ui/slider/index.js#trackElement");
177
178
  const valueFromClientX = (clientX, trackElement_, min, max) => {
178
179
  const rect = trackElement_.getBoundingClientRect();
179
180
  if (rect.width === 0) {
180
- return min;
181
+ return __foldkitBrandViewResult((min), "@foldkit/ui/slider/index.js#valueFromClientX");
181
182
  }
182
183
  else {
183
184
  const fraction = clamp((clientX - rect.left) / rect.width, 0, 1);
184
- return min + fraction * (max - min);
185
+ return __foldkitBrandViewResult((min + fraction * (max - min)), "@foldkit/ui/slider/index.js#valueFromClientX");
185
186
  }
186
187
  };
187
188
  /** Builds slider drag subscriptions, looking up the track
188
189
  * element through the supplied root resolver. Use this when the slider is
189
190
  * rendered inside a Shadow DOM. The root is read lazily so consumers can
190
191
  * resolve it at subscription time. */
191
- export const subscriptionsForRoot = (getTrackRoot) => Subscription.make()(entry => ({
192
+ export const subscriptionsForRoot = (getTrackRoot) => __foldkitBrandViewResult((Subscription.make()(entry => (__foldkitBrandViewResult(({
192
193
  dragPointer: entry({
193
194
  dragActivity: DragActivity,
194
195
  id: S.String,
195
196
  min: S.Number,
196
197
  max: S.Number,
197
198
  }, {
198
- modelToDependencies: model => ({
199
+ modelToDependencies: model => (__foldkitBrandViewResult(({
199
200
  dragActivity: dragActivityFromModel(model),
200
201
  id: model.id,
201
202
  min: model.min,
202
203
  max: model.max,
203
- }),
204
+ }), "@foldkit/ui/slider/index.js#modelToDependencies")),
204
205
  dependenciesToStream: ({ dragActivity, id, min, max }) => {
205
- const pointerEvents = Stream.merge(Stream.fromEventListener(document, 'pointermove').pipe(Stream.mapEffect(event => Effect.sync(() => Option.map(trackElement(id, getTrackRoot()), element => MovedDragPointer({
206
+ const pointerEvents = Stream.merge(Stream.fromEventListener(document, 'pointermove').pipe(Stream.mapEffect(event => __foldkitBrandViewResult((Effect.sync(() => __foldkitBrandViewResult((Option.map(trackElement(id, getTrackRoot()), element => __foldkitBrandViewResult((MovedDragPointer({
206
207
  value: valueFromClientX(event.clientX, element, min, max),
207
- })))), Stream.filter(Option.isSome), Stream.map(option => option.value)), Stream.fromEventListener(document, 'pointerup').pipe(Stream.map(() => ReleasedDragPointer())));
208
+ })), "@foldkit/ui/slider/index.js#anonymous~23"))), "@foldkit/ui/slider/index.js#anonymous~22"))), "@foldkit/ui/slider/index.js#anonymous~21")), Stream.filter(Option.isSome), Stream.map(option => __foldkitBrandViewResult((option.value), "@foldkit/ui/slider/index.js#anonymous~24"))), Stream.fromEventListener(document, 'pointerup').pipe(Stream.map(() => __foldkitBrandViewResult((ReleasedDragPointer()), "@foldkit/ui/slider/index.js#anonymous~25"))));
208
209
  // NOTE: prevents text selection and locks cursor to grabbing while the
209
210
  // user drags the thumb. Matches the approach used in drag-and-drop.
210
- const documentDragStyles = Stream.callback(() => Effect.acquireRelease(Effect.sync(() => {
211
+ const documentDragStyles = Stream.callback(() => __foldkitBrandViewResult((Effect.acquireRelease(Effect.sync(() => {
211
212
  document.documentElement.style.setProperty('user-select', 'none');
212
213
  document.documentElement.style.setProperty('-webkit-user-select', 'none');
213
214
  const cursorStyle = document.createElement('style');
214
215
  cursorStyle.textContent = '* { cursor: grabbing !important; }';
215
216
  document.head.appendChild(cursorStyle);
216
- return cursorStyle;
217
- }), cursorStyle => Effect.sync(() => {
217
+ return __foldkitBrandViewResult((cursorStyle), "@foldkit/ui/slider/index.js#anonymous~27");
218
+ }), cursorStyle => __foldkitBrandViewResult((Effect.sync(() => {
218
219
  document.documentElement.style.removeProperty('user-select');
219
220
  document.documentElement.style.removeProperty('-webkit-user-select');
220
221
  cursorStyle.remove();
221
- })).pipe(Effect.flatMap(() => Effect.never)));
222
- return Stream.when(Stream.merge(pointerEvents, documentDragStyles), Effect.sync(() => dragActivity === 'Active'));
222
+ })), "@foldkit/ui/slider/index.js#anonymous~28")).pipe(Effect.flatMap(() => __foldkitBrandViewResult((Effect.never), "@foldkit/ui/slider/index.js#anonymous~30")))), "@foldkit/ui/slider/index.js#anonymous~26"));
223
+ return __foldkitBrandViewResult((Stream.when(Stream.merge(pointerEvents, documentDragStyles), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/slider/index.js#anonymous~31")))), "@foldkit/ui/slider/index.js#dependenciesToStream");
223
224
  },
224
225
  }),
225
226
  dragEscape: entry({ dragActivity: DragActivity }, {
226
- modelToDependencies: model => ({
227
+ modelToDependencies: model => (__foldkitBrandViewResult(({
227
228
  dragActivity: dragActivityFromModel(model),
228
- }),
229
- dependenciesToStream: ({ dragActivity }) => Stream.when(Stream.fromEventListener(document, 'keydown').pipe(Stream.filter(({ key }) => key === 'Escape'), Stream.map(() => CancelledDrag())), Effect.sync(() => dragActivity === 'Active')),
229
+ }), "@foldkit/ui/slider/index.js#modelToDependencies~2")),
230
+ dependenciesToStream: ({ dragActivity }) => __foldkitBrandViewResult((Stream.when(Stream.fromEventListener(document, 'keydown').pipe(Stream.filter(({ key }) => __foldkitBrandViewResult((key === 'Escape'), "@foldkit/ui/slider/index.js#anonymous~32")), Stream.map(() => __foldkitBrandViewResult((CancelledDrag()), "@foldkit/ui/slider/index.js#anonymous~33"))), Effect.sync(() => __foldkitBrandViewResult((dragActivity === 'Active'), "@foldkit/ui/slider/index.js#anonymous~34")))), "@foldkit/ui/slider/index.js#dependenciesToStream~2"),
230
231
  }),
231
- }));
232
+ }), "@foldkit/ui/slider/index.js#anonymous~20")))), "@foldkit/ui/slider/index.js#subscriptionsForRoot");
232
233
  /** Default drag subscriptions, with the track looked up via `document`. */
233
- export const subscriptions = subscriptionsForRoot(() => document);
234
+ export const subscriptions = subscriptionsForRoot(() => __foldkitBrandViewResult((document), "@foldkit/ui/slider/index.js#anonymous~35"));
234
235
  // VIEW
235
236
  const LEFT_MOUSE_BUTTON = 0;
236
- const labelId = (id) => `${id}-label`;
237
- const keyToDirection = (key) => M.value(key).pipe(M.withReturnType(), M.whenOr('ArrowRight', 'ArrowUp', () => 'StepIncrement'), M.whenOr('ArrowLeft', 'ArrowDown', () => 'StepDecrement'), M.when('PageUp', () => 'PageIncrement'), M.when('PageDown', () => 'PageDecrement'), M.when('Home', () => 'Min'), M.when('End', () => 'Max'), M.option);
238
- const percentString = (fraction) => `${Math.round(fraction * 10000) / 100}%`;
237
+ const labelId = (id) => __foldkitBrandViewResult((`${id}-label`), "@foldkit/ui/slider/index.js#labelId");
238
+ const keyToDirection = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.withReturnType(), M.whenOr('ArrowRight', 'ArrowUp', () => __foldkitBrandViewResult(('StepIncrement'), "@foldkit/ui/slider/index.js#anonymous~36")), M.whenOr('ArrowLeft', 'ArrowDown', () => __foldkitBrandViewResult(('StepDecrement'), "@foldkit/ui/slider/index.js#anonymous~37")), M.when('PageUp', () => __foldkitBrandViewResult(('PageIncrement'), "@foldkit/ui/slider/index.js#anonymous~38")), M.when('PageDown', () => __foldkitBrandViewResult(('PageDecrement'), "@foldkit/ui/slider/index.js#anonymous~39")), M.when('Home', () => __foldkitBrandViewResult(('Min'), "@foldkit/ui/slider/index.js#anonymous~40")), M.when('End', () => __foldkitBrandViewResult(('Max'), "@foldkit/ui/slider/index.js#anonymous~41")), M.option)), "@foldkit/ui/slider/index.js#keyToDirection");
239
+ const percentString = (fraction) => __foldkitBrandViewResult((`${Math.round(fraction * 10000) / 100}%`), "@foldkit/ui/slider/index.js#percentString");
239
240
  /** Renders an accessible slider by building ARIA attribute groups and
240
241
  * delegating layout to the consumer's `toView` callback. Follows the
241
242
  * WAI-ARIA slider pattern: role="slider" on the thumb, aria-valuemin /
@@ -243,17 +244,17 @@ const percentString = (fraction) => `${Math.round(fraction * 10000) / 100}%`;
243
244
  * end. Pointer drag is handled by the component's drag subscriptions. */
244
245
  export const view = defineView((model, viewInputs) => {
245
246
  const h = html();
246
- const { value, formatValue, isDisabled = false, name, getTrackRoot = () => document, } = viewInputs;
247
+ const { value, formatValue, isDisabled = false, name, getTrackRoot = () => __foldkitBrandViewResult((document), "@foldkit/ui/slider/index.js#anonymous~43"), } = viewInputs;
247
248
  const { id, min, max } = model;
248
249
  const isDragging = model.dragState._tag === 'Dragging';
249
250
  const fraction = fractionOfValue(value, min, max);
250
- const handleKeyDown = (key) => Option.map(keyToDirection(key), direction => PressedKeyboardNavigation({ direction, value }));
251
- const pointerAtClientX = (clientX) => Option.map(trackElement(id, getTrackRoot()), element => PressedPointer({
251
+ const handleKeyDown = (key) => __foldkitBrandViewResult((Option.map(keyToDirection(key), direction => __foldkitBrandViewResult((PressedKeyboardNavigation({ direction, value })), "@foldkit/ui/slider/index.js#anonymous~44"))), "@foldkit/ui/slider/index.js#handleKeyDown");
252
+ const pointerAtClientX = (clientX) => __foldkitBrandViewResult((Option.map(trackElement(id, getTrackRoot()), element => __foldkitBrandViewResult((PressedPointer({
252
253
  value: valueFromClientX(clientX, element, min, max),
253
254
  originValue: value,
254
- }));
255
- const trackPointerHandler = (_pointerType, button, _screenX, _screenY, _timeStamp, clientX) => pipe(button, Option.liftPredicate(Equal.equals(LEFT_MOUSE_BUTTON)), Option.flatMap(() => pointerAtClientX(clientX)));
256
- const thumbPointerHandler = (_pointerType, button) => pipe(button, Option.liftPredicate(Equal.equals(LEFT_MOUSE_BUTTON)), Option.map(() => PressedThumb({ originValue: value })));
255
+ })), "@foldkit/ui/slider/index.js#anonymous~45"))), "@foldkit/ui/slider/index.js#pointerAtClientX");
256
+ const trackPointerHandler = (_pointerType, button, _screenX, _screenY, _timeStamp, clientX) => __foldkitBrandViewResult((pipe(button, Option.liftPredicate(Equal.equals(LEFT_MOUSE_BUTTON)), Option.flatMap(() => __foldkitBrandViewResult((pointerAtClientX(clientX)), "@foldkit/ui/slider/index.js#anonymous~46")))), "@foldkit/ui/slider/index.js#trackPointerHandler");
257
+ const thumbPointerHandler = (_pointerType, button) => __foldkitBrandViewResult((pipe(button, Option.liftPredicate(Equal.equals(LEFT_MOUSE_BUTTON)), Option.map(() => __foldkitBrandViewResult((PressedThumb({ originValue: value })), "@foldkit/ui/slider/index.js#anonymous~47")))), "@foldkit/ui/slider/index.js#thumbPointerHandler");
257
258
  const stateAttributes = [
258
259
  ...(isDragging ? [h.DataAttribute('dragging', '')] : []),
259
260
  ...(isDisabled ? [h.DataAttribute('disabled', '')] : []),
@@ -285,13 +286,13 @@ export const view = defineView((model, viewInputs) => {
285
286
  ];
286
287
  const resolveThumbLabel = () => {
287
288
  if (viewInputs.ariaLabel !== undefined) {
288
- return [h.AriaLabel(viewInputs.ariaLabel)];
289
+ return __foldkitBrandViewResult(([h.AriaLabel(viewInputs.ariaLabel)]), "@foldkit/ui/slider/index.js#resolveThumbLabel");
289
290
  }
290
291
  else if (viewInputs.ariaLabelledBy !== undefined) {
291
- return [h.AriaLabelledBy(viewInputs.ariaLabelledBy)];
292
+ return __foldkitBrandViewResult(([h.AriaLabelledBy(viewInputs.ariaLabelledBy)]), "@foldkit/ui/slider/index.js#resolveThumbLabel");
292
293
  }
293
294
  else {
294
- return [h.AriaLabelledBy(labelId(id))];
295
+ return __foldkitBrandViewResult(([h.AriaLabelledBy(labelId(id))]), "@foldkit/ui/slider/index.js#resolveThumbLabel");
295
296
  }
296
297
  };
297
298
  const thumbLabelAttributes = resolveThumbLabel();
@@ -326,12 +327,12 @@ export const view = defineView((model, viewInputs) => {
326
327
  const hiddenInputAttributes = name !== undefined
327
328
  ? [h.Type('hidden'), h.Name(name), h.Value(value.toString())]
328
329
  : [];
329
- return viewInputs.toView({
330
+ return __foldkitBrandViewResult((viewInputs.toView({
330
331
  root: childAttributes(rootAttributes),
331
332
  track: childAttributes(trackAttributes),
332
333
  filledTrack: childAttributes(filledTrackAttributes),
333
334
  thumb: childAttributes(thumbAttributes),
334
335
  label: childAttributes(labelAttributes),
335
336
  hiddenInput: childAttributes(hiddenInputAttributes),
336
- });
337
+ })), "@foldkit/ui/slider/index.js#anonymous~42");
337
338
  });
@@ -1,7 +1,8 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
1
2
  import { Match as M, Option } from 'effect';
2
3
  import { html } from 'foldkit/html';
3
- const labelId = (id) => `${id}-label`;
4
- const descriptionId = (id) => `${id}-description`;
4
+ const labelId = (id) => __foldkitBrandViewResult((`${id}-label`), "@foldkit/ui/switch/index.js#labelId");
5
+ const descriptionId = (id) => __foldkitBrandViewResult((`${id}-description`), "@foldkit/ui/switch/index.js#descriptionId");
5
6
  /** Renders an accessible switch as a stateless controlled component. The
6
7
  * parent owns the checked state (`isChecked`) and receives the new state via
7
8
  * `onToggle` when the user toggles it.
@@ -25,7 +26,7 @@ export const view = (config) => {
25
26
  const h = html();
26
27
  const { id, isChecked, onToggle, toView, isDisabled = false, name, value: formValue = 'on', } = config;
27
28
  const nextChecked = !isChecked;
28
- const handleKeyUp = (key) => M.value(key).pipe(M.when(' ', () => Option.some(onToggle(nextChecked))), M.orElse(() => Option.none()));
29
+ const handleKeyUp = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when(' ', () => __foldkitBrandViewResult((Option.some(onToggle(nextChecked))), "@foldkit/ui/switch/index.js#anonymous")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/switch/index.js#anonymous~2")))), "@foldkit/ui/switch/index.js#handleKeyUp");
29
30
  const checkedAttributes = isChecked ? [h.DataAttribute('checked', '')] : [];
30
31
  const disabledAttributes = isDisabled
31
32
  ? [h.AriaDisabled(true), h.DataAttribute('disabled', '')]
@@ -53,10 +54,10 @@ export const view = (config) => {
53
54
  const hiddenInputAttributes = name
54
55
  ? [h.Type('hidden'), h.Name(name), h.Value(isChecked ? formValue : '')]
55
56
  : [];
56
- return toView({
57
+ return __foldkitBrandViewResult((toView({
57
58
  button: buttonAttributes,
58
59
  label: labelAttributes,
59
60
  description: descriptionAttributes,
60
61
  hiddenInput: hiddenInputAttributes,
61
- });
62
+ })), "@foldkit/ui/switch/index.js#view");
62
63
  };
@@ -1,3 +1,4 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
1
2
  import { Array, Effect, Match as M, Option, Schema as S, String, pipe, } from 'effect';
2
3
  import * as Command from 'foldkit/command';
3
4
  import * as Dom from 'foldkit/dom';
@@ -47,53 +48,53 @@ export const OutMessage = S.Union([Selected]);
47
48
  /** Creates an initial tabs model from a config. Focus follows the selected
48
49
  * tab until the user navigates in `Manual` mode, so `maybeFocusedIndex`
49
50
  * starts `None`. Defaults to automatic activation. */
50
- export const init = (config) => ({
51
+ export const init = (config) => (__foldkitBrandViewResult(({
51
52
  id: config.id,
52
53
  maybeFocusedIndex: Option.none(),
53
54
  activationMode: config.activationMode ?? 'Automatic',
54
- });
55
+ }), "@foldkit/ui/tabs/index.js#init"));
55
56
  // UPDATE
56
- const tabId = (id, index) => `${id}-tab-${index}`;
57
- const tabPanelId = (id, index) => `${id}-panel-${index}`;
57
+ const tabId = (id, index) => __foldkitBrandViewResult((`${id}-tab-${index}`), "@foldkit/ui/tabs/index.js#tabId");
58
+ const tabPanelId = (id, index) => __foldkitBrandViewResult((`${id}-panel-${index}`), "@foldkit/ui/tabs/index.js#tabPanelId");
58
59
  /** Moves focus to the tab at the given index. */
59
- export const FocusTab = Command.define('FocusTab', { id: S.String, index: S.Number }, CompletedFocusTab)(({ id, index }) => Dom.focus(idSelector(tabId(id, index))).pipe(Effect.ignore, Effect.as(CompletedFocusTab())));
60
+ export const FocusTab = Command.define('FocusTab', { id: S.String, index: S.Number }, CompletedFocusTab)(({ id, index }) => __foldkitBrandViewResult((Dom.focus(idSelector(tabId(id, index))).pipe(Effect.ignore, Effect.as(CompletedFocusTab()))), "@foldkit/ui/tabs/index.js#anonymous"));
60
61
  /** Processes a tabs message and returns the next model, commands, and an
61
62
  * optional OutMessage. `Selected` fires when a tab is committed via click or
62
63
  * keyboard; the parent stores the new value and passes it back in as
63
64
  * `selectedValue`. */
64
- export const update = (model, message) => M.value(message).pipe(M.withReturnType(), M.tagsExhaustive({
65
- SelectedTab: ({ index, value }) => [
66
- evo(model, { maybeFocusedIndex: () => Option.none() }),
65
+ export const update = (model, message) => __foldkitBrandViewResult((M.value(message).pipe(M.withReturnType(), M.tagsExhaustive({
66
+ SelectedTab: ({ index, value }) => __foldkitBrandViewResult(([
67
+ evo(model, { maybeFocusedIndex: () => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/tabs/index.js#maybeFocusedIndex") }),
67
68
  [FocusTab({ id: model.id, index })],
68
69
  Option.some(Selected({ value, index })),
69
- ],
70
- FocusedTab: ({ index }) => [
71
- evo(model, { maybeFocusedIndex: () => Option.some(index) }),
70
+ ]), "@foldkit/ui/tabs/index.js#SelectedTab"),
71
+ FocusedTab: ({ index }) => __foldkitBrandViewResult(([
72
+ evo(model, { maybeFocusedIndex: () => __foldkitBrandViewResult((Option.some(index)), "@foldkit/ui/tabs/index.js#maybeFocusedIndex~2") }),
72
73
  [FocusTab({ id: model.id, index })],
73
74
  Option.none(),
74
- ],
75
- CompletedFocusTab: () => [model, [], Option.none()],
76
- }));
75
+ ]), "@foldkit/ui/tabs/index.js#FocusedTab"),
76
+ CompletedFocusTab: () => __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/tabs/index.js#CompletedFocusTab"),
77
+ }))), "@foldkit/ui/tabs/index.js#update");
77
78
  const internalView = defineView((model, viewInputs) => {
78
79
  const h = html();
79
80
  const { id, activationMode, maybeFocusedIndex } = model;
80
81
  const { tabs, selectedValue, ariaLabel, toView, isTabDisabled, orientation = 'Horizontal', } = viewInputs;
81
- const activeIndex = pipe(tabs, Array.findFirstIndex(tab => tab === selectedValue), Option.getOrElse(() => 0));
82
- const focusedIndex = pipe(maybeFocusedIndex, Option.filter(index => index < tabs.length), Option.getOrElse(() => activeIndex));
83
- const isDisabled = (index) => !!isTabDisabled &&
84
- pipe(tabs, Array.get(index), Option.exists(tab => isTabDisabled(tab, index)));
85
- const { nextKey, previousKey } = M.value(orientation).pipe(M.when('Horizontal', () => ({
82
+ const activeIndex = pipe(tabs, Array.findFirstIndex(tab => __foldkitBrandViewResult((tab === selectedValue), "@foldkit/ui/tabs/index.js#anonymous~3")), Option.getOrElse(() => __foldkitBrandViewResult((0), "@foldkit/ui/tabs/index.js#anonymous~4")));
83
+ const focusedIndex = pipe(maybeFocusedIndex, Option.filter(index => __foldkitBrandViewResult((index < tabs.length), "@foldkit/ui/tabs/index.js#anonymous~5")), Option.getOrElse(() => __foldkitBrandViewResult((activeIndex), "@foldkit/ui/tabs/index.js#anonymous~6")));
84
+ const isDisabled = (index) => __foldkitBrandViewResult((!!isTabDisabled &&
85
+ pipe(tabs, Array.get(index), Option.exists(tab => __foldkitBrandViewResult((isTabDisabled(tab, index)), "@foldkit/ui/tabs/index.js#anonymous~7")))), "@foldkit/ui/tabs/index.js#isDisabled");
86
+ const { nextKey, previousKey } = M.value(orientation).pipe(M.when('Horizontal', () => (__foldkitBrandViewResult(({
86
87
  nextKey: 'ArrowRight',
87
88
  previousKey: 'ArrowLeft',
88
- })), M.when('Vertical', () => ({
89
+ }), "@foldkit/ui/tabs/index.js#anonymous~8"))), M.when('Vertical', () => (__foldkitBrandViewResult(({
89
90
  nextKey: 'ArrowDown',
90
91
  previousKey: 'ArrowUp',
91
- })), M.exhaustive);
92
+ }), "@foldkit/ui/tabs/index.js#anonymous~9"))), M.exhaustive);
92
93
  const resolveKeyIndex = keyToIndex(nextKey, previousKey, tabs.length, focusedIndex, isDisabled);
93
- const tabSelectedAt = (index) => pipe(tabs, Array.get(index), Option.map(value => SelectedTab({ index, value })));
94
- const handleAutomaticKeyDown = (key) => M.value(key).pipe(M.whenOr(nextKey, previousKey, 'Home', 'End', 'PageUp', 'PageDown', () => tabSelectedAt(resolveKeyIndex(key))), M.whenOr('Enter', ' ', () => tabSelectedAt(focusedIndex)), M.orElse(() => Option.none()));
95
- const handleManualKeyDown = (key) => M.value(key).pipe(M.whenOr(nextKey, previousKey, 'Home', 'End', 'PageUp', 'PageDown', () => Option.some(FocusedTab({ index: resolveKeyIndex(key) }))), M.whenOr('Enter', ' ', () => tabSelectedAt(focusedIndex)), M.orElse(() => Option.none()));
96
- const handleKeyDown = (key) => M.value(activationMode).pipe(M.when('Automatic', () => handleAutomaticKeyDown(key)), M.when('Manual', () => handleManualKeyDown(key)), M.exhaustive);
94
+ const tabSelectedAt = (index) => __foldkitBrandViewResult((pipe(tabs, Array.get(index), Option.map(value => __foldkitBrandViewResult((SelectedTab({ index, value })), "@foldkit/ui/tabs/index.js#anonymous~10")))), "@foldkit/ui/tabs/index.js#tabSelectedAt");
95
+ const handleAutomaticKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.whenOr(nextKey, previousKey, 'Home', 'End', 'PageUp', 'PageDown', () => __foldkitBrandViewResult((tabSelectedAt(resolveKeyIndex(key))), "@foldkit/ui/tabs/index.js#anonymous~11")), M.whenOr('Enter', ' ', () => __foldkitBrandViewResult((tabSelectedAt(focusedIndex)), "@foldkit/ui/tabs/index.js#anonymous~12")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/tabs/index.js#anonymous~13")))), "@foldkit/ui/tabs/index.js#handleAutomaticKeyDown");
96
+ const handleManualKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.whenOr(nextKey, previousKey, 'Home', 'End', 'PageUp', 'PageDown', () => __foldkitBrandViewResult((Option.some(FocusedTab({ index: resolveKeyIndex(key) }))), "@foldkit/ui/tabs/index.js#anonymous~14")), M.whenOr('Enter', ' ', () => __foldkitBrandViewResult((tabSelectedAt(focusedIndex)), "@foldkit/ui/tabs/index.js#anonymous~15")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/tabs/index.js#anonymous~16")))), "@foldkit/ui/tabs/index.js#handleManualKeyDown");
97
+ const handleKeyDown = (key) => __foldkitBrandViewResult((M.value(activationMode).pipe(M.when('Automatic', () => __foldkitBrandViewResult((handleAutomaticKeyDown(key)), "@foldkit/ui/tabs/index.js#anonymous~17")), M.when('Manual', () => __foldkitBrandViewResult((handleManualKeyDown(key)), "@foldkit/ui/tabs/index.js#anonymous~18")), M.exhaustive)), "@foldkit/ui/tabs/index.js#handleKeyDown");
97
98
  const tabInfos = Array.map(tabs, (value, index) => {
98
99
  const isActive = index === activeIndex;
99
100
  const isFocused = index === focusedIndex;
@@ -122,7 +123,7 @@ const internalView = defineView((model, viewInputs) => {
122
123
  h.Tabindex(isActive ? 0 : -1),
123
124
  ...(isActive ? [h.DataAttribute('selected', '')] : []),
124
125
  ];
125
- return {
126
+ return __foldkitBrandViewResult(({
126
127
  value,
127
128
  index,
128
129
  isActive,
@@ -130,18 +131,18 @@ const internalView = defineView((model, viewInputs) => {
130
131
  isDisabled: isTabDisabledNow,
131
132
  tab: childAttributes(tabAttributes),
132
133
  panel: childAttributes(panelAttributes),
133
- };
134
+ }), "@foldkit/ui/tabs/index.js#anonymous~19");
134
135
  });
135
136
  const tablistAttributes = [
136
137
  h.Role('tablist'),
137
138
  h.AriaOrientation(String.toLowerCase(orientation)),
138
139
  h.AriaLabel(ariaLabel),
139
140
  ];
140
- return toView({
141
+ return __foldkitBrandViewResult((toView({
141
142
  tablist: childAttributes(tablistAttributes),
142
143
  tabs: tabInfos,
143
144
  activeIndex,
144
- });
145
+ })), "@foldkit/ui/tabs/index.js#anonymous~2");
145
146
  });
146
147
  /** Pairs the tabs `view` and `update` behind a single Value-typed entry
147
148
  * point. Declare once at module scope so consumers receive
@@ -164,10 +165,10 @@ const internalView = defineView((model, viewInputs) => {
164
165
  export const create = () => {
165
166
  const cast = (result) =>
166
167
  /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
167
- result;
168
- return {
168
+ __foldkitBrandViewResult((result), "@foldkit/ui/tabs/index.js#cast");
169
+ return __foldkitBrandViewResult(({
169
170
  /* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
170
171
  view: internalView,
171
- update: (model, message) => cast(update(model, message)),
172
- };
172
+ update: (model, message) => __foldkitBrandViewResult((cast(update(model, message))), "@foldkit/ui/tabs/index.js#update~2"),
173
+ }), "@foldkit/ui/tabs/index.js#create");
173
174
  };
@@ -1,3 +1,4 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
1
2
  import { Match as M, Schema as S } from 'effect';
2
3
  import * as Command from 'foldkit/command';
3
4
  import { html } from 'foldkit/html';
@@ -21,51 +22,51 @@ export const initialModel = {
21
22
  dialog: Dialog.init({ id: 'test-dialog', isOpen: true }),
22
23
  };
23
24
  // UPDATE
24
- export const update = (model, message) => M.value(message).pipe(M.withReturnType(), M.tagsExhaustive({
25
- ClickedToggle: () => [{ ...model, isEnabled: !model.isEnabled }, []],
26
- ClickedSubmit: () => [model, []],
25
+ export const update = (model, message) => __foldkitBrandViewResult((M.value(message).pipe(M.withReturnType(), M.tagsExhaustive({
26
+ ClickedToggle: () => __foldkitBrandViewResult(([{ ...model, isEnabled: !model.isEnabled }, []]), "@foldkit/ui/test/apps/disabledButton.js#ClickedToggle"),
27
+ ClickedSubmit: () => __foldkitBrandViewResult(([model, []]), "@foldkit/ui/test/apps/disabledButton.js#ClickedSubmit"),
27
28
  GotDialogMessage: ({ message: dialogMessage }) => {
28
29
  const [nextDialog, commands] = Dialog.update(model.dialog, dialogMessage);
29
- return [
30
+ return __foldkitBrandViewResult(([
30
31
  { ...model, dialog: nextDialog },
31
- Command.mapMessages(commands, dialogMessage => GotDialogMessage({ message: dialogMessage })),
32
- ];
32
+ Command.mapMessages(commands, dialogMessage => __foldkitBrandViewResult((GotDialogMessage({ message: dialogMessage })), "@foldkit/ui/test/apps/disabledButton.js#anonymous")),
33
+ ]), "@foldkit/ui/test/apps/disabledButton.js#GotDialogMessage");
33
34
  },
34
- }));
35
+ }))), "@foldkit/ui/test/apps/disabledButton.js#update");
35
36
  // VIEW
36
37
  const submitButton = (isEnabled) => {
37
38
  const h = html();
38
- return h.button([
39
+ return __foldkitBrandViewResult((h.button([
39
40
  h.Class('submit'),
40
41
  ...(isEnabled ? [h.OnClick(ClickedSubmit())] : [h.Disabled(true)]),
41
- ], ['Submit']);
42
+ ], ['Submit'])), "@foldkit/ui/test/apps/disabledButton.js#submitButton");
42
43
  };
43
44
  /** Plain view, no dialog wrapper. */
44
45
  export const view = (model) => {
45
46
  const h = html();
46
- return h.div([], [
47
+ return __foldkitBrandViewResult((h.div([], [
47
48
  h.button([h.OnClick(ClickedToggle())], ['Toggle']),
48
49
  submitButton(model.isEnabled),
49
- ]);
50
+ ])), "@foldkit/ui/test/apps/disabledButton.js#view");
50
51
  };
51
52
  /** View with submit button inside a dialog's panel. */
52
53
  export const viewWithDialog = (model) => {
53
54
  const h = html();
54
- return h.div([], [
55
+ return __foldkitBrandViewResult((h.div([], [
55
56
  h.button([h.OnClick(ClickedToggle())], ['Toggle']),
56
57
  h.submodel({
57
58
  slotId: model.dialog.id,
58
59
  model: model.dialog,
59
60
  view: Dialog.view,
60
61
  viewInputs: {
61
- toView: ({ dialog, backdrop, panel, isVisible }) => h.dialog([...dialog], isVisible
62
+ toView: ({ dialog, backdrop, panel, isVisible }) => __foldkitBrandViewResult((h.dialog([...dialog], isVisible
62
63
  ? [
63
64
  h.div([...backdrop], []),
64
65
  h.div([...panel], [submitButton(model.isEnabled)]),
65
66
  ]
66
- : []),
67
+ : [])), "@foldkit/ui/test/apps/disabledButton.js#toView"),
67
68
  },
68
- toParentMessage: message => GotDialogMessage({ message }),
69
+ toParentMessage: message => __foldkitBrandViewResult((GotDialogMessage({ message })), "@foldkit/ui/test/apps/disabledButton.js#toParentMessage"),
69
70
  }),
70
- ]);
71
+ ])), "@foldkit/ui/test/apps/disabledButton.js#viewWithDialog");
71
72
  };
@@ -1,7 +1,8 @@
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
1
2
  import { Predicate } from 'effect';
2
3
  import { html } from 'foldkit/html';
3
4
  /** Generates the description element ID from the textarea's base ID. */
4
- export const descriptionId = (id) => `${id}-description`;
5
+ export const descriptionId = (id) => __foldkitBrandViewResult((`${id}-description`), "@foldkit/ui/textarea/index.js#descriptionId");
5
6
  /** Renders an accessible textarea by building ARIA attribute groups and delegating layout to the consumer's `toView` callback. */
6
7
  export const view = (config) => {
7
8
  const h = html();
@@ -36,9 +37,9 @@ export const view = (config) => {
36
37
  ];
37
38
  const labelAttributes = [h.For(id)];
38
39
  const descriptionAttributes = [h.Id(descriptionId(id))];
39
- return toView({
40
+ return __foldkitBrandViewResult((toView({
40
41
  textarea: allTextareaAttributes,
41
42
  label: labelAttributes,
42
43
  description: descriptionAttributes,
43
- });
44
+ })), "@foldkit/ui/textarea/index.js#view");
44
45
  };