@twreporter/react-typescript-components 0.1.0-beta.3

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/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # @twreporter/react-typescript-components
2
+
3
+ React components built with TypeScript and Tailwind CSS.
4
+
5
+ ## Roadmap
6
+
7
+ - [ ] add storybook
8
+ - [ ] add test
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ yarn add @twreporter/react-typescript-components
14
+ # or
15
+ npm install @twreporter/react-typescript-components
16
+ ```
17
+
18
+ ## Peer Dependencies
19
+
20
+ Make sure your project has the following peer dependencies installed:
21
+
22
+ - react ^19.0.0
23
+ - react-dom ^19.0.0
24
+ - tailwindcss ^4.1.11
25
+
26
+ ## Usage
27
+
28
+ ```tsx
29
+ import { Title2 } from '@twreporter/react-typescript-components/lib/title-bar'
30
+
31
+ function App() {
32
+ return (
33
+ <Title2 title="Title" subtitle="Subtitle" />
34
+ )
35
+ }
36
+ ```
37
+
38
+ ## Development & Build
39
+
40
+ ```bash
41
+ yarn build
42
+ ```
43
+
44
+ The output files will be generated in the `lib/` directory.
45
+
46
+ ## License
47
+
48
+ MIT
package/lib/styles.css ADDED
@@ -0,0 +1,301 @@
1
+ /*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */
2
+ @layer properties;
3
+ @layer theme, base, components, utilities;
4
+ @layer theme {
5
+ :root, :host {
6
+ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
7
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
8
+ --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
9
+ "Courier New", monospace;
10
+ --color-gray-600: #808080;
11
+ --color-gray-800: #404040;
12
+ --spacing: 0.25rem;
13
+ --font-weight-bold: 700;
14
+ --default-font-family: var(--font-sans);
15
+ --default-mono-font-family: var(--font-mono);
16
+ --font-title: 'merriweather', 'source-han-serif-tc', serif;
17
+ --font-default: 'Roboto Slab', 'Noto Sans TC', sans-serif, 'Tauhu Oo';
18
+ }
19
+ }
20
+ @layer base {
21
+ *, ::after, ::before, ::backdrop, ::file-selector-button {
22
+ box-sizing: border-box;
23
+ margin: 0;
24
+ padding: 0;
25
+ border: 0 solid;
26
+ }
27
+ html, :host {
28
+ line-height: 1.5;
29
+ -webkit-text-size-adjust: 100%;
30
+ tab-size: 4;
31
+ font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
32
+ font-feature-settings: var(--default-font-feature-settings, normal);
33
+ font-variation-settings: var(--default-font-variation-settings, normal);
34
+ -webkit-tap-highlight-color: transparent;
35
+ }
36
+ hr {
37
+ height: 0;
38
+ color: inherit;
39
+ border-top-width: 1px;
40
+ }
41
+ abbr:where([title]) {
42
+ -webkit-text-decoration: underline dotted;
43
+ text-decoration: underline dotted;
44
+ }
45
+ h1, h2, h3, h4, h5, h6 {
46
+ font-size: inherit;
47
+ font-weight: inherit;
48
+ }
49
+ a {
50
+ color: inherit;
51
+ -webkit-text-decoration: inherit;
52
+ text-decoration: inherit;
53
+ }
54
+ b, strong {
55
+ font-weight: bolder;
56
+ }
57
+ code, kbd, samp, pre {
58
+ font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
59
+ font-feature-settings: var(--default-mono-font-feature-settings, normal);
60
+ font-variation-settings: var(--default-mono-font-variation-settings, normal);
61
+ font-size: 1em;
62
+ }
63
+ small {
64
+ font-size: 80%;
65
+ }
66
+ sub, sup {
67
+ font-size: 75%;
68
+ line-height: 0;
69
+ position: relative;
70
+ vertical-align: baseline;
71
+ }
72
+ sub {
73
+ bottom: -0.25em;
74
+ }
75
+ sup {
76
+ top: -0.5em;
77
+ }
78
+ table {
79
+ text-indent: 0;
80
+ border-color: inherit;
81
+ border-collapse: collapse;
82
+ }
83
+ :-moz-focusring {
84
+ outline: auto;
85
+ }
86
+ progress {
87
+ vertical-align: baseline;
88
+ }
89
+ summary {
90
+ display: list-item;
91
+ }
92
+ ol, ul, menu {
93
+ list-style: none;
94
+ }
95
+ img, svg, video, canvas, audio, iframe, embed, object {
96
+ display: block;
97
+ vertical-align: middle;
98
+ }
99
+ img, video {
100
+ max-width: 100%;
101
+ height: auto;
102
+ }
103
+ button, input, select, optgroup, textarea, ::file-selector-button {
104
+ font: inherit;
105
+ font-feature-settings: inherit;
106
+ font-variation-settings: inherit;
107
+ letter-spacing: inherit;
108
+ color: inherit;
109
+ border-radius: 0;
110
+ background-color: transparent;
111
+ opacity: 1;
112
+ }
113
+ :where(select:is([multiple], [size])) optgroup {
114
+ font-weight: bolder;
115
+ }
116
+ :where(select:is([multiple], [size])) optgroup option {
117
+ padding-inline-start: 20px;
118
+ }
119
+ ::file-selector-button {
120
+ margin-inline-end: 4px;
121
+ }
122
+ ::placeholder {
123
+ opacity: 1;
124
+ }
125
+ @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
126
+ ::placeholder {
127
+ color: currentcolor;
128
+ @supports (color: color-mix(in lab, red, red)) {
129
+ color: color-mix(in oklab, currentcolor 50%, transparent);
130
+ }
131
+ }
132
+ }
133
+ textarea {
134
+ resize: vertical;
135
+ }
136
+ ::-webkit-search-decoration {
137
+ -webkit-appearance: none;
138
+ }
139
+ ::-webkit-date-and-time-value {
140
+ min-height: 1lh;
141
+ text-align: inherit;
142
+ }
143
+ ::-webkit-datetime-edit {
144
+ display: inline-flex;
145
+ }
146
+ ::-webkit-datetime-edit-fields-wrapper {
147
+ padding: 0;
148
+ }
149
+ ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
150
+ padding-block: 0;
151
+ }
152
+ :-moz-ui-invalid {
153
+ box-shadow: none;
154
+ }
155
+ button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {
156
+ appearance: button;
157
+ }
158
+ ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
159
+ height: auto;
160
+ }
161
+ [hidden]:where(:not([hidden="until-found"])) {
162
+ display: none !important;
163
+ }
164
+ }
165
+ @layer utilities {
166
+ .m-0 {
167
+ margin: calc(var(--spacing) * 0);
168
+ }
169
+ .mt-\[8px\] {
170
+ margin-top: 8px;
171
+ }
172
+ .flex {
173
+ display: flex;
174
+ }
175
+ .h-\[1px\] {
176
+ height: 1px;
177
+ }
178
+ .w-full {
179
+ width: 100%;
180
+ }
181
+ .flex-col {
182
+ flex-direction: column;
183
+ }
184
+ .items-baseline {
185
+ align-items: baseline;
186
+ }
187
+ .items-center {
188
+ align-items: center;
189
+ }
190
+ .justify-between {
191
+ justify-content: space-between;
192
+ }
193
+ .gap-\[16px\] {
194
+ gap: 16px;
195
+ }
196
+ .bg-gray-800 {
197
+ background-color: var(--color-gray-800);
198
+ }
199
+ .font-default {
200
+ font-family: var(--font-default);
201
+ }
202
+ .font-title {
203
+ font-family: var(--font-title);
204
+ }
205
+ .text-\[10px\] {
206
+ font-size: 10px;
207
+ }
208
+ .text-\[12px\] {
209
+ font-size: 12px;
210
+ }
211
+ .text-\[14px\] {
212
+ font-size: 14px;
213
+ }
214
+ .text-\[16px\] {
215
+ font-size: 16px;
216
+ }
217
+ .text-\[17px\] {
218
+ font-size: 17px;
219
+ }
220
+ .text-\[18px\] {
221
+ font-size: 18px;
222
+ }
223
+ .text-\[22px\] {
224
+ font-size: 22px;
225
+ }
226
+ .text-\[24px\] {
227
+ font-size: 24px;
228
+ }
229
+ .text-\[28px\] {
230
+ font-size: 28px;
231
+ }
232
+ .leading-\[125\%\] {
233
+ --tw-leading: 125%;
234
+ line-height: 125%;
235
+ }
236
+ .leading-\[150\%\] {
237
+ --tw-leading: 150%;
238
+ line-height: 150%;
239
+ }
240
+ .font-bold {
241
+ --tw-font-weight: var(--font-weight-bold);
242
+ font-weight: var(--font-weight-bold);
243
+ }
244
+ .text-gray-600 {
245
+ color: var(--color-gray-600);
246
+ }
247
+ .text-gray-800 {
248
+ color: var(--color-gray-800);
249
+ }
250
+ .tablet\:text-\[16px\] {
251
+ @media (width >= 768px) {
252
+ font-size: 16px;
253
+ }
254
+ }
255
+ .tablet\:text-\[18px\] {
256
+ @media (width >= 768px) {
257
+ font-size: 18px;
258
+ }
259
+ }
260
+ .tablet\:text-\[22px\] {
261
+ @media (width >= 768px) {
262
+ font-size: 22px;
263
+ }
264
+ }
265
+ .tablet\:text-\[28px\] {
266
+ @media (width >= 768px) {
267
+ font-size: 28px;
268
+ }
269
+ }
270
+ .tablet\:text-\[32px\] {
271
+ @media (width >= 768px) {
272
+ font-size: 32px;
273
+ }
274
+ }
275
+ .tablet\:text-\[36px\] {
276
+ @media (width >= 768px) {
277
+ font-size: 36px;
278
+ }
279
+ }
280
+ .desktop\:mt-\[16px\] {
281
+ @media (width >= 1024px) {
282
+ margin-top: 16px;
283
+ }
284
+ }
285
+ }
286
+ @property --tw-leading {
287
+ syntax: "*";
288
+ inherits: false;
289
+ }
290
+ @property --tw-font-weight {
291
+ syntax: "*";
292
+ inherits: false;
293
+ }
294
+ @layer properties {
295
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
296
+ *, ::before, ::after, ::backdrop {
297
+ --tw-leading: initial;
298
+ --tw-font-weight: initial;
299
+ }
300
+ }
301
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/text/enum/index.ts
21
+ var enum_exports = {};
22
+ __export(enum_exports, {
23
+ TYPE: () => TYPE,
24
+ WEIGHT: () => WEIGHT
25
+ });
26
+ module.exports = __toCommonJS(enum_exports);
27
+ var TYPE = {
28
+ default: "default",
29
+ article: "article"
30
+ };
31
+ var WEIGHT = {
32
+ extraLight: "extra-light",
33
+ normal: "normal",
34
+ bold: "bold"
35
+ };
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ TYPE,
39
+ WEIGHT
40
+ });
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/text/heading.tsx
31
+ var heading_exports = {};
32
+ __export(heading_exports, {
33
+ H1: () => H1,
34
+ H2: () => H2,
35
+ H3: () => H3,
36
+ H4: () => H4,
37
+ H5: () => H5,
38
+ H6: () => H6
39
+ });
40
+ module.exports = __toCommonJS(heading_exports);
41
+ var import_clsx = __toESM(require("clsx"));
42
+ var import_react = __toESM(require("react"));
43
+
44
+ // src/text/enum/index.ts
45
+ var TYPE = {
46
+ default: "default",
47
+ article: "article"
48
+ };
49
+
50
+ // src/text/heading.tsx
51
+ var baseClass = "font-bold";
52
+ var variantClass = {
53
+ H1: "text-[28px] leading-[125%] tablet:text-[36px]",
54
+ H2: "text-[24px] leading-[125%] tablet:text-[32px]",
55
+ H3: "text-[22px] leading-[150%] tablet:text-[28px]",
56
+ H4: "text-[18px] leading-[150%] tablet:text-[22px]",
57
+ H5: "text-[17px] leading-[150%] tablet:text-[18px]",
58
+ H6: "text-[16px] leading-[150%] tablet:text-[16px]"
59
+ };
60
+ var HeadingVariant = (variant) => {
61
+ const Component = ({
62
+ text = "",
63
+ type = TYPE.default,
64
+ className = "",
65
+ ...props
66
+ }) => {
67
+ const htmlTag = variant.toLowerCase();
68
+ const fontFamily = type === TYPE.article ? "font-title" : "font-default";
69
+ return import_react.default.createElement(
70
+ htmlTag,
71
+ {
72
+ className: (0, import_clsx.default)(
73
+ fontFamily,
74
+ baseClass,
75
+ variantClass[variant],
76
+ className
77
+ ),
78
+ ...props
79
+ },
80
+ text
81
+ );
82
+ };
83
+ Component.displayName = variant;
84
+ Component.Type = TYPE;
85
+ return Component;
86
+ };
87
+ var H1 = HeadingVariant("H1");
88
+ var H2 = HeadingVariant("H2");
89
+ var H3 = HeadingVariant("H3");
90
+ var H4 = HeadingVariant("H4");
91
+ var H5 = HeadingVariant("H5");
92
+ var H6 = HeadingVariant("H6");
93
+ // Annotate the CommonJS export names for ESM import in node:
94
+ 0 && (module.exports = {
95
+ H1,
96
+ H2,
97
+ H3,
98
+ H4,
99
+ H5,
100
+ H6
101
+ });
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/text/paragraph.tsx
31
+ var paragraph_exports = {};
32
+ __export(paragraph_exports, {
33
+ P1: () => P1,
34
+ P2: () => P2,
35
+ P3: () => P3,
36
+ P4: () => P4
37
+ });
38
+ module.exports = __toCommonJS(paragraph_exports);
39
+ var import_clsx = __toESM(require("clsx"));
40
+
41
+ // src/text/enum/index.ts
42
+ var WEIGHT = {
43
+ extraLight: "extra-light",
44
+ normal: "normal",
45
+ bold: "bold"
46
+ };
47
+
48
+ // src/text/paragraph.tsx
49
+ var import_jsx_runtime = require("react/jsx-runtime");
50
+ var baseClass = "font-default leading-[150%] flex items-center m-0";
51
+ var variantClass = {
52
+ P1: "text-[16px]",
53
+ P2: "text-[14px]",
54
+ P3: "text-[12px]",
55
+ P4: "text-[10px]"
56
+ };
57
+ var ParagraphVariant = (variant) => {
58
+ const Component = ({
59
+ text = "",
60
+ weight = WEIGHT.normal,
61
+ className = "",
62
+ ...props
63
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
64
+ "p",
65
+ {
66
+ className: (0, import_clsx.default)(
67
+ baseClass,
68
+ variantClass[variant],
69
+ `font-${weight}`,
70
+ className
71
+ ),
72
+ ...props,
73
+ children: text
74
+ }
75
+ );
76
+ Component.displayName = variant;
77
+ Component.Weight = WEIGHT;
78
+ return Component;
79
+ };
80
+ var P1 = ParagraphVariant("P1");
81
+ var P2 = ParagraphVariant("P2");
82
+ var P3 = ParagraphVariant("P3");
83
+ var P4 = ParagraphVariant("P4");
84
+ // Annotate the CommonJS export names for ESM import in node:
85
+ 0 && (module.exports = {
86
+ P1,
87
+ P2,
88
+ P3,
89
+ P4
90
+ });
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/title-bar/components/title2.tsx
31
+ var title2_exports = {};
32
+ __export(title2_exports, {
33
+ default: () => title2_default
34
+ });
35
+ module.exports = __toCommonJS(title2_exports);
36
+ var import_clsx3 = __toESM(require("clsx"));
37
+
38
+ // src/text/heading.tsx
39
+ var import_clsx = __toESM(require("clsx"));
40
+ var import_react = __toESM(require("react"));
41
+
42
+ // src/text/enum/index.ts
43
+ var TYPE = {
44
+ default: "default",
45
+ article: "article"
46
+ };
47
+ var WEIGHT = {
48
+ extraLight: "extra-light",
49
+ normal: "normal",
50
+ bold: "bold"
51
+ };
52
+
53
+ // src/text/heading.tsx
54
+ var baseClass = "font-bold";
55
+ var variantClass = {
56
+ H1: "text-[28px] leading-[125%] tablet:text-[36px]",
57
+ H2: "text-[24px] leading-[125%] tablet:text-[32px]",
58
+ H3: "text-[22px] leading-[150%] tablet:text-[28px]",
59
+ H4: "text-[18px] leading-[150%] tablet:text-[22px]",
60
+ H5: "text-[17px] leading-[150%] tablet:text-[18px]",
61
+ H6: "text-[16px] leading-[150%] tablet:text-[16px]"
62
+ };
63
+ var HeadingVariant = (variant) => {
64
+ const Component = ({
65
+ text = "",
66
+ type = TYPE.default,
67
+ className = "",
68
+ ...props
69
+ }) => {
70
+ const htmlTag = variant.toLowerCase();
71
+ const fontFamily = type === TYPE.article ? "font-title" : "font-default";
72
+ return import_react.default.createElement(
73
+ htmlTag,
74
+ {
75
+ className: (0, import_clsx.default)(
76
+ fontFamily,
77
+ baseClass,
78
+ variantClass[variant],
79
+ className
80
+ ),
81
+ ...props
82
+ },
83
+ text
84
+ );
85
+ };
86
+ Component.displayName = variant;
87
+ Component.Type = TYPE;
88
+ return Component;
89
+ };
90
+ var H1 = HeadingVariant("H1");
91
+ var H2 = HeadingVariant("H2");
92
+ var H3 = HeadingVariant("H3");
93
+ var H4 = HeadingVariant("H4");
94
+ var H5 = HeadingVariant("H5");
95
+ var H6 = HeadingVariant("H6");
96
+
97
+ // src/text/paragraph.tsx
98
+ var import_clsx2 = __toESM(require("clsx"));
99
+ var import_jsx_runtime = require("react/jsx-runtime");
100
+ var baseClass2 = "font-default leading-[150%] flex items-center m-0";
101
+ var variantClass2 = {
102
+ P1: "text-[16px]",
103
+ P2: "text-[14px]",
104
+ P3: "text-[12px]",
105
+ P4: "text-[10px]"
106
+ };
107
+ var ParagraphVariant = (variant) => {
108
+ const Component = ({
109
+ text = "",
110
+ weight = WEIGHT.normal,
111
+ className = "",
112
+ ...props
113
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
114
+ "p",
115
+ {
116
+ className: (0, import_clsx2.default)(
117
+ baseClass2,
118
+ variantClass2[variant],
119
+ `font-${weight}`,
120
+ className
121
+ ),
122
+ ...props,
123
+ children: text
124
+ }
125
+ );
126
+ Component.displayName = variant;
127
+ Component.Weight = WEIGHT;
128
+ return Component;
129
+ };
130
+ var P1 = ParagraphVariant("P1");
131
+ var P2 = ParagraphVariant("P2");
132
+ var P3 = ParagraphVariant("P3");
133
+ var P4 = ParagraphVariant("P4");
134
+
135
+ // src/title-bar/components/title2.tsx
136
+ var import_jsx_runtime2 = require("react/jsx-runtime");
137
+ var Title2 = ({
138
+ title,
139
+ subtitle = "",
140
+ renderButton = null,
141
+ className = ""
142
+ }) => {
143
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: (0, import_clsx3.default)("flex justify-between flex-col", className), children: [
144
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: (0, import_clsx3.default)("flex items-baseline gap-[16px]"), children: [
145
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(H5, { className: "text-gray-800", text: title }),
146
+ subtitle ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(P2, { className: "text-gray-600", text: subtitle }) : null
147
+ ] }),
148
+ renderButton || null,
149
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
150
+ "div",
151
+ {
152
+ className: (0, import_clsx3.default)(
153
+ "w-full h-[1px] bg-gray-800 mt-[8px]",
154
+ "desktop:mt-[16px]"
155
+ )
156
+ }
157
+ )
158
+ ] });
159
+ };
160
+ var title2_default = Title2;
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/title-bar/index.ts
31
+ var title_bar_exports = {};
32
+ __export(title_bar_exports, {
33
+ Title2: () => title2_default,
34
+ default: () => title_bar_default
35
+ });
36
+ module.exports = __toCommonJS(title_bar_exports);
37
+
38
+ // src/title-bar/components/title2.tsx
39
+ var import_clsx3 = __toESM(require("clsx"));
40
+
41
+ // src/text/heading.tsx
42
+ var import_clsx = __toESM(require("clsx"));
43
+ var import_react = __toESM(require("react"));
44
+
45
+ // src/text/enum/index.ts
46
+ var TYPE = {
47
+ default: "default",
48
+ article: "article"
49
+ };
50
+ var WEIGHT = {
51
+ extraLight: "extra-light",
52
+ normal: "normal",
53
+ bold: "bold"
54
+ };
55
+
56
+ // src/text/heading.tsx
57
+ var baseClass = "font-bold";
58
+ var variantClass = {
59
+ H1: "text-[28px] leading-[125%] tablet:text-[36px]",
60
+ H2: "text-[24px] leading-[125%] tablet:text-[32px]",
61
+ H3: "text-[22px] leading-[150%] tablet:text-[28px]",
62
+ H4: "text-[18px] leading-[150%] tablet:text-[22px]",
63
+ H5: "text-[17px] leading-[150%] tablet:text-[18px]",
64
+ H6: "text-[16px] leading-[150%] tablet:text-[16px]"
65
+ };
66
+ var HeadingVariant = (variant) => {
67
+ const Component = ({
68
+ text = "",
69
+ type = TYPE.default,
70
+ className = "",
71
+ ...props
72
+ }) => {
73
+ const htmlTag = variant.toLowerCase();
74
+ const fontFamily = type === TYPE.article ? "font-title" : "font-default";
75
+ return import_react.default.createElement(
76
+ htmlTag,
77
+ {
78
+ className: (0, import_clsx.default)(
79
+ fontFamily,
80
+ baseClass,
81
+ variantClass[variant],
82
+ className
83
+ ),
84
+ ...props
85
+ },
86
+ text
87
+ );
88
+ };
89
+ Component.displayName = variant;
90
+ Component.Type = TYPE;
91
+ return Component;
92
+ };
93
+ var H1 = HeadingVariant("H1");
94
+ var H2 = HeadingVariant("H2");
95
+ var H3 = HeadingVariant("H3");
96
+ var H4 = HeadingVariant("H4");
97
+ var H5 = HeadingVariant("H5");
98
+ var H6 = HeadingVariant("H6");
99
+
100
+ // src/text/paragraph.tsx
101
+ var import_clsx2 = __toESM(require("clsx"));
102
+ var import_jsx_runtime = require("react/jsx-runtime");
103
+ var baseClass2 = "font-default leading-[150%] flex items-center m-0";
104
+ var variantClass2 = {
105
+ P1: "text-[16px]",
106
+ P2: "text-[14px]",
107
+ P3: "text-[12px]",
108
+ P4: "text-[10px]"
109
+ };
110
+ var ParagraphVariant = (variant) => {
111
+ const Component = ({
112
+ text = "",
113
+ weight = WEIGHT.normal,
114
+ className = "",
115
+ ...props
116
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
117
+ "p",
118
+ {
119
+ className: (0, import_clsx2.default)(
120
+ baseClass2,
121
+ variantClass2[variant],
122
+ `font-${weight}`,
123
+ className
124
+ ),
125
+ ...props,
126
+ children: text
127
+ }
128
+ );
129
+ Component.displayName = variant;
130
+ Component.Weight = WEIGHT;
131
+ return Component;
132
+ };
133
+ var P1 = ParagraphVariant("P1");
134
+ var P2 = ParagraphVariant("P2");
135
+ var P3 = ParagraphVariant("P3");
136
+ var P4 = ParagraphVariant("P4");
137
+
138
+ // src/title-bar/components/title2.tsx
139
+ var import_jsx_runtime2 = require("react/jsx-runtime");
140
+ var Title2 = ({
141
+ title,
142
+ subtitle = "",
143
+ renderButton = null,
144
+ className = ""
145
+ }) => {
146
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: (0, import_clsx3.default)("flex justify-between flex-col", className), children: [
147
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: (0, import_clsx3.default)("flex items-baseline gap-[16px]"), children: [
148
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(H5, { className: "text-gray-800", text: title }),
149
+ subtitle ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(P2, { className: "text-gray-600", text: subtitle }) : null
150
+ ] }),
151
+ renderButton || null,
152
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
153
+ "div",
154
+ {
155
+ className: (0, import_clsx3.default)(
156
+ "w-full h-[1px] bg-gray-800 mt-[8px]",
157
+ "desktop:mt-[16px]"
158
+ )
159
+ }
160
+ )
161
+ ] });
162
+ };
163
+ var title2_default = Title2;
164
+
165
+ // src/title-bar/index.ts
166
+ var title_bar_default = {
167
+ Title2: title2_default
168
+ };
169
+ // Annotate the CommonJS export names for ESM import in node:
170
+ 0 && (module.exports = {
171
+ Title2
172
+ });
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types/index.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@twreporter/react-typescript-components",
3
+ "description": "React components using TypeScript and Tailwind CSS",
4
+ "author": "twreporter <developer@twreporter.org>",
5
+ "license": "MIT",
6
+ "version": "0.1.0-beta.3",
7
+ "type": "commonjs",
8
+ "main": "lib/index.js",
9
+ "module": "lib/index.mjs",
10
+ "types": "lib/index.d.ts",
11
+ "scripts": {
12
+ "clean": "rm -rf lib",
13
+ "build:styles": "tailwindcss -i ./src/styles.css -o ./lib/styles.css",
14
+ "build:components": "tsup src/* --outDir lib",
15
+ "build": "yarn clean && yarn build:components && yarn build:styles",
16
+ "prepublishOnly": "yarn build"
17
+ },
18
+ "peerDependencies": {
19
+ "react": "^19.0.0",
20
+ "react-dom": "^19.0.0",
21
+ "tailwindcss": "^4.1.11"
22
+ },
23
+ "dependencies": {
24
+ "clsx": "^2.1.1"
25
+ },
26
+ "devDependencies": {
27
+ "@tailwindcss/cli": "^4.1.11",
28
+ "@tailwindcss/postcss": "^4.1.11",
29
+ "@twreporter/tailwind-config": "^0.1.0-beta.3",
30
+ "@types/react": "^19",
31
+ "@types/react-dom": "^19",
32
+ "autoprefixer": "^10.4.21",
33
+ "tsup": "^8.5.0",
34
+ "typescript": "^5"
35
+ },
36
+ "files": [
37
+ "lib"
38
+ ],
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/twreporter/www-public-monorepo.git",
42
+ "directory": "packages/react-typescript-components"
43
+ }
44
+ }