se-design 1.0.61 → 1.0.62-dev
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/assets/colors.css +22 -9
- package/dist/assets/icons/command.svg +1 -1
- package/dist/assets/style.css +1 -1
- package/dist/components/BreadCrumbs/index.d.ts +2 -0
- package/dist/components/Button/index.d.ts +5 -1
- package/dist/index.js +23 -21
- package/dist/index.js.map +1 -1
- package/dist/index100.js +1 -1
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +1 -1
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +2 -2
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +1 -1
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +2 -2
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +1 -1
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +1 -1
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +1 -1
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +2 -2
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +1 -1
- package/dist/index109.js.map +1 -1
- package/dist/index110.js +2 -2
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +2 -2
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +2 -2
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +2 -2
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +1 -1
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +1 -1
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +1 -1
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +2 -2
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +2 -2
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +2 -2
- package/dist/index119.js.map +1 -1
- package/dist/index120.js +1 -1
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +1 -1
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +1 -1
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +1 -1
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +1 -1
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +1 -1
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +1 -1
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +1 -1
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -2
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +2 -2
- package/dist/index129.js.map +1 -1
- package/dist/index130.js +1 -1
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +1 -1
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +1 -1
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +1 -1
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +1 -1
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +1 -1
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +2 -2
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +1 -1
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +2 -2
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +2 -2
- package/dist/index139.js.map +1 -1
- package/dist/index140.js +2 -2
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +2 -2
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +1 -1
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +1 -1
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +1 -1
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +1 -1
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +1 -1
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +1 -1
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +1 -1
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +1 -1
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +2 -2
- package/dist/index150.js +1 -1
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +1 -1
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +1 -1
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +1 -1
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +1 -1
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +1 -1
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +1 -1
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +1 -1
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +1 -1
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +1 -1
- package/dist/index159.js.map +1 -1
- package/dist/index160.js +1 -1
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +1 -1
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +1 -1
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +1 -1
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +1 -1
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +2 -2
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +2 -2
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +1 -1
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +1 -1
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +2 -2
- package/dist/index169.js.map +1 -1
- package/dist/index17.js +1 -1
- package/dist/index170.js +2 -2
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +1 -1
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +1 -1
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +1 -1
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +1 -1
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +1 -1
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +1 -1
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +1 -1
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +1 -1
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +2 -2
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +2 -2
- package/dist/index180.js +2 -2
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +2 -2
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +2 -149
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +149 -9
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +8 -5
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +5 -4
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +8 -0
- package/dist/index186.js.map +1 -0
- package/dist/index189.js +20 -58
- package/dist/index189.js.map +1 -1
- package/dist/index191.js +1 -1
- package/dist/index212.js +1 -1
- package/dist/index22.js +3 -3
- package/dist/index224.js +1 -1
- package/dist/index225.js +1 -1
- package/dist/index226.js +9 -21
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +9 -18
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +4 -9
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +170 -10
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +11 -5
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +22 -170
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +19 -11
- package/dist/index232.js.map +1 -1
- package/dist/index24.js +2 -2
- package/dist/index24.js.map +1 -1
- package/dist/index27.js +1 -1
- package/dist/index29.js +1 -1
- package/dist/index3.js +23 -21
- package/dist/index3.js.map +1 -1
- package/dist/index31.js +10 -11
- package/dist/index34.js +1 -1
- package/dist/index36.js +35 -38
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +4 -5
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +3 -3
- package/dist/index41.js +7 -8
- package/dist/index42.js +6 -7
- package/dist/index43.js +16 -16
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +2 -2
- package/dist/index45.js +2 -2
- package/dist/index48.js +1 -1
- package/dist/index49.js +48 -30
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +113 -113
- package/dist/index50.js +2 -2
- package/dist/index50.js.map +1 -1
- package/dist/index54.js +21 -22
- package/dist/index56.js +2 -2
- package/dist/index56.js.map +1 -1
- package/dist/index6.js +2 -3
- package/dist/index63.js +1 -1
- package/dist/index64.js +2 -3
- package/dist/index66.js +19 -17
- package/dist/index66.js.map +1 -1
- package/dist/index68.js +55 -5
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +5 -9
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +12 -0
- package/dist/index70.js.map +1 -0
- package/dist/index72.js +2 -2
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +2 -2
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +2 -2
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +1 -1
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +1 -1
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +1 -1
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +1 -1
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +1 -1
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +5 -5
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +1 -1
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +1 -1
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +1 -1
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +1 -1
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +1 -1
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +1 -1
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +1 -1
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +1 -1
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +1 -1
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +1 -1
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +1 -1
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +1 -1
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +1 -1
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +1 -1
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +1 -1
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +1 -1
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +1 -1
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +2 -2
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +1 -1
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +2 -2
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
- package/dist/index188.js +0 -27
- package/dist/index188.js.map +0 -1
- package/dist/index71.js +0 -5
- package/dist/index71.js.map +0 -1
package/dist/index3.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import r, { forwardRef as
|
|
2
|
-
import { getA11yNameAttributes as
|
|
3
|
-
import { useAccessiblePress as
|
|
1
|
+
import r, { forwardRef as I } from "react";
|
|
2
|
+
import { getA11yNameAttributes as R } from "./index70.js";
|
|
3
|
+
import { useAccessiblePress as z } from "./index66.js";
|
|
4
4
|
import { Icon as b } from "./index5.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
function c() {
|
|
@@ -12,7 +12,7 @@ function c() {
|
|
|
12
12
|
return e;
|
|
13
13
|
}, c.apply(null, arguments);
|
|
14
14
|
}
|
|
15
|
-
const a = "focus-outline",
|
|
15
|
+
const a = "focus-outline", D = {
|
|
16
16
|
primary: "primary-btn disabled-btn pointer-events-none cursor-not-allowed",
|
|
17
17
|
secondary: "secondary-btn disabled-btn pointer-events-none cursor-not-allowed",
|
|
18
18
|
ghost: "ghost-btn disabled-btn pointer-events-none cursor-not-allowed",
|
|
@@ -36,14 +36,14 @@ const a = "focus-outline", z = {
|
|
|
36
36
|
// padding: 8px, 12px
|
|
37
37
|
lg: "py-3 px-4 large"
|
|
38
38
|
// padding: 12px, 16px
|
|
39
|
-
},
|
|
39
|
+
}, U = {
|
|
40
40
|
blue: "theme-blue",
|
|
41
41
|
red: "theme-red",
|
|
42
42
|
yellow: "theme-yellow",
|
|
43
43
|
green: "theme-green",
|
|
44
44
|
ai: "theme-ai",
|
|
45
45
|
white: "theme-white"
|
|
46
|
-
},
|
|
46
|
+
}, q = /* @__PURE__ */ I(({
|
|
47
47
|
type: e = "primary",
|
|
48
48
|
theme: n = "blue",
|
|
49
49
|
size: s = "md",
|
|
@@ -60,44 +60,46 @@ const a = "focus-outline", z = {
|
|
|
60
60
|
ariaLabel: w,
|
|
61
61
|
ariaLabelledBy: N,
|
|
62
62
|
ariaDescribedBy: v,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
isPressed: x,
|
|
64
|
+
onClick: k,
|
|
65
|
+
onKeyboardActivate: C,
|
|
66
|
+
...E
|
|
67
|
+
}, $) => {
|
|
67
68
|
const m = e === "unstyled", {
|
|
68
|
-
pressProps:
|
|
69
|
+
pressProps: P,
|
|
69
70
|
isDisabled: d
|
|
70
|
-
} =
|
|
71
|
+
} = z({
|
|
71
72
|
disabled: y,
|
|
72
73
|
loading: o,
|
|
73
74
|
isNative: !0,
|
|
74
75
|
// native <button> => hook does NOT add Enter/Space onKeyDown
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
pressed: x,
|
|
77
|
+
onClick: k,
|
|
78
|
+
onKeyboardActivate: C
|
|
79
|
+
}), j = !m && e !== "link" ? p[s] : "", A = m ? "" : U[n], B = d ? D[e] : p[e], l = i?.name ? {
|
|
78
80
|
...i,
|
|
79
81
|
stroke: d ? "var(--color-gray-600)" : i.stroke
|
|
80
|
-
} : void 0,
|
|
82
|
+
} : void 0, O = ["se-design-button", A, j, B, f, m ? "" : "rounded-[6px] flex gap-1 items-center min-w-fit"].filter(Boolean).join(" "), _ = R({
|
|
81
83
|
ariaLabel: w,
|
|
82
84
|
ariaLabelledBy: N,
|
|
83
85
|
ariaDescribedBy: v
|
|
84
86
|
});
|
|
85
87
|
return /* @__PURE__ */ r.createElement("button", c({
|
|
86
|
-
ref:
|
|
88
|
+
ref: $,
|
|
87
89
|
type: "button",
|
|
88
|
-
className:
|
|
90
|
+
className: O,
|
|
89
91
|
disabled: d,
|
|
90
92
|
autoFocus: h,
|
|
91
93
|
"data-automation-id": g
|
|
92
|
-
},
|
|
94
|
+
}, E, P, _), o && /* @__PURE__ */ r.createElement("div", {
|
|
93
95
|
"aria-hidden": "true",
|
|
94
96
|
className: "animate-spin w-4 h-4 border-2 border-current border-t-transparent rounded-full"
|
|
95
97
|
}), !o && l?.name && u === "left" && /* @__PURE__ */ r.createElement(b, l), t && /* @__PURE__ */ r.createElement("span", {
|
|
96
98
|
className: "button-label [font-weight:inherit]"
|
|
97
99
|
}, t), !o && l?.name && u === "right" && /* @__PURE__ */ r.createElement(b, l));
|
|
98
100
|
});
|
|
99
|
-
|
|
101
|
+
q.displayName = "Button";
|
|
100
102
|
export {
|
|
101
|
-
|
|
103
|
+
q as Button
|
|
102
104
|
};
|
|
103
105
|
//# sourceMappingURL=index3.js.map
|
package/dist/index3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index3.js","sources":["../src/components/Button/index.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Map } from '../../utils/common.types';\nimport { useAccessiblePress, getA11yNameAttributes } from '../../utils/a11y';\nimport { Icon, IconProps } from '../Icon';\nimport './style.scss';\n\n/**\n * Allows native button attributes (aria-*, data-*, etc.) to be passed through,\n * but keeps our own onClick/disabled/type typing AND aria-label/aria-labelledby/aria-describedby.\n * Note: We omit 'type' because we use it for button variant, not HTML type attribute.\n * The HTML type is always set to 'button' internally.\n */\ntype NativeButtonProps = Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'onClick' | 'disabled' | 'type' | 'aria-label' | 'aria-labelledby' | 'aria-describedby'\n>;\n\nexport interface ButtonProps extends NativeButtonProps {\n /**\n * Type of the button. \n */\n type?: 'primary' | 'secondary' | 'ghost' | 'link' | 'unstyled';\n /**\n * Color pallet of the button\n */\n theme?: 'blue' | 'red' | 'yellow' | 'green' | 'ai' | 'white';\n /**\n * Size of the button\n */\n size?: 'sm' | 'md' | 'lg';\n /**\n * Button contents\n */\n label: string | '';\n /**\n * Icon props\n */\n iconProps?: IconProps;\n /**\n * Icon position\n */\n iconPosition?: 'left' | 'right';\n /**\n * Disabled state\n */\n disabled?: boolean;\n /**\n * Loading state - will disable button and show spinner\n */\n loading?: boolean;\n /**\n * Optional click handler (called for pointer/mouse activations)\n */\n onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n /**\n * Optional keyboard activation handler\n * Called when button is activated via keyboard (Enter/Space) or assistive technology virtual activation.\n * Use when you want to have different behavior for keyboard and pointer activations.\n * If not provided, onClick will be called for all activations.\n */\n onKeyboardActivate?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n /**\n * Custom class name\n */\n className?: string;\n /**\n * Automation ID for testing\n */\n automationId?: string;\n /**\n * If true, button will be focused on mount.\n * For programmatic focus control, use ref with .focus() instead.\n */\n autoFocus?: boolean;\n /**\n * Accessible name for the button. Use when there's no visible label (e.g., icon-only buttons).\n * Prefer ariaLabelledBy when a visible label exists.\n */\n ariaLabel?: string;\n /**\n * ID(s) of element(s) that label this button.\n * Preferred over ariaLabel when a visible label exists (keeps SR and visual text in sync).\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) that describe this button.\n * Provides additional context announced after the accessible name.\n */\n ariaDescribedBy?: string;\n}\n\nconst focusClass = 'focus-outline';\nconst disabledClassNames: Map = {\n primary: 'primary-btn disabled-btn pointer-events-none cursor-not-allowed',\n secondary: 'secondary-btn disabled-btn pointer-events-none cursor-not-allowed',\n ghost: 'ghost-btn disabled-btn pointer-events-none cursor-not-allowed',\n link: 'link-btn w-fit disabled-btn pointer-events-none cursor-not-allowed',\n unstyled: 'unstyled-btn disabled-btn pointer-events-none cursor-not-allowed',\n sm: 'py-1 px-3 small', // padding: 4px, 12px\n md: 'py-2 px-3 medium', // padding: 8px, 12px\n lg: 'py-3 px-4 large' // padding: 12px, 16px\n};\nconst classNames: Map = {\n primary: `primary-btn ${focusClass}`,\n secondary: `secondary-btn ${focusClass}`,\n ghost: `ghost-btn ${focusClass}`,\n link: `link-btn w-fit ${focusClass}`,\n unstyled: `unstyled-btn ${focusClass}`,\n sm: 'py-1 px-3 small', // padding: 4px, 12px\n md: 'py-2 px-3 medium', // padding: 8px, 12px\n lg: 'py-3 px-4 large' // padding: 12px, 16px\n};\n\nconst colorPalletClassNames: Map = {\n blue: 'theme-blue',\n red: 'theme-red',\n yellow: 'theme-yellow',\n green: 'theme-green',\n ai: 'theme-ai',\n white: 'theme-white'\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n type = 'primary',\n theme = 'blue',\n size = 'md',\n label = '',\n iconPosition = 'left',\n disabled = false,\n loading = false,\n className = '',\n iconProps = { name: '' },\n automationId = '',\n autoFocus = false,\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n onClick,\n onKeyboardActivate,\n ...props\n },\n ref\n ) => {\n const isUnstyled = type === 'unstyled';\n\n // Use shared hook for activation handling (pointer vs keyboard/virtual click routing)\n const { pressProps, isDisabled } = useAccessiblePress({\n disabled,\n loading,\n isNative: true, // native <button> => hook does NOT add Enter/Space onKeyDown\n onClick: onClick as (e: React.MouseEvent<HTMLElement>) => void,\n onKeyboardActivate: onKeyboardActivate as (e: React.MouseEvent<HTMLElement>) => void\n });\n\n // Skip size/color classes for unstyled variant\n const sizeClassName = !isUnstyled && type !== 'link' ? classNames[size] : '';\n const colorPalletClassName = !isUnstyled ? colorPalletClassNames[theme] : '';\n const typeClassName = isDisabled ? disabledClassNames[type] : classNames[type];\n\n // Avoid mutating incoming iconProps\n const computedIconProps: IconProps | undefined = iconProps?.name\n ? {\n ...iconProps,\n stroke: isDisabled ? 'var(--color-gray-600)' : iconProps.stroke\n }\n : undefined;\n\n const buttonClassName = [\n 'se-design-button',\n colorPalletClassName,\n sizeClassName,\n typeClassName,\n className,\n !isUnstyled ? 'rounded-[6px] flex gap-1 items-center min-w-fit' : ''\n ]\n .filter(Boolean)\n .join(' ');\n\n // Compute accessible name/description props with correct precedence\n const accessibleNameProps = getA11yNameAttributes({\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy\n });\n\n return (\n <button\n ref={ref}\n type=\"button\"\n className={buttonClassName}\n disabled={isDisabled}\n autoFocus={autoFocus}\n data-automation-id={automationId}\n {...props}\n {...(pressProps as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n {...accessibleNameProps}\n >\n {loading && (\n <div\n aria-hidden=\"true\"\n className=\"animate-spin w-4 h-4 border-2 border-current border-t-transparent rounded-full\"\n />\n )}\n {!loading && computedIconProps?.name && iconPosition === 'left' && (\n <Icon {...computedIconProps} />\n )}\n {label && <span className=\"button-label [font-weight:inherit]\">{label}</span>}\n {!loading && computedIconProps?.name && iconPosition === 'right' && (\n <Icon {...computedIconProps} />\n )}\n </button>\n );\n }\n);\n\nButton.displayName = 'Button';\n"],"names":["focusClass","disabledClassNames","primary","secondary","ghost","link","unstyled","sm","md","lg","classNames","colorPalletClassNames","blue","red","yellow","green","ai","white","Button","type","theme","size","label","iconPosition","disabled","loading","className","iconProps","name","automationId","autoFocus","ariaLabel","ariaLabelledBy","ariaDescribedBy","onClick","onKeyboardActivate","props","ref","isUnstyled","pressProps","isDisabled","useAccessiblePress","isNative","sizeClassName","colorPalletClassName","typeClassName","computedIconProps","stroke","undefined","buttonClassName","filter","Boolean","join","accessibleNameProps","getA11yNameAttributes","React","createElement","_extends","Icon","displayName"],"mappings":";;;;;;;;;;;;;;AA2FA,MAAMA,IAAa,iBACbC,IAA0B;AAAA,EAC9BC,SAAS;AAAA,EACTC,WAAW;AAAA,EACXC,OAAO;AAAA,EACPC,MAAM;AAAA,EACNC,UAAU;AAAA,EACVC,IAAI;AAAA;AAAA,EACJC,IAAI;AAAA;AAAA,EACJC,IAAI;AAAA;AACN,GACMC,IAAkB;AAAA,EACtBR,SAAS,eAAeF,CAAU;AAAA,EAClCG,WAAW,iBAAiBH,CAAU;AAAA,EACtCI,OAAO,aAAaJ,CAAU;AAAA,EAC9BK,MAAM,kBAAkBL,CAAU;AAAA,EAClCM,UAAU,gBAAgBN,CAAU;AAAA,EACpCO,IAAI;AAAA;AAAA,EACJC,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AAsD,EAEnEY,OAAOC,OAAO,EACdC,KAAK,GAAG,GAGLC,IAAsBC,EAAsB;AAAA,IAChDvB,WAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,EAAAA,CACD;AAED,SACEsB,gBAAAA,EAAAC,cAAA,UAAAC,EAAA;AAAA,IACEpB,KAAAA;AAAAA,IACAlB,MAAK;AAAA,IACLO,WAAWuB;AAAAA,IACXzB,UAAUgB;AAAAA,IACVV,WAAAA;AAAAA,IACA,sBAAoBD;AAAAA,EAAAA,GAChBO,GACCG,GACDc,CAAmB,GAEtB5B,KACC8B,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IACE,eAAY;AAAA,IACZ9B,WAAU;AAAA,EAAA,CACX,GAEF,CAACD,KAAWqB,GAAmBlB,QAAQL,MAAiB,UACvDgC,gBAAAA,EAAAC,cAACE,GAASZ,CAAoB,GAE/BxB,KAASiC,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAM9B,WAAU;AAAA,EAAA,GAAsCJ,CAAY,GAC3E,CAACG,KAAWqB,GAAmBlB,QAAQL,MAAiB,WACvDgC,gBAAAA,EAAAC,cAACE,GAASZ,CAAoB,CAE1B;AAEV,CACF;AAEA5B,EAAOyC,cAAc;"}
|
|
1
|
+
{"version":3,"file":"index3.js","sources":["../src/components/Button/index.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Map } from '../../utils/common.types';\nimport { useAccessiblePress, getA11yNameAttributes } from '../../utils/a11y';\nimport { Icon, IconProps } from '../Icon';\nimport './style.scss';\n\n/**\n * Allows native button attributes (aria-*, data-*, etc.) to be passed through,\n * but keeps our own onClick/disabled/type typing AND aria-label/aria-labelledby/aria-describedby.\n * Note: We omit 'type' because we use it for button variant, not HTML type attribute.\n * The HTML type is always set to 'button' internally.\n */\ntype NativeButtonProps = Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'onClick' | 'disabled' | 'type' | 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'aria-pressed'\n>;\n\nexport interface ButtonProps extends NativeButtonProps {\n /**\n * Type of the button. \n */\n type?: 'primary' | 'secondary' | 'ghost' | 'link' | 'unstyled';\n /**\n * Color pallet of the button\n */\n theme?: 'blue' | 'red' | 'yellow' | 'green' | 'ai' | 'white';\n /**\n * Size of the button\n */\n size?: 'sm' | 'md' | 'lg';\n /**\n * Button contents\n */\n label: string | '';\n /**\n * Icon props\n */\n iconProps?: IconProps;\n /**\n * Icon position\n */\n iconPosition?: 'left' | 'right';\n /**\n * Disabled state\n */\n disabled?: boolean;\n /**\n * Loading state - will disable button and show spinner\n */\n loading?: boolean;\n /**\n * Optional click handler (called for pointer/mouse activations)\n */\n onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n /**\n * Optional keyboard activation handler\n * Called when button is activated via keyboard (Enter/Space) or assistive technology virtual activation.\n * Use when you want to have different behavior for keyboard and pointer activations.\n * If not provided, onClick will be called for all activations.\n */\n onKeyboardActivate?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n /**\n * Custom class name\n */\n className?: string;\n /**\n * Automation ID for testing\n */\n automationId?: string;\n /**\n * If true, button will be focused on mount.\n * For programmatic focus control, use ref with .focus() instead.\n */\n autoFocus?: boolean;\n /**\n * Accessible name for the button. Use when there's no visible label (e.g., icon-only buttons).\n * Prefer ariaLabelledBy when a visible label exists.\n */\n ariaLabel?: string;\n /**\n * ID(s) of element(s) that label this button.\n * Preferred over ariaLabel when a visible label exists (keeps SR and visual text in sync).\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) that describe this button.\n * Provides additional context announced after the accessible name.\n */\n ariaDescribedBy?: string;\n /**\n * When true, sets aria-pressed for toggle/pressed state \n */\n isPressed?: boolean;\n}\n\nconst focusClass = 'focus-outline';\nconst disabledClassNames: Map = {\n primary: 'primary-btn disabled-btn pointer-events-none cursor-not-allowed',\n secondary: 'secondary-btn disabled-btn pointer-events-none cursor-not-allowed',\n ghost: 'ghost-btn disabled-btn pointer-events-none cursor-not-allowed',\n link: 'link-btn w-fit disabled-btn pointer-events-none cursor-not-allowed',\n unstyled: 'unstyled-btn disabled-btn pointer-events-none cursor-not-allowed',\n sm: 'py-1 px-3 small', // padding: 4px, 12px\n md: 'py-2 px-3 medium', // padding: 8px, 12px\n lg: 'py-3 px-4 large' // padding: 12px, 16px\n};\nconst classNames: Map = {\n primary: `primary-btn ${focusClass}`,\n secondary: `secondary-btn ${focusClass}`,\n ghost: `ghost-btn ${focusClass}`,\n link: `link-btn w-fit ${focusClass}`,\n unstyled: `unstyled-btn ${focusClass}`,\n sm: 'py-1 px-3 small', // padding: 4px, 12px\n md: 'py-2 px-3 medium', // padding: 8px, 12px\n lg: 'py-3 px-4 large' // padding: 12px, 16px\n};\n\nconst colorPalletClassNames: Map = {\n blue: 'theme-blue',\n red: 'theme-red',\n yellow: 'theme-yellow',\n green: 'theme-green',\n ai: 'theme-ai',\n white: 'theme-white'\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n type = 'primary',\n theme = 'blue',\n size = 'md',\n label = '',\n iconPosition = 'left',\n disabled = false,\n loading = false,\n className = '',\n iconProps = { name: '' },\n automationId = '',\n autoFocus = false,\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n isPressed,\n onClick,\n onKeyboardActivate,\n ...props\n },\n ref\n ) => {\n const isUnstyled = type === 'unstyled';\n\n // Use shared hook for activation handling (pointer vs keyboard/virtual click routing) \n const { pressProps, isDisabled } = useAccessiblePress({\n disabled,\n loading,\n isNative: true, // native <button> => hook does NOT add Enter/Space onKeyDown\n pressed: isPressed,\n onClick: onClick as (e: React.MouseEvent<HTMLElement>) => void,\n onKeyboardActivate: onKeyboardActivate as (e: React.MouseEvent<HTMLElement>) => void\n });\n\n // Skip size/color classes for unstyled variant\n const sizeClassName = !isUnstyled && type !== 'link' ? classNames[size] : '';\n const colorPalletClassName = !isUnstyled ? colorPalletClassNames[theme] : '';\n const typeClassName = isDisabled ? disabledClassNames[type] : classNames[type];\n\n // Avoid mutating incoming iconProps\n const computedIconProps: IconProps | undefined = iconProps?.name\n ? {\n ...iconProps,\n stroke: isDisabled ? 'var(--color-gray-600)' : iconProps.stroke\n }\n : undefined;\n\n const buttonClassName = [\n 'se-design-button',\n colorPalletClassName,\n sizeClassName,\n typeClassName,\n className,\n !isUnstyled ? 'rounded-[6px] flex gap-1 items-center min-w-fit' : ''\n ]\n .filter(Boolean)\n .join(' ');\n\n // Compute accessible name/description props with correct precedence\n const accessibleNameProps = getA11yNameAttributes({\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy\n });\n\n return (\n <button\n ref={ref}\n type=\"button\"\n className={buttonClassName}\n disabled={isDisabled}\n autoFocus={autoFocus}\n data-automation-id={automationId}\n {...props}\n {...(pressProps as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n {...accessibleNameProps}\n >\n {loading && (\n <div\n aria-hidden=\"true\"\n className=\"animate-spin w-4 h-4 border-2 border-current border-t-transparent rounded-full\"\n />\n )}\n {!loading && computedIconProps?.name && iconPosition === 'left' && (\n <Icon {...computedIconProps} />\n )}\n {label && <span className=\"button-label [font-weight:inherit]\">{label}</span>}\n {!loading && computedIconProps?.name && iconPosition === 'right' && (\n <Icon {...computedIconProps} />\n )}\n </button>\n );\n }\n);\n\nButton.displayName = 'Button';\n"],"names":["focusClass","disabledClassNames","primary","secondary","ghost","link","unstyled","sm","md","lg","classNames","colorPalletClassNames","blue","red","yellow","green","ai","white","Button","type","theme","size","label","iconPosition","disabled","loading","className","iconProps","name","automationId","autoFocus","ariaLabel","ariaLabelledBy","ariaDescribedBy","isPressed","onClick","onKeyboardActivate","props","ref","isUnstyled","pressProps","isDisabled","useAccessiblePress","isNative","pressed","sizeClassName","colorPalletClassName","typeClassName","computedIconProps","stroke","undefined","buttonClassName","filter","Boolean","join","accessibleNameProps","getA11yNameAttributes","React","createElement","_extends","Icon","displayName"],"mappings":";;;;;;;;;;;;;;AA+FA,MAAMA,IAAa,iBAC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31.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "react";
|
|
2
2
|
import { Button as N } from "./index3.js";
|
|
3
3
|
import { Badge as I } from "./index9.js";
|
|
4
|
-
import { Icon as
|
|
4
|
+
import { Icon as g } from "./index5.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
const t = {
|
|
7
7
|
widgetCtn: "flex flex-col gap-[2px] align-center border border-[var(--color-gray-200)] rounded-[12px] w-[385px]",
|
|
@@ -21,16 +21,16 @@ const t = {
|
|
|
21
21
|
requestFeatureImageCtn: "w-[48px] h-[48px] border border-[var(--color-gray-200)] rounded-[50%] flex items-center flex-shrink-0 bg-[var(--color-red-50)]",
|
|
22
22
|
requestFeatureDescriptionCtn: "flex flex-col"
|
|
23
23
|
}, B = ({
|
|
24
|
-
widgetClassName:
|
|
24
|
+
widgetClassName: d = "",
|
|
25
25
|
widgetType: a = "general",
|
|
26
26
|
widgetTitle: r = "",
|
|
27
27
|
widgetDescription: l = "",
|
|
28
28
|
widgetImage: p,
|
|
29
|
-
hasImage:
|
|
29
|
+
hasImage: x = !1,
|
|
30
30
|
hasButtonCta: n = !1,
|
|
31
31
|
hasLinkCta: i = !1,
|
|
32
32
|
ctaText: o = "",
|
|
33
|
-
hasBadge:
|
|
33
|
+
hasBadge: f = !1,
|
|
34
34
|
badgeText: w = "",
|
|
35
35
|
buttonBgColor: u = "secondary",
|
|
36
36
|
onCtaClick: b,
|
|
@@ -38,7 +38,7 @@ const t = {
|
|
|
38
38
|
webinarDateInfo: c,
|
|
39
39
|
webinarSpeaker: s
|
|
40
40
|
}) => {
|
|
41
|
-
const E =
|
|
41
|
+
const E = f && /* @__PURE__ */ e.createElement(I, {
|
|
42
42
|
label: w,
|
|
43
43
|
className: t.widgetBadge,
|
|
44
44
|
bgColor: "var(--color-yellow-50)",
|
|
@@ -52,14 +52,14 @@ const t = {
|
|
|
52
52
|
label: o,
|
|
53
53
|
className: `${t.widgetButtonCta} mt-[4px]`,
|
|
54
54
|
onClick: b
|
|
55
|
-
})), C =
|
|
55
|
+
})), C = x && /* @__PURE__ */ e.createElement("div", {
|
|
56
56
|
className: `${t.widgetImageCtn} widget-image-ctn`
|
|
57
57
|
}, /* @__PURE__ */ e.createElement("img", {
|
|
58
58
|
src: p,
|
|
59
59
|
alt: "widget-image"
|
|
60
60
|
}));
|
|
61
61
|
return /* @__PURE__ */ e.createElement("div", {
|
|
62
|
-
className: `${t.widgetCtn} ${
|
|
62
|
+
className: `${t.widgetCtn} ${d} widget-ctn`,
|
|
63
63
|
onClick: v
|
|
64
64
|
}, a !== "general" && C, /* @__PURE__ */ e.createElement("div", {
|
|
65
65
|
className: t.descriptionCtn
|
|
@@ -71,14 +71,14 @@ const t = {
|
|
|
71
71
|
className: t.webinarInfoCtn
|
|
72
72
|
}, s && /* @__PURE__ */ e.createElement("div", {
|
|
73
73
|
className: `${t.webinarDescriptionInfo} align-baseline`
|
|
74
|
-
}, /* @__PURE__ */ e.createElement(
|
|
74
|
+
}, /* @__PURE__ */ e.createElement(g, {
|
|
75
75
|
name: "people",
|
|
76
76
|
className: "relative top-[2px]"
|
|
77
77
|
}), /* @__PURE__ */ e.createElement("span", {
|
|
78
78
|
className: t.webinarSpeaker
|
|
79
79
|
}, s)), c && /* @__PURE__ */ e.createElement("div", {
|
|
80
80
|
className: `${t.webinarTimeInfo} align-baseline mb-[4px]`
|
|
81
|
-
}, /* @__PURE__ */ e.createElement(
|
|
81
|
+
}, /* @__PURE__ */ e.createElement(g, {
|
|
82
82
|
name: "clock",
|
|
83
83
|
className: "relative top-[2px]"
|
|
84
84
|
}), /* @__PURE__ */ e.createElement("span", {
|
|
@@ -96,7 +96,6 @@ const t = {
|
|
|
96
96
|
}, l), m)) : m));
|
|
97
97
|
};
|
|
98
98
|
export {
|
|
99
|
-
B as Widget
|
|
100
|
-
B as default
|
|
99
|
+
B as Widget
|
|
101
100
|
};
|
|
102
101
|
//# sourceMappingURL=index31.js.map
|
package/dist/index34.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e, { useState as h, useEffect as E } from "react";
|
|
2
2
|
import { Icon as N } from "./index5.js";
|
|
3
|
-
import { useStableId as $ } from "./
|
|
3
|
+
import { useStableId as $ } from "./index185.js";
|
|
4
4
|
import { getRegionAttributes as I } from "./index65.js";
|
|
5
5
|
import { useAccessiblePress as _ } from "./index66.js";
|
|
6
6
|
function r() {
|
package/dist/index36.js
CHANGED
|
@@ -1,61 +1,58 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a, { useState as p, useRef as N } from "react";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { Icon as
|
|
4
|
-
function
|
|
3
|
+
import { Icon as k } from "./index5.js";
|
|
4
|
+
function D({
|
|
5
5
|
value: g,
|
|
6
6
|
onChange: s,
|
|
7
7
|
placeholder: f,
|
|
8
|
-
className:
|
|
8
|
+
className: d,
|
|
9
9
|
error: o,
|
|
10
|
-
errorMessage:
|
|
11
|
-
label:
|
|
12
|
-
automationId:
|
|
10
|
+
errorMessage: h,
|
|
11
|
+
label: c,
|
|
12
|
+
automationId: w = ""
|
|
13
13
|
}) {
|
|
14
|
-
const [n,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
}
|
|
14
|
+
const [n, l] = p([...g]), [i, r] = p(""), u = N(null), m = (t) => {
|
|
15
|
+
const e = n.filter((y, E) => E !== t);
|
|
16
|
+
l(e), s?.(e);
|
|
17
|
+
}, v = (t) => {
|
|
18
|
+
if (t.key === "Enter" && i.trim()) {
|
|
19
|
+
t.preventDefault();
|
|
20
|
+
const e = [...n, i.trim()];
|
|
21
|
+
l(e), r(""), s?.(e);
|
|
22
|
+
} else t.key === "Backspace" && i === "" && n.length > 0 && m(n.length - 1);
|
|
23
23
|
};
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ a.createElement("div", {
|
|
25
25
|
className: "input-with-tags-main-container",
|
|
26
|
-
"data-automation-id":
|
|
27
|
-
},
|
|
26
|
+
"data-automation-id": w
|
|
27
|
+
}, c && /* @__PURE__ */ a.createElement("div", {
|
|
28
28
|
className: "label-container"
|
|
29
|
-
},
|
|
30
|
-
className: `input-with-tags-container ${o ? "input-with-tags-error" : ""} ${
|
|
29
|
+
}, c), /* @__PURE__ */ a.createElement("div", {
|
|
30
|
+
className: `input-with-tags-container ${o ? "input-with-tags-error" : ""} ${d}`,
|
|
31
31
|
onClick: () => u.current?.focus()
|
|
32
|
-
}, n.map((
|
|
33
|
-
key:
|
|
32
|
+
}, n.map((t, e) => /* @__PURE__ */ a.createElement("span", {
|
|
33
|
+
key: e,
|
|
34
34
|
className: "tag-in-inputwithtags",
|
|
35
|
-
"data-automation-id": `input-tag-${
|
|
36
|
-
},
|
|
35
|
+
"data-automation-id": `input-tag-${e}`
|
|
36
|
+
}, t, /* @__PURE__ */ a.createElement(k, {
|
|
37
|
+
name: "close",
|
|
37
38
|
className: "close-icon-in-inputwithtags",
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
}, /* @__PURE__ */ e.createElement(y, {
|
|
44
|
-
name: "close"
|
|
45
|
-
})))), /* @__PURE__ */ e.createElement("input", {
|
|
39
|
+
ariaLabel: `Remove tag ${t}`,
|
|
40
|
+
onClick: () => m(e),
|
|
41
|
+
shouldStopPropagation: !0
|
|
42
|
+
}))), /* @__PURE__ */ a.createElement("input", {
|
|
46
43
|
className: "input-with-tags-input",
|
|
47
44
|
ref: u,
|
|
48
45
|
type: "text",
|
|
49
46
|
value: i,
|
|
50
|
-
onChange: (
|
|
51
|
-
onKeyDown:
|
|
47
|
+
onChange: (t) => r(t.target.value),
|
|
48
|
+
onKeyDown: v,
|
|
52
49
|
placeholder: f,
|
|
53
50
|
"data-automation-id": "input-with-tags-input-field"
|
|
54
|
-
})), o && /* @__PURE__ */
|
|
51
|
+
})), o && /* @__PURE__ */ a.createElement("div", {
|
|
55
52
|
className: "error-message"
|
|
56
|
-
},
|
|
53
|
+
}, h));
|
|
57
54
|
}
|
|
58
55
|
export {
|
|
59
|
-
|
|
56
|
+
D as InputWithTags
|
|
60
57
|
};
|
|
61
58
|
//# sourceMappingURL=index36.js.map
|
package/dist/index36.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index36.js","sources":["../src/components/InputWithTags/index.tsx"],"sourcesContent":["import React, { useState, KeyboardEvent, useRef } from \"react\";\nimport './styles.scss';\nimport { Icon } from '../Icon';\n\nexport interface InputWithTagsProps {\n value: string[];\n onChange?: (tags: string[]) => void;\n placeholder?: string;\n className?: string;\n error?: boolean;\n errorMessage?: string;\n label?: string;\n automationId?: string;\n}\n\nexport function InputWithTags({ \n value, \n onChange, \n placeholder, \n className, \n error, \n errorMessage, \n label,\n automationId = ''\n}: InputWithTagsProps) {\n const [tags, setTags] = useState<string[]>([...value]);\n const [inputValue, setInputValue] = useState('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && inputValue.trim()) {\n e.preventDefault();\n const newTags = [...tags, inputValue.trim()];\n setTags(newTags);\n setInputValue(\"\");\n onChange?.(newTags);\n } else if (e.key === 'Backspace' && inputValue === \"\" && tags.length > 0) {\n
|
|
1
|
+
{"version":3,"file":"index36.js","sources":["../src/components/InputWithTags/index.tsx"],"sourcesContent":["import React, { useState, KeyboardEvent, useRef } from \"react\";\nimport './styles.scss';\nimport { Icon } from '../Icon';\n\nexport interface InputWithTagsProps {\n value: string[];\n onChange?: (tags: string[]) => void;\n placeholder?: string;\n className?: string;\n error?: boolean;\n errorMessage?: string;\n label?: string;\n automationId?: string;\n}\n\nexport function InputWithTags({ \n value, \n onChange, \n placeholder, \n className, \n error, \n errorMessage, \n label,\n automationId = ''\n}: InputWithTagsProps) {\n const [tags, setTags] = useState<string[]>([...value]);\n const [inputValue, setInputValue] = useState('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const removeTag = (indexToRemove: number) => {\n const newTags = tags.filter((_, i) => i !== indexToRemove);\n setTags(newTags);\n onChange?.(newTags);\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && inputValue.trim()) {\n e.preventDefault();\n const newTags = [...tags, inputValue.trim()];\n setTags(newTags);\n setInputValue(\"\");\n onChange?.(newTags);\n } else if (e.key === 'Backspace' && inputValue === \"\" && tags.length > 0) {\n removeTag(tags.length - 1);\n }\n };\n\n return (\n <div className=\"input-with-tags-main-container\" data-automation-id={automationId}>\n {label && <div className=\"label-container\">{label}</div>}\n <div \n className={`input-with-tags-container ${error ? 'input-with-tags-error' : ''} ${className}`} \n onClick={() => inputRef.current?.focus()}\n >\n {tags.map((tag, index) => (\n <span key={index} className=\"tag-in-inputwithtags\" data-automation-id={`input-tag-${index}`}>\n {tag} \n <Icon\n name=\"close\"\n className=\"close-icon-in-inputwithtags\"\n ariaLabel={`Remove tag ${tag}`}\n onClick={() => removeTag(index)}\n shouldStopPropagation\n />\n </span>\n ))}\n <input\n className=\"input-with-tags-input\"\n ref={inputRef}\n type=\"text\"\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n data-automation-id=\"input-with-tags-input-field\"\n />\n </div>\n {error && <div className=\"error-message\">{errorMessage}</div>}\n </div>\n );\n}"],"names":["React__default","useState","useRef","Icon","InputWithTags","value","onChange","placeholder","className","error","errorMessage","label","automationId","tags","setTags","inputValue","setInputValue","inputRef","removeTag","indexToRemove","newTags","filter","_","i","handleKeyDown","e","key","trim","preventDefault","length","React","createElement","onClick","current","focus","map","tag","index","name","ariaLabel","shouldStopPropagation","ref","type","target","onKeyDown"],"mappings":"AAeO,OAAAA,KAAA,YAAAC,GAAA,UAAAC,SAAA;AAAA,OAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,SAASC,EAAc;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AA,EAAAC,cAAA,QAAA;AAAA,IAAML,KAAKW;AAAAA,IAAO7B,WAAU;AAAA,IAAuB,sBAAoB,aAAa6B,CAAK;AAAA,EAAA,GACpFD,GACDN,gBAAAA,EAAAC,cAAC5B,GAAI;AAAA,IACDmC,MAAK;AAAA,IACL9B,WAAU;AAAA,IACV+B,WAAW,cAAcH,CAAG;AAAA,IAC5BJ,SAASA,MAAMd,EAAUmB,CAAK;AAAA,IAC9BG,uBAAqB;AAAA,EAAA,CACxB,CACC,CACT,GACDV,gBAAAA,EAAAC,cAAA,SAAA;AAAA,IACIvB,WAAU;AAAA,IACViC,KAAKxB;AAAAA,IACLyB,MAAK;AAAA,IACLrC,OAAOU;AAAAA,IACPT,UAAWmB,CAAAA,MAAMT,EAAcS,EAAEkB,OAAOtC,KAAK;AAAA,IAC7CuC,WAAWpB;AAAAA,IACXjB,aAAAA;AAAAA,IACA,sBAAmB;AAAA,EAAA,CACtB,CACA,GACJE,KAASqB,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKvB,WAAU;AAAA,EAAA,GAAiBE,CAAkB,CAC3D;AAEb;"}
|
package/dist/index37.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Icon as we } from "./index5.js";
|
|
|
4
4
|
import { Checkbox as Ee } from "./index22.js";
|
|
5
5
|
import { Button as G } from "./index3.js";
|
|
6
6
|
import { useCombobox as ke } from "./index191.js";
|
|
7
|
-
import { useStableId as be } from "./
|
|
7
|
+
import { useStableId as be } from "./index185.js";
|
|
8
8
|
/* empty css */
|
|
9
9
|
function g() {
|
|
10
10
|
return g = Object.assign ? Object.assign.bind() : function(v) {
|
|
@@ -256,14 +256,13 @@ const Te = /* @__PURE__ */ de(({
|
|
|
256
256
|
}, r.map((t, e) => /* @__PURE__ */ a.createElement("span", {
|
|
257
257
|
key: e,
|
|
258
258
|
className: "tag-in-inputwithtags"
|
|
259
|
-
}, t[K], !l && /* @__PURE__ */ a.createElement(
|
|
260
|
-
className: "close-icon-in-inputwithtags"
|
|
261
|
-
}, /* @__PURE__ */ a.createElement(we, {
|
|
259
|
+
}, t[K], !l && /* @__PURE__ */ a.createElement(we, {
|
|
262
260
|
name: "close",
|
|
261
|
+
className: "close-icon-in-inputwithtags",
|
|
263
262
|
ariaLabel: `Remove tag ${t[K]}`,
|
|
264
263
|
onClick: () => ne(e),
|
|
265
264
|
shouldStopPropagation: !0
|
|
266
|
-
})))
|
|
265
|
+
}))), (J || !r.length) && /* @__PURE__ */ a.createElement("input", g({
|
|
267
266
|
ref: x
|
|
268
267
|
}, U, {
|
|
269
268
|
type: "text",
|
package/dist/index37.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index37.js","sources":["../src/components/DropdownWithInputTags/index.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef, forwardRef, ForwardedRef, useImperativeHandle, KeyboardEvent, useCallback } from 'react';\nimport { Popover, PopoverHandle } from '../Popover';\nimport { Icon } from '../Icon';\nimport { Checkbox } from '../Checkbox';\nimport { Button } from '../Button';\nimport { useCombobox } from '../../utils/a11y';\nimport { useStableId } from '../../utils/useStableId';\nimport './styles.scss';\n\nexport interface DropdownOption {\n id: string | number;\n label: string;\n value: string;\n [key: string]: any; // Allow additional properties\n}\n\nexport interface DropdownWithInputTagsHandle {\n toggleDropdown: () => void;\n}\n\nexport interface DropdownWithInputTagsProps {\n value: string[];\n onChange?: (tags: string[]) => void;\n placeholder?: string;\n className?: string;\n options?: DropdownOption[];\n renderOption?: (\n option: DropdownOption, \n props: { \n id: string; \n role: 'option'; \n 'aria-selected': boolean; \n onMouseEnter: () => void;\n className: string;\n },\n onSelect: (option: DropdownOption) => void\n ) => React.ReactNode;\n label?: string;\n automationId?: string;\n noOptionsMessage?: string;\n allowCustomTags?: boolean;\n disabled?: boolean;\n type?: 'select' | 'multi-select' |'multi-select-without-cta';\n showInput?: boolean;\n displayTagBy?: 'label' | 'value';\n}\n\nexport const DropdownWithInputTags = forwardRef<DropdownWithInputTagsHandle, DropdownWithInputTagsProps>(\n (\n {\n value,\n onChange,\n placeholder = \"Type to search or add custom tags...\",\n className = '',\n options = [],\n renderOption,\n label,\n automationId = '',\n noOptionsMessage = \"No options found\",\n allowCustomTags = true,\n disabled = false,\n type = 'select',\n showInput = true,\n displayTagBy = 'label'\n },\n ref: ForwardedRef<DropdownWithInputTagsHandle>\n ) => {\n // Define initValues at the top, right after props\n const initValues = (values: string[]) => {\n return values.map(val => {\n const found = options.find(opt => opt.value === val);\n return found ? { label: found.label, value: found.value } : { label: val, value: val };\n });\n };\n\n // Now use it in useState\n const [tags, setTags] = useState<{ label: string; value: string }[]>(() => {\n return initValues(value || []);\n });\n const [inputValue, setInputValue] = useState('');\n const [filteredOptions, setFilteredOptions] = useState<DropdownOption[]>(options);\n const [isDropdownOpen, setIsDropdownOpen] = useState(false);\n const popoverRef = useRef<PopoverHandle>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const applyClickedRef = useRef<boolean>(false);\n \n const isMultiSelectWithoutCTA = type === 'multi-select-without-cta';\n const isMultiSelect = type === 'multi-select' ||isMultiSelectWithoutCTA;\n\n // Generate stable ID for listbox\n const listboxId = useStableId(automationId, 'dropdown-input-tags-listbox');\n\n const handleSelectOption = useCallback(\n (option: DropdownOption) => {\n if (disabled) return;\n\n const newTags = [...tags];\n if (!newTags.some((tag) => tag.value === option.value)) {\n newTags.push({ label: option.label, value: option.value });\n setTags(newTags);\n onChange?.(newTags.map((tag) => tag.value));\n }\n setInputValue('');\n setIsDropdownOpen(false);\n },\n [disabled, tags, onChange]\n );\n\n const handleMultiSelectDropdownOptionClick = useCallback(\n (isSelected: boolean, option: DropdownOption) => {\n let newSelectedTags: { label: string; value: string }[] = [];\n if (isSelected) {\n newSelectedTags = [...tags, { label: option.label, value: option.value }];\n } else {\n newSelectedTags = tags.filter((tag) => tag.value !== option.value);\n }\n setTags(newSelectedTags);\n if (isMultiSelectWithoutCTA) {\n onChange?.(newSelectedTags.map((tag) => tag.value));\n }\n },\n [tags, isMultiSelectWithoutCTA, onChange]\n );\n\n const ADD_CUSTOM_TAG_VALUE = '__add_custom_tag__';\n\n const handleSelectFromDropdown = useCallback((option: DropdownOption) => {\n if (disabled) return;\n\n if (option.value === ADD_CUSTOM_TAG_VALUE) {\n const trimmed = inputValue.trim();\n if (!trimmed) return;\n const newTags = [...tags];\n if (!newTags.some((tag) => tag.value === trimmed)) {\n newTags.push({ label: trimmed, value: trimmed });\n setTags(newTags);\n onChange?.(newTags.map((tag) => tag.value));\n }\n setInputValue('');\n setIsDropdownOpen(false);\n return;\n }\n\n if (isMultiSelect) {\n const isSelected = tags.some(tag => tag.value === option.value);\n handleMultiSelectDropdownOptionClick(!isSelected, option);\n } else {\n handleSelectOption(option);\n }\n }, [disabled, isMultiSelect, tags, inputValue, onChange, handleMultiSelectDropdownOptionClick, handleSelectOption]);\n\n const effectiveItems: DropdownOption[] =\n filteredOptions.length > 0\n ? filteredOptions\n : allowCustomTags && inputValue.trim()\n ? [{ id: ADD_CUSTOM_TAG_VALUE, label: `Add \"${inputValue.trim()}\"`, value: ADD_CUSTOM_TAG_VALUE }]\n : [];\n\n // Combobox hook for keyboard navigation and ARIA\n const {\n containerProps,\n inputProps: comboboxInputProps,\n listboxProps,\n getOptionProps,\n highlightedIndex,\n setHighlightedIndex\n } = useCombobox({\n items: effectiveItems,\n isOpen: isDropdownOpen,\n onOpenChange: setIsDropdownOpen,\n onSelect: handleSelectFromDropdown,\n listboxId,\n hasItems: effectiveItems.length > 0\n });\n\n\n useEffect(() => {\n if (applyClickedRef.current) {\n applyClickedRef.current = false;\n return;\n }\n setTags(initValues(value || []));\n }, [value, options, isDropdownOpen]);\n\n\n useEffect(() => {\n // const isInputEmpty = !inputValue.trim();\n const filtered = options.filter(option =>\n option.label.toLowerCase().includes(inputValue.toLowerCase()) ||\n option.value.toLowerCase().includes(inputValue.toLowerCase())\n );\n setFilteredOptions(filtered);\n }, [inputValue, options]);\n\n const handleRemoveTag = (indexToRemove: number) => {\n if (disabled) return;\n \n const newTags = tags.filter((_, index) => index !== indexToRemove);\n setTags(newTags);\n \n //in multiselect if tag removed while dorpdownopen, do not call onchange\n if(!isMultiSelect || isMultiSelectWithoutCTA ||(isMultiSelect && !isDropdownOpen)) {\n onChange?.(newTags.map(tag => tag.value));\n }\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (disabled) return;\n \n // Handle Backspace to remove last tag (preserve existing behavior)\n if (e.key === 'Backspace' && inputValue === \"\" && tags.length > 0) {\n e.preventDefault();\n const newTags = tags.slice(0, -1);\n setTags(newTags);\n onChange?.(newTags.map(tag => tag.value));\n return;\n }\n\n // Handle Enter for custom tags when no options match\n if (e.key === 'Enter' && inputValue.trim() && filteredOptions.length === 0 && allowCustomTags) {\n e.preventDefault();\n const newTags = [...tags];\n if (!newTags.some(tag => tag.value === inputValue.trim())) {\n newTags.push({ label: inputValue.trim(), value: inputValue.trim() });\n setTags(newTags);\n onChange?.(newTags.map(tag => tag.value));\n }\n setInputValue('');\n setHighlightedIndex(-1);\n setIsDropdownOpen(false);\n return;\n }\n\n // Let combobox hook handle all other keyboard events (Arrow keys, Enter, Escape, etc.)\n comboboxInputProps.onKeyDown(e);\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (disabled) return;\n \n const newValue = e.target.value;\n setInputValue(newValue);\n setHighlightedIndex(-1); // Reset highlighted index when user types\n \n if (newValue.trim() && !isDropdownOpen) {\n setIsDropdownOpen(true);\n }\n };\n\n const handleInputFocus = () => {\n if (disabled) return;\n \n if (inputValue.trim() || options.length > 0) {\n setIsDropdownOpen(true);\n }\n };\n\n const handleInputContainerClick = (e: React.MouseEvent) => {\n if (disabled) return;\n \n e.stopPropagation();\n inputRef.current?.focus();\n if (!isDropdownOpen && (inputValue.trim() || options.length > 0)) {\n setIsDropdownOpen(true);\n }\n };\n\n const handlePopoverWrapperClick = (e: React.MouseEvent) => {\n if (disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n \n const target = e.target as HTMLElement;\n const isInputArea = target.closest('.input-with-tags-container');\n if (isInputArea) {\n e.stopPropagation();\n }\n };\n\n const toggleDropdown = () => {\n if (disabled) return;\n setIsDropdownOpen(!isDropdownOpen);\n };\n\n useImperativeHandle(ref, () => ({ toggleDropdown }), []);\n\n const defaultRenderOption = (\n option: DropdownOption,\n index: number,\n onSelect: (option: DropdownOption) => void,\n disabled: boolean\n ) => {\n const isSelected = tags.some((tag) => tag.value === option.value);\n const isHighlighted = highlightedIndex === index;\n const optionProps = getOptionProps(index, isSelected);\n \n return (\n <div\n key={option.id}\n {...optionProps}\n className={`dropdown-with-input-tags-option ${isHighlighted ? 'highlighted' : ''}`}\n onClick={() => !disabled && onSelect(option)}\n onMouseEnter={() => setHighlightedIndex(index)}\n data-automation-id={`${automationId}-option-${option.id}`}\n >\n <span className=\"option-label\">{option.label}</span>\n {option.value !== option.label && <span className=\"option-value\">{option.value}</span>}\n </div>\n );\n };\n const handleApplySelectedDropDownValues = () => {\n applyClickedRef.current = true;\n const newTagValues = tags.map(tag => tag.value);\n onChange?.(newTagValues);\n setIsDropdownOpen(false);\n };\n\n const clearSelectedDropDownValues = () => {\n setTags([]);\n };\n const multiSelectRenderOption = (option: DropdownOption, index: number) => {\n const isOptionSelected = tags.some(tag => tag.value === option.value);\n const isHighlighted = highlightedIndex === index;\n const optionProps = getOptionProps(index, isOptionSelected);\n \n return (\n <div\n key={option.id}\n {...optionProps}\n className={`dropdown-with-input-tags-option dropdown-with-input-tags-multi-select-option ${isHighlighted ? 'highlighted' : ''}`}\n aria-checked={isOptionSelected}\n onClick={() => !disabled && handleMultiSelectDropdownOptionClick(!isOptionSelected, option)}\n onMouseEnter={() => setHighlightedIndex(index)}\n data-automation-id={`${automationId}-option-${option.id}`}\n >\n <span onClick={(e) => e.stopPropagation()}>\n <Checkbox\n automationId=\"checkbox\"\n className=\"checkbox\"\n defaultChecked={isOptionSelected}\n onChange={(value) => handleMultiSelectDropdownOptionClick(value, option)}\n label={option.label}\n />\n </span>\n </div>\n );\n };\n\n const multiSelectRenderCTAs = () => {\n return (\n <div className=\"dropdown-with-input-tags-ctas-container\">\n <Button label=\"Clear\" type=\"link\" size=\"sm\" onClick={clearSelectedDropDownValues} automationId={`${automationId}-clear-button`} />\n <Button label=\"Apply\" type=\"primary\" size=\"sm\" onClick={handleApplySelectedDropDownValues} automationId={`${automationId}-apply-button`} />\n </div>\n );\n };\n\n \n\n return (\n <div\n className={`dropdown-with-input-tags-wrapper ${className} ${disabled ? 'disabled-wrapper' : ''}`}\n data-automation-id={automationId}\n {...containerProps}\n >\n {label && <label id={`${automationId}-label`} className=\"dropdown-with-input-tags-label\">{label}</label>}\n\n <div onClick={handlePopoverWrapperClick}>\n <Popover\n ref={popoverRef}\n className=\"dropdown-with-input-tags-popover\"\n contentWidth=\"full\"\n position=\"bottom-left\"\n isPopoverOpen={!disabled && isDropdownOpen}\n onPopoverToggle={disabled ? () => {} : setIsDropdownOpen}\n disableClickToggle={true}\n renderPopoverContents={({ closePopoverCb }) => (\n <>\n <div\n {...listboxProps}\n className=\"dropdown-with-input-tags-content\"\n {...(isMultiSelect && { 'aria-multiselectable': 'true' })}\n >\n {effectiveItems.length > 0 ? (\n effectiveItems.map((option, index) => {\n if (option.value === ADD_CUSTOM_TAG_VALUE) {\n const isHighlighted = highlightedIndex === index;\n const optionProps = getOptionProps(index, false);\n return (\n <div\n key={option.id}\n {...optionProps}\n className={`dropdown-with-input-tags-option dropdown-with-input-tags-custom-option ${isHighlighted ? 'highlighted' : ''}`}\n onClick={() => {\n if (disabled) return;\n handleSelectFromDropdown(option);\n closePopoverCb();\n }}\n onMouseEnter={() => setHighlightedIndex(index)}\n >\n Add \"{inputValue.trim()}\"\n </div>\n );\n }\n if (isMultiSelect) {\n return multiSelectRenderOption(option, index);\n }\n \n const isSelected = tags.some((tag) => tag.value === option.value);\n const isHighlighted = highlightedIndex === index;\n const optionProps = getOptionProps(index, isSelected);\n const optionPropsWithHandlers = {\n ...optionProps,\n onMouseEnter: () => setHighlightedIndex(index),\n className: `dropdown-with-input-tags-option ${isHighlighted ? 'highlighted' : ''}`\n };\n \n return renderOption\n ? renderOption(option, optionPropsWithHandlers, handleSelectOption)\n : defaultRenderOption(option, index, handleSelectOption, disabled);\n })\n ) : (\n <div className=\"dropdown-with-input-tags-no-options\">\n <div className=\"dropdown-with-input-tags-no-options-text\" role=\"status\" aria-live=\"polite\">\n {noOptionsMessage}\n </div>\n </div>\n )}\n </div>\n {isMultiSelect && !isMultiSelectWithoutCTA && multiSelectRenderCTAs()}\n </>\n )}\n renderPopoverSrcElement={() => (\n <div className=\"dropdown-with-input-tags-input-container\">\n <div\n className={`input-with-tags-container ${disabled ? 'disabled-input-with-tags-container' : ''}`}\n onClick={handleInputContainerClick}\n >\n {tags.map((tag, index) => (\n <span key={index} className=\"tag-in-inputwithtags\">\n {tag[displayTagBy]}\n {!disabled && (\n <span className=\"close-icon-in-inputwithtags\">\n <Icon\n name=\"close\"\n ariaLabel={`Remove tag ${tag[displayTagBy]}`}\n onClick={() => handleRemoveTag(index)}\n shouldStopPropagation\n />\n </span>\n )}\n </span>\n ))}\n {(showInput ||!tags.length) && (\n <input\n ref={inputRef}\n {...comboboxInputProps}\n type=\"text\"\n value={inputValue}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onFocus={handleInputFocus}\n placeholder={tags.length === 0 ? placeholder : ''}\n className=\"input-with-tags-input\"\n disabled={disabled}\n aria-label={label || 'Search and select options'}\n />\n )}\n </div>\n </div>\n )}\n automationId={automationId}\n popoverContentAutomationId={`${automationId}-content`}\n />\n </div>\n </div>\n );\n }\n); "],"names":["DropdownWithInputTags","value","onChange","placeholder","className","options","renderOption","label","automationId","noOptionsMessage","allowCustomTags","disabled","type","showInput","displayTagBy","ref","initValues","values","map","val","found","find","opt","tags","setTags","useState","inputValue","setInputValue","filteredOptions","setFilteredOptions","isDropdownOpen","setIsDropdownOpen","popoverRef","useRef","inputRef","applyClickedRef","isMultiSelectWithoutCTA","isMultiSelect","listboxId","useStableId","handleSelectOption","useCallback","option","newTags","some","tag","push","handleMultiSelectDropdownOptionClick","isSelected","newSelectedTags","filter","ADD_CUSTOM_TAG_VALUE","handleSelectFromDropdown","trimmed","trim","effectiveItems","length","id","containerProps","inputProps","comboboxInputProps","listboxProps","getOptionProps","highlightedIndex","setHighlightedIndex","useCombobox","items","isOpen","onOpenChange","onSelect","hasItems","useEffect","current","filtered","toLowerCase","includes","handleRemoveTag","indexToRemove","_","index","handleKeyDown","e","key","preventDefault","slice","onKeyDown","handleInputChange","newValue","target","handleInputFocus","handleInputContainerClick","stopPropagation","focus","handlePopoverWrapperClick","closest","toggleDropdown","useImperativeHandle","defaultRenderOption","isHighlighted","optionProps","React","createElement","_extends","onClick","onMouseEnter","handleApplySelectedDropDownValues","newTagValues","clearSelectedDropDownValues","multiSelectRenderOption","isOptionSelected","Checkbox","defaultChecked","multiSelectRenderCTAs","Button","size","Popover","contentWidth","position","isPopoverOpen","onPopoverToggle","disableClickToggle","renderPopoverContents","closePopoverCb","Fragment","optionPropsWithHandlers","role","renderPopoverSrcElement","Icon","name","ariaLabel","shouldStopPropagation","onFocus","popoverContentAutomationId"],"mappings":";;;;;;;;;;;;;;;;;AA+CO,MAAMA,wBACX,CACE;AAAA,EACEC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,aAAAA,IAAc;AAAA,EACdC,WAAAA,IAAY;AAAA,EACZC,SAAAA,IAAU,CAAA;AAAA,EACVC,cAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,kBAAAA,IAAmB;AAAA,EACnBC,iBAAAA,IAAkB;AAAA,EAClBC,UAAAA,IAAW;AAAA,EACXC,MAAAA,IAAO;AAAA,EACPC,WAAAA,IAAY;AAAA,EACZC,cAAAA,IAAe;AACjB,GACAC,MACG;AAEH,QAAMC,IAAaA,CAACC,MACXA,EAAOC,IAAIC,CAAAA,MAAO;AACvB,UAAM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IAEJc,yBAAyBA,MACvB1B,gBAAAA,EAAAC,cAAA,OAAA;AAAA,MAAKjG,WAAU;AAAA,IAAA,GACbgG,gBAAAA,EAAAC,cAAA,OAAA;AAAA,MACEjG,WAAW,6BAA6BO,IAAW,uCAAuC,EAAE;AAAA,MAC5F4F,SAASb;AAAAA,IAAAA,GAERnE,EAAKL,IAAI,CAAC2B,GAAKkC,MACdqB,gBAAAA,EAAAC,cAAA,QAAA;AAAA,MAAMnB,KAAKH;AAAAA,MAAO3E,WAAU;AAAA,IAAA,GACzByC,EAAI/B,CAAY,GAChB,CAACH,KACEyF,gBAAAA,EAAAC,cAAA,QAAA;AAAA,MAAMjG,WAAU;AAAA,IAAA,GACdgG,gBAAAA,EAAAC,cAAC0B,IAAI;AAAA,MACHC,MAAK;AAAA,MACLC,WAAW,cAAcpF,EAAI/B,CAAY,CAAC;AAAA,MAC1CyF,SAASA,MAAM3B,GAAgBG,CAAK;AAAA,MACpCmD,uBAAqB;AAAA,IAAA,CACtB,CACG,CAEN,CACP,IACCrH,KAAY,CAACU,EAAKiC,WAClB4C,gBAAAA,EAAAC,uBAAAC,EAAA;AAAA,MACEvF,KAAKmB;AAAAA,IAAAA,GACD0B,GAAkB;AAAA,MACtBhD,MAAK;AAAA,MACLX,OAAOyB;AAAAA,MACPxB,UAAUoF;AAAAA,MACVD,WAAWL;AAAAA,MACXmD,SAAS1C;AAAAA,MACTtF,aAAaoB,EAAKiC,WAAW,IAAIrD,IAAc;AAAA,MAC/CC,WAAU;AAAA,MACVO,UAAAA;AAAAA,MACA,cAAYJ,KAAS;AAAA,IAAA,CAA4B,CAClD,CAEA,CACF;AAAA,IAEPC,cAAAA;AAAAA,IACA4H,4BAA4B,GAAG5H,CAAY;AAAA,EAAA,CAC5C,CACE,CACF;AAET,CACF;"}
|
|
1
|
+
{"version":3,"file":"index37.js","sources":["../src/components/DropdownWithInputTags/index.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef, forwardRef, ForwardedRef, useImperativeHandle, KeyboardEvent, useCallback } from 'react';\nimport { Popover, PopoverHandle } from '../Popover';\nimport { Icon } from '../Icon';\nimport { Checkbox } from '../Checkbox';\nimport { Button } from '../Button';\nimport { useCombobox } from '../../utils/a11y';\nimport { useStableId } from '../../utils/useStableId';\nimport './styles.scss';\n\nexport interface DropdownOption {\n id: string | number;\n label: string;\n value: string;\n [key: string]: any; // Allow additional properties\n}\n\nexport interface DropdownWithInputTagsHandle {\n toggleDropdown: () => void;\n}\n\nexport interface DropdownWithInputTagsProps {\n value: string[];\n onChange?: (tags: string[]) => void;\n placeholder?: string;\n className?: string;\n options?: DropdownOption[];\n renderOption?: (\n option: DropdownOption, \n props: { \n id: string; \n role: 'option'; \n 'aria-selected': boolean; \n onMouseEnter: () => void;\n className: string;\n },\n onSelect: (option: DropdownOption) => void\n ) => React.ReactNode;\n label?: string;\n automationId?: string;\n noOptionsMessage?: string;\n allowCustomTags?: boolean;\n disabled?: boolean;\n type?: 'select' | 'multi-select' |'multi-select-without-cta';\n showInput?: boolean;\n displayTagBy?: 'label' | 'value';\n}\n\nexport const DropdownWithInputTags = forwardRef<DropdownWithInputTagsHandle, DropdownWithInputTagsProps>(\n (\n {\n value,\n onChange,\n placeholder = \"Type to search or add custom tags...\",\n className = '',\n options = [],\n renderOption,\n label,\n automationId = '',\n noOptionsMessage = \"No options found\",\n allowCustomTags = true,\n disabled = false,\n type = 'select',\n showInput = true,\n displayTagBy = 'label'\n },\n ref: ForwardedRef<DropdownWithInputTagsHandle>\n ) => {\n // Define initValues at the top, right after props\n const initValues = (values: string[]) => {\n return values.map(val => {\n const found = options.find(opt => opt.value === val);\n return found ? { label: found.label, value: found.value } : { label: val, value: val };\n });\n };\n\n // Now use it in useState\n const [tags, setTags] = useState<{ label: string; value: string }[]>(() => {\n return initValues(value || []);\n });\n const [inputValue, setInputValue] = useState('');\n const [filteredOptions, setFilteredOptions] = useState<DropdownOption[]>(options);\n const [isDropdownOpen, setIsDropdownOpen] = useState(false);\n const popoverRef = useRef<PopoverHandle>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const applyClickedRef = useRef<boolean>(false);\n \n const isMultiSelectWithoutCTA = type === 'multi-select-without-cta';\n const isMultiSelect = type === 'multi-select' ||isMultiSelectWithoutCTA;\n\n // Generate stable ID for listbox\n const listboxId = useStableId(automationId, 'dropdown-input-tags-listbox');\n\n const handleSelectOption = useCallback(\n (option: DropdownOption) => {\n if (disabled) return;\n\n const newTags = [...tags];\n if (!newTags.some((tag) => tag.value === option.value)) {\n newTags.push({ label: option.label, value: option.value });\n setTags(newTags);\n onChange?.(newTags.map((tag) => tag.value));\n }\n setInputValue('');\n setIsDropdownOpen(false);\n },\n [disabled, tags, onChange]\n );\n\n const handleMultiSelectDropdownOptionClick = useCallback(\n (isSelected: boolean, option: DropdownOption) => {\n let newSelectedTags: { label: string; value: string }[] = [];\n if (isSelected) {\n newSelectedTags = [...tags, { label: option.label, value: option.value }];\n } else {\n newSelectedTags = tags.filter((tag) => tag.value !== option.value);\n }\n setTags(newSelectedTags);\n if (isMultiSelectWithoutCTA) {\n onChange?.(newSelectedTags.map((tag) => tag.value));\n }\n },\n [tags, isMultiSelectWithoutCTA, onChange]\n );\n\n const ADD_CUSTOM_TAG_VALUE = '__add_custom_tag__';\n\n const handleSelectFromDropdown = useCallback((option: DropdownOption) => {\n if (disabled) return;\n\n if (option.value === ADD_CUSTOM_TAG_VALUE) {\n const trimmed = inputValue.trim();\n if (!trimmed) return;\n const newTags = [...tags];\n if (!newTags.some((tag) => tag.value === trimmed)) {\n newTags.push({ label: trimmed, value: trimmed });\n setTags(newTags);\n onChange?.(newTags.map((tag) => tag.value));\n }\n setInputValue('');\n setIsDropdownOpen(false);\n return;\n }\n\n if (isMultiSelect) {\n const isSelected = tags.some(tag => tag.value === option.value);\n handleMultiSelectDropdownOptionClick(!isSelected, option);\n } else {\n handleSelectOption(option);\n }\n }, [disabled, isMultiSelect, tags, inputValue, onChange, handleMultiSelectDropdownOptionClick, handleSelectOption]);\n\n const effectiveItems: DropdownOption[] =\n filteredOptions.length > 0\n ? filteredOptions\n : allowCustomTags && inputValue.trim()\n ? [{ id: ADD_CUSTOM_TAG_VALUE, label: `Add \"${inputValue.trim()}\"`, value: ADD_CUSTOM_TAG_VALUE }]\n : [];\n\n // Combobox hook for keyboard navigation and ARIA\n const {\n containerProps,\n inputProps: comboboxInputProps,\n listboxProps,\n getOptionProps,\n highlightedIndex,\n setHighlightedIndex\n } = useCombobox({\n items: effectiveItems,\n isOpen: isDropdownOpen,\n onOpenChange: setIsDropdownOpen,\n onSelect: handleSelectFromDropdown,\n listboxId,\n hasItems: effectiveItems.length > 0\n });\n\n\n useEffect(() => {\n if (applyClickedRef.current) {\n applyClickedRef.current = false;\n return;\n }\n setTags(initValues(value || []));\n }, [value, options, isDropdownOpen]);\n\n\n useEffect(() => {\n // const isInputEmpty = !inputValue.trim();\n const filtered = options.filter(option =>\n option.label.toLowerCase().includes(inputValue.toLowerCase()) ||\n option.value.toLowerCase().includes(inputValue.toLowerCase())\n );\n setFilteredOptions(filtered);\n }, [inputValue, options]);\n\n const handleRemoveTag = (indexToRemove: number) => {\n if (disabled) return;\n \n const newTags = tags.filter((_, index) => index !== indexToRemove);\n setTags(newTags);\n \n //in multiselect if tag removed while dorpdownopen, do not call onchange\n if(!isMultiSelect || isMultiSelectWithoutCTA ||(isMultiSelect && !isDropdownOpen)) {\n onChange?.(newTags.map(tag => tag.value));\n }\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (disabled) return;\n \n // Handle Backspace to remove last tag (preserve existing behavior)\n if (e.key === 'Backspace' && inputValue === \"\" && tags.length > 0) {\n e.preventDefault();\n const newTags = tags.slice(0, -1);\n setTags(newTags);\n onChange?.(newTags.map(tag => tag.value));\n return;\n }\n\n // Handle Enter for custom tags when no options match\n if (e.key === 'Enter' && inputValue.trim() && filteredOptions.length === 0 && allowCustomTags) {\n e.preventDefault();\n const newTags = [...tags];\n if (!newTags.some(tag => tag.value === inputValue.trim())) {\n newTags.push({ label: inputValue.trim(), value: inputValue.trim() });\n setTags(newTags);\n onChange?.(newTags.map(tag => tag.value));\n }\n setInputValue('');\n setHighlightedIndex(-1);\n setIsDropdownOpen(false);\n return;\n }\n\n // Let combobox hook handle all other keyboard events (Arrow keys, Enter, Escape, etc.)\n comboboxInputProps.onKeyDown(e);\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (disabled) return;\n \n const newValue = e.target.value;\n setInputValue(newValue);\n setHighlightedIndex(-1); // Reset highlighted index when user types\n \n if (newValue.trim() && !isDropdownOpen) {\n setIsDropdownOpen(true);\n }\n };\n\n const handleInputFocus = () => {\n if (disabled) return;\n \n if (inputValue.trim() || options.length > 0) {\n setIsDropdownOpen(true);\n }\n };\n\n const handleInputContainerClick = (e: React.MouseEvent) => {\n if (disabled) return;\n \n e.stopPropagation();\n inputRef.current?.focus();\n if (!isDropdownOpen && (inputValue.trim() || options.length > 0)) {\n setIsDropdownOpen(true);\n }\n };\n\n const handlePopoverWrapperClick = (e: React.MouseEvent) => {\n if (disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n \n const target = e.target as HTMLElement;\n const isInputArea = target.closest('.input-with-tags-container');\n if (isInputArea) {\n e.stopPropagation();\n }\n };\n\n const toggleDropdown = () => {\n if (disabled) return;\n setIsDropdownOpen(!isDropdownOpen);\n };\n\n useImperativeHandle(ref, () => ({ toggleDropdown }), []);\n\n const defaultRenderOption = (\n option: DropdownOption,\n index: number,\n onSelect: (option: DropdownOption) => void,\n disabled: boolean\n ) => {\n const isSelected = tags.some((tag) => tag.value === option.value);\n const isHighlighted = highlightedIndex === index;\n const optionProps = getOptionProps(index, isSelected);\n \n return (\n <div\n key={option.id}\n {...optionProps}\n className={`dropdown-with-input-tags-option ${isHighlighted ? 'highlighted' : ''}`}\n onClick={() => !disabled && onSelect(option)}\n onMouseEnter={() => setHighlightedIndex(index)}\n data-automation-id={`${automationId}-option-${option.id}`}\n >\n <span className=\"option-label\">{option.label}</span>\n {option.value !== option.label && <span className=\"option-value\">{option.value}</span>}\n </div>\n );\n };\n const handleApplySelectedDropDownValues = () => {\n applyClickedRef.current = true;\n const newTagValues = tags.map(tag => tag.value);\n onChange?.(newTagValues);\n setIsDropdownOpen(false);\n };\n\n const clearSelectedDropDownValues = () => {\n setTags([]);\n };\n const multiSelectRenderOption = (option: DropdownOption, index: number) => {\n const isOptionSelected = tags.some(tag => tag.value === option.value);\n const isHighlighted = highlightedIndex === index;\n const optionProps = getOptionProps(index, isOptionSelected);\n \n return (\n <div\n key={option.id}\n {...optionProps}\n className={`dropdown-with-input-tags-option dropdown-with-input-tags-multi-select-option ${isHighlighted ? 'highlighted' : ''}`}\n aria-checked={isOptionSelected}\n onClick={() => !disabled && handleMultiSelectDropdownOptionClick(!isOptionSelected, option)}\n onMouseEnter={() => setHighlightedIndex(index)}\n data-automation-id={`${automationId}-option-${option.id}`}\n >\n <span onClick={(e) => e.stopPropagation()}>\n <Checkbox\n automationId=\"checkbox\"\n className=\"checkbox\"\n defaultChecked={isOptionSelected}\n onChange={(value) => handleMultiSelectDropdownOptionClick(value, option)}\n label={option.label}\n />\n </span>\n </div>\n );\n };\n\n const multiSelectRenderCTAs = () => {\n return (\n <div className=\"dropdown-with-input-tags-ctas-container\">\n <Button label=\"Clear\" type=\"link\" size=\"sm\" onClick={clearSelectedDropDownValues} automationId={`${automationId}-clear-button`} />\n <Button label=\"Apply\" type=\"primary\" size=\"sm\" onClick={handleApplySelectedDropDownValues} automationId={`${automationId}-apply-button`} />\n </div>\n );\n };\n\n \n\n return (\n <div\n className={`dropdown-with-input-tags-wrapper ${className} ${disabled ? 'disabled-wrapper' : ''}`}\n data-automation-id={automationId}\n {...containerProps}\n >\n {label && <label id={`${automationId}-label`} className=\"dropdown-with-input-tags-label\">{label}</label>}\n\n <div onClick={handlePopoverWrapperClick}>\n <Popover\n ref={popoverRef}\n className=\"dropdown-with-input-tags-popover\"\n contentWidth=\"full\"\n position=\"bottom-left\"\n isPopoverOpen={!disabled && isDropdownOpen}\n onPopoverToggle={disabled ? () => {} : setIsDropdownOpen}\n disableClickToggle={true}\n renderPopoverContents={({ closePopoverCb }) => (\n <>\n <div\n {...listboxProps}\n className=\"dropdown-with-input-tags-content\"\n {...(isMultiSelect && { 'aria-multiselectable': 'true' })}\n >\n {effectiveItems.length > 0 ? (\n effectiveItems.map((option, index) => {\n if (option.value === ADD_CUSTOM_TAG_VALUE) {\n const isHighlighted = highlightedIndex === index;\n const optionProps = getOptionProps(index, false);\n return (\n <div\n key={option.id}\n {...optionProps}\n className={`dropdown-with-input-tags-option dropdown-with-input-tags-custom-option ${isHighlighted ? 'highlighted' : ''}`}\n onClick={() => {\n if (disabled) return;\n handleSelectFromDropdown(option);\n closePopoverCb();\n }}\n onMouseEnter={() => setHighlightedIndex(index)}\n >\n Add \"{inputValue.trim()}\"\n </div>\n );\n }\n if (isMultiSelect) {\n return multiSelectRenderOption(option, index);\n }\n \n const isSelected = tags.some((tag) => tag.value === option.value);\n const isHighlighted = highlightedIndex === index;\n const optionProps = getOptionProps(index, isSelected);\n const optionPropsWithHandlers = {\n ...optionProps,\n onMouseEnter: () => setHighlightedIndex(index),\n className: `dropdown-with-input-tags-option ${isHighlighted ? 'highlighted' : ''}`\n };\n \n return renderOption\n ? renderOption(option, optionPropsWithHandlers, handleSelectOption)\n : defaultRenderOption(option, index, handleSelectOption, disabled);\n })\n ) : (\n <div className=\"dropdown-with-input-tags-no-options\">\n <div className=\"dropdown-with-input-tags-no-options-text\" role=\"status\" aria-live=\"polite\">\n {noOptionsMessage}\n </div>\n </div>\n )}\n </div>\n {isMultiSelect && !isMultiSelectWithoutCTA && multiSelectRenderCTAs()}\n </>\n )}\n renderPopoverSrcElement={() => (\n <div className=\"dropdown-with-input-tags-input-container\">\n <div\n className={`input-with-tags-container ${disabled ? 'disabled-input-with-tags-container' : ''}`}\n onClick={handleInputContainerClick}\n >\n {tags.map((tag, index) => (\n <span key={index} className=\"tag-in-inputwithtags\">\n {tag[displayTagBy]}\n {!disabled && (\n <Icon\n name=\"close\"\n className=\"close-icon-in-inputwithtags\"\n ariaLabel={`Remove tag ${tag[displayTagBy]}`}\n onClick={() => handleRemoveTag(index)}\n shouldStopPropagation\n />\n )}\n </span>\n ))}\n {(showInput ||!tags.length) && (\n <input\n ref={inputRef}\n {...comboboxInputProps}\n type=\"text\"\n value={inputValue}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onFocus={handleInputFocus}\n placeholder={tags.length === 0 ? placeholder : ''}\n className=\"input-with-tags-input\"\n disabled={disabled}\n aria-label={label || 'Search and select options'}\n />\n )}\n </div>\n </div>\n )}\n automationId={automationId}\n popoverContentAutomationId={`${automationId}-content`}\n />\n </div>\n </div>\n );\n }\n); "],"names":["DropdownWithInputTags","value","onChange","placeholder","className","options","renderOption","label","automationId","noOptionsMessage","allowCustomTags","disabled","type","showInput","displayTagBy","ref","initValues","values","map","val","found","find","opt","tags","setTags","useState","inputValue","setInputValue","filteredOptions","setFilteredOptions","isDropdownOpen","setIsDropdownOpen","popoverRef","useRef","inputRef","applyClickedRef","isMultiSelectWithoutCTA","isMultiSelect","listboxId","useStableId","handleSelectOption","useCallback","option","newTags","some","tag","push","handleMultiSelectDropdownOptionClick","isSelected","newSelectedTags","filter","ADD_CUSTOM_TAG_VALUE","handleSelectFromDropdown","trimmed","trim","effectiveItems","length","id","containerProps","inputProps","comboboxInputProps","listboxProps","getOptionProps","highlightedIndex","setHighlightedIndex","useCombobox","items","isOpen","onOpenChange","onSelect","hasItems","useEffect","current","filtered","toLowerCase","includes","handleRemoveTag","indexToRemove","_","index","handleKeyDown","e","key","preventDefault","slice","onKeyDown","handleInputChange","newValue","target","handleInputFocus","handleInputContainerClick","stopPropagation","focus","handlePopoverWrapperClick","closest","toggleDropdown","useImperativeHandle","defaultRenderOption","isHighlighted","optionProps","React","createElement","_extends","onClick","onMouseEnter","handleApplySelectedDropDownValues","newTagValues","clearSelectedDropDownValues","multiSelectRenderOption","isOptionSelected","Checkbox","defaultChecked","multiSelectRenderCTAs","Button","size","Popover","contentWidth","position","isPopoverOpen","onPopoverToggle","disableClickToggle","renderPopoverContents","closePopoverCb","Fragment","optionPropsWithHandlers","role","renderPopoverSrcElement","Icon","name","ariaLabel","shouldStopPropagation","onFocus","popoverContentAutomationId"],"mappings":";;;;;;;;;;;;;;;;;AA+CO,MAAMA,wBACX,CACE;AAAA,EACEC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,aAAAA,IAAc;AAAA,EACdC,WAAAA,IAAY;AAAA,EACZC,SAAAA,IAAU,CAAA;AAAA,EACVC,cAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,kBAAAA,IAAmB;AAAA,EACnBC,iBAAAA,IAAkB;AAAA,EAClBC,UAAAA,IAAW;AAAA,EACXC,MAAAA,IAAO;AAAA,EACPC,WAAAA,IAAY;AAAA,EACZC,cAAAA,IAAe;AACjB,GACAC,MACG;AAEH,QAAMC,IAAaA,CAACC,MACXA,EAAOC,IAAIC,CAAAA,MAAO;AACvB,UAAMC,IAAQf,EAAQgB,KAAKC,CAAAA,MAAOA,EAAIrB,UAAUkB,CAAG;AACnD,WAAOC,IAAQ;AAAA,MAAEb,OAAOa,EAAMb;AAAAA,MAAON,OAAOmB,EAAMnB;AAAAA,IAAAA,IAAU;AAAA,MAAEM,OAAOY;AAAAA,MAAKlB,OAAOkB;AAAAA,IAAAA;AAAAA,EACnF,CAAC,GAIG,CAACI,GAAMC,CAAO,IAAIC,EAA6C,MAC5DT,EAAWf,KAAS,EAAE,CAC9B,GACK,CAACyB,GAAYC,CAAa,IAAIF,EAAS,EAAE,GACzC,CAACG,GAAiBC,CAAkB,IAAIJ,EAA2BpB,CAAO,GAC1E,CAACyB,GAAgBC,CAAiB,IAAIN,EAAS,EAAK,GACpDO,IAAaC,EAAsB,IAAI,GACvCC,IAAWD,EAAyB,IAAI,GACxCE,IAAkBF,EA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;AAAA,MACpCmD,uBAAqB;AAAA,IAAA,CACtB,CAEC,CACP,IACCrH,KAAY,CAACU,EAAKiC,WAClB4C,gBAAAA,EAAAC,uBAAAC,EAAA;AAAA,MACEvF,KAAKmB;AAAAA,IAAAA,GACD0B,GAAkB;AAAA,MACtBhD,MAAK;AAAA,MACLX,OAAOyB;AAAAA,MACPxB,UAAUoF;AAAAA,MACVD,WAAWL;AAAAA,MACXmD,SAAS1C;AAAAA,MACTtF,aAAaoB,EAAKiC,WAAW,IAAIrD,IAAc;AAAA,MAC/CC,WAAU;AAAA,MACVO,UAAAA;AAAAA,MACA,cAAYJ,KAAS;AAAA,IAAA,CAA4B,CAClD,CAEA,CACF;AAAA,IAEPC,cAAAA;AAAAA,IACA4H,4BAA4B,GAAG5H,CAAY;AAAA,EAAA,CAC5C,CACE,CACF;AAET,CACF;"}
|
package/dist/index38.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "react";
|
|
2
|
-
import { useStableId as A } from "./
|
|
3
|
-
import { mergeIds as P } from "./
|
|
4
|
-
import { getA11yNameAttributes as _ } from "./
|
|
2
|
+
import { useStableId as A } from "./index185.js";
|
|
3
|
+
import { mergeIds as P } from "./index186.js";
|
|
4
|
+
import { getA11yNameAttributes as _ } from "./index70.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
function z({
|
|
7
7
|
value: l,
|
package/dist/index41.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e, { useState as g, useRef as p } from "react";
|
|
2
2
|
import { Icon as c } from "./index5.js";
|
|
3
|
-
import { ProgressBar as
|
|
3
|
+
import { ProgressBar as x } from "./index40.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
const r = {
|
|
6
6
|
gettingStartedWidgetCtn: "border border-[var(--color-gray-200)] rounded-[12px] w-[385px] p-4",
|
|
@@ -14,7 +14,7 @@ const r = {
|
|
|
14
14
|
}) => {
|
|
15
15
|
const [n, l] = g(!1), o = p(null), i = () => {
|
|
16
16
|
l(!n);
|
|
17
|
-
},
|
|
17
|
+
}, m = (t) => t ? "var(--color-green-500)" : "var(--color-gray-200)";
|
|
18
18
|
return /* @__PURE__ */ e.createElement("div", {
|
|
19
19
|
className: `${r.gettingStartedWidgetCtn} ${s} getting-started-widget-ctn`
|
|
20
20
|
}, /* @__PURE__ */ e.createElement("div", {
|
|
@@ -27,7 +27,7 @@ const r = {
|
|
|
27
27
|
onClick: i
|
|
28
28
|
})), /* @__PURE__ */ e.createElement("div", {
|
|
29
29
|
className: "mt-[12px]"
|
|
30
|
-
}, /* @__PURE__ */ e.createElement(
|
|
30
|
+
}, /* @__PURE__ */ e.createElement(x, {
|
|
31
31
|
totalTasks: a.length,
|
|
32
32
|
completedTasks: a.filter((t) => t.isComplete).length,
|
|
33
33
|
progressBarCtnClassName: "get-started-progress-bar-ctn"
|
|
@@ -37,19 +37,18 @@ const r = {
|
|
|
37
37
|
style: {
|
|
38
38
|
maxHeight: n ? `${o.current?.scrollHeight}px` : "0px"
|
|
39
39
|
}
|
|
40
|
-
}, a.map((t,
|
|
41
|
-
key:
|
|
40
|
+
}, a.map((t, d) => /* @__PURE__ */ e.createElement("div", {
|
|
41
|
+
key: d,
|
|
42
42
|
className: r.actionItemCtn
|
|
43
43
|
}, /* @__PURE__ */ e.createElement(c, {
|
|
44
44
|
name: "checked-circle",
|
|
45
|
-
stroke:
|
|
45
|
+
stroke: m(t.isComplete)
|
|
46
46
|
}), /* @__PURE__ */ e.createElement("span", {
|
|
47
47
|
className: t.isComplete ? "text-[var(--color-gray-500)]" : "text-[var(--color-gray-900)] cursor-pointer",
|
|
48
48
|
onClick: t?.handleActionItemClick
|
|
49
49
|
}, t.label)))));
|
|
50
50
|
};
|
|
51
51
|
export {
|
|
52
|
-
E as GetStartedWidget
|
|
53
|
-
E as default
|
|
52
|
+
E as GetStartedWidget
|
|
54
53
|
};
|
|
55
54
|
//# sourceMappingURL=index41.js.map
|