@tempots/beatui 1.0.0 → 1.1.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 (57) hide show
  1. package/dist/auth/index.cjs.js +1 -1
  2. package/dist/auth/index.es.js +1 -1
  3. package/dist/auth-divider-3t_-R0sL.cjs +1 -0
  4. package/dist/{auth-divider-BQIhr3-R.js → auth-divider-Cp3xGpHr.js} +14 -14
  5. package/dist/beatui.css +36 -15
  6. package/dist/beatui.tailwind.css +36 -15
  7. package/dist/better-auth/index.cjs.js +1 -1
  8. package/dist/better-auth/index.es.js +6 -6
  9. package/dist/{deep-merge-EkjEgK0N.cjs → deep-merge-Bz9HHpRt.cjs} +1 -1
  10. package/dist/{deep-merge-BzIheQtH.js → deep-merge-Da602mAN.js} +1 -1
  11. package/dist/{duration-input-DGzmIImj.js → duration-input-HM1i6RRY.js} +2 -2
  12. package/dist/{duration-input-ClgYjeBa.cjs → duration-input-g-cQ3cs1.cjs} +1 -1
  13. package/dist/index.cjs.js +4 -4
  14. package/dist/index.es.js +5394 -5251
  15. package/dist/json-schema/index.cjs.js +1 -1
  16. package/dist/json-schema/index.es.js +5 -5
  17. package/dist/json-structure/index.cjs.js +1 -1
  18. package/dist/json-structure/index.es.js +3 -3
  19. package/dist/notice-BNghd0oS.cjs +1 -0
  20. package/dist/notice-Dtz7ADVH.js +211 -0
  21. package/dist/prosemirror/index.cjs.js +1 -1
  22. package/dist/prosemirror/index.es.js +1 -1
  23. package/dist/text-input-DL9FvpTZ.cjs +1 -0
  24. package/dist/text-input-dDUEUmlC.js +57 -0
  25. package/dist/types/components/data/data-table-context.d.ts +4 -3
  26. package/dist/types/components/data/data-table-types.d.ts +31 -17
  27. package/dist/types/components/data/data-table.d.ts +3 -3
  28. package/dist/types/components/data/sortable-header.d.ts +4 -2
  29. package/dist/types/components/form/input/bigint-input.d.ts +3 -3
  30. package/dist/types/components/form/input/color-input.d.ts +3 -1
  31. package/dist/types/components/form/input/create-nullable-string-input.d.ts +2 -2
  32. package/dist/types/components/form/input/date-time-input.d.ts +4 -4
  33. package/dist/types/components/form/input/email-input.d.ts +4 -4
  34. package/dist/types/components/form/input/input-options.d.ts +3 -1
  35. package/dist/types/components/form/input/nullable-bigint-input.d.ts +3 -3
  36. package/dist/types/components/form/input/nullable-date-time-input.d.ts +2 -2
  37. package/dist/types/components/form/input/nullable-email-input.d.ts +3 -3
  38. package/dist/types/components/form/input/nullable-plain-date-input.d.ts +1 -0
  39. package/dist/types/components/form/input/nullable-plain-date-time-input.d.ts +1 -0
  40. package/dist/types/components/form/input/nullable-plain-time-input.d.ts +1 -0
  41. package/dist/types/components/form/input/nullable-plain-year-month-input.d.ts +1 -0
  42. package/dist/types/components/form/input/plain-date-input.d.ts +1 -0
  43. package/dist/types/components/form/input/plain-date-time-input.d.ts +1 -0
  44. package/dist/types/components/form/input/plain-time-input.d.ts +1 -0
  45. package/dist/types/components/form/input/plain-year-month-input.d.ts +1 -0
  46. package/dist/types/components/form/input/slider-input.d.ts +24 -6
  47. package/dist/types/components/form/input/switch.d.ts +3 -1
  48. package/dist/types/components/overlay/dialogs.d.ts +10 -2
  49. package/dist/widget-customization-DOWmUuPU.cjs +1 -0
  50. package/dist/{widget-customization-Dkx7kNSe.js → widget-customization-YhVcA-KM.js} +350 -341
  51. package/package.json +1 -1
  52. package/dist/auth-divider-DvnUModP.cjs +0 -1
  53. package/dist/notice-E19wu9lA.js +0 -209
  54. package/dist/notice-_9XhdrFw.cjs +0 -1
  55. package/dist/text-input-DfqXolVe.js +0 -55
  56. package/dist/text-input-X_q01NsY.cjs +0 -1
  57. package/dist/widget-customization-DgW1SXN6.cjs +0 -1
@@ -0,0 +1,57 @@
1
+ import { Fragment as C, attr as n, aria as r, Value as b, html as f, Empty as m, on as s, emitValue as c } from "@tempots/dom";
2
+ import { I as g } from "./input-container-BvEcp7FU.js";
3
+ function T(t, e, u) {
4
+ const { value: a, onChange: l, onInput: o, ...i } = t;
5
+ return {
6
+ ...i,
7
+ value: b.map(a, e),
8
+ onChange: l != null ? (p) => l(u(p)) : void 0,
9
+ onInput: o != null ? (p) => o(u(p)) : void 0
10
+ };
11
+ }
12
+ const h = ({
13
+ autocomplete: t,
14
+ ariaLabel: e,
15
+ autofocus: u,
16
+ classes: a,
17
+ disabled: l,
18
+ name: o,
19
+ placeholder: i,
20
+ id: p,
21
+ required: I,
22
+ tabIndex: v,
23
+ hasError: d
24
+ }) => C(
25
+ n.autocomplete(t),
26
+ n.autofocus(u),
27
+ n.class(a?.input),
28
+ n.disabled(l),
29
+ n.name(o ?? p),
30
+ n.placeholder(i),
31
+ n.id(p),
32
+ r.required(I),
33
+ e != null ? r.label(e) : null,
34
+ n.tabindex(v),
35
+ d != null ? r.invalid(
36
+ d ?? !1
37
+ ) : null
38
+ ), V = (t) => {
39
+ const { value: e, onBlur: u, onChange: a, onInput: l, type: o } = t;
40
+ return g({
41
+ ...t,
42
+ input: f.input(
43
+ n.type(o ?? "text"),
44
+ h(t),
45
+ n.value(e),
46
+ n.class("bc-input"),
47
+ u != null ? s.blur(c(u)) : m,
48
+ a != null ? s.change(c(a)) : m,
49
+ l != null ? s.input(c(l)) : m
50
+ )
51
+ });
52
+ };
53
+ export {
54
+ h as C,
55
+ V as T,
56
+ T as m
57
+ };
@@ -23,12 +23,13 @@ export interface DataTableContext<T, C extends string = string> {
23
23
  selectable: Value<boolean>;
24
24
  selectableSignal: Signal<boolean>;
25
25
  selectOnRowClickSignal: Signal<boolean>;
26
- selectionAfter: boolean;
26
+ selectionAfter: Value<boolean>;
27
27
  sortable: Value<boolean>;
28
+ multiSort: Value<boolean>;
28
29
  size: Value<ControlSize>;
29
30
  onRowClick?: (row: T) => void;
30
- filterLayout: 'header' | 'row';
31
- hasFilters: boolean;
31
+ filterLayout: Value<'header' | 'row'>;
32
+ hasFilters: Value<boolean>;
32
33
  loading: Value<boolean>;
33
34
  showFooter: Value<boolean>;
34
35
  emptyContent?: TNode;
@@ -112,6 +112,15 @@ export interface DataTableToolbarOptions {
112
112
  /** Bulk actions available when rows are selected */
113
113
  bulkActions?: BulkAction[];
114
114
  }
115
+ /**
116
+ * Options for row selection behavior.
117
+ */
118
+ export interface SelectionOptions {
119
+ /** Position of selection checkboxes. @default 'before' */
120
+ position?: 'before' | 'after';
121
+ /** Toggle row selection when clicking anywhere on the row. @default false */
122
+ selectOnRowClick?: boolean;
123
+ }
115
124
  /**
116
125
  * Configuration options for the {@link DataTable} component.
117
126
  *
@@ -125,25 +134,30 @@ export interface DataTableOptions<T, C extends string = string> {
125
134
  columns: DataColumnDef<T, C>[];
126
135
  /** Returns a unique string ID for each row */
127
136
  rowId: (row: T) => string;
128
- /** Enable sorting (columns opt-in via `column.sortable`). @default false */
129
- sortable?: Value<boolean>;
130
- /** Allow sorting by multiple columns. @default false */
131
- multiSort?: Value<boolean>;
132
- /** Enable filtering (columns opt-in via `column.filter`). @default false */
133
- filterable?: Value<boolean>;
134
137
  /**
135
- * Where to render filter controls.
136
- * - `'header'`: all filters render inline in the header row as icon triggers
137
- * - `'row'`: all filters render in a dedicated row below the header
138
- * @default 'header'
138
+ * Enable sorting. Columns opt-in via `column.sortable`.
139
+ * - `false` sorting disabled (default)
140
+ * - `true` or `'single'` single-column sorting
141
+ * - `'multi'` — multi-column sorting
142
+ * @default false
139
143
  */
140
- filterLayout?: 'header' | 'row';
141
- /** Show selection checkboxes. @default false */
142
- selectable?: Value<boolean>;
143
- /** Position of selection checkboxes. @default 'before' */
144
- selectionPosition?: 'before' | 'after';
145
- /** Toggle row selection when clicking anywhere on the row. @default false */
146
- selectOnRowClick?: Value<boolean>;
144
+ sortable?: Value<false | true | 'single' | 'multi'>;
145
+ /**
146
+ * Enable filtering. Columns opt-in via `column.filter`.
147
+ * - `false` filtering disabled (default)
148
+ * - `true` or `'header'` filters render inline in column header menus
149
+ * - `'row'` filters render in a dedicated row below the header
150
+ * @default false
151
+ */
152
+ filterable?: Value<false | true | 'header' | 'row'>;
153
+ /**
154
+ * Enable row selection with checkboxes.
155
+ * - `false` — selection disabled (default)
156
+ * - `true` — selection enabled with default options
157
+ * - `SelectionOptions` — selection enabled with custom options
158
+ * @default false
159
+ */
160
+ selectable?: Value<false | true | SelectionOptions>;
147
161
  /** Enable drag-to-reorder columns. @default false */
148
162
  reorderableColumns?: Value<boolean>;
149
163
  /** Called when column order changes via drag-and-drop */
@@ -26,9 +26,9 @@ import { DataTableOptions } from './data-table-types';
26
26
  * ] } },
27
27
  * ],
28
28
  * rowId: u => u.id,
29
- * sortable: true,
30
- * filterable: true,
31
- * selectable: true,
29
+ * sortable: 'multi',
30
+ * filterable: 'header',
31
+ * selectable: { position: 'before', selectOnRowClick: true },
32
32
  * pagination: { pageSize: 20 },
33
33
  * toolbar: { bulkActions: [{ label: 'Delete', onClick: sel => deleteUsers(sel) }] },
34
34
  * fullWidth: true,
@@ -20,8 +20,10 @@ export interface SortableHeaderOptions<T, C extends string = string> {
20
20
  menu?: TNode;
21
21
  /** Hide the sort icon when no sort is active. @default false */
22
22
  hideInactiveIcon?: boolean;
23
+ /** Whether multi-sort is enabled (shows "Hold Shift" hint). @default true */
24
+ multiSort?: Value<boolean>;
23
25
  /** Whether this header is draggable (for column reordering). @default false */
24
- draggable?: boolean;
26
+ draggable?: Value<boolean>;
25
27
  /** Drag start handler */
26
28
  onDragStart?: (e: DragEvent) => void;
27
29
  /** Drag over handler */
@@ -52,4 +54,4 @@ export interface SortableHeaderOptions<T, C extends string = string> {
52
54
  * )
53
55
  * ```
54
56
  */
55
- export declare function SortableHeader<T, C extends string = string>({ dataSource, column, size, actions, menu, hideInactiveIcon, draggable: isDraggable, onDragStart, onDragOver, onDrop, onDragEnd, }: SortableHeaderOptions<T, C>, ...children: TNode[]): import("@tempots/dom").Renderable;
57
+ export declare function SortableHeader<T, C extends string = string>({ dataSource, column, size, actions, menu, hideInactiveIcon, multiSort: multiSortEnabled, draggable: isDraggable, onDragStart, onDragOver, onDrop, onDragEnd, }: SortableHeaderOptions<T, C>, ...children: TNode[]): import("@tempots/dom").Renderable;
@@ -6,11 +6,11 @@ import { InputOptions } from './input-options';
6
6
  * Extends standard `InputOptions` for `bigint` values with stepper and range constraints.
7
7
  */
8
8
  export type BigintInputOptions = Merge<InputOptions<bigint>, {
9
- /** Step value for increment/decrement buttons. If provided, stepper buttons are shown. */
9
+ /** Step value for increment/decrement buttons. If provided, stepper buttons are shown. @default 1n */
10
10
  step?: Value<bigint>;
11
- /** Minimum allowed value. Values below this are clamped. */
11
+ /** Minimum allowed value. Values below this are clamped. @default 0n */
12
12
  min?: Value<bigint>;
13
- /** Maximum allowed value. Values above this are clamped. */
13
+ /** Maximum allowed value. Values above this are clamped. @default 100n */
14
14
  max?: Value<bigint>;
15
15
  }>;
16
16
  /**
@@ -6,7 +6,9 @@ import { InputOptions } from './input-options';
6
6
  * Extends {@link InputOptions} for string color values with an optional size
7
7
  * property for the color swatch preview.
8
8
  */
9
- export type ColorInputOptions = InputOptions<string> & {
9
+ export type ColorInputOptions = Omit<InputOptions<string>, 'value'> & {
10
+ /** The current color value as a CSS color string. @default '#000000' */
11
+ value?: Value<string>;
10
12
  /** Size in pixels of the color swatch preview (square). @default 32 */
11
13
  swatchSize?: Value<number>;
12
14
  };
@@ -12,13 +12,13 @@ export declare const nullToEmpty: (value: null | string) => string;
12
12
  * Factory function to create nullable string input components.
13
13
  * Eliminates duplication across nullable text-based inputs.
14
14
  *
15
- * @param BaseInput - The base input component (e.g., TextInput, NativeEmailInput, PasswordInput)
15
+ * @param BaseInput - The base input component (e.g., TextInput, EmailInput, PasswordInput)
16
16
  * @returns A nullable version of the input component
17
17
  *
18
18
  * @example
19
19
  * ```ts
20
20
  * export const NullableTextInput = createNullableStringInput(TextInput)
21
- * export const NativeNullableEmailInput = createNullableStringInput(NativeEmailInput)
21
+ * export const NullableEmailInput = createNullableStringInput(EmailInput)
22
22
  * ```
23
23
  */
24
24
  export declare function createNullableStringInput(BaseInput: (options: InputOptions<string>) => Renderable): (options: InputOptions<null | string>) => Renderable;
@@ -13,10 +13,10 @@ import { InputOptions } from './input-options';
13
13
  * @example
14
14
  * ```ts
15
15
  * import { prop } from '@tempots/dom'
16
- * import { DateTimeInput } from '@tempots/beatui'
16
+ * import { NativeDateTimeInput } from '@tempots/beatui'
17
17
  *
18
18
  * const appointment = prop(new Date())
19
- * DateTimeInput({
19
+ * NativeDateTimeInput({
20
20
  * value: appointment,
21
21
  * onChange: appointment.set,
22
22
  * })
@@ -25,7 +25,7 @@ import { InputOptions } from './input-options';
25
25
  * @example
26
26
  * ```ts
27
27
  * // With label via InputWrapper
28
- * DateTimeInput({
28
+ * NativeDateTimeInput({
29
29
  * value: prop(new Date()),
30
30
  * onChange: (d) => console.log('Selected:', d.toISOString()),
31
31
  * disabled: false,
@@ -33,4 +33,4 @@ import { InputOptions } from './input-options';
33
33
  * })
34
34
  * ```
35
35
  */
36
- export declare const DateTimeInput: (options: InputOptions<Date>) => import("@tempots/dom").Renderable;
36
+ export declare const NativeDateTimeInput: (options: InputOptions<Date>) => import("@tempots/dom").Renderable;
@@ -13,10 +13,10 @@ import { InputOptions } from './input-options';
13
13
  * @example
14
14
  * ```ts
15
15
  * import { prop } from '@tempots/dom'
16
- * import { NativeEmailInput } from '@tempots/beatui'
16
+ * import { EmailInput } from '@tempots/beatui'
17
17
  *
18
18
  * const email = prop('')
19
- * NativeEmailInput({
19
+ * EmailInput({
20
20
  * value: email,
21
21
  * onChange: email.set,
22
22
  * })
@@ -25,7 +25,7 @@ import { InputOptions } from './input-options';
25
25
  * @example
26
26
  * ```ts
27
27
  * // Override the default before icon
28
- * NativeEmailInput({
28
+ * EmailInput({
29
29
  * value: prop(''),
30
30
  * onChange: (v) => console.log('Email:', v),
31
31
  * before: Icon({ icon: 'custom-email-icon' }),
@@ -33,4 +33,4 @@ import { InputOptions } from './input-options';
33
33
  * })
34
34
  * ```
35
35
  */
36
- export declare const NativeEmailInput: (options: InputOptions<string>) => import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
36
+ export declare const EmailInput: (options: InputOptions<string>) => import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
@@ -54,6 +54,8 @@ export type CommonInputOptions = {
54
54
  required?: Value<boolean>;
55
55
  /** Tab index for keyboard navigation order */
56
56
  tabIndex?: Value<number>;
57
+ /** Accessible label for the input (applied as aria-label) */
58
+ ariaLabel?: Value<string>;
57
59
  /**
58
60
  * Visual size of the control, aligned with Button sizes.
59
61
  * @default 'md'
@@ -145,4 +147,4 @@ export declare function mapInputOptions<Outer, Inner>(options: InputOptions<Oute
145
147
  * )
146
148
  * ```
147
149
  */
148
- export declare const CommonInputAttributes: ({ autocomplete, autofocus, classes, disabled, name, placeholder, id, required, tabIndex, hasError, }: CommonInputOptions) => import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
150
+ export declare const CommonInputAttributes: ({ autocomplete, ariaLabel, autofocus, classes, disabled, name, placeholder, id, required, tabIndex, hasError, }: CommonInputOptions) => import("@tempots/core").Renderable<import("@tempots/dom").DOMContext, typeof import("@tempots/dom").DOM_RENDERABLE_TYPE>;
@@ -6,11 +6,11 @@ import { InputOptions } from './input-options';
6
6
  * Extends standard `InputOptions` for `bigint | null` values with stepper and range constraints.
7
7
  */
8
8
  export type NullableBigintInputOptions = Merge<InputOptions<bigint | null>, {
9
- /** Step value for increment/decrement buttons. If provided, stepper buttons are shown. */
9
+ /** Step value for increment/decrement buttons. If provided, stepper buttons are shown. @default 1n */
10
10
  step?: Value<bigint>;
11
- /** Minimum allowed value. Values below this are clamped. */
11
+ /** Minimum allowed value. Values below this are clamped. @default 0n */
12
12
  min?: Value<bigint>;
13
- /** Maximum allowed value. Values above this are clamped. */
13
+ /** Maximum allowed value. Values above this are clamped. @default 100n */
14
14
  max?: Value<bigint>;
15
15
  }>;
16
16
  /**
@@ -12,10 +12,10 @@ import { InputOptions } from './input-options';
12
12
  *
13
13
  * @example
14
14
  * ```ts
15
- * NullableDateTimeInput({
15
+ * NativeNullableDateTimeInput({
16
16
  * value: prop<Date | null>(new Date()),
17
17
  * onChange: date => console.log('DateTime:', date),
18
18
  * })
19
19
  * ```
20
20
  */
21
- export declare const NullableDateTimeInput: (options: InputOptions<Date | null>) => import("@tempots/dom").Renderable;
21
+ export declare const NativeNullableDateTimeInput: (options: InputOptions<Date | null>) => import("@tempots/dom").Renderable;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * A nullable variant of {@link NativeEmailInput} that maps between `string | null` and `string`.
2
+ * A nullable variant of {@link EmailInput} that maps between `string | null` and `string`.
3
3
  *
4
4
  * Empty strings are converted to `null` on change, and `null` values are displayed
5
5
  * as empty strings. Includes a reset button to clear the value back to `null`.
@@ -9,11 +9,11 @@
9
9
  *
10
10
  * @example
11
11
  * ```ts
12
- * NativeNullableEmailInput({
12
+ * NullableEmailInput({
13
13
  * value: prop<string | null>(null),
14
14
  * placeholder: 'Enter email or leave empty...',
15
15
  * onChange: v => console.log('Email:', v), // null or string
16
16
  * })
17
17
  * ```
18
18
  */
19
- export declare const NativeNullableEmailInput: (options: import("./input-options").InputOptions<null | string>) => import("@tempots/dom").Renderable;
19
+ export declare const NullableEmailInput: (options: import("./input-options").InputOptions<null | string>) => import("@tempots/dom").Renderable;
@@ -28,6 +28,7 @@ export declare const NullablePlainDateInput: (options: {
28
28
  id?: import("@tempots/core").Value<string> | undefined;
29
29
  required?: import("@tempots/core").Value<boolean> | undefined;
30
30
  tabIndex?: import("@tempots/core").Value<number> | undefined;
31
+ ariaLabel?: import("@tempots/core").Value<string> | undefined;
31
32
  size?: import("@tempots/core").Value<import("../../theme").ControlSize> | undefined;
32
33
  value: import("@tempots/core").Value<import("@js-temporal/polyfill").Temporal.PlainDate | null>;
33
34
  before?: import("@tempots/dom").TNode;
@@ -28,6 +28,7 @@ export declare const NullablePlainDateTimeInput: (options: {
28
28
  id?: import("@tempots/core").Value<string> | undefined;
29
29
  required?: import("@tempots/core").Value<boolean> | undefined;
30
30
  tabIndex?: import("@tempots/core").Value<number> | undefined;
31
+ ariaLabel?: import("@tempots/core").Value<string> | undefined;
31
32
  size?: import("@tempots/core").Value<import("../../theme").ControlSize> | undefined;
32
33
  value: import("@tempots/core").Value<import("@js-temporal/polyfill").Temporal.PlainDateTime | null>;
33
34
  before?: import("@tempots/dom").TNode;
@@ -28,6 +28,7 @@ export declare const NullablePlainTimeInput: (options: {
28
28
  id?: import("@tempots/core").Value<string> | undefined;
29
29
  required?: import("@tempots/core").Value<boolean> | undefined;
30
30
  tabIndex?: import("@tempots/core").Value<number> | undefined;
31
+ ariaLabel?: import("@tempots/core").Value<string> | undefined;
31
32
  size?: import("@tempots/core").Value<import("../../theme").ControlSize> | undefined;
32
33
  value: import("@tempots/core").Value<import("@js-temporal/polyfill").Temporal.PlainTime | null>;
33
34
  before?: import("@tempots/dom").TNode;
@@ -28,6 +28,7 @@ export declare const NullablePlainYearMonthInput: (options: {
28
28
  id?: import("@tempots/core").Value<string> | undefined;
29
29
  required?: import("@tempots/core").Value<boolean> | undefined;
30
30
  tabIndex?: import("@tempots/core").Value<number> | undefined;
31
+ ariaLabel?: import("@tempots/core").Value<string> | undefined;
31
32
  size?: import("@tempots/core").Value<import("../../theme").ControlSize> | undefined;
32
33
  value: import("@tempots/core").Value<import("@js-temporal/polyfill").Temporal.PlainYearMonth | null>;
33
34
  before?: import("@tempots/dom").TNode;
@@ -27,6 +27,7 @@ export declare const PlainDateInput: (options: {
27
27
  id?: import("@tempots/core").Value<string> | undefined;
28
28
  required?: import("@tempots/core").Value<boolean> | undefined;
29
29
  tabIndex?: import("@tempots/core").Value<number> | undefined;
30
+ ariaLabel?: import("@tempots/core").Value<string> | undefined;
30
31
  size?: import("@tempots/core").Value<import("../../theme").ControlSize> | undefined;
31
32
  value: import("@tempots/core").Value<import("@js-temporal/polyfill").Temporal.PlainDate>;
32
33
  before?: import("@tempots/dom").TNode;
@@ -27,6 +27,7 @@ export declare const PlainDateTimeInput: (options: {
27
27
  id?: import("@tempots/core").Value<string> | undefined;
28
28
  required?: import("@tempots/core").Value<boolean> | undefined;
29
29
  tabIndex?: import("@tempots/core").Value<number> | undefined;
30
+ ariaLabel?: import("@tempots/core").Value<string> | undefined;
30
31
  size?: import("@tempots/core").Value<import("../../theme").ControlSize> | undefined;
31
32
  value: import("@tempots/core").Value<import("@js-temporal/polyfill").Temporal.PlainDateTime>;
32
33
  before?: import("@tempots/dom").TNode;
@@ -27,6 +27,7 @@ export declare const PlainTimeInput: (options: {
27
27
  id?: import("@tempots/core").Value<string> | undefined;
28
28
  required?: import("@tempots/core").Value<boolean> | undefined;
29
29
  tabIndex?: import("@tempots/core").Value<number> | undefined;
30
+ ariaLabel?: import("@tempots/core").Value<string> | undefined;
30
31
  size?: import("@tempots/core").Value<import("../../theme").ControlSize> | undefined;
31
32
  value: import("@tempots/core").Value<import("@js-temporal/polyfill").Temporal.PlainTime>;
32
33
  before?: import("@tempots/dom").TNode;
@@ -27,6 +27,7 @@ export declare const PlainYearMonthInput: (options: {
27
27
  id?: import("@tempots/core").Value<string> | undefined;
28
28
  required?: import("@tempots/core").Value<boolean> | undefined;
29
29
  tabIndex?: import("@tempots/core").Value<number> | undefined;
30
+ ariaLabel?: import("@tempots/core").Value<string> | undefined;
30
31
  size?: import("@tempots/core").Value<import("../../theme").ControlSize> | undefined;
31
32
  value: import("@tempots/core").Value<import("@js-temporal/polyfill").Temporal.PlainYearMonth>;
32
33
  before?: import("@tempots/dom").TNode;
@@ -8,11 +8,20 @@ import { Merge } from '@tempots/std';
8
8
  * slider range boundaries and step increment.
9
9
  */
10
10
  export type SliderInputOptions = Merge<InputOptions<number>, {
11
- /** Step increment between valid values on the slider */
11
+ /**
12
+ * Step increment between valid values on the slider.
13
+ * @default 1
14
+ */
12
15
  step?: Value<number>;
13
- /** Minimum value of the slider range */
16
+ /**
17
+ * Minimum value of the slider range.
18
+ * @default 0
19
+ */
14
20
  min?: Value<number>;
15
- /** Maximum value of the slider range */
21
+ /**
22
+ * Maximum value of the slider range.
23
+ * @default 100
24
+ */
16
25
  max?: Value<number>;
17
26
  }>;
18
27
  /**
@@ -61,11 +70,20 @@ export declare const SliderInput: (options: SliderInputOptions) => import("@temp
61
70
  * (or 0) when the value is null.
62
71
  */
63
72
  export type NullableSliderInputOptions = Merge<InputOptions<number | null>, {
64
- /** Step increment between valid values on the slider */
73
+ /**
74
+ * Step increment between valid values on the slider.
75
+ * @default 1
76
+ */
65
77
  step?: Value<number>;
66
- /** Minimum value of the slider range */
78
+ /**
79
+ * Minimum value of the slider range.
80
+ * @default 0
81
+ */
67
82
  min?: Value<number>;
68
- /** Maximum value of the slider range */
83
+ /**
84
+ * Maximum value of the slider range.
85
+ * @default 100
86
+ */
69
87
  max?: Value<number>;
70
88
  }>;
71
89
  /**
@@ -32,6 +32,8 @@ export type SwitchOptions = {
32
32
  tabIndex?: Value<number>;
33
33
  /** Whether to add vertical padding so the switch matches the height of text inputs at the same size. @default true */
34
34
  matchInputHeight?: boolean;
35
+ /** Accessible label for the switch (applied as aria-label) */
36
+ ariaLabel?: Value<string>;
35
37
  };
36
38
  /**
37
39
  * A toggle switch component for boolean on/off states with animated thumb transition.
@@ -73,4 +75,4 @@ export type SwitchOptions = {
73
75
  * })
74
76
  * ```
75
77
  */
76
- export declare const Switch: ({ value, onChange, onInput, onBlur, offLabel, onLabel, disabled, size, id, color, tabIndex, matchInputHeight, }: SwitchOptions) => import("@tempots/dom").Renderable;
78
+ export declare const Switch: ({ value, onChange, onInput, onBlur, offLabel, onLabel, disabled, size, id, color, tabIndex, matchInputHeight, ariaLabel, }: SwitchOptions) => import("@tempots/dom").Renderable;
@@ -6,10 +6,12 @@ import { ThemeColorName } from '../../tokens';
6
6
  export interface ConfirmationDialogOptions {
7
7
  /**
8
8
  * Dialog title displayed next to the icon.
9
+ * @default 'Confirm action'
9
10
  */
10
11
  title: Value<string>;
11
12
  /**
12
13
  * Descriptive body text explaining what the action does.
14
+ * @default 'Are you sure you want to proceed? This action cannot be undone.'
13
15
  */
14
16
  body: Value<string>;
15
17
  /**
@@ -25,13 +27,15 @@ export interface ConfirmationDialogOptions {
25
27
  /**
26
28
  * Optional list of consequences displayed as bullet points.
27
29
  */
28
- consequences?: string[];
30
+ consequences?: Value<string[]>;
29
31
  /**
30
32
  * Custom label for the confirm button. Falls back to i18n `confirm` string.
33
+ * @default 'Confirm'
31
34
  */
32
35
  confirmText?: Value<string>;
33
36
  /**
34
37
  * Custom label for the cancel button. Falls back to i18n `cancel` string.
38
+ * @default 'Cancel'
35
39
  */
36
40
  cancelText?: Value<string>;
37
41
  /**
@@ -148,6 +152,7 @@ export declare function AlertDialog(options: AlertDialogOptions, fn: (open: () =
148
152
  export interface PromptDialogOptions {
149
153
  /**
150
154
  * Dialog title displayed in the header.
155
+ * @default 'Enter a value'
151
156
  */
152
157
  title: Value<string>;
153
158
  /**
@@ -156,19 +161,22 @@ export interface PromptDialogOptions {
156
161
  body?: TNode;
157
162
  /**
158
163
  * Placeholder text for the input field.
164
+ * @default 'Type here...'
159
165
  */
160
166
  placeholder?: Value<string>;
161
167
  /**
162
168
  * Default value pre-filled in the input field.
163
169
  * @default ''
164
170
  */
165
- defaultValue?: string;
171
+ defaultValue?: Value<string>;
166
172
  /**
167
173
  * Custom label for the confirm button. Falls back to i18n `confirm` string.
174
+ * @default 'Save'
168
175
  */
169
176
  confirmText?: Value<string>;
170
177
  /**
171
178
  * Custom label for the cancel button. Falls back to i18n `cancel` string.
179
+ * @default 'Cancel'
172
180
  */
173
181
  cancelText?: Value<string>;
174
182
  /**
@@ -0,0 +1 @@
1
+ "use strict";const t=require("@tempots/dom"),k=require("./deep-merge-Bz9HHpRt.cjs"),mt=require("@tempots/std"),B=require("./input-container-Di1YvVB_.cjs"),N=require("./text-input-DL9FvpTZ.cjs"),v=require("./translations-Dbx7L7Q1.cjs"),ft=require("@tempots/ui"),Q=require("./notice-BNghd0oS.cjs"),bt=require("./session-id-B5lJMzbB.cjs"),yt=require("./utils-DmEuG3Np.cjs");function Y(e){if(typeof e!="string")return!1;const n=e.startsWith("#")?e.slice(1):e;return/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(n)}function Z(e){if(typeof e!="string")return!1;const n=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r]=s,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(r,10);return l>=0&&l<=255&&i>=0&&i<=255&&c>=0&&c<=255}function J(e){if(typeof e!="string")return!1;const n=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r,l]=s,i=parseInt(a,10),c=parseInt(o,10),u=parseInt(r,10),p=parseFloat(l);return i>=0&&i<=255&&c>=0&&c<=255&&u>=0&&u<=255&&p>=0&&p<=1}function tt(e){if(typeof e!="string")return!1;const n=/^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r]=s,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(r,10);return l>=0&&l<=360&&i>=0&&i<=100&&c>=0&&c<=100}function wt(e){return Y(e)||Z(e)||J(e)||tt(e)}function et(e){if(!Y(e))return null;let n=e.startsWith("#")?e.slice(1):e;return n.length===3&&(n=n.split("").map(s=>s+s).join("")),`#${n.toLowerCase()}`}function q(e,n,s){const a=o=>{const r=Math.round(Math.max(0,Math.min(255,o))).toString(16);return r.length===1?"0"+r:r};return`#${a(e)}${a(n)}${a(s)}`}function D(e){const n=et(e);if(!n)return null;const s=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return s?{r:parseInt(s[1],16),g:parseInt(s[2],16),b:parseInt(s[3],16)}:null}function It(e,n){const s=D(e),a=D(n);if(!s||!a)return null;const o=(u,p,d)=>{const[b,g,h]=[u,p,d].map(y=>(y=y/255,y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4)));return .2126*b+.7152*g+.0722*h},r=o(s.r,s.g,s.b),l=o(a.r,a.g,a.b),i=Math.max(r,l),c=Math.min(r,l);return(i+.05)/(c+.05)}function nt(e){if(!e)return[0,0,0,1];const s=e.trim().match(/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/);if(s){const u=s[1];if(u.length===8){const p=parseInt(u.slice(0,2),16),d=parseInt(u.slice(2,4),16),b=parseInt(u.slice(4,6),16),g=parseInt(u.slice(6,8),16)/255;return[p,d,b,g]}if(u.length===6)return[parseInt(u.slice(0,2),16),parseInt(u.slice(2,4),16),parseInt(u.slice(4,6),16),1];if(u.length===4){const p=parseInt(u[0]+u[0],16),d=parseInt(u[1]+u[1],16),b=parseInt(u[2]+u[2],16),g=parseInt(u[3]+u[3],16)/255;return[p,d,b,g]}if(u.length===3){const p=parseInt(u[0]+u[0],16),d=parseInt(u[1]+u[1],16),b=parseInt(u[2]+u[2],16);return[p,d,b,1]}}const a=e.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i);if(a)return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])];const o=e.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(o)return[parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10),1];const r=e.match(/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(r){const u=parseFloat(r[1]),p=parseFloat(r[2]),d=parseFloat(r[3]),b=r[4]!=null?parseFloat(r[4]):1,[g,h,y]=G(u,p/100,d/100);return[g,h,y,b]}const l=e.match(/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(l){const u=parseFloat(l[1]),p=parseFloat(l[2])/100,d=parseFloat(l[3])/100,b=l[4]!=null?parseFloat(l[4]):1,[g,h,y]=st(u,p,d);return[g,h,y,b]}const i=e.match(/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(i){const u=i[1],p=parseFloat(i[2]),d=parseFloat(i[3]),b=i[4]!=null?parseFloat(i[4]):1,g=u.endsWith("%")?Math.max(0,Math.min(1,parseFloat(u)/100)):Math.max(0,Math.min(1,parseFloat(u))),[h,y,M]=lt(g,p,d);return[h,y,M,b]}const c=D(e);return c?[c.r,c.g,c.b,1]:[0,0,0,1]}function at(e,n,s,a){return`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(s)}, ${Math.max(0,Math.min(1,Math.round(a*100)/100))})`}function rt(e){let n=e+1831565813;return function(){return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function G(e,n,s){e=(e%360+360)%360;const a=(1-Math.abs(2*s-1))*n,o=a*(1-Math.abs(e/60%2-1)),r=s-a/2;let l,i,c;return 0<=e&&e<60?[l,i,c]=[a,o,0]:60<=e&&e<120?[l,i,c]=[o,a,0]:120<=e&&e<180?[l,i,c]=[0,a,o]:180<=e&&e<240?[l,i,c]=[0,o,a]:240<=e&&e<300?[l,i,c]=[o,0,a]:[l,i,c]=[a,0,o],[Math.round((l+r)*255),Math.round((i+r)*255),Math.round((c+r)*255)]}function st(e,n,s){e=(e%360+360)%360;const a=n+s;a>1&&(n/=a,s/=a);const[o,r,l]=G(e,1,.5).map(d=>d/255),i=1-n-s,c=o*i+n,u=r*i+n,p=l*i+n;return[Math.round(c*255),Math.round(u*255),Math.round(p*255)]}function z(e,n,s){e/=255,n/=255,s/=255;const a=Math.max(e,n,s),o=Math.min(e,n,s);let r=0,l=0;const i=(a+o)/2,c=a-o;if(c!==0){switch(l=i>.5?c/(2-a-o):c/(a+o),a){case e:r=(n-s)/c+(n<s?6:0);break;case n:r=(s-e)/c+2;break;default:r=(e-n)/c+4}r*=60}return[Math.round(r),Math.round(l*100),Math.round(i*100)]}function ot(e,n,s){const[a]=z(e,n,s),o=e/255,r=n/255,l=s/255,i=Math.min(o,r,l),c=1-Math.max(o,r,l);return[a,Math.round(i*100),Math.round(c*100)]}function U(e){const n=e/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function L(e){const n=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.round(Math.max(0,Math.min(1,n))*255)}function lt(e,n,s){const a=s*Math.PI/180,o=Math.cos(a)*n,r=Math.sin(a)*n,l=e+.3963377774*o+.2158037573*r,i=e-.1055613458*o-.0638541728*r,c=e-.0894841775*o-1.291485548*r,u=l*l*l,p=i*i*i,d=c*c*c,b=4.0767416621*u-3.3077115913*p+.2309699292*d,g=-1.2684380046*u+2.6097574011*p-.3413193965*d,h=-.0041960863*u-.7034186147*p+1.707614701*d;return[L(b),L(g),L(h)]}function it(e,n,s){const a=U(e),o=U(n),r=U(s),l=.4122214708*a+.5363325363*o+.0514459929*r,i=.2119034982*a+.6806995451*o+.1073969566*r,c=.0883024619*a+.2817188376*o+.6299787005*r,u=Math.cbrt(l),p=Math.cbrt(i),d=Math.cbrt(c),b=.2104542553*u+.793617785*p-.0040720468*d,g=1.9779984951*u-2.428592205*p+.4505937099*d,h=.0259040371*u+.7827717662*p-.808675766*d,y=Math.sqrt(g*g+h*h);let M=Math.atan2(h,g)*180/Math.PI;return M<0&&(M+=360),[b,y,M]}function R(e,n,s,a,o,r){switch(o){case"hex":if(r){const l=c=>c.toString(16).padStart(2,"0"),i=Math.max(0,Math.min(255,Math.round(a*255)));return`#${l(e)}${l(n)}${l(s)}${l(i)}`}return q(e,n,s);case"rgb":return`rgb(${e}, ${n}, ${s})`;case"rgba":return`rgba(${e}, ${n}, ${s}, ${Math.round(a*100)/100})`;case"hsl":{const[l,i,c]=z(e,n,s);return`hsl(${l}, ${i}%, ${c}%)`}case"hsla":{const[l,i,c]=z(e,n,s);return`hsla(${l}, ${i}%, ${c}%, ${Math.round(a*100)/100})`}case"hwb":{const[l,i,c]=ot(e,n,s);return a<1?`hwb(${l} ${i}% ${c}% / ${Math.round(a*100)/100})`:`hwb(${l} ${i}% ${c}%)`}case"oklch":{const[l,i,c]=it(e,n,s),u=(Math.round(l*1e3)/1e3).toFixed(3),p=(Math.round(i*1e3)/1e3).toFixed(3),d=(Math.round(c*10)/10).toFixed(1),b=Math.round(a*100)/100;return r||a<1?`oklch(${u} ${p} ${d} / ${b})`:`oklch(${u} ${p} ${d})`}}}function E(e,n){return n?e==="rgb"?"rgba":e==="hsl"?"hsla":e:e==="rgba"?"rgb":e==="hsla"?"hsl":e}async function ct(e){return new Promise((n,s)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>{const o=a.result;n(o.split(",")[1])},a.onerror=o=>s(o)})}function Vt(e){return Promise.all(e.map(ct))}function xt(e){if(e.length>=4){if(e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71)return"image/png";if(e[0]===255&&e[1]===216)return"image/jpeg";if(e[0]===71&&e[1]===73&&e[2]===70)return"image/gif";if(e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e.length>=12&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80)return"image/webp"}try{if(new TextDecoder("utf-8").decode(e.slice(0,256)).includes("<svg"))return"image/svg+xml"}catch{}return"application/octet-stream"}function Mt(e){const n=mt.decodeBase64(e??""),s=n.length,a=new Uint8Array(s);for(let o=0;o<s;o++)a[o]=n.charCodeAt(o);return a}function ut(e){const{value:n,onChange:s,onInput:a,...o}=e,r=new Map,l=t.Value.toSignal(n).map(p=>p.map((d,b)=>{const g=r.get(d),h=Mt(d??""),y=g?.type||xt(h),M=g?.name??`file-${b}`,_=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength),w=new Blob([_],{type:y});return new File([w],M,{type:y})})),i=p=>d=>{p&&Vt(d).then(b=>{for(const[g,h]of b.entries())r.set(h,{name:d[g].name,type:d[g].type});p(b)})},c=i(s),u=i(a);return k.FilesInput({...o,value:l,onChange:c,onInput:u})}function $t(e){const{value:n,onInput:s,onChange:a,...o}=e;return ut({...o,maxFiles:1,value:t.Value.map(n,r=>r==null?[]:[r]),onChange:r=>{a?.(r[0])},onInput:r=>{s?.(r[0])}})}function _t(e,n){const[s,a,o]=e,r=s<<16^a<<8^o,l=rt(r),i=6+Math.floor(l()*5),c=.18+l()*.06,u=[];for(let g=0;g<i;g++){const h=g/i*Math.PI*2,y=n*(1+(l()*2-1)*c),M=Math.cos(h)*y,_=Math.sin(h)*y;u.push({x:M,y:_})}const p=(u[0].x+u[i-1].x)/2,d=(u[0].y+u[i-1].y)/2;let b=`M ${p.toFixed(3)} ${d.toFixed(3)}`;for(let g=0;g<i;g++){const h=u[g],y=u[(g+1)%i],M=(h.x+y.x)/2,_=(h.y+y.y)/2;b+=` Q ${h.x.toFixed(3)} ${h.y.toFixed(3)} ${M.toFixed(3)} ${_.toFixed(3)}`}return b+=" Z",b}const Ct=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,displayValue:r,swatchSize:l,withAlpha:i}=e,c={xs:20,sm:26,md:32,lg:40,xl:52},u=l!=null?t.Value.map(l,m=>Number(m)):t.Value.map(e.size??"md",m=>c[m]??32),p=t.Value.map(n,m=>nt(m??"#000000")),d=t.Value.map(p,([m,V,$])=>[m,V,$]),b=t.Value.map(p,([,,,m])=>m),g=t.prop(t.Value.get(b)??1),h=t.Value.map(i??!1,m=>m),y=t.Value.map(e.colorTextFormat??"rgb",m=>m),M=t.computedOf(d,g,y,h)(([m,V,$],T,A,F)=>R(m,V,$,T??1,E(A,F),F)),_=t.Value.map(e.colorTextFormat??"hex",m=>m),w=t.Value.map(u,m=>`${-m/2} ${-m/2} ${m} ${m}`),f=t.computedOf(d,u)((m,V)=>_t(m,V/2)),I=t.computedOf(d,g,h)(([m,V,$],T,A)=>A||T<1?at(m,V,$,T):q(m,V,$)),C=t.html.div(t.attr.class("bc-color-swatch-input__control"),t.attr.class(t.Value.map(h,m=>m?"bc-color-swatch-input__control--alpha":"")),t.attr.style(t.computedOf(u)(m=>`width:${m+2}px;height:${m+2}px`)),t.svg.svg(t.attr.class("bc-color-swatch-input__svg"),t.svgAttr.viewBox(w),t.svg.path(t.svgAttr.d(f),t.svgAttr.fill(I))),t.html.input(t.attr.type("color"),N.CommonInputAttributes(e),t.attr.value(t.Value.map(d,([m,V,$])=>q(m,V,$))),t.attr.class("bc-input bc-color-swatch-input bc-color-swatch-input__native"),s!=null?t.on.blur(s):t.Empty,a!=null?t.on.change(m=>{const V=m.target.value;if(!a)return;const{r:$,g:T,b:A}=D(V)??{r:0,g:0,b:0},F=t.Value.get(g)??1,S=E(t.Value.get(_),t.Value.get(h)),X=R($,T,A,F,S,t.Value.get(h));a(X)}):t.Empty,o!=null?t.on.input(m=>{const V=m.target.value;if(!o)return;const{r:$,g:T,b:A}=D(V)??{r:0,g:0,b:0},F=t.Value.get(g)??1,S=E(t.Value.get(_),t.Value.get(h)),X=R($,T,A,F,S,t.Value.get(h));o(X)}):t.Empty)),x=t.When(h,()=>t.html.input(t.attr.type("range"),t.attr.class("bc-color-swatch-input__alpha"),t.attr.min(0),t.attr.max(1),t.attr.step(.01),t.attr.value(t.Value.map(g,m=>String(m??1))),t.attr.disabled(e.disabled),t.on.input(m=>{const V=parseFloat(m.target.value);g.set(V);const[$,T,A]=t.Value.get(d),F=E(t.Value.get(_),t.Value.get(h)),S=R($,T,A,V,F,t.Value.get(h));o?.(S)}),t.on.change(m=>{const V=parseFloat(m.target.value);g.set(V);const[$,T,A]=t.Value.get(d),F=E(t.Value.get(_),t.Value.get(h)),S=R($,T,A,V,F,t.Value.get(h));a?.(S)}))),{swatchSize:W,displayValue:H,withAlpha:j,colorTextFormat:K,...P}=e;return B.InputContainer({baseContainer:!0,...P,growInput:!1,input:C,after:t.Fragment(t.When(r??!1,()=>t.html.span(t.attr.class("bc-color-swatch-input__rgb"),M)),x,e.after)})},pt=e=>typeof e=="string"&&e.trim()===""?null:e,dt=e=>e??"";function O(e){return n=>{const{after:s,disabled:a}=n,o=N.mapInputOptions(n,dt,pt),r=k.NullableResetAfter(n.value,a,n.onChange??n.onInput);return e({...o,after:s!=null?t.Fragment(r,s):r})}}const Tt=({startEditing:e,value:n,onChange:s,placeholder:a,disabled:o})=>{const r=t.Value.deriveProp(e??!1),l=t.prop(!1),i=t.Value.map(o??!1,c=>c);return t.html.div(t.attr.class("bc-editable-text"),t.attr.class(t.Value.map(i,c=>c?"bc-editable-text--disabled":"")),t.aria.disabled(i),t.When(r,()=>t.html.input(t.attr.placeholder(a),t.attr.value(n),t.attr.class("bc-editable-text__input"),ft.AutoSelect(),t.on.keydown(c=>{c.key==="Enter"?r.set(!1):c.key==="Escape"&&(l.set(!0),r.set(!1))}),t.on.blur(t.emitValue(c=>{if(r.set(!1),l.value){l.set(!1);return}s(c)}))),()=>t.html.span(t.on.click(()=>{t.Value.get(i)||r.set(!0)}),t.attr.class("bc-editable-text__display"),t.When(t.Value.map(n,c=>c!=null&&c.trim()!==""),()=>t.html.span(t.attr.class("bc-editable-text__text"),n),()=>t.html.span(t.attr.class("bc-editable-text__placeholder"),a)),t.When(t.Value.map(i,c=>!c),()=>t.html.button(t.attr.type("button"),t.attr.class("bc-editable-text__edit-button"),t.Use(v.BeatUII18n,c=>t.aria.label(c.$.editLabel)),t.on.click(()=>r.set(!0)),v.Icon({icon:"line-md/pencil",color:"neutral"}))))))},At=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,after:r,disabled:l}=e,i=k.NullableResetAfter(n,l,a??o);return B.InputContainer({...e,input:t.input.date(N.CommonInputAttributes(e),t.attr.valueAsDate(n),t.attr.class("bc-input"),s!=null?t.on.blur(t.emitValue(s)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDate(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDate(o)):t.Empty),after:r!=null?t.Fragment(i,r):i})},Ft=e=>{const n=e.getFullYear(),s=e.getMonth()+1,a=e.getDate(),o=e.getHours(),r=e.getMinutes(),l=e.getSeconds();return`${n}-${s.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${o.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`},kt=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,after:r,disabled:l}=e,i=t.Value.map(n,u=>u!=null?Ft(u):null),c=k.NullableResetAfter(n,l,a??o);return B.InputContainer({...e,input:t.input["datetime-local"](N.CommonInputAttributes(e),t.attr.value(t.Value.map(i,u=>u??null)),t.attr.class("bc-input"),s!=null?t.on.blur(t.emitValue(s)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDateTime(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDateTime(o)):t.Empty),after:r!=null?t.Fragment(c,r):c})},Nt=O(Q.EmailInput),St=O(N.TextInput),vt=O(Q.PasswordInput),Rt=O(k.TextArea),Et=({value:e,onChange:n,onInput:s,onBlur:a,offLabel:o,onLabel:r,disabled:l=!1,size:i="md",id:c,color:u="primary",tabIndex:p=0,matchInputHeight:d=!0,ariaLabel:b})=>{const g=c??bt.sessionId("switch");function h(w,f){const I=["bc-switch",`bc-switch--size-${f}`,`bc-switch--${f}`];return d&&I.push("bc-switch--match-input"),w&&I.push("bc-switch--disabled"),I.join(" ")}function y(w){const f=w??"primary",I=new Map,C=v.backgroundValue(f,"solid","light"),x=v.backgroundValue(f,"solid","dark");return I.set("--switch-track-on-bg",C.backgroundColor),I.set("--switch-track-on-label",C.textColor),I.set("--switch-track-on-bg-dark",x.backgroundColor),I.set("--switch-track-on-label-dark",x.textColor),I.set("--switch-track-on-border-dark",v.borderColorValue(f,"dark")),Array.from(I.entries()).map(([W,H])=>`${W}: ${H}`).join("; ")}const M=()=>{t.Value.get(l)||(n?.(!t.Value.get(e)),s?.(!t.Value.get(e)))},_=w=>{t.Value.get(l)||(w.key===" "||w.key==="Enter")&&(w.preventDefault(),M())};return t.html.div(t.attr.class(t.computedOf(l??!1,i)((w,f)=>h(w??!1,f??"md"))),t.attr.style(t.computedOf(u)(w=>y(w))),t.attr.id(g),t.attr.role("switch"),t.attr.tabindex(t.computedOf(l??!1,p)((w,f)=>w?-1:f??0)),t.aria.checked(e),t.aria.disabled(l),b!=null?t.aria.label(b):null,t.on.click(M),t.on.keydown(_),a!=null?t.on.blur(a):null,t.html.div(t.attr.class("bc-switch__track"),t.attr.class(t.Value.map(e,w=>w?"bc-switch__track--on":"bc-switch__track--off")),o!=null?t.html.div(t.aria.hidden(!0),t.attr.class("bc-switch__track-label bc-switch__track-label--off"),t.attr.class(t.Value.map(e,w=>w?"bc-switch__track-label--hidden":"bc-switch__track-label--visible")),o):null,r!=null?t.html.div(t.attr.class("bc-switch__track-label bc-switch__track-label--on"),t.attr.class(t.Value.map(e,w=>w?"bc-switch__track-label--visible":"bc-switch__track-label--hidden")),r):null,t.html.div(t.attr.class("bc-switch__thumb"),t.attr.class(t.Value.map(e,w=>w?"bc-switch__thumb--on":"bc-switch__thumb--off")))))},Dt=O(k.UuidInput),Bt="line-md:star-alt-filled",Ot="line-md:star-alt",ht=e=>{const{value:n,onChange:s,onInput:a,disabled:o,max:r=5,fullColor:l="yellow",emptyColor:i="neutral",activeIcon:c=Bt,inactiveIcon:u=Ot,size:p="md",onBlur:d,rounding:b=1}=e,g=()=>{const f=t.Value.get(b);return f>0?f:1},h=f=>Math.min(Math.max(f,0),t.Value.get(r)),y=(f,I)=>{if(t.Value.get(o??!1))return;const x=f.currentTarget.getBoundingClientRect(),W=(f.clientX-x.left)/x.width,H=I-1+W,j=g(),K=Math.ceil(H/j)*j,P=h(K);s?.(P),a?.(P)},M=f=>{if(t.Value.get(o??!1))return;const I=g(),C=t.Value.get(n)??0;let x;switch(f.key){case"ArrowRight":case"ArrowUp":x=h(C+I);break;case"ArrowLeft":case"ArrowDown":x=h(C-I);break;case"Home":x=0;break;case"End":x=t.Value.get(r);break;default:return}f.preventDefault(),s?.(x),a?.(x)},_=t.Value.map(p,f=>`bc-icon--${f}`),w=({index:f,counter:I})=>t.html.span(t.attr.class("bc-rating-input__icon-container"),t.attr.class(_),t.on.click(t.emit(C=>y(C,I),{preventDefault:!0,stopPropagation:!0})),v.Icon({icon:u,size:p,color:i,tone:"soft"},t.attr.class("bc-rating-input__icon-empty")),t.html.span(t.attr.class("bc-rating-input__icon-clipper"),t.attr.class(_),t.style.width(t.Value.map(n,C=>{const x=Math.floor(C);return x>f?"100%":x<f?"0%":`${(C-f)*100}%`})),v.Icon({icon:c,size:p,color:l,tone:"soft"},t.attr.class("bc-rating-input__icon-full"))));return B.InputContainer({baseContainer:!0,growInput:!1,focusableSelector:'[role="slider"]',...e,input:t.html.div(N.CommonInputAttributes(e),t.attr.class("bc-rating-input"),t.attr.role("slider"),t.attr.tabindex(t.Value.map(o??!1,f=>f?-1:0)),t.aria.disabled(o??!1),t.aria.valuemin(0),t.aria.valuemax(t.Value.map(r,f=>f??0)),t.aria.valuenow(t.Value.map(n,f=>f??0)),t.aria.valuetext(t.computedOf(n,r)((f,I)=>{const C=f??0,x=I??0;return`${String(C)} / ${String(x)}`})),t.on.keydown(M),d!=null?t.on.blur(d):null,t.Repeat(r,w))})},Wt=e=>{const{after:n,disabled:s}=e,a=N.mapInputOptions(e,r=>r??0,r=>r),o=k.NullableResetAfter(e.value,s,e.onChange??e.onInput);return ht({...a,after:n!=null?t.Fragment(o,n):o})},Ht=e=>{const{value:n,step:s,min:a,max:o,onBlur:r,onChange:l,onInput:i}=e;return B.InputContainer({...e,focusableSelector:'input[type="range"]',input:t.html.input(t.attr.type("range"),N.CommonInputAttributes(e),t.attr.min(a),t.attr.max(o),t.attr.step(s),t.attr.valueAsNumber(n),t.attr.class("bc-input bc-slider-input"),r!=null?t.on.blur(t.emitValueAsNumber(r)):t.Empty,l!=null?t.on.change(t.emitValueAsNumber(l)):t.Empty,i!=null?t.on.input(t.emitValueAsNumber(i)):t.Empty)})},Pt=e=>{const{value:n,step:s,min:a,max:o,onBlur:r,onChange:l,onInput:i}=e,c=t.Value.map(n,p=>{if(p!=null)return p;const d=a!=null?t.Value.get(a):void 0;return typeof d=="number"?d:0}),u=k.NullableResetAfter(n,e.disabled,l??i);return B.InputContainer({...e,focusableSelector:'input[type="range"]',after:u,input:t.html.input(t.attr.type("range"),N.CommonInputAttributes(e),t.attr.min(a),t.attr.max(o),t.attr.step(s),t.attr.valueAsNumber(c),t.attr.class("bc-input bc-slider-input"),r!=null?t.on.blur(t.emitValueAsNumber(r)):t.Empty,l!=null?t.on.change(t.emitValueAsNumber(p=>{l(p)})):t.Empty,i!=null?t.on.input(t.emitValueAsNumber(p=>{i(p)})):t.Empty)})},Ut=O(k.UrlInput);class gt{widgets=new Map;typeMapping=new Map;register(n,s){if(this.widgets.set(n,s),s.supportedTypes)for(const a of s.supportedTypes)this.typeMapping.has(a)||this.typeMapping.set(a,[]),this.typeMapping.get(a).push(n),this.typeMapping.get(a).sort((o,r)=>{const l=this.widgets.get(o)?.priority||0;return(this.widgets.get(r)?.priority||0)-l})}unregister(n){const s=this.widgets.get(n);if(s&&(this.widgets.delete(n),s.supportedTypes))for(const a of s.supportedTypes){const o=this.typeMapping.get(a);if(o){const r=o.indexOf(n);r>=0&&o.splice(r,1),o.length===0&&this.typeMapping.delete(a)}}}get(n){return this.widgets.get(n)}getAll(){return new Map(this.widgets)}getForType(n){return(this.typeMapping.get(n)||[]).map(a=>this.widgets.get(a)).filter(Boolean)}findBestWidget(n){const s=yt.resolveWidget(n.definition,n.name);if(s?.widget){const o=this.widgets.get(s.widget);if(o)return{name:s.widget,registration:o,resolved:s}}const a=[];for(const[o,r]of this.widgets.entries())if(r.matcher)try{r.matcher(n)&&a.push({name:o,registration:r,priority:r.priority??0})}catch(l){console.warn(`Error in matcher for widget "${o}":`,l)}if(a.length>0){a.sort((r,l)=>l.priority-r.priority);const o=a[0];return{name:o.name,registration:o.registration,resolved:{widget:o.name,source:"heuristics"}}}if(typeof n.definition=="object"&&n.definition.type){const o=Array.isArray(n.definition.type)?n.definition.type[0]:n.definition.type,r=this.getForType(o);if(r.length>0){const l=this.typeMapping.get(o)[0];return{name:l,registration:r[0],resolved:{widget:l,source:"type-fallback"}}}}return null}}const Lt=new gt;function qt(e,n,s){return{factory:n,matcher:a=>{const r=a.definition["x:ui"];return r===e||typeof r=="object"&&r!==null&&r.widget===e},displayName:s?.displayName??e,priority:s?.priority??100,...s}}function zt(e,n,s){return{factory:n,matcher:a=>a.definition.format===e,displayName:s?.displayName??`${e} widget`,priority:s?.priority??75,...s}}function jt(e,n,s,a){return{factory:s,matcher:o=>{const r=o.definition;return r.type===e&&r.format===n},displayName:a?.displayName??`${e}:${n} widget`,priority:a?.priority??80,...a}}function Xt(e){const n=e?.logPrefix??"WIDGET_DIAG",s=e?.filterFn??(()=>!0);return{factory:()=>null,displayName:"Diagnostic Widget (never matches)",priority:-1e3,matcher:a=>{if(!s(a))return!1;const o=a.definition,r={name:a.name,path:a.path.map(String),type:o?.type,hasRegistry:a.widgetRegistry!==void 0,definition:o};return console.log(`[${n}] name="${r.name??"ROOT"}" path=[${r.path.join(", ")}] type="${r.type??"unknown"}" hasRegistry=${r.hasRegistry}`),e?.onProcess?.(r),!1}}}exports.Base64Input=$t;exports.Base64sInput=ut;exports.ColorSwatchInput=Ct;exports.EditableText=Tt;exports.NativeNullableDateInput=At;exports.NativeNullableDateTimeInput=kt;exports.NullableEmailInput=Nt;exports.NullablePasswordInput=vt;exports.NullableRatingInput=Wt;exports.NullableSliderInput=Pt;exports.NullableTextArea=Rt;exports.NullableTextInput=St;exports.NullableUrlInput=Ut;exports.NullableUuidInput=Dt;exports.RatingInput=ht;exports.SliderInput=Ht;exports.Switch=Et;exports.WidgetRegistry=gt;exports.createDiagnosticWidget=Xt;exports.emptyToNull=pt;exports.fileToBase64=ct;exports.forFormat=zt;exports.forTypeAndFormat=jt;exports.forXUI=qt;exports.formatColor=R;exports.getContrastRatio=It;exports.globalWidgetRegistry=Lt;exports.hexToRgb=D;exports.hslToRgb=G;exports.hwbToRgb=st;exports.isValidColor=wt;exports.isValidHexColor=Y;exports.isValidHslColor=tt;exports.isValidRgbColor=Z;exports.isValidRgbaColor=J;exports.linearToSrgb=L;exports.mulberry32=rt;exports.normalizeHexColor=et;exports.nullToEmpty=dt;exports.oklchToRgb=lt;exports.parseAnyColor=nt;exports.resolveEffectiveFormat=E;exports.rgbToHex=q;exports.rgbToHsl=z;exports.rgbToHwb=ot;exports.rgbToOklch=it;exports.srgbToLinear=U;exports.toRgbaString=at;