@charcoal-ui/tailwind-config 5.0.0-beta.2 → 5.0.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/dist/index.cjs +455 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +250 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +248 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +421 -0
- package/dist/index.js.map +1 -0
- package/package.json +18 -19
- package/src/docs/borderRadius/BorderRadius.tsx +2 -2
- package/src/docs/colors/Colors.tsx +1 -1
- package/src/docs/colors/TextColors.tsx +1 -1
- package/src/docs/screens/Screens.tsx +1 -1
- package/src/docs/spacing/Spacing.tsx +1 -1
- package/src/tokenV2.ts +5 -2
- package/dist/_lib/TailwindBuild.d.ts +0 -18
- package/dist/_lib/TailwindBuild.d.ts.map +0 -1
- package/dist/_lib/compat.d.ts +0 -14
- package/dist/_lib/compat.d.ts.map +0 -1
- package/dist/colors/plugin.d.ts +0 -9
- package/dist/colors/plugin.d.ts.map +0 -1
- package/dist/colors/plugin.test.d.ts +0 -2
- package/dist/colors/plugin.test.d.ts.map +0 -1
- package/dist/colors/pluginTokenV1.d.ts +0 -32
- package/dist/colors/pluginTokenV1.d.ts.map +0 -1
- package/dist/colors/toTailwindConfig.d.ts +0 -6
- package/dist/colors/toTailwindConfig.d.ts.map +0 -1
- package/dist/colors/toTailwindConfig.test.d.ts +0 -2
- package/dist/colors/toTailwindConfig.test.d.ts.map +0 -1
- package/dist/colors/utils.d.ts +0 -7
- package/dist/colors/utils.d.ts.map +0 -1
- package/dist/docs/borderRadius/BorderRadius.d.ts +0 -3
- package/dist/docs/borderRadius/BorderRadius.d.ts.map +0 -1
- package/dist/docs/borderRadius/index.d.ts +0 -3
- package/dist/docs/borderRadius/index.d.ts.map +0 -1
- package/dist/docs/colors/Colors.d.ts +0 -3
- package/dist/docs/colors/Colors.d.ts.map +0 -1
- package/dist/docs/colors/TextBgColor.d.ts +0 -7
- package/dist/docs/colors/TextBgColor.d.ts.map +0 -1
- package/dist/docs/colors/TextBgColor.story.d.ts +0 -7
- package/dist/docs/colors/TextBgColor.story.d.ts.map +0 -1
- package/dist/docs/colors/TextColors.d.ts +0 -3
- package/dist/docs/colors/TextColors.d.ts.map +0 -1
- package/dist/docs/colors/index.d.ts +0 -4
- package/dist/docs/colors/index.d.ts.map +0 -1
- package/dist/docs/gradient/Gradients.d.ts +0 -3
- package/dist/docs/gradient/Gradients.d.ts.map +0 -1
- package/dist/docs/gradient/index.d.ts +0 -10
- package/dist/docs/gradient/index.d.ts.map +0 -1
- package/dist/docs/gradient/utils.d.ts +0 -2
- package/dist/docs/gradient/utils.d.ts.map +0 -1
- package/dist/docs/icons/IconClasses.d.ts +0 -4
- package/dist/docs/icons/IconClasses.d.ts.map +0 -1
- package/dist/docs/icons/index.d.ts +0 -2
- package/dist/docs/icons/index.d.ts.map +0 -1
- package/dist/docs/index.d.ts +0 -9
- package/dist/docs/index.d.ts.map +0 -1
- package/dist/docs/screens/Screens.d.ts +0 -3
- package/dist/docs/screens/Screens.d.ts.map +0 -1
- package/dist/docs/screens/index.d.ts +0 -3
- package/dist/docs/screens/index.d.ts.map +0 -1
- package/dist/docs/spacing/Spacing.d.ts +0 -3
- package/dist/docs/spacing/Spacing.d.ts.map +0 -1
- package/dist/docs/spacing/index.d.ts +0 -3
- package/dist/docs/spacing/index.d.ts.map +0 -1
- package/dist/docs/typography/HalfLeading.d.ts +0 -3
- package/dist/docs/typography/HalfLeading.d.ts.map +0 -1
- package/dist/docs/typography/Sizes.d.ts +0 -3
- package/dist/docs/typography/Sizes.d.ts.map +0 -1
- package/dist/docs/typography/index.d.ts +0 -9
- package/dist/docs/typography/index.d.ts.map +0 -1
- package/dist/foundation.d.ts +0 -6
- package/dist/foundation.d.ts.map +0 -1
- package/dist/gradient/plugin.d.ts +0 -22
- package/dist/gradient/plugin.d.ts.map +0 -1
- package/dist/gradient/plugin.test.d.ts +0 -2
- package/dist/gradient/plugin.test.d.ts.map +0 -1
- package/dist/icons.d.ts +0 -15
- package/dist/icons.d.ts.map +0 -1
- package/dist/icons.test.d.ts +0 -2
- package/dist/icons.test.d.ts.map +0 -1
- package/dist/index.cjs.js +0 -606
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js +0 -589
- package/dist/index.esm.js.map +0 -1
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/tokenV2.d.ts +0 -2
- package/dist/tokenV2.d.ts.map +0 -1
- package/dist/tokenV2.test.d.ts +0 -2
- package/dist/tokenV2.test.d.ts.map +0 -1
- package/dist/types.d.ts +0 -30
- package/dist/types.d.ts.map +0 -1
- package/dist/typography/plugin.d.ts +0 -6
- package/dist/typography/plugin.d.ts.map +0 -1
- package/dist/util.d.ts +0 -16
- package/dist/util.d.ts.map +0 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
//#region rolldown:runtime
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
22
|
+
}) : target, mod));
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
let __charcoal_ui_foundation = require("@charcoal-ui/foundation");
|
|
26
|
+
__charcoal_ui_foundation = __toESM(__charcoal_ui_foundation);
|
|
27
|
+
let __charcoal_ui_theme = require("@charcoal-ui/theme");
|
|
28
|
+
__charcoal_ui_theme = __toESM(__charcoal_ui_theme);
|
|
29
|
+
let __charcoal_ui_utils = require("@charcoal-ui/utils");
|
|
30
|
+
__charcoal_ui_utils = __toESM(__charcoal_ui_utils);
|
|
31
|
+
let tailwindcss_plugin = require("tailwindcss/plugin");
|
|
32
|
+
tailwindcss_plugin = __toESM(tailwindcss_plugin);
|
|
33
|
+
let __charcoal_ui_theme_unstable_tokens_css_variables_json = require("@charcoal-ui/theme/unstable-tokens/css-variables.json");
|
|
34
|
+
__charcoal_ui_theme_unstable_tokens_css_variables_json = __toESM(__charcoal_ui_theme_unstable_tokens_css_variables_json);
|
|
35
|
+
let __charcoal_ui_icon_files_v2_datauri = require("@charcoal-ui/icon-files/v2-datauri");
|
|
36
|
+
__charcoal_ui_icon_files_v2_datauri = __toESM(__charcoal_ui_icon_files_v2_datauri);
|
|
37
|
+
let __charcoal_ui_icon_files_v1_datauri = require("@charcoal-ui/icon-files/v1-datauri");
|
|
38
|
+
__charcoal_ui_icon_files_v1_datauri = __toESM(__charcoal_ui_icon_files_v1_datauri);
|
|
39
|
+
|
|
40
|
+
//#region src/foundation.ts
|
|
41
|
+
const GRID_COUNT = 12;
|
|
42
|
+
function mergeEffect({ elementEffect, effect }) {
|
|
43
|
+
return {
|
|
44
|
+
...elementEffect,
|
|
45
|
+
...effect,
|
|
46
|
+
outline: {
|
|
47
|
+
type: "opacity",
|
|
48
|
+
opacity: .32
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/util.ts
|
|
55
|
+
/**
|
|
56
|
+
* the key "default" or "DEFAULT" has special meaning and dropped from class name
|
|
57
|
+
*
|
|
58
|
+
* @see https://tailwindcss.com/docs/upgrading-to-v2#update-default-theme-keys-to-default
|
|
59
|
+
*/
|
|
60
|
+
function getDefaultKeyName(version) {
|
|
61
|
+
switch (version) {
|
|
62
|
+
case "v3":
|
|
63
|
+
case "v2": return "DEFAULT";
|
|
64
|
+
case "v1": return "default";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function getVariantOption(version) {
|
|
68
|
+
switch (version) {
|
|
69
|
+
case "v3": return {};
|
|
70
|
+
case "v2":
|
|
71
|
+
case "v1": return { variants: {} };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function setEquals(a, b) {
|
|
75
|
+
return a.size === b.size && Array.from(a).every((value) => b.has(value));
|
|
76
|
+
}
|
|
77
|
+
function assertAllThemeHaveSameKeys(themeMap) {
|
|
78
|
+
const defaultTheme = themeMap[":root"];
|
|
79
|
+
const expectedColorKeys = new Set(Object.keys(defaultTheme.color));
|
|
80
|
+
const expectedEffectKeys = new Set(Object.keys(defaultTheme.effect));
|
|
81
|
+
for (const [name, theme] of Object.entries(themeMap)) {
|
|
82
|
+
const colorKeys = new Set(Object.keys(theme.color));
|
|
83
|
+
const effectKeys = new Set(Object.keys(theme.effect));
|
|
84
|
+
if (!setEquals(colorKeys, expectedColorKeys)) throw new Error(`:root and ${name} does not have same colors.
|
|
85
|
+
|
|
86
|
+
Expected( :root ): ${JSON.stringify(Array.from(expectedColorKeys))}
|
|
87
|
+
Got: ${JSON.stringify(Array.from(colorKeys))}`);
|
|
88
|
+
if (!setEquals(effectKeys, expectedEffectKeys)) throw new Error(`:root and ${name} does not have same effects.
|
|
89
|
+
|
|
90
|
+
Expected( :root ): ${JSON.stringify(Array.from(expectedEffectKeys))}
|
|
91
|
+
Got: ${JSON.stringify(Array.from(effectKeys))}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function camelToKebab(value) {
|
|
95
|
+
return value.replace(/(?<small>[\da-z]|(?=[A-Z]))(?<capital>[A-Z])/gu, "$1-$2").toLowerCase();
|
|
96
|
+
}
|
|
97
|
+
const mapDefaultKey = (o) => {
|
|
98
|
+
return JSON.parse(JSON.stringify(o), function reviver(k, v) {
|
|
99
|
+
if (k === "default") {
|
|
100
|
+
const DefaultKey = getDefaultKeyName("v3");
|
|
101
|
+
this[DefaultKey] = v;
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
return v;
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
const flattenKey = (o, join) => {
|
|
108
|
+
return Object.fromEntries(Object.entries(o).flatMap(([key, v]) => {
|
|
109
|
+
if (typeof v === "string") return [[key, v]];
|
|
110
|
+
return Object.entries(v).map(([kk, vv]) => {
|
|
111
|
+
return [join?.(key) ?? true ? [key, kk].join("-") : kk, vv];
|
|
112
|
+
});
|
|
113
|
+
}));
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/colors/utils.ts
|
|
118
|
+
const COLOR_PREFIX = "--tailwind-color-";
|
|
119
|
+
function isSingleColor(color) {
|
|
120
|
+
return typeof color === "string";
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/colors/toTailwindConfig.ts
|
|
125
|
+
function colorsToTailwindConfig(version, colors, effects) {
|
|
126
|
+
const targetColors = (0, __charcoal_ui_utils.filterObject)(colors, isSingleColor);
|
|
127
|
+
const DEFAULT = getDefaultKeyName(version);
|
|
128
|
+
/**
|
|
129
|
+
* こういう感じのを吐き出す
|
|
130
|
+
*
|
|
131
|
+
* ```js
|
|
132
|
+
* {
|
|
133
|
+
* DEFAULT: 'var(--tailwind-color-hoge1, #fff)',
|
|
134
|
+
* hover: 'var(--tailwind-color-hoge1--hover, #eee)',
|
|
135
|
+
* press: 'var(--tailwind-color-hoge1--press, #ddd)',
|
|
136
|
+
* disabled: 'var(--tailwind-color-hoge1--disabled, #eee)',
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
function colorsForAllEffects(name, color) {
|
|
141
|
+
const varName = `${COLOR_PREFIX}${name}`;
|
|
142
|
+
return {
|
|
143
|
+
[DEFAULT]: `var(${varName}, ${color})`,
|
|
144
|
+
...(0, __charcoal_ui_utils.mapObject)(effects, (effectName, effect) => [effectName, `var(${varName}--${effectName}, ${(0, __charcoal_ui_utils.applyEffect)(color, effect)})`])
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
return (0, __charcoal_ui_utils.mapObject)(targetColors, (name, color) => [name, colorsForAllEffects(name, color)]);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/colors/pluginTokenV1.ts
|
|
152
|
+
function defineCssVariablesV1(themeMap) {
|
|
153
|
+
return (0, __charcoal_ui_utils.mapObject)(themeMap, (key, theme) => {
|
|
154
|
+
if (key.startsWith("@media")) return [key, { ":root": defineColorVariableCSS(theme) }];
|
|
155
|
+
else return [key, defineColorVariableCSS(theme)];
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
const defineColorVariableCSS = (theme) => {
|
|
159
|
+
const borders = (0, __charcoal_ui_utils.mapObject)(theme.border, (name, { color }) => [withPrefixes("border", name), color]);
|
|
160
|
+
return defineThemeVariables({
|
|
161
|
+
...theme.color,
|
|
162
|
+
...borders
|
|
163
|
+
})({ theme });
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Check whether a value is non-null and non-undefined
|
|
167
|
+
*
|
|
168
|
+
* @param value nullable
|
|
169
|
+
*/
|
|
170
|
+
const isPresent = (value) => value != null;
|
|
171
|
+
/**
|
|
172
|
+
* 子孫要素で使われるカラーテーマの CSS Variables を上書きする
|
|
173
|
+
*
|
|
174
|
+
* @params colorParams - 上書きしたい色の定義( `theme.color` の一部だけ書けば良い )
|
|
175
|
+
* @params effectParams - effect の定義を上書きしたい場合は渡す(必須ではない)
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```tsx
|
|
179
|
+
* const LocalTheme = styled.div`
|
|
180
|
+
* ${defineThemeVariables({ text1: '#ff0000' })}
|
|
181
|
+
* // `text1` is now defined as red
|
|
182
|
+
* ${theme((o) => [o.font.text1])}
|
|
183
|
+
* `
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
function defineThemeVariables(colorParams, effectParams) {
|
|
187
|
+
return function toCssObject(props) {
|
|
188
|
+
const colors = (0, __charcoal_ui_utils.filterObject)(colorParams, isPresent);
|
|
189
|
+
const effects = Object.entries({
|
|
190
|
+
...props.theme.effect,
|
|
191
|
+
...effectParams
|
|
192
|
+
});
|
|
193
|
+
return (0, __charcoal_ui_utils.flatMapObject)(colors, (colorKey, color) => [[(0, __charcoal_ui_utils.customPropertyToken)(colorKey), color], ...effects.map(([effectKey, effect]) => [(0, __charcoal_ui_utils.customPropertyToken)(colorKey, [effectKey]), (0, __charcoal_ui_utils.applyEffect)(color, [effect])])]);
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function withPrefixes(...parts) {
|
|
197
|
+
return parts.join("-");
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/colors/plugin.ts
|
|
202
|
+
/**
|
|
203
|
+
* --tailwind-* また --charcoal-* を生成する
|
|
204
|
+
* TODO: --tailwindをやめる
|
|
205
|
+
*/
|
|
206
|
+
function cssVariableColorPlugin(themeMap, cssVariablesV1) {
|
|
207
|
+
const { ":root": _defaultTheme,...otherThemes } = themeMap;
|
|
208
|
+
const definitions = defineCssVariables(otherThemes);
|
|
209
|
+
return (0, tailwindcss_plugin.default)(({ addBase }) => {
|
|
210
|
+
addBase(definitions);
|
|
211
|
+
if (cssVariablesV1) addBase(defineCssVariablesV1(themeMap));
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
function defineCssVariables(themes) {
|
|
215
|
+
return (0, __charcoal_ui_utils.mapObject)(themes, (selectorOrMediaQuery, theme) => {
|
|
216
|
+
const css = toCssVariables(theme);
|
|
217
|
+
if (selectorOrMediaQuery.startsWith("@media")) return [selectorOrMediaQuery, { ":root": css }];
|
|
218
|
+
else return [selectorOrMediaQuery, css];
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function toCssVariables(theme) {
|
|
222
|
+
const colors = (0, __charcoal_ui_utils.filterObject)(theme.color, isSingleColor);
|
|
223
|
+
const effects = Object.entries(mergeEffect(theme));
|
|
224
|
+
return (0, __charcoal_ui_utils.flatMapObject)(colors, (name, color) => {
|
|
225
|
+
const varName = `${COLOR_PREFIX}${name}`;
|
|
226
|
+
return [[varName, color], ...effects.map(([type, effect]) => [`${varName}--${type}`, (0, __charcoal_ui_utils.applyEffect)(color, effect)])];
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/gradient/plugin.ts
|
|
232
|
+
const VAR_PREFIX = "--tailwind-gradient-";
|
|
233
|
+
function cssVariableColorPlugin$1(gradients, effects, selectorOrMediaQuery) {
|
|
234
|
+
const utilities = getUtilities(gradients, effects);
|
|
235
|
+
const classRules = (0, __charcoal_ui_utils.mapObject)(utilities, (name) => [`.bg-${name}`, { backgroundImage: `var(${VAR_PREFIX}${name})` }]);
|
|
236
|
+
return (0, tailwindcss_plugin.default)(({ addBase, addUtilities }) => {
|
|
237
|
+
const css = (0, __charcoal_ui_utils.mapKeys)(utilities, (name) => `${VAR_PREFIX}${name}`);
|
|
238
|
+
if (selectorOrMediaQuery.startsWith("@media")) addBase({ [selectorOrMediaQuery]: { ":root": css } });
|
|
239
|
+
else addBase({ [selectorOrMediaQuery]: css });
|
|
240
|
+
addUtilities(classRules, { variants: ["responsive"] });
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
const DIRECTIONS = {
|
|
244
|
+
"to top": "top",
|
|
245
|
+
"to bottom": "bottom",
|
|
246
|
+
"to left": "left",
|
|
247
|
+
"to right": "right"
|
|
248
|
+
};
|
|
249
|
+
function getUtilities(gradients, effect) {
|
|
250
|
+
const effects = Object.entries(effect);
|
|
251
|
+
const directions = Object.entries(DIRECTIONS);
|
|
252
|
+
return (0, __charcoal_ui_utils.flatMapObject)(gradients, (name, colors) => directions.flatMap(([direction, className]) => {
|
|
253
|
+
const toLinearGradient = (colors$1) => {
|
|
254
|
+
const style = (0, __charcoal_ui_utils.gradient)(direction)(colors$1);
|
|
255
|
+
if (!("backgroundImage" in style)) throw new Error(`Could not generate linear-gradient() from ${name} ${direction} ${className}`);
|
|
256
|
+
return style.backgroundImage;
|
|
257
|
+
};
|
|
258
|
+
return [[createUtilityName(name, className), toLinearGradient(colors)], ...effects.map(([effectName, effect$1]) => [createUtilityName(name, className, effectName), toLinearGradient((0, __charcoal_ui_utils.applyEffectToGradient)(effect$1)(colors))])];
|
|
259
|
+
}));
|
|
260
|
+
}
|
|
261
|
+
function createUtilityName(gradientName, direction, suffix = "") {
|
|
262
|
+
return [
|
|
263
|
+
camelToKebab(gradientName),
|
|
264
|
+
direction,
|
|
265
|
+
suffix
|
|
266
|
+
].filter(Boolean).join("-");
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/typography/plugin.ts
|
|
271
|
+
const leadingCancel = {
|
|
272
|
+
display: "block",
|
|
273
|
+
width: 0,
|
|
274
|
+
height: 0,
|
|
275
|
+
content: "\"\""
|
|
276
|
+
};
|
|
277
|
+
const typographyStyle = (style) => {
|
|
278
|
+
const margin = -(0, __charcoal_ui_utils.halfLeading)(style);
|
|
279
|
+
return {
|
|
280
|
+
"font-size": (0, __charcoal_ui_utils.px)(style.fontSize),
|
|
281
|
+
"line-height": (0, __charcoal_ui_utils.px)(style.lineHeight),
|
|
282
|
+
"&::before": {
|
|
283
|
+
...leadingCancel,
|
|
284
|
+
marginTop: (0, __charcoal_ui_utils.px)(margin)
|
|
285
|
+
},
|
|
286
|
+
"&::after": {
|
|
287
|
+
...leadingCancel,
|
|
288
|
+
marginBottom: (0, __charcoal_ui_utils.px)(margin)
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
const typographyPlugin = (0, tailwindcss_plugin.default)(({ addUtilities }) => {
|
|
293
|
+
addUtilities({
|
|
294
|
+
...(0, __charcoal_ui_utils.mapObject)(__charcoal_ui_foundation.TYPOGRAPHY_SIZE, (fontSize, style) => [`.typography-${fontSize}`, typographyStyle(style)]),
|
|
295
|
+
".preserve-half-leading": {
|
|
296
|
+
"&::before": { content: "none" },
|
|
297
|
+
"&::after": { content: "none" }
|
|
298
|
+
}
|
|
299
|
+
}, { variants: ["responsive"] });
|
|
300
|
+
});
|
|
301
|
+
var plugin_default = typographyPlugin;
|
|
302
|
+
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/tokenV2.ts
|
|
305
|
+
function unstable_createTailwindConfigTokenV2() {
|
|
306
|
+
const fontSize = Object.fromEntries(Object.entries(__charcoal_ui_theme_unstable_tokens_css_variables_json.default.text["font-size"]).flatMap(([k, v]) => {
|
|
307
|
+
if (typeof v === "string") return [[k, [v, { lineHeight: __charcoal_ui_theme_unstable_tokens_css_variables_json.default.text["line-height"][k] }]]];
|
|
308
|
+
return Object.entries(v).map(([kk, vv]) => {
|
|
309
|
+
return [[k, kk].join("-"), [vv, { lineHeight: __charcoal_ui_theme_unstable_tokens_css_variables_json.default.text["line-height"][k][kk] }]];
|
|
310
|
+
});
|
|
311
|
+
}));
|
|
312
|
+
const spacing = flattenKey(__charcoal_ui_theme_unstable_tokens_css_variables_json.default.space, (key) => !/(gap|padding)/.test(key));
|
|
313
|
+
const colors = mapDefaultKey(__charcoal_ui_theme_unstable_tokens_css_variables_json.default.color);
|
|
314
|
+
return {
|
|
315
|
+
darkMode: "media",
|
|
316
|
+
theme: {
|
|
317
|
+
borderWidth: flattenKey(__charcoal_ui_theme_unstable_tokens_css_variables_json.default["border-width"]),
|
|
318
|
+
borderRadius: __charcoal_ui_theme_unstable_tokens_css_variables_json.default.radius,
|
|
319
|
+
borderColor: flattenKey(colors.border),
|
|
320
|
+
colors,
|
|
321
|
+
fontSize,
|
|
322
|
+
fontWeight: __charcoal_ui_theme_unstable_tokens_css_variables_json.default.text["font-weight"],
|
|
323
|
+
spacing,
|
|
324
|
+
gap: spacing,
|
|
325
|
+
width: __charcoal_ui_theme_unstable_tokens_css_variables_json.default["paragraph-width"]
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
//#endregion
|
|
331
|
+
//#region src/icons.ts
|
|
332
|
+
const transformClassNameV2 = (fileName) => {
|
|
333
|
+
const [size, variant, name] = fileName.split("/");
|
|
334
|
+
return [
|
|
335
|
+
".icon",
|
|
336
|
+
name.replaceAll(".", "-"),
|
|
337
|
+
...variant === "regular" ? [] : [variant],
|
|
338
|
+
...size === "24" ? [] : [size]
|
|
339
|
+
].join("-").toLowerCase();
|
|
340
|
+
};
|
|
341
|
+
const transformClassNameV1 = (fileName) => {
|
|
342
|
+
const [size, name] = fileName.split("/");
|
|
343
|
+
return [
|
|
344
|
+
".icon-v1",
|
|
345
|
+
name.replaceAll(".", "-"),
|
|
346
|
+
...size === "24" ? [] : [size]
|
|
347
|
+
].join("-").toLowerCase();
|
|
348
|
+
};
|
|
349
|
+
const createIconUtilities = ({ v2 = false }) => {
|
|
350
|
+
const newUtilities = {};
|
|
351
|
+
const icons = v2 ? __charcoal_ui_icon_files_v2_datauri.default : __charcoal_ui_icon_files_v1_datauri.default;
|
|
352
|
+
for (const [fileName, { uri, isSetCurrentcolor }] of Object.entries(icons)) {
|
|
353
|
+
const className = v2 ? transformClassNameV2(fileName) : transformClassNameV1(fileName);
|
|
354
|
+
newUtilities[className] = {
|
|
355
|
+
display: "inline-block",
|
|
356
|
+
width: "1em",
|
|
357
|
+
height: "1em",
|
|
358
|
+
maskImage: `url(${uri})`,
|
|
359
|
+
maskSize: "100% 100%",
|
|
360
|
+
background: isSetCurrentcolor ? "currentColor" : null,
|
|
361
|
+
aspectRatio: "1/1"
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
return newUtilities;
|
|
365
|
+
};
|
|
366
|
+
const charcoalIconsV2 = (0, tailwindcss_plugin.default)(({ addUtilities }) => {
|
|
367
|
+
addUtilities(createIconUtilities({ v2: true }));
|
|
368
|
+
});
|
|
369
|
+
const charcoalIconsV1 = (0, tailwindcss_plugin.default)(({ addUtilities }) => {
|
|
370
|
+
addUtilities(createIconUtilities({ v2: false }));
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region src/index.ts
|
|
375
|
+
function createTailwindConfig({ theme = { ":root": __charcoal_ui_theme.light }, version = "v3", cssVariablesV1 = true, unstableTokenV2 = false, iconsV2: iconsV2$1 = false, iconsV1: iconsV1$1 = false }) {
|
|
376
|
+
assertAllThemeHaveSameKeys(theme);
|
|
377
|
+
const defaultTheme = theme[":root"];
|
|
378
|
+
const effects = mergeEffect(defaultTheme);
|
|
379
|
+
const DEFAULT = getDefaultKeyName(version);
|
|
380
|
+
const { borderWidth: borderWidthV2, borderRadius: borderRadiusV2, borderColor: borderColorV2, colors: colorsV2, fontSize: fontSizeV2, fontWeight: fontWeightV2, spacing: spacingV2, gap: gapV2, width: widthV2 } = unstableTokenV2 ? unstable_createTailwindConfigTokenV2().theme : {};
|
|
381
|
+
return {
|
|
382
|
+
theme: {
|
|
383
|
+
screens: {
|
|
384
|
+
screen1: (0, __charcoal_ui_utils.px)(0),
|
|
385
|
+
screen2: (0, __charcoal_ui_utils.px)(defaultTheme.breakpoint.screen1),
|
|
386
|
+
screen3: (0, __charcoal_ui_utils.px)(defaultTheme.breakpoint.screen2),
|
|
387
|
+
screen4: (0, __charcoal_ui_utils.px)(defaultTheme.breakpoint.screen3),
|
|
388
|
+
screen5: (0, __charcoal_ui_utils.px)(defaultTheme.breakpoint.screen4)
|
|
389
|
+
},
|
|
390
|
+
colors: {
|
|
391
|
+
black: "#000",
|
|
392
|
+
white: "#fff",
|
|
393
|
+
transparent: "transparent",
|
|
394
|
+
current: "currentColor",
|
|
395
|
+
...colorsToTailwindConfig(version, defaultTheme.color, effects),
|
|
396
|
+
...colorsV2
|
|
397
|
+
},
|
|
398
|
+
borderColor: {
|
|
399
|
+
...colorsToTailwindConfig(version, (0, __charcoal_ui_utils.mapObject)(defaultTheme.border, (k, v) => [k, v.color]), effects),
|
|
400
|
+
...borderColorV2
|
|
401
|
+
},
|
|
402
|
+
spacing: {
|
|
403
|
+
...(0, __charcoal_ui_utils.mapObject)(__charcoal_ui_foundation.SPACING, (name, pixel) => [name, (0, __charcoal_ui_utils.px)(pixel)]),
|
|
404
|
+
...spacingV2
|
|
405
|
+
},
|
|
406
|
+
width: {
|
|
407
|
+
full: "100%",
|
|
408
|
+
screen: "100vw",
|
|
409
|
+
auto: "auto",
|
|
410
|
+
fit: "fit-content",
|
|
411
|
+
...Array.from({ length: GRID_COUNT }, (_, i) => i + 1).reduce((styles, i) => ({
|
|
412
|
+
...styles,
|
|
413
|
+
[`col-span-${i}`]: (0, __charcoal_ui_utils.px)(__charcoal_ui_foundation.COLUMN_UNIT * i + __charcoal_ui_foundation.GUTTER_UNIT * (i - 1))
|
|
414
|
+
}), {}),
|
|
415
|
+
...Array.from({ length: GRID_COUNT - 1 }, (_, i) => i + 1).reduce((styles, i) => ({
|
|
416
|
+
...styles,
|
|
417
|
+
[`${i}/${GRID_COUNT}`]: `${i / GRID_COUNT * 100}%`
|
|
418
|
+
}), {}),
|
|
419
|
+
...widthV2
|
|
420
|
+
},
|
|
421
|
+
gap: {
|
|
422
|
+
fixed: (0, __charcoal_ui_utils.px)(__charcoal_ui_foundation.GUTTER_UNIT),
|
|
423
|
+
...gapV2
|
|
424
|
+
},
|
|
425
|
+
borderRadius: {
|
|
426
|
+
...(0, __charcoal_ui_utils.mapObject)(__charcoal_ui_foundation.BORDER_RADIUS, (name, value) => [name, (0, __charcoal_ui_utils.px)(value)]),
|
|
427
|
+
...borderRadiusV2
|
|
428
|
+
},
|
|
429
|
+
transitionDuration: { [DEFAULT]: "0.2s" },
|
|
430
|
+
...unstableTokenV2 ? {
|
|
431
|
+
borderWidth: borderWidthV2,
|
|
432
|
+
fontSize: fontSizeV2,
|
|
433
|
+
fontWeight: fontWeightV2
|
|
434
|
+
} : {}
|
|
435
|
+
},
|
|
436
|
+
...getVariantOption(version),
|
|
437
|
+
corePlugins: { lineHeight: false },
|
|
438
|
+
plugins: [
|
|
439
|
+
plugin_default,
|
|
440
|
+
cssVariableColorPlugin(theme, Boolean(cssVariablesV1)),
|
|
441
|
+
...Object.entries(theme).map(([selectorOrMediaQuery, theme$1]) => cssVariableColorPlugin$1(theme$1.gradientColor, mergeEffect(theme$1), selectorOrMediaQuery)),
|
|
442
|
+
...iconsV2$1 ? [charcoalIconsV2] : [],
|
|
443
|
+
...iconsV1$1 ? [charcoalIconsV1] : []
|
|
444
|
+
]
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
const config = createTailwindConfig({});
|
|
448
|
+
var src_default = config;
|
|
449
|
+
|
|
450
|
+
//#endregion
|
|
451
|
+
exports.config = config;
|
|
452
|
+
exports.createTailwindConfig = createTailwindConfig;
|
|
453
|
+
exports.default = src_default;
|
|
454
|
+
exports.unstable_createTailwindConfigTokenV2 = unstable_createTailwindConfigTokenV2;
|
|
455
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["varName: keyof CSSVariables","cssVariableColorPlugin","colors","effect","TYPOGRAPHY_SIZE","light","flattenKeys","mapDefaultKeys","newUtilities: { [key: string]: CSSRuleObject }","iconsV2","iconsV1","light","SPACING","COLUMN_UNIT","GUTTER_UNIT","BORDER_RADIUS","typographyPlugin","theme","cssVariableGradientPlugin","iconsV2","iconsV1","config: Omit<Config, 'content'>"],"sources":["../src/foundation.ts","../src/util.ts","../src/colors/utils.ts","../src/colors/toTailwindConfig.ts","../src/colors/pluginTokenV1.ts","../src/colors/plugin.ts","../src/gradient/plugin.ts","../src/typography/plugin.ts","../src/tokenV2.ts","../src/icons.ts","../src/index.ts"],"sourcesContent":["import { Effect } from '@charcoal-ui/foundation'\nimport { CharcoalTheme as Theme } from '@charcoal-ui/theme'\n\nexport const GRID_COUNT = 12\n\nexport function mergeEffect({\n elementEffect,\n effect,\n}: Pick<Theme, 'elementEffect' | 'effect'>): MergedEffect {\n return {\n ...elementEffect,\n ...effect,\n outline: {\n type: 'opacity',\n opacity: 0.32,\n } as Effect,\n }\n}\n\nexport type MergedEffect = Record<string, Effect>\n","import type { Config } from 'tailwindcss'\nimport { TailwindVersion, ThemeMap } from './types'\n\n/**\n * the key \"default\" or \"DEFAULT\" has special meaning and dropped from class name\n *\n * @see https://tailwindcss.com/docs/upgrading-to-v2#update-default-theme-keys-to-default\n */\nexport function getDefaultKeyName(version: TailwindVersion) {\n switch (version) {\n case 'v3':\n case 'v2': {\n return 'DEFAULT'\n }\n\n case 'v1': {\n return 'default'\n }\n }\n}\n\nexport function getVariantOption(version: TailwindVersion): Partial<Config> {\n switch (version) {\n case 'v3': {\n // v3 以上では variants は variantOrders に改名された\n // そしてこれは上書きをしたいモチベがない\n // https://v2.tailwindcss.com/docs/configuration#variant-order\n return {}\n }\n\n case 'v2':\n case 'v1': {\n return { variants: {} }\n }\n }\n}\n\nfunction setEquals<T>(a: Set<T>, b: Set<T>) {\n return a.size === b.size && Array.from(a).every((value) => b.has(value))\n}\n\nexport function assertAllThemeHaveSameKeys(themeMap: ThemeMap): void {\n const defaultTheme = themeMap[':root']\n const expectedColorKeys = new Set(Object.keys(defaultTheme.color))\n const expectedEffectKeys = new Set(Object.keys(defaultTheme.effect))\n\n for (const [name, theme] of Object.entries(themeMap)) {\n const colorKeys = new Set(Object.keys(theme.color))\n const effectKeys = new Set(Object.keys(theme.effect))\n\n if (!setEquals(colorKeys, expectedColorKeys)) {\n throw new Error(`:root and ${name} does not have same colors.\n\nExpected( :root ): ${JSON.stringify(Array.from(expectedColorKeys))}\nGot: ${JSON.stringify(Array.from(colorKeys))}`)\n }\n\n if (!setEquals(effectKeys, expectedEffectKeys)) {\n throw new Error(`:root and ${name} does not have same effects.\n\nExpected( :root ): ${JSON.stringify(Array.from(expectedEffectKeys))}\nGot: ${JSON.stringify(Array.from(effectKeys))}`)\n }\n }\n}\n\nexport function camelToKebab(value: string) {\n return value\n .replace(/(?<small>[\\da-z]|(?=[A-Z]))(?<capital>[A-Z])/gu, '$1-$2')\n .toLowerCase()\n}\n\nexport const mapDefaultKey = <O extends object>(o: O) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return JSON.parse(JSON.stringify(o), function reviver(k: string, v: string) {\n if (k === 'default') {\n const DefaultKey = getDefaultKeyName('v3')\n this[DefaultKey] = v\n return undefined\n }\n return v\n })\n}\n\nexport const flattenKey = <O extends object>(\n o: O,\n join?: (key: string) => boolean\n) => {\n return Object.fromEntries(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n Object.entries(o).flatMap(([key, v]) => {\n if (typeof v === 'string') return [[key, v]]\n return Object.entries(v as object).map(([kk, vv]) => {\n return [join?.(key) ?? true ? [key, kk].join('-') : kk, vv]\n })\n })\n )\n}\n","import { GradientMaterial, Material } from '@charcoal-ui/foundation'\n\nexport const COLOR_PREFIX = '--tailwind-color-'\n\nexport function isSingleColor(color: AnyColor): color is Material {\n return typeof color === 'string'\n}\n\ntype AnyColor = Material | GradientMaterial\n\nexport type AnyColorTheme = Record<string, AnyColor>\n","import { Material } from '@charcoal-ui/foundation'\nimport { applyEffect, filterObject, mapObject } from '@charcoal-ui/utils'\nimport type { Config } from 'tailwindcss'\nimport { MergedEffect } from '../foundation'\n\nimport { TailwindVersion } from '../types'\nimport { getDefaultKeyName } from '../util'\n\nimport { AnyColorTheme, COLOR_PREFIX, isSingleColor } from './utils'\n\nexport function colorsToTailwindConfig(\n version: TailwindVersion,\n colors: AnyColorTheme,\n effects: MergedEffect\n): NonNullable<Config['theme']>['colors'] {\n const targetColors = filterObject(colors, isSingleColor)\n const DEFAULT = getDefaultKeyName(version)\n\n /**\n * こういう感じのを吐き出す\n *\n * ```js\n * {\n * DEFAULT: 'var(--tailwind-color-hoge1, #fff)',\n * hover: 'var(--tailwind-color-hoge1--hover, #eee)',\n * press: 'var(--tailwind-color-hoge1--press, #ddd)',\n * disabled: 'var(--tailwind-color-hoge1--disabled, #eee)',\n * }\n * ```\n */\n function colorsForAllEffects(name: string, color: Material) {\n const varName = `${COLOR_PREFIX}${name}`\n\n return {\n [DEFAULT]: `var(${varName}, ${color})`,\n\n ...mapObject(effects, (effectName, effect) => [\n effectName,\n `var(${varName}--${effectName}, ${applyEffect(color, effect)})`,\n ]),\n }\n }\n\n return mapObject(targetColors, (name, color) => [\n name,\n colorsForAllEffects(name, color),\n ])\n}\n","import {\n applyEffect,\n customPropertyToken,\n filterObject,\n flatMapObject,\n mapObject,\n} from '@charcoal-ui/utils'\nimport { ThemeMap } from '../types'\nimport {\n CharcoalAbstractTheme,\n EffectType,\n Key,\n CharcoalTheme as Theme,\n} from '@charcoal-ui/theme'\n\nexport function defineCssVariablesV1(themeMap: ThemeMap) {\n // @ts-expect-error FIXME\n return mapObject(themeMap, (key, theme) => {\n if (key.startsWith('@media')) {\n return [\n key,\n {\n ':root': defineColorVariableCSS(theme),\n },\n ]\n } else {\n return [key, defineColorVariableCSS(theme)]\n }\n })\n}\n\nexport const defineColorVariableCSS = (theme: Theme) => {\n const borders = mapObject(theme.border, (name, { color }) => [\n // REVIEW: もしtheme.colorにたまたまborder-〇〇で始まる色名がいたら被りうる\n withPrefixes('border', name),\n color,\n ])\n\n const colors = defineThemeVariables({ ...theme.color, ...borders })({ theme })\n return colors\n}\n\n/**\n * Check whether a value is non-null and non-undefined\n *\n * @param value nullable\n */\nexport const isPresent = <T>(value: T): value is NonNullable<T> => value != null\n\n/**\n * 子孫要素で使われるカラーテーマの CSS Variables を上書きする\n *\n * @params colorParams - 上書きしたい色の定義( `theme.color` の一部だけ書けば良い )\n * @params effectParams - effect の定義を上書きしたい場合は渡す(必須ではない)\n *\n * @example\n * ```tsx\n * const LocalTheme = styled.div`\n * ${defineThemeVariables({ text1: '#ff0000' })}\n * // `text1` is now defined as red\n * ${theme((o) => [o.font.text1])}\n * `\n * ```\n */\nexport function defineThemeVariables(\n colorParams: Partial<CharcoalAbstractTheme['color']>,\n effectParams?: Partial<CharcoalAbstractTheme['effect']>\n) {\n return function toCssObject(props: {\n theme: Pick<CharcoalAbstractTheme, 'effect'>\n }) {\n const colors = filterObject(colorParams, isPresent)\n\n // flatMapObject の中で毎回 Object.entries を呼ぶのは無駄なので外で呼ぶ\n const effects = Object.entries({\n ...props.theme.effect,\n ...effectParams,\n })\n\n return flatMapObject(colors, (colorKey, color) => [\n [customPropertyToken(colorKey), color],\n\n ...effects.map<[string, string]>(([effectKey, effect]) => [\n customPropertyToken(colorKey, [effectKey]),\n applyEffect(color, [effect]),\n ]),\n ])\n }\n}\n\nexport function isSupportedEffect(effect: Key): effect is EffectType {\n return ['hover', 'press', 'disabled'].includes(effect as string)\n}\n\nexport const variable = (value: string) => `var(${value})`\n\nexport function withPrefixes(...parts: string[]) {\n return parts.join('-')\n}\n","import { Material } from '@charcoal-ui/foundation'\nimport { CharcoalTheme as Theme } from '@charcoal-ui/theme'\nimport {\n applyEffect,\n filterObject,\n flatMapObject,\n mapObject,\n} from '@charcoal-ui/utils'\nimport plugin from 'tailwindcss/plugin'\nimport { mergeEffect } from '../foundation'\nimport { CSSVariableName, CSSVariables, Definition, ThemeMap } from '../types'\nimport { COLOR_PREFIX, isSingleColor } from './utils'\nimport { defineCssVariablesV1 } from './pluginTokenV1'\n\n/**\n * --tailwind-* また --charcoal-* を生成する\n * TODO: --tailwindをやめる\n */\nexport default function cssVariableColorPlugin(\n themeMap: ThemeMap,\n cssVariablesV1: boolean\n): ReturnType<typeof plugin> {\n // `:root` 以外のケースで各 CSS Variable がどういう値を取るかを定義する\n const { ':root': _defaultTheme, ...otherThemes } = themeMap\n const definitions = defineCssVariables(otherThemes)\n\n return plugin(({ addBase }) => {\n addBase(definitions)\n\n // styledのTokenInjector移植(background処理除く)\n if (cssVariablesV1) {\n const cssVariablesV1 = defineCssVariablesV1(themeMap)\n // @ts-expect-error FIXME\n addBase(cssVariablesV1)\n }\n })\n}\n\nexport function defineCssVariables(themes: Omit<ThemeMap, ':root'>) {\n return mapObject(themes, (selectorOrMediaQuery, theme) => {\n const css = toCssVariables(theme)\n\n if (selectorOrMediaQuery.startsWith('@media')) {\n return [\n selectorOrMediaQuery,\n {\n ':root': css,\n },\n ]\n } else {\n return [selectorOrMediaQuery, css]\n }\n }) as Definition\n}\n\nfunction toCssVariables(theme: Theme): CSSVariables {\n const colors = filterObject(theme.color, isSingleColor)\n const effects = Object.entries(mergeEffect(theme))\n\n return flatMapObject(colors, (name, color) => {\n const varName: keyof CSSVariables = `${COLOR_PREFIX}${name}`\n\n return [\n [varName, color],\n\n ...effects.map<[CSSVariableName, Material]>(([type, effect]) => [\n `${varName}--${type}`,\n applyEffect(color, effect),\n ]),\n ]\n })\n}\n","import plugin from 'tailwindcss/plugin'\nimport { camelToKebab } from '../util'\nimport { GradientMaterial } from '@charcoal-ui/foundation'\nimport { ThemeColorGradient } from '@charcoal-ui/theme'\nimport {\n applyEffectToGradient,\n flatMapObject,\n gradient,\n GradientDirection,\n mapKeys,\n mapObject,\n} from '@charcoal-ui/utils'\nimport { Values } from '../types'\nimport { MergedEffect } from '../foundation'\n\nconst VAR_PREFIX = '--tailwind-gradient-'\n\nexport default function cssVariableColorPlugin(\n gradients: ThemeColorGradient,\n effects: MergedEffect,\n selectorOrMediaQuery: string\n) {\n const utilities = getUtilities(gradients, effects)\n\n const classRules = mapObject(utilities, (name) => [\n `.bg-${name}`,\n { backgroundImage: `var(${VAR_PREFIX}${name})` },\n ])\n\n return plugin(({ addBase, addUtilities }) => {\n const css = mapKeys(utilities, (name) => `${VAR_PREFIX}${name}`)\n if (selectorOrMediaQuery.startsWith('@media')) {\n addBase({\n [selectorOrMediaQuery]: {\n ':root': css,\n },\n })\n } else {\n addBase({\n [selectorOrMediaQuery]: css,\n })\n }\n\n addUtilities(classRules, {\n // @ts-expect-error FIXME\n variants: ['responsive'],\n })\n })\n}\n\nconst DIRECTIONS = {\n 'to top': 'top',\n 'to bottom': 'bottom',\n 'to left': 'left',\n 'to right': 'right',\n} as const\n\n/**\n * こういう感じのやつ。この時点では `--tailwind-gradient-` のような CSS 変数名になってない\n *\n * ```js\n * {\n * 'hoge1': 'linear-gradient(to top, ...)',\n * ...\n * }\n * ```\n */\ntype Utilities = Record<string, LinearGradient>\n\ntype LinearGradient = `linear-gradient(${string})`\n\nexport function getUtilities(\n gradients: Record<string, GradientMaterial>,\n effect: MergedEffect\n): Utilities {\n const effects = Object.entries(effect)\n const directions = Object.entries(DIRECTIONS) as [\n GradientDirection,\n Values<typeof DIRECTIONS>\n ][]\n\n return flatMapObject(gradients, (name, colors) =>\n directions.flatMap(([direction, className]) => {\n const toLinearGradient = (colors: GradientMaterial) => {\n const style = gradient(direction)(colors)\n\n if (!('backgroundImage' in style)) {\n throw new Error(\n `Could not generate linear-gradient() from ${name} ${direction} ${className}`\n )\n }\n\n // 本当は backgroundColor も同時に生成されるんだけど、使うにはそれ用の CSS 変数も一緒に作らないといけない\n // とりあえず background-image だけで動くのでこっちだけを利用する\n return style.backgroundImage as LinearGradient\n }\n\n return [\n // こういう感じのやつ\n // { 'hoge1': 'linear-gradient(to top, ...)' }\n [createUtilityName(name, className), toLinearGradient(colors)],\n\n // こういう感じのやつ\n // { 'hoge1--hover': 'linear-gradient(to top, ...)' }\n ...effects.map<[string, LinearGradient]>(([effectName, effect]) => [\n createUtilityName(name, className, effectName),\n toLinearGradient(applyEffectToGradient(effect)(colors)),\n ]),\n ]\n })\n )\n}\n\nfunction createUtilityName(\n gradientName: string,\n direction: Values<typeof DIRECTIONS>,\n suffix = ''\n) {\n return [camelToKebab(gradientName), direction, suffix]\n .filter(Boolean)\n .join('-')\n}\n","import plugin from 'tailwindcss/plugin'\nimport { TypographyDescriptor, TYPOGRAPHY_SIZE } from '@charcoal-ui/foundation'\nimport { halfLeading, mapObject, px } from '@charcoal-ui/utils'\n\nconst leadingCancel = {\n display: 'block',\n width: 0,\n height: 0,\n content: '\"\"',\n}\n\nconst typographyStyle = (style: TypographyDescriptor) => {\n const margin = -halfLeading(style)\n\n return {\n 'font-size': px(style.fontSize),\n 'line-height': px(style.lineHeight),\n\n /**\n * cancel leading\n *\n * @see https://yuyakinoshita.com/blog/2020/01/20/line-height-crop/\n */\n '&::before': {\n ...leadingCancel,\n marginTop: px(margin),\n },\n '&::after': {\n ...leadingCancel,\n marginBottom: px(margin),\n },\n }\n}\n\nconst typographyPlugin = plugin(({ addUtilities }) => {\n const typographyClasses = mapObject(TYPOGRAPHY_SIZE, (fontSize, style) => [\n `.typography-${fontSize}`,\n typographyStyle(style),\n ])\n\n addUtilities(\n {\n ...typographyClasses,\n '.preserve-half-leading': {\n '&::before': {\n content: 'none',\n },\n '&::after': {\n content: 'none',\n },\n },\n },\n {\n // @ts-expect-error FIXME\n variants: ['responsive'],\n }\n )\n})\n\nexport default typographyPlugin\n","import light from '@charcoal-ui/theme/unstable-tokens/css-variables.json'\nimport type { Config } from 'tailwindcss'\nimport {\n flattenKey as flattenKeys,\n mapDefaultKey as mapDefaultKeys,\n} from './util'\n\nexport function unstable_createTailwindConfigTokenV2(): Omit<\n Config,\n 'content'\n> {\n const fontSize = Object.fromEntries(\n Object.entries(light.text['font-size']).flatMap(([k, v]) => {\n // text.fontSize.paragraph + text.lineHeight.paragraph -> text-paragraph\n if (typeof v === 'string') {\n return [\n [\n k,\n [\n v,\n // @ts-expect-error k is keyof line-height\n { lineHeight: light.text['line-height'][k] },\n ],\n ],\n ]\n }\n\n // text.fontSize.heading.s + text.lineHeight.heading.s -> text-heading-s\n return Object.entries(v as Record<string, string>).map(([kk, vv]) => {\n return [\n [k, kk].join('-'),\n [\n vv,\n // @ts-expect-error k is keyof line-height\n { lineHeight: light.text['line-height'][k][kk] },\n ],\n ]\n })\n })\n ) as NonNullable<Config['theme']>['fontSize']\n\n // space.target.s -> p-target-s\n // space.gap.gapButtons -> p-gap-buttons\n const spacing = flattenKeys(light.space, (key) => !/(gap|padding)/.test(key))\n // color.container.default -> bg-container\n // color.container.hover -> bg-container-hover\n const colors = mapDefaultKeys(light.color)\n\n const config: Omit<Config, 'content'> = {\n darkMode: 'media',\n theme: {\n // borderWidth.m -> border-m\n // borderWidth.focus.1 -> border-focus-1\n borderWidth: flattenKeys(light['border-width']),\n borderRadius: light.radius,\n borderColor: flattenKeys(colors.border),\n\n colors,\n\n fontSize,\n fontWeight: light.text['font-weight'],\n\n spacing,\n gap: spacing,\n width: light['paragraph-width'],\n },\n }\n\n return config\n}\n","import plugin from 'tailwindcss/plugin'\nimport iconsV2 from '@charcoal-ui/icon-files/v2-datauri'\nimport iconsV1 from '@charcoal-ui/icon-files/v1-datauri'\nimport { CSSRuleObject } from 'tailwindcss/types/config'\n\nconst transformClassNameV2 = (fileName: string) => {\n const [size, variant, name] = fileName.split('/')\n return [\n '.icon',\n name.replaceAll('.', '-'),\n ...(variant === 'regular' ? [] : [variant]),\n ...(size === '24' ? [] : [size]),\n ]\n .join('-')\n .toLowerCase()\n}\n\nconst transformClassNameV1 = (fileName: string) => {\n const [size, name] = fileName.split('/')\n return [\n '.icon-v1',\n name.replaceAll('.', '-'),\n ...(size === '24' ? [] : [size]),\n ]\n .join('-')\n .toLowerCase()\n}\n\nexport const createIconUtilities = ({ v2 = false }: { v2?: boolean }) => {\n const newUtilities: { [key: string]: CSSRuleObject } = {}\n const icons = v2 ? iconsV2 : iconsV1\n for (const [fileName, { uri, isSetCurrentcolor }] of Object.entries(icons)) {\n const className = v2\n ? transformClassNameV2(fileName)\n : transformClassNameV1(fileName)\n\n newUtilities[className] = {\n display: 'inline-block',\n width: '1em',\n height: '1em',\n maskImage: `url(${uri})`,\n maskSize: '100% 100%',\n background: isSetCurrentcolor ? 'currentColor' : null,\n aspectRatio: '1/1',\n }\n }\n return newUtilities\n}\n\nexport const charcoalIconsV2 = plugin(({ addUtilities }) => {\n addUtilities(createIconUtilities({ v2: true }))\n})\n\nexport const charcoalIconsV1 = plugin(({ addUtilities }) => {\n addUtilities(createIconUtilities({ v2: false }))\n})\n","import { GRID_COUNT, mergeEffect } from './foundation'\n\nimport type { Config } from 'tailwindcss'\nimport { TailwindVersion, ThemeMap } from './types'\n\nimport {\n assertAllThemeHaveSameKeys,\n getDefaultKeyName,\n getVariantOption,\n} from './util'\nimport {\n COLUMN_UNIT,\n GUTTER_UNIT,\n SPACING,\n BORDER_RADIUS,\n} from '@charcoal-ui/foundation'\nimport { light } from '@charcoal-ui/theme'\nimport { mapObject, px } from '@charcoal-ui/utils'\nimport { colorsToTailwindConfig } from './colors/toTailwindConfig'\n\nimport cssVariableColorPlugin from './colors/plugin'\nimport cssVariableGradientPlugin from './gradient/plugin'\nimport typographyPlugin from './typography/plugin'\nimport { unstable_createTailwindConfigTokenV2 } from './tokenV2'\nimport { charcoalIconsV1, charcoalIconsV2 } from './icons'\nexport { unstable_createTailwindConfigTokenV2 }\n\ninterface Options {\n version?: TailwindVersion\n theme?: ThemeMap\n cssVariablesV1?: boolean\n unstableTokenV2?: boolean\n iconsV2?: boolean\n iconsV1?: boolean\n}\n\nexport function createTailwindConfig({\n theme = { ':root': light },\n version = 'v3',\n cssVariablesV1 = true,\n unstableTokenV2 = false,\n iconsV2 = false,\n iconsV1 = false,\n}: Options): Omit<Config, 'content'> {\n assertAllThemeHaveSameKeys(theme)\n\n const defaultTheme = theme[':root']\n const effects = mergeEffect(defaultTheme)\n const DEFAULT = getDefaultKeyName(version)\n\n const {\n borderWidth: borderWidthV2,\n borderRadius: borderRadiusV2,\n borderColor: borderColorV2,\n colors: colorsV2,\n fontSize: fontSizeV2,\n fontWeight: fontWeightV2,\n spacing: spacingV2,\n gap: gapV2,\n width: widthV2,\n }: Partial<NonNullable<Config['theme']>> = unstableTokenV2\n ? unstable_createTailwindConfigTokenV2().theme\n : {}\n\n return {\n theme: {\n screens: {\n screen1: px(0),\n screen2: px(defaultTheme.breakpoint.screen1),\n screen3: px(defaultTheme.breakpoint.screen2),\n screen4: px(defaultTheme.breakpoint.screen3),\n screen5: px(defaultTheme.breakpoint.screen4),\n },\n colors: {\n // @deprecated\n black: '#000',\n\n // @deprecated\n white: '#fff',\n\n transparent: 'transparent',\n current: 'currentColor',\n ...colorsToTailwindConfig(version, defaultTheme.color, effects),\n ...colorsV2,\n },\n borderColor: {\n ...colorsToTailwindConfig(\n version,\n mapObject(defaultTheme.border, (k, v) => [k, v.color]),\n effects\n ),\n ...borderColorV2,\n },\n spacing: {\n ...mapObject(\n SPACING,\n (name, pixel) => [name, px(pixel)] as [string, string]\n ),\n ...spacingV2,\n },\n width: {\n full: '100%',\n screen: '100vw',\n auto: 'auto',\n fit: 'fit-content',\n\n /**\n * generates classes like \"w-col-span-1\"\n */\n ...Array.from({ length: GRID_COUNT }, (_, i) => i + 1).reduce(\n (styles, i) => ({\n ...styles,\n [`col-span-${i}`]: px(COLUMN_UNIT * i + GUTTER_UNIT * (i - 1)),\n }),\n {}\n ),\n\n /**\n * generates classes like \"w-1/12\" (except for 12/12, which just equals to w-full)\n */\n ...Array.from({ length: GRID_COUNT - 1 }, (_, i) => i + 1).reduce(\n (styles, i) => ({\n ...styles,\n [`${i}/${GRID_COUNT}`]: `${(i / GRID_COUNT) * 100}%`,\n }),\n {}\n ),\n ...widthV2,\n },\n gap: {\n fixed: px(GUTTER_UNIT),\n ...gapV2,\n },\n borderRadius: {\n ...mapObject(\n BORDER_RADIUS,\n (name, value) => [name, px(value)] as [string, string]\n ),\n ...borderRadiusV2,\n },\n transitionDuration: {\n [DEFAULT]: '0.2s',\n },\n ...(unstableTokenV2\n ? {\n borderWidth: borderWidthV2,\n fontSize: fontSizeV2,\n fontWeight: fontWeightV2,\n }\n : {}),\n },\n\n ...getVariantOption(version),\n\n corePlugins: {\n lineHeight: false,\n },\n plugins: [\n typographyPlugin,\n cssVariableColorPlugin(theme, Boolean(cssVariablesV1)),\n\n ...Object.entries(theme).map(([selectorOrMediaQuery, theme]) =>\n cssVariableGradientPlugin(\n theme.gradientColor,\n mergeEffect(theme),\n selectorOrMediaQuery\n )\n ),\n ...(iconsV2 ? [charcoalIconsV2] : []),\n ...(iconsV1 ? [charcoalIconsV1] : []),\n ],\n }\n}\n\nexport const config: Omit<Config, 'content'> = createTailwindConfig({})\n\nexport default config\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAa,aAAa;AAE1B,SAAgB,YAAY,EAC1B,eACA,UACwD;AACxD,QAAO;EACL,GAAG;EACH,GAAG;EACH,SAAS;GACP,MAAM;GACN,SAAS;GACV;EACF;;;;;;;;;;ACRH,SAAgB,kBAAkB,SAA0B;AAC1D,SAAQ,SAAR;EACE,KAAK;EACL,KAAK,KACH,QAAO;EAGT,KAAK,KACH,QAAO;;;AAKb,SAAgB,iBAAiB,SAA2C;AAC1E,SAAQ,SAAR;EACE,KAAK,KAIH,QAAO,EAAE;EAGX,KAAK;EACL,KAAK,KACH,QAAO,EAAE,UAAU,EAAE,EAAE;;;AAK7B,SAAS,UAAa,GAAW,GAAW;AAC1C,QAAO,EAAE,SAAS,EAAE,QAAQ,MAAM,KAAK,EAAE,CAAC,OAAO,UAAU,EAAE,IAAI,MAAM,CAAC;;AAG1E,SAAgB,2BAA2B,UAA0B;CACnE,MAAM,eAAe,SAAS;CAC9B,MAAM,oBAAoB,IAAI,IAAI,OAAO,KAAK,aAAa,MAAM,CAAC;CAClE,MAAM,qBAAqB,IAAI,IAAI,OAAO,KAAK,aAAa,OAAO,CA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