@artsy/palette 44.0.1 → 44.2.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.
- package/dist/elements/AutocompleteInput/AutocompleteInput.story.d.ts +105 -6
- package/dist/elements/AutocompleteInput/AutocompleteInput.story.js +78 -365
- package/dist/elements/AutocompleteInput/AutocompleteInput.story.js.map +1 -1
- package/dist/elements/Avatar/Avatar.story.d.ts +74 -5
- package/dist/elements/Avatar/Avatar.story.js +69 -85
- package/dist/elements/Avatar/Avatar.story.js.map +1 -1
- package/dist/elements/Banner/Banner.story.d.ts +53 -2
- package/dist/elements/Banner/Banner.story.js +55 -24
- package/dist/elements/Banner/Banner.story.js.map +1 -1
- package/dist/elements/BaseTabs/BaseTabs.story.d.ts +45 -20
- package/dist/elements/BaseTabs/BaseTabs.story.js +99 -154
- package/dist/elements/BaseTabs/BaseTabs.story.js.map +1 -1
- package/dist/elements/BorderedRadio/BorderedRadio.story.d.ts +30 -1
- package/dist/elements/BorderedRadio/BorderedRadio.story.js +92 -19
- package/dist/elements/BorderedRadio/BorderedRadio.story.js.map +1 -1
- package/dist/elements/Box/Box.story.d.ts +35 -1
- package/dist/elements/Box/Box.story.js +54 -28
- package/dist/elements/Box/Box.story.js.map +1 -1
- package/dist/elements/Breadcrumbs/Breadcrumbs.story.d.ts +27 -1
- package/dist/elements/Breadcrumbs/Breadcrumbs.story.js +43 -26
- package/dist/elements/Breadcrumbs/Breadcrumbs.story.js.map +1 -1
- package/dist/elements/Button/Button.story.d.ts +132 -19
- package/dist/elements/Button/Button.story.js +133 -228
- package/dist/elements/Button/Button.story.js.map +1 -1
- package/dist/elements/CSSGrid/CSSGrid.story.d.ts +35 -10
- package/dist/elements/CSSGrid/CSSGrid.story.js +57 -20
- package/dist/elements/CSSGrid/CSSGrid.story.js.map +1 -1
- package/dist/elements/Cards/Cards.story.d.ts +56 -14
- package/dist/elements/Cards/Cards.story.js +65 -55
- package/dist/elements/Cards/Cards.story.js.map +1 -1
- package/dist/elements/Carousel/Carousel.story.d.ts +135 -48
- package/dist/elements/Carousel/Carousel.story.js +399 -303
- package/dist/elements/Carousel/Carousel.story.js.map +1 -1
- package/dist/elements/CarouselBar/CarouselBar.story.d.ts +37 -2
- package/dist/elements/CarouselBar/CarouselBar.story.js +38 -19
- package/dist/elements/CarouselBar/CarouselBar.story.js.map +1 -1
- package/dist/elements/Checkbox/Check.story.d.ts +75 -2
- package/dist/elements/Checkbox/Check.story.js +77 -32
- package/dist/elements/Checkbox/Check.story.js.map +1 -1
- package/dist/elements/Checkbox/Checkbox.story.d.ts +79 -3
- package/dist/elements/Checkbox/Checkbox.story.js +81 -79
- package/dist/elements/Checkbox/Checkbox.story.js.map +1 -1
- package/dist/elements/Clickable/Clickable.story.d.ts +50 -5
- package/dist/elements/Clickable/Clickable.story.js +52 -58
- package/dist/elements/Clickable/Clickable.story.js.map +1 -1
- package/dist/elements/Drawer/Drawer.story.d.ts +36 -2
- package/dist/elements/Drawer/Drawer.story.js +42 -9
- package/dist/elements/Drawer/Drawer.story.js.map +1 -1
- package/dist/elements/Dropdown/Dropdown.story.d.ts +53 -18
- package/dist/elements/Dropdown/Dropdown.story.js +244 -237
- package/dist/elements/Dropdown/Dropdown.story.js.map +1 -1
- package/dist/elements/EntityHeader/EntityHeader.story.d.ts +245 -1
- package/dist/elements/EntityHeader/EntityHeader.story.js +209 -76
- package/dist/elements/EntityHeader/EntityHeader.story.js.map +1 -1
- package/dist/elements/Expandable/Expandable.story.d.ts +54 -2
- package/dist/elements/Expandable/Expandable.story.js +76 -65
- package/dist/elements/Expandable/Expandable.story.js.map +1 -1
- package/dist/elements/FilterSelect/FilterSelect.story.d.ts +153 -2
- package/dist/elements/FilterSelect/FilterSelect.story.js +159 -62
- package/dist/elements/FilterSelect/FilterSelect.story.js.map +1 -1
- package/dist/elements/FullBleed/FullBleed.story.d.ts +30 -1
- package/dist/elements/FullBleed/FullBleed.story.js +44 -21
- package/dist/elements/FullBleed/FullBleed.story.js.map +1 -1
- package/dist/elements/GridColumns/GridColumns.story.d.ts +47 -9
- package/dist/elements/GridColumns/GridColumns.story.js +188 -204
- package/dist/elements/GridColumns/GridColumns.story.js.map +1 -1
- package/dist/elements/HTML/HTML.story.d.ts +56 -9
- package/dist/elements/HTML/HTML.story.js +56 -28
- package/dist/elements/HTML/HTML.story.js.map +1 -1
- package/dist/elements/HorizontalOverflow/HorizontalOverflow.story.d.ts +52 -2
- package/dist/elements/HorizontalOverflow/HorizontalOverflow.story.js +83 -46
- package/dist/elements/HorizontalOverflow/HorizontalOverflow.story.js.map +1 -1
- package/dist/elements/Image/Image.story.d.ts +56 -17
- package/dist/elements/Image/Image.story.js +106 -88
- package/dist/elements/Image/Image.story.js.map +1 -1
- package/dist/elements/Input/Input.story.d.ts +111 -6
- package/dist/elements/Input/Input.story.js +108 -106
- package/dist/elements/Input/Input.story.js.map +1 -1
- package/dist/elements/Join/Join.d.ts +1 -2
- package/dist/elements/Join/Join.js.map +1 -1
- package/dist/elements/Join/Join.story.d.ts +55 -10
- package/dist/elements/Join/Join.story.js +122 -58
- package/dist/elements/Join/Join.story.js.map +1 -1
- package/dist/elements/Label/Label.story.d.ts +44 -2
- package/dist/elements/Label/Label.story.js +68 -24
- package/dist/elements/Label/Label.story.js.map +1 -1
- package/dist/elements/LabeledInput/LabeledInput.story.d.ts +50 -3
- package/dist/elements/LabeledInput/LabeledInput.story.js +62 -68
- package/dist/elements/LabeledInput/LabeledInput.story.js.map +1 -1
- package/dist/elements/Marquee/Marquee.story.d.ts +57 -1
- package/dist/elements/Marquee/Marquee.story.js +82 -20
- package/dist/elements/Marquee/Marquee.story.js.map +1 -1
- package/dist/elements/Message/Message.story.d.ts +56 -1
- package/dist/elements/Message/Message.story.js +84 -25
- package/dist/elements/Message/Message.story.js.map +1 -1
- package/dist/elements/Modal/ModalBase.story.d.ts +53 -4
- package/dist/elements/Modal/ModalBase.story.js +78 -33
- package/dist/elements/Modal/ModalBase.story.js.map +1 -1
- package/dist/elements/ModalDialog/ModalDialog.story.d.ts +58 -1
- package/dist/elements/ModalDialog/ModalDialog.story.js +93 -144
- package/dist/elements/ModalDialog/ModalDialog.story.js.map +1 -1
- package/dist/elements/ModalDialog/ModalDialogContent.story.d.ts +112 -1
- package/dist/elements/ModalDialog/ModalDialogContent.story.js +190 -65
- package/dist/elements/ModalDialog/ModalDialogContent.story.js.map +1 -1
- package/dist/elements/MultiSelect/MultiSelect.d.ts +1 -1
- package/dist/elements/MultiSelect/MultiSelect.js +4 -0
- package/dist/elements/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/elements/MultiSelect/MultiSelect.story.d.ts +120 -2
- package/dist/elements/MultiSelect/MultiSelect.story.js +122 -44
- package/dist/elements/MultiSelect/MultiSelect.story.js.map +1 -1
- package/dist/elements/Pagination/Pagination.story.d.ts +88 -4
- package/dist/elements/Pagination/Pagination.story.js +64 -23
- package/dist/elements/Pagination/Pagination.story.js.map +1 -1
- package/dist/elements/PasswordInput/PasswordInput.story.d.ts +54 -2
- package/dist/elements/PasswordInput/PasswordInput.story.js +54 -16
- package/dist/elements/PasswordInput/PasswordInput.story.js.map +1 -1
- package/dist/elements/Pill/Pill.story.d.ts +114 -9
- package/dist/elements/Pill/Pill.story.js +282 -169
- package/dist/elements/Pill/Pill.story.js.map +1 -1
- package/dist/elements/Popover/Popover.story.d.ts +162 -13
- package/dist/elements/Popover/Popover.story.js +351 -190
- package/dist/elements/Popover/Popover.story.js.map +1 -1
- package/dist/elements/ProgressBar/ProgressBar.story.d.ts +43 -7
- package/dist/elements/ProgressBar/ProgressBar.story.js +73 -35
- package/dist/elements/ProgressBar/ProgressBar.story.js.map +1 -1
- package/dist/elements/ProgressDots/ProgressDots.story.d.ts +69 -7
- package/dist/elements/ProgressDots/ProgressDots.story.js +108 -41
- package/dist/elements/ProgressDots/ProgressDots.story.js.map +1 -1
- package/dist/elements/Radio/Radio.story.d.ts +103 -2
- package/dist/elements/Radio/Radio.story.js +112 -57
- package/dist/elements/Radio/Radio.story.js.map +1 -1
- package/dist/elements/RadioGroup/RadioGroup.story.d.ts +104 -5
- package/dist/elements/RadioGroup/RadioGroup.story.js +183 -65
- package/dist/elements/RadioGroup/RadioGroup.story.js.map +1 -1
- package/dist/elements/Range/Range.story.d.ts +89 -8
- package/dist/elements/Range/Range.story.js +170 -94
- package/dist/elements/Range/Range.story.js.map +1 -1
- package/dist/elements/ReadMore/ReadMore.story.d.ts +85 -25
- package/dist/elements/ReadMore/ReadMore.story.js +123 -80
- package/dist/elements/ReadMore/ReadMore.story.js.map +1 -1
- package/dist/elements/ResponsiveBox/ResponsiveBox.story.d.ts +40 -5
- package/dist/elements/ResponsiveBox/ResponsiveBox.story.js +87 -51
- package/dist/elements/ResponsiveBox/ResponsiveBox.story.js.map +1 -1
- package/dist/elements/Select/Select.story.d.ts +260 -2
- package/dist/elements/Select/Select.story.js +216 -48
- package/dist/elements/Select/Select.story.js.map +1 -1
- package/dist/elements/SelectInput/SelectInput.story.d.ts +304 -3
- package/dist/elements/SelectInput/SelectInput.story.js +347 -99
- package/dist/elements/SelectInput/SelectInput.story.js.map +1 -1
- package/dist/elements/SelectInput/SelectInputList.story.d.ts +31 -1
- package/dist/elements/SelectInput/SelectInputList.story.js +35 -164
- package/dist/elements/SelectInput/SelectInputList.story.js.map +1 -1
- package/dist/elements/Separator/Separator.story.d.ts +64 -2
- package/dist/elements/Separator/Separator.story.js +65 -18
- package/dist/elements/Separator/Separator.story.js.map +1 -1
- package/dist/elements/Shelf/Shelf.story.d.ts +140 -8
- package/dist/elements/Shelf/Shelf.story.js +224 -56
- package/dist/elements/Shelf/Shelf.story.js.map +1 -1
- package/dist/elements/ShowMore/ShowMore.story.d.ts +46 -4
- package/dist/elements/ShowMore/ShowMore.story.js +102 -48
- package/dist/elements/ShowMore/ShowMore.story.js.map +1 -1
- package/dist/elements/Skeleton/Skeleton.story.d.ts +68 -4
- package/dist/elements/Skeleton/Skeleton.story.js +84 -58
- package/dist/elements/Skeleton/Skeleton.story.js.map +1 -1
- package/dist/elements/Skip/Skip.story.d.ts +50 -11
- package/dist/elements/Skip/Skip.story.js +69 -31
- package/dist/elements/Skip/Skip.story.js.map +1 -1
- package/dist/elements/Spacer/Spacer.story.d.ts +39 -4
- package/dist/elements/Spacer/Spacer.story.js +53 -51
- package/dist/elements/Spacer/Spacer.story.js.map +1 -1
- package/dist/elements/Spinner/Spinner.story.d.ts +47 -7
- package/dist/elements/Spinner/Spinner.story.js +47 -27
- package/dist/elements/Spinner/Spinner.story.js.map +1 -1
- package/dist/elements/Stack/Stack.story.d.ts +45 -1
- package/dist/elements/Stack/Stack.story.js +81 -33
- package/dist/elements/Stack/Stack.story.js.map +1 -1
- package/dist/elements/StackableBorderBox/StackableBorderBox.story.d.ts +24 -1
- package/dist/elements/StackableBorderBox/StackableBorderBox.story.js +28 -9
- package/dist/elements/StackableBorderBox/StackableBorderBox.story.js.map +1 -1
- package/dist/elements/Stepper/Stepper.story.d.ts +99 -2
- package/dist/elements/Stepper/Stepper.story.js +166 -64
- package/dist/elements/Stepper/Stepper.story.js.map +1 -1
- package/dist/elements/Sup/Sup.story.d.ts +47 -1
- package/dist/elements/Sup/Sup.story.js +57 -15
- package/dist/elements/Sup/Sup.story.js.map +1 -1
- package/dist/elements/Swiper/Swiper.story.d.ts +32 -45
- package/dist/elements/Swiper/Swiper.story.js +234 -235
- package/dist/elements/Swiper/Swiper.story.js.map +1 -1
- package/dist/elements/Tabs/Tabs.story.d.ts +41 -18
- package/dist/elements/Tabs/Tabs.story.js +255 -238
- package/dist/elements/Tabs/Tabs.story.js.map +1 -1
- package/dist/elements/Text/Text.story.d.ts +117 -5
- package/dist/elements/Text/Text.story.js +119 -97
- package/dist/elements/Text/Text.story.js.map +1 -1
- package/dist/elements/TextArea/TextArea.story.d.ts +45 -2
- package/dist/elements/TextArea/TextArea.story.js +106 -49
- package/dist/elements/TextArea/TextArea.story.js.map +1 -1
- package/dist/elements/Toasts/Toast.story.d.ts +91 -2
- package/dist/elements/Toasts/Toast.story.js +90 -24
- package/dist/elements/Toasts/Toast.story.js.map +1 -1
- package/dist/elements/Toasts/Toasts.story.d.ts +13 -1
- package/dist/elements/Toasts/Toasts.story.js +78 -64
- package/dist/elements/Toasts/Toasts.story.js.map +1 -1
- package/dist/elements/Toggle/Toggle.story.d.ts +66 -2
- package/dist/elements/Toggle/Toggle.story.js +97 -41
- package/dist/elements/Toggle/Toggle.story.js.map +1 -1
- package/dist/elements/Tooltip/Tooltip.story.d.ts +53 -19
- package/dist/elements/Tooltip/Tooltip.story.js +201 -212
- package/dist/elements/Tooltip/Tooltip.story.js.map +1 -1
- package/dist/utils/storybookBlocklist.d.ts +6 -0
- package/dist/utils/storybookBlocklist.js +47 -0
- package/dist/utils/storybookBlocklist.js.map +1 -0
- package/package.json +3 -2
|
@@ -3,102 +3,145 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.WithCustomizableTypography2 = exports.WithCustomizableTypography = exports.
|
|
6
|
+
exports.default = exports.WithCustomizableTypography2 = exports.WithCustomizableTypography = exports.WithBottomReadMore = exports.ShortContent = exports.Default = 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
10
|
var _Box = require("../Box");
|
|
11
|
+
var _storybookBlocklist = require("../../utils/storybookBlocklist");
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
var _default = exports.default = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
component: _ReadMore.ReadMore,
|
|
15
|
+
title: "Components/ReadMore",
|
|
16
|
+
tags: ["autodocs"],
|
|
17
|
+
parameters: {
|
|
18
|
+
docs: {
|
|
19
|
+
description: {
|
|
20
|
+
component: "A component that truncates content and provides a 'read more' link to expand the full content."
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
controls: {
|
|
24
|
+
exclude: _storybookBlocklist.STORYBOOK_PROPS_BLOCKLIST
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var Default = exports.Default = {
|
|
29
|
+
args: {
|
|
17
30
|
maxChars: 300,
|
|
18
31
|
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>"
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
},
|
|
33
|
+
parameters: {
|
|
34
|
+
docs: {
|
|
35
|
+
description: {
|
|
36
|
+
story: "Read more component with character limit truncation."
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var ShortContent = exports.ShortContent = {
|
|
42
|
+
args: {
|
|
27
43
|
maxChars: 300,
|
|
28
44
|
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>"
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
45
|
+
},
|
|
46
|
+
parameters: {
|
|
47
|
+
docs: {
|
|
48
|
+
description: {
|
|
49
|
+
story: "Read more with content shorter than the character limit."
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var AsString = exports.AsString = {
|
|
55
|
+
args: {
|
|
37
56
|
maxChars: 300,
|
|
38
57
|
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."
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
58
|
+
},
|
|
59
|
+
parameters: {
|
|
60
|
+
docs: {
|
|
61
|
+
description: {
|
|
62
|
+
story: "Read more with plain string content instead of HTML."
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var CharacterCapWithHtml = exports.CharacterCapWithHtml = {
|
|
68
|
+
args: {
|
|
47
69
|
maxChars: 300,
|
|
48
70
|
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>"
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
WithCustomizableTypography2.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
},
|
|
72
|
+
parameters: {
|
|
73
|
+
docs: {
|
|
74
|
+
description: {
|
|
75
|
+
story: "Character cap with HTML content."
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
var WithCustomizableTypography = exports.WithCustomizableTypography = {
|
|
81
|
+
render: function render() {
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement(_HTML.HTML, null, /*#__PURE__*/_react.default.createElement(_ReadMore.ReadMore, {
|
|
83
|
+
maxChars: 300,
|
|
84
|
+
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>"
|
|
85
|
+
}));
|
|
86
|
+
},
|
|
87
|
+
parameters: {
|
|
88
|
+
docs: {
|
|
89
|
+
description: {
|
|
90
|
+
story: "ReadMore with customizable typography using HTML wrapper."
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
var WithCustomizableTypography2 = exports.WithCustomizableTypography2 = {
|
|
96
|
+
render: function render() {
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement(_HTML.HTML, {
|
|
98
|
+
variant: "lg"
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement(_ReadMore.ReadMore, {
|
|
100
|
+
maxChars: 300,
|
|
101
|
+
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>"
|
|
102
|
+
}));
|
|
103
|
+
},
|
|
104
|
+
parameters: {
|
|
105
|
+
docs: {
|
|
106
|
+
description: {
|
|
107
|
+
story: "ReadMore with customizable large typography using HTML wrapper."
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
var CharacterCapWithHtmlDisabled = exports.CharacterCapWithHtmlDisabled = {
|
|
113
|
+
args: {
|
|
79
114
|
disabled: true,
|
|
80
115
|
maxChars: 300,
|
|
81
116
|
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>"
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
117
|
+
},
|
|
118
|
+
parameters: {
|
|
119
|
+
docs: {
|
|
120
|
+
description: {
|
|
121
|
+
story: "Character cap with HTML content when disabled."
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
var WithBottomReadMore = exports.WithBottomReadMore = {
|
|
127
|
+
render: function render() {
|
|
128
|
+
return /*#__PURE__*/_react.default.createElement(_Box.Box, {
|
|
129
|
+
textAlign: "center",
|
|
130
|
+
width: 600
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_HTML.HTML, {
|
|
132
|
+
variant: "lg"
|
|
133
|
+
}, /*#__PURE__*/_react.default.createElement(_ReadMore.ReadMore, {
|
|
134
|
+
inlineReadMoreLink: false,
|
|
135
|
+
maxChars: 280,
|
|
136
|
+
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>"
|
|
137
|
+
})));
|
|
138
|
+
},
|
|
139
|
+
parameters: {
|
|
140
|
+
docs: {
|
|
141
|
+
description: {
|
|
142
|
+
story: "ReadMore with bottom-placed 'Read More' link."
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
103
146
|
};
|
|
104
147
|
//# sourceMappingURL=ReadMore.story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadMore.story.js","names":["_react","_interopRequireDefault","require","_HTML","_ReadMore","_Box","obj","__esModule","default","_default","exports","title","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,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D,oBACE3B,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAACT,SAAA,CAAAU,QAAQ;IACPc,QAAQ;IACRb,QAAQ,EAAE,GAAI;IACdC,OAAO;EAQG,EACV;AAEN,CAAC;AAhBYW,4BAA4B,CAAAV,WAAA;AAkBzCU,4BAA4B,CAACT,KAAK,GAAG;EACnCC,IAAI,EAAE;AACR,CAAC;AAEM,IAAMU,kBAAkB,GAAAnB,OAAA,CAAAmB,kBAAA,GAAG,SAArBA,kBAAkBA,CAAA,EAAS;EACtC,oBACE7B,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAACR,IAAA,CAAAyB,GAAG;IAACC,SAAS,EAAC,QAAQ;IAACC,KAAK,EAAE;EAAI,gBACjChC,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAACV,KAAA,CAAAqB,IAAI;IAACE,OAAO,EAAC;EAAI,gBAChB1B,MAAA,CAAAQ,OAAA,CAAAK,aAAA,CAACT,SAAA,CAAAU,QAAQ;IACPmB,kBAAkB,EAAE,KAAM;IAC1BlB,QAAQ,EAAE,GAAI;IACdC,OAAO;EAQD,EACN,CACG,CACH;AAEV,CAAC;AApBYa,kBAAkB,CAAAZ,WAAA;AAsB/BY,kBAAkB,CAACX,KAAK,GAAG;EACzBC,IAAI,EAAE;AACR,CAAC"}
|
|
1
|
+
{"version":3,"file":"ReadMore.story.js","names":["_react","_interopRequireDefault","require","_HTML","_ReadMore","_Box","_storybookBlocklist","obj","__esModule","default","_default","exports","component","ReadMore","title","tags","parameters","docs","description","controls","exclude","STORYBOOK_PROPS_BLOCKLIST","Default","args","maxChars","content","story","ShortContent","AsString","CharacterCapWithHtml","WithCustomizableTypography","render","createElement","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\"\nimport { STORYBOOK_PROPS_BLOCKLIST } from \"../../utils/storybookBlocklist\"\n\nexport default {\n component: ReadMore,\n title: \"Components/ReadMore\",\n tags: [\"autodocs\"],\n parameters: {\n docs: {\n description: {\n component:\n \"A component that truncates content and provides a 'read more' link to expand the full content.\",\n },\n },\n controls: {\n exclude: STORYBOOK_PROPS_BLOCKLIST,\n },\n },\n}\n\nexport const Default = {\n args: {\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 parameters: {\n docs: {\n description: {\n story: \"Read more component with character limit truncation.\",\n },\n },\n },\n}\n\nexport const ShortContent = {\n args: {\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 parameters: {\n docs: {\n description: {\n story: \"Read more with content shorter than the character limit.\",\n },\n },\n },\n}\n\nexport const AsString = {\n args: {\n maxChars: 300,\n content:\n \"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 parameters: {\n docs: {\n description: {\n story: \"Read more with plain string content instead of HTML.\",\n },\n },\n },\n}\n\nexport const CharacterCapWithHtml = {\n args: {\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 parameters: {\n docs: {\n description: {\n story: \"Character cap with HTML content.\",\n },\n },\n },\n}\n\nexport const WithCustomizableTypography = {\n render: () => (\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 parameters: {\n docs: {\n description: {\n story: \"ReadMore with customizable typography using HTML wrapper.\",\n },\n },\n },\n}\n\nexport const WithCustomizableTypography2 = {\n render: () => (\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 parameters: {\n docs: {\n description: {\n story:\n \"ReadMore with customizable large typography using HTML wrapper.\",\n },\n },\n },\n}\n\nexport const CharacterCapWithHtmlDisabled = {\n args: {\n disabled: true,\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 parameters: {\n docs: {\n description: {\n story: \"Character cap with HTML content when disabled.\",\n },\n },\n },\n}\n\nexport const WithBottomReadMore = {\n render: () => (\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 parameters: {\n docs: {\n description: {\n story: \"ReadMore with bottom-placed 'Read More' link.\",\n },\n },\n },\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC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E;MACJC,WAAW,EAAE;QACXQ,KAAK,EAAE;MACT;IACF;EACF;AACF,CAAC;AAEM,IAAMY,kBAAkB,GAAA3B,OAAA,CAAA2B,kBAAA,GAAG;EAChCP,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBACJ/B,MAAA,CAAAS,OAAA,CAAAuB,aAAA,CAAC3B,IAAA,CAAAkC,GAAG;MAACC,SAAS,EAAC,QAAQ;MAACC,KAAK,EAAE;IAAI,gBACjCzC,MAAA,CAAAS,OAAA,CAAAuB,aAAA,CAAC7B,KAAA,CAAA8B,IAAI;MAACE,OAAO,EAAC;IAAI,gBAChBnC,MAAA,CAAAS,OAAA,CAAAuB,aAAA,CAAC5B,SAAA,CAAAS,QAAQ;MACP6B,kBAAkB,EAAE,KAAM;MAC1BlB,QAAQ,EAAE,GAAI;MACdC,OAAO;IAQD,EACN,CACG,CACH;EAAA,CACP;EACDT,UAAU,EAAE;IACVC,IAAI,EAAE;MACJC,WAAW,EAAE;QACXQ,KAAK,EAAE;MACT;IACF;EACF;AACF,CAAC"}
|
|
@@ -1,13 +1,48 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ResponsiveBoxProps } from "./ResponsiveBox";
|
|
2
3
|
declare const _default: {
|
|
4
|
+
component: React.FC<React.PropsWithChildren<ResponsiveBoxProps>>;
|
|
3
5
|
title: string;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: string;
|
|
11
|
+
};
|
|
12
|
+
controls: {
|
|
13
|
+
exclude: string[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
4
17
|
};
|
|
5
18
|
export default _default;
|
|
6
|
-
export declare const Basic:
|
|
19
|
+
export declare const Basic: {
|
|
20
|
+
render: () => React.JSX.Element;
|
|
21
|
+
parameters: {
|
|
22
|
+
docs: {
|
|
23
|
+
description: {
|
|
24
|
+
story: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
7
29
|
export declare const MaxWidth100: {
|
|
8
|
-
()
|
|
9
|
-
|
|
10
|
-
|
|
30
|
+
render: () => React.JSX.Element;
|
|
31
|
+
parameters: {
|
|
32
|
+
docs: {
|
|
33
|
+
description: {
|
|
34
|
+
story: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare const ColumnsWithResponsiveImages: {
|
|
40
|
+
render: () => React.JSX.Element;
|
|
41
|
+
parameters: {
|
|
42
|
+
docs: {
|
|
43
|
+
description: {
|
|
44
|
+
story: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
11
47
|
};
|
|
12
48
|
};
|
|
13
|
-
export declare const ColumnsWithResponsiveImages: () => React.JSX.Element;
|
|
@@ -11,6 +11,7 @@ var _Box = require("../Box");
|
|
|
11
11
|
var _Text = require("../Text");
|
|
12
12
|
var _Image = require("../Image");
|
|
13
13
|
var _ResponsiveBox = require("./ResponsiveBox");
|
|
14
|
+
var _storybookBlocklist = require("../../utils/storybookBlocklist");
|
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
16
|
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); }
|
|
16
17
|
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; }
|
|
@@ -83,65 +84,100 @@ var EXAMPLE_MAXIMUMS = [{
|
|
|
83
84
|
maxWidth: 1024
|
|
84
85
|
}];
|
|
85
86
|
var _default = exports.default = {
|
|
86
|
-
|
|
87
|
+
component: _ResponsiveBox.ResponsiveBox,
|
|
88
|
+
title: "Components/ResponsiveBox",
|
|
89
|
+
tags: ["autodocs"],
|
|
90
|
+
parameters: {
|
|
91
|
+
docs: {
|
|
92
|
+
description: {
|
|
93
|
+
component: "A responsive container that maintains aspect ratio and optionally constrains maximum dimensions."
|
|
94
|
+
},
|
|
95
|
+
controls: {
|
|
96
|
+
exclude: _storybookBlocklist.STORYBOOK_PROPS_BLOCKLIST
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
87
100
|
};
|
|
88
|
-
var Basic = exports.Basic =
|
|
89
|
-
|
|
90
|
-
return
|
|
101
|
+
var Basic = exports.Basic = {
|
|
102
|
+
render: function render() {
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, EXAMPLE_ASPECTS.map(function (aspect, i) {
|
|
104
|
+
return EXAMPLE_MAXIMUMS.map(function (maximum, j) {
|
|
105
|
+
return /*#__PURE__*/_react.default.createElement(_ResponsiveBox.ResponsiveBox, _extends({
|
|
106
|
+
key: [i, j].join(".")
|
|
107
|
+
}, aspect, maximum, {
|
|
108
|
+
bg: "brand",
|
|
109
|
+
my: 2
|
|
110
|
+
}), /*#__PURE__*/_react.default.createElement(Measure, _extends({}, aspect, maximum)));
|
|
111
|
+
});
|
|
112
|
+
}));
|
|
113
|
+
},
|
|
114
|
+
parameters: {
|
|
115
|
+
docs: {
|
|
116
|
+
description: {
|
|
117
|
+
story: "Basic responsive boxes with various aspect ratios and maximum dimensions."
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
var MaxWidth100 = exports.MaxWidth100 = {
|
|
123
|
+
render: function render() {
|
|
124
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, EXAMPLE_ASPECTS.map(function (aspect, i) {
|
|
91
125
|
return /*#__PURE__*/_react.default.createElement(_ResponsiveBox.ResponsiveBox, _extends({
|
|
92
|
-
key:
|
|
93
|
-
}, aspect,
|
|
126
|
+
key: i
|
|
127
|
+
}, aspect, {
|
|
128
|
+
maxWidth: "100%",
|
|
94
129
|
bg: "brand",
|
|
95
130
|
my: 2
|
|
96
|
-
}), /*#__PURE__*/_react.default.createElement(Measure, _extends({}, aspect,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}), /*#__PURE__*/_react.default.createElement(Measure, _extends({}, aspect, {
|
|
109
|
-
maxWidth: "100%"
|
|
110
|
-
})));
|
|
111
|
-
}));
|
|
112
|
-
};
|
|
113
|
-
MaxWidth100.story = {
|
|
114
|
-
name: "maxWidth: 100%"
|
|
131
|
+
}), /*#__PURE__*/_react.default.createElement(Measure, _extends({}, aspect, {
|
|
132
|
+
maxWidth: "100%"
|
|
133
|
+
})));
|
|
134
|
+
}));
|
|
135
|
+
},
|
|
136
|
+
parameters: {
|
|
137
|
+
docs: {
|
|
138
|
+
description: {
|
|
139
|
+
story: "Responsive boxes constrained to 100% maximum width."
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
115
143
|
};
|
|
116
144
|
var Masonry = (0, _styledComponents.default)(_Box.Box).withConfig({
|
|
117
145
|
displayName: "ResponsiveBoxstory__Masonry",
|
|
118
146
|
componentId: "sc-m69kz2-0"
|
|
119
147
|
})(["column-count:3;*{break-inside:avoid;}"]);
|
|
120
|
-
var ColumnsWithResponsiveImages = exports.ColumnsWithResponsiveImages =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
148
|
+
var ColumnsWithResponsiveImages = exports.ColumnsWithResponsiveImages = {
|
|
149
|
+
render: function render() {
|
|
150
|
+
return /*#__PURE__*/_react.default.createElement(Masonry, null, new Array(12).fill(0).map(function (_, i) {
|
|
151
|
+
var orientation = i % 3 === 0 ? "portrait" : "landscape";
|
|
152
|
+
var width = orientation === "portrait" ? 200 : 300;
|
|
153
|
+
var height = orientation === "portrait" ? 300 : 200;
|
|
154
|
+
return (
|
|
155
|
+
/*#__PURE__*/
|
|
156
|
+
// Simply being wrapped in an extra `Box` causes a image loading bug in Chrome
|
|
157
|
+
_react.default.createElement(_Box.Box, {
|
|
158
|
+
key: i
|
|
159
|
+
}, /*#__PURE__*/_react.default.createElement(_ResponsiveBox.ResponsiveBox, {
|
|
160
|
+
aspectWidth: width,
|
|
161
|
+
aspectHeight: height,
|
|
162
|
+
maxWidth: "100%",
|
|
163
|
+
bg: "mono10",
|
|
164
|
+
mb: 2
|
|
165
|
+
}, /*#__PURE__*/_react.default.createElement(_Image.Image, {
|
|
166
|
+
lazyLoad: true,
|
|
167
|
+
width: "100%",
|
|
168
|
+
height: "100%",
|
|
169
|
+
src: "https://picsum.photos/seed/".concat(i, "/").concat(width, "/").concat(height),
|
|
170
|
+
srcSet: "https://picsum.photos/seed/".concat(i, "/").concat(width, "/").concat(height, " 1x, https://picsum.photos/seed/").concat(i, "/").concat(width * 2, "/").concat(height * 2, " 2x")
|
|
171
|
+
})))
|
|
172
|
+
);
|
|
173
|
+
}));
|
|
174
|
+
},
|
|
175
|
+
parameters: {
|
|
176
|
+
docs: {
|
|
177
|
+
description: {
|
|
178
|
+
story: "Responsive images in a masonry layout with different orientations."
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
145
182
|
};
|
|
146
|
-
ColumnsWithResponsiveImages.displayName = "ColumnsWithResponsiveImages";
|
|
147
183
|
//# sourceMappingURL=ResponsiveBox.story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveBox.story.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_Box","_Text","_Image","_ResponsiveBox","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","Measure","props","_useState","useState","width","height","_useState2","dimensions","setDimensions","ref","useRef","check","current","offsetWidth","offsetHeight","useEffect","requestAnimationFrame","window","addEventListener","removeEventListener","createElement","Box","p","Text","variant","color","aspectWidth","aspectHeight","Fragment","maxHeight","maxWidth","join","displayName","EXAMPLE_ASPECTS","EXAMPLE_MAXIMUMS","_default","exports","title","Basic","map","aspect","maximum","j","ResponsiveBox","bg","my","MaxWidth100","story","Masonry","styled","withConfig","componentId","ColumnsWithResponsiveImages","fill","_","orientation","mb","Image","lazyLoad","src","concat","srcSet"],"sources":["../../../src/elements/ResponsiveBox/ResponsiveBox.story.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\"\nimport styled from \"styled-components\"\nimport { Box } from \"../Box\"\nimport { Text } from \"../Text\"\nimport { Image } from \"../Image\"\nimport {\n ResponsiveBox,\n ResponsiveBoxAspectDimensions,\n ResponsiveBoxMaxDimensions,\n ResponsiveBoxProps,\n} from \"./ResponsiveBox\"\n\nconst Measure: React.FC<React.PropsWithChildren<ResponsiveBoxProps>> = (\n props\n) => {\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n\n const ref = useRef<null | HTMLDivElement>(null)\n\n const check = () => {\n if (!ref.current) return\n setDimensions({\n width: ref.current!.offsetWidth,\n height: ref.current!.offsetHeight,\n })\n }\n\n useEffect(() => {\n requestAnimationFrame(check)\n window.addEventListener(\"resize\", check)\n return () => {\n window.removeEventListener(\"resize\", check)\n }\n })\n\n return (\n <Box width=\"100%\" height=\"100%\" p={1} ref={ref as any}>\n <Text variant=\"xs\" color=\"mono0\">\n {props.aspectWidth}:{props.aspectHeight}\n <br />\n {(\"maxWidth\" in props || \"maxHeight\" in props) && (\n <>\n with max dimensions of{\" \"}\n {[\n (props as any).maxHeight || 0,\n (props as any).maxWidth || \"_\",\n ].join(\" × \")}\n <br />\n </>\n )}\n Renders @ {dimensions.width} × {dimensions.height}\n </Text>\n </Box>\n )\n}\n\nconst EXAMPLE_ASPECTS: ResponsiveBoxAspectDimensions[] = [\n { aspectWidth: 300, aspectHeight: 400 },\n { aspectWidth: 400, aspectHeight: 300 },\n]\n\nconst EXAMPLE_MAXIMUMS: ResponsiveBoxMaxDimensions[] = [\n { maxHeight: 200, maxWidth: 200 },\n { maxHeight: 400, maxWidth: 400 },\n { maxHeight: 400 },\n { maxWidth: 400 },\n { maxHeight: 600, maxWidth: 600 },\n { maxHeight: 100, maxWidth: 600 },\n { maxHeight: 1024, maxWidth: 1024 },\n]\n\nexport default { title: \"Components/ResponsiveBox\" }\n\nexport const Basic = () => {\n return (\n <>\n {EXAMPLE_ASPECTS.map((aspect, i) =>\n EXAMPLE_MAXIMUMS.map((maximum, j) => {\n return (\n <ResponsiveBox\n key={[i, j].join(\".\")}\n {...aspect}\n {...maximum}\n bg=\"brand\"\n my={2}\n >\n <Measure {...aspect} {...maximum} />\n </ResponsiveBox>\n )\n })\n )}\n </>\n )\n}\n\nexport const MaxWidth100 = () => {\n return (\n <>\n {EXAMPLE_ASPECTS.map((aspect, i) => {\n return (\n <ResponsiveBox key={i} {...aspect} maxWidth=\"100%\" bg=\"brand\" my={2}>\n <Measure {...aspect} maxWidth=\"100%\" />\n </ResponsiveBox>\n )\n })}\n </>\n )\n}\n\nMaxWidth100.story = {\n name: \"maxWidth: 100%\",\n}\n\nconst Masonry = styled(Box)`\n column-count: 3;\n\n * {\n break-inside: avoid;\n }\n`\n\nexport const ColumnsWithResponsiveImages = () => {\n return (\n <Masonry>\n {new Array(12).fill(0).map((_, i) => {\n const orientation = i % 3 === 0 ? \"portrait\" : \"landscape\"\n const width = orientation === \"portrait\" ? 200 : 300\n const height = orientation === \"portrait\" ? 300 : 200\n\n return (\n // Simply being wrapped in an extra `Box` causes a image loading bug in Chrome\n <Box key={i}>\n <ResponsiveBox\n aspectWidth={width}\n aspectHeight={height}\n maxWidth=\"100%\"\n bg=\"mono10\"\n mb={2}\n >\n <Image\n lazyLoad\n width=\"100%\"\n height=\"100%\"\n src={`https://picsum.photos/seed/${i}/${width}/${height}`}\n srcSet={`https://picsum.photos/seed/${i}/${width}/${height} 1x, https://picsum.photos/seed/${i}/${\n width * 2\n }/${height * 2} 2x`}\n />\n </ResponsiveBox>\n </Box>\n )\n })}\n </Masonry>\n )\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AAKwB,SAAAE,uBAAAK,GAAA,WAAAA,GA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;AAjCY+C,2BAA2B,CAAApB,WAAA"}
|
|
1
|
+
{"version":3,"file":"ResponsiveBox.story.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_Box","_Text","_Image","_ResponsiveBox","_storybookBlocklist","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","Measure","props","_useState","useState","width","height","_useState2","dimensions","setDimensions","ref","useRef","check","current","offsetWidth","offsetHeight","useEffect","requestAnimationFrame","window","addEventListener","removeEventListener","createElement","Box","p","Text","variant","color","aspectWidth","aspectHeight","Fragment","maxHeight","maxWidth","join","displayName","EXAMPLE_ASPECTS","EXAMPLE_MAXIMUMS","_default","exports","component","ResponsiveBox","title","tags","parameters","docs","description","controls","exclude","STORYBOOK_PROPS_BLOCKLIST","Basic","render","map","aspect","maximum","j","bg","my","story","MaxWidth100","Masonry","styled","withConfig","componentId","ColumnsWithResponsiveImages","fill","_","orientation","mb","Image","lazyLoad","src","concat","srcSet"],"sources":["../../../src/elements/ResponsiveBox/ResponsiveBox.story.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\"\nimport styled from \"styled-components\"\nimport { Box } from \"../Box\"\nimport { Text } from \"../Text\"\nimport { Image } from \"../Image\"\nimport {\n ResponsiveBox,\n ResponsiveBoxAspectDimensions,\n ResponsiveBoxMaxDimensions,\n ResponsiveBoxProps,\n} from \"./ResponsiveBox\"\nimport { STORYBOOK_PROPS_BLOCKLIST } from \"../../utils/storybookBlocklist\"\n\nconst Measure: React.FC<React.PropsWithChildren<ResponsiveBoxProps>> = (\n props\n) => {\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n\n const ref = useRef<null | HTMLDivElement>(null)\n\n const check = () => {\n if (!ref.current) return\n setDimensions({\n width: ref.current!.offsetWidth,\n height: ref.current!.offsetHeight,\n })\n }\n\n useEffect(() => {\n requestAnimationFrame(check)\n window.addEventListener(\"resize\", check)\n return () => {\n window.removeEventListener(\"resize\", check)\n }\n })\n\n return (\n <Box width=\"100%\" height=\"100%\" p={1} ref={ref as any}>\n <Text variant=\"xs\" color=\"mono0\">\n {props.aspectWidth}:{props.aspectHeight}\n <br />\n {(\"maxWidth\" in props || \"maxHeight\" in props) && (\n <>\n with max dimensions of{\" \"}\n {[\n (props as any).maxHeight || 0,\n (props as any).maxWidth || \"_\",\n ].join(\" × \")}\n <br />\n </>\n )}\n Renders @ {dimensions.width} × {dimensions.height}\n </Text>\n </Box>\n )\n}\n\nconst EXAMPLE_ASPECTS: ResponsiveBoxAspectDimensions[] = [\n { aspectWidth: 300, aspectHeight: 400 },\n { aspectWidth: 400, aspectHeight: 300 },\n]\n\nconst EXAMPLE_MAXIMUMS: ResponsiveBoxMaxDimensions[] = [\n { maxHeight: 200, maxWidth: 200 },\n { maxHeight: 400, maxWidth: 400 },\n { maxHeight: 400 },\n { maxWidth: 400 },\n { maxHeight: 600, maxWidth: 600 },\n { maxHeight: 100, maxWidth: 600 },\n { maxHeight: 1024, maxWidth: 1024 },\n]\n\nexport default {\n component: ResponsiveBox,\n title: \"Components/ResponsiveBox\",\n tags: [\"autodocs\"],\n parameters: {\n docs: {\n description: {\n component:\n \"A responsive container that maintains aspect ratio and optionally constrains maximum dimensions.\",\n },\n controls: {\n exclude: STORYBOOK_PROPS_BLOCKLIST,\n },\n },\n },\n}\n\nexport const Basic = {\n render: () => (\n <>\n {EXAMPLE_ASPECTS.map((aspect, i) =>\n EXAMPLE_MAXIMUMS.map((maximum, j) => {\n return (\n <ResponsiveBox\n key={[i, j].join(\".\")}\n {...aspect}\n {...maximum}\n bg=\"brand\"\n my={2}\n >\n <Measure {...aspect} {...maximum} />\n </ResponsiveBox>\n )\n })\n )}\n </>\n ),\n parameters: {\n docs: {\n description: {\n story:\n \"Basic responsive boxes with various aspect ratios and maximum dimensions.\",\n },\n },\n },\n}\n\nexport const MaxWidth100 = {\n render: () => (\n <>\n {EXAMPLE_ASPECTS.map((aspect, i) => {\n return (\n <ResponsiveBox key={i} {...aspect} maxWidth=\"100%\" bg=\"brand\" my={2}>\n <Measure {...aspect} maxWidth=\"100%\" />\n </ResponsiveBox>\n )\n })}\n </>\n ),\n parameters: {\n docs: {\n description: {\n story: \"Responsive boxes constrained to 100% maximum width.\",\n },\n },\n },\n}\n\nconst Masonry = styled(Box)`\n column-count: 3;\n\n * {\n break-inside: avoid;\n }\n`\n\nexport const ColumnsWithResponsiveImages = {\n render: () => (\n <Masonry>\n {new Array(12).fill(0).map((_, i) => {\n const orientation = i % 3 === 0 ? \"portrait\" : \"landscape\"\n const width = orientation === \"portrait\" ? 200 : 300\n const height = orientation === \"portrait\" ? 300 : 200\n\n return (\n // Simply being wrapped in an extra `Box` causes a image loading bug in Chrome\n <Box key={i}>\n <ResponsiveBox\n aspectWidth={width}\n aspectHeight={height}\n maxWidth=\"100%\"\n bg=\"mono10\"\n mb={2}\n >\n <Image\n lazyLoad\n width=\"100%\"\n height=\"100%\"\n src={`https://picsum.photos/seed/${i}/${width}/${height}`}\n srcSet={`https://picsum.photos/seed/${i}/${width}/${height} 1x, https://picsum.photos/seed/${i}/${\n width * 2\n }/${height * 2} 2x`}\n />\n </ResponsiveBox>\n </Box>\n )\n })}\n </Masonry>\n ),\n parameters: {\n docs: {\n description: {\n story:\n \"Responsive images in a masonry layout with different orientations.\",\n },\n },\n },\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF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