@artsy/palette 46.3.0 → 46.4.0

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.
Files changed (94) hide show
  1. package/dist/cjs/elements/BaseTabs/BaseTab.d.ts +18 -3
  2. package/dist/cjs/elements/BaseTabs/BaseTab.js +7 -8
  3. package/dist/cjs/elements/BaseTabs/BaseTab.js.map +1 -1
  4. package/dist/cjs/elements/BorderBox/BorderBox.d.ts +4 -2
  5. package/dist/cjs/elements/BorderBox/BorderBox.js +4 -5
  6. package/dist/cjs/elements/BorderBox/BorderBox.js.map +1 -1
  7. package/dist/cjs/elements/BorderBox/BorderBoxBase.d.ts +8 -2
  8. package/dist/cjs/elements/BorderBox/BorderBoxBase.js +4 -5
  9. package/dist/cjs/elements/BorderBox/BorderBoxBase.js.map +1 -1
  10. package/dist/cjs/elements/Carousel/Carousel.d.ts +8 -4
  11. package/dist/cjs/elements/Carousel/Carousel.js +8 -10
  12. package/dist/cjs/elements/Carousel/Carousel.js.map +1 -1
  13. package/dist/cjs/elements/Carousel/CarouselNavigation.d.ts +22 -6
  14. package/dist/cjs/elements/Carousel/CarouselNavigation.js +5 -10
  15. package/dist/cjs/elements/Carousel/CarouselNavigation.js.map +1 -1
  16. package/dist/cjs/elements/Clickable/Clickable.d.ts +3 -1
  17. package/dist/cjs/elements/Clickable/Clickable.js +4 -5
  18. package/dist/cjs/elements/Clickable/Clickable.js.map +1 -1
  19. package/dist/cjs/elements/Flex/Flex.d.ts +4 -2
  20. package/dist/cjs/elements/Flex/Flex.js +3 -4
  21. package/dist/cjs/elements/Flex/Flex.js.map +1 -1
  22. package/dist/cjs/elements/FullBleed/FullBleed.d.ts +4 -2
  23. package/dist/cjs/elements/FullBleed/FullBleed.js +9 -10
  24. package/dist/cjs/elements/FullBleed/FullBleed.js.map +1 -1
  25. package/dist/cjs/elements/GridColumns/GridColumns.d.ts +4 -2
  26. package/dist/cjs/elements/GridColumns/GridColumns.js +4 -5
  27. package/dist/cjs/elements/GridColumns/GridColumns.js.map +1 -1
  28. package/dist/cjs/elements/HTML/HTML.js +3 -4
  29. package/dist/cjs/elements/HTML/HTML.js.map +1 -1
  30. package/dist/cjs/elements/Link/Link.d.ts +3 -1
  31. package/dist/cjs/elements/Link/Link.js +3 -4
  32. package/dist/cjs/elements/Link/Link.js.map +1 -1
  33. package/dist/cjs/elements/Pill/Pill.js +0 -3
  34. package/dist/cjs/elements/Pill/Pill.js.map +1 -1
  35. package/dist/cjs/elements/Range/Range.js +3 -4
  36. package/dist/cjs/elements/Range/Range.js.map +1 -1
  37. package/dist/cjs/elements/Separator/Separator.d.ts +3 -1
  38. package/dist/cjs/elements/Separator/Separator.js +4 -5
  39. package/dist/cjs/elements/Separator/Separator.js.map +1 -1
  40. package/dist/cjs/elements/Skeleton/Skeleton.d.ts +4 -2
  41. package/dist/cjs/elements/Skeleton/Skeleton.js +3 -4
  42. package/dist/cjs/elements/Skeleton/Skeleton.js.map +1 -1
  43. package/dist/cjs/elements/Stack/Stack.d.ts +4 -2
  44. package/dist/cjs/elements/Stack/Stack.js +4 -5
  45. package/dist/cjs/elements/Stack/Stack.js.map +1 -1
  46. package/dist/cjs/elements/StackableBorderBox/StackableBorderBox.d.ts +4 -2
  47. package/dist/cjs/elements/StackableBorderBox/StackableBorderBox.js +0 -3
  48. package/dist/cjs/elements/StackableBorderBox/StackableBorderBox.js.map +1 -1
  49. package/dist/cjs/elements/Sup/Sup.d.ts +4 -2
  50. package/dist/cjs/elements/Swiper/Swiper.d.ts +4 -2
  51. package/dist/cjs/elements/Swiper/Swiper.js +3 -4
  52. package/dist/cjs/elements/Swiper/Swiper.js.map +1 -1
  53. package/dist/cjs/elements/Text/Text.d.ts +4 -2
  54. package/dist/cjs/elements/Text/Text.js +4 -5
  55. package/dist/cjs/elements/Text/Text.js.map +1 -1
  56. package/dist/esm/elements/BaseTabs/BaseTab.js +7 -8
  57. package/dist/esm/elements/BaseTabs/BaseTab.js.map +1 -1
  58. package/dist/esm/elements/BorderBox/BorderBox.js +4 -5
  59. package/dist/esm/elements/BorderBox/BorderBox.js.map +1 -1
  60. package/dist/esm/elements/BorderBox/BorderBoxBase.js +4 -5
  61. package/dist/esm/elements/BorderBox/BorderBoxBase.js.map +1 -1
  62. package/dist/esm/elements/Carousel/Carousel.js +8 -10
  63. package/dist/esm/elements/Carousel/Carousel.js.map +1 -1
  64. package/dist/esm/elements/Carousel/CarouselNavigation.js +5 -10
  65. package/dist/esm/elements/Carousel/CarouselNavigation.js.map +1 -1
  66. package/dist/esm/elements/Clickable/Clickable.js +4 -5
  67. package/dist/esm/elements/Clickable/Clickable.js.map +1 -1
  68. package/dist/esm/elements/Flex/Flex.js +3 -4
  69. package/dist/esm/elements/Flex/Flex.js.map +1 -1
  70. package/dist/esm/elements/FullBleed/FullBleed.js +9 -10
  71. package/dist/esm/elements/FullBleed/FullBleed.js.map +1 -1
  72. package/dist/esm/elements/GridColumns/GridColumns.js +4 -5
  73. package/dist/esm/elements/GridColumns/GridColumns.js.map +1 -1
  74. package/dist/esm/elements/HTML/HTML.js +3 -4
  75. package/dist/esm/elements/HTML/HTML.js.map +1 -1
  76. package/dist/esm/elements/Link/Link.js +3 -4
  77. package/dist/esm/elements/Link/Link.js.map +1 -1
  78. package/dist/esm/elements/Pill/Pill.js +0 -3
  79. package/dist/esm/elements/Pill/Pill.js.map +1 -1
  80. package/dist/esm/elements/Range/Range.js +3 -4
  81. package/dist/esm/elements/Range/Range.js.map +1 -1
  82. package/dist/esm/elements/Separator/Separator.js +4 -5
  83. package/dist/esm/elements/Separator/Separator.js.map +1 -1
  84. package/dist/esm/elements/Skeleton/Skeleton.js +3 -4
  85. package/dist/esm/elements/Skeleton/Skeleton.js.map +1 -1
  86. package/dist/esm/elements/Stack/Stack.js +4 -5
  87. package/dist/esm/elements/Stack/Stack.js.map +1 -1
  88. package/dist/esm/elements/StackableBorderBox/StackableBorderBox.js +0 -3
  89. package/dist/esm/elements/StackableBorderBox/StackableBorderBox.js.map +1 -1
  90. package/dist/esm/elements/Swiper/Swiper.js +3 -4
  91. package/dist/esm/elements/Swiper/Swiper.js.map +1 -1
  92. package/dist/esm/elements/Text/Text.js +4 -5
  93. package/dist/esm/elements/Text/Text.js.map +1 -1
  94. package/package.json +2 -2
@@ -17,9 +17,24 @@ export type BaseTabProps<C extends React.ComponentType<React.PropsWithChildren<u
17
17
  * E.g.: `<BaseTab as={RouterLink} to="/foo">Foo</BaseTab>`
18
18
  * or `<BaseTab as={Clickable} onClick={handleClick}>Foo</BaseTab>`
19
19
  */
20
- export declare const BaseTab: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("..").BoxProps> & import("..").BoxProps, "ref"> & {
20
+ export declare const BaseTab: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("..").BoxProps> & import("..").BoxProps, "ref"> & {
21
21
  ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
22
- }, "p" | "top" | "bottom" | "left" | "right" | "position" | "padding" | "width" | "height" | "gap" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "backgroundImage" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "boxShadow" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "pointerEvents" | "textAlign" | "textTransform" | "verticalAlign" | "zIndex" | "background" | "backgroundPosition" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "lineClamp" | "margin" | "overflow" | "bg" | "borderX" | "borderY" | "size" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "textColor" | "variant" | "hyphenate" | "overflowEllipsis"> & import("styled-system").TypographyProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & Omit<import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol>, "color"> & {
22
+ }, Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("..").BoxProps> & import("..").BoxProps, "ref"> & {
23
+ ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
24
+ }>, TextProps>, "p" | "top" | "bottom" | "left" | "right" | "position" | "padding" | "width" | "height" | "gap" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "backgroundImage" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "boxShadow" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "pointerEvents" | "textAlign" | "textTransform" | "verticalAlign" | "zIndex" | "background" | "backgroundPosition" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "lineClamp" | "margin" | "overflow" | "bg" | "borderX" | "borderY" | "size" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "textColor" | "variant" | "hyphenate" | "overflowEllipsis"> & import("styled-system").TypographyProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & Omit<import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol>, "color"> & {
25
+ variant?: import("styled-system").ResponsiveValue<import("@artsy/palette-tokens/dist/typography/v3").TextVariant>;
26
+ textColor?: import("styled-system").ResponsiveValue<import("@artsy/palette-tokens").Color>;
27
+ lineClamp?: number;
28
+ } & import("..").BoxProps & {
29
+ hyphenate?: boolean;
30
+ overflowEllipsis?: boolean;
31
+ textTransform?: import("styled-system").ResponsiveValue<import("../Text").TextTransform>;
32
+ lineClamp?: import("styled-system").ResponsiveValue<number>;
33
+ }, import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("..").BoxProps> & import("..").BoxProps, "ref"> & {
34
+ ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
35
+ }, Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("..").BoxProps> & import("..").BoxProps, "ref"> & {
36
+ ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
37
+ }>, TextProps>, "p" | "top" | "bottom" | "left" | "right" | "position" | "padding" | "width" | "height" | "gap" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "backgroundImage" | "backgroundRepeat" | "backgroundSize" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "boxShadow" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "pointerEvents" | "textAlign" | "textTransform" | "verticalAlign" | "zIndex" | "background" | "backgroundPosition" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gridArea" | "lineClamp" | "margin" | "overflow" | "bg" | "borderX" | "borderY" | "size" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "textColor" | "variant" | "hyphenate" | "overflowEllipsis"> & import("styled-system").TypographyProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & Omit<import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol>, "color"> & {
23
38
  variant?: import("styled-system").ResponsiveValue<import("@artsy/palette-tokens/dist/typography/v3").TextVariant>;
24
39
  textColor?: import("styled-system").ResponsiveValue<import("@artsy/palette-tokens").Color>;
25
40
  lineClamp?: number;
@@ -28,4 +43,4 @@ export declare const BaseTab: import("styled-components/dist/types").IStyledComp
28
43
  overflowEllipsis?: boolean;
29
44
  textTransform?: import("styled-system").ResponsiveValue<import("../Text").TextTransform>;
30
45
  lineClamp?: import("styled-system").ResponsiveValue<number>;
31
- }, BaseTabProps<any>>> & string;
46
+ }>, BaseTabProps<any>>, BaseTabProps<any>>> & string;
@@ -22,19 +22,18 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
22
22
  * E.g.: `<BaseTab as={RouterLink} to="/foo">Foo</BaseTab>`
23
23
  * or `<BaseTab as={Clickable} onClick={handleClick}>Foo</BaseTab>`
24
24
  */
25
- const BaseTab = exports.BaseTab = (0, _styledComponents.default)(_Text.Text).withConfig({
25
+ const BaseTab = exports.BaseTab = (0, _styledComponents.default)(_Text.Text).attrs(props => ({
26
+ variant: props.variant ?? "sm",
27
+ mb: props.mb ?? "-1px",
28
+ alignItems: props.alignItems ?? "flex-start",
29
+ justifyContent: props.justifyContent ?? "center",
30
+ textAlign: props.textAlign ?? "center"
31
+ })).withConfig({
26
32
  displayName: "BaseTab",
27
33
  componentId: "sc-1qn17bx-0"
28
34
  })(["display:flex;width:100%;position:relative;text-decoration:none;white-space:nowrap;z-index:1;", ""], props => {
29
35
  return (0, _styledComponents.css)(["", " ", " ", " ", " &:hover:not(:disabled){", "}&:focus{outline:0;", "}"], _tokens.STATES.default, props.hover && _tokens.STATES.hover, props.focus && _tokens.STATES.focus, props.active && _tokens.STATES.active, _tokens.STATES.hover, _tokens.STATES.focus);
30
36
  });
31
- BaseTab.defaultProps = {
32
- variant: "sm",
33
- mb: "-1px",
34
- alignItems: "flex-start",
35
- justifyContent: "center",
36
- textAlign: "center"
37
- };
38
37
  BaseTab.displayName = "BaseTab";
39
38
 
40
39
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"BaseTab.js","names":["_styledComponents","_interopRequireWildcard","require","_Clickable","_Text","_tokens","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","BaseTab","exports","styled","Text","withConfig","displayName","componentId","props","css","STATES","hover","focus","active","defaultProps","variant","mb","alignItems","justifyContent","textAlign","__Ignore__","Clickable"],"sources":["../../../../src/elements/BaseTabs/BaseTab.tsx"],"sourcesContent":["import React from \"react\"\nimport styled, { css } from \"styled-components\"\nimport { Clickable } from \"../Clickable\"\nimport { Text, TextProps } from \"../Text\"\nimport { STATES } from \"./tokens\"\n\n/**\n * Utilize as=\"a\" or as={Component} to alter functionality\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type BaseTabProps<C extends React.ComponentType<React.PropsWithChildren<unknown>> = any> = TextProps & {\n active?: boolean\n focus?: boolean\n hover?: boolean\n} & React.ComponentPropsWithoutRef<C> & { as?: C }\n\n/**\n * Extends `Text`. Should always be nested within a `BaseTabs` container.\n *\n * Use the `as` prop to alter behavior.\n * E.g.: `<BaseTab as={RouterLink} to=\"/foo\">Foo</BaseTab>`\n * or `<BaseTab as={Clickable} onClick={handleClick}>Foo</BaseTab>`\n */\nexport const BaseTab = styled(Text)<BaseTabProps>`\n display: flex;\n width: 100%;\n position: relative;\n text-decoration: none;\n white-space: nowrap;\n z-index: 1;\n\n ${(props) => {\n return css`\n ${STATES.default}\n ${props.hover && STATES.hover}\n ${props.focus && STATES.focus}\n ${props.active && STATES.active}\n\n &:hover:not(:disabled) {\n ${STATES.hover}\n }\n\n &:focus {\n outline: 0;\n ${STATES.focus}\n }\n `\n }}\n`\n\nBaseTab.defaultProps = {\n variant: \"sm\",\n mb: \"-1px\",\n alignItems: \"flex-start\",\n justifyContent: \"center\",\n textAlign: \"center\",\n}\n\nBaseTab.displayName = \"BaseTab\"\n\n/**\n * So this is interesting: We can trick styled-components into correcting the CSS specificity (Text > Clickable)\n * by simply including a Clickable here.\n */\n// @ts-expect-error MIGRATE_STRICT_MODE\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst __Ignore__ = Clickable\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAAiC,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WA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AID,cAAM,CAACC,KAAK,EAC3BH,KAAK,CAACI,KAAK,IAAIF,cAAM,CAACE,KAAK,EAC3BJ,KAAK,CAACK,MAAM,IAAIH,cAAM,CAACG,MAAM,EAG3BH,cAAM,CAACC,KAAK,EAKZD,cAAM,CAACE,KAAK;AAGpB,CAAC,CACF;AAEDX,OAAO,CAACa,YAAY,GAAG;EACrBC,OAAO,EAAE,IAAI;EACbC,EAAE,EAAE,MAAM;EACVC,UAAU,EAAE,YAAY;EACxBC,cAAc,EAAE,QAAQ;EACxBC,SAAS,EAAE;AACb,CAAC;AAEDlB,OAAO,CAACK,WAAW,GAAG,SAAS;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA,MAAMc,UAAU,GAAGC,oBAAS"}
1
+ {"version":3,"file":"BaseTab.js","names":["_styledComponents","_interopRequireWildcard","require","_Clickable","_Text","_tokens","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","BaseTab","exports","styled","Text","attrs","props","variant","mb","alignItems","justifyContent","textAlign","withConfig","displayName","componentId","css","STATES","hover","focus","active","__Ignore__","Clickable"],"sources":["../../../../src/elements/BaseTabs/BaseTab.tsx"],"sourcesContent":["import React from \"react\"\nimport styled, { css } from \"styled-components\"\nimport { Clickable } from \"../Clickable\"\nimport { Text, TextProps } from \"../Text\"\nimport { STATES } from \"./tokens\"\n\n/**\n * Utilize as=\"a\" or as={Component} to alter functionality\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type BaseTabProps<C extends React.ComponentType<React.PropsWithChildren<unknown>> = any> = TextProps & {\n active?: boolean\n focus?: boolean\n hover?: boolean\n} & React.ComponentPropsWithoutRef<C> & { as?: C }\n\n/**\n * Extends `Text`. Should always be nested within a `BaseTabs` container.\n *\n * Use the `as` prop to alter behavior.\n * E.g.: `<BaseTab as={RouterLink} to=\"/foo\">Foo</BaseTab>`\n * or `<BaseTab as={Clickable} onClick={handleClick}>Foo</BaseTab>`\n */\nexport const BaseTab = styled(Text).attrs<BaseTabProps>((props) => ({\n variant: props.variant ?? \"sm\",\n mb: props.mb ?? \"-1px\",\n alignItems: props.alignItems ?? \"flex-start\",\n justifyContent: props.justifyContent ?? \"center\",\n textAlign: props.textAlign ?? \"center\",\n}))<BaseTabProps>`\n display: flex;\n width: 100%;\n position: relative;\n text-decoration: none;\n white-space: nowrap;\n z-index: 1;\n\n ${(props) => {\n return css`\n ${STATES.default}\n ${props.hover && STATES.hover}\n ${props.focus && STATES.focus}\n ${props.active && STATES.active}\n\n &:hover:not(:disabled) {\n ${STATES.hover}\n }\n\n &:focus {\n outline: 0;\n ${STATES.focus}\n }\n `\n }}\n`\n\nBaseTab.displayName = \"BaseTab\"\n\n/**\n * So this is interesting: We can trick styled-components into correcting the CSS specificity (Text > Clickable)\n * by simply including a Clickable here.\n */\n// @ts-expect-error MIGRATE_STRICT_MODE\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst __Ignore__ = Clickable\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAAiC,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,w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AG,+EACNC,cAAM,CAAC9B,OAAO,EACdoB,KAAK,CAACW,KAAK,IAAID,cAAM,CAACC,KAAK,EAC3BX,KAAK,CAACY,KAAK,IAAIF,cAAM,CAACE,KAAK,EAC3BZ,KAAK,CAACa,MAAM,IAAIH,cAAM,CAACG,MAAM,EAG3BH,cAAM,CAACC,KAAK,EAKZD,cAAM,CAACE,KAAK;AAGpB,CAAC,CACF;AAEDjB,OAAO,CAACY,WAAW,GAAG,SAAS;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA,MAAMO,UAAU,GAAGC,oBAAS"}
@@ -5,6 +5,8 @@ export type BorderBoxProps = BoxProps;
5
5
  * @deprecated: Use `Box` along with props e.g. `border="1px solid" borderColor="mono10" p={2}`,
6
6
  * as needed.
7
7
  */
8
- export declare const BorderBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
8
+ export declare const BorderBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
9
9
  ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
10
- }, never>> & string;
10
+ }, Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
11
+ ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
12
+ }>, BoxProps>, BoxProps>> & string;
@@ -12,13 +12,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
12
12
  * @deprecated: Use `Box` along with props e.g. `border="1px solid" borderColor="mono10" p={2}`,
13
13
  * as needed.
14
14
  */
15
- const BorderBox = exports.BorderBox = (0, _styledComponents.default)(_Box.Box).withConfig({
15
+ const BorderBox = exports.BorderBox = (0, _styledComponents.default)(_Box.Box).attrs(props => ({
16
+ borderColor: props.borderColor ?? "mono10",
17
+ p: props.p ?? 2
18
+ })).withConfig({
16
19
  displayName: "BorderBox",
17
20
  componentId: "sc-18mwadn-0"
18
21
  })(["border-width:1px;border-style:solid;"]);
19
22
  BorderBox.displayName = "BorderBox";
20
- BorderBox.defaultProps = {
21
- borderColor: "mono10",
22
- p: 2
23
- };
24
23
  //# sourceMappingURL=BorderBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BorderBox.js","names":["_styledComponents","_interopRequireDefault","require","_Box","obj","__esModule","default","BorderBox","exports","styled","Box","withConfig","displayName","componentId","defaultProps","borderColor","p"],"sources":["../../../../src/elements/BorderBox/BorderBox.tsx"],"sourcesContent":["import styled from \"styled-components\"\nimport { Box, BoxProps } from \"../Box\"\n\nexport type BorderBoxProps = BoxProps\n\n/**\n * A `div` that has a common border and padding set by default\n * @deprecated: Use `Box` along with props e.g. `border=\"1px solid\" borderColor=\"mono10\" p={2}`,\n * as needed.\n */\nexport const BorderBox = styled(Box)`\n border-width: 1px;\n border-style: solid;\n`\n\nBorderBox.displayName = \"BorderBox\"\n\nBorderBox.defaultProps = {\n borderColor: \"mono10\",\n p: 2,\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAAsC,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAItC;AACA;AACA;AACA;AACA;AACO,MAAMG,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,yBAAM,EAACC,QAAG,CAAC,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,4CAGnC;AAEDN,SAAS,CAACK,WAAW,GAAG,WAAW;AAEnCL,SAAS,CAACO,YAAY,GAAG;EACvBC,WAAW,EAAE,QAAQ;EACrBC,CAAC,EAAE;AACL,CAAC"}
1
+ {"version":3,"file":"BorderBox.js","names":["_styledComponents","_interopRequireDefault","require","_Box","obj","__esModule","default","BorderBox","exports","styled","Box","attrs","props","borderColor","p","withConfig","displayName","componentId"],"sources":["../../../../src/elements/BorderBox/BorderBox.tsx"],"sourcesContent":["import styled from \"styled-components\"\nimport { Box, BoxProps } from \"../Box\"\n\nexport type BorderBoxProps = BoxProps\n\n/**\n * A `div` that has a common border and padding set by default\n * @deprecated: Use `Box` along with props e.g. `border=\"1px solid\" borderColor=\"mono10\" p={2}`,\n * as needed.\n */\nexport const BorderBox = styled(Box).attrs<BorderBoxProps>((props) => ({\n borderColor: props.borderColor ?? \"mono10\",\n p: props.p ?? 2,\n}))<BorderBoxProps>`\n border-width: 1px;\n border-style: solid;\n`\n\nBorderBox.displayName = \"BorderBox\"\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAAsC,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAItC;AACA;AACA;AACA;AACA;AACO,MAAMG,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,yBAAM,EAACC,QAAG,CAAC,CAACC,KAAK,CAAkBC,KAAK,KAAM;EACrEC,WAAW,EAAED,KAAK,CAACC,WAAW,IAAI,QAAQ;EAC1CC,CAAC,EAAEF,KAAK,CAACE,CAAC,IAAI;AAChB,CAAC,CAAC,CAAC,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,4CAGF;AAEDV,SAAS,CAACS,WAAW,GAAG,WAAW"}
@@ -6,6 +6,12 @@ export interface BorderBoxProps extends FlexProps {
6
6
  * A `div` that has a common border and padding set by default
7
7
  * @deprecated: Use `Box`
8
8
  */
9
- export declare const BorderBoxBase: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("..").BoxProps> & import("..").BoxProps, "ref"> & {
9
+ export declare const BorderBoxBase: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("..").BoxProps> & import("..").BoxProps, "ref"> & {
10
10
  ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
11
- }, keyof import("..").BoxProps> & import("..").BoxProps, BorderBoxProps>> & string;
11
+ }, Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("..").BoxProps> & import("..").BoxProps, "ref"> & {
12
+ ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
13
+ }>, import("..").BoxProps>, keyof import("..").BoxProps> & import("..").BoxProps, import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("..").BoxProps> & import("..").BoxProps, "ref"> & {
14
+ ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
15
+ }, Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("..").BoxProps> & import("..").BoxProps, "ref"> & {
16
+ ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
17
+ }>, import("..").BoxProps>, keyof import("..").BoxProps> & import("..").BoxProps>, BorderBoxProps>, BorderBoxProps>> & string;
@@ -11,12 +11,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11
11
  * A `div` that has a common border and padding set by default
12
12
  * @deprecated: Use `Box`
13
13
  */
14
- const BorderBoxBase = exports.BorderBoxBase = (0, _styledComponents.default)(_Flex.Flex).withConfig({
14
+ const BorderBoxBase = exports.BorderBoxBase = (0, _styledComponents.default)(_Flex.Flex).attrs(props => ({
15
+ borderColor: props.borderColor ?? "mono10",
16
+ p: props.p ?? 2
17
+ })).withConfig({
15
18
  displayName: "BorderBoxBase",
16
19
  componentId: "sc-1072ama-0"
17
20
  })(["border-width:1px;border-style:solid;"]);
18
- BorderBoxBase.defaultProps = {
19
- borderColor: "mono10",
20
- p: 2
21
- };
22
21
  //# sourceMappingURL=BorderBoxBase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BorderBoxBase.js","names":["_styledComponents","_interopRequireDefault","require","_Flex","obj","__esModule","default","BorderBoxBase","exports","styled","Flex","withConfig","displayName","componentId","defaultProps","borderColor","p"],"sources":["../../../../src/elements/BorderBox/BorderBoxBase.tsx"],"sourcesContent":["import styled from \"styled-components\"\nimport { Flex, FlexProps } from \"../Flex\"\n\nexport interface BorderBoxProps extends FlexProps {\n hover?: boolean\n}\n\n/**\n * A `div` that has a common border and padding set by default\n * @deprecated: Use `Box`\n */\nexport const BorderBoxBase = styled(Flex)<BorderBoxProps>`\n border-width: 1px;\n border-style: solid;\n`\n\nBorderBoxBase.defaultProps = {\n borderColor: \"mono10\",\n p: 2,\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAyC,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAMzC;AACA;AACA;AACA;AACO,MAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,yBAAM,EAACC,UAAI,CAAC,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,4CAGxC;AAEDN,aAAa,CAACO,YAAY,GAAG;EAC3BC,WAAW,EAAE,QAAQ;EACrBC,CAAC,EAAE;AACL,CAAC"}
1
+ {"version":3,"file":"BorderBoxBase.js","names":["_styledComponents","_interopRequireDefault","require","_Flex","obj","__esModule","default","BorderBoxBase","exports","styled","Flex","attrs","props","borderColor","p","withConfig","displayName","componentId"],"sources":["../../../../src/elements/BorderBox/BorderBoxBase.tsx"],"sourcesContent":["import styled from \"styled-components\"\nimport { Flex, FlexProps } from \"../Flex\"\n\nexport interface BorderBoxProps extends FlexProps {\n hover?: boolean\n}\n\n/**\n * A `div` that has a common border and padding set by default\n * @deprecated: Use `Box`\n */\nexport const BorderBoxBase = styled(Flex).attrs<BorderBoxProps>((props) => ({\n borderColor: props.borderColor ?? \"mono10\",\n p: props.p ?? 2,\n}))<BorderBoxProps>`\n border-width: 1px;\n border-style: solid;\n`\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAyC,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAMzC;AACA;AACA;AACA;AACO,MAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,yBAAM,EAACC,UAAI,CAAC,CAACC,KAAK,CAAkBC,KAAK,KAAM;EAC1EC,WAAW,EAAED,KAAK,CAACC,WAAW,IAAI,QAAQ;EAC1CC,CAAC,EAAEF,KAAK,CAACE,CAAC,IAAI;AAChB,CAAC,CAAC,CAAC,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,4CAGF"}
@@ -8,15 +8,19 @@ export type CarouselRailProps = BoxProps & {
8
8
  transition?: ResponsiveValue<string>;
9
9
  };
10
10
  /** A `CarouselRail` slides back and forth within the viewport */
11
- export declare const CarouselRail: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
11
+ export declare const CarouselRail: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
12
12
  ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
13
- }, CarouselRailProps>> & string;
13
+ }, Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
14
+ ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
15
+ }>, CarouselRailProps>, CarouselRailProps>> & string;
14
16
  /** CarouselCellProps */
15
17
  export type CarouselCellProps = BoxProps;
16
18
  /** A `CarouselCell` wraps a single child in the carousel */
17
- export declare const CarouselCell: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
19
+ export declare const CarouselCell: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
20
+ ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
21
+ }, Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
18
22
  ref?: ((instance: HTMLDivElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLDivElement> | null | undefined;
19
- }, never>> & string;
23
+ }>, BoxProps>, BoxProps>> & string;
20
24
  /**
21
25
  * We share this spacing value with the `Swiper` component
22
26
  */
@@ -28,26 +28,24 @@ const transition = (0, _styledSystem.system)({
28
28
  /** CarouselRailProps */
29
29
 
30
30
  /** A `CarouselRail` slides back and forth within the viewport */
31
- const CarouselRail = exports.CarouselRail = (0, _styledComponents.default)(_Box.Box).withConfig({
31
+ const CarouselRail = exports.CarouselRail = (0, _styledComponents.default)(_Box.Box).attrs(props => ({
32
+ as: props.as ?? "ul",
33
+ display: props.display ?? "flex",
34
+ transition: props.transition ?? `transform ${RAIL_TRANSITION_MS}ms`
35
+ })).withConfig({
32
36
  displayName: "Carousel__CarouselRail",
33
37
  componentId: "sc-k6g4b4-0"
34
38
  })(["height:100%;margin:0;padding:0;list-style:none;white-space:nowrap;", ""], transition);
35
- CarouselRail.defaultProps = {
36
- as: "ul",
37
- display: "flex",
38
- transition: `transform ${RAIL_TRANSITION_MS}ms`
39
- };
40
39
 
41
40
  /** CarouselCellProps */
42
41
 
43
42
  /** A `CarouselCell` wraps a single child in the carousel */
44
- const CarouselCell = exports.CarouselCell = (0, _styledComponents.default)(_Box.Box).withConfig({
43
+ const CarouselCell = exports.CarouselCell = (0, _styledComponents.default)(_Box.Box).attrs(props => ({
44
+ as: props.as ?? "li"
45
+ })).withConfig({
45
46
  displayName: "Carousel__CarouselCell",
46
47
  componentId: "sc-k6g4b4-1"
47
48
  })(["white-space:normal;"]);
48
- CarouselCell.defaultProps = {
49
- as: "li"
50
- };
51
49
 
52
50
  /**
53
51
  * We share this spacing value with the `Swiper` component
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_styledSystem","_useCursor","_ChevronLeftIcon","_ChevronRightIcon","_useUpdateEffect","_Box","_Skip","_VisuallyHidden","_CarouselNavigation","_paginate","_jsxRuntime","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","RAIL_TRANSITION_MS","transition","system","CarouselRail","exports","styled","Box","withConfig","displayName","componentId","defaultProps","as","display","CarouselCell","CELL_GAP_PADDING_AMOUNT","Container","Viewport","Carousel","initialIndex","children","Previous","CarouselPrevious","Next","CarouselNext","Rail","Cell","paginateBy","onChange","onPageCountChange","rest","containerRef","useRef","viewportRef","startRef","endRef","cells","useMemo","Children","toArray","filter","isValidElement","map","child","ref","createRef","pages","setPages","useState","index","handleNext","handlePrev","setCursor","useCursor","initialCursor","max","length","init","current","viewport","values","clientWidth","paginateCarousel","useEffect","window","addEventListener","removeEventListener","skipToEnd","focus","skipToStart","handleKeydown","contains","document","activeElement","useUpdateEffect","offset","jsxs","jsx","Skip","onClick","width","mb","disabled","height","style","transform","i","isLast","pr","mt","VisuallyHidden"],"sources":["../../../../src/elements/Carousel/Carousel.tsx"],"sourcesContent":["import React, {\n Children,\n createRef,\n isValidElement,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport styled from \"styled-components\"\nimport { ResponsiveValue, system } from \"styled-system\"\nimport { useCursor } from \"use-cursor\"\nimport ChevronLeftIcon from \"@artsy/icons/ChevronLeftIcon\"\nimport ChevronRightIcon from \"@artsy/icons/ChevronRightIcon\"\nimport { SpacingUnit } from \"../../Theme\"\nimport { useUpdateEffect } from \"../../utils/useUpdateEffect\"\nimport { Box, BoxProps } from \"../Box\"\nimport { Skip } from \"../Skip\"\nimport { VisuallyHidden } from \"../VisuallyHidden\"\nimport {\n CarouselNavigationProps,\n CarouselNext,\n CarouselPrevious,\n} from \"./CarouselNavigation\"\nimport { paginateCarousel } from \"./paginate\"\n\nconst RAIL_TRANSITION_MS = 500\n\nconst transition = system({ transition: true })\n\n/** CarouselRailProps */\nexport type CarouselRailProps = BoxProps & {\n transition?: ResponsiveValue<string>\n}\n\n/** A `CarouselRail` slides back and forth within the viewport */\nexport const CarouselRail = styled(Box)<CarouselRailProps>`\n height: 100%;\n margin: 0;\n padding: 0;\n list-style: none;\n white-space: nowrap;\n ${transition}\n`\n\nCarouselRail.defaultProps = {\n as: \"ul\",\n display: \"flex\",\n transition: `transform ${RAIL_TRANSITION_MS}ms`,\n}\n\n/** CarouselCellProps */\nexport type CarouselCellProps = BoxProps\n\n/** A `CarouselCell` wraps a single child in the carousel */\nexport const CarouselCell = styled(Box)`\n white-space: normal;\n`\n\nCarouselCell.defaultProps = {\n as: \"li\",\n}\n\n/**\n * We share this spacing value with the `Swiper` component\n */\nexport const CELL_GAP_PADDING_AMOUNT: SpacingUnit[] = [1, 2]\n\nconst Container = styled(Box)`\n position: relative;\n width: 100%;\n`\n\nconst Viewport = styled(Box)`\n width: 100%;\n overflow: hidden;\n`\n\nexport interface CarouselProps extends BoxProps {\n initialIndex?: number\n children: React.ReactNode\n Next?: typeof CarouselNext | React.FC<React.PropsWithChildren<CarouselNavigationProps>>\n Previous?: typeof CarouselPrevious | React.FC<React.PropsWithChildren<CarouselNavigationProps>>\n Rail?: typeof CarouselRail | React.FC<React.PropsWithChildren<CarouselRailProps>>\n /**\n * If providing a custom `Cell` you must forward a ref so\n * that cell widths can be calculated.\n */\n Cell?: React.ForwardRefExoticComponent<CarouselCellProps>\n paginateBy?: \"page\" | \"cell\"\n onChange?(index: number): void\n onPageCountChange?(count: number): void\n}\n\n/**\n * A `Carousel` accepts children or a series of children that are JSX elements.\n * It presents them in a horizontal rail and when the width exceeds the width\n * of the viewport, it presents navigation arrows and allows a user to page\n * through them.\n */\nexport const Carousel: React.FC<React.PropsWithChildren<CarouselProps>> = ({\n initialIndex = 0,\n children,\n Previous = CarouselPrevious,\n Next = CarouselNext,\n Rail = CarouselRail,\n Cell = CarouselCell,\n paginateBy = \"page\",\n onChange,\n onPageCountChange,\n ...rest\n}) => {\n const containerRef = useRef<HTMLDivElement | null>(null)\n const viewportRef = useRef<HTMLDivElement | null>(null)\n const startRef = useRef<HTMLButtonElement | null>(null)\n const endRef = useRef<HTMLButtonElement | null>(null)\n\n const cells = useMemo(\n () =>\n Children.toArray(children)\n .filter(isValidElement)\n .map((child) => ({ child, ref: createRef<HTMLDivElement>() })),\n [children]\n )\n\n const [pages, setPages] = useState([0])\n\n const { index, handleNext, handlePrev, setCursor } = useCursor({\n initialCursor: initialIndex,\n max: pages.length,\n })\n\n const init = () => {\n const { current: viewport } = viewportRef\n const values = cells.map(({ ref }) => ref.current!.clientWidth)\n\n setPages(\n paginateCarousel({\n viewport: viewport!.clientWidth,\n values,\n paginateBy,\n })\n )\n }\n\n useEffect(() => {\n init()\n window.addEventListener(\"resize\", init)\n return () => {\n window.removeEventListener(\"resize\", init)\n }\n }, [cells])\n\n const skipToEnd = () => {\n if (!endRef.current) return\n endRef.current.focus()\n setCursor(pages.length - 1)\n }\n\n const skipToStart = () => {\n if (!startRef.current) return\n startRef.current.focus()\n setCursor(0)\n }\n\n const handleKeydown = ({ key }: KeyboardEvent) => {\n if (!containerRef.current) return\n\n // Only triggers keyboard navigation if component is in focus\n if (!containerRef.current.contains(document.activeElement)) {\n return\n }\n\n switch (key) {\n case \"ArrowRight\":\n handleNext()\n break\n case \"ArrowLeft\":\n handlePrev()\n break\n default:\n break\n }\n }\n\n useEffect(() => {\n document.addEventListener(\"keydown\", handleKeydown)\n return () => document.removeEventListener(\"keydown\", handleKeydown)\n }, [handleKeydown])\n\n useUpdateEffect(() => {\n onChange && onChange(index)\n }, [onChange, index])\n\n useUpdateEffect(() => {\n onPageCountChange && onPageCountChange(pages.length)\n }, [onPageCountChange, pages.length])\n\n const offset = `-${pages[index]}px`\n\n return (\n <Container ref={containerRef as any} {...rest}>\n <Skip ref={startRef} onClick={skipToEnd} width=\"100%\" mb={1}>\n Skip to end of content\n </Skip>\n\n <nav>\n <Previous\n onClick={handlePrev}\n disabled={index === 0}\n aria-label=\"Previous page\"\n >\n <ChevronLeftIcon width={15} height={15} />\n </Previous>\n\n <Next\n onClick={handleNext}\n disabled={index === pages.length - 1}\n aria-label=\"Next page\"\n >\n <ChevronRightIcon width={15} height={15} />\n </Next>\n </nav>\n\n <Viewport ref={viewportRef as any}>\n <Rail style={{ transform: `translateX(${offset})` }}>\n {cells.map(({ child, ref }, i) => {\n const isLast = i === cells.length - 1\n\n return (\n <Cell\n key={i}\n ref={ref}\n pr={!isLast && (CELL_GAP_PADDING_AMOUNT as any)}\n >\n {child}\n </Cell>\n )\n })}\n </Rail>\n </Viewport>\n\n <Skip ref={endRef} onClick={skipToStart} width=\"100%\" mt={1}>\n Skip to beginning of content\n </Skip>\n\n <VisuallyHidden aria-live=\"polite\" aria-atomic=\"true\">\n Page {index + 1} of {pages.length}\n </VisuallyHidden>\n </Container>\n )\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AASA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,iBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAEA,IAAAO,gBAAA,GAAAP,OAAA;AACA,IAAAQ,IAAA,GA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","_styledComponents","_interopRequireDefault","_styledSystem","_useCursor","_ChevronLeftIcon","_ChevronRightIcon","_useUpdateEffect","_Box","_Skip","_VisuallyHidden","_CarouselNavigation","_paginate","_jsxRuntime","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","RAIL_TRANSITION_MS","transition","system","CarouselRail","exports","styled","Box","attrs","props","as","display","withConfig","displayName","componentId","CarouselCell","CELL_GAP_PADDING_AMOUNT","Container","Viewport","Carousel","initialIndex","children","Previous","CarouselPrevious","Next","CarouselNext","Rail","Cell","paginateBy","onChange","onPageCountChange","rest","containerRef","useRef","viewportRef","startRef","endRef","cells","useMemo","Children","toArray","filter","isValidElement","map","child","ref","createRef","pages","setPages","useState","index","handleNext","handlePrev","setCursor","useCursor","initialCursor","max","length","init","current","viewport","values","clientWidth","paginateCarousel","useEffect","window","addEventListener","removeEventListener","skipToEnd","focus","skipToStart","handleKeydown","contains","document","activeElement","useUpdateEffect","offset","jsxs","jsx","Skip","onClick","width","mb","disabled","height","style","transform","i","isLast","pr","mt","VisuallyHidden"],"sources":["../../../../src/elements/Carousel/Carousel.tsx"],"sourcesContent":["import React, {\n Children,\n createRef,\n isValidElement,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport styled from \"styled-components\"\nimport { ResponsiveValue, system } from \"styled-system\"\nimport { useCursor } from \"use-cursor\"\nimport ChevronLeftIcon from \"@artsy/icons/ChevronLeftIcon\"\nimport ChevronRightIcon from \"@artsy/icons/ChevronRightIcon\"\nimport { SpacingUnit } from \"../../Theme\"\nimport { useUpdateEffect } from \"../../utils/useUpdateEffect\"\nimport { Box, BoxProps } from \"../Box\"\nimport { Skip } from \"../Skip\"\nimport { VisuallyHidden } from \"../VisuallyHidden\"\nimport {\n CarouselNavigationProps,\n CarouselNext,\n CarouselPrevious,\n} from \"./CarouselNavigation\"\nimport { paginateCarousel } from \"./paginate\"\n\nconst RAIL_TRANSITION_MS = 500\n\nconst transition = system({ transition: true })\n\n/** CarouselRailProps */\nexport type CarouselRailProps = BoxProps & {\n transition?: ResponsiveValue<string>\n}\n\n/** A `CarouselRail` slides back and forth within the viewport */\nexport const CarouselRail = styled(Box).attrs<CarouselRailProps>((props) => ({\n as: props.as ?? \"ul\",\n display: props.display ?? \"flex\",\n transition: props.transition ?? `transform ${RAIL_TRANSITION_MS}ms`,\n}))<CarouselRailProps>`\n height: 100%;\n margin: 0;\n padding: 0;\n list-style: none;\n white-space: nowrap;\n ${transition}\n`\n\n/** CarouselCellProps */\nexport type CarouselCellProps = BoxProps\n\n/** A `CarouselCell` wraps a single child in the carousel */\nexport const CarouselCell = styled(Box).attrs<CarouselCellProps>((props) => ({\n as: props.as ?? \"li\",\n}))<CarouselCellProps>`\n white-space: normal;\n`\n\n/**\n * We share this spacing value with the `Swiper` component\n */\nexport const CELL_GAP_PADDING_AMOUNT: SpacingUnit[] = [1, 2]\n\nconst Container = styled(Box)`\n position: relative;\n width: 100%;\n`\n\nconst Viewport = styled(Box)`\n width: 100%;\n overflow: hidden;\n`\n\nexport interface CarouselProps extends BoxProps {\n initialIndex?: number\n children: React.ReactNode\n Next?: typeof CarouselNext | React.FC<React.PropsWithChildren<CarouselNavigationProps>>\n Previous?: typeof CarouselPrevious | React.FC<React.PropsWithChildren<CarouselNavigationProps>>\n Rail?: typeof CarouselRail | React.FC<React.PropsWithChildren<CarouselRailProps>>\n /**\n * If providing a custom `Cell` you must forward a ref so\n * that cell widths can be calculated.\n */\n Cell?: React.ForwardRefExoticComponent<CarouselCellProps>\n paginateBy?: \"page\" | \"cell\"\n onChange?(index: number): void\n onPageCountChange?(count: number): void\n}\n\n/**\n * A `Carousel` accepts children or a series of children that are JSX elements.\n * It presents them in a horizontal rail and when the width exceeds the width\n * of the viewport, it presents navigation arrows and allows a user to page\n * through them.\n */\nexport const Carousel: React.FC<React.PropsWithChildren<CarouselProps>> = ({\n initialIndex = 0,\n children,\n Previous = CarouselPrevious,\n Next = CarouselNext,\n Rail = CarouselRail,\n Cell = CarouselCell,\n paginateBy = \"page\",\n onChange,\n onPageCountChange,\n ...rest\n}) => {\n const containerRef = useRef<HTMLDivElement | null>(null)\n const viewportRef = useRef<HTMLDivElement | null>(null)\n const startRef = useRef<HTMLButtonElement | null>(null)\n const endRef = useRef<HTMLButtonElement | null>(null)\n\n const cells = useMemo(\n () =>\n Children.toArray(children)\n .filter(isValidElement)\n .map((child) => ({ child, ref: createRef<HTMLDivElement>() })),\n [children]\n )\n\n const [pages, setPages] = useState([0])\n\n const { index, handleNext, handlePrev, setCursor } = useCursor({\n initialCursor: initialIndex,\n max: pages.length,\n })\n\n const init = () => {\n const { current: viewport } = viewportRef\n const values = cells.map(({ ref }) => ref.current!.clientWidth)\n\n setPages(\n paginateCarousel({\n viewport: viewport!.clientWidth,\n values,\n paginateBy,\n })\n )\n }\n\n useEffect(() => {\n init()\n window.addEventListener(\"resize\", init)\n return () => {\n window.removeEventListener(\"resize\", init)\n }\n }, [cells])\n\n const skipToEnd = () => {\n if (!endRef.current) return\n endRef.current.focus()\n setCursor(pages.length - 1)\n }\n\n const skipToStart = () => {\n if (!startRef.current) return\n startRef.current.focus()\n setCursor(0)\n }\n\n const handleKeydown = ({ key }: KeyboardEvent) => {\n if (!containerRef.current) return\n\n // Only triggers keyboard navigation if component is in focus\n if (!containerRef.current.contains(document.activeElement)) {\n return\n }\n\n switch (key) {\n case \"ArrowRight\":\n handleNext()\n break\n case \"ArrowLeft\":\n handlePrev()\n break\n default:\n break\n }\n }\n\n useEffect(() => {\n document.addEventListener(\"keydown\", handleKeydown)\n return () => document.removeEventListener(\"keydown\", handleKeydown)\n }, [handleKeydown])\n\n useUpdateEffect(() => {\n onChange && onChange(index)\n }, [onChange, index])\n\n useUpdateEffect(() => {\n onPageCountChange && onPageCountChange(pages.length)\n }, [onPageCountChange, pages.length])\n\n const offset = `-${pages[index]}px`\n\n return (\n <Container ref={containerRef as any} {...rest}>\n <Skip ref={startRef} onClick={skipToEnd} width=\"100%\" mb={1}>\n Skip to end of content\n </Skip>\n\n <nav>\n <Previous\n onClick={handlePrev}\n disabled={index === 0}\n aria-label=\"Previous page\"\n >\n <ChevronLeftIcon width={15} height={15} />\n </Previous>\n\n <Next\n onClick={handleNext}\n disabled={index === pages.length - 1}\n aria-label=\"Next page\"\n >\n <ChevronRightIcon width={15} height={15} />\n </Next>\n </nav>\n\n <Viewport ref={viewportRef as any}>\n <Rail style={{ transform: `translateX(${offset})` }}>\n {cells.map(({ child, ref }, i) => {\n const isLast = i === cells.length - 1\n\n return (\n <Cell\n key={i}\n ref={ref}\n pr={!isLast && (CELL_GAP_PADDING_AMOUNT as any)}\n >\n {child}\n </Cell>\n )\n })}\n </Rail>\n </Viewport>\n\n <Skip ref={endRef} onClick={skipToStart} width=\"100%\" mt={1}>\n Skip to beginning of content\n </Skip>\n\n <VisuallyHidden aria-live=\"polite\" aria-atomic=\"true\">\n Page {index + 1} of {pages.length}\n </VisuallyHidden>\n </Container>\n )\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AASA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,iBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAEA,IAAAO,gBAAA,GAAAP,OAAA;AACA,IAAAQ,IAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,eAAA,GAAAV,OAAA;AACA,IAAAW,mBAAA,GAAAX,OAAA;AAKA,IAAAY,SAAA,GAAAZ,OAAA;AAA6C,IAAAa,WAAA,GAAAb,OAAA;AAAA,SAAAE,uBAAAY,GAAA,WAAAA,GAAA,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IAAA,EACH,eAEN,IAAA1G,WAAA,CAAAoG,GAAA,EAAC5D,QAAQ;MAAC2B,GAAG,EAAEX,WAAmB;MAAAb,QAAA,eAChC,IAAA3C,WAAA,CAAAoG,GAAA,EAACpD,IAAI;QAAC2D,KAAK,EAAE;UAAEC,SAAS,EAAG,cAAaV,MAAO;QAAG,CAAE;QAAAvD,QAAA,EACjDgB,KAAK,CAACM,GAAG,CAAC,CAAC;UAAEC,KAAK;UAAEC;QAAI,CAAC,EAAE0C,CAAC,KAAK;UAChC,MAAMC,MAAM,GAAGD,CAAC,KAAKlD,KAAK,CAACoB,MAAM,GAAG,CAAC;UAErC,oBACE,IAAA/E,WAAA,CAAAoG,GAAA,EAACnD,IAAI;YAEHkB,GAAG,EAAEA,GAAI;YACT4C,EAAE,EAAE,CAACD,MAAM,IAAKxE,uBAAgC;YAAAK,QAAA,EAE/CuB;UAAK,GAJD2C,CAAC,CAKD;QAEX,CAAC;MAAC;IACG,EACE,eAEX,IAAA7G,WAAA,CAAAoG,GAAA,EAACxG,KAAA,CAAAyG,IAAI;MAAClC,GAAG,EAAET,MAAO;MAAC4C,OAAO,EAAEV,WAAY;MAACW,KAAK,EAAC,MAAM;MAACS,EAAE,EAAE,CAAE;MAAArE,QAAA,EAAC;IAE7D,EAAO,eAEP,IAAA3C,WAAA,CAAAmG,IAAA,EAACtG,eAAA,CAAAoH,cAAc;MAAC,aAAU,QAAQ;MAAC,eAAY,MAAM;MAAAtE,QAAA,GAAC,OAC/C,EAAC6B,KAAK,GAAG,CAAC,EAAC,MAAI,EAACH,KAAK,CAACU,MAAM;IAAA,EAClB;EAAA,EACP;AAEhB,CAAC;AAAApD,OAAA,CAAAc,QAAA,GAAAA,QAAA;AAvJYA,QAA0D,CAAAN,WAAA"}
@@ -4,18 +4,34 @@ export type CarouselNavigationProps = ClickableProps;
4
4
  /**
5
5
  * Default next button
6
6
  */
7
- export declare const CarouselNext: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "cursor" | "textDecoration" | keyof import("..").BoxProps | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("..").BoxProps & {
7
+ export declare const CarouselNext: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
8
+ ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
9
+ }>, ClickableProps>, "cursor" | "textDecoration" | keyof import("..").BoxProps | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("..").BoxProps & {
8
10
  cursor?: import("styled-system").ResponsiveValue<string>;
9
11
  textDecoration?: import("styled-system").ResponsiveValue<string>;
10
- }, "ref"> & {
12
+ }, import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
11
13
  ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
12
- }, never>, never>> & string;
14
+ }>, ClickableProps>, "cursor" | "textDecoration" | keyof import("..").BoxProps | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("..").BoxProps & {
15
+ cursor?: import("styled-system").ResponsiveValue<string>;
16
+ textDecoration?: import("styled-system").ResponsiveValue<string>;
17
+ }>, ClickableProps>, "cursor" | "textDecoration" | keyof import("..").BoxProps | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("..").BoxProps & {
18
+ cursor?: import("styled-system").ResponsiveValue<string>;
19
+ textDecoration?: import("styled-system").ResponsiveValue<string>;
20
+ }, never>> & string;
13
21
  /**
14
22
  * Default previous button
15
23
  */
16
- export declare const CarouselPrevious: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "cursor" | "textDecoration" | keyof import("..").BoxProps | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("..").BoxProps & {
24
+ export declare const CarouselPrevious: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
25
+ ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
26
+ }>, ClickableProps>, "cursor" | "textDecoration" | keyof import("..").BoxProps | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("..").BoxProps & {
17
27
  cursor?: import("styled-system").ResponsiveValue<string>;
18
28
  textDecoration?: import("styled-system").ResponsiveValue<string>;
19
- }, "ref"> & {
29
+ }, import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
20
30
  ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
21
- }, never>, never>> & string;
31
+ }>, ClickableProps>, "cursor" | "textDecoration" | keyof import("..").BoxProps | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("..").BoxProps & {
32
+ cursor?: import("styled-system").ResponsiveValue<string>;
33
+ textDecoration?: import("styled-system").ResponsiveValue<string>;
34
+ }>, ClickableProps>, "cursor" | "textDecoration" | keyof import("..").BoxProps | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("..").BoxProps & {
35
+ cursor?: import("styled-system").ResponsiveValue<string>;
36
+ textDecoration?: import("styled-system").ResponsiveValue<string>;
37
+ }, never>> & string;
@@ -14,20 +14,15 @@ const ARROW_TRANSITION_MS = 250;
14
14
 
15
15
  /** CarouselNavigationProps */
16
16
 
17
- const Arrow = (0, _styledComponents.default)(_Clickable.Clickable).withConfig({
17
+ const Arrow = (0, _styledComponents.default)(_Clickable.Clickable).attrs(props => ({
18
+ width: props.width ?? ARROW_WIDTH.map(value => (0, _helpers.space)(value)),
19
+ height: props.height ?? "100%",
20
+ color: props.color ?? "mono60"
21
+ })).withConfig({
18
22
  displayName: "CarouselNavigation__Arrow",
19
23
  componentId: "sc-16jrffs-0"
20
24
  })(["position:absolute;top:0;display:flex;align-items:center;justify-content:center;cursor:pointer;user-select:none;transition:opacity ", "ms,color ", "ms;> svg{fill:currentColor;}&:hover,&:focus{outline:0;color:", ";}&:disabled{opacity:0;cursor:default;}"], ARROW_TRANSITION_MS, ARROW_TRANSITION_MS, (0, _themeGet.themeGet)("colors.mono100"));
21
25
 
22
- /**
23
- * Set some easily overwriteable props using `defaultProps`
24
- */
25
- Arrow.defaultProps = {
26
- width: ARROW_WIDTH.map(value => (0, _helpers.space)(value)),
27
- height: "100%",
28
- color: "mono60"
29
- };
30
-
31
26
  /**
32
27
  * Default next button
33
28
  */
@@ -1 +1 @@
1
- {"version":3,"file":"CarouselNavigation.js","names":["_styledComponents","_interopRequireDefault","require","_helpers","_Clickable","_themeGet","obj","__esModule","default","ARROW_WIDTH","ARROW_TRANSITION_MS","Arrow","styled","Clickable","withConfig","displayName","componentId","themeGet","defaultProps","width","map","value","space","height","color","CarouselNext","exports","CarouselPrevious"],"sources":["../../../../src/elements/Carousel/CarouselNavigation.tsx"],"sourcesContent":["import styled from \"styled-components\"\nimport { space } from \"../../helpers\"\nimport { SpacingUnit } from \"../../Theme\"\nimport { Clickable, ClickableProps } from \"../Clickable\"\nimport { themeGet } from \"@styled-system/theme-get\"\n\nconst ARROW_WIDTH: SpacingUnit[] = [2, 4]\nconst ARROW_TRANSITION_MS = 250\n\n/** CarouselNavigationProps */\nexport type CarouselNavigationProps = ClickableProps\n\nconst Arrow = styled(Clickable)`\n position: absolute;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n user-select: none;\n transition: opacity ${ARROW_TRANSITION_MS}ms, color ${ARROW_TRANSITION_MS}ms;\n\n > svg {\n fill: currentColor;\n }\n\n &:hover,\n &:focus {\n outline: 0;\n color: ${themeGet(\"colors.mono100\")};\n }\n\n &:disabled {\n opacity: 0;\n cursor: default;\n }\n`\n\n/**\n * Set some easily overwriteable props using `defaultProps`\n */\nArrow.defaultProps = {\n width: ARROW_WIDTH.map((value) => space(value)),\n height: \"100%\",\n color: \"mono60\",\n}\n\n/**\n * Default next button\n */\nexport const CarouselNext = styled(Arrow)`\n right: 0;\n transform: translateX(100%);\n`\n\n/**\n * Default previous button\n */\nexport const CarouselPrevious = styled(Arrow)`\n left: 0;\n transform: translateX(-100%);\n`\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAAmD,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEnD,MAAMG,WAA0B,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AACzC,MAAMC,mBAAmB,GAAG,GAAG;;AAE/B;;AAGA,MAAMC,KAAK,GAAG,IAAAC,yBAAM,EAACC,oBAAS,CAAC,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,mQAQPN,mBAAmB,EAAaA,mBAAmB,EAS9D,IAAAO,kBAAQ,EAAC,gBAAgB,CAAC,CAOtC;;AAED;AACA;AACA;AACAN,KAAK,CAACO,YAAY,GAAG;EACnBC,KAAK,EAAEV,WAAW,CAACW,GAAG,CAAEC,KAAK,IAAK,IAAAC,cAAK,EAACD,KAAK,CAAC,CAAC;EAC/CE,MAAM,EAAE,MAAM;EACdC,KAAK,EAAE;AACT,CAAC;;AAED;AACA;AACA;AACO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAb,yBAAM,EAACD,KAAK,CAAC,CAAAG,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,2CAGxC;;AAED;AACA;AACA;AACO,MAAMW,gBAAgB,GAAAD,OAAA,CAAAC,gBAAA,GAAG,IAAAf,yBAAM,EAACD,KAAK,CAAC,CAAAG,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,2CAG5C"}
1
+ {"version":3,"file":"CarouselNavigation.js","names":["_styledComponents","_interopRequireDefault","require","_helpers","_Clickable","_themeGet","obj","__esModule","default","ARROW_WIDTH","ARROW_TRANSITION_MS","Arrow","styled","Clickable","attrs","props","width","map","value","space","height","color","withConfig","displayName","componentId","themeGet","CarouselNext","exports","CarouselPrevious"],"sources":["../../../../src/elements/Carousel/CarouselNavigation.tsx"],"sourcesContent":["import styled from \"styled-components\"\nimport { space } from \"../../helpers\"\nimport { SpacingUnit } from \"../../Theme\"\nimport { Clickable, ClickableProps } from \"../Clickable\"\nimport { themeGet } from \"@styled-system/theme-get\"\n\nconst ARROW_WIDTH: SpacingUnit[] = [2, 4]\nconst ARROW_TRANSITION_MS = 250\n\n/** CarouselNavigationProps */\nexport type CarouselNavigationProps = ClickableProps\n\nconst Arrow = styled(Clickable).attrs<CarouselNavigationProps>((props) => ({\n width: props.width ?? ARROW_WIDTH.map((value) => space(value)),\n height: props.height ?? \"100%\",\n color: props.color ?? \"mono60\",\n}))<CarouselNavigationProps>`\n position: absolute;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n user-select: none;\n transition: opacity ${ARROW_TRANSITION_MS}ms, color ${ARROW_TRANSITION_MS}ms;\n\n > svg {\n fill: currentColor;\n }\n\n &:hover,\n &:focus {\n outline: 0;\n color: ${themeGet(\"colors.mono100\")};\n }\n\n &:disabled {\n opacity: 0;\n cursor: default;\n }\n`\n\n/**\n * Default next button\n */\nexport const CarouselNext = styled(Arrow)`\n right: 0;\n transform: translateX(100%);\n`\n\n/**\n * Default previous button\n */\nexport const CarouselPrevious = styled(Arrow)`\n left: 0;\n transform: translateX(-100%);\n`\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAAmD,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEnD,MAAMG,WAA0B,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AACzC,MAAMC,mBAAmB,GAAG,GAAG;;AAE/B;;AAGA,MAAMC,KAAK,GAAG,IAAAC,yBAAM,EAACC,oBAAS,CAAC,CAACC,KAAK,CAA2BC,KAAK,KAAM;EACzEC,KAAK,EAAED,KAAK,CAACC,KAAK,IAAIP,WAAW,CAACQ,GAAG,CAAEC,KAAK,IAAK,IAAAC,cAAK,EAACD,KAAK,CAAC,CAAC;EAC9DE,MAAM,EAAEL,KAAK,CAACK,MAAM,IAAI,MAAM;EAC9BC,KAAK,EAAEN,KAAK,CAACM,KAAK,IAAI;AACxB,CAAC,CAAC,CAAC,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,mQAQqBd,mBAAmB,EAAaA,mBAAmB,EAS9D,IAAAe,kBAAQ,EAAC,gBAAgB,CAAC,CAOtC;;AAED;AACA;AACA;AACO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAd,yBAAM,EAACD,KAAK,CAAC,CAAAW,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,2CAGxC;;AAED;AACA;AACA;AACO,MAAMI,gBAAgB,GAAAD,OAAA,CAAAC,gBAAA,GAAG,IAAAhB,yBAAM,EAACD,KAAK,CAAC,CAAAW,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,2CAG5C"}
@@ -10,5 +10,7 @@ export type ClickableProps = React.ButtonHTMLAttributes<HTMLButtonElement> & Box
10
10
  * Clickable is a utility component useful for wrapping things like <div>s
11
11
  * without having to deal with the requirements to make the <div> accessible.
12
12
  */
13
- export declare const Clickable: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ClickableProps>> & string;
13
+ export declare const Clickable: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
14
+ ref?: ((instance: HTMLButtonElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLButtonElement> | null | undefined;
15
+ }>, ClickableProps>, ClickableProps>> & string;
14
16
  export declare const splitClickableProps: <U extends Record<string, unknown>>(props: U) => [ClickableProps, Omit<U, "cursor" | "textDecoration" | keyof BoxProps | keyof React.ButtonHTMLAttributes<HTMLButtonElement>>];
@@ -24,13 +24,12 @@ const clickableMixin = (0, _styledSystem.compose)(_Box.boxMixin, cursor, textDec
24
24
  * Clickable is a utility component useful for wrapping things like <div>s
25
25
  * without having to deal with the requirements to make the <div> accessible.
26
26
  */
27
- const Clickable = exports.Clickable = _styledComponents.default.button.withConfig({
27
+ const Clickable = exports.Clickable = _styledComponents.default.button.attrs(props => ({
28
+ cursor: props.cursor ?? "pointer",
29
+ type: props.type ?? "button"
30
+ })).withConfig({
28
31
  displayName: "Clickable",
29
32
  componentId: "sc-10cr82y-0"
30
33
  })(["appearance:none;padding:0;border:0;margin:0;background-color:transparent;color:inherit;font:inherit;text-align:inherit;", " &:disabled{cursor:default;}"], clickableMixin);
31
- Clickable.defaultProps = {
32
- cursor: "pointer",
33
- type: "button"
34
- };
35
34
  const splitClickableProps = exports.splitClickableProps = (0, _splitProps.splitProps)(clickableMixin);
36
35
  //# sourceMappingURL=Clickable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Clickable.js","names":["_styledComponents","_interopRequireDefault","require","_styledSystem","_splitProps","_Box","obj","__esModule","default","cursor","system","textDecoration","clickableMixin","compose","boxMixin","Clickable","exports","styled","button","withConfig","displayName","componentId","defaultProps","type","splitClickableProps","splitProps"],"sources":["../../../../src/elements/Clickable/Clickable.tsx"],"sourcesContent":["import React from \"react\"\nimport styled from \"styled-components\"\nimport { compose, ResponsiveValue, system } from \"styled-system\"\nimport { splitProps } from \"../../utils/splitProps\"\nimport { boxMixin, BoxProps } from \"../Box\"\n\nconst cursor = system({ cursor: true })\nconst textDecoration = system({ textDecoration: true })\n\n/** ClickableProps */\nexport type ClickableProps = React.ButtonHTMLAttributes<HTMLButtonElement> &\n BoxProps & {\n cursor?: ResponsiveValue<string>\n textDecoration?: ResponsiveValue<string>\n }\n\nconst clickableMixin = compose(boxMixin, cursor, textDecoration)\n\n/**\n * Clickable is a utility component useful for wrapping things like <div>s\n * without having to deal with the requirements to make the <div> accessible.\n */\nexport const Clickable = styled.button<ClickableProps>`\n appearance: none;\n padding: 0;\n border: 0;\n margin: 0;\n background-color: transparent;\n color: inherit;\n font: inherit;\n text-align: inherit;\n\n ${clickableMixin}\n\n &:disabled {\n cursor: default;\n }\n`\n\nClickable.defaultProps = {\n cursor: \"pointer\",\n type: \"button\",\n}\n\nexport const splitClickableProps = splitProps<ClickableProps>(clickableMixin)\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AAA2C,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,MAAM,GAAG,IAAAC,oBAAM,EAAC;EAAED,MAAM,EAAE;AAAK,CAAC,CAAC;AACvC,MAAME,cAAc,GAAG,IAAAD,oBAAM,EAAC;EAAEC,cAAc,EAAE;AAAK,CAAC,CAAC;;AAEvD;;AAOA,MAAMC,cAAc,GAAG,IAAAC,qBAAO,EAACC,aAAQ,EAAEL,MAAM,EAAEE,cAAc,CAAC;;AAEhE;AACA;AACA;AACA;AACO,MAAMI,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAGE,yBAAM,CAACC,MAAM,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gKAUlCT,cAAc,CAKjB;AAEDG,SAAS,CAACO,YAAY,GAAG;EACvBb,MAAM,EAAE,SAAS;EACjBc,IAAI,EAAE;AACR,CAAC;AAEM,MAAMC,mBAAmB,GAAAR,OAAA,CAAAQ,mBAAA,GAAG,IAAAC,sBAAU,EAAiBb,cAAc,CAAC"}
1
+ {"version":3,"file":"Clickable.js","names":["_styledComponents","_interopRequireDefault","require","_styledSystem","_splitProps","_Box","obj","__esModule","default","cursor","system","textDecoration","clickableMixin","compose","boxMixin","Clickable","exports","styled","button","attrs","props","type","withConfig","displayName","componentId","splitClickableProps","splitProps"],"sources":["../../../../src/elements/Clickable/Clickable.tsx"],"sourcesContent":["import React from \"react\"\nimport styled from \"styled-components\"\nimport { compose, ResponsiveValue, system } from \"styled-system\"\nimport { splitProps } from \"../../utils/splitProps\"\nimport { boxMixin, BoxProps } from \"../Box\"\n\nconst cursor = system({ cursor: true })\nconst textDecoration = system({ textDecoration: true })\n\n/** ClickableProps */\nexport type ClickableProps = React.ButtonHTMLAttributes<HTMLButtonElement> &\n BoxProps & {\n cursor?: ResponsiveValue<string>\n textDecoration?: ResponsiveValue<string>\n }\n\nconst clickableMixin = compose(boxMixin, cursor, textDecoration)\n\n/**\n * Clickable is a utility component useful for wrapping things like <div>s\n * without having to deal with the requirements to make the <div> accessible.\n */\nexport const Clickable = styled.button.attrs<ClickableProps>((props) => ({\n cursor: props.cursor ?? \"pointer\",\n type: props.type ?? \"button\",\n}))<ClickableProps>`\n appearance: none;\n padding: 0;\n border: 0;\n margin: 0;\n background-color: transparent;\n color: inherit;\n font: inherit;\n text-align: inherit;\n\n ${clickableMixin}\n\n &:disabled {\n cursor: default;\n }\n`\n\nexport const splitClickableProps = splitProps<ClickableProps>(clickableMixin)\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AAA2C,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,MAAM,GAAG,IAAAC,oBAAM,EAAC;EAAED,MAAM,EAAE;AAAK,CAAC,CAAC;AACvC,MAAME,cAAc,GAAG,IAAAD,oBAAM,EAAC;EAAEC,cAAc,EAAE;AAAK,CAAC,CAAC;;AAEvD;;AAOA,MAAMC,cAAc,GAAG,IAAAC,qBAAO,EAACC,aAAQ,EAAEL,MAAM,EAAEE,cAAc,CAAC;;AAEhE;AACA;AACA;AACA;AACO,MAAMI,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAGE,yBAAM,CAACC,MAAM,CAACC,KAAK,CAAkBC,KAAK,KAAM;EACvEX,MAAM,EAAEW,KAAK,CAACX,MAAM,IAAI,SAAS;EACjCY,IAAI,EAAED,KAAK,CAACC,IAAI,IAAI;AACtB,CAAC,CAAC,CAAC,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,gKAUCZ,cAAc,CAKjB;AAEM,MAAMa,mBAAmB,GAAAT,OAAA,CAAAS,mBAAA,GAAG,IAAAC,sBAAU,EAAiBd,cAAc,CAAC"}
@@ -6,6 +6,8 @@ export type FlexProps = BoxProps;
6
6
  /**
7
7
  * Flex is Box with display: flex
8
8
  */
9
- export declare const Flex: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
9
+ export declare const Flex: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
10
10
  ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
11
- }, BoxProps>> & string;
11
+ }, Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
12
+ ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
13
+ }>, BoxProps>, BoxProps>> & string;
@@ -14,12 +14,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
14
14
  /**
15
15
  * Flex is Box with display: flex
16
16
  */
17
- const Flex = exports.Flex = (0, _styledComponents.default)(_Box.Box).withConfig({
17
+ const Flex = exports.Flex = (0, _styledComponents.default)(_Box.Box).attrs(props => ({
18
+ display: props.display ?? "flex"
19
+ })).withConfig({
18
20
  displayName: "Flex",
19
21
  componentId: "sc-cw39ct-0"
20
22
  })([""]);
21
- Flex.defaultProps = {
22
- display: "flex"
23
- };
24
23
  Flex.displayName = "Flex";
25
24
  //# sourceMappingURL=Flex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.js","names":["_styledComponents","_interopRequireDefault","require","_Box","obj","__esModule","default","Flex","exports","styled","Box","withConfig","displayName","componentId","defaultProps","display"],"sources":["../../../../src/elements/Flex/Flex.tsx"],"sourcesContent":["import styled from \"styled-components\"\nimport { Box, BoxProps } from \"../Box\"\n\n/**\n * Flex is Box with display: flex\n */\nexport type FlexProps = BoxProps\n\n/**\n * Flex is Box with display: flex\n */\nexport const Flex = styled(Box)<FlexProps>``\n\nFlex.defaultProps = {\n display: \"flex\",\n}\n\nFlex.displayName = \"Flex\"\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAAsC,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEtC;AACA;AACA;;AAGA;AACA;AACA;AACO,MAAMG,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG,IAAAE,yBAAM,EAACC,QAAG,CAAC,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,QAAa;AAE5CN,IAAI,CAACO,YAAY,GAAG;EAClBC,OAAO,EAAE;AACX,CAAC;AAEDR,IAAI,CAACK,WAAW,GAAG,MAAM"}
1
+ {"version":3,"file":"Flex.js","names":["_styledComponents","_interopRequireDefault","require","_Box","obj","__esModule","default","Flex","exports","styled","Box","attrs","props","display","withConfig","displayName","componentId"],"sources":["../../../../src/elements/Flex/Flex.tsx"],"sourcesContent":["import styled from \"styled-components\"\nimport { Box, BoxProps } from \"../Box\"\n\n/**\n * Flex is Box with display: flex\n */\nexport type FlexProps = BoxProps\n\n/**\n * Flex is Box with display: flex\n */\nexport const Flex = styled(Box).attrs<FlexProps>((props) => ({\n display: props.display ?? \"flex\",\n}))<FlexProps>``\n\nFlex.displayName = \"Flex\"\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAAsC,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEtC;AACA;AACA;;AAGA;AACA;AACA;AACO,MAAMG,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG,IAAAE,yBAAM,EAACC,QAAG,CAAC,CAACC,KAAK,CAAaC,KAAK,KAAM;EAC3DC,OAAO,EAAED,KAAK,CAACC,OAAO,IAAI;AAC5B,CAAC,CAAC,CAAC,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,QAAa;AAEhBT,IAAI,CAACQ,WAAW,GAAG,MAAM"}
@@ -4,6 +4,8 @@ export type FullBleedProps = BoxProps;
4
4
  /**
5
5
  * Utility to break out of parent containers
6
6
  */
7
- export declare const FullBleed: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
7
+ export declare const FullBleed: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
8
8
  ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
9
- }, never>> & string;
9
+ }, Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, "ref"> & {
10
+ ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
11
+ }>, BoxProps>, BoxProps>> & string;
@@ -12,17 +12,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
12
12
  /**
13
13
  * Utility to break out of parent containers
14
14
  */
15
- const FullBleed = exports.FullBleed = (0, _styledComponents.default)(_Box.Box).withConfig({
15
+ const FullBleed = exports.FullBleed = (0, _styledComponents.default)(_Box.Box).attrs(props => ({
16
+ position: props.position ?? "relative",
17
+ left: props.left ?? "50%",
18
+ right: props.right ?? "50%",
19
+ width: props.width ?? "100vw",
20
+ maxWidth: props.maxWidth ?? "100vw",
21
+ marginLeft: props.marginLeft ?? "-50vw",
22
+ marginRight: props.marginRight ?? "-50vw"
23
+ })).withConfig({
16
24
  displayName: "FullBleed",
17
25
  componentId: "sc-g9qwfe-0"
18
26
  })([""]);
19
- FullBleed.defaultProps = {
20
- position: "relative",
21
- left: "50%",
22
- right: "50%",
23
- width: "100vw",
24
- maxWidth: "100vw",
25
- marginLeft: "-50vw",
26
- marginRight: "-50vw"
27
- };
28
27
  //# sourceMappingURL=FullBleed.js.map