@antscorp/ui 0.1.3 → 0.1.4

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 (179) hide show
  1. package/README.md +25 -1
  2. package/dist/atoms/AddButton.d.ts +2 -5
  3. package/dist/atoms/Chip.d.ts +2 -5
  4. package/dist/atoms/Chip.js +1 -1
  5. package/dist/atoms/RemoveButton.d.ts +2 -5
  6. package/dist/atoms/TextAction.d.ts +2 -3
  7. package/dist/docs.json +1 -1
  8. package/dist/lib/iso.d.ts +2 -2
  9. package/dist/lib/iso.js +16 -8
  10. package/dist/lib/tokenEditorExtensions.js +1 -1
  11. package/dist/molecules/AccentCard.js +2 -2
  12. package/dist/molecules/CheckRow.d.ts +2 -7
  13. package/dist/molecules/ChoiceTiles.js +1 -1
  14. package/dist/molecules/CommitTextField.d.ts +1 -19
  15. package/dist/molecules/CommitTextField.js +21 -18
  16. package/dist/molecules/ConfirmDialog.d.ts +2 -7
  17. package/dist/molecules/DateTimeInput.d.ts +6 -3
  18. package/dist/molecules/DateTimeInput.js +82 -73
  19. package/dist/molecules/RemovableRow.js +32 -32
  20. package/dist/molecules/RevealRadioGroup.d.ts +2 -9
  21. package/dist/molecules/RevealSwitch.d.ts +2 -7
  22. package/dist/molecules/Select.d.ts +7 -23
  23. package/dist/molecules/Select.js +26 -20
  24. package/dist/molecules/StatusButton.d.ts +2 -7
  25. package/dist/molecules/TreeOptions.d.ts +3 -2
  26. package/dist/molecules/TreeOptions.js +67 -44
  27. package/dist/organisms/HourOfDayRow.js +2 -2
  28. package/dist/organisms/HourOfWeekGrid.js +2 -2
  29. package/dist/organisms/TreeSearchPanel.js +50 -47
  30. package/dist/ui.css +1 -1
  31. package/package.json +23 -17
  32. package/src/atoms/AddButton.tsx +2 -6
  33. package/src/atoms/Chip.tsx +5 -7
  34. package/src/atoms/RemoveButton.tsx +2 -6
  35. package/src/atoms/TextAction.tsx +2 -4
  36. package/src/lib/iso.ts +15 -3
  37. package/src/lib/tokenEditorExtensions.ts +1 -1
  38. package/src/molecules/AccentCard.tsx +4 -2
  39. package/src/molecules/CheckRow.tsx +2 -8
  40. package/src/molecules/ChoiceTiles.tsx +3 -1
  41. package/src/molecules/CommitTextField.tsx +15 -20
  42. package/src/molecules/ConfirmDialog.tsx +2 -8
  43. package/src/molecules/DateTimeInput.tsx +86 -68
  44. package/src/molecules/RemovableRow.tsx +1 -1
  45. package/src/molecules/RevealRadioGroup.tsx +5 -10
  46. package/src/molecules/RevealSwitch.tsx +2 -8
  47. package/src/molecules/Select.tsx +22 -22
  48. package/src/molecules/StatusButton.tsx +2 -8
  49. package/src/molecules/TreeOptions.tsx +86 -62
  50. package/src/organisms/HourOfDayRow.tsx +4 -2
  51. package/src/organisms/HourOfWeekGrid.tsx +4 -2
  52. package/src/organisms/TreeSearchPanel.tsx +1 -1
  53. package/dist/atoms/AddButton.doc.d.ts +0 -21
  54. package/dist/atoms/AddGlyph.doc.d.ts +0 -16
  55. package/dist/atoms/Chip.doc.d.ts +0 -29
  56. package/dist/atoms/ChipSkeletons.doc.d.ts +0 -21
  57. package/dist/atoms/FieldHeading.doc.d.ts +0 -15
  58. package/dist/atoms/HoverSwap.doc.d.ts +0 -25
  59. package/dist/atoms/InfoTip.doc.d.ts +0 -25
  60. package/dist/atoms/JointLabel.doc.d.ts +0 -15
  61. package/dist/atoms/LabeledDivider.doc.d.ts +0 -21
  62. package/dist/atoms/LogoImage.doc.d.ts +0 -21
  63. package/dist/atoms/PanelSearchInput.doc.d.ts +0 -25
  64. package/dist/atoms/PathMark.doc.d.ts +0 -16
  65. package/dist/atoms/RemoveButton.doc.d.ts +0 -16
  66. package/dist/atoms/RowSkeletons.doc.d.ts +0 -25
  67. package/dist/atoms/TextAction.doc.d.ts +0 -25
  68. package/dist/atoms/TruncatedOption.doc.d.ts +0 -24
  69. package/dist/atoms/TruncatedText.doc.d.ts +0 -15
  70. package/dist/molecules/AccentCard.doc.d.ts +0 -25
  71. package/dist/molecules/CheckGroup.doc.d.ts +0 -25
  72. package/dist/molecules/CheckRow.doc.d.ts +0 -25
  73. package/dist/molecules/ChoiceDialog.doc.d.ts +0 -21
  74. package/dist/molecules/ChoiceTiles.doc.d.ts +0 -21
  75. package/dist/molecules/CommitTextField.doc.d.ts +0 -29
  76. package/dist/molecules/ConfirmDialog.doc.d.ts +0 -21
  77. package/dist/molecules/DateTimeInput.doc.d.ts +0 -25
  78. package/dist/molecules/DurationInput.doc.d.ts +0 -25
  79. package/dist/molecules/FieldGroup.doc.d.ts +0 -25
  80. package/dist/molecules/FieldRow.doc.d.ts +0 -24
  81. package/dist/molecules/FieldSkeleton.doc.d.ts +0 -25
  82. package/dist/molecules/FrequencyLimitRow.doc.d.ts +0 -25
  83. package/dist/molecules/InlineEditableText.doc.d.ts +0 -25
  84. package/dist/molecules/LoadMoreRow.doc.d.ts +0 -21
  85. package/dist/molecules/LoadState.doc.d.ts +0 -21
  86. package/dist/molecules/MetaTable.doc.d.ts +0 -25
  87. package/dist/molecules/PercentRow.doc.d.ts +0 -25
  88. package/dist/molecules/PhoneFrame.doc.d.ts +0 -21
  89. package/dist/molecules/ProblemsButton.doc.d.ts +0 -25
  90. package/dist/molecules/RemovableRow.doc.d.ts +0 -25
  91. package/dist/molecules/RevealRadioGroup.doc.d.ts +0 -25
  92. package/dist/molecules/RevealSwitch.doc.d.ts +0 -25
  93. package/dist/molecules/RuleRow.doc.d.ts +0 -25
  94. package/dist/molecules/Select.doc.d.ts +0 -30
  95. package/dist/molecules/SideLabelRow.doc.d.ts +0 -20
  96. package/dist/molecules/SplitButton.doc.d.ts +0 -25
  97. package/dist/molecules/StatusButton.doc.d.ts +0 -25
  98. package/dist/molecules/TagSelect.doc.d.ts +0 -25
  99. package/dist/molecules/ToggleGrid.doc.d.ts +0 -25
  100. package/dist/molecules/TokenTextField.doc.d.ts +0 -29
  101. package/dist/molecules/TransferLayout.doc.d.ts +0 -25
  102. package/dist/molecules/TreeOptions.doc.d.ts +0 -25
  103. package/dist/organisms/ChipListAddPopover.doc.d.ts +0 -25
  104. package/dist/organisms/HourOfDayRow.doc.d.ts +0 -25
  105. package/dist/organisms/HourOfWeekGrid.doc.d.ts +0 -25
  106. package/dist/organisms/RepeatableList.doc.d.ts +0 -21
  107. package/dist/organisms/ResizableDrawer.doc.d.ts +0 -25
  108. package/dist/organisms/RuleGroups.doc.d.ts +0 -21
  109. package/dist/organisms/RuleList.doc.d.ts +0 -25
  110. package/dist/organisms/SearchableGroupedList.doc.d.ts +0 -25
  111. package/dist/organisms/TokenPickerDialog.doc.d.ts +0 -21
  112. package/dist/organisms/TransferPicker.doc.d.ts +0 -29
  113. package/dist/organisms/TreeSearchPanel.doc.d.ts +0 -25
  114. package/dist/organisms/TreeSelect.doc.d.ts +0 -29
  115. package/dist/theme/AntsomiTheme.doc.d.ts +0 -15
  116. package/dist/theme/AntsomiTheme.doc.js +0 -22
  117. package/src/atoms/AddButton.doc.ts +0 -36
  118. package/src/atoms/AddGlyph.doc.ts +0 -26
  119. package/src/atoms/Chip.doc.ts +0 -45
  120. package/src/atoms/ChipSkeletons.doc.ts +0 -31
  121. package/src/atoms/FieldHeading.doc.ts +0 -22
  122. package/src/atoms/HoverSwap.doc.ts +0 -39
  123. package/src/atoms/InfoTip.doc.ts +0 -37
  124. package/src/atoms/JointLabel.doc.ts +0 -23
  125. package/src/atoms/LabeledDivider.doc.ts +0 -35
  126. package/src/atoms/LogoImage.doc.ts +0 -42
  127. package/src/atoms/PanelSearchInput.doc.ts +0 -41
  128. package/src/atoms/PathMark.doc.ts +0 -25
  129. package/src/atoms/RemoveButton.doc.ts +0 -26
  130. package/src/atoms/RowSkeletons.doc.ts +0 -43
  131. package/src/atoms/TextAction.doc.ts +0 -40
  132. package/src/atoms/TruncatedOption.doc.ts +0 -39
  133. package/src/atoms/TruncatedText.doc.ts +0 -22
  134. package/src/molecules/AccentCard.doc.ts +0 -43
  135. package/src/molecules/CheckGroup.doc.ts +0 -40
  136. package/src/molecules/CheckRow.doc.ts +0 -43
  137. package/src/molecules/ChoiceDialog.doc.ts +0 -48
  138. package/src/molecules/ChoiceTiles.doc.ts +0 -42
  139. package/src/molecules/CommitTextField.doc.ts +0 -41
  140. package/src/molecules/ConfirmDialog.doc.ts +0 -43
  141. package/src/molecules/DateTimeInput.doc.ts +0 -48
  142. package/src/molecules/DurationInput.doc.ts +0 -36
  143. package/src/molecules/FieldGroup.doc.ts +0 -41
  144. package/src/molecules/FieldRow.doc.ts +0 -36
  145. package/src/molecules/FieldSkeleton.doc.ts +0 -38
  146. package/src/molecules/FrequencyLimitRow.doc.ts +0 -48
  147. package/src/molecules/InlineEditableText.doc.ts +0 -41
  148. package/src/molecules/LoadMoreRow.doc.ts +0 -36
  149. package/src/molecules/LoadState.doc.ts +0 -42
  150. package/src/molecules/MetaTable.doc.ts +0 -46
  151. package/src/molecules/PercentRow.doc.ts +0 -48
  152. package/src/molecules/PhoneFrame.doc.ts +0 -46
  153. package/src/molecules/ProblemsButton.doc.ts +0 -41
  154. package/src/molecules/RemovableRow.doc.ts +0 -48
  155. package/src/molecules/RevealRadioGroup.doc.ts +0 -41
  156. package/src/molecules/RevealSwitch.doc.ts +0 -38
  157. package/src/molecules/RuleRow.doc.ts +0 -43
  158. package/src/molecules/Select.doc.ts +0 -62
  159. package/src/molecules/SideLabelRow.doc.ts +0 -35
  160. package/src/molecules/SplitButton.doc.ts +0 -41
  161. package/src/molecules/StatusButton.doc.ts +0 -39
  162. package/src/molecules/TagSelect.doc.ts +0 -41
  163. package/src/molecules/ToggleGrid.doc.ts +0 -43
  164. package/src/molecules/TokenTextField.doc.ts +0 -41
  165. package/src/molecules/TransferLayout.doc.ts +0 -42
  166. package/src/molecules/TreeOptions.doc.ts +0 -38
  167. package/src/organisms/ChipListAddPopover.doc.ts +0 -54
  168. package/src/organisms/HourOfDayRow.doc.ts +0 -43
  169. package/src/organisms/HourOfWeekGrid.doc.ts +0 -48
  170. package/src/organisms/RepeatableList.doc.ts +0 -49
  171. package/src/organisms/ResizableDrawer.doc.ts +0 -48
  172. package/src/organisms/RuleGroups.doc.ts +0 -49
  173. package/src/organisms/RuleList.doc.ts +0 -43
  174. package/src/organisms/SearchableGroupedList.doc.ts +0 -49
  175. package/src/organisms/TokenPickerDialog.doc.ts +0 -54
  176. package/src/organisms/TransferPicker.doc.ts +0 -69
  177. package/src/organisms/TreeSearchPanel.doc.ts +0 -43
  178. package/src/organisms/TreeSelect.doc.ts +0 -56
  179. package/src/theme/AntsomiTheme.doc.ts +0 -23
package/dist/lib/iso.d.ts CHANGED
@@ -3,11 +3,11 @@ import { type ISODateString, type ISOTimeString } from "@astryxdesign/core/utils
3
3
  export declare function timeValue(time: string): {
4
4
  readonly value?: ISOTimeString;
5
5
  };
6
- /** Spread into a date input: `{ value }` when `date` is `YYYY-MM-DD`, `{}` otherwise. */
6
+ /** Spread into a date input: `{ value }` for a valid calendar date in `YYYY-MM-DD`, `{}` otherwise. */
7
7
  export declare function dateValue(date: string): {
8
8
  readonly value?: ISODateString;
9
9
  };
10
- /** Spread into a date input: `{ min }` when `min` is `YYYY-MM-DD`, `{}` otherwise. */
10
+ /** Spread into a date input: `{ min }` for a valid calendar date in `YYYY-MM-DD`, `{}` otherwise. */
11
11
  export declare function minDate(min: string | undefined): {
12
12
  readonly min?: ISODateString;
13
13
  };
package/dist/lib/iso.js CHANGED
@@ -1,14 +1,22 @@
1
- import { createISOTimeString as e } from "@astryxdesign/core/utils";
1
+ import { createISOTimeString as e, parseISO as t } from "@astryxdesign/core/utils";
2
2
  // src/lib/iso.ts
3
- function t(t) {
3
+ function n(t) {
4
4
  let n = e(t);
5
5
  return n === null ? {} : { value: n };
6
6
  }
7
- var n = (e) => /^\d{4}-\d{2}-\d{2}$/u.test(e);
8
- function r(e) {
9
- return n(e) ? { value: e } : {};
10
- }
7
+ var r = (e) => /^\d{4}-\d{2}-\d{2}$/u.test(e);
11
8
  function i(e) {
12
- return e !== void 0 && n(e) ? { min: e } : {};
9
+ if (!r(e)) return !1;
10
+ try {
11
+ return t(e), !0;
12
+ } catch {
13
+ return !1;
14
+ }
15
+ }
16
+ function a(e) {
17
+ return i(e) ? { value: e } : {};
18
+ }
19
+ function o(e) {
20
+ return e !== void 0 && i(e) ? { min: e } : {};
13
21
  }
14
- export { r as dateValue, i as minDate, t as timeValue };
22
+ export { a as dateValue, o as minDate, n as timeValue };
@@ -187,7 +187,7 @@ var h = r.theme({
187
187
  font: "inherit",
188
188
  fontSize: "12px",
189
189
  borderRadius: "50%",
190
- color: "var(--ants-mh-blue-700)",
190
+ color: "var(--color-icon-accent)",
191
191
  cursor: "pointer"
192
192
  },
193
193
  ".cm-token:hover .cm-token-remove, .cm-token:focus-within .cm-token-remove": { opacity: "1" }
@@ -41,7 +41,7 @@ function u(u) {
41
41
  }) : /* @__PURE__ */ n(e, {
42
42
  label: p,
43
43
  size: "sm",
44
- isDisabled: u.isDisabled,
44
+ isDisabled: u.isDisabled ?? !1,
45
45
  onClick: u.onClose
46
46
  })), f[9] = p, f[10] = h, f[11] = m, f[12] = u.isDisabled, f[13] = u.onClose, f[14] = S) : S = f[14];
47
47
  let C;
@@ -95,7 +95,7 @@ var d = {
95
95
  $$css: !0
96
96
  },
97
97
  banner: {
98
- kWkggS: "auial5by5",
98
+ kWkggS: "aui1jxocwm",
99
99
  kMwMTN: "aui17wrial",
100
100
  kP9fke: "auitvhhri",
101
101
  $$css: !0
@@ -1,8 +1,7 @@
1
+ import { type CheckboxInputProps } from "@astryxdesign/core/CheckboxInput";
1
2
  import type { ReactNode } from "react";
2
3
  /** What `CheckRow` takes. */
3
- export type CheckRowProps = {
4
- /** The row's text and the checkbox's name; one line, the whole text in a tooltip when cut. */
5
- readonly label: string;
4
+ export type CheckRowProps = Pick<CheckboxInputProps, "label" | "isDisabled" | "isReadOnly"> & {
6
5
  /** A second line under the text, such as an id under a name; one line too. */
7
6
  readonly description?: string | undefined;
8
7
  /** Whether the box is ticked. */
@@ -16,10 +15,6 @@ export type CheckRowProps = {
16
15
  * link to the item; the two share one place, so nothing moves. None without it.
17
16
  */
18
17
  readonly hoverContent?: ReactNode;
19
- /** Dims the box and blocks it; nothing is hidden. */
20
- readonly isDisabled?: boolean | undefined;
21
- /** Shows the box's state, not dimmed, and blocks it. */
22
- readonly isReadOnly?: boolean | undefined;
23
18
  };
24
19
  /**
25
20
  * One row of a list to tick: a checkbox (md, as every checkbox), the row's text on one line (and
@@ -64,7 +64,7 @@ var l = {
64
64
  kzqmXN: "aui1pju0fl",
65
65
  kZKoxP: "aui10wjd1d",
66
66
  kaIpWk: "aui16rqkct",
67
- kWkggS: "aui1mu13x8",
67
+ kWkggS: "auir796ur",
68
68
  kMwMTN: "auiqwr325",
69
69
  $$css: !0
70
70
  }
@@ -1,33 +1,19 @@
1
1
  import { type TextInputProps } from "@astryxdesign/core/TextInput";
2
2
  import type { ReactNode } from "react";
3
3
  /** What `CommitTextField` takes. */
4
- export type CommitTextFieldProps = {
5
- /** The field's label; also its accessible name when hidden. */
6
- readonly label: string;
4
+ export type CommitTextFieldProps = Pick<TextInputProps, "label" | "isDisabled" | "isReadOnly" | "isLabelHidden" | "placeholder" | "description" | "isRequired" | "width" | "controlXstyle" | "containerXstyle"> & {
7
5
  /** The committed text. A new value from outside (an agent, undo) replaces the draft. */
8
6
  readonly value: string;
9
7
  /** Called with the draft on blur or Enter, only when it differs from `value`. */
10
8
  readonly onCommit: (value: string) => void;
11
9
  /** The input's height, `md` by default. */
12
10
  readonly size?: "sm" | "md";
13
- /** Dims the field and blocks typing. */
14
- readonly isDisabled?: boolean;
15
- /** Shows the text, not dimmed, and blocks typing. */
16
- readonly isReadOnly?: boolean;
17
- /** Keeps the label for screen readers only. */
18
- readonly isLabelHidden?: boolean;
19
- /** Shown while the field is empty. */
20
- readonly placeholder?: string;
21
- /** Help under the label. */
22
- readonly description?: string;
23
11
  /** A problem with the value, already in the user's language. */
24
12
  readonly error?: string | undefined;
25
13
  /** A text area instead of a single line; Enter then adds a line. */
26
14
  readonly isMultiline?: boolean;
27
15
  /** For `isMultiline`: how many rows the text area shows, `4` by default. */
28
16
  readonly rows?: number;
29
- /** Marks the field as required. */
30
- readonly isRequired?: boolean;
31
17
  /**
32
18
  * `false` (default): after a commit the draft goes back to `value`, so a refused text does not
33
19
  * stay in the field. `true` keeps the typed text until `value` changes from outside.
@@ -37,10 +23,6 @@ export type CommitTextFieldProps = {
37
23
  readonly maxLength?: number;
38
24
  /** Fresh global pattern for whole tokens, counted as one character even in plain text. */
39
25
  readonly pattern?: () => RegExp;
40
- /** For a single line: the field's width, in pixels or any CSS length such as `"100%"`. */
41
- readonly width?: number | string;
42
- /** For a single line: StyleX styles for the input's box, e.g. to make it read as plain text. */
43
- readonly controlXstyle?: TextInputProps["controlXstyle"];
44
26
  };
45
27
  /**
46
28
  * Text that stays a local draft while typing and commits on blur or Enter, so a word typed is one
@@ -7,7 +7,7 @@ import { TextArea as a } from "@astryxdesign/core/TextArea";
7
7
  import { TextInput as o } from "@astryxdesign/core/TextInput";
8
8
  // src/molecules/CommitTextField.tsx
9
9
  function s(s) {
10
- let c = r(43), { value: l, onCommit: u, isMultiline: d, error: f, maxLength: p, isDraftKeptOnCommit: m } = s, h = d !== void 0 && d, g = m !== void 0 && m, _;
10
+ let c = r(46), { value: l, onCommit: u, isMultiline: d, error: f, maxLength: p, isDraftKeptOnCommit: m } = s, h = d !== void 0 && d, g = m !== void 0 && m, _;
11
11
  c[0] === u ? _ = c[1] : (_ = (e) => {
12
12
  u(e ?? "");
13
13
  }, c[0] = u, c[1] = _);
@@ -24,9 +24,13 @@ function s(s) {
24
24
  let j;
25
25
  c[14] === s.description ? j = c[15] : (j = s.description === void 0 ? {} : { description: s.description }, c[14] = s.description, c[15] = j);
26
26
  let M;
27
- c[16] === f ? M = c[17] : (M = e(f), c[16] = f, c[17] = M);
27
+ c[16] === s.controlXstyle ? M = c[17] : (M = s.controlXstyle === void 0 ? {} : { controlXstyle: s.controlXstyle }, c[16] = s.controlXstyle, c[17] = M);
28
28
  let N;
29
- c[18] !== S || c[19] !== v || c[20] !== s.label || c[21] !== k || c[22] !== A || c[23] !== j || c[24] !== M || c[25] !== w || c[26] !== T || c[27] !== E || c[28] !== D || c[29] !== O ? (N = {
29
+ c[18] === s.containerXstyle ? N = c[19] : (N = s.containerXstyle === void 0 ? {} : { containerXstyle: s.containerXstyle }, c[18] = s.containerXstyle, c[19] = N);
30
+ let P;
31
+ c[20] === f ? P = c[21] : (P = e(f), c[20] = f, c[21] = P);
32
+ let F;
33
+ c[22] !== S || c[23] !== v || c[24] !== s.label || c[25] !== k || c[26] !== A || c[27] !== j || c[28] !== M || c[29] !== N || c[30] !== P || c[31] !== w || c[32] !== T || c[33] !== E || c[34] !== D || c[35] !== O ? (F = {
30
34
  label: C,
31
35
  value: v,
32
36
  onChange: w,
@@ -38,26 +42,25 @@ function s(s) {
38
42
  isRequired: k,
39
43
  ...A,
40
44
  ...j,
41
- ...M
42
- }, c[18] = S, c[19] = v, c[20] = s.label, c[21] = k, c[22] = A, c[23] = j, c[24] = M, c[25] = w, c[26] = T, c[27] = E, c[28] = D, c[29] = O, c[30] = N) : N = c[30];
43
- let P = N;
45
+ ...M,
46
+ ...N,
47
+ ...P
48
+ }, c[22] = S, c[23] = v, c[24] = s.label, c[25] = k, c[26] = A, c[27] = j, c[28] = M, c[29] = N, c[30] = P, c[31] = w, c[32] = T, c[33] = E, c[34] = D, c[35] = O, c[36] = F) : F = c[36];
49
+ let I = F;
44
50
  if (h) {
45
51
  let e = s.rows ?? 4, t;
46
- return c[31] !== P || c[32] !== e ? (t = /* @__PURE__ */ i(a, {
47
- ...P,
52
+ return c[37] !== I || c[38] !== e ? (t = /* @__PURE__ */ i(a, {
53
+ ...I,
48
54
  rows: e
49
- }), c[31] = P, c[32] = e, c[33] = t) : t = c[33], t;
55
+ }), c[37] = I, c[38] = e, c[39] = t) : t = c[39], t;
50
56
  }
51
- let F;
52
- c[34] === s.width ? F = c[35] : (F = s.width === void 0 ? {} : { width: s.width }, c[34] = s.width, c[35] = F);
53
- let I;
54
- c[36] === s.controlXstyle ? I = c[37] : (I = s.controlXstyle === void 0 ? {} : { controlXstyle: s.controlXstyle }, c[36] = s.controlXstyle, c[37] = I);
55
57
  let L;
56
- return c[38] !== S || c[39] !== P || c[40] !== F || c[41] !== I ? (L = /* @__PURE__ */ i(o, {
57
- ...P,
58
+ c[40] === s.width ? L = c[41] : (L = s.width === void 0 ? {} : { width: s.width }, c[40] = s.width, c[41] = L);
59
+ let R;
60
+ return c[42] !== S || c[43] !== I || c[44] !== L ? (R = /* @__PURE__ */ i(o, {
61
+ ...I,
58
62
  onEnter: S,
59
- ...F,
60
- ...I
61
- }), c[38] = S, c[39] = P, c[40] = F, c[41] = I, c[42] = L) : L = c[42], L;
63
+ ...L
64
+ }), c[42] = S, c[43] = I, c[44] = L, c[45] = R) : R = c[45], R;
62
65
  }
63
66
  export { s as CommitTextField };
@@ -1,12 +1,7 @@
1
+ import { type AlertDialogProps } from "@astryxdesign/core/AlertDialog";
1
2
  import type { ReactNode } from "react";
2
3
  /** What `ConfirmDialog` takes. */
3
- export type ConfirmDialogProps = {
4
- /** Open while a change waits for an answer. */
5
- readonly isOpen: boolean;
6
- /** The question, e.g. "Remove these rows?". */
7
- readonly title: string;
8
- /** What the change does. */
9
- readonly description: string;
4
+ export type ConfirmDialogProps = Pick<AlertDialogProps, "isOpen" | "title" | "description"> & {
10
5
  /** The texts of the two buttons; the host translates them. */
11
6
  readonly labels: {
12
7
  /** The confirming button, e.g. "Remove". */
@@ -1,7 +1,8 @@
1
+ import { type TimeInputProps } from "@astryxdesign/core/TimeInput";
1
2
  import type { ReactNode } from "react";
2
3
  import { type FieldGroupProps } from "./FieldGroup.js";
3
4
  /** What `DateTimeInput` takes. */
4
- export type DateTimeInputProps = Pick<FieldGroupProps, "isDisabled"> & {
5
+ export type DateTimeInputProps = Pick<FieldGroupProps, "isDisabled"> & Pick<TimeInputProps, "hourFormat"> & {
5
6
  /** The group's label, e.g. "Start date"; it names the group and is not shown. */
6
7
  readonly label: string;
7
8
  /** The texts the inputs show; the host translates them. */
@@ -17,7 +18,7 @@ export type DateTimeInputProps = Pick<FieldGroupProps, "isDisabled"> & {
17
18
  readonly value: string;
18
19
  /** The inputs' size, `md` by default. */
19
20
  readonly size?: "sm" | "md" | undefined;
20
- /** Shows the date-time, not dimmed, and ignores changes. */
21
+ /** Shows readable date and time fields at full opacity, without clear or picker actions. */
21
22
  readonly isReadOnly?: boolean | undefined;
22
23
  /** A problem with the date-time, already in the user's language. */
23
24
  readonly error?: string | undefined;
@@ -36,7 +37,7 @@ export type DateTimeInputProps = Pick<FieldGroupProps, "isDisabled"> & {
36
37
  readonly isRequired?: boolean;
37
38
  /** The time input stays disabled until a date is picked. */
38
39
  readonly isTimeLockedWithoutDate?: boolean;
39
- /** The earliest date the calendar offers (`YYYY-MM-DD`), such as an end's start; any without it or with another text. */
40
+ /** The earliest valid calendar date (`YYYY-MM-DD`); an absent or invalid minimum leaves dates unconstrained. */
40
41
  readonly min?: string | undefined;
41
42
  /** Called with the new date-time; a part not picked yet is empty, a new date starts at 00:00:00. */
42
43
  readonly onChange: (value: string) => void;
@@ -45,5 +46,7 @@ export type DateTimeInputProps = Pick<FieldGroupProps, "isDisabled"> & {
45
46
  * A date and a time of day under one label. It composes `DateInput` and `TimeInput` rather than
46
47
  * using Astryx's `DateTimeInput`, which holds only a complete value: here a date or a time may be
47
48
  * set alone while the other is still empty.
49
+ * `hourFormat` defaults to `12h`; choose `24h` for a 24-hour clock. Calendar and clear text use
50
+ * the facade's `InternationalizationProvider`, alongside host-translated `label` and `labels`.
48
51
  */
49
52
  export declare function DateTimeInput(props: DateTimeInputProps): ReactNode;
@@ -5,94 +5,103 @@ import { c as a } from "react/compiler-runtime";
5
5
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
6
  import { HStack as c } from "@astryxdesign/core/HStack";
7
7
  import { Text as l } from "@astryxdesign/core/Text";
8
- import { DateInput as u } from "@astryxdesign/core/DateInput";
9
- import { TimeInput as d } from "@astryxdesign/core/TimeInput";
8
+ import { TextInput as u } from "@astryxdesign/core/TextInput";
9
+ import { DateInput as d } from "@astryxdesign/core/DateInput";
10
+ import { TimeInput as f } from "@astryxdesign/core/TimeInput";
10
11
  // src/molecules/DateTimeInput.tsx
11
- function f(f) {
12
- let p = a(68), { label: m, isDisabled: h, isReadOnly: g, error: _, hasTime: v, frame: y } = f, b = h !== void 0 && h, x = g !== void 0 && g, S = v === void 0 || v, C = f.size ?? "md", w;
13
- p[0] !== x || p[1] !== f ? (w = (e) => {
14
- x || f.onChange(e);
15
- }, p[0] = x, p[1] = f, p[2] = w) : w = p[2];
16
- let T = w, E = y === "none", D, O, k, A, j, M, N, P, F;
17
- if (p[3] !== b || p[4] !== E || p[5] !== f.isRequired || p[6] !== f.labels.date || p[7] !== f.value || p[8] !== C) {
18
- let [e, n] = f.value.split(" ");
19
- O = e === void 0 ? "" : e, F = n === void 0 ? "" : n, D = u, k = f.labels.date, A = C, j = !E, M = b, N = f.isRequired ?? !1, P = t(O), p[3] = b, p[4] = E, p[5] = f.isRequired, p[6] = f.labels.date, p[7] = f.value, p[8] = C, p[9] = D, p[10] = O, p[11] = k, p[12] = A, p[13] = j, p[14] = M, p[15] = N, p[16] = P, p[17] = F;
20
- } else D = p[9], O = p[10], k = p[11], A = p[12], j = p[13], M = p[14], N = p[15], P = p[16], F = p[17];
21
- let I;
22
- p[18] === f.min ? I = p[19] : (I = n(f.min), p[18] = f.min, p[19] = I);
23
- let L;
24
- p[20] !== S || p[21] !== T || p[22] !== F ? (L = (e) => {
25
- T(S ? [e, F === "" ? "00:00:00" : F].join(" ") : e ?? "");
26
- }, p[20] = S, p[21] = T, p[22] = F, p[23] = L) : L = p[23];
27
- let R;
28
- p[24] !== E || p[25] !== f.description ? (R = E && f.description !== void 0 ? { description: f.description } : {}, p[24] = E, p[25] = f.description, p[26] = R) : R = p[26];
29
- let z;
30
- p[27] !== _ || p[28] !== E ? (z = E ? e(_) : {}, p[27] = _, p[28] = E, p[29] = z) : z = p[29];
31
- let B;
32
- p[30] !== D || p[31] !== I || p[32] !== L || p[33] !== R || p[34] !== z || p[35] !== k || p[36] !== A || p[37] !== j || p[38] !== M || p[39] !== N || p[40] !== P ? (B = /* @__PURE__ */ o(D, {
33
- label: k,
34
- size: A,
35
- isLabelHidden: j,
36
- isDisabled: M,
37
- isRequired: N,
38
- ...P,
39
- ...I,
40
- onChange: L,
41
- ...R,
42
- ...z
43
- }), p[30] = D, p[31] = I, p[32] = L, p[33] = R, p[34] = z, p[35] = k, p[36] = A, p[37] = j, p[38] = M, p[39] = N, p[40] = P, p[41] = B) : B = p[41];
44
- let V = B, H;
45
- p[42] !== O || p[43] !== S || p[44] !== b || p[45] !== E || p[46] !== T || p[47] !== f.isTimeLockedWithoutDate || p[48] !== f.labels.time || p[49] !== C || p[50] !== F ? (H = S && /* @__PURE__ */ o(d, {
46
- label: f.labels.time,
47
- size: C,
48
- isLabelHidden: !E,
49
- hourFormat: "12h",
12
+ function p(p) {
13
+ let m = a(52), { label: h, isDisabled: g, isReadOnly: _, error: v, hasTime: y, frame: b } = p, x = g !== void 0 && g, S = _ !== void 0 && _, C = y === void 0 || y, w = p.size ?? "md", T = b === "none", E, D, O;
14
+ if (m[0] !== v || m[1] !== C || m[2] !== x || m[3] !== T || m[4] !== S || m[5] !== p || m[6] !== w) {
15
+ let [r, i] = p.value.split(" ");
16
+ E = r === void 0 ? "" : r, O = i === void 0 ? "" : i;
17
+ let a = !T, s = p.isRequired ?? !1, c;
18
+ m[10] !== T || m[11] !== p.description ? (c = T && p.description !== void 0 ? { description: p.description } : {}, m[10] = T, m[11] = p.description, m[12] = c) : c = m[12];
19
+ let l;
20
+ m[13] !== v || m[14] !== T ? (l = T ? e(v) : {}, m[13] = v, m[14] = T, m[15] = l) : l = m[15];
21
+ let f;
22
+ m[16] !== p.labels.date || m[17] !== w || m[18] !== a || m[19] !== s || m[20] !== c || m[21] !== l ? (f = {
23
+ label: p.labels.date,
24
+ size: w,
25
+ isLabelHidden: a,
26
+ isRequired: s,
27
+ ...c,
28
+ ...l
29
+ }, m[16] = p.labels.date, m[17] = w, m[18] = a, m[19] = s, m[20] = c, m[21] = l, m[22] = f) : f = m[22];
30
+ let h = f;
31
+ D = S ? /* @__PURE__ */ o(u, {
32
+ ...h,
33
+ value: E,
34
+ isReadOnly: !0
35
+ }) : /* @__PURE__ */ o(d, {
36
+ ...h,
37
+ isDisabled: x,
38
+ ...t(E),
39
+ ...n(p.min),
40
+ onChange: (e) => {
41
+ p.onChange(C ? [e, O === "" ? "00:00:00" : O].join(" ") : e ?? "");
42
+ }
43
+ }), m[0] = v, m[1] = C, m[2] = x, m[3] = T, m[4] = S, m[5] = p, m[6] = w, m[7] = E, m[8] = D, m[9] = O;
44
+ } else E = m[7], D = m[8], O = m[9];
45
+ let k = D, A = !T, j = w === "sm" ? 150 : 168, M;
46
+ m[23] !== p.labels.time || m[24] !== w || m[25] !== A || m[26] !== j ? (M = {
47
+ label: p.labels.time,
48
+ size: w,
49
+ isLabelHidden: A,
50
+ width: j
51
+ }, m[23] = p.labels.time, m[24] = w, m[25] = A, m[26] = j, m[27] = M) : M = m[27];
52
+ let N = M, P;
53
+ m[28] !== E || m[29] !== C || m[30] !== x || m[31] !== S || m[32] !== p || m[33] !== O || m[34] !== N ? (P = C && (S ? /* @__PURE__ */ o(u, {
54
+ ...N,
55
+ value: O,
56
+ isReadOnly: !0
57
+ }) : /* @__PURE__ */ o(f, {
58
+ ...N,
59
+ hourFormat: p.hourFormat ?? "12h",
50
60
  hasSeconds: !0,
51
- width: C === "sm" ? 150 : 168,
52
- isDisabled: b || f.isTimeLockedWithoutDate === !0 && O === "",
53
- ...r(F),
61
+ isDisabled: x || p.isTimeLockedWithoutDate === !0 && E === "",
62
+ ...r(O),
54
63
  onChange: (e) => {
55
- T([O, e?.length === 5 ? `${e}:00` : e].join(" "));
64
+ p.onChange([E, e?.length === 5 ? `${e}:00` : e].join(" "));
56
65
  }
57
- }), p[42] = O, p[43] = S, p[44] = b, p[45] = E, p[46] = T, p[47] = f.isTimeLockedWithoutDate, p[48] = f.labels.time, p[49] = C, p[50] = F, p[51] = H) : H = p[51];
58
- let U = H, W;
59
- p[52] === f.labels.timezone ? W = p[53] : (W = f.labels.timezone !== void 0 && /* @__PURE__ */ o(l, {
66
+ })), m[28] = E, m[29] = C, m[30] = x, m[31] = S, m[32] = p, m[33] = O, m[34] = N, m[35] = P) : P = m[35];
67
+ let F = P, I;
68
+ m[36] === p.labels.timezone ? I = m[37] : (I = p.labels.timezone !== void 0 && /* @__PURE__ */ o(l, {
60
69
  type: "supporting",
61
- children: f.labels.timezone
62
- }), p[52] = f.labels.timezone, p[53] = W);
63
- let G = W;
64
- if (E) {
65
- if (!S) return V;
70
+ children: p.labels.timezone
71
+ }), m[36] = p.labels.timezone, m[37] = I);
72
+ let L = I;
73
+ if (T) {
74
+ if (!C) return k;
66
75
  let e;
67
- return p[54] !== V || p[55] !== U || p[56] !== G ? (e = /* @__PURE__ */ s(c, {
76
+ return m[38] !== k || m[39] !== F || m[40] !== L ? (e = /* @__PURE__ */ s(c, {
68
77
  gap: 2,
69
78
  wrap: "wrap",
70
79
  align: "start",
71
80
  children: [
72
- V,
73
- U,
74
- G
81
+ k,
82
+ F,
83
+ L
75
84
  ]
76
- }), p[54] = V, p[55] = U, p[56] = G, p[57] = e) : e = p[57], e;
85
+ }), m[38] = k, m[39] = F, m[40] = L, m[41] = e) : e = m[41], e;
77
86
  }
78
- let K;
79
- p[58] !== V || p[59] !== U || p[60] !== G ? (K = /* @__PURE__ */ s(c, {
87
+ let R = x && !S, z;
88
+ m[42] !== k || m[43] !== F || m[44] !== L ? (z = /* @__PURE__ */ s(c, {
80
89
  gap: 2,
81
90
  wrap: "wrap",
82
91
  align: "center",
83
92
  children: [
84
- V,
85
- U,
86
- G
93
+ k,
94
+ F,
95
+ L
87
96
  ]
88
- }), p[58] = V, p[59] = U, p[60] = G, p[61] = K) : K = p[61];
89
- let q;
90
- return p[62] !== _ || p[63] !== b || p[64] !== m || p[65] !== f.description || p[66] !== K ? (q = /* @__PURE__ */ o(i, {
91
- label: m,
92
- description: f.description,
93
- isDisabled: b,
94
- error: _,
95
- children: K
96
- }), p[62] = _, p[63] = b, p[64] = m, p[65] = f.description, p[66] = K, p[67] = q) : q = p[67], q;
97
+ }), m[42] = k, m[43] = F, m[44] = L, m[45] = z) : z = m[45];
98
+ let B;
99
+ return m[46] !== v || m[47] !== h || m[48] !== p.description || m[49] !== z || m[50] !== R ? (B = /* @__PURE__ */ o(i, {
100
+ label: h,
101
+ description: p.description,
102
+ isDisabled: R,
103
+ error: v,
104
+ children: z
105
+ }), m[46] = v, m[47] = h, m[48] = p.description, m[49] = z, m[50] = R, m[51] = B) : B = m[51], B;
97
106
  }
98
- export { f as DateTimeInput };
107
+ export { p as DateTimeInput };
@@ -12,29 +12,29 @@ import { VStack as u } from "@astryxdesign/core/VStack";
12
12
  import { FieldStatus as d } from "@astryxdesign/core/FieldStatus";
13
13
  // src/molecules/RemovableRow.tsx
14
14
  function f(f) {
15
- let m = i(29), h = f.isFramed ?? !1, g;
16
- m[0] !== f.isDisabled || m[1] !== f.isReadOnly || m[2] !== f.labels.remove || m[3] !== f.onRemove || m[4] !== f.size ? (g = /* @__PURE__ */ o(e, {
15
+ let m = i(29), h = f.isFramed ?? !1, g = f.isDisabled ?? !1, _;
16
+ m[0] !== f.isReadOnly || m[1] !== f.labels.remove || m[2] !== f.onRemove || m[3] !== f.size || m[4] !== g ? (_ = /* @__PURE__ */ o(e, {
17
17
  label: f.labels.remove,
18
18
  size: f.size,
19
- isDisabled: f.isDisabled,
19
+ isDisabled: g,
20
20
  isReadOnly: f.isReadOnly,
21
21
  onClick: f.onRemove
22
- }), m[0] = f.isDisabled, m[1] = f.isReadOnly, m[2] = f.labels.remove, m[3] = f.onRemove, m[4] = f.size, m[5] = g) : g = m[5];
23
- let _ = g, v;
24
- m[6] === h ? v = m[7] : (v = h && { padding: 2 }, m[6] = h, m[7] = v);
25
- let y;
26
- m[8] === Symbol.for("react.memo_cache_sentinel") ? (y = {
22
+ }), m[0] = f.isReadOnly, m[1] = f.labels.remove, m[2] = f.onRemove, m[3] = f.size, m[4] = g, m[5] = _) : _ = m[5];
23
+ let v = _, y;
24
+ m[6] === h ? y = m[7] : (y = h && { padding: 2 }, m[6] = h, m[7] = y);
25
+ let b;
26
+ m[8] === Symbol.for("react.memo_cache_sentinel") ? (b = {
27
27
  "aui-default-marker": "aui-default-marker",
28
28
  $$css: !0
29
- }, m[8] = y) : y = m[8];
30
- let b = h && p.frame, x = h && f.error !== void 0 && p.frameError, S;
31
- m[9] !== b || m[10] !== x ? (S = [
32
- y,
29
+ }, m[8] = b) : b = m[8];
30
+ let x = h && p.frame, S = h && f.error !== void 0 && p.frameError, C;
31
+ m[9] !== x || m[10] !== S ? (C = [
33
32
  b,
34
- x
35
- ], m[9] = b, m[10] = x, m[11] = S) : S = m[11];
36
- let C;
37
- m[12] !== h || m[13] !== f.description || m[14] !== f.error || m[15] !== f.label ? (C = h ? /* @__PURE__ */ s(u, {
33
+ x,
34
+ S
35
+ ], m[9] = x, m[10] = S, m[11] = C) : C = m[11];
36
+ let w;
37
+ m[12] !== h || m[13] !== f.description || m[14] !== f.error || m[15] !== f.label ? (w = h ? /* @__PURE__ */ s(u, {
38
38
  xstyle: p.text,
39
39
  children: [/* @__PURE__ */ s(c, {
40
40
  gap: 1,
@@ -69,28 +69,28 @@ function f(f) {
69
69
  message: f.error
70
70
  })
71
71
  ]
72
- }), m[12] = h, m[13] = f.description, m[14] = f.error, m[15] = f.label, m[16] = C) : C = m[16];
73
- let w = h && p.end, T;
74
- m[17] !== f.endContent || m[18] !== f.hoverContent || m[19] !== _ ? (T = f.hoverContent === void 0 ? /* @__PURE__ */ s(a, { children: [f.endContent, _] }) : /* @__PURE__ */ o(t, {
75
- hoverContent: /* @__PURE__ */ s(a, { children: [f.hoverContent, _] }),
72
+ }), m[12] = h, m[13] = f.description, m[14] = f.error, m[15] = f.label, m[16] = w) : w = m[16];
73
+ let T = h && p.end, E;
74
+ m[17] !== f.endContent || m[18] !== f.hoverContent || m[19] !== v ? (E = f.hoverContent === void 0 ? /* @__PURE__ */ s(a, { children: [f.endContent, v] }) : /* @__PURE__ */ o(t, {
75
+ hoverContent: /* @__PURE__ */ s(a, { children: [f.hoverContent, v] }),
76
76
  children: f.endContent
77
- }), m[17] = f.endContent, m[18] = f.hoverContent, m[19] = _, m[20] = T) : T = m[20];
78
- let E;
79
- m[21] !== w || m[22] !== T ? (E = /* @__PURE__ */ o(c, {
77
+ }), m[17] = f.endContent, m[18] = f.hoverContent, m[19] = v, m[20] = E) : E = m[20];
78
+ let D;
79
+ m[21] !== T || m[22] !== E ? (D = /* @__PURE__ */ o(c, {
80
80
  gap: 1.5,
81
81
  align: "center",
82
- xstyle: w,
83
- children: T
84
- }), m[21] = w, m[22] = T, m[23] = E) : E = m[23];
85
- let D;
86
- return m[24] !== v || m[25] !== S || m[26] !== C || m[27] !== E ? (D = /* @__PURE__ */ s(c, {
82
+ xstyle: T,
83
+ children: E
84
+ }), m[21] = T, m[22] = E, m[23] = D) : D = m[23];
85
+ let O;
86
+ return m[24] !== D || m[25] !== y || m[26] !== C || m[27] !== w ? (O = /* @__PURE__ */ s(c, {
87
87
  gap: 1.5,
88
88
  align: "center",
89
89
  justify: "between",
90
- ...v,
91
- xstyle: S,
92
- children: [C, E]
93
- }), m[24] = v, m[25] = S, m[26] = C, m[27] = E, m[28] = D) : D = m[28], D;
90
+ ...y,
91
+ xstyle: C,
92
+ children: [w, D]
93
+ }), m[24] = D, m[25] = y, m[26] = C, m[27] = w, m[28] = O) : O = m[28], O;
94
94
  }
95
95
  var p = {
96
96
  text: {
@@ -1,3 +1,4 @@
1
+ import { type RadioListProps } from "@astryxdesign/core/RadioList";
1
2
  import { type ReactNode } from "react";
2
3
  /** One choice of a `RevealRadioGroup`. */
3
4
  export type RevealRadioOption<V extends string> = {
@@ -13,13 +14,7 @@ export type RevealRadioOption<V extends string> = {
13
14
  readonly content?: ReactNode;
14
15
  };
15
16
  /** What `RevealRadioGroup` takes. */
16
- export type RevealRadioGroupProps<V extends string> = {
17
- /** Names the group; also its accessible name when hidden. */
18
- readonly label: string;
19
- /** Keeps the label for screen readers only. */
20
- readonly isLabelHidden?: boolean | undefined;
21
- /** Lays the options out in a row instead of a column. */
22
- readonly orientation?: "vertical" | "horizontal" | undefined;
17
+ export type RevealRadioGroupProps<V extends string> = Pick<RadioListProps, "label" | "isLabelHidden" | "orientation" | "isDisabled"> & {
23
18
  /** The choices, in order. */
24
19
  readonly options: readonly RevealRadioOption<V>[];
25
20
  /** The chosen option's value. */
@@ -28,8 +23,6 @@ export type RevealRadioGroupProps<V extends string> = {
28
23
  readonly onChange: (value: V) => void;
29
24
  /** The radios' size, `md` by default (Astryx's default; the theme draws it at 18px). */
30
25
  readonly size?: "sm" | "md" | undefined;
31
- /** Dims the radios and blocks them. */
32
- readonly isDisabled?: boolean | undefined;
33
26
  /** Shows the value, not dimmed, and ignores changes. */
34
27
  readonly isReadOnly?: boolean | undefined;
35
28
  /** The space between the list and the revealed content, `2` by default. */
@@ -1,16 +1,11 @@
1
+ import { type SwitchProps } from "@astryxdesign/core/Switch";
1
2
  import type { ReactNode } from "react";
2
3
  /** What `RevealSwitch` takes. */
3
- export type RevealSwitchProps = {
4
- /** What the switch turns on. */
5
- readonly label: string;
6
- /** Whether the switch is on. */
7
- readonly value: boolean;
4
+ export type RevealSwitchProps = Pick<SwitchProps, "label" | "isDisabled" | "value"> & {
8
5
  /** Called with the new state. */
9
6
  readonly onChange: (value: boolean) => void;
10
7
  /** The switch's size, `md` by default. */
11
8
  readonly size?: "sm" | "md" | undefined;
12
- /** Dims the switch and blocks it. */
13
- readonly isDisabled?: boolean | undefined;
14
9
  /** Shows the value, not dimmed, and ignores changes. */
15
10
  readonly isReadOnly?: boolean | undefined;
16
11
  /** What shows below the switch while it is on. */