vueless 1.0.2-beta.35 → 1.0.2-beta.36

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "1.0.2-beta.35",
3
+ "version": "1.0.2-beta.36",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -1,6 +1,5 @@
1
1
  export default /*tw*/ {
2
2
  header: {
3
- base: "font-medium",
4
3
  variants: {
5
4
  variant: {
6
5
  default: "text-{color}",
@@ -19,6 +18,13 @@ export default /*tw*/ {
19
18
  xl: "text-4xl",
20
19
  "2xl": "text-5xl",
21
20
  },
21
+ weight: {
22
+ light: "font-light",
23
+ normal: "font-normal",
24
+ medium: "font-medium",
25
+ semibold: "font-semibold",
26
+ bold: "font-bold",
27
+ },
22
28
  line: {
23
29
  true: "!leading-none",
24
30
  },
@@ -33,6 +39,7 @@ export default /*tw*/ {
33
39
  defaults: {
34
40
  color: "text",
35
41
  variant: "default",
42
+ weight: "medium",
36
43
  size: "md",
37
44
  tag: "div",
38
45
  line: true,
@@ -15,7 +15,7 @@ import type { Props } from "../types.ts";
15
15
 
16
16
  interface UHeaderArgs extends Props {
17
17
  slotTemplate?: string;
18
- enum: "size" | "color" | "variant";
18
+ enum: "size" | "color" | "variant" | "weight";
19
19
  }
20
20
 
21
21
  export default {
@@ -92,6 +92,9 @@ Variants.args = { enum: "variant" };
92
92
  export const Colors = EnumTemplate.bind({});
93
93
  Colors.args = { enum: "color" };
94
94
 
95
+ export const Weights = EnumTemplate.bind({});
96
+ Weights.args = { enum: "weight" };
97
+
95
98
  export const DefaultSlot = DefaultTemplate.bind({});
96
99
  DefaultSlot.args = {
97
100
  slotTemplate: `
@@ -79,6 +79,27 @@ describe("UHeader.vue", () => {
79
79
  });
80
80
  });
81
81
 
82
+ // Weight prop
83
+ it("applies the correct weight class", async () => {
84
+ const weights = {
85
+ light: "font-light",
86
+ normal: "font-normal",
87
+ medium: "font-medium",
88
+ semibold: "font-semibold",
89
+ bold: "font-bold",
90
+ };
91
+
92
+ Object.entries(weights).forEach(([weight, classes]) => {
93
+ const component = mount(UHeader, {
94
+ props: {
95
+ weight: weight as Props["weight"],
96
+ },
97
+ });
98
+
99
+ expect(component.attributes("class")).toContain(classes);
100
+ });
101
+ });
102
+
82
103
  // Label prop
83
104
  it("renders the correct label text", () => {
84
105
  const label = "Header Text";
@@ -19,6 +19,11 @@ export interface Props {
19
19
  */
20
20
  variant?: "default" | "accented" | "lifted" | "muted";
21
21
 
22
+ /**
23
+ * Font weight.
24
+ */
25
+ weight?: "light" | "normal" | "medium" | "semibold" | "bold";
26
+
22
27
  /**
23
28
  * Header color.
24
29
  */