@jobber/components 6.103.2-JOB-140609-9051081.26 → 6.103.2-JOB-140609-8386817.45

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 (34) hide show
  1. package/dist/Autocomplete/Autocomplete.types.d.ts +1 -1
  2. package/dist/Checkbox/Checkbox.types.d.ts +1 -1
  3. package/dist/Checkbox/index.cjs +3 -2
  4. package/dist/Checkbox/index.mjs +3 -2
  5. package/dist/FormField/FormFieldTypes.d.ts +1 -219
  6. package/dist/FormField/hooks/useFormFieldWrapperStyles.d.ts +7 -2
  7. package/dist/InputDate/index.cjs +4 -12
  8. package/dist/InputDate/index.mjs +4 -12
  9. package/dist/InputDate/useInputDateActivatorActions.d.ts +4 -8
  10. package/dist/InputEmail/InputEmail.types.d.ts +3 -6
  11. package/dist/InputEmail/index.cjs +4 -5
  12. package/dist/InputEmail/index.mjs +4 -5
  13. package/dist/InputNumber/InputNumber.rebuilt.types.d.ts +2 -6
  14. package/dist/InputNumber/index.cjs +1 -4
  15. package/dist/InputNumber/index.mjs +1 -4
  16. package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +2 -5
  17. package/dist/InputPhoneNumber/index.cjs +3 -5
  18. package/dist/InputPhoneNumber/index.mjs +3 -5
  19. package/dist/InputText/InputText.d.ts +2 -2
  20. package/dist/InputText/InputText.types.d.ts +3 -6
  21. package/dist/InputText/index.cjs +36 -7
  22. package/dist/InputText/index.mjs +37 -8
  23. package/dist/InputTime/InputTime.types.d.ts +2 -2
  24. package/dist/InputTime/hooks/useInputTimeActions.d.ts +16 -0
  25. package/dist/InputTime/index.cjs +56 -31
  26. package/dist/InputTime/index.mjs +57 -32
  27. package/dist/Select/Select.types.d.ts +1 -1
  28. package/dist/Select/index.cjs +2 -1
  29. package/dist/Select/index.mjs +2 -1
  30. package/dist/Tabs-es.js +1 -1
  31. package/dist/debounce-es.js +1 -1
  32. package/dist/sharedHelpers/types.d.ts +235 -0
  33. package/dist/useScrollToActive-es.js +1 -1
  34. package/package.json +2 -2
@@ -1,3 +1,8 @@
1
+ import type { AriaAttributes, ReactNode } from "react";
2
+ import type React from "react";
3
+ import type { XOR } from "ts-xor";
4
+ import type { Clearable } from "@jobber/hooks";
5
+ import type { IconNames } from "../Icon";
1
6
  export interface CommonAtlantisProps {
2
7
  /** Standard HTML data attributes. Accepts anything in a {{"data-key":"value"}} format. */
3
8
  dataAttributes?: {
@@ -10,8 +15,238 @@ export interface CommonAtlantisProps {
10
15
  /** Standard HTML id attribute. */
11
16
  id?: string;
12
17
  }
18
+ /**
19
+ * Core ARIA attributes for input elements.
20
+ * Uses camelCase naming for consistency with React props pattern.
21
+ * Based on React's canonical ARIA type definitions.
22
+ */
23
+ export interface AriaInputProps {
24
+ /**
25
+ * Defines a string value that labels the current element.
26
+ * @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-label}
27
+ */
28
+ readonly ariaLabel?: AriaAttributes["aria-label"];
29
+ /**
30
+ * Identifies the element (or elements) that labels the current element.
31
+ * @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-labelledby}
32
+ */
33
+ readonly ariaLabelledBy?: AriaAttributes["aria-labelledby"];
34
+ /**
35
+ * Identifies the element (or elements) that describes the object.
36
+ * @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-describedby}
37
+ */
38
+ readonly ariaDescribedBy?: AriaAttributes["aria-describedby"];
39
+ /**
40
+ * Identifies the element (or elements) that provide a detailed, extended description.
41
+ * @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-details}
42
+ */
43
+ readonly ariaDetails?: AriaAttributes["aria-details"];
44
+ /**
45
+ * ID of the currently active descendant element.
46
+ * Used for composite widgets like combobox or listbox.
47
+ * @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-activedescendant}
48
+ */
49
+ readonly ariaActiveDescendant?: AriaAttributes["aria-activedescendant"];
50
+ /**
51
+ * Indicates the element that controls the current element.
52
+ * @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-controls}
53
+ */
54
+ readonly ariaControls?: AriaAttributes["aria-controls"];
55
+ /**
56
+ * Indicates whether the element is expanded or collapsed.
57
+ * @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-expanded}
58
+ */
59
+ readonly ariaExpanded?: AriaAttributes["aria-expanded"];
60
+ /**
61
+ * Indicates the type of autocomplete interaction.
62
+ * @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-autocomplete}
63
+ */
64
+ readonly ariaAutocomplete?: AriaAttributes["aria-autocomplete"];
65
+ /**
66
+ * Indicates that user input is required before form submission.
67
+ * @see {@link https://www.w3.org/TR/wai-aria-1.2/#aria-required}
68
+ */
69
+ readonly ariaRequired?: AriaAttributes["aria-required"];
70
+ }
71
+ /**
72
+ * Focus event handlers for input elements.
73
+ * Generic interface that can be specialized for different element types.
74
+ */
75
+ export interface FocusEvents<Target = HTMLElement> {
76
+ /**
77
+ * Focus event handler.
78
+ */
79
+ readonly onFocus?: (event: React.FocusEvent<Target>) => void;
80
+ /**
81
+ * Blur event handler.
82
+ */
83
+ readonly onBlur?: (event: React.FocusEvent<Target>) => void;
84
+ }
85
+ /**
86
+ * Keyboard event handlers for input elements.
87
+ * Generic interface that can be specialized for different element types.
88
+ */
89
+ export interface KeyboardEvents<Target = HTMLElement> {
90
+ /**
91
+ * Key down event handler.
92
+ */
93
+ readonly onKeyDown?: (event: React.KeyboardEvent<Target>) => void;
94
+ /**
95
+ * Key up event handler.
96
+ */
97
+ readonly onKeyUp?: (event: React.KeyboardEvent<Target>) => void;
98
+ }
99
+ /**
100
+ * Curated set of HTML input attributes for rebuilt input components.
101
+ * This provides a whitelist of standard HTML/React props we want to support,
102
+ * avoiding the issues of extending React.InputHTMLAttributes directly.
103
+ * Note: Event handlers and ARIA attributes are separate - use FocusEvents, KeyboardEvents, and AriaInputProps.
104
+ */
105
+ export interface HTMLInputBaseProps extends AriaInputProps {
106
+ /**
107
+ * The unique identifier for the input element.
108
+ */
109
+ readonly id?: string;
110
+ /**
111
+ * The name attribute for the input element.
112
+ */
113
+ readonly name?: string;
114
+ /**
115
+ * Whether the input is disabled.
116
+ */
117
+ readonly disabled?: boolean;
118
+ /**
119
+ * Whether the input is read-only (HTML standard casing).
120
+ */
121
+ readonly readOnly?: boolean;
122
+ /**
123
+ * Whether the input should be auto-focused (React casing).
124
+ */
125
+ readonly autoFocus?: boolean;
126
+ /**
127
+ * Autocomplete behavior for the input (React casing, string values only).
128
+ * Use standard HTML autocomplete values or "on"/"off".
129
+ */
130
+ readonly autoComplete?: string;
131
+ /**
132
+ * Validation pattern (regex) for the input.
133
+ */
134
+ readonly pattern?: string;
135
+ /**
136
+ * Input mode hint for virtual keyboards.
137
+ */
138
+ readonly inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search";
139
+ /**
140
+ * Role attribute for accessibility.
141
+ */
142
+ readonly role?: string;
143
+ /**
144
+ * Tab index for keyboard navigation.
145
+ */
146
+ readonly tabIndex?: number;
147
+ }
148
+ /**
149
+ * Numeric/date constraint props for inputs that support min/max values.
150
+ * Only extend this for input types where these make semantic sense (number, date, range, etc.).
151
+ */
152
+ export interface InputConstraintProps {
153
+ /**
154
+ * Maximum numerical or date value.
155
+ */
156
+ readonly max?: number | string;
157
+ /**
158
+ * Minimum numerical or date value.
159
+ */
160
+ readonly min?: number | string;
161
+ }
162
+ /**
163
+ * Character length constraint for inputs.
164
+ * Only extend this for text-based inputs where character limits make sense.
165
+ */
166
+ export interface InputLengthConstraint {
167
+ /**
168
+ * Maximum character length for the input.
169
+ * Note: This affects both HTML validation AND visual width of the component.
170
+ * Future work will separate these concerns.
171
+ */
172
+ readonly maxLength?: number;
173
+ }
174
+ export interface Affix {
175
+ readonly label?: string;
176
+ readonly icon?: IconNames;
177
+ }
178
+ interface BaseSuffix extends Affix {
179
+ readonly icon: IconNames;
180
+ onClick?(): void;
181
+ }
182
+ export interface Suffix extends BaseSuffix {
183
+ onClick(): void;
184
+ readonly ariaLabel: string;
185
+ }
186
+ /**
187
+ * Common props shared across all rebuilt input components.
188
+ * These are Atlantis-specific features not part of standard HTML inputs.
189
+ */
190
+ export interface RebuiltInputCommonProps {
191
+ /**
192
+ * Text that appears inside the input when empty and floats above the value
193
+ * as a mini label once the user enters a value.
194
+ * When showMiniLabel is false, this text only serves as a standard placeholder and
195
+ * disappears when the user types.
196
+ */
197
+ readonly placeholder?: string;
198
+ /**
199
+ * Error message to display. This also highlights the field red.
200
+ */
201
+ readonly error?: string;
202
+ /**
203
+ * Highlights the field red to indicate an error.
204
+ */
205
+ readonly invalid?: boolean;
206
+ /**
207
+ * Show a spinner to indicate loading.
208
+ */
209
+ readonly loading?: boolean;
210
+ /**
211
+ * Add a clear action on the input that clears the value.
212
+ */
213
+ readonly clearable?: Clearable;
214
+ /**
215
+ * Adjusts the interface to either have small or large spacing.
216
+ */
217
+ readonly size?: "small" | "large";
218
+ /**
219
+ * Adjusts the form field to go inline with content.
220
+ */
221
+ readonly inline?: boolean;
222
+ /**
223
+ * Determines the alignment of the text inside the input.
224
+ */
225
+ readonly align?: "center" | "right";
226
+ /**
227
+ * Adds a prefix label and icon to the field.
228
+ */
229
+ readonly prefix?: Affix;
230
+ /**
231
+ * Adds a suffix label and icon with an optional action to the field.
232
+ */
233
+ readonly suffix?: XOR<Affix, Suffix>;
234
+ /**
235
+ * Further description of the input, can be used for a hint.
236
+ */
237
+ readonly description?: ReactNode;
238
+ /**
239
+ * Children elements to render inside the component.
240
+ */
241
+ readonly children?: ReactNode;
242
+ /**
243
+ * Version 2 is highly experimental. Avoid using it unless you have talked with Atlantis first.
244
+ */
245
+ readonly version: 2;
246
+ }
13
247
  /** Represents a day of the week as a number where 0 = Sunday, 1 = Monday, etc. */
14
248
  export type DayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
15
249
  export type CommonAllowedElements = "section" | "p" | "article" | "ul" | "li" | "div" | "span" | "dl" | "dd" | "dt";
16
250
  export type Spaces = "none" | "minuscule" | "slim" | "smallest" | "smaller" | "small" | "base" | "large" | "larger" | "largest" | "extravagant";
17
251
  export type GapSpacing = Spaces | (string & NonNullable<unknown>);
252
+ export {};
@@ -8,7 +8,7 @@ import { i as isSymbol_1 } from './isSymbol-es.js';
8
8
  import { i as identity_1 } from './identity-es.js';
9
9
  import { _ as _baseRest, a as _isIterateeCall } from './_isIterateeCall-es.js';
10
10
  import { useLiveAnnounce } from '@jobber/hooks';
11
- import { d as debounce } from './debounce-es.js';
11
+ import { a as debounce } from './debounce-es.js';
12
12
  import { I as Icon } from './Icon-es.js';
13
13
  import { u as useFloating, o as offset, f as flip, c as size, b as autoUpdate } from './floating-ui.react-es.js';
14
14
  import { c as calculateMaxHeight } from './maxHeight-es.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.103.2-JOB-140609-9051081.26+90510815f",
3
+ "version": "6.103.2-JOB-140609-8386817.45+8386817c4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -538,5 +538,5 @@
538
538
  "> 1%",
539
539
  "IE 10"
540
540
  ],
541
- "gitHead": "90510815f31f3c04ee1c9d53cd024e26c94a3e2f"
541
+ "gitHead": "8386817c443c0866d7979714a10f81c25b281158"
542
542
  }