@wistia/ui 0.10.17 → 0.10.18

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.10.17
3
+ * @license @wistia/ui v0.10.18
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -83,6 +83,7 @@ __export(index_exports, {
83
83
  ImageDimensionsValidator: () => import_validators.ImageDimensionsValidator,
84
84
  Input: () => Input,
85
85
  InputClickToCopy: () => InputClickToCopy,
86
+ InputPassword: () => InputPassword,
86
87
  KeyboardShortcut: () => KeyboardShortcut,
87
88
  Label: () => Label,
88
89
  Link: () => Link,
@@ -8973,10 +8974,12 @@ var StyledFormControlLabel = import_styled_components39.default.label`
8973
8974
  font-size: var(--wui-typography-label-3-size);
8974
8975
  font-weight: var(--wui-typography-label-3-weight);
8975
8976
  line-height: var(--wui-typography-label-3-line-height);
8977
+ justify-content: ${({ $align }) => $align === "left" ? "flex-start" : "space-between"};
8976
8978
 
8977
8979
  ${({ $disabled }) => $disabled && disabledStyle2}
8978
8980
  `;
8979
8981
  var FormControlLabel = ({
8982
+ align = "left",
8980
8983
  label,
8981
8984
  description,
8982
8985
  disabled = false,
@@ -8992,15 +8995,17 @@ var FormControlLabel = ({
8992
8995
  label,
8993
8996
  /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(FormControlLabelDescription, { children: description })
8994
8997
  ] });
8998
+ const slot = (0, import_type_guards27.isNotNil)(controlSlot) ? controlSlot : null;
8995
8999
  return /* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(
8996
9000
  StyledFormControlLabel,
8997
9001
  {
9002
+ $align: align,
8998
9003
  $disabled: disabled,
8999
9004
  htmlFor,
9000
9005
  ...props,
9001
9006
  children: [
9002
- (0, import_type_guards27.isNotNil)(controlSlot) ? controlSlot : null,
9003
- labelContent
9007
+ align === "left" ? slot : labelContent,
9008
+ align === "left" ? labelContent : slot
9004
9009
  ]
9005
9010
  }
9006
9011
  );
@@ -13428,6 +13433,7 @@ var StyledHiddenSwitchInput = import_styled_components84.default.input`
13428
13433
  `;
13429
13434
  var Switch = (0, import_react68.forwardRef)(
13430
13435
  ({
13436
+ align = "left",
13431
13437
  checked,
13432
13438
  disabled = false,
13433
13439
  id,
@@ -13462,6 +13468,7 @@ var Switch = (0, import_react68.forwardRef)(
13462
13468
  /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
13463
13469
  FormControlLabel,
13464
13470
  {
13471
+ align,
13465
13472
  controlSlot: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
13466
13473
  StyledSwitchInput,
13467
13474
  {
@@ -14482,6 +14489,53 @@ var WistiaLogo = ({
14482
14489
  return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime283.jsx)("a", { href, children: Logo }) : Logo;
14483
14490
  };
14484
14491
  WistiaLogo.displayName = "WistiaLogo";
14492
+
14493
+ // src/components/InputPassword/InputPassword.tsx
14494
+ var import_styled_components100 = __toESM(require("styled-components"));
14495
+ var import_react76 = require("react");
14496
+ var import_type_guards66 = require("@wistia/type-guards");
14497
+ var import_jsx_runtime284 = require("react/jsx-runtime");
14498
+ var StyledIconButton = (0, import_styled_components100.default)(IconButton)`
14499
+ /* override size for icon button since prop gets changed by Input */
14500
+ height: var(--icon-button-size-sm);
14501
+ width: var(--icon-button-size-sm);
14502
+
14503
+ /* override input padding variable since it is used for Input Icon positioning */
14504
+ --wui-input-horizontal-padding: 4px;
14505
+ `;
14506
+ var InputPassword = (0, import_react76.forwardRef)(
14507
+ ({ onVisibilityToggle, disabled = false, ...props }, ref) => {
14508
+ const [isVisible, setIsVisible] = (0, import_react76.useState)(false);
14509
+ const handleClick = () => {
14510
+ const newVisibility = !isVisible;
14511
+ setIsVisible(newVisibility);
14512
+ if ((0, import_type_guards66.isFunction)(onVisibilityToggle)) {
14513
+ onVisibilityToggle(newVisibility);
14514
+ }
14515
+ };
14516
+ return /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(
14517
+ Input,
14518
+ {
14519
+ ...props,
14520
+ ref,
14521
+ disabled,
14522
+ rightIcon: /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(
14523
+ StyledIconButton,
14524
+ {
14525
+ disabled,
14526
+ label: isVisible ? "Hide password" : "Show password",
14527
+ onClick: handleClick,
14528
+ tabIndex: disabled ? -1 : 0,
14529
+ variant: "ghost",
14530
+ children: /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(Icon, { type: isVisible ? "preview" : "hide" })
14531
+ }
14532
+ ),
14533
+ type: isVisible ? "text" : "password"
14534
+ }
14535
+ );
14536
+ }
14537
+ );
14538
+ InputPassword.displayName = "InputPassword";
14485
14539
  // Annotate the CommonJS export names for ESM import in node:
14486
14540
  0 && (module.exports = {
14487
14541
  ActionButton,
@@ -14528,6 +14582,7 @@ WistiaLogo.displayName = "WistiaLogo";
14528
14582
  ImageDimensionsValidator,
14529
14583
  Input,
14530
14584
  InputClickToCopy,
14585
+ InputPassword,
14531
14586
  KeyboardShortcut,
14532
14587
  Label,
14533
14588
  Link,