@wistia/ui 0.0.2 → 0.0.4

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.d.cts CHANGED
@@ -17,6 +17,19 @@ declare const UIProvider: ({ children }: UIProviderProps) => react_jsx_runtime.J
17
17
  */
18
18
  declare const copyToClipboard: (textToCopy: string) => Promise<void>;
19
19
 
20
+ declare const mq: {
21
+ xsAndUp: () => string;
22
+ smAndUp: () => string;
23
+ mdAndUp: () => string;
24
+ lgAndUp: () => string;
25
+ xlAndUp: () => string;
26
+ xsAndDown: () => string;
27
+ smAndDown: () => string;
28
+ mdAndDown: () => string;
29
+ lgAndDown: () => string;
30
+ xlAndDown: () => string;
31
+ };
32
+
20
33
  type MediaQueryBooleans = {
21
34
  isXlAndUp: boolean;
22
35
  isLgAndUp: boolean;
@@ -1006,4 +1019,4 @@ declare const WistiaLogo: {
1006
1019
  displayName: string;
1007
1020
  };
1008
1021
 
1009
- export { Box, Button, ButtonGroup, type ButtonProps, Divider, Ellipsis, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Link, type LinkProps, ScreenReaderOnly, Stack, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, useActiveMq, useAriaLive, useMq, useWindowSize };
1022
+ export { Box, Button, ButtonGroup, type ButtonProps, Divider, Ellipsis, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Link, type LinkProps, ScreenReaderOnly, Stack, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useMq, useWindowSize };
package/dist/index.d.ts CHANGED
@@ -17,6 +17,19 @@ declare const UIProvider: ({ children }: UIProviderProps) => react_jsx_runtime.J
17
17
  */
18
18
  declare const copyToClipboard: (textToCopy: string) => Promise<void>;
19
19
 
20
+ declare const mq: {
21
+ xsAndUp: () => string;
22
+ smAndUp: () => string;
23
+ mdAndUp: () => string;
24
+ lgAndUp: () => string;
25
+ xlAndUp: () => string;
26
+ xsAndDown: () => string;
27
+ smAndDown: () => string;
28
+ mdAndDown: () => string;
29
+ lgAndDown: () => string;
30
+ xlAndDown: () => string;
31
+ };
32
+
20
33
  type MediaQueryBooleans = {
21
34
  isXlAndUp: boolean;
22
35
  isLgAndUp: boolean;
@@ -1006,4 +1019,4 @@ declare const WistiaLogo: {
1006
1019
  displayName: string;
1007
1020
  };
1008
1021
 
1009
- export { Box, Button, ButtonGroup, type ButtonProps, Divider, Ellipsis, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Link, type LinkProps, ScreenReaderOnly, Stack, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, useActiveMq, useAriaLive, useMq, useWindowSize };
1022
+ export { Box, Button, ButtonGroup, type ButtonProps, Divider, Ellipsis, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Link, type LinkProps, ScreenReaderOnly, Stack, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useMq, useWindowSize };
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.0.2
3
+ * @license @wistia/ui v0.0.4
4
4
  *
5
5
  * Copyright (c) 2024-2024, Wistia, Inc. and its affiliates.
6
6
  *
@@ -1243,6 +1243,52 @@ var copyToClipboard = async (textToCopy) => {
1243
1243
  });
1244
1244
  };
1245
1245
 
1246
+ // src/helpers/mq/mq.ts
1247
+ import { getValueAndUnit } from "polished";
1248
+
1249
+ // src/css/breakpoints.ts
1250
+ var breakpoints = {
1251
+ xs: "0em",
1252
+ // 0px
1253
+ sm: "37.5em",
1254
+ // 600px
1255
+ md: "56.5625em",
1256
+ // ~904px
1257
+ lg: "77.5em",
1258
+ // 1240px
1259
+ xl: "90em"
1260
+ // 1440px
1261
+ };
1262
+
1263
+ // src/helpers/mq/mq.ts
1264
+ var getMaxWidth = (breakpoint) => {
1265
+ const breakpointBuffer = 25e-4;
1266
+ const [value, unit] = getValueAndUnit(breakpoint);
1267
+ return `@media (max-width: ${Math.max(value - breakpointBuffer, 0)}${unit})`;
1268
+ };
1269
+ var xsAndUp = () => `@media (min-width: ${breakpoints.xs})`;
1270
+ var smAndUp = () => `@media (min-width: ${breakpoints.sm})`;
1271
+ var mdAndUp = () => `@media (min-width: ${breakpoints.md})`;
1272
+ var lgAndUp = () => `@media (min-width: ${breakpoints.lg})`;
1273
+ var xlAndUp = () => `@media (min-width: ${breakpoints.xl})`;
1274
+ var xsAndDown = () => getMaxWidth(breakpoints.xs);
1275
+ var smAndDown = () => getMaxWidth(breakpoints.sm);
1276
+ var mdAndDown = () => getMaxWidth(breakpoints.md);
1277
+ var lgAndDown = () => getMaxWidth(breakpoints.lg);
1278
+ var xlAndDown = () => getMaxWidth(breakpoints.xl);
1279
+ var mq = {
1280
+ xsAndUp,
1281
+ smAndUp,
1282
+ mdAndUp,
1283
+ lgAndUp,
1284
+ xlAndUp,
1285
+ xsAndDown,
1286
+ smAndDown,
1287
+ mdAndDown,
1288
+ lgAndDown,
1289
+ xlAndDown
1290
+ };
1291
+
1246
1292
  // src/hooks/useMq/useMq.ts
1247
1293
  import { isBoolean } from "@wistia/type-guards";
1248
1294
 
@@ -1273,20 +1319,6 @@ var useWindowSize = (interval = 0) => {
1273
1319
  return dimensions;
1274
1320
  };
1275
1321
 
1276
- // src/css/breakpoints.ts
1277
- var breakpoints = {
1278
- xs: "0em",
1279
- // 0px
1280
- sm: "37.5em",
1281
- // 600px
1282
- md: "56.5625em",
1283
- // ~904px
1284
- lg: "77.5em",
1285
- // 1240px
1286
- xl: "90em"
1287
- // 1440px
1288
- };
1289
-
1290
1322
  // src/hooks/useMq/useMq.ts
1291
1323
  var REM_SIZE = 16;
1292
1324
  var useMq = () => {
@@ -1661,7 +1693,7 @@ var buttonSizeStyles = {
1661
1693
  hero: buttonHeroStyles
1662
1694
  };
1663
1695
 
1664
- // src/helpers/getColorScheme/getColorScheme.ts
1696
+ // src/private/getColorScheme/getColorScheme.ts
1665
1697
  import { css as css11 } from "styled-components";
1666
1698
  var colorSchemeSchema = [
1667
1699
  { token: "bg-surface", step: "surface" },
@@ -4941,7 +4973,7 @@ var isButton = (props) => isUndefined2(props.href);
4941
4973
  var isLink = (props) => isNotUndefined2(props.href);
4942
4974
  var StyledLink = styled2.a`
4943
4975
  ${({ href }) => isNil5(href) && buttonResetCss};
4944
- ${({ colorScheme }) => getColorScheme(colorScheme)}
4976
+ ${({ $colorScheme }) => getColorScheme($colorScheme)}
4945
4977
  cursor: pointer;
4946
4978
  font-family: var(--typography-family-default);
4947
4979
  color: var(--color-text-link);
@@ -4980,7 +5012,7 @@ var Link = forwardRef(
4980
5012
  }
4981
5013
  };
4982
5014
  const commonProps = {
4983
- colorScheme,
5015
+ $colorScheme: colorScheme,
4984
5016
  $underline: underline,
4985
5017
  onClick: handleClick
4986
5018
  };
@@ -4999,14 +5031,25 @@ var Link = forwardRef(
4999
5031
  }
5000
5032
  if (isLink(props)) {
5001
5033
  const externalLinkProps = type === "external" ? { target: "_blank", rel: "noopener noreferrer" } : null;
5002
- return /* @__PURE__ */ jsx157(
5034
+ const combinedProps = {
5035
+ ref,
5036
+ ...props,
5037
+ ...commonProps,
5038
+ ...externalLinkProps
5039
+ };
5040
+ return inRouterContext && type !== "external" ? /* @__PURE__ */ jsx157(
5003
5041
  StyledLink,
5004
5042
  {
5005
- ref,
5006
- as: inRouterContext ? RouterLink : "a",
5007
- ...props,
5008
- ...commonProps,
5009
- ...externalLinkProps,
5043
+ as: RouterLink,
5044
+ ...combinedProps,
5045
+ to: to ?? "",
5046
+ children
5047
+ }
5048
+ ) : /* @__PURE__ */ jsx157(
5049
+ StyledLink,
5050
+ {
5051
+ as: "a",
5052
+ ...combinedProps,
5010
5053
  href: to,
5011
5054
  children
5012
5055
  }
@@ -5150,38 +5193,6 @@ Button.displayName = "Button";
5150
5193
  // src/components/ButtonGroup/ButtonGroup.tsx
5151
5194
  import styled4 from "styled-components";
5152
5195
  import { isNil as isNil6 } from "@wistia/type-guards";
5153
-
5154
- // src/helpers/mq/mq.ts
5155
- import { getValueAndUnit } from "polished";
5156
- var getMaxWidth = (breakpoint) => {
5157
- const breakpointBuffer = 25e-4;
5158
- const [value, unit] = getValueAndUnit(breakpoint);
5159
- return `@media (max-width: ${Math.max(value - breakpointBuffer, 0)}${unit})`;
5160
- };
5161
- var xsAndUp = () => `@media (min-width: ${breakpoints.xs})`;
5162
- var smAndUp = () => `@media (min-width: ${breakpoints.sm})`;
5163
- var mdAndUp = () => `@media (min-width: ${breakpoints.md})`;
5164
- var lgAndUp = () => `@media (min-width: ${breakpoints.lg})`;
5165
- var xlAndUp = () => `@media (min-width: ${breakpoints.xl})`;
5166
- var xsAndDown = () => getMaxWidth(breakpoints.xs);
5167
- var smAndDown = () => getMaxWidth(breakpoints.sm);
5168
- var mdAndDown = () => getMaxWidth(breakpoints.md);
5169
- var lgAndDown = () => getMaxWidth(breakpoints.lg);
5170
- var xlAndDown = () => getMaxWidth(breakpoints.xl);
5171
- var mq = {
5172
- xsAndUp,
5173
- smAndUp,
5174
- mdAndUp,
5175
- lgAndUp,
5176
- xlAndUp,
5177
- xsAndDown,
5178
- smAndDown,
5179
- mdAndDown,
5180
- lgAndDown,
5181
- xlAndDown
5182
- };
5183
-
5184
- // src/components/ButtonGroup/ButtonGroup.tsx
5185
5196
  import { jsx as jsx159 } from "react/jsx-runtime";
5186
5197
  var getAlignment = (align) => {
5187
5198
  if (align === "center") {
@@ -5946,6 +5957,7 @@ export {
5946
5957
  ellipsisFlexParentStyle,
5947
5958
  ellipsisStyle,
5948
5959
  iconSizeMap,
5960
+ mq,
5949
5961
  useActiveMq,
5950
5962
  useAriaLive,
5951
5963
  useMq,