@wistia/ui 0.4.7 → 0.4.8-beta.2116c6fb.fdbbdee
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 +315 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +98 -1
- package/dist/index.d.ts +98 -1
- package/dist/index.mjs +299 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.4.
|
|
3
|
+
* @license @wistia/ui v0.4.8-beta.2116c6fb.fdbbdee
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -40,6 +40,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
40
40
|
var index_exports = {};
|
|
41
41
|
__export(index_exports, {
|
|
42
42
|
ActionButton: () => ActionButton,
|
|
43
|
+
AnalyticsCard: () => AnalyticsCard,
|
|
43
44
|
Avatar: () => Avatar,
|
|
44
45
|
Badge: () => Badge,
|
|
45
46
|
Box: () => Box,
|
|
@@ -75,6 +76,9 @@ __export(index_exports, {
|
|
|
75
76
|
RadioGroup: () => RadioGroup,
|
|
76
77
|
RadioMenuItem: () => RadioMenuItem,
|
|
77
78
|
ScreenReaderOnly: () => ScreenReaderOnly,
|
|
79
|
+
Select: () => Select,
|
|
80
|
+
SelectOption: () => SelectOption,
|
|
81
|
+
SelectOptionGroup: () => SelectOptionGroup,
|
|
78
82
|
Stack: () => Stack,
|
|
79
83
|
SubMenu: () => SubMenu,
|
|
80
84
|
Tag: () => Tag,
|
|
@@ -7483,6 +7487,14 @@ Input.displayName = "Input";
|
|
|
7483
7487
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
7484
7488
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
7485
7489
|
var import_type_guards23 = require("@wistia/type-guards");
|
|
7490
|
+
var import_react31 = require("react");
|
|
7491
|
+
|
|
7492
|
+
// src/components/Menu/MenuContext.tsx
|
|
7493
|
+
var import_react30 = require("react");
|
|
7494
|
+
var MenuContext = (0, import_react30.createContext)({ compact: false });
|
|
7495
|
+
var useMenuContext = () => (0, import_react30.useContext)(MenuContext);
|
|
7496
|
+
|
|
7497
|
+
// src/components/Menu/Menu.tsx
|
|
7486
7498
|
var import_jsx_runtime187 = require("react/jsx-runtime");
|
|
7487
7499
|
var open = import_styled_components39.keyframes`
|
|
7488
7500
|
from {
|
|
@@ -7504,6 +7516,28 @@ var close = import_styled_components39.keyframes`
|
|
|
7504
7516
|
transform: scale(.97) translateY(-8px);
|
|
7505
7517
|
}
|
|
7506
7518
|
`;
|
|
7519
|
+
var menuItemCss = import_styled_components39.css`
|
|
7520
|
+
--menu-label-description-gap: var(--wui-space-01);
|
|
7521
|
+
--menu-item-inner-gap: var(--wui-space-03);
|
|
7522
|
+
--menu-item-left-icon-size: 24px;
|
|
7523
|
+
--menu-item-right-icon-size: 16px;
|
|
7524
|
+
--menu-item-padding: var(--wui-space-02);
|
|
7525
|
+
--menu-label-font-size: var(--wui-typography-label-3-size);
|
|
7526
|
+
--menu-label-font-weight: var(--wui-typography-label-3-weight);
|
|
7527
|
+
--menu-label-line-height: var(--wui-typography-label-3-line-height);
|
|
7528
|
+
--menu-divider-margin: var(--wui-space-02);
|
|
7529
|
+
`;
|
|
7530
|
+
var compactMenuItemCss = import_styled_components39.css`
|
|
7531
|
+
--menu-label-description-gap: 0;
|
|
7532
|
+
--menu-item-inner-gap: var(--wui-space-02);
|
|
7533
|
+
--menu-item-left-icon-size: 16px;
|
|
7534
|
+
--menu-item-right-icon-size: 12px;
|
|
7535
|
+
--menu-item-padding: 6px;
|
|
7536
|
+
--menu-label-font-size: var(--wui-typography-label-4-size);
|
|
7537
|
+
--menu-label-font-weight: var(--wui-typography-label-4-weight);
|
|
7538
|
+
--menu-label-line-height: var(--wui-typography-label-4-line-height);
|
|
7539
|
+
--menu-divider-margin: var(--wui-space-01);
|
|
7540
|
+
`;
|
|
7507
7541
|
var menuContentCss = import_styled_components39.css`
|
|
7508
7542
|
--menu-font-family: var(--wui-typography-family-default);
|
|
7509
7543
|
--menu-bg: var(--wui-color-bg-surface);
|
|
@@ -7513,6 +7547,8 @@ var menuContentCss = import_styled_components39.css`
|
|
|
7513
7547
|
--menu-min-width: 120px;
|
|
7514
7548
|
--menu-max-width: 284px;
|
|
7515
7549
|
|
|
7550
|
+
${({ $compact }) => $compact ? compactMenuItemCss : menuItemCss};
|
|
7551
|
+
|
|
7516
7552
|
animation: ${open}; /* TODO - need easing tokens */
|
|
7517
7553
|
font-family: var(--menu-font-family);
|
|
7518
7554
|
background: var(--menu-bg);
|
|
@@ -7543,31 +7579,8 @@ var menuContentCss = import_styled_components39.css`
|
|
|
7543
7579
|
margin: var(--menu-divider-margin) 0;
|
|
7544
7580
|
}
|
|
7545
7581
|
`;
|
|
7546
|
-
var menuItemCss = import_styled_components39.css`
|
|
7547
|
-
--menu-label-description-gap: var(--wui-space-01);
|
|
7548
|
-
--menu-item-inner-gap: var(--wui-space-03);
|
|
7549
|
-
--menu-item-left-icon-size: 24px;
|
|
7550
|
-
--menu-item-right-icon-size: 16px;
|
|
7551
|
-
--menu-item-padding: var(--wui-space-02);
|
|
7552
|
-
--menu-label-font-size: var(--wui-typography-label-3-size);
|
|
7553
|
-
--menu-label-font-weight: var(--wui-typography-label-3-weight);
|
|
7554
|
-
--menu-label-line-height: var(--wui-typography-label-3-line-height);
|
|
7555
|
-
--menu-divider-margin: var(--wui-space-02);
|
|
7556
|
-
`;
|
|
7557
|
-
var compactMenuItemCss = import_styled_components39.css`
|
|
7558
|
-
--menu-label-description-gap: 0;
|
|
7559
|
-
--menu-item-inner-gap: var(--wui-space-02);
|
|
7560
|
-
--menu-item-left-icon-size: 16px;
|
|
7561
|
-
--menu-item-right-icon-size: 12px;
|
|
7562
|
-
--menu-item-padding: 6px;
|
|
7563
|
-
--menu-label-font-size: var(--wui-typography-label-4-size);
|
|
7564
|
-
--menu-label-font-weight: var(--wui-typography-label-4-weight);
|
|
7565
|
-
--menu-label-line-height: var(--wui-typography-label-4-line-height);
|
|
7566
|
-
--menu-divider-margin: var(--wui-space-01);
|
|
7567
|
-
`;
|
|
7568
7582
|
var MenuContent = (0, import_styled_components39.default)(import_react_dropdown_menu.DropdownMenuContent)`
|
|
7569
7583
|
${menuContentCss}
|
|
7570
|
-
${({ $compact }) => $compact ? compactMenuItemCss : menuItemCss}
|
|
7571
7584
|
`;
|
|
7572
7585
|
var Menu = ({
|
|
7573
7586
|
align = "start",
|
|
@@ -7582,6 +7595,7 @@ var Menu = ({
|
|
|
7582
7595
|
onInteractOutside,
|
|
7583
7596
|
...props
|
|
7584
7597
|
}) => {
|
|
7598
|
+
const contextValue = (0, import_react31.useMemo)(() => ({ compact }), [compact]);
|
|
7585
7599
|
let controlProps = {
|
|
7586
7600
|
...(0, import_type_guards23.isNotNil)(onOpenChange) && (0, import_type_guards23.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
7587
7601
|
};
|
|
@@ -7591,7 +7605,7 @@ var Menu = ({
|
|
|
7591
7605
|
onOpenChange: () => null
|
|
7592
7606
|
};
|
|
7593
7607
|
}
|
|
7594
|
-
return /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(
|
|
7608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(MenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(
|
|
7595
7609
|
import_react_dropdown_menu.DropdownMenu,
|
|
7596
7610
|
{
|
|
7597
7611
|
modal: false,
|
|
@@ -7623,7 +7637,7 @@ var Menu = ({
|
|
|
7623
7637
|
) })
|
|
7624
7638
|
]
|
|
7625
7639
|
}
|
|
7626
|
-
);
|
|
7640
|
+
) });
|
|
7627
7641
|
};
|
|
7628
7642
|
Menu.displayName = "Menu";
|
|
7629
7643
|
|
|
@@ -7655,13 +7669,13 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
7655
7669
|
MenuLabel.displayName = "MenuLabel";
|
|
7656
7670
|
|
|
7657
7671
|
// src/components/Menu/SubMenu.tsx
|
|
7658
|
-
var
|
|
7672
|
+
var import_react33 = require("react");
|
|
7659
7673
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
7660
7674
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
7661
7675
|
var import_type_guards25 = require("@wistia/type-guards");
|
|
7662
7676
|
|
|
7663
7677
|
// src/components/Menu/MenuItemButton.tsx
|
|
7664
|
-
var
|
|
7678
|
+
var import_react32 = require("react");
|
|
7665
7679
|
var import_styled_components41 = __toESM(require("styled-components"));
|
|
7666
7680
|
var import_type_guards24 = require("@wistia/type-guards");
|
|
7667
7681
|
var import_jsx_runtime189 = require("react/jsx-runtime");
|
|
@@ -7733,7 +7747,7 @@ var StyledBadgeContainer = import_styled_components41.default.div`
|
|
|
7733
7747
|
font-size: var(--wui-typography-label-4-size);
|
|
7734
7748
|
color: var(--wui-color-text-secondary);
|
|
7735
7749
|
`;
|
|
7736
|
-
var MenuItemButton = (0,
|
|
7750
|
+
var MenuItemButton = (0, import_react32.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
7737
7751
|
let { colorScheme, badge } = props;
|
|
7738
7752
|
if (appearance === "dangerous") {
|
|
7739
7753
|
if ((0, import_type_guards24.isNotUndefined)(colorScheme)) {
|
|
@@ -7793,7 +7807,6 @@ var MenuItemDescription = ({ children }) => {
|
|
|
7793
7807
|
var import_jsx_runtime191 = require("react/jsx-runtime");
|
|
7794
7808
|
var SubMenuContent = (0, import_styled_components43.default)(import_react_dropdown_menu3.DropdownMenuSubContent)`
|
|
7795
7809
|
${menuContentCss}
|
|
7796
|
-
width: 298px;
|
|
7797
7810
|
|
|
7798
7811
|
${mq.smAndDown} {
|
|
7799
7812
|
transform: translateX(-100%) !important;
|
|
@@ -7812,8 +7825,8 @@ var StyledSubTrigger = (0, import_styled_components43.default)(import_react_drop
|
|
|
7812
7825
|
`;
|
|
7813
7826
|
var SubMenuTrigger = (props) => {
|
|
7814
7827
|
const { isSmAndUp } = useMq();
|
|
7815
|
-
const
|
|
7816
|
-
return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
|
|
7828
|
+
const Trigger3 = isSmAndUp ? StyledSubTrigger : import_react_dropdown_menu3.DropdownMenuItem;
|
|
7829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(Trigger3, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
|
|
7817
7830
|
MenuItemButton,
|
|
7818
7831
|
{
|
|
7819
7832
|
...props,
|
|
@@ -7829,13 +7842,14 @@ var SubMenu = ({
|
|
|
7829
7842
|
...props
|
|
7830
7843
|
}) => {
|
|
7831
7844
|
const { isSmAndUp } = useMq();
|
|
7832
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
7845
|
+
const [isExpanded, setIsExpanded] = (0, import_react33.useState)(false);
|
|
7846
|
+
const { compact } = useMenuContext();
|
|
7833
7847
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
7834
7848
|
/* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
7835
7849
|
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(MenuItemLabel, { children: label }),
|
|
7836
7850
|
(0, import_type_guards25.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(MenuItemDescription, { children: description }) : null
|
|
7837
7851
|
] }),
|
|
7838
|
-
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(SubMenuContent, { children }) })
|
|
7852
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(SubMenuContent, { $compact: compact, children }) })
|
|
7839
7853
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
7840
7854
|
/* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(
|
|
7841
7855
|
SubMenuTrigger,
|
|
@@ -7857,10 +7871,10 @@ var SubMenu = ({
|
|
|
7857
7871
|
SubMenu.displayName = "SubMenu";
|
|
7858
7872
|
|
|
7859
7873
|
// src/components/Menu/MenuItem.tsx
|
|
7860
|
-
var
|
|
7874
|
+
var import_react34 = require("react");
|
|
7861
7875
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
7862
7876
|
var import_jsx_runtime192 = require("react/jsx-runtime");
|
|
7863
|
-
var MenuItem = (0,
|
|
7877
|
+
var MenuItem = (0, import_react34.forwardRef)(
|
|
7864
7878
|
({ onSelect = () => null, ...props }, ref) => {
|
|
7865
7879
|
return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7866
7880
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
@@ -8010,7 +8024,7 @@ var CheckboxMenuItem = ({
|
|
|
8010
8024
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
8011
8025
|
|
|
8012
8026
|
// src/components/Modal/Modal.tsx
|
|
8013
|
-
var
|
|
8027
|
+
var import_react38 = require("react");
|
|
8014
8028
|
var import_styled_components49 = __toESM(require("styled-components"));
|
|
8015
8029
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
8016
8030
|
var import_type_guards28 = require("@wistia/type-guards");
|
|
@@ -8093,19 +8107,19 @@ var ModalHeader = ({
|
|
|
8093
8107
|
};
|
|
8094
8108
|
|
|
8095
8109
|
// src/components/Modal/ModalContent.tsx
|
|
8096
|
-
var
|
|
8110
|
+
var import_react36 = require("react");
|
|
8097
8111
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
8098
8112
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
8099
8113
|
|
|
8100
8114
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
8101
|
-
var
|
|
8115
|
+
var import_react35 = require("react");
|
|
8102
8116
|
var import_type_guards27 = require("@wistia/type-guards");
|
|
8103
8117
|
var useFocusRestore = () => {
|
|
8104
|
-
const previouslyFocusedRef = (0,
|
|
8105
|
-
(0,
|
|
8118
|
+
const previouslyFocusedRef = (0, import_react35.useRef)(null);
|
|
8119
|
+
(0, import_react35.useEffect)(() => {
|
|
8106
8120
|
previouslyFocusedRef.current = document.activeElement;
|
|
8107
8121
|
}, []);
|
|
8108
|
-
(0,
|
|
8122
|
+
(0, import_react35.useEffect)(() => {
|
|
8109
8123
|
return () => {
|
|
8110
8124
|
if ((0, import_type_guards27.isNotNil)(previouslyFocusedRef.current)) {
|
|
8111
8125
|
setTimeout(() => {
|
|
@@ -8158,7 +8172,7 @@ var StyledModalContent = (0, import_styled_components47.default)(import_react_di
|
|
|
8158
8172
|
}
|
|
8159
8173
|
}
|
|
8160
8174
|
`;
|
|
8161
|
-
var ModalContent = (0,
|
|
8175
|
+
var ModalContent = (0, import_react36.forwardRef)(
|
|
8162
8176
|
({ fullHeight, width, children, ...otherProps }, ref) => {
|
|
8163
8177
|
useFocusRestore();
|
|
8164
8178
|
return /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(
|
|
@@ -8175,7 +8189,7 @@ var ModalContent = (0, import_react34.forwardRef)(
|
|
|
8175
8189
|
);
|
|
8176
8190
|
|
|
8177
8191
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
8178
|
-
var
|
|
8192
|
+
var import_react37 = require("react");
|
|
8179
8193
|
var import_styled_components48 = __toESM(require("styled-components"));
|
|
8180
8194
|
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
8181
8195
|
var backdropAnimationDuration = 150;
|
|
@@ -8213,7 +8227,7 @@ var BackdropComponent = import_styled_components48.default.div`
|
|
|
8213
8227
|
}
|
|
8214
8228
|
}
|
|
8215
8229
|
`;
|
|
8216
|
-
var Backdrop = (0,
|
|
8230
|
+
var Backdrop = (0, import_react37.forwardRef)(
|
|
8217
8231
|
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
8218
8232
|
BackdropComponent,
|
|
8219
8233
|
{
|
|
@@ -8234,7 +8248,7 @@ var ModalBody = import_styled_components49.default.div`
|
|
|
8234
8248
|
display: flex;
|
|
8235
8249
|
order: 2;
|
|
8236
8250
|
`;
|
|
8237
|
-
var Modal = (0,
|
|
8251
|
+
var Modal = (0, import_react38.forwardRef)(
|
|
8238
8252
|
({
|
|
8239
8253
|
children,
|
|
8240
8254
|
fullHeight = false,
|
|
@@ -8295,7 +8309,7 @@ var Modal = (0, import_react36.forwardRef)(
|
|
|
8295
8309
|
Modal.displayName = "Modal";
|
|
8296
8310
|
|
|
8297
8311
|
// src/components/Radio/Radio.tsx
|
|
8298
|
-
var
|
|
8312
|
+
var import_react39 = require("react");
|
|
8299
8313
|
var import_styled_components50 = __toESM(require("styled-components"));
|
|
8300
8314
|
var import_type_guards29 = require("@wistia/type-guards");
|
|
8301
8315
|
var import_jsx_runtime202 = require("react/jsx-runtime");
|
|
@@ -8369,7 +8383,7 @@ var StyledRadioWrapper = import_styled_components50.default.div`
|
|
|
8369
8383
|
|
|
8370
8384
|
${({ disabled }) => disabled && disabledStyle2};
|
|
8371
8385
|
`;
|
|
8372
|
-
var Radio = (0,
|
|
8386
|
+
var Radio = (0, import_react39.forwardRef)(
|
|
8373
8387
|
({
|
|
8374
8388
|
checked,
|
|
8375
8389
|
disabled = false,
|
|
@@ -8382,7 +8396,7 @@ var Radio = (0, import_react37.forwardRef)(
|
|
|
8382
8396
|
value = "false",
|
|
8383
8397
|
...otherProps
|
|
8384
8398
|
}, ref) => {
|
|
8385
|
-
const generatedId = (0,
|
|
8399
|
+
const generatedId = (0, import_react39.useId)();
|
|
8386
8400
|
const computedId = (0, import_type_guards29.isNonEmptyString)(id) ? id : `ui-radio-${generatedId}`;
|
|
8387
8401
|
return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(
|
|
8388
8402
|
StyledRadioWrapper,
|
|
@@ -8425,7 +8439,7 @@ var Radio = (0, import_react37.forwardRef)(
|
|
|
8425
8439
|
Radio.displayName = "Radio";
|
|
8426
8440
|
|
|
8427
8441
|
// src/components/Tag/Tag.tsx
|
|
8428
|
-
var
|
|
8442
|
+
var import_react40 = require("react");
|
|
8429
8443
|
var import_styled_components51 = __toESM(require("styled-components"));
|
|
8430
8444
|
var import_type_guards30 = require("@wistia/type-guards");
|
|
8431
8445
|
var import_jsx_runtime203 = require("react/jsx-runtime");
|
|
@@ -8531,7 +8545,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
8531
8545
|
)
|
|
8532
8546
|
] });
|
|
8533
8547
|
};
|
|
8534
|
-
var Tag = (0,
|
|
8548
|
+
var Tag = (0, import_react40.forwardRef)(
|
|
8535
8549
|
({ onClickRemove, colorScheme = "inherit", href, label, onClickRemoveLabel, ...otherProps }, ref) => {
|
|
8536
8550
|
const labelProps = (0, import_type_guards30.isNotNil)(href) && (0, import_type_guards30.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
8537
8551
|
return /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)(
|
|
@@ -8774,9 +8788,256 @@ var WistiaLogo = ({
|
|
|
8774
8788
|
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("a", { href, children: Logo }) : Logo;
|
|
8775
8789
|
};
|
|
8776
8790
|
WistiaLogo.displayName = "WistiaLogo";
|
|
8791
|
+
|
|
8792
|
+
// src/components/Select/Select.tsx
|
|
8793
|
+
var import_react_select = require("@radix-ui/react-select");
|
|
8794
|
+
var import_react41 = require("react");
|
|
8795
|
+
var import_styled_components54 = __toESM(require("styled-components"));
|
|
8796
|
+
var import_jsx_runtime206 = require("react/jsx-runtime");
|
|
8797
|
+
var StyledTrigger = (0, import_styled_components54.default)(import_react_select.Trigger)`
|
|
8798
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8799
|
+
--wui-select-color-bg: var(--wui-color-bg-surface);
|
|
8800
|
+
--wui-select-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
8801
|
+
--wui-select-color-border: var(--wui-color-border);
|
|
8802
|
+
--wui-select-color-border-focus: var(--wui-color-border-active);
|
|
8803
|
+
--wui-select-color-border-error: var(--wui-color-border-error);
|
|
8804
|
+
--wui-select-color-border-disabled: var(--wui-color-border-disabled);
|
|
8805
|
+
--wui-select-border-radius: var(--wui-border-radius-rounded);
|
|
8806
|
+
--wui-select-multiline-border-radius: var(--wui-border-radius-02);
|
|
8807
|
+
--wui-select-vertical-padding: var(--wui-space-02);
|
|
8808
|
+
--wui-select-horizontal-padding: var(--wui-space-03);
|
|
8809
|
+
--wui-select-placeholder: var(--wui-gray-10);
|
|
8810
|
+
--wui-select-color-text-error: var(--wui-color-text-error);
|
|
8811
|
+
|
|
8812
|
+
padding: var(--wui-select-vertical-padding) var(--wui-select-horizontal-padding);
|
|
8813
|
+
background-color: var(--wui-select-color-bg);
|
|
8814
|
+
border: 1px solid var(--wui-select-color-border);
|
|
8815
|
+
border-radius: var(--wui-select-border-radius);
|
|
8816
|
+
min-width: 200px;
|
|
8817
|
+
text-align: left;
|
|
8818
|
+
display: inline-flex;
|
|
8819
|
+
align-items: center;
|
|
8820
|
+
justify-content: space-between;
|
|
8821
|
+
width: ${({ $fullWidth = false }) => $fullWidth ? "100%" : "auto"};
|
|
8822
|
+
|
|
8823
|
+
&[aria-expanded='true'],
|
|
8824
|
+
&:focus {
|
|
8825
|
+
outline: 2px solid var(--wui-color-focus-ring);
|
|
8826
|
+
}
|
|
8827
|
+
|
|
8828
|
+
&[aria-invalid='true'] {
|
|
8829
|
+
outline: 2px solid var(--wui-select-color-border-error);
|
|
8830
|
+
color: var(--wui-select-color-text-error);
|
|
8831
|
+
}
|
|
8832
|
+
|
|
8833
|
+
&:disabled {
|
|
8834
|
+
border-color: var(--wui-color-bg-surface-disabled);
|
|
8835
|
+
background-color: var(--wui-color-bg-surface-disabled);
|
|
8836
|
+
}
|
|
8837
|
+
`;
|
|
8838
|
+
var StyledContent2 = (0, import_styled_components54.default)(import_react_select.Content)`
|
|
8839
|
+
--wui-select-content-border: var(--wui-color-border);
|
|
8840
|
+
--wui-select-content-bg: var(--wui-color-bg-surface);
|
|
8841
|
+
--wui-select-content-border-radius: var(--wui-border-radius-02);
|
|
8842
|
+
--wui-select-option-padding: var(--wui-space-02);
|
|
8843
|
+
--wui-select-option-inner-gap: var(--wui-space-03);
|
|
8844
|
+
--wui-select-option-bg-hover: var(--wui-color-bg-surface-hover);
|
|
8845
|
+
|
|
8846
|
+
overflow: hidden;
|
|
8847
|
+
transform: translateY(8px);
|
|
8848
|
+
background-color: var(--wui-select-content-bg);
|
|
8849
|
+
border: 1px solid var(--wui-select-content-border);
|
|
8850
|
+
border-radius: var(--wui-select-content-border-radius);
|
|
8851
|
+
padding: var(--wui-select-option-padding);
|
|
8852
|
+
min-width: 200px;
|
|
8853
|
+
`;
|
|
8854
|
+
var Select = (0, import_react41.forwardRef)(
|
|
8855
|
+
({
|
|
8856
|
+
colorScheme = "inherit",
|
|
8857
|
+
children,
|
|
8858
|
+
onChange = () => null,
|
|
8859
|
+
placeholder = "Select...",
|
|
8860
|
+
fullWidth = false,
|
|
8861
|
+
...props
|
|
8862
|
+
}, forwardedRef) => {
|
|
8863
|
+
const responsiveFullWidth = useResponsiveProp(fullWidth);
|
|
8864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(
|
|
8865
|
+
import_react_select.Root,
|
|
8866
|
+
{
|
|
8867
|
+
...props,
|
|
8868
|
+
onValueChange: onChange,
|
|
8869
|
+
children: [
|
|
8870
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(
|
|
8871
|
+
StyledTrigger,
|
|
8872
|
+
{
|
|
8873
|
+
ref: forwardedRef,
|
|
8874
|
+
$colorScheme: colorScheme,
|
|
8875
|
+
$fullWidth: responsiveFullWidth,
|
|
8876
|
+
...props,
|
|
8877
|
+
children: [
|
|
8878
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(import_react_select.Value, { placeholder }),
|
|
8879
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
8880
|
+
Icon,
|
|
8881
|
+
{
|
|
8882
|
+
size: "md",
|
|
8883
|
+
type: "caret-down"
|
|
8884
|
+
}
|
|
8885
|
+
)
|
|
8886
|
+
]
|
|
8887
|
+
}
|
|
8888
|
+
),
|
|
8889
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(import_react_select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(StyledContent2, { position: "popper", children: [
|
|
8890
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(import_react_select.ScrollUpButton, { children: /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(Icon, { type: "caret-up" }) }),
|
|
8891
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(import_react_select.Viewport, { children }),
|
|
8892
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(import_react_select.ScrollDownButton, { children: /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(Icon, { type: "caret-down" }) })
|
|
8893
|
+
] }) })
|
|
8894
|
+
]
|
|
8895
|
+
}
|
|
8896
|
+
);
|
|
8897
|
+
}
|
|
8898
|
+
);
|
|
8899
|
+
Select.displayName = "Select";
|
|
8900
|
+
|
|
8901
|
+
// src/components/Select/SelectOption.tsx
|
|
8902
|
+
var import_react_select2 = require("@radix-ui/react-select");
|
|
8903
|
+
var import_react42 = require("react");
|
|
8904
|
+
var import_styled_components55 = __toESM(require("styled-components"));
|
|
8905
|
+
var import_jsx_runtime207 = require("react/jsx-runtime");
|
|
8906
|
+
var StyledItem = (0, import_styled_components55.default)(import_react_select2.Item)`
|
|
8907
|
+
${variantStyleMap2.body3};
|
|
8908
|
+
display: flex;
|
|
8909
|
+
padding: var(--wui-select-option-padding);
|
|
8910
|
+
gap: var(--wui-select-option-inner-gap);
|
|
8911
|
+
font-size: var(--font-size);
|
|
8912
|
+
font-weight: var(--font-weight);
|
|
8913
|
+
border-radius: var(--wui-border-radius-01);
|
|
8914
|
+
|
|
8915
|
+
&:hover,
|
|
8916
|
+
&:focus-visible {
|
|
8917
|
+
background-color: var(--wui-select-option-bg-hover);
|
|
8918
|
+
outline: none;
|
|
8919
|
+
}
|
|
8920
|
+
|
|
8921
|
+
&[aria-disabled='true'] {
|
|
8922
|
+
color: var(--wui-color-text-disabled);
|
|
8923
|
+
}
|
|
8924
|
+
|
|
8925
|
+
&[aria-disabled='true']:hover {
|
|
8926
|
+
background-color: transparent;
|
|
8927
|
+
}
|
|
8928
|
+
`;
|
|
8929
|
+
var StyledIconContainer = import_styled_components55.default.span`
|
|
8930
|
+
width: 12px;
|
|
8931
|
+
`;
|
|
8932
|
+
var SelectOption = (0, import_react42.forwardRef)(
|
|
8933
|
+
({ children, ...props }, forwardedRef) => {
|
|
8934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)(
|
|
8935
|
+
StyledItem,
|
|
8936
|
+
{
|
|
8937
|
+
...props,
|
|
8938
|
+
ref: forwardedRef,
|
|
8939
|
+
children: [
|
|
8940
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(StyledIconContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(import_react_select2.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
8941
|
+
Icon,
|
|
8942
|
+
{
|
|
8943
|
+
size: "sm",
|
|
8944
|
+
type: "checkmark"
|
|
8945
|
+
}
|
|
8946
|
+
) }) }),
|
|
8947
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(import_react_select2.ItemText, { children })
|
|
8948
|
+
]
|
|
8949
|
+
}
|
|
8950
|
+
);
|
|
8951
|
+
}
|
|
8952
|
+
);
|
|
8953
|
+
SelectOption.displayName = "Option";
|
|
8954
|
+
|
|
8955
|
+
// src/components/Select/SelectOptionGroup.tsx
|
|
8956
|
+
var import_react_select3 = require("@radix-ui/react-select");
|
|
8957
|
+
var import_styled_components56 = __toESM(require("styled-components"));
|
|
8958
|
+
var import_jsx_runtime208 = require("react/jsx-runtime");
|
|
8959
|
+
var StyledLabel3 = (0, import_styled_components56.default)(import_react_select3.Label)`
|
|
8960
|
+
padding: var(--wui-select-option-padding);
|
|
8961
|
+
`;
|
|
8962
|
+
var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
8963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(import_react_select3.Group, { ...props, children: [
|
|
8964
|
+
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)(StyledLabel3, { children: /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
8965
|
+
Text,
|
|
8966
|
+
{
|
|
8967
|
+
prominence: "secondary",
|
|
8968
|
+
variant: "body3",
|
|
8969
|
+
children: label
|
|
8970
|
+
}
|
|
8971
|
+
) }),
|
|
8972
|
+
children
|
|
8973
|
+
] });
|
|
8974
|
+
};
|
|
8975
|
+
|
|
8976
|
+
// src/components/AnalyticsCards/AnalyticsCard.tsx
|
|
8977
|
+
var import_styled_components57 = __toESM(require("styled-components"));
|
|
8978
|
+
var import_type_guards32 = require("@wistia/type-guards");
|
|
8979
|
+
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
8980
|
+
var StyledAnalyticsCard = import_styled_components57.default.div`
|
|
8981
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
8982
|
+
display: grid;
|
|
8983
|
+
grid-template-areas: 'label slot' 'value value';
|
|
8984
|
+
grid-template-rows: auto auto;
|
|
8985
|
+
grid-template-columns: auto auto;
|
|
8986
|
+
gap: var(--wui-space-01);
|
|
8987
|
+
padding: var(--wui-space-03);
|
|
8988
|
+
background: var(--wui-color-bg-surface-secondary);
|
|
8989
|
+
flex: 1;
|
|
8990
|
+
border-radius: var(--wui-border-radius-02);
|
|
8991
|
+
`;
|
|
8992
|
+
var StyledLabel4 = (0, import_styled_components57.default)(Heading)`
|
|
8993
|
+
grid-area: label;
|
|
8994
|
+
`;
|
|
8995
|
+
var StyledValue = (0, import_styled_components57.default)(Heading)`
|
|
8996
|
+
grid-area: value;
|
|
8997
|
+
`;
|
|
8998
|
+
var StyledSlot = import_styled_components57.default.div`
|
|
8999
|
+
display: flex;
|
|
9000
|
+
justify-content: flex-end;
|
|
9001
|
+
grid-area: slot;
|
|
9002
|
+
align-self: center;
|
|
9003
|
+
`;
|
|
9004
|
+
var AnalyticsCard = ({
|
|
9005
|
+
label,
|
|
9006
|
+
value,
|
|
9007
|
+
slot,
|
|
9008
|
+
colorScheme = "inherit",
|
|
9009
|
+
...props
|
|
9010
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(
|
|
9011
|
+
StyledAnalyticsCard,
|
|
9012
|
+
{
|
|
9013
|
+
$colorScheme: colorScheme,
|
|
9014
|
+
...props,
|
|
9015
|
+
children: [
|
|
9016
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
9017
|
+
StyledLabel4,
|
|
9018
|
+
{
|
|
9019
|
+
renderAs: "dt",
|
|
9020
|
+
variant: "heading6",
|
|
9021
|
+
children: label
|
|
9022
|
+
}
|
|
9023
|
+
),
|
|
9024
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
9025
|
+
StyledValue,
|
|
9026
|
+
{
|
|
9027
|
+
renderAs: "dd",
|
|
9028
|
+
variant: "heading3",
|
|
9029
|
+
children: value
|
|
9030
|
+
}
|
|
9031
|
+
),
|
|
9032
|
+
(0, import_type_guards32.isNotNull)(slot) && /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(StyledSlot, { children: slot })
|
|
9033
|
+
]
|
|
9034
|
+
}
|
|
9035
|
+
);
|
|
9036
|
+
AnalyticsCard.displayName = "AnalyticsCard";
|
|
8777
9037
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8778
9038
|
0 && (module.exports = {
|
|
8779
9039
|
ActionButton,
|
|
9040
|
+
AnalyticsCard,
|
|
8780
9041
|
Avatar,
|
|
8781
9042
|
Badge,
|
|
8782
9043
|
Box,
|
|
@@ -8812,6 +9073,9 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
8812
9073
|
RadioGroup,
|
|
8813
9074
|
RadioMenuItem,
|
|
8814
9075
|
ScreenReaderOnly,
|
|
9076
|
+
Select,
|
|
9077
|
+
SelectOption,
|
|
9078
|
+
SelectOptionGroup,
|
|
8815
9079
|
Stack,
|
|
8816
9080
|
SubMenu,
|
|
8817
9081
|
Tag,
|