@estiva-app/ui 0.44.1 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CollapsibleSection.d.ts +7 -1
- package/dist/CollapsibleSection.d.ts.map +1 -1
- package/dist/InlineChip.d.ts +1 -1
- package/dist/NavItem.d.ts +11 -1
- package/dist/NavItem.d.ts.map +1 -1
- package/dist/SectionHeader.d.ts +9 -1
- package/dist/SectionHeader.d.ts.map +1 -1
- package/dist/SelectionToolbar.d.ts +62 -0
- package/dist/SelectionToolbar.d.ts.map +1 -0
- package/dist/SuggestionMenu.d.ts +75 -0
- package/dist/SuggestionMenu.d.ts.map +1 -0
- package/dist/editor.d.ts +12 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/editor.js +357 -0
- package/dist/editor.js.map +7 -0
- package/dist/eslint/index.js +4 -3
- package/dist/eslint/index.js.map +2 -2
- package/dist/eslint/no-restyled-part.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +274 -133
- package/dist/index.js.map +4 -4
- package/dist/looks.d.ts +3 -0
- package/dist/looks.d.ts.map +1 -1
- package/dist/registry/{app-YMABQII6.js → app-LDGOH6UW.js} +3 -3
- package/dist/registry/{build-3EANARLQ.js → build-P6X3PTZP.js} +6 -2
- package/dist/registry/build.d.ts +4 -0
- package/dist/registry/build.d.ts.map +1 -1
- package/dist/registry/{chunk-SIB44CES.js → chunk-P55P2QFD.js} +9 -4
- package/dist/registry/chunk-P55P2QFD.js.map +7 -0
- package/dist/registry/{chunk-EVJW26UR.js → chunk-TQ6UQER3.js} +10 -10
- package/dist/registry/chunk-TQ6UQER3.js.map +7 -0
- package/dist/registry/cli.js +2 -2
- package/dist/registry/index.js +2 -2
- package/dist/shortcuts.d.ts +27 -0
- package/dist/shortcuts.d.ts.map +1 -0
- package/dist/suggestionPopup.d.ts +41 -0
- package/dist/suggestionPopup.d.ts.map +1 -0
- package/package.json +27 -2
- package/registry.json +391 -11
- package/src/Chip.tsx +1 -1
- package/src/CollapsibleSection.mdx +5 -0
- package/src/CollapsibleSection.stories.tsx +5 -0
- package/src/CollapsibleSection.tsx +10 -3
- package/src/CommandPalette.tsx +1 -1
- package/src/InlineChip.test.tsx +1 -1
- package/src/InlineChip.tsx +1 -1
- package/src/NavItem.mdx +9 -0
- package/src/NavItem.stories.tsx +23 -0
- package/src/NavItem.tsx +56 -6
- package/src/Reaction.tsx +1 -1
- package/src/SectionHeader.mdx +9 -0
- package/src/SectionHeader.stories.tsx +15 -0
- package/src/SectionHeader.tsx +28 -7
- package/src/SelectionToolbar.mdx +78 -0
- package/src/SelectionToolbar.stories.tsx +63 -0
- package/src/SelectionToolbar.test.ts +105 -0
- package/src/SelectionToolbar.tsx +487 -0
- package/src/SuggestionMenu.mdx +107 -0
- package/src/SuggestionMenu.stories.tsx +202 -0
- package/src/SuggestionMenu.test.tsx +128 -0
- package/src/SuggestionMenu.tsx +189 -0
- package/src/editor.ts +11 -0
- package/src/eslint/no-rebuilt-behaviour.test.ts +1 -1
- package/src/eslint/no-rebuilt-behaviour.ts +2 -2
- package/src/eslint/no-restyled-part.ts +2 -1
- package/src/how.test.ts +1 -1
- package/src/index.ts +2 -0
- package/src/keptSelection.test.ts +67 -0
- package/src/looks.ts +4 -0
- package/src/registry/app.ts +8 -8
- package/src/registry/build.ts +10 -2
- package/src/registry/registry.test.ts +14 -9
- package/src/shortcuts.ts +40 -0
- package/src/suggestionPopup.tsx +119 -0
- package/stories/Choosing.mdx +2 -0
- package/tailwind-preset.js +1 -0
- package/tokens.css +19 -4
- package/dist/registry/chunk-EVJW26UR.js.map +0 -7
- package/dist/registry/chunk-SIB44CES.js.map +0 -7
- /package/dist/registry/{app-YMABQII6.js.map → app-LDGOH6UW.js.map} +0 -0
- /package/dist/registry/{build-3EANARLQ.js.map → build-P6X3PTZP.js.map} +0 -0
package/registry.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"kind": "package",
|
|
5
5
|
"repo": "estiva-ui",
|
|
6
6
|
"package": "@estiva-app/ui",
|
|
7
|
-
"packageVersion": "0.
|
|
8
|
-
"exports":
|
|
9
|
-
"typeExports":
|
|
7
|
+
"packageVersion": "0.46.0",
|
|
8
|
+
"exports": 100,
|
|
9
|
+
"typeExports": 109,
|
|
10
10
|
"files": null
|
|
11
11
|
},
|
|
12
12
|
"storybook": {
|
|
@@ -832,14 +832,14 @@
|
|
|
832
832
|
"docPage": "src/Chip.mdx",
|
|
833
833
|
"app": null,
|
|
834
834
|
"looks": [
|
|
835
|
-
"bg-accent-muted text-accent-
|
|
835
|
+
"bg-accent-muted text-accent-text signal:border signal:border-accent-outline",
|
|
836
836
|
"bg-info-muted text-info-default signal:border signal:border-info-outline",
|
|
837
837
|
"bg-warning-muted text-warning-default signal:border signal:border-warning-outline signal:shadow-glow-warning",
|
|
838
838
|
"bg-success-muted text-success-default signal:border signal:border-success-outline",
|
|
839
839
|
"bg-error-muted text-error-default signal:border signal:border-error-outline",
|
|
840
840
|
"overflow-x-clip text-ellipsis whitespace-nowrap signal:tracking-wide text-chip signal:font-mono signal:text-small signal:font-semibold signal:tabular-nums",
|
|
841
841
|
"overflow-x-clip text-ellipsis whitespace-nowrap signal:tracking-wide",
|
|
842
|
-
"rounded-full bg-accent-muted text-accent-
|
|
842
|
+
"rounded-full bg-accent-muted text-accent-text signal:border signal:border-accent-outline",
|
|
843
843
|
"rounded-full bg-info-muted text-info-default signal:border signal:border-info-outline",
|
|
844
844
|
"rounded-full bg-warning-muted text-warning-default signal:border signal:border-warning-outline signal:shadow-glow-warning",
|
|
845
845
|
"rounded-full bg-success-muted text-success-default signal:border signal:border-success-outline",
|
|
@@ -1045,6 +1045,12 @@
|
|
|
1045
1045
|
"required": false,
|
|
1046
1046
|
"note": null
|
|
1047
1047
|
},
|
|
1048
|
+
{
|
|
1049
|
+
"name": "look",
|
|
1050
|
+
"takes": "heading | row",
|
|
1051
|
+
"required": false,
|
|
1052
|
+
"note": "`heading` (default): the title is a section heading."
|
|
1053
|
+
},
|
|
1048
1054
|
{
|
|
1049
1055
|
"name": "children",
|
|
1050
1056
|
"takes": "anything",
|
|
@@ -1071,6 +1077,13 @@
|
|
|
1071
1077
|
"hover",
|
|
1072
1078
|
"always"
|
|
1073
1079
|
]
|
|
1080
|
+
},
|
|
1081
|
+
{
|
|
1082
|
+
"prop": "look",
|
|
1083
|
+
"values": [
|
|
1084
|
+
"heading",
|
|
1085
|
+
"row"
|
|
1086
|
+
]
|
|
1074
1087
|
}
|
|
1075
1088
|
],
|
|
1076
1089
|
"ownsBehaviours": [
|
|
@@ -2651,6 +2664,63 @@
|
|
|
2651
2664
|
"text-caption font-medium text-text-primary truncate"
|
|
2652
2665
|
]
|
|
2653
2666
|
},
|
|
2667
|
+
{
|
|
2668
|
+
"name": "isApplePlatform",
|
|
2669
|
+
"repo": "estiva-ui",
|
|
2670
|
+
"kind": "helper",
|
|
2671
|
+
"importPath": "@estiva-app/ui",
|
|
2672
|
+
"sourceFile": "src/shortcuts.ts",
|
|
2673
|
+
"purpose": "Whether this machine calls the modifier Cmd rather than Ctrl.",
|
|
2674
|
+
"purposeFrom": "comment",
|
|
2675
|
+
"props": [],
|
|
2676
|
+
"variants": [],
|
|
2677
|
+
"ownsBehaviours": [],
|
|
2678
|
+
"status": "stable",
|
|
2679
|
+
"migrationStage": null,
|
|
2680
|
+
"docsId": null,
|
|
2681
|
+
"storyId": null,
|
|
2682
|
+
"docPage": null,
|
|
2683
|
+
"app": null,
|
|
2684
|
+
"looks": []
|
|
2685
|
+
},
|
|
2686
|
+
{
|
|
2687
|
+
"name": "isSuggestionActive",
|
|
2688
|
+
"repo": "estiva-ui",
|
|
2689
|
+
"kind": "helper",
|
|
2690
|
+
"importPath": "@estiva-app/ui/editor",
|
|
2691
|
+
"sourceFile": "src/suggestionPopup.tsx",
|
|
2692
|
+
"purpose": "Open, or closed less than 100ms ago — what an Enter handler asks.",
|
|
2693
|
+
"purposeFrom": "comment",
|
|
2694
|
+
"props": [],
|
|
2695
|
+
"variants": [],
|
|
2696
|
+
"ownsBehaviours": [],
|
|
2697
|
+
"status": "stable",
|
|
2698
|
+
"migrationStage": null,
|
|
2699
|
+
"docsId": null,
|
|
2700
|
+
"storyId": null,
|
|
2701
|
+
"docPage": null,
|
|
2702
|
+
"app": null,
|
|
2703
|
+
"looks": []
|
|
2704
|
+
},
|
|
2705
|
+
{
|
|
2706
|
+
"name": "isSuggestionOpen",
|
|
2707
|
+
"repo": "estiva-ui",
|
|
2708
|
+
"kind": "helper",
|
|
2709
|
+
"importPath": "@estiva-app/ui/editor",
|
|
2710
|
+
"sourceFile": "src/suggestionPopup.tsx",
|
|
2711
|
+
"purpose": "Open *now*, with no grace period — what an Escape handler asks.",
|
|
2712
|
+
"purposeFrom": "comment",
|
|
2713
|
+
"props": [],
|
|
2714
|
+
"variants": [],
|
|
2715
|
+
"ownsBehaviours": [],
|
|
2716
|
+
"status": "stable",
|
|
2717
|
+
"migrationStage": null,
|
|
2718
|
+
"docsId": null,
|
|
2719
|
+
"storyId": null,
|
|
2720
|
+
"docPage": null,
|
|
2721
|
+
"app": null,
|
|
2722
|
+
"looks": []
|
|
2723
|
+
},
|
|
2654
2724
|
{
|
|
2655
2725
|
"name": "Kbd",
|
|
2656
2726
|
"repo": "estiva-ui",
|
|
@@ -2704,6 +2774,25 @@
|
|
|
2704
2774
|
"border-border-tooltip-key bg-bg-tooltip-key text-text-tooltip-key signal:bg-bg-tooltip-key ship:bg-bg-tooltip-key"
|
|
2705
2775
|
]
|
|
2706
2776
|
},
|
|
2777
|
+
{
|
|
2778
|
+
"name": "KeptSelection",
|
|
2779
|
+
"repo": "estiva-ui",
|
|
2780
|
+
"kind": "component",
|
|
2781
|
+
"importPath": "@estiva-app/ui/editor",
|
|
2782
|
+
"sourceFile": "src/SelectionToolbar.tsx",
|
|
2783
|
+
"purpose": "The extension an editor registers so a selection can stay drawn while a field has the focus.",
|
|
2784
|
+
"purposeFrom": "comment",
|
|
2785
|
+
"props": [],
|
|
2786
|
+
"variants": [],
|
|
2787
|
+
"ownsBehaviours": [],
|
|
2788
|
+
"status": "stable",
|
|
2789
|
+
"migrationStage": null,
|
|
2790
|
+
"docsId": "primitives-selectiontoolbar--docs",
|
|
2791
|
+
"storyId": "primitives-selectiontoolbar--default",
|
|
2792
|
+
"docPage": null,
|
|
2793
|
+
"app": null,
|
|
2794
|
+
"looks": []
|
|
2795
|
+
},
|
|
2707
2796
|
{
|
|
2708
2797
|
"name": "Lightbox",
|
|
2709
2798
|
"repo": "estiva-ui",
|
|
@@ -3373,6 +3462,18 @@
|
|
|
3373
3462
|
"required": false,
|
|
3374
3463
|
"note": "16px, stroke 1.5."
|
|
3375
3464
|
},
|
|
3465
|
+
{
|
|
3466
|
+
"name": "menu",
|
|
3467
|
+
"takes": "anything",
|
|
3468
|
+
"required": false,
|
|
3469
|
+
"note": "The row's \"More options\" menu: `MenuItem`s."
|
|
3470
|
+
},
|
|
3471
|
+
{
|
|
3472
|
+
"name": "menuLabel",
|
|
3473
|
+
"takes": "text",
|
|
3474
|
+
"required": false,
|
|
3475
|
+
"note": "The ⋮'s accessible name and tooltip. Default \"More options for {label}\"."
|
|
3476
|
+
},
|
|
3376
3477
|
{
|
|
3377
3478
|
"name": "className",
|
|
3378
3479
|
"takes": "text",
|
|
@@ -3389,11 +3490,31 @@
|
|
|
3389
3490
|
"docPage": "src/NavItem.mdx",
|
|
3390
3491
|
"app": null,
|
|
3391
3492
|
"looks": [
|
|
3392
|
-
"
|
|
3393
|
-
"
|
|
3394
|
-
"text-center font-mono text-caption tabular-nums text-text-muted"
|
|
3493
|
+
"text-body-2 rounded-md transition-colors bg-bg-active text-text-primary",
|
|
3494
|
+
"text-body-2 rounded-md transition-colors text-text-secondary hover:text-text-primary hover:bg-bg-hover",
|
|
3495
|
+
"text-center font-mono text-caption tabular-nums text-text-muted",
|
|
3496
|
+
"text-center font-mono text-caption tabular-nums text-text-muted transition-opacity"
|
|
3395
3497
|
]
|
|
3396
3498
|
},
|
|
3499
|
+
{
|
|
3500
|
+
"name": "normalizeHref",
|
|
3501
|
+
"repo": "estiva-ui",
|
|
3502
|
+
"kind": "helper",
|
|
3503
|
+
"importPath": "@estiva-app/ui/editor",
|
|
3504
|
+
"sourceFile": "src/SelectionToolbar.tsx",
|
|
3505
|
+
"purpose": "What somebody typed into the link field → an `href`, or null when it cannot be one.",
|
|
3506
|
+
"purposeFrom": "comment",
|
|
3507
|
+
"props": [],
|
|
3508
|
+
"variants": [],
|
|
3509
|
+
"ownsBehaviours": [],
|
|
3510
|
+
"status": "stable",
|
|
3511
|
+
"migrationStage": null,
|
|
3512
|
+
"docsId": "primitives-selectiontoolbar--docs",
|
|
3513
|
+
"storyId": "primitives-selectiontoolbar--default",
|
|
3514
|
+
"docPage": null,
|
|
3515
|
+
"app": null,
|
|
3516
|
+
"looks": []
|
|
3517
|
+
},
|
|
3397
3518
|
{
|
|
3398
3519
|
"name": "Panel",
|
|
3399
3520
|
"repo": "estiva-ui",
|
|
@@ -4091,9 +4212,9 @@
|
|
|
4091
4212
|
"docPage": "src/Reaction.mdx",
|
|
4092
4213
|
"app": null,
|
|
4093
4214
|
"looks": [
|
|
4094
|
-
"rounded-full border transition-colors disabled:cursor-not-allowed disabled:opacity-50 border-accent-primary bg-accent-muted text-accent-
|
|
4215
|
+
"rounded-full border transition-colors disabled:cursor-not-allowed disabled:opacity-50 border-accent-primary bg-accent-muted text-accent-text hover:border-accent-hover ship:text-text-primary",
|
|
4095
4216
|
"rounded-full border transition-colors disabled:cursor-not-allowed disabled:opacity-50 border-border-default bg-bg-inset text-text-primary hover:border-border-strong hover:bg-bg-hover",
|
|
4096
|
-
"border-accent-primary bg-accent-muted text-accent-
|
|
4217
|
+
"border-accent-primary bg-accent-muted text-accent-text hover:border-accent-hover ship:text-text-primary",
|
|
4097
4218
|
"border-border-default bg-bg-inset text-text-primary hover:border-border-strong hover:bg-bg-hover",
|
|
4098
4219
|
"text-chip signal:font-mono signal:text-small signal:font-semibold signal:tabular-nums"
|
|
4099
4220
|
]
|
|
@@ -4423,6 +4544,12 @@
|
|
|
4423
4544
|
"required": false,
|
|
4424
4545
|
"note": "`fill` lights the row under the pointer when it does something (a toggle, actions); `none` keeps it still — a heading whose actions are always shown, where the buttons light up on their own (UIG-14, Katerina, 19 September)."
|
|
4425
4546
|
},
|
|
4547
|
+
{
|
|
4548
|
+
"name": "look",
|
|
4549
|
+
"takes": "heading | quiet | row",
|
|
4550
|
+
"required": false,
|
|
4551
|
+
"note": "`heading` (default): a section's title, the `SectionLabel`."
|
|
4552
|
+
},
|
|
4426
4553
|
{
|
|
4427
4554
|
"name": "render",
|
|
4428
4555
|
"takes": "useRender.RenderProp",
|
|
@@ -4450,6 +4577,14 @@
|
|
|
4450
4577
|
"fill",
|
|
4451
4578
|
"none"
|
|
4452
4579
|
]
|
|
4580
|
+
},
|
|
4581
|
+
{
|
|
4582
|
+
"prop": "look",
|
|
4583
|
+
"values": [
|
|
4584
|
+
"heading",
|
|
4585
|
+
"quiet",
|
|
4586
|
+
"row"
|
|
4587
|
+
]
|
|
4453
4588
|
}
|
|
4454
4589
|
],
|
|
4455
4590
|
"ownsBehaviours": [],
|
|
@@ -4460,7 +4595,9 @@
|
|
|
4460
4595
|
"docPage": "src/SectionHeader.mdx",
|
|
4461
4596
|
"app": null,
|
|
4462
4597
|
"looks": [
|
|
4463
|
-
"
|
|
4598
|
+
"transition-transform duration-150 text-text-secondary rotate-90",
|
|
4599
|
+
"rounded-md transition-colors text-text-secondary hover:text-text-primary",
|
|
4600
|
+
"rounded-md transition-colors text-text-secondary hover:text-text-primary hover:bg-bg-hover",
|
|
4464
4601
|
"-mr-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100",
|
|
4465
4602
|
"opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100"
|
|
4466
4603
|
]
|
|
@@ -4658,6 +4795,84 @@
|
|
|
4658
4795
|
"rounded-lg border bg-bg-field shadow-field text-left"
|
|
4659
4796
|
]
|
|
4660
4797
|
},
|
|
4798
|
+
{
|
|
4799
|
+
"name": "SelectionToolbar",
|
|
4800
|
+
"repo": "estiva-ui",
|
|
4801
|
+
"kind": "component",
|
|
4802
|
+
"importPath": "@estiva-app/ui/editor",
|
|
4803
|
+
"sourceFile": "src/SelectionToolbar.tsx",
|
|
4804
|
+
"purpose": "Bold, italic and underline — and code or a link where the editor has them — over text you have already selected in an editor.",
|
|
4805
|
+
"purposeFrom": "page",
|
|
4806
|
+
"props": [
|
|
4807
|
+
{
|
|
4808
|
+
"name": "editor",
|
|
4809
|
+
"takes": "Editor | null",
|
|
4810
|
+
"required": true,
|
|
4811
|
+
"note": "The editor whose selection the strip follows."
|
|
4812
|
+
},
|
|
4813
|
+
{
|
|
4814
|
+
"name": "marks",
|
|
4815
|
+
"takes": "readonly MarkId[]",
|
|
4816
|
+
"required": false,
|
|
4817
|
+
"note": "Which marks the strip toggles, in order."
|
|
4818
|
+
},
|
|
4819
|
+
{
|
|
4820
|
+
"name": "link",
|
|
4821
|
+
"takes": "true/false",
|
|
4822
|
+
"required": false,
|
|
4823
|
+
"note": "The Link button and its address field. Needs a link mark in the editor and `KeptSelection`."
|
|
4824
|
+
}
|
|
4825
|
+
],
|
|
4826
|
+
"variants": [],
|
|
4827
|
+
"ownsBehaviours": [
|
|
4828
|
+
{
|
|
4829
|
+
"id": "portal",
|
|
4830
|
+
"behaviour": "Floats on top of the page"
|
|
4831
|
+
},
|
|
4832
|
+
{
|
|
4833
|
+
"id": "press-outside",
|
|
4834
|
+
"behaviour": "Closes on a press outside"
|
|
4835
|
+
},
|
|
4836
|
+
{
|
|
4837
|
+
"id": "page-keys",
|
|
4838
|
+
"behaviour": "Takes its keys by itself"
|
|
4839
|
+
},
|
|
4840
|
+
{
|
|
4841
|
+
"id": "focus",
|
|
4842
|
+
"behaviour": "Holds focus inside while open, and gives it back"
|
|
4843
|
+
},
|
|
4844
|
+
{
|
|
4845
|
+
"id": "follow",
|
|
4846
|
+
"behaviour": "Stays attached to its anchor on scroll and resize"
|
|
4847
|
+
}
|
|
4848
|
+
],
|
|
4849
|
+
"status": "stable",
|
|
4850
|
+
"migrationStage": null,
|
|
4851
|
+
"docsId": "primitives-selectiontoolbar--docs",
|
|
4852
|
+
"storyId": "primitives-selectiontoolbar--default",
|
|
4853
|
+
"docPage": "src/SelectionToolbar.mdx",
|
|
4854
|
+
"app": null,
|
|
4855
|
+
"looks": []
|
|
4856
|
+
},
|
|
4857
|
+
{
|
|
4858
|
+
"name": "shortcutLabel",
|
|
4859
|
+
"repo": "estiva-ui",
|
|
4860
|
+
"kind": "helper",
|
|
4861
|
+
"importPath": "@estiva-app/ui",
|
|
4862
|
+
"sourceFile": "src/shortcuts.ts",
|
|
4863
|
+
"purpose": "`Mod-B` → `Cmd+B` on a Mac, `Ctrl+B` elsewhere.",
|
|
4864
|
+
"purposeFrom": "comment",
|
|
4865
|
+
"props": [],
|
|
4866
|
+
"variants": [],
|
|
4867
|
+
"ownsBehaviours": [],
|
|
4868
|
+
"status": "stable",
|
|
4869
|
+
"migrationStage": null,
|
|
4870
|
+
"docsId": null,
|
|
4871
|
+
"storyId": null,
|
|
4872
|
+
"docPage": null,
|
|
4873
|
+
"app": null,
|
|
4874
|
+
"looks": []
|
|
4875
|
+
},
|
|
4661
4876
|
{
|
|
4662
4877
|
"name": "Sidebar",
|
|
4663
4878
|
"repo": "estiva-ui",
|
|
@@ -4786,6 +5001,171 @@
|
|
|
4786
5001
|
"app": null,
|
|
4787
5002
|
"looks": []
|
|
4788
5003
|
},
|
|
5004
|
+
{
|
|
5005
|
+
"name": "SuggestionMenu",
|
|
5006
|
+
"repo": "estiva-ui",
|
|
5007
|
+
"kind": "component",
|
|
5008
|
+
"importPath": "@estiva-app/ui",
|
|
5009
|
+
"sourceFile": "src/SuggestionMenu.tsx",
|
|
5010
|
+
"purpose": "The list a text editor opens as you type — `/` for commands, `@` for people — while focus stays in the text.",
|
|
5011
|
+
"purposeFrom": "page",
|
|
5012
|
+
"props": [
|
|
5013
|
+
{
|
|
5014
|
+
"name": "rect",
|
|
5015
|
+
"takes": "DOMRect | null",
|
|
5016
|
+
"required": true,
|
|
5017
|
+
"note": "The caret's rect, from the editor. `null` closes the box."
|
|
5018
|
+
},
|
|
5019
|
+
{
|
|
5020
|
+
"name": "editorElement",
|
|
5021
|
+
"takes": "HTMLElement | null",
|
|
5022
|
+
"required": false,
|
|
5023
|
+
"note": "The editor's own element — told which row is active."
|
|
5024
|
+
},
|
|
5025
|
+
{
|
|
5026
|
+
"name": "ariaLabel",
|
|
5027
|
+
"takes": "text",
|
|
5028
|
+
"required": true,
|
|
5029
|
+
"note": "Names the list — \"Commands\", \"People\"."
|
|
5030
|
+
},
|
|
5031
|
+
{
|
|
5032
|
+
"name": "width",
|
|
5033
|
+
"takes": "text",
|
|
5034
|
+
"required": true,
|
|
5035
|
+
"note": "The box's width, e.g. `w-[300px]`."
|
|
5036
|
+
},
|
|
5037
|
+
{
|
|
5038
|
+
"name": "maxHeight",
|
|
5039
|
+
"takes": "text",
|
|
5040
|
+
"required": true,
|
|
5041
|
+
"note": "The cap before the rows scroll, e.g. `max-h-[400px]`."
|
|
5042
|
+
},
|
|
5043
|
+
{
|
|
5044
|
+
"name": "sections",
|
|
5045
|
+
"takes": "readonly SuggestionMenuSection<T>[]",
|
|
5046
|
+
"required": true,
|
|
5047
|
+
"note": null
|
|
5048
|
+
},
|
|
5049
|
+
{
|
|
5050
|
+
"name": "itemKey",
|
|
5051
|
+
"takes": "a handler",
|
|
5052
|
+
"required": true,
|
|
5053
|
+
"note": "A stable key for a row."
|
|
5054
|
+
},
|
|
5055
|
+
{
|
|
5056
|
+
"name": "row",
|
|
5057
|
+
"takes": "a handler",
|
|
5058
|
+
"required": true,
|
|
5059
|
+
"note": "What a row shows."
|
|
5060
|
+
},
|
|
5061
|
+
{
|
|
5062
|
+
"name": "onSelect",
|
|
5063
|
+
"takes": "a handler",
|
|
5064
|
+
"required": true,
|
|
5065
|
+
"note": null
|
|
5066
|
+
},
|
|
5067
|
+
{
|
|
5068
|
+
"name": "handle",
|
|
5069
|
+
"takes": "Ref<SuggestionMenuHandle>",
|
|
5070
|
+
"required": false,
|
|
5071
|
+
"note": null
|
|
5072
|
+
}
|
|
5073
|
+
],
|
|
5074
|
+
"variants": [],
|
|
5075
|
+
"ownsBehaviours": [
|
|
5076
|
+
{
|
|
5077
|
+
"id": "portal",
|
|
5078
|
+
"behaviour": "Floats on top of the page"
|
|
5079
|
+
},
|
|
5080
|
+
{
|
|
5081
|
+
"id": "press-outside",
|
|
5082
|
+
"behaviour": "Closes on a press outside"
|
|
5083
|
+
},
|
|
5084
|
+
{
|
|
5085
|
+
"id": "page-keys",
|
|
5086
|
+
"behaviour": "Takes its keys by itself"
|
|
5087
|
+
},
|
|
5088
|
+
{
|
|
5089
|
+
"id": "focus",
|
|
5090
|
+
"behaviour": "Holds focus inside while open, and gives it back"
|
|
5091
|
+
},
|
|
5092
|
+
{
|
|
5093
|
+
"id": "follow",
|
|
5094
|
+
"behaviour": "Stays attached to its anchor on scroll and resize"
|
|
5095
|
+
},
|
|
5096
|
+
{
|
|
5097
|
+
"id": "walking",
|
|
5098
|
+
"behaviour": "Moves through its items with the arrow keys"
|
|
5099
|
+
},
|
|
5100
|
+
{
|
|
5101
|
+
"id": "role",
|
|
5102
|
+
"behaviour": "Says what it is to assistive technology"
|
|
5103
|
+
}
|
|
5104
|
+
],
|
|
5105
|
+
"status": "stable",
|
|
5106
|
+
"migrationStage": null,
|
|
5107
|
+
"docsId": "primitives-suggestionmenu--docs",
|
|
5108
|
+
"storyId": "primitives-suggestionmenu--default",
|
|
5109
|
+
"docPage": "src/SuggestionMenu.mdx",
|
|
5110
|
+
"app": null,
|
|
5111
|
+
"looks": []
|
|
5112
|
+
},
|
|
5113
|
+
{
|
|
5114
|
+
"name": "suggestionPopup",
|
|
5115
|
+
"repo": "estiva-ui",
|
|
5116
|
+
"kind": "helper",
|
|
5117
|
+
"importPath": "@estiva-app/ui/editor",
|
|
5118
|
+
"sourceFile": "src/suggestionPopup.tsx",
|
|
5119
|
+
"purpose": "The `render` of a Tiptap suggestion plugin, drawn as a `SuggestionMenu` — the popup controller Peek wrote four times (`mention.tsx`, `slashCommands.tsx`), once.",
|
|
5120
|
+
"purposeFrom": "comment",
|
|
5121
|
+
"props": [
|
|
5122
|
+
{
|
|
5123
|
+
"name": "ariaLabel",
|
|
5124
|
+
"takes": "text",
|
|
5125
|
+
"required": true,
|
|
5126
|
+
"note": "Names the list — \"Commands\", \"People\"."
|
|
5127
|
+
},
|
|
5128
|
+
{
|
|
5129
|
+
"name": "width",
|
|
5130
|
+
"takes": "text",
|
|
5131
|
+
"required": true,
|
|
5132
|
+
"note": "The box's width, e.g. `w-[300px]`."
|
|
5133
|
+
},
|
|
5134
|
+
{
|
|
5135
|
+
"name": "maxHeight",
|
|
5136
|
+
"takes": "text",
|
|
5137
|
+
"required": true,
|
|
5138
|
+
"note": "The cap before the rows scroll, e.g. `max-h-[400px]`."
|
|
5139
|
+
},
|
|
5140
|
+
{
|
|
5141
|
+
"name": "sections",
|
|
5142
|
+
"takes": "a handler",
|
|
5143
|
+
"required": false,
|
|
5144
|
+
"note": "The plugin's items, and the typed query, → the sections to draw."
|
|
5145
|
+
},
|
|
5146
|
+
{
|
|
5147
|
+
"name": "itemKey",
|
|
5148
|
+
"takes": "a handler",
|
|
5149
|
+
"required": true,
|
|
5150
|
+
"note": null
|
|
5151
|
+
},
|
|
5152
|
+
{
|
|
5153
|
+
"name": "row",
|
|
5154
|
+
"takes": "a handler",
|
|
5155
|
+
"required": true,
|
|
5156
|
+
"note": null
|
|
5157
|
+
}
|
|
5158
|
+
],
|
|
5159
|
+
"variants": [],
|
|
5160
|
+
"ownsBehaviours": [],
|
|
5161
|
+
"status": "stable",
|
|
5162
|
+
"migrationStage": null,
|
|
5163
|
+
"docsId": null,
|
|
5164
|
+
"storyId": null,
|
|
5165
|
+
"docPage": null,
|
|
5166
|
+
"app": null,
|
|
5167
|
+
"looks": []
|
|
5168
|
+
},
|
|
4789
5169
|
{
|
|
4790
5170
|
"name": "Tabs",
|
|
4791
5171
|
"repo": "estiva-ui",
|
package/src/Chip.tsx
CHANGED
|
@@ -33,7 +33,7 @@ export interface ChipProps {
|
|
|
33
33
|
|
|
34
34
|
const typeStyles: Record<ChipType, string> = {
|
|
35
35
|
neutral: 'bg-bg-inset text-text-primary',
|
|
36
|
-
brand: 'bg-accent-muted text-accent-
|
|
36
|
+
brand: 'bg-accent-muted text-accent-text signal:border signal:border-accent-outline',
|
|
37
37
|
info: 'bg-info-muted text-info-default signal:border signal:border-info-outline',
|
|
38
38
|
warning: 'bg-warning-muted text-warning-default signal:border signal:border-warning-outline signal:shadow-glow-warning',
|
|
39
39
|
success: 'bg-success-muted text-success-default signal:border signal:border-success-outline',
|
|
@@ -22,6 +22,11 @@ toggle, and the rows under it, sliding shut and open.
|
|
|
22
22
|
- `open` + `onOpenChange` when the app owns the state.
|
|
23
23
|
- `actions` for add, sort, filter beside the title — SectionHeader's,
|
|
24
24
|
revealed on hover or focus.
|
|
25
|
+
- `look="row"` when the section is a row among rows — a folder in a
|
|
26
|
+
sidebar, under a quiet label: the title at a row's weight, and its rows
|
|
27
|
+
indented under it, past the chevron.
|
|
28
|
+
|
|
29
|
+
<Canvas of={CollapsibleSectionStories.AsARow} />
|
|
25
30
|
|
|
26
31
|
In a sidebar — the Sidebar's own Composed canvas, which is where that
|
|
27
32
|
composition lives:
|
|
@@ -42,3 +42,8 @@ export const WithTrailing: Story = {
|
|
|
42
42
|
/** Close it and reload the page: still closed. This browser remembers, under the key. */
|
|
43
43
|
export const Remembered: Story = { args: { storageKey: 'estiva-ui.stories.collapsible-section' } }
|
|
44
44
|
|
|
45
|
+
|
|
46
|
+
/** `look="row"`: a fold that is a row among rows — a folder in a sidebar. The title at a row's weight, the rows indented under it, past the chevron. */
|
|
47
|
+
export const AsARow: Story = {
|
|
48
|
+
args: { title: 'Folder', look: 'row' },
|
|
49
|
+
}
|
|
@@ -36,6 +36,12 @@ export interface CollapsibleSectionProps {
|
|
|
36
36
|
/** Beside the title, revealed on hover or focus — `SectionHeader`'s. */
|
|
37
37
|
actions?: SectionAction[]
|
|
38
38
|
showActions?: 'hover' | 'always'
|
|
39
|
+
/**
|
|
40
|
+
* `heading` (default): the title is a section heading. `row`: the fold is a
|
|
41
|
+
* row among rows — a folder in a sidebar — and its rows sit indented under
|
|
42
|
+
* its title, past the chevron (`SectionHeader`'s `look`).
|
|
43
|
+
*/
|
|
44
|
+
look?: 'heading' | 'row'
|
|
39
45
|
/** The rows. */
|
|
40
46
|
children: ReactNode
|
|
41
47
|
/** On the section's box: `mt-2` between groups, `shrink-0` in a scrolling column. */
|
|
@@ -66,7 +72,7 @@ function writeStored(key: string | undefined, open: boolean) {
|
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
|
|
69
|
-
export function CollapsibleSection({ title, defaultOpen = true, open: openProp, onOpenChange, storageKey, trailing, actions, showActions, children, className, contentClassName }: CollapsibleSectionProps) {
|
|
75
|
+
export function CollapsibleSection({ title, defaultOpen = true, open: openProp, onOpenChange, storageKey, trailing, actions, showActions, look = 'heading', children, className, contentClassName }: CollapsibleSectionProps) {
|
|
70
76
|
const [openState, setOpenState] = useState(() => readStored(storageKey) ?? defaultOpen)
|
|
71
77
|
const open = openProp ?? openState
|
|
72
78
|
const setOpen = (next: boolean) => {
|
|
@@ -76,7 +82,7 @@ export function CollapsibleSection({ title, defaultOpen = true, open: openProp,
|
|
|
76
82
|
}
|
|
77
83
|
return (
|
|
78
84
|
<Collapsible.Root open={open} onOpenChange={setOpen} className={cn('flex flex-col', className)}>
|
|
79
|
-
<SectionHeader title={title} chevron isExpanded={open} trailing={trailing} actions={actions} showActions={showActions} className="shrink-0" render={<Collapsible.Trigger />} />
|
|
85
|
+
<SectionHeader title={title} chevron isExpanded={open} trailing={trailing} actions={actions} showActions={showActions} look={look} className="shrink-0" render={<Collapsible.Trigger />} />
|
|
80
86
|
{/* The slide: Base UI measures the panel and writes its height to a
|
|
81
87
|
variable — `auto` again once the slide ends, so rows that arrive
|
|
82
88
|
later are not clipped — and the panel is 0 high on its opening frame
|
|
@@ -87,7 +93,8 @@ export function CollapsibleSection({ title, defaultOpen = true, open: openProp,
|
|
|
87
93
|
hiddenUntilFound
|
|
88
94
|
className="h-[var(--collapsible-panel-height)] overflow-hidden transition-[height] duration-150 ease-out motion-reduce:transition-none data-[starting-style]:h-0 data-[ending-style]:h-0"
|
|
89
95
|
>
|
|
90
|
-
|
|
96
|
+
{/* A row's rows start under its title: the 16px chevron and its 8px gap (pl-6). */}
|
|
97
|
+
<div className={cn('flex flex-col', look === 'row' && 'pl-6', contentClassName)}>{children}</div>
|
|
91
98
|
</Collapsible.Panel>
|
|
92
99
|
</Collapsible.Root>
|
|
93
100
|
)
|
package/src/CommandPalette.tsx
CHANGED
|
@@ -639,7 +639,7 @@ export function CommandPaletteAnswer({ children, note }: CommandPaletteAnswerPro
|
|
|
639
639
|
before "[1]" would stand between them as a gap. */}
|
|
640
640
|
{paragraph.split(/\s*(\[\d+\])/).map((part, j) =>
|
|
641
641
|
/^\[\d+\]$/.test(part) ? (
|
|
642
|
-
<sup key={j} className="ml-0.5 font-mono text-small text-accent-
|
|
642
|
+
<sup key={j} className="ml-0.5 font-mono text-small text-accent-text">
|
|
643
643
|
{part.slice(1, -1)}
|
|
644
644
|
</sup>
|
|
645
645
|
) : (
|
package/src/InlineChip.test.tsx
CHANGED
|
@@ -52,7 +52,7 @@ describe('InlineChip', () => {
|
|
|
52
52
|
expect(neutral).toContain('text-text-primary')
|
|
53
53
|
const person = inlineChipClassName('person').split(' ')
|
|
54
54
|
expect(person).toContain('text-body-2')
|
|
55
|
-
expect(person).toContain('text-accent-
|
|
55
|
+
expect(person).toContain('text-accent-text')
|
|
56
56
|
const urgent = inlineChipClassName('urgent').split(' ')
|
|
57
57
|
expect(urgent).toContain('text-warning-default')
|
|
58
58
|
// quiet is smaller: its caption size replaces the body size, and its colour survives beside it
|
package/src/InlineChip.tsx
CHANGED
|
@@ -33,7 +33,7 @@ export const INLINE_CHIP_TONE_CLASSES = {
|
|
|
33
33
|
/** A thing or a place — anything that is not a person. */
|
|
34
34
|
neutral: 'bg-bg-active text-text-primary',
|
|
35
35
|
/** A person. */
|
|
36
|
-
person: 'bg-accent-muted text-accent-
|
|
36
|
+
person: 'bg-accent-muted text-accent-text',
|
|
37
37
|
/** A person, called urgently. */
|
|
38
38
|
urgent: 'bg-warning-muted text-warning-default',
|
|
39
39
|
/**
|
package/src/NavItem.mdx
CHANGED
|
@@ -22,6 +22,12 @@ count — a muted mono number whose tooltip says what it counts.
|
|
|
22
22
|
|
|
23
23
|
<Canvas of={NavItemStories.ZeroDrawsNothing} />
|
|
24
24
|
|
|
25
|
+
- A row with things to do to it — move it, rename it — takes them as
|
|
26
|
+
`menu`: pass `MenuItem`s, and the row draws the ⋮, shows it while the row
|
|
27
|
+
is pointed at or focused, and moves the count aside for it.
|
|
28
|
+
|
|
29
|
+
<Canvas of={NavItemStories.WithMenu} />
|
|
30
|
+
|
|
25
31
|
## When not
|
|
26
32
|
|
|
27
33
|
- An icon rail's tile → **RailItem**.
|
|
@@ -47,6 +53,8 @@ import { NavItem } from '@estiva-app/ui'
|
|
|
47
53
|
`active` from the location, intercept the click, navigate — every
|
|
48
54
|
anchor prop passes through.
|
|
49
55
|
- The label truncates; the count never gives up its width.
|
|
56
|
+
- `menu` is the items only: `menu={<MenuItem label="Move to Folder…" onClick={move} />}`.
|
|
57
|
+
The ⋮'s name is `More options for {label}` unless `menuLabel` says otherwise.
|
|
50
58
|
|
|
51
59
|
- A row is 32px tall, 8px in on each side, 8px between the icon and the label,
|
|
52
60
|
the label 14px regular, 6px corners.
|
|
@@ -59,6 +67,7 @@ It does these by itself. Write none of them around it.
|
|
|
59
67
|
|---|---|---|
|
|
60
68
|
| Marks the current place for assistive technology when `active` | `aria-current` | |
|
|
61
69
|
| Keeps its 32px in a scrolling column | `shrink-0` | |
|
|
70
|
+
| Shows a ⋮ over the count while pointed at, focused or open, and keeps the row's hover look under it | a positioned `IconButton` + `Menu` over the row, `group-hover` reveals | |
|
|
62
71
|
|
|
63
72
|
## Props
|
|
64
73
|
|
package/src/NavItem.stories.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
2
|
import { IconSquareRounded } from '@tabler/icons-react'
|
|
3
|
+
import { MenuItem } from './Menu'
|
|
3
4
|
import { NavItem } from './NavItem'
|
|
4
5
|
|
|
5
6
|
const placeholder = <IconSquareRounded size={16} stroke={1.5} />
|
|
@@ -37,3 +38,25 @@ export const ZeroDrawsNothing: Story = {
|
|
|
37
38
|
export const LongLabelTruncates: Story = {
|
|
38
39
|
args: { label: 'An item whose label runs much longer than the column has room for', count: 7, countLabel: '7 open' },
|
|
39
40
|
}
|
|
41
|
+
|
|
42
|
+
const MENU = (
|
|
43
|
+
<>
|
|
44
|
+
<MenuItem label="Action one" onClick={() => {}} />
|
|
45
|
+
<MenuItem label="Action two" onClick={() => {}} />
|
|
46
|
+
</>
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
/** A row with a menu: point at it (or Tab to it) and a ⋮ takes the count's place; the count comes back when you leave. */
|
|
50
|
+
export const WithMenu: Story = {
|
|
51
|
+
args: { icon: placeholder, count: 6, countLabel: '6 open', menu: MENU },
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The active row keeps its fill; the ⋮ sits on it the same way. */
|
|
55
|
+
export const WithMenuActive: Story = {
|
|
56
|
+
args: { icon: placeholder, count: 6, countLabel: '6 open', menu: MENU, active: true },
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** No count: the ⋮ still appears in the same place, and a long label stops short of it. */
|
|
60
|
+
export const WithMenuNoCount: Story = {
|
|
61
|
+
args: { label: 'An item whose label runs much longer than the column has room for', icon: placeholder, menu: MENU },
|
|
62
|
+
}
|