@artsy/palette 38.1.5 → 38.3.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.
@@ -2,6 +2,7 @@ import React from "react";
2
2
  export interface ReadMoreProps {
3
3
  content: string;
4
4
  disabled?: boolean;
5
+ inlineReadMoreLink?: boolean;
5
6
  isExpanded?: boolean;
6
7
  maxChars?: number;
7
8
  onReadLessClicked?: () => void;
@@ -24,6 +24,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
24
  var ReadMore = function ReadMore(_ref) {
25
25
  var expandedHTML = _ref.content,
26
26
  disabled = _ref.disabled,
27
+ _ref$inlineReadMoreLi = _ref.inlineReadMoreLink,
28
+ inlineReadMoreLink = _ref$inlineReadMoreLi === void 0 ? true : _ref$inlineReadMoreLi,
27
29
  isExpanded = _ref.isExpanded,
28
30
  _ref$maxChars = _ref.maxChars,
29
31
  maxChars = _ref$maxChars === void 0 ? Infinity : _ref$maxChars,
@@ -66,11 +68,15 @@ var ReadMore = function ReadMore(_ref) {
66
68
  fontWeight: "bold"
67
69
  }, "Read less"))) : /*#__PURE__*/_react.default.createElement(_Clickable.Clickable, {
68
70
  onClick: handleClick
69
- }, /*#__PURE__*/_react.default.createElement("span", {
71
+ }, inlineReadMoreLink ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
70
72
  dangerouslySetInnerHTML: {
71
73
  __html: truncatedHTML
72
74
  }
73
- }), " ", /*#__PURE__*/_react.default.createElement(_Text.Text, {
75
+ }), " ") : /*#__PURE__*/_react.default.createElement(_Box.Box, {
76
+ dangerouslySetInnerHTML: {
77
+ __html: truncatedHTML
78
+ }
79
+ }), /*#__PURE__*/_react.default.createElement(_Text.Text, {
74
80
  as: "span",
75
81
  variant: "xs",
76
82
  fontWeight: "bold",
@@ -1 +1 @@
1
- {"version":3,"file":"ReadMore.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_truncHtml","_Clickable","_Text","_Box","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","length","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","ReadMore","_ref","expandedHTML","content","disabled","isExpanded","_ref$maxChars","maxChars","Infinity","onReadLessClicked","onReadMoreClicked","_useState","useState","_useState2","expanded","setExpanded","charCount","replace","HTML_TAG_REGEX","truncatedHTML","truncate","html","visible","handleClick","expandedState","createElement","dangerouslySetInnerHTML","__html","Container","Fragment","Box","Clickable","cursor","textDecoration","onClick","Text","variant","fontWeight","as","style","exports","displayName","styled","div","withConfig","componentId"],"sources":["../../../src/elements/ReadMore/ReadMore.tsx"],"sourcesContent":["import React, { useState } from \"react\"\nimport styled from \"styled-components\"\nimport truncate from \"trunc-html\"\nimport { Clickable } from \"../Clickable\"\nimport { Text } from \"../Text\"\nimport { Box } from \"../Box\"\n\nexport interface ReadMoreProps {\n content: string\n disabled?: boolean\n isExpanded?: boolean\n maxChars?: number\n onReadLessClicked?: () => void\n onReadMoreClicked?: () => void\n}\n\n/** ReadMore */\nexport const ReadMore: React.FC<ReadMoreProps> = ({\n content: expandedHTML,\n disabled,\n isExpanded,\n maxChars = Infinity,\n onReadLessClicked,\n onReadMoreClicked,\n}) => {\n const [expanded, setExpanded] = useState(!!isExpanded)\n\n if (typeof expandedHTML !== \"string\") return null\n\n const charCount = expandedHTML.replace(HTML_TAG_REGEX, \"\").length\n\n const truncatedHTML = truncate(expandedHTML, maxChars).html\n\n const visible = charCount > maxChars\n\n const handleClick = () => {\n if (disabled) return\n setExpanded((expandedState) => !expandedState)\n\n expanded\n ? onReadLessClicked && onReadLessClicked()\n : onReadMoreClicked && onReadMoreClicked()\n }\n\n if (!visible) {\n return (\n <span\n dangerouslySetInnerHTML={{\n __html: expandedHTML,\n }}\n />\n )\n }\n\n return (\n <Container aria-expanded={expanded}>\n {expanded ? (\n <>\n <Box dangerouslySetInnerHTML={{ __html: expandedHTML }} />\n\n <Clickable\n cursor=\"pointer\"\n textDecoration=\"underline\"\n onClick={handleClick}\n >\n <Text variant=\"xs\" fontWeight=\"bold\">\n Read less\n </Text>\n </Clickable>\n </>\n ) : (\n <Clickable onClick={handleClick}>\n <span dangerouslySetInnerHTML={{ __html: truncatedHTML }} />{\" \"}\n <Text\n as=\"span\"\n variant=\"xs\"\n fontWeight=\"bold\"\n style={{ textDecoration: \"underline\" }}\n >\n Read more\n </Text>\n </Clickable>\n )}\n </Container>\n )\n}\n\nconst Container = styled.div`\n > * > span > *:last-child {\n display: inherit;\n }\n`\n\nContainer.displayName = \"Container\"\n\nconst HTML_TAG_REGEX = /(<([^>]+)>)/gi\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAA4B,SAAAE,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAZ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,UAAU,EAAC,MAAM;IACjBE,KAAK,EAAE;MAAEN,cAAc,EAAE;IAAY;EAAE,GACxC,WAED,CAAO,CAEV,CACS;AAEhB,CAAC;AAAAO,OAAA,CAAAxC,QAAA,GAAAA,QAAA;AApEYA,QAAiC,CAAAyC,WAAA;AAsE9C,IAAMb,SAAS,GAAGc,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAH,WAAA;EAAAI,WAAA;AAAA,mDAI3B;AAEDjB,SAAS,CAACa,WAAW,GAAG,WAAW;AAEnC,IAAMvB,cAAc,GAAG,eAAe"}
1
+ {"version":3,"file":"ReadMore.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_truncHtml","_Clickable","_Text","_Box","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","length","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","ReadMore","_ref","expandedHTML","content","disabled","_ref$inlineReadMoreLi","inlineReadMoreLink","isExpanded","_ref$maxChars","maxChars","Infinity","onReadLessClicked","onReadMoreClicked","_useState","useState","_useState2","expanded","setExpanded","charCount","replace","HTML_TAG_REGEX","truncatedHTML","truncate","html","visible","handleClick","expandedState","createElement","dangerouslySetInnerHTML","__html","Container","Fragment","Box","Clickable","cursor","textDecoration","onClick","Text","variant","fontWeight","as","style","exports","displayName","styled","div","withConfig","componentId"],"sources":["../../../src/elements/ReadMore/ReadMore.tsx"],"sourcesContent":["import React, { useState } from \"react\"\nimport styled from \"styled-components\"\nimport truncate from \"trunc-html\"\nimport { Clickable } from \"../Clickable\"\nimport { Text } from \"../Text\"\nimport { Box } from \"../Box\"\n\nexport interface ReadMoreProps {\n content: string\n disabled?: boolean\n inlineReadMoreLink?: boolean\n isExpanded?: boolean\n maxChars?: number\n onReadLessClicked?: () => void\n onReadMoreClicked?: () => void\n}\n\n/** ReadMore */\nexport const ReadMore: React.FC<ReadMoreProps> = ({\n content: expandedHTML,\n disabled,\n inlineReadMoreLink = true,\n isExpanded,\n maxChars = Infinity,\n onReadLessClicked,\n onReadMoreClicked,\n}) => {\n const [expanded, setExpanded] = useState(!!isExpanded)\n\n if (typeof expandedHTML !== \"string\") return null\n\n const charCount = expandedHTML.replace(HTML_TAG_REGEX, \"\").length\n\n const truncatedHTML = truncate(expandedHTML, maxChars).html\n\n const visible = charCount > maxChars\n\n const handleClick = () => {\n if (disabled) return\n setExpanded((expandedState) => !expandedState)\n\n expanded\n ? onReadLessClicked && onReadLessClicked()\n : onReadMoreClicked && onReadMoreClicked()\n }\n\n if (!visible) {\n return (\n <span\n dangerouslySetInnerHTML={{\n __html: expandedHTML,\n }}\n />\n )\n }\n\n return (\n <Container aria-expanded={expanded}>\n {expanded ? (\n <>\n <Box dangerouslySetInnerHTML={{ __html: expandedHTML }} />\n\n <Clickable\n cursor=\"pointer\"\n textDecoration=\"underline\"\n onClick={handleClick}\n >\n <Text variant=\"xs\" fontWeight=\"bold\">\n Read less\n </Text>\n </Clickable>\n </>\n ) : (\n <Clickable onClick={handleClick}>\n {inlineReadMoreLink ? (\n <>\n <span dangerouslySetInnerHTML={{ __html: truncatedHTML }} />{\" \"}\n </>\n ) : (\n <Box dangerouslySetInnerHTML={{ __html: truncatedHTML }} />\n )}\n\n <Text\n as=\"span\"\n variant=\"xs\"\n fontWeight=\"bold\"\n style={{ textDecoration: \"underline\" }}\n >\n Read more\n </Text>\n </Clickable>\n )}\n </Container>\n )\n}\n\nconst Container = styled.div`\n > * > span > *:last-child {\n display: inherit;\n }\n`\n\nContainer.displayName = \"Container\"\n\nconst HTML_TAG_REGEX = /(<([^>]+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AAG,WAAW;AAEnC,IAAMvB,cAAc,GAAG,eAAe"}
@@ -44,3 +44,9 @@ export declare const CharacterCapWithHtmlDisabled: {
44
44
  name: string;
45
45
  };
46
46
  };
47
+ export declare const WithBottomReadMore: {
48
+ (): JSX.Element;
49
+ story: {
50
+ name: string;
51
+ };
52
+ };
@@ -3,10 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.WithCustomizableTypography2 = exports.WithCustomizableTypography = exports.WithCharacterCap = exports.ShortContent = exports.CharacterCapWithHtmlDisabled = exports.CharacterCapWithHtml = exports.AsString = void 0;
6
+ exports.default = exports.WithCustomizableTypography2 = exports.WithCustomizableTypography = exports.WithCharacterCap = exports.WithBottomReadMore = exports.ShortContent = exports.CharacterCapWithHtmlDisabled = exports.CharacterCapWithHtml = exports.AsString = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _HTML = require("../HTML");
9
9
  var _ReadMore = require("./ReadMore");
10
+ var _Box = require("../Box");
10
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12
  var _default = {
12
13
  title: "Components/ReadMore"
@@ -92,4 +93,21 @@ CharacterCapWithHtmlDisabled.displayName = "CharacterCapWithHtmlDisabled";
92
93
  CharacterCapWithHtmlDisabled.story = {
93
94
  name: "Character cap with html (disabled)"
94
95
  };
96
+ var WithBottomReadMore = function WithBottomReadMore() {
97
+ return /*#__PURE__*/_react.default.createElement(_Box.Box, {
98
+ textAlign: "center",
99
+ width: 600
100
+ }, /*#__PURE__*/_react.default.createElement(_HTML.HTML, {
101
+ variant: "lg"
102
+ }, /*#__PURE__*/_react.default.createElement(_ReadMore.ReadMore, {
103
+ inlineReadMoreLink: false,
104
+ maxChars: 280,
105
+ content: "<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>"
106
+ })));
107
+ };
108
+ exports.WithBottomReadMore = WithBottomReadMore;
109
+ WithBottomReadMore.displayName = "WithBottomReadMore";
110
+ WithBottomReadMore.story = {
111
+ name: "With bottom placed 'Read More'"
112
+ };
95
113
  //# sourceMappingURL=ReadMore.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReadMore.story.js","names":["_react","_interopRequireDefault","require","_HTML","_ReadMore","obj","__esModule","default","_default","title","exports","WithCharacterCap","createElement","ReadMore","maxChars","content","displayName","story","name","ShortContent","AsString","CharacterCapWithHtml","WithCustomizableTypography","HTML","WithCustomizableTypography2","variant","CharacterCapWithHtmlDisabled","disabled"],"sources":["../../../src/elements/ReadMore/ReadMore.story.tsx"],"sourcesContent":["import React from \"react\"\nimport { HTML } from \"../HTML\"\nimport { ReadMore } from \"./ReadMore\"\n\nexport default {\n title: \"Components/ReadMore\",\n}\n\nexport const WithCharacterCap = () => {\n return (\n <ReadMore\n maxChars={300}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>`}\n />\n )\n}\n\nWithCharacterCap.story = {\n name: \"With character cap\",\n}\n\nexport const ShortContent = () => {\n return (\n <ReadMore\n maxChars={300}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>.\n </div>`}\n />\n )\n}\n\nShortContent.story = {\n name: \"Short content\",\n}\n\nexport const AsString = () => {\n return (\n <ReadMore\n maxChars={300}\n content=\"Donald Judd, widely regarded as one of the most significant American artists of the post-war period, is perhaps best-known for the large-scale outdoor installations and long, spacious interiors he designed in Marfa. Donald Judd, widely regarded as one of the most significant American artists of the post-war period, is perhaps best-known for the large-scale outdoor installations and long, spacious interiors he designed in Marfa.\"\n />\n )\n}\n\nAsString.story = {\n name: \"As string\",\n}\n\nexport const CharacterCapWithHtml = () => {\n return (\n <ReadMore\n maxChars={300}\n content={`<p>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur adipisicing\n elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est temporibus\n labore sint aliquam, laudantium tempore. Tenetur adipisci cumque\n alias facilis animi. Illum.\n </p>`}\n />\n )\n}\n\nCharacterCapWithHtml.story = {\n name: \"Character cap with HTML\",\n}\n\nexport const WithCustomizableTypography = () => {\n return (\n <HTML>\n <ReadMore\n maxChars={300}\n content={`\n <p>\n Donald Judd, widely regarded as one of the most significant\n American artists of <a href=\"#\">the post-war period</a>, is\n perhaps best-known for the large-scale outdoor installations and\n long, spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur\n adipisicing elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum\n assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est\n temporibus labore sint aliquam, laudantium tempore. Tenetur\n adipisci cumque alias facilis animi. Illum.\n </p>`}\n />\n </HTML>\n )\n}\n\nWithCustomizableTypography.story = {\n name: \"With customizable typography\",\n}\n\nexport const WithCustomizableTypography2 = () => {\n return (\n <HTML variant=\"lg\">\n <ReadMore\n maxChars={300}\n content={`<p>\n Donald Judd, widely regarded as one of the most significant\n American artists of <a href=\"#\">the post-war period</a>, is\n perhaps best-known for the large-scale outdoor installations and\n long, spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur\n adipisicing elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum\n assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est\n temporibus labore sint aliquam, laudantium tempore. Tenetur\n adipisci cumque alias facilis animi. Illum.\n </p>`}\n />\n </HTML>\n )\n}\n\nWithCustomizableTypography2.story = {\n name: \"With customizable typography (2)\",\n}\n\nexport const CharacterCapWithHtmlDisabled = () => {\n return (\n <ReadMore\n disabled\n maxChars={300}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>`}\n />\n )\n}\n\nCharacterCapWithHtmlDisabled.story = {\n name: \"Character cap with html (disabled)\",\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAAqC,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,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QG,EACV;AAEN,CAAC;AAAAL,OAAA,CAAAgB,4BAAA,GAAAA,4BAAA;AAhBYA,4BAA4B,CAAAV,WAAA;AAkBzCU,4BAA4B,CAACT,KAAK,GAAG;EACnCC,IAAI,EAAE;AACR,CAAC"}
1
+ {"version":3,"file":"ReadMore.story.js","names":["_react","_interopRequireDefault","require","_HTML","_ReadMore","_Box","obj","__esModule","default","_default","title","exports","WithCharacterCap","createElement","ReadMore","maxChars","content","displayName","story","name","ShortContent","AsString","CharacterCapWithHtml","WithCustomizableTypography","HTML","WithCustomizableTypography2","variant","CharacterCapWithHtmlDisabled","disabled","WithBottomReadMore","Box","textAlign","width","inlineReadMoreLink"],"sources":["../../../src/elements/ReadMore/ReadMore.story.tsx"],"sourcesContent":["import React from \"react\"\nimport { HTML } from \"../HTML\"\nimport { ReadMore } from \"./ReadMore\"\nimport { Box } from \"../Box\"\n\nexport default {\n title: \"Components/ReadMore\",\n}\n\nexport const WithCharacterCap = () => {\n return (\n <ReadMore\n maxChars={300}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>`}\n />\n )\n}\n\nWithCharacterCap.story = {\n name: \"With character cap\",\n}\n\nexport const ShortContent = () => {\n return (\n <ReadMore\n maxChars={300}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>.\n </div>`}\n />\n )\n}\n\nShortContent.story = {\n name: \"Short content\",\n}\n\nexport const AsString = () => {\n return (\n <ReadMore\n maxChars={300}\n content=\"Donald Judd, widely regarded as one of the most significant American artists of the post-war period, is perhaps best-known for the large-scale outdoor installations and long, spacious interiors he designed in Marfa. Donald Judd, widely regarded as one of the most significant American artists of the post-war period, is perhaps best-known for the large-scale outdoor installations and long, spacious interiors he designed in Marfa.\"\n />\n )\n}\n\nAsString.story = {\n name: \"As string\",\n}\n\nexport const CharacterCapWithHtml = () => {\n return (\n <ReadMore\n maxChars={300}\n content={`<p>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur adipisicing\n elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est temporibus\n labore sint aliquam, laudantium tempore. Tenetur adipisci cumque\n alias facilis animi. Illum.\n </p>`}\n />\n )\n}\n\nCharacterCapWithHtml.story = {\n name: \"Character cap with HTML\",\n}\n\nexport const WithCustomizableTypography = () => {\n return (\n <HTML>\n <ReadMore\n maxChars={300}\n content={`\n <p>\n Donald Judd, widely regarded as one of the most significant\n American artists of <a href=\"#\">the post-war period</a>, is\n perhaps best-known for the large-scale outdoor installations and\n long, spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur\n adipisicing elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum\n assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est\n temporibus labore sint aliquam, laudantium tempore. Tenetur\n adipisci cumque alias facilis animi. Illum.\n </p>`}\n />\n </HTML>\n )\n}\n\nWithCustomizableTypography.story = {\n name: \"With customizable typography\",\n}\n\nexport const WithCustomizableTypography2 = () => {\n return (\n <HTML variant=\"lg\">\n <ReadMore\n maxChars={300}\n content={`<p>\n Donald Judd, widely regarded as one of the most significant\n American artists of <a href=\"#\">the post-war period</a>, is\n perhaps best-known for the large-scale outdoor installations and\n long, spacious interiors he designed in Marfa. Donald Judd, widely\n regarded as one of the most significant American artists of the\n post-war period, is perhaps best-known for the large-scale outdoor\n installations and long, spacious interiors he designed in Marfa.\n </p>\n <hr />\n <p>\n <strong>Lorem ipsum dolor</strong> sit amet consectetur\n adipisicing elit. Ducimus eligendi obcaecati voluptate\n <em>molestias vero nobis voluptatum</em>, tenetur dolorum\n assumenda.\n </p>\n <p>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis\n eveniet aliquid laborum fugiat quibusdam id suscipit est\n temporibus labore sint aliquam, laudantium tempore. Tenetur\n adipisci cumque alias facilis animi. Illum.\n </p>`}\n />\n </HTML>\n )\n}\n\nWithCustomizableTypography2.story = {\n name: \"With customizable typography (2)\",\n}\n\nexport const CharacterCapWithHtmlDisabled = () => {\n return (\n <ReadMore\n disabled\n maxChars={300}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>`}\n />\n )\n}\n\nCharacterCapWithHtmlDisabled.story = {\n name: \"Character cap with html (disabled)\",\n}\n\nexport const WithBottomReadMore = () => {\n return (\n <Box textAlign=\"center\" width={600}>\n <HTML variant=\"lg\">\n <ReadMore\n inlineReadMoreLink={false}\n maxChars={280}\n content={`<div>\n Donald Judd, widely regarded as one of the most significant American\n artists of <a href=\"#\">the post-war period</a>, is perhaps best-known\n for the large-scale outdoor installations and long, spacious interiors\n he designed in Marfa. Donald Judd, widely regarded as one of the most\n significant American artists of the post-war period, is perhaps\n best-known for the large-scale outdoor installations and long,\n spacious interiors he designed in Marfa.\n </div>`}\n />\n </HTML>\n </Box>\n )\n}\n\nWithBottomReadMore.story = {\n name: \"With bottom placed 'Read More'\",\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AAA4B,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAEb;EACbC,KAAK,EAAE;AACT,CAAC;AAAAC,OAAA,CAAAH,OAAA,GAAAC,QAAA;AAEM,IAAMG,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAA,EAAS;EACpC,oBACEZ,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAACT,SAAA,CAAAU,QAAQ;IACPC,QAAQ,EAAE,GAAI;IACdC,OAAO;EAQG,EACV;AAEN,CAAC;AAAAL,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAfYA,gBAAgB,CAAAK,WAAA;AAiB7BL,gBAAgB,CAACM,KAAK,GAAG;EACvBC,IAAI,EAAE;AACR,CAAC;AAEM,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAA,EAAS;EAChC,oBACEpB,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAACT,SAAA,CAAAU,QAAQ;IACPC,QAAQ,EAAE,GAAI;IACdC,OAAO;EAGG,EACV;AAEN,CAAC;AAAAL,OAAA,CAAAS,YAAA,GAAAA,YAAA;AAVYA,YAAY,CAAAH,WAAA;AAYzBG,YAAY,CAACF,KAAK,GAAG;EACnBC,IAAI,EAAE;AACR,CAAC;AAEM,IAAME,QAAQ,GAAG,SAAXA,QAAQA,CAAA,EAAS;EAC5B,oB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ributes<HTMLDivElement>, "onSelect"> {
4
+ /** Disable toggle interactions */
5
+ disabled?: boolean;
6
+ /** Select the toggle on render */
7
+ selected?: boolean;
8
+ /** Used to force the toggle into the visual hover state */
9
+ hover?: boolean;
10
+ /** Callback when selected */
11
+ onSelect?: (selected: boolean) => void;
12
+ }
13
+ /** A toggle */
14
+ export declare const Toggle: React.FC<ToggleProps>;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.Toggle = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
10
+ var _Box = require("../Box");
11
+ var _tokens = require("./tokens");
12
+ var _themeGet = require("@styled-system/theme-get");
13
+ var _excluded = ["selected", "disabled", "onSelect", "onClick"];
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
18
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
19
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
+ /** A toggle */
21
+ var Toggle = function Toggle(_ref) {
22
+ var _ref$selected = _ref.selected,
23
+ selected = _ref$selected === void 0 ? false : _ref$selected,
24
+ disabled = _ref.disabled,
25
+ onSelect = _ref.onSelect,
26
+ onClick = _ref.onClick,
27
+ rest = _objectWithoutProperties(_ref, _excluded);
28
+ var isSelectable = !disabled && onSelect !== undefined;
29
+ var handleClick = function handleClick(event) {
30
+ if (isSelectable && onSelect) {
31
+ onSelect(!selected);
32
+ }
33
+ if (onClick) {
34
+ onClick(event);
35
+ }
36
+ };
37
+ var handleKeyPress = function handleKeyPress(event) {
38
+ if (event.key === " " && isSelectable && onSelect) {
39
+ event.preventDefault();
40
+ onSelect(!selected);
41
+ }
42
+ };
43
+ return /*#__PURE__*/_react.default.createElement(Container, _extends({
44
+ display: "flex",
45
+ alignItems: "center",
46
+ onClick: handleClick,
47
+ tabIndex: disabled ? -1 : 0,
48
+ onKeyPress: handleKeyPress,
49
+ role: "toggle",
50
+ "aria-checked": selected,
51
+ selected: selected,
52
+ disabled: disabled
53
+ }, rest), /*#__PURE__*/_react.default.createElement(Switch, {
54
+ selected: selected
55
+ }));
56
+ };
57
+ exports.Toggle = Toggle;
58
+ Toggle.displayName = "Toggle";
59
+ var Switch = (0, _styledComponents.default)(_Box.Box).withConfig({
60
+ displayName: "Toggle__Switch",
61
+ componentId: "sc-1yxwor4-0"
62
+ })(["width:26px;height:26px;margin:3px;border-radius:50%;transition:transform 0.3s;box-shadow:", ";", ""], (0, _themeGet.themeGet)("effects.dropShadow"), function (props) {
63
+ return (0, _styledComponents.css)(["", ""], props.selected ? _tokens.SWITCH_STATES.selected : _tokens.SWITCH_STATES.default);
64
+ });
65
+ var Container = (0, _styledComponents.default)(_Box.Box).withConfig({
66
+ displayName: "Toggle__Container",
67
+ componentId: "sc-1yxwor4-1"
68
+ })(["user-select:none;border-radius:100px;width:51px;height:31px;", ""], function (props) {
69
+ return (0, _styledComponents.css)(["", " ", " ", ""], props.selected ? _tokens.TOGGLE_STATES.selected : _tokens.TOGGLE_STATES.default, props.hover && _tokens.TOGGLE_STATES.hover, props.disabled && (props.selected ? _tokens.TOGGLE_STATES.disabled.selected : _tokens.TOGGLE_STATES.disabled.default));
70
+ });
71
+ //# sourceMappingURL=Toggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toggle.js","names":["_react","_interopRequireDefault","require","_styledComponents","_interopRequireWildcard","_Box","_tokens","_themeGet","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","Toggle","_ref","_ref$selected","selected","disabled","onSelect","onClick","rest","isSelectable","undefined","handleClick","event","handleKeyPress","preventDefault","createElement","Container","display","alignItems","tabIndex","onKeyPress","role","Switch","exports","displayName","styled","Box","withConfig","componentId","themeGet","props","css","SWITCH_STATES","TOGGLE_STATES","hover"],"sources":["../../../src/elements/Toggle/Toggle.tsx"],"sourcesContent":["import React from \"react\"\nimport styled, { css } from \"styled-components\"\nimport { Box, BoxProps } from \"../Box\"\nimport { SWITCH_STATES, TOGGLE_STATES } from \"./tokens\"\nimport { themeGet } from \"@styled-system/theme-get\"\n\nexport interface ToggleProps\n extends BoxProps,\n Omit<React.HTMLAttributes<HTMLDivElement>, \"onSelect\"> {\n /** Disable toggle interactions */\n disabled?: boolean\n /** Select the toggle on render */\n selected?: boolean\n /** Used to force the toggle into the visual hover state */\n hover?: boolean\n /** Callback when selected */\n onSelect?: (selected: boolean) => void\n}\n\n/** A toggle */\nexport const Toggle: React.FC<ToggleProps> = ({\n selected = false,\n disabled,\n onSelect,\n onClick,\n ...rest\n}) => {\n const isSelectable = !disabled && onSelect !== undefined\n\n const handleClick = (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n if (isSelectable && onSelect) {\n onSelect(!selected)\n }\n\n if (onClick) {\n onClick(event)\n }\n }\n\n const handleKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \" \" && isSelectable && onSelect) {\n event.preventDefault()\n onSelect(!selected)\n }\n }\n\n return (\n <Container\n display=\"flex\"\n alignItems=\"center\"\n onClick={handleClick}\n tabIndex={disabled ? -1 : 0}\n onKeyPress={handleKeyPress}\n role=\"toggle\"\n aria-checked={selected}\n selected={selected}\n disabled={disabled}\n {...rest}\n >\n <Switch selected={selected} />\n </Container>\n )\n}\n\nconst Switch = styled(Box)<{ selected: boolean }>`\n width: 26px;\n height: 26px;\n margin: 3px;\n border-radius: 50%;\n transition: transform 0.3s;\n box-shadow: ${themeGet(\"effects.dropShadow\")};\n\n ${(props) => {\n return css`\n ${props.selected ? SWITCH_STATES.selected : SWITCH_STATES.default}\n `\n }}\n`\n\nconst Container = styled(Box)<{\n selected: boolean\n hover?: boolean\n disabled?: boolean\n}>`\n user-select: none;\n border-radius: 100px;\n width: 51px;\n height: 31px;\n\n ${(props) => {\n return css`\n ${props.selected ? TOGGLE_STATES.selected : TOGGLE_STATES.default}\n ${props.hover && TOGGLE_STATES.hover}\n ${props.disabled &&\n (props.selected\n ? TOGGLE_STATES.disabled.selected\n : TOGGLE_STATES.disabled.default)}\n `\n }}\n`\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAAmD,IAAAM,SAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,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,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,4BAAAG,OAAA,EAAAH,GAAA,UAAAI,KAAA,GAAAT,wBAAA,CAAAC,WAAA,OAAAQ,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAL,GAAA,YAAAI,KAAA,CAAAE,GAAA,CAAAN,GAAA,SAAAO,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAA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C,CAAAC,UAAA;EAAAH,WAAA;EAAAI,WAAA;AAAA,yEAUzB,UAACE,KAAK,EAAK;EACX,WAAOC,qBAAG,sBACND,KAAK,CAAC1B,QAAQ,GAAG6B,qBAAa,CAAC7B,QAAQ,GAAG6B,qBAAa,CAACjE,OAAO,EAC/D8D,KAAK,CAACI,KAAK,IAAID,qBAAa,CAACC,KAAK,EAClCJ,KAAK,CAACzB,QAAQ,KACfyB,KAAK,CAAC1B,QAAQ,GACX6B,qBAAa,CAAC5B,QAAQ,CAACD,QAAQ,GAC/B6B,qBAAa,CAAC5B,QAAQ,CAACrC,OAAO,CAAC;AAEvC,CAAC,CACF"}
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ title: string;
3
+ };
4
+ export default _default;
5
+ export declare const Default: () => JSX.Element;
6
+ export declare const Demo: () => JSX.Element;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = exports.Demo = exports.Default = void 0;
8
+ var _addonActions = require("@storybook/addon-actions");
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _storybookStates = require("storybook-states");
11
+ var _Toggle = require("./Toggle");
12
+ var _Text = require("../Text");
13
+ var _Flex = require("../Flex");
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
20
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
21
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
+ var _default = {
23
+ title: "Components/Toggle"
24
+ };
25
+ exports.default = _default;
26
+ var Default = function Default() {
27
+ return /*#__PURE__*/_react.default.createElement(_storybookStates.States, {
28
+ states: [{}, {
29
+ selected: true
30
+ }, {
31
+ hover: true
32
+ }, {
33
+ hover: true,
34
+ selected: true
35
+ }, {
36
+ disabled: true
37
+ }, {
38
+ disabled: true,
39
+ selected: true
40
+ }]
41
+ }, /*#__PURE__*/_react.default.createElement(_Toggle.Toggle, null));
42
+ };
43
+ exports.Default = Default;
44
+ Default.displayName = "Default";
45
+ var Demo = function Demo() {
46
+ var _useState = (0, _react.useState)(false),
47
+ _useState2 = _slicedToArray(_useState, 2),
48
+ isSelected = _useState2[0],
49
+ setSelected = _useState2[1];
50
+ return /*#__PURE__*/_react.default.createElement(_storybookStates.States, null, /*#__PURE__*/_react.default.createElement(_Flex.Flex, null, /*#__PURE__*/_react.default.createElement(_Text.Text, {
51
+ px: 1
52
+ }, isSelected ? "On" : "Off", " "), /*#__PURE__*/_react.default.createElement(_Toggle.Toggle, {
53
+ selected: isSelected,
54
+ onSelect: function onSelect(selected) {
55
+ setSelected(selected);
56
+ (0, _addonActions.action)("onClick")(selected);
57
+ }
58
+ }, "Example")));
59
+ };
60
+ exports.Demo = Demo;
61
+ Demo.displayName = "Demo";
62
+ //# sourceMappingURL=Toggle.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toggle.story.js","names":["_addonActions","require","_react","_interopRequireWildcard","_storybookStates","_Toggle","_Text","_Flex","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","length","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","_default","title","exports","Default","createElement","States","states","selected","hover","disabled","Toggle","displayName","Demo","_useState","useState","_useState2","isSelected","setSelected","Flex","Text","px","onSelect","action"],"sources":["../../../src/elements/Toggle/Toggle.story.tsx"],"sourcesContent":["import { action } from \"@storybook/addon-actions\"\nimport React, { useState } from \"react\"\nimport { States } from \"storybook-states\"\nimport { Toggle } from \"./Toggle\"\nimport { Text } from \"../Text\"\nimport { Flex } from \"../Flex\"\n\nexport default {\n title: \"Components/Toggle\",\n}\n\nexport const Default = () => {\n return (\n <States\n states={[\n {},\n { selected: true },\n { hover: true },\n { hover: true, selected: true },\n { disabled: true },\n { disabled: true, selected: true },\n ]}\n >\n <Toggle />\n </States>\n )\n}\n\nexport const Demo = () => {\n const [isSelected, setSelected] = useState(false)\n return (\n <States>\n <Flex>\n <Text px={1}>{isSelected ? \"On\" : \"Off\"} </Text>\n <Toggle\n selected={isSelected}\n onSelect={(selected) => {\n setSelected(selected)\n action(\"onClick\")(selected)\n }}\n >\n Example\n </Toggle>\n </Flex>\n </States>\n )\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAA8B,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA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AM,qBACLzE,MAAA,CAAAc,OAAA,CAAA0D,aAAA,CAACnE,KAAA,CAAAiF,IAAI,qBACHtF,MAAA,CAAAc,OAAA,CAAA0D,aAAA,CAACpE,KAAA,CAAAmF,IAAI;IAACC,EAAE,EAAE;EAAE,GAAEJ,UAAU,GAAG,IAAI,GAAG,KAAK,EAAC,GAAC,CAAO,eAChDpF,MAAA,CAAAc,OAAA,CAAA0D,aAAA,CAACrE,OAAA,CAAA2E,MAAM;IACLH,QAAQ,EAAES,UAAW;IACrBK,QAAQ,EAAE,SAAAA,SAACd,QAAQ,EAAK;MACtBU,WAAW,CAACV,QAAQ,CAAC;MACrB,IAAAe,oBAAM,EAAC,SAAS,CAAC,CAACf,QAAQ,CAAC;IAC7B;EAAE,GACH,SAED,CAAS,CACJ,CACA;AAEb,CAAC;AAAAL,OAAA,CAAAU,IAAA,GAAAA,IAAA;AAlBYA,IAAI,CAAAD,WAAA"}
@@ -0,0 +1 @@
1
+ export * from "./Toggle";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Toggle = require("./Toggle");
7
+ Object.keys(_Toggle).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _Toggle[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _Toggle[key];
14
+ }
15
+ });
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_Toggle","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../src/elements/Toggle/index.tsx"],"sourcesContent":["export * from \"./Toggle\"\n"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1,13 @@
1
+ export declare const SWITCH_STATES: {
2
+ readonly selected: import("styled-components").InterpolationValue[];
3
+ readonly default: import("styled-components").InterpolationValue[];
4
+ };
5
+ export declare const TOGGLE_STATES: {
6
+ readonly default: import("styled-components").FlattenInterpolation<any>[];
7
+ readonly selected: import("styled-components").FlattenInterpolation<any>[];
8
+ readonly hover: import("styled-components").InterpolationValue[];
9
+ readonly disabled: {
10
+ readonly default: import("styled-components").FlattenInterpolation<any>[];
11
+ readonly selected: import("styled-components").FlattenInterpolation<any>[];
12
+ };
13
+ };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TOGGLE_STATES = exports.SWITCH_STATES = void 0;
7
+ var _themeGet = require("@styled-system/theme-get");
8
+ var _styledComponents = require("styled-components");
9
+ var SWITCH_STATES = {
10
+ selected: (0, _styledComponents.css)(["background-color:white;transform:translateX(19px);"]),
11
+ default: (0, _styledComponents.css)(["background-color:white;"])
12
+ };
13
+ exports.SWITCH_STATES = SWITCH_STATES;
14
+ var TOGGLE_STATES = {
15
+ default: (0, _styledComponents.css)(["background-color:", ";"], (0, _themeGet.themeGet)("colors.black30")),
16
+ selected: (0, _styledComponents.css)(["background-color:", ";"], (0, _themeGet.themeGet)("colors.blue100")),
17
+ hover: (0, _styledComponents.css)(["cursor:pointer;"]),
18
+ disabled: {
19
+ default: (0, _styledComponents.css)(["background-color:", ";pointer-events:none;"], (0, _themeGet.themeGet)("colors.black10")),
20
+ selected: (0, _styledComponents.css)(["background-color:", ";pointer-events:none;"], (0, _themeGet.themeGet)("colors.blue10"))
21
+ }
22
+ };
23
+ exports.TOGGLE_STATES = TOGGLE_STATES;
24
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","names":["_themeGet","require","_styledComponents","SWITCH_STATES","selected","css","default","exports","TOGGLE_STATES","themeGet","hover","disabled"],"sources":["../../../src/elements/Toggle/tokens.ts"],"sourcesContent":["import { themeGet } from \"@styled-system/theme-get\"\nimport { css } from \"styled-components\"\n\nexport const SWITCH_STATES = {\n selected: css`\n background-color: white;\n transform: translateX(19px);\n `,\n default: css`\n background-color: white;\n `,\n} as const\n\nexport const TOGGLE_STATES = {\n default: css`\n background-color: ${themeGet(\"colors.black30\")};\n `,\n selected: css`\n background-color: ${themeGet(\"colors.blue100\")};\n `,\n hover: css`\n cursor: pointer;\n `,\n disabled: {\n default: css`\n background-color: ${themeGet(\"colors.black10\")};\n pointer-events: none;\n `,\n selected: css`\n background-color: ${themeGet(\"colors.blue10\")};\n pointer-events: none;\n `,\n },\n} as const\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEO,IAAME,aAAa,GAAG;EAC3BC,QAAQ,MAAEC,qBAAG,yDAGZ;EACDC,OAAO,MAAED,qBAAG;AAGd,CAAU;AAAAE,OAAA,CAAAJ,aAAA,GAAAA,aAAA;AAEH,IAAMK,aAAa,GAAG;EAC3BF,OAAO,MAAED,qBAAG,8BACU,IAAAI,kBAAQ,EAAC,gBAAgB,CAAC,CAC/C;EACDL,QAAQ,MAAEC,qBAAG,8BACS,IAAAI,kBAAQ,EAAC,gBAAgB,CAAC,CAC/C;EACDC,KAAK,MAAEL,qBAAG,sBAET;EACDM,QAAQ,EAAE;IACRL,OAAO,MAAED,qBAAG,kDACU,IAAAI,kBAAQ,EAAC,gBAAgB,CAAC,CAE/C;IACDL,QAAQ,MAAEC,qBAAG,kDACS,IAAAI,kBAAQ,EAAC,eAAe,CAAC;EAGjD;AACF,CAAU;AAAAF,OAAA,CAAAC,aAAA,GAAAA,aAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artsy/palette",
3
- "version": "38.1.5",
3
+ "version": "38.3.0",
4
4
  "description": "Design system library for react components",
5
5
  "main": "dist/index.js",
6
6
  "publishConfig": {
@@ -182,5 +182,5 @@
182
182
  "url": "http://localhost"
183
183
  }
184
184
  },
185
- "gitHead": "4c518941ca152a98ecc374c3ae4ddf0c8f79bcd1"
185
+ "gitHead": "0a4e85291249b0f318a742585d6685b169e32e19"
186
186
  }