@nxgt/material 3.34.0 → 3.35.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 (164) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +4 -4
  3. package/dist/{async-slice-C9q_eMJD.js → async-slice-BNI_F0jz.js} +2 -2
  4. package/dist/{button-CoAu_GuF.js → button-EMWOFSDB.js} +1 -1
  5. package/dist/charts.js +3 -3
  6. package/dist/{chip-Ch21Qbnj.js → chip-B6m3yagf.js} +1 -1
  7. package/dist/{code-editor-CEdEmolU.js → code-editor-BdiufnpC.js} +4 -4
  8. package/dist/code-editor.js +4 -4
  9. package/dist/{code-language-items-BNMM7YlZ.js → code-language-items-v5Rnq425.js} +2 -2
  10. package/dist/{components-BM9WHviO.js → components-C9Zz2dir.js} +18597 -15903
  11. package/dist/components.js +26 -26
  12. package/dist/{dialog-C_U4twIJ.js → dialog-Cdv9IXVo.js} +1 -1
  13. package/dist/dnd.js +1 -1
  14. package/dist/{dropdown-menu-DSgkmogX.js → dropdown-menu-CpSnRXd-.js} +1 -1
  15. package/dist/editor.js +7 -7
  16. package/dist/{empty-state-CJZ0sVE8.js → empty-state-DMr94lsF.js} +1 -1
  17. package/dist/hooks.js +2 -2
  18. package/dist/{i18n-provider-CLq-1Qgc.js → i18n-provider-A4mI4vc1.js} +1 -1
  19. package/dist/i18n.js +5 -5
  20. package/dist/{icon-badge-Dssl4rfn.js → icon-badge-BFScQnp9.js} +1 -1
  21. package/dist/lib/components/ui/dates/picker-trigger/typed-box-compact.d.ts +12 -0
  22. package/dist/lib/components/ui/dates/picker-trigger/typed-box.d.ts +6 -2
  23. package/dist/lib/components/ui/dates/picker-trigger/typed-trigger.d.ts +3 -2
  24. package/dist/lib/components/ui/dates/time-field/index.d.ts +1 -0
  25. package/dist/lib/components/ui/dates/time-field/partials/time-field-body.d.ts +2 -1
  26. package/dist/lib/components/ui/dates/time-field/partials/time-field-entry.d.ts +1 -0
  27. package/dist/lib/components/ui/dates/time-field/partials/time-field-typed.d.ts +2 -2
  28. package/dist/lib/components/ui/dates/time-field/time-field.d.ts +6 -1
  29. package/dist/lib/components/ui/dates/time-field/time-string-field.d.ts +14 -0
  30. package/dist/lib/components/ui/fields/attributes/attribute-dialog.d.ts +3 -1
  31. package/dist/lib/components/ui/fields/attributes/attribute-form/attribute-form.d.ts +3 -1
  32. package/dist/lib/components/ui/fields/attributes/attribute-form/attribute-text-form-fields.d.ts +6 -0
  33. package/dist/lib/components/ui/fields/attributes/attribute-form/consts.d.ts +7 -6
  34. package/dist/lib/components/ui/fields/attributes/attribute-form/use-attribute-form.d.ts +44 -0
  35. package/dist/lib/components/ui/fields/attributes/attributes-editor.d.ts +22 -0
  36. package/dist/lib/components/ui/fields/attributes/attributes-field/attributes-dialog-field.d.ts +14 -0
  37. package/dist/lib/components/ui/fields/attributes/attributes-field/attributes-field.d.ts +14 -12
  38. package/dist/lib/components/ui/fields/attributes/attributes-field/attributes-inline-field.d.ts +8 -0
  39. package/dist/lib/components/ui/fields/attributes/attributes-field/use-dialog-field.d.ts +15 -0
  40. package/dist/lib/components/ui/fields/attributes/attributes-form-field/attributes-form-field.d.ts +7 -1
  41. package/dist/lib/components/ui/fields/attributes/attributes-summary.d.ts +22 -0
  42. package/dist/lib/components/ui/fields/attributes/index.d.ts +3 -0
  43. package/dist/lib/components/ui/fields/attributes/logic/names.d.ts +13 -0
  44. package/dist/lib/components/ui/fields/attributes/logic/order.d.ts +15 -0
  45. package/dist/lib/components/ui/fields/attributes/logic/reorder-keys.d.ts +9 -0
  46. package/dist/lib/components/ui/fields/attributes/logic/value.d.ts +42 -0
  47. package/dist/lib/components/ui/fields/attributes/models/attribute.d.ts +5 -1
  48. package/dist/lib/components/ui/fields/attributes/partials/attribute-row.d.ts +18 -0
  49. package/dist/lib/components/ui/fields/attributes/partials/default-choices.d.ts +5 -0
  50. package/dist/lib/components/ui/fields/attributes/partials/default-field.d.ts +12 -0
  51. package/dist/lib/components/ui/fields/attributes/partials/default-inputs.d.ts +16 -0
  52. package/dist/lib/components/ui/fields/attributes/partials/editor-notes.d.ts +11 -0
  53. package/dist/lib/components/ui/fields/attributes/partials/labeled.d.ts +10 -0
  54. package/dist/lib/components/ui/fields/attributes/partials/name-field.d.ts +15 -0
  55. package/dist/lib/components/ui/fields/attributes/partials/options-field.d.ts +11 -0
  56. package/dist/lib/components/ui/fields/attributes/partials/phone-sheet.d.ts +12 -0
  57. package/dist/lib/components/ui/fields/attributes/partials/reorder-handle.d.ts +19 -0
  58. package/dist/lib/components/ui/fields/attributes/partials/row-fields.d.ts +16 -0
  59. package/dist/lib/components/ui/fields/attributes/partials/row-footer.d.ts +12 -0
  60. package/dist/lib/components/ui/fields/attributes/partials/row-head.d.ts +12 -0
  61. package/dist/lib/components/ui/fields/attributes/partials/row-panel.d.ts +15 -0
  62. package/dist/lib/components/ui/fields/attributes/partials/rows-dnd.d.ts +11 -0
  63. package/dist/lib/components/ui/fields/attributes/partials/simple-fields.d.ts +20 -0
  64. package/dist/lib/components/ui/fields/attributes/partials/summary-item.d.ts +9 -0
  65. package/dist/lib/components/ui/fields/attributes/partials/type-icon.d.ts +13 -0
  66. package/dist/lib/components/ui/fields/attributes/partials/value-text.d.ts +12 -0
  67. package/dist/lib/components/ui/fields/attributes/schema.d.ts +32 -0
  68. package/dist/lib/components/ui/fields/attributes/use-announce.d.ts +14 -0
  69. package/dist/lib/components/ui/fields/attributes/use-attribute-text.d.ts +13 -0
  70. package/dist/lib/components/ui/fields/attributes/use-attributes-editor.d.ts +34 -0
  71. package/dist/lib/components/ui/fields/attributes/use-reorder.d.ts +26 -0
  72. package/dist/lib/components/ui/fields/contacts/contacts-dialog-form-field.d.ts +9 -0
  73. package/dist/lib/components/ui/fields/contacts/contacts-editor.d.ts +29 -0
  74. package/dist/lib/components/ui/fields/contacts/contacts-form-field.d.ts +14 -1
  75. package/dist/lib/components/ui/fields/contacts/contacts-summary.d.ts +23 -0
  76. package/dist/lib/components/ui/fields/contacts/index.d.ts +3 -0
  77. package/dist/lib/components/ui/fields/contacts/logic/check-contact.d.ts +11 -0
  78. package/dist/lib/components/ui/fields/contacts/logic/contact-action.d.ts +11 -0
  79. package/dist/lib/components/ui/fields/contacts/logic/duplicates.d.ts +17 -0
  80. package/dist/lib/components/ui/fields/contacts/logic/issues.d.ts +7 -0
  81. package/dist/lib/components/ui/fields/contacts/logic/primary.d.ts +33 -0
  82. package/dist/lib/components/ui/fields/contacts/models.d.ts +7 -0
  83. package/dist/lib/components/ui/fields/contacts/partials/contact-fields.d.ts +29 -0
  84. package/dist/lib/components/ui/fields/contacts/partials/contact-links.d.ts +15 -0
  85. package/dist/lib/components/ui/fields/contacts/partials/contact-row.d.ts +14 -0
  86. package/dist/lib/components/ui/fields/contacts/partials/phone-sheet.d.ts +14 -0
  87. package/dist/lib/components/ui/fields/contacts/partials/quick-add.d.ts +12 -0
  88. package/dist/lib/components/ui/fields/contacts/partials/row-actions.d.ts +16 -0
  89. package/dist/lib/components/ui/fields/contacts/partials/summary-item.d.ts +11 -0
  90. package/dist/lib/components/ui/fields/contacts/partials/summary-row.d.ts +14 -0
  91. package/dist/lib/components/ui/fields/contacts/partials/type-group.d.ts +15 -0
  92. package/dist/lib/components/ui/fields/contacts/partials/type-icon.d.ts +12 -0
  93. package/dist/lib/components/ui/fields/contacts/partials/value-field.d.ts +25 -0
  94. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +2 -0
  95. package/dist/lib/components/ui/fields/contacts/schema.d.ts +18 -0
  96. package/dist/lib/components/ui/fields/contacts/use-contact-text.d.ts +9 -0
  97. package/dist/lib/components/ui/fields/contacts/use-contacts-editor.d.ts +33 -0
  98. package/dist/lib/components/ui/fields/inline-editor/action-tone.d.ts +2 -0
  99. package/dist/lib/components/ui/fields/inline-editor/editor-header.d.ts +19 -0
  100. package/dist/lib/components/ui/fields/inline-editor/editor-sheet.d.ts +20 -0
  101. package/dist/lib/components/ui/fields/inline-editor/empty-summary.d.ts +19 -0
  102. package/dist/lib/components/ui/fields/inline-editor/use-focus-request.d.ts +13 -0
  103. package/dist/lib/components/ui/fields/inline-editor/use-row-ids.d.ts +13 -0
  104. package/dist/lib/components/ui/fields/opening-hours/consts.d.ts +17 -3
  105. package/dist/lib/components/ui/fields/opening-hours/index.d.ts +2 -0
  106. package/dist/lib/components/ui/fields/opening-hours/logic/edit-days.d.ts +9 -0
  107. package/dist/lib/components/ui/fields/opening-hours/logic/first-day.d.ts +14 -0
  108. package/dist/lib/components/ui/fields/opening-hours/logic/format.d.ts +6 -0
  109. package/dist/lib/components/ui/fields/opening-hours/logic/group.d.ts +13 -0
  110. package/dist/lib/components/ui/fields/opening-hours/logic/range-errors.d.ts +20 -0
  111. package/dist/lib/components/ui/fields/opening-hours/logic/status.d.ts +19 -0
  112. package/dist/lib/components/ui/fields/opening-hours/logic/week.d.ts +32 -0
  113. package/dist/lib/components/ui/fields/opening-hours/logic/zoned.d.ts +10 -0
  114. package/dist/lib/components/ui/fields/opening-hours/opening-hours-dialog-form-field.d.ts +10 -0
  115. package/dist/lib/components/ui/fields/opening-hours/opening-hours-editor.d.ts +26 -0
  116. package/dist/lib/components/ui/fields/opening-hours/opening-hours-form-field.d.ts +17 -1
  117. package/dist/lib/components/ui/fields/opening-hours/opening-hours-summary.d.ts +32 -0
  118. package/dist/lib/components/ui/fields/opening-hours/partials/copy-chips.d.ts +12 -0
  119. package/dist/lib/components/ui/fields/opening-hours/partials/copy-menu.d.ts +10 -0
  120. package/dist/lib/components/ui/fields/opening-hours/partials/day-controls.d.ts +14 -0
  121. package/dist/lib/components/ui/fields/opening-hours/partials/day-row.d.ts +15 -0
  122. package/dist/lib/components/ui/fields/opening-hours/partials/day-summary-row.d.ts +15 -0
  123. package/dist/lib/components/ui/fields/opening-hours/partials/group-row.d.ts +13 -0
  124. package/dist/lib/components/ui/fields/opening-hours/partials/phone-sheet.d.ts +18 -0
  125. package/dist/lib/components/ui/fields/opening-hours/partials/range-field-props.d.ts +28 -0
  126. package/dist/lib/components/ui/fields/opening-hours/partials/range-row.d.ts +24 -0
  127. package/dist/lib/components/ui/fields/opening-hours/partials/status-pill.d.ts +13 -0
  128. package/dist/lib/components/ui/fields/opening-hours/use-first-day.d.ts +8 -0
  129. package/dist/lib/components/ui/fields/opening-hours/use-hours-editor.d.ts +26 -0
  130. package/dist/lib/components/ui/fields/opening-hours/use-hours-text.d.ts +8 -0
  131. package/dist/lib/components/ui/fields/opening-hours/use-now.d.ts +6 -0
  132. package/dist/lib/i18n/resources/en/en.d.ts +75 -0
  133. package/dist/lib/i18n/resources/en/material.json.d.ts +86 -11
  134. package/dist/lib/i18n/resources/fr/fr.d.ts +75 -0
  135. package/dist/lib/i18n/resources/fr/material.json.d.ts +86 -11
  136. package/dist/lib/i18n/resources/resources.d.ts +150 -0
  137. package/dist/lib/i18n/translator.d.ts +1 -1
  138. package/dist/lib.js +1 -1
  139. package/dist/main.js +43 -43
  140. package/dist/map.js +4 -4
  141. package/dist/material.css +1 -1
  142. package/dist/pdf-reader.js +1 -1
  143. package/dist/print.js +2 -2
  144. package/dist/{public-CX7FN97X.js → public-CYdnlHqA.js} +6 -6
  145. package/dist/{rich-code-block-cc1NZtbD.js → rich-code-block-Bwhfhu7J.js} +4 -4
  146. package/dist/{sortable-provider-D43VdFMP.js → sortable-provider-CY_YD3Ee.js} +1 -1
  147. package/dist/{spinner-wKfFAVU9.js → spinner-CKlDba5I.js} +1 -1
  148. package/dist/{stored-language-D73ujVW4.js → stored-language-CfQGHLq9.js} +176 -22
  149. package/dist/theme-picker.js +2 -2
  150. package/dist/{theme-toggle-Drab-hke.js → theme-toggle--Zcf5AM8.js} +1 -1
  151. package/dist/{toolbar-items-D7R9YtYx.js → toolbar-items-B1W-uVHS.js} +2 -2
  152. package/dist/{translate-material-CdpLjkcD.js → translate-material-xDh10aWZ.js} +2 -2
  153. package/dist/{translator-BE-yEb0p.js → translator-BbOZntEF.js} +1 -1
  154. package/dist/{use-chat-composer-CpKh8564.js → use-chat-composer-CoyqPKbt.js} +12 -12
  155. package/dist/{use-heading-spy-DgWhvYfh.js → use-heading-spy-DXYCeegh.js} +1 -1
  156. package/dist/{use-material-translation-Da9Ponn5.js → use-material-translation-BK2YYCY3.js} +2 -2
  157. package/docs/components/date-and-time.md +9 -1
  158. package/docs/components/form-fields.md +298 -67
  159. package/docs/guides/forms.md +18 -12
  160. package/docs/guides/i18n.md +1 -1
  161. package/docs/guides/ssr.md +1 -0
  162. package/docs/previews/form-fields-contacts.webp +0 -0
  163. package/docs/previews/form-fields-openinghours.webp +0 -0
  164. package/package.json +1 -1
@@ -1,9 +1,25 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { UseControllerProps } from 'react-hook-form';
3
+ import { WeekStart } from './logic/week.js';
3
4
  export type OpeningHoursFormFieldProps<T extends Record<string, any>> = Pick<UseControllerProps<T>, 'control' | 'name'> & {
4
5
  className?: string;
5
6
  disabled?: boolean;
6
7
  label?: string;
8
+ /**
9
+ * `'inline'` (the default) edits the week in place
10
+ * (`OpeningHoursEditor`); `'dialog'` keeps the list and the dialog that
11
+ * edits one range at a time.
12
+ */
13
+ editing?: 'inline' | 'dialog';
14
+ /** `editing="dialog"` only: the "Add All Days" button. */
7
15
  showAddAllDays?: boolean;
16
+ /** `editing="inline"` only: the first day of the week, `0` Sunday. */
17
+ weekStartsOn?: WeekStart;
18
+ /** `editing="inline"` only: the locale of day and time names. */
19
+ locale?: string;
8
20
  } & Omit<ComponentProps<'div'>, 'name'>;
9
- export declare function OpeningHoursFormField<T extends Record<string, any>>({ control, name, className, disabled, label, showAddAllDays, ...props }: OpeningHoursFormFieldProps<T>): import("react").JSX.Element;
21
+ /**
22
+ * Opening hours in a React Hook Form field (an array of one entry per
23
+ * range). Inline by default; `editing="dialog"` is today's list and dialog.
24
+ */
25
+ export declare function OpeningHoursFormField<T extends Record<string, any>>({ editing, showAddAllDays, weekStartsOn, locale, ...props }: OpeningHoursFormFieldProps<T>): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { ReactNode } from 'react';
2
+ import { WeekStart } from './logic/week.js';
3
+ import { OpeningHoursFieldValue } from './models.js';
4
+ export type OpeningHoursSummaryProps = {
5
+ /** The hours, in the value model of `OpeningHours`. */
6
+ data?: OpeningHoursFieldValue[] | null;
7
+ /** Names the region; "Opening Hours" by default. */
8
+ label?: string;
9
+ /** The moment to read as now (tests, stories); the clock by default. */
10
+ now?: Date;
11
+ /** The IANA zone of the place ("America/Toronto"); the viewer's by default. */
12
+ timeZone?: string;
13
+ /** The locale of day and time names; the `I18nProvider` language by default. */
14
+ locale?: string;
15
+ /** The first day of the week, `0` Sunday; the locale's by default. */
16
+ weekStartsOn?: WeekStart;
17
+ className?: string;
18
+ /**
19
+ * What shows when there is nothing to list. A quiet "Hours not set" by default; your
20
+ * node replaces it, and `null` renders nothing.
21
+ */
22
+ empty?: ReactNode;
23
+ };
24
+ /**
25
+ * The read-only counterpart of `OpeningHoursEditor`: whether the place is
26
+ * open now ("Open · closes at 6:00 PM", "Closed · opens Monday at 9:00 AM"),
27
+ * then the week with identical consecutive days grouped ("Mon–Fri
28
+ * 9:00 AM – 6:00 PM") and today's group marked. Times are the locale's; the
29
+ * status reads the clock in `timeZone`. Without `now` the status appears
30
+ * once the page has mounted, so a server render and its hydration match.
31
+ */
32
+ export declare function OpeningHoursSummary({ data, label, now, timeZone, locale, weekStartsOn, className, empty, }: OpeningHoursSummaryProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { HoursText } from '../use-hours-text.js';
2
+ type CopyChipsProps = {
3
+ text: HoursText;
4
+ /** The day copied from, left out of the chips. */
5
+ index: number;
6
+ order: readonly number[];
7
+ targets: readonly number[];
8
+ onToggle: (day: number) => void;
9
+ };
10
+ /** "Copy to…": one toggle chip for each other day of the week. */
11
+ export declare function CopyChips({ text, index, order, targets, onToggle, }: CopyChipsProps): import("react").JSX.Element;
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import { HoursText } from '../use-hours-text.js';
2
+ type CopyMenuProps = {
3
+ text: HoursText;
4
+ from: number;
5
+ disabled?: boolean;
6
+ onCopy: (to: number[]) => void;
7
+ };
8
+ /** "Copy to": Monday to Friday, the weekend, or all days. */
9
+ export declare function CopyMenu({ text, from, disabled, onCopy }: CopyMenuProps): import("react").JSX.Element;
10
+ export {};
@@ -0,0 +1,14 @@
1
+ import { FocusRequest } from '../../inline-editor/use-focus-request.js';
2
+ import { Day } from '../logic/week.js';
3
+ import { HoursText } from '../use-hours-text.js';
4
+ type DayControlsProps = {
5
+ text: HoursText;
6
+ index: number;
7
+ day: Day;
8
+ disabled?: boolean;
9
+ focus: Pick<FocusRequest, 'key' | 'request'>;
10
+ onChange: (day: Day) => void;
11
+ };
12
+ /** A day's switch, its ranges and the button that adds one. */
13
+ export declare function DayControls({ text, index, day, disabled, focus, onChange, }: DayControlsProps): import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,15 @@
1
+ import { FocusRequest } from '../../inline-editor/use-focus-request.js';
2
+ import { Day } from '../logic/week.js';
3
+ import { HoursText } from '../use-hours-text.js';
4
+ type DayRowProps = {
5
+ text: HoursText;
6
+ index: number;
7
+ day: Day;
8
+ disabled?: boolean;
9
+ focus: Pick<FocusRequest, 'key' | 'request'>;
10
+ onChange: (day: Day) => void;
11
+ onCopy: (to: number[]) => void;
12
+ };
13
+ /** A day on a wide screen: its name, its controls and the "Copy to" menu. */
14
+ export declare function DayRow({ text, index, day, disabled, focus, onChange, onCopy, }: DayRowProps): import("react").JSX.Element;
15
+ export {};
@@ -0,0 +1,15 @@
1
+ import { Day } from '../logic/week.js';
2
+ import { HoursText } from '../use-hours-text.js';
3
+ /** The text under a day's name: its ranges, or that it is closed. */
4
+ export declare function daySummary(text: HoursText, day: Day): string;
5
+ type DaySummaryRowProps = {
6
+ text: HoursText;
7
+ index: number;
8
+ day: Day;
9
+ disabled?: boolean;
10
+ onOpen: () => void;
11
+ onChange: (day: Day) => void;
12
+ };
13
+ /** A phone's row for a day: a summary and a chevron that opens its sheet. */
14
+ export declare function DaySummaryRow({ text, index, day, disabled, onOpen, onChange, }: DaySummaryRowProps): import("react").JSX.Element;
15
+ export {};
@@ -0,0 +1,13 @@
1
+ import { Group } from '../logic/group.js';
2
+ import { HoursText } from '../use-hours-text.js';
3
+ type GroupRowProps = {
4
+ text: HoursText;
5
+ group: Group;
6
+ today: boolean;
7
+ };
8
+ /**
9
+ * A run of identical days and its hours. Today's group has the selected-row
10
+ * look (a tint and a 3px start bar) and a "Today" tag.
11
+ */
12
+ export declare function GroupRow({ text, group, today }: GroupRowProps): import("react").JSX.Element;
13
+ export {};
@@ -0,0 +1,18 @@
1
+ import { FocusRequest } from '../../inline-editor/use-focus-request.js';
2
+ import { Day } from '../logic/week.js';
3
+ import { HoursText } from '../use-hours-text.js';
4
+ type PhoneSheetProps = {
5
+ text: HoursText;
6
+ /** The day being edited; `null` keeps the sheet closed. */
7
+ index: number | null;
8
+ day?: Day;
9
+ order: readonly number[];
10
+ disabled?: boolean;
11
+ focus: Pick<FocusRequest, 'key' | 'request'>;
12
+ onClose: () => void;
13
+ onChange: (day: Day) => void;
14
+ onCopy: (from: number, to: number[]) => void;
15
+ };
16
+ /** A phone's editor for one day: its controls and copy-to day chips. */
17
+ export declare function PhoneSheet({ text, index, day, order, disabled, focus, onClose, onChange, onCopy, }: PhoneSheetProps): import("react").JSX.Element;
18
+ export {};
@@ -0,0 +1,28 @@
1
+ import { HoursRangeError } from '../logic/range-errors.js';
2
+ import { HoursRange } from '../logic/week.js';
3
+ import { HoursText } from '../use-hours-text.js';
4
+ type Options = {
5
+ text: HoursText;
6
+ key: 'o' | 'c';
7
+ day: number;
8
+ /** Position of the range in its day, from 1. */
9
+ n: number;
10
+ range: HoursRange;
11
+ error?: HoursRangeError;
12
+ errorId: string;
13
+ disabled?: boolean;
14
+ onChange: (range: HoursRange) => void;
15
+ };
16
+ /** The props of one compact time field of a range (`o` opens, `c` closes). */
17
+ export declare function rangeFieldProps({ text, key, day, n, range, error, errorId, disabled, onChange, }: Options): {
18
+ size: "sm";
19
+ clearable: boolean;
20
+ disabled: boolean | undefined;
21
+ value: string;
22
+ error: boolean;
23
+ 'aria-describedby': string | undefined;
24
+ className: string;
25
+ 'aria-label': string;
26
+ onValueChange: (value?: string) => void;
27
+ };
28
+ export {};
@@ -0,0 +1,24 @@
1
+ import { HoursRangeError } from '../logic/range-errors.js';
2
+ import { HoursRange } from '../logic/week.js';
3
+ import { HoursText } from '../use-hours-text.js';
4
+ type RangeRowProps = {
5
+ text: HoursText;
6
+ day: number;
7
+ /** Position of the range in its day, from 0. */
8
+ index: number;
9
+ range: HoursRange;
10
+ error?: HoursRangeError;
11
+ disabled?: boolean;
12
+ /** The scoped focus keys of the two time fields. */
13
+ focusKeys: {
14
+ open: string;
15
+ close: string;
16
+ };
17
+ onChange: (range: HoursRange) => void;
18
+ onRemove: () => void;
19
+ };
20
+ /** One range of a day: opening and closing time, remove, and its error. */
21
+ export declare function RangeRow({ text, day, index, range, error, disabled, focusKeys, onChange, onRemove, }: RangeRowProps): import("react").JSX.Element;
22
+ /** The sentence for a range error. */
23
+ export declare function errorText({ t }: HoursText, error: HoursRangeError): string;
24
+ export {};
@@ -0,0 +1,13 @@
1
+ import { Status } from '../logic/status.js';
2
+ import { HoursText } from '../use-hours-text.js';
3
+ /** "Open · closes at 6:00 PM" or "Closed · opens Monday at 9:00 AM". */
4
+ export declare function statusDetail(text: HoursText, status: Status, today: number): string | null;
5
+ type StatusPillProps = {
6
+ text: HoursText;
7
+ status: Status;
8
+ today: number;
9
+ className?: string;
10
+ };
11
+ /** The tonal pill that says whether the place is open now, and what is next. */
12
+ export declare function StatusPill({ text, status, today, className, }: StatusPillProps): import("react").JSX.Element;
13
+ export {};
@@ -0,0 +1,8 @@
1
+ import { WeekStart } from './logic/week.js';
2
+ /**
3
+ * The first day of the week: `weekStartsOn` when given, else the locale's.
4
+ * Until the page has mounted the answer comes from the language alone, the
5
+ * same on a server and in a browser, so hydration matches; then the locale's
6
+ * own week info replaces it.
7
+ */
8
+ export declare function useFirstDay(locale: string, weekStartsOn?: WeekStart): WeekStart;
@@ -0,0 +1,26 @@
1
+ import { Day } from './logic/week.js';
2
+ import { OpeningHoursFieldValue } from './models.js';
3
+ import { HoursText } from './use-hours-text.js';
4
+ type Options = {
5
+ value: OpeningHoursFieldValue[] | undefined;
6
+ onValueChange?: (value: OpeningHoursFieldValue[]) => void;
7
+ text: HoursText;
8
+ };
9
+ /**
10
+ * The week an editor shows, how it changes the value, its copy note, and the
11
+ * focus hand-off a day's controls use after a range is added or removed.
12
+ */
13
+ export declare function useHoursEditor({ value, onValueChange, text }: Options): {
14
+ focus: {
15
+ key: (name: string) => string;
16
+ request: (name: string) => void;
17
+ };
18
+ week: import('./logic/week.js').Week;
19
+ note: string;
20
+ sheet: number | null;
21
+ setSheet: import('react').Dispatch<import('react').SetStateAction<number | null>>;
22
+ issues: number;
23
+ setDay: (index: number, day: Day) => void;
24
+ copy: (from: number, to: number[]) => void;
25
+ };
26
+ export {};
@@ -0,0 +1,8 @@
1
+ /** The translator and the locale the hours components print with. */
2
+ export declare function useHoursText(locale?: string): {
3
+ t: (key: import('../../../../i18n/index.js').MaterialLocaleKey, fallback: string, options?: import('../../../../i18n/index.js').TranslationContext) => string;
4
+ locale: string;
5
+ time: (value: string) => string;
6
+ day: (day: number, width?: "long" | "short") => string;
7
+ };
8
+ export type HoursText = ReturnType<typeof useHoursText>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The moment the summary reads: `now` when given, else the clock, once the
3
+ * page has mounted and every minute after. `null` before that, so a server
4
+ * and a hydrating client render the same (no status, no "today").
5
+ */
6
+ export declare function useNow(now?: Date): Date | null;
@@ -416,10 +416,20 @@ export declare const en: {
416
416
  cancel: string;
417
417
  remove: string;
418
418
  "add-option": string;
419
+ done: string;
420
+ "remove-row": string;
421
+ "edit-row": string;
422
+ reorder: string;
419
423
  };
420
424
  labels: {
425
+ none: string;
421
426
  "new-attribute": string;
422
427
  attributes: string;
428
+ default: string;
429
+ yes: string;
430
+ no: string;
431
+ hint: string;
432
+ untitled: string;
423
433
  };
424
434
  messages: {
425
435
  "create-succeeded": string;
@@ -428,6 +438,7 @@ export declare const en: {
428
438
  empty: string;
429
439
  "add-first": string;
430
440
  dialog: string;
441
+ sheet: string;
431
442
  };
432
443
  types: {
433
444
  color: string;
@@ -486,6 +497,17 @@ export declare const en: {
486
497
  placeholder: string;
487
498
  };
488
499
  };
500
+ errors: {
501
+ duplicate: string;
502
+ empty: string;
503
+ issues: string;
504
+ };
505
+ announce: {
506
+ lift: string;
507
+ move: string;
508
+ drop: string;
509
+ cancel: string;
510
+ };
489
511
  };
490
512
  table: {
491
513
  loading: string;
@@ -545,6 +567,9 @@ export declare const en: {
545
567
  type: string;
546
568
  value: string;
547
569
  label: string;
570
+ "row-type": string;
571
+ "row-value": string;
572
+ "row-label": string;
548
573
  };
549
574
  types: {
550
575
  phone: string;
@@ -569,14 +594,35 @@ export declare const en: {
569
594
  edit: string;
570
595
  save: string;
571
596
  cancel: string;
597
+ "make-primary": string;
598
+ "is-primary": string;
599
+ call: string;
600
+ "send-email": string;
601
+ "open-site": string;
602
+ "copy-value": string;
603
+ done: string;
604
+ "remove-row": string;
605
+ "add-type": string;
572
606
  };
573
607
  messages: {
574
608
  "no-contacts": string;
575
609
  "add-first": string;
576
610
  dialog: string;
611
+ sheet: string;
577
612
  };
578
613
  labels: {
614
+ none: string;
579
615
  contacts: string;
616
+ primary: string;
617
+ group: string;
618
+ };
619
+ errors: {
620
+ email: string;
621
+ phone: string;
622
+ website: string;
623
+ duplicate: string;
624
+ empty: string;
625
+ issues: string;
580
626
  };
581
627
  };
582
628
  "opening-hours": {
@@ -585,6 +631,9 @@ export declare const en: {
585
631
  openTime: string;
586
632
  closeTime: string;
587
633
  isClosed: string;
634
+ "range-open": string;
635
+ "range-close": string;
636
+ "day-open": string;
588
637
  };
589
638
  days: {
590
639
  "0": string;
@@ -616,16 +665,42 @@ export declare const en: {
616
665
  edit: string;
617
666
  save: string;
618
667
  cancel: string;
668
+ "add-range": string;
669
+ "remove-range": string;
670
+ "copy-to": string;
671
+ copy: string;
672
+ done: string;
619
673
  };
620
674
  labels: {
621
675
  "closed-all-day": string;
622
676
  "open-hours": string;
677
+ today: string;
678
+ open: string;
679
+ closed: string;
680
+ "copy-weekdays": string;
681
+ "copy-weekend": string;
682
+ "copy-all": string;
683
+ copied: string;
684
+ "copy-days": string;
623
685
  };
624
686
  messages: {
625
687
  "no-hours": string;
626
688
  "add-first": string;
627
689
  dialog: string;
628
690
  };
691
+ status: {
692
+ "closes-at": string;
693
+ "opens-at": string;
694
+ "opens-tomorrow": string;
695
+ "opens-day": string;
696
+ unset: string;
697
+ };
698
+ errors: {
699
+ close: string;
700
+ overlap: string;
701
+ missing: string;
702
+ issues: string;
703
+ };
629
704
  };
630
705
  "postal-address": {
631
706
  fields: {
@@ -405,11 +405,21 @@ declare const _default: {
405
405
  "save": "Save",
406
406
  "cancel": "Cancel",
407
407
  "remove": "Delete",
408
- "add-option": "Add option"
408
+ "add-option": "Add option",
409
+ "done": "Done",
410
+ "remove-row": "Remove {name}",
411
+ "edit-row": "Edit {name}",
412
+ "reorder": "Reorder {name}"
409
413
  },
410
414
  "labels": {
415
+ "none": "No attributes",
411
416
  "new-attribute": "New attribute",
412
- "attributes": "Attributes"
417
+ "attributes": "Attributes",
418
+ "default": "Default",
419
+ "yes": "Yes",
420
+ "no": "No",
421
+ "hint": "Drag the handle, or press Space, then ↑ ↓, Space to drop, Esc to cancel",
422
+ "untitled": "Untitled attribute"
413
423
  },
414
424
  "messages": {
415
425
  "create-succeeded": "Attribute successfully created",
@@ -417,7 +427,8 @@ declare const _default: {
417
427
  "delete-succeeded": "{count, plural, one {Attribute successfully deleted} other {# attributes successfully deleted}}",
418
428
  "empty": "No attributes yet",
419
429
  "add-first": "Add an attribute to get started.",
420
- "dialog": "Name, type, and optional defaults."
430
+ "dialog": "Name, type, and optional defaults.",
431
+ "sheet": "Edit this attribute."
421
432
  },
422
433
  "types": {
423
434
  "color": "Color",
@@ -475,6 +486,17 @@ declare const _default: {
475
486
  "label": "Unit",
476
487
  "placeholder": "Enter unit (e.g., kg, cm)"
477
488
  }
489
+ },
490
+ "errors": {
491
+ "duplicate": "Another attribute already has this name.",
492
+ "empty": "Enter a name.",
493
+ "issues": "{count, plural, one {# issue to fix} other {# issues to fix}}"
494
+ },
495
+ "announce": {
496
+ "lift": "Picked up {name}, position {position} of {count}. Use the arrow keys to move it, Space to drop it, Escape to cancel.",
497
+ "move": "{name} moved to position {position} of {count}.",
498
+ "drop": "{name} dropped at position {position} of {count}.",
499
+ "cancel": "Reorder cancelled. {name} is back at position {position} of {count}."
478
500
  }
479
501
  },
480
502
  "table": {
@@ -534,7 +556,10 @@ declare const _default: {
534
556
  "fields": {
535
557
  "type": "Type",
536
558
  "value": "Value",
537
- "label": "Label"
559
+ "label": "Label",
560
+ "row-type": "{type} {n}: type",
561
+ "row-value": "{type} {n}: value",
562
+ "row-label": "{type} {n}: label"
538
563
  },
539
564
  "types": {
540
565
  "phone": "Phone",
@@ -558,15 +583,36 @@ declare const _default: {
558
583
  "remove": "Remove Contact",
559
584
  "edit": "Edit contact",
560
585
  "save": "Save",
561
- "cancel": "Cancel"
586
+ "cancel": "Cancel",
587
+ "make-primary": "Make primary",
588
+ "is-primary": "Primary for this type",
589
+ "call": "Call",
590
+ "send-email": "Send an email",
591
+ "open-site": "Open site",
592
+ "copy-value": "Copy {value}",
593
+ "done": "Done",
594
+ "remove-row": "Remove {type} {n}",
595
+ "add-type": "Add {type}"
562
596
  },
563
597
  "messages": {
564
598
  "no-contacts": "No contacts added yet",
565
599
  "add-first": "Click the button below to add a contact",
566
- "dialog": "Type, value, and an optional label."
600
+ "dialog": "Type, value, and an optional label.",
601
+ "sheet": "Edit this contact."
567
602
  },
568
603
  "labels": {
569
- "contacts": "Contacts"
604
+ "none": "No contacts",
605
+ "contacts": "Contacts",
606
+ "primary": "Primary",
607
+ "group": "{type}, {count, plural, one {# contact} other {# contacts}}"
608
+ },
609
+ "errors": {
610
+ "email": "Enter a valid email address.",
611
+ "phone": "Enter 7 to 15 digits.",
612
+ "website": "Start with https:// or http://.",
613
+ "duplicate": "Already listed ({name}).",
614
+ "empty": "Enter a value.",
615
+ "issues": "{count, plural, one {# issue to fix} other {# issues to fix}}"
570
616
  }
571
617
  },
572
618
  "opening-hours": {
@@ -574,7 +620,10 @@ declare const _default: {
574
620
  "dayOfWeek": "Day of Week",
575
621
  "openTime": "Opening Time",
576
622
  "closeTime": "Closing Time",
577
- "isClosed": "Closed"
623
+ "isClosed": "Closed",
624
+ "range-open": "{day}, range {n}: opening time",
625
+ "range-close": "{day}, range {n}: closing time",
626
+ "day-open": "{day}: open"
578
627
  },
579
628
  "days": {
580
629
  "0": "Sunday",
@@ -605,16 +654,42 @@ declare const _default: {
605
654
  "add-all": "Add All Days",
606
655
  "edit": "Edit hours",
607
656
  "save": "Save",
608
- "cancel": "Cancel"
657
+ "cancel": "Cancel",
658
+ "add-range": "Add hours",
659
+ "remove-range": "Remove range {n} of {day}",
660
+ "copy-to": "Copy to…",
661
+ "copy": "Copy",
662
+ "done": "Done"
609
663
  },
610
664
  "labels": {
611
665
  "closed-all-day": "Closed all day",
612
- "open-hours": "Opening Hours"
666
+ "open-hours": "Opening Hours",
667
+ "today": "Today",
668
+ "open": "Open",
669
+ "closed": "Closed",
670
+ "copy-weekdays": "Monday to Friday",
671
+ "copy-weekend": "Weekend",
672
+ "copy-all": "All days",
673
+ "copied": "Copied to {days}",
674
+ "copy-days": "Copy {day} to"
613
675
  },
614
676
  "messages": {
615
677
  "no-hours": "No opening hours configured",
616
- "add-first": "Click the button below to add opening hours",
678
+ "add-first": "Use the button above to add opening hours",
617
679
  "dialog": "Day, opening time, and closing time."
680
+ },
681
+ "status": {
682
+ "closes-at": "closes at {time}",
683
+ "opens-at": "opens at {time}",
684
+ "opens-tomorrow": "opens tomorrow at {time}",
685
+ "opens-day": "opens {day} at {time}",
686
+ "unset": "Hours not set"
687
+ },
688
+ "errors": {
689
+ "close": "Closing time must be after opening time.",
690
+ "overlap": "This range overlaps another one.",
691
+ "missing": "Enter both times.",
692
+ "issues": "{count, plural, one {# issue to fix} other {# issues to fix}}"
618
693
  }
619
694
  },
620
695
  "postal-address": {