@vaneui/ui 0.2.1-alpha.20250904211915.5efd1b4 → 0.2.2-alpha.20250907183237.5f63365
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +271 -396
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +271 -395
- package/dist/index.js.map +1 -1
- package/dist/playground/src/App.d.ts +2 -0
- package/dist/playground/src/index.d.ts +2 -0
- package/dist/{components → src/components}/tests/utils/propOmissionTestUtils.d.ts +4 -9
- package/dist/src/components/tests/visual-decoration.test.d.ts +1 -0
- package/dist/{components → src/components}/themedComponent.d.ts +4 -2
- package/dist/src/components/ui/badge.d.ts +2 -0
- package/dist/src/components/ui/button.d.ts +2 -0
- package/dist/src/components/ui/card.d.ts +2 -0
- package/dist/{components → src/components}/ui/checkbox.d.ts +3 -4
- package/dist/src/components/ui/chip.d.ts +2 -0
- package/dist/src/components/ui/classes/radiusClasses.d.ts +3 -0
- package/dist/{components → src/components}/ui/code.d.ts +3 -4
- package/dist/src/components/ui/col.d.ts +2 -0
- package/dist/src/components/ui/container.d.ts +2 -0
- package/dist/{components → src/components}/ui/divider.d.ts +3 -4
- package/dist/src/components/ui/grid.d.ts +4 -0
- package/dist/{components → src/components}/ui/img.d.ts +3 -4
- package/dist/{components → src/components}/ui/label.d.ts +3 -4
- package/dist/{components → src/components}/ui/props/keys.d.ts +6 -5
- package/dist/src/components/ui/row.d.ts +2 -0
- package/dist/src/components/ui/section.d.ts +2 -0
- package/dist/src/components/ui/stack.d.ts +2 -0
- package/dist/src/components/ui/theme/appearance/appearanceTheme.d.ts +20 -0
- package/dist/{components → src/components}/ui/theme/appearance/genericVariantTheme.d.ts +4 -6
- package/dist/src/components/ui/theme/appearance/shadowAppearanceTheme.d.ts +21 -0
- package/dist/{components → src/components}/ui/theme/layout/borderTheme.d.ts +4 -4
- package/dist/{components → src/components}/ui/theme/layout/directionTheme.d.ts +5 -4
- package/dist/src/components/ui/theme/layout/displayTheme.d.ts +17 -0
- package/dist/{components → src/components}/ui/theme/layout/hideTheme.d.ts +6 -4
- package/dist/src/components/ui/theme/layout/itemsTheme.d.ts +11 -0
- package/dist/src/components/ui/theme/layout/justifyTheme.d.ts +14 -0
- package/dist/src/components/ui/theme/layout/overflowTheme.d.ts +21 -0
- package/dist/{components → src/components}/ui/theme/layout/positionTheme.d.ts +6 -4
- package/dist/{components → src/components}/ui/theme/layout/radiusTheme.d.ts +1 -6
- package/dist/{components → src/components}/ui/theme/layout/ringTheme.d.ts +4 -4
- package/dist/{components → src/components}/ui/theme/layout/wrapTheme.d.ts +4 -4
- package/dist/{components → src/components}/ui/theme/list/listStyleTheme.d.ts +3 -4
- package/dist/{components → src/components}/ui/theme/size/breakpointTheme.d.ts +6 -4
- package/dist/{components → src/components}/ui/theme/size/gapTheme.d.ts +6 -3
- package/dist/{components → src/components}/ui/theme/size/paddingTheme.d.ts +6 -3
- package/dist/{components → src/components}/ui/theme/size/plTheme.d.ts +0 -2
- package/dist/{components → src/components}/ui/theme/size/pxTheme.d.ts +0 -2
- package/dist/{components → src/components}/ui/theme/size/pyTheme.d.ts +0 -2
- package/dist/{components → src/components}/ui/theme/size/sizeTheme.d.ts +6 -3
- package/dist/src/components/ui/theme/typography/fontFamilyTheme.d.ts +8 -0
- package/dist/{components → src/components}/ui/theme/typography/fontStyleTheme.d.ts +3 -4
- package/dist/src/components/ui/theme/typography/fontWeightTheme.d.ts +15 -0
- package/dist/{components → src/components}/ui/theme/typography/textAlignTheme.d.ts +5 -4
- package/dist/src/components/ui/theme/typography/textDecorationTheme.d.ts +10 -0
- package/dist/src/components/ui/theme/typography/textTransformTheme.d.ts +10 -0
- package/dist/{components → src/components}/ui/theme/typographyTheme.d.ts +1 -1
- package/dist/{components → src/components}/ui/typography.d.ts +9 -10
- package/dist/{components → src/components}/utils/componentUtils.d.ts +1 -1
- package/package.json +9 -2
- package/dist/components/examples/ref-usage-examples.d.ts +0 -29
- package/dist/components/examples/theme-types-strictness-compile-check.d.ts +0 -5
- package/dist/components/ui/badge.d.ts +0 -3
- package/dist/components/ui/button.d.ts +0 -3
- package/dist/components/ui/card.d.ts +0 -3
- package/dist/components/ui/chip.d.ts +0 -3
- package/dist/components/ui/classes/radiusClasses.d.ts +0 -5
- package/dist/components/ui/col.d.ts +0 -3
- package/dist/components/ui/container.d.ts +0 -3
- package/dist/components/ui/grid.d.ts +0 -5
- package/dist/components/ui/row.d.ts +0 -3
- package/dist/components/ui/section.d.ts +0 -3
- package/dist/components/ui/stack.d.ts +0 -3
- package/dist/components/ui/theme/appearance/appearanceTheme.d.ts +0 -11
- package/dist/components/ui/theme/appearance/shadowAppearanceTheme.d.ts +0 -13
- package/dist/components/ui/theme/layout/displayTheme.d.ts +0 -9
- package/dist/components/ui/theme/layout/itemsTheme.d.ts +0 -9
- package/dist/components/ui/theme/layout/justifyTheme.d.ts +0 -9
- package/dist/components/ui/theme/layout/overflowTheme.d.ts +0 -9
- package/dist/components/ui/theme/typography/fontFamilyTheme.d.ts +0 -8
- package/dist/components/ui/theme/typography/fontWeightTheme.d.ts +0 -9
- package/dist/components/ui/theme/typography/textDecorationTheme.d.ts +0 -9
- package/dist/components/ui/theme/typography/textTransformTheme.d.ts +0 -9
- /package/dist/{components → src/components}/complex/sharer.d.ts +0 -0
- /package/dist/{components → src/components}/tests/badge.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/button.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/card.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/checkbox.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/chip.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/code.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/col.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/componentThemeCoverage.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/container.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/deepMerge.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/divider.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/extra-classes.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/grid.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/grid2.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/img.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/label.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/link.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/linkable.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/list.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/nested-theme-providers-simple.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/nested-theme-providers.test.d.ts +0 -0
- /package/dist/{components/tests/prop-filtering.test.d.ts → src/components/tests/pickFirstTruthyKeyByCategory.test.d.ts} +0 -0
- /package/dist/{components/tests/prop-types-validation.test.d.ts → src/components/tests/prop-filtering.test.d.ts} +0 -0
- /package/dist/{components → src/components}/tests/prop-omission-edge-cases.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/prop-omission.test.d.ts +0 -0
- /package/dist/{components/tests/theme-collections.test.d.ts → src/components/tests/prop-types-validation.test.d.ts} +0 -0
- /package/dist/{components → src/components}/tests/ref-support-comprehensive.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/ref-support.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/row.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/section.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/stack.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/text.test.d.ts +0 -0
- /package/dist/{components/tests/visual-decoration.test.d.ts → src/components/tests/theme-collections.test.d.ts} +0 -0
- /package/dist/{components → src/components}/tests/theme-override.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/theme-types-strictness.test.d.ts +0 -0
- /package/dist/{components → src/components}/tests/title.test.d.ts +0 -0
- /package/dist/{components → src/components}/themeContext.d.ts +0 -0
- /package/dist/{components → src/components}/ui/classes/appearanceClasses.d.ts +0 -0
- /package/dist/{components → src/components}/ui/classes/typographyClasses.d.ts +0 -0
- /package/dist/{components → src/components}/ui/layout.d.ts +0 -0
- /package/dist/{components → src/components}/ui/props/index.d.ts +0 -0
- /package/dist/{components → src/components}/ui/props/props.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/badgeTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/buttonTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/cardTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/checkboxTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/chipTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/codeTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/colTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/common/ComponentTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/common/baseTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/containerTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/defaults.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/dividerTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/gridTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/imgTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/labelTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/rowTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/sectionTheme.d.ts +0 -0
- /package/dist/{components → src/components}/ui/theme/stackTheme.d.ts +0 -0
- /package/dist/{components → src/components}/utils/deepMerge.d.ts +0 -0
- /package/dist/{components → src/components}/utils/deepPartial.d.ts +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{setupTests.d.ts → src/setupTests.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -34,6 +34,11 @@ const COMPONENT_PROPS_CATEGORY = [
|
|
|
34
34
|
...VARIANT,
|
|
35
35
|
'mode',
|
|
36
36
|
];
|
|
37
|
+
/**
|
|
38
|
+
* Describes what the @ComponentKeys.appearance can be applied to
|
|
39
|
+
* @see ComponentKeys.appearance
|
|
40
|
+
*/
|
|
41
|
+
const APPEARANCE_CATEGORY = ['text', 'border', 'ring', 'shadow', 'bg', 'accent'];
|
|
37
42
|
const ComponentKeys = {
|
|
38
43
|
appearance: ['default', 'accent', 'primary', 'secondary', 'tertiary', 'success', 'danger', 'warning', 'info', 'link'],
|
|
39
44
|
border: ['border', 'noBorder'],
|
|
@@ -120,231 +125,161 @@ const ComponentCategories = {
|
|
|
120
125
|
};
|
|
121
126
|
|
|
122
127
|
class HideTheme extends BaseTheme {
|
|
123
|
-
constructor(
|
|
124
|
-
super();
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
mdHide: "max-md:hidden",
|
|
131
|
-
lgHide: "max-lg:hidden",
|
|
132
|
-
xlHide: "max-xl:hidden"
|
|
133
|
-
}[key];
|
|
134
|
-
});
|
|
128
|
+
constructor() {
|
|
129
|
+
super(...arguments);
|
|
130
|
+
this.xsHide = "max-xs:hidden";
|
|
131
|
+
this.smHide = "max-sm:hidden";
|
|
132
|
+
this.mdHide = "max-md:hidden";
|
|
133
|
+
this.lgHide = "max-lg:hidden";
|
|
134
|
+
this.xlHide = "max-xl:hidden";
|
|
135
135
|
}
|
|
136
136
|
getClasses(extractedKeys) {
|
|
137
|
-
|
|
138
|
-
return [key ? this[key] : ''];
|
|
137
|
+
return [(extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.hide) ? this[extractedKeys.hide] : ''];
|
|
139
138
|
}
|
|
140
139
|
}
|
|
141
140
|
|
|
142
141
|
class ItemsTheme extends BaseTheme {
|
|
143
|
-
constructor(
|
|
144
|
-
super();
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
itemsCenter: "items-center",
|
|
151
|
-
itemsBaseline: "items-baseline",
|
|
152
|
-
itemsStretch: "items-stretch",
|
|
153
|
-
}[key];
|
|
154
|
-
});
|
|
142
|
+
constructor() {
|
|
143
|
+
super(...arguments);
|
|
144
|
+
this.itemsStart = "items-start";
|
|
145
|
+
this.itemsEnd = "items-end";
|
|
146
|
+
this.itemsCenter = "items-center";
|
|
147
|
+
this.itemsBaseline = "items-baseline";
|
|
148
|
+
this.itemsStretch = "items-stretch";
|
|
155
149
|
}
|
|
156
150
|
getClasses(extractedKeys) {
|
|
157
|
-
|
|
158
|
-
return [pickedKey && this[pickedKey] ? this[pickedKey] : ''];
|
|
151
|
+
return [(extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.items) && this[extractedKeys.items] ? this[extractedKeys.items] : ''];
|
|
159
152
|
}
|
|
160
153
|
}
|
|
161
154
|
|
|
162
155
|
class JustifyTheme extends BaseTheme {
|
|
163
|
-
constructor(
|
|
164
|
-
super();
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
justifyEvenly: "justify-evenly",
|
|
174
|
-
justifyStretch: "justify-stretch",
|
|
175
|
-
justifyBaseline: "justify-baseline",
|
|
176
|
-
}[key];
|
|
177
|
-
});
|
|
156
|
+
constructor() {
|
|
157
|
+
super(...arguments);
|
|
158
|
+
this.justifyStart = "justify-start";
|
|
159
|
+
this.justifyEnd = "justify-end";
|
|
160
|
+
this.justifyCenter = "justify-center";
|
|
161
|
+
this.justifyBetween = "justify-between";
|
|
162
|
+
this.justifyAround = "justify-around";
|
|
163
|
+
this.justifyEvenly = "justify-evenly";
|
|
164
|
+
this.justifyStretch = "justify-stretch";
|
|
165
|
+
this.justifyBaseline = "justify-baseline";
|
|
178
166
|
}
|
|
179
167
|
getClasses(extractedKeys) {
|
|
180
|
-
|
|
181
|
-
return [key ? this[key] : ''];
|
|
168
|
+
return [(extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.justify) ? this[extractedKeys.justify] : ''];
|
|
182
169
|
}
|
|
183
170
|
}
|
|
184
171
|
|
|
185
172
|
class PositionTheme extends BaseTheme {
|
|
186
|
-
constructor(
|
|
187
|
-
super();
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
fixed: "fixed",
|
|
194
|
-
sticky: "sticky",
|
|
195
|
-
static: "static"
|
|
196
|
-
}[key];
|
|
197
|
-
});
|
|
173
|
+
constructor() {
|
|
174
|
+
super(...arguments);
|
|
175
|
+
this.relative = "relative";
|
|
176
|
+
this.absolute = "absolute";
|
|
177
|
+
this.fixed = "fixed";
|
|
178
|
+
this.sticky = "sticky";
|
|
179
|
+
this.static = "static";
|
|
198
180
|
}
|
|
199
181
|
getClasses(extractedKeys) {
|
|
200
|
-
|
|
201
|
-
return [key ? this[key] : ''];
|
|
182
|
+
return [(extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.position) ? this[extractedKeys.position] : ''];
|
|
202
183
|
}
|
|
203
184
|
}
|
|
204
185
|
|
|
205
186
|
class FontStyleTheme extends BaseTheme {
|
|
206
|
-
constructor(
|
|
207
|
-
super();
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : {
|
|
211
|
-
italic: "italic",
|
|
212
|
-
notItalic: "not-italic",
|
|
213
|
-
}[key];
|
|
214
|
-
});
|
|
187
|
+
constructor() {
|
|
188
|
+
super(...arguments);
|
|
189
|
+
this.italic = "italic";
|
|
190
|
+
this.notItalic = "not-italic";
|
|
215
191
|
}
|
|
216
192
|
getClasses(extractedKeys) {
|
|
217
|
-
|
|
218
|
-
return [key ? this[key] : '']; // No default for font style
|
|
193
|
+
return [(extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.fontStyle) ? this[extractedKeys.fontStyle] : ''];
|
|
219
194
|
}
|
|
220
195
|
}
|
|
221
196
|
|
|
222
197
|
class FontFamilyTheme extends BaseTheme {
|
|
223
|
-
constructor(
|
|
224
|
-
super();
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
sans: "font-sans",
|
|
229
|
-
serif: "font-serif",
|
|
230
|
-
mono: "font-mono",
|
|
231
|
-
}[key];
|
|
232
|
-
});
|
|
198
|
+
constructor() {
|
|
199
|
+
super(...arguments);
|
|
200
|
+
this.sans = "font-sans";
|
|
201
|
+
this.serif = "font-serif";
|
|
202
|
+
this.mono = "font-mono";
|
|
233
203
|
}
|
|
234
204
|
getClasses(extractedKeys) {
|
|
235
|
-
|
|
236
|
-
if (key === undefined)
|
|
237
|
-
return [];
|
|
238
|
-
return [this[key]];
|
|
205
|
+
return (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.fontFamily) ? [this[extractedKeys.fontFamily]] : [];
|
|
239
206
|
}
|
|
240
207
|
}
|
|
241
208
|
|
|
242
209
|
class FontWeightTheme extends BaseTheme {
|
|
243
|
-
constructor(
|
|
244
|
-
super();
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
bold: "font-bold",
|
|
255
|
-
extrabold: "font-extrabold",
|
|
256
|
-
black: "font-black",
|
|
257
|
-
}[key];
|
|
258
|
-
});
|
|
210
|
+
constructor() {
|
|
211
|
+
super(...arguments);
|
|
212
|
+
this.thin = "font-thin";
|
|
213
|
+
this.extralight = "font-extralight";
|
|
214
|
+
this.light = "font-light";
|
|
215
|
+
this.normal = "font-normal";
|
|
216
|
+
this.medium = "font-medium";
|
|
217
|
+
this.semibold = "font-semibold";
|
|
218
|
+
this.bold = "font-bold";
|
|
219
|
+
this.extrabold = "font-extrabold";
|
|
220
|
+
this.black = "font-black";
|
|
259
221
|
}
|
|
260
222
|
getClasses(extractedKeys) {
|
|
261
|
-
|
|
262
|
-
if (key === undefined)
|
|
263
|
-
return [];
|
|
264
|
-
return [this[key]];
|
|
223
|
+
return (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.fontWeight) ? [this[extractedKeys.fontWeight]] : [];
|
|
265
224
|
}
|
|
266
225
|
}
|
|
267
226
|
|
|
268
227
|
class TextDecorationTheme extends BaseTheme {
|
|
269
|
-
constructor(
|
|
270
|
-
super();
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
lineThrough: "line-through",
|
|
276
|
-
noUnderline: "no-underline",
|
|
277
|
-
overline: "overline",
|
|
278
|
-
}[key];
|
|
279
|
-
});
|
|
228
|
+
constructor() {
|
|
229
|
+
super(...arguments);
|
|
230
|
+
this.underline = "underline";
|
|
231
|
+
this.lineThrough = "line-through";
|
|
232
|
+
this.noUnderline = "no-underline";
|
|
233
|
+
this.overline = "overline";
|
|
280
234
|
}
|
|
281
235
|
getClasses(extractedKeys) {
|
|
282
|
-
|
|
283
|
-
return [key ? this[key] : '']; // No default for text decoration
|
|
236
|
+
return [(extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.textDecoration) ? this[extractedKeys.textDecoration] : ''];
|
|
284
237
|
}
|
|
285
238
|
}
|
|
286
239
|
|
|
287
240
|
class TextTransformTheme extends BaseTheme {
|
|
288
|
-
constructor(
|
|
289
|
-
super();
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
lowercase: "lowercase",
|
|
295
|
-
capitalize: "capitalize",
|
|
296
|
-
normalCase: "normal-case",
|
|
297
|
-
}[key];
|
|
298
|
-
});
|
|
241
|
+
constructor() {
|
|
242
|
+
super(...arguments);
|
|
243
|
+
this.uppercase = "uppercase";
|
|
244
|
+
this.lowercase = "lowercase";
|
|
245
|
+
this.capitalize = "capitalize";
|
|
246
|
+
this.normalCase = "normal-case";
|
|
299
247
|
}
|
|
300
248
|
getClasses(extractedKeys) {
|
|
301
|
-
|
|
302
|
-
return [key ? this[key] : '']; // No default for text transform
|
|
249
|
+
return [(extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.textTransform) ? this[extractedKeys.textTransform] : ''];
|
|
303
250
|
}
|
|
304
251
|
}
|
|
305
252
|
|
|
306
253
|
class TextAlignTheme extends BaseTheme {
|
|
307
|
-
constructor(
|
|
308
|
-
super();
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
textCenter: "text-center",
|
|
314
|
-
textRight: "text-right",
|
|
315
|
-
textJustify: "text-justify",
|
|
316
|
-
}[key];
|
|
317
|
-
});
|
|
254
|
+
constructor() {
|
|
255
|
+
super(...arguments);
|
|
256
|
+
this.textLeft = "text-left";
|
|
257
|
+
this.textCenter = "text-center";
|
|
258
|
+
this.textRight = "text-right";
|
|
259
|
+
this.textJustify = "text-justify";
|
|
318
260
|
}
|
|
319
261
|
getClasses(extractedKeys) {
|
|
320
|
-
|
|
321
|
-
return [key ? this[key] : '']; // No default for text align
|
|
262
|
+
return [(extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.textAlign) ? this[extractedKeys.textAlign] : ''];
|
|
322
263
|
}
|
|
323
264
|
}
|
|
324
265
|
|
|
325
266
|
class DisplayTheme extends BaseTheme {
|
|
326
|
-
constructor(
|
|
327
|
-
super();
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
table: "table",
|
|
340
|
-
tableCell: "table-cell",
|
|
341
|
-
hidden: "hidden"
|
|
342
|
-
}[key];
|
|
343
|
-
});
|
|
267
|
+
constructor() {
|
|
268
|
+
super(...arguments);
|
|
269
|
+
this.inline = "inline";
|
|
270
|
+
this.block = "block";
|
|
271
|
+
this.inlineBlock = "inline-block";
|
|
272
|
+
this.flex = "flex";
|
|
273
|
+
this.inlineFlex = "inline-flex";
|
|
274
|
+
this.grid = "grid";
|
|
275
|
+
this.inlineGrid = "inline-grid";
|
|
276
|
+
this.contents = "contents";
|
|
277
|
+
this.table = "table";
|
|
278
|
+
this.tableCell = "table-cell";
|
|
279
|
+
this.hidden = "hidden";
|
|
344
280
|
}
|
|
345
281
|
getClasses(extractedKeys) {
|
|
346
|
-
|
|
347
|
-
return [key && this[key] ? this[key] : ''];
|
|
282
|
+
return [(extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.display) && this[extractedKeys.display] ? this[extractedKeys.display] : ''];
|
|
348
283
|
}
|
|
349
284
|
}
|
|
350
285
|
|
|
@@ -3060,32 +2995,26 @@ const getDefaultConfig = () => {
|
|
|
3060
2995
|
const twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);
|
|
3061
2996
|
|
|
3062
2997
|
class OverflowTheme extends BaseTheme {
|
|
3063
|
-
constructor(
|
|
3064
|
-
super();
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
overflowYVisible: 'overflow-y-visible',
|
|
3081
|
-
overflowXScroll: 'overflow-x-scroll',
|
|
3082
|
-
overflowYScroll: 'overflow-y-scroll',
|
|
3083
|
-
}[key];
|
|
3084
|
-
});
|
|
2998
|
+
constructor() {
|
|
2999
|
+
super(...arguments);
|
|
3000
|
+
this.overflowAuto = 'overflow-auto';
|
|
3001
|
+
this.overflowHidden = 'overflow-hidden';
|
|
3002
|
+
this.overflowClip = 'overflow-clip';
|
|
3003
|
+
this.overflowVisible = 'overflow-visible';
|
|
3004
|
+
this.overflowScroll = 'overflow-scroll';
|
|
3005
|
+
this.overflowXAuto = 'overflow-x-auto';
|
|
3006
|
+
this.overflowYAuto = 'overflow-y-auto';
|
|
3007
|
+
this.overflowXHidden = 'overflow-x-hidden';
|
|
3008
|
+
this.overflowYHidden = 'overflow-y-hidden';
|
|
3009
|
+
this.overflowXClip = 'overflow-x-clip';
|
|
3010
|
+
this.overflowYClip = 'overflow-y-clip';
|
|
3011
|
+
this.overflowXVisible = 'overflow-x-visible';
|
|
3012
|
+
this.overflowYVisible = 'overflow-y-visible';
|
|
3013
|
+
this.overflowXScroll = 'overflow-x-scroll';
|
|
3014
|
+
this.overflowYScroll = 'overflow-y-scroll';
|
|
3085
3015
|
}
|
|
3086
3016
|
getClasses(extractedKeys) {
|
|
3087
|
-
|
|
3088
|
-
return [key && this[key] ? this[key] : ''];
|
|
3017
|
+
return [(extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.overflow) && this[extractedKeys.overflow] ? this[extractedKeys.overflow] : ''];
|
|
3089
3018
|
}
|
|
3090
3019
|
}
|
|
3091
3020
|
|
|
@@ -3166,7 +3095,7 @@ class ComponentTheme {
|
|
|
3166
3095
|
};
|
|
3167
3096
|
walk(this.themes);
|
|
3168
3097
|
// Apply extra classes based on extracted keys
|
|
3169
|
-
for (const [
|
|
3098
|
+
for (const [, value] of Object.entries(extractedKeys)) {
|
|
3170
3099
|
if (value && this.extraClasses[value]) {
|
|
3171
3100
|
const existingClasses = this.extraClasses[value];
|
|
3172
3101
|
if (existingClasses !== undefined) {
|
|
@@ -3208,6 +3137,11 @@ class ComponentTheme {
|
|
|
3208
3137
|
class SizeTheme extends BaseTheme {
|
|
3209
3138
|
constructor(sizeMap, useDefaultKey = true) {
|
|
3210
3139
|
super();
|
|
3140
|
+
this.xs = "";
|
|
3141
|
+
this.sm = "";
|
|
3142
|
+
this.md = "";
|
|
3143
|
+
this.lg = "";
|
|
3144
|
+
this.xl = "";
|
|
3211
3145
|
this.useDefaultKey = useDefaultKey;
|
|
3212
3146
|
ComponentKeys.size.forEach((key) => {
|
|
3213
3147
|
var _a;
|
|
@@ -3217,34 +3151,30 @@ class SizeTheme extends BaseTheme {
|
|
|
3217
3151
|
getClasses(extractedKeys) {
|
|
3218
3152
|
var _a;
|
|
3219
3153
|
const size = (_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) !== null && _a !== void 0 ? _a : (this.useDefaultKey ? 'md' : undefined);
|
|
3220
|
-
|
|
3221
|
-
return [this[size]];
|
|
3222
|
-
else
|
|
3223
|
-
return [''];
|
|
3154
|
+
return size ? [this[size]] : [''];
|
|
3224
3155
|
}
|
|
3225
3156
|
}
|
|
3226
3157
|
|
|
3227
3158
|
class GapTheme extends BaseTheme {
|
|
3228
3159
|
constructor(sizeMap) {
|
|
3229
3160
|
super();
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3161
|
+
this.xs = 'gap-2';
|
|
3162
|
+
this.sm = 'gap-3';
|
|
3163
|
+
this.md = 'gap-4';
|
|
3164
|
+
this.lg = 'gap-5';
|
|
3165
|
+
this.xl = 'gap-6';
|
|
3166
|
+
if (sizeMap) {
|
|
3167
|
+
ComponentKeys.size.forEach((key) => {
|
|
3168
|
+
if (sizeMap[key] !== undefined) {
|
|
3169
|
+
this[key] = sizeMap[key];
|
|
3170
|
+
}
|
|
3171
|
+
});
|
|
3172
|
+
}
|
|
3236
3173
|
}
|
|
3237
3174
|
getClasses(extractedKeys) {
|
|
3238
3175
|
var _a;
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
// If noGap is true, return empty array (no gap classes)
|
|
3242
|
-
if (gap === 'noGap') {
|
|
3243
|
-
return [];
|
|
3244
|
-
}
|
|
3245
|
-
// If gap is true or undefined, apply gap classes based on size
|
|
3246
|
-
if (gap === 'gap') {
|
|
3247
|
-
const gapClass = this[size];
|
|
3176
|
+
if ((extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.gap) === 'gap') {
|
|
3177
|
+
const gapClass = this[(_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) !== null && _a !== void 0 ? _a : 'md'];
|
|
3248
3178
|
return gapClass ? [gapClass] : [];
|
|
3249
3179
|
}
|
|
3250
3180
|
return [];
|
|
@@ -3276,21 +3206,22 @@ class RadiusTheme extends BaseTheme {
|
|
|
3276
3206
|
static createUITheme(customRounded) {
|
|
3277
3207
|
return new RadiusTheme(customRounded || uiBorderRadiusClasses);
|
|
3278
3208
|
}
|
|
3279
|
-
static createLayoutTheme(
|
|
3280
|
-
return new RadiusTheme(
|
|
3209
|
+
static createLayoutTheme() {
|
|
3210
|
+
return new RadiusTheme(layoutBorderRadiusClasses);
|
|
3281
3211
|
}
|
|
3282
3212
|
getClasses(extractedKeys) {
|
|
3283
3213
|
var _a, _b;
|
|
3284
|
-
const size = (_a = extractedKeys
|
|
3285
|
-
const shape = (_b = extractedKeys
|
|
3214
|
+
const size = (_a = extractedKeys.size) !== null && _a !== void 0 ? _a : 'md';
|
|
3215
|
+
const shape = (_b = extractedKeys.shape) !== null && _b !== void 0 ? _b : 'rounded';
|
|
3286
3216
|
switch (shape) {
|
|
3287
3217
|
case 'pill':
|
|
3288
3218
|
return [this.pill];
|
|
3289
3219
|
case 'sharp':
|
|
3290
3220
|
return [this.sharp];
|
|
3291
|
-
case 'rounded':
|
|
3221
|
+
case 'rounded': {
|
|
3292
3222
|
const roundedClass = this.rounded[size];
|
|
3293
3223
|
return roundedClass ? [roundedClass] : [];
|
|
3224
|
+
}
|
|
3294
3225
|
default:
|
|
3295
3226
|
return [];
|
|
3296
3227
|
}
|
|
@@ -3298,78 +3229,53 @@ class RadiusTheme extends BaseTheme {
|
|
|
3298
3229
|
}
|
|
3299
3230
|
|
|
3300
3231
|
class BorderTheme extends BaseTheme {
|
|
3301
|
-
constructor(
|
|
3302
|
-
super();
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
base: "border",
|
|
3307
|
-
hover: "",
|
|
3308
|
-
active: "",
|
|
3309
|
-
}[key];
|
|
3310
|
-
});
|
|
3232
|
+
constructor() {
|
|
3233
|
+
super(...arguments);
|
|
3234
|
+
this.base = "border";
|
|
3235
|
+
this.hover = "";
|
|
3236
|
+
this.active = "";
|
|
3311
3237
|
}
|
|
3312
3238
|
getClasses(extractedKeys) {
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
return [];
|
|
3317
|
-
}
|
|
3318
|
-
// Only apply border classes if border is explicitly true
|
|
3319
|
-
if (border === 'border') {
|
|
3320
|
-
return ComponentKeys.mode.map(mode => this[mode] || '').filter(Boolean);
|
|
3321
|
-
}
|
|
3322
|
-
return [];
|
|
3239
|
+
return (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.border) === "border"
|
|
3240
|
+
? ComponentKeys.mode.map((mode) => this[mode])
|
|
3241
|
+
: [];
|
|
3323
3242
|
}
|
|
3324
3243
|
}
|
|
3325
3244
|
|
|
3326
3245
|
class RingTheme extends BaseTheme {
|
|
3327
|
-
constructor(
|
|
3328
|
-
super();
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
base: "ring ring-inset",
|
|
3333
|
-
hover: "hover:ring hover:ring-inset",
|
|
3334
|
-
active: "active:ring active:ring-inset",
|
|
3335
|
-
}[key];
|
|
3336
|
-
});
|
|
3246
|
+
constructor() {
|
|
3247
|
+
super(...arguments);
|
|
3248
|
+
this.base = "ring ring-inset";
|
|
3249
|
+
this.hover = "";
|
|
3250
|
+
this.active = "";
|
|
3337
3251
|
}
|
|
3338
3252
|
getClasses(extractedKeys) {
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
return [];
|
|
3343
|
-
}
|
|
3344
|
-
// Only apply ring classes if ring is explicitly true
|
|
3345
|
-
if (ring === 'ring') {
|
|
3346
|
-
return ComponentKeys.mode.map(mode => this[mode] || '').filter(Boolean);
|
|
3347
|
-
}
|
|
3348
|
-
return [];
|
|
3253
|
+
return (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.ring) === 'ring'
|
|
3254
|
+
? ComponentKeys.mode.map(mode => this[mode] || '').filter(Boolean)
|
|
3255
|
+
: [];
|
|
3349
3256
|
}
|
|
3350
3257
|
}
|
|
3351
3258
|
|
|
3352
3259
|
class PaddingTheme extends BaseTheme {
|
|
3353
3260
|
constructor(initial) {
|
|
3354
3261
|
super();
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3262
|
+
this.xs = "";
|
|
3263
|
+
this.sm = "";
|
|
3264
|
+
this.md = "";
|
|
3265
|
+
this.lg = "";
|
|
3266
|
+
this.xl = "";
|
|
3267
|
+
if (initial) {
|
|
3268
|
+
ComponentKeys.size.forEach((key) => {
|
|
3269
|
+
if (initial[key] !== undefined) {
|
|
3270
|
+
this[key] = initial[key];
|
|
3271
|
+
}
|
|
3272
|
+
});
|
|
3273
|
+
}
|
|
3361
3274
|
}
|
|
3362
3275
|
getClasses(extractedKeys) {
|
|
3363
3276
|
var _a;
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
// If noPadding is true, return empty array (no padding classes)
|
|
3367
|
-
if (padding === 'noPadding') {
|
|
3368
|
-
return [];
|
|
3369
|
-
}
|
|
3370
|
-
// If padding is true or undefined, apply padding classes based on size
|
|
3371
|
-
if (padding === 'padding' || padding === undefined) {
|
|
3372
|
-
const paddingClass = this[size];
|
|
3277
|
+
if ((extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.padding) === 'padding' || (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.padding) === undefined) {
|
|
3278
|
+
const paddingClass = this[(_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) !== null && _a !== void 0 ? _a : 'md'];
|
|
3373
3279
|
return paddingClass ? [paddingClass] : [];
|
|
3374
3280
|
}
|
|
3375
3281
|
return [];
|
|
@@ -3405,13 +3311,23 @@ class PyTheme extends PaddingTheme {
|
|
|
3405
3311
|
}
|
|
3406
3312
|
|
|
3407
3313
|
class AppearanceTheme extends BaseTheme {
|
|
3408
|
-
constructor(config, transparentClasses) {
|
|
3314
|
+
constructor(config, category, transparentClasses) {
|
|
3409
3315
|
super();
|
|
3410
3316
|
Object.assign(this, config);
|
|
3317
|
+
this.category = category;
|
|
3411
3318
|
this.transparentClasses = transparentClasses;
|
|
3412
3319
|
}
|
|
3413
3320
|
getClasses(extractedKeys) {
|
|
3414
3321
|
var _a;
|
|
3322
|
+
if (this.category === 'border' && extractedKeys.border === 'noBorder') {
|
|
3323
|
+
return [];
|
|
3324
|
+
}
|
|
3325
|
+
if (this.category === 'ring' && extractedKeys.ring === 'noRing') {
|
|
3326
|
+
return [];
|
|
3327
|
+
}
|
|
3328
|
+
if (this.category === 'shadow' && extractedKeys.shadow === 'noShadow') {
|
|
3329
|
+
return [];
|
|
3330
|
+
}
|
|
3415
3331
|
// Check for specific transparent styles first
|
|
3416
3332
|
if (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.transparent) {
|
|
3417
3333
|
const transparentClass = ((_a = this.transparentClasses) === null || _a === void 0 ? void 0 : _a[extractedKeys.transparent]) || '';
|
|
@@ -3427,7 +3343,7 @@ class AppearanceTheme extends BaseTheme {
|
|
|
3427
3343
|
}
|
|
3428
3344
|
return [];
|
|
3429
3345
|
}
|
|
3430
|
-
static createTheme(src = {}) {
|
|
3346
|
+
static createTheme(src = {}, category) {
|
|
3431
3347
|
const config = Object.fromEntries(ComponentKeys.appearance.map(textKey => [
|
|
3432
3348
|
textKey,
|
|
3433
3349
|
Object.fromEntries(ComponentKeys.mode.map(modeKey => {
|
|
@@ -3438,7 +3354,7 @@ class AppearanceTheme extends BaseTheme {
|
|
|
3438
3354
|
];
|
|
3439
3355
|
})),
|
|
3440
3356
|
]));
|
|
3441
|
-
return new AppearanceTheme(config, src.base);
|
|
3357
|
+
return new AppearanceTheme(config, category, src.base);
|
|
3442
3358
|
}
|
|
3443
3359
|
}
|
|
3444
3360
|
|
|
@@ -3754,21 +3670,21 @@ class GenericVariantTheme extends BaseTheme {
|
|
|
3754
3670
|
getClasses(extractedKeys) {
|
|
3755
3671
|
var _a;
|
|
3756
3672
|
const variantKey = (_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.variant) !== null && _a !== void 0 ? _a : 'outline';
|
|
3757
|
-
const
|
|
3758
|
-
if (!
|
|
3673
|
+
const activeTheme = this[variantKey];
|
|
3674
|
+
if (!activeTheme) {
|
|
3759
3675
|
return [];
|
|
3760
3676
|
}
|
|
3761
|
-
return
|
|
3677
|
+
return activeTheme.getClasses(extractedKeys);
|
|
3762
3678
|
}
|
|
3763
3679
|
// used for button, bages, chips, etc
|
|
3764
3680
|
static createUIElementTextTheme() {
|
|
3765
3681
|
return new GenericVariantTheme({
|
|
3766
3682
|
outline: AppearanceTheme.createTheme({
|
|
3767
3683
|
base: textAppearanceClasses
|
|
3768
|
-
}),
|
|
3684
|
+
}, 'text'),
|
|
3769
3685
|
filled: AppearanceTheme.createTheme({
|
|
3770
3686
|
base: filledTextAppearanceClasses
|
|
3771
|
-
})
|
|
3687
|
+
}, 'text')
|
|
3772
3688
|
});
|
|
3773
3689
|
}
|
|
3774
3690
|
static createUIElementShadowTheme() {
|
|
@@ -3783,155 +3699,118 @@ class GenericVariantTheme extends BaseTheme {
|
|
|
3783
3699
|
filled: ShadowAppearanceTheme.createLayoutTheme({})
|
|
3784
3700
|
});
|
|
3785
3701
|
}
|
|
3786
|
-
static createBorderAppearanceTheme() {
|
|
3787
|
-
return new GenericVariantTheme({
|
|
3788
|
-
outline: AppearanceTheme.createTheme({ base: borderAppearanceClasses }),
|
|
3789
|
-
filled: AppearanceTheme.createTheme({ base: filledBorderAppearanceClasses })
|
|
3790
|
-
});
|
|
3791
|
-
}
|
|
3792
3702
|
static createUIElementBorderTheme() {
|
|
3793
3703
|
return new GenericVariantTheme({
|
|
3794
3704
|
outline: AppearanceTheme.createTheme({
|
|
3795
3705
|
base: borderAppearanceClasses
|
|
3796
|
-
}),
|
|
3706
|
+
}, 'border'),
|
|
3797
3707
|
filled: AppearanceTheme.createTheme({
|
|
3798
3708
|
base: filledBorderAppearanceClasses
|
|
3799
|
-
})
|
|
3709
|
+
}, 'border')
|
|
3800
3710
|
});
|
|
3801
3711
|
}
|
|
3802
3712
|
static createUIElementRingTheme() {
|
|
3803
3713
|
return new GenericVariantTheme({
|
|
3804
3714
|
outline: AppearanceTheme.createTheme({
|
|
3805
3715
|
base: ringAppearanceClasses
|
|
3806
|
-
}),
|
|
3716
|
+
}, 'ring'),
|
|
3807
3717
|
filled: AppearanceTheme.createTheme({
|
|
3808
3718
|
base: filledRingAppearanceClasses
|
|
3809
|
-
})
|
|
3810
|
-
});
|
|
3811
|
-
}
|
|
3812
|
-
static createBgAppearanceTheme() {
|
|
3813
|
-
return new GenericVariantTheme({
|
|
3814
|
-
outline: AppearanceTheme.createTheme({
|
|
3815
|
-
base: backgroundAppearanceClasses,
|
|
3816
|
-
hover: hoverBackgroundAppearanceClasses,
|
|
3817
|
-
active: activeBackgroundAppearanceClasses
|
|
3818
|
-
}),
|
|
3819
|
-
filled: AppearanceTheme.createTheme({
|
|
3820
|
-
base: filledBackgroundAppearanceClasses,
|
|
3821
|
-
hover: filledHoverBackgroundAppearanceClasses,
|
|
3822
|
-
active: filledActiveBackgroundAppearanceClasses
|
|
3823
|
-
})
|
|
3719
|
+
}, 'ring')
|
|
3824
3720
|
});
|
|
3825
3721
|
}
|
|
3826
3722
|
static createCheckboxBgAppearanceTheme() {
|
|
3827
3723
|
return new GenericVariantTheme({
|
|
3828
3724
|
outline: AppearanceTheme.createTheme({
|
|
3829
3725
|
base: backgroundAppearanceClasses,
|
|
3830
|
-
}),
|
|
3726
|
+
}, 'bg'),
|
|
3831
3727
|
filled: AppearanceTheme.createTheme({
|
|
3832
3728
|
base: backgroundAppearanceClasses,
|
|
3833
|
-
})
|
|
3729
|
+
}, 'bg')
|
|
3834
3730
|
});
|
|
3835
3731
|
}
|
|
3836
|
-
static
|
|
3732
|
+
static createBgAppearanceTheme() {
|
|
3837
3733
|
return new GenericVariantTheme({
|
|
3838
3734
|
outline: AppearanceTheme.createTheme({
|
|
3839
3735
|
base: backgroundAppearanceClasses,
|
|
3840
3736
|
hover: hoverBackgroundAppearanceClasses,
|
|
3841
3737
|
active: activeBackgroundAppearanceClasses
|
|
3842
|
-
}),
|
|
3738
|
+
}, 'bg'),
|
|
3843
3739
|
filled: AppearanceTheme.createTheme({
|
|
3844
3740
|
base: filledBackgroundAppearanceClasses,
|
|
3845
3741
|
hover: filledHoverBackgroundAppearanceClasses,
|
|
3846
3742
|
active: filledActiveBackgroundAppearanceClasses
|
|
3847
|
-
})
|
|
3743
|
+
}, 'bg')
|
|
3848
3744
|
});
|
|
3849
3745
|
}
|
|
3850
3746
|
static createSimpleUIElementBgAppearanceTheme() {
|
|
3851
3747
|
return new GenericVariantTheme({
|
|
3852
3748
|
outline: AppearanceTheme.createTheme({
|
|
3853
3749
|
base: backgroundAppearanceClasses,
|
|
3854
|
-
}),
|
|
3750
|
+
}, 'bg'),
|
|
3855
3751
|
filled: AppearanceTheme.createTheme({
|
|
3856
3752
|
base: filledBackgroundAppearanceClasses,
|
|
3857
|
-
})
|
|
3753
|
+
}, 'bg')
|
|
3858
3754
|
});
|
|
3859
3755
|
}
|
|
3860
3756
|
static createAccentColorAppearanceTheme() {
|
|
3861
3757
|
return new GenericVariantTheme({
|
|
3862
3758
|
outline: AppearanceTheme.createTheme({
|
|
3863
3759
|
base: accentColorAppearanceClasses
|
|
3864
|
-
}),
|
|
3760
|
+
}, 'accent'),
|
|
3865
3761
|
filled: AppearanceTheme.createTheme({
|
|
3866
3762
|
base: filledAccentColorAppearanceClasses
|
|
3867
|
-
})
|
|
3763
|
+
}, 'accent')
|
|
3868
3764
|
});
|
|
3869
3765
|
}
|
|
3870
3766
|
static createCheckedAppearanceTheme() {
|
|
3871
3767
|
return new GenericVariantTheme({
|
|
3872
3768
|
outline: AppearanceTheme.createTheme({
|
|
3873
3769
|
base: checkedBackgroundAppearanceClasses
|
|
3874
|
-
}),
|
|
3770
|
+
}, 'bg'),
|
|
3875
3771
|
filled: AppearanceTheme.createTheme({
|
|
3876
3772
|
base: filledCheckedBackgroundAppearanceClasses
|
|
3877
|
-
})
|
|
3773
|
+
}, 'bg')
|
|
3878
3774
|
});
|
|
3879
3775
|
}
|
|
3880
3776
|
static createLayoutBgAppearanceTheme() {
|
|
3881
3777
|
return new GenericVariantTheme({
|
|
3882
3778
|
outline: AppearanceTheme.createTheme({
|
|
3883
3779
|
base: layoutBackgroundAppearanceClasses
|
|
3884
|
-
}),
|
|
3780
|
+
}, 'bg'),
|
|
3885
3781
|
filled: AppearanceTheme.createTheme({
|
|
3886
3782
|
base: layoutFilledBackgroundAppearanceClasses
|
|
3887
|
-
})
|
|
3783
|
+
}, 'bg')
|
|
3888
3784
|
});
|
|
3889
3785
|
}
|
|
3890
3786
|
}
|
|
3891
3787
|
|
|
3892
3788
|
class WrapTheme extends BaseTheme {
|
|
3893
|
-
constructor(
|
|
3894
|
-
super();
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
flexWrap: "flex-wrap",
|
|
3899
|
-
flexNoWrap: "flex-nowrap",
|
|
3900
|
-
flexWrapReverse: "flex-wrap-reverse"
|
|
3901
|
-
}[key];
|
|
3902
|
-
});
|
|
3789
|
+
constructor() {
|
|
3790
|
+
super(...arguments);
|
|
3791
|
+
this.flexWrap = "flex-wrap";
|
|
3792
|
+
this.flexNoWrap = "flex-nowrap";
|
|
3793
|
+
this.flexWrapReverse = "flex-wrap-reverse";
|
|
3903
3794
|
}
|
|
3904
3795
|
getClasses(extractedKeys) {
|
|
3905
|
-
|
|
3906
|
-
return key ? [this[key]] : [];
|
|
3796
|
+
return (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.wrap) ? [this[extractedKeys.wrap]] : [];
|
|
3907
3797
|
}
|
|
3908
3798
|
}
|
|
3909
3799
|
|
|
3910
3800
|
class DirectionTheme extends BaseTheme {
|
|
3911
|
-
constructor(
|
|
3912
|
-
super();
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
rowReverse: "flex-row-reverse",
|
|
3918
|
-
columnReverse: "flex-col-reverse",
|
|
3919
|
-
}[key];
|
|
3920
|
-
});
|
|
3801
|
+
constructor() {
|
|
3802
|
+
super(...arguments);
|
|
3803
|
+
this.row = "flex-row";
|
|
3804
|
+
this.column = "flex-col";
|
|
3805
|
+
this.rowReverse = "flex-row-reverse";
|
|
3806
|
+
this.columnReverse = "flex-col-reverse";
|
|
3921
3807
|
}
|
|
3922
3808
|
getClasses(extractedKeys) {
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
direction = "columnReverse";
|
|
3929
|
-
break;
|
|
3930
|
-
case "row":
|
|
3931
|
-
direction = "rowReverse";
|
|
3932
|
-
break;
|
|
3933
|
-
}
|
|
3934
|
-
}
|
|
3809
|
+
const direction = (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.reverse) === 'reverse'
|
|
3810
|
+
? ((extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.flexDirection) === "column" ? "columnReverse"
|
|
3811
|
+
: (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.flexDirection) === "row" ? "rowReverse"
|
|
3812
|
+
: extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.flexDirection)
|
|
3813
|
+
: extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.flexDirection;
|
|
3935
3814
|
return direction ? [this[direction]] : [];
|
|
3936
3815
|
}
|
|
3937
3816
|
}
|
|
@@ -4160,7 +4039,7 @@ const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-poin
|
|
|
4160
4039
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
|
|
4161
4040
|
},
|
|
4162
4041
|
appearance: {
|
|
4163
|
-
background: GenericVariantTheme.
|
|
4042
|
+
background: GenericVariantTheme.createBgAppearanceTheme(),
|
|
4164
4043
|
text: GenericVariantTheme.createUIElementTextTheme(),
|
|
4165
4044
|
border: GenericVariantTheme.createUIElementBorderTheme(),
|
|
4166
4045
|
ring: GenericVariantTheme.createUIElementRingTheme(),
|
|
@@ -4175,7 +4054,7 @@ const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-poin
|
|
|
4175
4054
|
flexDirection: new DirectionTheme(),
|
|
4176
4055
|
},
|
|
4177
4056
|
typography: defaultTypographyTheme,
|
|
4178
|
-
}, themeDefaults.button, BUTTON_CATEGORIES, (props
|
|
4057
|
+
}, themeDefaults.button, BUTTON_CATEGORIES, (props) => {
|
|
4179
4058
|
// Determine tag based on href prop
|
|
4180
4059
|
return props.href ? "a" : "button";
|
|
4181
4060
|
});
|
|
@@ -4203,7 +4082,7 @@ const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all
|
|
|
4203
4082
|
flexDirection: new DirectionTheme(),
|
|
4204
4083
|
},
|
|
4205
4084
|
typography: defaultTypographyTheme,
|
|
4206
|
-
}, themeDefaults.badge, BADGE_CATEGORIES, (props
|
|
4085
|
+
}, themeDefaults.badge, BADGE_CATEGORIES, (props) => {
|
|
4207
4086
|
return props.href ? "a" : "span";
|
|
4208
4087
|
});
|
|
4209
4088
|
|
|
@@ -4230,7 +4109,7 @@ const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all
|
|
|
4230
4109
|
flexDirection: new DirectionTheme(),
|
|
4231
4110
|
},
|
|
4232
4111
|
typography: defaultTypographyTheme,
|
|
4233
|
-
}, themeDefaults.chip, CHIP_CATEGORIES, (props
|
|
4112
|
+
}, themeDefaults.chip, CHIP_CATEGORIES, (props) => {
|
|
4234
4113
|
return props.href ? "a" : "span";
|
|
4235
4114
|
});
|
|
4236
4115
|
|
|
@@ -4303,7 +4182,7 @@ const deepClone = (source) => {
|
|
|
4303
4182
|
};
|
|
4304
4183
|
const findGroup = (key) => {
|
|
4305
4184
|
// Check each group in ComponentKeys to find which one contains this key
|
|
4306
|
-
for (const [
|
|
4185
|
+
for (const [, group] of Object.entries(ComponentKeys)) {
|
|
4307
4186
|
if (group.includes(key)) {
|
|
4308
4187
|
return group;
|
|
4309
4188
|
}
|
|
@@ -4351,15 +4230,10 @@ class PlTheme extends PaddingTheme {
|
|
|
4351
4230
|
}
|
|
4352
4231
|
|
|
4353
4232
|
class ListStyleTheme extends BaseTheme {
|
|
4354
|
-
constructor(
|
|
4355
|
-
super();
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : {
|
|
4359
|
-
disc: 'list-disc',
|
|
4360
|
-
decimal: 'list-decimal',
|
|
4361
|
-
}[key];
|
|
4362
|
-
});
|
|
4233
|
+
constructor() {
|
|
4234
|
+
super(...arguments);
|
|
4235
|
+
this.disc = 'list-disc';
|
|
4236
|
+
this.decimal = 'list-decimal';
|
|
4363
4237
|
}
|
|
4364
4238
|
getClasses(extractedKeys) {
|
|
4365
4239
|
const listStyle = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.listStyle;
|
|
@@ -4381,7 +4255,7 @@ const createTypographyComponentTheme = (tag, base = "text-balance", textSizeMap
|
|
|
4381
4255
|
},
|
|
4382
4256
|
typography: defaultTypographyTheme,
|
|
4383
4257
|
layout: defaultLayoutTheme,
|
|
4384
|
-
}, defaults, TYPOGRAPHY_CATEGORIES, (props
|
|
4258
|
+
}, defaults, TYPOGRAPHY_CATEGORIES, (props) => {
|
|
4385
4259
|
// Determine tag based on href prop
|
|
4386
4260
|
return props.href ? "a" : tag;
|
|
4387
4261
|
});
|
|
@@ -4439,34 +4313,25 @@ const listTheme = new ComponentTheme("ul", "list-inside", {
|
|
|
4439
4313
|
typography: defaultTypographyTheme,
|
|
4440
4314
|
layout: defaultLayoutTheme,
|
|
4441
4315
|
listStyle: new ListStyleTheme(),
|
|
4442
|
-
}, themeDefaults.list, LIST_CATEGORIES, (props
|
|
4443
|
-
// Determine tag based on list style from props
|
|
4316
|
+
}, themeDefaults.list, LIST_CATEGORIES, (props) => {
|
|
4317
|
+
// Determine tag based on list style from props
|
|
4444
4318
|
const componentProps = props;
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
const hasDecimal = (componentProps === null || componentProps === void 0 ? void 0 : componentProps.decimal) || (defaultsRecord === null || defaultsRecord === void 0 ? void 0 : defaultsRecord.decimal);
|
|
4319
|
+
// Check if decimal is set in props
|
|
4320
|
+
const hasDecimal = componentProps === null || componentProps === void 0 ? void 0 : componentProps.decimal;
|
|
4448
4321
|
return hasDecimal ? "ol" : "ul";
|
|
4449
4322
|
});
|
|
4450
4323
|
|
|
4451
4324
|
class BreakpointTheme extends BaseTheme {
|
|
4452
|
-
constructor(
|
|
4453
|
-
super();
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
mdCol: "max-md:flex-col",
|
|
4460
|
-
lgCol: "max-lg:flex-col",
|
|
4461
|
-
xlCol: "max-xl:flex-col"
|
|
4462
|
-
}[key];
|
|
4463
|
-
});
|
|
4325
|
+
constructor() {
|
|
4326
|
+
super(...arguments);
|
|
4327
|
+
this.xsCol = "max-xs:flex-col";
|
|
4328
|
+
this.smCol = "max-sm:flex-col";
|
|
4329
|
+
this.mdCol = "max-md:flex-col";
|
|
4330
|
+
this.lgCol = "max-lg:flex-col";
|
|
4331
|
+
this.xlCol = "max-xl:flex-col";
|
|
4464
4332
|
}
|
|
4465
4333
|
getClasses(extractedKeys) {
|
|
4466
|
-
|
|
4467
|
-
if (!key)
|
|
4468
|
-
return [];
|
|
4469
|
-
return [this[key] || ''];
|
|
4334
|
+
return (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.breakpoint) ? [this[extractedKeys.breakpoint] || ''] : [];
|
|
4470
4335
|
}
|
|
4471
4336
|
}
|
|
4472
4337
|
|
|
@@ -4505,7 +4370,7 @@ const defaultCardTheme = new ComponentTheme("div", "", {
|
|
|
4505
4370
|
ring: GenericVariantTheme.createUIElementRingTheme(),
|
|
4506
4371
|
},
|
|
4507
4372
|
typography: defaultTypographyTheme,
|
|
4508
|
-
}, themeDefaults.card, CARD_CATEGORIES, (props
|
|
4373
|
+
}, themeDefaults.card, CARD_CATEGORIES, (props) => {
|
|
4509
4374
|
return props.href ? "a" : "div";
|
|
4510
4375
|
});
|
|
4511
4376
|
|
|
@@ -4529,7 +4394,7 @@ const defaultRowTheme = new ComponentTheme("div", "", {
|
|
|
4529
4394
|
ring: GenericVariantTheme.createUIElementRingTheme(),
|
|
4530
4395
|
shadow: GenericVariantTheme.createLayoutShadowTheme(),
|
|
4531
4396
|
}
|
|
4532
|
-
}, themeDefaults.row, ROW_CATEGORIES, (props
|
|
4397
|
+
}, themeDefaults.row, ROW_CATEGORIES, (props) => {
|
|
4533
4398
|
// Determine tag based on href prop
|
|
4534
4399
|
return props.href ? "a" : "div";
|
|
4535
4400
|
});
|
|
@@ -4541,7 +4406,7 @@ const defaultDividerTheme = new ComponentTheme("div", "h-px w-full", {
|
|
|
4541
4406
|
appearance: {
|
|
4542
4407
|
background: AppearanceTheme.createTheme({
|
|
4543
4408
|
base: bgBorderAppearanceClasses,
|
|
4544
|
-
}),
|
|
4409
|
+
}, 'bg'),
|
|
4545
4410
|
},
|
|
4546
4411
|
layout: defaultLayoutTheme,
|
|
4547
4412
|
}, themeDefaults.divider, DIVIDER_CATEGORIES);
|
|
@@ -4572,7 +4437,7 @@ const defaultContainerTheme = new ComponentTheme("div", "flex-col mx-auto w-full
|
|
|
4572
4437
|
ring: GenericVariantTheme.createUIElementRingTheme(),
|
|
4573
4438
|
shadow: GenericVariantTheme.createLayoutShadowTheme(),
|
|
4574
4439
|
}
|
|
4575
|
-
}, themeDefaults.container, CONTAINER_CATEGORIES, (props
|
|
4440
|
+
}, themeDefaults.container, CONTAINER_CATEGORIES, (props) => {
|
|
4576
4441
|
return props.href ? "a" : "div";
|
|
4577
4442
|
});
|
|
4578
4443
|
|
|
@@ -4595,7 +4460,7 @@ const defaultColTheme = new ComponentTheme("div", "", {
|
|
|
4595
4460
|
ring: GenericVariantTheme.createUIElementRingTheme(),
|
|
4596
4461
|
shadow: GenericVariantTheme.createLayoutShadowTheme(),
|
|
4597
4462
|
}
|
|
4598
|
-
}, themeDefaults.col, COL_CATEGORIES, (props
|
|
4463
|
+
}, themeDefaults.col, COL_CATEGORIES, (props) => {
|
|
4599
4464
|
return props.href ? "a" : "div";
|
|
4600
4465
|
});
|
|
4601
4466
|
|
|
@@ -4621,7 +4486,7 @@ const defaultStackTheme = new ComponentTheme("div", "", {
|
|
|
4621
4486
|
ring: GenericVariantTheme.createUIElementRingTheme(),
|
|
4622
4487
|
shadow: GenericVariantTheme.createLayoutShadowTheme(),
|
|
4623
4488
|
}
|
|
4624
|
-
}, themeDefaults.stack, STACK_CATEGORIES, (props
|
|
4489
|
+
}, themeDefaults.stack, STACK_CATEGORIES, (props) => {
|
|
4625
4490
|
return props.href ? "a" : "div";
|
|
4626
4491
|
});
|
|
4627
4492
|
|
|
@@ -4659,7 +4524,7 @@ const defaultSectionTheme = new ComponentTheme("div", "w-full flex-col", {
|
|
|
4659
4524
|
ring: new RingTheme(),
|
|
4660
4525
|
radius: RadiusTheme.createLayoutTheme(),
|
|
4661
4526
|
},
|
|
4662
|
-
}, themeDefaults.section, SECTION_CATEGORIES, (props
|
|
4527
|
+
}, themeDefaults.section, SECTION_CATEGORIES, (props) => {
|
|
4663
4528
|
return props.href ? "a" : "div";
|
|
4664
4529
|
});
|
|
4665
4530
|
|
|
@@ -4683,13 +4548,13 @@ const gridSubThemes = {
|
|
|
4683
4548
|
flexDirection: new DirectionTheme(),
|
|
4684
4549
|
},
|
|
4685
4550
|
};
|
|
4686
|
-
const defaultGrid2Theme = new ComponentTheme("div", "grid-cols-1 md:grid-cols-2", gridSubThemes, themeDefaults.grid2, GRID_CATEGORIES, (props
|
|
4551
|
+
const defaultGrid2Theme = new ComponentTheme("div", "grid-cols-1 md:grid-cols-2", gridSubThemes, themeDefaults.grid2, GRID_CATEGORIES, (props) => {
|
|
4687
4552
|
return props.href ? "a" : "div";
|
|
4688
4553
|
});
|
|
4689
|
-
const defaultGrid3Theme = new ComponentTheme("div", "grid-cols-1 md:grid-cols-3", gridSubThemes, themeDefaults.grid3, GRID_CATEGORIES, (props
|
|
4554
|
+
const defaultGrid3Theme = new ComponentTheme("div", "grid-cols-1 md:grid-cols-3", gridSubThemes, themeDefaults.grid3, GRID_CATEGORIES, (props) => {
|
|
4690
4555
|
return props.href ? "a" : "div";
|
|
4691
4556
|
});
|
|
4692
|
-
const defaultGrid4Theme = new ComponentTheme("div", "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4", gridSubThemes, themeDefaults.grid4, GRID_CATEGORIES, (props
|
|
4557
|
+
const defaultGrid4Theme = new ComponentTheme("div", "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4", gridSubThemes, themeDefaults.grid4, GRID_CATEGORIES, (props) => {
|
|
4693
4558
|
return props.href ? "a" : "div";
|
|
4694
4559
|
});
|
|
4695
4560
|
|
|
@@ -4953,15 +4818,25 @@ const Checkbox = react.forwardRef(function Checkbox(props, ref) {
|
|
|
4953
4818
|
filled, outline,
|
|
4954
4819
|
// Shape props
|
|
4955
4820
|
pill, sharp, rounded,
|
|
4956
|
-
//
|
|
4957
|
-
|
|
4821
|
+
// Extract input HTML attributes
|
|
4822
|
+
checked, defaultChecked, disabled, name, value, onChange, onBlur, onFocus, required, readOnly,
|
|
4823
|
+
// Other HTML attributes
|
|
4824
|
+
id, className, tabIndex, 'aria-label': ariaLabel, ...remainingProps } = props;
|
|
4958
4825
|
const themeProps = {
|
|
4959
4826
|
xs, sm, md, lg, xl,
|
|
4960
4827
|
default: defaultProp, accent, primary, secondary, tertiary, success, danger, warning, info, transparent,
|
|
4961
4828
|
filled, outline,
|
|
4962
4829
|
pill, sharp, rounded
|
|
4963
4830
|
};
|
|
4964
|
-
|
|
4831
|
+
const inputProps = {
|
|
4832
|
+
type: "checkbox",
|
|
4833
|
+
checked, defaultChecked, disabled, name, value, onChange, onBlur, onFocus, required, readOnly,
|
|
4834
|
+
id, tabIndex, 'aria-label': ariaLabel,
|
|
4835
|
+
className, // Apply className to the input element
|
|
4836
|
+
...remainingProps,
|
|
4837
|
+
...themeProps
|
|
4838
|
+
};
|
|
4839
|
+
return (jsxRuntime.jsxs(ThemedComponent, { theme: theme.checkbox.wrapper, ref: ref, ...themeProps, children: [jsxRuntime.jsx(ThemedComponent, { theme: theme.checkbox.input, ...inputProps }), jsxRuntime.jsx(ThemedComponent, { theme: theme.checkbox.check, ...themeProps, children: theme.checkbox.check.themes.checkElement() })] }));
|
|
4965
4840
|
});
|
|
4966
4841
|
|
|
4967
4842
|
const Label = react.forwardRef(function Label(props, ref) {
|
|
@@ -5047,6 +4922,7 @@ const List = react.forwardRef(function List(props, ref) {
|
|
|
5047
4922
|
return jsxRuntime.jsx(ThemedComponent, { ref: ref, theme: theme.list, ...props });
|
|
5048
4923
|
});
|
|
5049
4924
|
|
|
4925
|
+
exports.APPEARANCE_CATEGORY = APPEARANCE_CATEGORY;
|
|
5050
4926
|
exports.BADGE_CATEGORIES = BADGE_CATEGORIES;
|
|
5051
4927
|
exports.BREAKPOINT = BREAKPOINT;
|
|
5052
4928
|
exports.BUTTON_CATEGORIES = BUTTON_CATEGORIES;
|