@webority/tokens 0.164.0 → 0.165.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.
- package/LICENSE +1 -1
- package/dist/canvas/webority-phone.json +1 -1
- package/dist/canvas/webority-web-390.json +1 -1
- package/dist/canvas/webority-web.json +1 -1
- package/dist/emit/phone.d.ts +2 -0
- package/dist/emit/phone.js +3 -3
- package/dist/meanings.json +1 -1
- package/package.json +2 -2
- package/renames/0.165.0.json +53 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Copyright (c) Webority Technologies. All rights reserved.
|
|
2
2
|
|
|
3
|
-
This software and its
|
|
3
|
+
This software and its Webority packages are the proprietary and confidential property
|
|
4
4
|
of Webority Technologies. They are published publicly only for the convenience of
|
|
5
5
|
Webority's own projects and internal consumption.
|
|
6
6
|
|
package/dist/emit/phone.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export interface PhoneToken {
|
|
|
8
8
|
platforms: readonly ("web" | "phone")[] | null;
|
|
9
9
|
/** The com.webority extension object, or null. */
|
|
10
10
|
extensions: Record<string, unknown> | null;
|
|
11
|
+
/** What the token is for: required on a colour a brand adds, which the library has no name for. */
|
|
12
|
+
description: string | null;
|
|
11
13
|
}
|
|
12
14
|
export interface PhoneTokenSets {
|
|
13
15
|
light: readonly PhoneToken[];
|
package/dist/emit/phone.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{isObjectLike as e}from"../guards.js";import{present as t}from"../present.js";var n="// Generated by `webority brand --library` from packages/tokens/src/source. Do not edit: run `corepack pnpm --filter @webority/mobile-ui tokens`.",r=/^[A-Za-z_$][A-Za-z0-9_$]*$/,i=/^#([0-9a-fA-F]{6})([0-9a-fA-F]{2})?$/,a=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/,o=[`xs`,`sm`,`md`,`lg`,`xl`],s=`must be component.<name>.<prop> or component.<name>.<size>.<prop>`,c=[`light`,`dark`],l=new Map([[`color`,`colors`],[`space`,`space`],[`radius`,`radius`],[`text`,`text`],[`weight`,`weight`],[`leading`,`leading`],[`letter-spacing`,`letter-spacing`],[`font`,`font`],[`shadow`,`shadow`],[`size`,`size`],[`component`,`components`]]),u=[{key:`colors`,constName:`COLOR_NAMES`,typeName:`ColorName`},{key:`space`,constName:`SPACE_NAMES`,typeName:`SpaceName`},{key:`radius`,constName:`RADIUS_NAMES`,typeName:`RadiusName`},{key:`text`,constName:`TEXT_NAMES`,typeName:`TextName`},{key:`weight`,constName:`WEIGHT_NAMES`,typeName:`WeightName`},{key:`leading`,constName:`LEADING_NAMES`,typeName:`LeadingName`},{key:`letter-spacing`,constName:`LETTER_SPACING_NAMES`,typeName:`LetterSpacingName`},{key:`font`,constName:`FONT_NAMES`,typeName:`FontName`},{key:`shadow`,constName:`SHADOW_NAMES`,typeName:`ShadowName`},{key:`motion.duration`,constName:`DURATION_NAMES`,typeName:`DurationName`},{key:`motion.ease`,constName:`EASE_NAMES`,typeName:`EaseName`},{key:`size`,constName:`SIZE_NAMES`,typeName:`SizeName`}],d={space:`SpaceName`,text:`TextName`,radius:`RadiusName`,px:`number`,number:`number`,ms:`number`},f=[`export type FontWeightValue = "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";`,`/** Face name per weight; an empty object means the platform system font. */`,`export type FontFaces = Partial<Record<WeightName, string>>;`,`export interface PhoneShadow {`,` shadowColor: string;`,` shadowOffset: { width: number; height: number };`,` shadowOpacity: number;`,` shadowRadius: number;`,` elevation: number;`,`}`,`export type ComponentKind = "space" | "text" | "radius" | "px" | "number" | "ms";`,`type Sized<S extends string, T> = Record<S, T>;`,`type L3 = "sm" | "md" | "lg";`],p=[`export interface TokenSet {`,` mode: "light" | "dark";`,` colors: Record<ColorName, string>;`,` space: Record<SpaceName, number>;`,` radius: Record<RadiusName, number>;`,` text: Record<TextName, { size: number }>;`,` weight: Record<WeightName, FontWeightValue>;`,` leading: Record<LeadingName, number>;`,` "letter-spacing": Record<LetterSpacingName, number>;`,` font: Record<FontName, FontFaces>;`,` shadow: Record<ShadowName, PhoneShadow>;`,` motion: { duration: Record<DurationName, number>; ease: Record<EaseName, readonly [number, number, number, number]> };`,` size: Record<SizeName, number>;`,` components: ComponentTokens;`,`}`];function m(e,t){let n=e.contexts.find(e=>e.platform===`phone`&&e.mode===t);if(!n)throw Error(`phoneSets: the model has no ${t} phone context`);let r=[];for(let t of e.tokens.values()){if(!e.existsIn(t.path,n))continue;let i=e.resolvedIn(t.path,n);r.push({path:t.path.split(`.`),type:t.type,value:t.group===`text`?_(t.path,i):i,reference:e.referenceIn(t.path,n)??null,platforms:t.platforms,extensions:Object.keys(t.extensions).length>0?t.extensions:null})}return r}function h(e){let t=E(e.light),r=E(e.dark);I(t,r);let i=[n];for(let e of u)i.push(...B(e,b(t.lists,e.key)));return i.push(...f),i.push(...G(t.components)),i.push(...K(t.components)),i.push(...p),i.push(...Y(`lightTokens`,`light`,t)),i.push(...Y(`darkTokens`,`dark`,r)),{name:`tokens.generated.ts`,contents:`${i.join(`
|
|
2
|
-
`)}\n`}}function g(e,t,n){let r={colors:{light:{},dark:{}},radius:{},font:{}};for(let n of c){let i=E(e[n]).values,a=E(t[n]).values;for(let e of new Set([...i.keys(),...a.keys()])){let t=i.get(e),o=a.get(e);if(!t&&o&&e.startsWith(`colors.`))
|
|
3
|
-
`)}\n`}}function _(e,t){return{size:T(t,e)}}function v(t,n){return e(t)?t[n]:void 0}function y(e,n){return t(e[n],`token path segment ${n}`)}function b(e,n){return t(e.get(n),`phone emitter ${n} list`)}function x(e,n){return t(e.get(n),`phone emitter value for ${n}`).value}function S(e){return e.extensions?.internal===!0?!1:e.platforms===null||e.platforms.includes(`phone`)}function C(e,t){return Error(`Token group ${e} has no phone mapping; mark it web or add one to emit/phone.js (first: ${t})`)}function w(e){let[t,n]=e.path;if(t===`motion`){if(n===`duration`||n===`ease`)return`motion.${n}`;throw C(t,e.path.join(`.`))}let r=t===void 0?void 0:l.get(t);if(r===void 0)throw C(t,e.path.join(`.`));return r}function T(t,n){let r=e(t)?t.value:t;if(typeof r!=`number`||!Number.isFinite(r))throw Error(`Token ${n} has no numeric value`);return r}function E(e){let t=new Map(u.map(e=>[e.key,[]])),n=new Map,r=new Map;for(let i of e){if(!S(i))continue;let e=i.path.join(`.`),a=w(i);if(i.value===void 0||i.value===null)throw Error(`Token ${e} has no phone value`);if(a===`components`){P(i,e,n,r);continue}let o=i.path.slice(a.startsWith(`motion.`)?2:1).join(`-`);n.set(`${a}.${o}`,{path:e,value:D(a,o,i,e)}),b(t,a).push(o)}return{lists:t,values:n,components:r}}function D(e,t,n,r){let{value:i}=n;switch(e){case`colors`:return i;case`space`:case`radius`:case`letter-spacing`:case`size`:case`leading`:case`motion.duration`:return T(i,r);case`text`:return{size:T(v(i,`size`),r)};case`weight`:return String(T(i,r));case`font`:return O(n,t);case`shadow`:return k(n,t,r);case`motion.ease`:return j(i,r)}}function O(e,t){if(Array.isArray(e.value)&&e.value.length===1&&e.value[0]===`System`)return{};if(!e.extensions?.faces)throw Error(`Font ${t} is not the system font and has no faces`);return e.extensions.faces}function k(t,n,r){let i=t.value;if(!e(i))throw Error(`Shadow ${n} has no shadow value`);let{hex:a,opacity:o}=A(i.color,r),s=t.extensions?.elevation;if(typeof s!=`number`||!Number.isFinite(s))throw Error(`Shadow ${n} has no elevation`);return{shadowColor:a,shadowOffset:{width:T(i.offsetX,r),height:T(i.offsetY,r)},shadowOpacity:o,shadowRadius:T(i.blur,r),elevation:s}}function A(e,t){let n=typeof e==`string`?i.exec(e):null;if(n){let e=n[1],r=n[2];if(e===void 0)throw Error(`Shadow ${t} colour has no digits`);let i=r===void 0?1:Math.round(parseInt(r,16)/255*1e3)/1e3;return{hex:`#${e.toLowerCase()}`,opacity:i}}let r=typeof e==`string`?a.exec(e):null;if(r)return{hex:`#${r.slice(1,4).map(e=>Number(e).toString(16).padStart(2,`0`)).join(``)}`,opacity:Number(r[4])};throw Error(`Shadow ${t} colour is not #RRGGBB, #RRGGBBAA or rgba(): ${String(e)}`)}function j(e,t){if(!Array.isArray(e)||e.length!==4||!e.every(e=>Number.isFinite(e)))throw Error(`Token ${t} has no phone value`);return[...e]}function M(e){return e!==void 0&&o.includes(e)}function N(e,n){return t(e.props.get(n),`component prop ${n} kind`)}function P(e,t,n,r){let i=e.path,a=i.length===4;if(i.length!==3&&!a||a&&!M(i[2]))throw Error(`Component token ${t} ${s}`);let o=y(i,1),c=y(i,i.length-1),{kind:l,value:u}=F(e,t),d=r.get(o);if(d===void 0&&(d={props:new Map,sizes:new Map,free:new Map},r.set(o,d)),d.props.has(c)&&d.props.get(c)!==l)throw Error(`Component ${o} prop ${c} has two kinds`);if(d.props.set(c,l),a){let
|
|
1
|
+
import{isObjectLike as e}from"../guards.js";import{present as t}from"../present.js";var n="// Generated by `webority brand --library` from packages/tokens/src/source. Do not edit: run `corepack pnpm --filter @webority/mobile-ui tokens`.",r=/^[A-Za-z_$][A-Za-z0-9_$]*$/,i=/^#([0-9a-fA-F]{6})([0-9a-fA-F]{2})?$/,a=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/,o=[`xs`,`sm`,`md`,`lg`,`xl`],s=`must be component.<name>.<prop> or component.<name>.<size>.<prop>`,c=[`light`,`dark`],l=new Map([[`color`,`colors`],[`space`,`space`],[`radius`,`radius`],[`text`,`text`],[`weight`,`weight`],[`leading`,`leading`],[`letter-spacing`,`letter-spacing`],[`font`,`font`],[`shadow`,`shadow`],[`size`,`size`],[`component`,`components`]]),u=[{key:`colors`,constName:`COLOR_NAMES`,typeName:`ColorName`},{key:`space`,constName:`SPACE_NAMES`,typeName:`SpaceName`},{key:`radius`,constName:`RADIUS_NAMES`,typeName:`RadiusName`},{key:`text`,constName:`TEXT_NAMES`,typeName:`TextName`},{key:`weight`,constName:`WEIGHT_NAMES`,typeName:`WeightName`},{key:`leading`,constName:`LEADING_NAMES`,typeName:`LeadingName`},{key:`letter-spacing`,constName:`LETTER_SPACING_NAMES`,typeName:`LetterSpacingName`},{key:`font`,constName:`FONT_NAMES`,typeName:`FontName`},{key:`shadow`,constName:`SHADOW_NAMES`,typeName:`ShadowName`},{key:`motion.duration`,constName:`DURATION_NAMES`,typeName:`DurationName`},{key:`motion.ease`,constName:`EASE_NAMES`,typeName:`EaseName`},{key:`size`,constName:`SIZE_NAMES`,typeName:`SizeName`}],d={space:`SpaceName`,text:`TextName`,radius:`RadiusName`,px:`number`,number:`number`,ms:`number`},f=[`export type FontWeightValue = "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";`,`/** Face name per weight; an empty object means the platform system font. */`,`export type FontFaces = Partial<Record<WeightName, string>>;`,`export interface PhoneShadow {`,` shadowColor: string;`,` shadowOffset: { width: number; height: number };`,` shadowOpacity: number;`,` shadowRadius: number;`,` elevation: number;`,`}`,`export type ComponentKind = "space" | "text" | "radius" | "px" | "number" | "ms";`,`type Sized<S extends string, T> = Record<S, T>;`,`type L3 = "sm" | "md" | "lg";`],p=[`export interface TokenSet {`,` mode: "light" | "dark";`,` colors: Record<ColorName, string>;`,` space: Record<SpaceName, number>;`,` radius: Record<RadiusName, number>;`,` text: Record<TextName, { size: number }>;`,` weight: Record<WeightName, FontWeightValue>;`,` leading: Record<LeadingName, number>;`,` "letter-spacing": Record<LetterSpacingName, number>;`,` font: Record<FontName, FontFaces>;`,` shadow: Record<ShadowName, PhoneShadow>;`,` motion: { duration: Record<DurationName, number>; ease: Record<EaseName, readonly [number, number, number, number]> };`,` size: Record<SizeName, number>;`,` components: ComponentTokens;`,`}`];function m(e,t){let n=e.contexts.find(e=>e.platform===`phone`&&e.mode===t);if(!n)throw Error(`phoneSets: the model has no ${t} phone context`);let r=[];for(let t of e.tokens.values()){if(!e.existsIn(t.path,n))continue;let i=e.resolvedIn(t.path,n);r.push({path:t.path.split(`.`),type:t.type,value:t.group===`text`?_(t.path,i):i,reference:e.referenceIn(t.path,n)??null,platforms:t.platforms,extensions:Object.keys(t.extensions).length>0?t.extensions:null,description:t.description})}return r}function h(e){let t=E(e.light),r=E(e.dark);I(t,r);let i=[n];for(let e of u)i.push(...B(e,b(t.lists,e.key)));return i.push(...f),i.push(...G(t.components)),i.push(...K(t.components)),i.push(...p),i.push(...Y(`lightTokens`,`light`,t)),i.push(...Y(`darkTokens`,`dark`,r)),{name:`tokens.generated.ts`,contents:`${i.join(`
|
|
2
|
+
`)}\n`}}function g(e,t,n){let r={colors:{light:{},dark:{}},descriptions:{},radius:{},font:{}};for(let n of c){let i=E(e[n]).values,a=E(t[n]).values;for(let e of new Set([...i.keys(),...a.keys()])){let t=i.get(e),o=a.get(e);if(!t&&o&&e.startsWith(`colors.`)){let t=e.slice(7),i=o.description;if(i===null||i===``)throw Error(`Brand-only colour ${t} has no description`);r.colors[n][t]=o.value,r.descriptions[t]=i;continue}if(!t||!o)throw Error(R(e));if(JSON.stringify(t.value)===JSON.stringify(o.value))continue;let s=e.lastIndexOf(`.`),c=e.slice(0,s),l=e.slice(s+1);if(c===`radius`&&(l===`none`||l===`pill`))throw Error(`A brand cannot change radius none or pill`);if(c===`colors`)r.colors[n][l]=o.value;else if(c===`radius`)L(r.radius,l,o.value,e);else if(c===`font`)L(r.font,l,o.value,e);else throw Error(R(e))}}let i=Object.fromEntries(c.filter(e=>Object.keys(r.colors[e]).length>0).map(e=>[e,r.colors[e]])),a={};Object.keys(i).length>0&&(a.colors=i),Object.keys(r.radius).length>0&&(a.radius=r.radius),Object.keys(r.font).length>0&&(a.font=r.font),Object.keys(r.descriptions).length>0&&(a.descriptions=r.descriptions);let o=[`// Generated by \`webority brand\` for ${n.brand} from ${n.package} ${n.version}. Do not edit.`,``,`/** @type {import("@webority/mobile-ui").BrandOverrides} */`];return Object.keys(a).length===0?o.push(`export const brand = {};`):o.push(`export const brand = {`,...Object.entries(a).flatMap(([e,t])=>Z(e,t,` `)),`};`),{name:`brand.phone.js`,contents:`${o.join(`
|
|
3
|
+
`)}\n`}}function _(e,t){return{size:T(t,e)}}function v(t,n){return e(t)?t[n]:void 0}function y(e,n){return t(e[n],`token path segment ${n}`)}function b(e,n){return t(e.get(n),`phone emitter ${n} list`)}function x(e,n){return t(e.get(n),`phone emitter value for ${n}`).value}function S(e){return e.extensions?.internal===!0?!1:e.platforms===null||e.platforms.includes(`phone`)}function C(e,t){return Error(`Token group ${e} has no phone mapping; mark it web or add one to emit/phone.js (first: ${t})`)}function w(e){let[t,n]=e.path;if(t===`motion`){if(n===`duration`||n===`ease`)return`motion.${n}`;throw C(t,e.path.join(`.`))}let r=t===void 0?void 0:l.get(t);if(r===void 0)throw C(t,e.path.join(`.`));return r}function T(t,n){let r=e(t)?t.value:t;if(typeof r!=`number`||!Number.isFinite(r))throw Error(`Token ${n} has no numeric value`);return r}function E(e){let t=new Map(u.map(e=>[e.key,[]])),n=new Map,r=new Map;for(let i of e){if(!S(i))continue;let e=i.path.join(`.`),a=w(i);if(i.value===void 0||i.value===null)throw Error(`Token ${e} has no phone value`);if(a===`components`){P(i,e,n,r);continue}let o=i.path.slice(a.startsWith(`motion.`)?2:1).join(`-`);n.set(`${a}.${o}`,{path:e,value:D(a,o,i,e),description:i.description}),b(t,a).push(o)}return{lists:t,values:n,components:r}}function D(e,t,n,r){let{value:i}=n;switch(e){case`colors`:return i;case`space`:case`radius`:case`letter-spacing`:case`size`:case`leading`:case`motion.duration`:return T(i,r);case`text`:return{size:T(v(i,`size`),r)};case`weight`:return String(T(i,r));case`font`:return O(n,t);case`shadow`:return k(n,t,r);case`motion.ease`:return j(i,r)}}function O(e,t){if(Array.isArray(e.value)&&e.value.length===1&&e.value[0]===`System`)return{};if(!e.extensions?.faces)throw Error(`Font ${t} is not the system font and has no faces`);return e.extensions.faces}function k(t,n,r){let i=t.value;if(!e(i))throw Error(`Shadow ${n} has no shadow value`);let{hex:a,opacity:o}=A(i.color,r),s=t.extensions?.elevation;if(typeof s!=`number`||!Number.isFinite(s))throw Error(`Shadow ${n} has no elevation`);return{shadowColor:a,shadowOffset:{width:T(i.offsetX,r),height:T(i.offsetY,r)},shadowOpacity:o,shadowRadius:T(i.blur,r),elevation:s}}function A(e,t){let n=typeof e==`string`?i.exec(e):null;if(n){let e=n[1],r=n[2];if(e===void 0)throw Error(`Shadow ${t} colour has no digits`);let i=r===void 0?1:Math.round(parseInt(r,16)/255*1e3)/1e3;return{hex:`#${e.toLowerCase()}`,opacity:i}}let r=typeof e==`string`?a.exec(e):null;if(r)return{hex:`#${r.slice(1,4).map(e=>Number(e).toString(16).padStart(2,`0`)).join(``)}`,opacity:Number(r[4])};throw Error(`Shadow ${t} colour is not #RRGGBB, #RRGGBBAA or rgba(): ${String(e)}`)}function j(e,t){if(!Array.isArray(e)||e.length!==4||!e.every(e=>Number.isFinite(e)))throw Error(`Token ${t} has no phone value`);return[...e]}function M(e){return e!==void 0&&o.includes(e)}function N(e,n){return t(e.props.get(n),`component prop ${n} kind`)}function P(e,t,n,r){let i=e.path,a=i.length===4;if(i.length!==3&&!a||a&&!M(i[2]))throw Error(`Component token ${t} ${s}`);let o=y(i,1),c=y(i,i.length-1),{kind:l,value:u}=F(e,t),d=r.get(o);if(d===void 0&&(d={props:new Map,sizes:new Map,free:new Map},r.set(o,d)),d.props.has(c)&&d.props.get(c)!==l)throw Error(`Component ${o} prop ${c} has two kinds`);if(d.props.set(c,l),a){let r=y(i,2),a=d.sizes.get(r);a===void 0&&(a=new Map,d.sizes.set(r,a)),a.set(c,u),n.set(`components.${o}.${r}.${c}`,{path:t,value:u,description:e.description})}else d.free.set(c,u),n.set(`components.${o}.${c}`,{path:t,value:u,description:e.description})}function F(e,t){let{reference:n}=e;for(let[e,t]of[[`space.`,`space`],[`text.`,`text`],[`radius.`,`radius`]])if(n?.startsWith(e))return{kind:t,value:n.slice(e.length)};if(!n){if(e.type===`dimension`)return{kind:`px`,value:T(e.value,t)};if(e.type===`number`)return{kind:`number`,value:T(e.value,t)};if(e.type===`duration`)return{kind:`ms`,value:T(e.value,t)}}throw Error(`Component token ${t} has an unsupported value`)}function I(e,t){for(let[n,{path:r}]of e.values)if(!t.values.has(n))throw Error(`Token ${r} exists in one mode only`);for(let[n,{path:r}]of t.values)if(!e.values.has(n))throw Error(`Token ${r} exists in one mode only`)}function L(e,t,n,r){if(Object.hasOwn(e,t)&&JSON.stringify(e[t])!==JSON.stringify(n))throw Error(`A brand sets ${r} differently in light and dark`);e[t]=n}function R(e){return`A brand overrides colours, radius and fonts only; ${e} differs`}function z(e){return r.test(e)?e:JSON.stringify(e)}function B(e,t){let n=`export type ${e.typeName} = (typeof ${e.constName})[number];`;return t.length<=12?[`export const ${e.constName} = [${t.map(e=>JSON.stringify(e)).join(`, `)}] as const;`,n]:[`export const ${e.constName} = [`,...t.map(e=>` ${JSON.stringify(e)},`),`] as const;`,n]}var V=140;function H(e,t){return t.map(t=>`${z(t)}: ${d[N(e,t)]}`)}function U(e){return e.split(/[^A-Za-z0-9]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function W(e,t){return[`export interface ${e} {`,...t.map(e=>` ${e};`),`}`]}function G(e){let t=[],n=[];for(let[r,i]of e){let e=H(i,[...i.free.keys()]),a=H(i,[...new Set([...i.sizes.values()].flatMap(e=>[...e.keys()]))]),s=o.filter(e=>i.sizes.has(e)),c=s.join()===`sm,md,lg`?`L3`:s.map(e=>JSON.stringify(e)).join(` | `),l=e=>`{ ${e.join(`; `)} }`,u=(t,n)=>a.length===0?n:`Sized<${c}, ${t}>${e.length>0?` & ${n}`:``}`,d=` ${z(r)}: ${u(l(a),l(e))};`;if(d.length<=V){n.push(d);continue}let f=U(r);a.length>0&&t.push(...W(`${f}SizeTokens`,a)),e.length>0&&t.push(...W(`${f}Tokens`,e)),n.push(` ${z(r)}: ${u(`${f}SizeTokens`,`${f}Tokens`)};`)}let r=[...t,`export interface ComponentTokens {`,...n];return r.push(`}`,`export type ComponentName = keyof ComponentTokens;`,`type SizeKeysOf<C extends ComponentName> = Extract<keyof ComponentTokens[C], "xs" | "sm" | "md" | "lg" | "xl">;`,`export type ComponentSizeTokens<C extends ComponentName> = ComponentTokens[C][SizeKeysOf<C>];`),r}function K(e){let t=[`export const COMPONENT_KINDS = {`];for(let[n,r]of e){let e=[...r.props].map(([e,t])=>`${z(e)}: ${JSON.stringify(t)}`),i=` ${z(n)}: { ${e.join(`, `)} },`;i.length<=V?t.push(i):t.push(` ${z(n)}: {`,...e.map(e=>` ${e},`),` },`)}return t.push(`} as const satisfies { readonly [C in ComponentName]: Readonly<Record<string, ComponentKind>> };`),t}function q(e){let t={};for(let[n,r]of e){let e={};for(let t of o){let n=r.sizes.get(t);n!==void 0&&(e[t]=Object.fromEntries(n))}for(let[t,n]of r.free)e[t]=n;t[n]=e}return t}function J(e,t){let{lists:n}=t,r=(e,n)=>Object.fromEntries(n.map(n=>[n,x(t.values,`${e}.${n}`)]));return{mode:e,colors:r(`colors`,b(n,`colors`)),space:r(`space`,b(n,`space`)),radius:r(`radius`,b(n,`radius`)),text:r(`text`,b(n,`text`)),weight:r(`weight`,b(n,`weight`)),leading:r(`leading`,b(n,`leading`)),"letter-spacing":r(`letter-spacing`,b(n,`letter-spacing`)),font:r(`font`,b(n,`font`)),shadow:r(`shadow`,b(n,`shadow`)),motion:{duration:r(`motion.duration`,b(n,`motion.duration`)),ease:r(`motion.ease`,b(n,`motion.ease`))},size:r(`size`,b(n,`size`)),components:q(t.components)}}function Y(e,t,n){let r=J(t,n);return[`export const ${e}: TokenSet = {`,...Object.entries(r).flatMap(([e,t])=>Z(e,t,` `)),`};`]}function X(e){return Array.isArray(e)?`[${e.map(e=>X(e)).join(`, `)}]`:JSON.stringify(e)}function Z(e,t,n){let r=`${n}${z(e)}`;if(typeof t==`object`&&t&&!Array.isArray(t)){let e=Object.entries(t);return e.length===0?[`${r}: {},`]:[`${r}: {`,...e.flatMap(([e,t])=>Z(e,t,`${n} `)),`${n}},`]}return[`${r}: ${X(t)},`]}export{g as emitPhoneBrand,h as emitPhoneTheme,m as phoneSets};
|
package/dist/meanings.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/tokens",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.165.0",
|
|
4
4
|
"description": "The Webority design tokens in one W3C Design Tokens source (palette, scale, meaning and component tiers, with light and dark, web and phone, and 390 and 1440 widths), and the webority command that brands a product, upgrades it between releases and checks it against the token source.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@babel/types": "7.29.8",
|
|
43
43
|
"@types/node": "25.6.0",
|
|
44
|
-
"@webority/biome-config": "0.
|
|
44
|
+
"@webority/biome-config": "0.165.0",
|
|
45
45
|
"ajv": "8.20.0",
|
|
46
46
|
"typescript": "^7.0.2",
|
|
47
47
|
"vite": "^8.3.6"
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.165.0",
|
|
3
|
+
"css": {
|
|
4
|
+
"rename": [],
|
|
5
|
+
"reads": [],
|
|
6
|
+
"choose": {},
|
|
7
|
+
"checkRole": []
|
|
8
|
+
},
|
|
9
|
+
"classes": [],
|
|
10
|
+
"themeReads": [],
|
|
11
|
+
"props": [],
|
|
12
|
+
"propValues": [],
|
|
13
|
+
"propSplits": [],
|
|
14
|
+
"razorAttributes": [],
|
|
15
|
+
"componentProps": [],
|
|
16
|
+
"valueSplits": [],
|
|
17
|
+
"components": [],
|
|
18
|
+
"razorValueSplits": [],
|
|
19
|
+
"razorTags": [],
|
|
20
|
+
"razorEnumAttributes": [],
|
|
21
|
+
"razorListAttributes": [],
|
|
22
|
+
"csharpEnumArguments": [],
|
|
23
|
+
"markup": {
|
|
24
|
+
"literals": [],
|
|
25
|
+
"flags": [
|
|
26
|
+
{
|
|
27
|
+
"pattern": "<app-(resizable|resizable-handle|resizable-panel|rolling-number|row-switch)\\b",
|
|
28
|
+
"hint": "removed in 0.165.0 with no successor: delete the tag"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"pattern": "<wui-(resizable|rolling-number)\\b",
|
|
32
|
+
"hint": "removed in 0.165.0 with no successor: delete the element"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"source": {
|
|
37
|
+
"literals": [],
|
|
38
|
+
"members": [],
|
|
39
|
+
"flags": [],
|
|
40
|
+
"removedImports": [
|
|
41
|
+
{
|
|
42
|
+
"package": "@webority/ui-react",
|
|
43
|
+
"names": ["AppResizable", "AppResizableHandle", "AppResizablePanel", "AppRollingNumber", "AppRowSwitch"],
|
|
44
|
+
"hint": "removed in 0.165.0 with no successor: delete the use"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"package": "@webority/ui-elements",
|
|
48
|
+
"names": ["WuiResizable", "WuiRollingNumber"],
|
|
49
|
+
"hint": "removed in 0.165.0 with no successor: delete the use"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|