Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

refactor(web): migrate dataset icon commands (#40647)

yyh288766171d9d
diff --git a/oxlint-suppressions.json b/oxlint-suppressions.json
index df14b5896a8..171e9a141ca 100644
--- a/oxlint-suppressions.json
+++ b/oxlint-suppressions.json
@@ -1141,7 +1141,7 @@
},
"web/app/components/base/icons/src/public/knowledge/online-drive/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 3
+ "count": 2
}
},
"web/app/components/base/icons/src/public/llm/index.ts": {
diff --git a/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsGray.json b/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsGray.json
deleted file mode 100644
index ed31435ede0..00000000000
--- a/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsGray.json
+++ /dev/null
@@ -1,591 +0,0 @@
-{
- "icon": {
- "type": "element",
- "isRootNode": true,
- "name": "svg",
- "attributes": {
- "width": "18",
- "height": "19",
- "viewBox": "0 0 18 19",
- "fill": "none",
- "xmlns": "http://www.w3.org/2000/svg"
- },
- "children": [
- {
- "type": "element",
- "name": "g",
- "attributes": {
- "filter": "url(#filter0_dg_9155_106569)"
- },
- "children": [
- {
- "type": "element",
- "name": "path",
- "attributes": {
- "fill-rule": "evenodd",
- "clip-rule": "evenodd",
- "d": "M2.71865 4.37937C2.68524 4.25999 2.66663 4.13355 2.66663 4.00016C2.66663 3.4484 2.98515 3.01549 3.35148 2.7098C3.72157 2.40099 4.21723 2.15279 4.77114 1.95729C5.88498 1.56417 7.38013 1.3335 8.99996 1.3335C10.6198 1.3335 12.115 1.56417 13.2288 1.95729C13.7827 2.15279 14.2784 2.40099 14.6484 2.7098C15.0148 3.01549 15.3333 3.4484 15.3333 4.00016C15.3333 4.1336 15.3146 4.26009 15.2812 4.37951L13.9096 12.9861C13.8459 13.447 13.5885 13.8203 13.2754 14.1042C12.9608 14.3892 12.558 14.6152 12.122 14.7906C11.2488 15.1417 10.1334 15.3334 8.99996 15.3334C7.86896 15.3334 6.76119 15.1485 5.8906 14.8C5.07268 14.4727 4.23491 13.9023 4.09151 12.9934L4.09139 12.9926L2.71865 4.37937ZM13.7942 4.26678C13.5908 4.43652 13.2566 4.61928 12.785 4.78572C11.8479 5.11646 10.5098 5.3335 8.99996 5.3335C7.49016 5.3335 6.15199 5.11646 5.21489 4.78572C4.74334 4.61928 4.40913 4.43652 4.20573 4.26678C3.98111 4.07936 3.97209 3.92848 4.20573 3.73353C4.40913 3.56379 4.74334 3.38103 5.21489 3.2146C6.15199 2.88386 7.49016 2.66682 8.99996 2.66682C10.5098 2.66682 11.8479 2.88386 12.785 3.2146C13.2566 3.38103 13.5908 3.56379 13.7942 3.73353C14.0253 3.92637 14.0303 4.06978 13.7942 4.26678Z",
- "fill": "url(#paint0_linear_9155_106569)"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "path",
- "attributes": {
- "d": "M8.99963 1.5835C10.5986 1.5835 12.0645 1.81154 13.1451 2.19287C13.6835 2.38289 14.1491 2.61917 14.4879 2.90186C14.825 3.18316 15.0836 3.55264 15.0836 4.00049C15.0836 4.11011 15.0681 4.21383 15.0406 4.31201L15.0367 4.32568L15.0348 4.34033L13.6627 12.9468L13.6617 12.9517C13.6085 13.3371 13.3916 13.6605 13.1071 13.9185C12.8211 14.1776 12.4474 14.3908 12.0289 14.5591C11.1912 14.8959 10.1081 15.0835 8.99963 15.0835C7.89281 15.0835 6.81755 14.9019 5.98303 14.5679C5.18068 14.2467 4.4599 13.7234 4.3385 12.9546V12.9526L2.96545 4.34033L2.9635 4.32568L2.95959 4.31201L2.92737 4.16064C2.92011 4.10875 2.91664 4.05535 2.91663 4.00049C2.91663 3.55274 3.17436 3.18313 3.51135 2.90186C3.85017 2.61914 4.31573 2.38291 4.85413 2.19287C5.93475 1.81147 7.40056 1.58353 8.99963 1.5835ZM8.99963 2.4165C7.46933 2.41654 6.10163 2.63659 5.13147 2.979C4.64464 3.15085 4.28017 3.34571 4.04553 3.5415C3.91579 3.64976 3.78112 3.80197 3.78381 4.00635C3.7865 4.20806 3.92243 4.35576 4.04553 4.4585C4.28015 4.65428 4.64467 4.84915 5.13147 5.021C6.10163 5.36341 7.46933 5.58346 8.99963 5.5835C10.5299 5.5835 11.8975 5.36338 12.8678 5.021C13.3547 4.84912 13.72 4.65433 13.9547 4.4585C14.0815 4.35269 14.2209 4.20184 14.2194 3.99658C14.2178 3.79281 14.0778 3.64424 13.9547 3.5415C13.72 3.34567 13.3547 3.15088 12.8678 2.979C11.8975 2.63664 10.5299 2.4165 8.99963 2.4165Z",
- "stroke": "white",
- "stroke-opacity": "0.01",
- "stroke-width": "0.5"
- },
- "children": []
- }
- ]
- },
- {
- "type": "element",
- "name": "path",
- "attributes": {
- "opacity": "0.8",
- "d": "M8.99999 8.3335C8.36485 8.3335 7.81909 8.71403 7.57737 9.25902C6.99119 9.39939 6.55554 9.92652 6.55554 10.5557C6.55554 11.2921 7.1525 11.8891 7.88888 11.8891H10.3333C10.947 11.8891 11.4444 11.3916 11.4444 10.7779C11.4444 10.2358 11.0561 9.78432 10.5425 9.68647C10.4432 8.92308 9.79045 8.3335 8.99999 8.3335Z",
- "fill": "white"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "path",
- "attributes": {
- "fill-rule": "evenodd",
- "clip-rule": "evenodd",
- "d": "M2.71865 4.37908C2.68524 4.2597 2.66663 4.13326 2.66663 3.99986C2.66663 3.88343 2.68081 3.7723 2.70663 3.66653C2.71039 3.68194 2.7144 3.69723 2.71865 3.71241L4.09151 12.3264C4.23491 13.2353 5.07268 13.8057 5.8906 14.1331C6.76119 14.4815 7.86896 14.6665 8.99996 14.6665C10.1334 14.6665 11.2488 14.4747 12.122 14.1236C12.558 13.9483 12.9608 13.7223 13.2754 13.4372C13.5885 13.1533 13.8459 12.78 13.9096 12.3191L15.2812 3.71255C15.2855 3.69732 15.2895 3.68197 15.2933 3.6665C15.3191 3.77228 15.3333 3.88343 15.3333 3.99986C15.3333 4.1333 15.3146 4.2598 15.2812 4.37922L13.9096 12.9858C13.8459 13.4467 13.5885 13.82 13.2754 14.1039C12.9608 14.3889 12.558 14.6149 12.122 14.7903C11.2488 15.1414 10.1334 15.3331 8.99996 15.3331C7.86896 15.3331 6.76119 15.1482 5.8906 14.7997C5.07268 14.4724 4.23491 13.902 4.09151 12.9931L2.71865 4.37908Z",
- "fill": "#101828",
- "fill-opacity": "0.14"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "defs",
- "attributes": {},
- "children": [
- {
- "type": "element",
- "name": "filter",
- "attributes": {
- "id": "filter0_dg_9155_106569",
- "x": "0.666626",
- "y": "0.133496",
- "width": "16.6666",
- "height": "18.2",
- "filterUnits": "userSpaceOnUse",
- "color-interpolation-filters": "sRGB"
- },
- "children": [
- {
- "type": "element",
- "name": "feFlood",
- "attributes": {
- "flood-opacity": "0",
- "result": "BackgroundImageFix"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feColorMatrix",
- "attributes": {
- "in": "SourceAlpha",
- "type": "matrix",
- "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
- "result": "hardAlpha"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feOffset",
- "attributes": {
- "dy": "1"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feGaussianBlur",
- "attributes": {
- "stdDeviation": "1"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in2": "hardAlpha",
- "operator": "out"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feColorMatrix",
- "attributes": {
- "type": "matrix",
- "values": "0 0 0 0 0.0352941 0 0 0 0 0.0352941 0 0 0 0 0.0431373 0 0 0 0.05 0"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feBlend",
- "attributes": {
- "mode": "normal",
- "in2": "BackgroundImageFix",
- "result": "effect1_dropShadow_9155_106569"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feBlend",
- "attributes": {
- "mode": "normal",
- "in": "BackgroundImageFix",
- "in2": "effect1_dropShadow_9155_106569",
- "result": "BackgroundImageFix"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feBlend",
- "attributes": {
- "mode": "normal",
- "in": "SourceGraphic",
- "in2": "BackgroundImageFix",
- "result": "shape"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feTurbulence",
- "attributes": {
- "type": "fractalNoise",
- "baseFrequency": "9.0909090042114258 9.0909090042114258",
- "numOctaves": "3",
- "seed": "5297",
- "result": "displacementX"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feTurbulence",
- "attributes": {
- "type": "fractalNoise",
- "baseFrequency": "9.0909090042114258 9.0909090042114258",
- "numOctaves": "3",
- "seed": "5298",
- "result": "displacementY"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feColorMatrix",
- "attributes": {
- "in": "displacementX",
- "type": "matrix",
- "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1",
- "result": "displacementXRed"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feColorMatrix",
- "attributes": {
- "in": "displacementY",
- "type": "matrix",
- "values": "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in": "displacementXRed",
- "operator": "arithmetic",
- "k1": "0",
- "k2": "1",
- "k3": "1",
- "k4": "0"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feDisplacementMap",
- "attributes": {
- "in": "shape",
- "scale": "2.4000000953674316",
- "xChannelSelector": "R",
- "yChannelSelector": "G",
- "width": "100%",
- "height": "100%"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feColorMatrix",
- "attributes": {
- "type": "matrix",
- "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComponentTransfer",
- "attributes": {
- "result": "sourceDisplacedAlpha"
- },
- "children": [
- {
- "type": "element",
- "name": "feFuncA",
- "attributes": {
- "type": "gamma",
- "exponent": "0.2"
- },
- "children": []
- }
- ]
- },
- {
- "type": "element",
- "name": "feColorMatrix",
- "attributes": {
- "in": "shape",
- "type": "matrix",
- "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComponentTransfer",
- "attributes": {
- "result": "inputSourceAlpha"
- },
- "children": [
- {
- "type": "element",
- "name": "feFuncA",
- "attributes": {
- "type": "gamma",
- "exponent": "0.2"
- },
- "children": []
- }
- ]
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in": "sourceDisplacedAlpha",
- "operator": "arithmetic",
- "k1": "1",
- "k2": "0",
- "k3": "0",
- "k4": "0",
- "result": "displacementAlphasMultiplied"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in": "displacementAlphasMultiplied",
- "operator": "arithmetic",
- "k1": "0",
- "k2": "0",
- "k3": "-0.5",
- "k4": "0.5",
- "result": "centeringAdjustment"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in": "displacementX",
- "in2": "displacementAlphasMultiplied",
- "operator": "arithmetic",
- "k1": "1",
- "k2": "0",
- "k3": "0",
- "k4": "0"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in": "centeringAdjustment",
- "operator": "arithmetic",
- "k1": "0",
- "k2": "1",
- "k3": "1",
- "k4": "0"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feColorMatrix",
- "attributes": {
- "type": "matrix",
- "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1",
- "result": "displacementXFinal"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in": "displacementY",
- "in2": "displacementAlphasMultiplied",
- "operator": "arithmetic",
- "k1": "1",
- "k2": "0",
- "k3": "0",
- "k4": "0"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in": "centeringAdjustment",
- "operator": "arithmetic",
- "k1": "0",
- "k2": "1",
- "k3": "1",
- "k4": "0"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feColorMatrix",
- "attributes": {
- "type": "matrix",
- "values": "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1",
- "result": "displacementYFinal"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in": "displacementXFinal",
- "in2": "displacementYFinal",
- "operator": "arithmetic",
- "k1": "0",
- "k2": "1",
- "k3": "1",
- "k4": "0"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in2": "displacementAlphasMultiplied",
- "operator": "in",
- "result": "displacementMap"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feFlood",
- "attributes": {
- "flood-color": "rgb(127, 127, 127)",
- "flood-opacity": "1"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in2": "displacementAlphasMultiplied",
- "operator": "out"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in2": "displacementMap",
- "operator": "over",
- "result": "displacementMapWithBg"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feDisplacementMap",
- "attributes": {
- "in": "shape",
- "scale": "2.4000000953674316",
- "xChannelSelector": "R",
- "yChannelSelector": "G",
- "width": "100%",
- "height": "100%",
- "result": "displacedImage"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feColorMatrix",
- "attributes": {
- "in": "shape",
- "type": "matrix",
- "values": "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 127 0",
- "result": "imageOpaque"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feDisplacementMap",
- "attributes": {
- "in": "imageOpaque",
- "in2": "displacementMapWithBg",
- "scale": "2.4000000953674316",
- "xChannelSelector": "R",
- "yChannelSelector": "G",
- "width": "100%",
- "height": "100%",
- "result": "displacedImageOpaque"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feColorMatrix",
- "attributes": {
- "in": "displacedImage",
- "type": "matrix",
- "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
- "result": "displacedImageRed"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feColorMatrix",
- "attributes": {
- "in": "shape",
- "type": "matrix",
- "values": "0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in": "displacedImageRed",
- "operator": "atop",
- "result": "transparencyRedMap"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feColorMatrix",
- "attributes": {
- "in": "transparencyRedMap",
- "type": "matrix",
- "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0",
- "result": "transparencyAlphaMap"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in": "displacedImageOpaque",
- "in2": "imageOpaque",
- "operator": "over"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "feComposite",
- "attributes": {
- "in2": "transparencyAlphaMap",
- "operator": "in",
- "result": "effect2_texture_9155_106569"
- },
- "children": []
- }
- ]
- },
- {
- "type": "element",
- "name": "linearGradient",
- "attributes": {
- "id": "paint0_linear_9155_106569",
- "x1": "8.99996",
- "y1": "1.3335",
- "x2": "8.99996",
- "y2": "15.3334",
- "gradientUnits": "userSpaceOnUse"
- },
- "children": [
- {
- "type": "element",
- "name": "stop",
- "attributes": {
- "stop-color": "#98A2B2"
- },
- "children": []
- },
- {
- "type": "element",
- "name": "stop",
- "attributes": {
- "offset": "1",
- "stop-color": "#676F83"
- },
- "children": []
- }
- ]
- }
- ]
- }
- ]
- },
- "name": "BucketsGray"
-}
diff --git a/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsGray.tsx b/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsGray.tsx
deleted file mode 100644
index a1b9146b77e..00000000000
--- a/web/app/components/base/icons/src/public/knowledge/online-drive/BucketsGray.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-// GENERATE BY script
-// DON NOT EDIT IT MANUALLY
-
-import type { IconData } from '@/app/components/base/icons/IconBase'
-import * as React from 'react'
-import IconBase from '@/app/components/base/icons/IconBase'
-import data from './BucketsGray.json'
-
-const Icon = ({
- ref,
- ...props
-}: React.SVGProps<SVGSVGElement> & {
- ref?: React.RefObject<React.RefObject<HTMLOrSVGElement>>
-}) => <IconBase {...props} ref={ref} data={data as IconData} />
-
-Icon.displayName = 'BucketsGray'
-
-export default Icon
diff --git a/web/app/components/base/icons/src/public/knowledge/online-drive/index.ts b/web/app/components/base/icons/src/public/knowledge/online-drive/index.ts
index 44e4a9d6406..76c391060d0 100644
--- a/web/app/components/base/icons/src/public/knowledge/online-drive/index.ts
+++ b/web/app/components/base/icons/src/public/knowledge/online-drive/index.ts
@@ -1,3 +1,2 @@
export { default as BucketsBlue } from './BucketsBlue'
-export { default as BucketsGray } from './BucketsGray'
export { default as Folder } from './Folder'
diff --git a/web/app/components/datasets/common/image-previewer/index.tsx b/web/app/components/datasets/common/image-previewer/index.tsx
index 597d8e65e08..f452074c4b7 100644
--- a/web/app/components/datasets/common/image-previewer/index.tsx
+++ b/web/app/components/datasets/common/image-previewer/index.tsx
@@ -1,7 +1,6 @@
-import { Button } from '@langgenius/dify-ui/button'
import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'
+import { IconButton } from '@langgenius/dify-ui/icon-button'
import { Kbd } from '@langgenius/dify-ui/kbd'
-import { RiArrowLeftLine, RiArrowRightLine, RiCloseLine, RiRefreshLine } from '@remixicon/react'
import { formatForDisplay, useHotkey } from '@tanstack/react-hotkeys'
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
@@ -159,30 +158,29 @@ const ImagePreviewer = ({ images, initialIndex = 0, onClose }: ImagePreviewerPro
backdropClassName="bg-transparent!"
>
<div className="absolute top-6 right-6 z-10 flex cursor-pointer flex-col items-center gap-y-1">
- <Button
+ <IconButton
variant="tertiary"
+ size="xl"
aria-label={t(($) => $['operation.close'], { ns: 'common' })}
onClick={onClose}
- className="size-9 rounded-[10px] p-0"
- size="large"
>
- <RiCloseLine className="size-5" />
- </Button>
+ <span aria-hidden className="i-ri-close-line size-5" />
+ </IconButton>
<Kbd>{formatForDisplay('Escape')}</Kbd>
</div>
{cachedImages[currentImage!.url]!.status === 'loading' && <Loading type="app" />}
{cachedImages[currentImage!.url]!.status === 'error' && (
<div className="flex max-w-sm flex-col items-center gap-y-2 system-sm-regular text-text-tertiary">
<span>{`Failed to load image: ${currentImage!.url}. Please try again.`}</span>
- <Button
+ <IconButton
variant="secondary"
+ size="xl"
aria-label={t(($) => $['operation.retry'], { ns: 'common' })}
onClick={() => retryImage(currentImage!)}
- className="size-9 rounded-full p-0"
- size="large"
+ className="rounded-full"
>
- <RiRefreshLine className="size-5" />
- </Button>
+ <span aria-hidden className="i-ri-refresh-line size-5" />
+ </IconButton>
</div>
)}
{cachedImages[currentImage!.url]!.status === 'loaded' && (
@@ -201,26 +199,26 @@ const ImagePreviewer = ({ images, initialIndex = 0, onClose }: ImagePreviewerPro
</div>
</div>
)}
- <Button
+ <IconButton
variant="secondary"
+ size="xl"
aria-label={t(($) => $['pagination.previous'], { ns: 'common' })}
onClick={prevImage}
- className="absolute top-1/2 left-8 z-10 size-9 -translate-y-1/2 rounded-full p-0"
+ className="absolute top-1/2 left-8 z-10 -translate-y-1/2 rounded-full"
disabled={currentIndex === 0}
- size="large"
>
- <RiArrowLeftLine className="size-5" />
- </Button>
- <Button
+ <span aria-hidden className="i-ri-arrow-left-line size-5" />
+ </IconButton>
+ <IconButton
variant="secondary"
+ size="xl"
aria-label={t(($) => $['pagination.next'], { ns: 'common' })}
onClick={nextImage}
- className="absolute top-1/2 right-8 z-10 size-9 -translate-y-1/2 rounded-full p-0"
+ className="absolute top-1/2 right-8 z-10 -translate-y-1/2 rounded-full"
disabled={currentIndex === images.length - 1}
- size="large"
>
- <RiArrowRightLine className="size-5" />
- </Button>
+ <span aria-hidden className="i-ri-arrow-right-line size-5" />
+ </IconButton>
</DialogContent>
</Dialog>
)
diff --git a/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/image-item.tsx b/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/image-item.tsx
index b42079ad957..6bd81861d00 100644
--- a/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/image-item.tsx
+++ b/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/image-item.tsx
@@ -1,11 +1,9 @@
import type { FileEntity } from '../types'
-import { Button } from '@langgenius/dify-ui/button'
+import { IconButton } from '@langgenius/dify-ui/icon-button'
import { ProgressCircle } from '@langgenius/dify-ui/progress'
-import { RiCloseLine } from '@remixicon/react'
import { memo, useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import FileImageRender from '@/app/components/base/file-uploader/file-image-render'
-import { ReplayLine } from '@/app/components/base/icons/src/vender/other'
import { fileIsUploaded } from '../utils'
type ImageItemProps = {
@@ -49,12 +47,18 @@ const ImageItem = ({ file, showDeleteAction, onRemove, onReUpload, onPreview }:
return (
<div className="group/file-image relative cursor-pointer" onClick={handlePreview}>
{showDeleteAction && (
- <Button
- className="absolute -top-1.5 -right-1.5 z-11 hidden size-5 rounded-full p-0 group-hover/file-image:flex"
+ <IconButton
+ aria-label={t(($) => $['operation.remove'], { ns: 'common' })}
+ variant="secondary"
+ size="sm"
+ className="absolute -top-1.5 -right-1.5 z-11 hidden rounded-full group-hover/file-image:flex"
onClick={handleRemove}
>
- <RiCloseLine className="size-4 text-components-button-secondary-text" />
- </Button>
+ <span
+ aria-hidden
+ className="i-ri-close-line size-4 text-components-button-secondary-text"
+ />
+ </IconButton>
)}
<FileImageRender className="h-17 w-17 shadow-md" imageUrl={base64Url || sourceUrl || ''} />
{progress >= 0 && !fileIsUploaded(file) && (
@@ -71,7 +75,10 @@ const ImageItem = ({ file, showDeleteAction, onRemove, onReUpload, onPreview }:
className="absolute inset-0 z-10 flex items-center justify-center border-2 border-state-destructive-border bg-background-overlay-destructive"
onClick={handleReUpload}
>
- <ReplayLine className="size-5 text-text-primary-on-surface" />
+ <span
+ aria-hidden
+ className="i-custom-vender-other-replay-line size-5 text-text-primary-on-surface"
+ />
</div>
)}
</div>
diff --git a/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/image-item.tsx b/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/image-item.tsx
index b32a1cacadb..0d8e0125161 100644
--- a/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/image-item.tsx
+++ b/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/image-item.tsx
@@ -1,11 +1,9 @@
import type { FileEntity } from '../types'
-import { Button } from '@langgenius/dify-ui/button'
+import { IconButton } from '@langgenius/dify-ui/icon-button'
import { ProgressCircle } from '@langgenius/dify-ui/progress'
-import { RiCloseLine } from '@remixicon/react'
import { memo, useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import FileImageRender from '@/app/components/base/file-uploader/file-image-render'
-import { ReplayLine } from '@/app/components/base/icons/src/vender/other'
import { fileIsUploaded } from '../utils'
type ImageItemProps = {
@@ -49,12 +47,18 @@ const ImageItem = ({ file, showDeleteAction, onRemove, onReUpload, onPreview }:
return (
<div className="group/file-image relative cursor-pointer" onClick={handlePreview}>
{showDeleteAction && (
- <Button
- className="absolute -top-1.5 -right-1.5 z-11 hidden size-5 rounded-full p-0 group-hover/file-image:flex"
+ <IconButton
+ aria-label={t(($) => $['operation.remove'], { ns: 'common' })}
+ variant="secondary"
+ size="sm"
+ className="absolute -top-1.5 -right-1.5 z-11 hidden rounded-full group-hover/file-image:flex"
onClick={handleRemove}
>
- <RiCloseLine className="size-4 text-components-button-secondary-text" />
- </Button>
+ <span
+ aria-hidden
+ className="i-ri-close-line size-4 text-components-button-secondary-text"
+ />
+ </IconButton>
)}
<FileImageRender className="size-20 shadow-md" imageUrl={base64Url || sourceUrl || ''} />
{progress >= 0 && !fileIsUploaded(file) && (
@@ -71,7 +75,10 @@ const ImageItem = ({ file, showDeleteAction, onRemove, onReUpload, onPreview }:
className="absolute inset-0 z-10 flex items-center justify-center border-2 border-state-destructive-border bg-background-overlay-destructive"
onClick={handleReUpload}
>
- <ReplayLine className="size-5 text-text-primary-on-surface" />
+ <span
+ aria-hidden
+ className="i-custom-vender-other-replay-line size-5 text-text-primary-on-surface"
+ />
</div>
)}
</div>
diff --git a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/__tests__/index.spec.tsx b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/__tests__/index.spec.tsx
index 3982556c4de..748efeecdd6 100644
--- a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/__tests__/index.spec.tsx
+++ b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/__tests__/index.spec.tsx
@@ -873,7 +873,7 @@ describe('CreateFromDSLModal', () => {
expect(screen.getByText('test.pipeline'))!.toBeInTheDocument()
})
- // Now remove the file by clicking delete button (inside ActionButton)
+ // Now remove the file by clicking the delete icon button.
const actionButton = document.querySelector('[class*="group-hover"]')
const deleteButton = actionButton?.querySelector('button')
if (deleteButton) {
diff --git a/web/app/components/datasets/create/step-two/components/option-card.tsx b/web/app/components/datasets/create/step-two/components/option-card.tsx
index f73c1468ce5..5ee9cfb7ebc 100644
--- a/web/app/components/datasets/create/step-two/components/option-card.tsx
+++ b/web/app/components/datasets/create/step-two/components/option-card.tsx
@@ -48,7 +48,7 @@ const OptionCardHeader: FC<OptionCardHeaderProps> = (props) => {
/>
)}
<div className="p-1">
- <div className="flex action-btn-l justify-center border border-components-panel-border-subtle bg-background-default-dodge shadow-md">
+ <div className="flex size-8 items-center justify-center rounded-lg border border-components-panel-border-subtle bg-background-default-dodge p-1.5 shadow-md">
{icon}
</div>
</div>
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/base/header.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/base/header.tsx
index 8252d27fd55..876495018f7 100644
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/base/header.tsx
+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/base/header.tsx
@@ -1,5 +1,5 @@
import type { CredentialSelectorProps } from './credential-selector'
-import { Button } from '@langgenius/dify-ui/button'
+import { IconButton } from '@langgenius/dify-ui/icon-button'
import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
@@ -25,15 +25,15 @@ const Header = ({ docTitle, docLink, onClickConfiguration, pluginName, ...rest }
<Tooltip>
<TooltipTrigger
render={
- <Button
+ <IconButton
variant="ghost"
- size="small"
- className="size-6 shrink-0 px-1"
+ size="md"
+ className="shrink-0"
aria-label={configurationTip}
onClick={onClickConfiguration}
>
<span aria-hidden className="i-ri-equalizer-2-line size-4" />
- </Button>
+ </IconButton>
}
/>
<TooltipContent>{configurationTip}</TooltipContent>
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/__tests__/bucket.spec.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/__tests__/bucket.spec.tsx
index 164b4f19c9b..58d93a682b2 100644
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/__tests__/bucket.spec.tsx
+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/__tests__/bucket.spec.tsx
@@ -2,12 +2,6 @@ import { fireEvent, render, screen } from '@testing-library/react'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import Bucket from '../bucket'
-vi.mock('@/app/components/base/icons/src/public/knowledge/online-drive', () => ({
- BucketsGray: (props: React.SVGProps<SVGSVGElement>) => (
- <svg data-testid="buckets-gray" {...props} />
- ),
-}))
-
describe('Bucket', () => {
const defaultProps = {
bucketName: 'my-bucket',
@@ -24,11 +18,6 @@ describe('Bucket', () => {
expect(screen.getByText('my-bucket'))!.toBeInTheDocument()
})
- it('should render bucket icon', () => {
- render(<Bucket {...defaultProps} />)
- expect(screen.getByTestId('buckets-gray'))!.toBeInTheDocument()
- })
-
it('should call handleBackToBucketList on icon button click', () => {
render(<Bucket {...defaultProps} />)
fireEvent.click(
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/bucket.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/bucket.tsx
index 93138df69eb..979e4bc8f81 100644
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/bucket.tsx
+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/bucket.tsx
@@ -1,10 +1,9 @@
-import { Button } from '@langgenius/dify-ui/button'
import { cn } from '@langgenius/dify-ui/cn'
+import { IconButton } from '@langgenius/dify-ui/icon-button'
import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'
import * as React from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
-import { BucketsGray } from '@/app/components/base/icons/src/public/knowledge/online-drive'
type BucketProps = {
bucketName: string
@@ -36,16 +35,19 @@ const Bucket = ({
<Tooltip>
<TooltipTrigger
render={
- <Button
+ <IconButton
type="button"
variant="ghost"
- size="small"
+ size="md"
aria-label={allBucketsLabel}
- className="size-6 shrink-0 rounded-md px-0 hover:bg-state-base-hover focus-visible:ring-2 focus-visible:ring-state-accent-solid"
+ className="shrink-0"
onClick={handleBackToBucketList}
>
- <BucketsGray aria-hidden />
- </Button>
+ <span
+ aria-hidden
+ className="i-custom-public-knowledge-online-drive-buckets-gray h-4.75 w-4.5"
+ />
+ </IconButton>
}
/>
<TooltipContent>{allBucketsLabel}</TooltipContent>
diff --git a/web/app/components/datasets/documents/detail/settings/pipeline-settings/left-header.tsx b/web/app/components/datasets/documents/detail/settings/pipeline-settings/left-header.tsx
index 1fbbb2162b3..fad8c7d93b8 100644
--- a/web/app/components/datasets/documents/detail/settings/pipeline-settings/left-header.tsx
+++ b/web/app/components/datasets/documents/detail/settings/pipeline-settings/left-header.tsx
@@ -1,5 +1,4 @@
-import { Button } from '@langgenius/dify-ui/button'
-import { RiArrowLeftLine } from '@remixicon/react'
+import { IconButton } from '@langgenius/dify-ui/icon-button'
import * as React from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
@@ -26,14 +25,15 @@ const LeftHeader = ({ title }: LeftHeaderProps) => {
<div className="system-md-semibold text-text-primary">
{t(($) => $['addDocuments.steps.processDocuments'], { ns: 'datasetPipeline' })}
</div>
- <Button
+ <IconButton
variant="secondary-accent"
- className="absolute top-3.5 -left-11 size-9 rounded-full p-0"
+ size="xl"
+ className="absolute top-3.5 -left-11 rounded-full"
onClick={navigateBack}
aria-label={t(($) => $['operation.back'], { ns: 'common' })}
>
- <RiArrowLeftLine className="size-5" />
- </Button>
+ <span aria-hidden className="i-ri-arrow-left-line size-5" />
+ </IconButton>
<Effect className="-top-8.5 left-8 opacity-20" />
</div>
)
diff --git a/web/app/components/datasets/external-knowledge-base/create/index.tsx b/web/app/components/datasets/external-knowledge-base/create/index.tsx
index 0d29e6019c5..2d8ca76bed5 100644
--- a/web/app/components/datasets/external-knowledge-base/create/index.tsx
+++ b/web/app/components/datasets/external-knowledge-base/create/index.tsx
@@ -2,7 +2,7 @@
import type { CreateKnowledgeBaseReq } from './declarations'
import { Button } from '@langgenius/dify-ui/button'
-import { RiArrowLeftLine, RiArrowRightLine } from '@remixicon/react'
+import { IconButton } from '@langgenius/dify-ui/icon-button'
import { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Divider from '@/app/components/base/divider'
@@ -78,13 +78,15 @@ const ExternalKnowledgeBaseCreate: React.FC<ExternalKnowledgeBaseCreateProps> =
</a>
<span>{t(($) => $['connectHelper.helper5'], { ns: 'dataset' })} </span>
</p>
- <Button
- className="absolute top-1 -left-11 flex h-8 w-8 items-center justify-center rounded-full p-2"
+ <IconButton
+ aria-label={t(($) => $['operation.back'], { ns: 'common' })}
+ className="absolute top-1 -left-11 rounded-full"
variant="tertiary"
+ size="lg"
onClick={navBackHandle}
>
- <RiArrowLeftLine className="size-4 text-text-tertiary" />
- </Button>
+ <span aria-hidden className="i-ri-arrow-left-line size-4 text-text-tertiary" />
+ </IconButton>
</div>
<KnowledgeBaseInfo
name={formData.name}
@@ -138,7 +140,10 @@ const ExternalKnowledgeBaseCreate: React.FC<ExternalKnowledgeBaseCreateProps> =
<div className="system-sm-medium text-components-button-primary-text">
{t(($) => $['externalKnowledgeForm.connect'], { ns: 'dataset' })}
</div>
- <RiArrowRightLine className="size-4 text-components-button-primary-text" />
+ <span
+ aria-hidden
+ className="i-ri-arrow-right-line size-4 text-components-button-primary-text"
+ />
</Button>
</div>
</div>
diff --git a/web/app/components/datasets/formatted-text/flavours/__tests__/edit-slice.spec.tsx b/web/app/components/datasets/formatted-text/flavours/__tests__/edit-slice.spec.tsx
index c015f07b6f2..1c91d924259 100644
--- a/web/app/components/datasets/formatted-text/flavours/__tests__/edit-slice.spec.tsx
+++ b/web/app/components/datasets/formatted-text/flavours/__tests__/edit-slice.spec.tsx
@@ -34,18 +34,6 @@ vi.mock('@floating-ui/react', () => ({
}),
}))
-vi.mock('@/app/components/base/action-button', () => {
- const comp = ({ children, onClick }: { children: React.ReactNode; onClick: () => void }) => (
- <button data-testid="action-button" onClick={onClick}>
- {children}
- </button>
- )
- return {
- default: comp,
- ActionButtonState: { Destructive: 'destructive' },
- }
-})
-
const { EditSlice } = await import('../edit-slice')
// Helper to find divider span (zero-width space)