@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,346 @@
|
|
|
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 _polarisicons = /*#__PURE__*/ _interop_require_wildcard(require("@shopify/polaris-icons"));
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
15
|
+
if (typeof WeakMap !== "function") return null;
|
|
16
|
+
var cacheBabelInterop = new WeakMap();
|
|
17
|
+
var cacheNodeInterop = new WeakMap();
|
|
18
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
19
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
20
|
+
})(nodeInterop);
|
|
21
|
+
}
|
|
22
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
23
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
24
|
+
return obj;
|
|
25
|
+
}
|
|
26
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
27
|
+
return {
|
|
28
|
+
default: obj
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
32
|
+
if (cache && cache.has(obj)) {
|
|
33
|
+
return cache.get(obj);
|
|
34
|
+
}
|
|
35
|
+
var newObj = {
|
|
36
|
+
__proto__: null
|
|
37
|
+
};
|
|
38
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
39
|
+
for(var key in obj){
|
|
40
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
41
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
42
|
+
if (desc && (desc.get || desc.set)) {
|
|
43
|
+
Object.defineProperty(newObj, key, desc);
|
|
44
|
+
} else {
|
|
45
|
+
newObj[key] = obj[key];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
newObj.default = obj;
|
|
50
|
+
if (cache) {
|
|
51
|
+
cache.set(obj, newObj);
|
|
52
|
+
}
|
|
53
|
+
return newObj;
|
|
54
|
+
}
|
|
55
|
+
var styles = (0, _tailwindvariants.tv)({
|
|
56
|
+
base: "Litho-Icon",
|
|
57
|
+
variants: {
|
|
58
|
+
display: {
|
|
59
|
+
block: "block",
|
|
60
|
+
flex: "flex items-center justify-center",
|
|
61
|
+
inline: "inline",
|
|
62
|
+
"inline-block": "inline-block",
|
|
63
|
+
"inline-flex": "inline-flex items-center justify-center"
|
|
64
|
+
},
|
|
65
|
+
size: {
|
|
66
|
+
xs: "h-3 w-3 min-w-3",
|
|
67
|
+
sm: "h-4 w-4 min-w-4",
|
|
68
|
+
default: "h-5 w-5 min-w-5",
|
|
69
|
+
lg: "h-6 w-6 min-w-6",
|
|
70
|
+
xl: "h-7 w-7 min-w-7",
|
|
71
|
+
"2xl": "h-8 w-8 min-w-8"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
defaultVariants: {
|
|
75
|
+
display: "block",
|
|
76
|
+
size: "default"
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
var iconStyles = (0, _tailwindvariants.tv)({
|
|
80
|
+
base: "",
|
|
81
|
+
variants: {
|
|
82
|
+
color: {
|
|
83
|
+
white: "fill-white",
|
|
84
|
+
default: "fill-higher",
|
|
85
|
+
base: "fill-higher",
|
|
86
|
+
subdued: "fill-low",
|
|
87
|
+
link: "fill-link",
|
|
88
|
+
primary: "fill-link",
|
|
89
|
+
alternate: "fill-alternate",
|
|
90
|
+
successFgAlternate: "fill-fg-success-alternate",
|
|
91
|
+
success: "fill-fg-success",
|
|
92
|
+
"fg-success": "fill-fg-success",
|
|
93
|
+
critical: "fill-fg-critical",
|
|
94
|
+
"fg-critical": "fill-fg-critical",
|
|
95
|
+
criticalFgAlternate: "fill-fg-critical-alternate",
|
|
96
|
+
warning: "fill-attention-alt-icon",
|
|
97
|
+
info: "fill-info-alt-icon",
|
|
98
|
+
caution: "fill-fg-caution-alternate",
|
|
99
|
+
attention: "fill-attention-alt-icon",
|
|
100
|
+
highlight: "fill-highlight-alt-icon",
|
|
101
|
+
neutral: "fill-neutral-alt-icon",
|
|
102
|
+
normal: "fill-normal",
|
|
103
|
+
disabled: "fill-lowest",
|
|
104
|
+
active: "fill-tab-active-fg",
|
|
105
|
+
"btn-primary-icon": "fill-btn-primary-icon",
|
|
106
|
+
"btn-secondary-icon": "fill-btn-secondary-icon",
|
|
107
|
+
"btn-plain-icon": "fill-btn-plain-icon",
|
|
108
|
+
"btn-link-icon": "fill-btn-link-icon",
|
|
109
|
+
"btn-destructive-icon": "fill-btn-destructive-icon",
|
|
110
|
+
"btn-highlight-icon": "fill-btn-highlight-icon",
|
|
111
|
+
inputFg: "fill-form-input-fg",
|
|
112
|
+
inputFgDisabled: "fill-form-input-fg-disabled",
|
|
113
|
+
"success-icon": "fill-success-icon",
|
|
114
|
+
"critical-icon": "fill-critical-icon",
|
|
115
|
+
"warning-icon": "fill-warning-icon",
|
|
116
|
+
"attention-icon": "fill-attention-icon",
|
|
117
|
+
"info-icon": "fill-info-icon",
|
|
118
|
+
"highlight-icon": "fill-highlight-icon",
|
|
119
|
+
"insight-icon": "fill-insight-icon",
|
|
120
|
+
"neutral-icon": "fill-neutral-icon",
|
|
121
|
+
"success-alt-icon": "fill-success-alt-icon",
|
|
122
|
+
"critical-alt-icon": "fill-critical-alt-icon",
|
|
123
|
+
"warning-alt-icon": "fill-attention-alt-icon",
|
|
124
|
+
"attention-alt-icon": "fill-attention-alt-icon",
|
|
125
|
+
"info-alt-icon": "fill-info-alt-icon",
|
|
126
|
+
"highlight-alt-icon": "fill-highlight-alt-icon",
|
|
127
|
+
"insight-alt-icon": "fill-insight-alt-icon",
|
|
128
|
+
"neutral-alt-icon": "fill-neutral-alt-icon",
|
|
129
|
+
"FrameSaveBar": "fill-alternate dark:fill-black"
|
|
130
|
+
},
|
|
131
|
+
hoverColor: {
|
|
132
|
+
white: "hover:fill-white group-hover/LithoIcon:fill-white",
|
|
133
|
+
default: "hover:fill-higher group-hover/LithoIcon:fill-higher",
|
|
134
|
+
base: "hover:fill-higher group-hover/LithoIcon:fill-higher",
|
|
135
|
+
subdued: "hover:fill-low group-hover/LithoIcon:fill-low",
|
|
136
|
+
link: "hover:fill-link group-hover/LithoIcon:fill-link",
|
|
137
|
+
primary: "hover:fill-link group-hover/LithoIcon:fill-link",
|
|
138
|
+
alternate: "hover:fill-alternate group-hover/LithoIcon:fill-alternate",
|
|
139
|
+
success: "hover:fill-success-alt-icon group-hover/LithoIcon:fill-success-alt-icon",
|
|
140
|
+
critical: "hover:fill-critical-alt-icon group-hover/LithoIcon:fill-critical-alt-icon",
|
|
141
|
+
warning: "hover:fill-attention-alt-icon group-hover/LithoIcon:fill-attention-alt-icon",
|
|
142
|
+
info: "hover:fill-info-alt-icon group-hover/LithoIcon:fill-info-alt-icon",
|
|
143
|
+
caution: "hover:fill-caution-alt-icon group-hover/LithoIcon:fill-caution-alt-icon",
|
|
144
|
+
attention: "hover:fill-attention-alt-icon group-hover/LithoIcon:fill-attention-alt-icon",
|
|
145
|
+
highlight: "hover:fill-highlight-alt-icon group-hover/LithoIcon:fill-highlight-alt-icon",
|
|
146
|
+
neutral: "hover:fill-neutral-alt-icon group-hover/LithoIcon:fill-neutral-alt-icon",
|
|
147
|
+
normal: "hover:fill-normal group-hover/LithoIcon:fill-normal",
|
|
148
|
+
disabled: "hover:fill-lowest group-hover/LithoIcon:fill-lowest",
|
|
149
|
+
active: "hover:fill-tab-active-fg group-hover/LithoIcon:fill-tab-active-fg",
|
|
150
|
+
"btn-primary-icon": "hover:fill-btn-primary-icon group-hover/LithoIcon:fill-btn-primary-icon",
|
|
151
|
+
"btn-secondary-icon": "hover:fill-btn-secondary-icon group-hover/LithoIcon:fill-btn-secondary-icon",
|
|
152
|
+
"btn-plain-icon": "hover:fill-btn-plain-icon group-hover/LithoIcon:fill-btn-plain-icon",
|
|
153
|
+
"btn-link-icon": "hover:fill-btn-link-icon group-hover/LithoIcon:fill-btn-link-icon",
|
|
154
|
+
"btn-destructive-icon": "hover:fill-btn-destructive-icon group-hover/LithoIcon:fill-btn-destructive-icon",
|
|
155
|
+
"btn-highlight-icon": "hover:fill-btn-highlight-icon group-hover/LithoIcon:fill-btn-highlight-icon",
|
|
156
|
+
inputFg: "hover:fill-form-input-fg group-hover/LithoIcon:fill-form-input-fg",
|
|
157
|
+
inputFgDisabled: "hover:fill-form-input-fg-disabled group-hover/LithoIcon:fill-form-input-fg-disabled",
|
|
158
|
+
"success-icon": "hover:fill-success-icon group-hover/LithoIcon:fill-success-icon",
|
|
159
|
+
"critical-icon": "hover:fill-critical-icon group-hover/LithoIcon:fill-critical-icon",
|
|
160
|
+
"warning-icon": "hover:fill-warning-icon group-hover/LithoIcon:fill-warning-icon",
|
|
161
|
+
"attention-icon": "hover:fill-attention-icon group-hover/LithoIcon:fill-attention-icon",
|
|
162
|
+
"info-icon": "hover:fill-info-icon group-hover/LithoIcon:fill-info-icon",
|
|
163
|
+
"highlight-icon": "hover:fill-highlight-icon group-hover/LithoIcon:fill-highlight-icon",
|
|
164
|
+
"insight-icon": "hover:fill-insight-icon group-hover/LithoIcon:fill-insight-icon",
|
|
165
|
+
"neutral-icon": "hover:fill-neutral-icon group-hover/LithoIcon:fill-neutral-icon",
|
|
166
|
+
"success-alt-icon": "hover:fill-success-alt-icon group-hover/LithoIcon:fill-success-alt-icon",
|
|
167
|
+
"critical-alt-icon": "hover:fill-critical-alt-icon group-hover/LithoIcon:fill-critical-alt-icon",
|
|
168
|
+
"warning-alt-icon": "hover:fill-attention-alt-icon group-hover/LithoIcon:fill-attention-alt-icon",
|
|
169
|
+
"attention-alt-icon": "hover:fill-attention-alt-icon group-hover/LithoIcon:fill-attention-alt-icon",
|
|
170
|
+
"info-alt-icon": "hover:fill-info-alt-icon group-hover/LithoIcon:fill-info-alt-icon",
|
|
171
|
+
"highlight-alt-icon": "hover:fill-highlight-alt-icon group-hover/LithoIcon:fill-highlight-alt-icon",
|
|
172
|
+
"insight-alt-icon": "hover:fill-insight-alt-icon group-hover/LithoIcon:fill-insight-alt-icon",
|
|
173
|
+
"neutral-alt-icon": "hover:fill-neutral-alt-icon group-hover/LithoIcon:fill-neutral-alt-icon"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
compoundVariants: [
|
|
177
|
+
{
|
|
178
|
+
stroke: true,
|
|
179
|
+
color: "success",
|
|
180
|
+
class: "fill-transparent stroke-success"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
stroke: true,
|
|
184
|
+
color: "critical",
|
|
185
|
+
class: "fill-transparent stroke-critical"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
stroke: true,
|
|
189
|
+
color: "fg-success",
|
|
190
|
+
class: "fill-transparent stroke-fg-success"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
stroke: true,
|
|
194
|
+
color: "fg-critical",
|
|
195
|
+
class: "fill-transparent stroke-fg-critical"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
stroke: true,
|
|
199
|
+
color: "subdued",
|
|
200
|
+
class: "fill-transparent stroke-low"
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
defaultVariants: {
|
|
204
|
+
stroke: false,
|
|
205
|
+
color: "default"
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
var LithoIcons = function(param) {
|
|
209
|
+
var className = param.className;
|
|
210
|
+
return {
|
|
211
|
+
Moon: /*#__PURE__*/ (0, _jsxruntime.jsx)("svg", {
|
|
212
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
213
|
+
width: "16",
|
|
214
|
+
height: "16",
|
|
215
|
+
strokeWidth: "2",
|
|
216
|
+
viewBox: "0 0 24 24",
|
|
217
|
+
className: className,
|
|
218
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("path", {
|
|
219
|
+
strokeLinecap: "round",
|
|
220
|
+
strokeLinejoin: "round",
|
|
221
|
+
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"
|
|
222
|
+
})
|
|
223
|
+
}),
|
|
224
|
+
OutlineCircle: /*#__PURE__*/ (0, _jsxruntime.jsx)("svg", {
|
|
225
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
226
|
+
width: "20",
|
|
227
|
+
height: "20",
|
|
228
|
+
viewBox: "0 0 24 24",
|
|
229
|
+
className: className,
|
|
230
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("path", {
|
|
231
|
+
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"
|
|
232
|
+
})
|
|
233
|
+
}),
|
|
234
|
+
Partnerships: /*#__PURE__*/ (0, _jsxruntime.jsx)("svg", {
|
|
235
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
236
|
+
width: "15",
|
|
237
|
+
height: "12.5",
|
|
238
|
+
className: className,
|
|
239
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("g", {
|
|
240
|
+
fillRule: "nonzero",
|
|
241
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("path", {
|
|
242
|
+
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"
|
|
243
|
+
})
|
|
244
|
+
})
|
|
245
|
+
}),
|
|
246
|
+
Sun: /*#__PURE__*/ (0, _jsxruntime.jsx)("svg", {
|
|
247
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
248
|
+
strokeWidth: "2",
|
|
249
|
+
viewBox: "0 0 24 24",
|
|
250
|
+
className: className,
|
|
251
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("path", {
|
|
252
|
+
strokeLinecap: "round",
|
|
253
|
+
strokeLinejoin: "round",
|
|
254
|
+
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"
|
|
255
|
+
})
|
|
256
|
+
}),
|
|
257
|
+
TrendDownRight: /*#__PURE__*/ (0, _jsxruntime.jsx)("svg", {
|
|
258
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
259
|
+
width: "6",
|
|
260
|
+
height: "6",
|
|
261
|
+
className: className,
|
|
262
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("g", {
|
|
263
|
+
fill: "none",
|
|
264
|
+
fillRule: "evenodd",
|
|
265
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("path", {
|
|
266
|
+
d: "M5.5 5.5l-5-5M0 5.5h5.5V0"
|
|
267
|
+
})
|
|
268
|
+
})
|
|
269
|
+
}),
|
|
270
|
+
TrendUpRight: /*#__PURE__*/ (0, _jsxruntime.jsx)("svg", {
|
|
271
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
272
|
+
width: "6",
|
|
273
|
+
height: "6",
|
|
274
|
+
className: className,
|
|
275
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("g", {
|
|
276
|
+
fill: "none",
|
|
277
|
+
fillRule: "evenodd",
|
|
278
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("path", {
|
|
279
|
+
d: "M5.5 0.5l-5 5M0 0.5h5.5V6"
|
|
280
|
+
})
|
|
281
|
+
})
|
|
282
|
+
})
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
/**
|
|
286
|
+
* A Component that renders an icon with customizable size, color, and display style, using Shopify Polaris icons.
|
|
287
|
+
* The icon adapts styling based on the provided props and supports a range of color schemes and sizes.
|
|
288
|
+
*
|
|
289
|
+
* @component
|
|
290
|
+
*
|
|
291
|
+
* @param {Object} props - The properties for configuring the Component.
|
|
292
|
+
* @param {Object} props.source - The source icon component from `@shopify/polaris-icons`. Should be a valid Polaris icon component.
|
|
293
|
+
* @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.
|
|
294
|
+
* @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.
|
|
295
|
+
* @param {('block'|'flex'|'inline'|'inline-block'|'inline-flex')} [props.display="block"] - Determines the display type for the icon container.
|
|
296
|
+
* @param {('xs'|'sm'|'default'|'lg'|'xl'|'2xl')} [props.size="default"] - Sets the icon size.
|
|
297
|
+
* - 'xs': Extra small (12px)
|
|
298
|
+
* - 'sm': Small (16px)
|
|
299
|
+
* - 'default': Medium (20px)
|
|
300
|
+
* - 'lg': Large (24px)
|
|
301
|
+
* - 'xl': Extra large (28px)
|
|
302
|
+
* - '2xl': Double extra large (32px)
|
|
303
|
+
* @param {boolean} [props.stroke=false] - Whether to use stroke styling instead of fill.
|
|
304
|
+
* @param {Function} [props.onClick] - Click handler for the icon.
|
|
305
|
+
* @param {string} [props.className] - Additional CSS classes to apply.
|
|
306
|
+
* @returns {JSX.Element} The rendered icon component with the specified styles.
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* <Icon
|
|
310
|
+
* source={PolarisIcons.TickMinor}
|
|
311
|
+
* color="success"
|
|
312
|
+
* display="inline"
|
|
313
|
+
* size="lg"
|
|
314
|
+
* />
|
|
315
|
+
*/ function Icon() {
|
|
316
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
317
|
+
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;
|
|
318
|
+
var IconComponent = typeof source === "string" ? _polarisicons[source] : _polarisicons[source === null || source === void 0 ? void 0 : source.displayName];
|
|
319
|
+
var classes = styles({
|
|
320
|
+
display: display,
|
|
321
|
+
size: size
|
|
322
|
+
});
|
|
323
|
+
var iconClasses = iconStyles({
|
|
324
|
+
color: color,
|
|
325
|
+
stroke: stroke,
|
|
326
|
+
hoverColor: hoverColor
|
|
327
|
+
});
|
|
328
|
+
var LithoIconComponents = LithoIcons({
|
|
329
|
+
className: iconClasses
|
|
330
|
+
});
|
|
331
|
+
if (typeof source === "string" && LithoIconComponents[source]) {
|
|
332
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
333
|
+
className: "".concat(classes).concat(className ? " ".concat(className) : ""),
|
|
334
|
+
onClick: onClick,
|
|
335
|
+
children: LithoIconComponents[source]
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
339
|
+
className: "".concat(classes).concat(className ? " ".concat(className) : ""),
|
|
340
|
+
onClick: onClick,
|
|
341
|
+
children: IconComponent ? /*#__PURE__*/ (0, _jsxruntime.jsx)(IconComponent, {
|
|
342
|
+
className: iconClasses
|
|
343
|
+
}) : source
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
var _default = Icon;
|
|
@@ -0,0 +1,191 @@
|
|
|
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 _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
13
|
+
var _tailwindvariants = require("tailwind-variants");
|
|
14
|
+
function _define_property(obj, key, value) {
|
|
15
|
+
if (key in obj) {
|
|
16
|
+
Object.defineProperty(obj, key, {
|
|
17
|
+
value: value,
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true
|
|
21
|
+
});
|
|
22
|
+
} else {
|
|
23
|
+
obj[key] = value;
|
|
24
|
+
}
|
|
25
|
+
return obj;
|
|
26
|
+
}
|
|
27
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
28
|
+
if (typeof WeakMap !== "function") return null;
|
|
29
|
+
var cacheBabelInterop = new WeakMap();
|
|
30
|
+
var cacheNodeInterop = new WeakMap();
|
|
31
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
32
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
33
|
+
})(nodeInterop);
|
|
34
|
+
}
|
|
35
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
36
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
37
|
+
return obj;
|
|
38
|
+
}
|
|
39
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
40
|
+
return {
|
|
41
|
+
default: obj
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
45
|
+
if (cache && cache.has(obj)) {
|
|
46
|
+
return cache.get(obj);
|
|
47
|
+
}
|
|
48
|
+
var newObj = {
|
|
49
|
+
__proto__: null
|
|
50
|
+
};
|
|
51
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
52
|
+
for(var key in obj){
|
|
53
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
54
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
55
|
+
if (desc && (desc.get || desc.set)) {
|
|
56
|
+
Object.defineProperty(newObj, key, desc);
|
|
57
|
+
} else {
|
|
58
|
+
newObj[key] = obj[key];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
newObj.default = obj;
|
|
63
|
+
if (cache) {
|
|
64
|
+
cache.set(obj, newObj);
|
|
65
|
+
}
|
|
66
|
+
return newObj;
|
|
67
|
+
}
|
|
68
|
+
function _object_spread(target) {
|
|
69
|
+
for(var i = 1; i < arguments.length; i++){
|
|
70
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
71
|
+
var ownKeys = Object.keys(source);
|
|
72
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
73
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
74
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
ownKeys.forEach(function(key) {
|
|
78
|
+
_define_property(target, key, source[key]);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return target;
|
|
82
|
+
}
|
|
83
|
+
function _object_without_properties(source, excluded) {
|
|
84
|
+
if (source == null) return {};
|
|
85
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
86
|
+
var key, i;
|
|
87
|
+
if (Object.getOwnPropertySymbols) {
|
|
88
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
89
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
90
|
+
key = sourceSymbolKeys[i];
|
|
91
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
92
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
93
|
+
target[key] = source[key];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return target;
|
|
97
|
+
}
|
|
98
|
+
function _object_without_properties_loose(source, excluded) {
|
|
99
|
+
if (source == null) return {};
|
|
100
|
+
var target = {};
|
|
101
|
+
var sourceKeys = Object.keys(source);
|
|
102
|
+
var key, i;
|
|
103
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
104
|
+
key = sourceKeys[i];
|
|
105
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
106
|
+
target[key] = source[key];
|
|
107
|
+
}
|
|
108
|
+
return target;
|
|
109
|
+
}
|
|
110
|
+
var styles = (0, _tailwindvariants.tv)({
|
|
111
|
+
base: "Litho-Image",
|
|
112
|
+
variants: {
|
|
113
|
+
borderRadius: {
|
|
114
|
+
default: "",
|
|
115
|
+
none: "rounded-none",
|
|
116
|
+
xs: "rounded-xs",
|
|
117
|
+
sm: "rounded-sm",
|
|
118
|
+
md: "rounded-md",
|
|
119
|
+
lg: "rounded-lg",
|
|
120
|
+
full: "rounded-full",
|
|
121
|
+
max: "rounded-max"
|
|
122
|
+
},
|
|
123
|
+
rounded: {
|
|
124
|
+
true: "rounded-md"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
/**
|
|
129
|
+
* Image component that renders an image with optional styling and behavior.
|
|
130
|
+
*
|
|
131
|
+
* @component
|
|
132
|
+
* @param {Object} props - Properties passed to the Image component.
|
|
133
|
+
* @param {string} [props.alt] - Alternative text for the image.
|
|
134
|
+
* @param {Array<{source: string, descriptor: string}>} [props.sourceSet] - Array of image sources and descriptors for responsive images.
|
|
135
|
+
* @param {string} [props.source] - URL of the image to display.
|
|
136
|
+
* @param {boolean} [props.rounded] - Whether to round the image.
|
|
137
|
+
* @param {string} [props.crossOrigin] - Sets the crossOrigin attribute for the image. Possible values are "anonymous" or "use-credentials".
|
|
138
|
+
* @param {function} [props.onLoad] - Callback function to handle the image load event.
|
|
139
|
+
* @param {string} [props.className] - Additional classes to apply to the image.
|
|
140
|
+
* @param {('default'|'none'|'xs'|'sm'|'md'|'lg'|'full'|'max')} [props.borderRadius='default'] - The border radius variant for the image.
|
|
141
|
+
* @param {Object} [rest] - Any additional props passed to the underlying `<img>` element.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* <Image
|
|
145
|
+
* alt="Sample Image"
|
|
146
|
+
* sourceSet={[
|
|
147
|
+
* { source: 'image-320w.jpg', descriptor: '320w' },
|
|
148
|
+
* { source: 'image-640w.jpg', descriptor: '640w' }
|
|
149
|
+
* ]}
|
|
150
|
+
* source="image.jpg"
|
|
151
|
+
* borderRadius="md"
|
|
152
|
+
* onLoad={() => console.log("Image loaded")}
|
|
153
|
+
* className="custom-class"
|
|
154
|
+
* />
|
|
155
|
+
*
|
|
156
|
+
* @returns {JSX.Element} A styled image component with optional responsive support.
|
|
157
|
+
*/ function Image() {
|
|
158
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
159
|
+
var alt = props.alt, sourceSet = props.sourceSet, source = props.source, crossOrigin = props.crossOrigin, onLoad = props.onLoad, rounded = props.rounded, className = props.className, borderRadius = props.borderRadius, rest = _object_without_properties(props, [
|
|
160
|
+
"alt",
|
|
161
|
+
"sourceSet",
|
|
162
|
+
"source",
|
|
163
|
+
"crossOrigin",
|
|
164
|
+
"onLoad",
|
|
165
|
+
"rounded",
|
|
166
|
+
"className",
|
|
167
|
+
"borderRadius"
|
|
168
|
+
]);
|
|
169
|
+
var classes = styles({
|
|
170
|
+
borderRadius: borderRadius,
|
|
171
|
+
rounded: rounded
|
|
172
|
+
});
|
|
173
|
+
var finalSourceSet = sourceSet ? sourceSet.map(function(param) {
|
|
174
|
+
var subSource = param.source, descriptor = param.descriptor;
|
|
175
|
+
return "".concat(subSource, " ").concat(descriptor);
|
|
176
|
+
}).join(',') : null;
|
|
177
|
+
var handleLoad = (0, _react.useCallback)(function() {
|
|
178
|
+
if (onLoad) onLoad();
|
|
179
|
+
}, [
|
|
180
|
+
onLoad
|
|
181
|
+
]);
|
|
182
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("img", _object_spread({
|
|
183
|
+
alt: alt,
|
|
184
|
+
srcSet: finalSourceSet,
|
|
185
|
+
src: source,
|
|
186
|
+
crossOrigin: crossOrigin,
|
|
187
|
+
onLoad: handleLoad,
|
|
188
|
+
className: "".concat(classes).concat(className ? " ".concat(className) : '')
|
|
189
|
+
}, rest));
|
|
190
|
+
}
|
|
191
|
+
var _default = Image;
|
|
@@ -0,0 +1,57 @@
|
|
|
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 _Icon = /*#__PURE__*/ _interop_require_default(require("./Icon"));
|
|
14
|
+
var _polarisicons = require("@shopify/polaris-icons");
|
|
15
|
+
function _interop_require_default(obj) {
|
|
16
|
+
return obj && obj.__esModule ? obj : {
|
|
17
|
+
default: obj
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
var styles = (0, _tailwindvariants.tv)({
|
|
21
|
+
base: "Litho-InlineError flex items-start justify-start gap-2"
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* InlineError Component
|
|
25
|
+
*
|
|
26
|
+
* Displays an inline error message with an icon, useful for indicating errors next to form fields.
|
|
27
|
+
*
|
|
28
|
+
* @component
|
|
29
|
+
* @param {Object} props - Component properties.
|
|
30
|
+
* @param {string} props.message - The error message to display.
|
|
31
|
+
* @param {string} props.fieldID - The ID of the field this error is associated with, used to generate an accessible ID for the error element.
|
|
32
|
+
*
|
|
33
|
+
* @returns {JSX.Element} A styled inline error message with an icon.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* <InlineError message="This field is required" fieldID="username" />
|
|
37
|
+
*
|
|
38
|
+
*/ function InlineError() {
|
|
39
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
40
|
+
var message = props.message, fieldID = props.fieldID, _props_icon = props.icon, icon = _props_icon === void 0 ? _polarisicons.CircleAlertMajor : _props_icon;
|
|
41
|
+
var classes = styles();
|
|
42
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
43
|
+
id: "".concat(fieldID, "Error"),
|
|
44
|
+
className: classes,
|
|
45
|
+
children: [
|
|
46
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Icon.default, {
|
|
47
|
+
source: icon,
|
|
48
|
+
color: "critical"
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
51
|
+
className: "Litho-InlineError__Text text-fg-critical",
|
|
52
|
+
children: message
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
var _default = InlineError;
|
|
@@ -0,0 +1,78 @@
|
|
|
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 _Text = /*#__PURE__*/ _interop_require_default(require("./Text"));
|
|
14
|
+
var _Tooltip = /*#__PURE__*/ _interop_require_default(require("./Tooltip"));
|
|
15
|
+
function _interop_require_default(obj) {
|
|
16
|
+
return obj && obj.__esModule ? obj : {
|
|
17
|
+
default: obj
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
var styles = (0, _tailwindvariants.tv)({
|
|
21
|
+
base: "Litho-Label flex items-center gap-1 text-highest",
|
|
22
|
+
variants: {
|
|
23
|
+
hidden: {
|
|
24
|
+
true: "sr-only"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Label component
|
|
30
|
+
*
|
|
31
|
+
* This component renders a customizable label element with optional required indicator styling.
|
|
32
|
+
* It uses `tailwind-variants` to apply base styles and accepts various props for customization.
|
|
33
|
+
*
|
|
34
|
+
* @param {Object} props - The properties passed to the component.
|
|
35
|
+
* @param {React.ReactNode} props.children - The content to be displayed within the label.
|
|
36
|
+
* @param {string} [props.id] - The identifier for the label and its associated form element.
|
|
37
|
+
* @param {boolean} [props.hidden] - If true, the label is visually hidden.
|
|
38
|
+
* @param {boolean} [props.requiredIndicator] - If true, displays an asterisk (*) to indicate a required field.
|
|
39
|
+
* @param {string} [props.className] - Additional CSS class names.
|
|
40
|
+
* @param {React.ReactNode|import("./Tooltip").TooltipContentObject} [props.tooltip] - Tooltip content for the label.
|
|
41
|
+
* @param {Object} [props.rest] - Additional props to be spread onto the label element.
|
|
42
|
+
*
|
|
43
|
+
* @returns {JSX.Element} The rendered label component with optional required indicator.
|
|
44
|
+
*/ function Label() {
|
|
45
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
46
|
+
var tmp = props.color, _color = tmp === void 0 ? "subdued" : tmp, children = props.children, _props_variant = props.variant, variant = _props_variant === void 0 ? "bodyMd" : _props_variant, _props_fontWeight = props.fontWeight, fontWeight = _props_fontWeight === void 0 ? "normal" : _props_fontWeight, id = props.id, hidden = props.hidden, className = props.className, requiredIndicator = props.requiredIndicator, _props_as = props.as, as = _props_as === void 0 ? "label" : _props_as, disabled = props.disabled, tooltip = props.tooltip;
|
|
47
|
+
var classes = styles({
|
|
48
|
+
requiredIndicator: requiredIndicator,
|
|
49
|
+
hidden: hidden,
|
|
50
|
+
disabled: disabled
|
|
51
|
+
});
|
|
52
|
+
var color = disabled ? "disabled" : _color;
|
|
53
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
54
|
+
className: "flex items-center gap-1".concat(className ? " ".concat(className) : ""),
|
|
55
|
+
children: [
|
|
56
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_Text.default, {
|
|
57
|
+
as: as,
|
|
58
|
+
id: id ? "".concat(id, "Label") : undefined,
|
|
59
|
+
htmlFor: id,
|
|
60
|
+
className: classes,
|
|
61
|
+
variant: variant,
|
|
62
|
+
fontWeight: fontWeight,
|
|
63
|
+
color: color,
|
|
64
|
+
children: [
|
|
65
|
+
children,
|
|
66
|
+
requiredIndicator ? /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
67
|
+
className: "Litho-Label__RequiredIndicator text-fg-critical ml-0.5",
|
|
68
|
+
children: "*"
|
|
69
|
+
}) : null
|
|
70
|
+
]
|
|
71
|
+
}),
|
|
72
|
+
tooltip && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Tooltip.default, {
|
|
73
|
+
content: tooltip
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
var _default = Label;
|