jvetrau-ds 0.1.42 → 0.1.43
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/components/flip-list/flip-list.cjs +131 -0
- package/components/flip-list/flip-list.cjs.map +1 -0
- package/components/flip-list/flip-list.css +354 -0
- package/components/flip-list/flip-list.d.ts +28 -0
- package/components/flip-list/flip-list.js +125 -0
- package/components/flip-list/flip-list.js.map +1 -0
- package/components/flip-list/index.cjs +22 -0
- package/components/flip-list/index.cjs.map +1 -0
- package/components/flip-list/index.d.ts +3 -0
- package/components/flip-list/index.js +3 -0
- package/components/flip-list/index.js.map +1 -0
- package/components/index.cjs +6 -0
- package/components/index.d.ts +2 -0
- package/components/index.js +1 -0
- package/index.cjs +6 -0
- package/index.d.ts +2 -0
- package/index.js +1 -0
- package/package.json +1 -1
- package/styles.css +356 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
require('./flip-list.css');
|
|
6
|
+
var classnames = require('../helpers/classnames');
|
|
7
|
+
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
11
|
+
|
|
12
|
+
function hasContent(value) {
|
|
13
|
+
return value !== null && value !== void 0;
|
|
14
|
+
}
|
|
15
|
+
function getInitialOpenItemId(items, defaultOpenId) {
|
|
16
|
+
if (defaultOpenId === void 0) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const hasMatchingItem = items.some(
|
|
20
|
+
(item) => item.id === defaultOpenId
|
|
21
|
+
);
|
|
22
|
+
return hasMatchingItem ? defaultOpenId : null;
|
|
23
|
+
}
|
|
24
|
+
const FlipList = ({
|
|
25
|
+
items,
|
|
26
|
+
defaultOpenId,
|
|
27
|
+
scrollToDefaultOpen = false,
|
|
28
|
+
className = "",
|
|
29
|
+
...props
|
|
30
|
+
}) => {
|
|
31
|
+
const componentId = React__default.default.useId();
|
|
32
|
+
const initialOpenItemIdRef = React__default.default.useRef(
|
|
33
|
+
getInitialOpenItemId(
|
|
34
|
+
items,
|
|
35
|
+
defaultOpenId
|
|
36
|
+
)
|
|
37
|
+
);
|
|
38
|
+
const shouldScrollInitiallyRef = React__default.default.useRef(scrollToDefaultOpen);
|
|
39
|
+
const initialOpenItemRef = React__default.default.useRef(
|
|
40
|
+
null
|
|
41
|
+
);
|
|
42
|
+
const hasScrolledInitiallyRef = React__default.default.useRef(false);
|
|
43
|
+
const [openItemId, setOpenItemId] = React__default.default.useState(
|
|
44
|
+
initialOpenItemIdRef.current
|
|
45
|
+
);
|
|
46
|
+
React__default.default.useEffect(() => {
|
|
47
|
+
if (hasScrolledInitiallyRef.current || !shouldScrollInitiallyRef.current || initialOpenItemIdRef.current === null || !initialOpenItemRef.current) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
hasScrolledInitiallyRef.current = true;
|
|
51
|
+
initialOpenItemRef.current.scrollIntoView({
|
|
52
|
+
behavior: "auto",
|
|
53
|
+
block: "start"
|
|
54
|
+
});
|
|
55
|
+
}, []);
|
|
56
|
+
if (items.length === 0) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const classes = classnames.classnames(
|
|
60
|
+
"flip-list",
|
|
61
|
+
className,
|
|
62
|
+
{}
|
|
63
|
+
);
|
|
64
|
+
const toggleItem = (itemId) => {
|
|
65
|
+
setOpenItemId(
|
|
66
|
+
(current) => current === itemId ? null : itemId
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: classes,
|
|
73
|
+
...props,
|
|
74
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flip-list__items", children: items.map((item, itemIndex) => {
|
|
75
|
+
const isOpen = openItemId === item.id;
|
|
76
|
+
const hasMeta = hasContent(
|
|
77
|
+
item.meta
|
|
78
|
+
);
|
|
79
|
+
const triggerId = `${componentId}-trigger-${itemIndex}`;
|
|
80
|
+
const contentId = `${componentId}-content-${itemIndex}`;
|
|
81
|
+
const itemClasses = classnames.classnames(
|
|
82
|
+
"flip-list__item",
|
|
83
|
+
"",
|
|
84
|
+
{
|
|
85
|
+
"flip-list__item--open": isOpen
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
89
|
+
"div",
|
|
90
|
+
{
|
|
91
|
+
ref: item.id === initialOpenItemIdRef.current ? initialOpenItemRef : void 0,
|
|
92
|
+
className: itemClasses,
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
95
|
+
"button",
|
|
96
|
+
{
|
|
97
|
+
className: "flip-list__trigger",
|
|
98
|
+
id: triggerId,
|
|
99
|
+
type: "button",
|
|
100
|
+
"aria-expanded": isOpen,
|
|
101
|
+
"aria-controls": contentId,
|
|
102
|
+
onClick: () => toggleItem(item.id),
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flip-list__title", children: item.title }),
|
|
105
|
+
hasMeta && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flip-list__meta", children: item.meta })
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
className: "flip-list__content",
|
|
113
|
+
id: contentId,
|
|
114
|
+
"aria-labelledby": triggerId,
|
|
115
|
+
hidden: !isOpen,
|
|
116
|
+
children: item.content
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
item.id
|
|
122
|
+
);
|
|
123
|
+
}) })
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
var flip_list_default = FlipList;
|
|
128
|
+
|
|
129
|
+
module.exports = flip_list_default;
|
|
130
|
+
//# sourceMappingURL=flip-list.cjs.map
|
|
131
|
+
//# sourceMappingURL=flip-list.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/flip-list/flip-list.tsx"],"names":["React","classnames","jsx","jsxs"],"mappings":";;;;;;;;;;;AAuCA,SAAS,WACP,KAAA,EAIA;AACA,EAAA,OAAO,KAAA,KAAU,QAAQ,KAAA,KAAU,MAAA;AACrC;AAEA,SAAS,oBAAA,CACP,OACA,aAAA,EACY;AACZ,EAAA,IAAI,kBAAkB,MAAA,EAAW;AAC/B,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,kBAAkB,KAAA,CAAM,IAAA;AAAA,IAC5B,CAAC,IAAA,KAAS,IAAA,CAAK,EAAA,KAAO;AAAA,GACxB;AAEA,EAAA,OAAO,kBACH,aAAA,GACA,IAAA;AACN;AAEA,MAAM,WAAoC,CAAC;AAAA,EACzC,KAAA;AAAA,EACA,aAAA;AAAA,EACA,mBAAA,GAAsB,KAAA;AAAA,EACtB,SAAA,GAAY,EAAA;AAAA,EACZ,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MAAM,WAAA,GAAcA,uBAAM,KAAA,EAAM;AAEhC,EAAA,MAAM,uBACJA,sBAAA,CAAM,MAAA;AAAA,IACJ,oBAAA;AAAA,MACE,KAAA;AAAA,MACA;AAAA;AACF,GACF;AAEF,EAAA,MAAM,wBAAA,GACJA,sBAAA,CAAM,MAAA,CAAO,mBAAmB,CAAA;AAElC,EAAA,MAAM,qBACJA,sBAAA,CAAM,MAAA;AAAA,IACJ;AAAA,GACF;AAEF,EAAA,MAAM,uBAAA,GACJA,sBAAA,CAAM,MAAA,CAAO,KAAK,CAAA;AAEpB,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAC9B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A;AAAA,GACF;AAEJ,CAAA;AAEA,IAAO,iBAAA,GAAQ","file":"flip-list.cjs","sourcesContent":["import React from 'react';\n\nimport './flip-list.css';\nimport { classnames } from '../helpers/classnames';\n\nexport interface FlipListItem {\n id: React.Key;\n title: React.ReactNode;\n meta?: React.ReactNode;\n content: React.ReactNode;\n}\n\nexport interface FlipListProps\n extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'children'\n > {\n items: FlipListItem[];\n\n /**\n * Item opened during the initial render.\n *\n * Later changes to this prop do not control\n * the component state.\n */\n defaultOpenId?: React.Key;\n\n /**\n * Scrolls the initially opened item into view once\n * after mounting.\n *\n * Has no effect without a valid defaultOpenId.\n * Manual item opening never triggers scrolling.\n */\n scrollToDefaultOpen?: boolean;\n}\n\ntype OpenItemId = React.Key | null;\n\nfunction hasContent(\n value: React.ReactNode,\n): value is Exclude<\n React.ReactNode,\n null | undefined\n> {\n return value !== null && value !== undefined;\n}\n\nfunction getInitialOpenItemId(\n items: FlipListItem[],\n defaultOpenId: React.Key | undefined,\n): OpenItemId {\n if (defaultOpenId === undefined) {\n return null;\n }\n\n const hasMatchingItem = items.some(\n (item) => item.id === defaultOpenId,\n );\n\n return hasMatchingItem\n ? defaultOpenId\n : null;\n}\n\nconst FlipList: React.FC<FlipListProps> = ({\n items,\n defaultOpenId,\n scrollToDefaultOpen = false,\n className = '',\n ...props\n}) => {\n const componentId = React.useId();\n\n const initialOpenItemIdRef =\n React.useRef<OpenItemId>(\n getInitialOpenItemId(\n items,\n defaultOpenId,\n ),\n );\n\n const shouldScrollInitiallyRef =\n React.useRef(scrollToDefaultOpen);\n\n const initialOpenItemRef =\n React.useRef<HTMLDivElement | null>(\n null,\n );\n\n const hasScrolledInitiallyRef =\n React.useRef(false);\n\n const [openItemId, setOpenItemId] =\n React.useState<OpenItemId>(\n initialOpenItemIdRef.current,\n );\n\n React.useEffect(() => {\n if (\n hasScrolledInitiallyRef.current ||\n !shouldScrollInitiallyRef.current ||\n initialOpenItemIdRef.current === null ||\n !initialOpenItemRef.current\n ) {\n return;\n }\n\n hasScrolledInitiallyRef.current = true;\n\n initialOpenItemRef.current.scrollIntoView({\n behavior: 'auto',\n block: 'start',\n });\n }, []);\n\n if (items.length === 0) {\n return null;\n }\n\n const classes = classnames(\n 'flip-list',\n className,\n {},\n );\n\n const toggleItem = (\n itemId: React.Key,\n ) => {\n setOpenItemId((current) =>\n current === itemId\n ? null\n : itemId,\n );\n };\n\n return (\n <div\n className={classes}\n {...props}\n >\n <div className=\"flip-list__items\">\n {items.map((item, itemIndex) => {\n const isOpen =\n openItemId === item.id;\n\n const hasMeta = hasContent(\n item.meta,\n );\n\n const triggerId =\n `${componentId}-trigger-${itemIndex}`;\n\n const contentId =\n `${componentId}-content-${itemIndex}`;\n\n const itemClasses = classnames(\n 'flip-list__item',\n '',\n {\n 'flip-list__item--open':\n isOpen,\n },\n );\n\n return (\n <div\n key={item.id}\n ref={\n item.id ===\n initialOpenItemIdRef.current\n ? initialOpenItemRef\n : undefined\n }\n className={itemClasses}\n >\n <button\n className=\"flip-list__trigger\"\n id={triggerId}\n type=\"button\"\n aria-expanded={isOpen}\n aria-controls={contentId}\n onClick={() =>\n toggleItem(item.id)\n }\n >\n <span className=\"flip-list__title\">\n {item.title}\n </span>\n\n {hasMeta && (\n <span className=\"flip-list__meta\">\n {item.meta}\n </span>\n )}\n </button>\n\n <div\n className=\"flip-list__content\"\n id={contentId}\n aria-labelledby={triggerId}\n hidden={!isOpen}\n >\n {item.content}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n\nexport default FlipList;"]}
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
.flip-list {
|
|
2
|
+
/* color */
|
|
3
|
+
--flip-list-color: inherit;
|
|
4
|
+
--flip-list-trigger-color:
|
|
5
|
+
var(--color-link);
|
|
6
|
+
--flip-list-meta-color:
|
|
7
|
+
var(--color-text-note);
|
|
8
|
+
|
|
9
|
+
color: var(--flip-list-color);
|
|
10
|
+
|
|
11
|
+
/* typography */
|
|
12
|
+
--flip-list-title-font-family:
|
|
13
|
+
var(--font-h4-family);
|
|
14
|
+
--flip-list-title-font-size:
|
|
15
|
+
var(--font-h4);
|
|
16
|
+
--flip-list-title-font-weight:
|
|
17
|
+
var(--font-h4-weight);
|
|
18
|
+
--flip-list-title-line-height:
|
|
19
|
+
var(--font-h4-line);
|
|
20
|
+
--flip-list-title-letter-spacing:
|
|
21
|
+
var(--font-h4-letter-spacing);
|
|
22
|
+
|
|
23
|
+
--flip-list-open-title-font-family:
|
|
24
|
+
var(--font-h2-family);
|
|
25
|
+
--flip-list-open-title-font-size:
|
|
26
|
+
var(--font-h2);
|
|
27
|
+
--flip-list-open-title-font-weight:
|
|
28
|
+
var(--font-h2-weight);
|
|
29
|
+
--flip-list-open-title-line-height:
|
|
30
|
+
var(--font-h2-line);
|
|
31
|
+
--flip-list-open-title-letter-spacing:
|
|
32
|
+
var(--font-h2-letter-spacing);
|
|
33
|
+
|
|
34
|
+
--flip-list-meta-font-family:
|
|
35
|
+
var(--font-body-family);
|
|
36
|
+
--flip-list-meta-font-size:
|
|
37
|
+
var(--font-note);
|
|
38
|
+
--flip-list-meta-font-weight:
|
|
39
|
+
var(--font-note-weight);
|
|
40
|
+
--flip-list-meta-line-height:
|
|
41
|
+
var(--font-note-line);
|
|
42
|
+
--flip-list-meta-letter-spacing:
|
|
43
|
+
var(--font-note-letter-spacing);
|
|
44
|
+
|
|
45
|
+
/* size */
|
|
46
|
+
--flip-list-items-gap:
|
|
47
|
+
var(--margin-item);
|
|
48
|
+
--flip-list-open-content-gap:
|
|
49
|
+
var(--font-h2-margin);
|
|
50
|
+
--flip-list-trigger-column-gap:
|
|
51
|
+
var(--margin-item);
|
|
52
|
+
--flip-list-scroll-margin-block-start:
|
|
53
|
+
0px;
|
|
54
|
+
|
|
55
|
+
display: block;
|
|
56
|
+
width: 100%;
|
|
57
|
+
min-width: 0;
|
|
58
|
+
max-width: 100%;
|
|
59
|
+
|
|
60
|
+
/* border */
|
|
61
|
+
|
|
62
|
+
/* depth */
|
|
63
|
+
|
|
64
|
+
/* motion */
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.flip-list__items {
|
|
68
|
+
/* color */
|
|
69
|
+
|
|
70
|
+
/* typography */
|
|
71
|
+
|
|
72
|
+
/* size */
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
gap: var(--flip-list-items-gap);
|
|
76
|
+
width: 100%;
|
|
77
|
+
min-width: 0;
|
|
78
|
+
max-width: 100%;
|
|
79
|
+
|
|
80
|
+
/* border */
|
|
81
|
+
|
|
82
|
+
/* depth */
|
|
83
|
+
|
|
84
|
+
/* motion */
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.flip-list__item {
|
|
88
|
+
/* color */
|
|
89
|
+
|
|
90
|
+
/* typography */
|
|
91
|
+
|
|
92
|
+
/* size */
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
width: 100%;
|
|
96
|
+
min-width: 0;
|
|
97
|
+
max-width: 100%;
|
|
98
|
+
scroll-margin-block-start:
|
|
99
|
+
var(
|
|
100
|
+
--flip-list-scroll-margin-block-start
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
/* border */
|
|
104
|
+
|
|
105
|
+
/* depth */
|
|
106
|
+
|
|
107
|
+
/* motion */
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.flip-list__item--open {
|
|
111
|
+
/* color */
|
|
112
|
+
|
|
113
|
+
/* typography */
|
|
114
|
+
|
|
115
|
+
/* size */
|
|
116
|
+
gap: var(--flip-list-open-content-gap);
|
|
117
|
+
|
|
118
|
+
/* border */
|
|
119
|
+
|
|
120
|
+
/* depth */
|
|
121
|
+
|
|
122
|
+
/* motion */
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.flip-list__trigger {
|
|
126
|
+
/* color */
|
|
127
|
+
background: transparent;
|
|
128
|
+
color: var(--flip-list-trigger-color);
|
|
129
|
+
|
|
130
|
+
/* typography */
|
|
131
|
+
font: inherit;
|
|
132
|
+
text-align: left;
|
|
133
|
+
|
|
134
|
+
/* size */
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: flex-start;
|
|
137
|
+
justify-content: space-between;
|
|
138
|
+
gap: var(--flip-list-trigger-column-gap);
|
|
139
|
+
width: 100%;
|
|
140
|
+
min-width: 0;
|
|
141
|
+
max-width: 100%;
|
|
142
|
+
padding: 0;
|
|
143
|
+
|
|
144
|
+
/* border */
|
|
145
|
+
border: 0;
|
|
146
|
+
|
|
147
|
+
/* depth */
|
|
148
|
+
|
|
149
|
+
/* motion */
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.flip-list__trigger:focus-visible {
|
|
154
|
+
/* color */
|
|
155
|
+
|
|
156
|
+
/* typography */
|
|
157
|
+
|
|
158
|
+
/* size */
|
|
159
|
+
|
|
160
|
+
/* border */
|
|
161
|
+
outline:
|
|
162
|
+
var(--size-border-width-focus)
|
|
163
|
+
solid
|
|
164
|
+
currentColor;
|
|
165
|
+
outline-offset:
|
|
166
|
+
var(--size-border-offset-focus);
|
|
167
|
+
|
|
168
|
+
/* depth */
|
|
169
|
+
|
|
170
|
+
/* motion */
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.flip-list__title {
|
|
174
|
+
/* color */
|
|
175
|
+
color: inherit;
|
|
176
|
+
|
|
177
|
+
/* typography */
|
|
178
|
+
font-family:
|
|
179
|
+
var(--flip-list-title-font-family);
|
|
180
|
+
font-size:
|
|
181
|
+
var(--flip-list-title-font-size);
|
|
182
|
+
font-weight:
|
|
183
|
+
var(--flip-list-title-font-weight);
|
|
184
|
+
line-height:
|
|
185
|
+
var(--flip-list-title-line-height);
|
|
186
|
+
letter-spacing:
|
|
187
|
+
var(
|
|
188
|
+
--flip-list-title-letter-spacing
|
|
189
|
+
);
|
|
190
|
+
text-decoration: underline;
|
|
191
|
+
text-decoration-thickness: from-font;
|
|
192
|
+
text-underline-offset: from-font;
|
|
193
|
+
|
|
194
|
+
/* size */
|
|
195
|
+
flex: 1 1 auto;
|
|
196
|
+
min-width: 0;
|
|
197
|
+
max-width: 100%;
|
|
198
|
+
overflow-wrap: anywhere;
|
|
199
|
+
|
|
200
|
+
/* border */
|
|
201
|
+
|
|
202
|
+
/* depth */
|
|
203
|
+
|
|
204
|
+
/* motion */
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.flip-list__trigger:hover
|
|
208
|
+
.flip-list__title {
|
|
209
|
+
/* color */
|
|
210
|
+
|
|
211
|
+
/* typography */
|
|
212
|
+
text-decoration: none;
|
|
213
|
+
|
|
214
|
+
/* size */
|
|
215
|
+
|
|
216
|
+
/* border */
|
|
217
|
+
|
|
218
|
+
/* depth */
|
|
219
|
+
|
|
220
|
+
/* motion */
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.flip-list__meta {
|
|
224
|
+
/* color */
|
|
225
|
+
color: var(--flip-list-meta-color);
|
|
226
|
+
|
|
227
|
+
/* typography */
|
|
228
|
+
font-family:
|
|
229
|
+
var(--flip-list-meta-font-family);
|
|
230
|
+
font-size:
|
|
231
|
+
var(--flip-list-meta-font-size);
|
|
232
|
+
font-weight:
|
|
233
|
+
var(--flip-list-meta-font-weight);
|
|
234
|
+
line-height:
|
|
235
|
+
var(--flip-list-meta-line-height);
|
|
236
|
+
letter-spacing:
|
|
237
|
+
var(--flip-list-meta-letter-spacing);
|
|
238
|
+
white-space: nowrap;
|
|
239
|
+
|
|
240
|
+
/* size */
|
|
241
|
+
flex: 0 0 auto;
|
|
242
|
+
min-width: 0;
|
|
243
|
+
max-width: 100%;
|
|
244
|
+
|
|
245
|
+
/* border */
|
|
246
|
+
|
|
247
|
+
/* depth */
|
|
248
|
+
|
|
249
|
+
/* motion */
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.flip-list__item--open
|
|
253
|
+
.flip-list__trigger {
|
|
254
|
+
/* color */
|
|
255
|
+
color: inherit;
|
|
256
|
+
|
|
257
|
+
/* typography */
|
|
258
|
+
|
|
259
|
+
/* size */
|
|
260
|
+
|
|
261
|
+
/* border */
|
|
262
|
+
|
|
263
|
+
/* depth */
|
|
264
|
+
|
|
265
|
+
/* motion */
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.flip-list__item--open
|
|
269
|
+
.flip-list__title {
|
|
270
|
+
/* color */
|
|
271
|
+
color: inherit;
|
|
272
|
+
|
|
273
|
+
/* typography */
|
|
274
|
+
font-family:
|
|
275
|
+
var(
|
|
276
|
+
--flip-list-open-title-font-family
|
|
277
|
+
);
|
|
278
|
+
font-size:
|
|
279
|
+
var(
|
|
280
|
+
--flip-list-open-title-font-size
|
|
281
|
+
);
|
|
282
|
+
font-weight:
|
|
283
|
+
var(
|
|
284
|
+
--flip-list-open-title-font-weight
|
|
285
|
+
);
|
|
286
|
+
line-height:
|
|
287
|
+
var(
|
|
288
|
+
--flip-list-open-title-line-height
|
|
289
|
+
);
|
|
290
|
+
letter-spacing:
|
|
291
|
+
var(
|
|
292
|
+
--flip-list-open-title-letter-spacing
|
|
293
|
+
);
|
|
294
|
+
text-decoration: none;
|
|
295
|
+
|
|
296
|
+
/* size */
|
|
297
|
+
|
|
298
|
+
/* border */
|
|
299
|
+
|
|
300
|
+
/* depth */
|
|
301
|
+
|
|
302
|
+
/* motion */
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.flip-list__item--open
|
|
306
|
+
.flip-list__trigger:hover
|
|
307
|
+
.flip-list__title {
|
|
308
|
+
/* color */
|
|
309
|
+
|
|
310
|
+
/* typography */
|
|
311
|
+
text-decoration: none;
|
|
312
|
+
|
|
313
|
+
/* size */
|
|
314
|
+
|
|
315
|
+
/* border */
|
|
316
|
+
|
|
317
|
+
/* depth */
|
|
318
|
+
|
|
319
|
+
/* motion */
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.flip-list__content {
|
|
323
|
+
/* color */
|
|
324
|
+
color: inherit;
|
|
325
|
+
|
|
326
|
+
/* typography */
|
|
327
|
+
|
|
328
|
+
/* size */
|
|
329
|
+
width: 100%;
|
|
330
|
+
min-width: 0;
|
|
331
|
+
max-width: 100%;
|
|
332
|
+
overflow-wrap: anywhere;
|
|
333
|
+
|
|
334
|
+
/* border */
|
|
335
|
+
|
|
336
|
+
/* depth */
|
|
337
|
+
|
|
338
|
+
/* motion */
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.flip-list__content[hidden] {
|
|
342
|
+
/* color */
|
|
343
|
+
|
|
344
|
+
/* typography */
|
|
345
|
+
|
|
346
|
+
/* size */
|
|
347
|
+
display: none;
|
|
348
|
+
|
|
349
|
+
/* border */
|
|
350
|
+
|
|
351
|
+
/* depth */
|
|
352
|
+
|
|
353
|
+
/* motion */
|
|
354
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './flip-list.css';
|
|
3
|
+
export interface FlipListItem {
|
|
4
|
+
id: React.Key;
|
|
5
|
+
title: React.ReactNode;
|
|
6
|
+
meta?: React.ReactNode;
|
|
7
|
+
content: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface FlipListProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
10
|
+
items: FlipListItem[];
|
|
11
|
+
/**
|
|
12
|
+
* Item opened during the initial render.
|
|
13
|
+
*
|
|
14
|
+
* Later changes to this prop do not control
|
|
15
|
+
* the component state.
|
|
16
|
+
*/
|
|
17
|
+
defaultOpenId?: React.Key;
|
|
18
|
+
/**
|
|
19
|
+
* Scrolls the initially opened item into view once
|
|
20
|
+
* after mounting.
|
|
21
|
+
*
|
|
22
|
+
* Has no effect without a valid defaultOpenId.
|
|
23
|
+
* Manual item opening never triggers scrolling.
|
|
24
|
+
*/
|
|
25
|
+
scrollToDefaultOpen?: boolean;
|
|
26
|
+
}
|
|
27
|
+
declare const FlipList: React.FC<FlipListProps>;
|
|
28
|
+
export default FlipList;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './flip-list.css';
|
|
4
|
+
import { classnames } from '../helpers/classnames';
|
|
5
|
+
|
|
6
|
+
function hasContent(value) {
|
|
7
|
+
return value !== null && value !== void 0;
|
|
8
|
+
}
|
|
9
|
+
function getInitialOpenItemId(items, defaultOpenId) {
|
|
10
|
+
if (defaultOpenId === void 0) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const hasMatchingItem = items.some(
|
|
14
|
+
(item) => item.id === defaultOpenId
|
|
15
|
+
);
|
|
16
|
+
return hasMatchingItem ? defaultOpenId : null;
|
|
17
|
+
}
|
|
18
|
+
const FlipList = ({
|
|
19
|
+
items,
|
|
20
|
+
defaultOpenId,
|
|
21
|
+
scrollToDefaultOpen = false,
|
|
22
|
+
className = "",
|
|
23
|
+
...props
|
|
24
|
+
}) => {
|
|
25
|
+
const componentId = React.useId();
|
|
26
|
+
const initialOpenItemIdRef = React.useRef(
|
|
27
|
+
getInitialOpenItemId(
|
|
28
|
+
items,
|
|
29
|
+
defaultOpenId
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
const shouldScrollInitiallyRef = React.useRef(scrollToDefaultOpen);
|
|
33
|
+
const initialOpenItemRef = React.useRef(
|
|
34
|
+
null
|
|
35
|
+
);
|
|
36
|
+
const hasScrolledInitiallyRef = React.useRef(false);
|
|
37
|
+
const [openItemId, setOpenItemId] = React.useState(
|
|
38
|
+
initialOpenItemIdRef.current
|
|
39
|
+
);
|
|
40
|
+
React.useEffect(() => {
|
|
41
|
+
if (hasScrolledInitiallyRef.current || !shouldScrollInitiallyRef.current || initialOpenItemIdRef.current === null || !initialOpenItemRef.current) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
hasScrolledInitiallyRef.current = true;
|
|
45
|
+
initialOpenItemRef.current.scrollIntoView({
|
|
46
|
+
behavior: "auto",
|
|
47
|
+
block: "start"
|
|
48
|
+
});
|
|
49
|
+
}, []);
|
|
50
|
+
if (items.length === 0) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const classes = classnames(
|
|
54
|
+
"flip-list",
|
|
55
|
+
className,
|
|
56
|
+
{}
|
|
57
|
+
);
|
|
58
|
+
const toggleItem = (itemId) => {
|
|
59
|
+
setOpenItemId(
|
|
60
|
+
(current) => current === itemId ? null : itemId
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
return /* @__PURE__ */ jsx(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: classes,
|
|
67
|
+
...props,
|
|
68
|
+
children: /* @__PURE__ */ jsx("div", { className: "flip-list__items", children: items.map((item, itemIndex) => {
|
|
69
|
+
const isOpen = openItemId === item.id;
|
|
70
|
+
const hasMeta = hasContent(
|
|
71
|
+
item.meta
|
|
72
|
+
);
|
|
73
|
+
const triggerId = `${componentId}-trigger-${itemIndex}`;
|
|
74
|
+
const contentId = `${componentId}-content-${itemIndex}`;
|
|
75
|
+
const itemClasses = classnames(
|
|
76
|
+
"flip-list__item",
|
|
77
|
+
"",
|
|
78
|
+
{
|
|
79
|
+
"flip-list__item--open": isOpen
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
return /* @__PURE__ */ jsxs(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
ref: item.id === initialOpenItemIdRef.current ? initialOpenItemRef : void 0,
|
|
86
|
+
className: itemClasses,
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ jsxs(
|
|
89
|
+
"button",
|
|
90
|
+
{
|
|
91
|
+
className: "flip-list__trigger",
|
|
92
|
+
id: triggerId,
|
|
93
|
+
type: "button",
|
|
94
|
+
"aria-expanded": isOpen,
|
|
95
|
+
"aria-controls": contentId,
|
|
96
|
+
onClick: () => toggleItem(item.id),
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsx("span", { className: "flip-list__title", children: item.title }),
|
|
99
|
+
hasMeta && /* @__PURE__ */ jsx("span", { className: "flip-list__meta", children: item.meta })
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ jsx(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
className: "flip-list__content",
|
|
107
|
+
id: contentId,
|
|
108
|
+
"aria-labelledby": triggerId,
|
|
109
|
+
hidden: !isOpen,
|
|
110
|
+
children: item.content
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
item.id
|
|
116
|
+
);
|
|
117
|
+
}) })
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
var flip_list_default = FlipList;
|
|
122
|
+
|
|
123
|
+
export { flip_list_default as default };
|
|
124
|
+
//# sourceMappingURL=flip-list.js.map
|
|
125
|
+
//# sourceMappingURL=flip-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/flip-list/flip-list.tsx"],"names":[],"mappings":";;;;;AAuCA,SAAS,WACP,KAAA,EAIA;AACA,EAAA,OAAO,KAAA,KAAU,QAAQ,KAAA,KAAU,MAAA;AACrC;AAEA,SAAS,oBAAA,CACP,OACA,aAAA,EACY;AACZ,EAAA,IAAI,kBAAkB,MAAA,EAAW;AAC/B,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,kBAAkB,KAAA,CAAM,IAAA;AAAA,IAC5B,CAAC,IAAA,KAAS,IAAA,CAAK,EAAA,KAAO;AAAA,GACxB;AAEA,EAAA,OAAO,kBACH,aAAA,GACA,IAAA;AACN;AAEA,MAAM,WAAoC,CAAC;AAAA,EACzC,KAAA;AAAA,EACA,aAAA;AAAA,EACA,mBAAA,GAAsB,KAAA;AAAA,EACtB,SAAA,GAAY,EAAA;AAAA,EACZ,GAAG;AACL,CAAA,KAAM;AACJ,EAAA,MA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AAA,EAAU,iBAAA,EACb,eAAK,IAAA,EACR;AAAA;AAAA;AAAA,eAEJ;AAAA,8BAEA,GAAA;AAAA,gBAAC,KAAA;AAAA,gBAAA;AAAA,kBACC,SAAA,EAAU,oBAAA;AAAA,kBACV,EAAA,EAAI,SAAA;AAAA,kBACJ,iBAAA,EAAiB,SAAA;AAAA,kBACjB,QAAQ,CAAC,MAAA;AAAA,kBAER,QAAA,EAAA,IAAA,CAAK;AAAA;AAAA;AACR;AAAA,WAAA;AAAA,UArCK,IAAA,CAAK;AAAA,SAsCZ;AAAA,MAEJ,CAAC,CAAA,EACH;AAAA;AAAA,GACF;AAEJ,CAAA;AAEA,IAAO,iBAAA,GAAQ","file":"flip-list.js","sourcesContent":["import React from 'react';\n\nimport './flip-list.css';\nimport { classnames } from '../helpers/classnames';\n\nexport interface FlipListItem {\n id: React.Key;\n title: React.ReactNode;\n meta?: React.ReactNode;\n content: React.ReactNode;\n}\n\nexport interface FlipListProps\n extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'children'\n > {\n items: FlipListItem[];\n\n /**\n * Item opened during the initial render.\n *\n * Later changes to this prop do not control\n * the component state.\n */\n defaultOpenId?: React.Key;\n\n /**\n * Scrolls the initially opened item into view once\n * after mounting.\n *\n * Has no effect without a valid defaultOpenId.\n * Manual item opening never triggers scrolling.\n */\n scrollToDefaultOpen?: boolean;\n}\n\ntype OpenItemId = React.Key | null;\n\nfunction hasContent(\n value: React.ReactNode,\n): value is Exclude<\n React.ReactNode,\n null | undefined\n> {\n return value !== null && value !== undefined;\n}\n\nfunction getInitialOpenItemId(\n items: FlipListItem[],\n defaultOpenId: React.Key | undefined,\n): OpenItemId {\n if (defaultOpenId === undefined) {\n return null;\n }\n\n const hasMatchingItem = items.some(\n (item) => item.id === defaultOpenId,\n );\n\n return hasMatchingItem\n ? defaultOpenId\n : null;\n}\n\nconst FlipList: React.FC<FlipListProps> = ({\n items,\n defaultOpenId,\n scrollToDefaultOpen = false,\n className = '',\n ...props\n}) => {\n const componentId = React.useId();\n\n const initialOpenItemIdRef =\n React.useRef<OpenItemId>(\n getInitialOpenItemId(\n items,\n defaultOpenId,\n ),\n );\n\n const shouldScrollInitiallyRef =\n React.useRef(scrollToDefaultOpen);\n\n const initialOpenItemRef =\n React.useRef<HTMLDivElement | null>(\n null,\n );\n\n const hasScrolledInitiallyRef =\n React.useRef(false);\n\n const [openItemId, setOpenItemId] =\n React.useState<OpenItemId>(\n initialOpenItemIdRef.current,\n );\n\n React.useEffect(() => {\n if (\n hasScrolledInitiallyRef.current ||\n !shouldScrollInitiallyRef.current ||\n initialOpenItemIdRef.current === null ||\n !initialOpenItemRef.current\n ) {\n return;\n }\n\n hasScrolledInitiallyRef.current = true;\n\n initialOpenItemRef.current.scrollIntoView({\n behavior: 'auto',\n block: 'start',\n });\n }, []);\n\n if (items.length === 0) {\n return null;\n }\n\n const classes = classnames(\n 'flip-list',\n className,\n {},\n );\n\n const toggleItem = (\n itemId: React.Key,\n ) => {\n setOpenItemId((current) =>\n current === itemId\n ? null\n : itemId,\n );\n };\n\n return (\n <div\n className={classes}\n {...props}\n >\n <div className=\"flip-list__items\">\n {items.map((item, itemIndex) => {\n const isOpen =\n openItemId === item.id;\n\n const hasMeta = hasContent(\n item.meta,\n );\n\n const triggerId =\n `${componentId}-trigger-${itemIndex}`;\n\n const contentId =\n `${componentId}-content-${itemIndex}`;\n\n const itemClasses = classnames(\n 'flip-list__item',\n '',\n {\n 'flip-list__item--open':\n isOpen,\n },\n );\n\n return (\n <div\n key={item.id}\n ref={\n item.id ===\n initialOpenItemIdRef.current\n ? initialOpenItemRef\n : undefined\n }\n className={itemClasses}\n >\n <button\n className=\"flip-list__trigger\"\n id={triggerId}\n type=\"button\"\n aria-expanded={isOpen}\n aria-controls={contentId}\n onClick={() =>\n toggleItem(item.id)\n }\n >\n <span className=\"flip-list__title\">\n {item.title}\n </span>\n\n {hasMeta && (\n <span className=\"flip-list__meta\">\n {item.meta}\n </span>\n )}\n </button>\n\n <div\n className=\"flip-list__content\"\n id={contentId}\n aria-labelledby={triggerId}\n hidden={!isOpen}\n >\n {item.content}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n\nexport default FlipList;"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var flipList = require('./flip-list');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var flipList__default = /*#__PURE__*/_interopDefault(flipList);
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
Object.defineProperty(exports, "FlipList", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return flipList__default.default; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "default", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return flipList__default.default; }
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=index.cjs.map
|
|
22
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
package/components/index.cjs
CHANGED
|
@@ -27,6 +27,7 @@ var markdown = require('./markdown/markdown');
|
|
|
27
27
|
var discussion = require('./discussion/discussion');
|
|
28
28
|
var courseOutline = require('./course-outline/course-outline');
|
|
29
29
|
var calendarMonth = require('./calendar-month');
|
|
30
|
+
var flipList = require('./flip-list/flip-list');
|
|
30
31
|
|
|
31
32
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
32
33
|
|
|
@@ -56,6 +57,7 @@ var breadcrumbs__default = /*#__PURE__*/_interopDefault(breadcrumbs);
|
|
|
56
57
|
var markdown__default = /*#__PURE__*/_interopDefault(markdown);
|
|
57
58
|
var discussion__default = /*#__PURE__*/_interopDefault(discussion);
|
|
58
59
|
var courseOutline__default = /*#__PURE__*/_interopDefault(courseOutline);
|
|
60
|
+
var flipList__default = /*#__PURE__*/_interopDefault(flipList);
|
|
59
61
|
|
|
60
62
|
|
|
61
63
|
|
|
@@ -163,6 +165,10 @@ Object.defineProperty(exports, "CourseOutline", {
|
|
|
163
165
|
enumerable: true,
|
|
164
166
|
get: function () { return courseOutline__default.default; }
|
|
165
167
|
});
|
|
168
|
+
Object.defineProperty(exports, "FlipList", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () { return flipList__default.default; }
|
|
171
|
+
});
|
|
166
172
|
Object.keys(calendarMonth).forEach(function (k) {
|
|
167
173
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
168
174
|
enumerable: true,
|
package/components/index.d.ts
CHANGED
|
@@ -51,3 +51,5 @@ export type { DiscussionItem, DiscussionProps, } from './discussion/discussion';
|
|
|
51
51
|
export { default as CourseOutline } from './course-outline/course-outline';
|
|
52
52
|
export type { CourseOutlineGroup, CourseOutlineHeadingLevel, CourseOutlineItem, CourseOutlineProps, } from './course-outline/course-outline';
|
|
53
53
|
export * from './calendar-month';
|
|
54
|
+
export { default as FlipList } from './flip-list/flip-list';
|
|
55
|
+
export type { FlipListItem, FlipListProps, } from './flip-list/flip-list';
|
package/components/index.js
CHANGED
|
@@ -25,5 +25,6 @@ export { default as Markdown } from './markdown/markdown';
|
|
|
25
25
|
export { default as Discussion } from './discussion/discussion';
|
|
26
26
|
export { default as CourseOutline } from './course-outline/course-outline';
|
|
27
27
|
export * from './calendar-month';
|
|
28
|
+
export { default as FlipList } from './flip-list/flip-list';
|
|
28
29
|
//# sourceMappingURL=index.js.map
|
|
29
30
|
//# sourceMappingURL=index.js.map
|
package/index.cjs
CHANGED
|
@@ -29,6 +29,7 @@ var markdown = require('./components/markdown');
|
|
|
29
29
|
var discussion = require('./components/discussion');
|
|
30
30
|
var courseOutline = require('./components/course-outline');
|
|
31
31
|
var calendarMonth = require('./components/calendar-month');
|
|
32
|
+
var flipList = require('./components/flip-list');
|
|
32
33
|
var header = require('./patterns/header');
|
|
33
34
|
var footer = require('./patterns/footer');
|
|
34
35
|
var screenHeader = require('./patterns/screen-header');
|
|
@@ -70,6 +71,7 @@ var breadcrumbs__default = /*#__PURE__*/_interopDefault(breadcrumbs);
|
|
|
70
71
|
var markdown__default = /*#__PURE__*/_interopDefault(markdown);
|
|
71
72
|
var discussion__default = /*#__PURE__*/_interopDefault(discussion);
|
|
72
73
|
var courseOutline__default = /*#__PURE__*/_interopDefault(courseOutline);
|
|
74
|
+
var flipList__default = /*#__PURE__*/_interopDefault(flipList);
|
|
73
75
|
var header__default = /*#__PURE__*/_interopDefault(header);
|
|
74
76
|
var footer__default = /*#__PURE__*/_interopDefault(footer);
|
|
75
77
|
var screenHeader__default = /*#__PURE__*/_interopDefault(screenHeader);
|
|
@@ -195,6 +197,10 @@ Object.defineProperty(exports, "CourseOutline", {
|
|
|
195
197
|
enumerable: true,
|
|
196
198
|
get: function () { return courseOutline__default.default; }
|
|
197
199
|
});
|
|
200
|
+
Object.defineProperty(exports, "FlipList", {
|
|
201
|
+
enumerable: true,
|
|
202
|
+
get: function () { return flipList__default.default; }
|
|
203
|
+
});
|
|
198
204
|
Object.defineProperty(exports, "Header", {
|
|
199
205
|
enumerable: true,
|
|
200
206
|
get: function () { return header__default.default; }
|
package/index.d.ts
CHANGED
|
@@ -59,6 +59,8 @@ export type { DiscussionItem, DiscussionProps, } from './components/discussion';
|
|
|
59
59
|
export { default as CourseOutline } from './components/course-outline';
|
|
60
60
|
export type { CourseOutlineGroup, CourseOutlineHeadingLevel, CourseOutlineItem, CourseOutlineProps, } from './components/course-outline';
|
|
61
61
|
export * from './components/calendar-month';
|
|
62
|
+
export { default as FlipList } from './components/flip-list';
|
|
63
|
+
export type { FlipListItem, FlipListProps, } from './components/flip-list';
|
|
62
64
|
export { default as Header } from './patterns/header';
|
|
63
65
|
export type { HeaderProps } from './patterns/header';
|
|
64
66
|
export { default as Footer } from './patterns/footer';
|
package/index.js
CHANGED
|
@@ -27,6 +27,7 @@ export { default as Markdown } from './components/markdown';
|
|
|
27
27
|
export { default as Discussion } from './components/discussion';
|
|
28
28
|
export { default as CourseOutline } from './components/course-outline';
|
|
29
29
|
export * from './components/calendar-month';
|
|
30
|
+
export { default as FlipList } from './components/flip-list';
|
|
30
31
|
export { default as Header } from './patterns/header';
|
|
31
32
|
export { default as Footer } from './patterns/footer';
|
|
32
33
|
export { default as ScreenHeader } from './patterns/screen-header';
|
package/package.json
CHANGED
package/styles.css
CHANGED
|
@@ -2175,6 +2175,362 @@
|
|
|
2175
2175
|
flex-direction: column;
|
|
2176
2176
|
}
|
|
2177
2177
|
|
|
2178
|
+
/* src/components/flip-list/flip-list.css */
|
|
2179
|
+
.flip-list {
|
|
2180
|
+
/* color */
|
|
2181
|
+
--flip-list-color: inherit;
|
|
2182
|
+
--flip-list-trigger-color:
|
|
2183
|
+
var(--color-link);
|
|
2184
|
+
--flip-list-meta-color:
|
|
2185
|
+
var(--color-text-note);
|
|
2186
|
+
|
|
2187
|
+
color: var(--flip-list-color);
|
|
2188
|
+
|
|
2189
|
+
/* typography */
|
|
2190
|
+
--flip-list-title-font-family:
|
|
2191
|
+
var(--font-h4-family);
|
|
2192
|
+
--flip-list-title-font-size:
|
|
2193
|
+
var(--font-h4);
|
|
2194
|
+
--flip-list-title-font-weight:
|
|
2195
|
+
var(--font-h4-weight);
|
|
2196
|
+
--flip-list-title-line-height:
|
|
2197
|
+
var(--font-h4-line);
|
|
2198
|
+
--flip-list-title-letter-spacing:
|
|
2199
|
+
var(--font-h4-letter-spacing);
|
|
2200
|
+
|
|
2201
|
+
--flip-list-open-title-font-family:
|
|
2202
|
+
var(--font-h2-family);
|
|
2203
|
+
--flip-list-open-title-font-size:
|
|
2204
|
+
var(--font-h2);
|
|
2205
|
+
--flip-list-open-title-font-weight:
|
|
2206
|
+
var(--font-h2-weight);
|
|
2207
|
+
--flip-list-open-title-line-height:
|
|
2208
|
+
var(--font-h2-line);
|
|
2209
|
+
--flip-list-open-title-letter-spacing:
|
|
2210
|
+
var(--font-h2-letter-spacing);
|
|
2211
|
+
|
|
2212
|
+
--flip-list-meta-font-family:
|
|
2213
|
+
var(--font-body-family);
|
|
2214
|
+
--flip-list-meta-font-size:
|
|
2215
|
+
var(--font-note);
|
|
2216
|
+
--flip-list-meta-font-weight:
|
|
2217
|
+
var(--font-note-weight);
|
|
2218
|
+
--flip-list-meta-line-height:
|
|
2219
|
+
var(--font-note-line);
|
|
2220
|
+
--flip-list-meta-letter-spacing:
|
|
2221
|
+
var(--font-note-letter-spacing);
|
|
2222
|
+
|
|
2223
|
+
/* size */
|
|
2224
|
+
--flip-list-items-gap:
|
|
2225
|
+
var(--margin-item);
|
|
2226
|
+
--flip-list-open-content-gap:
|
|
2227
|
+
var(--font-h2-margin);
|
|
2228
|
+
--flip-list-trigger-column-gap:
|
|
2229
|
+
var(--margin-item);
|
|
2230
|
+
--flip-list-scroll-margin-block-start:
|
|
2231
|
+
0px;
|
|
2232
|
+
|
|
2233
|
+
display: block;
|
|
2234
|
+
width: 100%;
|
|
2235
|
+
min-width: 0;
|
|
2236
|
+
max-width: 100%;
|
|
2237
|
+
|
|
2238
|
+
/* border */
|
|
2239
|
+
|
|
2240
|
+
/* depth */
|
|
2241
|
+
|
|
2242
|
+
/* motion */
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
.flip-list__items {
|
|
2246
|
+
/* color */
|
|
2247
|
+
|
|
2248
|
+
/* typography */
|
|
2249
|
+
|
|
2250
|
+
/* size */
|
|
2251
|
+
display: flex;
|
|
2252
|
+
flex-direction: column;
|
|
2253
|
+
gap: var(--flip-list-items-gap);
|
|
2254
|
+
width: 100%;
|
|
2255
|
+
min-width: 0;
|
|
2256
|
+
max-width: 100%;
|
|
2257
|
+
|
|
2258
|
+
/* border */
|
|
2259
|
+
|
|
2260
|
+
/* depth */
|
|
2261
|
+
|
|
2262
|
+
/* motion */
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
.flip-list__item {
|
|
2266
|
+
/* color */
|
|
2267
|
+
|
|
2268
|
+
/* typography */
|
|
2269
|
+
|
|
2270
|
+
/* size */
|
|
2271
|
+
display: flex;
|
|
2272
|
+
flex-direction: column;
|
|
2273
|
+
width: 100%;
|
|
2274
|
+
min-width: 0;
|
|
2275
|
+
max-width: 100%;
|
|
2276
|
+
scroll-margin-block-start:
|
|
2277
|
+
var(
|
|
2278
|
+
--flip-list-scroll-margin-block-start
|
|
2279
|
+
);
|
|
2280
|
+
|
|
2281
|
+
/* border */
|
|
2282
|
+
|
|
2283
|
+
/* depth */
|
|
2284
|
+
|
|
2285
|
+
/* motion */
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
.flip-list__item--open {
|
|
2289
|
+
/* color */
|
|
2290
|
+
|
|
2291
|
+
/* typography */
|
|
2292
|
+
|
|
2293
|
+
/* size */
|
|
2294
|
+
gap: var(--flip-list-open-content-gap);
|
|
2295
|
+
|
|
2296
|
+
/* border */
|
|
2297
|
+
|
|
2298
|
+
/* depth */
|
|
2299
|
+
|
|
2300
|
+
/* motion */
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
.flip-list__trigger {
|
|
2304
|
+
/* color */
|
|
2305
|
+
background: transparent;
|
|
2306
|
+
color: var(--flip-list-trigger-color);
|
|
2307
|
+
|
|
2308
|
+
/* typography */
|
|
2309
|
+
font: inherit;
|
|
2310
|
+
text-align: left;
|
|
2311
|
+
|
|
2312
|
+
/* size */
|
|
2313
|
+
display: flex;
|
|
2314
|
+
align-items: flex-start;
|
|
2315
|
+
justify-content: space-between;
|
|
2316
|
+
gap: var(--flip-list-trigger-column-gap);
|
|
2317
|
+
width: 100%;
|
|
2318
|
+
min-width: 0;
|
|
2319
|
+
max-width: 100%;
|
|
2320
|
+
padding: 0;
|
|
2321
|
+
|
|
2322
|
+
/* border */
|
|
2323
|
+
border: 0;
|
|
2324
|
+
|
|
2325
|
+
/* depth */
|
|
2326
|
+
|
|
2327
|
+
/* motion */
|
|
2328
|
+
cursor: pointer;
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
.flip-list__trigger:focus-visible {
|
|
2332
|
+
/* color */
|
|
2333
|
+
|
|
2334
|
+
/* typography */
|
|
2335
|
+
|
|
2336
|
+
/* size */
|
|
2337
|
+
|
|
2338
|
+
/* border */
|
|
2339
|
+
outline:
|
|
2340
|
+
var(--size-border-width-focus)
|
|
2341
|
+
solid
|
|
2342
|
+
currentColor;
|
|
2343
|
+
outline-offset:
|
|
2344
|
+
var(--size-border-offset-focus);
|
|
2345
|
+
|
|
2346
|
+
/* depth */
|
|
2347
|
+
|
|
2348
|
+
/* motion */
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
.flip-list__title {
|
|
2352
|
+
/* color */
|
|
2353
|
+
color: inherit;
|
|
2354
|
+
|
|
2355
|
+
/* typography */
|
|
2356
|
+
font-family:
|
|
2357
|
+
var(--flip-list-title-font-family);
|
|
2358
|
+
font-size:
|
|
2359
|
+
var(--flip-list-title-font-size);
|
|
2360
|
+
font-weight:
|
|
2361
|
+
var(--flip-list-title-font-weight);
|
|
2362
|
+
line-height:
|
|
2363
|
+
var(--flip-list-title-line-height);
|
|
2364
|
+
letter-spacing:
|
|
2365
|
+
var(
|
|
2366
|
+
--flip-list-title-letter-spacing
|
|
2367
|
+
);
|
|
2368
|
+
text-decoration: underline;
|
|
2369
|
+
text-decoration-thickness: from-font;
|
|
2370
|
+
text-underline-offset: from-font;
|
|
2371
|
+
|
|
2372
|
+
/* size */
|
|
2373
|
+
flex: 1 1 auto;
|
|
2374
|
+
min-width: 0;
|
|
2375
|
+
max-width: 100%;
|
|
2376
|
+
overflow-wrap: anywhere;
|
|
2377
|
+
|
|
2378
|
+
/* border */
|
|
2379
|
+
|
|
2380
|
+
/* depth */
|
|
2381
|
+
|
|
2382
|
+
/* motion */
|
|
2383
|
+
}
|
|
2384
|
+
|
|
2385
|
+
.flip-list__trigger:hover
|
|
2386
|
+
.flip-list__title {
|
|
2387
|
+
/* color */
|
|
2388
|
+
|
|
2389
|
+
/* typography */
|
|
2390
|
+
text-decoration: none;
|
|
2391
|
+
|
|
2392
|
+
/* size */
|
|
2393
|
+
|
|
2394
|
+
/* border */
|
|
2395
|
+
|
|
2396
|
+
/* depth */
|
|
2397
|
+
|
|
2398
|
+
/* motion */
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
.flip-list__meta {
|
|
2402
|
+
/* color */
|
|
2403
|
+
color: var(--flip-list-meta-color);
|
|
2404
|
+
|
|
2405
|
+
/* typography */
|
|
2406
|
+
font-family:
|
|
2407
|
+
var(--flip-list-meta-font-family);
|
|
2408
|
+
font-size:
|
|
2409
|
+
var(--flip-list-meta-font-size);
|
|
2410
|
+
font-weight:
|
|
2411
|
+
var(--flip-list-meta-font-weight);
|
|
2412
|
+
line-height:
|
|
2413
|
+
var(--flip-list-meta-line-height);
|
|
2414
|
+
letter-spacing:
|
|
2415
|
+
var(--flip-list-meta-letter-spacing);
|
|
2416
|
+
white-space: nowrap;
|
|
2417
|
+
|
|
2418
|
+
/* size */
|
|
2419
|
+
flex: 0 0 auto;
|
|
2420
|
+
min-width: 0;
|
|
2421
|
+
max-width: 100%;
|
|
2422
|
+
|
|
2423
|
+
/* border */
|
|
2424
|
+
|
|
2425
|
+
/* depth */
|
|
2426
|
+
|
|
2427
|
+
/* motion */
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
.flip-list__item--open
|
|
2431
|
+
.flip-list__trigger {
|
|
2432
|
+
/* color */
|
|
2433
|
+
color: inherit;
|
|
2434
|
+
|
|
2435
|
+
/* typography */
|
|
2436
|
+
|
|
2437
|
+
/* size */
|
|
2438
|
+
|
|
2439
|
+
/* border */
|
|
2440
|
+
|
|
2441
|
+
/* depth */
|
|
2442
|
+
|
|
2443
|
+
/* motion */
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
.flip-list__item--open
|
|
2447
|
+
.flip-list__title {
|
|
2448
|
+
/* color */
|
|
2449
|
+
color: inherit;
|
|
2450
|
+
|
|
2451
|
+
/* typography */
|
|
2452
|
+
font-family:
|
|
2453
|
+
var(
|
|
2454
|
+
--flip-list-open-title-font-family
|
|
2455
|
+
);
|
|
2456
|
+
font-size:
|
|
2457
|
+
var(
|
|
2458
|
+
--flip-list-open-title-font-size
|
|
2459
|
+
);
|
|
2460
|
+
font-weight:
|
|
2461
|
+
var(
|
|
2462
|
+
--flip-list-open-title-font-weight
|
|
2463
|
+
);
|
|
2464
|
+
line-height:
|
|
2465
|
+
var(
|
|
2466
|
+
--flip-list-open-title-line-height
|
|
2467
|
+
);
|
|
2468
|
+
letter-spacing:
|
|
2469
|
+
var(
|
|
2470
|
+
--flip-list-open-title-letter-spacing
|
|
2471
|
+
);
|
|
2472
|
+
text-decoration: none;
|
|
2473
|
+
|
|
2474
|
+
/* size */
|
|
2475
|
+
|
|
2476
|
+
/* border */
|
|
2477
|
+
|
|
2478
|
+
/* depth */
|
|
2479
|
+
|
|
2480
|
+
/* motion */
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
.flip-list__item--open
|
|
2484
|
+
.flip-list__trigger:hover
|
|
2485
|
+
.flip-list__title {
|
|
2486
|
+
/* color */
|
|
2487
|
+
|
|
2488
|
+
/* typography */
|
|
2489
|
+
text-decoration: none;
|
|
2490
|
+
|
|
2491
|
+
/* size */
|
|
2492
|
+
|
|
2493
|
+
/* border */
|
|
2494
|
+
|
|
2495
|
+
/* depth */
|
|
2496
|
+
|
|
2497
|
+
/* motion */
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
.flip-list__content {
|
|
2501
|
+
/* color */
|
|
2502
|
+
color: inherit;
|
|
2503
|
+
|
|
2504
|
+
/* typography */
|
|
2505
|
+
|
|
2506
|
+
/* size */
|
|
2507
|
+
width: 100%;
|
|
2508
|
+
min-width: 0;
|
|
2509
|
+
max-width: 100%;
|
|
2510
|
+
overflow-wrap: anywhere;
|
|
2511
|
+
|
|
2512
|
+
/* border */
|
|
2513
|
+
|
|
2514
|
+
/* depth */
|
|
2515
|
+
|
|
2516
|
+
/* motion */
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
.flip-list__content[hidden] {
|
|
2520
|
+
/* color */
|
|
2521
|
+
|
|
2522
|
+
/* typography */
|
|
2523
|
+
|
|
2524
|
+
/* size */
|
|
2525
|
+
display: none;
|
|
2526
|
+
|
|
2527
|
+
/* border */
|
|
2528
|
+
|
|
2529
|
+
/* depth */
|
|
2530
|
+
|
|
2531
|
+
/* motion */
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2178
2534
|
/* src/components/input/input.css */
|
|
2179
2535
|
.input {
|
|
2180
2536
|
/* color */
|