@wistia/ui 0.4.12 → 0.4.13-beta.e9d42e46.8e8935e
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 +181 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +73 -1
- package/dist/index.d.ts +73 -1
- package/dist/index.mjs +178 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2135,4 +2135,76 @@ type SelectOptionGroupProps = {
|
|
|
2135
2135
|
};
|
|
2136
2136
|
declare const SelectOptionGroup: ({ children, label, ...props }: SelectOptionGroupProps) => react_jsx_runtime.JSX.Element;
|
|
2137
2137
|
|
|
2138
|
-
|
|
2138
|
+
type DataCardProps = ComponentPropsWithoutRef<'div'> & {
|
|
2139
|
+
/**
|
|
2140
|
+
* Label text displayed above the value
|
|
2141
|
+
*/
|
|
2142
|
+
label: ReactNode;
|
|
2143
|
+
/**
|
|
2144
|
+
* Main value to display in the card
|
|
2145
|
+
*/
|
|
2146
|
+
value: ReactNode;
|
|
2147
|
+
/**
|
|
2148
|
+
* Optional content to display in the top-right corner
|
|
2149
|
+
*/
|
|
2150
|
+
upperRightSlot?: ReactNode;
|
|
2151
|
+
/**
|
|
2152
|
+
* Sets the color scheme of the card
|
|
2153
|
+
*/
|
|
2154
|
+
colorScheme?: ColorSchemeTypes;
|
|
2155
|
+
/**
|
|
2156
|
+
* Controls the loading state of the card
|
|
2157
|
+
*/
|
|
2158
|
+
isLoading?: boolean;
|
|
2159
|
+
/**
|
|
2160
|
+
* Optional trend arrow to display below the value. Use the `DataCardTrend` component to create this.
|
|
2161
|
+
*/
|
|
2162
|
+
trend?: JSX.Element;
|
|
2163
|
+
};
|
|
2164
|
+
/**
|
|
2165
|
+
* A single DataCard for use in the DataCards component
|
|
2166
|
+
*/
|
|
2167
|
+
declare const DataCard: {
|
|
2168
|
+
({ label, value, upperRightSlot, colorScheme, isLoading, trend, ...props }: DataCardProps): JSX.Element;
|
|
2169
|
+
displayName: string;
|
|
2170
|
+
};
|
|
2171
|
+
|
|
2172
|
+
type DataCardsProps = ComponentPropsWithoutRef<'dl'> & {
|
|
2173
|
+
/**
|
|
2174
|
+
* Should be at least one `DataCard` component
|
|
2175
|
+
*/
|
|
2176
|
+
children: ReactNode;
|
|
2177
|
+
/**
|
|
2178
|
+
* Max width of the child cards
|
|
2179
|
+
*/
|
|
2180
|
+
cardMaxWidth?: number | undefined;
|
|
2181
|
+
/**
|
|
2182
|
+
* Sets the color scheme of the cards, can be overriden at the card level
|
|
2183
|
+
*/
|
|
2184
|
+
colorScheme?: ColorSchemeTypes;
|
|
2185
|
+
};
|
|
2186
|
+
/**
|
|
2187
|
+
* Displays a series of cards tailor made for displaying analytics data
|
|
2188
|
+
*/
|
|
2189
|
+
declare const DataCards: {
|
|
2190
|
+
({ children, cardMaxWidth, colorScheme, ...props }: DataCardsProps): JSX.Element;
|
|
2191
|
+
displayName: string;
|
|
2192
|
+
};
|
|
2193
|
+
|
|
2194
|
+
type DataCardTrendProps = {
|
|
2195
|
+
/**
|
|
2196
|
+
* Direction of the trend arrow
|
|
2197
|
+
*/
|
|
2198
|
+
direction?: 'down' | 'up';
|
|
2199
|
+
/**
|
|
2200
|
+
* Outlook of the trend arrow
|
|
2201
|
+
*/
|
|
2202
|
+
outlook?: 'negative' | 'positive';
|
|
2203
|
+
/**
|
|
2204
|
+
* Content to display next to the trend arrow
|
|
2205
|
+
*/
|
|
2206
|
+
children: JSX.Element | string;
|
|
2207
|
+
};
|
|
2208
|
+
declare const DataCardTrend: ({ direction, outlook, children, ...props }: DataCardTrendProps) => JSX.Element;
|
|
2209
|
+
|
|
2210
|
+
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Checkbox, CheckboxGroup, CheckboxMenuItem, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, Ellipsis, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useMq, useToast, useWindowSize };
|
package/dist/index.d.ts
CHANGED
|
@@ -2135,4 +2135,76 @@ type SelectOptionGroupProps = {
|
|
|
2135
2135
|
};
|
|
2136
2136
|
declare const SelectOptionGroup: ({ children, label, ...props }: SelectOptionGroupProps) => react_jsx_runtime.JSX.Element;
|
|
2137
2137
|
|
|
2138
|
-
|
|
2138
|
+
type DataCardProps = ComponentPropsWithoutRef<'div'> & {
|
|
2139
|
+
/**
|
|
2140
|
+
* Label text displayed above the value
|
|
2141
|
+
*/
|
|
2142
|
+
label: ReactNode;
|
|
2143
|
+
/**
|
|
2144
|
+
* Main value to display in the card
|
|
2145
|
+
*/
|
|
2146
|
+
value: ReactNode;
|
|
2147
|
+
/**
|
|
2148
|
+
* Optional content to display in the top-right corner
|
|
2149
|
+
*/
|
|
2150
|
+
upperRightSlot?: ReactNode;
|
|
2151
|
+
/**
|
|
2152
|
+
* Sets the color scheme of the card
|
|
2153
|
+
*/
|
|
2154
|
+
colorScheme?: ColorSchemeTypes;
|
|
2155
|
+
/**
|
|
2156
|
+
* Controls the loading state of the card
|
|
2157
|
+
*/
|
|
2158
|
+
isLoading?: boolean;
|
|
2159
|
+
/**
|
|
2160
|
+
* Optional trend arrow to display below the value. Use the `DataCardTrend` component to create this.
|
|
2161
|
+
*/
|
|
2162
|
+
trend?: JSX.Element;
|
|
2163
|
+
};
|
|
2164
|
+
/**
|
|
2165
|
+
* A single DataCard for use in the DataCards component
|
|
2166
|
+
*/
|
|
2167
|
+
declare const DataCard: {
|
|
2168
|
+
({ label, value, upperRightSlot, colorScheme, isLoading, trend, ...props }: DataCardProps): JSX.Element;
|
|
2169
|
+
displayName: string;
|
|
2170
|
+
};
|
|
2171
|
+
|
|
2172
|
+
type DataCardsProps = ComponentPropsWithoutRef<'dl'> & {
|
|
2173
|
+
/**
|
|
2174
|
+
* Should be at least one `DataCard` component
|
|
2175
|
+
*/
|
|
2176
|
+
children: ReactNode;
|
|
2177
|
+
/**
|
|
2178
|
+
* Max width of the child cards
|
|
2179
|
+
*/
|
|
2180
|
+
cardMaxWidth?: number | undefined;
|
|
2181
|
+
/**
|
|
2182
|
+
* Sets the color scheme of the cards, can be overriden at the card level
|
|
2183
|
+
*/
|
|
2184
|
+
colorScheme?: ColorSchemeTypes;
|
|
2185
|
+
};
|
|
2186
|
+
/**
|
|
2187
|
+
* Displays a series of cards tailor made for displaying analytics data
|
|
2188
|
+
*/
|
|
2189
|
+
declare const DataCards: {
|
|
2190
|
+
({ children, cardMaxWidth, colorScheme, ...props }: DataCardsProps): JSX.Element;
|
|
2191
|
+
displayName: string;
|
|
2192
|
+
};
|
|
2193
|
+
|
|
2194
|
+
type DataCardTrendProps = {
|
|
2195
|
+
/**
|
|
2196
|
+
* Direction of the trend arrow
|
|
2197
|
+
*/
|
|
2198
|
+
direction?: 'down' | 'up';
|
|
2199
|
+
/**
|
|
2200
|
+
* Outlook of the trend arrow
|
|
2201
|
+
*/
|
|
2202
|
+
outlook?: 'negative' | 'positive';
|
|
2203
|
+
/**
|
|
2204
|
+
* Content to display next to the trend arrow
|
|
2205
|
+
*/
|
|
2206
|
+
children: JSX.Element | string;
|
|
2207
|
+
};
|
|
2208
|
+
declare const DataCardTrend: ({ direction, outlook, children, ...props }: DataCardTrendProps) => JSX.Element;
|
|
2209
|
+
|
|
2210
|
+
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Checkbox, CheckboxGroup, CheckboxMenuItem, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, Ellipsis, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useMq, useToast, useWindowSize };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.4.
|
|
3
|
+
* @license @wistia/ui v0.4.13-beta.e9d42e46.8e8935e
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -146,6 +146,10 @@ var globalStyleAdjustmentsCss = css2`
|
|
|
146
146
|
-moz-osx-font-smoothing: grayscale; /* 1 */
|
|
147
147
|
-webkit-font-smoothing: antialiased; /* 2 */
|
|
148
148
|
}
|
|
149
|
+
|
|
150
|
+
* {
|
|
151
|
+
margin: 0;
|
|
152
|
+
}
|
|
149
153
|
`;
|
|
150
154
|
|
|
151
155
|
// src/css/designTokens/index.tsx
|
|
@@ -9101,6 +9105,176 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
9101
9105
|
children
|
|
9102
9106
|
] });
|
|
9103
9107
|
};
|
|
9108
|
+
|
|
9109
|
+
// src/components/DataCards/DataCard.tsx
|
|
9110
|
+
import styled47, { keyframes as keyframes2 } from "styled-components";
|
|
9111
|
+
import { isNotNull } from "@wistia/type-guards";
|
|
9112
|
+
import { jsx as jsx210, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9113
|
+
var StyledDataCard = styled47.div`
|
|
9114
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
9115
|
+
display: grid;
|
|
9116
|
+
grid-template-areas: 'label slot' 'value value';
|
|
9117
|
+
grid-template-rows: auto auto;
|
|
9118
|
+
grid-template-columns: auto auto;
|
|
9119
|
+
gap: var(--wui-space-01);
|
|
9120
|
+
padding: var(--wui-space-03);
|
|
9121
|
+
background: var(--wui-color-bg-surface-secondary);
|
|
9122
|
+
flex: 1;
|
|
9123
|
+
border-radius: var(--wui-border-radius-02);
|
|
9124
|
+
position: relative;
|
|
9125
|
+
`;
|
|
9126
|
+
var shimmer = keyframes2`
|
|
9127
|
+
0% {
|
|
9128
|
+
background-position: 200% 0;
|
|
9129
|
+
}
|
|
9130
|
+
100% {
|
|
9131
|
+
background-position: -200% 0;
|
|
9132
|
+
}
|
|
9133
|
+
`;
|
|
9134
|
+
var LoadingBackground = styled47.div`
|
|
9135
|
+
background: linear-gradient(
|
|
9136
|
+
90deg,
|
|
9137
|
+
var(--wui-color-bg-surface-tertiary) 25%,
|
|
9138
|
+
var(--wui-color-bg-surface-secondary) 37%,
|
|
9139
|
+
var(--wui-color-bg-surface-tertiary) 63%
|
|
9140
|
+
);
|
|
9141
|
+
background-size: 200% 100%;
|
|
9142
|
+
animation: ${shimmer} 1.5s infinite;
|
|
9143
|
+
border-radius: var(--wui-border-radius-01);
|
|
9144
|
+
`;
|
|
9145
|
+
var StyledLoadingLabel = styled47(LoadingBackground)`
|
|
9146
|
+
width: 80px;
|
|
9147
|
+
height: var(--wui-typography-heading-6-line-height);
|
|
9148
|
+
`;
|
|
9149
|
+
var StyledLoadingValue = styled47(LoadingBackground)`
|
|
9150
|
+
width: 90%;
|
|
9151
|
+
height: var(--wui-typography-heading-3-line-height);
|
|
9152
|
+
`;
|
|
9153
|
+
var StyledLabel4 = styled47(Heading)`
|
|
9154
|
+
grid-area: label;
|
|
9155
|
+
`;
|
|
9156
|
+
var StyledValue = styled47(Heading)`
|
|
9157
|
+
grid-area: value;
|
|
9158
|
+
`;
|
|
9159
|
+
var StyledSlot = styled47.div`
|
|
9160
|
+
display: flex;
|
|
9161
|
+
justify-content: flex-end;
|
|
9162
|
+
grid-area: slot;
|
|
9163
|
+
align-self: center;
|
|
9164
|
+
`;
|
|
9165
|
+
var StyledDataCardTrendContainer = styled47.div`
|
|
9166
|
+
position: absolute;
|
|
9167
|
+
bottom: var(--wui-space-01);
|
|
9168
|
+
right: var(--wui-space-01);
|
|
9169
|
+
`;
|
|
9170
|
+
var DataCard = ({
|
|
9171
|
+
label,
|
|
9172
|
+
value,
|
|
9173
|
+
upperRightSlot,
|
|
9174
|
+
colorScheme = "inherit",
|
|
9175
|
+
isLoading = false,
|
|
9176
|
+
trend,
|
|
9177
|
+
...props
|
|
9178
|
+
}) => /* @__PURE__ */ jsxs31(
|
|
9179
|
+
StyledDataCard,
|
|
9180
|
+
{
|
|
9181
|
+
$colorScheme: colorScheme,
|
|
9182
|
+
...props,
|
|
9183
|
+
children: [
|
|
9184
|
+
/* @__PURE__ */ jsx210(
|
|
9185
|
+
StyledLabel4,
|
|
9186
|
+
{
|
|
9187
|
+
renderAs: "dt",
|
|
9188
|
+
variant: "heading6",
|
|
9189
|
+
children: isLoading ? /* @__PURE__ */ jsx210(StyledLoadingLabel, {}) : label
|
|
9190
|
+
}
|
|
9191
|
+
),
|
|
9192
|
+
/* @__PURE__ */ jsx210(
|
|
9193
|
+
StyledValue,
|
|
9194
|
+
{
|
|
9195
|
+
renderAs: "dd",
|
|
9196
|
+
variant: "heading3",
|
|
9197
|
+
children: isLoading ? /* @__PURE__ */ jsx210(StyledLoadingValue, {}) : value
|
|
9198
|
+
}
|
|
9199
|
+
),
|
|
9200
|
+
isNotNull(upperRightSlot) && !isLoading && /* @__PURE__ */ jsx210(StyledSlot, { children: upperRightSlot }),
|
|
9201
|
+
isNotNull(trend) && !isLoading && /* @__PURE__ */ jsx210(StyledDataCardTrendContainer, { children: trend })
|
|
9202
|
+
]
|
|
9203
|
+
}
|
|
9204
|
+
);
|
|
9205
|
+
DataCard.displayName = "DataCard";
|
|
9206
|
+
|
|
9207
|
+
// src/components/DataCards/DataCards.tsx
|
|
9208
|
+
import styled48 from "styled-components";
|
|
9209
|
+
import { isNotUndefined as isNotUndefined9 } from "@wistia/type-guards";
|
|
9210
|
+
import { jsx as jsx211 } from "react/jsx-runtime";
|
|
9211
|
+
var StyledDataCards = styled48(Box)`
|
|
9212
|
+
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
9213
|
+
> * {
|
|
9214
|
+
min-width: 120px;
|
|
9215
|
+
max-width: ${({ $cardMaxWidth }) => isNotUndefined9($cardMaxWidth) ? `${$cardMaxWidth}px` : "none"};
|
|
9216
|
+
}
|
|
9217
|
+
`;
|
|
9218
|
+
var DataCards = ({
|
|
9219
|
+
children,
|
|
9220
|
+
cardMaxWidth,
|
|
9221
|
+
colorScheme = "inherit",
|
|
9222
|
+
...props
|
|
9223
|
+
}) => {
|
|
9224
|
+
return /* @__PURE__ */ jsx211(
|
|
9225
|
+
StyledDataCards,
|
|
9226
|
+
{
|
|
9227
|
+
...props,
|
|
9228
|
+
$cardMaxWidth: cardMaxWidth,
|
|
9229
|
+
$colorScheme: colorScheme,
|
|
9230
|
+
direction: "row",
|
|
9231
|
+
fill: "horizontal",
|
|
9232
|
+
gap: "space-02",
|
|
9233
|
+
renderAs: "dl",
|
|
9234
|
+
wrapItems: true,
|
|
9235
|
+
children
|
|
9236
|
+
}
|
|
9237
|
+
);
|
|
9238
|
+
};
|
|
9239
|
+
DataCards.displayName = "DataCards";
|
|
9240
|
+
|
|
9241
|
+
// src/components/DataCards/DataCardTrend.tsx
|
|
9242
|
+
import styled49 from "styled-components";
|
|
9243
|
+
import { jsx as jsx212, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
9244
|
+
var StyledDataCardTrend = styled49.div`
|
|
9245
|
+
${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
|
|
9246
|
+
background: var(--wui-color-bg-app);
|
|
9247
|
+
border-radius: var(--wui-border-radius-rounded);
|
|
9248
|
+
padding: var(--wui-space-01);
|
|
9249
|
+
display: flex;
|
|
9250
|
+
align-items: center;
|
|
9251
|
+
gap: 2px;
|
|
9252
|
+
`;
|
|
9253
|
+
var DataCardTrend = ({
|
|
9254
|
+
direction = "up",
|
|
9255
|
+
outlook = "positive",
|
|
9256
|
+
children,
|
|
9257
|
+
...props
|
|
9258
|
+
}) => {
|
|
9259
|
+
return /* @__PURE__ */ jsxs32(StyledDataCardTrend, { $outlook: outlook, children: [
|
|
9260
|
+
/* @__PURE__ */ jsx212(
|
|
9261
|
+
Icon,
|
|
9262
|
+
{
|
|
9263
|
+
size: "md",
|
|
9264
|
+
type: direction === "up" ? "arrow-up" : "arrow-down",
|
|
9265
|
+
...props
|
|
9266
|
+
}
|
|
9267
|
+
),
|
|
9268
|
+
/* @__PURE__ */ jsx212(
|
|
9269
|
+
Text,
|
|
9270
|
+
{
|
|
9271
|
+
prominence: "secondary",
|
|
9272
|
+
variant: "label4",
|
|
9273
|
+
children
|
|
9274
|
+
}
|
|
9275
|
+
)
|
|
9276
|
+
] });
|
|
9277
|
+
};
|
|
9104
9278
|
export {
|
|
9105
9279
|
ActionButton,
|
|
9106
9280
|
Avatar,
|
|
@@ -9115,6 +9289,9 @@ export {
|
|
|
9115
9289
|
CheckboxGroup,
|
|
9116
9290
|
CheckboxMenuItem,
|
|
9117
9291
|
ColorSchemeWrapper,
|
|
9292
|
+
DataCard,
|
|
9293
|
+
DataCardTrend,
|
|
9294
|
+
DataCards,
|
|
9118
9295
|
Divider,
|
|
9119
9296
|
Ellipsis,
|
|
9120
9297
|
Form,
|