@bikdotai/bik-component-library 0.0.836 → 0.0.837-beta.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/cjs/components/agent-builder/AgentBuilder.js +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +41 -23
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/AgentBuilderFooter.js +1 -1
- package/dist/cjs/components/agent-builder/components/AgentBuilderFooter.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/AgentBuilderTopBar.js +1 -1
- package/dist/cjs/components/agent-builder/components/AgentBuilderTopBar.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +1 -1
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/DiscardModal.js +1 -1
- package/dist/cjs/components/agent-builder/components/DiscardModal.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/GoLiveModal.js +1 -1
- package/dist/cjs/components/agent-builder/components/GoLiveModal.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js +2 -2
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +1 -1
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js +6 -6
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/StepSectionHeader.js +1 -1
- package/dist/cjs/components/agent-builder/components/StepSectionHeader.js.map +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js +3 -1
- package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js +5 -3
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/cjs/components/agent-listing/AgentListing.js +1 -1
- package/dist/cjs/components/agent-listing/AgentListing.js.map +1 -1
- package/dist/cjs/components/agent-listing/AgentTable.js +1 -1
- package/dist/cjs/components/agent-listing/AgentTable.js.map +1 -1
- package/dist/cjs/components/agent-listing/AgentTableRow.js +1 -1
- package/dist/cjs/components/agent-listing/AgentTableRow.js.map +1 -1
- package/dist/cjs/components/agent-listing/AgentTableShimmer.js +2 -0
- package/dist/cjs/components/agent-listing/AgentTableShimmer.js.map +1 -0
- package/dist/cjs/components/button/Button.styled.js +1 -0
- package/dist/cjs/components/button/Button.styled.js.map +1 -1
- package/dist/cjs/components/dropdown/Dropdown.js +1 -1
- package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
- package/dist/cjs/editor/BikEditor.js +1 -1
- package/dist/cjs/editor/BikEditor.js.map +1 -1
- package/dist/cjs/editor/BikEditor.styles.js +74 -42
- package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.js +80 -77
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +3 -0
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js +106 -84
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/esm/components/agent-builder/__fixtures__/agentValue.d.ts +11 -0
- package/dist/esm/components/agent-builder/components/AgentBuilderFooter.js +29 -21
- package/dist/esm/components/agent-builder/components/AgentBuilderFooter.js.map +1 -1
- package/dist/esm/components/agent-builder/components/AgentBuilderTopBar.js +21 -21
- package/dist/esm/components/agent-builder/components/AgentBuilderTopBar.js.map +1 -1
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +24 -23
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/DiscardModal.js +15 -8
- package/dist/esm/components/agent-builder/components/DiscardModal.js.map +1 -1
- package/dist/esm/components/agent-builder/components/GoLiveModal.js +11 -11
- package/dist/esm/components/agent-builder/components/GoLiveModal.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.js +41 -40
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +22 -21
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +13 -4
- package/dist/esm/components/agent-builder/components/SelectableListSection.js +167 -144
- package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/esm/components/agent-builder/components/StepSectionHeader.js +7 -7
- package/dist/esm/components/agent-builder/components/StepSectionHeader.js.map +1 -1
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +104 -103
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js +84 -82
- package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +20 -19
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js +23 -79
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js +37 -25
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentListing.js +70 -65
- package/dist/esm/components/agent-listing/AgentListing.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentTable.d.ts +2 -0
- package/dist/esm/components/agent-listing/AgentTable.js +16 -15
- package/dist/esm/components/agent-listing/AgentTable.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentTableRow.js +7 -7
- package/dist/esm/components/agent-listing/AgentTableRow.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentTableShimmer.d.ts +12 -0
- package/dist/esm/components/agent-listing/AgentTableShimmer.js +20 -0
- package/dist/esm/components/agent-listing/AgentTableShimmer.js.map +1 -0
- package/dist/esm/components/agent-listing/__fixtures__/agents.d.ts +3 -0
- package/dist/esm/components/button/Button.styled.js +25 -19
- package/dist/esm/components/button/Button.styled.js.map +1 -1
- package/dist/esm/components/dropdown/Dropdown.js +18 -13
- package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
- package/dist/esm/editor/BikEditor.js +173 -160
- package/dist/esm/editor/BikEditor.js.map +1 -1
- package/dist/esm/editor/BikEditor.styles.d.ts +20 -3
- package/dist/esm/editor/BikEditor.styles.js +78 -44
- package/dist/esm/editor/BikEditor.styles.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentListing.js","sources":["../../../../src/components/agent-listing/AgentListing.tsx"],"sourcesContent":["import React, { useCallback, useState } from 'react';\nimport { unwrapDropdownValue } from '@src/components/dropdown';\nimport { DropdownOption } from '@src/components/dropdown/type';\nimport { TablePagination } from '@src/components/TablePagination/TablePagination';\nimport { ZeroState } from '@src/components/zeroState/ZeroState';\nimport { AgentListingProps, AgentListItem } from './AgentListing.model';\nimport { Body, EmptyHolder, Page } from './AgentListing.styled';\nimport { AgentListingFilters } from './AgentListingFilters';\nimport { AgentListingHeader } from './AgentListingHeader';\nimport { AgentTable } from './AgentTable';\nimport { DeleteAgentModal } from './DeleteAgentModal';\n\n/**\n * Full body of the \"AI Agents\" listing screen (header + filters + table).\n * Presentational and fully controlled — the consumer owns data, search, sort,\n * pagination and routing. Render it inside your app shell (next to the sidebar).\n *\n * @example\n * <AgentListing\n * agents={rows}\n * searchValue={search}\n * onSearchChange={setSearch}\n * onNewAgent={() => router.push('/agents/new')}\n * onRunAgent={runAgent}\n * onEditAgent={(a) => router.push(`/agents/${a.id}`)}\n * />\n */\nexport const AgentListing: React.FC<AgentListingProps> = ({\n\tconfig,\n\tonSearchChange,\n\tonSearchSubmit,\n\tonFilterChange,\n\tonSortChange,\n\tonNewAgent,\n\tonBrowseTemplates,\n\tonRunAgent,\n\tonEditAgent,\n\tonDeleteAgent,\n\tonRowClick,\n\t...rest\n}) => {\n\t// Agent pending delete-confirmation (null = dialog closed).\n\tconst [pendingDelete, setPendingDelete] = useState<AgentListItem | null>(\n\t\tnull,\n\t);\n\tconst [isDeleting, setIsDeleting] = useState(false);\n\tconst {\n\t\tagents,\n\t\tisLoading,\n\t\tsearchValue,\n\t\tsearchPlaceholder = 'Search',\n\t\tfilterOptions,\n\t\tfilterPlaceholder = 'Filters',\n\t\tsortOptions,\n\t\tselectedSort,\n\t\ttitle = 'AI Agents',\n\t\theaderActions,\n\t\tpagination,\n\t\temptyState,\n\t\tdebugLog,\n\t} = config;\n\n\tconst showEmpty = !isLoading && agents.length === 0;\n\n\t// Gated debug logging: each handler logs at its start only when `debugLog`.\n\tconst logAction = useCallback(\n\t\t(action: string, ...args: unknown[]) => {\n\t\t\tif (debugLog) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(`[AgentListing] ${action}`, ...args);\n\t\t\t}\n\t\t},\n\t\t[debugLog],\n\t);\n\n\tconst handleSearchChange = useCallback(\n\t\t(v: string) => {\n\t\t\tlogAction('onSearchChange', v);\n\t\t\tonSearchChange(v);\n\t\t},\n\t\t[logAction, onSearchChange],\n\t);\n\tconst handleSearchSubmit = useCallback(\n\t\t(v: string) => {\n\t\t\tlogAction('onSearchSubmit', v);\n\t\t\tonSearchSubmit?.(v);\n\t\t},\n\t\t[logAction, onSearchSubmit],\n\t);\n\tconst handleFilterChange = useCallback(\n\t\t(selected: DropdownOption | DropdownOption[]) => {\n\t\t\tlogAction('onFilterChange', selected);\n\t\t\tonFilterChange?.(selected);\n\t\t},\n\t\t[logAction, onFilterChange],\n\t);\n\tconst handleSortChange = useCallback(\n\t\t(v: string) => {\n\t\t\tlogAction('onSortChange', v);\n\t\t\tonSortChange?.(v);\n\t\t},\n\t\t[logAction, onSortChange],\n\t);\n\tconst handleNewAgent = useCallback(() => {\n\t\tlogAction('onNewAgent');\n\t\tonNewAgent();\n\t}, [logAction, onNewAgent]);\n\tconst handleBrowseTemplates = useCallback(() => {\n\t\tlogAction('onBrowseTemplates');\n\t\tonBrowseTemplates?.();\n\t}, [logAction, onBrowseTemplates]);\n\tconst handleRunAgent = useCallback(\n\t\t(agent: AgentListItem) => {\n\t\t\tlogAction('onRunAgent', agent.id);\n\t\t\tonRunAgent(agent);\n\t\t},\n\t\t[logAction, onRunAgent],\n\t);\n\tconst handleEditAgent = useCallback(\n\t\t(agent: AgentListItem) => {\n\t\t\tlogAction('onEditAgent', agent.id);\n\t\t\tonEditAgent(agent);\n\t\t},\n\t\t[logAction, onEditAgent],\n\t);\n\tconst handleRowClick = useCallback(\n\t\t(agent: AgentListItem) => {\n\t\t\tlogAction('onRowClick', agent.id);\n\t\t\tonRowClick?.(agent);\n\t\t},\n\t\t[logAction, onRowClick],\n\t);\n\t// Row delete just opens the confirm dialog; the actual delete runs on confirm.\n\tconst handleDeleteRequest = useCallback(\n\t\t(agent: AgentListItem) => {\n\t\t\tlogAction('onDeleteAgent', agent.id);\n\t\t\tsetPendingDelete(agent);\n\t\t},\n\t\t[logAction],\n\t);\n\tconst handleConfirmDelete = useCallback(async () => {\n\t\tif (!pendingDelete || !onDeleteAgent) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsDeleting(true);\n\t\ttry {\n\t\t\tawait onDeleteAgent(pendingDelete);\n\t\t\tsetPendingDelete(null);\n\t\t} finally {\n\t\t\tsetIsDeleting(false);\n\t\t}\n\t}, [pendingDelete, onDeleteAgent]);\n\n\treturn (\n\t\t<Page data-test={rest['data-test'] ?? 'agent-listing'}>\n\t\t\t<AgentListingHeader\n\t\t\t\ttitle={title}\n\t\t\t\tonNewAgent={handleNewAgent}\n\t\t\t\tonBrowseTemplates={\n\t\t\t\t\tonBrowseTemplates ? handleBrowseTemplates : undefined\n\t\t\t\t}\n\t\t\t\theaderActions={headerActions}\n\t\t\t/>\n\n\t\t\t<AgentListingFilters\n\t\t\t\tsearchValue={searchValue}\n\t\t\t\tonSearchChange={handleSearchChange}\n\t\t\t\tonSearchSubmit={onSearchSubmit ? handleSearchSubmit : undefined}\n\t\t\t\tsearchPlaceholder={searchPlaceholder}\n\t\t\t\tfilterOptions={filterOptions}\n\t\t\t\tonFilterChange={onFilterChange ? handleFilterChange : undefined}\n\t\t\t\tfilterPlaceholder={filterPlaceholder}\n\t\t\t\tsortOptions={sortOptions}\n\t\t\t\tselectedSort={selectedSort}\n\t\t\t\tonSortChange={onSortChange ? handleSortChange : undefined}\n\t\t\t/>\n\n\t\t\t<Body>\n\t\t\t\t{isLoading || showEmpty ? (\n\t\t\t\t\t<EmptyHolder>\n\t\t\t\t\t\t<ZeroState\n\t\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\t\ttitle={emptyState?.title ?? 'No agents yet'}\n\t\t\t\t\t\t\tsubTitle={\n\t\t\t\t\t\t\t\temptyState?.subTitle ??\n\t\t\t\t\t\t\t\t'Create your first AI agent to start automating conversations.'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tactionButton={\n\t\t\t\t\t\t\t\temptyState?.actionButton ?? {\n\t\t\t\t\t\t\t\t\tbuttonText: 'New AI agent',\n\t\t\t\t\t\t\t\t\tbuttonType: 'primary',\n\t\t\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t\t\t\tonClick: handleNewAgent,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</EmptyHolder>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<AgentTable\n\t\t\t\t\t\t\tagents={agents}\n\t\t\t\t\t\t\tonRunAgent={handleRunAgent}\n\t\t\t\t\t\t\tonEditAgent={handleEditAgent}\n\t\t\t\t\t\t\tonDeleteAgent={onDeleteAgent ? handleDeleteRequest : undefined}\n\t\t\t\t\t\t\tonRowClick={onRowClick ? handleRowClick : undefined}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{pagination && pagination.totalRows > 0 && (\n\t\t\t\t\t\t\t<TablePagination\n\t\t\t\t\t\t\t\tpageNumber={pagination.pageNumber}\n\t\t\t\t\t\t\t\tpageSize={pagination.pageSize}\n\t\t\t\t\t\t\t\ttotalRows={pagination.totalRows}\n\t\t\t\t\t\t\t\thidePageSizeOptions={pagination.hidePageSizeOptions}\n\t\t\t\t\t\t\t\tupdatePageNumber={pagination.onPageChange}\n\t\t\t\t\t\t\t\tupdatePageSize={(opt) => {\n\t\t\t\t\t\t\t\t\tconst value = Number(unwrapDropdownValue(opt));\n\t\t\t\t\t\t\t\t\tif (!Number.isNaN(value)) {\n\t\t\t\t\t\t\t\t\t\tpagination.onPageSizeChange(value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</Body>\n\n\t\t\t{pendingDelete && (\n\t\t\t\t<DeleteAgentModal\n\t\t\t\t\tagentName={pendingDelete.name}\n\t\t\t\t\tisDeleting={isDeleting}\n\t\t\t\t\tonClose={() => (isDeleting ? undefined : setPendingDelete(null))}\n\t\t\t\t\tonConfirm={handleConfirmDelete}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</Page>\n\t);\n};\n\nAgentListing.displayName = 'AgentListing';\n"],"names":["AgentListing","config","onSearchChange","onSearchSubmit","onFilterChange","onSortChange","onNewAgent","onBrowseTemplates","onRunAgent","onEditAgent","onDeleteAgent","onRowClick","rest","pendingDelete","setPendingDelete","useState","isDeleting","setIsDeleting","agents","isLoading","searchValue","searchPlaceholder","filterOptions","filterPlaceholder","sortOptions","selectedSort","title","headerActions","pagination","emptyState","debugLog","showEmpty","logAction","useCallback","action","args","handleSearchChange","v","handleSearchSubmit","handleFilterChange","selected","handleSortChange","handleNewAgent","handleBrowseTemplates","handleRunAgent","agent","handleEditAgent","handleRowClick","handleDeleteRequest","handleConfirmDelete","Page","jsx","AgentListingHeader","AgentListingFilters","Body","EmptyHolder","ZeroState","jsxs","Fragment","AgentTable","TablePagination","opt","value","unwrapDropdownValue","DeleteAgentModal"],"mappings":";;;;;;;;;;AA2BO,MAAMA,KAA4C,CAAC;AAAA,EACzD,QAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACJ,MAAM;AAEL,QAAM,CAACC,GAAeC,CAAgB,IAAIC;AAAA,IACzC;AAAA,EAAA,GAEK,CAACC,GAAYC,CAAa,IAAIF,EAAS,EAAK,GAC5C;AAAA,IACL,QAAAG;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC,IAAoB;AAAA,IACpB,eAAAC;AAAA,IACA,mBAAAC,IAAoB;AAAA,IACpB,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,IACG7B,GAEE8B,IAAY,CAACZ,KAAaD,EAAO,WAAW,GAG5Cc,IAAYC;AAAA,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
|
+
{"version":3,"file":"AgentListing.js","sources":["../../../../src/components/agent-listing/AgentListing.tsx"],"sourcesContent":["import React, { useCallback, useState } from 'react';\nimport { unwrapDropdownValue } from '@src/components/dropdown';\nimport { DropdownOption } from '@src/components/dropdown/type';\nimport { TablePagination } from '@src/components/TablePagination/TablePagination';\nimport { ZeroState } from '@src/components/zeroState/ZeroState';\nimport { AgentListingProps, AgentListItem } from './AgentListing.model';\nimport { Body, EmptyHolder, Page } from './AgentListing.styled';\nimport { AgentListingFilters } from './AgentListingFilters';\nimport { AgentListingHeader } from './AgentListingHeader';\nimport { AgentTable } from './AgentTable';\nimport { AgentTableShimmer } from './AgentTableShimmer';\nimport { DeleteAgentModal } from './DeleteAgentModal';\n\n/**\n * Full body of the \"AI Agents\" listing screen (header + filters + table).\n * Presentational and fully controlled — the consumer owns data, search, sort,\n * pagination and routing. Render it inside your app shell (next to the sidebar).\n *\n * @example\n * <AgentListing\n * agents={rows}\n * searchValue={search}\n * onSearchChange={setSearch}\n * onNewAgent={() => router.push('/agents/new')}\n * onRunAgent={runAgent}\n * onEditAgent={(a) => router.push(`/agents/${a.id}`)}\n * />\n */\nexport const AgentListing: React.FC<AgentListingProps> = ({\n\tconfig,\n\tonSearchChange,\n\tonSearchSubmit,\n\tonFilterChange,\n\tonSortChange,\n\tonNewAgent,\n\tonBrowseTemplates,\n\tonRunAgent,\n\tonEditAgent,\n\tonDeleteAgent,\n\tonRowClick,\n\t...rest\n}) => {\n\t// Agent pending delete-confirmation (null = dialog closed).\n\tconst [pendingDelete, setPendingDelete] = useState<AgentListItem | null>(\n\t\tnull,\n\t);\n\tconst [isDeleting, setIsDeleting] = useState(false);\n\tconst {\n\t\tagents,\n\t\tisLoading,\n\t\tsearchValue,\n\t\tsearchPlaceholder = 'Search',\n\t\tfilterOptions,\n\t\tfilterPlaceholder = 'Filters',\n\t\tsortOptions,\n\t\tselectedSort,\n\t\ttitle = 'AI Agents',\n\t\theaderActions,\n\t\tpagination,\n\t\temptyState,\n\t\tdebugLog,\n\t} = config;\n\n\tconst showEmpty = !isLoading && agents.length === 0;\n\n\t// Gated debug logging: each handler logs at its start only when `debugLog`.\n\tconst logAction = useCallback(\n\t\t(action: string, ...args: unknown[]) => {\n\t\t\tif (debugLog) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(`[AgentListing] ${action}`, ...args);\n\t\t\t}\n\t\t},\n\t\t[debugLog],\n\t);\n\n\tconst handleSearchChange = useCallback(\n\t\t(v: string) => {\n\t\t\tlogAction('onSearchChange', v);\n\t\t\tonSearchChange(v);\n\t\t},\n\t\t[logAction, onSearchChange],\n\t);\n\tconst handleSearchSubmit = useCallback(\n\t\t(v: string) => {\n\t\t\tlogAction('onSearchSubmit', v);\n\t\t\tonSearchSubmit?.(v);\n\t\t},\n\t\t[logAction, onSearchSubmit],\n\t);\n\tconst handleFilterChange = useCallback(\n\t\t(selected: DropdownOption | DropdownOption[]) => {\n\t\t\tlogAction('onFilterChange', selected);\n\t\t\tonFilterChange?.(selected);\n\t\t},\n\t\t[logAction, onFilterChange],\n\t);\n\tconst handleSortChange = useCallback(\n\t\t(v: string) => {\n\t\t\tlogAction('onSortChange', v);\n\t\t\tonSortChange?.(v);\n\t\t},\n\t\t[logAction, onSortChange],\n\t);\n\tconst handleNewAgent = useCallback(() => {\n\t\tlogAction('onNewAgent');\n\t\tonNewAgent();\n\t}, [logAction, onNewAgent]);\n\tconst handleBrowseTemplates = useCallback(() => {\n\t\tlogAction('onBrowseTemplates');\n\t\tonBrowseTemplates?.();\n\t}, [logAction, onBrowseTemplates]);\n\tconst handleRunAgent = useCallback(\n\t\t(agent: AgentListItem) => {\n\t\t\tlogAction('onRunAgent', agent.id);\n\t\t\tonRunAgent(agent);\n\t\t},\n\t\t[logAction, onRunAgent],\n\t);\n\tconst handleEditAgent = useCallback(\n\t\t(agent: AgentListItem) => {\n\t\t\tlogAction('onEditAgent', agent.id);\n\t\t\tonEditAgent(agent);\n\t\t},\n\t\t[logAction, onEditAgent],\n\t);\n\tconst handleRowClick = useCallback(\n\t\t(agent: AgentListItem) => {\n\t\t\tlogAction('onRowClick', agent.id);\n\t\t\tonRowClick?.(agent);\n\t\t},\n\t\t[logAction, onRowClick],\n\t);\n\t// Row delete just opens the confirm dialog; the actual delete runs on confirm.\n\tconst handleDeleteRequest = useCallback(\n\t\t(agent: AgentListItem) => {\n\t\t\tlogAction('onDeleteAgent', agent.id);\n\t\t\tsetPendingDelete(agent);\n\t\t},\n\t\t[logAction],\n\t);\n\tconst handleConfirmDelete = useCallback(async () => {\n\t\tif (!pendingDelete || !onDeleteAgent) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsDeleting(true);\n\t\ttry {\n\t\t\tawait onDeleteAgent(pendingDelete);\n\t\t\tsetPendingDelete(null);\n\t\t} finally {\n\t\t\tsetIsDeleting(false);\n\t\t}\n\t}, [pendingDelete, onDeleteAgent]);\n\n\treturn (\n\t\t<Page data-test={rest['data-test'] ?? 'agent-listing'}>\n\t\t\t<AgentListingHeader\n\t\t\t\ttitle={title}\n\t\t\t\tonNewAgent={handleNewAgent}\n\t\t\t\tonBrowseTemplates={\n\t\t\t\t\tonBrowseTemplates ? handleBrowseTemplates : undefined\n\t\t\t\t}\n\t\t\t\theaderActions={headerActions}\n\t\t\t/>\n\n\t\t\t<AgentListingFilters\n\t\t\t\tsearchValue={searchValue}\n\t\t\t\tonSearchChange={handleSearchChange}\n\t\t\t\tonSearchSubmit={onSearchSubmit ? handleSearchSubmit : undefined}\n\t\t\t\tsearchPlaceholder={searchPlaceholder}\n\t\t\t\tfilterOptions={filterOptions}\n\t\t\t\tonFilterChange={onFilterChange ? handleFilterChange : undefined}\n\t\t\t\tfilterPlaceholder={filterPlaceholder}\n\t\t\t\tsortOptions={sortOptions}\n\t\t\t\tselectedSort={selectedSort}\n\t\t\t\tonSortChange={onSortChange ? handleSortChange : undefined}\n\t\t\t/>\n\n\t\t\t<Body>\n\t\t\t\t{isLoading ? (\n\t\t\t\t\t// Table-shaped shimmer: refetches (page/page-size/sort/search) load in\n\t\t\t\t\t// place instead of collapsing to a spinner. Keep the page\n\t\t\t\t\t// height by matching the current page size.\n\t\t\t\t\t<AgentTableShimmer rows={Math.min(pagination?.pageSize ?? 5, 10)} />\n\t\t\t\t) : showEmpty ? (\n\t\t\t\t\t<EmptyHolder>\n\t\t\t\t\t\t<ZeroState\n\t\t\t\t\t\t\ttitle={emptyState?.title ?? 'No agents yet'}\n\t\t\t\t\t\t\tsubTitle={\n\t\t\t\t\t\t\t\temptyState?.subTitle ??\n\t\t\t\t\t\t\t\t'Create your first AI agent to start automating conversations.'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tactionButton={\n\t\t\t\t\t\t\t\temptyState?.actionButton ?? {\n\t\t\t\t\t\t\t\t\tbuttonText: 'New AI agent',\n\t\t\t\t\t\t\t\t\tbuttonType: 'primary',\n\t\t\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t\t\t\tonClick: handleNewAgent,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</EmptyHolder>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<AgentTable\n\t\t\t\t\t\t\tagents={agents}\n\t\t\t\t\t\t\tonRunAgent={handleRunAgent}\n\t\t\t\t\t\t\tonEditAgent={handleEditAgent}\n\t\t\t\t\t\t\tonDeleteAgent={onDeleteAgent ? handleDeleteRequest : undefined}\n\t\t\t\t\t\t\tonRowClick={onRowClick ? handleRowClick : undefined}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{pagination && pagination.totalRows > 0 && (\n\t\t\t\t\t\t\t<TablePagination\n\t\t\t\t\t\t\t\tpageNumber={pagination.pageNumber}\n\t\t\t\t\t\t\t\tpageSize={pagination.pageSize}\n\t\t\t\t\t\t\t\ttotalRows={pagination.totalRows}\n\t\t\t\t\t\t\t\thidePageSizeOptions={pagination.hidePageSizeOptions}\n\t\t\t\t\t\t\t\tupdatePageNumber={pagination.onPageChange}\n\t\t\t\t\t\t\t\tupdatePageSize={(opt) => {\n\t\t\t\t\t\t\t\t\tconst value = Number(unwrapDropdownValue(opt));\n\t\t\t\t\t\t\t\t\tif (!Number.isNaN(value)) {\n\t\t\t\t\t\t\t\t\t\tpagination.onPageSizeChange(value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</Body>\n\n\t\t\t{pendingDelete && (\n\t\t\t\t<DeleteAgentModal\n\t\t\t\t\tagentName={pendingDelete.name}\n\t\t\t\t\tisDeleting={isDeleting}\n\t\t\t\t\tonClose={() => (isDeleting ? undefined : setPendingDelete(null))}\n\t\t\t\t\tonConfirm={handleConfirmDelete}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</Page>\n\t);\n};\n\nAgentListing.displayName = 'AgentListing';\n"],"names":["AgentListing","config","onSearchChange","onSearchSubmit","onFilterChange","onSortChange","onNewAgent","onBrowseTemplates","onRunAgent","onEditAgent","onDeleteAgent","onRowClick","rest","pendingDelete","setPendingDelete","useState","isDeleting","setIsDeleting","agents","isLoading","searchValue","searchPlaceholder","filterOptions","filterPlaceholder","sortOptions","selectedSort","title","headerActions","pagination","emptyState","debugLog","showEmpty","logAction","useCallback","action","args","handleSearchChange","v","handleSearchSubmit","handleFilterChange","selected","handleSortChange","handleNewAgent","handleBrowseTemplates","handleRunAgent","agent","handleEditAgent","handleRowClick","handleDeleteRequest","handleConfirmDelete","Page","jsx","AgentListingHeader","AgentListingFilters","Body","AgentTableShimmer","EmptyHolder","ZeroState","jsxs","Fragment","AgentTable","TablePagination","opt","value","unwrapDropdownValue","DeleteAgentModal"],"mappings":";;;;;;;;;;;AA4BO,MAAMA,KAA4C,CAAC;AAAA,EACzD,QAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,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AAaoC,IAAiB;AAAA,QAAA;AAAA,MAAA;AAAA,MAE1CnB,KAAcA,EAAW,YAAY,KACrC,gBAAAuB;AAAA,QAACU;AAAA,QAAA;AAAA,UACA,YAAYjC,EAAW;AAAA,UACvB,UAAUA,EAAW;AAAA,UACrB,WAAWA,EAAW;AAAA,UACtB,qBAAqBA,EAAW;AAAA,UAChC,kBAAkBA,EAAW;AAAA,UAC7B,gBAAgB,CAACkC,MAAQ;AACxB,kBAAMC,IAAQ,OAAOC,GAAoBF,CAAG,CAAC;AAC7C,YAAK,OAAO,MAAMC,CAAK,KACtBnC,EAAW,iBAAiBmC,CAAK;AAAA,UAEnC;AAAA,QAAA;AAAA,MAAA;AAAA,IACD,EAAA,CAEF,EAAA,CAEF;AAAA,IAEClD,KACA,gBAAAsC;AAAA,MAACc;AAAA,MAAA;AAAA,QACA,WAAWpD,EAAc;AAAA,QACzB,YAAAG;AAAA,QACA,SAAS,MAAOA,IAAa,SAAYF,EAAiB,IAAI;AAAA,QAC9D,WAAWmC;AAAA,MAAA;AAAA,IAAA;AAAA,EACZ,GAEF;AAEF;AAEAjD,GAAa,cAAc;"}
|
|
@@ -7,5 +7,7 @@ interface AgentTableProps {
|
|
|
7
7
|
onDeleteAgent?: (agent: AgentListItem) => void;
|
|
8
8
|
onRowClick?: (agent: AgentListItem) => void;
|
|
9
9
|
}
|
|
10
|
+
/** Column header row — shared with the loading shimmer so the two can't drift. */
|
|
11
|
+
export declare const AgentTableHeader: React.FC;
|
|
10
12
|
export declare const AgentTable: React.FC<AgentTableProps>;
|
|
11
13
|
export {};
|
|
@@ -3,33 +3,34 @@ import { TitleSmall as h } from "../TypographyStyle.js";
|
|
|
3
3
|
import { COLORS as m } from "../../constants/Theme.js";
|
|
4
4
|
import { TableCard as g, TableScroll as p, HeaderGridRow as s, HeaderCell as e } from "./AgentListing.styled.js";
|
|
5
5
|
import { AgentTableRow as T } from "./AgentTableRow.js";
|
|
6
|
-
const
|
|
7
|
-
|
|
6
|
+
const l = ({ children: i }) => /* @__PURE__ */ r(h, { color: m.content.primary, children: i }), b = () => /* @__PURE__ */ c(s, { children: [
|
|
7
|
+
/* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(l, { children: "Agent name" }) }),
|
|
8
|
+
/* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(l, { children: "Trigger" }) }),
|
|
9
|
+
/* @__PURE__ */ r(e, { align: "right", children: /* @__PURE__ */ r(l, { children: "Trigger count" }) }),
|
|
10
|
+
/* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(l, { children: "Status" }) }),
|
|
11
|
+
/* @__PURE__ */ r(e, { align: "center", children: /* @__PURE__ */ r(l, { children: "Actions" }) })
|
|
12
|
+
] }), C = ({
|
|
13
|
+
agents: i,
|
|
8
14
|
onRunAgent: o,
|
|
9
|
-
onEditAgent:
|
|
10
|
-
onDeleteAgent:
|
|
15
|
+
onEditAgent: t,
|
|
16
|
+
onDeleteAgent: d,
|
|
11
17
|
onRowClick: a
|
|
12
18
|
}) => /* @__PURE__ */ r(g, { children: /* @__PURE__ */ c(p, { children: [
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
|
|
15
|
-
/* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(i, { children: "Trigger" }) }),
|
|
16
|
-
/* @__PURE__ */ r(e, { align: "right", children: /* @__PURE__ */ r(i, { children: "Trigger count" }) }),
|
|
17
|
-
/* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(i, { children: "Status" }) }),
|
|
18
|
-
/* @__PURE__ */ r(e, { align: "center", children: /* @__PURE__ */ r(i, { children: "Actions" }) })
|
|
19
|
-
] }),
|
|
20
|
-
l.map((n) => /* @__PURE__ */ r(
|
|
19
|
+
/* @__PURE__ */ r(b, {}),
|
|
20
|
+
i.map((n) => /* @__PURE__ */ r(
|
|
21
21
|
T,
|
|
22
22
|
{
|
|
23
23
|
agent: n,
|
|
24
24
|
onRunAgent: o,
|
|
25
|
-
onEditAgent:
|
|
26
|
-
onDeleteAgent:
|
|
25
|
+
onEditAgent: t,
|
|
26
|
+
onDeleteAgent: d,
|
|
27
27
|
onRowClick: a
|
|
28
28
|
},
|
|
29
29
|
n.id
|
|
30
30
|
))
|
|
31
31
|
] }) });
|
|
32
32
|
export {
|
|
33
|
-
C as AgentTable
|
|
33
|
+
C as AgentTable,
|
|
34
|
+
b as AgentTableHeader
|
|
34
35
|
};
|
|
35
36
|
//# sourceMappingURL=AgentTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentTable.js","sources":["../../../../src/components/agent-listing/AgentTable.tsx"],"sourcesContent":["import React from 'react';\nimport { TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { AgentListItem } from './AgentListing.model';\nimport {\n\tHeaderCell,\n\tHeaderGridRow,\n\tTableCard,\n\tTableScroll,\n} from './AgentListing.styled';\nimport { AgentTableRow } from './AgentTableRow';\n\ninterface AgentTableProps {\n\tagents: AgentListItem[];\n\tonRunAgent: (agent: AgentListItem) => void;\n\tonEditAgent: (agent: AgentListItem) => void;\n\tonDeleteAgent?: (agent: AgentListItem) => void;\n\tonRowClick?: (agent: AgentListItem) => void;\n}\n\nconst HeaderLabel: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n\t<TitleSmall color={COLORS.content.primary}>{children}</TitleSmall>\n);\n\nexport const
|
|
1
|
+
{"version":3,"file":"AgentTable.js","sources":["../../../../src/components/agent-listing/AgentTable.tsx"],"sourcesContent":["import React from 'react';\nimport { TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { AgentListItem } from './AgentListing.model';\nimport {\n\tHeaderCell,\n\tHeaderGridRow,\n\tTableCard,\n\tTableScroll,\n} from './AgentListing.styled';\nimport { AgentTableRow } from './AgentTableRow';\n\ninterface AgentTableProps {\n\tagents: AgentListItem[];\n\tonRunAgent: (agent: AgentListItem) => void;\n\tonEditAgent: (agent: AgentListItem) => void;\n\tonDeleteAgent?: (agent: AgentListItem) => void;\n\tonRowClick?: (agent: AgentListItem) => void;\n}\n\nconst HeaderLabel: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n\t<TitleSmall color={COLORS.content.primary}>{children}</TitleSmall>\n);\n\n/** Column header row — shared with the loading shimmer so the two can't drift. */\nexport const AgentTableHeader: React.FC = () => (\n\t<HeaderGridRow>\n\t\t<HeaderCell>\n\t\t\t<HeaderLabel>Agent name</HeaderLabel>\n\t\t</HeaderCell>\n\t\t<HeaderCell>\n\t\t\t<HeaderLabel>Trigger</HeaderLabel>\n\t\t</HeaderCell>\n\t\t<HeaderCell align=\"right\">\n\t\t\t<HeaderLabel>Trigger count</HeaderLabel>\n\t\t</HeaderCell>\n\t\t<HeaderCell>\n\t\t\t<HeaderLabel>Status</HeaderLabel>\n\t\t</HeaderCell>\n\t\t<HeaderCell align=\"center\">\n\t\t\t<HeaderLabel>Actions</HeaderLabel>\n\t\t</HeaderCell>\n\t</HeaderGridRow>\n);\n\nexport const AgentTable: React.FC<AgentTableProps> = ({\n\tagents,\n\tonRunAgent,\n\tonEditAgent,\n\tonDeleteAgent,\n\tonRowClick,\n}) => (\n\t<TableCard>\n\t\t<TableScroll>\n\t\t\t<AgentTableHeader />\n\n\t\t\t{agents.map((agent) => (\n\t\t\t\t<AgentTableRow\n\t\t\t\t\tkey={agent.id}\n\t\t\t\t\tagent={agent}\n\t\t\t\t\tonRunAgent={onRunAgent}\n\t\t\t\t\tonEditAgent={onEditAgent}\n\t\t\t\t\tonDeleteAgent={onDeleteAgent}\n\t\t\t\t\tonRowClick={onRowClick}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</TableScroll>\n\t</TableCard>\n);\n"],"names":["HeaderLabel","children","jsx","TitleSmall","COLORS","AgentTableHeader","jsxs","HeaderGridRow","HeaderCell","AgentTable","agents","onRunAgent","onEditAgent","onDeleteAgent","onRowClick","TableCard","TableScroll","agent","AgentTableRow"],"mappings":";;;;;AAoBA,MAAMA,IAAuD,CAAC,EAAE,UAAAC,EAAA,MAC/D,gBAAAC,EAACC,GAAA,EAAW,OAAOC,EAAO,QAAQ,SAAU,UAAAH,EAAA,CAAS,GAIzCI,IAA6B,MACzC,gBAAAC,EAACC,GAAA,EACA,UAAA;AAAA,EAAA,gBAAAL,EAACM,GAAA,EACA,UAAA,gBAAAN,EAACF,GAAA,EAAY,UAAA,aAAA,CAAU,GACxB;AAAA,EACA,gBAAAE,EAACM,GAAA,EACA,UAAA,gBAAAN,EAACF,GAAA,EAAY,qBAAO,GACrB;AAAA,oBACCQ,GAAA,EAAW,OAAM,SACjB,UAAA,gBAAAN,EAACF,GAAA,EAAY,2BAAa,EAAA,CAC3B;AAAA,EACA,gBAAAE,EAACM,GAAA,EACA,UAAA,gBAAAN,EAACF,GAAA,EAAY,oBAAM,GACpB;AAAA,oBACCQ,GAAA,EAAW,OAAM,UACjB,UAAA,gBAAAN,EAACF,GAAA,EAAY,qBAAO,EAAA,CACrB;AAAA,EAAA,CACD,GAGYS,IAAwC,CAAC;AAAA,EACrD,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AACD,MACC,gBAAAZ,EAACa,GAAA,EACA,UAAA,gBAAAT,EAACU,GAAA,EACA,UAAA;AAAA,EAAA,gBAAAd,EAACG,GAAA,EAAiB;AAAA,EAEjBK,EAAO,IAAI,CAACO,MACZ,gBAAAf;AAAA,IAACgB;AAAA,IAAA;AAAA,MAEA,OAAAD;AAAA,MACA,YAAAN;AAAA,MACA,aAAAC;AAAA,MACA,eAAAC;AAAA,MACA,YAAAC;AAAA,IAAA;AAAA,IALKG,EAAM;AAAA,EAAA,CAOZ;AAAA,EAAA,CACF,EAAA,CACD;"}
|
|
@@ -3,10 +3,10 @@ import b from "../../assets/icons/delete.svg.js";
|
|
|
3
3
|
import v from "../../assets/icons/edit.svg.js";
|
|
4
4
|
import w from "../../assets/icons/playOutline.svg.js";
|
|
5
5
|
import D from "../../assets/icons/vertical_dots.svg.js";
|
|
6
|
-
import { DropdownPopover as
|
|
7
|
-
import { TitleSmall as
|
|
6
|
+
import { DropdownPopover as S } from "../dropdown/DropdownPopover/index.js";
|
|
7
|
+
import { TitleSmall as T, BodyCaption as x, BodySecondary as s } from "../TypographyStyle.js";
|
|
8
8
|
import { COLORS as o } from "../../constants/Theme.js";
|
|
9
|
-
import { ActionButton as p, BodyGridRow as
|
|
9
|
+
import { ActionButton as p, BodyGridRow as g, Cell as n, ActionGroup as C } from "./AgentListing.styled.js";
|
|
10
10
|
import { Tag as L } from "../tag/Tag.js";
|
|
11
11
|
import { Tooltip as O } from "../tooltips/Tooltip.js";
|
|
12
12
|
import { unwrapDropdownValue as P } from "../dropdown/utils.js";
|
|
@@ -15,7 +15,7 @@ const R = (e) => {
|
|
|
15
15
|
case "topic":
|
|
16
16
|
return `Topic: ${e.label ?? ""}`;
|
|
17
17
|
case "phrases":
|
|
18
|
-
return `Phrases: ${
|
|
18
|
+
return e.items?.length ? `Phrases: ${e.items.join(", ")}` : "Phrases";
|
|
19
19
|
default:
|
|
20
20
|
return e.label ?? "";
|
|
21
21
|
}
|
|
@@ -85,14 +85,14 @@ const R = (e) => {
|
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
87
|
return /* @__PURE__ */ r(
|
|
88
|
-
|
|
88
|
+
g,
|
|
89
89
|
{
|
|
90
90
|
"data-test": `agent-row-${e.id}`,
|
|
91
91
|
clickable: !!l,
|
|
92
92
|
onClick: l ? () => l(e) : void 0,
|
|
93
93
|
children: [
|
|
94
94
|
/* @__PURE__ */ r(n, { children: [
|
|
95
|
-
/* @__PURE__ */ t(
|
|
95
|
+
/* @__PURE__ */ t(T, { numberOfLines: 1, color: o.content.primary, children: e.name }),
|
|
96
96
|
/* @__PURE__ */ r(x, { numberOfLines: 1, color: o.content.secondary, children: [
|
|
97
97
|
"Created: ",
|
|
98
98
|
e.createdAtLabel
|
|
@@ -116,7 +116,7 @@ const R = (e) => {
|
|
|
116
116
|
style: { display: "flex" },
|
|
117
117
|
onClick: (i) => i.stopPropagation(),
|
|
118
118
|
children: /* @__PURE__ */ t(
|
|
119
|
-
|
|
119
|
+
S,
|
|
120
120
|
{
|
|
121
121
|
"data-test": `agent-row-menu-${e.id}`,
|
|
122
122
|
options: f,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentTableRow.js","sources":["../../../../src/components/agent-listing/AgentTableRow.tsx"],"sourcesContent":["import DeleteIcon from '@src/assets/icons/delete.svg';\nimport EditIcon from '@src/assets/icons/edit.svg';\nimport PlayOutlineIcon from '@src/assets/icons/playOutline.svg';\nimport MoreIcon from '@src/assets/icons/vertical_dots.svg';\nimport React from 'react';\nimport { unwrapDropdownValue } from '@src/components/dropdown';\nimport { DropdownPopover } from '@src/components/dropdown/DropdownPopover';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { Tag } from '@src/components/tag';\nimport { Tooltip } from '@src/components/tooltips';\nimport {\n\tBodyCaption,\n\
|
|
1
|
+
{"version":3,"file":"AgentTableRow.js","sources":["../../../../src/components/agent-listing/AgentTableRow.tsx"],"sourcesContent":["import DeleteIcon from '@src/assets/icons/delete.svg';\nimport EditIcon from '@src/assets/icons/edit.svg';\nimport PlayOutlineIcon from '@src/assets/icons/playOutline.svg';\nimport MoreIcon from '@src/assets/icons/vertical_dots.svg';\nimport React from 'react';\nimport { unwrapDropdownValue } from '@src/components/dropdown';\nimport { DropdownPopover } from '@src/components/dropdown/DropdownPopover';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { Tag } from '@src/components/tag';\nimport { Tooltip } from '@src/components/tooltips';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { AgentListItem, AgentTriggerSummary } from './AgentListing.model';\nimport {\n\tActionButton,\n\tActionGroup,\n\tBodyGridRow,\n\tCell,\n} from './AgentListing.styled';\n\nconst triggerToText = (trigger: AgentTriggerSummary): string => {\n\tswitch (trigger.kind) {\n\t\tcase 'topic':\n\t\t\treturn `Topic: ${trigger.label ?? ''}`;\n\t\tcase 'phrases':\n\t\t\t// No enumerable phrase list (free-text trigger) → just the word.\n\t\t\treturn trigger.items?.length\n\t\t\t\t? `Phrases: ${trigger.items.join(', ')}`\n\t\t\t\t: 'Phrases';\n\t\tcase 'custom':\n\t\tdefault:\n\t\t\treturn trigger.label ?? '';\n\t}\n};\n\ninterface AgentTableRowProps {\n\tagent: AgentListItem;\n\tonRunAgent: (agent: AgentListItem) => void;\n\tonEditAgent: (agent: AgentListItem) => void;\n\t/** When set, render a delete action (the listing handles confirmation). */\n\tonDeleteAgent?: (agent: AgentListItem) => void;\n\tonRowClick?: (agent: AgentListItem) => void;\n}\n\nexport const AgentTableRow: React.FC<AgentTableRowProps> = ({\n\tagent,\n\tonRunAgent,\n\tonEditAgent,\n\tonDeleteAgent,\n\tonRowClick,\n}) => {\n\tconst isLive = agent.status === 'live';\n\n\tconst handleRun = (e: React.MouseEvent) => {\n\t\te.stopPropagation();\n\t\tif (agent.isRunDisabled) {\n\t\t\treturn;\n\t\t}\n\t\tonRunAgent(agent);\n\t};\n\n\t// Edit + Delete live in the \"⋮\" menu beside the run button.\n\tconst menuOptions: SingleOption[] = [\n\t\t{\n\t\t\tlabel: 'Edit',\n\t\t\tvalue: 'edit',\n\t\t\tleadingIcon: (\n\t\t\t\t<EditIcon width={16} height={16} color={COLORS.content.secondary} />\n\t\t\t),\n\t\t},\n\t\t...(onDeleteAgent\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Delete',\n\t\t\t\t\t\tvalue: 'delete',\n\t\t\t\t\t\t// Rendered red (icon + label) via customComponent.\n\t\t\t\t\t\tcustomComponent: (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t\t\tgap: 8,\n\t\t\t\t\t\t\t\t\tcolor: COLORS.content.negative,\n\t\t\t\t\t\t\t\t\tfontFamily: 'Inter',\n\t\t\t\t\t\t\t\t\tfontSize: 14,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<DeleteIcon\n\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\tcolor={COLORS.content.negative}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\tDelete\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t ]\n\t\t\t: []),\n\t];\n\n\tconst handleMenuSelect = (value: string | undefined) => {\n\t\tif (value === 'edit') {\n\t\t\tonEditAgent(agent);\n\t\t} else if (value === 'delete') {\n\t\t\tonDeleteAgent?.(agent);\n\t\t}\n\t};\n\n\tconst playButton = (\n\t\t<ActionButton\n\t\t\tdata-test={`agent-row-run-${agent.id}`}\n\t\t\tdisabled={agent.isRunDisabled}\n\t\t\tonClick={handleRun}\n\t\t\taria-label=\"Run agent\"\n\t\t>\n\t\t\t<PlayOutlineIcon\n\t\t\t\twidth={20}\n\t\t\t\theight={20}\n\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t/>\n\t\t</ActionButton>\n\t);\n\n\treturn (\n\t\t<BodyGridRow\n\t\t\tdata-test={`agent-row-${agent.id}`}\n\t\t\tclickable={!!onRowClick}\n\t\t\tonClick={onRowClick ? () => onRowClick(agent) : undefined}\n\t\t>\n\t\t\t<Cell>\n\t\t\t\t<TitleSmall numberOfLines={1} color={COLORS.content.primary}>\n\t\t\t\t\t{agent.name}\n\t\t\t\t</TitleSmall>\n\t\t\t\t<BodyCaption numberOfLines={1} color={COLORS.content.secondary}>\n\t\t\t\t\tCreated: {agent.createdAtLabel}\n\t\t\t\t</BodyCaption>\n\t\t\t</Cell>\n\n\t\t\t<Cell>\n\t\t\t\t<BodySecondary numberOfLines={2} color={COLORS.content.primary}>\n\t\t\t\t\t{triggerToText(agent.trigger)}\n\t\t\t\t</BodySecondary>\n\t\t\t</Cell>\n\n\t\t\t<Cell align=\"right\">\n\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t{agent.triggerCount}\n\t\t\t\t</BodySecondary>\n\t\t\t</Cell>\n\n\t\t\t<Cell>\n\t\t\t\t<Tag\n\t\t\t\t\ttagText={isLive ? 'Live' : 'Draft'}\n\t\t\t\t\ttype={isLive ? 'positive' : 'neutral'}\n\t\t\t\t\tvariant=\"regular\"\n\t\t\t\t/>\n\t\t\t</Cell>\n\n\t\t\t<Cell align=\"center\">\n\t\t\t\t<ActionGroup>\n\t\t\t\t\t{agent.isRunDisabled && agent.runDisabledTooltip ? (\n\t\t\t\t\t\t<Tooltip body={agent.runDisabledTooltip} placement=\"top\">\n\t\t\t\t\t\t\t<span style={{ display: 'flex' }}>{playButton}</span>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tplayButton\n\t\t\t\t\t)}\n\t\t\t\t\t{/* Stop the row's onClick from firing when interacting with the menu. */}\n\t\t\t\t\t<span\n\t\t\t\t\t\tstyle={{ display: 'flex' }}\n\t\t\t\t\t\tonClick={(e) => e.stopPropagation()}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DropdownPopover\n\t\t\t\t\t\t\tdata-test={`agent-row-menu-${agent.id}`}\n\t\t\t\t\t\t\toptions={menuOptions}\n\t\t\t\t\t\t\tplacement=\"bottom-end\"\n\t\t\t\t\t\t\twidth=\"160px\"\n\t\t\t\t\t\t\tonSelect={(opt) => handleMenuSelect(unwrapDropdownValue(opt))}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ActionButton\n\t\t\t\t\t\t\t\tdata-test={`agent-row-menu-button-${agent.id}`}\n\t\t\t\t\t\t\t\taria-label=\"More actions\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<MoreIcon\n\t\t\t\t\t\t\t\t\twidth={20}\n\t\t\t\t\t\t\t\t\theight={20}\n\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ActionButton>\n\t\t\t\t\t\t</DropdownPopover>\n\t\t\t\t\t</span>\n\t\t\t\t</ActionGroup>\n\t\t\t</Cell>\n\t\t</BodyGridRow>\n\t);\n};\n"],"names":["triggerToText","trigger","AgentTableRow","agent","onRunAgent","onEditAgent","onDeleteAgent","onRowClick","isLive","handleRun","e","menuOptions","jsx","EditIcon","COLORS","jsxs","DeleteIcon","handleMenuSelect","value","playButton","ActionButton","PlayOutlineIcon","BodyGridRow","Cell","TitleSmall","BodyCaption","BodySecondary","Tag","ActionGroup","Tooltip","DropdownPopover","opt","unwrapDropdownValue","MoreIcon"],"mappings":";;;;;;;;;;;;AAwBA,MAAMA,IAAgB,CAACC,MAAyC;AAC/D,UAAQA,EAAQ,MAAA;AAAA,IACf,KAAK;AACJ,aAAO,UAAUA,EAAQ,SAAS,EAAE;AAAA,IACrC,KAAK;AAEJ,aAAOA,EAAQ,OAAO,SACnB,YAAYA,EAAQ,MAAM,KAAK,IAAI,CAAC,KACpC;AAAA,IAEJ;AACC,aAAOA,EAAQ,SAAS;AAAA,EAAA;AAE3B,GAWaC,IAA8C,CAAC;AAAA,EAC3D,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AACD,MAAM;AACL,QAAMC,IAASL,EAAM,WAAW,QAE1BM,IAAY,CAACC,MAAwB;AAE1C,IADAA,EAAE,gBAAA,GACE,CAAAP,EAAM,iBAGVC,EAAWD,CAAK;AAAA,EACjB,GAGMQ,IAA8B;AAAA,IACnC;AAAA,MACC,OAAO;AAAA,MACP,OAAO;AAAA,MACP,aACC,gBAAAC,EAACC,GAAA,EAAS,OAAO,IAAI,QAAQ,IAAI,OAAOC,EAAO,QAAQ,UA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EAAiBe,EAAoBD,CAAG,CAAC;AAAA,kBAE5D,UAAA,gBAAAnB;AAAA,oBAACQ;AAAA,oBAAA;AAAA,sBACA,aAAW,yBAAyBjB,EAAM,EAAE;AAAA,sBAC5C,cAAW;AAAA,sBAEX,UAAA,gBAAAS;AAAA,wBAACqB;AAAAA,wBAAA;AAAA,0BACA,OAAO;AAAA,0BACP,QAAQ;AAAA,0BACR,OAAOnB,EAAO,QAAQ;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBACvB;AAAA,kBAAA;AAAA,gBACD;AAAA,cAAA;AAAA,YACD;AAAA,UAAA;AAAA,QACD,EAAA,CACD,EAAA,CACD;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGH;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface AgentTableShimmerProps {
|
|
3
|
+
/** Shimmer row count — pass the page size so the refetch keeps the page height. */
|
|
4
|
+
rows?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Table-shaped loading state: the real column header + shimmer rows matching the
|
|
8
|
+
* listing grid, so a refetch (page/page-size/sort/search change) shimmers in place
|
|
9
|
+
* instead of collapsing to the initial full-page loader.
|
|
10
|
+
*/
|
|
11
|
+
export declare const AgentTableShimmer: React.FC<AgentTableShimmerProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as r, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { BikShimmer as m } from "../shimmer/ShimmerComponent/BikShimmer.js";
|
|
3
|
+
import { TableCard as a, TableScroll as p, BodyGridRow as d, Cell as e } from "./AgentListing.styled.js";
|
|
4
|
+
import { AgentTableHeader as h } from "./AgentTable.js";
|
|
5
|
+
const i = (l, o = "16px", n = "4px") => /* @__PURE__ */ r(m, { boxes: [{ width: l, height: o, borderRadius: n, marginTop: "0" }] }), b = ({
|
|
6
|
+
rows: l = 5
|
|
7
|
+
}) => /* @__PURE__ */ r(a, { "data-test": "agent-table-shimmer", children: /* @__PURE__ */ t(p, { children: [
|
|
8
|
+
/* @__PURE__ */ r(h, {}),
|
|
9
|
+
Array.from({ length: l }, (o, n) => /* @__PURE__ */ t(d, { children: [
|
|
10
|
+
/* @__PURE__ */ r(e, { children: i("60%") }),
|
|
11
|
+
/* @__PURE__ */ r(e, { children: i("70%") }),
|
|
12
|
+
/* @__PURE__ */ r(e, { align: "right", children: i("48px") }),
|
|
13
|
+
/* @__PURE__ */ r(e, { children: i("64px", "24px", "999px") }),
|
|
14
|
+
/* @__PURE__ */ r(e, { align: "center", children: i("72px", "24px") })
|
|
15
|
+
] }, n))
|
|
16
|
+
] }) });
|
|
17
|
+
export {
|
|
18
|
+
b as AgentTableShimmer
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=AgentTableShimmer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentTableShimmer.js","sources":["../../../../src/components/agent-listing/AgentTableShimmer.tsx"],"sourcesContent":["import React from 'react';\nimport BikShimmer from '@src/components/shimmer/ShimmerComponent/BikShimmer';\nimport {\n\tBodyGridRow,\n\tCell,\n\tTableCard,\n\tTableScroll,\n} from './AgentListing.styled';\nimport { AgentTableHeader } from './AgentTable';\n\ninterface AgentTableShimmerProps {\n\t/** Shimmer row count — pass the page size so the refetch keeps the page height. */\n\trows?: number;\n}\n\nconst box = (width: string, height = '16px', borderRadius = '4px') => (\n\t<BikShimmer boxes={[{ width, height, borderRadius, marginTop: '0' }]} />\n);\n\n/**\n * Table-shaped loading state: the real column header + shimmer rows matching the\n * listing grid, so a refetch (page/page-size/sort/search change) shimmers in place\n * instead of collapsing to the initial full-page loader.\n */\nexport const AgentTableShimmer: React.FC<AgentTableShimmerProps> = ({\n\trows = 5,\n}) => (\n\t<TableCard data-test=\"agent-table-shimmer\">\n\t\t<TableScroll>\n\t\t\t<AgentTableHeader />\n\n\t\t\t{Array.from({ length: rows }, (_, i) => (\n\t\t\t\t<BodyGridRow key={i}>\n\t\t\t\t\t<Cell>{box('60%')}</Cell>\n\t\t\t\t\t<Cell>{box('70%')}</Cell>\n\t\t\t\t\t<Cell align=\"right\">{box('48px')}</Cell>\n\t\t\t\t\t<Cell>{box('64px', '24px', '999px')}</Cell>\n\t\t\t\t\t<Cell align=\"center\">{box('72px', '24px')}</Cell>\n\t\t\t\t</BodyGridRow>\n\t\t\t))}\n\t\t</TableScroll>\n\t</TableCard>\n);\n"],"names":["box","width","height","borderRadius","jsx","BikShimmer","AgentTableShimmer","rows","TableCard","TableScroll","AgentTableHeader","_","i","jsxs","BodyGridRow","Cell"],"mappings":";;;;AAeA,MAAMA,IAAM,CAACC,GAAeC,IAAS,QAAQC,IAAe,UAC3D,gBAAAC,EAACC,GAAA,EAAW,OAAO,CAAC,EAAE,OAAAJ,GAAO,QAAAC,GAAQ,cAAAC,GAAc,WAAW,IAAA,CAAK,GAAG,GAQ1DG,IAAsD,CAAC;AAAA,EACnE,MAAAC,IAAO;AACR,MACC,gBAAAH,EAACI,GAAA,EAAU,aAAU,uBACpB,4BAACC,GAAA,EACA,UAAA;AAAA,EAAA,gBAAAL,EAACM,GAAA,EAAiB;AAAA,EAEjB,MAAM,KAAK,EAAE,QAAQH,EAAA,GAAQ,CAACI,GAAGC,MACjC,gBAAAC,EAACC,GAAA,EACA,UAAA;AAAA,IAAA,gBAAAV,EAACW,GAAA,EAAM,UAAAf,EAAI,KAAK,EAAA,CAAE;AAAA,IAClB,gBAAAI,EAACW,GAAA,EAAM,UAAAf,EAAI,KAAK,EAAA,CAAE;AAAA,sBACjBe,GAAA,EAAK,OAAM,SAAS,UAAAf,EAAI,MAAM,GAAE;AAAA,sBAChCe,GAAA,EAAM,UAAAf,EAAI,QAAQ,QAAQ,OAAO,GAAE;AAAA,sBACnCe,GAAA,EAAK,OAAM,UAAU,UAAAf,EAAI,QAAQ,MAAM,EAAA,CAAE;AAAA,EAAA,EAAA,GALzBY,CAMlB,CACA;AAAA,EAAA,CACF,EAAA,CACD;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as c, Fragment as l, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import r from "styled-components";
|
|
3
3
|
import { COLORS as e } from "../../constants/Theme.js";
|
|
4
|
-
import { getBackgroundColor as
|
|
5
|
-
const
|
|
4
|
+
import { getBackgroundColor as u, getPadding as i, getBorder as b, getColor as g, getDashedBorderStyling as o, getClickEffect as a, generateDisabledStyling as y, getDisabledTextColor as h, getHoverButtonBackgroundCustom as $, getHoverButtonBackground as s, getHoverButtonTextDecorationStyle as v, generateInverseHoverBackground as x, getLoadingBorder as m, getLoadingBackground as d, getLoadingButtonBackgroundCustom as z } from "./themes.js";
|
|
5
|
+
const C = r.button`
|
|
6
6
|
all: unset;
|
|
7
7
|
outline: none;
|
|
8
8
|
cursor: pointer;
|
|
@@ -11,7 +11,7 @@ const w = l.button`
|
|
|
11
11
|
border-radius: ${(t) => t.buttonType == "text" ? "0" : "4px"};
|
|
12
12
|
overflow: hidden;
|
|
13
13
|
${(t) => t.matchParentWidth ? "flex-grow: 1;" : ""}
|
|
14
|
-
background-color: ${(t) =>
|
|
14
|
+
background-color: ${(t) => u(
|
|
15
15
|
t.buttonType,
|
|
16
16
|
t.size,
|
|
17
17
|
t.inverse,
|
|
@@ -28,7 +28,7 @@ const w = l.button`
|
|
|
28
28
|
${t.matchParentWidth ? "justify-content: center;" : ""}
|
|
29
29
|
padding: ${i(t.buttonType, t.size)};
|
|
30
30
|
}` : `padding: ${i(t.buttonType, t.size)};
|
|
31
|
-
${
|
|
31
|
+
${b(
|
|
32
32
|
t.version ?? "1.0",
|
|
33
33
|
t.buttonType,
|
|
34
34
|
t.size,
|
|
@@ -47,7 +47,7 @@ const w = l.button`
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.text {
|
|
50
|
-
color: ${(t) =>
|
|
50
|
+
color: ${(t) => g(t.buttonType, t.size, t.inverse, t.darkMode)};
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.icon-leading {
|
|
@@ -91,9 +91,9 @@ const w = l.button`
|
|
|
91
91
|
display: none !important;
|
|
92
92
|
}
|
|
93
93
|
cursor: ${(t) => t.buttonType === "text" ? "auto" : "not-allowed"};
|
|
94
|
-
${(t) =>
|
|
94
|
+
${(t) => y(t.buttonType, t.size, t.inverse)}
|
|
95
95
|
.text {
|
|
96
|
-
color: ${(t) =>
|
|
96
|
+
color: ${(t) => h(t.inverse)} !important;
|
|
97
97
|
}
|
|
98
98
|
${(t) => o(
|
|
99
99
|
t.buttonType,
|
|
@@ -130,7 +130,13 @@ const w = l.button`
|
|
|
130
130
|
t.isLoading ? `
|
|
131
131
|
cursor: not-allowed;
|
|
132
132
|
padding: 0;
|
|
133
|
-
${
|
|
133
|
+
${m(t.buttonType, t.size, t.inverse)}
|
|
134
|
+
${d(
|
|
135
|
+
t.buttonType,
|
|
136
|
+
t.size,
|
|
137
|
+
t.inverse,
|
|
138
|
+
t.buttonColor
|
|
139
|
+
)}
|
|
134
140
|
|
|
135
141
|
.button-container {
|
|
136
142
|
display: flex;
|
|
@@ -144,7 +150,7 @@ const w = l.button`
|
|
|
144
150
|
.icon-trailing {
|
|
145
151
|
opacity: 0;
|
|
146
152
|
}
|
|
147
|
-
${t.buttonColor ? `background-color: ${
|
|
153
|
+
${t.buttonColor ? `background-color: ${z(
|
|
148
154
|
t.buttonColor,
|
|
149
155
|
15
|
|
150
156
|
)};` : ""}
|
|
@@ -159,7 +165,7 @@ const w = l.button`
|
|
|
159
165
|
left: 0;
|
|
160
166
|
width: 100%;
|
|
161
167
|
height: 100%;
|
|
162
|
-
${
|
|
168
|
+
${d(
|
|
163
169
|
t.buttonType,
|
|
164
170
|
t.size,
|
|
165
171
|
t.inverse,
|
|
@@ -177,7 +183,7 @@ const w = l.button`
|
|
|
177
183
|
width: 100%;
|
|
178
184
|
${t.matchParentWidth ? "justify-content: center;" : ""}
|
|
179
185
|
padding: ${i(t.buttonType, t.size)};
|
|
180
|
-
{${t.buttonColor ? `background-color: ${
|
|
186
|
+
{${t.buttonColor ? `background-color: ${$(
|
|
181
187
|
t.buttonColor,
|
|
182
188
|
15
|
|
183
189
|
)}` : ""}}
|
|
@@ -189,14 +195,14 @@ const w = l.button`
|
|
|
189
195
|
left: 0;
|
|
190
196
|
width: 100%;
|
|
191
197
|
height: 100%;
|
|
192
|
-
${
|
|
198
|
+
${s(t.buttonType, t.inverse)}
|
|
193
199
|
}
|
|
194
200
|
${t.size === "chip" && t.buttonType !== "text" ? t.darkMode ? `background-color: ${e.stroke.primary};` : `background-color: ${e.surface.hovered};` : ""}
|
|
195
201
|
${t.buttonType === "special" ? `background-color: ${e.background.brandLight};` : t.buttonType === "secondaryGray" ? `background-color: ${e.surface.hovered};` : ""}
|
|
196
202
|
${t.buttonType === "primary" && t.size !== "chip" && t.size !== "xs" && !t.inverse && !t.buttonColor ? `background-color: ${e.background.inverse};` : ""}
|
|
197
203
|
}
|
|
198
|
-
${t.buttonType === "text" ?
|
|
199
|
-
${t.inverse ?
|
|
204
|
+
${t.buttonType === "text" ? v(t.buttonType, t.disabled) : ""}
|
|
205
|
+
${t.inverse ? x(t.buttonType, t.disabled) : ""}
|
|
200
206
|
}`
|
|
201
207
|
)}
|
|
202
208
|
|
|
@@ -205,14 +211,14 @@ const w = l.button`
|
|
|
205
211
|
gap: 8.33px;
|
|
206
212
|
${(t) => t.matchParentWidth ? "margin: auto;" : ""}
|
|
207
213
|
}
|
|
208
|
-
`,
|
|
214
|
+
`, w = () => /* @__PURE__ */ c(l, { children: [
|
|
209
215
|
/* @__PURE__ */ n("div", { className: "line-top" }),
|
|
210
216
|
/* @__PURE__ */ n("div", { className: "line-left" }),
|
|
211
217
|
/* @__PURE__ */ n("div", { className: "line-bottom" }),
|
|
212
218
|
/* @__PURE__ */ n("div", { className: "line-right" })
|
|
213
219
|
] });
|
|
214
220
|
export {
|
|
215
|
-
|
|
216
|
-
|
|
221
|
+
C as Button,
|
|
222
|
+
w as ButtonCustomDashedBorder
|
|
217
223
|
};
|
|
218
224
|
//# sourceMappingURL=Button.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.styled.js","sources":["../../../../src/components/button/Button.styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\nimport { Size, Type } from './model';\nimport {\n\tgenerateDisabledStyling,\n\tgenerateInverseHoverBackground,\n\tgetBackgroundColor,\n\tgetBorder,\n\tgetClickEffect,\n\tgetColor,\n\tgetDashedBorderStyling,\n\tgetDisabledTextColor,\n\tgetHoverButtonBackground,\n\tgetHoverButtonBackgroundCustom,\n\tgetHoverButtonTextDecorationStyle,\n\tgetLoadingBackground,\n\tgetLoadingBorder,\n\tgetLoadingButtonBackgroundCustom,\n\tgetPadding,\n} from './themes';\n\nexport const Button = styled.button<{\n\tsize: Size;\n\tbuttonType: Type;\n\tisLoading?: boolean;\n\tinverse?: boolean;\n\tdisabled?: boolean;\n\tmatchParentWidth?: boolean;\n\tversion?: '1.0' | '2.0' | '3.0';\n\tdarkMode?: boolean;\n\tactivated?: boolean;\n\terror?: boolean;\n\tbuttonColor?: string;\n}>`\n\tall: unset;\n\toutline: none;\n\tcursor: pointer;\n\tdisplay: flex;\n\tgap: 8.83px;\n\tborder-radius: ${(props) => (props.buttonType == 'text' ? '0' : '4px')};\n\toverflow: hidden;\n\t${(props) => (props.matchParentWidth ? `flex-grow: 1;` : '')}\n\tbackground-color: ${(props) =>\n\t\tgetBackgroundColor(\n\t\t\tprops.buttonType,\n\t\t\tprops.size,\n\t\t\tprops.inverse,\n\t\t\tprops.darkMode,\n\t\t\tprops.buttonColor,\n\t\t)};\n\n\t${(props) =>\n\t\tprops.buttonType.startsWith('dash')\n\t\t\t? `.button-container {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\tposition: relative;\n\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t${props.matchParentWidth ? 'justify-content: center;' : ''}\n\t\t\t\t\tpadding: ${getPadding(props.buttonType, props.size)};\n\t\t\t\t}`\n\t\t\t: `padding: ${getPadding(props.buttonType, props.size)};\n\t${getBorder(\n\t\tprops.version ?? '1.0',\n\t\tprops.buttonType,\n\t\tprops.size,\n\t\tprops.inverse,\n\t\tprops.error,\n\t)}`}\n\n\t.icon-component {\n\t\theight: ${(props) =>\n\t\t\tprops.size === 'chip' || props.size === 'xs' ? '16px' : '20px'};\n\t\twidth: ${(props) =>\n\t\t\tprops.size === 'chip' || props.size === 'xs' ? '16px' : '20px'};\n\t}\n\n\t.icon-trailing {\n\t\theight: ${(props) =>\n\t\t\tprops.size === 'chip' || props.size === 'xs' ? '16px' : '20px'};\n\t\twidth: ${(props) =>\n\t\t\tprops.size === 'chip' || props.size === 'xs' ? '16px' : '20px'};\n\t}\n\n\t.text {\n\t\tcolor: ${(props) =>\n\t\t\tgetColor(props.buttonType, props.size, props.inverse, props.darkMode)};\n\t}\n\n\t.icon-leading {\n\t\theight: ${(props) =>\n\t\t\tprops.size === 'chip' || props.size === 'xs' ? '16px' : '20px'};\n\t\twidth: ${(props) =>\n\t\t\tprops.size === 'chip' || props.size === 'xs' ? '16px' : '20px'};\n\t}\n\n\t${(props) =>\n\t\tgetDashedBorderStyling(\n\t\t\tprops.buttonType,\n\t\t\tprops.size,\n\t\t\tprops.isLoading\n\t\t\t\t? COLORS.stroke.brandLightAlt\n\t\t\t\t: props.error\n\t\t\t\t? COLORS.stroke.negative.vibrant\n\t\t\t\t: undefined,\n\t\t)}\n\n\t.overlay-container {\n\t\tdisplay: none;\n\t}\n\n\t${(props) =>\n\t\t!props.disabled &&\n\t\t!props.isLoading &&\n\t\tprops.activated &&\n\t\t(props.buttonType == 'dashBold' || props.buttonType == 'dashRegular') &&\n\t\t`\n\t.button-container {\n\t\tdisplay: flex;\n\t\t${props.matchParentWidth ? 'justify-content: center;' : ''}\n\t\tposition: relative;\n\t\twidth: 100%;\n\t\t.overlay-container {\n\t\t\tdisplay: none !important;\n\t\t}\n\t\t${`.text {\n\t\t\tcolor: ${COLORS.content.brand} !important;\n\t\t}\n\t\t.icon {\n\t\t\tcolor: ${COLORS.background.brand};\n\t\t}\n\t\t`}\n\t}\n\t${getClickEffect(props.buttonType, props.size, props.inverse)}\n\t${getDashedBorderStyling(props.buttonType, props.size, COLORS.content.brand)}\n\t`}\n\n\t:disabled {\n\t\t.overlay-container {\n\t\t\tdisplay: none !important;\n\t\t}\n\t\tcursor: ${(props) =>\n\t\t\tprops.buttonType === 'text' ? 'auto' : 'not-allowed'};\n\t\t${(props) =>\n\t\t\tgenerateDisabledStyling(props.buttonType, props.size, props.inverse)}\n\t\t.text {\n\t\t\tcolor: ${(props) => getDisabledTextColor(props.inverse)} !important;\n\t\t}\n\t\t${(props) =>\n\t\t\tgetDashedBorderStyling(\n\t\t\t\tprops.buttonType,\n\t\t\t\tprops.size,\n\t\t\t\tCOLORS.stroke.primary,\n\t\t\t)}\n\t}\n\n\t${(props) =>\n\t\t!props.disabled &&\n\t\t!props.isLoading &&\n\t\t`:active {\n\t\t\t\t.button-container {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t${props.matchParentWidth ? 'justify-content: center;' : ''}\n\t\t\t\t\tposition: relative;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\t.overlay-container {\n\t\t\t\t\t\tdisplay: none !important;\n\t\t\t\t\t}\n\t\t\t\t\t${\n\t\t\t\t\t\tprops.size === 'chip' &&\n\t\t\t\t\t\t`.text {\n\t\t\t\t\t\tcolor: ${COLORS.background.inverseLight} !important;\n\t\t\t\t\t}\n\t\t\t\t\t.icon {\n\t\t\t\t\t\tcolor: ${COLORS.background.inverseLight};\n\t\t\t\t\t}\n\t\t\t\t\t`\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t${getClickEffect(props.buttonType, props.size, props.inverse)}\n\t\t\t${getDashedBorderStyling(props.buttonType, props.size, COLORS.content.brand)}\n\t\t}`}\n\n\t${(props) =>\n\t\t// do not load hover styles for loading state and also active state\n\t\t!props.isLoading\n\t\t\t? `:not(:active):not(:disabled):hover {\n\t\t\tpadding: 0;\n\t\t\t.button-container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 100%;\n\t\t\t\t${props.matchParentWidth ? 'justify-content: center;' : ''}\n\t\t\t\tpadding: ${getPadding(props.buttonType, props.size)};\n\t\t\t\t{${\n\t\t\t\t\tprops.buttonColor\n\t\t\t\t\t\t? `background-color: ${getHoverButtonBackgroundCustom(\n\t\t\t\t\t\t\t\tprops.buttonColor,\n\t\t\t\t\t\t\t\t15,\n\t\t\t\t\t\t )}`\n\t\t\t\t\t\t: ''\n\t\t\t\t}}\n\t\t\t\t.overlay-container {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tpadding: 0;\n\t\t\t\t\ttop: 0;\n\t\t\t\t\tleft: 0;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\theight: 100%;\n\t\t\t\t\t${getHoverButtonBackground(props.buttonType, props.inverse)}\n\t\t\t\t}\n\t\t\t\t${\n\t\t\t\t\tprops.size === 'chip' && props.buttonType !== 'text'\n\t\t\t\t\t\t? props.darkMode\n\t\t\t\t\t\t\t? `background-color: ${COLORS.stroke.primary};`\n\t\t\t\t\t\t\t: `background-color: ${COLORS.surface.hovered};`\n\t\t\t\t\t\t: ''\n\t\t\t\t}\n\t\t\t\t${\n\t\t\t\t\tprops.buttonType === 'special'\n\t\t\t\t\t\t? `background-color: ${COLORS.background.brandLight};`\n\t\t\t\t\t\t: props.buttonType === 'secondaryGray'\n\t\t\t\t\t\t? `background-color: ${COLORS.surface.hovered};`\n\t\t\t\t\t\t: ''\n\t\t\t\t}\n\t\t\t\t${\n\t\t\t\t\tprops.buttonType === 'primary' &&\n\t\t\t\t\tprops.size !== 'chip' &&\n\t\t\t\t\tprops.size !== 'xs' &&\n\t\t\t\t\t!props.inverse &&\n\t\t\t\t\t!props.buttonColor\n\t\t\t\t\t\t? `background-color: ${COLORS.background.inverse};`\n\t\t\t\t\t\t: ''\n\t\t\t\t}\n\t\t\t}\n\t\t\t${\n\t\t\t\tprops.buttonType === 'text'\n\t\t\t\t\t? getHoverButtonTextDecorationStyle(props.buttonType, props.disabled)\n\t\t\t\t\t: ''\n\t\t\t}\n\t\t\t${\n\t\t\t\tprops.inverse\n\t\t\t\t\t? generateInverseHoverBackground(props.buttonType, props.disabled)\n\t\t\t\t\t: ''\n\t\t\t}\n\t\t}`\n\t\t\t: `\n\t\t\tcursor: not-allowed;\n\t\t\tpadding: 0;\n\t\t${getLoadingBorder(props.buttonType, props.size, props.inverse)}\n\n\t\t.button-container {\n\t\t\tdisplay: flex;\n\t\t\tposition: relative;\n\t\t\twidth: 100%;\n\t\t\t.text {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\t.icon-leading,\n\t\t\t.icon-component,\n\t\t\t.icon-trailing {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\t${\n\t\t\t\tprops.buttonColor\n\t\t\t\t\t? `background-color: ${getLoadingButtonBackgroundCustom(\n\t\t\t\t\t\t\tprops.buttonColor,\n\t\t\t\t\t\t\t15,\n\t\t\t\t\t )};`\n\t\t\t\t\t: ''\n\t\t\t}\n\t\t\tpadding: ${getPadding(props.buttonType, props.size)};\n\t\t\t.overlay-container {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\tposition: absolute;\n\t\t\t\tpadding: 0;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\t${getLoadingBackground(\n\t\t\t\t\tprops.buttonType,\n\t\t\t\t\tprops.size,\n\t\t\t\t\tprops.inverse,\n\t\t\t\t\tprops.buttonColor,\n\t\t\t\t)}\n\t\t\t\t.spinner {\n\t\t\t\t\tline-height: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}`}\n\n\t\t.button-container {\n\t\tdisplay: flex;\n\t\tgap: 8.33px;\n\t\t${(props) => (props.matchParentWidth ? 'margin: auto;' : '')}\n\t}\n`;\n\nexport const ButtonCustomDashedBorder = () => {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"line-top\"></div>\n\t\t\t<div className=\"line-left\"></div>\n\t\t\t<div className=\"line-bottom\"></div>\n\t\t\t<div className=\"line-right\"></div>\n\t\t</>\n\t);\n};\n"],"names":["Button","styled","props","getBackgroundColor","getPadding","getBorder","getColor","getDashedBorderStyling","COLORS","getClickEffect","generateDisabledStyling","getDisabledTextColor","getLoadingBorder","getLoadingButtonBackgroundCustom","getLoadingBackground","getHoverButtonBackgroundCustom","getHoverButtonBackground","getHoverButtonTextDecorationStyle","generateInverseHoverBackground","ButtonCustomDashedBorder","jsxs","Fragment","jsx"],"mappings":";;;;AAqBO,MAAMA,IAASC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAkBX,CAACC,MAAWA,EAAM,cAAc,SAAS,MAAM,KAAM;AAAA;AAAA,GAEpE,CAACA,MAAWA,EAAM,mBAAmB,kBAAkB,EAAG;AAAA,qBACxC,CAACA,MACpBC;AAAA,EACCD,EAAM;AAAA,EACNA,EAAM;AAAA,EACNA,EAAM;AAAA,EACNA,EAAM;AAAA,EACNA,EAAM;AACP,CAAC;AAAA;AAAA,GAEA,CAACA,MACFA,EAAM,WAAW,WAAW,MAAM,IAC/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAMEA,EAAM,mBAAmB,6BAA6B,EAAE;AAAA,gBAC/CE,EAAWF,EAAM,YAAYA,EAAM,IAAI,CAAC;AAAA,SAEnD,YAAYE,EAAWF,EAAM,YAAYA,EAAM,IAAI,CAAC;AAAA,GACtDG;AAAA,EACDH,EAAM,WAAW;AAAA,EACjBA,EAAM;AAAA,EACNA,EAAM;AAAA,EAC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AA,gBAAAC,EAAC,OAAA,EAAI,WAAU,WAAA,CAAW;AAAA,EAC1B,gBAAAA,EAAC,OAAA,EAAI,WAAU,YAAA,CAAY;AAAA,EAC3B,gBAAAA,EAAC,OAAA,EAAI,WAAU,cAAA,CAAc;AAAA,EAC7B,gBAAAA,EAAC,OAAA,EAAI,WAAU,aAAA,CAAa;AAAA,GAC7B;"}
|
|
1
|
+
{"version":3,"file":"Button.styled.js","sources":["../../../../src/components/button/Button.styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\nimport { Size, Type } from './model';\nimport {\n\tgenerateDisabledStyling,\n\tgenerateInverseHoverBackground,\n\tgetBackgroundColor,\n\tgetBorder,\n\tgetClickEffect,\n\tgetColor,\n\tgetDashedBorderStyling,\n\tgetDisabledTextColor,\n\tgetHoverButtonBackground,\n\tgetHoverButtonBackgroundCustom,\n\tgetHoverButtonTextDecorationStyle,\n\tgetLoadingBackground,\n\tgetLoadingBorder,\n\tgetLoadingButtonBackgroundCustom,\n\tgetPadding,\n} from './themes';\n\nexport const Button = styled.button<{\n\tsize: Size;\n\tbuttonType: Type;\n\tisLoading?: boolean;\n\tinverse?: boolean;\n\tdisabled?: boolean;\n\tmatchParentWidth?: boolean;\n\tversion?: '1.0' | '2.0' | '3.0';\n\tdarkMode?: boolean;\n\tactivated?: boolean;\n\terror?: boolean;\n\tbuttonColor?: string;\n}>`\n\tall: unset;\n\toutline: none;\n\tcursor: pointer;\n\tdisplay: flex;\n\tgap: 8.83px;\n\tborder-radius: ${(props) => (props.buttonType == 'text' ? '0' : '4px')};\n\toverflow: hidden;\n\t${(props) => (props.matchParentWidth ? `flex-grow: 1;` : '')}\n\tbackground-color: ${(props) =>\n\t\tgetBackgroundColor(\n\t\t\tprops.buttonType,\n\t\t\tprops.size,\n\t\t\tprops.inverse,\n\t\t\tprops.darkMode,\n\t\t\tprops.buttonColor,\n\t\t)};\n\n\t${(props) =>\n\t\tprops.buttonType.startsWith('dash')\n\t\t\t? `.button-container {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\tposition: relative;\n\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t${props.matchParentWidth ? 'justify-content: center;' : ''}\n\t\t\t\t\tpadding: ${getPadding(props.buttonType, props.size)};\n\t\t\t\t}`\n\t\t\t: `padding: ${getPadding(props.buttonType, props.size)};\n\t${getBorder(\n\t\tprops.version ?? '1.0',\n\t\tprops.buttonType,\n\t\tprops.size,\n\t\tprops.inverse,\n\t\tprops.error,\n\t)}`}\n\n\t.icon-component {\n\t\theight: ${(props) =>\n\t\t\tprops.size === 'chip' || props.size === 'xs' ? '16px' : '20px'};\n\t\twidth: ${(props) =>\n\t\t\tprops.size === 'chip' || props.size === 'xs' ? '16px' : '20px'};\n\t}\n\n\t.icon-trailing {\n\t\theight: ${(props) =>\n\t\t\tprops.size === 'chip' || props.size === 'xs' ? '16px' : '20px'};\n\t\twidth: ${(props) =>\n\t\t\tprops.size === 'chip' || props.size === 'xs' ? '16px' : '20px'};\n\t}\n\n\t.text {\n\t\tcolor: ${(props) =>\n\t\t\tgetColor(props.buttonType, props.size, props.inverse, props.darkMode)};\n\t}\n\n\t.icon-leading {\n\t\theight: ${(props) =>\n\t\t\tprops.size === 'chip' || props.size === 'xs' ? '16px' : '20px'};\n\t\twidth: ${(props) =>\n\t\t\tprops.size === 'chip' || props.size === 'xs' ? '16px' : '20px'};\n\t}\n\n\t${(props) =>\n\t\tgetDashedBorderStyling(\n\t\t\tprops.buttonType,\n\t\t\tprops.size,\n\t\t\tprops.isLoading\n\t\t\t\t? COLORS.stroke.brandLightAlt\n\t\t\t\t: props.error\n\t\t\t\t? COLORS.stroke.negative.vibrant\n\t\t\t\t: undefined,\n\t\t)}\n\n\t.overlay-container {\n\t\tdisplay: none;\n\t}\n\n\t${(props) =>\n\t\t!props.disabled &&\n\t\t!props.isLoading &&\n\t\tprops.activated &&\n\t\t(props.buttonType == 'dashBold' || props.buttonType == 'dashRegular') &&\n\t\t`\n\t.button-container {\n\t\tdisplay: flex;\n\t\t${props.matchParentWidth ? 'justify-content: center;' : ''}\n\t\tposition: relative;\n\t\twidth: 100%;\n\t\t.overlay-container {\n\t\t\tdisplay: none !important;\n\t\t}\n\t\t${`.text {\n\t\t\tcolor: ${COLORS.content.brand} !important;\n\t\t}\n\t\t.icon {\n\t\t\tcolor: ${COLORS.background.brand};\n\t\t}\n\t\t`}\n\t}\n\t${getClickEffect(props.buttonType, props.size, props.inverse)}\n\t${getDashedBorderStyling(props.buttonType, props.size, COLORS.content.brand)}\n\t`}\n\n\t:disabled {\n\t\t.overlay-container {\n\t\t\tdisplay: none !important;\n\t\t}\n\t\tcursor: ${(props) =>\n\t\t\tprops.buttonType === 'text' ? 'auto' : 'not-allowed'};\n\t\t${(props) =>\n\t\t\tgenerateDisabledStyling(props.buttonType, props.size, props.inverse)}\n\t\t.text {\n\t\t\tcolor: ${(props) => getDisabledTextColor(props.inverse)} !important;\n\t\t}\n\t\t${(props) =>\n\t\t\tgetDashedBorderStyling(\n\t\t\t\tprops.buttonType,\n\t\t\t\tprops.size,\n\t\t\t\tCOLORS.stroke.primary,\n\t\t\t)}\n\t}\n\n\t${(props) =>\n\t\t!props.disabled &&\n\t\t!props.isLoading &&\n\t\t`:active {\n\t\t\t\t.button-container {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t${props.matchParentWidth ? 'justify-content: center;' : ''}\n\t\t\t\t\tposition: relative;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\t.overlay-container {\n\t\t\t\t\t\tdisplay: none !important;\n\t\t\t\t\t}\n\t\t\t\t\t${\n\t\t\t\t\t\tprops.size === 'chip' &&\n\t\t\t\t\t\t`.text {\n\t\t\t\t\t\tcolor: ${COLORS.background.inverseLight} !important;\n\t\t\t\t\t}\n\t\t\t\t\t.icon {\n\t\t\t\t\t\tcolor: ${COLORS.background.inverseLight};\n\t\t\t\t\t}\n\t\t\t\t\t`\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t${getClickEffect(props.buttonType, props.size, props.inverse)}\n\t\t\t${getDashedBorderStyling(props.buttonType, props.size, COLORS.content.brand)}\n\t\t}`}\n\n\t${(props) =>\n\t\t// do not load hover styles for loading state and also active state\n\t\t!props.isLoading\n\t\t\t? `:not(:active):not(:disabled):hover {\n\t\t\tpadding: 0;\n\t\t\t.button-container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 100%;\n\t\t\t\t${props.matchParentWidth ? 'justify-content: center;' : ''}\n\t\t\t\tpadding: ${getPadding(props.buttonType, props.size)};\n\t\t\t\t{${\n\t\t\t\t\tprops.buttonColor\n\t\t\t\t\t\t? `background-color: ${getHoverButtonBackgroundCustom(\n\t\t\t\t\t\t\t\tprops.buttonColor,\n\t\t\t\t\t\t\t\t15,\n\t\t\t\t\t\t )}`\n\t\t\t\t\t\t: ''\n\t\t\t\t}}\n\t\t\t\t.overlay-container {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tpadding: 0;\n\t\t\t\t\ttop: 0;\n\t\t\t\t\tleft: 0;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\theight: 100%;\n\t\t\t\t\t${getHoverButtonBackground(props.buttonType, props.inverse)}\n\t\t\t\t}\n\t\t\t\t${\n\t\t\t\t\tprops.size === 'chip' && props.buttonType !== 'text'\n\t\t\t\t\t\t? props.darkMode\n\t\t\t\t\t\t\t? `background-color: ${COLORS.stroke.primary};`\n\t\t\t\t\t\t\t: `background-color: ${COLORS.surface.hovered};`\n\t\t\t\t\t\t: ''\n\t\t\t\t}\n\t\t\t\t${\n\t\t\t\t\tprops.buttonType === 'special'\n\t\t\t\t\t\t? `background-color: ${COLORS.background.brandLight};`\n\t\t\t\t\t\t: props.buttonType === 'secondaryGray'\n\t\t\t\t\t\t? `background-color: ${COLORS.surface.hovered};`\n\t\t\t\t\t\t: ''\n\t\t\t\t}\n\t\t\t\t${\n\t\t\t\t\tprops.buttonType === 'primary' &&\n\t\t\t\t\tprops.size !== 'chip' &&\n\t\t\t\t\tprops.size !== 'xs' &&\n\t\t\t\t\t!props.inverse &&\n\t\t\t\t\t!props.buttonColor\n\t\t\t\t\t\t? `background-color: ${COLORS.background.inverse};`\n\t\t\t\t\t\t: ''\n\t\t\t\t}\n\t\t\t}\n\t\t\t${\n\t\t\t\tprops.buttonType === 'text'\n\t\t\t\t\t? getHoverButtonTextDecorationStyle(props.buttonType, props.disabled)\n\t\t\t\t\t: ''\n\t\t\t}\n\t\t\t${\n\t\t\t\tprops.inverse\n\t\t\t\t\t? generateInverseHoverBackground(props.buttonType, props.disabled)\n\t\t\t\t\t: ''\n\t\t\t}\n\t\t}`\n\t\t\t: `\n\t\t\tcursor: not-allowed;\n\t\t\tpadding: 0;\n\t\t${getLoadingBorder(props.buttonType, props.size, props.inverse)}\n\t\t${getLoadingBackground(\n\t\t\tprops.buttonType,\n\t\t\tprops.size,\n\t\t\tprops.inverse,\n\t\t\tprops.buttonColor,\n\t\t)}\n\n\t\t.button-container {\n\t\t\tdisplay: flex;\n\t\t\tposition: relative;\n\t\t\twidth: 100%;\n\t\t\t.text {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\t.icon-leading,\n\t\t\t.icon-component,\n\t\t\t.icon-trailing {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\t${\n\t\t\t\tprops.buttonColor\n\t\t\t\t\t? `background-color: ${getLoadingButtonBackgroundCustom(\n\t\t\t\t\t\t\tprops.buttonColor,\n\t\t\t\t\t\t\t15,\n\t\t\t\t\t )};`\n\t\t\t\t\t: ''\n\t\t\t}\n\t\t\tpadding: ${getPadding(props.buttonType, props.size)};\n\t\t\t.overlay-container {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\tposition: absolute;\n\t\t\t\tpadding: 0;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\t${getLoadingBackground(\n\t\t\t\t\tprops.buttonType,\n\t\t\t\t\tprops.size,\n\t\t\t\t\tprops.inverse,\n\t\t\t\t\tprops.buttonColor,\n\t\t\t\t)}\n\t\t\t\t.spinner {\n\t\t\t\t\tline-height: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}`}\n\n\t\t.button-container {\n\t\tdisplay: flex;\n\t\tgap: 8.33px;\n\t\t${(props) => (props.matchParentWidth ? 'margin: auto;' : '')}\n\t}\n`;\n\nexport const ButtonCustomDashedBorder = () => {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"line-top\"></div>\n\t\t\t<div className=\"line-left\"></div>\n\t\t\t<div className=\"line-bottom\"></div>\n\t\t\t<div className=\"line-right\"></div>\n\t\t</>\n\t);\n};\n"],"names":["Button","styled","props","getBackgroundColor","getPadding","getBorder","getColor","getDashedBorderStyling","COLORS","getClickEffect","generateDisabledStyling","getDisabledTextColor","getLoadingBorder","getLoadingBackground","getLoadingButtonBackgroundCustom","getHoverButtonBackgroundCustom","getHoverButtonBackground","getHoverButtonTextDecorationStyle","generateInverseHoverBackground","ButtonCustomDashedBorder","jsxs","Fragment","jsx"],"mappings":";;;;AAqBO,MAAMA,IAASC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAkBX,CAACC,MAAWA,EAAM,cAAc,SAAS,MAAM,KAAM;AAAA;AAAA,GAEpE,CAACA,MAAWA,EAAM,mBAAmB,kBAAkB,EAAG;AAAA,qBACxC,CAACA,MACpBC;AAAA,EACCD,EAAM;AAAA,EACNA,EAAM;AAAA,EACNA,EAAM;AAAA,EACNA,EAAM;AAAA,EACNA,EAAM;AACP,CAAC;AAAA;AAAA,GAEA,CAACA,MACFA,EAAM,WAAW,WAAW,MAAM,IAC/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAMEA,EAAM,mBAAmB,6B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,eAAe,SAClBe,EAAkCf,EAAM,YAAYA,EAAM,QAAQ,IAClE,EACJ;AAAA,KAECA,EAAM,UACHgB,EAA+BhB,EAAM,YAAYA,EAAM,QAAQ,IAC/D,EACJ;AAAA;AAAA,CAsDC;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,CAACA,MAAWA,EAAM,mBAAmB,kBAAkB,EAAG;AAAA;AAAA,GAIjDiB,IAA2B,MAEtC,gBAAAC,EAAAC,GAAA,EACC,UAAA;AAAA,EAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,WAAA,CAAW;AAAA,EAC1B,gBAAAA,EAAC,OAAA,EAAI,WAAU,YAAA,CAAY;AAAA,EAC3B,gBAAAA,EAAC,OAAA,EAAI,WAAU,cAAA,CAAc;AAAA,EAC7B,gBAAAA,EAAC,OAAA,EAAI,WAAU,aAAA,CAAa;AAAA,GAC7B;"}
|
|
@@ -26,28 +26,28 @@ const H = ({
|
|
|
26
26
|
showTrailingIconPlaceholder: V = !1,
|
|
27
27
|
showLabelsOnMoreHover: j = !1,
|
|
28
28
|
value: l,
|
|
29
|
-
showSelected:
|
|
29
|
+
showSelected: f = !1,
|
|
30
30
|
onDropdownVisbilityChange: z,
|
|
31
31
|
...t
|
|
32
32
|
}) => {
|
|
33
|
-
const [
|
|
33
|
+
const [c, F] = g(!1), [y, I] = g(!1), i = E ?? "default", B = G(), [s, d] = g(
|
|
34
34
|
o ?? []
|
|
35
35
|
);
|
|
36
36
|
function N(e) {
|
|
37
|
-
Array.isArray(e) ?
|
|
37
|
+
Array.isArray(e) ? d([...e]) : d([e]), M?.(e);
|
|
38
38
|
}
|
|
39
39
|
p(() => {
|
|
40
40
|
const e = [];
|
|
41
|
-
t?.options?.forEach((
|
|
42
|
-
|
|
41
|
+
t?.options?.forEach((h) => {
|
|
42
|
+
h.options ? h.options.forEach((u) => {
|
|
43
43
|
u.selected && e.push({
|
|
44
44
|
...u,
|
|
45
45
|
label: u.label
|
|
46
46
|
});
|
|
47
|
-
}) :
|
|
48
|
-
}),
|
|
47
|
+
}) : h.selected && e.push(h);
|
|
48
|
+
}), d([...e]);
|
|
49
49
|
}, [t.options]), p(() => {
|
|
50
|
-
o &&
|
|
50
|
+
o && d([...o]);
|
|
51
51
|
}, [o]);
|
|
52
52
|
const U = Z(s), _ = w ? a : U ?? a ?? "Select an option", m = t.buttonWidth, C = m ?? t.width ?? "100%", q = t.dropdownWidth ?? C;
|
|
53
53
|
return /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(
|
|
@@ -61,14 +61,19 @@ const H = ({
|
|
|
61
61
|
zIndex: 1,
|
|
62
62
|
cursor: "pointer",
|
|
63
63
|
padding: i === "x-small" ? "4px 8px" : "6px 8px",
|
|
64
|
-
backgroundColor: t.version === "3.0" ?
|
|
64
|
+
backgroundColor: t.version === "3.0" ? c || y ? r.surface.hovered : r.surface.standard : f && l !== void 0 ? J.positive[100] : (
|
|
65
|
+
// The hover wrapper also contains the popover, so while the
|
|
66
|
+
// dropdown is open, hovering an option would grey the input
|
|
67
|
+
// — only show hover feedback while closed.
|
|
68
|
+
y && !c ? r.background.inactive : r.surface.standard
|
|
69
|
+
),
|
|
65
70
|
transition: "background-color 0.3s ease",
|
|
66
71
|
...A
|
|
67
72
|
},
|
|
68
73
|
input: {
|
|
69
74
|
minHeight: "100%",
|
|
70
75
|
maxWidth: "100%",
|
|
71
|
-
color:
|
|
76
|
+
color: f && l !== void 0 ? r.content.positive : "inherit"
|
|
72
77
|
}
|
|
73
78
|
},
|
|
74
79
|
children: /* @__PURE__ */ n(
|
|
@@ -117,12 +122,12 @@ const H = ({
|
|
|
117
122
|
K,
|
|
118
123
|
{
|
|
119
124
|
style: {
|
|
120
|
-
transform:
|
|
125
|
+
transform: c ? "rotate(180deg)" : "rotate(0deg)"
|
|
121
126
|
},
|
|
122
127
|
onClick: O,
|
|
123
128
|
width: i === "x-small" ? 16 : i === "small" ? 20 : 24,
|
|
124
129
|
height: i === "x-small" ? 16 : i === "small" ? 20 : 24,
|
|
125
|
-
color:
|
|
130
|
+
color: f ? r.content.positive : r.content.primary
|
|
126
131
|
}
|
|
127
132
|
)
|
|
128
133
|
]
|
|
@@ -141,7 +146,7 @@ const H = ({
|
|
|
141
146
|
R?.(e);
|
|
142
147
|
},
|
|
143
148
|
errorMessage: t.error,
|
|
144
|
-
isDropdownOpened:
|
|
149
|
+
isDropdownOpened: c,
|
|
145
150
|
sizeToUse: i,
|
|
146
151
|
containerStyle: {
|
|
147
152
|
width: t.width ?? "100%",
|