@webority/mobile-ui 0.130.0 → 0.130.2

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 (35) hide show
  1. package/canvas-kit.json +2 -1
  2. package/dist/canvas-kit/kit.js +4443 -3958
  3. package/dist/canvas-kit/manifest.json +585 -3
  4. package/dist/canvas-kit/release.json +6 -6
  5. package/lib/commonjs/components/AppBar/AppBar.js +1 -1
  6. package/lib/commonjs/components/AuthedImage/authedImageCache.js +1 -1
  7. package/lib/commonjs/components/ListSection/ListSection.js +1 -1
  8. package/lib/commonjs/components/OnboardingPager/OnboardingPager.js +1 -1
  9. package/lib/commonjs/components/Screen/Screen.js +1 -1
  10. package/lib/commonjs/index.js +1 -1
  11. package/lib/commonjs/utils/index.js +1 -1
  12. package/lib/module/components/AppBar/AppBar.js +1 -1
  13. package/lib/module/components/AuthedImage/authedImageCache.js +1 -1
  14. package/lib/module/components/ListSection/ListSection.js +1 -1
  15. package/lib/module/components/OnboardingPager/OnboardingPager.js +1 -1
  16. package/lib/module/components/Screen/Screen.js +1 -1
  17. package/lib/module/index.js +1 -1
  18. package/lib/module/utils/index.js +1 -1
  19. package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +4 -1
  20. package/lib/typescript/commonjs/components/AuthedImage/authedImageCache.d.ts +4 -1
  21. package/lib/typescript/commonjs/components/Autocomplete/Autocomplete.d.ts +1 -1
  22. package/lib/typescript/commonjs/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  23. package/lib/typescript/commonjs/components/OnboardingPager/OnboardingPager.d.ts +4 -1
  24. package/lib/typescript/commonjs/components/Screen/Screen.d.ts +3 -1
  25. package/lib/typescript/commonjs/index.d.ts +3 -3
  26. package/lib/typescript/commonjs/utils/index.d.ts +1 -1
  27. package/lib/typescript/module/components/AppBar/AppBar.d.ts +4 -1
  28. package/lib/typescript/module/components/AuthedImage/authedImageCache.d.ts +4 -1
  29. package/lib/typescript/module/components/Autocomplete/Autocomplete.d.ts +1 -1
  30. package/lib/typescript/module/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  31. package/lib/typescript/module/components/OnboardingPager/OnboardingPager.d.ts +4 -1
  32. package/lib/typescript/module/components/Screen/Screen.d.ts +3 -1
  33. package/lib/typescript/module/index.d.ts +3 -3
  34. package/lib/typescript/module/utils/index.d.ts +1 -1
  35. package/package.json +8 -9
@@ -2,7 +2,7 @@
2
2
  "kind": "WeborityPhone",
3
3
  "library": {
4
4
  "name": "@webority/mobile-ui",
5
- "version": "0.130.0"
5
+ "version": "0.130.2"
6
6
  },
7
7
  "rendererProtocolVersion": 13,
8
8
  "platform": "Phone",
@@ -564,7 +564,7 @@
564
564
  "name": "leading",
565
565
  "type": "node",
566
566
  "required": false,
567
- "description": "Any element in the left slot, after the left action."
567
+ "description": "Any element in the left slot, after the left action. On a tab screen with a large title, keep it icon-sized so it does not squeeze the title."
568
568
  },
569
569
  {
570
570
  "name": "leftAction",
@@ -13474,7 +13474,7 @@
13474
13474
  "name": "floatingAction",
13475
13475
  "type": "node",
13476
13476
  "required": false,
13477
- "description": "A floating action button. The page lifts it above the tab bar and footer and keeps room under the content for it."
13477
+ "description": "A floating action button. The page lifts it above the tab bar and footer, floats it bottom right unless its own position is set, and keeps room under the content for it."
13478
13478
  },
13479
13479
  {
13480
13480
  "name": "footer",
@@ -22220,5 +22220,587 @@
22220
22220
  "zoom",
22221
22221
  "zoom-in",
22222
22222
  "zoom-out"
22223
+ ],
22224
+ "renames": [
22225
+ {
22226
+ "version": "0.87.1",
22227
+ "components": [],
22228
+ "values": {}
22229
+ },
22230
+ {
22231
+ "version": "0.89.0",
22232
+ "components": [],
22233
+ "values": {
22234
+ "tone": {
22235
+ "error": "danger"
22236
+ },
22237
+ "variant": {
22238
+ "error": "danger"
22239
+ }
22240
+ }
22241
+ },
22242
+ {
22243
+ "version": "0.91.0",
22244
+ "components": [],
22245
+ "values": {
22246
+ "tone": {
22247
+ "error": "danger"
22248
+ },
22249
+ "variant": {
22250
+ "error": "danger"
22251
+ },
22252
+ "iconTone": {
22253
+ "error": "danger"
22254
+ },
22255
+ "avatarTone": {
22256
+ "error": "danger"
22257
+ },
22258
+ "elevation": {
22259
+ "xs": "card",
22260
+ "sm": "card",
22261
+ "md": "elevated",
22262
+ "lg": "popover",
22263
+ "xl": "modal",
22264
+ "2xl": "modal"
22265
+ }
22266
+ }
22267
+ },
22268
+ {
22269
+ "version": "0.93.0",
22270
+ "components": [],
22271
+ "values": {}
22272
+ },
22273
+ {
22274
+ "version": "0.97.0",
22275
+ "components": [],
22276
+ "values": {}
22277
+ },
22278
+ {
22279
+ "version": "0.107.0",
22280
+ "components": [
22281
+ {
22282
+ "name": "Banner",
22283
+ "props": {
22284
+ "variant": "tone"
22285
+ },
22286
+ "values": {
22287
+ "tone": {
22288
+ "default": "neutral"
22289
+ }
22290
+ },
22291
+ "added": {},
22292
+ "removed": {}
22293
+ },
22294
+ {
22295
+ "name": "Toast",
22296
+ "props": {},
22297
+ "values": {},
22298
+ "added": {},
22299
+ "removed": {
22300
+ "undoLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22301
+ }
22302
+ },
22303
+ {
22304
+ "name": "DatePicker",
22305
+ "props": {},
22306
+ "values": {},
22307
+ "added": {},
22308
+ "removed": {
22309
+ "mode": "mode is gone: pass the boolean inline prop for mode 'inline', and drop mode for 'modal'",
22310
+ "confirmLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type",
22311
+ "cancelLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22312
+ }
22313
+ },
22314
+ {
22315
+ "name": "DateRangePicker",
22316
+ "props": {},
22317
+ "values": {},
22318
+ "added": {},
22319
+ "removed": {
22320
+ "confirmLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type",
22321
+ "cancelLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22322
+ }
22323
+ },
22324
+ {
22325
+ "name": "OptionSheet",
22326
+ "props": {},
22327
+ "values": {},
22328
+ "added": {},
22329
+ "removed": {
22330
+ "emptyText": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22331
+ }
22332
+ },
22333
+ {
22334
+ "name": "TimePicker",
22335
+ "props": {},
22336
+ "values": {},
22337
+ "added": {},
22338
+ "removed": {
22339
+ "confirmLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type",
22340
+ "cancelLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type",
22341
+ "title": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22342
+ }
22343
+ },
22344
+ {
22345
+ "name": "Chip",
22346
+ "props": {},
22347
+ "values": {
22348
+ "variant": {
22349
+ "filled": "solid",
22350
+ "outlined": "outline"
22351
+ }
22352
+ },
22353
+ "added": {},
22354
+ "removed": {}
22355
+ },
22356
+ {
22357
+ "name": "Menu",
22358
+ "props": {},
22359
+ "values": {},
22360
+ "added": {},
22361
+ "removed": {
22362
+ "closeLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type",
22363
+ "backLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22364
+ }
22365
+ },
22366
+ {
22367
+ "name": "Select",
22368
+ "props": {
22369
+ "errorText": "error"
22370
+ },
22371
+ "values": {
22372
+ "variant": {
22373
+ "outlined": "outline"
22374
+ }
22375
+ },
22376
+ "added": {},
22377
+ "removed": {}
22378
+ },
22379
+ {
22380
+ "name": "FloatingActionButtonGroup",
22381
+ "props": {
22382
+ "open": "expanded"
22383
+ },
22384
+ "values": {},
22385
+ "added": {},
22386
+ "removed": {}
22387
+ },
22388
+ {
22389
+ "name": "Button",
22390
+ "props": {
22391
+ "title": "label",
22392
+ "children": "label"
22393
+ },
22394
+ "values": {},
22395
+ "added": {},
22396
+ "removed": {}
22397
+ },
22398
+ {
22399
+ "name": "StatusBadge",
22400
+ "props": {
22401
+ "text": "label"
22402
+ },
22403
+ "values": {},
22404
+ "added": {},
22405
+ "removed": {}
22406
+ },
22407
+ {
22408
+ "name": "ScannerOverlay",
22409
+ "props": {
22410
+ "hint": "helperText"
22411
+ },
22412
+ "values": {},
22413
+ "added": {},
22414
+ "removed": {}
22415
+ },
22416
+ {
22417
+ "name": "FilePicker",
22418
+ "props": {
22419
+ "errorText": "error"
22420
+ },
22421
+ "values": {},
22422
+ "added": {},
22423
+ "removed": {}
22424
+ },
22425
+ {
22426
+ "name": "Dialog",
22427
+ "props": {
22428
+ "variant": "tone"
22429
+ },
22430
+ "values": {
22431
+ "tone": {
22432
+ "default": "neutral"
22433
+ }
22434
+ },
22435
+ "added": {},
22436
+ "removed": {}
22437
+ },
22438
+ {
22439
+ "name": "Composer",
22440
+ "props": {
22441
+ "busy": "loading"
22442
+ },
22443
+ "values": {},
22444
+ "added": {},
22445
+ "removed": {
22446
+ "sendLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22447
+ }
22448
+ },
22449
+ {
22450
+ "name": "Card",
22451
+ "props": {},
22452
+ "values": {
22453
+ "variant": {
22454
+ "outlined": "outline"
22455
+ }
22456
+ },
22457
+ "added": {},
22458
+ "removed": {
22459
+ "removeLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22460
+ }
22461
+ },
22462
+ {
22463
+ "name": "Input",
22464
+ "props": {},
22465
+ "values": {
22466
+ "variant": {
22467
+ "outlined": "outline"
22468
+ }
22469
+ },
22470
+ "added": {},
22471
+ "removed": {}
22472
+ },
22473
+ {
22474
+ "name": "SearchBar",
22475
+ "props": {},
22476
+ "values": {
22477
+ "variant": {
22478
+ "outlined": "outline"
22479
+ }
22480
+ },
22481
+ "added": {},
22482
+ "removed": {}
22483
+ },
22484
+ {
22485
+ "name": "PickerTrigger",
22486
+ "props": {},
22487
+ "values": {
22488
+ "variant": {
22489
+ "outlined": "outline"
22490
+ }
22491
+ },
22492
+ "added": {},
22493
+ "removed": {}
22494
+ },
22495
+ {
22496
+ "name": "Calendar",
22497
+ "props": {
22498
+ "mode": "selectionMode"
22499
+ },
22500
+ "values": {},
22501
+ "added": {},
22502
+ "removed": {}
22503
+ },
22504
+ {
22505
+ "name": "BottomSheet",
22506
+ "props": {},
22507
+ "values": {},
22508
+ "added": {},
22509
+ "removed": {
22510
+ "mode": "mode is gone: pass the boolean inline prop for mode 'inline', and drop mode for 'modal'"
22511
+ }
22512
+ },
22513
+ {
22514
+ "name": "AsyncBlock",
22515
+ "props": {},
22516
+ "values": {},
22517
+ "added": {},
22518
+ "removed": {
22519
+ "retryLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22520
+ }
22521
+ },
22522
+ {
22523
+ "name": "ForceUpdateDialog",
22524
+ "props": {},
22525
+ "values": {},
22526
+ "added": {},
22527
+ "removed": {
22528
+ "updateLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type",
22529
+ "laterLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22530
+ }
22531
+ },
22532
+ {
22533
+ "name": "OnboardingPager",
22534
+ "props": {},
22535
+ "values": {},
22536
+ "added": {},
22537
+ "removed": {
22538
+ "doneLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22539
+ }
22540
+ },
22541
+ {
22542
+ "name": "KeyboardToolbar",
22543
+ "props": {},
22544
+ "values": {},
22545
+ "added": {},
22546
+ "removed": {
22547
+ "doneLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22548
+ }
22549
+ },
22550
+ {
22551
+ "name": "Tooltip",
22552
+ "props": {},
22553
+ "values": {},
22554
+ "added": {},
22555
+ "removed": {
22556
+ "closeLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type",
22557
+ "backLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22558
+ }
22559
+ },
22560
+ {
22561
+ "name": "Autocomplete",
22562
+ "props": {},
22563
+ "values": {},
22564
+ "added": {},
22565
+ "removed": {
22566
+ "emptyText": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22567
+ }
22568
+ },
22569
+ {
22570
+ "name": "Repeater",
22571
+ "props": {},
22572
+ "values": {},
22573
+ "added": {},
22574
+ "removed": {
22575
+ "emptyText": "moved into the labels prop: pass labels with this text under the key of the component's Labels type",
22576
+ "addLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type",
22577
+ "rowLabel": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22578
+ }
22579
+ },
22580
+ {
22581
+ "name": "PhoneNumberInput",
22582
+ "props": {},
22583
+ "values": {},
22584
+ "added": {},
22585
+ "removed": {
22586
+ "allCountriesTitle": "moved into the labels prop: pass labels with this text under the key of the component's Labels type",
22587
+ "countrySheetTitle": "moved into the labels prop: pass labels with this text under the key of the component's Labels type"
22588
+ }
22589
+ }
22590
+ ],
22591
+ "values": {}
22592
+ },
22593
+ {
22594
+ "version": "0.108.0",
22595
+ "components": [],
22596
+ "values": {}
22597
+ },
22598
+ {
22599
+ "version": "0.130.0",
22600
+ "components": [
22601
+ {
22602
+ "name": "Banner",
22603
+ "props": {
22604
+ "visible": "open"
22605
+ },
22606
+ "values": {},
22607
+ "added": {},
22608
+ "removed": {}
22609
+ },
22610
+ {
22611
+ "name": "BottomSheet",
22612
+ "props": {
22613
+ "visible": "open"
22614
+ },
22615
+ "values": {},
22616
+ "added": {},
22617
+ "removed": {}
22618
+ },
22619
+ {
22620
+ "name": "DatePicker",
22621
+ "props": {
22622
+ "visible": "open"
22623
+ },
22624
+ "values": {},
22625
+ "added": {},
22626
+ "removed": {}
22627
+ },
22628
+ {
22629
+ "name": "DateRangePicker",
22630
+ "props": {
22631
+ "visible": "open"
22632
+ },
22633
+ "values": {},
22634
+ "added": {},
22635
+ "removed": {}
22636
+ },
22637
+ {
22638
+ "name": "Dialog",
22639
+ "props": {
22640
+ "visible": "open"
22641
+ },
22642
+ "values": {},
22643
+ "added": {},
22644
+ "removed": {}
22645
+ },
22646
+ {
22647
+ "name": "Drawer",
22648
+ "props": {
22649
+ "visible": "open",
22650
+ "defaultVisible": "defaultOpen"
22651
+ },
22652
+ "values": {},
22653
+ "added": {},
22654
+ "removed": {}
22655
+ },
22656
+ {
22657
+ "name": "ForceUpdateDialog",
22658
+ "props": {
22659
+ "visible": "open"
22660
+ },
22661
+ "values": {},
22662
+ "added": {},
22663
+ "removed": {}
22664
+ },
22665
+ {
22666
+ "name": "Menu",
22667
+ "props": {
22668
+ "visible": "open"
22669
+ },
22670
+ "values": {},
22671
+ "added": {},
22672
+ "removed": {}
22673
+ },
22674
+ {
22675
+ "name": "Modal",
22676
+ "props": {
22677
+ "visible": "open"
22678
+ },
22679
+ "values": {},
22680
+ "added": {},
22681
+ "removed": {}
22682
+ },
22683
+ {
22684
+ "name": "OptionSheet",
22685
+ "props": {
22686
+ "visible": "open"
22687
+ },
22688
+ "values": {},
22689
+ "added": {},
22690
+ "removed": {}
22691
+ },
22692
+ {
22693
+ "name": "TimePicker",
22694
+ "props": {
22695
+ "visible": "open"
22696
+ },
22697
+ "values": {},
22698
+ "added": {},
22699
+ "removed": {}
22700
+ },
22701
+ {
22702
+ "name": "Tour",
22703
+ "props": {
22704
+ "visible": "open"
22705
+ },
22706
+ "values": {},
22707
+ "added": {},
22708
+ "removed": {}
22709
+ },
22710
+ {
22711
+ "name": "Tooltip",
22712
+ "props": {
22713
+ "visible": "open"
22714
+ },
22715
+ "values": {},
22716
+ "added": {},
22717
+ "removed": {}
22718
+ },
22719
+ {
22720
+ "name": "Select",
22721
+ "props": {
22722
+ "borderRadius": "radius"
22723
+ },
22724
+ "values": {},
22725
+ "added": {},
22726
+ "removed": {}
22727
+ },
22728
+ {
22729
+ "name": "ListItem",
22730
+ "props": {
22731
+ "left": "leading",
22732
+ "right": "trailing"
22733
+ },
22734
+ "values": {},
22735
+ "added": {},
22736
+ "removed": {}
22737
+ },
22738
+ {
22739
+ "name": "PickerTrigger",
22740
+ "props": {
22741
+ "leadingIcon": "leftIcon"
22742
+ },
22743
+ "values": {},
22744
+ "added": {},
22745
+ "removed": {}
22746
+ },
22747
+ {
22748
+ "name": "SliderField",
22749
+ "props": {
22750
+ "startIcon": "leftIcon",
22751
+ "endIcon": "rightIcon"
22752
+ },
22753
+ "values": {},
22754
+ "added": {},
22755
+ "removed": {}
22756
+ },
22757
+ {
22758
+ "name": "Card",
22759
+ "props": {
22760
+ "borderRadius": "radius"
22761
+ },
22762
+ "values": {},
22763
+ "added": {},
22764
+ "removed": {}
22765
+ },
22766
+ {
22767
+ "name": "Input",
22768
+ "props": {
22769
+ "borderRadius": "radius"
22770
+ },
22771
+ "values": {},
22772
+ "added": {},
22773
+ "removed": {}
22774
+ },
22775
+ {
22776
+ "name": "PhoneNumberInput",
22777
+ "props": {
22778
+ "borderRadius": "radius"
22779
+ },
22780
+ "values": {},
22781
+ "added": {},
22782
+ "removed": {}
22783
+ },
22784
+ {
22785
+ "name": "SearchBar",
22786
+ "props": {
22787
+ "borderRadius": "radius"
22788
+ },
22789
+ "values": {},
22790
+ "added": {},
22791
+ "removed": {}
22792
+ },
22793
+ {
22794
+ "name": "SquircleImage",
22795
+ "props": {
22796
+ "borderRadius": "radius"
22797
+ },
22798
+ "values": {},
22799
+ "added": {},
22800
+ "removed": {}
22801
+ }
22802
+ ],
22803
+ "values": {}
22804
+ }
22223
22805
  ]
22224
22806
  }
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "webority-phone",
3
- "version": "0.130.0",
3
+ "version": "0.130.2",
4
4
  "platform": "Phone",
5
5
  "kitModuleVersion": 2,
6
6
  "rendererProtocolVersion": 13,
7
7
  "library": {
8
8
  "name": "@webority/mobile-ui",
9
- "version": "0.130.0"
9
+ "version": "0.130.2"
10
10
  },
11
11
  "files": {
12
12
  "manifest.json": {
13
- "sha256": "235642c0448ed31b39b60eefbe1d5674bb1b00aff9f07805af1311c71be6ce16",
14
- "bytes": 646085
13
+ "sha256": "f5f7f30a2587563654a12e55f28269be6bb401476b1f8cb1d62fd7707e8147a9",
14
+ "bytes": 661101
15
15
  },
16
16
  "kit.js": {
17
- "sha256": "c27059e1af6342d59084e6aa0959e8c49320e3284eb2db5dafb7d92841880504",
18
- "bytes": 6088895
17
+ "sha256": "67b718b2bff1a8b67a815c72e9aa2470660b8a651ed6bb4ed664e11158fe69e1",
18
+ "bytes": 6100972
19
19
  },
20
20
  "kit.css": {
21
21
  "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.DEFAULT_APP_BAR_LABELS=exports.AppBar=void 0;var _react=require("react"),_reactNative=require("react-native"),_reactNativeSafeAreaContext=require("react-native-safe-area-context"),_usePressAnimation=require("../../hooks/usePressAnimation.js"),_index=require("../../theme/index.js"),_corners=require("../../utils/corners.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_warnInvalidValue=require("../../utils/warnInvalidValue.js"),_AppIcon=require("../AppIcon/AppIcon.js"),_index2=require("../Menu/index.js"),_Text=require("../Text/Text.js"),_jsxRuntime=require("react/jsx-runtime");const ACTION_BUTTON_SIZE=44,DOT_OFFSET=10,DOT_SIZE=8,BADGE_OFFSET=4,DEFAULT_APP_BAR_LABELS=exports.DEFAULT_APP_BAR_LABELS=Object.freeze({back:"Back"}),variantSize=(e,t)=>{switch(t){case"compact":return{height:44,titleSize:e.text.lg.size,titleWeight:"semibold",alignBottom:!1,subtitleLines:1};case"large":return{height:96,titleSize:e.text["2xl"].size,titleWeight:"bold",alignBottom:!0,subtitleLines:2};default:return{height:56,titleSize:e.text.lg.size,titleWeight:"semibold",alignBottom:!1,subtitleLines:1}}},ActionButton=(0,_react.forwardRef)(({action:e,side:t,badgeStyle:i,haptic:n,flush:a,onPress:r},l)=>{const s=(0,_index.useTheme)(),{style:o,pressIn:c,pressOut:d}=(0,_usePressAnimation.usePressAnimation)({enabled:!0}),u=(0,_react.useMemo)(()=>buildActionStyles(s),[s]),p=e.badge,m=void 0!==p&&0!==p,x=void 0!==e.label;return(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:o,children:(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{ref:l,onPress:t=>{const i=(0,_hapticUtils.resolveHaptic)(n,"selection");i&&(0,_hapticUtils.triggerHaptic)(i),"onPress"in e&&e.onPress(),r?.(t)},onPressIn:c,onPressOut:d,accessibilityRole:"button",accessibilityLabel:e.accessibilityLabel??e.label,testID:e.testID,android_ripple:{color:s.colors["surface-pressed"],borderless:!x},style:({pressed:e})=>[x?u.textButton:u.actionButton,a?null:"left"===t?u.actionLeft:u.actionRight,e&&!x?u.actionPressed:null,e&&x?u.textPressed:null],children:[x?(0,_jsxRuntime.jsx)(_Text.Text,{variant:"body",weight:"semibold",color:"link",numberOfLines:1,children:e.label}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:u.iconWrap,children:e.icon}),m?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[u.badge,i],pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_Text.Text,{variant:"caption",weight:"semibold",numberOfLines:1,style:u.badgeText,children:String(p)})}):null,e.dot?(0,_jsxRuntime.jsx)(_reactNative.View,{testID:e.testID?`${e.testID}-dot`:"appbar-action-dot",style:u.dot,pointerEvents:"none"}):null]})})}),COLLAPSE_RANGE=60,LARGE_TITLE_SCALE_END=.71,AppBar=exports.AppBar=(0,_react.forwardRef)((e,t)=>{const{title:i,subtitle:n,titleAlignment:a="left",leftAction:r,rightActions:l,leading:s,trailing:o,onBack:c,gutter:d,titleVariant:u,titleOffset:p,height:m,divider:x,variant:g="default",transparent:h=!1,scrollY:_,style:b,containerStyle:f,titleStyle:j,subtitleStyle:A,badgeStyle:v,haptic:y,labels:R,testID:S}=e;(0,_warnInvalidValue.warnInvalidValue)("AppBar","variant",e.variant,["default","large","compact"]),(0,_warnInvalidValue.warnInvalidValue)("AppBar","titleAlignment",e.titleAlignment,["left","center"]);const B=(0,_react.useMemo)(()=>({...DEFAULT_APP_BAR_LABELS,...R}),[R]),w=(0,_index.useTheme)(),I=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),L=(0,_react.useMemo)(()=>variantSize(w,g),[w,g]),N=(0,_react.useMemo)(()=>buildStyles(w),[w]),T="large"===g&&void 0!==_,C=r??(c?{icon:(0,_jsxRuntime.jsx)(_AppIcon.AppIcon,{name:"arrow-left",size:24,color:w.colors["text-body"]}),onPress:c,accessibilityLabel:B.back}:void 0),P=o?void 0:l?.[l.length-1],opticalInset=e=>void 0===e?0:void 0!==e.label?w.space.sm:Math.max((44-(e.glyphSize??24))/2,0),V=void 0===d?null:{paddingLeft:Math.max(d-opticalInset(C),0),paddingRight:Math.max(d-opticalInset(P),0)},E=void 0!==p,z=Boolean(C)||Boolean(s),O=x??!h,D=_reactNative.StyleSheet.hairlineWidth,W=(0,_react.useMemo)(()=>{if(!_)return null;const e={inputRange:[0,60],extrapolate:"clamp"};return{titleScale:_.interpolate({...e,outputRange:[1,.71]}),titleTranslateY:_.interpolate({...e,outputRange:[0,-20]}),titleTranslateX:_.interpolate({...e,outputRange:"center"===a?[0,0]:[0,8]}),subtitleOpacity:_.interpolate({inputRange:[0,30],outputRange:[1,0],extrapolate:"clamp"}),barHeight:_.interpolate({...e,outputRange:[96,56]}),borderOpacity:_.interpolate({...e,outputRange:[0,1]})}},[_,a]),q=T&&W?{transform:[{translateX:W.titleTranslateX},{translateY:W.titleTranslateY},{scale:W.titleScale}]}:null,k=i?u?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:q,children:(0,_jsxRuntime.jsx)(_Text.Text,{variant:u,align:"center"===a?"center":"left",accessibilityRole:"header",numberOfLines:1,style:[N.titleVariant,j],children:i})}):(0,_jsxRuntime.jsx)(_reactNative.Animated.Text,{accessibilityRole:"header",style:[N.title,{fontSize:L.titleSize,fontWeight:w.weight[L.titleWeight],textAlign:"center"===a?"center":"left"},q,j],numberOfLines:1,children:i}):null,M=n?(0,_jsxRuntime.jsx)(_reactNative.Animated.Text,{style:[N.subtitle,{textAlign:"center"===a?"center":"left"},T&&W?{opacity:W.subtitleOpacity}:null,A],numberOfLines:L.subtitleLines,children:n}):null,F=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[N.titleColumn,"center"===a?N.titleColumnCenter:null,L.alignBottom?N.titleColumnBottom:null],children:[k,M]}),H=T?_reactNative.Animated.View:_reactNative.View,U=T&&W?{height:_reactNative.Animated.add(W.barHeight,new _reactNative.Animated.Value(I.top))}:{height:(m??L.height)+I.top};return(0,_jsxRuntime.jsxs)(H,{ref:t,testID:S,style:[N.root,{paddingTop:I.top,backgroundColor:h?"transparent":w.colors.surface},U,!T&&O?{borderBottomWidth:D,borderBottomColor:w.colors.border}:null,f,b],children:[T&&W&&O?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[N.animatedBorder,{backgroundColor:w.colors.border,opacity:W.borderOpacity}]}):null,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[N.row,L.alignBottom?N.rowAlignBottom:null,V,{flex:1}],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[N.sideSlot,E?N.sideSlotCompact:null],children:[C?(0,_jsxRuntime.jsx)(ActionButton,{action:C,side:"left",haptic:y,flush:E}):null,null!=s&&!1!==s?(0,_jsxRuntime.jsx)(_reactNative.View,{style:N.slotNode,children:s}):null]}),(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[N.center,"center"===a?N.centerAligned:N.centerLeft,E?{paddingLeft:z?p:w.space.none,paddingRight:w.space.none}:null],children:F}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[N.sideSlot,N.sideSlotRight,E?N.sideSlotCompact:null],children:[l?.map((e,t)=>(0,_jsxRuntime.jsx)(_react.Fragment,{children:"menu"in e?(0,_jsxRuntime.jsx)(_index2.Menu,{items:e.menu,title:e.menuTitle,haptic:y,trigger:(0,_jsxRuntime.jsx)(ActionButton,{action:e,side:"right",badgeStyle:v,haptic:y,flush:E})}):(0,_jsxRuntime.jsx)(ActionButton,{action:e,side:"right",badgeStyle:v,haptic:y,flush:E})},`appbar-right-${t}`)),null!=o&&!1!==o?(0,_jsxRuntime.jsx)(_reactNative.View,{style:N.slotNode,children:o}):null]})]})]})});AppBar.displayName="AppBar";const buildStyles=e=>_reactNative.StyleSheet.create({root:{width:"100%"},row:{flexDirection:"row",alignItems:"center",paddingHorizontal:e.space.xs},rowAlignBottom:{alignItems:"flex-end",paddingBottom:e.space.sm},sideSlot:{flexDirection:"row",alignItems:"center",minWidth:48},sideSlotRight:{justifyContent:"flex-end"},sideSlotCompact:{minWidth:0},slotNode:{flexDirection:"row",alignItems:"center"},center:{flex:1,minWidth:0,paddingHorizontal:e.space.xs},centerAligned:{alignItems:"center"},centerLeft:{alignItems:"flex-start"},titleColumn:{flexDirection:"column",maxWidth:"100%"},titleColumnCenter:{alignItems:"center"},titleColumnBottom:{justifyContent:"flex-end"},title:{color:e.colors["text-body"]},titleVariant:{includeFontPadding:!1,textAlignVertical:"center"},subtitle:{marginTop:e.space.xxs,color:e.colors["text-subtle"],fontSize:e.text.sm.size,fontWeight:e.weight.normal},animatedBorder:{position:"absolute",left:0,right:0,bottom:0,height:_reactNative.StyleSheet.hairlineWidth}}),buildActionStyles=e=>_reactNative.StyleSheet.create({actionButton:{width:44,height:44,borderRadius:e.radius.pill,..._corners.smoothCorners,alignItems:"center",justifyContent:"center"},actionLeft:{marginRight:e.space.xs},actionRight:{marginLeft:e.space.xs},actionPressed:{backgroundColor:e.colors["surface-pressed"]},textButton:{minWidth:44,minHeight:44,paddingHorizontal:e.space.sm,alignItems:"center",justifyContent:"center"},textPressed:{opacity:.6},dot:{position:"absolute",top:10,right:10,width:8,height:8,borderRadius:e.radius.pill,backgroundColor:e.colors.danger},iconWrap:{alignItems:"center",justifyContent:"center"},badge:{position:"absolute",top:4,right:4,minWidth:16,height:16,paddingHorizontal:e.space.xs,borderRadius:e.radius.pill,..._corners.smoothCorners,backgroundColor:e.colors.danger,alignItems:"center",justifyContent:"center"},badgeText:{color:e.colors["on-danger"],fontSize:e.text.xs.size,fontWeight:e.weight.semibold,lineHeight:13}});var _default=exports.default=AppBar;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.DEFAULT_APP_BAR_LABELS=exports.AppBar=void 0;var _react=require("react"),_reactNative=require("react-native"),_reactNativeSafeAreaContext=require("react-native-safe-area-context"),_usePressAnimation=require("../../hooks/usePressAnimation.js"),_index=require("../../theme/index.js"),_corners=require("../../utils/corners.js"),_hapticUtils=require("../../utils/hapticUtils.js"),_warnInvalidValue=require("../../utils/warnInvalidValue.js"),_AppIcon=require("../AppIcon/AppIcon.js"),_index2=require("../Menu/index.js"),_Text=require("../Text/Text.js"),_jsxRuntime=require("react/jsx-runtime");const ACTION_BUTTON_SIZE=44,DOT_OFFSET=10,DOT_SIZE=8,BADGE_OFFSET=4,DEFAULT_APP_BAR_LABELS=exports.DEFAULT_APP_BAR_LABELS=Object.freeze({back:"Back"}),variantSize=(e,t)=>{switch(t){case"compact":return{height:44,titleSize:e.text.lg.size,titleWeight:"semibold",alignBottom:!1,subtitleLines:1};case"large":return{height:96,titleSize:e.text["2xl"].size,titleWeight:"bold",alignBottom:!0,subtitleLines:2};default:return{height:56,titleSize:e.text.lg.size,titleWeight:"semibold",alignBottom:!1,subtitleLines:1}}},ActionButton=(0,_react.forwardRef)(({action:e,side:t,badgeStyle:i,haptic:n,flush:a,onPress:l},r)=>{const s=(0,_index.useTheme)(),{style:o,pressIn:c,pressOut:d}=(0,_usePressAnimation.usePressAnimation)({enabled:!0}),u=(0,_react.useMemo)(()=>buildActionStyles(s),[s]),p=e.badge,m=void 0!==p&&0!==p,g=void 0!==e.label;return(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:o,children:(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{ref:r,onPress:t=>{const i=(0,_hapticUtils.resolveHaptic)(n,"selection");i&&(0,_hapticUtils.triggerHaptic)(i),"onPress"in e&&e.onPress(),l?.(t)},onPressIn:c,onPressOut:d,accessibilityRole:"button",accessibilityLabel:e.accessibilityLabel??e.label,testID:e.testID,android_ripple:{color:s.colors["surface-pressed"],borderless:!g},style:({pressed:e})=>[g?u.textButton:u.actionButton,a?null:"left"===t?u.actionLeft:u.actionRight,e&&!g?u.actionPressed:null,e&&g?u.textPressed:null],children:[g?(0,_jsxRuntime.jsx)(_Text.Text,{variant:"body",weight:"semibold",color:"link",numberOfLines:1,children:e.label}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:u.iconWrap,children:e.icon}),m?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[u.badge,i],pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_Text.Text,{variant:"caption",weight:"semibold",numberOfLines:1,style:u.badgeText,children:String(p)})}):null,e.dot?(0,_jsxRuntime.jsx)(_reactNative.View,{testID:e.testID?`${e.testID}-dot`:"appbar-action-dot",style:u.dot,pointerEvents:"none"}):null]})})}),COLLAPSE_RANGE=60,LARGE_TITLE_SCALE_END=.71,AppBar=exports.AppBar=(0,_react.forwardRef)((e,t)=>{const{title:i,subtitle:n,titleAlignment:a="left",leftAction:l,rightActions:r,leading:s,trailing:o,onBack:c,gutter:d,titleVariant:u,titleOffset:p,height:m,divider:g,variant:x="default",transparent:h=!1,scrollY:_,style:b,containerStyle:f,titleStyle:j,subtitleStyle:A,badgeStyle:v,haptic:y,labels:R,testID:S}=e;(0,_warnInvalidValue.warnInvalidValue)("AppBar","variant",e.variant,["default","large","compact"]),(0,_warnInvalidValue.warnInvalidValue)("AppBar","titleAlignment",e.titleAlignment,["left","center"]);const B=(0,_react.useMemo)(()=>({...DEFAULT_APP_BAR_LABELS,...R}),[R]),w=(0,_index.useTheme)(),I=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)(),L=(0,_react.useMemo)(()=>variantSize(w,x),[w,x]),N=(0,_react.useMemo)(()=>buildStyles(w),[w]),T="large"===x&&void 0!==_,C=l??(c?{icon:(0,_jsxRuntime.jsx)(_AppIcon.AppIcon,{name:"arrow-left",size:24,color:w.colors["text-body"]}),onPress:c,accessibilityLabel:B.back}:void 0),P=o?void 0:r?.[r.length-1],opticalInset=e=>void 0===e?0:void 0!==e.label?w.space.sm:Math.max((44-(e.glyphSize??24))/2,0),V=void 0===d?null:{paddingLeft:Math.max(d-opticalInset(C),0),paddingRight:Math.max(d-opticalInset(P),0)},E=void 0!==p,z=Boolean(C)||Boolean(s),O=E||!z&&"left"===a,D=g??!h,W=_reactNative.StyleSheet.hairlineWidth,q=(0,_react.useMemo)(()=>{if(!_)return null;const e={inputRange:[0,60],extrapolate:"clamp"};return{titleScale:_.interpolate({...e,outputRange:[1,.71]}),titleTranslateY:_.interpolate({...e,outputRange:[0,-20]}),titleTranslateX:_.interpolate({...e,outputRange:"center"===a?[0,0]:[0,8]}),subtitleOpacity:_.interpolate({inputRange:[0,30],outputRange:[1,0],extrapolate:"clamp"}),barHeight:_.interpolate({...e,outputRange:[96,56]}),borderOpacity:_.interpolate({...e,outputRange:[0,1]})}},[_,a]),k=T&&q?{transform:[{translateX:q.titleTranslateX},{translateY:q.titleTranslateY},{scale:q.titleScale}]}:null,M=i?u?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:k,children:(0,_jsxRuntime.jsx)(_Text.Text,{variant:u,align:"center"===a?"center":"left",accessibilityRole:"header",numberOfLines:1,style:[N.titleVariant,j],children:i})}):(0,_jsxRuntime.jsx)(_reactNative.Animated.Text,{accessibilityRole:"header",style:[N.title,{fontSize:L.titleSize,fontWeight:w.weight[L.titleWeight],textAlign:"center"===a?"center":"left"},k,j],numberOfLines:1,children:i}):null,F=n?(0,_jsxRuntime.jsx)(_reactNative.Animated.Text,{style:[N.subtitle,{textAlign:"center"===a?"center":"left"},T&&q?{opacity:q.subtitleOpacity}:null,A],numberOfLines:L.subtitleLines,children:n}):null,H=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[N.titleColumn,"center"===a?N.titleColumnCenter:null,L.alignBottom?N.titleColumnBottom:null],children:[M,F]}),U=T?_reactNative.Animated.View:_reactNative.View,Y=T&&q?{height:_reactNative.Animated.add(q.barHeight,new _reactNative.Animated.Value(I.top))}:{height:(m??L.height)+I.top};return(0,_jsxRuntime.jsxs)(U,{ref:t,testID:S,style:[N.root,{paddingTop:I.top,backgroundColor:h?"transparent":w.colors.surface},Y,!T&&D?{borderBottomWidth:W,borderBottomColor:w.colors.border}:null,f,b],children:[T&&q&&D?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{pointerEvents:"none",style:[N.animatedBorder,{backgroundColor:w.colors.border,opacity:q.borderOpacity}]}):null,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[N.row,L.alignBottom?N.rowAlignBottom:null,V,{flex:1}],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:S?`${S}-leading-slot`:void 0,style:[N.sideSlot,O?N.sideSlotCompact:null],children:[C?(0,_jsxRuntime.jsx)(ActionButton,{action:C,side:"left",haptic:y,flush:E}):null,null!=s&&!1!==s?(0,_jsxRuntime.jsx)(_reactNative.View,{style:N.slotNode,children:s}):null]}),(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[N.center,"center"===a?N.centerAligned:N.centerLeft,E?{paddingLeft:z?p:w.space.none,paddingRight:w.space.none}:O?{paddingLeft:w.space.none}:null],children:H}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[N.sideSlot,N.sideSlotRight,E?N.sideSlotCompact:null],children:[r?.map((e,t)=>(0,_jsxRuntime.jsx)(_react.Fragment,{children:"menu"in e?(0,_jsxRuntime.jsx)(_index2.Menu,{items:e.menu,title:e.menuTitle,haptic:y,trigger:(0,_jsxRuntime.jsx)(ActionButton,{action:e,side:"right",badgeStyle:v,haptic:y,flush:E})}):(0,_jsxRuntime.jsx)(ActionButton,{action:e,side:"right",badgeStyle:v,haptic:y,flush:E})},`appbar-right-${t}`)),null!=o&&!1!==o?(0,_jsxRuntime.jsx)(_reactNative.View,{style:N.slotNode,children:o}):null]})]})]})});AppBar.displayName="AppBar";const buildStyles=e=>_reactNative.StyleSheet.create({root:{width:"100%"},row:{flexDirection:"row",alignItems:"center",paddingHorizontal:e.space.xs},rowAlignBottom:{alignItems:"flex-end",paddingBottom:e.space.sm},sideSlot:{flexDirection:"row",alignItems:"center",minWidth:48},sideSlotRight:{justifyContent:"flex-end"},sideSlotCompact:{minWidth:0},slotNode:{flexDirection:"row",alignItems:"center"},center:{flex:1,minWidth:0,paddingHorizontal:e.space.xs},centerAligned:{alignItems:"center"},centerLeft:{alignItems:"flex-start"},titleColumn:{flexDirection:"column",maxWidth:"100%"},titleColumnCenter:{alignItems:"center"},titleColumnBottom:{justifyContent:"flex-end"},title:{color:e.colors["text-body"]},titleVariant:{includeFontPadding:!1,textAlignVertical:"center"},subtitle:{marginTop:e.space.xxs,color:e.colors["text-subtle"],fontSize:e.text.sm.size,fontWeight:e.weight.normal},animatedBorder:{position:"absolute",left:0,right:0,bottom:0,height:_reactNative.StyleSheet.hairlineWidth}}),buildActionStyles=e=>_reactNative.StyleSheet.create({actionButton:{width:44,height:44,borderRadius:e.radius.pill,..._corners.smoothCorners,alignItems:"center",justifyContent:"center"},actionLeft:{marginRight:e.space.xs},actionRight:{marginLeft:e.space.xs},actionPressed:{backgroundColor:e.colors["surface-pressed"]},textButton:{minWidth:44,minHeight:44,paddingHorizontal:e.space.sm,alignItems:"center",justifyContent:"center"},textPressed:{opacity:.6},dot:{position:"absolute",top:10,right:10,width:8,height:8,borderRadius:e.radius.pill,backgroundColor:e.colors.danger},iconWrap:{alignItems:"center",justifyContent:"center"},badge:{position:"absolute",top:4,right:4,minWidth:16,height:16,paddingHorizontal:e.space.xs,borderRadius:e.radius.pill,..._corners.smoothCorners,backgroundColor:e.colors.danger,alignItems:"center",justifyContent:"center"},badgeText:{color:e.colors["on-danger"],fontSize:e.text.xs.size,fontWeight:e.weight.semibold,lineHeight:13}});var _default=exports.default=AppBar;