@homebound/truss 1.103.0 → 1.106.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,OAAO,EAAE,MAAM,EAAwC,MAAM,UAAU,CAAC;AAIxE,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,UAAU,CAAC,CAStE,CAAC;AAEF,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI5D"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,OAAO,EAAE,MAAM,EAAwC,MAAM,UAAU,CAAC;AAKxE,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,UAAU,CAAC,CAStE,CAAC;AAEF,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI5D"}
package/build/generate.js CHANGED
@@ -77,6 +77,7 @@ var ts_poet_1 = require("ts-poet");
77
77
  var breakpoints_1 = require("./breakpoints");
78
78
  var methods_1 = require("./methods");
79
79
  var sections_1 = require("./sections");
80
+ var utils_1 = require("./utils");
80
81
  exports.defaultTypeAliases = {
81
82
  Margin: ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"],
82
83
  Padding: [
@@ -107,7 +108,7 @@ function generate(config) {
107
108
  }
108
109
  exports.generate = generate;
109
110
  function generateCssBuilder(config) {
110
- var aliases = config.aliases, increment = config.increment, extras = config.extras, typeAliases = config.typeAliases, breakpoints = config.breakpoints, palette = config.palette, customSections = config.sections;
111
+ var aliases = config.aliases, fonts = config.fonts, increment = config.increment, extras = config.extras, typeAliases = config.typeAliases, breakpoints = config.breakpoints, palette = config.palette, customSections = config.sections;
111
112
  // Combine our out-of-the-box utility methods with any custom ones
112
113
  var sections = __assign(__assign(__assign({}, generateMethods(config, sections_1.defaultSections)), (customSections ? generateMethods(config, customSections) : {})), (aliases && { aliases: methods_1.newAliasesMethods(aliases) }));
113
114
  var Properties = ts_poet_1.imp("Properties@csstype");
@@ -119,10 +120,12 @@ function generateCssBuilder(config) {
119
120
  .flat();
120
121
  var typeAliasCode = Object.entries(__assign(__assign({}, exports.defaultTypeAliases), typeAliases)).map(function (_a) {
121
122
  var _b = __read(_a, 2), name = _b[0], props = _b[1];
122
- return "export type " + name + " = " + props
123
- .map(function (p) { return "\"" + p + "\""; })
124
- .join(" | ") + ";\n\n";
123
+ return "export type " + name + " = " + props.map(utils_1.quote).join(" | ") + ";\n\n";
125
124
  });
125
+ var typographyType = ts_poet_1.code(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n export type ", " = ", ";\n "], ["\n export type ", " = ",
126
+ ";\n "])), ts_poet_1.def("Typography"), Object.keys(fonts)
127
+ .map(utils_1.quote)
128
+ .join(" | "));
126
129
  var breakpointCode = breakpoints === undefined
127
130
  ? []
128
131
  : __spread([
@@ -132,8 +135,8 @@ function generateCssBuilder(config) {
132
135
  var _b = __read(_a, 2), name = _b[0], query = _b[1];
133
136
  return "export const " + name + " = \"" + query + "\" as Breakpoint;";
134
137
  }));
135
- return ts_poet_1.code(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n// This file is auto-generated by truss: https://github.com/homebound-team/truss.\n\n/** Given a type X, and the user's proposed type T, only allow keys in X and nothing else. */\nexport type Only<X, T> = X & Record<Exclude<keyof T, keyof X>, never>;\n\nexport type ", " = ", ";\n\ntype Opts<T> = {\n rules: T,\n enabled: boolean,\n important: boolean,\n selector: string | undefined\n};\n\n// prettier-ignore\nclass CssBuilder<T extends ", "> {\n constructor(private opts: Opts<T>) {}\n\n private get rules(): T { return this.opts.rules };\n private get enabled(): boolean { return this.opts.enabled };\n private get selector(): string | undefined { return this.opts.selector };\n private newCss(opts: Partial<Opts<T>>): CssBuilder<T> {\n return new CssBuilder({ ...this.opts, ...opts });\n }\n\n ", "\n get $(): T { return maybeImportant(sortObject(this.rules), this.opts.important); }\n\n if(t: boolean | Breakpoint) {\n if (typeof t === \"boolean\") {\n return this.newCss({ enabled: t });\n } else {\n return this.newCss({ selector: t as string });\n }\n }\n\n get else() {\n if (this.selector !== undefined) {\n throw new Error(\"else is not supported with if(selector)\");\n }\n return this.newCss({ enabled: !this.enabled });\n }\n\n get important() { return this.newCss({ important: true }); }\n\n /** Adds new properties, either a specific key/value or a Properties object, to the current css. */\n add<P extends Properties>(props: P): CssBuilder<T & P>;\n add<K extends keyof Properties>(prop: K, value: Properties[K]): CssBuilder<T & { [U in K]: Properties[K] }>;\n add<K extends keyof Properties>(propOrProperties: K | Properties, value?: Properties[K]): CssBuilder<any> {\n const newRules = typeof propOrProperties === \"string\" ? { [propOrProperties]: value } : propOrProperties;\n const rules = this.selector\n ? { ...this.rules, [this.selector]: { ...(this.rules as any)[this.selector], ...newRules } }\n : this.enabled ? { ...this.rules, ...newRules } : this.rules;\n return this.newCss({ rules: rules as any });\n }\n\n /** Adds new properties, either a specific key/value or a Properties object, to a nested selector. */\n addIn<P extends Properties>(selector: string, props: P | undefined): CssBuilder<T & P>;\n addIn<K extends keyof Properties>(selector: string, prop: K, value: Properties[K]): CssBuilder<T & { [U in K]: Properties[K] }>;\n addIn<K extends keyof Properties>(selector: string, propOrProperties: K | Properties, value?: Properties[K]): CssBuilder<any> {\n const newRules = typeof propOrProperties === \"string\" ? { [propOrProperties]: value } : propOrProperties;\n if (newRules === undefined) {\n return this;\n }\n const rules = { ...this.rules, [selector]: { ...(this.rules as any)[selector], ...newRules } };\n return this.newCss({ rules: rules as any });\n }\n}\n\n/** Emotion treats the same rules, ordered differently as different classes, but naively they can be the same. */\nfunction sortObject<T extends object>(obj: T): T {\n return Object.keys(obj)\n .sort()\n .reduce((acc, key) => {\n acc[key as keyof T] = obj[key as keyof T];\n return acc;\n }, ({} as any) as T) as T;\n}\n\n/** Conditionally adds `important!` to everything. */\nfunction maybeImportant<T extends object>(obj: T, important: boolean): T {\n if (important) {\n Object.keys(obj).forEach(key => {\n (obj as any)[key] = `${(obj as any)[key]} !important`;\n });\n }\n return obj;\n}\n\n/** Converts `inc` into pixels value with a `px` suffix. */\nexport function maybeInc(inc: number | string): string {\n return typeof inc === \"string\" ? inc : `${increment(inc)}px`;\n}\n\n/** Converts `inc` into pixels. */\nexport function increment(inc: number): number {\n return inc * ", ";\n}\n\n/** Convert `pixels` to a `px` units string so it's not ambiguous. */\nexport function px(pixels: number): string {\n return `${pixels}px`;\n}\n\nexport enum Palette {\n ", "\n}\n\n/** A shortcut for defining Xss types. */\nexport type Xss<P extends keyof Properties> = Pick<Properties, P>;\n\n/** An entry point for Css expressions. CssBuilder is immutable so this is safe to share. */\nexport const Css = new CssBuilder({ rules: {}, enabled: true, important: false, selector: undefined });\n\n", "\n\n", "\n\n", "\n "], ["\n// This file is auto-generated by truss: https://github.com/homebound-team/truss.\n\n/** Given a type X, and the user's proposed type T, only allow keys in X and nothing else. */\nexport type Only<X, T> = X & Record<Exclude<keyof T, keyof X>, never>;\n\nexport type ", " = ", ";\n\ntype Opts<T> = {\n rules: T,\n enabled: boolean,\n important: boolean,\n selector: string | undefined\n};\n\n// prettier-ignore\nclass CssBuilder<T extends ", "> {\n constructor(private opts: Opts<T>) {}\n\n private get rules(): T { return this.opts.rules };\n private get enabled(): boolean { return this.opts.enabled };\n private get selector(): string | undefined { return this.opts.selector };\n private newCss(opts: Partial<Opts<T>>): CssBuilder<T> {\n return new CssBuilder({ ...this.opts, ...opts });\n }\n\n ", "\n get $(): T { return maybeImportant(sortObject(this.rules), this.opts.important); }\n\n if(t: boolean | Breakpoint) {\n if (typeof t === \"boolean\") {\n return this.newCss({ enabled: t });\n } else {\n return this.newCss({ selector: t as string });\n }\n }\n\n get else() {\n if (this.selector !== undefined) {\n throw new Error(\"else is not supported with if(selector)\");\n }\n return this.newCss({ enabled: !this.enabled });\n }\n\n get important() { return this.newCss({ important: true }); }\n\n /** Adds new properties, either a specific key/value or a Properties object, to the current css. */\n add<P extends Properties>(props: P): CssBuilder<T & P>;\n add<K extends keyof Properties>(prop: K, value: Properties[K]): CssBuilder<T & { [U in K]: Properties[K] }>;\n add<K extends keyof Properties>(propOrProperties: K | Properties, value?: Properties[K]): CssBuilder<any> {\n const newRules = typeof propOrProperties === \"string\" ? { [propOrProperties]: value } : propOrProperties;\n const rules = this.selector\n ? { ...this.rules, [this.selector]: { ...(this.rules as any)[this.selector], ...newRules } }\n : this.enabled ? { ...this.rules, ...newRules } : this.rules;\n return this.newCss({ rules: rules as any });\n }\n\n /** Adds new properties, either a specific key/value or a Properties object, to a nested selector. */\n addIn<P extends Properties>(selector: string, props: P | undefined): CssBuilder<T & P>;\n addIn<K extends keyof Properties>(selector: string, prop: K, value: Properties[K]): CssBuilder<T & { [U in K]: Properties[K] }>;\n addIn<K extends keyof Properties>(selector: string, propOrProperties: K | Properties, value?: Properties[K]): CssBuilder<any> {\n const newRules = typeof propOrProperties === \"string\" ? { [propOrProperties]: value } : propOrProperties;\n if (newRules === undefined) {\n return this;\n }\n const rules = { ...this.rules, [selector]: { ...(this.rules as any)[selector], ...newRules } };\n return this.newCss({ rules: rules as any });\n }\n}\n\n/** Emotion treats the same rules, ordered differently as different classes, but naively they can be the same. */\nfunction sortObject<T extends object>(obj: T): T {\n return Object.keys(obj)\n .sort()\n .reduce((acc, key) => {\n acc[key as keyof T] = obj[key as keyof T];\n return acc;\n }, ({} as any) as T) as T;\n}\n\n/** Conditionally adds \\`important!\\` to everything. */\nfunction maybeImportant<T extends object>(obj: T, important: boolean): T {\n if (important) {\n Object.keys(obj).forEach(key => {\n (obj as any)[key] = \\`\\${(obj as any)[key]} !important\\`;\n });\n }\n return obj;\n}\n\n/** Converts \\`inc\\` into pixels value with a \\`px\\` suffix. */\nexport function maybeInc(inc: number | string): string {\n return typeof inc === \"string\" ? inc : \\`\\${increment(inc)}px\\`;\n}\n\n/** Converts \\`inc\\` into pixels. */\nexport function increment(inc: number): number {\n return inc * ", ";\n}\n\n/** Convert \\`pixels\\` to a \\`px\\` units string so it's not ambiguous. */\nexport function px(pixels: number): string {\n return \\`\\${pixels}px\\`;\n}\n\nexport enum Palette {\n ",
136
- "\n}\n\n/** A shortcut for defining Xss types. */\nexport type Xss<P extends keyof Properties> = Pick<Properties, P>;\n\n/** An entry point for Css expressions. CssBuilder is immutable so this is safe to share. */\nexport const Css = new CssBuilder({ rules: {}, enabled: true, important: false, selector: undefined });\n\n", "\n\n", "\n\n", "\n "])), ts_poet_1.def("Properties"), Properties, Properties, lines.join("\n ").replace(/ +\n/g, "\n"), increment, Object.entries(palette).map(function (_a) {
138
+ return ts_poet_1.code(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n// This file is auto-generated by truss: https://github.com/homebound-team/truss.\n\n/** Given a type X, and the user's proposed type T, only allow keys in X and nothing else. */\nexport type Only<X, T> = X & Record<Exclude<keyof T, keyof X>, never>;\n\nexport type ", " = ", ";\n\n", "\n\ntype Opts<T> = {\n rules: T,\n enabled: boolean,\n important: boolean,\n selector: string | undefined\n};\n\n// prettier-ignore\nclass CssBuilder<T extends ", "> {\n constructor(private opts: Opts<T>) {}\n\n private get rules(): T { return this.opts.rules };\n private get enabled(): boolean { return this.opts.enabled };\n private get selector(): string | undefined { return this.opts.selector };\n private newCss(opts: Partial<Opts<T>>): CssBuilder<T> {\n return new CssBuilder({ ...this.opts, ...opts });\n }\n\n ", "\n get $(): T { return maybeImportant(sortObject(this.rules), this.opts.important); }\n\n if(t: boolean | Breakpoint) {\n if (typeof t === \"boolean\") {\n return this.newCss({ enabled: t });\n } else {\n return this.newCss({ selector: t as string });\n }\n }\n\n get else() {\n if (this.selector !== undefined) {\n throw new Error(\"else is not supported with if(selector)\");\n }\n return this.newCss({ enabled: !this.enabled });\n }\n\n get important() { return this.newCss({ important: true }); }\n\n /** Adds new properties, either a specific key/value or a Properties object, to the current css. */\n add<P extends Properties>(props: P): CssBuilder<T & P>;\n add<K extends keyof Properties>(prop: K, value: Properties[K]): CssBuilder<T & { [U in K]: Properties[K] }>;\n add<K extends keyof Properties>(propOrProperties: K | Properties, value?: Properties[K]): CssBuilder<any> {\n const newRules = typeof propOrProperties === \"string\" ? { [propOrProperties]: value } : propOrProperties;\n const rules = this.selector\n ? { ...this.rules, [this.selector]: { ...(this.rules as any)[this.selector], ...newRules } }\n : this.enabled ? { ...this.rules, ...newRules } : this.rules;\n return this.newCss({ rules: rules as any });\n }\n\n /** Adds new properties, either a specific key/value or a Properties object, to a nested selector. */\n addIn<P extends Properties>(selector: string, props: P | undefined): CssBuilder<T & P>;\n addIn<K extends keyof Properties>(selector: string, prop: K, value: Properties[K]): CssBuilder<T & { [U in K]: Properties[K] }>;\n addIn<K extends keyof Properties>(selector: string, propOrProperties: K | Properties, value?: Properties[K]): CssBuilder<any> {\n const newRules = typeof propOrProperties === \"string\" ? { [propOrProperties]: value } : propOrProperties;\n if (newRules === undefined) {\n return this;\n }\n const rules = { ...this.rules, [selector]: { ...(this.rules as any)[selector], ...newRules } };\n return this.newCss({ rules: rules as any });\n }\n}\n\n/** Emotion treats the same rules, ordered differently as different classes, but naively they can be the same. */\nfunction sortObject<T extends object>(obj: T): T {\n return Object.keys(obj)\n .sort()\n .reduce((acc, key) => {\n acc[key as keyof T] = obj[key as keyof T];\n return acc;\n }, ({} as any) as T) as T;\n}\n\n/** Conditionally adds `important!` to everything. */\nfunction maybeImportant<T extends object>(obj: T, important: boolean): T {\n if (important) {\n Object.keys(obj).forEach(key => {\n (obj as any)[key] = `${(obj as any)[key]} !important`;\n });\n }\n return obj;\n}\n\n/** Converts `inc` into pixels value with a `px` suffix. */\nexport function maybeInc(inc: number | string): string {\n return typeof inc === \"string\" ? inc : `${increment(inc)}px`;\n}\n\n/** Converts `inc` into pixels. */\nexport function increment(inc: number): number {\n return inc * ", ";\n}\n\n/** Convert `pixels` to a `px` units string so it's not ambiguous. */\nexport function px(pixels: number): string {\n return `${pixels}px`;\n}\n\nexport enum Palette {\n ", "\n}\n\n/** A shortcut for defining Xss types. */\nexport type Xss<P extends keyof Properties> = Pick<Properties, P>;\n\n/** An entry point for Css expressions. CssBuilder is immutable so this is safe to share. */\nexport const Css = new CssBuilder({ rules: {}, enabled: true, important: false, selector: undefined });\n\n", "\n\n", "\n\n", "\n "], ["\n// This file is auto-generated by truss: https://github.com/homebound-team/truss.\n\n/** Given a type X, and the user's proposed type T, only allow keys in X and nothing else. */\nexport type Only<X, T> = X & Record<Exclude<keyof T, keyof X>, never>;\n\nexport type ", " = ", ";\n\n", "\n\ntype Opts<T> = {\n rules: T,\n enabled: boolean,\n important: boolean,\n selector: string | undefined\n};\n\n// prettier-ignore\nclass CssBuilder<T extends ", "> {\n constructor(private opts: Opts<T>) {}\n\n private get rules(): T { return this.opts.rules };\n private get enabled(): boolean { return this.opts.enabled };\n private get selector(): string | undefined { return this.opts.selector };\n private newCss(opts: Partial<Opts<T>>): CssBuilder<T> {\n return new CssBuilder({ ...this.opts, ...opts });\n }\n\n ", "\n get $(): T { return maybeImportant(sortObject(this.rules), this.opts.important); }\n\n if(t: boolean | Breakpoint) {\n if (typeof t === \"boolean\") {\n return this.newCss({ enabled: t });\n } else {\n return this.newCss({ selector: t as string });\n }\n }\n\n get else() {\n if (this.selector !== undefined) {\n throw new Error(\"else is not supported with if(selector)\");\n }\n return this.newCss({ enabled: !this.enabled });\n }\n\n get important() { return this.newCss({ important: true }); }\n\n /** Adds new properties, either a specific key/value or a Properties object, to the current css. */\n add<P extends Properties>(props: P): CssBuilder<T & P>;\n add<K extends keyof Properties>(prop: K, value: Properties[K]): CssBuilder<T & { [U in K]: Properties[K] }>;\n add<K extends keyof Properties>(propOrProperties: K | Properties, value?: Properties[K]): CssBuilder<any> {\n const newRules = typeof propOrProperties === \"string\" ? { [propOrProperties]: value } : propOrProperties;\n const rules = this.selector\n ? { ...this.rules, [this.selector]: { ...(this.rules as any)[this.selector], ...newRules } }\n : this.enabled ? { ...this.rules, ...newRules } : this.rules;\n return this.newCss({ rules: rules as any });\n }\n\n /** Adds new properties, either a specific key/value or a Properties object, to a nested selector. */\n addIn<P extends Properties>(selector: string, props: P | undefined): CssBuilder<T & P>;\n addIn<K extends keyof Properties>(selector: string, prop: K, value: Properties[K]): CssBuilder<T & { [U in K]: Properties[K] }>;\n addIn<K extends keyof Properties>(selector: string, propOrProperties: K | Properties, value?: Properties[K]): CssBuilder<any> {\n const newRules = typeof propOrProperties === \"string\" ? { [propOrProperties]: value } : propOrProperties;\n if (newRules === undefined) {\n return this;\n }\n const rules = { ...this.rules, [selector]: { ...(this.rules as any)[selector], ...newRules } };\n return this.newCss({ rules: rules as any });\n }\n}\n\n/** Emotion treats the same rules, ordered differently as different classes, but naively they can be the same. */\nfunction sortObject<T extends object>(obj: T): T {\n return Object.keys(obj)\n .sort()\n .reduce((acc, key) => {\n acc[key as keyof T] = obj[key as keyof T];\n return acc;\n }, ({} as any) as T) as T;\n}\n\n/** Conditionally adds \\`important!\\` to everything. */\nfunction maybeImportant<T extends object>(obj: T, important: boolean): T {\n if (important) {\n Object.keys(obj).forEach(key => {\n (obj as any)[key] = \\`\\${(obj as any)[key]} !important\\`;\n });\n }\n return obj;\n}\n\n/** Converts \\`inc\\` into pixels value with a \\`px\\` suffix. */\nexport function maybeInc(inc: number | string): string {\n return typeof inc === \"string\" ? inc : \\`\\${increment(inc)}px\\`;\n}\n\n/** Converts \\`inc\\` into pixels. */\nexport function increment(inc: number): number {\n return inc * ", ";\n}\n\n/** Convert \\`pixels\\` to a \\`px\\` units string so it's not ambiguous. */\nexport function px(pixels: number): string {\n return \\`\\${pixels}px\\`;\n}\n\nexport enum Palette {\n ",
139
+ "\n}\n\n/** A shortcut for defining Xss types. */\nexport type Xss<P extends keyof Properties> = Pick<Properties, P>;\n\n/** An entry point for Css expressions. CssBuilder is immutable so this is safe to share. */\nexport const Css = new CssBuilder({ rules: {}, enabled: true, important: false, selector: undefined });\n\n", "\n\n", "\n\n", "\n "])), ts_poet_1.def("Properties"), Properties, typographyType, Properties, lines.join("\n ").replace(/ +\n/g, "\n"), increment, Object.entries(palette).map(function (_a) {
137
140
  var _b = __read(_a, 2), name = _b[0], value = _b[1];
138
141
  return name + " = \"" + value + "\",";
139
142
  }), typeAliasCode, breakpointCode, extras || "");
@@ -145,5 +148,5 @@ function generateMethods(config, methodFns) {
145
148
  return [name, fn(config)];
146
149
  }));
147
150
  }
148
- var templateObject_1;
151
+ var templateObject_1, templateObject_2;
149
152
  //# sourceMappingURL=generate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yBAAoC;AACpC,mCAA+C;AAC/C,6CAAgD;AAEhD,qCAA8C;AAC9C,uCAA6C;AAEhC,QAAA,kBAAkB,GAA4C;IACzE,MAAM,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,CAAC;IAC5E,OAAO,EAAE;QACP,SAAS;QACT,YAAY;QACZ,cAAc;QACd,eAAe;QACf,aAAa;KACd;CACF,CAAC;AAEF,SAAsB,QAAQ,CAAC,MAAc;;;;;;oBACnC,UAAU,GAAK,MAAM,WAAX,CAAY;oBACf,qBAAM,kBAAkB,CAAC,MAAM,CAAC,CAAC,mBAAmB,EAAE,EAAA;;oBAA/D,MAAM,GAAG,SAAsD;oBACrE,qBAAM,aAAE,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC,EAAA;;oBAAtC,SAAsC,CAAC;;;;;CACxC;AAJD,4BAIC;AAED,SAAS,kBAAkB,CAAC,MAAc;IAEt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EAAY,MACX,KAtHW,aAAG,CAAC,YAAY,CAAC,EAAM,UAAU,EAE7C,cAAc,EAUa,UAAU,EAUnC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAuE5B,SAAS,EAStB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAC,EAAa;YAAb,KAAA,aAAa,EAAZ,IAAI,QAAA,EAAE,KAAK,QAAA;QACzC,OAAU,IAAI,aAAO,KAAK,QAAI,CAAC;IACjC,CAAC,CAAC,EASF,aAAa,EAEb,cAAc,EAEd,MAAM,IAAI,EAAE,EACV;AACJ,CAAC;AAED,wEAAwE;AACxE,SAAS,eAAe,CACtB,MAAc,EACd,SAAmB;IAEnB,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,UAAC,EAAU;YAAV,KAAA,aAAU,EAAT,IAAI,QAAA,EAAE,EAAE,QAAA;QAAM,OAAA,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;IAAlB,CAAkB,CAAC,CAClE,CAAC;AACJ,CAAC"}
@@ -69,4 +69,5 @@ export declare function newIncrementMethods(config: Config, abbr: UtilityName, c
69
69
  /** Creates `<abbr>X` utility methods that call an `abbr(number)` that the caller is responsible for creating. */
70
70
  export declare function newIncrementDelegateMethods(abbr: UtilityName, numberOfIncrements: number): UtilityMethod[];
71
71
  export declare function newPxMethod(abbr: UtilityName): UtilityName;
72
+ export declare const zeroTo: (n: number) => number[];
72
73
  //# sourceMappingURL=methods.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../src/methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,SAA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ED,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,CAE1D;AAED,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAAoC,CAAC"}
package/build/methods.js CHANGED
@@ -20,7 +20,7 @@ var __spread = (this && this.__spread) || function () {
20
20
  return ar;
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.newPxMethod = exports.newIncrementDelegateMethods = exports.newIncrementMethods = exports.newSetCssVariablesMethod = exports.newAliasesMethods = exports.newMethodsForProp = exports.newParamMethod = exports.newMethod = void 0;
23
+ exports.zeroTo = exports.newPxMethod = exports.newIncrementDelegateMethods = exports.newIncrementMethods = exports.newSetCssVariablesMethod = exports.newAliasesMethods = exports.newMethodsForProp = exports.newParamMethod = exports.newMethod = void 0;
24
24
  /**
25
25
  * Given a single abbreviation (i.e. `mt0`) and multiple `{ prop: value }` CSS values, returns
26
26
  * the TypeScript code for a `mt0` utility method that sets those values.
@@ -142,7 +142,7 @@ function newIncrementMethods(config, abbr, conf) {
142
142
  exports.newIncrementMethods = newIncrementMethods;
143
143
  /** Creates `<abbr>X` utility methods that call an `abbr(number)` that the caller is responsible for creating. */
144
144
  function newIncrementDelegateMethods(abbr, numberOfIncrements) {
145
- return zeroTo(numberOfIncrements).map(function (i) { return "get " + abbr + i + "() { return this." + abbr + "(" + i + "); }"; });
145
+ return exports.zeroTo(numberOfIncrements).map(function (i) { return "get " + abbr + i + "() { return this." + abbr + "(" + i + "); }"; });
146
146
  }
147
147
  exports.newIncrementDelegateMethods = newIncrementDelegateMethods;
148
148
  function newPxMethod(abbr) {
@@ -150,6 +150,7 @@ function newPxMethod(abbr) {
150
150
  }
151
151
  exports.newPxMethod = newPxMethod;
152
152
  var zeroTo = function (n) { return __spread(Array(n + 1).keys()); };
153
+ exports.zeroTo = zeroTo;
153
154
  /** Keeps numbers as literals, and wraps anything else with double quotes. */
154
155
  function maybeWrap(value) {
155
156
  return typeof value ===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AK,OAAA,SAAO,IAAI,GAAG,CAAC,yBAAoB,IAAI,SAAI,CAAC,SAAM,EAAlD,CAAkD,CAC1D,CAAC;AACJ,CAAC;AAPD,kEAOC;AAED,SAAgB,WAAW,CAAC,IAAiB;IAC3C,OAAU,IAAI,qCAAgC,IAAI,mBAAmB,CAAC;AACxE,CAAC;AAFD,kCAEC;AAEM,IAAM,MAAM,GAA4B,UAAC,CAAC,IAAK,gBAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,GAAvB,CAAwB,CAAC;AAAlE,QAAA,MAAM,UAA4D;AAE/E,6EAA6E;AAC7E,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAI,KAAK,OAAG,CAAC;AAClE,CAAC"}
@@ -13,6 +13,7 @@ export declare const defaultSections: {
13
13
  readonly fontWeight: import("..").MethodFn;
14
14
  readonly grid: import("..").MethodFn;
15
15
  readonly height: import("..").MethodFn;
16
+ readonly lineClamp: import("..").MethodFn;
16
17
  readonly objectFit: import("..").MethodFn;
17
18
  readonly outline: import("..").MethodFn;
18
19
  readonly overflow: import("..").MethodFn;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sections/index.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiClB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sections/index.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkClB,CAAC"}
@@ -15,6 +15,7 @@ var floats_1 = require("./floats");
15
15
  var fontWeight_1 = require("./fontWeight");
16
16
  var grid_1 = require("./grid");
17
17
  var heights_1 = require("./heights");
18
+ var lineClamp_1 = require("./lineClamp");
18
19
  var objectFit_1 = require("./objectFit");
19
20
  var outlines_1 = require("./outlines");
20
21
  var overflow_1 = require("./overflow");
@@ -48,6 +49,7 @@ exports.defaultSections = {
48
49
  fontWeight: fontWeight_1.fontWeight,
49
50
  grid: grid_1.grid,
50
51
  height: heights_1.height,
52
+ lineClamp: lineClamp_1.lineClamp,
51
53
  objectFit: objectFit_1.objectFit,
52
54
  outline: outlines_1.outline,
53
55
  overflow: overflow_1.overflow,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sections/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAClC,+CAA6C;AAC7C,+CAA8C;AAC9C,+CAA6C;AAC7C,+CAA6C;AAC7C,yCAAwC;AACxC,6CAA4C;AAC5C,mCAAkC;AAClC,qCAAoC;AACpC,qCAAoC;AACpC,mCAAiC;AACjC,2CAA0C;AAC1C,+BAA8B;AAC9B,qCAAmC;AACnC,yCAAwC;AACxC,uCAAqC;AACrC,uCAAsC;AACtC,uCAAsC;AACtC,iCAAgC;AAChC,qCAAoC;AACpC,yCAAwC;AACxC,mDAAkD;AAClD,iDAAgD;AAChD,yCAAwC;AACxC,2CAA0C;AAC1C,2CAA0C;AAC1C,iDAAgD;AAChD,2CAA0C;AAC1C,2CAA0C;AAC1C,mCAAiC;AACjC,yCAAwC;AACxC,mCAAkC;AAErB,QAAA,eAAe,GAAG;IAC7B,MAAM,iBAAA;IACN,WAAW,4BAAA;IACX,YAAY,6BAAA;IACZ,WAAW,4BAAA;IACX,WAAW,4BAAA;IACX,SAAS,uBAAA;IACT,WAAW,2BAAA;IACX,MAAM,iBAAA;IACN,OAAO,mBAAA;IACP,OAAO,mBAAA;IACP,KAAK,gBAAA;IACL,UAAU,yBAAA;IACV,IAAI,aAAA;IACJ,MAAM,kBAAA;IACN,SAAS,uBAAA;IACT,OAAO,oBAAA;IACP,QAAQ,qBAAA;IACR,QAAQ,qBAAA;IACR,KAAK,eAAA;IACL,OAAO,mBAAA;IACP,SAAS,uBAAA;IACT,cAAc,iCAAA;IACd,aAAa,+BAAA;IACb,SAAS,uBAAA;IACT,UAAU,yBAAA;IACV,UAAU,yBAAA;IACV,aAAa,+BAAA;IACb,UAAU,yBAAA;IACV,UAAU,yBAAA;IACV,KAAK,gBAAA;IACL,SAAS,uBAAA;IACT,MAAM,iBAAA;CACE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sections/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAClC,+CAA6C;AAC7C,+CAA8C;AAC9C,+CAA6C;AAC7C,+CAA6C;AAC7C,yCAAwC;AACxC,6CAA4C;AAC5C,mCAAkC;AAClC,qCAAoC;AACpC,qCAAoC;AACpC,mCAAiC;AACjC,2CAA0C;AAC1C,+BAA8B;AAC9B,qCAAmC;AACnC,yCAAwC;AACxC,yCAAwC;AACxC,uCAAqC;AACrC,uCAAsC;AACtC,uCAAsC;AACtC,iCAAgC;AAChC,qCAAoC;AACpC,yCAAwC;AACxC,mDAAkD;AAClD,iDAAgD;AAChD,yCAAwC;AACxC,2CAA0C;AAC1C,2CAA0C;AAC1C,iDAAgD;AAChD,2CAA0C;AAC1C,2CAA0C;AAC1C,mCAAiC;AACjC,yCAAwC;AACxC,mCAAkC;AAErB,QAAA,eAAe,GAAG;IAC7B,MAAM,iBAAA;IACN,WAAW,4BAAA;IACX,YAAY,6BAAA;IACZ,WAAW,4BAAA;IACX,WAAW,4BAAA;IACX,SAAS,uBAAA;IACT,WAAW,2BAAA;IACX,MAAM,iBAAA;IACN,OAAO,mBAAA;IACP,OAAO,mBAAA;IACP,KAAK,gBAAA;IACL,UAAU,yBAAA;IACV,IAAI,aAAA;IACJ,MAAM,kBAAA;IACN,SAAS,uBAAA;IACT,SAAS,uBAAA;IACT,OAAO,oBAAA;IACP,QAAQ,qBAAA;IACR,QAAQ,qBAAA;IACR,KAAK,eAAA;IACL,OAAO,mBAAA;IACP,SAAS,uBAAA;IACT,cAAc,iCAAA;IACd,aAAa,+BAAA;IACb,SAAS,uBAAA;IACT,UAAU,yBAAA;IACV,UAAU,yBAAA;IACV,aAAa,+BAAA;IACb,UAAU,yBAAA;IACV,UAAU,yBAAA;IACV,KAAK,gBAAA;IACL,SAAS,uBAAA;IACT,MAAM,iBAAA;CACE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { MethodFn } from "../config";
2
+ export declare const lineClamp: MethodFn;
3
+ //# sourceMappingURL=lineClamp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lineClamp.d.ts","sourceRoot":"","sources":["../../src/sections/lineClamp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,eAAO,MAAM,SAAS,EAAE,QAYvB,CAAC"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __read = (this && this.__read) || function (o, n) {
3
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
4
+ if (!m) return o;
5
+ var i = m.call(o), r, ar = [], e;
6
+ try {
7
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
+ }
9
+ catch (error) { e = { error: error }; }
10
+ finally {
11
+ try {
12
+ if (r && !r.done && (m = i["return"])) m.call(i);
13
+ }
14
+ finally { if (e) throw e.error; }
15
+ }
16
+ return ar;
17
+ };
18
+ var __spread = (this && this.__spread) || function () {
19
+ for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
20
+ return ar;
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.lineClamp = void 0;
24
+ var methods_1 = require("../methods");
25
+ // https://github.com/tailwindlabs/tailwindcss-line-clamp/
26
+ var lineClamp = function () { return __spread(methods_1.zeroTo(5).map(function (i) {
27
+ return methods_1.newMethod("lineClamp" + (i + 1), {
28
+ overflow: "hidden",
29
+ display: "-webkit-box",
30
+ WebkitBoxOrient: "vertical",
31
+ WebkitLineClamp: i + 1,
32
+ // tailwinds doesn't add this by default, but it seems like a good default for us.
33
+ textOverflow: "ellipsis",
34
+ });
35
+ }), [
36
+ methods_1.newMethod("lineClampNone", { WebkitLineClamp: "unset" }),
37
+ ]); };
38
+ exports.lineClamp = lineClamp;
39
+ //# sourceMappingURL=lineClamp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lineClamp.js","sourceRoot":"","sources":["../../src/sections/lineClamp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAA+C;AAG/C,0DAA0D;AACnD,IAAM,SAAS,GAAa,cAAM,gBACpC,gBAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC;IACjB,OAAA,mBAAS,CAAC,eAAY,CAAC,GAAG,CAAC,CAAE,EAAE;QAC7B,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,aAAa;QACtB,eAAe,EAAE,UAAU;QAC3B,eAAe,EAAE,CAAC,GAAG,CAAC;QACtB,kFAAkF;QAClF,YAAY,EAAE,UAAU;KACzB,CAAC;AAPF,CAOE,CACH;IACD,mBAAS,CAAC,eAAe,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC;IAXjB,CAYxC,CAAC;AAZW,QAAA,SAAS,aAYpB"}
package/build/utils.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export declare function lowerCaseFirst(s: string): string;
2
+ export declare function quote(s: string): string;
2
3
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,UAEvC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvC"}
package/build/utils.js CHANGED
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lowerCaseFirst = void 0;
3
+ exports.quote = exports.lowerCaseFirst = void 0;
4
4
  function lowerCaseFirst(s) {
5
5
  return s.charAt(0).toLowerCase() + s.substr(1);
6
6
  }
7
7
  exports.lowerCaseFirst = lowerCaseFirst;
8
+ function quote(s) {
9
+ return "\"" + s + "\"";
10
+ }
11
+ exports.quote = quote;
8
12
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,SAAgB,cAAc,CAAC,CAAS;IACtC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC;AAFD,wCAEC"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,SAAgB,cAAc,CAAC,CAAS;IACtC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC;AAFD,wCAEC;AAED,SAAgB,KAAK,CAAC,CAAS;IAC7B,OAAO,OAAI,CAAC,OAAG,CAAC;AAClB,CAAC;AAFD,sBAEC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/truss",
3
- "version": "1.103.0",
3
+ "version": "1.106.0",
4
4
  "main": "build/index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",