strivui 1.0.2 → 1.0.4

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.
@@ -0,0 +1,41 @@
1
+ import React, { ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, AnchorHTMLAttributes, TextareaHTMLAttributes, SelectHTMLAttributes } from 'react';
2
+
3
+ type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
4
+ children?: ReactNode;
5
+ };
6
+
7
+ const Button = ({ children, ...props }: ButtonProps) => {
8
+ return <button {...props}>{children}</button>;
9
+ };
10
+
11
+ type InputProps = InputHTMLAttributes<HTMLInputElement>;
12
+
13
+ const Input = (props: InputProps) => {
14
+ return <input {...props} />;
15
+ };
16
+
17
+ type AnchorProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
18
+ children?: ReactNode;
19
+ };
20
+
21
+ const Anchor = ({ children, ...props }: AnchorProps) => {
22
+ return <a {...props}>{children}</a>;
23
+ };
24
+
25
+ type TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
26
+ children?: ReactNode;
27
+ };
28
+
29
+ const TextArea = ({ children, ...props }: TextAreaProps) => {
30
+ return <textarea {...props}>{children}</textarea>;
31
+ };
32
+
33
+ type SelectProps = SelectHTMLAttributes<HTMLSelectElement> & {
34
+ children?: ReactNode;
35
+ };
36
+
37
+ const Select = ({ children, ...props }: SelectProps) => {
38
+ return <select {...props}>{children}</select>;
39
+ };
40
+
41
+ export { Button, Input, Anchor, TextArea, Select };
@@ -0,0 +1,75 @@
1
+ import React, { ReactNode, TableHTMLAttributes, HTMLAttributes } from "react";
2
+
3
+ type TableProps = TableHTMLAttributes<HTMLTableElement> & {
4
+ children?: ReactNode;
5
+ };
6
+
7
+ const Table = ({ children, ...props }: TableProps) => {
8
+ return <table {...props}>{children}</table>;
9
+ };
10
+
11
+ type TableHeadProps = HTMLAttributes<HTMLTableSectionElement> & {
12
+ children?: ReactNode;
13
+ };
14
+
15
+ const TableHead = ({ children, ...props }: TableHeadProps) => {
16
+ return <thead {...props}>{children}</thead>;
17
+ };
18
+
19
+ type TableBodyProps = HTMLAttributes<HTMLTableSectionElement> & {
20
+ children?: ReactNode;
21
+ };
22
+
23
+ const TableBody = ({ children, ...props }: TableBodyProps) => {
24
+ return <tbody {...props}>{children}</tbody>;
25
+ };
26
+
27
+ type TableRowProps = HTMLAttributes<HTMLTableRowElement> & {
28
+ children?: ReactNode;
29
+ };
30
+
31
+ const TableRow = ({ children, ...props }: TableRowProps) => {
32
+ return <tr {...props}>{children}</tr>;
33
+ };
34
+
35
+ type TableHeaderCellProps = React.ThHTMLAttributes<HTMLTableHeaderCellElement> & {
36
+ children?: ReactNode;
37
+ };
38
+
39
+ const TableHeaderCell = ({ children, ...props }: TableHeaderCellProps) => {
40
+ return <th {...props}>{children}</th>;
41
+ };
42
+
43
+ type TableDataCellProps = React.TdHTMLAttributes<HTMLTableDataCellElement> & {
44
+ children?: ReactNode;
45
+ };
46
+
47
+ const TableDataCell = ({ children, ...props }: TableDataCellProps) => {
48
+ return <td {...props}>{children}</td>;
49
+ };
50
+
51
+ type ContainerProps = HTMLAttributes<HTMLDivElement> & {
52
+ children?: ReactNode;
53
+ };
54
+
55
+ const Container = ({ children, ...props }: ContainerProps) => {
56
+ return <div {...props}>{children}</div>;
57
+ };
58
+
59
+ type CardProps = HTMLAttributes<HTMLDivElement> & {
60
+ children?: ReactNode;
61
+ };
62
+ const Card = ({ children, ...props }: CardProps) => {
63
+ return <div {...props}>{children}</div>;
64
+ };
65
+
66
+ export {
67
+ Card,
68
+ Table,
69
+ TableHead,
70
+ TableBody,
71
+ TableRow,
72
+ TableHeaderCell,
73
+ TableDataCell,
74
+ Container
75
+ };
@@ -0,0 +1,34 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+
4
+ const inputFiles = ["./example.html", "./example.tsx"]; // replace with your files
5
+ let css = "/* === StriveUI Utility CSS === */\n\n";
6
+
7
+ /* Static Utility Examples */
8
+ css += `.bg-primary { background-color: #2563eb; }\n`;
9
+ css += `.bg-secondary { background-color: #facc15; }\n`;
10
+
11
+ /* Extract Arbitrary Classes */
12
+ const content = inputFiles
13
+ .map(file => fs.existsSync(file) ? fs.readFileSync(file, "utf8") : "")
14
+ .join(" ");
15
+
16
+ const matches = [...content.matchAll(/(\w+)-\[(.+?)\]/g)];
17
+
18
+ matches.forEach(([full, prop, val]) => {
19
+ const safeVal = val.replace(/\./g, "\\.").replace(/\//g, "\\/");
20
+ const selector = `${prop}-\\[${safeVal}\\]`;
21
+
22
+ if (prop.startsWith("p")) {
23
+ css += `.${selector} { padding: ${val}; }\n`;
24
+ } else if (prop.startsWith("m")) {
25
+ css += `.${selector} { margin: ${val}; }\n`;
26
+ } else if (prop === "text") {
27
+ css += `.${selector} { font-size: ${val}; }\n`;
28
+ } else if (prop === "rounded") {
29
+ css += `.${selector} { border-radius: ${val}; }\n`;
30
+ }
31
+ });
32
+ fs.writeFileSync("styles/striveui.css", css);
33
+
34
+ console.log("✅ Generated striveui.css with dynamic [value] class support.");
package/app/index.tsx CHANGED
@@ -1,2 +1,25 @@
1
- import Button from './component/Button';
2
- export { Button };
1
+ import { Button, Input, Anchor, TextArea, Select } from "./component/blocks";
2
+ import {
3
+ Card,
4
+ Table,
5
+ TableHead,
6
+ TableBody,
7
+ TableRow,
8
+ TableHeaderCell,
9
+ TableDataCell,
10
+ } from "./component/ui";
11
+
12
+ export {
13
+ Button,
14
+ Input,
15
+ Anchor,
16
+ TextArea,
17
+ Select,
18
+ Card,
19
+ Table,
20
+ TableHead,
21
+ TableBody,
22
+ TableRow,
23
+ TableHeaderCell,
24
+ TableDataCell,
25
+ };
@@ -0,0 +1,161 @@
1
+ $colors: (
2
+ blue: (50: #eff6ff,
3
+ 100: #dbeafe,
4
+ 200: #bfdbfe,
5
+ 300: #93c5fd,
6
+ 400: #60a5fa,
7
+ 500: #3b82f6,
8
+ 600: #2563eb,
9
+ 700: #1d4ed8,
10
+ 800: #1e40af,
11
+ 900: #1e3a8a),
12
+ red: (50: #fef2f2,
13
+ 100: #fee2e2,
14
+ 200: #fecaca,
15
+ 300: #fca5a5,
16
+ 400: #f87171,
17
+ 500: #ef4444,
18
+ 600: #dc2626,
19
+ 700: #b91c1c,
20
+ 800: #991b1b,
21
+ 900: #7f1d1d),
22
+ green: (50: #f0fdf4,
23
+ 100: #dcfce7,
24
+ 200: #bbf7d0,
25
+ 300: #86efac,
26
+ 400: #4ade80,
27
+ 500: #22c55e,
28
+ 600: #16a34a,
29
+ 700: #15803d,
30
+ 800: #166534,
31
+ 900: #14532d),
32
+ yellow: (50: #fefce8,
33
+ 100: #fef9c3,
34
+ 200: #fef08a,
35
+ 300: #fde047,
36
+ 400: #facc15,
37
+ 500: #eab308,
38
+ 600: #ca8a04,
39
+ 700: #a16207,
40
+ 800: #854d0e,
41
+ 900: #713f12),
42
+ orange: (50: #fff7ed,
43
+ 100: #ffedd5,
44
+ 200: #fed7aa,
45
+ 300: #fdba74,
46
+ 400: #fb923c,
47
+ 500: #f97316,
48
+ 600: #ea580c,
49
+ 700: #c2410c,
50
+ 800: #9a3412,
51
+ 900: #7c2d12,
52
+ ),
53
+ purple: (50: #faf5ff,
54
+ 100: #f3e8ff,
55
+ 200: #e9d5ff,
56
+ 300: #d8b4fe,
57
+ 400: #c084fc,
58
+ 500: #a855f7,
59
+ 600: #9333ea,
60
+ 700: #7e22ce,
61
+ 800: #6b21a8,
62
+ 900: #581c87),
63
+ pink: (50: #fdf2f8,
64
+ 100: #fce7f3,
65
+ 200: #fbcfe8,
66
+ 300: #f9a8d4,
67
+ 400: #f472b6,
68
+ 500: #ec4899,
69
+ 600: #db2777,
70
+ 700: #be185d,
71
+ 800: #9d174d,
72
+ 900: #831843),
73
+ indigo: (50: #eef2ff,
74
+ 100: #e0e7ff,
75
+ 200: #c7d2fe,
76
+ 300: #a5b4fc,
77
+ 400: #818cf8,
78
+ 500: #6366f1,
79
+ 600: #4f46e5,
80
+ 700: #4338ca,
81
+ 800: #3730a3,
82
+ 900: #312e81),
83
+ cyan: (50: #ecfeff,
84
+ 100: #cffafe,
85
+ 200: #a5f3fc,
86
+ 300: #67e8f9,
87
+ 400: #22d3ee,
88
+ 500: #06b6d4,
89
+ 600: #0891b2,
90
+ 700: #0e7490,
91
+ 800: #155e75,
92
+ 900: #164e63),
93
+ teal: (50: #f0fdfa,
94
+ 100: #ccfbf1,
95
+ 200: #99f6e4,
96
+ 300: #5eead4,
97
+ 400: #2dd4bf,
98
+ 500: #14b8a6,
99
+ 600: #0d9488,
100
+ 700: #0f766e,
101
+ 800: #115e59,
102
+ 900: #134e4a),
103
+ gray: (50: #f9fafb,
104
+ 100: #f3f4f6,
105
+ 200: #e5e7eb,
106
+ 300: #d1d5db,
107
+ 400: #9ca3af,
108
+ 500: #6b7280,
109
+ 600: #4b5563,
110
+ 700: #374151,
111
+ 800: #1f2937,
112
+ 900: #111827),
113
+ amber: (50: #fffbeb,
114
+ 100: #fef3c7,
115
+ 200: #fde68a,
116
+ 300: #fcd34d,
117
+ 400: #fbbf24,
118
+ 500: #f59e0b,
119
+ 600: #d97706,
120
+ 700: #b45309,
121
+ 800: #92400e,
122
+ 900: #78350f),
123
+ stone: (50: #fafaf9,
124
+ 100: #f5f5f4,
125
+ 200: #e7e5e4,
126
+ 300: #d6d3d1,
127
+ 400: #a8a29e,
128
+ 500: #78716c,
129
+ 600: #57534e,
130
+ 700: #44403c,
131
+ 800: #292524,
132
+ 900: #1c1917),
133
+ fuchsia: (50: #fdf4ff,
134
+ 100: #fae8ff,
135
+ 200: #f5d0fe,
136
+ 300: #f0abfc,
137
+ 400: #e879f9,
138
+ 500: #d946ef,
139
+ 600: #c026d3,
140
+ 700: #a21caf,
141
+ 800: #86198f,
142
+ 900: #701a75)
143
+ );
144
+
145
+ @each $color, $shades in $colors {
146
+ $color-name: " " + $color;
147
+
148
+ @each $shade, $hex in $shades {
149
+ .bg-#{$color-name}-#{$shade} {
150
+ background-color: #{$hex};
151
+ }
152
+
153
+ .text-#{$color-name}-#{$shade} {
154
+ color: #{$hex};
155
+ }
156
+
157
+ .border-#{$color-name}-#{$shade} {
158
+ border-color: #{$hex};
159
+ }
160
+ }
161
+ }
@@ -0,0 +1,33 @@
1
+ $spacing: (
2
+ 1: 3rem,
3
+ 2: 6rem,
4
+ 3: 9rem,
5
+ 4: 12rem,
6
+ 5: 15rem
7
+ );
8
+
9
+ @each $key, $val in $spacing {
10
+ .p-#{$key} {
11
+ padding: $val;
12
+ }
13
+
14
+ .m-#{$key} {
15
+ margin: $val;
16
+ }
17
+
18
+ .mt-#{$key} {
19
+ margin-top: $val;
20
+ }
21
+
22
+ .mb-#{$key} {
23
+ margin-bottom: $val;
24
+ }
25
+
26
+ .ml-#{$key} {
27
+ margin-left: $val;
28
+ }
29
+
30
+ .mr-#{$key} {
31
+ margin-right: $val;
32
+ }
33
+ }
@@ -0,0 +1,35 @@
1
+ $font-sizes: (
2
+ xs: 9rem,
3
+ sm: 10.5rem,
4
+ base: 12rem,
5
+ lg: 13.5rem,
6
+ xl: 15rem,
7
+ 2xl: 18rem,
8
+ 3xl: 22.5rem
9
+ );
10
+
11
+ @each $label, $size in $font-sizes {
12
+ .text-#{$label} {
13
+ font-size: $size;
14
+ }
15
+ }
16
+
17
+ .font-normal {
18
+ font-weight: 400;
19
+ }
20
+
21
+ .font-bold {
22
+ font-weight: 700;
23
+ }
24
+
25
+ .text-left {
26
+ text-align: left;
27
+ }
28
+
29
+ .text-center {
30
+ text-align: center;
31
+ }
32
+
33
+ .text-right {
34
+ text-align: right;
35
+ }
@@ -0,0 +1,169 @@
1
+ @use './colors' as *;
2
+ @use './spacing' as *;
3
+ @use './typography' as *;
4
+
5
+ $gridColumns: (
6
+ 1: repeat(1, 1fr),
7
+ 2: repeat(2, 1fr),
8
+ 3: repeat(3, 1fr),
9
+ 4: repeat(4, 1fr),
10
+ 5: repeat(5, 1fr),
11
+ 6: repeat(6, 1fr),
12
+ 7: repeat(7, 1fr),
13
+ 8: repeat(8, 1fr),
14
+ 9: repeat(9, 1fr),
15
+ 10: repeat(10, 1fr),
16
+ 11: repeat(11, 1fr),
17
+ 12: repeat(12, 1fr)
18
+ );
19
+
20
+ .grid {
21
+ display: grid;
22
+ }
23
+
24
+ @each $number , $columns in $gridColumns {
25
+ .grid-cols-#{$number} {
26
+ grid-template-columns: #{$columns};
27
+ }
28
+
29
+ .col-span-#{$number} {
30
+ grid-column: span #{$number} / span #{$number};
31
+ }
32
+
33
+ .row-span-#{$number} {
34
+ grid-row: span #{$number} / span #{$number};
35
+ }
36
+ }
37
+
38
+ /* === Grid Alignment === */
39
+ .place-items-start {
40
+ place-items: start;
41
+ }
42
+
43
+ .place-items-center {
44
+ place-items: center;
45
+ }
46
+
47
+ .place-items-end {
48
+ place-items: end;
49
+ }
50
+
51
+ /* === Flex Display === */
52
+ .flex {
53
+ display: flex;
54
+ }
55
+
56
+ .inline-flex {
57
+ display: inline-flex;
58
+ }
59
+
60
+ /* === Flex Direction === */
61
+ .flex-row {
62
+ flex-direction: row;
63
+ }
64
+
65
+ .flex-col {
66
+ flex-direction: column;
67
+ }
68
+
69
+ /* === Flex Wrap === */
70
+ .flex-wrap {
71
+ flex-wrap: wrap;
72
+ }
73
+
74
+ .flex-nowrap {
75
+ flex-wrap: nowrap;
76
+ }
77
+
78
+ /* === Flex Grow/Shrink === */
79
+ .flex-1 {
80
+ flex: 1 1 0%;
81
+ }
82
+
83
+ .flex-grow {
84
+ flex-grow: 1;
85
+ }
86
+
87
+ .flex-shrink {
88
+ flex-shrink: 1;
89
+ }
90
+
91
+ /* === Flex Basis === */
92
+ .basis-1_2 {
93
+ flex-basis: 50%;
94
+ }
95
+
96
+ .basis-1_3 {
97
+ flex-basis: 33.3333%;
98
+ }
99
+
100
+ .basis-2_3 {
101
+ flex-basis: 66.6667%;
102
+ }
103
+
104
+ .basis-1_4 {
105
+ flex-basis: 25%;
106
+ }
107
+
108
+ .basis-3_4 {
109
+ flex-basis: 75%;
110
+ }
111
+
112
+ .basis-full {
113
+ flex-basis: 100%;
114
+ }
115
+
116
+ /* === Flex Justify === */
117
+ .justify-start {
118
+ justify-content: flex-start;
119
+ }
120
+
121
+ .justify-center {
122
+ justify-content: center;
123
+ }
124
+
125
+ .justify-end {
126
+ justify-content: flex-end;
127
+ }
128
+
129
+ .justify-between {
130
+ justify-content: space-between;
131
+ }
132
+
133
+ .justify-around {
134
+ justify-content: space-around;
135
+ }
136
+
137
+ .justify-evenly {
138
+ justify-content: space-evenly;
139
+ }
140
+
141
+ /* === Flex Align Items === */
142
+ .items-start {
143
+ align-items: flex-start;
144
+ }
145
+
146
+ .items-center {
147
+ align-items: center;
148
+ }
149
+
150
+ .items-end {
151
+ align-items: flex-end;
152
+ }
153
+
154
+ .items-stretch {
155
+ align-items: stretch;
156
+ }
157
+
158
+ /* === Flex Align Self === */
159
+ .self-start {
160
+ align-self: flex-start;
161
+ }
162
+
163
+ .self-center {
164
+ align-self: center;
165
+ }
166
+
167
+ .self-end {
168
+ align-self: flex-end;
169
+ }