@wistia/ui 0.7.1-beta.dd072345.612ae5b → 0.7.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.cjs +1 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -33
- package/dist/index.d.ts +1 -33
- package/dist/index.mjs +1 -66
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.7.1
|
|
3
|
+
* @license @wistia/ui v0.7.1
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -76,7 +76,6 @@ __export(index_exports, {
|
|
|
76
76
|
Image: () => Image,
|
|
77
77
|
ImageDimensionsValidator: () => import_validators.ImageDimensionsValidator,
|
|
78
78
|
Input: () => Input,
|
|
79
|
-
InputClickToCopy: () => InputClickToCopy,
|
|
80
79
|
Label: () => Label,
|
|
81
80
|
Link: () => Link,
|
|
82
81
|
Menu: () => Menu,
|
|
@@ -12712,70 +12711,6 @@ var Thumbnail = (0, import_react66.forwardRef)(
|
|
|
12712
12711
|
}
|
|
12713
12712
|
);
|
|
12714
12713
|
Thumbnail.displayName = "Thumbnail";
|
|
12715
|
-
|
|
12716
|
-
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
12717
|
-
var import_styled_components90 = __toESM(require("styled-components"));
|
|
12718
|
-
var import_react67 = require("react");
|
|
12719
|
-
var import_type_guards54 = require("@wistia/type-guards");
|
|
12720
|
-
var import_jsx_runtime271 = require("react/jsx-runtime");
|
|
12721
|
-
var StyledInput2 = (0, import_styled_components90.default)(Input)`
|
|
12722
|
-
&:not([aria-disabled='true']) {
|
|
12723
|
-
cursor: pointer;
|
|
12724
|
-
}
|
|
12725
|
-
|
|
12726
|
-
&::selection {
|
|
12727
|
-
background-color: transparent;
|
|
12728
|
-
}
|
|
12729
|
-
`;
|
|
12730
|
-
var COPY_SUCCESS_DURATION = 2e3;
|
|
12731
|
-
var InputClickToCopy = (0, import_react67.forwardRef)(
|
|
12732
|
-
({ value, onCopy, ...props }, ref) => {
|
|
12733
|
-
const [isCopied, setIsCopied] = (0, import_react67.useState)(false);
|
|
12734
|
-
(0, import_react67.useEffect)(() => {
|
|
12735
|
-
if (isCopied) {
|
|
12736
|
-
const timeout = setTimeout(() => {
|
|
12737
|
-
setIsCopied(false);
|
|
12738
|
-
}, COPY_SUCCESS_DURATION);
|
|
12739
|
-
return () => {
|
|
12740
|
-
clearTimeout(timeout);
|
|
12741
|
-
};
|
|
12742
|
-
}
|
|
12743
|
-
return () => null;
|
|
12744
|
-
}, [isCopied]);
|
|
12745
|
-
const handleClick = (event) => {
|
|
12746
|
-
event.preventDefault();
|
|
12747
|
-
if ((0, import_type_guards54.isFunction)(props.onClick)) {
|
|
12748
|
-
props.onClick(event);
|
|
12749
|
-
}
|
|
12750
|
-
void copyToClipboard(value).then(() => {
|
|
12751
|
-
setIsCopied(true);
|
|
12752
|
-
if ((0, import_type_guards54.isFunction)(onCopy)) {
|
|
12753
|
-
onCopy(value);
|
|
12754
|
-
}
|
|
12755
|
-
return value;
|
|
12756
|
-
});
|
|
12757
|
-
};
|
|
12758
|
-
return /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
|
|
12759
|
-
StyledInput2,
|
|
12760
|
-
{
|
|
12761
|
-
"aria-label": "Click to Copy",
|
|
12762
|
-
...props,
|
|
12763
|
-
ref,
|
|
12764
|
-
onClick: handleClick,
|
|
12765
|
-
readOnly: true,
|
|
12766
|
-
rightIcon: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
|
|
12767
|
-
Icon,
|
|
12768
|
-
{
|
|
12769
|
-
colorScheme: "success",
|
|
12770
|
-
type: "checkmark-circle"
|
|
12771
|
-
}
|
|
12772
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(Icon, { type: "save-as-copy" }),
|
|
12773
|
-
value
|
|
12774
|
-
}
|
|
12775
|
-
);
|
|
12776
|
-
}
|
|
12777
|
-
);
|
|
12778
|
-
InputClickToCopy.displayName = "InputClickToCopy";
|
|
12779
12714
|
// Annotate the CommonJS export names for ESM import in node:
|
|
12780
12715
|
0 && (module.exports = {
|
|
12781
12716
|
ActionButton,
|
|
@@ -12815,7 +12750,6 @@ InputClickToCopy.displayName = "InputClickToCopy";
|
|
|
12815
12750
|
Image,
|
|
12816
12751
|
ImageDimensionsValidator,
|
|
12817
12752
|
Input,
|
|
12818
|
-
InputClickToCopy,
|
|
12819
12753
|
Label,
|
|
12820
12754
|
Link,
|
|
12821
12755
|
Menu,
|