@wistia/ui 0.4.8-beta.25eae1b2.b10e708 → 0.4.8-beta.39749e5f.7a8d5fd

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.4.8-beta.25eae1b2.b10e708
3
+ * @license @wistia/ui v0.4.8-beta.39749e5f.7a8d5fd
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -77,9 +77,6 @@ __export(index_exports, {
77
77
  ScreenReaderOnly: () => ScreenReaderOnly,
78
78
  SegmentedControl: () => SegmentedControl,
79
79
  SegmentedControlItem: () => SegmentedControlItem,
80
- Select: () => Select,
81
- SelectOption: () => SelectOption,
82
- SelectOptionGroup: () => SelectOptionGroup,
83
80
  Stack: () => Stack,
84
81
  SubMenu: () => SubMenu,
85
82
  Tag: () => Tag,
@@ -5473,25 +5470,12 @@ var generateHref = (href, type, disabled) => {
5473
5470
  var isButton = (props) => (0, import_type_guards10.isUndefined)(props.href);
5474
5471
  var isLink = (props) => (0, import_type_guards10.isNotUndefined)(props.href);
5475
5472
  var StyledLink = import_styled_components17.default.a`
5476
- --link-icon-size: 14px;
5477
-
5478
5473
  ${({ href }) => (0, import_type_guards10.isNil)(href) && buttonResetCss};
5479
5474
  ${({ $colorScheme }) => getColorScheme($colorScheme)}
5480
5475
  cursor: pointer;
5481
5476
  font-family: var(--wui-typography-family-default);
5482
5477
  color: var(--wui-color-text-link);
5483
5478
  text-decoration: ${({ $underline }) => $underline ? "underline" : "none"};
5484
- display: inline-flex;
5485
- align-items: baseline;
5486
- gap: var(--wui-space-01);
5487
-
5488
- /* This ensure that the icon is the corect color when the style is solid or the button is disabled */
5489
- && {
5490
- svg {
5491
- width: var(--link-icon-size);
5492
- height: var(--link-icon-size);
5493
- }
5494
- }
5495
5479
  `;
5496
5480
  var Link = (0, import_react11.forwardRef)(
5497
5481
  ({
@@ -5501,8 +5485,6 @@ var Link = (0, import_react11.forwardRef)(
5501
5485
  disabled = false,
5502
5486
  colorScheme = "inherit",
5503
5487
  underline = false,
5504
- leftIcon,
5505
- rightIcon,
5506
5488
  ...props
5507
5489
  }, ref) => {
5508
5490
  const inRouterContext = (0, import_react_router_dom.useInRouterContext)();
@@ -5561,17 +5543,13 @@ var Link = (0, import_react11.forwardRef)(
5561
5543
  to: to ?? "",
5562
5544
  children
5563
5545
  }
5564
- ) : /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)(
5546
+ ) : /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
5565
5547
  StyledLink,
5566
5548
  {
5567
5549
  as: "a",
5568
5550
  ...combinedProps,
5569
5551
  href: to,
5570
- children: [
5571
- leftIcon ?? null,
5572
- children,
5573
- rightIcon ?? null
5574
- ]
5552
+ children
5575
5553
  }
5576
5554
  );
5577
5555
  }
@@ -7845,8 +7823,8 @@ var StyledSubTrigger = (0, import_styled_components43.default)(import_react_drop
7845
7823
  `;
7846
7824
  var SubMenuTrigger = (props) => {
7847
7825
  const { isSmAndUp } = useMq();
7848
- const Trigger3 = isSmAndUp ? StyledSubTrigger : import_react_dropdown_menu3.DropdownMenuItem;
7849
- return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(Trigger3, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
7826
+ const Trigger2 = isSmAndUp ? StyledSubTrigger : import_react_dropdown_menu3.DropdownMenuItem;
7827
+ return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(Trigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
7850
7828
  MenuItemButton,
7851
7829
  {
7852
7830
  ...props,
@@ -8475,7 +8453,6 @@ var StyledSegmentedControl = (0, import_styled_components51.default)(import_reac
8475
8453
  var SegmentedControl = (0, import_react40.forwardRef)(
8476
8454
  ({
8477
8455
  children,
8478
- disabled = false,
8479
8456
  fullWidth = false,
8480
8457
  selectedValue,
8481
8458
  onSelectedValueChange,
@@ -8489,7 +8466,6 @@ var SegmentedControl = (0, import_react40.forwardRef)(
8489
8466
  {
8490
8467
  ref,
8491
8468
  $fullWidth: fullWidth,
8492
- disabled,
8493
8469
  loop: true,
8494
8470
  onValueChange: onSelectedValueChange,
8495
8471
  rovingFocus: true,
@@ -8504,7 +8480,6 @@ var SegmentedControl = (0, import_react40.forwardRef)(
8504
8480
  SegmentedControl.displayName = "SegmentedControl";
8505
8481
 
8506
8482
  // src/components/SegmentedControl/SegmentedControlItem.tsx
8507
- var import_react41 = require("react");
8508
8483
  var import_styled_components52 = __toESM(require("styled-components"));
8509
8484
  var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
8510
8485
  var import_type_guards31 = require("@wistia/type-guards");
@@ -8552,45 +8527,35 @@ var StyledSegmentedControlItem = (0, import_styled_components52.default)(import_
8552
8527
  fill: var(--wui-color-focus-ring);
8553
8528
  }
8554
8529
  }
8555
-
8556
- &[data-disabled] {
8557
- cursor: not-allowed;
8558
-
8559
- &:hover {
8560
- background-color: inherit;
8561
- }
8562
- }
8563
8530
  `;
8564
- var SegmentedControlItem = (0, import_react41.forwardRef)(
8565
- ({ disabled, icon, label, "aria-label": ariaLabel, value }, ref) => {
8566
- const handleClick = (event) => {
8567
- const target = event.target;
8568
- const { state } = target.dataset;
8569
- if (state === "on") {
8570
- event.preventDefault();
8571
- }
8572
- };
8573
- return /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)(
8574
- StyledSegmentedControlItem,
8575
- {
8576
- ref,
8577
- $hasLabel: (0, import_type_guards31.isNotNil)(label),
8578
- "aria-label": (0, import_type_guards31.isNotNil)(label) ? void 0 : ariaLabel,
8579
- disabled,
8580
- onClick: handleClick,
8581
- value,
8582
- children: [
8583
- icon,
8584
- label
8585
- ]
8586
- }
8587
- );
8588
- }
8589
- );
8590
- SegmentedControlItem.displayName = "SegmentedControlItem";
8531
+ var SegmentedControlItem = ({
8532
+ icon,
8533
+ label,
8534
+ value
8535
+ }) => {
8536
+ const handleClick = (event) => {
8537
+ const target = event.target;
8538
+ const { state } = target.dataset;
8539
+ if (state === "on") {
8540
+ event.preventDefault();
8541
+ }
8542
+ };
8543
+ return /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)(
8544
+ StyledSegmentedControlItem,
8545
+ {
8546
+ $hasLabel: (0, import_type_guards31.isNotNil)(label),
8547
+ onClick: handleClick,
8548
+ value,
8549
+ children: [
8550
+ icon,
8551
+ label
8552
+ ]
8553
+ }
8554
+ );
8555
+ };
8591
8556
 
8592
8557
  // src/components/Tag/Tag.tsx
8593
- var import_react42 = require("react");
8558
+ var import_react41 = require("react");
8594
8559
  var import_styled_components53 = __toESM(require("styled-components"));
8595
8560
  var import_type_guards32 = require("@wistia/type-guards");
8596
8561
  var import_jsx_runtime205 = require("react/jsx-runtime");
@@ -8696,7 +8661,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
8696
8661
  )
8697
8662
  ] });
8698
8663
  };
8699
- var Tag = (0, import_react42.forwardRef)(
8664
+ var Tag = (0, import_react41.forwardRef)(
8700
8665
  ({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
8701
8666
  const labelProps = (0, import_type_guards32.isNotNil)(href) && (0, import_type_guards32.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
8702
8667
  return /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(
@@ -8939,190 +8904,6 @@ var WistiaLogo = ({
8939
8904
  return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("a", { href, children: Logo }) : Logo;
8940
8905
  };
8941
8906
  WistiaLogo.displayName = "WistiaLogo";
8942
-
8943
- // src/components/Select/Select.tsx
8944
- var import_react_select = require("@radix-ui/react-select");
8945
- var import_react43 = require("react");
8946
- var import_styled_components56 = __toESM(require("styled-components"));
8947
- var import_jsx_runtime208 = require("react/jsx-runtime");
8948
- var StyledTrigger = (0, import_styled_components56.default)(import_react_select.Trigger)`
8949
- ${({ $colorScheme }) => getColorScheme($colorScheme)};
8950
- --wui-select-color-bg: var(--wui-color-bg-surface);
8951
- --wui-select-color-bg-disabled: var(--wui-color-bg-surface-disabled);
8952
- --wui-select-color-border: var(--wui-color-border);
8953
- --wui-select-color-border-focus: var(--wui-color-border-active);
8954
- --wui-select-color-border-error: var(--wui-color-border-error);
8955
- --wui-select-color-border-disabled: var(--wui-color-border-disabled);
8956
- --wui-select-border-radius: var(--wui-border-radius-rounded);
8957
- --wui-select-multiline-border-radius: var(--wui-border-radius-02);
8958
- --wui-select-vertical-padding: var(--wui-space-02);
8959
- --wui-select-horizontal-padding: var(--wui-space-03);
8960
- --wui-select-placeholder: var(--wui-gray-10);
8961
- --wui-select-color-text-error: var(--wui-color-text-error);
8962
-
8963
- padding: var(--wui-select-vertical-padding) var(--wui-select-horizontal-padding);
8964
- background-color: var(--wui-select-color-bg);
8965
- border: 1px solid var(--wui-select-color-border);
8966
- border-radius: var(--wui-select-border-radius);
8967
- min-width: 200px;
8968
- text-align: left;
8969
- display: inline-flex;
8970
- align-items: center;
8971
- justify-content: space-between;
8972
- width: ${({ $fullWidth = false }) => $fullWidth ? "100%" : "auto"};
8973
-
8974
- &[aria-expanded='true'],
8975
- &:focus {
8976
- outline: 2px solid var(--wui-color-focus-ring);
8977
- }
8978
-
8979
- &[aria-invalid='true'] {
8980
- outline: 2px solid var(--wui-select-color-border-error);
8981
- color: var(--wui-select-color-text-error);
8982
- }
8983
-
8984
- &:disabled {
8985
- border-color: var(--wui-color-bg-surface-disabled);
8986
- background-color: var(--wui-color-bg-surface-disabled);
8987
- }
8988
- `;
8989
- var StyledContent2 = (0, import_styled_components56.default)(import_react_select.Content)`
8990
- --wui-select-content-border: var(--wui-color-border);
8991
- --wui-select-content-bg: var(--wui-color-bg-surface);
8992
- --wui-select-content-border-radius: var(--wui-border-radius-02);
8993
- --wui-select-option-padding: var(--wui-space-02);
8994
- --wui-select-option-inner-gap: var(--wui-space-03);
8995
- --wui-select-option-bg-hover: var(--wui-color-bg-surface-hover);
8996
-
8997
- overflow: hidden;
8998
- transform: translateY(8px);
8999
- background-color: var(--wui-select-content-bg);
9000
- border: 1px solid var(--wui-select-content-border);
9001
- border-radius: var(--wui-select-content-border-radius);
9002
- padding: var(--wui-select-option-padding);
9003
- min-width: 200px;
9004
- `;
9005
- var Select = (0, import_react43.forwardRef)(
9006
- ({
9007
- colorScheme = "inherit",
9008
- children,
9009
- onChange = () => null,
9010
- placeholder = "Select...",
9011
- fullWidth = false,
9012
- ...props
9013
- }, forwardedRef) => {
9014
- const responsiveFullWidth = useResponsiveProp(fullWidth);
9015
- return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(
9016
- import_react_select.Root,
9017
- {
9018
- ...props,
9019
- onValueChange: onChange,
9020
- children: [
9021
- /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(
9022
- StyledTrigger,
9023
- {
9024
- ref: forwardedRef,
9025
- $colorScheme: colorScheme,
9026
- $fullWidth: responsiveFullWidth,
9027
- ...props,
9028
- children: [
9029
- /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(import_react_select.Value, { placeholder }),
9030
- /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
9031
- Icon,
9032
- {
9033
- size: "md",
9034
- type: "caret-down"
9035
- }
9036
- )
9037
- ]
9038
- }
9039
- ),
9040
- /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(import_react_select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(StyledContent2, { position: "popper", children: [
9041
- /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(import_react_select.ScrollUpButton, { children: /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(Icon, { type: "caret-up" }) }),
9042
- /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(import_react_select.Viewport, { children }),
9043
- /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(import_react_select.ScrollDownButton, { children: /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(Icon, { type: "caret-down" }) })
9044
- ] }) })
9045
- ]
9046
- }
9047
- );
9048
- }
9049
- );
9050
- Select.displayName = "Select";
9051
-
9052
- // src/components/Select/SelectOption.tsx
9053
- var import_react_select2 = require("@radix-ui/react-select");
9054
- var import_react44 = require("react");
9055
- var import_styled_components57 = __toESM(require("styled-components"));
9056
- var import_jsx_runtime209 = require("react/jsx-runtime");
9057
- var StyledItem = (0, import_styled_components57.default)(import_react_select2.Item)`
9058
- ${variantStyleMap2.body3};
9059
- display: flex;
9060
- padding: var(--wui-select-option-padding);
9061
- gap: var(--wui-select-option-inner-gap);
9062
- font-size: var(--font-size);
9063
- font-weight: var(--font-weight);
9064
- border-radius: var(--wui-border-radius-01);
9065
-
9066
- &:hover,
9067
- &:focus-visible {
9068
- background-color: var(--wui-select-option-bg-hover);
9069
- outline: none;
9070
- }
9071
-
9072
- &[aria-disabled='true'] {
9073
- color: var(--wui-color-text-disabled);
9074
- }
9075
-
9076
- &[aria-disabled='true']:hover {
9077
- background-color: transparent;
9078
- }
9079
- `;
9080
- var StyledIconContainer = import_styled_components57.default.span`
9081
- width: 12px;
9082
- `;
9083
- var SelectOption = (0, import_react44.forwardRef)(
9084
- ({ children, ...props }, forwardedRef) => {
9085
- return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(
9086
- StyledItem,
9087
- {
9088
- ...props,
9089
- ref: forwardedRef,
9090
- children: [
9091
- /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(StyledIconContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_react_select2.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
9092
- Icon,
9093
- {
9094
- size: "sm",
9095
- type: "checkmark"
9096
- }
9097
- ) }) }),
9098
- /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_react_select2.ItemText, { children })
9099
- ]
9100
- }
9101
- );
9102
- }
9103
- );
9104
- SelectOption.displayName = "Option";
9105
-
9106
- // src/components/Select/SelectOptionGroup.tsx
9107
- var import_react_select3 = require("@radix-ui/react-select");
9108
- var import_styled_components58 = __toESM(require("styled-components"));
9109
- var import_jsx_runtime210 = require("react/jsx-runtime");
9110
- var StyledLabel3 = (0, import_styled_components58.default)(import_react_select3.Label)`
9111
- padding: var(--wui-select-option-padding);
9112
- `;
9113
- var SelectOptionGroup = ({ children, label, ...props }) => {
9114
- return /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(import_react_select3.Group, { ...props, children: [
9115
- /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(StyledLabel3, { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
9116
- Text,
9117
- {
9118
- prominence: "secondary",
9119
- variant: "body3",
9120
- children: label
9121
- }
9122
- ) }),
9123
- children
9124
- ] });
9125
- };
9126
8907
  // Annotate the CommonJS export names for ESM import in node:
9127
8908
  0 && (module.exports = {
9128
8909
  ActionButton,
@@ -9163,9 +8944,6 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
9163
8944
  ScreenReaderOnly,
9164
8945
  SegmentedControl,
9165
8946
  SegmentedControlItem,
9166
- Select,
9167
- SelectOption,
9168
- SelectOptionGroup,
9169
8947
  Stack,
9170
8948
  SubMenu,
9171
8949
  Tag,