@lobehub/ui 6.0.2 → 6.0.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.
@@ -6,9 +6,9 @@ export declare const accordionStyles: {
6
6
  action: string;
7
7
  content: string;
8
8
  trigger: string;
9
- item: string;
10
9
  root: string;
11
10
  indicator: string;
11
+ item: string;
12
12
  itemOutlined: string;
13
13
  rootOutlined: string;
14
14
  actionAlwaysVisible: string;
@@ -14,13 +14,13 @@ export declare const textStyles: {
14
14
  text: string;
15
15
  disabled: string;
16
16
  danger: string;
17
- success: string;
18
17
  delete: string;
19
18
  ellipsis: string;
20
19
  italic: string;
21
20
  underline: string;
22
- info: string;
21
+ success: string;
23
22
  warning: string;
23
+ info: string;
24
24
  ellipsisMulti: string;
25
25
  secondary: string;
26
26
  };
package/es/styles/css.mjs CHANGED
@@ -39,7 +39,7 @@ const responsive = {
39
39
  };
40
40
  const emotion = createEmotion({
41
41
  key: "acss",
42
- speedy: false
42
+ speedy: true
43
43
  });
44
44
  const isSerialized = (value) => typeof value === "object" && value !== null && "name" in value && "styles" in value;
45
45
  const css = (template, ...args) => serializeStyles([template, ...args], emotion.cache.registered);
@@ -1 +1 @@
1
- {"version":3,"file":"css.mjs","names":[],"sources":["../../src/styles/css.ts"],"sourcesContent":["import createEmotion from '@emotion/css/create-instance';\nimport { type CSSInterpolation, type SerializedStyles, serializeStyles } from '@emotion/serialize';\n\nimport { createLobeToken, type LobeToken } from './theme/createLobeToken';\n\nconst UNITLESS = new Set([\n 'fontWeightStrong',\n 'lineHeight',\n 'lineHeightHeading1',\n 'lineHeightHeading2',\n 'lineHeightHeading3',\n 'lineHeightHeading4',\n 'lineHeightHeading5',\n 'lineHeightLG',\n 'lineHeightSM',\n 'opacityImage',\n 'opacityLoading',\n 'zIndexBase',\n 'zIndexPopupBase',\n]);\n\nconst IGNORED = new Set(['motionBase', 'motionUnit']);\n\nexport const toKebabCase = (str: string) =>\n str\n .replaceAll(/([a-z])([A-Z])/g, '$1-$2')\n .replaceAll(/([a-z])(\\d)/g, '$1-$2')\n .replaceAll(/(\\d)([A-Z])/g, '$1-$2')\n .replaceAll(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')\n .toLowerCase();\n\nexport const toCssVarName = (key: string) => `--lobe-${toKebabCase(key)}`;\n\nexport const toCssVariables = (token: Record<string, number | string>) =>\n Object.fromEntries(\n Object.entries(token)\n .filter(([key]) => !IGNORED.has(key))\n .map(([key, value]) => [\n toCssVarName(key),\n typeof value === 'number' && !UNITLESS.has(key)\n ? `${value}px`\n : String(value).replaceAll(/\\s+/g, ' ').trim(),\n ]),\n );\n\nexport type LobeCssVar = Record<Exclude<keyof LobeToken, 'motionBase' | 'motionUnit'>, string>;\n\nexport const cssVar = Object.fromEntries(\n Object.keys(createLobeToken({ appearance: 'light' }))\n .filter((key) => !IGNORED.has(key))\n .map((key) => [key, `var(${toCssVarName(key)})`]),\n) as LobeCssVar;\n\nconst breakpoints = {\n xs: '@media (max-width: 479.98px)',\n sm: '@media (max-width: 575.98px)',\n md: '@media (max-width: 767.98px)',\n lg: '@media (max-width: 991.98px)',\n xl: '@media (max-width: 1199.98px)',\n xxl: '@media (min-width: 1200px)',\n};\n\nexport const responsive = {\n ...breakpoints,\n desktop: breakpoints.xxl,\n laptop: breakpoints.lg,\n mobile: breakpoints.xs,\n tablet: breakpoints.md,\n};\n\nexport interface StaticStyleUtils {\n css: (template: TemplateStringsArray, ...args: any[]) => string;\n cssVar: LobeCssVar;\n cx: (...classNames: any[]) => string;\n responsive: typeof responsive;\n}\n\nconst emotion = createEmotion({ key: 'acss', speedy: false });\n\nconst isSerialized = (value: unknown): value is SerializedStyles =>\n typeof value === 'object' && value !== null && 'name' in value && 'styles' in value;\n\nexport const css = (\n template: TemplateStringsArray | CSSInterpolation,\n ...args: CSSInterpolation[]\n): SerializedStyles =>\n serializeStyles([template as CSSInterpolation, ...args], emotion.cache.registered);\n\nexport const cx = (...classNames: unknown[]): string =>\n emotion.cx(\n ...(classNames.map((value) => (isSerialized(value) ? emotion.css(value) : value)) as Parameters<\n typeof emotion.cx\n >),\n );\n\nexport const { injectGlobal, keyframes } = emotion;\n\nconst staticCss: StaticStyleUtils['css'] = (template, ...args) => emotion.css(template, ...args);\n\nexport const createStaticStyles = <T>(stylesFn: (utils: StaticStyleUtils) => T): T =>\n stylesFn({ css: staticCss, cssVar, cx, responsive });\n\nexport interface StaticStyleExtract {\n css: string;\n ids: string[];\n key: string;\n tag: string;\n}\n\n// emotion rehydrates `<style data-emotion=\"acss id…\">` from SSR into its cache on the client\nexport const extractStaticStyle = Object.assign(\n (html?: string, _options?: Record<string, unknown>): StaticStyleExtract[] => {\n const { inserted, key, registered } = emotion.cache;\n const used = html\n ? new Set([...html.matchAll(new RegExp(`${key}-([\\\\w-]+)`, 'g'))].map((match) => match[1]))\n : undefined;\n // Same rule as @emotion/server extractCritical: unregistered ids are globals/keyframes and always ship\n const ids = Object.keys(inserted).filter(\n (id) =>\n typeof inserted[id] === 'string' &&\n (!used || used.has(id) || registered[`${key}-${id}`] === undefined),\n );\n const styles = ids.map((id) => inserted[id]).join('');\n if (!styles) return [];\n return [\n {\n css: styles,\n ids,\n key,\n tag: `<style data-emotion=\"${key} ${ids.join(' ')}\">${styles}</style>`,\n },\n ];\n },\n { cache: emotion.cache },\n);\n"],"mappings":";;;;AAKA,MAAM,2BAAW,IAAI,IAAI;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,0BAAU,IAAI,IAAI,CAAC,cAAc,YAAY,CAAC;AAEpD,MAAa,eAAe,QAC1B,IACG,WAAW,mBAAmB,OAAO,CAAC,CACtC,WAAW,gBAAgB,OAAO,CAAC,CACnC,WAAW,gBAAgB,OAAO,CAAC,CACnC,WAAW,yBAAyB,OAAO,CAAC,CAC5C,YAAY;AAEjB,MAAa,gBAAgB,QAAgB,UAAU,YAAY,GAAG;AAEtE,MAAa,kB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KAAK;CAAW;CAAQ;CAAI;AAAW,CAAC;AAUrD,MAAa,qBAAqB,OAAO,QACtC,MAAe,aAA6D;CAC3E,MAAM,EAAE,UAAU,KAAK,eAAe,QAAQ;CAC9C,MAAM,OAAO,OACT,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,IAAI,OAAO,GAAG,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,UAAU,MAAM,EAAE,CAAC,IACxF,KAAA;CAEJ,MAAM,MAAM,OAAO,KAAK,QAAQ,CAAC,CAAC,QAC/B,OACC,OAAO,SAAS,QAAQ,aACvB,CAAC,QAAQ,KAAK,IAAI,EAAE,KAAK,WAAW,GAAG,IAAI,GAAG,UAAU,KAAA,EAC7D;CACA,MAAM,SAAS,IAAI,KAAK,OAAO,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE;CACpD,IAAI,CAAC,QAAQ,OAAO,CAAC;CACrB,OAAO,CACL;EACE,KAAK;EACL;EACA;EACA,KAAK,wBAAwB,IAAI,GAAG,IAAI,KAAK,GAAG,EAAE,IAAI,OAAO;CAC/D,CACF;AACF,GACA,EAAE,OAAO,QAAQ,MAAM,CACzB"}
1
+ {"version":3,"file":"css.mjs","names":[],"sources":["../../src/styles/css.ts"],"sourcesContent":["import createEmotion from '@emotion/css/create-instance';\nimport { type CSSInterpolation, type SerializedStyles, serializeStyles } from '@emotion/serialize';\n\nimport { createLobeToken, type LobeToken } from './theme/createLobeToken';\n\nconst UNITLESS = new Set([\n 'fontWeightStrong',\n 'lineHeight',\n 'lineHeightHeading1',\n 'lineHeightHeading2',\n 'lineHeightHeading3',\n 'lineHeightHeading4',\n 'lineHeightHeading5',\n 'lineHeightLG',\n 'lineHeightSM',\n 'opacityImage',\n 'opacityLoading',\n 'zIndexBase',\n 'zIndexPopupBase',\n]);\n\nconst IGNORED = new Set(['motionBase', 'motionUnit']);\n\nexport const toKebabCase = (str: string) =>\n str\n .replaceAll(/([a-z])([A-Z])/g, '$1-$2')\n .replaceAll(/([a-z])(\\d)/g, '$1-$2')\n .replaceAll(/(\\d)([A-Z])/g, '$1-$2')\n .replaceAll(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')\n .toLowerCase();\n\nexport const toCssVarName = (key: string) => `--lobe-${toKebabCase(key)}`;\n\nexport const toCssVariables = (token: Record<string, number | string>) =>\n Object.fromEntries(\n Object.entries(token)\n .filter(([key]) => !IGNORED.has(key))\n .map(([key, value]) => [\n toCssVarName(key),\n typeof value === 'number' && !UNITLESS.has(key)\n ? `${value}px`\n : String(value).replaceAll(/\\s+/g, ' ').trim(),\n ]),\n );\n\nexport type LobeCssVar = Record<Exclude<keyof LobeToken, 'motionBase' | 'motionUnit'>, string>;\n\nexport const cssVar = Object.fromEntries(\n Object.keys(createLobeToken({ appearance: 'light' }))\n .filter((key) => !IGNORED.has(key))\n .map((key) => [key, `var(${toCssVarName(key)})`]),\n) as LobeCssVar;\n\nconst breakpoints = {\n xs: '@media (max-width: 479.98px)',\n sm: '@media (max-width: 575.98px)',\n md: '@media (max-width: 767.98px)',\n lg: '@media (max-width: 991.98px)',\n xl: '@media (max-width: 1199.98px)',\n xxl: '@media (min-width: 1200px)',\n};\n\nexport const responsive = {\n ...breakpoints,\n desktop: breakpoints.xxl,\n laptop: breakpoints.lg,\n mobile: breakpoints.xs,\n tablet: breakpoints.md,\n};\n\nexport interface StaticStyleUtils {\n css: (template: TemplateStringsArray, ...args: any[]) => string;\n cssVar: LobeCssVar;\n cx: (...classNames: any[]) => string;\n responsive: typeof responsive;\n}\n\nconst emotion = createEmotion({ key: 'acss', speedy: true });\n\nconst isSerialized = (value: unknown): value is SerializedStyles =>\n typeof value === 'object' && value !== null && 'name' in value && 'styles' in value;\n\nexport const css = (\n template: TemplateStringsArray | CSSInterpolation,\n ...args: CSSInterpolation[]\n): SerializedStyles =>\n serializeStyles([template as CSSInterpolation, ...args], emotion.cache.registered);\n\nexport const cx = (...classNames: unknown[]): string =>\n emotion.cx(\n ...(classNames.map((value) => (isSerialized(value) ? emotion.css(value) : value)) as Parameters<\n typeof emotion.cx\n >),\n );\n\nexport const { injectGlobal, keyframes } = emotion;\n\nconst staticCss: StaticStyleUtils['css'] = (template, ...args) => emotion.css(template, ...args);\n\nexport const createStaticStyles = <T>(stylesFn: (utils: StaticStyleUtils) => T): T =>\n stylesFn({ css: staticCss, cssVar, cx, responsive });\n\nexport interface StaticStyleExtract {\n css: string;\n ids: string[];\n key: string;\n tag: string;\n}\n\n// emotion rehydrates `<style data-emotion=\"acss id…\">` from SSR into its cache on the client\nexport const extractStaticStyle = Object.assign(\n (html?: string, _options?: Record<string, unknown>): StaticStyleExtract[] => {\n const { inserted, key, registered } = emotion.cache;\n const used = html\n ? new Set([...html.matchAll(new RegExp(`${key}-([\\\\w-]+)`, 'g'))].map((match) => match[1]))\n : undefined;\n // Same rule as @emotion/server extractCritical: unregistered ids are globals/keyframes and always ship\n const ids = Object.keys(inserted).filter(\n (id) =>\n typeof inserted[id] === 'string' &&\n (!used || used.has(id) || registered[`${key}-${id}`] === undefined),\n );\n const styles = ids.map((id) => inserted[id]).join('');\n if (!styles) return [];\n return [\n {\n css: styles,\n ids,\n key,\n tag: `<style data-emotion=\"${key} ${ids.join(' ')}\">${styles}</style>`,\n },\n ];\n },\n { cache: emotion.cache },\n);\n"],"mappings":";;;;AAKA,MAAM,2BAAW,IAAI,IAAI;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,0BAAU,IAAI,IAAI,CAAC,cAAc,YAAY,CAAC;AAEpD,MAAa,eAAe,QAC1B,IACG,WAAW,mBAAmB,OAAO,CAAC,CACtC,WAAW,gBAAgB,OAAO,CAAC,CACnC,WAAW,gBAAgB,OAAO,CAAC,CACnC,WAAW,yBAAyB,OAAO,CAAC,CAC5C,YAAY;AAEjB,MAAa,gBAAgB,QAAgB,UAAU,YAAY,GAAG;AAEtE,MAAa,kBAAkB,UAC7B,OAAO,YACL,OA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AAW,CAAC;AAUrD,MAAa,qBAAqB,OAAO,QACtC,MAAe,aAA6D;CAC3E,MAAM,EAAE,UAAU,KAAK,eAAe,QAAQ;CAC9C,MAAM,OAAO,OACT,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,IAAI,OAAO,GAAG,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,UAAU,MAAM,EAAE,CAAC,IACxF,KAAA;CAEJ,MAAM,MAAM,OAAO,KAAK,QAAQ,CAAC,CAAC,QAC/B,OACC,OAAO,SAAS,QAAQ,aACvB,CAAC,QAAQ,KAAK,IAAI,EAAE,KAAK,WAAW,GAAG,IAAI,GAAG,UAAU,KAAA,EAC7D;CACA,MAAM,SAAS,IAAI,KAAK,OAAO,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE;CACpD,IAAI,CAAC,QAAQ,OAAO,CAAC;CACrB,OAAO,CACL;EACE,KAAK;EACL;EACA;EACA,KAAK,wBAAwB,IAAI,GAAG,IAAI,KAAK,GAAG,EAAE,IAAI,OAAO;CAC/D,CACF;AACF,GACA,EAAE,OAAO,QAAQ,MAAM,CACzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "6.0.2",
3
+ "version": "6.0.3",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",