@charcoal-ui/utils 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 ADDED
@@ -0,0 +1,236 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+
23
+ //#endregion
24
+ let polished_lib_color_rgba = require("polished/lib/color/rgba");
25
+ polished_lib_color_rgba = __toESM(polished_lib_color_rgba);
26
+ let polished_lib_color_rgbToColorString = require("polished/lib/color/rgbToColorString");
27
+ polished_lib_color_rgbToColorString = __toESM(polished_lib_color_rgbToColorString);
28
+ let polished_lib_color_parseToRgb = require("polished/lib/color/parseToRgb");
29
+ polished_lib_color_parseToRgb = __toESM(polished_lib_color_parseToRgb);
30
+ let polished_lib_mixins_linearGradient = require("polished/lib/mixins/linearGradient");
31
+ polished_lib_mixins_linearGradient = __toESM(polished_lib_mixins_linearGradient);
32
+
33
+ //#region src/index.ts
34
+ const GRADIENT_DIRECTIONS = [
35
+ "to top",
36
+ "to bottom",
37
+ "to left",
38
+ "to right"
39
+ ];
40
+ function transparentGradient(color, defaultDirection = "to bottom") {
41
+ return function transparentGradient$1(direction = defaultDirection) {
42
+ const transparent = (0, polished_lib_color_rgba.default)(color, 0);
43
+ return (0, polished_lib_mixins_linearGradient.default)({
44
+ colorStops: [color, transparent],
45
+ fallback: transparent,
46
+ toDirection: typeof direction === "object" ? defaultDirection : direction
47
+ });
48
+ };
49
+ }
50
+ function gradient(toDirection = "to bottom") {
51
+ return function toLinearGradient(value) {
52
+ return (0, polished_lib_mixins_linearGradient.default)({
53
+ colorStops: value.map(({ color, ratio }) => `${color} ${ratio}%`),
54
+ fallback: value[0]?.color,
55
+ toDirection
56
+ });
57
+ };
58
+ }
59
+ function applyEffectToGradient(effect) {
60
+ return function toGradient(value) {
61
+ return value.map(({ color, ratio }) => ({
62
+ color: applyEffect(color, effect),
63
+ ratio
64
+ }));
65
+ };
66
+ }
67
+ function applyEffect(baseColor, effects) {
68
+ const color = baseColor ?? "#00000000";
69
+ if (Array.isArray(effects)) return effects.reduce(applySingleEffect, color);
70
+ return applySingleEffect(color, effects);
71
+ }
72
+ function applySingleEffect(baseColor, effect) {
73
+ switch (effect.type) {
74
+ case "alpha": return applyAlpha(baseColor, effect);
75
+ case "opacity": return applyOpacity(baseColor, effect);
76
+ case "replace": return applyReplace(baseColor, effect);
77
+ default: throw new RangeError(`Unknown effect type ${effect.type}, upgrade @charcoal-ui/utils`);
78
+ }
79
+ }
80
+ function applyAlpha(baseColor, { color, opacity }) {
81
+ const base = (0, polished_lib_color_parseToRgb.default)(baseColor);
82
+ const effect = (0, polished_lib_color_parseToRgb.default)(color);
83
+ return (0, polished_lib_color_rgba.default)(...alphaBlend([
84
+ base.red,
85
+ base.green,
86
+ base.blue,
87
+ base.alpha ?? 1
88
+ ], [
89
+ effect.red,
90
+ effect.green,
91
+ effect.blue,
92
+ clamp(0, 1, (effect.alpha ?? 1) * (opacity ?? 1))
93
+ ]));
94
+ }
95
+ function applyOpacity(baseColor, { opacity }) {
96
+ const parsed = (0, polished_lib_color_parseToRgb.default)(baseColor);
97
+ parsed.alpha = clamp(0, 1, (parsed.alpha ?? 1) * opacity);
98
+ return (0, polished_lib_color_rgbToColorString.default)(parsed);
99
+ }
100
+ function applyReplace(baseColor, { color = baseColor, opacity }) {
101
+ if (opacity === void 0) return color;
102
+ const parsed = (0, polished_lib_color_parseToRgb.default)(color);
103
+ parsed.alpha = opacity;
104
+ return (0, polished_lib_color_rgbToColorString.default)(parsed);
105
+ }
106
+ /**
107
+ * NOTE: alpha component must be in range from 0.0 to 1.0. (0.0 represents a fully transparent)
108
+ *
109
+ * @param src `[r, g, b, alpha]` Background
110
+ * @param dst `[r, g, b, alpha]` Foreground
111
+ */
112
+ function alphaBlend(src, dst) {
113
+ const srcA = src[3];
114
+ const dstA = dst[3];
115
+ const outA = srcA + dstA * (1 - srcA);
116
+ if (outA < EPS) return [
117
+ 0,
118
+ 0,
119
+ 0,
120
+ 0
121
+ ];
122
+ return [
123
+ Math.round((src[0] * srcA * (1 - dstA) + dst[0] * dstA) / outA),
124
+ Math.round((src[1] * srcA * (1 - dstA) + dst[1] * dstA) / outA),
125
+ Math.round((src[2] * srcA * (1 - dstA) + dst[2] * dstA) / outA),
126
+ outA
127
+ ];
128
+ }
129
+ const EPS = 1e-6;
130
+ function clamp(min, max, value) {
131
+ return Math.min(Math.max(value, min), max);
132
+ }
133
+ /**
134
+ * affix `px` unit
135
+ *
136
+ * @param value pixel
137
+ */
138
+ function px(value) {
139
+ return `${value}px`;
140
+ }
141
+ /**
142
+ * affix `s` unit
143
+ *
144
+ * @param value second
145
+ */
146
+ function dur(value) {
147
+ return `${value}s`;
148
+ }
149
+ const notDisabledSelector = `&:not(:disabled):not([aria-disabled]), &[aria-disabled=false]`;
150
+ const disabledSelector = `&:disabled, &[aria-disabled]:not([aria-disabled=false])`;
151
+ /**
152
+ * Construct media query from breakpoint
153
+ */
154
+ function maxWidth(breakpoint) {
155
+ return `(max-width: ${breakpoint - 1}px)`;
156
+ }
157
+ /**
158
+ * Derive half-leading from typography size
159
+ */
160
+ const halfLeading = ({ fontSize, lineHeight }) => (lineHeight - fontSize) / 2;
161
+ /**
162
+ * Namespaced custom property
163
+ */
164
+ const customPropertyToken = (id, modifiers = []) => `--charcoal-${id}${modifiers.length === 0 ? "" : ["", modifiers].join("-")}`;
165
+ /**
166
+ * @example
167
+ * ```js
168
+ * mapKeys({ a: 'aa', b: 'bb' }, (key) => key.toUpperCase()) // => { A: "aa", B: "bb" }
169
+ * ````
170
+ */
171
+ function mapKeys(object, callback) {
172
+ return Object.fromEntries(Object.entries(object).map(([key, value]) => [callback(key), value]));
173
+ }
174
+ /**
175
+ * @example
176
+ * ```js
177
+ * mapObject({ a: 'aa', b: 'bb', c: 'cc' }, (key, value) =>
178
+ * key === 'b' ? undefined : [key + '1', value.toUpperCase()]
179
+ * ) // => { a1: "AA", c1: "CC" }
180
+ * ```
181
+ */
182
+ function mapObject(source, callback) {
183
+ return Object.fromEntries(Object.entries(source).flatMap(([key, value]) => {
184
+ const entry = callback(key, value);
185
+ if (entry) return [entry];
186
+ else return [];
187
+ }));
188
+ }
189
+ /**
190
+ * @example
191
+ * ```js
192
+ * flatMapObject({ a: 'aa', b: 'bb' }, (key, value) => [
193
+ * [key + '1', value + '1'],
194
+ * [key + '2', value + '2'],
195
+ * ]) // => { a1: "aa1", a2: "aa2", b1: "bb1", b2: "bb2" }
196
+ * ```
197
+ */
198
+ function flatMapObject(source, callback) {
199
+ return Object.fromEntries(Object.entries(source).flatMap(([key, value]) => {
200
+ return callback(key, value);
201
+ }));
202
+ }
203
+ /**
204
+ * @example
205
+ * ```ts
206
+ * filterObject(
207
+ * { a: 'aa', b: 'bb', c: 'cc' },
208
+ * (value): value is string => value !== 'bb'
209
+ * ) // => { a: "aa", c: "cc" }
210
+ * ```
211
+ */
212
+ function filterObject(source, fn) {
213
+ return mapObject(source, (key, value) => {
214
+ if (fn(value) === true) return [key, value];
215
+ else return null;
216
+ });
217
+ }
218
+
219
+ //#endregion
220
+ exports.GRADIENT_DIRECTIONS = GRADIENT_DIRECTIONS;
221
+ exports.applyEffect = applyEffect;
222
+ exports.applyEffectToGradient = applyEffectToGradient;
223
+ exports.customPropertyToken = customPropertyToken;
224
+ exports.disabledSelector = disabledSelector;
225
+ exports.dur = dur;
226
+ exports.filterObject = filterObject;
227
+ exports.flatMapObject = flatMapObject;
228
+ exports.gradient = gradient;
229
+ exports.halfLeading = halfLeading;
230
+ exports.mapKeys = mapKeys;
231
+ exports.mapObject = mapObject;
232
+ exports.maxWidth = maxWidth;
233
+ exports.notDisabledSelector = notDisabledSelector;
234
+ exports.px = px;
235
+ exports.transparentGradient = transparentGradient;
236
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["transparentGradient","base: RgbaColor","effect: RgbaColor","parsed: RgbaColor"],"sources":["../src/index.ts"],"sourcesContent":["import rgba from 'polished/lib/color/rgba'\nimport rgbToColorString from 'polished/lib/color/rgbToColorString'\nimport parseToRgb from 'polished/lib/color/parseToRgb'\nimport linearGradient from 'polished/lib/mixins/linearGradient'\nimport type { RgbColor } from 'polished/lib/types/color'\n\nimport type {\n AlphaEffect,\n Effect,\n Effects,\n GradientMaterial,\n OpacityEffect,\n ReplaceEffect,\n TypographyDescriptor,\n} from '@charcoal-ui/foundation'\nimport type { Styles } from 'polished/lib/types/style'\n\nexport const GRADIENT_DIRECTIONS = [\n 'to top',\n 'to bottom',\n 'to left',\n 'to right',\n] as const\n\nexport type GradientDirection = (typeof GRADIENT_DIRECTIONS)[number]\n\nexport function transparentGradient(\n color: string,\n defaultDirection: GradientDirection = 'to bottom'\n) {\n return function transparentGradient(\n direction: GradientDirection | object = defaultDirection\n ): Styles {\n const transparent = rgba(color, 0)\n return linearGradient({\n colorStops: [color, transparent],\n fallback: transparent,\n toDirection: typeof direction === 'object' ? defaultDirection : direction,\n })\n }\n}\n\nexport function gradient(toDirection: GradientDirection = 'to bottom') {\n return function toLinearGradient(value: GradientMaterial): Styles {\n return linearGradient({\n colorStops: value.map(({ color, ratio }) => `${color} ${ratio}%`),\n fallback: value[0]?.color,\n toDirection,\n })\n }\n}\n\nexport function applyEffectToGradient(effect: Effects) {\n return function toGradient(value: GradientMaterial): GradientMaterial {\n return value.map(({ color, ratio }) => ({\n color: applyEffect(color, effect),\n ratio,\n }))\n }\n}\n\ninterface RgbaColor extends RgbColor {\n alpha?: number\n}\n\ninterface ReadonlyArrayConstructor {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n isArray(value: any): value is readonly any[]\n}\n\nexport function applyEffect(\n baseColor: string | null,\n effects: Effects\n): string {\n const color = baseColor ?? '#00000000'\n if ((Array as ReadonlyArrayConstructor).isArray(effects)) {\n return effects.reduce(applySingleEffect, color)\n }\n return applySingleEffect(color, effects)\n}\n\nfunction applySingleEffect(baseColor: string, effect: Effect): string {\n switch (effect.type) {\n case 'alpha':\n return applyAlpha(baseColor, effect)\n case 'opacity':\n return applyOpacity(baseColor, effect)\n case 'replace':\n return applyReplace(baseColor, effect)\n default:\n throw new RangeError(\n `Unknown effect type ${\n (effect as Effect).type\n }, upgrade @charcoal-ui/utils`\n )\n }\n}\n\nfunction applyAlpha(baseColor: string, { color, opacity }: AlphaEffect) {\n const base: RgbaColor = parseToRgb(baseColor)\n const effect: RgbaColor = parseToRgb(color)\n const src = [base.red, base.green, base.blue, base.alpha ?? 1.0] as const\n const dst = [\n effect.red,\n effect.green,\n effect.blue,\n clamp(0, 1, (effect.alpha ?? 1.0) * (opacity ?? 1.0)),\n ] as const\n return rgba(...alphaBlend(src, dst))\n}\n\nfunction applyOpacity(baseColor: string, { opacity }: OpacityEffect) {\n const parsed: RgbaColor = parseToRgb(baseColor)\n parsed.alpha = clamp(0, 1, (parsed.alpha ?? 1.0) * opacity)\n return rgbToColorString(parsed)\n}\n\nfunction applyReplace(\n baseColor: string,\n { color = baseColor, opacity }: ReplaceEffect\n) {\n if (opacity === undefined) {\n return color\n }\n const parsed: RgbaColor = parseToRgb(color)\n // NOTE: intentionally ignores any alpha value in the baseColor\n parsed.alpha = opacity\n return rgbToColorString(parsed)\n}\n\ntype Color4 = readonly [number, number, number, number]\n\n/**\n * NOTE: alpha component must be in range from 0.0 to 1.0. (0.0 represents a fully transparent)\n *\n * @param src `[r, g, b, alpha]` Background\n * @param dst `[r, g, b, alpha]` Foreground\n */\nfunction alphaBlend(src: Color4, dst: Color4): Color4 {\n const srcA = src[3]\n const dstA = dst[3]\n const outA = srcA + dstA * (1 - srcA)\n if (outA < EPS) {\n // blending 0% alpha with 0% alpha\n return [0, 0, 0, 0]\n }\n return [\n Math.round((src[0] * srcA * (1 - dstA) + dst[0] * dstA) / outA),\n Math.round((src[1] * srcA * (1 - dstA) + dst[1] * dstA) / outA),\n Math.round((src[2] * srcA * (1 - dstA) + dst[2] * dstA) / outA),\n outA,\n ]\n}\nconst EPS = 1e-6\n\nfunction clamp(min: number, max: number, value: number) {\n return Math.min(Math.max(value, min), max)\n}\n\n/**\n * affix `px` unit\n *\n * @param value pixel\n */\nexport function px(value: number) {\n return `${value}px`\n}\n\n/**\n * affix `s` unit\n *\n * @param value second\n */\nexport function dur(value: number) {\n return `${value}s`\n}\n\nexport const notDisabledSelector = `&:not(:disabled):not([aria-disabled]), &[aria-disabled=false]`\n\nexport const disabledSelector = `&:disabled, &[aria-disabled]:not([aria-disabled=false])`\n\n/**\n * Construct media query from breakpoint\n */\nexport function maxWidth(breakpoint: number) {\n return `(max-width: ${breakpoint - 1}px)`\n}\n\n/**\n * Derive half-leading from typography size\n */\nexport const halfLeading = ({\n fontSize,\n lineHeight,\n}: TypographyDescriptor): number => (lineHeight - fontSize) / 2\n\n/**\n * Namespaced custom property\n */\nexport const customPropertyToken = (\n id: string,\n modifiers: readonly string[] = []\n): `--charcoal-${string}` =>\n `--charcoal-${id}${modifiers.length === 0 ? '' : ['', modifiers].join('-')}`\n\n/**\n * @example\n * ```js\n * mapKeys({ a: 'aa', b: 'bb' }, (key) => key.toUpperCase()) // => { A: \"aa\", B: \"bb\" }\n * ````\n */\nexport function mapKeys<V, K extends string>(\n object: Record<string, V>,\n callback: (key: string) => K\n) {\n return Object.fromEntries(\n Object.entries(object).map(([key, value]) => [callback(key), value])\n ) as Record<K, V>\n}\n\n/**\n * @example\n * ```js\n * mapObject({ a: 'aa', b: 'bb', c: 'cc' }, (key, value) =>\n * key === 'b' ? undefined : [key + '1', value.toUpperCase()]\n * ) // => { a1: \"AA\", c1: \"CC\" }\n * ```\n */\nexport function mapObject<\n SourceKey extends string,\n SourceValue,\n DestKey extends string,\n DestValue\n>(\n source: Record<SourceKey, SourceValue>,\n callback: (\n key: SourceKey,\n value: SourceValue\n ) => [DestKey, DestValue] | null | undefined\n) {\n return Object.fromEntries(\n Object.entries(source).flatMap(([key, value]) => {\n const entry = callback(key as SourceKey, value as SourceValue)\n if (entry) {\n return [entry]\n } else {\n return []\n }\n })\n ) as Record<DestKey, DestValue>\n}\n\n/**\n * @example\n * ```js\n * flatMapObject({ a: 'aa', b: 'bb' }, (key, value) => [\n * [key + '1', value + '1'],\n * [key + '2', value + '2'],\n * ]) // => { a1: \"aa1\", a2: \"aa2\", b1: \"bb1\", b2: \"bb2\" }\n * ```\n */\nexport function flatMapObject<\n SourceKey extends string,\n SourceValue,\n DestKey extends string,\n DestValue\n>(\n source: Record<SourceKey, SourceValue>,\n callback: (key: SourceKey, value: SourceValue) => [DestKey, DestValue][]\n) {\n return Object.fromEntries(\n Object.entries(source).flatMap(([key, value]) => {\n return callback(key as SourceKey, value as SourceValue)\n })\n ) as Record<DestKey, DestValue>\n}\n\n/**\n * @example\n * ```ts\n * filterObject(\n * { a: 'aa', b: 'bb', c: 'cc' },\n * (value): value is string => value !== 'bb'\n * ) // => { a: \"aa\", c: \"cc\" }\n * ```\n */\nexport function filterObject<Source, Dest extends Source>(\n source: Record<string, Source>,\n fn: (value: Source) => value is Dest\n) {\n return mapObject(source, (key, value) => {\n if (fn(value) === true) {\n return [key, value]\n } else {\n return null\n }\n }) as Record<string, Dest>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACD;AAID,SAAgB,oBACd,OACA,mBAAsC,aACtC;AACA,QAAO,SAASA,sBACd,YAAwC,kBAChC;EACR,MAAM,mDAAmB,OAAO,EAAE;AAClC,yDAAsB;GACpB,YAAY,CAAC,OAAO,YAAY;GAChC,UAAU;GACV,aAAa,OAAO,cAAc,WAAW,mBAAmB;GACjE,CAAC;;;AAIN,SAAgB,SAAS,cAAiC,aAAa;AACrE,QAAO,SAAS,iBAAiB,OAAiC;AAChE,yDAAsB;GACpB,YAAY,MAAM,KAAK,EAAE,OAAO,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG;GACjE,UAAU,MAAM,IAAI;GACpB;GACD,CAAC;;;AAIN,SAAgB,sBAAsB,QAAiB;AACrD,QAAO,SAAS,WAAW,OAA2C;AACpE,SAAO,MAAM,KAAK,EAAE,OAAO,aAAa;GACtC,OAAO,YAAY,OAAO,OAAO;GACjC;GACD,EAAE;;;AAaP,SAAgB,YACd,WACA,SACQ;CACR,MAAM,QAAQ,aAAa;AAC3B,KAAK,MAAmC,QAAQ,QAAQ,CACtD,QAAO,QAAQ,OAAO,mBAAmB,MAAM;AAEjD,QAAO,kBAAkB,OAAO,QAAQ;;AAG1C,SAAS,kBAAkB,WAAmB,QAAwB;AACpE,SAAQ,OAAO,MAAf;EACE,KAAK,QACH,QAAO,WAAW,WAAW,OAAO;EACtC,KAAK,UACH,QAAO,aAAa,WAAW,OAAO;EACxC,KAAK,UACH,QAAO,aAAa,WAAW,OAAO;EACxC,QACE,OAAM,IAAI,WACR,uBACG,OAAkB,KACpB,8BACF;;;AAIP,SAAS,WAAW,WAAmB,EAAE,OAAO,WAAwB;CACtE,MAAMC,kDAA6B,UAAU;CAC7C,MAAMC,oDAA+B,MAAM;AAQ3C,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B;AAC3C,QAAO,eAAe,aAAa,EAAE;;;;;AAMvC,MAAa,eAAe,EAC1B,UACA,kBACmC,aAAa,YAAY;;;;AAK9D,MAAa,uBACX,IACA,YAA+B,EAAE,KAEjC,cAAc,KAAK,UAAU,WAAW,IAAI,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,IAAI;;;;;;;AAQ5E,SAAgB,QACd,QACA,UACA;AACA,QAAO,OAAO,YACZ,OAAO,QAAQ,OAAO,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,SAAS,IAAI,EAAE,MAAM,CAAC,CACrE;;;;;;;;;;AAWH,SAAgB,UAMd,QACA,UAIA;AACA,QAAO,OAAO,YACZ,OAAO,QAAQ,OAAO,CAAC,SAAS,CAAC,KAAK,WAAW;EAC/C,MAAM,QAAQ,SAAS,KAAkB,MAAqB;AAC9D,MAAI,MACF,QAAO,CAAC,MAAM;MAEd,QAAO,EAAE;GAEX,CACH;;;;;;;;;;;AAYH,SAAgB,cAMd,QACA,UACA;AACA,QAAO,OAAO,YACZ,OAAO,QAAQ,OAAO,CAAC,SAAS,CAAC,KAAK,WAAW;AAC/C,SAAO,SAAS,KAAkB,MAAqB;GACvD,CACH;;;;;;;;;;;AAYH,SAAgB,aACd,QACA,IACA;AACA,QAAO,UAAU,SAAS,KAAK,UAAU;AACvC,MAAI,GAAG,MAAM,KAAK,KAChB,QAAO,CAAC,KAAK,MAAM;MAEnB,QAAO;GAET"}
@@ -0,0 +1,128 @@
1
+ import { Styles } from "polished/lib/types/style";
2
+
3
+ //#region ../foundation/src/typography.d.ts
4
+ interface TypographyDescriptor {
5
+ readonly lineHeight: number;
6
+ readonly fontSize: number;
7
+ }
8
+ //#endregion
9
+ //#region ../foundation/src/color.d.ts
10
+ type Material = string;
11
+ type GradientMaterial = readonly {
12
+ readonly color: Material;
13
+ readonly ratio: number;
14
+ }[];
15
+ //#endregion
16
+ //#region ../foundation/src/effect.d.ts
17
+ type Effects = Readonly<Effect> | readonly Readonly<Effect>[];
18
+ type Effect = AlphaEffect | OpacityEffect | ReplaceEffect;
19
+ interface BaseEffect {}
20
+ interface AlphaEffect extends BaseEffect {
21
+ readonly type: "alpha";
22
+ /**
23
+ * Color to blend with the base color using alpha blending.
24
+ */
25
+ readonly color: string;
26
+ /**
27
+ * Multiplied with the alpha value of the effect's `color` before blending.
28
+ *
29
+ * `1` by default.
30
+ */
31
+ readonly opacity?: number;
32
+ }
33
+ interface OpacityEffect extends BaseEffect {
34
+ readonly type: "opacity";
35
+ /**
36
+ * Value to multiply with the current color's alpha value.
37
+ */
38
+ readonly opacity: number;
39
+ }
40
+ interface ReplaceEffect extends BaseEffect {
41
+ readonly type: "replace";
42
+ /**
43
+ * Replaces any given color with this color
44
+ */
45
+ readonly color?: string;
46
+ /**
47
+ * Replaces the alpha value with this opacity.
48
+ *
49
+ * Overrides the `color`'s opacity as well.
50
+ */
51
+ readonly opacity?: number;
52
+ }
53
+ //#endregion
54
+ //#region src/index.d.ts
55
+ declare const GRADIENT_DIRECTIONS: readonly ["to top", "to bottom", "to left", "to right"];
56
+ type GradientDirection = (typeof GRADIENT_DIRECTIONS)[number];
57
+ declare function transparentGradient(color: string, defaultDirection?: GradientDirection): (direction?: GradientDirection | object) => Styles;
58
+ declare function gradient(toDirection?: GradientDirection): (value: GradientMaterial) => Styles;
59
+ declare function applyEffectToGradient(effect: Effects): (value: GradientMaterial) => GradientMaterial;
60
+ declare function applyEffect(baseColor: string | null, effects: Effects): string;
61
+ /**
62
+ * affix `px` unit
63
+ *
64
+ * @param value pixel
65
+ */
66
+ declare function px(value: number): string;
67
+ /**
68
+ * affix `s` unit
69
+ *
70
+ * @param value second
71
+ */
72
+ declare function dur(value: number): string;
73
+ declare const notDisabledSelector = "&:not(:disabled):not([aria-disabled]), &[aria-disabled=false]";
74
+ declare const disabledSelector = "&:disabled, &[aria-disabled]:not([aria-disabled=false])";
75
+ /**
76
+ * Construct media query from breakpoint
77
+ */
78
+ declare function maxWidth(breakpoint: number): string;
79
+ /**
80
+ * Derive half-leading from typography size
81
+ */
82
+ declare const halfLeading: ({
83
+ fontSize,
84
+ lineHeight
85
+ }: TypographyDescriptor) => number;
86
+ /**
87
+ * Namespaced custom property
88
+ */
89
+ declare const customPropertyToken: (id: string, modifiers?: readonly string[]) => `--charcoal-${string}`;
90
+ /**
91
+ * @example
92
+ * ```js
93
+ * mapKeys({ a: 'aa', b: 'bb' }, (key) => key.toUpperCase()) // => { A: "aa", B: "bb" }
94
+ * ````
95
+ */
96
+ declare function mapKeys<V, K extends string>(object: Record<string, V>, callback: (key: string) => K): Record<K, V>;
97
+ /**
98
+ * @example
99
+ * ```js
100
+ * mapObject({ a: 'aa', b: 'bb', c: 'cc' }, (key, value) =>
101
+ * key === 'b' ? undefined : [key + '1', value.toUpperCase()]
102
+ * ) // => { a1: "AA", c1: "CC" }
103
+ * ```
104
+ */
105
+ declare function mapObject<SourceKey extends string, SourceValue, DestKey extends string, DestValue>(source: Record<SourceKey, SourceValue>, callback: (key: SourceKey, value: SourceValue) => [DestKey, DestValue] | null | undefined): Record<DestKey, DestValue>;
106
+ /**
107
+ * @example
108
+ * ```js
109
+ * flatMapObject({ a: 'aa', b: 'bb' }, (key, value) => [
110
+ * [key + '1', value + '1'],
111
+ * [key + '2', value + '2'],
112
+ * ]) // => { a1: "aa1", a2: "aa2", b1: "bb1", b2: "bb2" }
113
+ * ```
114
+ */
115
+ declare function flatMapObject<SourceKey extends string, SourceValue, DestKey extends string, DestValue>(source: Record<SourceKey, SourceValue>, callback: (key: SourceKey, value: SourceValue) => [DestKey, DestValue][]): Record<DestKey, DestValue>;
116
+ /**
117
+ * @example
118
+ * ```ts
119
+ * filterObject(
120
+ * { a: 'aa', b: 'bb', c: 'cc' },
121
+ * (value): value is string => value !== 'bb'
122
+ * ) // => { a: "aa", c: "cc" }
123
+ * ```
124
+ */
125
+ declare function filterObject<Source, Dest extends Source>(source: Record<string, Source>, fn: (value: Source) => value is Dest): Record<string, Dest>;
126
+ //#endregion
127
+ export { GRADIENT_DIRECTIONS, GradientDirection, applyEffect, applyEffectToGradient, customPropertyToken, disabledSelector, dur, filterObject, flatMapObject, gradient, halfLeading, mapKeys, mapObject, maxWidth, notDisabledSelector, px, transparentGradient };
128
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../foundation/src/typography.ts","../../foundation/src/color.ts","../../foundation/src/effect.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;UAAiB,oBAAA;;;AAAjB;;;KCAY,QAAA;KAEA,gBAAA;kBACM;EDHlB,SAAiB,KAAA,EAAA,MAAA;;;;KEAL,OAAA,GAAU,SAAS,mBAAmB,SAAS;KAE/C,MAAA,GAAS,cAAc,gBAAgB;UAEzC,UAAA;AFJO,UEMA,WAAA,SAAoB,UFNpB,CAAA;;;;ACAjB;EAEA,SAAY,KAAA,EAAA,MAAA;;;;ACFZ;;WAA+B,OAAA,CAAA,EAAA,MAAA;;AAA4B,UAoB1C,aAAA,SAAsB,UApBoB,CAAA;WAAT,IAAA,EAAA,SAAA;EAAA;AAElD;;WAAqB,OAAA,EAAA,MAAA;;AAA8B,UA0BlC,aAAA,SAAsB,UA1BY,CAAA;EAAA,SAAA,IAAA,EAAA,SAAA;EAAA;AAInD;AAcA;EAQA,SAAiB,KAAA,CAAA,EAAA,MAAA;;;;ACXjB;AAOA;EAEA,SAAgB,OAAA,CAAA,EAAA,MAAA;;;;cATH;AHjBI,KGwBL,iBAAA,GHxBK,CAAA,OGwBuB,mBHxBvB,CAAA,CAAA,MAAA,CAAA;iBG0BD,mBAAA,mCAEI,iCAGL,+BACV;iBAUW,QAAA,eAAsB,4BACI,qBAAmB;iBAS7C,qBAAA,SAA8B,kBACV,qBAAmB;AFrD3C,iBEsEI,WAAA,CFtEJ,SAAA,EAAA,MAAA,GAAA,IAAA,EAAA,OAAA,EEwED,OFxEC,CAAA,EAAA,MAAA;AAEZ;;;;ACFA;AAAY,iBCoKI,EAAA,CDp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AA,EAmD6B,WAnD7B,EAAA,GAAA,CAmD8C,OAnD9C,EAmDuD,SAnDvD,CAAA,EAAA,CAAA,EAyDA,MAzDA,CAyDO,OAzDP,EAyDgB,SAzDhB,CAAA;;AAWP;;;;;;;;AAUiB,iBAgDD,YAhDC,OAWH,eAqCoC,MArC3B,QAAhB,EAsCG,MAtCH,CAAA,MAAA,EAsCkB,MAtClB,CAAA,EAAA,EAAA,EAAA,CAAA,KAAA,EAuCO,MAvCP,EAAA,GAAA,KAAA,IAuC2B,IAvC3B,CAAA,EA+CC,MA/CD,CAAA,MAAA,EA+CgB,IA/ChB,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,70 +1,128 @@
1
- import { type Effects, type GradientMaterial, type TypographyDescriptor } from '@charcoal-ui/foundation';
2
- export declare const GRADIENT_DIRECTIONS: readonly ["to top", "to bottom", "to left", "to right"];
3
- export type GradientDirection = (typeof GRADIENT_DIRECTIONS)[number];
4
- export declare function transparentGradient(color: string, defaultDirection?: GradientDirection): (direction?: GradientDirection | object) => import("polished/lib/types/style").Styles;
5
- export declare function gradient(toDirection?: GradientDirection): (value: GradientMaterial) => import("polished/lib/types/style").Styles;
6
- export declare function applyEffectToGradient(effect: Effects): (value: GradientMaterial) => GradientMaterial;
7
- export declare function applyEffect(baseColor: string | null, effects: Effects): string;
1
+ import { Styles } from "polished/lib/types/style";
2
+
3
+ //#region ../foundation/src/typography.d.ts
4
+ interface TypographyDescriptor {
5
+ readonly lineHeight: number;
6
+ readonly fontSize: number;
7
+ }
8
+ //#endregion
9
+ //#region ../foundation/src/color.d.ts
10
+ type Material = string;
11
+ type GradientMaterial = readonly {
12
+ readonly color: Material;
13
+ readonly ratio: number;
14
+ }[];
15
+ //#endregion
16
+ //#region ../foundation/src/effect.d.ts
17
+ type Effects = Readonly<Effect> | readonly Readonly<Effect>[];
18
+ type Effect = AlphaEffect | OpacityEffect | ReplaceEffect;
19
+ interface BaseEffect {}
20
+ interface AlphaEffect extends BaseEffect {
21
+ readonly type: "alpha";
22
+ /**
23
+ * Color to blend with the base color using alpha blending.
24
+ */
25
+ readonly color: string;
26
+ /**
27
+ * Multiplied with the alpha value of the effect's `color` before blending.
28
+ *
29
+ * `1` by default.
30
+ */
31
+ readonly opacity?: number;
32
+ }
33
+ interface OpacityEffect extends BaseEffect {
34
+ readonly type: "opacity";
35
+ /**
36
+ * Value to multiply with the current color's alpha value.
37
+ */
38
+ readonly opacity: number;
39
+ }
40
+ interface ReplaceEffect extends BaseEffect {
41
+ readonly type: "replace";
42
+ /**
43
+ * Replaces any given color with this color
44
+ */
45
+ readonly color?: string;
46
+ /**
47
+ * Replaces the alpha value with this opacity.
48
+ *
49
+ * Overrides the `color`'s opacity as well.
50
+ */
51
+ readonly opacity?: number;
52
+ }
53
+ //#endregion
54
+ //#region src/index.d.ts
55
+ declare const GRADIENT_DIRECTIONS: readonly ["to top", "to bottom", "to left", "to right"];
56
+ type GradientDirection = (typeof GRADIENT_DIRECTIONS)[number];
57
+ declare function transparentGradient(color: string, defaultDirection?: GradientDirection): (direction?: GradientDirection | object) => Styles;
58
+ declare function gradient(toDirection?: GradientDirection): (value: GradientMaterial) => Styles;
59
+ declare function applyEffectToGradient(effect: Effects): (value: GradientMaterial) => GradientMaterial;
60
+ declare function applyEffect(baseColor: string | null, effects: Effects): string;
8
61
  /**
9
- * affix `px` unit
10
- *
11
- * @param value pixel
12
- */
13
- export declare function px(value: number): string;
62
+ * affix `px` unit
63
+ *
64
+ * @param value pixel
65
+ */
66
+ declare function px(value: number): string;
14
67
  /**
15
- * affix `s` unit
16
- *
17
- * @param value second
18
- */
19
- export declare function dur(value: number): string;
20
- export declare const notDisabledSelector = "&:not(:disabled):not([aria-disabled]), &[aria-disabled=false]";
21
- export declare const disabledSelector = "&:disabled, &[aria-disabled]:not([aria-disabled=false])";
68
+ * affix `s` unit
69
+ *
70
+ * @param value second
71
+ */
72
+ declare function dur(value: number): string;
73
+ declare const notDisabledSelector = "&:not(:disabled):not([aria-disabled]), &[aria-disabled=false]";
74
+ declare const disabledSelector = "&:disabled, &[aria-disabled]:not([aria-disabled=false])";
22
75
  /**
23
- * Construct media query from breakpoint
24
- */
25
- export declare function maxWidth(breakpoint: number): string;
76
+ * Construct media query from breakpoint
77
+ */
78
+ declare function maxWidth(breakpoint: number): string;
26
79
  /**
27
- * Derive half-leading from typography size
28
- */
29
- export declare const halfLeading: ({ fontSize, lineHeight }: TypographyDescriptor) => number;
80
+ * Derive half-leading from typography size
81
+ */
82
+ declare const halfLeading: ({
83
+ fontSize,
84
+ lineHeight
85
+ }: TypographyDescriptor) => number;
30
86
  /**
31
- * Namespaced custom property
32
- */
33
- export declare const customPropertyToken: (id: string, modifiers?: readonly string[]) => `--charcoal-${string}`;
87
+ * Namespaced custom property
88
+ */
89
+ declare const customPropertyToken: (id: string, modifiers?: readonly string[]) => `--charcoal-${string}`;
34
90
  /**
35
- * @example
36
- * ```js
37
- * mapKeys({ a: 'aa', b: 'bb' }, (key) => key.toUpperCase()) // => { A: "aa", B: "bb" }
38
- * ````
39
- */
40
- export declare function mapKeys<V, K extends string>(object: Record<string, V>, callback: (key: string) => K): Record<K, V>;
91
+ * @example
92
+ * ```js
93
+ * mapKeys({ a: 'aa', b: 'bb' }, (key) => key.toUpperCase()) // => { A: "aa", B: "bb" }
94
+ * ````
95
+ */
96
+ declare function mapKeys<V, K extends string>(object: Record<string, V>, callback: (key: string) => K): Record<K, V>;
41
97
  /**
42
- * @example
43
- * ```js
44
- * mapObject({ a: 'aa', b: 'bb', c: 'cc' }, (key, value) =>
45
- * key === 'b' ? undefined : [key + '1', value.toUpperCase()]
46
- * ) // => { a1: "AA", c1: "CC" }
47
- * ```
48
- */
49
- export declare function mapObject<SourceKey extends string, SourceValue, DestKey extends string, DestValue>(source: Record<SourceKey, SourceValue>, callback: (key: SourceKey, value: SourceValue) => [DestKey, DestValue] | null | undefined): Record<DestKey, DestValue>;
98
+ * @example
99
+ * ```js
100
+ * mapObject({ a: 'aa', b: 'bb', c: 'cc' }, (key, value) =>
101
+ * key === 'b' ? undefined : [key + '1', value.toUpperCase()]
102
+ * ) // => { a1: "AA", c1: "CC" }
103
+ * ```
104
+ */
105
+ declare function mapObject<SourceKey extends string, SourceValue, DestKey extends string, DestValue>(source: Record<SourceKey, SourceValue>, callback: (key: SourceKey, value: SourceValue) => [DestKey, DestValue] | null | undefined): Record<DestKey, DestValue>;
50
106
  /**
51
- * @example
52
- * ```js
53
- * flatMapObject({ a: 'aa', b: 'bb' }, (key, value) => [
54
- * [key + '1', value + '1'],
55
- * [key + '2', value + '2'],
56
- * ]) // => { a1: "aa1", a2: "aa2", b1: "bb1", b2: "bb2" }
57
- * ```
58
- */
59
- export declare function flatMapObject<SourceKey extends string, SourceValue, DestKey extends string, DestValue>(source: Record<SourceKey, SourceValue>, callback: (key: SourceKey, value: SourceValue) => [DestKey, DestValue][]): Record<DestKey, DestValue>;
107
+ * @example
108
+ * ```js
109
+ * flatMapObject({ a: 'aa', b: 'bb' }, (key, value) => [
110
+ * [key + '1', value + '1'],
111
+ * [key + '2', value + '2'],
112
+ * ]) // => { a1: "aa1", a2: "aa2", b1: "bb1", b2: "bb2" }
113
+ * ```
114
+ */
115
+ declare function flatMapObject<SourceKey extends string, SourceValue, DestKey extends string, DestValue>(source: Record<SourceKey, SourceValue>, callback: (key: SourceKey, value: SourceValue) => [DestKey, DestValue][]): Record<DestKey, DestValue>;
60
116
  /**
61
- * @example
62
- * ```ts
63
- * filterObject(
64
- * { a: 'aa', b: 'bb', c: 'cc' },
65
- * (value): value is string => value !== 'bb'
66
- * ) // => { a: "aa", c: "cc" }
67
- * ```
68
- */
69
- export declare function filterObject<Source, Dest extends Source>(source: Record<string, Source>, fn: (value: Source) => value is Dest): Record<string, Dest>;
117
+ * @example
118
+ * ```ts
119
+ * filterObject(
120
+ * { a: 'aa', b: 'bb', c: 'cc' },
121
+ * (value): value is string => value !== 'bb'
122
+ * ) // => { a: "aa", c: "cc" }
123
+ * ```
124
+ */
125
+ declare function filterObject<Source, Dest extends Source>(source: Record<string, Source>, fn: (value: Source) => value is Dest): Record<string, Dest>;
126
+ //#endregion
127
+ export { GRADIENT_DIRECTIONS, GradientDirection, applyEffect, applyEffectToGradient, customPropertyToken, disabledSelector, dur, filterObject, flatMapObject, gradient, halfLeading, mapKeys, mapObject, maxWidth, notDisabledSelector, px, transparentGradient };
70
128
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,gBAAgB,EAGrB,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAA;AAEhC,eAAO,MAAM,mBAAmB,yDAKtB,CAAA;AAEV,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,gBAAgB,GAAE,iBAA+B,gBAGpC,iBAAiB,GAAG,MAAM,+CASxC;AAED,wBAAgB,QAAQ,CAAC,WAAW,GAAE,iBAA+B,0EAQpE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,iDAOpD;AAWD,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,OAAO,EAAE,OAAO,GACf,MAAM,CAMR;AAgFD;;;;GAIG;AACH,wBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,UAE/B;AAED;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,UAEhC;AAED,eAAO,MAAM,mBAAmB,kEAAkE,CAAA;AAElG,eAAO,MAAM,gBAAgB,4DAA4D,CAAA;AAEzF;;GAEG;AACH,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,UAE1C;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,6BAA8B,oBAAoB,WAC7C,CAAA;AAE7B;;GAEG;AACH,eAAO,MAAM,mBAAmB,OAC1B,MAAM,cACC,SAAS,MAAM,EAAE,KAC3B,cAAc,MAAM,EACuD,CAAA;AAE9E;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EACzC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EACzB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,gBAK7B;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,SAAS,SAAS,MAAM,EACxB,WAAW,EACX,OAAO,SAAS,MAAM,EACtB,SAAS,EAET,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,EACtC,QAAQ,EAAE,CACR,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,WAAW,KACf,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,IAAI,GAAG,SAAS,8BAY7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,SAAS,SAAS,MAAM,EACxB,WAAW,EACX,OAAO,SAAS,MAAM,EACtB,SAAS,EAET,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,EACtC,QAAQ,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,8BAOzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,IAAI,SAAS,MAAM,EACtD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,KAAK,IAAI,IAAI,wBASrC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../foundation/src/typography.ts","../../foundation/src/color.ts","../../foundation/src/effect.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;UAAiB,oBAAA;;;AAAjB;;;KCAY,QAAA;KAEA,gBAAA;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