@jobber/components 8.4.0 → 8.6.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 (56) hide show
  1. package/dist/Autocomplete/Autocomplete.d.ts +6 -4
  2. package/dist/Autocomplete/Autocomplete.types.d.ts +3 -137
  3. package/dist/Autocomplete/components/FloatingMenu.d.ts +6 -6
  4. package/dist/Autocomplete/components/MenuList.d.ts +4 -4
  5. package/dist/Autocomplete/components/PersistentRegion.d.ts +3 -3
  6. package/dist/Autocomplete/index.cjs +25 -1658
  7. package/dist/Autocomplete/index.d.ts +3 -30
  8. package/dist/Autocomplete/index.mjs +25 -1647
  9. package/dist/Autocomplete/tests/Autocomplete.setup.d.ts +15 -15
  10. package/dist/Autocomplete/useAutocomplete.d.ts +2 -2
  11. package/dist/Autocomplete-cjs.js +1306 -0
  12. package/dist/Autocomplete-es.js +1304 -0
  13. package/dist/FormField/FormFieldTypes.d.ts +0 -7
  14. package/dist/InputDate/InputDate.types.d.ts +1 -1
  15. package/dist/InputEmail/InputEmail.types.d.ts +1 -1
  16. package/dist/InputNumber/InputNumber.types.d.ts +1 -1
  17. package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +1 -1
  18. package/dist/InputText/InputText.types.d.ts +1 -5
  19. package/dist/InputTime/InputTime.types.d.ts +1 -1
  20. package/dist/Menu-es.js +1 -1
  21. package/dist/MenuSubmenuTrigger-es.js +1 -1
  22. package/dist/Select/OptionGroup.d.ts +2 -2
  23. package/dist/Select/Select.types.d.ts +1 -1
  24. package/dist/docs/Autocomplete/{AutocompleteV2.md → Autocomplete.md} +13 -107
  25. package/dist/docs/Banner/Banner.md +3 -3
  26. package/dist/docs/Box/Box.md +2 -2
  27. package/dist/docs/Chips/Chips.md +1 -1
  28. package/dist/docs/DataList/DataList.md +1 -1
  29. package/dist/docs/FormField/FormField.md +0 -1
  30. package/dist/docs/Icon/Icon.md +1 -1
  31. package/dist/docs/InputGroup/InputGroup.md +1 -1
  32. package/dist/docs/InputPassword/InputPassword.md +0 -1
  33. package/dist/docs/Menu/Menu.md +1 -1
  34. package/dist/docs/Modal/Modal.md +3 -3
  35. package/dist/docs/MultiSelect/MultiSelect.md +1 -1
  36. package/dist/docs/index.md +1 -2
  37. package/dist/docs/usage-guidelines/usage-guidelines.md +13 -44
  38. package/dist/floating-ui.react-dom-es.js +1 -1
  39. package/dist/floating-ui.react-es.js +1 -1
  40. package/dist/index.cjs +2 -2
  41. package/dist/index.esm-es.js +1 -1
  42. package/dist/index.mjs +1 -1
  43. package/dist/sharedHelpers/types.d.ts +0 -4
  44. package/dist/styles.css +29 -153
  45. package/package.json +2 -2
  46. package/dist/Autocomplete/Autocomplete.rebuilt.d.ts +0 -8
  47. package/dist/Autocomplete/Autocomplete.utils.d.ts +0 -8
  48. package/dist/Autocomplete/Menu/DefaultMenu.d.ts +0 -16
  49. package/dist/Autocomplete/Menu/Menu.d.ts +0 -3
  50. package/dist/Autocomplete/Menu/MenuWrapper.d.ts +0 -23
  51. package/dist/Autocomplete/Option.d.ts +0 -78
  52. package/dist/Autocomplete/V1.docgen.d.ts +0 -4
  53. package/dist/Autocomplete/V2.docgen.d.ts +0 -6
  54. package/dist/Autocomplete/useKeyboardNavigation.d.ts +0 -35
  55. package/dist/Autocomplete/useRepositionMenu.d.ts +0 -10
  56. package/dist/docs/Autocomplete/AutocompleteV1.md +0 -1328
package/dist/index.cjs CHANGED
@@ -6,7 +6,7 @@ var AnimatedSwitcher = require('./AnimatedSwitcher-cjs.js');
6
6
  var AtlantisContext = require('./AtlantisContext-cjs.js');
7
7
  var AtlantisThemeContext = require('./AtlantisThemeContext-cjs.js');
8
8
  var updateTheme = require('./updateTheme-cjs.js');
9
- var Autocomplete_index = require('./Autocomplete/index.cjs');
9
+ var Autocomplete = require('./Autocomplete-cjs.js');
10
10
  var Avatar = require('./Avatar-cjs.js');
11
11
  var Banner = require('./Banner-cjs.js');
12
12
  var Box = require('./Box-cjs.js');
@@ -217,7 +217,7 @@ exports.THEME_CHANGE_EVENT = AtlantisThemeContext.THEME_CHANGE_EVENT;
217
217
  exports.atlantisThemeContextDefaultValues = AtlantisThemeContext.atlantisThemeContextDefaultValues;
218
218
  exports.useAtlantisTheme = AtlantisThemeContext.useAtlantisTheme;
219
219
  exports.updateTheme = updateTheme.updateTheme;
220
- exports.Autocomplete = Autocomplete_index.Autocomplete;
220
+ exports.Autocomplete = Autocomplete.Autocomplete;
221
221
  exports.Avatar = Avatar.Avatar;
222
222
  exports.Banner = Banner.Banner;
223
223
  exports.Box = Box.Box;
@@ -709,4 +709,4 @@ var isTabbable = function isTabbable(node, options) {
709
709
  return isNodeMatchingSelectorTabbable(options, node);
710
710
  };
711
711
 
712
- export { focusable as a, getSideAxis as b, getOppositePlacement as c, getExpandedPlacements as d, evaluate as e, floor as f, getSide as g, getOppositeAxisPlacements as h, isTabbable as i, getAlignmentSides as j, getAlignment as k, max as l, min as m, getAlignmentAxis as n, getPaddingObject as o, clamp as p, getAxisLength as q, rectToClientRect as r, sides as s, tabbable as t, getOppositeAxis as u, placements as v, getOppositeAlignmentPlacement as w, createCoords as x, round as y };
712
+ export { focusable as a, getAlignmentAxis as b, getSide as c, getAlignment as d, evaluate as e, floor as f, getSideAxis as g, getPaddingObject as h, isTabbable as i, getOppositePlacement as j, getExpandedPlacements as k, getOppositeAxisPlacements as l, getAlignmentSides as m, clamp as n, min as o, max as p, getAxisLength as q, rectToClientRect as r, sides as s, tabbable as t, getOppositeAxis as u, placements as v, getOppositeAlignmentPlacement as w, createCoords as x, round as y };
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ export { A as AnimatedSwitcher } from './AnimatedSwitcher-es.js';
4
4
  export { A as AtlantisContext, a as atlantisContextDefaultValues, u as useAtlantisContext } from './AtlantisContext-es.js';
5
5
  export { A as AtlantisThemeContextProvider, T as THEME_CHANGE_EVENT, a as atlantisThemeContextDefaultValues, u as useAtlantisTheme } from './AtlantisThemeContext-es.js';
6
6
  export { u as updateTheme } from './updateTheme-es.js';
7
- export { Autocomplete } from './Autocomplete/index.mjs';
7
+ export { A as Autocomplete } from './Autocomplete-es.js';
8
8
  export { A as Avatar } from './Avatar-es.js';
9
9
  export { B as Banner } from './Banner-es.js';
10
10
  export { B as Box } from './Box-es.js';
@@ -243,10 +243,6 @@ export interface RebuiltInputCommonProps {
243
243
  * Further description of the input, can be used for a hint.
244
244
  */
245
245
  readonly description?: ReactNode;
246
- /**
247
- * Version 2 is highly experimental. Avoid using it unless you have talked with Atlantis first.
248
- */
249
- readonly version: 2;
250
246
  }
251
247
  /** Represents a day of the week as a number where 0 = Sunday, 1 = Monday, etc. */
252
248
  export type DayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
package/dist/styles.css CHANGED
@@ -285,7 +285,7 @@
285
285
  display: contents;
286
286
  }
287
287
 
288
- ._37kZB-nYE08- {
288
+ .w5g7qggGrr4- {
289
289
  display: -ms-flexbox;
290
290
  display: flex;
291
291
  -ms-flex-direction: column;
@@ -308,7 +308,7 @@
308
308
  scroll-behavior: smooth;
309
309
  }
310
310
 
311
- .ULib3TUQja0- {
311
+ .ELlB2Kio7q8- {
312
312
  display: -ms-flexbox;
313
313
  display: flex;
314
314
  -ms-flex-direction: column;
@@ -319,7 +319,7 @@
319
319
  padding: var(--space-small) var(--space-base);
320
320
  }
321
321
 
322
- .h5-1Pp0eRyo- {
322
+ .y9zhi8Wr8QA- {
323
323
  width: 100%;
324
324
  box-sizing: border-box;
325
325
  padding: 8px;
@@ -330,7 +330,7 @@
330
330
  cursor: pointer;
331
331
  }
332
332
 
333
- .iBkyj85vd-E- {
333
+ .adJv-3bhYOQ- {
334
334
  display: -ms-flexbox;
335
335
  display: flex;
336
336
  text-align: left;
@@ -346,7 +346,7 @@
346
346
  align-items: center;
347
347
  }
348
348
 
349
- .h5-1Pp0eRyo- .I6wAbSJJHNQ- {
349
+ .y9zhi8Wr8QA- .K2phy6IC3TY- {
350
350
  -ms-flex: 0 1 auto;
351
351
  flex: 0 1 auto;
352
352
  -ms-flex-item-align: auto;
@@ -355,13 +355,13 @@
355
355
  width: var(--space-large);
356
356
  }
357
357
 
358
- ._4yhnonWAWRY-,
359
- .oGLMF6n8C74- {
358
+ .p2CY3TGCdRc-,
359
+ .-tyLeCnCEUI- {
360
360
  background: hsl(43, 18%, 92%);
361
361
  background: var(--color-surface--hover);
362
362
  }
363
363
 
364
- .LBrwH6TEUYA- {
364
+ .dXIHuZjqX84- {
365
365
  box-sizing: border-box;
366
366
  padding: 8px;
367
367
  padding: var(--space-small);
@@ -369,13 +369,13 @@
369
369
  cursor: pointer;
370
370
  }
371
371
 
372
- .h5-1Pp0eRyo-:hover,
373
- .LBrwH6TEUYA-:hover {
372
+ .y9zhi8Wr8QA-:hover,
373
+ .dXIHuZjqX84-:hover {
374
374
  background: hsl(43, 18%, 92%);
375
375
  background: var(--color-surface--hover);
376
376
  }
377
377
 
378
- .DDOv4DR8bJQ- {
378
+ .gQ86NtBHt-Y- {
379
379
  padding: 8px 0 4px 8px;
380
380
  padding: var(--space-small) 0 var(--space-smaller) var(--space-small);
381
381
  border-bottom: 1px solid hsl(200, 13%, 87%);
@@ -383,13 +383,13 @@
383
383
  cursor: default;
384
384
  }
385
385
 
386
- .Twgjn26oldE- {
386
+ .uElGEScjH68- {
387
387
  padding: 8px 16px;
388
388
  padding: var(--space-small) var(--space-base);
389
389
  cursor: default;
390
390
  }
391
391
 
392
- .mc1-CEwZtHE- {
392
+ .nXvoRgKgoz8- {
393
393
  position: sticky;
394
394
  top: 0;
395
395
  z-index: 1;
@@ -398,21 +398,21 @@
398
398
  background: var(--color-surface);
399
399
  }
400
400
 
401
- .kOR88SFNOn0- {
401
+ .Ey1zL5E-c74- {
402
402
  overflow: auto;
403
403
  }
404
404
 
405
- ._0O-kEf3h9ZI- {
405
+ .ei36u5racbA- {
406
406
  border-bottom: 1px solid hsl(200, 13%, 87%);
407
407
  border-bottom: var(--border-base) solid var(--color-border);
408
408
  }
409
409
 
410
- .rQ9ZS7Rb7Z4- {
410
+ .IDIz9ZHykRw- {
411
411
  border-top: 1px solid hsl(200, 13%, 87%);
412
412
  border-top: var(--border-base) solid var(--color-border);
413
413
  }
414
414
 
415
- .vxk57ZhP8GU- {
415
+ .Wx--khA61eA- {
416
416
  padding: 8px 0 4px 8px;
417
417
  padding: var(--space-small) 0 var(--space-smaller) var(--space-small);
418
418
  cursor: default;
@@ -420,12 +420,12 @@
420
420
 
421
421
  /* Multiple mode: FormFieldWrapper-based container */
422
422
 
423
- .AWoK6-P8fFE- [data-testid="Form-Field-Wrapper"] > div:first-child {
423
+ .COW3V1gDtwI- [data-testid="Form-Field-Wrapper"] > div:first-child {
424
424
  height: auto;
425
425
  min-height: var(--field--height);
426
426
  }
427
427
 
428
- .zJm0oR5x4qY- {
428
+ ._1iRpnGn3PaA- {
429
429
  display: -ms-flexbox;
430
430
  display: flex;
431
431
  -ms-flex-wrap: wrap;
@@ -441,7 +441,7 @@
441
441
  cursor: text;
442
442
  }
443
443
 
444
- .Oa26ZaVEi3g- {
444
+ .bHaScorkEaQ- {
445
445
  min-width: 80px;
446
446
  padding: 0;
447
447
  border: none;
@@ -455,16 +455,16 @@
455
455
  flex: 1 1 auto;
456
456
  }
457
457
 
458
- .Oa26ZaVEi3g-:focus {
458
+ .bHaScorkEaQ-:focus {
459
459
  outline: none;
460
460
  }
461
461
 
462
- .Oa26ZaVEi3g-:disabled {
462
+ .bHaScorkEaQ-:disabled {
463
463
  color: hsl(0, 0%, 58%);
464
464
  color: var(--color-disabled);
465
465
  }
466
466
 
467
- .IarOrfyYExE- {
467
+ .sFMc1SJPOSM- {
468
468
  display: -ms-inline-flexbox;
469
469
  display: inline-flex;
470
470
  padding: 2px 8px;
@@ -486,12 +486,12 @@
486
486
  gap: var(--space-small);
487
487
  }
488
488
 
489
- .pmtAk9HEhF4- {
489
+ ._9Ljs17OW-QM- {
490
490
  background-color: hsl(43, 5%, 72%);
491
491
  background-color: var(--color-interactive--background--hover);
492
492
  }
493
493
 
494
- .nmXqlAV-DJo- {
494
+ .QYUKkbmNjLE- {
495
495
  border: 1px solid hsl(200, 13%, 87%);
496
496
  border: var(--border-base) solid var(--color-border);
497
497
  color: hsl(0, 0%, 58%);
@@ -501,7 +501,7 @@
501
501
  cursor: default;
502
502
  }
503
503
 
504
- .SmrmwoOlZDo- {
504
+ .Wv6D8g2MKPo- {
505
505
  display: -ms-inline-flexbox;
506
506
  display: inline-flex;
507
507
  position: relative;
@@ -518,7 +518,7 @@
518
518
  cursor: pointer;
519
519
  }
520
520
 
521
- .SmrmwoOlZDo-::before {
521
+ .Wv6D8g2MKPo-::before {
522
522
  content: "";
523
523
  position: absolute;
524
524
  top: calc(-1 * 24px);
@@ -532,12 +532,12 @@
532
532
  z-index: -1;
533
533
  }
534
534
 
535
- .SmrmwoOlZDo-:hover::before {
535
+ .Wv6D8g2MKPo-:hover::before {
536
536
  background-color: hsl(43, 5%, 72%);
537
537
  background-color: var(--color-interactive--background--hover);
538
538
  }
539
539
 
540
- .pqwAJ8VczCU- {
540
+ .UAegmMck3-U- {
541
541
  display: -ms-inline-flexbox;
542
542
  display: inline-flex;
543
543
  -ms-flex-align: center;
@@ -2294,130 +2294,6 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
2294
2294
  vertical-align: middle;
2295
2295
  }
2296
2296
 
2297
- ._7mObJiwfPh4- {
2298
- position: relative;
2299
- width: 100%;
2300
- }
2301
-
2302
- .dL5JShAJlKM- {
2303
- visibility: hidden;
2304
- z-index: calc(6 + 1001);
2305
- z-index: calc(var(--elevation-menu) + var(--elevation-modal));
2306
- width: 0;
2307
- height: 0;
2308
- box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1), 0px 4px 12px 0px rgba(0, 0, 0, 0.05);
2309
- box-shadow: var(--shadow-base);
2310
- box-sizing: border-box;
2311
- margin: 0;
2312
- padding: 0;
2313
- border: 1px solid var(--color-color-border);
2314
- border: var(--border-base) solid var(--color-color-border);
2315
- border-radius: 8px;
2316
- border-radius: var(--radius-base);
2317
- overflow: auto;
2318
- background-color: rgba(255, 255, 255, 1);
2319
- background-color: var(--color-surface);
2320
- scroll-behavior: smooth;
2321
- opacity: 0;
2322
- }
2323
-
2324
- .dL5JShAJlKM- .PWZL-94hH7k- {
2325
- padding: 8px 0 4px 8px;
2326
- padding: var(--space-small) 0 var(--space-smaller) var(--space-small);
2327
- border-bottom: 1px solid hsl(200, 13%, 87%);
2328
- border-bottom: var(--border-base) solid var(--color-border);
2329
- }
2330
-
2331
- .dL5JShAJlKM-._2RzcnTdaPyc- {
2332
- visibility: visible;
2333
- width: 100%;
2334
- height: auto;
2335
- opacity: 1;
2336
- }
2337
-
2338
- .dL5JShAJlKM-._2RzcnTdaPyc-:empty {
2339
- visibility: hidden;
2340
- opacity: 0;
2341
- }
2342
-
2343
- .y9zhi8Wr8QA- {
2344
- display: -ms-flexbox;
2345
- display: flex;
2346
- width: 100%;
2347
- -ms-flex-direction: row;
2348
- flex-direction: row;
2349
- -ms-flex-wrap: nowrap;
2350
- flex-wrap: nowrap;
2351
- -ms-flex-pack: start;
2352
- justify-content: flex-start;
2353
- -ms-flex-line-pack: stretch;
2354
- align-content: stretch;
2355
- -ms-flex-align: center;
2356
- align-items: center;
2357
- padding: 8px;
2358
- padding: var(--space-small);
2359
- border: none;
2360
- text-align: left;
2361
- list-style: none;
2362
- background-color: transparent;
2363
- cursor: pointer;
2364
- }
2365
-
2366
- .y9zhi8Wr8QA-:hover,
2367
- .y9zhi8Wr8QA-:focus,
2368
- .y9zhi8Wr8QA-._3Xg49dtL1Q8- {
2369
- background-color: hsl(43, 18%, 92%);
2370
- background-color: var(--color-surface--hover);
2371
- outline-color: hsl(198, 12%, 57%);
2372
- outline-color: var(--color-focus);
2373
- }
2374
-
2375
- .y9zhi8Wr8QA-.LIeh390F3W8-:not(:last-child) {
2376
- border-bottom: 1px solid hsl(200, 13%, 87%);
2377
- border-bottom: var(--border-base) solid var(--color-border);
2378
- }
2379
-
2380
- .dL5JShAJlKM-:hover .y9zhi8Wr8QA-._3Xg49dtL1Q8-:not(:hover) {
2381
- background-color: transparent;
2382
- outline-color: transparent;
2383
- }
2384
-
2385
- .dL5JShAJlKM- .PWZL-94hH7k-:not(:first-child) {
2386
- padding-top: 16px;
2387
- padding-top: var(--space-base);
2388
- }
2389
-
2390
- .y9zhi8Wr8QA- .K2phy6IC3TY- {
2391
- -ms-flex: 0 1 auto;
2392
- flex: 0 1 auto;
2393
- -ms-flex-item-align: auto;
2394
- align-self: auto;
2395
- width: 24px;
2396
- width: var(--space-large);
2397
- }
2398
-
2399
- .y9zhi8Wr8QA- .a6-LbUm5WnY- {
2400
- display: -ms-inline-flexbox;
2401
- display: inline-flex;
2402
- -ms-flex: 1 100%;
2403
- flex: 1 100%;
2404
- -ms-flex-wrap: wrap;
2405
- flex-wrap: wrap;
2406
- }
2407
-
2408
- .y9zhi8Wr8QA- .tQNbuxcE9nU- {
2409
- -ms-flex: 2;
2410
- flex: 2;
2411
- }
2412
-
2413
- .y9zhi8Wr8QA- .qacStG9-XbE- {
2414
- -ms-flex: 1;
2415
- flex: 1;
2416
- -ms-flex-item-align: end;
2417
- align-self: flex-end;
2418
- text-align: right;
2419
- }
2420
-
2421
2297
  :root {
2422
2298
  --public--avatar-size: 32px;
2423
2299
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "8.4.0",
3
+ "version": "8.6.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -568,5 +568,5 @@
568
568
  "> 1%",
569
569
  "IE 10"
570
570
  ],
571
- "gitHead": "7b859533f0b0482ad30654fb0fde5d41c2d918ba"
571
+ "gitHead": "3f1dd8cc5b57561326b2dad6431310db346554a5"
572
572
  }
@@ -1,8 +0,0 @@
1
- import type { Ref } from "react";
2
- import React from "react";
3
- import type { AutocompleteRebuiltProps, OptionLike } from "./Autocomplete.types";
4
- export declare const AutocompleteRebuilt: <Value extends OptionLike = OptionLike, Multiple extends boolean = false>(props: AutocompleteRebuiltProps<Value, Multiple> & {
5
- ref?: Ref<HTMLInputElement | HTMLTextAreaElement>;
6
- }) => ReturnType<typeof AutocompleteRebuiltInternal>;
7
- declare function AutocompleteRebuiltInternal<Value extends OptionLike, Multiple extends boolean = false>(props: AutocompleteRebuiltProps<Value, Multiple>, forwardedRef: Ref<HTMLInputElement | HTMLTextAreaElement>): React.JSX.Element;
8
- export {};
@@ -1,8 +0,0 @@
1
- import { type AnyOption, type GroupOption, type Option } from "./Autocomplete.types";
2
- export declare function isOptionSelected(selectedOption: Option | undefined, option: Option): boolean;
3
- /**
4
- * Helper function to determine if the option is a group. This is used to
5
- * determine if the option contains a list of options for rendering Section
6
- * Labels in the Autocomplete component.
7
- */
8
- export declare function isOptionGroup<T extends AnyOption>(option: T): option is Extract<T, GroupOption>;
@@ -1,16 +0,0 @@
1
- import React from "react";
2
- import { type AnyOption, type Option } from "../Autocomplete.types";
3
- export interface DefaultMenuProps {
4
- readonly options: AnyOption[];
5
- readonly selectedOption?: Option;
6
- /**
7
- * Element that it's attached to when the menu opens.
8
- */
9
- readonly attachTo: HTMLDivElement | null;
10
- onOptionSelect(chosenOption?: Option): void;
11
- readonly visible: boolean;
12
- }
13
- /**
14
- * Renders the default Menu for the Autocomplete component.
15
- */
16
- export declare function DefaultMenu({ options, selectedOption, onOptionSelect, attachTo, visible, }: DefaultMenuProps): React.JSX.Element;
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- import { type AnyOption, type MenuProps, type Option } from "../Autocomplete.types";
3
- export declare function Menu<GenericOption extends AnyOption = AnyOption, GenericOptionValue extends Option = Option>({ options, selectedOption, onOptionSelect, inputFocused, attachTo, inputRef, customRenderMenu, }: MenuProps<GenericOption, GenericOptionValue>): React.JSX.Element | null;
@@ -1,23 +0,0 @@
1
- import type { PropsWithChildren } from "react";
2
- import React from "react";
3
- import type { UseRepositionMenu } from "../useRepositionMenu";
4
- export interface BaseAutocompleteMenuWrapperInternalProps {
5
- readonly setMenuRef: UseRepositionMenu["setMenuRef"];
6
- readonly floatStyles: UseRepositionMenu["styles"];
7
- readonly targetWidth: UseRepositionMenu["targetWidth"];
8
- readonly visible?: boolean;
9
- }
10
- /**
11
- * Provides a wrapper for the Autocomplete menu that handles positioning and visibility.
12
- * @param attachTo - The element that the menu should be attached to.
13
- */
14
- export declare function useAutocompleteMenu({ attachTo, }: {
15
- attachTo: HTMLDivElement | null;
16
- }): {
17
- MenuWrapper: ({ children, visible, }: {
18
- children?: React.ReactNode;
19
- visible: boolean;
20
- }) => React.ReactElement;
21
- menuRef: HTMLElement | null;
22
- };
23
- export declare function BaseAutocompleteMenuWrapper(props: PropsWithChildren<BaseAutocompleteMenuWrapperInternalProps>): React.JSX.Element;
@@ -1,78 +0,0 @@
1
- import type { PropsWithChildren } from "react";
2
- import React from "react";
3
- import { type AnyOption, type Option } from "./Autocomplete.types";
4
- export interface MenuOptionProps {
5
- readonly isHighlighted: boolean;
6
- readonly option: AnyOption;
7
- readonly onOptionSelect: (option?: AnyOption) => void;
8
- /**
9
- * Whether to add separators between the options.
10
- */
11
- readonly addSeparators: boolean;
12
- readonly isSelected: boolean;
13
- readonly UNSAFE_className?: {
14
- option?: BaseMenuOptionProps["UNSAFE_className"];
15
- content?: MenuOptionContentProps["UNSAFE_className"];
16
- groupOption?: MenuGroupOptionProps["UNSAFE_className"];
17
- };
18
- readonly UNSAFE_style?: {
19
- option?: BaseMenuOptionProps["UNSAFE_style"];
20
- content?: MenuOptionContentProps["UNSAFE_style"];
21
- groupOption?: MenuGroupOptionProps["UNSAFE_style"];
22
- };
23
- }
24
- /**
25
- * The rendering of the default MenuOption
26
- */
27
- export declare function MenuOption({ isHighlighted, option, onOptionSelect, isSelected, addSeparators, UNSAFE_className, UNSAFE_style, }: MenuOptionProps): React.JSX.Element;
28
- interface MenuOptionContentProps {
29
- readonly UNSAFE_className?: {
30
- readonly icon?: string;
31
- readonly text?: string;
32
- readonly details?: string;
33
- readonly label?: string;
34
- };
35
- readonly UNSAFE_style?: {
36
- readonly icon?: React.CSSProperties;
37
- readonly text?: React.CSSProperties;
38
- readonly label?: React.CSSProperties;
39
- readonly details?: React.CSSProperties;
40
- };
41
- readonly option: Option;
42
- readonly isSelected: boolean;
43
- }
44
- export declare function MenuOptionContent({ option, isSelected, UNSAFE_className, UNSAFE_style, }: MenuOptionContentProps): React.JSX.Element;
45
- export interface MenuGroupOptionProps {
46
- readonly option: AnyOption;
47
- readonly UNSAFE_className?: {
48
- heading?: string;
49
- };
50
- readonly UNSAFE_style?: {
51
- heading?: React.CSSProperties;
52
- };
53
- }
54
- /**
55
- * The rendering of the default MenuGroupOption
56
- */
57
- export declare function MenuGroupOptions({ option, UNSAFE_className, UNSAFE_style, }: MenuGroupOptionProps): React.JSX.Element;
58
- /**
59
- * The base component for the MenuGroupOption
60
- */
61
- export interface BaseMenuGroupOptionProps extends PropsWithChildren {
62
- readonly UNSAFE_className?: string;
63
- readonly UNSAFE_style?: React.CSSProperties;
64
- }
65
- export declare function BaseMenuGroupOption({ children, UNSAFE_className, UNSAFE_style, }: BaseMenuGroupOptionProps): React.JSX.Element;
66
- export interface BaseMenuOptionProps<GenericOption extends AnyOption = AnyOption> extends PropsWithChildren {
67
- readonly option?: GenericOption;
68
- readonly onOptionSelect?: (option?: GenericOption) => void;
69
- readonly isHighlighted: boolean;
70
- readonly addSeparators: boolean;
71
- readonly UNSAFE_className?: string;
72
- readonly UNSAFE_style?: React.CSSProperties;
73
- }
74
- /**
75
- * Renders the base option component. The component takes children and renders them inside a button.
76
- */
77
- export declare function BaseMenuOption<GenericOption extends AnyOption = AnyOption>({ option, isHighlighted, onOptionSelect, addSeparators, children, UNSAFE_className, UNSAFE_style, }: BaseMenuOptionProps<GenericOption>): React.JSX.Element;
78
- export {};
@@ -1,4 +0,0 @@
1
- import type React from "react";
2
- import type { AnyOption, AutocompleteLegacyProps, Option } from "@jobber/components/Autocomplete";
3
- export type V1DocgenProps = AutocompleteLegacyProps<AnyOption, Option, AnyOption>;
4
- export declare const AutocompleteV1Docgen: React.FC<V1DocgenProps>;
@@ -1,6 +0,0 @@
1
- import type React from "react";
2
- import type { AutocompleteRebuiltProps, OptionLike } from "@jobber/components/Autocomplete";
3
- type ExtraProps = Record<string, unknown>;
4
- export type V2DocgenProps = AutocompleteRebuiltProps<OptionLike, boolean, ExtraProps, ExtraProps>;
5
- export declare const AutocompleteV2Docgen: React.FC<V2DocgenProps>;
6
- export {};
@@ -1,35 +0,0 @@
1
- import { type AnyOption, type Option } from "./Autocomplete.types";
2
- export declare enum KeyboardAction {
3
- Previous = -1,
4
- Next = 1,
5
- Select = 0
6
- }
7
- /**
8
- * Hook to handle custom keyboard navigation for the Autocomplete component.
9
- * Use this hook if you are using components in the menu that aren't MenuOption or BaseMenuOption.
10
- */
11
- export declare function useCustomKeyboardNavigation({ onRequestHighlightChange, }: {
12
- onRequestHighlightChange?: (event: KeyboardEvent, direction: KeyboardAction) => void;
13
- }): void;
14
- /**
15
- * Hook to handle keyboard navigation for the Menu in the Autocomplete component.
16
- * If using components in the menu that aren't MenuOption or BaseMenuOption, you should use the `useCustomKeyboardNavigation` hook.
17
- */
18
- export declare function useKeyboardNavigation<GenericOption extends AnyOption = AnyOption, GenericOptionValue extends Option = Option>({ options, onOptionSelect, menuRef, visible, }: {
19
- options: GenericOption[];
20
- visible?: boolean;
21
- menuRef?: HTMLElement | null;
22
- onOptionSelect: (option?: GenericOptionValue) => void;
23
- }): {
24
- highlightedIndex: number;
25
- };
26
- /**
27
- * Function to get the requested index change based on the current highlighted index and the direction of the keyboard action.
28
- * Accounts for groups in the options array.
29
- */
30
- export declare function getRequestedIndexChange<T extends AnyOption>({ event, options, direction, highlightedIndex, }: {
31
- event: KeyboardEvent;
32
- direction: KeyboardAction;
33
- options: T[];
34
- highlightedIndex: number;
35
- }): number;
@@ -1,10 +0,0 @@
1
- import type { MenuProps } from "./Autocomplete.types";
2
- export interface UseRepositionMenu {
3
- readonly menuRef: HTMLElement | null;
4
- readonly setMenuRef: (ref: HTMLElement | null) => void;
5
- readonly targetWidth: number | undefined;
6
- readonly styles: {
7
- float: React.CSSProperties;
8
- };
9
- }
10
- export declare function useRepositionMenu(attachTo: MenuProps["attachTo"], visible: boolean, cssManagedVisibility: boolean): UseRepositionMenu;