@heymantle/litho 0.0.1
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/LICENSE +21 -0
- package/README.md +90 -0
- package/dist/cjs/components/ActionList.js +267 -0
- package/dist/cjs/components/AnnouncementBar.js +73 -0
- package/dist/cjs/components/AppProvider.js +245 -0
- package/dist/cjs/components/Autocomplete.js +351 -0
- package/dist/cjs/components/Badge.js +234 -0
- package/dist/cjs/components/Banner.js +264 -0
- package/dist/cjs/components/Box.js +247 -0
- package/dist/cjs/components/Button.js +1018 -0
- package/dist/cjs/components/ButtonGroup.js +196 -0
- package/dist/cjs/components/Card.js +593 -0
- package/dist/cjs/components/Checkbox.js +175 -0
- package/dist/cjs/components/ChoiceList.js +160 -0
- package/dist/cjs/components/Collapsible.js +42 -0
- package/dist/cjs/components/ColorField.js +159 -0
- package/dist/cjs/components/ContextualSaveBar.js +53 -0
- package/dist/cjs/components/DatePicker.js +547 -0
- package/dist/cjs/components/Divider.js +50 -0
- package/dist/cjs/components/DropZone.js +547 -0
- package/dist/cjs/components/EmptyState.js +111 -0
- package/dist/cjs/components/Filters.js +874 -0
- package/dist/cjs/components/FooterHelp.js +48 -0
- package/dist/cjs/components/Form.js +44 -0
- package/dist/cjs/components/Frame.js +386 -0
- package/dist/cjs/components/FrameSaveBar.js +239 -0
- package/dist/cjs/components/Grid.js +151 -0
- package/dist/cjs/components/HorizontalStack.js +180 -0
- package/dist/cjs/components/Icon.js +346 -0
- package/dist/cjs/components/Image.js +191 -0
- package/dist/cjs/components/InlineError.js +57 -0
- package/dist/cjs/components/Label.js +78 -0
- package/dist/cjs/components/Layout.js +228 -0
- package/dist/cjs/components/LayoutSection.js +133 -0
- package/dist/cjs/components/Link.js +128 -0
- package/dist/cjs/components/List.js +69 -0
- package/dist/cjs/components/Listbox.js +211 -0
- package/dist/cjs/components/Loading.js +103 -0
- package/dist/cjs/components/Modal.js +449 -0
- package/dist/cjs/components/Navigation.js +331 -0
- package/dist/cjs/components/Page.js +529 -0
- package/dist/cjs/components/Pagination.js +109 -0
- package/dist/cjs/components/Pane.js +128 -0
- package/dist/cjs/components/Popover.js +365 -0
- package/dist/cjs/components/PopoverManager.js +34 -0
- package/dist/cjs/components/ProgressBar.js +124 -0
- package/dist/cjs/components/RadioButton.js +172 -0
- package/dist/cjs/components/RadioButtonCard.js +193 -0
- package/dist/cjs/components/RangeSlider.js +235 -0
- package/dist/cjs/components/ResourceList.js +105 -0
- package/dist/cjs/components/Select.js +300 -0
- package/dist/cjs/components/SkeletonText.js +130 -0
- package/dist/cjs/components/Spinner.js +72 -0
- package/dist/cjs/components/Table.js +1184 -0
- package/dist/cjs/components/Tabs.js +421 -0
- package/dist/cjs/components/Tag.js +165 -0
- package/dist/cjs/components/Text.js +274 -0
- package/dist/cjs/components/TextField.js +584 -0
- package/dist/cjs/components/Thumbnail.js +73 -0
- package/dist/cjs/components/TimePicker.js +23 -0
- package/dist/cjs/components/Tip.js +220 -0
- package/dist/cjs/components/Tooltip.js +431 -0
- package/dist/cjs/components/TopBar.js +210 -0
- package/dist/cjs/components/VerticalStack.js +161 -0
- package/dist/cjs/index.js +308 -0
- package/dist/cjs/styles/Table.js +591 -0
- package/dist/cjs/utilities/dates.js +339 -0
- package/dist/cjs/utilities/useIndexResourceState.js +175 -0
- package/dist/cjs/utilities/useMounted.js +67 -0
- package/dist/cjs/utilities/useTableScrollState.js +142 -0
- package/dist/esm/components/ActionList.js +216 -0
- package/dist/esm/components/AnnouncementBar.js +63 -0
- package/dist/esm/components/AppProvider.js +185 -0
- package/dist/esm/components/Autocomplete.js +300 -0
- package/dist/esm/components/Badge.js +225 -0
- package/dist/esm/components/Banner.js +254 -0
- package/dist/esm/components/Box.js +238 -0
- package/dist/esm/components/Button.js +967 -0
- package/dist/esm/components/ButtonGroup.js +137 -0
- package/dist/esm/components/Card.js +537 -0
- package/dist/esm/components/Checkbox.js +165 -0
- package/dist/esm/components/ChoiceList.js +145 -0
- package/dist/esm/components/Collapsible.js +32 -0
- package/dist/esm/components/ColorField.js +149 -0
- package/dist/esm/components/ContextualSaveBar.js +43 -0
- package/dist/esm/components/DatePicker.js +532 -0
- package/dist/esm/components/Divider.js +41 -0
- package/dist/esm/components/DropZone.js +537 -0
- package/dist/esm/components/EmptyState.js +101 -0
- package/dist/esm/components/Filters.js +823 -0
- package/dist/esm/components/FooterHelp.js +38 -0
- package/dist/esm/components/Form.js +35 -0
- package/dist/esm/components/Frame.js +376 -0
- package/dist/esm/components/FrameSaveBar.js +229 -0
- package/dist/esm/components/Grid.js +142 -0
- package/dist/esm/components/HorizontalStack.js +171 -0
- package/dist/esm/components/Icon.js +296 -0
- package/dist/esm/components/Image.js +141 -0
- package/dist/esm/components/InlineError.js +43 -0
- package/dist/esm/components/Label.js +63 -0
- package/dist/esm/components/Layout.js +164 -0
- package/dist/esm/components/LayoutSection.js +82 -0
- package/dist/esm/components/Link.js +119 -0
- package/dist/esm/components/List.js +61 -0
- package/dist/esm/components/Listbox.js +201 -0
- package/dist/esm/components/Loading.js +93 -0
- package/dist/esm/components/Modal.js +390 -0
- package/dist/esm/components/Navigation.js +321 -0
- package/dist/esm/components/Page.js +473 -0
- package/dist/esm/components/Pagination.js +99 -0
- package/dist/esm/components/Pane.js +118 -0
- package/dist/esm/components/Popover.js +350 -0
- package/dist/esm/components/PopoverManager.js +24 -0
- package/dist/esm/components/ProgressBar.js +114 -0
- package/dist/esm/components/RadioButton.js +157 -0
- package/dist/esm/components/RadioButtonCard.js +178 -0
- package/dist/esm/components/RangeSlider.js +225 -0
- package/dist/esm/components/ResourceList.js +95 -0
- package/dist/esm/components/Select.js +285 -0
- package/dist/esm/components/SkeletonText.js +120 -0
- package/dist/esm/components/Spinner.js +63 -0
- package/dist/esm/components/Table.js +1129 -0
- package/dist/esm/components/Tabs.js +366 -0
- package/dist/esm/components/Tag.js +151 -0
- package/dist/esm/components/Text.js +265 -0
- package/dist/esm/components/TextField.js +533 -0
- package/dist/esm/components/Thumbnail.js +63 -0
- package/dist/esm/components/TimePicker.js +13 -0
- package/dist/esm/components/Tip.js +169 -0
- package/dist/esm/components/Tooltip.js +380 -0
- package/dist/esm/components/TopBar.js +200 -0
- package/dist/esm/components/VerticalStack.js +152 -0
- package/dist/esm/index.js +61 -0
- package/dist/esm/styles/Table.js +581 -0
- package/dist/esm/utilities/dates.js +289 -0
- package/dist/esm/utilities/useIndexResourceState.js +158 -0
- package/dist/esm/utilities/useMounted.js +57 -0
- package/dist/esm/utilities/useTableScrollState.js +132 -0
- package/index.css +1137 -0
- package/package.json +53 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
get LayoutContext () {
|
|
14
|
+
return LayoutContext;
|
|
15
|
+
},
|
|
16
|
+
get default () {
|
|
17
|
+
return _default;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
var _jsxruntime = require("react/jsx-runtime");
|
|
21
|
+
var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
22
|
+
var _tailwindvariants = require("tailwind-variants");
|
|
23
|
+
var _AppProvider = require("../components/AppProvider");
|
|
24
|
+
var _LayoutSection = /*#__PURE__*/ _interop_require_default(require("./LayoutSection"));
|
|
25
|
+
var _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
26
|
+
function _interop_require_default(obj) {
|
|
27
|
+
return obj && obj.__esModule ? obj : {
|
|
28
|
+
default: obj
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
32
|
+
if (typeof WeakMap !== "function") return null;
|
|
33
|
+
var cacheBabelInterop = new WeakMap();
|
|
34
|
+
var cacheNodeInterop = new WeakMap();
|
|
35
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
36
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
37
|
+
})(nodeInterop);
|
|
38
|
+
}
|
|
39
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
40
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
41
|
+
return obj;
|
|
42
|
+
}
|
|
43
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
44
|
+
return {
|
|
45
|
+
default: obj
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
49
|
+
if (cache && cache.has(obj)) {
|
|
50
|
+
return cache.get(obj);
|
|
51
|
+
}
|
|
52
|
+
var newObj = {
|
|
53
|
+
__proto__: null
|
|
54
|
+
};
|
|
55
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
56
|
+
for(var key in obj){
|
|
57
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
58
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
59
|
+
if (desc && (desc.get || desc.set)) {
|
|
60
|
+
Object.defineProperty(newObj, key, desc);
|
|
61
|
+
} else {
|
|
62
|
+
newObj[key] = obj[key];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
newObj.default = obj;
|
|
67
|
+
if (cache) {
|
|
68
|
+
cache.set(obj, newObj);
|
|
69
|
+
}
|
|
70
|
+
return newObj;
|
|
71
|
+
}
|
|
72
|
+
var LayoutContext = /*#__PURE__*/ (0, _react.createContext)();
|
|
73
|
+
var styles = (0, _tailwindvariants.tv)({
|
|
74
|
+
base: "Litho-Layout flex flex-col gap-4 w-full max-w-full",
|
|
75
|
+
variants: {
|
|
76
|
+
hasSidebarSection: {
|
|
77
|
+
true: ""
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
compoundVariants: [
|
|
81
|
+
{
|
|
82
|
+
hasSidebarSection: true,
|
|
83
|
+
embedded: false,
|
|
84
|
+
className: "@lg:flex-row @lg:gap-5"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
hasSidebarSection: true,
|
|
88
|
+
embedded: true,
|
|
89
|
+
className: "@lg-embed:flex-row @lg-embed:items-start @lg-embed:gap-5"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
defaultVariants: {
|
|
93
|
+
hasSidebarSection: false,
|
|
94
|
+
embedded: false
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
/**
|
|
98
|
+
* Layout component for structuring content.
|
|
99
|
+
*
|
|
100
|
+
* The `Layout` component organizes its children into a flexible and responsive layout.
|
|
101
|
+
* If no `Layout.Section` or `Layout.AnnotatedSection` children are found, it wraps the
|
|
102
|
+
* children inside a default `Layout.Section`.
|
|
103
|
+
*
|
|
104
|
+
* @param {Object} props - Component props.
|
|
105
|
+
* @param {React.ReactNode} props.children - The content to render inside the layout.
|
|
106
|
+
* @returns {JSX.Element} The rendered layout component.
|
|
107
|
+
*/ function Layout() {
|
|
108
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
109
|
+
var embedded = (0, _react.useContext)(_AppProvider.FrameContext).embedded;
|
|
110
|
+
var children = props.children;
|
|
111
|
+
var analyzeChildren = function(children) {
|
|
112
|
+
var depth = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
113
|
+
if (depth > 3) return {
|
|
114
|
+
sections: [],
|
|
115
|
+
hasSection: false,
|
|
116
|
+
parentHasSidebar: false
|
|
117
|
+
};
|
|
118
|
+
var sections = [];
|
|
119
|
+
var hasSection = false;
|
|
120
|
+
var parentHasSidebar = false;
|
|
121
|
+
_react.default.Children.forEach(children, function(child) {
|
|
122
|
+
if (/*#__PURE__*/ _react.default.isValidElement(child)) {
|
|
123
|
+
var type = child.type, childProps = child.props;
|
|
124
|
+
if ([
|
|
125
|
+
"Layout.Section",
|
|
126
|
+
"Layout.AnnotatedSection"
|
|
127
|
+
].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
|
|
128
|
+
hasSection = true;
|
|
129
|
+
}
|
|
130
|
+
if ((type === null || type === void 0 ? void 0 : type.displayName) === "Layout.Section") {
|
|
131
|
+
sections.push(child);
|
|
132
|
+
if (childProps.sidebar === true || childProps.sidebar === "slim") {
|
|
133
|
+
parentHasSidebar = true;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
var childAnalysis = analyzeChildren(childProps === null || childProps === void 0 ? void 0 : childProps.children, depth + 1);
|
|
137
|
+
sections = sections.concat(childAnalysis.sections);
|
|
138
|
+
hasSection = hasSection || childAnalysis.hasSection;
|
|
139
|
+
parentHasSidebar = parentHasSidebar || childAnalysis.parentHasSidebar;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
return {
|
|
143
|
+
sections: sections,
|
|
144
|
+
hasSection: hasSection,
|
|
145
|
+
parentHasSidebar: parentHasSidebar
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
var _useMemo = (0, _react.useMemo)(function() {
|
|
149
|
+
return analyzeChildren(children);
|
|
150
|
+
}, [
|
|
151
|
+
children
|
|
152
|
+
]), sections = _useMemo.sections, hasSection = _useMemo.hasSection, parentHasSidebar = _useMemo.parentHasSidebar;
|
|
153
|
+
var hasSidebarSection = sections.length > 0;
|
|
154
|
+
var classes = styles({
|
|
155
|
+
hasSidebarSection: hasSidebarSection,
|
|
156
|
+
embedded: embedded
|
|
157
|
+
});
|
|
158
|
+
var wrappedChildren = hasSection ? children : /*#__PURE__*/ (0, _jsxruntime.jsx)(Layout.Section, {
|
|
159
|
+
children: children
|
|
160
|
+
});
|
|
161
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(LayoutContext.Provider, {
|
|
162
|
+
value: {
|
|
163
|
+
parentHasSidebar: parentHasSidebar
|
|
164
|
+
},
|
|
165
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
166
|
+
className: classes,
|
|
167
|
+
children: wrappedChildren
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
var annotatedSectionStyles = (0, _tailwindvariants.tv)({
|
|
172
|
+
base: "Litho-Layout__AnnotatedSection w-full flex flex-col gap-1 border-edge-subdued dark:border-tint-alt-2 pb-5",
|
|
173
|
+
variants: {
|
|
174
|
+
embedded: {
|
|
175
|
+
true: "@md-embed:grid @md-embed:grid-cols-12 @md-embed:gap-8 @md-embed:border-b @md-embed:last:border-b-0",
|
|
176
|
+
false: "@md:grid @md:grid-cols-12 @md:gap-8 @md:border-b @md:last:border-b-0"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
defaultVariants: {
|
|
180
|
+
embedded: false
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
/**
|
|
184
|
+
* AnnotatedSection component for displaying a titled section with optional description.
|
|
185
|
+
*
|
|
186
|
+
* The `AnnotatedSection` organizes content into two main areas:
|
|
187
|
+
* - Annotation: Displays a title and description.
|
|
188
|
+
* - Content: Displays the main content provided as children.
|
|
189
|
+
*
|
|
190
|
+
* @param {Object} props - Component props.
|
|
191
|
+
* @param {React.ReactNode} props.children - The main content of the section.
|
|
192
|
+
* @param {string|React.ReactNode} [props.title] - The title for the annotated section.
|
|
193
|
+
* @param {string|React.ReactNode} [props.description] - A brief description for the annotated section.
|
|
194
|
+
* @returns {JSX.Element} The rendered annotated section component.
|
|
195
|
+
*/ function AnnotatedSection() {
|
|
196
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
197
|
+
var children = props.children, title = props.title, description = props.description;
|
|
198
|
+
var embedded = (0, _react.useContext)(_AppProvider.FrameContext).embedded;
|
|
199
|
+
var annotatedSectionClasses = annotatedSectionStyles({
|
|
200
|
+
embedded: embedded
|
|
201
|
+
});
|
|
202
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
203
|
+
className: annotatedSectionClasses,
|
|
204
|
+
children: [
|
|
205
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
206
|
+
className: "Litho-Layout__Annotation flex flex-col gap-1 @md:col-span-4 py-2",
|
|
207
|
+
children: [
|
|
208
|
+
title && (typeof title === "string" ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
209
|
+
variant: "headingMd",
|
|
210
|
+
children: title
|
|
211
|
+
}) : title),
|
|
212
|
+
description && (typeof description === "string" ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_Text.default, {
|
|
213
|
+
color: "subdued",
|
|
214
|
+
children: description
|
|
215
|
+
}) : description)
|
|
216
|
+
]
|
|
217
|
+
}),
|
|
218
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
219
|
+
className: "Litho-Layout__AnnotationContent @md:col-span-8",
|
|
220
|
+
children: children
|
|
221
|
+
})
|
|
222
|
+
]
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
AnnotatedSection.displayName = "Layout.AnnotatedSection";
|
|
226
|
+
Layout.AnnotatedSection = AnnotatedSection;
|
|
227
|
+
Layout.Section = _LayoutSection.default;
|
|
228
|
+
var _default = Layout;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return _default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _jsxruntime = require("react/jsx-runtime");
|
|
13
|
+
var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
14
|
+
var _tailwindvariants = require("tailwind-variants");
|
|
15
|
+
var _AppProvider = require("../components/AppProvider");
|
|
16
|
+
var _Layout = require("./Layout");
|
|
17
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
18
|
+
if (typeof WeakMap !== "function") return null;
|
|
19
|
+
var cacheBabelInterop = new WeakMap();
|
|
20
|
+
var cacheNodeInterop = new WeakMap();
|
|
21
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
22
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
23
|
+
})(nodeInterop);
|
|
24
|
+
}
|
|
25
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
26
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
27
|
+
return obj;
|
|
28
|
+
}
|
|
29
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
30
|
+
return {
|
|
31
|
+
default: obj
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
35
|
+
if (cache && cache.has(obj)) {
|
|
36
|
+
return cache.get(obj);
|
|
37
|
+
}
|
|
38
|
+
var newObj = {
|
|
39
|
+
__proto__: null
|
|
40
|
+
};
|
|
41
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
42
|
+
for(var key in obj){
|
|
43
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
44
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
45
|
+
if (desc && (desc.get || desc.set)) {
|
|
46
|
+
Object.defineProperty(newObj, key, desc);
|
|
47
|
+
} else {
|
|
48
|
+
newObj[key] = obj[key];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
newObj.default = obj;
|
|
53
|
+
if (cache) {
|
|
54
|
+
cache.set(obj, newObj);
|
|
55
|
+
}
|
|
56
|
+
return newObj;
|
|
57
|
+
}
|
|
58
|
+
var sectionStyles = (0, _tailwindvariants.tv)({
|
|
59
|
+
base: "Litho-Layout__Section",
|
|
60
|
+
variants: {
|
|
61
|
+
sidebar: {
|
|
62
|
+
true: "",
|
|
63
|
+
slim: ""
|
|
64
|
+
},
|
|
65
|
+
sibling: {
|
|
66
|
+
none: "w-full",
|
|
67
|
+
sidebar: "flex-1 basis-0 min-w-0"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
compoundVariants: [
|
|
71
|
+
{
|
|
72
|
+
sidebar: true,
|
|
73
|
+
embedded: true,
|
|
74
|
+
className: "@lg-embed:w-1/3 @lg-embed:max-w-80 @xl-embed:max-w-120 @lg-embed:w-1/3 @lg-embed:max-w-120"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
sidebar: true,
|
|
78
|
+
embedded: false,
|
|
79
|
+
className: "@lg:w-1/3 @lg:max-w-80 @xl:max-w-120 @lg:w-1/3 @lg:max-w-120"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
sidebar: "slim",
|
|
83
|
+
embedded: true,
|
|
84
|
+
className: "@lg-embed:w-1/3 @lg-embed:max-w-80 @lg-embed:w-1/3 @lg-embed:max-w-80"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
sidebar: "slim",
|
|
88
|
+
embedded: false,
|
|
89
|
+
className: "@lg:w-1/3 @lg:max-w-80 @lg:w-1/3 @lg:max-w-80"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
defaultVariants: {
|
|
93
|
+
sidebar: false,
|
|
94
|
+
embedded: false
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
/**
|
|
98
|
+
* Section component for flexible content grouping.
|
|
99
|
+
*
|
|
100
|
+
* The `Section` allows for configuring its layout, supporting sidebar and slim variants.
|
|
101
|
+
*
|
|
102
|
+
* @param {Object} props - Component props.
|
|
103
|
+
* @param {React.ReactNode} props.children - The content to render inside the section.
|
|
104
|
+
* @param {boolean|"slim"} [props.sidebar=false] - Configures the section layout:
|
|
105
|
+
* - `true`: Makes it a sidebar with a 1/3 basis.
|
|
106
|
+
* - `"slim"`: Makes it a slim sidebar with a max width of 320px.
|
|
107
|
+
* - `false`: Allows it to grow.
|
|
108
|
+
* @params {boolean|integer} props.sticky - Specify whether the section becomes sticky or not
|
|
109
|
+
* @returns {JSX.Element} The rendered section component.
|
|
110
|
+
*/ function Section() {
|
|
111
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
112
|
+
var children = props.children, _props_sidebar = props.sidebar, sidebar = _props_sidebar === void 0 ? false : _props_sidebar, className = props.className, sticky = props.sticky;
|
|
113
|
+
var embedded = (0, _react.useContext)(_AppProvider.FrameContext).embedded;
|
|
114
|
+
var parentHasSidebar = (0, _react.useContext)(_Layout.LayoutContext).parentHasSidebar;
|
|
115
|
+
var sectionClasses = sectionStyles({
|
|
116
|
+
sidebar: sidebar,
|
|
117
|
+
sticky: sticky,
|
|
118
|
+
sibling: sidebar ? undefined : parentHasSidebar ? "sidebar" : "none",
|
|
119
|
+
embedded: embedded
|
|
120
|
+
});
|
|
121
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
122
|
+
className: "".concat(sectionClasses).concat(className ? " ".concat(className) : ""),
|
|
123
|
+
children: sticky ? /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
124
|
+
className: "sticky".concat(typeof sticky === "boolean" ? " top-[calc(var(--litho-top-bar-height)+var(--spacing)*4)]" : ""),
|
|
125
|
+
style: typeof sticky === "number" ? {
|
|
126
|
+
top: sticky
|
|
127
|
+
} : undefined,
|
|
128
|
+
children: children
|
|
129
|
+
}) : children
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
Section.displayName = "Layout.Section";
|
|
133
|
+
var _default = Section;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
var _tailwindvariants = require("tailwind-variants");
|
|
13
|
+
var styles = (0, _tailwindvariants.tv)({
|
|
14
|
+
base: "Litho-Link cursor-pointer hover:underline",
|
|
15
|
+
variants: {
|
|
16
|
+
monochrome: {
|
|
17
|
+
true: "text-normal hover:text-higher"
|
|
18
|
+
},
|
|
19
|
+
removeUnderline: {
|
|
20
|
+
true: "no-underline",
|
|
21
|
+
false: "underline"
|
|
22
|
+
},
|
|
23
|
+
bold: {
|
|
24
|
+
true: "font-medium no-underline",
|
|
25
|
+
false: "font-normal"
|
|
26
|
+
},
|
|
27
|
+
disabled: {
|
|
28
|
+
true: "text-lowest hover:text-lowest cursor-default hover:no-underline",
|
|
29
|
+
false: ""
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
compoundVariants: [
|
|
33
|
+
{
|
|
34
|
+
monochrome: false,
|
|
35
|
+
disabled: false,
|
|
36
|
+
color: "link",
|
|
37
|
+
className: "text-link hover:text-link-lower"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
disabled: false,
|
|
41
|
+
monochrome: false,
|
|
42
|
+
color: "info",
|
|
43
|
+
className: "text-info-alt-fg dark:text-info-alt-fg-dark"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
disabled: false,
|
|
47
|
+
monochrome: false,
|
|
48
|
+
color: "critical",
|
|
49
|
+
className: "text-critical-alt-fg dark:text-critical-alt-fg-dark"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
disabled: false,
|
|
53
|
+
monochrome: false,
|
|
54
|
+
color: "success",
|
|
55
|
+
className: "text-success-alt-fg dark:text-success-alt-fg-dark"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
disabled: false,
|
|
59
|
+
monochrome: false,
|
|
60
|
+
color: "warning",
|
|
61
|
+
className: "text-warning-alt-fg dark:text-warning-alt-fg-dark"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
disabled: false,
|
|
65
|
+
monochrome: false,
|
|
66
|
+
color: "attention",
|
|
67
|
+
className: "text-attention-alt-fg dark:text-attention-alt-fg-dark"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
disabled: false,
|
|
71
|
+
monochrome: false,
|
|
72
|
+
color: "highlight",
|
|
73
|
+
className: "text-highlight-alt-fg dark:text-highlight-alt-fg-dark"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
disabled: false,
|
|
77
|
+
monochrome: false,
|
|
78
|
+
color: "neutral",
|
|
79
|
+
className: "text-neutral-alt-fg dark:text-neutral-alt-fg-dark"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
defaultVariants: {
|
|
83
|
+
monochrome: false,
|
|
84
|
+
removeUnderline: false,
|
|
85
|
+
bold: false,
|
|
86
|
+
disabled: false,
|
|
87
|
+
color: "link"
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* Renders an accessible link with customizable styling based on variants.
|
|
92
|
+
*
|
|
93
|
+
* @param {Object} props - Props for the Link component.
|
|
94
|
+
* @param {string} props.url - The URL the link points to.
|
|
95
|
+
* @param {React.ReactNode} props.children - Content to display within the link.
|
|
96
|
+
* @param {Function} [props.onClick] - Optional click event handler for the link.
|
|
97
|
+
* @param {boolean} [props.external=false] - If true, opens the link in a new tab.
|
|
98
|
+
* @param {string} [props.target] - Optional target attribute for specifying where to open the link.
|
|
99
|
+
* @param {string} [props.id] - Optional id attribute for the link.
|
|
100
|
+
* @param {boolean} [props.monochrome=false] - If true, applies monochrome color scheme.
|
|
101
|
+
* @param {boolean} [props.removeUnderline=false] - If true, removes underline from the link.
|
|
102
|
+
* @param {string} [props.accessibilityLabel] - Optional aria-label for accessibility.
|
|
103
|
+
* @param {string} [props.dataPrimaryLink] - Optional data attribute for custom tracking.
|
|
104
|
+
*
|
|
105
|
+
* @returns {JSX.Element} Rendered link element.
|
|
106
|
+
*/ function Link() {
|
|
107
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
108
|
+
var url = props.url, children = props.children, onClick = props.onClick, external = props.external, target = props.target, _props_bold = props.bold, bold = _props_bold === void 0 ? false : _props_bold, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, id = props.id, monochrome = props.monochrome, removeUnderline = props.removeUnderline, accessibilityLabel = props.accessibilityLabel, dataPrimaryLink = props.dataPrimaryLink, color = props.color, className = props.className;
|
|
109
|
+
var classes = styles({
|
|
110
|
+
monochrome: monochrome,
|
|
111
|
+
removeUnderline: removeUnderline,
|
|
112
|
+
bold: bold,
|
|
113
|
+
disabled: disabled,
|
|
114
|
+
color: color
|
|
115
|
+
});
|
|
116
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("a", {
|
|
117
|
+
href: disabled ? undefined : url,
|
|
118
|
+
className: "".concat(classes).concat(className ? " ".concat(className) : ""),
|
|
119
|
+
onClick: disabled ? undefined : onClick,
|
|
120
|
+
target: target ? target : external ? "_blank" : undefined,
|
|
121
|
+
id: id,
|
|
122
|
+
"aria-label": accessibilityLabel,
|
|
123
|
+
"data-primary-link": dataPrimaryLink,
|
|
124
|
+
children: children
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
Link.displayName = "Link";
|
|
128
|
+
var _default = Link;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
var _tailwindvariants = require("tailwind-variants");
|
|
13
|
+
var styles = (0, _tailwindvariants.tv)({
|
|
14
|
+
base: "Litho-List list-outside ml-5",
|
|
15
|
+
variants: {
|
|
16
|
+
type: {
|
|
17
|
+
bullet: "list-disc",
|
|
18
|
+
number: "list-decimal"
|
|
19
|
+
},
|
|
20
|
+
spacing: {
|
|
21
|
+
loose: "space-y-2",
|
|
22
|
+
normal: "space-y-1",
|
|
23
|
+
tight: "space-y-0"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* List component for rendering unordered or ordered lists.
|
|
29
|
+
*
|
|
30
|
+
* @param {Object} props - Component props.
|
|
31
|
+
* @param {React.ReactNode} props.children - The list items to render inside the list.
|
|
32
|
+
* @param {'normal' | 'loose' | 'tight'} [props.spacing='normal'] - Controls vertical spacing between list items.
|
|
33
|
+
* @param {'bullet' | 'number'} [props.type='bullet'] - Determines list type: bullet (unordered) or number (ordered).
|
|
34
|
+
* @param {string} [props.className] - Additional class names to apply to the list container.
|
|
35
|
+
* @returns {JSX.Element} The rendered List component.
|
|
36
|
+
*/ function List() {
|
|
37
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
38
|
+
var children = props.children, _props_spacing = props.spacing, spacing = _props_spacing === void 0 ? 'normal' : _props_spacing, _props_type = props.type, type = _props_type === void 0 ? 'bullet' : _props_type, className = props.className;
|
|
39
|
+
var classes = styles({
|
|
40
|
+
spacing: spacing,
|
|
41
|
+
type: type
|
|
42
|
+
});
|
|
43
|
+
var Element = type === 'bullet' ? 'ul' : 'ol';
|
|
44
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(Element, {
|
|
45
|
+
className: "".concat(classes).concat(className ? " ".concat(className) : ''),
|
|
46
|
+
children: children
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
var itemStyles = (0, _tailwindvariants.tv)({
|
|
50
|
+
base: "Litho-ListItem text-left leading-4"
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* Item component for individual list items in the List component.
|
|
54
|
+
*
|
|
55
|
+
* @param {Object} props - Component props.
|
|
56
|
+
* @param {React.ReactNode} props.children - The content of the list item.
|
|
57
|
+
* @param {string} [props.className] - Additional class names to apply to the list item.
|
|
58
|
+
* @returns {JSX.Element} The rendered Item component.
|
|
59
|
+
*/ function Item() {
|
|
60
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
61
|
+
var children = props.children, className = props.className;
|
|
62
|
+
var itemClasses = itemStyles();
|
|
63
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("li", {
|
|
64
|
+
className: "".concat(itemClasses).concat(className ? " ".concat(className) : ''),
|
|
65
|
+
children: children
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
List.Item = Item;
|
|
69
|
+
var _default = List;
|