@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,142 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
9
|
+
function _iterable_to_array_limit(arr, i) {
|
|
10
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
11
|
+
if (_i == null) return;
|
|
12
|
+
var _arr = [];
|
|
13
|
+
var _n = true;
|
|
14
|
+
var _d = false;
|
|
15
|
+
var _s, _e;
|
|
16
|
+
try {
|
|
17
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
18
|
+
_arr.push(_s.value);
|
|
19
|
+
if (i && _arr.length === i) break;
|
|
20
|
+
}
|
|
21
|
+
} catch (err) {
|
|
22
|
+
_d = true;
|
|
23
|
+
_e = err;
|
|
24
|
+
} finally{
|
|
25
|
+
try {
|
|
26
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
27
|
+
} finally{
|
|
28
|
+
if (_d) throw _e;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return _arr;
|
|
32
|
+
}
|
|
33
|
+
function _non_iterable_rest() {
|
|
34
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
35
|
+
}
|
|
36
|
+
function _sliced_to_array(arr, i) {
|
|
37
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
38
|
+
}
|
|
39
|
+
function _type_of(obj) {
|
|
40
|
+
"@swc/helpers - typeof";
|
|
41
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
42
|
+
}
|
|
43
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
44
|
+
if (!o) return;
|
|
45
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
46
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
47
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
48
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
49
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
50
|
+
}
|
|
51
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
52
|
+
import { tv } from "tailwind-variants";
|
|
53
|
+
var styles = tv({
|
|
54
|
+
base: "Litho-Grid grid",
|
|
55
|
+
variants: {
|
|
56
|
+
justify: {
|
|
57
|
+
stretch: "justify-stretch",
|
|
58
|
+
start: "justify-start",
|
|
59
|
+
end: "justify-end",
|
|
60
|
+
center: "justify-center"
|
|
61
|
+
},
|
|
62
|
+
align: {
|
|
63
|
+
stretch: "items-stretch",
|
|
64
|
+
start: "items-start",
|
|
65
|
+
end: "items-end",
|
|
66
|
+
center: "items-center"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
defaultVariants: {
|
|
70
|
+
justify: "stretch",
|
|
71
|
+
align: "stretch"
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* Tailwind-based Grid component with customizable columns, gaps, alignment, and justification.
|
|
76
|
+
*
|
|
77
|
+
* @param {object} [props={}] - Props for the Grid component.
|
|
78
|
+
* @param {React.ReactNode} [props.children] - Content to render inside the Grid.
|
|
79
|
+
* @param {number|object} [props.columns] - Defines the number of columns in the grid. Can be a single number or an object with breakpoints as keys.
|
|
80
|
+
* @param {number|object} [props.gap] - Defines the gap between grid items. Can be a single number or an object with breakpoints as keys.
|
|
81
|
+
* @param {"stretch"|"start"|"end"|"center"} [props.justify="stretch"] - Horizontal alignment of the grid items.
|
|
82
|
+
* @param {"stretch"|"start"|"end"|"center"} [props.align="stretch"] - Vertical alignment of the grid items.
|
|
83
|
+
* @param {string} [props.className] - Additional class names to apply to the grid.
|
|
84
|
+
* @returns {JSX.Element} A div element representing the grid container.
|
|
85
|
+
*/ function Grid() {
|
|
86
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
87
|
+
var children = props.children, columns = props.columns, gap = props.gap, _props_justify = props.justify, justify = _props_justify === void 0 ? "stretch" : _props_justify, _props_align = props.align, align = _props_align === void 0 ? "stretch" : _props_align, className = props.className;
|
|
88
|
+
var columnClasses;
|
|
89
|
+
var gapClasses;
|
|
90
|
+
if ((typeof columns === "undefined" ? "undefined" : _type_of(columns)) === "object") {
|
|
91
|
+
columnClasses = Object.entries(columns).map(function(param) {
|
|
92
|
+
var _param = _sliced_to_array(param, 2), breakpoint = _param[0], count = _param[1];
|
|
93
|
+
return breakpoint === "default" || breakpoint === "xs" ? "grid-cols-".concat(count) : "@".concat(breakpoint, ":grid-cols-").concat(count);
|
|
94
|
+
}).join(" ");
|
|
95
|
+
} else {
|
|
96
|
+
columnClasses = "grid-cols-".concat(columns);
|
|
97
|
+
}
|
|
98
|
+
if ((typeof gap === "undefined" ? "undefined" : _type_of(gap)) === "object") {
|
|
99
|
+
gapClasses = Object.entries(gap).map(function(param) {
|
|
100
|
+
var _param = _sliced_to_array(param, 2), breakpoint = _param[0], count = _param[1];
|
|
101
|
+
return breakpoint === "default" || breakpoint === "xs" ? "gap-".concat(count) : "@".concat(breakpoint, ":gap-").concat(count);
|
|
102
|
+
}).join(" ");
|
|
103
|
+
} else {
|
|
104
|
+
gapClasses = "gap-".concat(gap);
|
|
105
|
+
}
|
|
106
|
+
var classes = styles({
|
|
107
|
+
align: align,
|
|
108
|
+
justify: justify
|
|
109
|
+
});
|
|
110
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
111
|
+
className: "".concat(classes, " ").concat(columnClasses, " ").concat(gapClasses).concat(className ? " ".concat(className) : ""),
|
|
112
|
+
children: children
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
;
|
|
116
|
+
/**
|
|
117
|
+
* Cell component for the Grid, allowing column span customization.
|
|
118
|
+
*
|
|
119
|
+
* @param {object} [props={}] - Props for the Cell component.
|
|
120
|
+
* @param {number|object} [props.columnSpan] - Defines the column span for the cell. Can be a single number or an object with breakpoints as keys.
|
|
121
|
+
* @param {React.ReactNode} [props.children] - Content to render inside the cell.
|
|
122
|
+
* @param {string} [props.className] - Additional class names to apply to the cell.
|
|
123
|
+
* @returns {JSX.Element} A div element representing a grid cell.
|
|
124
|
+
*/ function Cell() {
|
|
125
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
126
|
+
var columnSpan = props.columnSpan, children = props.children, className = props.className;
|
|
127
|
+
var columnSpanClasses;
|
|
128
|
+
if ((typeof columnSpan === "undefined" ? "undefined" : _type_of(columnSpan)) === "object") {
|
|
129
|
+
columnSpanClasses = Object.entries(columnSpan).map(function(param) {
|
|
130
|
+
var _param = _sliced_to_array(param, 2), breakpoint = _param[0], count = _param[1];
|
|
131
|
+
return breakpoint === "default" || breakpoint === "xs" ? "col-span-".concat(count) : "@".concat(breakpoint, ":col-span-").concat(count);
|
|
132
|
+
}).join(" ");
|
|
133
|
+
} else {
|
|
134
|
+
columnSpanClasses = "col-span-".concat(columnSpan);
|
|
135
|
+
}
|
|
136
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
137
|
+
className: "Litho-Grid-Cell ".concat(columnSpanClasses).concat(className ? " ".concat(className) : ""),
|
|
138
|
+
children: children
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
Grid.Cell = Cell;
|
|
142
|
+
export default Grid;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
function _object_without_properties(source, excluded) {
|
|
54
|
+
if (source == null) return {};
|
|
55
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
56
|
+
var key, i;
|
|
57
|
+
if (Object.getOwnPropertySymbols) {
|
|
58
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
59
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
60
|
+
key = sourceSymbolKeys[i];
|
|
61
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
62
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
63
|
+
target[key] = source[key];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return target;
|
|
67
|
+
}
|
|
68
|
+
function _object_without_properties_loose(source, excluded) {
|
|
69
|
+
if (source == null) return {};
|
|
70
|
+
var target = {};
|
|
71
|
+
var sourceKeys = Object.keys(source);
|
|
72
|
+
var key, i;
|
|
73
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
74
|
+
key = sourceKeys[i];
|
|
75
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
76
|
+
target[key] = source[key];
|
|
77
|
+
}
|
|
78
|
+
return target;
|
|
79
|
+
}
|
|
80
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
81
|
+
import { tv } from "tailwind-variants";
|
|
82
|
+
var styles = tv({
|
|
83
|
+
base: "Litho-HorizontalStack flex flex-row",
|
|
84
|
+
variants: {
|
|
85
|
+
gap: {
|
|
86
|
+
none: "",
|
|
87
|
+
"0": "gap-0",
|
|
88
|
+
"px": "gap-px",
|
|
89
|
+
"0.5": "gap-0.5",
|
|
90
|
+
"1": "gap-1",
|
|
91
|
+
"2": "gap-2",
|
|
92
|
+
"3": "gap-3",
|
|
93
|
+
"4": "gap-4",
|
|
94
|
+
"6": "gap-6",
|
|
95
|
+
"8": "gap-8",
|
|
96
|
+
"10": "gap-10"
|
|
97
|
+
},
|
|
98
|
+
align: {
|
|
99
|
+
start: "justify-start",
|
|
100
|
+
center: "justify-center",
|
|
101
|
+
end: "justify-end",
|
|
102
|
+
"space-between": "justify-between",
|
|
103
|
+
"space-evenly": "justify-evenly",
|
|
104
|
+
"space-around": "justify-around"
|
|
105
|
+
},
|
|
106
|
+
blockAlign: {
|
|
107
|
+
start: "items-start",
|
|
108
|
+
center: "items-center",
|
|
109
|
+
end: "items-end"
|
|
110
|
+
},
|
|
111
|
+
wrap: {
|
|
112
|
+
true: "flex-wrap",
|
|
113
|
+
false: "flex-nowrap"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
defaultVariants: {
|
|
117
|
+
align: "start",
|
|
118
|
+
blockAlign: "start"
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
/**
|
|
122
|
+
* HorizontalStack Component
|
|
123
|
+
*
|
|
124
|
+
* A flexible horizontal stack component with customizable spacing, alignment, and wrapping.
|
|
125
|
+
*
|
|
126
|
+
* @param {Object} [props={}] - Component props.
|
|
127
|
+
* @param {string} [props.as='div'] - The HTML element to render. Defaults to `div`.
|
|
128
|
+
* @param {React.ReactNode} [props.children] - Child elements to render inside the stack.
|
|
129
|
+
* @param {string} [props.gap] - Spacing between children. Options: 'none', '0', 'px', '0.5', '1', '2', '3', '4', '6', '8', '10'.
|
|
130
|
+
* @param {string} [props.id] - Optional ID for the component.
|
|
131
|
+
* @param {string} [props.className] - Additional custom class names to apply to the component.
|
|
132
|
+
* @param {string} [props.align='start'] - Horizontal alignment of children. Options: 'start', 'center', 'end'.
|
|
133
|
+
* @param {string} [props.blockAlign='start'] - Vertical alignment of children. Options: 'start', 'center', 'end'.
|
|
134
|
+
* @param {boolean} [props.wrap=true] - Whether children should wrap to the next line if necessary. Defaults to `true`.
|
|
135
|
+
* @param {Object} [restProps] - Additional props passed to the root element.
|
|
136
|
+
*
|
|
137
|
+
* @returns {JSX.Element} The rendered HorizontalStack component.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* <HorizontalStack gap="2" align="center" blockAlign="start" wrap={false}>
|
|
141
|
+
* <div>Item 1</div>
|
|
142
|
+
* <div>Item 2</div>
|
|
143
|
+
* </HorizontalStack>
|
|
144
|
+
*/ function HorizontalStack() {
|
|
145
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
146
|
+
var _props_as = props.as, as = _props_as === void 0 ? 'div' : _props_as, children = props.children, gap = props.gap, id = props.id, className = props.className, align = props.align, blockAlign = props.blockAlign, _props_wrap = props.wrap, wrap = _props_wrap === void 0 ? true : _props_wrap, restProps = _object_without_properties(props, [
|
|
147
|
+
"as",
|
|
148
|
+
"children",
|
|
149
|
+
"gap",
|
|
150
|
+
"id",
|
|
151
|
+
"className",
|
|
152
|
+
"align",
|
|
153
|
+
"blockAlign",
|
|
154
|
+
"wrap"
|
|
155
|
+
]);
|
|
156
|
+
var classes = styles({
|
|
157
|
+
gap: gap,
|
|
158
|
+
align: align,
|
|
159
|
+
blockAlign: blockAlign,
|
|
160
|
+
wrap: wrap
|
|
161
|
+
});
|
|
162
|
+
var Element = as;
|
|
163
|
+
return /*#__PURE__*/ _jsx(Element, _object_spread_props(_object_spread({
|
|
164
|
+
id: id,
|
|
165
|
+
className: "".concat(classes).concat(className ? " ".concat(className) : "")
|
|
166
|
+
}, restProps), {
|
|
167
|
+
children: children
|
|
168
|
+
}));
|
|
169
|
+
}
|
|
170
|
+
;
|
|
171
|
+
export default HorizontalStack;
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { tv } from "tailwind-variants";
|
|
3
|
+
import * as PolarisIcons from "@shopify/polaris-icons";
|
|
4
|
+
var styles = tv({
|
|
5
|
+
base: "Litho-Icon",
|
|
6
|
+
variants: {
|
|
7
|
+
display: {
|
|
8
|
+
block: "block",
|
|
9
|
+
flex: "flex items-center justify-center",
|
|
10
|
+
inline: "inline",
|
|
11
|
+
"inline-block": "inline-block",
|
|
12
|
+
"inline-flex": "inline-flex items-center justify-center"
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
xs: "h-3 w-3 min-w-3",
|
|
16
|
+
sm: "h-4 w-4 min-w-4",
|
|
17
|
+
default: "h-5 w-5 min-w-5",
|
|
18
|
+
lg: "h-6 w-6 min-w-6",
|
|
19
|
+
xl: "h-7 w-7 min-w-7",
|
|
20
|
+
"2xl": "h-8 w-8 min-w-8"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
display: "block",
|
|
25
|
+
size: "default"
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
var iconStyles = tv({
|
|
29
|
+
base: "",
|
|
30
|
+
variants: {
|
|
31
|
+
color: {
|
|
32
|
+
white: "fill-white",
|
|
33
|
+
default: "fill-higher",
|
|
34
|
+
base: "fill-higher",
|
|
35
|
+
subdued: "fill-low",
|
|
36
|
+
link: "fill-link",
|
|
37
|
+
primary: "fill-link",
|
|
38
|
+
alternate: "fill-alternate",
|
|
39
|
+
successFgAlternate: "fill-fg-success-alternate",
|
|
40
|
+
success: "fill-fg-success",
|
|
41
|
+
"fg-success": "fill-fg-success",
|
|
42
|
+
critical: "fill-fg-critical",
|
|
43
|
+
"fg-critical": "fill-fg-critical",
|
|
44
|
+
criticalFgAlternate: "fill-fg-critical-alternate",
|
|
45
|
+
warning: "fill-attention-alt-icon",
|
|
46
|
+
info: "fill-info-alt-icon",
|
|
47
|
+
caution: "fill-fg-caution-alternate",
|
|
48
|
+
attention: "fill-attention-alt-icon",
|
|
49
|
+
highlight: "fill-highlight-alt-icon",
|
|
50
|
+
neutral: "fill-neutral-alt-icon",
|
|
51
|
+
normal: "fill-normal",
|
|
52
|
+
disabled: "fill-lowest",
|
|
53
|
+
active: "fill-tab-active-fg",
|
|
54
|
+
"btn-primary-icon": "fill-btn-primary-icon",
|
|
55
|
+
"btn-secondary-icon": "fill-btn-secondary-icon",
|
|
56
|
+
"btn-plain-icon": "fill-btn-plain-icon",
|
|
57
|
+
"btn-link-icon": "fill-btn-link-icon",
|
|
58
|
+
"btn-destructive-icon": "fill-btn-destructive-icon",
|
|
59
|
+
"btn-highlight-icon": "fill-btn-highlight-icon",
|
|
60
|
+
inputFg: "fill-form-input-fg",
|
|
61
|
+
inputFgDisabled: "fill-form-input-fg-disabled",
|
|
62
|
+
"success-icon": "fill-success-icon",
|
|
63
|
+
"critical-icon": "fill-critical-icon",
|
|
64
|
+
"warning-icon": "fill-warning-icon",
|
|
65
|
+
"attention-icon": "fill-attention-icon",
|
|
66
|
+
"info-icon": "fill-info-icon",
|
|
67
|
+
"highlight-icon": "fill-highlight-icon",
|
|
68
|
+
"insight-icon": "fill-insight-icon",
|
|
69
|
+
"neutral-icon": "fill-neutral-icon",
|
|
70
|
+
"success-alt-icon": "fill-success-alt-icon",
|
|
71
|
+
"critical-alt-icon": "fill-critical-alt-icon",
|
|
72
|
+
"warning-alt-icon": "fill-attention-alt-icon",
|
|
73
|
+
"attention-alt-icon": "fill-attention-alt-icon",
|
|
74
|
+
"info-alt-icon": "fill-info-alt-icon",
|
|
75
|
+
"highlight-alt-icon": "fill-highlight-alt-icon",
|
|
76
|
+
"insight-alt-icon": "fill-insight-alt-icon",
|
|
77
|
+
"neutral-alt-icon": "fill-neutral-alt-icon",
|
|
78
|
+
"FrameSaveBar": "fill-alternate dark:fill-black"
|
|
79
|
+
},
|
|
80
|
+
hoverColor: {
|
|
81
|
+
white: "hover:fill-white group-hover/LithoIcon:fill-white",
|
|
82
|
+
default: "hover:fill-higher group-hover/LithoIcon:fill-higher",
|
|
83
|
+
base: "hover:fill-higher group-hover/LithoIcon:fill-higher",
|
|
84
|
+
subdued: "hover:fill-low group-hover/LithoIcon:fill-low",
|
|
85
|
+
link: "hover:fill-link group-hover/LithoIcon:fill-link",
|
|
86
|
+
primary: "hover:fill-link group-hover/LithoIcon:fill-link",
|
|
87
|
+
alternate: "hover:fill-alternate group-hover/LithoIcon:fill-alternate",
|
|
88
|
+
success: "hover:fill-success-alt-icon group-hover/LithoIcon:fill-success-alt-icon",
|
|
89
|
+
critical: "hover:fill-critical-alt-icon group-hover/LithoIcon:fill-critical-alt-icon",
|
|
90
|
+
warning: "hover:fill-attention-alt-icon group-hover/LithoIcon:fill-attention-alt-icon",
|
|
91
|
+
info: "hover:fill-info-alt-icon group-hover/LithoIcon:fill-info-alt-icon",
|
|
92
|
+
caution: "hover:fill-caution-alt-icon group-hover/LithoIcon:fill-caution-alt-icon",
|
|
93
|
+
attention: "hover:fill-attention-alt-icon group-hover/LithoIcon:fill-attention-alt-icon",
|
|
94
|
+
highlight: "hover:fill-highlight-alt-icon group-hover/LithoIcon:fill-highlight-alt-icon",
|
|
95
|
+
neutral: "hover:fill-neutral-alt-icon group-hover/LithoIcon:fill-neutral-alt-icon",
|
|
96
|
+
normal: "hover:fill-normal group-hover/LithoIcon:fill-normal",
|
|
97
|
+
disabled: "hover:fill-lowest group-hover/LithoIcon:fill-lowest",
|
|
98
|
+
active: "hover:fill-tab-active-fg group-hover/LithoIcon:fill-tab-active-fg",
|
|
99
|
+
"btn-primary-icon": "hover:fill-btn-primary-icon group-hover/LithoIcon:fill-btn-primary-icon",
|
|
100
|
+
"btn-secondary-icon": "hover:fill-btn-secondary-icon group-hover/LithoIcon:fill-btn-secondary-icon",
|
|
101
|
+
"btn-plain-icon": "hover:fill-btn-plain-icon group-hover/LithoIcon:fill-btn-plain-icon",
|
|
102
|
+
"btn-link-icon": "hover:fill-btn-link-icon group-hover/LithoIcon:fill-btn-link-icon",
|
|
103
|
+
"btn-destructive-icon": "hover:fill-btn-destructive-icon group-hover/LithoIcon:fill-btn-destructive-icon",
|
|
104
|
+
"btn-highlight-icon": "hover:fill-btn-highlight-icon group-hover/LithoIcon:fill-btn-highlight-icon",
|
|
105
|
+
inputFg: "hover:fill-form-input-fg group-hover/LithoIcon:fill-form-input-fg",
|
|
106
|
+
inputFgDisabled: "hover:fill-form-input-fg-disabled group-hover/LithoIcon:fill-form-input-fg-disabled",
|
|
107
|
+
"success-icon": "hover:fill-success-icon group-hover/LithoIcon:fill-success-icon",
|
|
108
|
+
"critical-icon": "hover:fill-critical-icon group-hover/LithoIcon:fill-critical-icon",
|
|
109
|
+
"warning-icon": "hover:fill-warning-icon group-hover/LithoIcon:fill-warning-icon",
|
|
110
|
+
"attention-icon": "hover:fill-attention-icon group-hover/LithoIcon:fill-attention-icon",
|
|
111
|
+
"info-icon": "hover:fill-info-icon group-hover/LithoIcon:fill-info-icon",
|
|
112
|
+
"highlight-icon": "hover:fill-highlight-icon group-hover/LithoIcon:fill-highlight-icon",
|
|
113
|
+
"insight-icon": "hover:fill-insight-icon group-hover/LithoIcon:fill-insight-icon",
|
|
114
|
+
"neutral-icon": "hover:fill-neutral-icon group-hover/LithoIcon:fill-neutral-icon",
|
|
115
|
+
"success-alt-icon": "hover:fill-success-alt-icon group-hover/LithoIcon:fill-success-alt-icon",
|
|
116
|
+
"critical-alt-icon": "hover:fill-critical-alt-icon group-hover/LithoIcon:fill-critical-alt-icon",
|
|
117
|
+
"warning-alt-icon": "hover:fill-attention-alt-icon group-hover/LithoIcon:fill-attention-alt-icon",
|
|
118
|
+
"attention-alt-icon": "hover:fill-attention-alt-icon group-hover/LithoIcon:fill-attention-alt-icon",
|
|
119
|
+
"info-alt-icon": "hover:fill-info-alt-icon group-hover/LithoIcon:fill-info-alt-icon",
|
|
120
|
+
"highlight-alt-icon": "hover:fill-highlight-alt-icon group-hover/LithoIcon:fill-highlight-alt-icon",
|
|
121
|
+
"insight-alt-icon": "hover:fill-insight-alt-icon group-hover/LithoIcon:fill-insight-alt-icon",
|
|
122
|
+
"neutral-alt-icon": "hover:fill-neutral-alt-icon group-hover/LithoIcon:fill-neutral-alt-icon"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
compoundVariants: [
|
|
126
|
+
{
|
|
127
|
+
stroke: true,
|
|
128
|
+
color: "success",
|
|
129
|
+
class: "fill-transparent stroke-success"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
stroke: true,
|
|
133
|
+
color: "critical",
|
|
134
|
+
class: "fill-transparent stroke-critical"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
stroke: true,
|
|
138
|
+
color: "fg-success",
|
|
139
|
+
class: "fill-transparent stroke-fg-success"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
stroke: true,
|
|
143
|
+
color: "fg-critical",
|
|
144
|
+
class: "fill-transparent stroke-fg-critical"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
stroke: true,
|
|
148
|
+
color: "subdued",
|
|
149
|
+
class: "fill-transparent stroke-low"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
defaultVariants: {
|
|
153
|
+
stroke: false,
|
|
154
|
+
color: "default"
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
var LithoIcons = function(param) {
|
|
158
|
+
var className = param.className;
|
|
159
|
+
return {
|
|
160
|
+
Moon: /*#__PURE__*/ _jsx("svg", {
|
|
161
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
162
|
+
width: "16",
|
|
163
|
+
height: "16",
|
|
164
|
+
strokeWidth: "2",
|
|
165
|
+
viewBox: "0 0 24 24",
|
|
166
|
+
className: className,
|
|
167
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
168
|
+
strokeLinecap: "round",
|
|
169
|
+
strokeLinejoin: "round",
|
|
170
|
+
d: "M21.8 15a9.7 9.7 0 0 1-3.8.8A9.7 9.7 0 0 1 9 2.2a9.8 9.8 0 0 0-6 9c0 5.4 4.4 9.8 9.8 9.8a9.8 9.8 0 0 0 9-6Z"
|
|
171
|
+
})
|
|
172
|
+
}),
|
|
173
|
+
OutlineCircle: /*#__PURE__*/ _jsx("svg", {
|
|
174
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
175
|
+
width: "20",
|
|
176
|
+
height: "20",
|
|
177
|
+
viewBox: "0 0 24 24",
|
|
178
|
+
className: className,
|
|
179
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
180
|
+
d: "M10.5 2.1a10 10 0 0 1 3 0 1 1 0 1 1-.3 2 8 8 0 0 0-2.4 0 1 1 0 0 1-.3-2Zm-3 2c.3.5.2 1.1-.3 1.5a8 8 0 0 0-1.6 1.6A1 1 0 1 1 4 6a10 10 0 0 1 2-2 1 1 0 0 1 1.4.2Zm9 0A1 1 0 0 1 18 4a10 10 0 0 1 2 2 1 1 0 1 1-1.6 1.2 8 8 0 0 0-1.6-1.6 1 1 0 0 1-.2-1.4ZM3.3 9.8c.6 0 1 .6.9 1.1a8 8 0 0 0 0 2.4 1 1 0 0 1-2 .3 10 10 0 0 1 0-3c0-.5.6-.9 1.1-.8Zm17.6 0c.5 0 1 .3 1 .8a10 10 0 0 1 0 3 1 1 0 0 1-1.9-.3 8 8 0 0 0 0-2.4c0-.5.3-1 .9-1.1ZM4.2 16.6a1 1 0 0 1 1.4.2 8 8 0 0 0 1.6 1.6A1 1 0 1 1 6 20a10 10 0 0 1-2-2 1 1 0 0 1 .2-1.4Zm15.6 0c.5.3.6 1 .2 1.4a10 10 0 0 1-2 2 1 1 0 1 1-1.2-1.6 8 8 0 0 0 1.6-1.6 1 1 0 0 1 1.4-.2ZM9.7 20.8c0-.6.6-1 1.1-.9a8 8 0 0 0 2.4 0 1 1 0 0 1 .3 2 10 10 0 0 1-3 0 1 1 0 0 1-.8-1.1Z"
|
|
181
|
+
})
|
|
182
|
+
}),
|
|
183
|
+
Partnerships: /*#__PURE__*/ _jsx("svg", {
|
|
184
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
185
|
+
width: "15",
|
|
186
|
+
height: "12.5",
|
|
187
|
+
className: className,
|
|
188
|
+
children: /*#__PURE__*/ _jsx("g", {
|
|
189
|
+
fillRule: "nonzero",
|
|
190
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
191
|
+
d: "M3.5 0a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-.75 2.25a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0ZM7.5 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-.75 2.25a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0ZM9.25 2.25a2.25 2.25 0 1 1 4.5 0 2.25 2.25 0 0 1-4.5 0Zm2.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM11.5 5a.75.75 0 1 0 0 1.5h.75c.69 0 1.25.56 1.25 1.25v1.5a.75.75 0 1 0 1.5 0v-1.5A2.75 2.75 0 0 0 12.25 5h-.75ZM4.25 5.75A.75.75 0 0 0 3.5 5h-.75A2.75 2.75 0 0 0 0 7.75v1.5a.75.75 0 1 0 1.5 0v-1.5c0-.69.56-1.25 1.25-1.25h.75a.75.75 0 0 0 .75-.75ZM8.25 8A2.75 2.75 0 0 1 11 10.75v1a.75.75 0 0 1-1.5 0v-1c0-.69-.56-1.25-1.25-1.25h-1.5c-.69 0-1.25.56-1.25 1.25v1a.75.75 0 0 1-1.5 0v-1A2.75 2.75 0 0 1 6.75 8h1.5Z"
|
|
192
|
+
})
|
|
193
|
+
})
|
|
194
|
+
}),
|
|
195
|
+
Sun: /*#__PURE__*/ _jsx("svg", {
|
|
196
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
197
|
+
strokeWidth: "2",
|
|
198
|
+
viewBox: "0 0 24 24",
|
|
199
|
+
className: className,
|
|
200
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
201
|
+
strokeLinecap: "round",
|
|
202
|
+
strokeLinejoin: "round",
|
|
203
|
+
d: "M12 3v2.3m6.4.3-1.6 1.6M21 12h-2.3m-.3 6.4-1.6-1.6m-4.8 2V21m-4.8-4.2-1.6 1.6M5.3 12H3m4.2-4.8L5.6 5.6M15.8 12a3.8 3.8 0 1 1-7.6 0 3.8 3.8 0 0 1 7.6 0Z"
|
|
204
|
+
})
|
|
205
|
+
}),
|
|
206
|
+
TrendDownRight: /*#__PURE__*/ _jsx("svg", {
|
|
207
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
208
|
+
width: "6",
|
|
209
|
+
height: "6",
|
|
210
|
+
className: className,
|
|
211
|
+
children: /*#__PURE__*/ _jsx("g", {
|
|
212
|
+
fill: "none",
|
|
213
|
+
fillRule: "evenodd",
|
|
214
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
215
|
+
d: "M5.5 5.5l-5-5M0 5.5h5.5V0"
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
}),
|
|
219
|
+
TrendUpRight: /*#__PURE__*/ _jsx("svg", {
|
|
220
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
221
|
+
width: "6",
|
|
222
|
+
height: "6",
|
|
223
|
+
className: className,
|
|
224
|
+
children: /*#__PURE__*/ _jsx("g", {
|
|
225
|
+
fill: "none",
|
|
226
|
+
fillRule: "evenodd",
|
|
227
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
228
|
+
d: "M5.5 0.5l-5 5M0 0.5h5.5V6"
|
|
229
|
+
})
|
|
230
|
+
})
|
|
231
|
+
})
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* A Component that renders an icon with customizable size, color, and display style, using Shopify Polaris icons.
|
|
236
|
+
* The icon adapts styling based on the provided props and supports a range of color schemes and sizes.
|
|
237
|
+
*
|
|
238
|
+
* @component
|
|
239
|
+
*
|
|
240
|
+
* @param {Object} props - The properties for configuring the Component.
|
|
241
|
+
* @param {Object} props.source - The source icon component from `@shopify/polaris-icons`. Should be a valid Polaris icon component.
|
|
242
|
+
* @param {('white'|'default'|'base'|'subdued'|'link'|'primary'|'alternate'|'successFgAlternate'|'success'|'fg-success'|'critical'|'fg-critical'|'criticalFgAlternate'|'warning'|'info'|'caution'|'attention'|'highlight'|'neutral'|'normal'|'disabled'|'active'|'btn-primary-icon'|'btn-secondary-icon'|'btn-plain-icon'|'btn-link-icon'|'btn-destructive-icon'|'btn-highlight-icon'|'inputFg'|'inputFgDisabled'|'success-icon'|'critical-icon'|'warning-icon'|'attention-icon'|'info-icon'|'highlight-icon'|'insight-icon'|'neutral-icon'|'success-alt-icon'|'critical-alt-icon'|'warning-alt-icon'|'attention-alt-icon'|'info-alt-icon'|'highlight-alt-icon'|'insight-alt-icon'|'neutral-alt-icon')} [props.color="default"] - The color variant for the icon.
|
|
243
|
+
* @param {('white'|'default'|'base'|'subdued'|'link'|'primary'|'alternate'|'success'|'critical'|'warning'|'info'|'caution'|'attention'|'highlight'|'neutral'|'normal'|'disabled'|'active'|'btn-primary-icon'|'btn-secondary-icon'|'btn-plain-icon'|'btn-link-icon'|'btn-destructive-icon'|'btn-highlight-icon'|'inputFg'|'inputFgDisabled'|'success-icon'|'critical-icon'|'warning-icon'|'attention-icon'|'info-icon'|'highlight-icon'|'insight-icon'|'neutral-icon'|'success-alt-icon'|'critical-alt-icon'|'warning-alt-icon'|'attention-alt-icon'|'info-alt-icon'|'highlight-alt-icon'|'insight-alt-icon'|'neutral-alt-icon')} [props.hoverColor] - The hover color variant for the icon.
|
|
244
|
+
* @param {('block'|'flex'|'inline'|'inline-block'|'inline-flex')} [props.display="block"] - Determines the display type for the icon container.
|
|
245
|
+
* @param {('xs'|'sm'|'default'|'lg'|'xl'|'2xl')} [props.size="default"] - Sets the icon size.
|
|
246
|
+
* - 'xs': Extra small (12px)
|
|
247
|
+
* - 'sm': Small (16px)
|
|
248
|
+
* - 'default': Medium (20px)
|
|
249
|
+
* - 'lg': Large (24px)
|
|
250
|
+
* - 'xl': Extra large (28px)
|
|
251
|
+
* - '2xl': Double extra large (32px)
|
|
252
|
+
* @param {boolean} [props.stroke=false] - Whether to use stroke styling instead of fill.
|
|
253
|
+
* @param {Function} [props.onClick] - Click handler for the icon.
|
|
254
|
+
* @param {string} [props.className] - Additional CSS classes to apply.
|
|
255
|
+
* @returns {JSX.Element} The rendered icon component with the specified styles.
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* <Icon
|
|
259
|
+
* source={PolarisIcons.TickMinor}
|
|
260
|
+
* color="success"
|
|
261
|
+
* display="inline"
|
|
262
|
+
* size="lg"
|
|
263
|
+
* />
|
|
264
|
+
*/ function Icon() {
|
|
265
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
266
|
+
var source = props.source, color = props.color, hoverColor = props.hoverColor, _props_display = props.display, display = _props_display === void 0 ? "block" : _props_display, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, _props_stroke = props.stroke, stroke = _props_stroke === void 0 ? false : _props_stroke, onClick = props.onClick, className = props.className;
|
|
267
|
+
var IconComponent = typeof source === "string" ? PolarisIcons[source] : PolarisIcons[source === null || source === void 0 ? void 0 : source.displayName];
|
|
268
|
+
var classes = styles({
|
|
269
|
+
display: display,
|
|
270
|
+
size: size
|
|
271
|
+
});
|
|
272
|
+
var iconClasses = iconStyles({
|
|
273
|
+
color: color,
|
|
274
|
+
stroke: stroke,
|
|
275
|
+
hoverColor: hoverColor
|
|
276
|
+
});
|
|
277
|
+
var LithoIconComponents = LithoIcons({
|
|
278
|
+
className: iconClasses
|
|
279
|
+
});
|
|
280
|
+
if (typeof source === "string" && LithoIconComponents[source]) {
|
|
281
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
282
|
+
className: "".concat(classes).concat(className ? " ".concat(className) : ""),
|
|
283
|
+
onClick: onClick,
|
|
284
|
+
children: LithoIconComponents[source]
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
288
|
+
className: "".concat(classes).concat(className ? " ".concat(className) : ""),
|
|
289
|
+
onClick: onClick,
|
|
290
|
+
children: IconComponent ? /*#__PURE__*/ _jsx(IconComponent, {
|
|
291
|
+
className: iconClasses
|
|
292
|
+
}) : source
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
;
|
|
296
|
+
export default Icon;
|