@mittwald/flow-react-components 0.2.0-alpha.569 → 0.2.0-alpha.570
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.
- package/CHANGELOG.md +7 -0
- package/dist/assets/doc-properties.json +286 -362
- package/dist/js/components/src/components/Autocomplete/Autocomplete.mjs +10 -18
- package/dist/js/components/src/components/Autocomplete/Autocomplete.mjs.map +1 -1
- package/dist/js/components/src/components/FileField/FileField.mjs +21 -26
- package/dist/js/components/src/components/FileField/FileField.mjs.map +1 -1
- package/dist/js/components/src/components/FileField/components/FileInput.mjs +2 -1
- package/dist/js/components/src/components/FileField/components/FileInput.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/Field/Field.mjs +4 -1
- package/dist/js/components/src/integrations/react-hook-form/components/Field/Field.mjs.map +1 -1
- package/dist/js/components/src/lib/propsContext/mergePropsContext.mjs +1 -1
- package/dist/js/components/src/lib/propsContext/mergePropsContext.mjs.map +1 -1
- package/dist/js/components/src/lib/react/emitElementValueChange.mjs +23 -0
- package/dist/js/components/src/lib/react/emitElementValueChange.mjs.map +1 -0
- package/dist/types/components/Autocomplete/Autocomplete.d.ts +0 -4
- package/dist/types/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/types/components/FileField/FileField.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/Field/Field.d.ts.map +1 -1
- package/dist/types/lib/react/emitElementValueChange.d.ts +6 -0
- package/dist/types/lib/react/emitElementValueChange.d.ts.map +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.2.0-alpha.570](https://github.com/mittwald/flow/compare/0.2.0-alpha.569...0.2.0-alpha.570) (2025-11-26)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **Autocomplete:** fix label always marked as optional ([#2155](https://github.com/mittwald/flow/issues/2155)) ([3973659](https://github.com/mittwald/flow/commit/3973659068b7a86ab577c795a0439e67ca3640c7))
|
|
11
|
+
* **FileField:** fix flaky props settings ([#2156](https://github.com/mittwald/flow/issues/2156)) ([a332b42](https://github.com/mittwald/flow/commit/a332b427f41e304cc35a15eb76f573a61367511c))
|
|
12
|
+
|
|
6
13
|
# [0.2.0-alpha.569](https://github.com/mittwald/flow/compare/0.2.0-alpha.568...0.2.0-alpha.569) (2025-11-26)
|
|
7
14
|
|
|
8
15
|
**Note:** Version bump only for package @mittwald/flow-react-components
|
|
@@ -56244,182 +56244,6 @@
|
|
|
56244
56244
|
}
|
|
56245
56245
|
}
|
|
56246
56246
|
},
|
|
56247
|
-
{
|
|
56248
|
-
"tags": {},
|
|
56249
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
56250
|
-
"description": "",
|
|
56251
|
-
"displayName": "OverlayTrigger",
|
|
56252
|
-
"methods": [],
|
|
56253
|
-
"props": {
|
|
56254
|
-
"overlayType": {
|
|
56255
|
-
"defaultValue": null,
|
|
56256
|
-
"description": "",
|
|
56257
|
-
"name": "overlayType",
|
|
56258
|
-
"parent": {
|
|
56259
|
-
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
56260
|
-
"name": "Props"
|
|
56261
|
-
},
|
|
56262
|
-
"declarations": [
|
|
56263
|
-
{
|
|
56264
|
-
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
56265
|
-
"name": "Props"
|
|
56266
|
-
}
|
|
56267
|
-
],
|
|
56268
|
-
"required": true,
|
|
56269
|
-
"type": {
|
|
56270
|
-
"name": "keyof FlowComponentPropsTypes"
|
|
56271
|
-
}
|
|
56272
|
-
},
|
|
56273
|
-
"component": {
|
|
56274
|
-
"defaultValue": null,
|
|
56275
|
-
"description": "",
|
|
56276
|
-
"name": "component",
|
|
56277
|
-
"parent": {
|
|
56278
|
-
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
56279
|
-
"name": "Props"
|
|
56280
|
-
},
|
|
56281
|
-
"declarations": [
|
|
56282
|
-
{
|
|
56283
|
-
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
56284
|
-
"name": "Props"
|
|
56285
|
-
}
|
|
56286
|
-
],
|
|
56287
|
-
"required": true,
|
|
56288
|
-
"type": {
|
|
56289
|
-
"name": "AriaComponentType"
|
|
56290
|
-
}
|
|
56291
|
-
},
|
|
56292
|
-
"isDefaultOpen": {
|
|
56293
|
-
"defaultValue": null,
|
|
56294
|
-
"description": "Whether the overlay should be open initially.",
|
|
56295
|
-
"name": "isDefaultOpen",
|
|
56296
|
-
"parent": {
|
|
56297
|
-
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
56298
|
-
"name": "OverlayTriggerProps"
|
|
56299
|
-
},
|
|
56300
|
-
"declarations": [
|
|
56301
|
-
{
|
|
56302
|
-
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
56303
|
-
"name": "OverlayTriggerProps"
|
|
56304
|
-
}
|
|
56305
|
-
],
|
|
56306
|
-
"required": false,
|
|
56307
|
-
"type": {
|
|
56308
|
-
"name": "boolean"
|
|
56309
|
-
}
|
|
56310
|
-
},
|
|
56311
|
-
"controller": {
|
|
56312
|
-
"defaultValue": null,
|
|
56313
|
-
"description": "A controller to control the state of the overlay.",
|
|
56314
|
-
"name": "controller",
|
|
56315
|
-
"parent": {
|
|
56316
|
-
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
56317
|
-
"name": "OverlayTriggerProps"
|
|
56318
|
-
},
|
|
56319
|
-
"declarations": [
|
|
56320
|
-
{
|
|
56321
|
-
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
56322
|
-
"name": "OverlayTriggerProps"
|
|
56323
|
-
}
|
|
56324
|
-
],
|
|
56325
|
-
"required": false,
|
|
56326
|
-
"type": {
|
|
56327
|
-
"name": "OverlayController"
|
|
56328
|
-
}
|
|
56329
|
-
},
|
|
56330
|
-
"wrapWith": {
|
|
56331
|
-
"defaultValue": null,
|
|
56332
|
-
"description": "",
|
|
56333
|
-
"name": "wrapWith",
|
|
56334
|
-
"parent": {
|
|
56335
|
-
"fileName": "components/src/lib/componentFactory/flowComponent.tsx",
|
|
56336
|
-
"name": "FlowComponentProps"
|
|
56337
|
-
},
|
|
56338
|
-
"declarations": [
|
|
56339
|
-
{
|
|
56340
|
-
"fileName": "components/src/lib/componentFactory/flowComponent.tsx",
|
|
56341
|
-
"name": "FlowComponentProps"
|
|
56342
|
-
}
|
|
56343
|
-
],
|
|
56344
|
-
"required": false,
|
|
56345
|
-
"type": {
|
|
56346
|
-
"name": "ReactElement<unknown, string | JSXElementConstructor<any>>"
|
|
56347
|
-
}
|
|
56348
|
-
},
|
|
56349
|
-
"tunnelId": {
|
|
56350
|
-
"defaultValue": null,
|
|
56351
|
-
"description": "@internal",
|
|
56352
|
-
"name": "tunnelId",
|
|
56353
|
-
"parent": {
|
|
56354
|
-
"fileName": "components/src/lib/types/props.ts",
|
|
56355
|
-
"name": "PropsWithTunnel"
|
|
56356
|
-
},
|
|
56357
|
-
"declarations": [
|
|
56358
|
-
{
|
|
56359
|
-
"fileName": "components/src/lib/types/props.ts",
|
|
56360
|
-
"name": "PropsWithTunnel"
|
|
56361
|
-
}
|
|
56362
|
-
],
|
|
56363
|
-
"required": false,
|
|
56364
|
-
"type": {
|
|
56365
|
-
"name": "string | null"
|
|
56366
|
-
}
|
|
56367
|
-
},
|
|
56368
|
-
"ref": {
|
|
56369
|
-
"defaultValue": null,
|
|
56370
|
-
"description": "Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",
|
|
56371
|
-
"name": "ref",
|
|
56372
|
-
"parent": {
|
|
56373
|
-
"fileName": "flow/node_modules/.pnpm/@types+react@19.2.2/node_modules/@types/react/index.d.ts",
|
|
56374
|
-
"name": "RefAttributes"
|
|
56375
|
-
},
|
|
56376
|
-
"declarations": [
|
|
56377
|
-
{
|
|
56378
|
-
"fileName": "flow/node_modules/.pnpm/@types+react@19.2.2/node_modules/@types/react/index.d.ts",
|
|
56379
|
-
"name": "RefAttributes"
|
|
56380
|
-
}
|
|
56381
|
-
],
|
|
56382
|
-
"required": false,
|
|
56383
|
-
"type": {
|
|
56384
|
-
"name": "Ref<HTMLSpanElement>"
|
|
56385
|
-
}
|
|
56386
|
-
},
|
|
56387
|
-
"key": {
|
|
56388
|
-
"defaultValue": null,
|
|
56389
|
-
"description": "",
|
|
56390
|
-
"name": "key",
|
|
56391
|
-
"parent": {
|
|
56392
|
-
"fileName": "flow/node_modules/.pnpm/@types+react@19.2.2/node_modules/@types/react/index.d.ts",
|
|
56393
|
-
"name": "Attributes"
|
|
56394
|
-
},
|
|
56395
|
-
"declarations": [
|
|
56396
|
-
{
|
|
56397
|
-
"fileName": "flow/node_modules/.pnpm/@types+react@19.2.2/node_modules/@types/react/index.d.ts",
|
|
56398
|
-
"name": "Attributes"
|
|
56399
|
-
}
|
|
56400
|
-
],
|
|
56401
|
-
"required": false,
|
|
56402
|
-
"type": {
|
|
56403
|
-
"name": "Key | null"
|
|
56404
|
-
}
|
|
56405
|
-
},
|
|
56406
|
-
"children": {
|
|
56407
|
-
"defaultValue": null,
|
|
56408
|
-
"description": "",
|
|
56409
|
-
"name": "children",
|
|
56410
|
-
"declarations": [
|
|
56411
|
-
{
|
|
56412
|
-
"fileName": "flow/node_modules/.pnpm/@types+react@19.2.2/node_modules/@types/react/index.d.ts",
|
|
56413
|
-
"name": "TypeLiteral"
|
|
56414
|
-
}
|
|
56415
|
-
],
|
|
56416
|
-
"required": false,
|
|
56417
|
-
"type": {
|
|
56418
|
-
"name": "ReactNode"
|
|
56419
|
-
}
|
|
56420
|
-
}
|
|
56421
|
-
}
|
|
56422
|
-
},
|
|
56423
56247
|
{
|
|
56424
56248
|
"tags": {},
|
|
56425
56249
|
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/Overlay/Overlay.tsx",
|
|
@@ -58656,6 +58480,182 @@
|
|
|
58656
58480
|
}
|
|
58657
58481
|
}
|
|
58658
58482
|
},
|
|
58483
|
+
{
|
|
58484
|
+
"tags": {},
|
|
58485
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
58486
|
+
"description": "",
|
|
58487
|
+
"displayName": "OverlayTrigger",
|
|
58488
|
+
"methods": [],
|
|
58489
|
+
"props": {
|
|
58490
|
+
"overlayType": {
|
|
58491
|
+
"defaultValue": null,
|
|
58492
|
+
"description": "",
|
|
58493
|
+
"name": "overlayType",
|
|
58494
|
+
"parent": {
|
|
58495
|
+
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
58496
|
+
"name": "Props"
|
|
58497
|
+
},
|
|
58498
|
+
"declarations": [
|
|
58499
|
+
{
|
|
58500
|
+
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
58501
|
+
"name": "Props"
|
|
58502
|
+
}
|
|
58503
|
+
],
|
|
58504
|
+
"required": true,
|
|
58505
|
+
"type": {
|
|
58506
|
+
"name": "keyof FlowComponentPropsTypes"
|
|
58507
|
+
}
|
|
58508
|
+
},
|
|
58509
|
+
"component": {
|
|
58510
|
+
"defaultValue": null,
|
|
58511
|
+
"description": "",
|
|
58512
|
+
"name": "component",
|
|
58513
|
+
"parent": {
|
|
58514
|
+
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
58515
|
+
"name": "Props"
|
|
58516
|
+
},
|
|
58517
|
+
"declarations": [
|
|
58518
|
+
{
|
|
58519
|
+
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
58520
|
+
"name": "Props"
|
|
58521
|
+
}
|
|
58522
|
+
],
|
|
58523
|
+
"required": true,
|
|
58524
|
+
"type": {
|
|
58525
|
+
"name": "AriaComponentType"
|
|
58526
|
+
}
|
|
58527
|
+
},
|
|
58528
|
+
"isDefaultOpen": {
|
|
58529
|
+
"defaultValue": null,
|
|
58530
|
+
"description": "Whether the overlay should be open initially.",
|
|
58531
|
+
"name": "isDefaultOpen",
|
|
58532
|
+
"parent": {
|
|
58533
|
+
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
58534
|
+
"name": "OverlayTriggerProps"
|
|
58535
|
+
},
|
|
58536
|
+
"declarations": [
|
|
58537
|
+
{
|
|
58538
|
+
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
58539
|
+
"name": "OverlayTriggerProps"
|
|
58540
|
+
}
|
|
58541
|
+
],
|
|
58542
|
+
"required": false,
|
|
58543
|
+
"type": {
|
|
58544
|
+
"name": "boolean"
|
|
58545
|
+
}
|
|
58546
|
+
},
|
|
58547
|
+
"controller": {
|
|
58548
|
+
"defaultValue": null,
|
|
58549
|
+
"description": "A controller to control the state of the overlay.",
|
|
58550
|
+
"name": "controller",
|
|
58551
|
+
"parent": {
|
|
58552
|
+
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
58553
|
+
"name": "OverlayTriggerProps"
|
|
58554
|
+
},
|
|
58555
|
+
"declarations": [
|
|
58556
|
+
{
|
|
58557
|
+
"fileName": "components/src/components/OverlayTrigger/OverlayTrigger.tsx",
|
|
58558
|
+
"name": "OverlayTriggerProps"
|
|
58559
|
+
}
|
|
58560
|
+
],
|
|
58561
|
+
"required": false,
|
|
58562
|
+
"type": {
|
|
58563
|
+
"name": "OverlayController"
|
|
58564
|
+
}
|
|
58565
|
+
},
|
|
58566
|
+
"wrapWith": {
|
|
58567
|
+
"defaultValue": null,
|
|
58568
|
+
"description": "",
|
|
58569
|
+
"name": "wrapWith",
|
|
58570
|
+
"parent": {
|
|
58571
|
+
"fileName": "components/src/lib/componentFactory/flowComponent.tsx",
|
|
58572
|
+
"name": "FlowComponentProps"
|
|
58573
|
+
},
|
|
58574
|
+
"declarations": [
|
|
58575
|
+
{
|
|
58576
|
+
"fileName": "components/src/lib/componentFactory/flowComponent.tsx",
|
|
58577
|
+
"name": "FlowComponentProps"
|
|
58578
|
+
}
|
|
58579
|
+
],
|
|
58580
|
+
"required": false,
|
|
58581
|
+
"type": {
|
|
58582
|
+
"name": "ReactElement<unknown, string | JSXElementConstructor<any>>"
|
|
58583
|
+
}
|
|
58584
|
+
},
|
|
58585
|
+
"tunnelId": {
|
|
58586
|
+
"defaultValue": null,
|
|
58587
|
+
"description": "@internal",
|
|
58588
|
+
"name": "tunnelId",
|
|
58589
|
+
"parent": {
|
|
58590
|
+
"fileName": "components/src/lib/types/props.ts",
|
|
58591
|
+
"name": "PropsWithTunnel"
|
|
58592
|
+
},
|
|
58593
|
+
"declarations": [
|
|
58594
|
+
{
|
|
58595
|
+
"fileName": "components/src/lib/types/props.ts",
|
|
58596
|
+
"name": "PropsWithTunnel"
|
|
58597
|
+
}
|
|
58598
|
+
],
|
|
58599
|
+
"required": false,
|
|
58600
|
+
"type": {
|
|
58601
|
+
"name": "string | null"
|
|
58602
|
+
}
|
|
58603
|
+
},
|
|
58604
|
+
"ref": {
|
|
58605
|
+
"defaultValue": null,
|
|
58606
|
+
"description": "Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",
|
|
58607
|
+
"name": "ref",
|
|
58608
|
+
"parent": {
|
|
58609
|
+
"fileName": "flow/node_modules/.pnpm/@types+react@19.2.2/node_modules/@types/react/index.d.ts",
|
|
58610
|
+
"name": "RefAttributes"
|
|
58611
|
+
},
|
|
58612
|
+
"declarations": [
|
|
58613
|
+
{
|
|
58614
|
+
"fileName": "flow/node_modules/.pnpm/@types+react@19.2.2/node_modules/@types/react/index.d.ts",
|
|
58615
|
+
"name": "RefAttributes"
|
|
58616
|
+
}
|
|
58617
|
+
],
|
|
58618
|
+
"required": false,
|
|
58619
|
+
"type": {
|
|
58620
|
+
"name": "Ref<HTMLSpanElement>"
|
|
58621
|
+
}
|
|
58622
|
+
},
|
|
58623
|
+
"key": {
|
|
58624
|
+
"defaultValue": null,
|
|
58625
|
+
"description": "",
|
|
58626
|
+
"name": "key",
|
|
58627
|
+
"parent": {
|
|
58628
|
+
"fileName": "flow/node_modules/.pnpm/@types+react@19.2.2/node_modules/@types/react/index.d.ts",
|
|
58629
|
+
"name": "Attributes"
|
|
58630
|
+
},
|
|
58631
|
+
"declarations": [
|
|
58632
|
+
{
|
|
58633
|
+
"fileName": "flow/node_modules/.pnpm/@types+react@19.2.2/node_modules/@types/react/index.d.ts",
|
|
58634
|
+
"name": "Attributes"
|
|
58635
|
+
}
|
|
58636
|
+
],
|
|
58637
|
+
"required": false,
|
|
58638
|
+
"type": {
|
|
58639
|
+
"name": "Key | null"
|
|
58640
|
+
}
|
|
58641
|
+
},
|
|
58642
|
+
"children": {
|
|
58643
|
+
"defaultValue": null,
|
|
58644
|
+
"description": "",
|
|
58645
|
+
"name": "children",
|
|
58646
|
+
"declarations": [
|
|
58647
|
+
{
|
|
58648
|
+
"fileName": "flow/node_modules/.pnpm/@types+react@19.2.2/node_modules/@types/react/index.d.ts",
|
|
58649
|
+
"name": "TypeLiteral"
|
|
58650
|
+
}
|
|
58651
|
+
],
|
|
58652
|
+
"required": false,
|
|
58653
|
+
"type": {
|
|
58654
|
+
"name": "ReactNode"
|
|
58655
|
+
}
|
|
58656
|
+
}
|
|
58657
|
+
}
|
|
58658
|
+
},
|
|
58659
58659
|
{
|
|
58660
58660
|
"tags": {
|
|
58661
58661
|
"flr-generate": "all"
|
|
@@ -224136,85 +224136,68 @@
|
|
|
224136
224136
|
"tags": {
|
|
224137
224137
|
"flr-generate": "all"
|
|
224138
224138
|
},
|
|
224139
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/
|
|
224139
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/Avatar/Avatar.tsx",
|
|
224140
224140
|
"description": "",
|
|
224141
|
-
"displayName": "
|
|
224141
|
+
"displayName": "Avatar",
|
|
224142
224142
|
"methods": [],
|
|
224143
224143
|
"props": {
|
|
224144
|
-
"
|
|
224145
|
-
"defaultValue":
|
|
224146
|
-
|
|
224147
|
-
"name": "isInvalid",
|
|
224148
|
-
"parent": {
|
|
224149
|
-
"fileName": "components/src/components/Autocomplete/Autocomplete.tsx",
|
|
224150
|
-
"name": "AutocompleteProps"
|
|
224144
|
+
"size": {
|
|
224145
|
+
"defaultValue": {
|
|
224146
|
+
"value": "\"m\""
|
|
224151
224147
|
},
|
|
224152
|
-
"
|
|
224153
|
-
|
|
224154
|
-
"fileName": "components/src/components/Autocomplete/Autocomplete.tsx",
|
|
224155
|
-
"name": "AutocompleteProps"
|
|
224156
|
-
}
|
|
224157
|
-
],
|
|
224158
|
-
"required": false,
|
|
224159
|
-
"type": {
|
|
224160
|
-
"name": "boolean"
|
|
224161
|
-
}
|
|
224162
|
-
},
|
|
224163
|
-
"value": {
|
|
224164
|
-
"defaultValue": null,
|
|
224165
|
-
"description": "",
|
|
224166
|
-
"name": "value",
|
|
224148
|
+
"description": "The size of the avatar.",
|
|
224149
|
+
"name": "size",
|
|
224167
224150
|
"parent": {
|
|
224168
|
-
"fileName": "components/src/components/
|
|
224169
|
-
"name": "
|
|
224151
|
+
"fileName": "components/src/components/Avatar/Avatar.tsx",
|
|
224152
|
+
"name": "AvatarProps"
|
|
224170
224153
|
},
|
|
224171
224154
|
"declarations": [
|
|
224172
224155
|
{
|
|
224173
|
-
"fileName": "components/src/components/
|
|
224174
|
-
"name": "
|
|
224156
|
+
"fileName": "components/src/components/Avatar/Avatar.tsx",
|
|
224157
|
+
"name": "AvatarProps"
|
|
224175
224158
|
}
|
|
224176
224159
|
],
|
|
224177
224160
|
"required": false,
|
|
224178
224161
|
"type": {
|
|
224179
|
-
"name": "
|
|
224162
|
+
"name": "\"s\" | \"xs\" | \"m\" | \"l\""
|
|
224180
224163
|
}
|
|
224181
224164
|
},
|
|
224182
|
-
"
|
|
224165
|
+
"color": {
|
|
224183
224166
|
"defaultValue": null,
|
|
224184
|
-
"description": "",
|
|
224185
|
-
"name": "
|
|
224167
|
+
"description": "The color of icons and initials inside the avatar.",
|
|
224168
|
+
"name": "color",
|
|
224186
224169
|
"parent": {
|
|
224187
|
-
"fileName": "components/src/components/
|
|
224188
|
-
"name": "
|
|
224170
|
+
"fileName": "components/src/components/Avatar/Avatar.tsx",
|
|
224171
|
+
"name": "AvatarProps"
|
|
224189
224172
|
},
|
|
224190
224173
|
"declarations": [
|
|
224191
224174
|
{
|
|
224192
|
-
"fileName": "components/src/components/
|
|
224193
|
-
"name": "
|
|
224175
|
+
"fileName": "components/src/components/Avatar/Avatar.tsx",
|
|
224176
|
+
"name": "AvatarProps"
|
|
224194
224177
|
}
|
|
224195
224178
|
],
|
|
224196
224179
|
"required": false,
|
|
224197
224180
|
"type": {
|
|
224198
|
-
"name": "
|
|
224181
|
+
"name": "\"violet\" | \"green\" | \"blue\" | \"teal\" | \"lilac\""
|
|
224199
224182
|
}
|
|
224200
224183
|
},
|
|
224201
|
-
"
|
|
224184
|
+
"status": {
|
|
224202
224185
|
"defaultValue": null,
|
|
224203
|
-
"description": "",
|
|
224204
|
-
"name": "
|
|
224186
|
+
"description": "Adds status icon and color to the avatar. May only be used if the status is\nexplained by an element (like text or label) nearby.",
|
|
224187
|
+
"name": "status",
|
|
224205
224188
|
"parent": {
|
|
224206
|
-
"fileName": "components/src/components/
|
|
224207
|
-
"name": "
|
|
224189
|
+
"fileName": "components/src/components/Avatar/Avatar.tsx",
|
|
224190
|
+
"name": "AvatarProps"
|
|
224208
224191
|
},
|
|
224209
224192
|
"declarations": [
|
|
224210
224193
|
{
|
|
224211
|
-
"fileName": "components/src/components/
|
|
224212
|
-
"name": "
|
|
224194
|
+
"fileName": "components/src/components/Avatar/Avatar.tsx",
|
|
224195
|
+
"name": "AvatarProps"
|
|
224213
224196
|
}
|
|
224214
224197
|
],
|
|
224215
224198
|
"required": false,
|
|
224216
224199
|
"type": {
|
|
224217
|
-
"name": "
|
|
224200
|
+
"name": "Status"
|
|
224218
224201
|
}
|
|
224219
224202
|
},
|
|
224220
224203
|
"children": {
|
|
@@ -224326,86 +224309,6 @@
|
|
|
224326
224309
|
"type": {
|
|
224327
224310
|
"name": "Key | null"
|
|
224328
224311
|
}
|
|
224329
|
-
},
|
|
224330
|
-
"slot": {
|
|
224331
|
-
"defaultValue": null,
|
|
224332
|
-
"description": "A slot name for the component. Slots allow the component to receive props from a parent component.\nAn explicit `null` value indicates that the local props completely override all props received from a parent.",
|
|
224333
|
-
"name": "slot",
|
|
224334
|
-
"parent": {
|
|
224335
|
-
"fileName": "flow/node_modules/.pnpm/react-aria-components@1.13.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/dist/types.d.ts",
|
|
224336
|
-
"name": "SlotProps"
|
|
224337
|
-
},
|
|
224338
|
-
"declarations": [
|
|
224339
|
-
{
|
|
224340
|
-
"fileName": "flow/node_modules/.pnpm/react-aria-components@1.13.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/dist/types.d.ts",
|
|
224341
|
-
"name": "SlotProps"
|
|
224342
|
-
}
|
|
224343
|
-
],
|
|
224344
|
-
"required": false,
|
|
224345
|
-
"type": {
|
|
224346
|
-
"name": "string | null"
|
|
224347
|
-
}
|
|
224348
|
-
},
|
|
224349
|
-
"filter": {
|
|
224350
|
-
"defaultValue": null,
|
|
224351
|
-
"description": "An optional filter function used to determine if a option should be included in the autocomplete list.\nInclude this if the items you are providing to your wrapped collection aren't filtered by default.",
|
|
224352
|
-
"name": "filter",
|
|
224353
|
-
"parent": {
|
|
224354
|
-
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-rc.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
224355
|
-
"name": "AriaAutocompleteProps"
|
|
224356
|
-
},
|
|
224357
|
-
"declarations": [
|
|
224358
|
-
{
|
|
224359
|
-
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-rc.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
224360
|
-
"name": "AriaAutocompleteProps"
|
|
224361
|
-
}
|
|
224362
|
-
],
|
|
224363
|
-
"required": false,
|
|
224364
|
-
"type": {
|
|
224365
|
-
"name": "((textValue: string, inputValue: string, node: Node<object>) => boolean)"
|
|
224366
|
-
}
|
|
224367
|
-
},
|
|
224368
|
-
"disableAutoFocusFirst": {
|
|
224369
|
-
"defaultValue": {
|
|
224370
|
-
"value": "false"
|
|
224371
|
-
},
|
|
224372
|
-
"description": "Whether or not to focus the first item in the collection after a filter is performed. Note this is only applicable\nif virtual focus behavior is not turned off via `disableVirtualFocus`.",
|
|
224373
|
-
"name": "disableAutoFocusFirst",
|
|
224374
|
-
"parent": {
|
|
224375
|
-
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-rc.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
224376
|
-
"name": "AriaAutocompleteProps"
|
|
224377
|
-
},
|
|
224378
|
-
"declarations": [
|
|
224379
|
-
{
|
|
224380
|
-
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-rc.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
224381
|
-
"name": "AriaAutocompleteProps"
|
|
224382
|
-
}
|
|
224383
|
-
],
|
|
224384
|
-
"required": false,
|
|
224385
|
-
"type": {
|
|
224386
|
-
"name": "boolean"
|
|
224387
|
-
}
|
|
224388
|
-
},
|
|
224389
|
-
"disableVirtualFocus": {
|
|
224390
|
-
"defaultValue": {
|
|
224391
|
-
"value": "false"
|
|
224392
|
-
},
|
|
224393
|
-
"description": "Whether the autocomplete should disable virtual focus, instead making the wrapped collection directly tabbable.",
|
|
224394
|
-
"name": "disableVirtualFocus",
|
|
224395
|
-
"parent": {
|
|
224396
|
-
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-rc.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
224397
|
-
"name": "AriaAutocompleteProps"
|
|
224398
|
-
},
|
|
224399
|
-
"declarations": [
|
|
224400
|
-
{
|
|
224401
|
-
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-rc.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
224402
|
-
"name": "AriaAutocompleteProps"
|
|
224403
|
-
}
|
|
224404
|
-
],
|
|
224405
|
-
"required": false,
|
|
224406
|
-
"type": {
|
|
224407
|
-
"name": "boolean"
|
|
224408
|
-
}
|
|
224409
224312
|
}
|
|
224410
224313
|
}
|
|
224411
224314
|
},
|
|
@@ -224413,70 +224316,11 @@
|
|
|
224413
224316
|
"tags": {
|
|
224414
224317
|
"flr-generate": "all"
|
|
224415
224318
|
},
|
|
224416
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/
|
|
224319
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/Autocomplete/Autocomplete.tsx",
|
|
224417
224320
|
"description": "",
|
|
224418
|
-
"displayName": "
|
|
224321
|
+
"displayName": "Autocomplete",
|
|
224419
224322
|
"methods": [],
|
|
224420
224323
|
"props": {
|
|
224421
|
-
"size": {
|
|
224422
|
-
"defaultValue": {
|
|
224423
|
-
"value": "\"m\""
|
|
224424
|
-
},
|
|
224425
|
-
"description": "The size of the avatar.",
|
|
224426
|
-
"name": "size",
|
|
224427
|
-
"parent": {
|
|
224428
|
-
"fileName": "components/src/components/Avatar/Avatar.tsx",
|
|
224429
|
-
"name": "AvatarProps"
|
|
224430
|
-
},
|
|
224431
|
-
"declarations": [
|
|
224432
|
-
{
|
|
224433
|
-
"fileName": "components/src/components/Avatar/Avatar.tsx",
|
|
224434
|
-
"name": "AvatarProps"
|
|
224435
|
-
}
|
|
224436
|
-
],
|
|
224437
|
-
"required": false,
|
|
224438
|
-
"type": {
|
|
224439
|
-
"name": "\"s\" | \"xs\" | \"m\" | \"l\""
|
|
224440
|
-
}
|
|
224441
|
-
},
|
|
224442
|
-
"color": {
|
|
224443
|
-
"defaultValue": null,
|
|
224444
|
-
"description": "The color of icons and initials inside the avatar.",
|
|
224445
|
-
"name": "color",
|
|
224446
|
-
"parent": {
|
|
224447
|
-
"fileName": "components/src/components/Avatar/Avatar.tsx",
|
|
224448
|
-
"name": "AvatarProps"
|
|
224449
|
-
},
|
|
224450
|
-
"declarations": [
|
|
224451
|
-
{
|
|
224452
|
-
"fileName": "components/src/components/Avatar/Avatar.tsx",
|
|
224453
|
-
"name": "AvatarProps"
|
|
224454
|
-
}
|
|
224455
|
-
],
|
|
224456
|
-
"required": false,
|
|
224457
|
-
"type": {
|
|
224458
|
-
"name": "\"violet\" | \"green\" | \"blue\" | \"teal\" | \"lilac\""
|
|
224459
|
-
}
|
|
224460
|
-
},
|
|
224461
|
-
"status": {
|
|
224462
|
-
"defaultValue": null,
|
|
224463
|
-
"description": "Adds status icon and color to the avatar. May only be used if the status is\nexplained by an element (like text or label) nearby.",
|
|
224464
|
-
"name": "status",
|
|
224465
|
-
"parent": {
|
|
224466
|
-
"fileName": "components/src/components/Avatar/Avatar.tsx",
|
|
224467
|
-
"name": "AvatarProps"
|
|
224468
|
-
},
|
|
224469
|
-
"declarations": [
|
|
224470
|
-
{
|
|
224471
|
-
"fileName": "components/src/components/Avatar/Avatar.tsx",
|
|
224472
|
-
"name": "AvatarProps"
|
|
224473
|
-
}
|
|
224474
|
-
],
|
|
224475
|
-
"required": false,
|
|
224476
|
-
"type": {
|
|
224477
|
-
"name": "Status"
|
|
224478
|
-
}
|
|
224479
|
-
},
|
|
224480
224324
|
"children": {
|
|
224481
224325
|
"defaultValue": null,
|
|
224482
224326
|
"description": "",
|
|
@@ -224586,6 +224430,86 @@
|
|
|
224586
224430
|
"type": {
|
|
224587
224431
|
"name": "Key | null"
|
|
224588
224432
|
}
|
|
224433
|
+
},
|
|
224434
|
+
"slot": {
|
|
224435
|
+
"defaultValue": null,
|
|
224436
|
+
"description": "A slot name for the component. Slots allow the component to receive props from a parent component.\nAn explicit `null` value indicates that the local props completely override all props received from a parent.",
|
|
224437
|
+
"name": "slot",
|
|
224438
|
+
"parent": {
|
|
224439
|
+
"fileName": "flow/node_modules/.pnpm/react-aria-components@1.13.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/dist/types.d.ts",
|
|
224440
|
+
"name": "SlotProps"
|
|
224441
|
+
},
|
|
224442
|
+
"declarations": [
|
|
224443
|
+
{
|
|
224444
|
+
"fileName": "flow/node_modules/.pnpm/react-aria-components@1.13.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/dist/types.d.ts",
|
|
224445
|
+
"name": "SlotProps"
|
|
224446
|
+
}
|
|
224447
|
+
],
|
|
224448
|
+
"required": false,
|
|
224449
|
+
"type": {
|
|
224450
|
+
"name": "string | null"
|
|
224451
|
+
}
|
|
224452
|
+
},
|
|
224453
|
+
"filter": {
|
|
224454
|
+
"defaultValue": null,
|
|
224455
|
+
"description": "An optional filter function used to determine if a option should be included in the autocomplete list.\nInclude this if the items you are providing to your wrapped collection aren't filtered by default.",
|
|
224456
|
+
"name": "filter",
|
|
224457
|
+
"parent": {
|
|
224458
|
+
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-rc.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
224459
|
+
"name": "AriaAutocompleteProps"
|
|
224460
|
+
},
|
|
224461
|
+
"declarations": [
|
|
224462
|
+
{
|
|
224463
|
+
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-rc.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
224464
|
+
"name": "AriaAutocompleteProps"
|
|
224465
|
+
}
|
|
224466
|
+
],
|
|
224467
|
+
"required": false,
|
|
224468
|
+
"type": {
|
|
224469
|
+
"name": "((textValue: string, inputValue: string, node: Node<object>) => boolean)"
|
|
224470
|
+
}
|
|
224471
|
+
},
|
|
224472
|
+
"disableAutoFocusFirst": {
|
|
224473
|
+
"defaultValue": {
|
|
224474
|
+
"value": "false"
|
|
224475
|
+
},
|
|
224476
|
+
"description": "Whether or not to focus the first item in the collection after a filter is performed. Note this is only applicable\nif virtual focus behavior is not turned off via `disableVirtualFocus`.",
|
|
224477
|
+
"name": "disableAutoFocusFirst",
|
|
224478
|
+
"parent": {
|
|
224479
|
+
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-rc.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
224480
|
+
"name": "AriaAutocompleteProps"
|
|
224481
|
+
},
|
|
224482
|
+
"declarations": [
|
|
224483
|
+
{
|
|
224484
|
+
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-rc.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
224485
|
+
"name": "AriaAutocompleteProps"
|
|
224486
|
+
}
|
|
224487
|
+
],
|
|
224488
|
+
"required": false,
|
|
224489
|
+
"type": {
|
|
224490
|
+
"name": "boolean"
|
|
224491
|
+
}
|
|
224492
|
+
},
|
|
224493
|
+
"disableVirtualFocus": {
|
|
224494
|
+
"defaultValue": {
|
|
224495
|
+
"value": "false"
|
|
224496
|
+
},
|
|
224497
|
+
"description": "Whether the autocomplete should disable virtual focus, instead making the wrapped collection directly tabbable.",
|
|
224498
|
+
"name": "disableVirtualFocus",
|
|
224499
|
+
"parent": {
|
|
224500
|
+
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-rc.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
224501
|
+
"name": "AriaAutocompleteProps"
|
|
224502
|
+
},
|
|
224503
|
+
"declarations": [
|
|
224504
|
+
{
|
|
224505
|
+
"fileName": "flow/node_modules/.pnpm/@react-aria+autocomplete@3.0.0-rc.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@react-aria/autocomplete/dist/types.d.ts",
|
|
224506
|
+
"name": "AriaAutocompleteProps"
|
|
224507
|
+
}
|
|
224508
|
+
],
|
|
224509
|
+
"required": false,
|
|
224510
|
+
"type": {
|
|
224511
|
+
"name": "boolean"
|
|
224512
|
+
}
|
|
224589
224513
|
}
|
|
224590
224514
|
}
|
|
224591
224515
|
},
|
|
@@ -15,11 +15,11 @@ import { Text } from '../Text/Text.mjs';
|
|
|
15
15
|
import styles from './Autocomplete.module.scss.mjs';
|
|
16
16
|
import { useObjectRef, useLocalizedStringFormatter, useFocusWithin, UNSAFE_PortalProvider } from 'react-aria';
|
|
17
17
|
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
18
|
-
import { useControlledHostValueProps } from '../../lib/remote/useControlledHostValueProps.mjs';
|
|
19
18
|
import { isFocused } from '../../lib/form/isFocused.mjs';
|
|
19
|
+
import { emitElementValueChange } from '../../lib/react/emitElementValueChange.mjs';
|
|
20
20
|
|
|
21
21
|
const Autocomplete = flowComponent("Autocomplete", (props) => {
|
|
22
|
-
const { children,
|
|
22
|
+
const { children, ref, ...rest } = props;
|
|
23
23
|
const inputRef = useObjectRef(ref);
|
|
24
24
|
const { contains } = Aria.useFilter({ sensitivity: "base" });
|
|
25
25
|
const stringFormatter = useLocalizedStringFormatter(locales);
|
|
@@ -31,17 +31,18 @@ const Autocomplete = flowComponent("Autocomplete", (props) => {
|
|
|
31
31
|
onBlurWithin: optionsOverlayController.close
|
|
32
32
|
});
|
|
33
33
|
const renderEmptyState = () => /* @__PURE__ */ jsx(Text, { className: styles.empty, children: stringFormatter.format("autocomplete.empty") });
|
|
34
|
-
const handleInputChange = (
|
|
35
|
-
if (
|
|
34
|
+
const handleInputChange = (value) => {
|
|
35
|
+
if (value === "") {
|
|
36
36
|
optionsOverlayController.close();
|
|
37
37
|
} else if (isFocused(inputRef.current)) {
|
|
38
38
|
optionsOverlayController.open();
|
|
39
39
|
}
|
|
40
|
-
onChange?.(value2);
|
|
41
40
|
};
|
|
42
41
|
const handleOptionAction = (key) => {
|
|
43
|
-
const
|
|
44
|
-
|
|
42
|
+
const value = String(key);
|
|
43
|
+
if (inputRef.current) {
|
|
44
|
+
emitElementValueChange(inputRef.current, value);
|
|
45
|
+
}
|
|
45
46
|
optionsOverlayController.close();
|
|
46
47
|
};
|
|
47
48
|
const inputProps = {
|
|
@@ -50,11 +51,8 @@ const Autocomplete = flowComponent("Autocomplete", (props) => {
|
|
|
50
51
|
e.preventDefault();
|
|
51
52
|
}
|
|
52
53
|
},
|
|
53
|
-
isInvalid,
|
|
54
54
|
ref: inputRef,
|
|
55
|
-
onChange: handleInputChange
|
|
56
|
-
value,
|
|
57
|
-
defaultValue
|
|
55
|
+
onChange: handleInputChange
|
|
58
56
|
};
|
|
59
57
|
const {
|
|
60
58
|
FieldErrorView,
|
|
@@ -78,13 +76,7 @@ const Autocomplete = flowComponent("Autocomplete", (props) => {
|
|
|
78
76
|
PropsContextProvider,
|
|
79
77
|
{
|
|
80
78
|
props: propsContext,
|
|
81
|
-
dependencies: [
|
|
82
|
-
value,
|
|
83
|
-
isInvalid,
|
|
84
|
-
defaultValue,
|
|
85
|
-
optionsOverlayController,
|
|
86
|
-
onChange
|
|
87
|
-
],
|
|
79
|
+
dependencies: [optionsOverlayController],
|
|
88
80
|
children: /* @__PURE__ */ jsx("div", { ...focusWithin.focusWithinProps, ref: container, children: /* @__PURE__ */ jsx(UNSAFE_PortalProvider, { getContainer: () => container.current, children: /* @__PURE__ */ jsxs(
|
|
89
81
|
Aria.Autocomplete,
|
|
90
82
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.mjs","sources":["../../../../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import { useRef, type PropsWithChildren } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { SearchFieldProps } from \"@/components/SearchField\";\nimport type { TextFieldProps } from \"@/components/TextField\";\nimport Options from \"@/components/Options\";\nimport { TunnelExit } from \"@mittwald/react-tunnel\";\nimport locales from \"./locales/*.locale.json\";\nimport Text from \"@/components/Text\";\nimport styles from \"./Autocomplete.module.scss\";\nimport {\n UNSAFE_PortalProvider,\n useFocusWithin,\n useLocalizedStringFormatter,\n useObjectRef,\n} from \"react-aria\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport {
|
|
1
|
+
{"version":3,"file":"Autocomplete.mjs","sources":["../../../../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import { useRef, type PropsWithChildren } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport type { SearchFieldProps } from \"@/components/SearchField\";\nimport type { TextFieldProps } from \"@/components/TextField\";\nimport Options from \"@/components/Options\";\nimport { TunnelExit } from \"@mittwald/react-tunnel\";\nimport locales from \"./locales/*.locale.json\";\nimport Text from \"@/components/Text\";\nimport styles from \"./Autocomplete.module.scss\";\nimport {\n UNSAFE_PortalProvider,\n useFocusWithin,\n useLocalizedStringFormatter,\n useObjectRef,\n} from \"react-aria\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { isFocused } from \"@/lib/form/isFocused\";\nimport { emitElementValueChange } from \"@/lib/react/emitElementValueChange\";\n\nexport interface AutocompleteProps\n extends PropsWithChildren,\n PropsWithClassName,\n FlowComponentProps<HTMLInputElement>,\n Omit<\n Aria.AutocompleteProps,\n \"children\" | \"onInputChange\" | \"inputValue\" | \"defaultInputValue\" | \"ref\"\n > {}\n\n/** @flr-generate all */\nexport const Autocomplete = flowComponent(\"Autocomplete\", (props) => {\n const { children, ref, ...rest } = props;\n\n const inputRef = useObjectRef(ref);\n\n const { contains } = Aria.useFilter({ sensitivity: \"base\" });\n const stringFormatter = useLocalizedStringFormatter(locales);\n const container = useRef(null);\n\n const optionsOverlayController = useOverlayController(\"Popover\", {\n reuseControllerFromContext: false,\n });\n\n const focusWithin = useFocusWithin({\n onBlurWithin: optionsOverlayController.close,\n });\n\n const renderEmptyState = () => (\n <Text className={styles.empty}>\n {stringFormatter.format(\"autocomplete.empty\")}\n </Text>\n );\n\n const handleInputChange = (value: string) => {\n if (value === \"\") {\n optionsOverlayController.close();\n } else if (isFocused(inputRef.current)) {\n optionsOverlayController.open();\n }\n };\n\n const handleOptionAction = (key: Aria.Key) => {\n const value = String(key);\n if (inputRef.current) {\n emitElementValueChange(inputRef.current, value);\n }\n optionsOverlayController.close();\n };\n\n const inputProps: SearchFieldProps & TextFieldProps = {\n onKeyDown: (e) => {\n if (e.key === \"Enter\" && optionsOverlayController.isOpen) {\n e.preventDefault();\n }\n },\n ref: inputRef,\n onChange: handleInputChange,\n };\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props);\n\n const propsContext: PropsContext = {\n SearchField: inputProps,\n TextField: inputProps,\n Option: {\n tunnelId: \"options\",\n },\n Popover: {\n className: styles.popover,\n },\n ...fieldPropsContext,\n };\n\n return (\n <div {...fieldProps}>\n <FieldErrorCaptureContext>\n <PropsContextProvider\n props={propsContext}\n dependencies={[optionsOverlayController]}\n >\n <div {...focusWithin.focusWithinProps} ref={container}>\n <UNSAFE_PortalProvider getContainer={() => container.current}>\n <Aria.Autocomplete\n filter={contains}\n disableAutoFocusFirst\n {...rest}\n >\n {children}\n <Options\n onAction={handleOptionAction}\n triggerRef={inputRef}\n controller={optionsOverlayController}\n renderEmptyState={renderEmptyState}\n isNonModal\n placement=\"bottom start\"\n >\n <TunnelExit id=\"options\" />\n </Options>\n </Aria.Autocomplete>\n </UNSAFE_PortalProvider>\n </div>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </div>\n );\n});\n\nexport default Autocomplete;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAoCO,MAAM,YAAA,GAAe,aAAA,CAAc,cAAA,EAAgB,CAAC,KAAA,KAAU;AACnE,EAAA,MAAM,EAAE,QAAA,EAAU,GAAA,EAAK,GAAG,MAAK,GAAI,KAAA;AAEnC,EAAA,MAAM,QAAA,GAAW,aAAa,GAAG,CAAA;AAEjC,EAAA,MAAM,EAAE,UAAS,GAAI,IAAA,CAAK,UAAU,EAAE,WAAA,EAAa,QAAQ,CAAA;AAC3D,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAC3D,EAAA,MAAM,SAAA,GAAY,OAAO,IAAI,CAAA;AAE7B,EAAA,MAAM,wBAAA,GAA2B,qBAAqB,SAAA,EAAW;AAAA,IAC/D,0BAAA,EAA4B;AAAA,GAC7B,CAAA;AAED,EAAA,MAAM,cAAc,cAAA,CAAe;AAAA,IACjC,cAAc,wBAAA,CAAyB;AAAA,GACxC,CAAA;AAED,EAAA,MAAM,gBAAA,GAAmB,sBACvB,GAAA,CAAC,IAA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Validation } from '@react-aria/form';
|
|
5
5
|
import { useFormValidationState } from '@react-stately/form';
|
|
6
|
-
import {
|
|
6
|
+
import { FieldErrorContext } from 'react-aria-components';
|
|
7
7
|
import { FileInput } from './components/FileInput.mjs';
|
|
8
8
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
9
9
|
import '../../lib/propsContext/propsContext.mjs';
|
|
@@ -49,33 +49,28 @@ const FileField = flowComponent("FileField", (props) => {
|
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
return /* @__PURE__ */ jsx("div", { ...fieldProps, children: /* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
return /* @__PURE__ */ jsx("div", { ...fieldProps, children: /* @__PURE__ */ jsxs(FieldErrorContext.Provider, { value: formValidationState.displayValidation, children: [
|
|
53
|
+
/* @__PURE__ */ jsx(FieldErrorCaptureContext, { children: /* @__PURE__ */ jsx(PropsContextProvider, { props: fieldPropsContext, children: /* @__PURE__ */ jsx(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
"data-readonly": isReadOnly,
|
|
57
|
+
"data-required": !!isRequired || void 0,
|
|
58
|
+
"data-invalid": formValidationState.displayValidation.isInvalid || void 0,
|
|
59
|
+
children: /* @__PURE__ */ jsx(
|
|
60
|
+
FileInput,
|
|
59
61
|
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
ref: inputRef,
|
|
67
|
-
isReadOnly,
|
|
68
|
-
onChange: isReadOnly ? void 0 : handleChange,
|
|
69
|
-
isDisabled,
|
|
70
|
-
children
|
|
71
|
-
}
|
|
72
|
-
)
|
|
62
|
+
ref: inputRef,
|
|
63
|
+
isReadOnly,
|
|
64
|
+
onChange: isReadOnly ? void 0 : handleChange,
|
|
65
|
+
isDisabled,
|
|
66
|
+
...inputProps,
|
|
67
|
+
children
|
|
73
68
|
}
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
) }) }),
|
|
72
|
+
/* @__PURE__ */ jsx(FieldErrorView, {})
|
|
73
|
+
] }) });
|
|
79
74
|
});
|
|
80
75
|
|
|
81
76
|
export { FileField, FileField as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileField.mjs","sources":["../../../../../../src/components/FileField/FileField.tsx"],"sourcesContent":["import { useFormValidation } from \"@react-aria/form\";\nimport { useFormValidationState } from \"@react-stately/form\";\nimport type { PropsWithChildren } from \"react\";\nimport type * as Aria from \"react-aria-components\";\nimport { FieldErrorContext
|
|
1
|
+
{"version":3,"file":"FileField.mjs","sources":["../../../../../../src/components/FileField/FileField.tsx"],"sourcesContent":["import { useFormValidation } from \"@react-aria/form\";\nimport { useFormValidationState } from \"@react-stately/form\";\nimport type { PropsWithChildren } from \"react\";\nimport type * as Aria from \"react-aria-components\";\nimport { FieldErrorContext } from \"react-aria-components\";\nimport type { FileInputOnChangeHandler } from \"@/components/FileField/components/FileInput\";\nimport { FileInput } from \"@/components/FileField/components/FileInput\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { addAwaitedArrayBuffer } from \"@mittwald/flow-core\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\n\nexport interface FileFieldProps\n extends PropsWithChildren,\n FlowComponentProps<HTMLInputElement>,\n Pick<Aria.InputProps, \"accept\" | \"multiple\" | \"name\">,\n Pick<\n Aria.TextFieldProps,\n \"isRequired\" | \"isInvalid\" | \"validationBehavior\" | \"isDisabled\"\n > {\n /** Handler that is called when the file input changes. */\n onChange?: FileInputOnChangeHandler;\n /** Whether the component is read only. */\n isReadOnly?: boolean;\n}\n\n/** @flr-generate all */\nexport const FileField = flowComponent(\"FileField\", (props) => {\n const {\n children,\n ref,\n isRequired,\n isInvalid,\n isDisabled,\n validationBehavior,\n onChange,\n isReadOnly,\n ...restInputProps\n } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props);\n\n const inputRef = useObjectRef(ref);\n\n const formValidationState = useFormValidationState({\n value: undefined,\n validationBehavior,\n isInvalid,\n });\n\n useFormValidation({ validationBehavior }, formValidationState, inputRef);\n\n const inputProps = {\n ...restInputProps,\n \"aria-invalid\": formValidationState.displayValidation.isInvalid,\n value: undefined,\n };\n\n const handleChange: FileInputOnChangeHandler = (fileList) => {\n if (fileList && onChange) {\n Promise.all(Array.from(fileList).map(addAwaitedArrayBuffer)).then(() =>\n onChange(fileList),\n );\n }\n };\n\n return (\n <div {...fieldProps}>\n <FieldErrorContext.Provider value={formValidationState.displayValidation}>\n <FieldErrorCaptureContext>\n <PropsContextProvider props={fieldPropsContext}>\n <div\n data-readonly={isReadOnly}\n data-required={!!isRequired || undefined}\n data-invalid={\n formValidationState.displayValidation.isInvalid || undefined\n }\n >\n <FileInput\n ref={inputRef}\n isReadOnly={isReadOnly}\n onChange={isReadOnly ? undefined : handleChange}\n isDisabled={isDisabled}\n {...inputProps}\n >\n {children}\n </FileInput>\n </div>\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </FieldErrorContext.Provider>\n </div>\n );\n});\nexport default FileField;\n"],"names":[],"mappings":";;;;;;;;;;;;AA6BO,MAAM,SAAA,GAAY,aAAA,CAAc,WAAA,EAAa,CAAC,KAAA,KAAU;AAC7D,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,GAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,kBAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,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AAAA,QAC/B,cAAA,EACE,mBAAA,CAAoB,iBAAA,CAAkB,SAAA,IAAa,MAAA;AAAA,QAGrD,QAAA,kBAAA,GAAA;AAAA,UAAC,SAAA;AAAA,UAAA;AAAA,YACC,GAAA,EAAK,QAAA;AAAA,YACL,UAAA;AAAA,YACA,QAAA,EAAU,aAAa,MAAA,GAAY,YAAA;AAAA,YACnC,UAAA;AAAA,YACC,GAAG,UAAA;AAAA,YAEH;AAAA;AAAA;AACH;AAAA,OAEJ,CAAA,EACF,CAAA;AAAA,wBACC,cAAA,EAAA,EAAe;AAAA,GAAA,EAClB,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -9,7 +9,7 @@ import { PropsContextProvider } from '../../../lib/propsContext/components/Props
|
|
|
9
9
|
import styles from './FileInput.module.scss.mjs';
|
|
10
10
|
|
|
11
11
|
const FileInput = (props) => {
|
|
12
|
-
const { children, isDisabled, onChange, isReadOnly, ref } = props;
|
|
12
|
+
const { children, isDisabled, onChange, isReadOnly, ref, ...restInputProps } = props;
|
|
13
13
|
const inputRef = useObjectRef(ref);
|
|
14
14
|
const handlePress = () => {
|
|
15
15
|
if (inputRef.current?.value) {
|
|
@@ -34,6 +34,7 @@ const FileInput = (props) => {
|
|
|
34
34
|
/* @__PURE__ */ jsx(
|
|
35
35
|
Aria.Input,
|
|
36
36
|
{
|
|
37
|
+
...restInputProps,
|
|
37
38
|
className: styles.FileInput,
|
|
38
39
|
type: "file",
|
|
39
40
|
ref: inputRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.mjs","sources":["../../../../../../../src/components/FileField/components/FileInput.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref } from \"react\";\nimport { type ChangeEvent } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport styles from \"./FileInput.module.scss\";\n\nexport type FileInputOnChangeHandler = (files: FileList | null) => void;\n\n/** @internal */\nexport interface FileInputProps extends PropsWithChildren {\n onChange?: FileInputOnChangeHandler;\n isDisabled?: boolean;\n ref?: Ref<HTMLInputElement>;\n isReadOnly?: boolean;\n}\n\n/** @internal */\nexport const FileInput: FC<FileInputProps> = (props) => {\n const { children, isDisabled, onChange, isReadOnly, ref }
|
|
1
|
+
{"version":3,"file":"FileInput.mjs","sources":["../../../../../../../src/components/FileField/components/FileInput.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref } from \"react\";\nimport { type ChangeEvent } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport styles from \"./FileInput.module.scss\";\n\nexport type FileInputOnChangeHandler = (files: FileList | null) => void;\n\n/** @internal */\nexport interface FileInputProps extends PropsWithChildren {\n onChange?: FileInputOnChangeHandler;\n isDisabled?: boolean;\n ref?: Ref<HTMLInputElement>;\n isReadOnly?: boolean;\n}\n\n/** @internal */\nexport const FileInput: FC<FileInputProps> = (props) => {\n const { children, isDisabled, onChange, isReadOnly, ref, ...restInputProps } =\n props;\n const inputRef = useObjectRef(ref);\n\n const handlePress = () => {\n if (inputRef.current?.value) {\n inputRef.current.value = \"\";\n onChange?.(null);\n }\n inputRef.current?.click();\n };\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n onChange?.(event.target.files);\n };\n\n const propsContext: PropsContext = {\n Button: {\n onPress: handlePress,\n className: styles.trigger,\n isDisabled,\n isReadOnly,\n },\n };\n\n return (\n <PropsContextProvider props={propsContext}>\n {children}\n <Aria.Input\n {...restInputProps}\n className={styles.FileInput}\n type=\"file\"\n ref={inputRef}\n onChange={handleChange}\n />\n </PropsContextProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAmBO,MAAM,SAAA,GAAgC,CAAC,KAAA,KAAU;AACtD,EAAA,MAAM,EAAE,UAAU,UAAA,EAAY,QAAA,EAAU,YAAY,GAAA,EAAK,GAAG,gBAAe,GACzE,KAAA;AACF,EAAA,MAAM,QAAA,GAAW,aAAa,GAAG,CAAA;AAEjC,EAAA,MAAM,cAAc,MAAM;AACxB,IAAA,IAAI,QAAA,CAAS,SAAS,KAAA,EAAO;AAC3B,MAAA,QAAA,CAAS,QAAQ,KAAA,GAAQ,EAAA;AACzB,MAAA,QAAA,GAAW,IAAI,CAAA;AAAA,IACjB;AACA,IAAA,QAAA,CAAS,SAAS,KAAA,EAAM;AAAA,EAC1B,CAAA;AAEA,EAAA,MAAM,YAAA,GAAe,CAAC,KAAA,KAAyC;AAC7D,IAAA,QAAA,GAAW,KAAA,CAAM,OAAO,KAAK,CAAA;AAAA,EAC/B,CAAA;AAEA,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,MAAA,EAAQ;AAAA,MACN,OAAA,EAAS,WAAA;AAAA,MACT,WAAW,MAAA,CAAO,OAAA;AAAA,MAClB,UAAA;AAAA,MACA;AAAA;AACF,GACF;AAEA,EAAA,uBACE,IAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,YAAA,EAC1B,QAAA,EAAA;AAAA,IAAA,QAAA;AAAA,oBACD,GAAA;AAAA,MAAC,IAAA,CAAK,KAAA;AAAA,MAAL;AAAA,QACE,GAAG,cAAA;AAAA,QACJ,WAAW,MAAA,CAAO,SAAA;AAAA,QAClB,IAAA,EAAK,MAAA;AAAA,QACL,GAAA,EAAK,QAAA;AAAA,QACL,QAAA,EAAU;AAAA;AAAA;AACZ,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import { useFormContext } from \"@/integrations/react-hook-form/components/context/formContext\";\nimport { dynamic, type PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { type PropsWithChildren } from \"react\";\nimport {\n type ControllerProps,\n type FieldValues,\n useController,\n type UseFormReturn,\n useWatch,\n} from \"react-hook-form\";\nimport { useHotkeys } from \"react-hotkeys-hook\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\nimport { mergeRefs } from \"@react-aria/utils\";\n\nexport interface FieldProps<T extends FieldValues>\n extends Omit<ControllerProps<T>, \"render\">,\n PropsWithChildren {}\n\nexport function Field<T extends FieldValues>(props: FieldProps<T>) {\n const { children, name, defaultValue, ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const controller = useController({\n ...props,\n rules: {\n ...props.rules,\n minLength:\n typeof rest.rules?.minLength === \"number\"\n ? {\n value: rest.rules.minLength,\n message: stringFormatter.format(\"minLength\", {\n number: rest.rules.minLength,\n }),\n }\n : rest.rules?.minLength,\n maxLength:\n typeof rest.rules?.maxLength === \"number\"\n ? {\n value: rest.rules.maxLength,\n message: stringFormatter.format(\"maxLength\", {\n number: rest.rules.maxLength,\n }),\n }\n : rest.rules?.maxLength,\n },\n });\n const formContext = useFormContext<T>();\n /**\n * We don't use controller.field.value here, because it doesn't update when\n * the form value is updated outside of this field (e.g. when setting values\n * with form.setValue or resetting the form), and the Field unmounts in\n * between. This is generally a feature of React Hook Form, but this breaks\n * dynamic forms where fields are conditionally rendered.\n *\n * By using formContext.form.watch(name), we ensure that the field value is\n * always in sync with the form state. See:\n * https://react-hook-form.com/api/usecontroller/controller/\n */\n const value =\n useWatch({\n control: formContext.form.control,\n name,\n }) ?? controller.field.value;\n\n const isFieldInvalid = controller.fieldState.invalid;\n\n const hotkeyRef = useHotkeys<never>(\n \"mod+enter\",\n () => {\n formContext.submit();\n },\n {\n enableOnFormTags: true,\n enableOnContentEditable: true,\n },\n );\n\n const refWithHotkey = mergeRefs(controller.field.ref, hotkeyRef);\n\n const fieldProps = {\n ...controller.field,\n ref: refWithHotkey,\n value,\n name,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n isReadOnly: formContext.isReadOnly,\n validationBehavior: \"aria\" as const,\n defaultValue,\n isInvalid: isFieldInvalid,\n children: dynamic((p) => {\n return (\n <>\n {p.children}\n <FieldErrorView>\n {controller.fieldState.error?.message}\n </FieldErrorView>\n </>\n );\n }),\n };\n\n const propsContext: PropsContext = {\n Autocomplete: fieldProps,\n SearchField: fieldProps,\n TextField: fieldProps,\n TextArea: fieldProps,\n MarkdownEditor: fieldProps,\n Checkbox: {\n ...fieldProps,\n isSelected: value,\n },\n CheckboxGroup: {\n ...fieldProps,\n },\n CheckboxButton: {\n ...fieldProps,\n isSelected: value,\n },\n FileField: fieldProps,\n FileDropZone: fieldProps,\n NumberField: fieldProps,\n RadioGroup: fieldProps,\n Switch: {\n ...fieldProps,\n isSelected: value,\n },\n Slider: fieldProps,\n PasswordCreationField: fieldProps,\n DatePicker: fieldProps,\n DateRangePicker: fieldProps,\n TimeField: fieldProps,\n SegmentedControl: fieldProps,\n Select: {\n ...fieldProps,\n selectedKey: value,\n },\n ComboBox: {\n ...fieldProps,\n selectedKey: value,\n },\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[\n controller.fieldState,\n controller.field,\n value,\n formContext.isReadOnly,\n ]}\n >\n {children}\n </PropsContextProvider>\n );\n}\n\nexport const typedField = <T extends FieldValues>(\n ignoredForm: UseFormReturn<T> | UseFormReturn<T>[\"control\"],\n): typeof Field<T> => Field;\n\nexport default Field;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAqBO,SAAS,MAA6B,KAAA,EAAsB;AACjE,EAAA,MAAM,EAAE,QAAA,EAAU,IAAA,EAAM,YAAA,EAAc,GAAG,MAAK,GAAI,KAAA;AAElD,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAAA,MAAM,aAAa,aAAA,CAAc;AAAA,IAC/B,GAAG,KAAA;AAAA,IACH,KA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,GAAA,EAAK,aAAA;AAAA,IACL,KAAA;AAAA,IACA,IAAA;AAAA,IACA,MAAM,WAAA,CAAY,EAAA;AAAA,IAClB,UAAA,EAAY,CAAC,CAAC,IAAA,CAAK,KAAA,EAAO,QAAA;AAAA,IAC1B,YAAY,WAAA,CAAY,UAAA;AAAA,IACxB,kBAAA,EAAoB,MAAA;AAAA,IACpB,YAAA;AAAA,IACA,SAAA,EAAW,cAAA;AAAA,IACX,QAAA,EAAU,OAAA,CAAQ,CAAC,CAAA,KAAM;AACvB,MAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,QAAA,CAAA,CAAE,QAAA;AAAA,wBACH,GAAA,CAAC,cAAA,EAAA,EACE,QAAA,EAAA,UAAA,CAAW,UAAA,CAAW,OAAO,OAAA,EAChC;AAAA,OAAA,EACF,CAAA;AAAA,IAEJ,CAAC;AAAA,GACH;AAEA,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,YAAA,EAAc,UAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"Field.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import { useFormContext } from \"@/integrations/react-hook-form/components/context/formContext\";\nimport { dynamic, type PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { type PropsWithChildren } from \"react\";\nimport {\n type ControllerProps,\n type FieldValues,\n useController,\n type UseFormReturn,\n useWatch,\n} from \"react-hook-form\";\nimport { useHotkeys } from \"react-hotkeys-hook\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\nimport { mergeRefs } from \"@react-aria/utils\";\n\nexport interface FieldProps<T extends FieldValues>\n extends Omit<ControllerProps<T>, \"render\">,\n PropsWithChildren {}\n\nexport function Field<T extends FieldValues>(props: FieldProps<T>) {\n const { children, name, defaultValue, ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const controller = useController({\n ...props,\n rules: {\n ...props.rules,\n minLength:\n typeof rest.rules?.minLength === \"number\"\n ? {\n value: rest.rules.minLength,\n message: stringFormatter.format(\"minLength\", {\n number: rest.rules.minLength,\n }),\n }\n : rest.rules?.minLength,\n maxLength:\n typeof rest.rules?.maxLength === \"number\"\n ? {\n value: rest.rules.maxLength,\n message: stringFormatter.format(\"maxLength\", {\n number: rest.rules.maxLength,\n }),\n }\n : rest.rules?.maxLength,\n },\n });\n const formContext = useFormContext<T>();\n /**\n * We don't use controller.field.value here, because it doesn't update when\n * the form value is updated outside of this field (e.g. when setting values\n * with form.setValue or resetting the form), and the Field unmounts in\n * between. This is generally a feature of React Hook Form, but this breaks\n * dynamic forms where fields are conditionally rendered.\n *\n * By using formContext.form.watch(name), we ensure that the field value is\n * always in sync with the form state. See:\n * https://react-hook-form.com/api/usecontroller/controller/\n */\n const value =\n useWatch({\n control: formContext.form.control,\n name,\n }) ?? controller.field.value;\n\n const isFieldInvalid = controller.fieldState.invalid;\n\n const hotkeyRef = useHotkeys<never>(\n \"mod+enter\",\n () => {\n formContext.submit();\n },\n {\n enableOnFormTags: true,\n enableOnContentEditable: true,\n },\n );\n\n const refWithHotkey = mergeRefs(controller.field.ref, hotkeyRef);\n\n const fieldProps = {\n ...controller.field,\n ref: refWithHotkey,\n value,\n name,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n isReadOnly: formContext.isReadOnly,\n validationBehavior: \"aria\" as const,\n defaultValue,\n isInvalid: isFieldInvalid,\n children: dynamic((p) => {\n return (\n <>\n {p.children}\n <FieldErrorView>\n {controller.fieldState.error?.message}\n </FieldErrorView>\n </>\n );\n }),\n };\n\n const propsContext: PropsContext = {\n Autocomplete: {\n SearchField: fieldProps,\n TextField: fieldProps,\n },\n SearchField: fieldProps,\n TextField: fieldProps,\n TextArea: fieldProps,\n MarkdownEditor: fieldProps,\n Checkbox: {\n ...fieldProps,\n isSelected: value,\n },\n CheckboxGroup: {\n ...fieldProps,\n },\n CheckboxButton: {\n ...fieldProps,\n isSelected: value,\n },\n FileField: fieldProps,\n FileDropZone: fieldProps,\n NumberField: fieldProps,\n RadioGroup: fieldProps,\n Switch: {\n ...fieldProps,\n isSelected: value,\n },\n Slider: fieldProps,\n PasswordCreationField: fieldProps,\n DatePicker: fieldProps,\n DateRangePicker: fieldProps,\n TimeField: fieldProps,\n SegmentedControl: fieldProps,\n Select: {\n ...fieldProps,\n selectedKey: value,\n },\n ComboBox: {\n ...fieldProps,\n selectedKey: value,\n },\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[\n controller.fieldState,\n controller.field,\n value,\n formContext.isReadOnly,\n ]}\n >\n {children}\n </PropsContextProvider>\n );\n}\n\nexport const typedField = <T extends FieldValues>(\n ignoredForm: UseFormReturn<T> | UseFormReturn<T>[\"control\"],\n): typeof Field<T> => Field;\n\nexport default Field;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAqBO,SAAS,MAA6B,KAAA,EAAsB;AACjE,EAAA,MAAM,EAAE,QAAA,EAAU,IAAA,EAAM,YAAA,EAAc,GAAG,MAAK,GAAI,KAAA;AAElD,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAAA,MAAM,aAAa,aAAA,CAAc;AAAA,IAC/B,GAAG,KAAA;AAAA,IACH,KAAA,EAAO;AAAA,MACL,GAAG,KAAA,CAAM,KAAA;AAAA,MACT,SAAA,EACE,OAAO,IAAA,CAAK,KAAA,EAAO,cAAc,QAAA,GAC7B;AAAA,QACE,KAAA,EAAO,KAAK,KAAA,CAAM,SAAA;AAAA,QAClB,OAAA,EAAS,eAAA,CAAgB,MAAA,CAAO,WAAA,EAAa;AAAA,UAC3C,MAAA,EAAQ,KAAK,KAAA,CAAM;AAAA,SACpB;AAAA,OACH,GACA,KAAK,KAAA,EAAO,SAAA;AAAA,MAClB,SAAA,EACE,OAAO,IAAA,CAAK,KAAA,EAAO,cAAc,QAAA,GAC7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,KAAA,EAAO,YAAA;AAAA,MACP,YAAA,EAAc;AAAA,QACZ,UAAA,CAAW,UAAA;AAAA,QACX,UAAA,CAAW,KAAA;AAAA,QACX,KAAA;AAAA,QACA,WAAA,CAAY;AAAA,OACd;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;AAEO,MAAM,UAAA,GAAa,CACxB,WAAA,KACoB;;;;"}
|
|
@@ -15,7 +15,7 @@ import '../viewComponentContext/viewComponentContext.mjs';
|
|
|
15
15
|
|
|
16
16
|
const merger = getPropsMerger({
|
|
17
17
|
mergeClassNames: false,
|
|
18
|
-
mergeEventHandler:
|
|
18
|
+
mergeEventHandler: true
|
|
19
19
|
});
|
|
20
20
|
const mergePropsContext = (firstContext = {}, secondContext = {}) => {
|
|
21
21
|
const mergedComponentNames = Object.keys({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergePropsContext.mjs","sources":["../../../../../../src/lib/propsContext/mergePropsContext.ts"],"sourcesContent":["import { isFlowComponentName } from \"@/index/internal\";\nimport type { PropsContext, WorkaroundType } from \"@/lib/propsContext/types\";\nimport { getPropsMerger } from \"@/lib/react/getPropsMerger\";\n\nconst merger = getPropsMerger({\n mergeClassNames: false,\n mergeEventHandler:
|
|
1
|
+
{"version":3,"file":"mergePropsContext.mjs","sources":["../../../../../../src/lib/propsContext/mergePropsContext.ts"],"sourcesContent":["import { isFlowComponentName } from \"@/index/internal\";\nimport type { PropsContext, WorkaroundType } from \"@/lib/propsContext/types\";\nimport { getPropsMerger } from \"@/lib/react/getPropsMerger\";\n\nconst merger = getPropsMerger({\n mergeClassNames: false,\n mergeEventHandler: true,\n});\n\nexport const mergePropsContext = (\n firstContext: PropsContext = {},\n secondContext: PropsContext = {},\n): PropsContext => {\n const mergedComponentNames = Object.keys({\n ...firstContext,\n ...secondContext,\n }).filter(isFlowComponentName);\n\n return Object.fromEntries(\n mergedComponentNames.map((componentName) => [\n componentName,\n merger<WorkaroundType>(\n firstContext[componentName],\n secondContext[componentName],\n ),\n ]),\n );\n};\n\nexport default mergePropsContext;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAIA,MAAM,SAAS,cAAA,CAAe;AAAA,EAC5B,eAAA,EAAiB,KAAA;AAAA,EACjB,iBAAA,EAAmB;AACrB,CAAC,CAAA;AAEM,MAAM,oBAAoB,CAC/B,YAAA,GAA6B,EAAC,EAC9B,aAAA,GAA8B,EAAC,KACd;AACjB,EAAA,MAAM,oBAAA,GAAuB,OAAO,IAAA,CAAK;AAAA,IACvC,GAAG,YAAA;AAAA,IACH,GAAG;AAAA,GACJ,CAAA,CAAE,MAAA,CAAO,mBAAmB,CAAA;AAE7B,EAAA,OAAO,MAAA,CAAO,WAAA;AAAA,IACZ,oBAAA,CAAqB,GAAA,CAAI,CAAC,aAAA,KAAkB;AAAA,MAC1C,aAAA;AAAA,MACA,MAAA;AAAA,QACE,aAAa,aAAa,CAAA;AAAA,QAC1B,cAAc,aAAa;AAAA;AAC7B,KACD;AAAA,GACH;AACF;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
const emitElementValueChange = (element, value) => {
|
|
4
|
+
const event = new Event("change", { bubbles: true });
|
|
5
|
+
try {
|
|
6
|
+
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
|
|
7
|
+
Object.getPrototypeOf(element),
|
|
8
|
+
"value"
|
|
9
|
+
)?.set;
|
|
10
|
+
nativeInputValueSetter?.call(element, value);
|
|
11
|
+
element.dispatchEvent(event);
|
|
12
|
+
} catch (ignoredError) {
|
|
13
|
+
if ("value" in element) {
|
|
14
|
+
element.value = value;
|
|
15
|
+
element.dispatchEvent(event);
|
|
16
|
+
} else {
|
|
17
|
+
throw Error("could not emit value update for element");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { emitElementValueChange };
|
|
23
|
+
//# sourceMappingURL=emitElementValueChange.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emitElementValueChange.mjs","sources":["../../../../../../src/lib/react/emitElementValueChange.ts"],"sourcesContent":["/**\n * Triggers a Value Update for an Element that also fires the React onChange\n * routine\n */\nexport const emitElementValueChange = (\n element: HTMLElement,\n value: unknown,\n) => {\n const event = new Event(\"change\", { bubbles: true });\n\n try {\n const nativeInputValueSetter = Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(element),\n \"value\",\n )?.set;\n nativeInputValueSetter?.call(element, value);\n element.dispatchEvent(event);\n } catch (ignoredError) {\n if (\"value\" in element) {\n element.value = value;\n element.dispatchEvent(event);\n } else {\n throw Error(\"could not emit value update for element\");\n }\n }\n};\n"],"names":[],"mappings":"AAIO,MAAM,sBAAA,GAAyB,CACpC,OAAA,EACA,KAAA,KACG;AACH,EAAA,MAAM,QAAQ,IAAI,KAAA,CAAM,UAAU,EAAE,OAAA,EAAS,MAAM,CAAA;AAEnD,EAAA,IAAI;AACF,IAAA,MAAM,yBAAyB,MAAA,CAAO,wBAAA;AAAA,MACpC,MAAA,CAAO,eAAe,OAAO,CAAA;AAAA,MAC7B;AAAA,KACF,EAAG,GAAA;AACH,IAAA,sBAAA,EAAwB,IAAA,CAAK,SAAS,KAAK,CAAA;AAC3C,IAAA,OAAA,CAAQ,cAAc,KAAK,CAAA;AAAA,EAC7B,SAAS,YAAA,EAAc;AACrB,IAAA,IAAI,WAAW,OAAA,EAAS;AACtB,MAAA,OAAA,CAAQ,KAAA,GAAQ,KAAA;AAChB,MAAA,OAAA,CAAQ,cAAc,KAAK,CAAA;AAAA,IAC7B,CAAA,MAAO;AACL,MAAA,MAAM,MAAM,yCAAyC,CAAA;AAAA,IACvD;AAAA,EACF;AACF;;;;"}
|
|
@@ -3,10 +3,6 @@ import { PropsWithClassName } from '../../lib/types/props';
|
|
|
3
3
|
import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
|
|
4
4
|
import * as Aria from "react-aria-components";
|
|
5
5
|
export interface AutocompleteProps extends PropsWithChildren, PropsWithClassName, FlowComponentProps<HTMLInputElement>, Omit<Aria.AutocompleteProps, "children" | "onInputChange" | "inputValue" | "defaultInputValue" | "ref"> {
|
|
6
|
-
isInvalid?: boolean;
|
|
7
|
-
value?: string;
|
|
8
|
-
defaultValue?: string;
|
|
9
|
-
onChange?: (value: string) => void;
|
|
10
6
|
}
|
|
11
7
|
/** @flr-generate all */
|
|
12
8
|
export declare const Autocomplete: import('react').FunctionComponent<AutocompleteProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,sCAAsC,CAAC;AAkB9C,MAAM,WAAW,iBACf,SAAQ,iBAAiB,EACvB,kBAAkB,EAClB,kBAAkB,CAAC,gBAAgB,CAAC,EACpC,IAAI,CACF,IAAI,CAAC,iBAAiB,EACtB,UAAU,GAAG,eAAe,GAAG,YAAY,GAAG,mBAAmB,GAAG,KAAK,CAC1E;
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,sCAAsC,CAAC;AAkB9C,MAAM,WAAW,iBACf,SAAQ,iBAAiB,EACvB,kBAAkB,EAClB,kBAAkB,CAAC,gBAAgB,CAAC,EACpC,IAAI,CACF,IAAI,CAAC,iBAAiB,EACtB,UAAU,GAAG,eAAe,GAAG,YAAY,GAAG,mBAAmB,GAAG,KAAK,CAC1E;CAAG;AAER,wBAAwB;AACxB,eAAO,MAAM,YAAY,wGAqGvB,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileField.d.ts","sourceRoot":"","sources":["../../../../src/components/FileField/FileField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAE5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAO/E,MAAM,WAAW,cACf,SAAQ,iBAAiB,EACvB,kBAAkB,CAAC,gBAAgB,CAAC,EACpC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC,EACrD,IAAI,CACF,IAAI,CAAC,cAAc,EACnB,YAAY,GAAG,WAAW,GAAG,oBAAoB,GAAG,YAAY,CACjE;IACH,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,wBAAwB,CAAC;IACpC,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAwB;AACxB,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"FileField.d.ts","sourceRoot":"","sources":["../../../../src/components/FileField/FileField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAE5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAO/E,MAAM,WAAW,cACf,SAAQ,iBAAiB,EACvB,kBAAkB,CAAC,gBAAgB,CAAC,EACpC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC,EACrD,IAAI,CACF,IAAI,CAAC,cAAc,EACnB,YAAY,GAAG,WAAW,GAAG,oBAAoB,GAAG,YAAY,CACjE;IACH,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,wBAAwB,CAAC;IACpC,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAwB;AACxB,eAAO,MAAM,SAAS,qGAwEpB,CAAC;AACH,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAEhB,KAAK,aAAa,EAEnB,MAAM,iBAAiB,CAAC;AAOzB,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,WAAW,CAC/C,SAAQ,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EACxC,iBAAiB;CAAG;AAExB,wBAAgB,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAEhB,KAAK,aAAa,EAEnB,MAAM,iBAAiB,CAAC;AAOzB,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,WAAW,CAC/C,SAAQ,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EACxC,iBAAiB;CAAG;AAExB,wBAAgB,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,2CA8IhE;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,WAAW,EAC9C,aAAa,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAC1D,OAAO,KAAK,CAAC,CAAC,CAAU,CAAC;AAE5B,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emitElementValueChange.d.ts","sourceRoot":"","sources":["../../../../src/lib/react/emitElementValueChange.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,WAAW,EACpB,OAAO,OAAO,SAmBf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.570",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@internationalized/string-compiler": "^3.2.6",
|
|
60
60
|
"@mittwald/password-tools-js": "3.0.0-alpha.18",
|
|
61
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
61
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.570",
|
|
62
62
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
63
63
|
"@react-aria/form": "^3.1.2",
|
|
64
64
|
"@react-aria/live-announcer": "^3.4.4",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@faker-js/faker": "^10.1.0",
|
|
104
104
|
"@internationalized/date": "^3.10.0",
|
|
105
105
|
"@mittwald/flow-core": "",
|
|
106
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
106
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.570",
|
|
107
107
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
108
108
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
109
109
|
"@mittwald/typescript-config": "",
|
|
@@ -176,5 +176,5 @@
|
|
|
176
176
|
"optional": true
|
|
177
177
|
}
|
|
178
178
|
},
|
|
179
|
-
"gitHead": "
|
|
179
|
+
"gitHead": "7d3b0ac2101a8c4fa41220ada976702fca96823a"
|
|
180
180
|
}
|