myoperator-ui 0.0.210-beta.0 → 0.0.210-beta.1
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/index.js +167 -167
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1661,6 +1661,172 @@ const Switch = React.forwardRef<
|
|
|
1661
1661
|
Switch.displayName = "Switch";
|
|
1662
1662
|
|
|
1663
1663
|
export { Switch, switchVariants };
|
|
1664
|
+
`, prefix)
|
|
1665
|
+
}
|
|
1666
|
+
]
|
|
1667
|
+
},
|
|
1668
|
+
"textarea": {
|
|
1669
|
+
name: "textarea",
|
|
1670
|
+
description: "A multi-line text input with label, helper text, error state, and character count support",
|
|
1671
|
+
category: "form",
|
|
1672
|
+
dependencies: [
|
|
1673
|
+
"class-variance-authority",
|
|
1674
|
+
"clsx",
|
|
1675
|
+
"tailwind-merge"
|
|
1676
|
+
],
|
|
1677
|
+
files: [
|
|
1678
|
+
{
|
|
1679
|
+
name: "textarea.tsx",
|
|
1680
|
+
content: prefixTailwindClasses(`import * as React from "react";
|
|
1681
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
1682
|
+
|
|
1683
|
+
import { cn } from "../../lib/utils";
|
|
1684
|
+
|
|
1685
|
+
const textAreaVariants = cva(
|
|
1686
|
+
"w-full rounded bg-semantic-bg-primary px-4 py-3 text-base text-semantic-text-primary outline-none transition-all resize-y placeholder:text-semantic-text-placeholder disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-[var(--color-neutral-50)]",
|
|
1687
|
+
{
|
|
1688
|
+
variants: {
|
|
1689
|
+
state: {
|
|
1690
|
+
default:
|
|
1691
|
+
"border border-semantic-border-input focus:outline-none focus:border-semantic-border-input-focus/50 focus:shadow-[0_0_0_1px_rgba(43,188,202,0.15)]",
|
|
1692
|
+
error:
|
|
1693
|
+
"border border-semantic-error-primary/40 focus:outline-none focus:border-semantic-error-primary/60 focus:shadow-[0_0_0_1px_rgba(240,68,56,0.1)]",
|
|
1694
|
+
},
|
|
1695
|
+
},
|
|
1696
|
+
defaultVariants: {
|
|
1697
|
+
state: "default",
|
|
1698
|
+
},
|
|
1699
|
+
}
|
|
1700
|
+
);
|
|
1701
|
+
|
|
1702
|
+
export interface TextAreaProps
|
|
1703
|
+
extends React.ComponentProps<"textarea">,
|
|
1704
|
+
VariantProps<typeof textAreaVariants> {
|
|
1705
|
+
/** Label text displayed above the textarea */
|
|
1706
|
+
label?: string;
|
|
1707
|
+
/** Shows red asterisk next to label when true */
|
|
1708
|
+
required?: boolean;
|
|
1709
|
+
/** Helper text displayed below the textarea */
|
|
1710
|
+
helperText?: string;
|
|
1711
|
+
/** Error message - shows error state with red styling */
|
|
1712
|
+
error?: string;
|
|
1713
|
+
/** Shows character count when maxLength is set */
|
|
1714
|
+
showCount?: boolean;
|
|
1715
|
+
/** Additional class for the wrapper container */
|
|
1716
|
+
wrapperClassName?: string;
|
|
1717
|
+
/** Additional class for the label */
|
|
1718
|
+
labelClassName?: string;
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(
|
|
1722
|
+
(
|
|
1723
|
+
{
|
|
1724
|
+
className,
|
|
1725
|
+
wrapperClassName,
|
|
1726
|
+
labelClassName,
|
|
1727
|
+
state,
|
|
1728
|
+
label,
|
|
1729
|
+
required,
|
|
1730
|
+
helperText,
|
|
1731
|
+
error,
|
|
1732
|
+
showCount,
|
|
1733
|
+
maxLength,
|
|
1734
|
+
value,
|
|
1735
|
+
defaultValue,
|
|
1736
|
+
onChange,
|
|
1737
|
+
disabled,
|
|
1738
|
+
id,
|
|
1739
|
+
rows = 4,
|
|
1740
|
+
...props
|
|
1741
|
+
},
|
|
1742
|
+
ref
|
|
1743
|
+
) => {
|
|
1744
|
+
const [internalValue, setInternalValue] = React.useState(
|
|
1745
|
+
defaultValue ?? ""
|
|
1746
|
+
);
|
|
1747
|
+
|
|
1748
|
+
const isControlled = value !== undefined;
|
|
1749
|
+
const currentValue = isControlled ? value : internalValue;
|
|
1750
|
+
const derivedState = error ? "error" : (state ?? "default");
|
|
1751
|
+
|
|
1752
|
+
const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
1753
|
+
if (!isControlled) setInternalValue(e.target.value);
|
|
1754
|
+
onChange?.(e);
|
|
1755
|
+
};
|
|
1756
|
+
|
|
1757
|
+
const generatedId = React.useId();
|
|
1758
|
+
const textAreaId = id || generatedId;
|
|
1759
|
+
const helperId = \`\${textAreaId}-helper\`;
|
|
1760
|
+
const errorId = \`\${textAreaId}-error\`;
|
|
1761
|
+
const ariaDescribedBy = error ? errorId : helperText ? helperId : undefined;
|
|
1762
|
+
const charCount = String(currentValue).length;
|
|
1763
|
+
|
|
1764
|
+
return (
|
|
1765
|
+
<div className={cn("flex flex-col gap-1.5", wrapperClassName)}>
|
|
1766
|
+
{label && (
|
|
1767
|
+
<label
|
|
1768
|
+
htmlFor={textAreaId}
|
|
1769
|
+
className={cn(
|
|
1770
|
+
"text-sm font-semibold text-semantic-text-secondary tracking-[0.014px]",
|
|
1771
|
+
labelClassName
|
|
1772
|
+
)}
|
|
1773
|
+
>
|
|
1774
|
+
{label}
|
|
1775
|
+
{required && (
|
|
1776
|
+
<span className="text-semantic-error-primary ml-0.5">*</span>
|
|
1777
|
+
)}
|
|
1778
|
+
</label>
|
|
1779
|
+
)}
|
|
1780
|
+
|
|
1781
|
+
<textarea
|
|
1782
|
+
ref={ref}
|
|
1783
|
+
id={textAreaId}
|
|
1784
|
+
rows={rows}
|
|
1785
|
+
className={cn(textAreaVariants({ state: derivedState, className }))}
|
|
1786
|
+
disabled={disabled}
|
|
1787
|
+
maxLength={maxLength}
|
|
1788
|
+
value={isControlled ? value : undefined}
|
|
1789
|
+
defaultValue={!isControlled ? defaultValue : undefined}
|
|
1790
|
+
onChange={handleChange}
|
|
1791
|
+
aria-invalid={!!error}
|
|
1792
|
+
aria-describedby={ariaDescribedBy}
|
|
1793
|
+
{...props}
|
|
1794
|
+
/>
|
|
1795
|
+
|
|
1796
|
+
{(error || helperText || (showCount && maxLength)) && (
|
|
1797
|
+
<div className="flex justify-between items-start gap-2">
|
|
1798
|
+
{error ? (
|
|
1799
|
+
<span id={errorId} className="text-xs text-semantic-error-primary">
|
|
1800
|
+
{error}
|
|
1801
|
+
</span>
|
|
1802
|
+
) : helperText ? (
|
|
1803
|
+
<span id={helperId} className="text-xs text-semantic-text-muted">
|
|
1804
|
+
{helperText}
|
|
1805
|
+
</span>
|
|
1806
|
+
) : (
|
|
1807
|
+
<span />
|
|
1808
|
+
)}
|
|
1809
|
+
{showCount && maxLength && (
|
|
1810
|
+
<span
|
|
1811
|
+
className={cn(
|
|
1812
|
+
"text-xs",
|
|
1813
|
+
charCount > maxLength
|
|
1814
|
+
? "text-semantic-error-primary"
|
|
1815
|
+
: "text-semantic-text-muted"
|
|
1816
|
+
)}
|
|
1817
|
+
>
|
|
1818
|
+
{charCount}/{maxLength}
|
|
1819
|
+
</span>
|
|
1820
|
+
)}
|
|
1821
|
+
</div>
|
|
1822
|
+
)}
|
|
1823
|
+
</div>
|
|
1824
|
+
);
|
|
1825
|
+
}
|
|
1826
|
+
);
|
|
1827
|
+
TextArea.displayName = "TextArea";
|
|
1828
|
+
|
|
1829
|
+
export { TextArea, textAreaVariants };
|
|
1664
1830
|
`, prefix)
|
|
1665
1831
|
}
|
|
1666
1832
|
]
|
|
@@ -2194,172 +2360,6 @@ export const ReadableField = React.forwardRef<HTMLDivElement, ReadableFieldProps
|
|
|
2194
2360
|
);
|
|
2195
2361
|
|
|
2196
2362
|
ReadableField.displayName = "ReadableField";
|
|
2197
|
-
`, prefix)
|
|
2198
|
-
}
|
|
2199
|
-
]
|
|
2200
|
-
},
|
|
2201
|
-
"textarea": {
|
|
2202
|
-
name: "textarea",
|
|
2203
|
-
description: "A multi-line text area with label, helper text, error state, and character count support",
|
|
2204
|
-
category: "form",
|
|
2205
|
-
dependencies: [
|
|
2206
|
-
"class-variance-authority",
|
|
2207
|
-
"clsx",
|
|
2208
|
-
"tailwind-merge"
|
|
2209
|
-
],
|
|
2210
|
-
files: [
|
|
2211
|
-
{
|
|
2212
|
-
name: "textarea.tsx",
|
|
2213
|
-
content: prefixTailwindClasses(`import * as React from "react";
|
|
2214
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
2215
|
-
|
|
2216
|
-
import { cn } from "../../lib/utils";
|
|
2217
|
-
|
|
2218
|
-
const textAreaVariants = cva(
|
|
2219
|
-
"w-full rounded bg-semantic-bg-primary px-4 py-3 text-base text-semantic-text-primary outline-none transition-all resize-y placeholder:text-semantic-text-placeholder disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-[var(--color-neutral-50)]",
|
|
2220
|
-
{
|
|
2221
|
-
variants: {
|
|
2222
|
-
state: {
|
|
2223
|
-
default:
|
|
2224
|
-
"border border-semantic-border-input focus:outline-none focus:border-semantic-border-input-focus/50 focus:shadow-[0_0_0_1px_rgba(43,188,202,0.15)]",
|
|
2225
|
-
error:
|
|
2226
|
-
"border border-semantic-error-primary/40 focus:outline-none focus:border-semantic-error-primary/60 focus:shadow-[0_0_0_1px_rgba(240,68,56,0.1)]",
|
|
2227
|
-
},
|
|
2228
|
-
},
|
|
2229
|
-
defaultVariants: {
|
|
2230
|
-
state: "default",
|
|
2231
|
-
},
|
|
2232
|
-
}
|
|
2233
|
-
);
|
|
2234
|
-
|
|
2235
|
-
export interface TextAreaProps
|
|
2236
|
-
extends React.ComponentProps<"textarea">,
|
|
2237
|
-
VariantProps<typeof textAreaVariants> {
|
|
2238
|
-
/** Label text displayed above the textarea */
|
|
2239
|
-
label?: string;
|
|
2240
|
-
/** Shows red asterisk next to label when true */
|
|
2241
|
-
required?: boolean;
|
|
2242
|
-
/** Helper text displayed below the textarea */
|
|
2243
|
-
helperText?: string;
|
|
2244
|
-
/** Error message - shows error state with red styling */
|
|
2245
|
-
error?: string;
|
|
2246
|
-
/** Shows character count when maxLength is set */
|
|
2247
|
-
showCount?: boolean;
|
|
2248
|
-
/** Additional class for the wrapper container */
|
|
2249
|
-
wrapperClassName?: string;
|
|
2250
|
-
/** Additional class for the label */
|
|
2251
|
-
labelClassName?: string;
|
|
2252
|
-
}
|
|
2253
|
-
|
|
2254
|
-
const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(
|
|
2255
|
-
(
|
|
2256
|
-
{
|
|
2257
|
-
className,
|
|
2258
|
-
wrapperClassName,
|
|
2259
|
-
labelClassName,
|
|
2260
|
-
state,
|
|
2261
|
-
label,
|
|
2262
|
-
required,
|
|
2263
|
-
helperText,
|
|
2264
|
-
error,
|
|
2265
|
-
showCount,
|
|
2266
|
-
maxLength,
|
|
2267
|
-
value,
|
|
2268
|
-
defaultValue,
|
|
2269
|
-
onChange,
|
|
2270
|
-
disabled,
|
|
2271
|
-
id,
|
|
2272
|
-
rows = 4,
|
|
2273
|
-
...props
|
|
2274
|
-
},
|
|
2275
|
-
ref
|
|
2276
|
-
) => {
|
|
2277
|
-
const [internalValue, setInternalValue] = React.useState(
|
|
2278
|
-
defaultValue ?? ""
|
|
2279
|
-
);
|
|
2280
|
-
|
|
2281
|
-
const isControlled = value !== undefined;
|
|
2282
|
-
const currentValue = isControlled ? value : internalValue;
|
|
2283
|
-
const derivedState = error ? "error" : (state ?? "default");
|
|
2284
|
-
|
|
2285
|
-
const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
2286
|
-
if (!isControlled) setInternalValue(e.target.value);
|
|
2287
|
-
onChange?.(e);
|
|
2288
|
-
};
|
|
2289
|
-
|
|
2290
|
-
const generatedId = React.useId();
|
|
2291
|
-
const textAreaId = id || generatedId;
|
|
2292
|
-
const helperId = \`\${textAreaId}-helper\`;
|
|
2293
|
-
const errorId = \`\${textAreaId}-error\`;
|
|
2294
|
-
const ariaDescribedBy = error ? errorId : helperText ? helperId : undefined;
|
|
2295
|
-
const charCount = String(currentValue).length;
|
|
2296
|
-
|
|
2297
|
-
return (
|
|
2298
|
-
<div className={cn("flex flex-col gap-1.5", wrapperClassName)}>
|
|
2299
|
-
{label && (
|
|
2300
|
-
<label
|
|
2301
|
-
htmlFor={textAreaId}
|
|
2302
|
-
className={cn(
|
|
2303
|
-
"text-sm font-semibold text-semantic-text-secondary tracking-[0.014px]",
|
|
2304
|
-
labelClassName
|
|
2305
|
-
)}
|
|
2306
|
-
>
|
|
2307
|
-
{label}
|
|
2308
|
-
{required && (
|
|
2309
|
-
<span className="text-semantic-error-primary ml-0.5">*</span>
|
|
2310
|
-
)}
|
|
2311
|
-
</label>
|
|
2312
|
-
)}
|
|
2313
|
-
|
|
2314
|
-
<textarea
|
|
2315
|
-
ref={ref}
|
|
2316
|
-
id={textAreaId}
|
|
2317
|
-
rows={rows}
|
|
2318
|
-
className={cn(textAreaVariants({ state: derivedState, className }))}
|
|
2319
|
-
disabled={disabled}
|
|
2320
|
-
maxLength={maxLength}
|
|
2321
|
-
value={isControlled ? value : undefined}
|
|
2322
|
-
defaultValue={!isControlled ? defaultValue : undefined}
|
|
2323
|
-
onChange={handleChange}
|
|
2324
|
-
aria-invalid={!!error}
|
|
2325
|
-
aria-describedby={ariaDescribedBy}
|
|
2326
|
-
{...props}
|
|
2327
|
-
/>
|
|
2328
|
-
|
|
2329
|
-
{(error || helperText || (showCount && maxLength)) && (
|
|
2330
|
-
<div className="flex justify-between items-start gap-2">
|
|
2331
|
-
{error ? (
|
|
2332
|
-
<span id={errorId} className="text-xs text-semantic-error-primary">
|
|
2333
|
-
{error}
|
|
2334
|
-
</span>
|
|
2335
|
-
) : helperText ? (
|
|
2336
|
-
<span id={helperId} className="text-xs text-semantic-text-muted">
|
|
2337
|
-
{helperText}
|
|
2338
|
-
</span>
|
|
2339
|
-
) : (
|
|
2340
|
-
<span />
|
|
2341
|
-
)}
|
|
2342
|
-
{showCount && maxLength && (
|
|
2343
|
-
<span
|
|
2344
|
-
className={cn(
|
|
2345
|
-
"text-xs",
|
|
2346
|
-
charCount > maxLength
|
|
2347
|
-
? "text-semantic-error-primary"
|
|
2348
|
-
: "text-semantic-text-muted"
|
|
2349
|
-
)}
|
|
2350
|
-
>
|
|
2351
|
-
{charCount}/{maxLength}
|
|
2352
|
-
</span>
|
|
2353
|
-
)}
|
|
2354
|
-
</div>
|
|
2355
|
-
)}
|
|
2356
|
-
</div>
|
|
2357
|
-
);
|
|
2358
|
-
}
|
|
2359
|
-
);
|
|
2360
|
-
TextArea.displayName = "TextArea";
|
|
2361
|
-
|
|
2362
|
-
export { TextArea, textAreaVariants };
|
|
2363
2363
|
`, prefix)
|
|
2364
2364
|
}
|
|
2365
2365
|
]
|
|
@@ -16637,7 +16637,7 @@ export type { WalletTopupProps, AmountOption } from "./types";
|
|
|
16637
16637
|
},
|
|
16638
16638
|
"fallback-prompts-panel": {
|
|
16639
16639
|
name: "fallback-prompts-panel",
|
|
16640
|
-
description: "An accordion card for configuring IVR bot fallback prompt messages (agent busy
|
|
16640
|
+
description: "An accordion card for configuring IVR bot fallback prompt messages (agent busy, no extension found)",
|
|
16641
16641
|
category: "custom",
|
|
16642
16642
|
dependencies: [
|
|
16643
16643
|
"clsx",
|