@wallarm-org/design-system 4.14.0 → 4.15.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/components/AgentAvatar/AgentAvatar.js +71 -54
- package/dist/components/AgentGlyph/AgentGlyph.js +38 -87
- package/dist/components/Avatar/AgentItem.d.ts +33 -0
- package/dist/components/Avatar/AgentItem.js +183 -0
- package/dist/components/Avatar/classes.d.ts +3 -0
- package/dist/components/Avatar/classes.js +16 -1
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Avatar/index.js +1 -0
- package/dist/components/Chat/ChatTrigger.d.ts +1 -1
- package/dist/components/Chat/ChatTrigger.js +5 -3
- package/dist/components/FilterDropdown/FilterDropdownOption.d.ts +6 -1
- package/dist/components/FilterDropdown/FilterDropdownOption.js +66 -49
- package/dist/components/FilterDropdown/FilterDropdownTrigger.d.ts +6 -0
- package/dist/components/FilterDropdown/FilterDropdownTrigger.js +127 -109
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/FilterInputValueMenu.d.ts +3 -1
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/NestedValueMenuItem.js +12 -10
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/ValueMenuItem.js +13 -11
- package/dist/components/FilterInput/types.d.ts +5 -0
- package/dist/components/Select/SelectInput/SelectInputItemRenderer.js +19 -18
- package/dist/components/Select/SelectValueIcon.js +3 -1
- package/dist/components/Select/types.d.ts +6 -1
- package/dist/components/Table/TableBody/TableBodyCell.js +2 -2
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/agent-characters/geom.d.ts +4 -0
- package/dist/lib/agent-characters/geom.js +12 -1
- package/dist/lib/agent-characters/look.d.ts +2 -0
- package/dist/lib/agent-characters/look.js +2 -1
- package/dist/metadata/components.json +198 -8
- package/dist/metadata/guidelines.json +1 -1
- package/dist/utils/isValidSvg.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
3
|
-
"generatedAt": "2026-11-
|
|
2
|
+
"version": "4.14.0",
|
|
3
|
+
"generatedAt": "2026-11-12T13:49:05.431Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"name": "Accordion",
|
|
@@ -1736,7 +1736,7 @@
|
|
|
1736
1736
|
},
|
|
1737
1737
|
{
|
|
1738
1738
|
"name": "ApprovalCard",
|
|
1739
|
-
"description": "Asks the user to approve an action Wally wants to take — a tool call, a config change — before it runs. While `status` is `pending` the card shows its children (`ApprovalCardContent` and `ApprovalCardActions`); once the app sets `approved` or `rejected`, the children are replaced by a one-line status, so the buttons need no gating of their own. The card has no outer margins or horizontal padding: the panel gutter (`ChatBody` / `ChatFooter`) places it, whether it sits inline in the conversation or docked above the input. Buttons are plain DS components composed by the app, which also owns loading — disable them while the request is in flight.",
|
|
1739
|
+
"description": "Asks the user to approve an action Wally wants to take — a tool call, a config change — before it runs. While `status` is `pending` the card shows its children (`ApprovalCardContent` and `ApprovalCardActions`); once the app sets `approved` or `rejected`, the children are replaced by a one-line status, so the buttons need no gating of their own. The card has no outer margins or horizontal padding: the panel gutter (`ChatBody` / `ChatFooter`) places it, whether it sits inline in the conversation or docked above the input. When an agent other than Wally asks, its live 40px `AgentItem` opens the `ApprovalCardContent`. Buttons are plain DS components composed by the app, which also owns loading — disable them while the request is in flight.",
|
|
1740
1740
|
"importPath": "@wallarm-org/design-system/ApprovalCard",
|
|
1741
1741
|
"props": [
|
|
1742
1742
|
{
|
|
@@ -1932,6 +1932,13 @@
|
|
|
1932
1932
|
"storyTitle": "AI/ApprovalCard",
|
|
1933
1933
|
"description": "The default ask: what Wally wants to do, then the split approve button and Reject."
|
|
1934
1934
|
},
|
|
1935
|
+
{
|
|
1936
|
+
"name": "WithRequester",
|
|
1937
|
+
"code": "import { ApprovalCard, ApprovalCardActions, ApprovalCardContent } from '@wallarm-org/design-system/ApprovalCard';\nimport { AgentItem, AvatarContent, AvatarDescription, AvatarName } from '@wallarm-org/design-system/Avatar';\nimport { Button } from '@wallarm-org/design-system/Button';\n\nexport const WithRequester = () => (\n <ApprovalCard data-testid='approval-card'>\n <ApprovalCardContent>\n <AgentItem agent='acquit' size={40} live data-testid='approval-card-requester'>\n <AvatarContent>\n <AvatarName>Acquit</AvatarName>\n <AvatarDescription>False Positive Resolver</AvatarDescription>\n </AvatarContent>\n </AgentItem>\n <p>Mark 12 requests to /api/search as false positives and add an exception rule</p>\n </ApprovalCardContent>\n <ApprovalCardActions>\n <Button>Allow</Button>\n <Button variant='secondary' color='neutral'>\n Reject\n </Button>\n </ApprovalCardActions>\n </ApprovalCard>\n);",
|
|
1938
|
+
"storyFile": "ApprovalCard/ApprovalCard.stories.tsx",
|
|
1939
|
+
"storyTitle": "AI/ApprovalCard",
|
|
1940
|
+
"description": "An agent's request: its live 40px `AgentItem` (the 3D character, name and role, no plate) opens the content."
|
|
1941
|
+
},
|
|
1935
1942
|
{
|
|
1936
1943
|
"name": "PendingLongText",
|
|
1937
1944
|
"code": "import { ApprovalCard, ApprovalCardActions, ApprovalCardContent } from '@wallarm-org/design-system/ApprovalCard';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';\nimport { ChevronDown } from '@wallarm-org/design-system/icons';\nimport { SplitButton } from '@wallarm-org/design-system/SplitButton';\n\nexport const PendingLongText = () => (\n <ApprovalCard data-testid='approval-card'>\n <ApprovalCardContent>\n Disable the rule \"Block SQL injection attempts\" for the application \"Payments API\" and\n redeploy the policy to every node in the eu-west-1 cluster. Affected endpoint:\n https://payments.example.com/api/v2/transactions/refunds/batch-processing/callbacks\n </ApprovalCardContent>\n <ApprovalCardActions>\n <DropdownMenu positioning={{ placement: 'bottom-end' }}>\n <SplitButton>\n <Button>Always allow in this session</Button>\n <DropdownMenuTrigger asChild>\n <Button aria-label='More approval options' data-testid='approval-card-more'>\n <ChevronDown />\n </Button>\n </DropdownMenuTrigger>\n </SplitButton>\n <DropdownMenuContent>\n <DropdownMenuItem data-testid='approval-card-allow-once'>Allow once</DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n <Button variant='secondary' color='neutral'>\n Reject\n </Button>\n </ApprovalCardActions>\n </ApprovalCard>\n);",
|
|
@@ -3262,6 +3269,13 @@
|
|
|
3262
3269
|
"storyTitle": "Data Display/Attribute",
|
|
3263
3270
|
"description": "The same value components in the horizontal layout, where a wide one such as\n`IpList type='horizontal'` needs its row to span both columns."
|
|
3264
3271
|
},
|
|
3272
|
+
{
|
|
3273
|
+
"name": "AgentValue",
|
|
3274
|
+
"code": "import { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\nimport { AgentItem, Avatar, AvatarContent, AvatarFallback, AvatarName } from '@wallarm-org/design-system/Avatar';\n\nexport const AgentValue = () => (\n <div className='w-[400px] flex flex-col gap-16'>\n <Attribute data-testid='attr-run-by'>\n <AttributeLabel>Run by</AttributeLabel>\n <AttributeValue>\n <AgentItem agent='radar' data-testid='attr-run-by-agent'>\n <AvatarContent>\n <AvatarName>Radar</AvatarName>\n </AvatarContent>\n </AgentItem>\n </AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' data-testid='attr-proposed-by'>\n <AttributeLabel>Proposed by</AttributeLabel>\n <AttributeValue>\n <AgentItem agent='acquit' data-testid='attr-proposed-by-agent'>\n <AvatarContent>\n <AvatarName>Acquit</AvatarName>\n </AvatarContent>\n </AgentItem>\n </AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' data-testid='attr-approved-by'>\n <AttributeLabel>Approved by</AttributeLabel>\n <AttributeValue>\n <Avatar size='sm' data-testid='attr-approved-by-person'>\n <AvatarFallback name='Artem Miskevich' />\n <AvatarContent>\n <AvatarName>Artem Miskevich</AvatarName>\n </AvatarContent>\n </Avatar>\n </AttributeValue>\n </Attribute>\n </div>\n);",
|
|
3275
|
+
"storyFile": "Attribute/Attribute.stories.tsx",
|
|
3276
|
+
"storyTitle": "Data Display/Attribute",
|
|
3277
|
+
"description": "An agent as the value — Run by, Proposed by: `AgentItem` at 20 px beside the text-sm value, the agent's glyph with\nno plate, where a person gets the `Avatar` plate."
|
|
3278
|
+
},
|
|
3265
3279
|
{
|
|
3266
3280
|
"name": "HorizontalLoading",
|
|
3267
3281
|
"code": "import { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\n\nexport const HorizontalLoading = () => (\n <div className='w-[400px] flex flex-col gap-8'>\n <Attribute orientation='horizontal' loading>\n <AttributeLabel>Created at</AttributeLabel>\n <AttributeValue />\n </Attribute>\n <Attribute orientation='horizontal' loading>\n <AttributeLabel>Status</AttributeLabel>\n <AttributeValue />\n </Attribute>\n </div>\n);",
|
|
@@ -3322,7 +3336,7 @@
|
|
|
3322
3336
|
},
|
|
3323
3337
|
{
|
|
3324
3338
|
"name": "Avatar",
|
|
3325
|
-
"description": "A person's photo on a rounded plate, falling back to initials or an icon while it loads, when it fails, or when there is none. It is decorative beside a visible name; standing alone, give it `aria-label` so it reads as an image. Add `AvatarContent` with `AvatarName` (and an optional `AvatarDescription`) for the user item: plate and name in one row. To let people change it, make the avatar the `FileUploadTrigger` (`asChild`) and give it `as='button'` — picking only previews, and your form uploads.",
|
|
3339
|
+
"description": "A person's photo on a rounded plate, falling back to initials or an icon while it loads, when it fails, or when there is none. It is decorative beside a visible name; standing alone, give it `aria-label` so it reads as an image. Add `AvatarContent` with `AvatarName` (and an optional `AvatarDescription`) for the user item: plate and name in one row. An AI agent takes `AgentItem` instead of `Avatar`: its character, with no plate, before the same `AvatarContent`. To let people change it, make the avatar the `FileUploadTrigger` (`asChild`) and give it `as='button'` — picking only previews, and your form uploads.",
|
|
3326
3340
|
"importPath": "@wallarm-org/design-system/Avatar",
|
|
3327
3341
|
"props": [
|
|
3328
3342
|
{
|
|
@@ -3435,6 +3449,100 @@
|
|
|
3435
3449
|
}
|
|
3436
3450
|
],
|
|
3437
3451
|
"subComponents": [
|
|
3452
|
+
{
|
|
3453
|
+
"name": "AgentItem",
|
|
3454
|
+
"props": [
|
|
3455
|
+
{
|
|
3456
|
+
"name": "defaultChecked",
|
|
3457
|
+
"type": "boolean | undefined",
|
|
3458
|
+
"required": false
|
|
3459
|
+
},
|
|
3460
|
+
{
|
|
3461
|
+
"name": "defaultValue",
|
|
3462
|
+
"type": "string | number | readonly string[] | undefined",
|
|
3463
|
+
"required": false
|
|
3464
|
+
},
|
|
3465
|
+
{
|
|
3466
|
+
"name": "autoFocus",
|
|
3467
|
+
"type": "boolean | undefined",
|
|
3468
|
+
"required": false
|
|
3469
|
+
},
|
|
3470
|
+
{
|
|
3471
|
+
"name": "id",
|
|
3472
|
+
"type": "string | undefined",
|
|
3473
|
+
"required": false
|
|
3474
|
+
},
|
|
3475
|
+
{
|
|
3476
|
+
"name": "tabIndex",
|
|
3477
|
+
"type": "number | undefined",
|
|
3478
|
+
"required": false
|
|
3479
|
+
},
|
|
3480
|
+
{
|
|
3481
|
+
"name": "title",
|
|
3482
|
+
"type": "string | undefined",
|
|
3483
|
+
"required": false
|
|
3484
|
+
},
|
|
3485
|
+
{
|
|
3486
|
+
"name": "rel",
|
|
3487
|
+
"type": "string | undefined",
|
|
3488
|
+
"required": false
|
|
3489
|
+
},
|
|
3490
|
+
{
|
|
3491
|
+
"name": "onChange",
|
|
3492
|
+
"type": "ChangeEventHandler<T, Element> | undefined",
|
|
3493
|
+
"required": false
|
|
3494
|
+
},
|
|
3495
|
+
{
|
|
3496
|
+
"name": "data-testid",
|
|
3497
|
+
"type": "string | undefined",
|
|
3498
|
+
"required": false
|
|
3499
|
+
},
|
|
3500
|
+
{
|
|
3501
|
+
"name": "agent",
|
|
3502
|
+
"type": "AgentCharacterId",
|
|
3503
|
+
"required": false
|
|
3504
|
+
},
|
|
3505
|
+
{
|
|
3506
|
+
"name": "look",
|
|
3507
|
+
"type": "undefined",
|
|
3508
|
+
"required": false
|
|
3509
|
+
},
|
|
3510
|
+
{
|
|
3511
|
+
"name": "size",
|
|
3512
|
+
"type": "AgentItemSize | undefined",
|
|
3513
|
+
"required": false,
|
|
3514
|
+
"description": "20 beside text-sm (table rows, attributes), 16 beside text-xs (D3); 40 and up for cards that show the agent.",
|
|
3515
|
+
"defaultValue": "20"
|
|
3516
|
+
},
|
|
3517
|
+
{
|
|
3518
|
+
"name": "state",
|
|
3519
|
+
"type": "AgentGlyphState | undefined",
|
|
3520
|
+
"required": false
|
|
3521
|
+
},
|
|
3522
|
+
{
|
|
3523
|
+
"name": "hasApplications",
|
|
3524
|
+
"type": "boolean | undefined",
|
|
3525
|
+
"required": false
|
|
3526
|
+
},
|
|
3527
|
+
{
|
|
3528
|
+
"name": "coverage",
|
|
3529
|
+
"type": "\"full\" | \"partial\" | undefined",
|
|
3530
|
+
"required": false
|
|
3531
|
+
},
|
|
3532
|
+
{
|
|
3533
|
+
"name": "live",
|
|
3534
|
+
"type": "boolean | undefined",
|
|
3535
|
+
"required": false,
|
|
3536
|
+
"description": "3D sizes only: animated, as in an Overview row."
|
|
3537
|
+
},
|
|
3538
|
+
{
|
|
3539
|
+
"name": "seed",
|
|
3540
|
+
"type": "string | undefined",
|
|
3541
|
+
"required": false,
|
|
3542
|
+
"description": "3D sizes only: the agent's uid, keeping its timing distinct from its neighbours. Defaults to `agent`."
|
|
3543
|
+
}
|
|
3544
|
+
]
|
|
3545
|
+
},
|
|
3438
3546
|
{
|
|
3439
3547
|
"name": "AvatarContent",
|
|
3440
3548
|
"props": [
|
|
@@ -3775,6 +3883,13 @@
|
|
|
3775
3883
|
"storyTitle": "Data Display/Avatar",
|
|
3776
3884
|
"description": "`AvatarDescription` adds a secondary line under the name — the email in the account menu. Both lines truncate."
|
|
3777
3885
|
},
|
|
3886
|
+
{
|
|
3887
|
+
"name": "Agent",
|
|
3888
|
+
"code": "import { AgentItem, Avatar, AvatarContent, AvatarDescription, AvatarFallback, AvatarName } from '@wallarm-org/design-system/Avatar';\nimport { VStack } from '@wallarm-org/design-system/Stack';\n\nexport const Agent = () => (\n <VStack gap={16} align='start' data-testid='avatar'>\n <Avatar size='sm' data-testid='avatar-person'>\n <AvatarFallback name='Artem Miskevich' />\n <AvatarContent>\n <AvatarName>Artem Miskevich</AvatarName>\n </AvatarContent>\n </Avatar>\n {([20, 24, 16] as const).map(size => (\n <AgentItem key={size} agent='radar' size={size} data-testid={`avatar-agent-${size}`}>\n <AvatarContent>\n <AvatarName>Radar</AvatarName>\n </AvatarContent>\n </AgentItem>\n ))}\n <AgentItem agent='sift' data-testid='avatar-agent-description'>\n <AvatarContent>\n <AvatarName>Sift</AvatarName>\n <AvatarDescription>False Positives Analyzer</AvatarDescription>\n </AvatarContent>\n </AgentItem>\n <div className='w-120'>\n <AgentItem agent='acquit' data-testid='avatar-agent-truncated'>\n <AvatarContent>\n <AvatarName>Acquit, the false positive resolver</AvatarName>\n </AvatarContent>\n </AgentItem>\n </div>\n </VStack>\n);",
|
|
3889
|
+
"storyFile": "Avatar/Avatar.stories.tsx",
|
|
3890
|
+
"storyTitle": "Data Display/Avatar",
|
|
3891
|
+
"description": "An AI agent's user item: `AgentItem` puts the agent's glyph where the plate goes, with no plate and no circle, and\ntakes the same `AvatarContent`. 20 px beside the text-sm name, 24 px for roomier rows, 16 px beside text-xs."
|
|
3892
|
+
},
|
|
3778
3893
|
{
|
|
3779
3894
|
"name": "Fallback",
|
|
3780
3895
|
"code": "import { Avatar, AvatarFallback, AvatarImage } from '@wallarm-org/design-system/Avatar';\nimport { HStack } from '@wallarm-org/design-system/Stack';\n\nexport const Fallback = () => (\n <HStack gap={12} align='center' data-testid='avatar'>\n <Avatar>\n <AvatarFallback name='Grace Hopper' />\n </Avatar>\n <Avatar>\n <AvatarFallback />\n </Avatar>\n <Avatar data-testid='avatar-broken-initials'>\n <AvatarImage src='/does-not-exist.png' />\n <AvatarFallback name='Alan Turing' />\n </Avatar>\n <Avatar data-testid='avatar-broken-icon'>\n <AvatarImage src='/does-not-exist.png' />\n <AvatarFallback />\n </Avatar>\n </HStack>\n);",
|
|
@@ -6512,6 +6627,13 @@
|
|
|
6512
6627
|
"storyTitle": "AI/ChainOfThought",
|
|
6513
6628
|
"description": "Steps with children toggle open; a nested chain can hold its own collapsible steps."
|
|
6514
6629
|
},
|
|
6630
|
+
{
|
|
6631
|
+
"name": "WithAgent",
|
|
6632
|
+
"code": "import { AgentGlyph, defaultLook } from '@wallarm-org/design-system/AgentGlyph';\nimport { ChainOfThought, ChainOfThoughtStep } from '@wallarm-org/design-system/ChainOfThought';\nimport { Bot, Brain, Radar, Search, Wrench } from '@wallarm-org/design-system/icons';\n\nexport const WithAgent = () => (\n <ChainOfThought data-testid='cot'>\n <ChainOfThoughtStep icon={<Brain />} label='Thought for 5s' />\n <ChainOfThoughtStep\n icon={<AgentGlyph agent='radar' size={16} />}\n label='Ran Radar, Attack Anomaly Investigator'\n defaultOpen\n data-testid='cot-agent'\n >\n <ChainOfThought>\n <ChainOfThoughtStep icon={<Search />} label='Searched for anomalous requests' />\n <ChainOfThoughtStep icon={<Wrench />} label='Called get_attacks' />\n </ChainOfThought>\n </ChainOfThoughtStep>\n <ChainOfThoughtStep\n icon={<AgentGlyph agent='sift' size={16} />}\n label='Ran Sift, False Positives Analyzer'\n />\n <ChainOfThoughtStep\n icon={<AgentGlyph look={defaultLook('agent-7f3a')} size={16} />}\n label='Ran Tune'\n />\n <ChainOfThoughtStep icon={<Bot />} label='Ran an unknown subagent' />\n </ChainOfThought>\n);",
|
|
6633
|
+
"storyFile": "ChainOfThought/ChainOfThought.stories.tsx",
|
|
6634
|
+
"storyTitle": "AI/ChainOfThought",
|
|
6635
|
+
"description": "A sub-agent step shows the sub-agent's 16px `AgentGlyph` in the `icon` slot when the agent is known, a custom\nagent its `defaultLook(uid)`; the label names it. `Bot` stays the fallback for an unknown agent."
|
|
6636
|
+
},
|
|
6515
6637
|
{
|
|
6516
6638
|
"name": "SimpleRows",
|
|
6517
6639
|
"code": "import { ChainOfThought, ChainOfThoughtStep } from '@wallarm-org/design-system/ChainOfThought';\n\nexport const SimpleRows = () => (\n <ChainOfThought data-testid='cot'>\n <ChainOfThoughtStep icon={null} label='Checked 3 applications' />\n <ChainOfThoughtStep icon={null} label='Compared rule sets' />\n <ChainOfThoughtStep icon={null} label='Found 2 overlapping rules' />\n </ChainOfThought>\n);",
|
|
@@ -7235,7 +7357,7 @@
|
|
|
7235
7357
|
"code": "import { ChatTrigger } from '@wallarm-org/design-system/Chat';\n\nexport const Trigger = () => <ChatTrigger data-testid='chat-trigger' />;",
|
|
7236
7358
|
"storyFile": "Chat/Chat.stories.tsx",
|
|
7237
7359
|
"storyTitle": "AI/Chat",
|
|
7238
|
-
"description": "The app-header button that opens the panel (Figma 101:1034): the Wally
|
|
7360
|
+
"description": "The app-header button that opens the panel (Figma 101:1034): the 24 px Wally glyph in a ghost small\n`Button`, with an \"Ask Wally\" tooltip that doubles as its accessible name (`label`)."
|
|
7239
7361
|
},
|
|
7240
7362
|
{
|
|
7241
7363
|
"name": "TriggerWithDrawer",
|
|
@@ -12527,6 +12649,13 @@
|
|
|
12527
12649
|
"storyTitle": "Overlay/Drawer",
|
|
12528
12650
|
"description": "`DrawerDescription` under the title, wired to `aria-describedby` so it is read with the panel\nrather than after it. `DrawerHeader` stacks the two, keeping the close button right-aligned."
|
|
12529
12651
|
},
|
|
12652
|
+
{
|
|
12653
|
+
"name": "WithAgent",
|
|
12654
|
+
"code": "import { AgentItem, AvatarContent, AvatarName } from '@wallarm-org/design-system/Avatar';\nimport { Badge } from '@wallarm-org/design-system/Badge';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { Drawer, DrawerBody, DrawerContent, DrawerDescription, DrawerHeader, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';\nimport { HStack } from '@wallarm-org/design-system/Stack';\nimport { Text } from '@wallarm-org/design-system/Text';\nimport { DRAWER_SIZES } from './constants';\n\nexport const WithAgent = () => (\n <Drawer width={DRAWER_SIZES.medium} data-testid='agent-drawer'>\n <DrawerTrigger asChild>\n <Button variant='outline' color='neutral'>\n Open Agent Drawer\n </Button>\n </DrawerTrigger>\n\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>\n Attack spike{' '}\n <span className='font-mono font-normal text-text-secondary'>\n GET shop.acme.internal/search\n </span>\n </DrawerTitle>\n <DrawerDescription>\n <HStack\n gap={8}\n align='center'\n wrap='wrap'\n className='mt-4'\n data-testid='agent-drawer-meta'\n >\n <Badge color='amber' type='outline'>\n Needs approval\n </Badge>\n <span aria-hidden='true'>·</span>\n <Text size='sm' weight='medium' color='primary'>\n Malicious anomaly\n </Text>\n <span aria-hidden='true'>·</span>\n {/* AgentItem is inline: it sits on the text line, so the comma follows the name as in a sentence */}\n <Text size='sm' color='secondary'>\n Found by{' '}\n <AgentItem agent='radar' data-testid='agent-drawer-found-by'>\n <AvatarContent>\n <AvatarName className='font-medium'>Radar</AvatarName>\n </AvatarContent>\n </AgentItem>\n , updated by{' '}\n <AgentItem agent='sift' data-testid='agent-drawer-updated-by'>\n <AvatarContent>\n <AvatarName className='font-medium'>Sift</AvatarName>\n </AvatarContent>\n </AgentItem>{' '}\n <Text asChild size='sm' decoration='dashed'>\n <span>5 min ago</span>\n </Text>\n </Text>\n </HStack>\n </DrawerDescription>\n </DrawerHeader>\n <DrawerBody>\n <ContentPlaceholder fillHeight />\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n);",
|
|
12655
|
+
"storyFile": "Drawer/Drawer.stories.tsx",
|
|
12656
|
+
"storyTitle": "Overlay/Drawer",
|
|
12657
|
+
"description": "Agents as actors in the header: the meta line names who found and who last changed the item with `AgentItem`\n(20 px glyph beside the text-sm name, no plate), composed in `DrawerDescription` like any other inline content."
|
|
12658
|
+
},
|
|
12530
12659
|
{
|
|
12531
12660
|
"name": "WithFooterLeftActions",
|
|
12532
12661
|
"code": "import { Button } from '@wallarm-org/design-system/Button';\nimport { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerFooter, DrawerFooterControls, DrawerHeader, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';\nimport { Switch, SwitchControl, SwitchLabel } from '@wallarm-org/design-system/Switch';\n\nexport const WithFooterLeftActions = () => (\n <Drawer>\n <DrawerTrigger asChild>\n <Button variant='outline' color='neutral'>\n Open with Footer Actions\n </Button>\n </DrawerTrigger>\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>Footer with Left Actions</DrawerTitle>\n </DrawerHeader>\n\n <DrawerBody>\n <ContentPlaceholder fillHeight />\n </DrawerBody>\n\n <DrawerFooter>\n <DrawerFooterControls placement='left'>\n <Switch>\n <SwitchControl />\n <SwitchLabel>Remember choice</SwitchLabel>\n </Switch>\n </DrawerFooterControls>\n\n <DrawerClose asChild>\n <Button variant='ghost' color='neutral' size='large'>\n Cancel\n </Button>\n </DrawerClose>\n <Button variant='primary' color='brand' size='large'>\n Apply\n </Button>\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n);",
|
|
@@ -13708,6 +13837,13 @@
|
|
|
13708
13837
|
"storyTitle": "Actions/DropdownMenu",
|
|
13709
13838
|
"description": "`DropdownMenuItemIcon` sits before the label. Icon every item in a group or none of\nthem — a half-iconned list reads as though some items are missing theirs."
|
|
13710
13839
|
},
|
|
13840
|
+
{
|
|
13841
|
+
"name": "WithAgents",
|
|
13842
|
+
"code": "import { AgentGlyph, defaultLook } from '@wallarm-org/design-system/AgentGlyph';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDescription, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';\nimport { UserPlus } from '@wallarm-org/design-system/icons';\n\nexport const WithAgents = () => (\n <DropdownMenu data-testid='dropdown-menu'>\n <DropdownMenuTrigger asChild>\n <Button variant='outline' color='neutral'>\n <UserPlus />\n Assign to\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem>\n <DropdownMenuItemIcon>\n <AgentGlyph agent='radar' size={16} />\n </DropdownMenuItemIcon>\n <DropdownMenuItemContent>\n <DropdownMenuItemText>Radar</DropdownMenuItemText>\n <DropdownMenuItemDescription>Attack Anomaly Investigator</DropdownMenuItemDescription>\n </DropdownMenuItemContent>\n </DropdownMenuItem>\n <DropdownMenuItem>\n <DropdownMenuItemIcon>\n <AgentGlyph agent='sift' size={16} />\n </DropdownMenuItemIcon>\n <DropdownMenuItemContent>\n <DropdownMenuItemText>Sift</DropdownMenuItemText>\n <DropdownMenuItemDescription>False Positives Analyzer</DropdownMenuItemDescription>\n </DropdownMenuItemContent>\n </DropdownMenuItem>\n <DropdownMenuItem>\n <DropdownMenuItemIcon>\n <AgentGlyph agent='lens' size={16} />\n </DropdownMenuItemIcon>\n <DropdownMenuItemText>Lens</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuItem>\n <DropdownMenuItemIcon>\n <AgentGlyph agent='bard' size={16} />\n </DropdownMenuItemIcon>\n <DropdownMenuItemText>Bard</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuItem>\n <DropdownMenuItemIcon>\n <AgentGlyph look={defaultLook('agent-7f3a')} size={16} />\n </DropdownMenuItemIcon>\n <DropdownMenuItemText>Night watch</DropdownMenuItemText>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n);",
|
|
13843
|
+
"storyFile": "DropdownMenu/DropdownMenu.stories.tsx",
|
|
13844
|
+
"storyTitle": "Actions/DropdownMenu",
|
|
13845
|
+
"description": "An agent takes the icon's place: a 16 px `AgentGlyph` in `DropdownMenuItemIcon`, beside the agent's\nvisible name — the glyph is decorative and never announced. A custom agent passes its stored look\n(`defaultLook(uid)` until it has one)."
|
|
13846
|
+
},
|
|
13711
13847
|
{
|
|
13712
13848
|
"name": "WithFooter",
|
|
13713
13849
|
"code": "import { Button } from '@wallarm-org/design-system/Button';\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuFooter, DropdownMenuItem, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';\nimport { Kbd, KbdGroup } from '@wallarm-org/design-system/Kbd';\n\nexport const WithFooter = () => (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant='outline' color='neutral'>\n Open\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem>Profile</DropdownMenuItem>\n <DropdownMenuItem>Billing</DropdownMenuItem>\n <DropdownMenuItem>Settings</DropdownMenuItem>\n <DropdownMenuItem>Notifications</DropdownMenuItem>\n <DropdownMenuItem>Integrations</DropdownMenuItem>\n <DropdownMenuItem>Security</DropdownMenuItem>\n <DropdownMenuItem>API Keys</DropdownMenuItem>\n <DropdownMenuItem>Webhooks</DropdownMenuItem>\n <DropdownMenuItem>Audit Log</DropdownMenuItem>\n <DropdownMenuItem>Team Members</DropdownMenuItem>\n <DropdownMenuItem>Permissions</DropdownMenuItem>\n <DropdownMenuItem>Usage</DropdownMenuItem>\n <DropdownMenuFooter>\n <span className='flex items-center gap-4'>\n <KbdGroup>\n <Kbd>↑</Kbd>\n <Kbd>↓</Kbd>\n </KbdGroup>\n to navigate\n </span>\n <span className='flex items-center gap-4'>\n <KbdGroup>\n <Kbd>↵</Kbd>\n </KbdGroup>\n to select\n </span>\n </DropdownMenuFooter>\n </DropdownMenuContent>\n </DropdownMenu>\n);",
|
|
@@ -17670,6 +17806,12 @@
|
|
|
17670
17806
|
"required": false,
|
|
17671
17807
|
"description": "Secondary text at the right end of the row, such as a count."
|
|
17672
17808
|
},
|
|
17809
|
+
{
|
|
17810
|
+
"name": "icon",
|
|
17811
|
+
"type": "ReactNode",
|
|
17812
|
+
"required": false,
|
|
17813
|
+
"description": "Leading element before the text, such as an agent's 16 px `AgentGlyph`. It keeps its own size:\nthe row does not resize it."
|
|
17814
|
+
},
|
|
17673
17815
|
{
|
|
17674
17816
|
"name": "title",
|
|
17675
17817
|
"type": "string | undefined",
|
|
@@ -17952,6 +18094,12 @@
|
|
|
17952
18094
|
{
|
|
17953
18095
|
"name": "FilterDropdownTrigger",
|
|
17954
18096
|
"props": [
|
|
18097
|
+
{
|
|
18098
|
+
"name": "renderIcon",
|
|
18099
|
+
"type": "((item: any) => ReactNode) | undefined",
|
|
18100
|
+
"required": false,
|
|
18101
|
+
"description": "Single mode: a leading element for the picked item, such as the agent's 16 px `AgentGlyph`\nbefore its name. Not called while unset or in multi mode."
|
|
18102
|
+
},
|
|
17955
18103
|
{
|
|
17956
18104
|
"name": "title",
|
|
17957
18105
|
"type": "string | undefined",
|
|
@@ -18035,6 +18183,13 @@
|
|
|
18035
18183
|
"storyTitle": "Inputs/FilterDropdown",
|
|
18036
18184
|
"description": "Multi mode: checkboxes, OR-ed, the menu stays open. The trigger shows the name with the value or\na count, and the ✕ (or Backspace on the trigger) clears. Pass your own `FilterDropdownClear` as\nthe trigger's child to put an analytics id on the ✕."
|
|
18037
18185
|
},
|
|
18186
|
+
{
|
|
18187
|
+
"name": "Agent",
|
|
18188
|
+
"code": "import { createListCollection } from '@ark-ui/react/collection';\nimport { FilterDropdown, FilterDropdownAllOption, FilterDropdownContent, FilterDropdownFooter, FilterDropdownOption, FilterDropdownTrigger } from '@wallarm-org/design-system/FilterDropdown';\n\nexport const Agent = () => (\n <div className='flex gap-8'>\n <FilterDropdown\n label='Agent'\n allLabel='All agents'\n collection={createListCollection({ items: agents })}\n defaultValue={['radar']}\n data-testid='filter-dropdown-single'\n >\n <FilterDropdownTrigger renderIcon={renderAgentGlyph} />\n <FilterDropdownContent>\n <FilterDropdownAllOption />\n {agents.map(item => (\n <FilterDropdownOption key={item.value} item={item} icon={renderAgentGlyph(item)}>\n {item.label}\n </FilterDropdownOption>\n ))}\n </FilterDropdownContent>\n </FilterDropdown>\n <FilterDropdown\n label='Agent'\n multiple\n collection={createListCollection({ items: agents })}\n defaultValue={['sift']}\n data-testid='filter-dropdown-multi'\n >\n <FilterDropdownTrigger />\n <FilterDropdownContent>\n {agents.map(item => (\n <FilterDropdownOption key={item.value} item={item} icon={renderAgentGlyph(item)}>\n {item.label}\n </FilterDropdownOption>\n ))}\n <FilterDropdownFooter />\n </FilterDropdownContent>\n </FilterDropdown>\n </div>\n);",
|
|
18189
|
+
"storyFile": "FilterDropdown/FilterDropdown.stories.tsx",
|
|
18190
|
+
"storyTitle": "Inputs/FilterDropdown",
|
|
18191
|
+
"description": "Filter by agent: each option leads with the agent's 16 px glyph through `icon`, and in single\nmode the trigger's `renderIcon` puts the picked agent's glyph before its name. Multi keeps the\ntext forms."
|
|
18192
|
+
},
|
|
18038
18193
|
{
|
|
18039
18194
|
"name": "LabelForms",
|
|
18040
18195
|
"code": "export const LabelForms = () => (\n <div className='flex flex-col gap-12'>\n <LabelFormRow caption='single, unset' value={[]} testId='single-unset' />\n <LabelFormRow caption='single, set' value={['wasm']} testId='single-set' />\n <LabelFormRow caption='multi, unset' multiple value={[]} testId='multi-unset' />\n <LabelFormRow caption='multi, one value' multiple value={['lua']} testId='multi-one' />\n <LabelFormRow\n caption='multi, several values'\n multiple\n value={['lua', 'wasm', 'plugin']}\n testId='multi-many'\n />\n </div>\n);",
|
|
@@ -18636,6 +18791,13 @@
|
|
|
18636
18791
|
"storyTitle": "Inputs/FilterInput/FilterInput",
|
|
18637
18792
|
"description": "A field with a `description` carries it into a tooltip on the chip's first segment, so a committed filter can still explain itself; the operator and value segments keep click-to-edit."
|
|
18638
18793
|
},
|
|
18794
|
+
{
|
|
18795
|
+
"name": "WithAgentValues",
|
|
18796
|
+
"code": "import { FilterInput } from '@wallarm-org/design-system/FilterInput';\n\n<FilterInput fields={agentValueFields} placeholder=\"Type to filter...\" />",
|
|
18797
|
+
"storyFile": "FilterInput/stories/FilterInput.stories.tsx",
|
|
18798
|
+
"storyTitle": "Inputs/FilterInput/FilterInput",
|
|
18799
|
+
"description": "A value's `icon` leads its row in the value menu: an agent is its 16 px `AgentGlyph`, no plate, beside its name. The chip shows the name alone."
|
|
18800
|
+
},
|
|
18639
18801
|
{
|
|
18640
18802
|
"name": "ErrorEmpty",
|
|
18641
18803
|
"code": "import { FilterInput } from '@wallarm-org/design-system/FilterInput';\n\n<FilterInput fields={attackVectorFields} placeholder=\"Type to filter...\" error />",
|
|
@@ -29812,14 +29974,14 @@
|
|
|
29812
29974
|
"examples": [
|
|
29813
29975
|
{
|
|
29814
29976
|
"name": "Basic",
|
|
29815
|
-
"code": "import { useMemo, useState } from 'react';\nimport { ChevronRight, Plus, Search, Users } from '@wallarm-org/design-system/icons';\nimport { SearchModal, SearchModalBody, SearchModalContent, SearchModalEmpty, SearchModalFooter, SearchModalGroup, SearchModalGroupLabel, SearchModalInput, SearchModalItem } from '@wallarm-org/design-system/SearchModal';\nimport { Text } from '@wallarm-org/design-system/Text';\
|
|
29977
|
+
"code": "import { useMemo, useState } from 'react';\nimport { AgentGlyph } from '@wallarm-org/design-system/AgentGlyph';\nimport { ChevronRight, Plus, Search, Users } from '@wallarm-org/design-system/icons';\nimport { SearchModal, SearchModalBody, SearchModalContent, SearchModalEmpty, SearchModalFooter, SearchModalGroup, SearchModalGroupLabel, SearchModalInput, SearchModalItem } from '@wallarm-org/design-system/SearchModal';\nimport { Text } from '@wallarm-org/design-system/Text';\n\nexport const Basic = () => {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n\n const filteredRecents = useMemo(() => filterItems(RECENT_ITEMS, query), [query]);\n const filteredJumpTo = useMemo(() => filterItems(JUMP_TO_ITEMS, query), [query]);\n const hasResults = filteredRecents.length > 0 || filteredJumpTo.length > 0;\n\n return (\n <SearchModal open={open} onOpenChange={setOpen} onQueryChange={setQuery} data-testid='search'>\n <SearchTriggerButton />\n <SearchModalContent>\n <SearchModalInput placeholder='Search products, features, and more\\u2026' />\n <SearchModalBody>\n <SearchModalGroup>\n <SearchModalGroupLabel>\n <Text size='xs' color='secondary' weight='medium'>\n Quick actions\n </Text>\n </SearchModalGroupLabel>\n <SearchModalItem onSelect={noop}>\n <AgentGlyph agent='wally' size={20} />\n <Text size='sm'>{query ? `Ask Wally \"${query}\"` : 'Ask Wally'}</Text>\n </SearchModalItem>\n {!query && (\n <>\n <SearchModalItem onSelect={noop}>\n <Users className='!icon-md' />\n <Text size='sm'>Switch tenant</Text>\n </SearchModalItem>\n <SearchModalItem onSelect={noop}>\n <Plus className='!icon-md' />\n <Text size='sm'>Create…</Text>\n </SearchModalItem>\n </>\n )}\n </SearchModalGroup>\n\n {filteredRecents.length > 0 && (\n <SearchModalGroup>\n <SearchModalGroupLabel>\n <Text size='xs' color='secondary' weight='medium'>\n Recent\n </Text>\n </SearchModalGroupLabel>\n {filteredRecents.map(item => (\n <SearchModalItem key={item.id} onSelect={noop}>\n {item.icon}\n <Text size='sm'>{item.label}</Text>\n <span className='ml-auto'>\n <Text size='xs' color='secondary'>\n {item.date}\n </Text>\n </span>\n </SearchModalItem>\n ))}\n </SearchModalGroup>\n )}\n\n {(hasResults || !query) && (\n <SearchModalGroup>\n <SearchModalGroupLabel>\n <Text size='xs' color='secondary' weight='medium'>\n {query ? 'Go to' : 'Jump to'}\n </Text>\n </SearchModalGroupLabel>\n {(query ? filteredJumpTo : JUMP_TO_ITEMS).map(item => (\n <SearchModalItem key={item.id} onSelect={noop}>\n {item.icon}\n <Text size='sm'>{item.label}</Text>\n <ChevronRight className='text-text-tertiary ml-auto !icon-sm' />\n </SearchModalItem>\n ))}\n </SearchModalGroup>\n )}\n\n {query && !hasResults && (\n <SearchModalGroup>\n <SearchModalEmpty>\n <Text size='sm' color='secondary'>\n No results\n </Text>\n </SearchModalEmpty>\n </SearchModalGroup>\n )}\n </SearchModalBody>\n <SearchModalFooter />\n </SearchModalContent>\n </SearchModal>\n );\n};",
|
|
29816
29978
|
"storyFile": "SearchModal/SearchModal.stories.tsx",
|
|
29817
29979
|
"storyTitle": "Navigation/SearchModal",
|
|
29818
29980
|
"description": "The full palette with recent history. Type to filter: \"Jump to\" relabels to\n\"Go to\", recents hide when nothing matches, and a no-results fallback offers\nAsk Wally. Covers PRD states 1, 3, 4 and 5."
|
|
29819
29981
|
},
|
|
29820
29982
|
{
|
|
29821
29983
|
"name": "EmptyRecents",
|
|
29822
|
-
"code": "import { useMemo, useState } from 'react';\nimport { ChevronRight, Plus, Search, Users } from '@wallarm-org/design-system/icons';\nimport { SearchModal, SearchModalBody, SearchModalContent, SearchModalEmpty, SearchModalFooter, SearchModalGroup, SearchModalGroupLabel, SearchModalInput, SearchModalItem } from '@wallarm-org/design-system/SearchModal';\nimport { Text } from '@wallarm-org/design-system/Text';\
|
|
29984
|
+
"code": "import { useMemo, useState } from 'react';\nimport { AgentGlyph } from '@wallarm-org/design-system/AgentGlyph';\nimport { ChevronRight, Plus, Search, Users } from '@wallarm-org/design-system/icons';\nimport { SearchModal, SearchModalBody, SearchModalContent, SearchModalEmpty, SearchModalFooter, SearchModalGroup, SearchModalGroupLabel, SearchModalInput, SearchModalItem } from '@wallarm-org/design-system/SearchModal';\nimport { Text } from '@wallarm-org/design-system/Text';\n\nexport const EmptyRecents = () => {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n\n const filteredJumpTo = useMemo(() => filterItems(JUMP_TO_ITEMS, query), [query]);\n\n return (\n <SearchModal open={open} onOpenChange={setOpen} onQueryChange={setQuery}>\n <SearchTriggerButton />\n <SearchModalContent>\n <SearchModalInput placeholder='Search products, features, and more\\u2026' />\n <SearchModalBody>\n <SearchModalGroup>\n <SearchModalGroupLabel>\n <Text size='xs' color='secondary' weight='medium'>\n Quick actions\n </Text>\n </SearchModalGroupLabel>\n <SearchModalItem onSelect={noop}>\n <AgentGlyph agent='wally' size={20} />\n <Text size='sm'>{query ? `Ask Wally \"${query}\"` : 'Ask Wally'}</Text>\n </SearchModalItem>\n {!query && (\n <>\n <SearchModalItem onSelect={noop}>\n <Users className='!icon-md' />\n <Text size='sm'>Switch tenant</Text>\n </SearchModalItem>\n <SearchModalItem onSelect={noop}>\n <Plus className='!icon-md' />\n <Text size='sm'>Create…</Text>\n </SearchModalItem>\n </>\n )}\n </SearchModalGroup>\n\n {!query && (\n <SearchModalGroup>\n <SearchModalGroupLabel>\n <Text size='xs' color='secondary' weight='medium'>\n Recent\n </Text>\n </SearchModalGroupLabel>\n <SearchModalEmpty>\n <Text size='sm' color='secondary'>\n Nothing recent yet\n </Text>\n </SearchModalEmpty>\n </SearchModalGroup>\n )}\n\n {filteredJumpTo.length > 0 && (\n <SearchModalGroup>\n <SearchModalGroupLabel>\n <Text size='xs' color='secondary' weight='medium'>\n {query ? 'Go to' : 'Jump to'}\n </Text>\n </SearchModalGroupLabel>\n {filteredJumpTo.map(item => (\n <SearchModalItem key={item.id} onSelect={noop}>\n {item.icon}\n <Text size='sm'>{item.label}</Text>\n <ChevronRight className='text-text-tertiary ml-auto !icon-sm' />\n </SearchModalItem>\n ))}\n </SearchModalGroup>\n )}\n\n {query && filteredJumpTo.length === 0 && (\n <SearchModalGroup>\n <SearchModalEmpty>\n <Text size='sm' color='secondary'>\n No results\n </Text>\n </SearchModalEmpty>\n </SearchModalGroup>\n )}\n </SearchModalBody>\n <SearchModalFooter />\n </SearchModalContent>\n </SearchModal>\n );\n};",
|
|
29823
29985
|
"storyFile": "SearchModal/SearchModal.stories.tsx",
|
|
29824
29986
|
"storyTitle": "Navigation/SearchModal",
|
|
29825
29987
|
"description": "A new user with no history. The Recent section shows \"Nothing recent yet\"\ninstead of items. Matches PRD state 2."
|
|
@@ -29840,7 +30002,7 @@
|
|
|
29840
30002
|
},
|
|
29841
30003
|
{
|
|
29842
30004
|
"name": "DisabledItems",
|
|
29843
|
-
"code": "import { useMemo, useState } from 'react';\nimport { Plus, Search, Users } from '@wallarm-org/design-system/icons';\nimport { SearchModal, SearchModalBody, SearchModalContent, SearchModalEmpty, SearchModalFooter, SearchModalGroup, SearchModalGroupLabel, SearchModalInput, SearchModalItem } from '@wallarm-org/design-system/SearchModal';\nimport { Text } from '@wallarm-org/design-system/Text';\
|
|
30005
|
+
"code": "import { useMemo, useState } from 'react';\nimport { AgentGlyph } from '@wallarm-org/design-system/AgentGlyph';\nimport { Plus, Search, Users } from '@wallarm-org/design-system/icons';\nimport { SearchModal, SearchModalBody, SearchModalContent, SearchModalEmpty, SearchModalFooter, SearchModalGroup, SearchModalGroupLabel, SearchModalInput, SearchModalItem } from '@wallarm-org/design-system/SearchModal';\nimport { Text } from '@wallarm-org/design-system/Text';\n\nexport const DisabledItems = () => {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n\n const actions = useMemo(\n () =>\n filterItems(\n [\n { id: 'ask-wally', label: 'Ask Wally', icon: <AgentGlyph agent='wally' size={20} /> },\n { id: 'switch-tenant', label: 'Switch tenant', icon: <Users className='!icon-md' /> },\n { id: 'create', label: 'Create\\u2026', icon: <Plus className='!icon-md' /> },\n ],\n query,\n ),\n [query],\n );\n\n return (\n <SearchModal open={open} onOpenChange={setOpen} onQueryChange={setQuery}>\n <SearchTriggerButton />\n <SearchModalContent>\n <SearchModalInput placeholder='Search products, features, and more\\u2026' />\n <SearchModalBody>\n {actions.length > 0 ? (\n <SearchModalGroup>\n <SearchModalGroupLabel>\n <Text size='xs' color='secondary' weight='medium'>\n Quick actions\n </Text>\n </SearchModalGroupLabel>\n {actions.map(item => (\n <SearchModalItem\n key={item.id}\n onSelect={item.id === 'switch-tenant' ? undefined : noop}\n disabled={item.id === 'switch-tenant'}\n >\n {item.icon}\n <Text size='sm'>{item.label}</Text>\n {item.id === 'switch-tenant' && (\n <span className='ml-auto'>\n <Text size='xs' color='secondary'>\n Unavailable\n </Text>\n </span>\n )}\n </SearchModalItem>\n ))}\n </SearchModalGroup>\n ) : (\n <SearchModalGroup>\n <SearchModalEmpty>\n <Text size='sm' color='secondary'>\n No results\n </Text>\n </SearchModalEmpty>\n </SearchModalGroup>\n )}\n </SearchModalBody>\n <SearchModalFooter />\n </SearchModalContent>\n </SearchModal>\n );\n};",
|
|
29844
30006
|
"storyFile": "SearchModal/SearchModal.stories.tsx",
|
|
29845
30007
|
"storyTitle": "Navigation/SearchModal",
|
|
29846
30008
|
"description": "Disabled items are excluded from keyboard navigation and cannot be selected."
|
|
@@ -32224,6 +32386,13 @@
|
|
|
32224
32386
|
"storyTitle": "Inputs/Select",
|
|
32225
32387
|
"description": "`SelectValueIcon` in the option and the trigger, so the chosen option keeps its icon once\nthe menu closes."
|
|
32226
32388
|
},
|
|
32389
|
+
{
|
|
32390
|
+
"name": "WithAgents",
|
|
32391
|
+
"code": "import { createListCollection } from '@ark-ui/react/collection';\nimport { Select, SelectButton, SelectContent, SelectOption, SelectOptionIndicator, SelectOptionText, SelectPositioner } from '@wallarm-org/design-system/Select';\n\nexport const WithAgents = () => {\n const collection = createListCollection({\n items: agents,\n });\n\n return (\n <div className='w-300'>\n <Select collection={collection} defaultValue={['radar']} data-testid='agent-select'>\n <SelectButton />\n\n <SelectPositioner>\n <SelectContent>\n {collection.items.map(agent => (\n <SelectOption key={agent.value} item={agent}>\n {agent.leading}\n <SelectOptionText>{agent.label}</SelectOptionText>\n <SelectOptionIndicator />\n </SelectOption>\n ))}\n </SelectContent>\n </SelectPositioner>\n </Select>\n </div>\n );\n};",
|
|
32392
|
+
"storyFile": "Select/Select.stories.tsx",
|
|
32393
|
+
"storyTitle": "Inputs/Select",
|
|
32394
|
+
"description": "An agent leads its option and, once picked, the trigger: pass its `AgentGlyph` as the item's\n`leading`. The glyph keeps its own 20 px beside the text-sm row and is never put on a plate."
|
|
32395
|
+
},
|
|
32227
32396
|
{
|
|
32228
32397
|
"name": "WithFooter",
|
|
32229
32398
|
"code": "import { createListCollection } from '@ark-ui/react/collection';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { SquareArrowOutUpRight } from '@wallarm-org/design-system/icons';\nimport { Select, SelectButton, SelectClearTrigger, SelectContent, SelectFooter, SelectGroup, SelectGroupLabel, SelectOption, SelectOptionDescription, SelectOptionIndicator, SelectOptionText, SelectPositioner } from '@wallarm-org/design-system/Select';\nimport { HStack } from '@wallarm-org/design-system/Stack';\n\nexport const WithFooter = () => {\n const collection = createListCollection({\n items: skillsWithoutIcons,\n groupBy: item => item.category ?? '',\n });\n\n return (\n <div className='w-300'>\n <Select collection={collection}>\n <SelectButton />\n\n <SelectPositioner>\n <SelectContent>\n {collection.group().map(([category, group], index) => (\n <SelectGroup key={category}>\n <SelectGroupLabel>\n {category}\n {index === 0 && <SelectClearTrigger>Clear all</SelectClearTrigger>}\n </SelectGroupLabel>\n {group.map(skill => (\n <SelectOption key={skill.value} item={skill}>\n <SelectOptionText>{skill.label}</SelectOptionText>\n {skill.description && (\n <SelectOptionDescription>{skill.description}</SelectOptionDescription>\n )}\n <SelectOptionIndicator />\n </SelectOption>\n ))}\n </SelectGroup>\n ))}\n </SelectContent>\n\n <SelectFooter>\n <HStack justify='between'>\n <Button variant='ghost' color='neutral' size='small'>\n <SquareArrowOutUpRight />\n See all\n </Button>\n\n <HStack justify='end'>\n <Button variant='ghost' color='neutral' size='small'>\n Cancel\n </Button>\n\n <Button variant='primary' color='brand' size='small'>\n Apply\n </Button>\n </HStack>\n </HStack>\n </SelectFooter>\n </SelectPositioner>\n </Select>\n </div>\n );\n};",
|
|
@@ -40282,6 +40451,13 @@
|
|
|
40282
40451
|
"storyTitle": "Data Display/Table",
|
|
40283
40452
|
"description": "The minimum — `data`, `columns`, `getRowId` and a column to open sorted on. The header stays\nput as the body scrolls."
|
|
40284
40453
|
},
|
|
40454
|
+
{
|
|
40455
|
+
"name": "AgentCell",
|
|
40456
|
+
"code": "import { AgentItem, Avatar, AvatarContent, AvatarFallback, AvatarName } from '@wallarm-org/design-system/Avatar';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';\nimport { CircleStop, Ellipsis, Eye } from '@wallarm-org/design-system/icons';\nimport { Table, type TableColumnDef } from '@wallarm-org/design-system/Table';\n\nexport const AgentCell = () => {\n interface AgentRun {\n id: string;\n agent: 'radar' | 'sift' | 'trim';\n agentName: string;\n finding: string;\n runBy: { type: 'agent'; agent: 'wally'; name: string } | { type: 'person'; name: string };\n }\n\n const runs: AgentRun[] = [\n {\n id: '1',\n agent: 'radar',\n agentName: 'Radar',\n finding: 'Credential stuffing on /api/v1/login',\n runBy: { type: 'agent', agent: 'wally', name: 'Wally' },\n },\n {\n id: '2',\n agent: 'sift',\n agentName: 'Sift',\n finding: '12 false positives in the SQLi rule',\n runBy: { type: 'person', name: 'Artem Miskevich' },\n },\n {\n id: '3',\n agent: 'trim',\n agentName: 'Trim',\n finding: '4 rules that never match',\n runBy: { type: 'agent', agent: 'wally', name: 'Wally' },\n },\n ];\n\n const columns: TableColumnDef<AgentRun>[] = [\n {\n accessorKey: 'agentName',\n header: 'Agent',\n size: 200,\n meta: {\n renderMenuAction: () => (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant='ghost' color='neutral' size='small' aria-label='More'>\n <Ellipsis />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem onSelect={onViewRun}>\n <DropdownMenuItemIcon>\n <Eye />\n </DropdownMenuItemIcon>\n <DropdownMenuItemText>View run</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={onStopRun}>\n <DropdownMenuItemIcon>\n <CircleStop />\n </DropdownMenuItemIcon>\n <DropdownMenuItemText>Stop run</DropdownMenuItemText>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n ),\n },\n cell: ({ row }) => (\n <AgentItem agent={row.original.agent} data-testid={`agent-cell-agent-${row.id}`}>\n <AvatarContent>\n <AvatarName>{row.original.agentName}</AvatarName>\n </AvatarContent>\n </AgentItem>\n ),\n },\n { accessorKey: 'finding', header: 'Finding', size: 320 },\n {\n id: 'runBy',\n header: 'Run by',\n size: 200,\n cell: ({ row }) =>\n row.original.runBy.type === 'agent' ? (\n <AgentItem agent={row.original.runBy.agent} data-testid={`agent-cell-run-by-${row.id}`}>\n <AvatarContent>\n <AvatarName>{row.original.runBy.name}</AvatarName>\n </AvatarContent>\n </AgentItem>\n ) : (\n <Avatar size='sm' data-testid={`agent-cell-run-by-${row.id}`}>\n <AvatarFallback name={row.original.runBy.name} />\n <AvatarContent>\n <AvatarName>{row.original.runBy.name}</AvatarName>\n </AvatarContent>\n </Avatar>\n ),\n },\n ];\n\n const getRowId = (run: AgentRun) => run.id;\n\n return (\n <Table\n aria-label='Agent runs'\n data={runs}\n columns={columns}\n getRowId={getRowId}\n data-testid='agent-cell'\n />\n );\n};",
|
|
40457
|
+
"storyFile": "Table/Table.stories.tsx",
|
|
40458
|
+
"storyTitle": "Data Display/Table",
|
|
40459
|
+
"description": "An agent in a cell — the Agent, Found by or Run by column: `AgentItem` at 20 px beside the text-sm row, the agent's\nglyph with no plate, where a person gets the `Avatar` plate. The row actions stay in the master cell\n(`meta.renderMenuAction`)."
|
|
40460
|
+
},
|
|
40285
40461
|
{
|
|
40286
40462
|
"name": "NoStretch",
|
|
40287
40463
|
"code": "import { Table, type TableColumnDef } from '@wallarm-org/design-system/Table';\nimport { type SecurityEvent, securityColumnHelper, securityEvents } from './mocks';\n\nexport const NoStretch = () => {\n const narrowColumns: TableColumnDef<SecurityEvent>[] = [\n securityColumnHelper.accessor('objectName', {\n header: 'Object name',\n size: 200,\n }),\n securityColumnHelper.accessor('status', {\n header: 'Status',\n size: 120,\n }),\n securityColumnHelper.accessor('requests', {\n header: 'Requests',\n size: 100,\n }),\n ];\n\n return (\n <Table data={securityEvents} columns={narrowColumns} getRowId={row => row.id} stretch={false} />\n );\n};",
|
|
@@ -41299,6 +41475,13 @@
|
|
|
41299
41475
|
"storyTitle": "Status Indication/Tag",
|
|
41300
41476
|
"description": "An icon beside the label, carrying the kind of thing rather than its state."
|
|
41301
41477
|
},
|
|
41478
|
+
{
|
|
41479
|
+
"name": "Agent",
|
|
41480
|
+
"code": "import { AgentGlyph } from '@wallarm-org/design-system/AgentGlyph';\nimport { HStack, VStack } from '@wallarm-org/design-system/Stack';\nimport { Tag } from '@wallarm-org/design-system/Tag';\n\nexport const Agent = () => (\n <VStack gap={12} align='stretch'>\n <HStack gap={8}>\n <Tag size='medium' data-testid='tag-agent-medium'>\n <AgentGlyph agent='radar' size={16} data-testid='tag-agent-medium--glyph' />\n Radar\n </Tag>\n <Tag size='medium'>\n <AgentGlyph agent='lens' size={16} />\n Lens\n </Tag>\n <Tag size='medium'>\n <AgentGlyph agent='bard' size={16} />\n Bard\n </Tag>\n </HStack>\n <HStack gap={8}>\n <Tag size='large' data-testid='tag-agent-large'>\n <AgentGlyph agent='radar' size={20} data-testid='tag-agent-large--glyph' />\n Radar\n </Tag>\n <Tag size='large'>\n <AgentGlyph agent='lens' size={20} />\n Lens\n </Tag>\n <Tag size='large'>\n <AgentGlyph agent='bard' size={20} />\n Bard\n </Tag>\n </HStack>\n </VStack>\n);",
|
|
41481
|
+
"storyFile": "Tag/Tag.stories.tsx",
|
|
41482
|
+
"storyTitle": "Status Indication/Tag",
|
|
41483
|
+
"description": "An agent in a tag stands as its character beside its name, with no plate: 16 px in a medium\ntag, 20 px in a large one. A person keeps the icon slot above."
|
|
41484
|
+
},
|
|
41302
41485
|
{
|
|
41303
41486
|
"name": "WithOnClick",
|
|
41304
41487
|
"code": "import { Tag } from '@wallarm-org/design-system/Tag';\n\nexport const WithOnClick = () => (\n <Tag onClick={onTagClick}>\n Click me\n </Tag>\n);",
|
|
@@ -42492,6 +42675,13 @@
|
|
|
42492
42675
|
"storyTitle": "Data Display/Timeline",
|
|
42493
42676
|
"description": "Content beside the rail. The line stretches to whatever height the row turns out to need,\nwhich is why the third step's long description does not break the rhythm."
|
|
42494
42677
|
},
|
|
42678
|
+
{
|
|
42679
|
+
"name": "WithAgent",
|
|
42680
|
+
"code": "import { AgentItem, Avatar, AvatarContent, AvatarFallback, AvatarName } from '@wallarm-org/design-system/Avatar';\nimport { HStack } from '@wallarm-org/design-system/Stack';\nimport { Text } from '@wallarm-org/design-system/Text';\nimport { Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineSeparator, TimelineTitle } from '@wallarm-org/design-system/Timeline';\n\nexport const WithAgent = () => (\n <div className='max-w-[360px]'>\n <Timeline data-testid='timeline'>\n <TimelineItem>\n <TimelineConnector>\n <TimelineIndicator>1</TimelineIndicator>\n <TimelineSeparator />\n </TimelineConnector>\n <TimelineContent>\n <TimelineTitle>Rule proposed</TimelineTitle>\n <HStack gap={4}>\n <TimelineDescription>Proposed by</TimelineDescription>\n <AgentItem agent='trim' data-testid='timeline-agent'>\n <AvatarContent>\n <AvatarName>Trim</AvatarName>\n </AvatarContent>\n </AgentItem>\n </HStack>\n </TimelineContent>\n </TimelineItem>\n <TimelineItem>\n <TimelineConnector>\n <TimelineIndicator>2</TimelineIndicator>\n <TimelineSeparator />\n </TimelineConnector>\n <TimelineContent>\n <TimelineTitle>Rule approved</TimelineTitle>\n <HStack gap={4}>\n <TimelineDescription>Approved by</TimelineDescription>\n <Avatar size='sm' data-testid='timeline-person'>\n <AvatarFallback name='Artem Miskevich' />\n <AvatarContent>\n <AvatarName>Artem Miskevich</AvatarName>\n </AvatarContent>\n </Avatar>\n </HStack>\n </TimelineContent>\n </TimelineItem>\n <TimelineItem>\n <TimelineConnector>\n <TimelineIndicator>3</TimelineIndicator>\n <TimelineSeparator />\n </TimelineConnector>\n <TimelineContent>\n <TimelineTitle>Rule applied</TimelineTitle>\n <HStack gap={4}>\n <Text size='xs' color='secondary'>\n Verified by\n </Text>\n <AgentItem agent='radar' size={16} data-testid='timeline-agent-xs'>\n <AvatarContent>\n <AvatarName>Radar</AvatarName>\n </AvatarContent>\n </AgentItem>\n </HStack>\n </TimelineContent>\n </TimelineItem>\n </Timeline>\n </div>\n);",
|
|
42681
|
+
"storyFile": "Timeline/Timeline.stories.tsx",
|
|
42682
|
+
"storyTitle": "Data Display/Timeline",
|
|
42683
|
+
"description": "The actor of an entry, composed in `TimelineContent`: an agent through `AgentItem`, a person\nthrough `Avatar`, beside the same label. 20 px beside the text-sm rows, 16 px beside text-xs."
|
|
42684
|
+
},
|
|
42495
42685
|
{
|
|
42496
42686
|
"name": "WithoutConnector",
|
|
42497
42687
|
"code": "import { Timeline, TimelineContent, TimelineDescription, TimelineItem, TimelineTitle } from '@wallarm-org/design-system/Timeline';\n\nexport const WithoutConnector = () => (\n <Timeline>\n <TimelineItem>\n <TimelineContent>\n <TimelineTitle>Order placed</TimelineTitle>\n <TimelineDescription>The order was placed by the customer.</TimelineDescription>\n </TimelineContent>\n </TimelineItem>\n <TimelineItem>\n <TimelineContent>\n <TimelineTitle>Order confirmed</TimelineTitle>\n <TimelineDescription>Payment received, order confirmed.</TimelineDescription>\n </TimelineContent>\n </TimelineItem>\n <TimelineItem>\n <TimelineContent>\n <TimelineTitle>Order shipped</TimelineTitle>\n <TimelineDescription>\n The package left the warehouse and is on its way. This step has the longest description of\n the three, to show the connecting line stretching to match a taller row.\n </TimelineDescription>\n </TimelineContent>\n </TimelineItem>\n </Timeline>\n);",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
2
|
+
"version": "4.14.0",
|
|
3
3
|
"rules": "Every numeric utility is in px, not 4px steps: p-16 is 16px, p-4 is 4px. Translate Tailwind habits (p-4 → p-16, gap-6 → gap-24, w-64 → w-256).\n\nBefore composing a screen, call get_guideline for the pattern (app shell, list page, table, drawer, form, dialog, filters, empty state, settings, auth). Wrong → right:\n\n- p-5, gap-3, p-10 → stay on the scale: 1, 2, 4, 6, 8, 12, 16, 20, 24, 28, 32, 40, 48, 64…\n- space-y-4, margins per child → <VStack gap={16}>, <HStack gap={8}>\n- Padded page wrapper → PageHeader / PageToolbar / PageContent own the 24px gutter\n- p-* on Card, DrawerBody, DialogBody, PageToolbar, Table → none; they own their padding\n- className on Text, Heading, Field, Drawer/Dialog Header/Body/Footer → wrap in your own element\n- Raw <h1>, <p>, <label> → <Heading as=\"h2\" size=\"lg\">, <Text size=\"sm\">, Field\n- <Text> default (16px) for body → size=\"sm\"\n- leading-none (0px), leading-5 (5px) → leading-sm, leading-20\n- weight=\"semibold\" → weight is light|regular|medium|bold (medium = 450)\n- bg-primary, text-muted, bg-card, bg-white → bg-bg-primary, text-text-secondary, bg-bg-surface-1\n- text-error, bg-red-500 → danger tokens; categorical color → Badge color\n- dark: variant, setting data-theme → semantic tokens, useTheme().setTheme()\n- rounded-lg, rounded, rounded-[15px] → rounded-8 (controls), rounded-12 (panels)\n- shadow-* on DS components, z-* on overlays → never; they own both\n- focus:ring → focus-visible:ring-3 ring-focus-primary outline-none\n- size, DIALOG/DRAWER_SIZES → width: Dialog 400 confirm, 560 default, 960 picker; Drawer 640 default, 700 Timeline form\n- Dialog, useToast from the root → @wallarm-org/design-system/Dialog, /Toast\n- Field invalid → error on the control + FieldError\n- Table actions column → meta.renderMenuAction on the master column\n- Hand-built side menu → RemoteShell config={NavConfig}\n- ConfirmDialog, FilterBar, Combobox → compose Dialog parts, PageToolbar + FilterDropdown, Select + useSelectSearch\n- data-slot in tests → data-testid\n",
|
|
4
4
|
"guidelines": [
|
|
5
5
|
{
|
package/dist/utils/isValidSvg.js
CHANGED
|
@@ -3,6 +3,6 @@ const isSvgElement = (node)=>{
|
|
|
3
3
|
if (!isValidElement(node)) return false;
|
|
4
4
|
if ('svg' === node.type) return true;
|
|
5
5
|
const displayName = node.type.displayName;
|
|
6
|
-
return 'string' == typeof displayName && displayName.endsWith('Icon');
|
|
6
|
+
return 'string' == typeof displayName && (displayName.endsWith('Icon') || 'AgentGlyph' === displayName);
|
|
7
7
|
};
|
|
8
8
|
export { isSvgElement };
|