@wistia/ui 0.14.11 → 0.14.12-beta.5ec6d9c0.7d3f35b

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 CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.14.11
3
+ * @license @wistia/ui v0.14.12-beta.5ec6d9c0.7d3f35b
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -9490,14 +9490,14 @@ var Checkbox = (0, import_react38.forwardRef)(
9490
9490
  const contextValue = checkboxGroupContext?.value;
9491
9491
  const checkboxName = name ?? contextName;
9492
9492
  const handleOnChange = onChange ?? contextOnChange;
9493
- const defaultChecked = (0, import_type_guards31.isNotUndefined)(value) && contextValue ? contextValue.includes(value) : void 0;
9493
+ const isChecked = (0, import_type_guards31.isNotUndefined)(value) && contextValue ? contextValue.includes(value) : checked;
9494
9494
  return /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(StyledCheckboxWrapper, { disabled, children: [
9495
9495
  /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
9496
9496
  StyledHiddenCheckboxInput,
9497
9497
  {
9498
9498
  ...props,
9499
9499
  ref,
9500
- ...(0, import_type_guards31.isNotUndefined)(defaultChecked) ? { defaultChecked } : { checked },
9500
+ checked: isChecked,
9501
9501
  disabled,
9502
9502
  id: computedId,
9503
9503
  name: checkboxName,
@@ -11207,13 +11207,18 @@ var inputStyles = import_styled_components61.css`
11207
11207
  font-weight: var(--wui-input-font-weight);
11208
11208
  color: var(--wui-input-color-text);
11209
11209
 
11210
+ &:read-only {
11211
+ outline-style: dashed;
11212
+ }
11213
+
11210
11214
  &::placeholder {
11211
11215
  color: var(--wui-input-placeholder);
11212
11216
  opacity: 1; /* Firefox */
11213
11217
  }
11214
11218
 
11215
11219
  &:focus {
11216
- outline: 2px solid var(--wui-input-color-border-focus);
11220
+ outline-width: 2px;
11221
+ outline-color: var(--wui-input-color-border-focus);
11217
11222
  outline-offset: -2px;
11218
11223
  }
11219
11224
 
@@ -13252,18 +13257,17 @@ var import_styled_components76 = __toESM(require("styled-components"));
13252
13257
  var import_react62 = require("react");
13253
13258
  var import_type_guards41 = require("@wistia/type-guards");
13254
13259
  var import_jsx_runtime265 = require("react/jsx-runtime");
13255
- var StyledInput2 = (0, import_styled_components76.default)(Input)`
13256
- &:not([aria-disabled='true']) {
13257
- cursor: pointer;
13258
- }
13260
+ var StyledIconButton = (0, import_styled_components76.default)(IconButton)`
13261
+ /* override size for icon button since prop gets changed by Input */
13262
+ height: var(--icon-button-size-sm);
13263
+ width: var(--icon-button-size-sm);
13259
13264
 
13260
- &::selection {
13261
- background-color: transparent;
13262
- }
13265
+ /* override input padding variable since it is used for Input Icon positioning */
13266
+ --wui-input-horizontal-padding: 4px;
13263
13267
  `;
13264
13268
  var COPY_SUCCESS_DURATION = 2e3;
13265
13269
  var InputClickToCopy = (0, import_react62.forwardRef)(
13266
- ({ value, onCopy, ...props }, ref) => {
13270
+ ({ value, onCopy, disabled = false, ...props }, ref) => {
13267
13271
  const [isCopied, setIsCopied] = (0, import_react62.useState)(false);
13268
13272
  (0, import_react62.useEffect)(() => {
13269
13273
  if (isCopied) {
@@ -13278,6 +13282,9 @@ var InputClickToCopy = (0, import_react62.forwardRef)(
13278
13282
  }, [isCopied]);
13279
13283
  const handleClick = (event) => {
13280
13284
  event.preventDefault();
13285
+ if (disabled) {
13286
+ return;
13287
+ }
13281
13288
  if ((0, import_type_guards41.isFunction)(props.onClick)) {
13282
13289
  props.onClick(event);
13283
13290
  }
@@ -13290,20 +13297,24 @@ var InputClickToCopy = (0, import_react62.forwardRef)(
13290
13297
  });
13291
13298
  };
13292
13299
  return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
13293
- StyledInput2,
13300
+ Input,
13294
13301
  {
13295
13302
  "aria-label": "Click to Copy",
13296
13303
  ...props,
13297
13304
  ref,
13298
- onClick: handleClick,
13305
+ disabled,
13299
13306
  readOnly: true,
13300
- rightIcon: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
13301
- Icon,
13307
+ rightIcon: /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
13308
+ StyledIconButton,
13302
13309
  {
13303
- colorScheme: "success",
13304
- type: "checkmark-circle"
13310
+ colorScheme: isCopied ? "success" : "inherit",
13311
+ disabled,
13312
+ label: "Copy to clipboard",
13313
+ onClick: handleClick,
13314
+ variant: "ghost",
13315
+ children: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(Icon, { type: "checkmark-circle" }) : /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(Icon, { type: "save-as-copy" })
13305
13316
  }
13306
- ) : /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(Icon, { type: "save-as-copy" }),
13317
+ ),
13307
13318
  value
13308
13319
  }
13309
13320
  );
@@ -14945,7 +14956,7 @@ var Radio = (0, import_react72.forwardRef)(
14945
14956
  const contextValue = radioGroupContext?.value;
14946
14957
  const radioName = name ?? contextName;
14947
14958
  const handleOnChange = onChange ?? contextOnChange;
14948
- const defaultChecked = (0, import_type_guards53.isNotUndefined)(value) && (0, import_type_guards53.isNotUndefined)(contextValue) ? contextValue.includes(value) : void 0;
14959
+ const isChecked = (0, import_type_guards53.isNotUndefined)(value) && (0, import_type_guards53.isNotUndefined)(contextValue) ? contextValue === value : checked;
14949
14960
  return /* @__PURE__ */ (0, import_jsx_runtime286.jsxs)(
14950
14961
  StyledRadioWrapper,
14951
14962
  {
@@ -14957,14 +14968,14 @@ var Radio = (0, import_react72.forwardRef)(
14957
14968
  {
14958
14969
  ...props,
14959
14970
  ref,
14971
+ checked: isChecked,
14960
14972
  disabled,
14961
14973
  id: computedId,
14962
14974
  name: radioName,
14963
14975
  onChange: handleOnChange,
14964
14976
  required,
14965
14977
  type: "radio",
14966
- value,
14967
- ...(0, import_type_guards53.isNotUndefined)(defaultChecked) ? { defaultChecked } : { checked }
14978
+ value
14968
14979
  }
14969
14980
  ),
14970
14981
  /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
@@ -15128,7 +15139,7 @@ var RadioCardRoot = (0, import_react73.forwardRef)(
15128
15139
  const contextValue = radioGroupContext?.value;
15129
15140
  const radioName = name ?? contextName;
15130
15141
  const handleOnChange = onChange ?? contextOnChange;
15131
- const defaultChecked = (0, import_type_guards54.isNotUndefined)(value) && (0, import_type_guards54.isNotUndefined)(contextValue) ? contextValue.includes(value) : void 0;
15142
+ const isChecked = (0, import_type_guards54.isNotUndefined)(value) && (0, import_type_guards54.isNotUndefined)(contextValue) ? contextValue === value : checked;
15132
15143
  return /* @__PURE__ */ (0, import_jsx_runtime287.jsxs)(
15133
15144
  StyledCard2,
15134
15145
  {
@@ -15141,13 +15152,13 @@ var RadioCardRoot = (0, import_react73.forwardRef)(
15141
15152
  {
15142
15153
  ...props,
15143
15154
  ref,
15155
+ checked: isChecked,
15144
15156
  disabled,
15145
15157
  id: computedId,
15146
15158
  name: radioName,
15147
15159
  onChange: handleOnChange,
15148
15160
  type: "radio",
15149
- value,
15150
- ...(0, import_type_guards54.isNotUndefined)(defaultChecked) ? { defaultChecked } : { checked }
15161
+ value
15151
15162
  }
15152
15163
  ),
15153
15164
  children
@@ -16917,7 +16928,7 @@ var import_styled_components120 = __toESM(require("styled-components"));
16917
16928
  var import_react89 = require("react");
16918
16929
  var import_type_guards70 = require("@wistia/type-guards");
16919
16930
  var import_jsx_runtime315 = require("react/jsx-runtime");
16920
- var StyledIconButton = (0, import_styled_components120.default)(IconButton)`
16931
+ var StyledIconButton2 = (0, import_styled_components120.default)(IconButton)`
16921
16932
  /* override size for icon button since prop gets changed by Input */
16922
16933
  height: var(--icon-button-size-sm);
16923
16934
  width: var(--icon-button-size-sm);
@@ -16942,7 +16953,7 @@ var InputPassword = (0, import_react89.forwardRef)(
16942
16953
  ref,
16943
16954
  disabled,
16944
16955
  rightIcon: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
16945
- StyledIconButton,
16956
+ StyledIconButton2,
16946
16957
  {
16947
16958
  disabled,
16948
16959
  label: isVisible ? "Hide password" : "Show password",