@exem-ui/tailwindcss3 0.0.0-next-20260227030322
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.en.md +102 -0
- package/README.md +119 -0
- package/dist/chunk-GQI4KKR5.mjs +96 -0
- package/dist/chunk-GQI4KKR5.mjs.map +1 -0
- package/dist/index.d.mts +33 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +105 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -0
- package/dist/preset.d.mts +21 -0
- package/dist/preset.d.ts +21 -0
- package/dist/preset.js +109 -0
- package/dist/preset.js.map +1 -0
- package/dist/preset.mjs +12 -0
- package/dist/preset.mjs.map +1 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2025 EXEM Corporation
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">@exem-ui/tailwindcss3</h1>
|
|
3
|
+
<p align="center">Tailwind CSS v3 plugin for the EXEM Design System</p>
|
|
4
|
+
</p>
|
|
5
|
+
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://www.npmjs.com/package/@exem-ui/tailwindcss3"><img src="https://img.shields.io/npm/v/@exem-ui/tailwindcss3?style=flat-square&color=blue" alt="npm version" /></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/@exem-ui/tailwindcss3"><img src="https://img.shields.io/npm/dm/@exem-ui/tailwindcss3?style=flat-square" alt="npm downloads" /></a>
|
|
9
|
+
<img src="https://img.shields.io/badge/Tailwind_CSS-3-06B6D4?style=flat-square&logo=tailwindcss&logoColor=white" alt="Tailwind CSS" />
|
|
10
|
+
<img src="https://img.shields.io/badge/TypeScript-5.3-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript" />
|
|
11
|
+
<a href="https://github.com/CloudMOA/exem-ui/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green?style=flat-square" alt="license" /></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
English | <a href="./README.md">한국어</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Introduction
|
|
21
|
+
|
|
22
|
+
`@exem-ui/tailwindcss3` is a plugin that brings the EXEM Design System's colors, radii, shadows, and more directly into your Tailwind CSS v3 project. Apply the full EXEM theme with a single line using the Preset approach.
|
|
23
|
+
|
|
24
|
+
## Key Features
|
|
25
|
+
|
|
26
|
+
- **Preset-based Setup** — Apply the full theme with one line in `tailwind.config`
|
|
27
|
+
- **450+ Design Tokens** — Colors, radii, shadows, breakpoints auto-mapped
|
|
28
|
+
- **CSS Variable Sync** — Automatically synchronized with `@exem-ui/core` CSS custom properties
|
|
29
|
+
- **Zero Runtime** — Processed at build time with no runtime overhead
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# npm
|
|
35
|
+
npm install @exem-ui/tailwindcss3 @exem-ui/core
|
|
36
|
+
|
|
37
|
+
# pnpm
|
|
38
|
+
pnpm add @exem-ui/tailwindcss3 @exem-ui/core
|
|
39
|
+
|
|
40
|
+
# yarn
|
|
41
|
+
yarn add @exem-ui/tailwindcss3 @exem-ui/core
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Prerequisites
|
|
45
|
+
|
|
46
|
+
- Tailwind CSS >= 3.0.0
|
|
47
|
+
|
|
48
|
+
## Usage
|
|
49
|
+
|
|
50
|
+
### Preset (Recommended)
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
// tailwind.config.ts
|
|
54
|
+
import { exemPreset } from '@exem-ui/tailwindcss3/preset';
|
|
55
|
+
|
|
56
|
+
export default {
|
|
57
|
+
presets: [exemPreset],
|
|
58
|
+
content: ['./src/**/*.{ts,tsx}'],
|
|
59
|
+
};
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Plugin
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
// tailwind.config.ts
|
|
66
|
+
import { exemPlugin } from '@exem-ui/tailwindcss3';
|
|
67
|
+
|
|
68
|
+
export default {
|
|
69
|
+
plugins: [exemPlugin],
|
|
70
|
+
content: ['./src/**/*.{ts,tsx}'],
|
|
71
|
+
};
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Using Tailwind Utilities
|
|
75
|
+
|
|
76
|
+
```html
|
|
77
|
+
<!-- Use EXEM design tokens as Tailwind classes -->
|
|
78
|
+
<div class="bg-solid-accent-default text-text-inverse rounded-medium shadow-medium">
|
|
79
|
+
EXEM styled content
|
|
80
|
+
</div>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Export Map
|
|
84
|
+
|
|
85
|
+
| Path | Description |
|
|
86
|
+
|------|-------------|
|
|
87
|
+
| `@exem-ui/tailwindcss3` | Main entry (plugin) |
|
|
88
|
+
| `@exem-ui/tailwindcss3/preset` | Tailwind Preset |
|
|
89
|
+
|
|
90
|
+
## Related Packages
|
|
91
|
+
|
|
92
|
+
| Package | Description |
|
|
93
|
+
|---------|-------------|
|
|
94
|
+
| [@exem-ui/core](https://www.npmjs.com/package/@exem-ui/core) | Design tokens, CSS variables |
|
|
95
|
+
| [@exem-ui/react](https://www.npmjs.com/package/@exem-ui/react) | React UI components |
|
|
96
|
+
| [@exem-ui/tailwindcss4](https://www.npmjs.com/package/@exem-ui/tailwindcss4) | Tailwind CSS v4 theme |
|
|
97
|
+
|
|
98
|
+
## License
|
|
99
|
+
|
|
100
|
+
Apache License 2.0 - Copyright 2026 Exem Co., Ltd.
|
|
101
|
+
|
|
102
|
+
See [LICENSE](https://github.com/CloudMOA/exem-ui/blob/main/LICENSE) for details.
|
package/README.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">@exem-ui/tailwindcss3</h1>
|
|
3
|
+
<p align="center">EXEM 디자인 시스템을 위한 Tailwind CSS v3 플러그인</p>
|
|
4
|
+
</p>
|
|
5
|
+
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://www.npmjs.com/package/@exem-ui/tailwindcss3"><img src="https://img.shields.io/npm/v/@exem-ui/tailwindcss3?style=flat-square&color=blue" alt="npm version" /></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/@exem-ui/tailwindcss3"><img src="https://img.shields.io/npm/dm/@exem-ui/tailwindcss3?style=flat-square" alt="npm downloads" /></a>
|
|
9
|
+
<img src="https://img.shields.io/badge/Tailwind_CSS-3-06B6D4?style=flat-square&logo=tailwindcss&logoColor=white" alt="Tailwind CSS" />
|
|
10
|
+
<img src="https://img.shields.io/badge/TypeScript-5.3-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript" />
|
|
11
|
+
<a href="https://github.com/CloudMOA/exem-ui/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green?style=flat-square" alt="license" /></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="./README.en.md">English</a> | 한국어
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 소개
|
|
21
|
+
|
|
22
|
+
`@exem-ui/tailwindcss3`는 EXEM 디자인 시스템의 색상, 반경, 그림자 등을 Tailwind CSS v3 프로젝트에서 바로 사용할 수 있게 해주는 플러그인입니다. Preset 방식으로 한 줄 설정만으로 EXEM 테마를 적용할 수 있습니다.
|
|
23
|
+
|
|
24
|
+
## 주요 특징
|
|
25
|
+
|
|
26
|
+
- **Preset 기반 설정** — `tailwind.config`에 한 줄 추가로 전체 테마 적용
|
|
27
|
+
- **450+ 디자인 토큰** — 색상, 반경, 그림자, 브레이크포인트 자동 매핑
|
|
28
|
+
- **CSS 변수 연동** — `@exem-ui/core`의 CSS 커스텀 프로퍼티와 자동 동기화
|
|
29
|
+
- **Zero Runtime** — 빌드 타임에 처리되어 런타임 오버헤드 없음
|
|
30
|
+
|
|
31
|
+
## 설치
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# npm
|
|
35
|
+
npm install @exem-ui/tailwindcss3 @exem-ui/core
|
|
36
|
+
|
|
37
|
+
# pnpm
|
|
38
|
+
pnpm add @exem-ui/tailwindcss3 @exem-ui/core
|
|
39
|
+
|
|
40
|
+
# yarn
|
|
41
|
+
yarn add @exem-ui/tailwindcss3 @exem-ui/core
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 사전 요구사항
|
|
45
|
+
|
|
46
|
+
- Tailwind CSS >= 3.0.0
|
|
47
|
+
|
|
48
|
+
## 사용법
|
|
49
|
+
|
|
50
|
+
### 1. Tailwind 설정
|
|
51
|
+
|
|
52
|
+
#### Preset 방식 (권장)
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
// tailwind.config.ts
|
|
56
|
+
import { exemPreset } from '@exem-ui/tailwindcss3/preset';
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
presets: [exemPreset],
|
|
60
|
+
darkMode: 'class',
|
|
61
|
+
content: ['./src/**/*.{ts,tsx}'],
|
|
62
|
+
};
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### 플러그인 방식
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
// tailwind.config.ts
|
|
69
|
+
import { exemPlugin } from '@exem-ui/tailwindcss3';
|
|
70
|
+
|
|
71
|
+
export default {
|
|
72
|
+
plugins: [exemPlugin],
|
|
73
|
+
darkMode: 'class',
|
|
74
|
+
content: ['./src/**/*.{ts,tsx}'],
|
|
75
|
+
};
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
> Preset 방식은 플러그인 등록 + 테마 확장을 한 번에 처리합니다.
|
|
79
|
+
|
|
80
|
+
### 2. CSS 설정
|
|
81
|
+
|
|
82
|
+
```css
|
|
83
|
+
/* globals.css */
|
|
84
|
+
@import '@exem-ui/core/css';
|
|
85
|
+
|
|
86
|
+
@tailwind base;
|
|
87
|
+
@tailwind components;
|
|
88
|
+
@tailwind utilities;
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Tailwind 유틸리티 사용
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
<!-- EXEM 디자인 토큰을 Tailwind 클래스로 직접 사용 -->
|
|
95
|
+
<div class="bg-solid-accent-default text-text-inverse rounded-medium shadow-medium">
|
|
96
|
+
EXEM 스타일 적용됨
|
|
97
|
+
</div>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Export Map
|
|
101
|
+
|
|
102
|
+
| 경로 | 설명 |
|
|
103
|
+
|------|------|
|
|
104
|
+
| `@exem-ui/tailwindcss3` | 메인 엔트리 (플러그인) |
|
|
105
|
+
| `@exem-ui/tailwindcss3/preset` | Tailwind Preset (권장) |
|
|
106
|
+
|
|
107
|
+
## 관련 패키지
|
|
108
|
+
|
|
109
|
+
| 패키지 | 설명 |
|
|
110
|
+
|--------|------|
|
|
111
|
+
| [@exem-ui/core](https://www.npmjs.com/package/@exem-ui/core) | 디자인 토큰, CSS 변수 |
|
|
112
|
+
| [@exem-ui/react](https://www.npmjs.com/package/@exem-ui/react) | React UI 컴포넌트 |
|
|
113
|
+
| [@exem-ui/tailwindcss4](https://www.npmjs.com/package/@exem-ui/tailwindcss4) | Tailwind CSS v4 테마 |
|
|
114
|
+
|
|
115
|
+
## 라이선스
|
|
116
|
+
|
|
117
|
+
Apache License 2.0 - Copyright 2026 Exem Co., Ltd.
|
|
118
|
+
|
|
119
|
+
자세한 내용은 [LICENSE](https://github.com/CloudMOA/exem-ui/blob/main/LICENSE)를 참조하세요.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { fontPreset, gradientTokens, gradientDirections, radius, colorKebab, textPreset, shadow, breakpoint } from '@exem-ui/core/tailwindcss';
|
|
2
|
+
import plugin from 'tailwindcss/plugin';
|
|
3
|
+
|
|
4
|
+
// src/plugin.ts
|
|
5
|
+
function extractPrefixes(tokenKeys) {
|
|
6
|
+
const prefixes = /* @__PURE__ */ new Set();
|
|
7
|
+
for (const key of tokenKeys) {
|
|
8
|
+
const firstPart = key.split("-")[0];
|
|
9
|
+
if (firstPart) {
|
|
10
|
+
prefixes.add(firstPart);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return prefixes;
|
|
14
|
+
}
|
|
15
|
+
function generateSafelistPatterns() {
|
|
16
|
+
const colorKeys = Object.keys(colorKebab);
|
|
17
|
+
const radiusKeys = Object.keys(radius);
|
|
18
|
+
const shadowKeys = Object.keys(shadow);
|
|
19
|
+
const colorPrefixes = extractPrefixes(colorKeys);
|
|
20
|
+
const patterns = [];
|
|
21
|
+
for (const prefix of colorPrefixes) {
|
|
22
|
+
patterns.push({ pattern: new RegExp(`^bg-${prefix}-.+$`) });
|
|
23
|
+
}
|
|
24
|
+
for (const prefix of colorPrefixes) {
|
|
25
|
+
patterns.push({ pattern: new RegExp(`^text-${prefix}-.+$`) });
|
|
26
|
+
}
|
|
27
|
+
for (const prefix of colorPrefixes) {
|
|
28
|
+
patterns.push({ pattern: new RegExp(`^border-${prefix}-.+$`) });
|
|
29
|
+
}
|
|
30
|
+
for (const key of radiusKeys) {
|
|
31
|
+
patterns.push({ pattern: new RegExp(`^rounded-${key}$`) });
|
|
32
|
+
}
|
|
33
|
+
for (const key of shadowKeys) {
|
|
34
|
+
patterns.push({ pattern: new RegExp(`^shadow-${key}$`) });
|
|
35
|
+
}
|
|
36
|
+
patterns.push({ pattern: /^text-(header|title|body|caption)-.+$/ });
|
|
37
|
+
patterns.push({ pattern: /^text-code$/ });
|
|
38
|
+
const fontPresetKeys = Object.keys(fontPreset).join("|");
|
|
39
|
+
patterns.push({ pattern: new RegExp(`^font-(${fontPresetKeys})$`) });
|
|
40
|
+
return patterns;
|
|
41
|
+
}
|
|
42
|
+
var plugin_default = plugin(
|
|
43
|
+
({ matchUtilities, addUtilities }) => {
|
|
44
|
+
const fontUtilities = {};
|
|
45
|
+
for (const [name, value] of Object.entries(fontPreset)) {
|
|
46
|
+
fontUtilities[`.font-${name}`] = {
|
|
47
|
+
"font-weight": value.fontWeight,
|
|
48
|
+
"line-height": value.lineHeight
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
addUtilities(fontUtilities);
|
|
52
|
+
addUtilities({
|
|
53
|
+
".text-code": {
|
|
54
|
+
"font-family": "'JetBrains Mono', monospace"
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
for (const [name, colorStops] of Object.entries(gradientTokens)) {
|
|
58
|
+
matchUtilities(
|
|
59
|
+
{
|
|
60
|
+
[`bg-gradient-${name}`]: (direction) => ({
|
|
61
|
+
backgroundImage: `linear-gradient(${direction}, ${colorStops})`
|
|
62
|
+
})
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
values: { ...gradientDirections }
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
safelist: generateSafelistPatterns(),
|
|
72
|
+
theme: {
|
|
73
|
+
screens: {
|
|
74
|
+
...breakpoint
|
|
75
|
+
},
|
|
76
|
+
boxShadow: {
|
|
77
|
+
...shadow
|
|
78
|
+
},
|
|
79
|
+
fontSize: {
|
|
80
|
+
...textPreset
|
|
81
|
+
},
|
|
82
|
+
extend: {
|
|
83
|
+
colors: {
|
|
84
|
+
...colorKebab
|
|
85
|
+
},
|
|
86
|
+
borderRadius: {
|
|
87
|
+
...radius
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
export { plugin_default };
|
|
95
|
+
//# sourceMappingURL=chunk-GQI4KKR5.mjs.map
|
|
96
|
+
//# sourceMappingURL=chunk-GQI4KKR5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugin.ts"],"names":[],"mappings":";;;;AAgBA,SAAS,gBAAgB,SAAA,EAAkC;AACzD,EAAA,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OAAA,CAAQ,cAAc,CAAA,EAAG;AAC/D,MAAA,cAAA;AAAA,QACE;AAAA,UACE,CAAC,CAAA,YAAA,EAAe,IAAI,CAAA,CAAE,GAAG,CAAC,SAAA,MAAuB;AAAA,YAC/C,eAAA,EAAiB,CAAA,gBAAA,EAAmB,SAAS,CAAA,EAAA,EAAK,UAAU,CAAA,CAAA;AAAA,WAC9D;AAAA,SACF;AAAA,QACA;AAAA,UACE,MAAA,EAAQ,EAAE,GAAG,kBAAA;AAAmB;AAClC,OACF;AAAA,IACF;AAAA,EACF,CAAA;AAAA,EACA;AAAA,IACE,UAAU,wBAAA,EAAyB;AAAA,IACnC,KAAA,EAAO;AAAA,MACL,OAAA,EAAS;AAAA,QACP,GAAG;AAAA,OACL;AAAA,MACA,SAAA,EAAW;AAAA,QACT,GAAG;AAAA,OACL;AAAA,MACA,QAAA,EAAU;AAAA,QACR,GAAG;AAAA,OACL;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,MAAA,EAAQ;AAAA,UACN,GAAG;AAAA,SACL;AAAA,QACA,YAAA,EAAc;AAAA,UACZ,GAAG;AAAA;AACL;AACF;AACF;AAEJ","file":"chunk-GQI4KKR5.mjs","sourcesContent":["import {\n breakpoint,\n colorKebab,\n fontPreset,\n gradientDirections,\n gradientTokens,\n radius,\n shadow,\n textPreset,\n} from '@exem-ui/core/tailwindcss';\nimport plugin from 'tailwindcss/plugin';\n\n/**\n * 토큰에서 prefix 그룹을 추출하는 함수.\n * 예: 'text-primary' -> 'text', 'solid-accent-default' -> 'solid'\n */\nfunction extractPrefixes(tokenKeys: string[]): Set<string> {\n const prefixes = new Set<string>();\n\n for (const key of tokenKeys) {\n const firstPart = key.split('-')[0];\n if (firstPart) {\n prefixes.add(firstPart);\n }\n }\n\n return prefixes;\n}\n\n/**\n * 동적으로 safelist 패턴을 생성합니다.\n * 토큰에서 자동으로 prefix를 추출하여 패턴을 만듭니다.\n * 토큰이 변경되면 safelist도 자동으로 업데이트됩니다.\n */\nfunction generateSafelistPatterns() {\n const colorKeys = Object.keys(colorKebab);\n const radiusKeys = Object.keys(radius);\n const shadowKeys = Object.keys(shadow);\n\n const colorPrefixes = extractPrefixes(colorKeys);\n const patterns: Array<{ pattern: RegExp }> = [];\n\n // 배경색 패턴 (bg-)\n for (const prefix of colorPrefixes) {\n patterns.push({ pattern: new RegExp(`^bg-${prefix}-.+$`) });\n }\n\n // 텍스트 색상 패턴 (text-)\n for (const prefix of colorPrefixes) {\n patterns.push({ pattern: new RegExp(`^text-${prefix}-.+$`) });\n }\n\n // 보더 색상 패턴 (border-)\n for (const prefix of colorPrefixes) {\n patterns.push({ pattern: new RegExp(`^border-${prefix}-.+$`) });\n }\n\n // 반경 패턴 (rounded-)\n for (const key of radiusKeys) {\n patterns.push({ pattern: new RegExp(`^rounded-${key}$`) });\n }\n\n // 그림자 패턴 (shadow-)\n for (const key of shadowKeys) {\n patterns.push({ pattern: new RegExp(`^shadow-${key}$`) });\n }\n\n // 폰트 크기 패턴\n patterns.push({ pattern: /^text-(header|title|body|caption)-.+$/ });\n patterns.push({ pattern: /^text-code$/ });\n\n // 폰트 스타일 패턴 (fontPreset 토큰에서 자동 생성)\n const fontPresetKeys = Object.keys(fontPreset).join('|');\n patterns.push({ pattern: new RegExp(`^font-(${fontPresetKeys})$`) });\n\n return patterns;\n}\n\n/**\n * EXEM 디자인 시스템 Tailwind CSS(v3.x) 플러그인.\n *\n * `@exem-ui/core/tailwindcss` 공통 토큰을 활용하여 Tailwind 테마를 확장하고\n * 동적 그라데이션 유틸리티와 자동 safelist를 제공합니다.\n *\n * 제공 기능:\n * - 색상: `@exem-ui/core` 디자인 토큰 색상 (extend)\n * - 반경: weak, medium, strong, hard (extend)\n * - 그림자: weak, medium, strong, hard\n * - 타이포그래피: text-header-1/2, text-title-1/2, text-body-1/2/3, text-caption, text-code\n * - 동적 그라데이션: bg-gradient-exem-logo-[to-right] 등\n * - 브레이크포인트: md, lg, xl\n * - 동적 safelist: 토큰 기반 자동 패턴 생성\n *\n * @example\n * ```ts\n * // tailwind.config.ts\n * import exemPlugin from '@exem-ui/tailwindcss3';\n *\n * export default {\n * plugins: [exemPlugin],\n * };\n * ```\n */\nexport default plugin(\n ({ matchUtilities, addUtilities }) => {\n // font-* 유틸리티 (fontWeight + lineHeight)\n const fontUtilities: Record<string, Record<string, string>> = {};\n for (const [name, value] of Object.entries(fontPreset)) {\n fontUtilities[`.font-${name}`] = {\n 'font-weight': value.fontWeight,\n 'line-height': value.lineHeight,\n };\n }\n addUtilities(fontUtilities);\n\n // text-code: font-family 오버라이드 (font-size는 theme.fontSize에서 처리)\n addUtilities({\n '.text-code': {\n 'font-family': \"'JetBrains Mono', monospace\",\n },\n });\n\n for (const [name, colorStops] of Object.entries(gradientTokens)) {\n matchUtilities(\n {\n [`bg-gradient-${name}`]: (direction: string) => ({\n backgroundImage: `linear-gradient(${direction}, ${colorStops})`,\n }),\n },\n {\n values: { ...gradientDirections },\n },\n );\n }\n },\n {\n safelist: generateSafelistPatterns(),\n theme: {\n screens: {\n ...breakpoint,\n },\n boxShadow: {\n ...shadow,\n },\n fontSize: {\n ...textPreset,\n },\n extend: {\n colors: {\n ...colorKebab,\n },\n borderRadius: {\n ...radius,\n },\n },\n },\n },\n);\n"]}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as tailwindcss_types_config from 'tailwindcss/types/config';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* EXEM 디자인 시스템 Tailwind CSS(v3.x) 플러그인.
|
|
5
|
+
*
|
|
6
|
+
* `@exem-ui/core/tailwindcss` 공통 토큰을 활용하여 Tailwind 테마를 확장하고
|
|
7
|
+
* 동적 그라데이션 유틸리티와 자동 safelist를 제공합니다.
|
|
8
|
+
*
|
|
9
|
+
* 제공 기능:
|
|
10
|
+
* - 색상: `@exem-ui/core` 디자인 토큰 색상 (extend)
|
|
11
|
+
* - 반경: weak, medium, strong, hard (extend)
|
|
12
|
+
* - 그림자: weak, medium, strong, hard
|
|
13
|
+
* - 타이포그래피: text-header-1/2, text-title-1/2, text-body-1/2/3, text-caption, text-code
|
|
14
|
+
* - 동적 그라데이션: bg-gradient-exem-logo-[to-right] 등
|
|
15
|
+
* - 브레이크포인트: md, lg, xl
|
|
16
|
+
* - 동적 safelist: 토큰 기반 자동 패턴 생성
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // tailwind.config.ts
|
|
21
|
+
* import exemPlugin from '@exem-ui/tailwindcss3';
|
|
22
|
+
*
|
|
23
|
+
* export default {
|
|
24
|
+
* plugins: [exemPlugin],
|
|
25
|
+
* };
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare const _default: {
|
|
29
|
+
handler: tailwindcss_types_config.PluginCreator;
|
|
30
|
+
config?: Partial<tailwindcss_types_config.Config>;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { _default as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as tailwindcss_types_config from 'tailwindcss/types/config';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* EXEM 디자인 시스템 Tailwind CSS(v3.x) 플러그인.
|
|
5
|
+
*
|
|
6
|
+
* `@exem-ui/core/tailwindcss` 공통 토큰을 활용하여 Tailwind 테마를 확장하고
|
|
7
|
+
* 동적 그라데이션 유틸리티와 자동 safelist를 제공합니다.
|
|
8
|
+
*
|
|
9
|
+
* 제공 기능:
|
|
10
|
+
* - 색상: `@exem-ui/core` 디자인 토큰 색상 (extend)
|
|
11
|
+
* - 반경: weak, medium, strong, hard (extend)
|
|
12
|
+
* - 그림자: weak, medium, strong, hard
|
|
13
|
+
* - 타이포그래피: text-header-1/2, text-title-1/2, text-body-1/2/3, text-caption, text-code
|
|
14
|
+
* - 동적 그라데이션: bg-gradient-exem-logo-[to-right] 등
|
|
15
|
+
* - 브레이크포인트: md, lg, xl
|
|
16
|
+
* - 동적 safelist: 토큰 기반 자동 패턴 생성
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // tailwind.config.ts
|
|
21
|
+
* import exemPlugin from '@exem-ui/tailwindcss3';
|
|
22
|
+
*
|
|
23
|
+
* export default {
|
|
24
|
+
* plugins: [exemPlugin],
|
|
25
|
+
* };
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare const _default: {
|
|
29
|
+
handler: tailwindcss_types_config.PluginCreator;
|
|
30
|
+
config?: Partial<tailwindcss_types_config.Config>;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { _default as default };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tailwindcss = require('@exem-ui/core/tailwindcss');
|
|
4
|
+
var plugin = require('tailwindcss/plugin');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var plugin__default = /*#__PURE__*/_interopDefault(plugin);
|
|
9
|
+
|
|
10
|
+
// src/plugin.ts
|
|
11
|
+
function extractPrefixes(tokenKeys) {
|
|
12
|
+
const prefixes = /* @__PURE__ */ new Set();
|
|
13
|
+
for (const key of tokenKeys) {
|
|
14
|
+
const firstPart = key.split("-")[0];
|
|
15
|
+
if (firstPart) {
|
|
16
|
+
prefixes.add(firstPart);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return prefixes;
|
|
20
|
+
}
|
|
21
|
+
function generateSafelistPatterns() {
|
|
22
|
+
const colorKeys = Object.keys(tailwindcss.colorKebab);
|
|
23
|
+
const radiusKeys = Object.keys(tailwindcss.radius);
|
|
24
|
+
const shadowKeys = Object.keys(tailwindcss.shadow);
|
|
25
|
+
const colorPrefixes = extractPrefixes(colorKeys);
|
|
26
|
+
const patterns = [];
|
|
27
|
+
for (const prefix of colorPrefixes) {
|
|
28
|
+
patterns.push({ pattern: new RegExp(`^bg-${prefix}-.+$`) });
|
|
29
|
+
}
|
|
30
|
+
for (const prefix of colorPrefixes) {
|
|
31
|
+
patterns.push({ pattern: new RegExp(`^text-${prefix}-.+$`) });
|
|
32
|
+
}
|
|
33
|
+
for (const prefix of colorPrefixes) {
|
|
34
|
+
patterns.push({ pattern: new RegExp(`^border-${prefix}-.+$`) });
|
|
35
|
+
}
|
|
36
|
+
for (const key of radiusKeys) {
|
|
37
|
+
patterns.push({ pattern: new RegExp(`^rounded-${key}$`) });
|
|
38
|
+
}
|
|
39
|
+
for (const key of shadowKeys) {
|
|
40
|
+
patterns.push({ pattern: new RegExp(`^shadow-${key}$`) });
|
|
41
|
+
}
|
|
42
|
+
patterns.push({ pattern: /^text-(header|title|body|caption)-.+$/ });
|
|
43
|
+
patterns.push({ pattern: /^text-code$/ });
|
|
44
|
+
const fontPresetKeys = Object.keys(tailwindcss.fontPreset).join("|");
|
|
45
|
+
patterns.push({ pattern: new RegExp(`^font-(${fontPresetKeys})$`) });
|
|
46
|
+
return patterns;
|
|
47
|
+
}
|
|
48
|
+
var plugin_default = plugin__default.default(
|
|
49
|
+
({ matchUtilities, addUtilities }) => {
|
|
50
|
+
const fontUtilities = {};
|
|
51
|
+
for (const [name, value] of Object.entries(tailwindcss.fontPreset)) {
|
|
52
|
+
fontUtilities[`.font-${name}`] = {
|
|
53
|
+
"font-weight": value.fontWeight,
|
|
54
|
+
"line-height": value.lineHeight
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
addUtilities(fontUtilities);
|
|
58
|
+
addUtilities({
|
|
59
|
+
".text-code": {
|
|
60
|
+
"font-family": "'JetBrains Mono', monospace"
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
for (const [name, colorStops] of Object.entries(tailwindcss.gradientTokens)) {
|
|
64
|
+
matchUtilities(
|
|
65
|
+
{
|
|
66
|
+
[`bg-gradient-${name}`]: (direction) => ({
|
|
67
|
+
backgroundImage: `linear-gradient(${direction}, ${colorStops})`
|
|
68
|
+
})
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
values: { ...tailwindcss.gradientDirections }
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
safelist: generateSafelistPatterns(),
|
|
78
|
+
theme: {
|
|
79
|
+
screens: {
|
|
80
|
+
...tailwindcss.breakpoint
|
|
81
|
+
},
|
|
82
|
+
boxShadow: {
|
|
83
|
+
...tailwindcss.shadow
|
|
84
|
+
},
|
|
85
|
+
fontSize: {
|
|
86
|
+
...tailwindcss.textPreset
|
|
87
|
+
},
|
|
88
|
+
extend: {
|
|
89
|
+
colors: {
|
|
90
|
+
...tailwindcss.colorKebab
|
|
91
|
+
},
|
|
92
|
+
borderRadius: {
|
|
93
|
+
...tailwindcss.radius
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
// src/index.ts
|
|
101
|
+
var src_default = plugin_default;
|
|
102
|
+
|
|
103
|
+
module.exports = src_default;
|
|
104
|
+
//# sourceMappingURL=index.js.map
|
|
105
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugin.ts","../src/index.ts"],"names":["colorKebab","radius","shadow","fontPreset","plugin","gradientTokens","gradientDirections","breakpoint","textPreset"],"mappings":";;;;;;;;;;AAgBA,SAAS,gBAAgB,SAAA,EAAkC;AACzD,EAAA,MAAM,QAAA,uBAAe,GAAA,EAAY;AAEjC,EAAA,KAAA,MAAW,OAAO,SAAA,EAAW;AAC3B,IAAA,MAAM,SAAA,GAAY,GAAA,CAAI,KAAA,CAAM,GAAG,EAAE,CAAC,CAAA;AAClC,IAAA,IAAI,SAAA,EAAW;AACb,MAAA,QAAA,CAAS,IAAI,SAAS,CAAA;AAAA,IACxB;AAAA,EACF;AAEA,EAAA,OAA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F;AAAA,QACA;AAAA,UACE,MAAA,EAAQ,EAAE,GAAGC,8BAAA;AAAmB;AAClC,OACF;AAAA,IACF;AAAA,EACF,CAAA;AAAA,EACA;AAAA,IACE,UAAU,wBAAA,EAAyB;AAAA,IACnC,KAAA,EAAO;AAAA,MACL,OAAA,EAAS;AAAA,QACP,GAAGC;AAAA,OACL;AAAA,MACA,SAAA,EAAW;AAAA,QACT,GAAGL;AAAA,OACL;AAAA,MACA,QAAA,EAAU;AAAA,QACR,GAAGM;AAAA,OACL;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,MAAA,EAAQ;AAAA,UACN,GAAGR;AAAA,SACL;AAAA,QACA,YAAA,EAAc;AAAA,UACZ,GAAGC;AAAA;AACL;AACF;AACF;AAEJ,CAAA;;;AC3JA,IAAO,WAAA,GAAQ","file":"index.js","sourcesContent":["import {\n breakpoint,\n colorKebab,\n fontPreset,\n gradientDirections,\n gradientTokens,\n radius,\n shadow,\n textPreset,\n} from '@exem-ui/core/tailwindcss';\nimport plugin from 'tailwindcss/plugin';\n\n/**\n * 토큰에서 prefix 그룹을 추출하는 함수.\n * 예: 'text-primary' -> 'text', 'solid-accent-default' -> 'solid'\n */\nfunction extractPrefixes(tokenKeys: string[]): Set<string> {\n const prefixes = new Set<string>();\n\n for (const key of tokenKeys) {\n const firstPart = key.split('-')[0];\n if (firstPart) {\n prefixes.add(firstPart);\n }\n }\n\n return prefixes;\n}\n\n/**\n * 동적으로 safelist 패턴을 생성합니다.\n * 토큰에서 자동으로 prefix를 추출하여 패턴을 만듭니다.\n * 토큰이 변경되면 safelist도 자동으로 업데이트됩니다.\n */\nfunction generateSafelistPatterns() {\n const colorKeys = Object.keys(colorKebab);\n const radiusKeys = Object.keys(radius);\n const shadowKeys = Object.keys(shadow);\n\n const colorPrefixes = extractPrefixes(colorKeys);\n const patterns: Array<{ pattern: RegExp }> = [];\n\n // 배경색 패턴 (bg-)\n for (const prefix of colorPrefixes) {\n patterns.push({ pattern: new RegExp(`^bg-${prefix}-.+$`) });\n }\n\n // 텍스트 색상 패턴 (text-)\n for (const prefix of colorPrefixes) {\n patterns.push({ pattern: new RegExp(`^text-${prefix}-.+$`) });\n }\n\n // 보더 색상 패턴 (border-)\n for (const prefix of colorPrefixes) {\n patterns.push({ pattern: new RegExp(`^border-${prefix}-.+$`) });\n }\n\n // 반경 패턴 (rounded-)\n for (const key of radiusKeys) {\n patterns.push({ pattern: new RegExp(`^rounded-${key}$`) });\n }\n\n // 그림자 패턴 (shadow-)\n for (const key of shadowKeys) {\n patterns.push({ pattern: new RegExp(`^shadow-${key}$`) });\n }\n\n // 폰트 크기 패턴\n patterns.push({ pattern: /^text-(header|title|body|caption)-.+$/ });\n patterns.push({ pattern: /^text-code$/ });\n\n // 폰트 스타일 패턴 (fontPreset 토큰에서 자동 생성)\n const fontPresetKeys = Object.keys(fontPreset).join('|');\n patterns.push({ pattern: new RegExp(`^font-(${fontPresetKeys})$`) });\n\n return patterns;\n}\n\n/**\n * EXEM 디자인 시스템 Tailwind CSS(v3.x) 플러그인.\n *\n * `@exem-ui/core/tailwindcss` 공통 토큰을 활용하여 Tailwind 테마를 확장하고\n * 동적 그라데이션 유틸리티와 자동 safelist를 제공합니다.\n *\n * 제공 기능:\n * - 색상: `@exem-ui/core` 디자인 토큰 색상 (extend)\n * - 반경: weak, medium, strong, hard (extend)\n * - 그림자: weak, medium, strong, hard\n * - 타이포그래피: text-header-1/2, text-title-1/2, text-body-1/2/3, text-caption, text-code\n * - 동적 그라데이션: bg-gradient-exem-logo-[to-right] 등\n * - 브레이크포인트: md, lg, xl\n * - 동적 safelist: 토큰 기반 자동 패턴 생성\n *\n * @example\n * ```ts\n * // tailwind.config.ts\n * import exemPlugin from '@exem-ui/tailwindcss3';\n *\n * export default {\n * plugins: [exemPlugin],\n * };\n * ```\n */\nexport default plugin(\n ({ matchUtilities, addUtilities }) => {\n // font-* 유틸리티 (fontWeight + lineHeight)\n const fontUtilities: Record<string, Record<string, string>> = {};\n for (const [name, value] of Object.entries(fontPreset)) {\n fontUtilities[`.font-${name}`] = {\n 'font-weight': value.fontWeight,\n 'line-height': value.lineHeight,\n };\n }\n addUtilities(fontUtilities);\n\n // text-code: font-family 오버라이드 (font-size는 theme.fontSize에서 처리)\n addUtilities({\n '.text-code': {\n 'font-family': \"'JetBrains Mono', monospace\",\n },\n });\n\n for (const [name, colorStops] of Object.entries(gradientTokens)) {\n matchUtilities(\n {\n [`bg-gradient-${name}`]: (direction: string) => ({\n backgroundImage: `linear-gradient(${direction}, ${colorStops})`,\n }),\n },\n {\n values: { ...gradientDirections },\n },\n );\n }\n },\n {\n safelist: generateSafelistPatterns(),\n theme: {\n screens: {\n ...breakpoint,\n },\n boxShadow: {\n ...shadow,\n },\n fontSize: {\n ...textPreset,\n },\n extend: {\n colors: {\n ...colorKebab,\n },\n borderRadius: {\n ...radius,\n },\n },\n },\n },\n);\n","import plugin from './plugin';\n\nexport default plugin;\n"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,IAAO,WAAA,GAAQ","file":"index.mjs","sourcesContent":["import plugin from './plugin';\n\nexport default plugin;\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Config } from 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* EXEM 디자인 시스템 Tailwind CSS v3 프리셋.
|
|
5
|
+
* 플러그인 + content 경로를 포함하는 완전한 설정입니다.
|
|
6
|
+
* 기존 `@exem-ui/ui`의 Tailwind preset 기능을 대체합니다.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // tailwind.config.ts
|
|
11
|
+
* import exemPreset from '@exem-ui/tailwindcss3/preset';
|
|
12
|
+
*
|
|
13
|
+
* export default {
|
|
14
|
+
* presets: [exemPreset],
|
|
15
|
+
* content: ['./src/**\/*.{ts,tsx}'],
|
|
16
|
+
* } satisfies Config;
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare const preset: Config;
|
|
20
|
+
|
|
21
|
+
export { preset as default };
|
package/dist/preset.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Config } from 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* EXEM 디자인 시스템 Tailwind CSS v3 프리셋.
|
|
5
|
+
* 플러그인 + content 경로를 포함하는 완전한 설정입니다.
|
|
6
|
+
* 기존 `@exem-ui/ui`의 Tailwind preset 기능을 대체합니다.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // tailwind.config.ts
|
|
11
|
+
* import exemPreset from '@exem-ui/tailwindcss3/preset';
|
|
12
|
+
*
|
|
13
|
+
* export default {
|
|
14
|
+
* presets: [exemPreset],
|
|
15
|
+
* content: ['./src/**\/*.{ts,tsx}'],
|
|
16
|
+
* } satisfies Config;
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare const preset: Config;
|
|
20
|
+
|
|
21
|
+
export { preset as default };
|
package/dist/preset.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tailwindcss = require('@exem-ui/core/tailwindcss');
|
|
4
|
+
var plugin = require('tailwindcss/plugin');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var plugin__default = /*#__PURE__*/_interopDefault(plugin);
|
|
9
|
+
|
|
10
|
+
// src/plugin.ts
|
|
11
|
+
function extractPrefixes(tokenKeys) {
|
|
12
|
+
const prefixes = /* @__PURE__ */ new Set();
|
|
13
|
+
for (const key of tokenKeys) {
|
|
14
|
+
const firstPart = key.split("-")[0];
|
|
15
|
+
if (firstPart) {
|
|
16
|
+
prefixes.add(firstPart);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return prefixes;
|
|
20
|
+
}
|
|
21
|
+
function generateSafelistPatterns() {
|
|
22
|
+
const colorKeys = Object.keys(tailwindcss.colorKebab);
|
|
23
|
+
const radiusKeys = Object.keys(tailwindcss.radius);
|
|
24
|
+
const shadowKeys = Object.keys(tailwindcss.shadow);
|
|
25
|
+
const colorPrefixes = extractPrefixes(colorKeys);
|
|
26
|
+
const patterns = [];
|
|
27
|
+
for (const prefix of colorPrefixes) {
|
|
28
|
+
patterns.push({ pattern: new RegExp(`^bg-${prefix}-.+$`) });
|
|
29
|
+
}
|
|
30
|
+
for (const prefix of colorPrefixes) {
|
|
31
|
+
patterns.push({ pattern: new RegExp(`^text-${prefix}-.+$`) });
|
|
32
|
+
}
|
|
33
|
+
for (const prefix of colorPrefixes) {
|
|
34
|
+
patterns.push({ pattern: new RegExp(`^border-${prefix}-.+$`) });
|
|
35
|
+
}
|
|
36
|
+
for (const key of radiusKeys) {
|
|
37
|
+
patterns.push({ pattern: new RegExp(`^rounded-${key}$`) });
|
|
38
|
+
}
|
|
39
|
+
for (const key of shadowKeys) {
|
|
40
|
+
patterns.push({ pattern: new RegExp(`^shadow-${key}$`) });
|
|
41
|
+
}
|
|
42
|
+
patterns.push({ pattern: /^text-(header|title|body|caption)-.+$/ });
|
|
43
|
+
patterns.push({ pattern: /^text-code$/ });
|
|
44
|
+
const fontPresetKeys = Object.keys(tailwindcss.fontPreset).join("|");
|
|
45
|
+
patterns.push({ pattern: new RegExp(`^font-(${fontPresetKeys})$`) });
|
|
46
|
+
return patterns;
|
|
47
|
+
}
|
|
48
|
+
var plugin_default = plugin__default.default(
|
|
49
|
+
({ matchUtilities, addUtilities }) => {
|
|
50
|
+
const fontUtilities = {};
|
|
51
|
+
for (const [name, value] of Object.entries(tailwindcss.fontPreset)) {
|
|
52
|
+
fontUtilities[`.font-${name}`] = {
|
|
53
|
+
"font-weight": value.fontWeight,
|
|
54
|
+
"line-height": value.lineHeight
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
addUtilities(fontUtilities);
|
|
58
|
+
addUtilities({
|
|
59
|
+
".text-code": {
|
|
60
|
+
"font-family": "'JetBrains Mono', monospace"
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
for (const [name, colorStops] of Object.entries(tailwindcss.gradientTokens)) {
|
|
64
|
+
matchUtilities(
|
|
65
|
+
{
|
|
66
|
+
[`bg-gradient-${name}`]: (direction) => ({
|
|
67
|
+
backgroundImage: `linear-gradient(${direction}, ${colorStops})`
|
|
68
|
+
})
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
values: { ...tailwindcss.gradientDirections }
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
safelist: generateSafelistPatterns(),
|
|
78
|
+
theme: {
|
|
79
|
+
screens: {
|
|
80
|
+
...tailwindcss.breakpoint
|
|
81
|
+
},
|
|
82
|
+
boxShadow: {
|
|
83
|
+
...tailwindcss.shadow
|
|
84
|
+
},
|
|
85
|
+
fontSize: {
|
|
86
|
+
...tailwindcss.textPreset
|
|
87
|
+
},
|
|
88
|
+
extend: {
|
|
89
|
+
colors: {
|
|
90
|
+
...tailwindcss.colorKebab
|
|
91
|
+
},
|
|
92
|
+
borderRadius: {
|
|
93
|
+
...tailwindcss.radius
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
// src/preset.ts
|
|
101
|
+
var preset = {
|
|
102
|
+
content: [],
|
|
103
|
+
plugins: [plugin_default]
|
|
104
|
+
};
|
|
105
|
+
var preset_default = preset;
|
|
106
|
+
|
|
107
|
+
module.exports = preset_default;
|
|
108
|
+
//# sourceMappingURL=preset.js.map
|
|
109
|
+
//# sourceMappingURL=preset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugin.ts","../src/preset.ts"],"names":["colorKebab","radius","shadow","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A,EAAc;AAAA,QACZ,aAAA,EAAe;AAAA;AACjB,KACD,CAAA;AAED,IAAA,KAAA,MAAW,CAAC,IAAA,EAAM,UAAU,KAAK,MAAA,CAAO,OAAA,CAAQE,0BAAc,CAAA,EAAG;AAC/D,MAAA,cAAA;AAAA,QACE;AAAA,UACE,CAAC,CAAA,YAAA,EAAe,IAAI,CAAA,CAAE,GAAG,CAAC,SAAA,MAAuB;AAAA,YAC/C,eAAA,EAAiB,CAAA,gBAAA,EAAmB,SAAS,CAAA,EAAA,EAAK,UAAU,CAAA,CAAA;AAAA,WAC9D;AAAA,SACF;AAAA,QACA;AAAA,UACE,MAAA,EAAQ,EAAE,GAAGC,8BAAA;AAAmB;AAClC,OACF;AAAA,IACF;AAAA,EACF,CAAA;AAAA,EACA;AAAA,IACE,UAAU,wBAAA,EAAyB;AAAA,IACnC,KAAA,EAAO;AAAA,MACL,OAAA,EAAS;AAAA,QACP,GAAGC;AAAA,OACL;AAAA,MACA,SAAA,EAAW;AAAA,QACT,GAAGL;AAAA,OACL;AAAA,MACA,QAAA,EAAU;AAAA,QACR,GAAGM;AAAA,OACL;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,MAAA,EAAQ;AAAA,UACN,GAAGR;AAAA,SACL;AAAA,QACA,YAAA,EAAc;AAAA,UACZ,GAAGC;AAAA;AACL;AACF;AACF;AAEJ,CAAA;;;AC1IA,IAAM,MAAA,GAAiB;AAAA,EACrB,SAAS,EAAC;AAAA,EACV,OAAA,EAAS,CAAC,cAAU;AACtB,CAAA;AAEA,IAAO,cAAA,GAAQ","file":"preset.js","sourcesContent":["import {\n breakpoint,\n colorKebab,\n fontPreset,\n gradientDirections,\n gradientTokens,\n radius,\n shadow,\n textPreset,\n} from '@exem-ui/core/tailwindcss';\nimport plugin from 'tailwindcss/plugin';\n\n/**\n * 토큰에서 prefix 그룹을 추출하는 함수.\n * 예: 'text-primary' -> 'text', 'solid-accent-default' -> 'solid'\n */\nfunction extractPrefixes(tokenKeys: string[]): Set<string> {\n const prefixes = new Set<string>();\n\n for (const key of tokenKeys) {\n const firstPart = key.split('-')[0];\n if (firstPart) {\n prefixes.add(firstPart);\n }\n }\n\n return prefixes;\n}\n\n/**\n * 동적으로 safelist 패턴을 생성합니다.\n * 토큰에서 자동으로 prefix를 추출하여 패턴을 만듭니다.\n * 토큰이 변경되면 safelist도 자동으로 업데이트됩니다.\n */\nfunction generateSafelistPatterns() {\n const colorKeys = Object.keys(colorKebab);\n const radiusKeys = Object.keys(radius);\n const shadowKeys = Object.keys(shadow);\n\n const colorPrefixes = extractPrefixes(colorKeys);\n const patterns: Array<{ pattern: RegExp }> = [];\n\n // 배경색 패턴 (bg-)\n for (const prefix of colorPrefixes) {\n patterns.push({ pattern: new RegExp(`^bg-${prefix}-.+$`) });\n }\n\n // 텍스트 색상 패턴 (text-)\n for (const prefix of colorPrefixes) {\n patterns.push({ pattern: new RegExp(`^text-${prefix}-.+$`) });\n }\n\n // 보더 색상 패턴 (border-)\n for (const prefix of colorPrefixes) {\n patterns.push({ pattern: new RegExp(`^border-${prefix}-.+$`) });\n }\n\n // 반경 패턴 (rounded-)\n for (const key of radiusKeys) {\n patterns.push({ pattern: new RegExp(`^rounded-${key}$`) });\n }\n\n // 그림자 패턴 (shadow-)\n for (const key of shadowKeys) {\n patterns.push({ pattern: new RegExp(`^shadow-${key}$`) });\n }\n\n // 폰트 크기 패턴\n patterns.push({ pattern: /^text-(header|title|body|caption)-.+$/ });\n patterns.push({ pattern: /^text-code$/ });\n\n // 폰트 스타일 패턴 (fontPreset 토큰에서 자동 생성)\n const fontPresetKeys = Object.keys(fontPreset).join('|');\n patterns.push({ pattern: new RegExp(`^font-(${fontPresetKeys})$`) });\n\n return patterns;\n}\n\n/**\n * EXEM 디자인 시스템 Tailwind CSS(v3.x) 플러그인.\n *\n * `@exem-ui/core/tailwindcss` 공통 토큰을 활용하여 Tailwind 테마를 확장하고\n * 동적 그라데이션 유틸리티와 자동 safelist를 제공합니다.\n *\n * 제공 기능:\n * - 색상: `@exem-ui/core` 디자인 토큰 색상 (extend)\n * - 반경: weak, medium, strong, hard (extend)\n * - 그림자: weak, medium, strong, hard\n * - 타이포그래피: text-header-1/2, text-title-1/2, text-body-1/2/3, text-caption, text-code\n * - 동적 그라데이션: bg-gradient-exem-logo-[to-right] 등\n * - 브레이크포인트: md, lg, xl\n * - 동적 safelist: 토큰 기반 자동 패턴 생성\n *\n * @example\n * ```ts\n * // tailwind.config.ts\n * import exemPlugin from '@exem-ui/tailwindcss3';\n *\n * export default {\n * plugins: [exemPlugin],\n * };\n * ```\n */\nexport default plugin(\n ({ matchUtilities, addUtilities }) => {\n // font-* 유틸리티 (fontWeight + lineHeight)\n const fontUtilities: Record<string, Record<string, string>> = {};\n for (const [name, value] of Object.entries(fontPreset)) {\n fontUtilities[`.font-${name}`] = {\n 'font-weight': value.fontWeight,\n 'line-height': value.lineHeight,\n };\n }\n addUtilities(fontUtilities);\n\n // text-code: font-family 오버라이드 (font-size는 theme.fontSize에서 처리)\n addUtilities({\n '.text-code': {\n 'font-family': \"'JetBrains Mono', monospace\",\n },\n });\n\n for (const [name, colorStops] of Object.entries(gradientTokens)) {\n matchUtilities(\n {\n [`bg-gradient-${name}`]: (direction: string) => ({\n backgroundImage: `linear-gradient(${direction}, ${colorStops})`,\n }),\n },\n {\n values: { ...gradientDirections },\n },\n );\n }\n },\n {\n safelist: generateSafelistPatterns(),\n theme: {\n screens: {\n ...breakpoint,\n },\n boxShadow: {\n ...shadow,\n },\n fontSize: {\n ...textPreset,\n },\n extend: {\n colors: {\n ...colorKebab,\n },\n borderRadius: {\n ...radius,\n },\n },\n },\n },\n);\n","import type { Config } from 'tailwindcss';\nimport exemPlugin from './plugin';\n\n/**\n * EXEM 디자인 시스템 Tailwind CSS v3 프리셋.\n * 플러그인 + content 경로를 포함하는 완전한 설정입니다.\n * 기존 `@exem-ui/ui`의 Tailwind preset 기능을 대체합니다.\n *\n * @example\n * ```ts\n * // tailwind.config.ts\n * import exemPreset from '@exem-ui/tailwindcss3/preset';\n *\n * export default {\n * presets: [exemPreset],\n * content: ['./src/**\\/*.{ts,tsx}'],\n * } satisfies Config;\n * ```\n */\nconst preset: Config = {\n content: [],\n plugins: [exemPlugin],\n};\n\nexport default preset;\n"]}
|
package/dist/preset.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { plugin_default } from './chunk-GQI4KKR5.mjs';
|
|
2
|
+
|
|
3
|
+
// src/preset.ts
|
|
4
|
+
var preset = {
|
|
5
|
+
content: [],
|
|
6
|
+
plugins: [plugin_default]
|
|
7
|
+
};
|
|
8
|
+
var preset_default = preset;
|
|
9
|
+
|
|
10
|
+
export { preset_default as default };
|
|
11
|
+
//# sourceMappingURL=preset.mjs.map
|
|
12
|
+
//# sourceMappingURL=preset.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/preset.ts"],"names":[],"mappings":";;;AAmBA,IAAM,MAAA,GAAiB;AAAA,EACrB,SAAS,EAAC;AAAA,EACV,OAAA,EAAS,CAAC,cAAU;AACtB,CAAA;AAEA,IAAO,cAAA,GAAQ","file":"preset.mjs","sourcesContent":["import type { Config } from 'tailwindcss';\nimport exemPlugin from './plugin';\n\n/**\n * EXEM 디자인 시스템 Tailwind CSS v3 프리셋.\n * 플러그인 + content 경로를 포함하는 완전한 설정입니다.\n * 기존 `@exem-ui/ui`의 Tailwind preset 기능을 대체합니다.\n *\n * @example\n * ```ts\n * // tailwind.config.ts\n * import exemPreset from '@exem-ui/tailwindcss3/preset';\n *\n * export default {\n * presets: [exemPreset],\n * content: ['./src/**\\/*.{ts,tsx}'],\n * } satisfies Config;\n * ```\n */\nconst preset: Config = {\n content: [],\n plugins: [exemPlugin],\n};\n\nexport default preset;\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@exem-ui/tailwindcss3",
|
|
3
|
+
"version": "0.0.0-next-20260227030322",
|
|
4
|
+
"description": "EXEM Design System - Tailwind CSS 3 Plugin",
|
|
5
|
+
"author": "EXEM Design Team",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.mjs",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.mjs",
|
|
14
|
+
"require": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./preset": {
|
|
17
|
+
"types": "./dist/preset.d.ts",
|
|
18
|
+
"import": "./dist/preset.mjs",
|
|
19
|
+
"require": "./dist/preset.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/CloudMOA/exem-ui.git",
|
|
29
|
+
"directory": "packages/design-system/tailwind3"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/CloudMOA/exem-ui",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/CloudMOA/exem-ui/issues"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"tailwindcss",
|
|
40
|
+
"tailwindcss3",
|
|
41
|
+
"plugin",
|
|
42
|
+
"design-system",
|
|
43
|
+
"exem",
|
|
44
|
+
"css"
|
|
45
|
+
],
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@exem-ui/core": "0.0.0-next-20260227030322"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"tailwindcss": "^3.4.18",
|
|
51
|
+
"tsup": "^8.5.0",
|
|
52
|
+
"typescript": "^5.3.3"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"tailwindcss": "^3.0.0"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsup",
|
|
59
|
+
"dev": "tsup --watch",
|
|
60
|
+
"typecheck": "tsc --noEmit"
|
|
61
|
+
}
|
|
62
|
+
}
|