@lobehub/ui 5.31.1 → 5.32.1
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/es/Alert/style.mjs +17 -4
- package/es/Alert/style.mjs.map +1 -1
- package/es/ColorSwatches/ColorSwatches.mjs +3 -3
- package/es/ColorSwatches/ColorSwatches.mjs.map +1 -1
- package/es/_virtual/_rolldown/runtime.mjs +1 -0
- package/es/base-ui/Input/style.d.mts +2 -2
- package/es/static-css/baseline.d.mts +6 -0
- package/es/static-css/baseline.mjs +39 -0
- package/es/static-css/baseline.mjs.map +1 -0
- package/es/static-css/buildAntdStaticCss.d.mts +31 -0
- package/es/static-css/buildAntdStaticCss.mjs +71 -0
- package/es/static-css/buildAntdStaticCss.mjs.map +1 -0
- package/es/static-css/emit/index.d.mts +18 -0
- package/es/static-css/emit/index.mjs +42 -0
- package/es/static-css/emit/index.mjs.map +1 -0
- package/es/static-css/hash.mjs +7 -0
- package/es/static-css/hash.mjs.map +1 -0
- package/es/static-css/index.d.mts +6 -0
- package/es/static-css/index.d.ts +1 -0
- package/es/static-css/index.js +1 -0
- package/es/static-css/index.mjs +6 -0
- package/es/static-css/registry.d.mts +20 -0
- package/es/static-css/registry.mjs +298 -0
- package/es/static-css/registry.mjs.map +1 -0
- package/es/static-css/runtime/index.d.mts +14 -0
- package/es/static-css/runtime/index.mjs +34 -0
- package/es/static-css/runtime/index.mjs.map +1 -0
- package/es/static-css/scan.d.mts +19 -0
- package/es/static-css/scan.mjs +87 -0
- package/es/static-css/scan.mjs.map +1 -0
- package/es/static-css/shared.mjs +6 -0
- package/es/static-css/shared.mjs.map +1 -0
- package/es/static-css/themeVars.d.mts +22 -0
- package/es/static-css/themeVars.mjs +130 -0
- package/es/static-css/themeVars.mjs.map +1 -0
- package/es/static-css/vite/index.d.mts +14 -0
- package/es/static-css/vite/index.mjs +48 -0
- package/es/static-css/vite/index.mjs.map +1 -0
- package/package.json +17 -1
package/es/Alert/style.mjs
CHANGED
|
@@ -69,21 +69,34 @@ const styles = createStaticStyles(({ css, cssVar }) => {
|
|
|
69
69
|
|
|
70
70
|
max-width: 100%;
|
|
71
71
|
|
|
72
|
+
/* Every control anchors itself to the title's FIRST 24px line box via
|
|
73
|
+
align-self. Root-level align-items cannot be relied on: antd v6's own
|
|
74
|
+
base style centers the row, and whether it or these static styles win
|
|
75
|
+
depends on stylesheet injection order, which differs between
|
|
76
|
+
environments. Centering the row is also wrong for message-only alerts
|
|
77
|
+
whose content wraps - the icon drifts to the middle of the block. */
|
|
72
78
|
.${prefixCls}-alert-icon {
|
|
73
79
|
display: flex;
|
|
74
80
|
align-items: center;
|
|
81
|
+
align-self: flex-start;
|
|
82
|
+
|
|
75
83
|
height: 24px;
|
|
76
84
|
margin: 0;
|
|
77
85
|
}
|
|
78
86
|
.${prefixCls}-alert-close-icon {
|
|
79
87
|
display: flex;
|
|
80
88
|
align-items: center;
|
|
89
|
+
align-self: flex-start;
|
|
90
|
+
|
|
81
91
|
height: 24px;
|
|
82
92
|
margin: 0;
|
|
83
93
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
.${prefixCls}-alert-actions {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
align-self: flex-start;
|
|
98
|
+
height: 24px;
|
|
99
|
+
}
|
|
87
100
|
`,
|
|
88
101
|
rootNoTitleNoIconNoClosable: css`
|
|
89
102
|
gap: 8px;
|
|
@@ -290,7 +303,7 @@ const rootVariants = cva(styles.rootBase, {
|
|
|
290
303
|
true: styles.glass
|
|
291
304
|
},
|
|
292
305
|
hasTitle: {
|
|
293
|
-
false:
|
|
306
|
+
false: null,
|
|
294
307
|
true: null
|
|
295
308
|
},
|
|
296
309
|
showIcon: {
|
package/es/Alert/style.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","names":["lobeStaticStylish"],"sources":["../../src/Alert/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\nimport { cva } from 'class-variance-authority';\n\nimport { lobeStaticStylish } from '@/styles';\n\nconst prefixCls = 'ant';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => {\n return {\n banner: css`\n border: none !important;\n border-radius: 0 !important;\n `,\n borderless: css`\n padding: 0 !important;\n border: none !important;\n background: transparent !important;\n `,\n borderlessExtraHeaderNoTitle: css`\n margin-block-start: 8px;\n padding-inline: 0;\n `,\n borderlessExtraHeaderWithTitle: css`\n margin-block-start: 16px;\n padding-inline: 0;\n `,\n colorfulText: css`\n .${prefixCls}-alert-message,.${prefixCls}-alert-description {\n color: inherit;\n }\n `,\n expandText: css`\n padding-inline-end: 12px;\n\n &:hover {\n cursor: pointer;\n }\n `,\n extra: css`\n position: relative;\n\n overflow: hidden;\n\n max-width: 100%;\n border: 1px solid;\n border-block-start: none;\n border-end-start-radius: ${cssVar.borderRadiusLG};\n border-end-end-radius: ${cssVar.borderRadiusLG};\n `,\n extraHeader: css`\n border-block-start: 1px dashed;\n border-radius: 0;\n background: transparent !important;\n `,\n filled: css``,\n glass: lobeStaticStylish.blur,\n hasExtra: css`\n border-block-end: none;\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n `,\n outlined: css`\n background: transparent !important;\n `,\n // Root variants based on closable, hasTitle, showIcon combinations\n rootBase: css`\n position: relative;\n\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n\n max-width: 100%;\n\n .${prefixCls}-alert-icon {\n display: flex;\n align-items: center;\n height: 24px;\n margin: 0;\n }\n .${prefixCls}-alert-close-icon {\n display: flex;\n align-items: center;\n height: 24px;\n margin: 0;\n }\n `,\n rootSingleLine: css`\n align-items: center;\n `,\n rootNoTitleNoIconNoClosable: css`\n gap: 8px;\n padding-block: 8px;\n padding-inline: 12px;\n\n .${prefixCls}-alert-title {\n font-weight: 400;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n `,\n rootNoTitleNoIconWithClosable: css`\n gap: 8px;\n padding-block: 8px;\n padding-inline: 12px 9px;\n\n .${prefixCls}-alert-title {\n font-weight: 400;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n `,\n rootNoTitleWithIconNoClosable: css`\n gap: 8px;\n padding-block: 8px;\n padding-inline: 9px 12px;\n\n .${prefixCls}-alert-title {\n font-weight: 400;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n `,\n rootNoTitleWithIconWithClosable: css`\n gap: 8px;\n padding-block: 8px;\n padding-inline: 9px;\n\n .${prefixCls}-alert-title {\n font-weight: 400;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n `,\n rootWithTitleNoIconNoClosable: css`\n gap: 12px;\n padding-block: 16px;\n padding-inline: 16px;\n\n .${prefixCls}-alert-title {\n font-weight: 500;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n .${prefixCls}-alert-description {\n line-height: 1.5;\n word-break: normal;\n opacity: 0.75;\n }\n `,\n rootWithTitleNoIconWithClosable: css`\n gap: 12px;\n padding-block: 16px;\n padding-inline: 16px 12px;\n\n .${prefixCls}-alert-title {\n font-weight: 500;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n .${prefixCls}-alert-description {\n line-height: 1.5;\n word-break: normal;\n opacity: 0.75;\n }\n `,\n rootWithTitleWithIconNoClosable: css`\n gap: 12px;\n padding-block: 16px;\n padding-inline: 12px 16px;\n\n .${prefixCls}-alert-title {\n font-weight: 500;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n .${prefixCls}-alert-description {\n line-height: 1.5;\n word-break: normal;\n opacity: 0.75;\n }\n `,\n rootWithTitleWithIconWithClosable: css`\n gap: 12px;\n padding-block: 16px;\n padding-inline: 12px;\n\n .${prefixCls}-alert-title {\n font-weight: 500;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n .${prefixCls}-alert-description {\n line-height: 1.5;\n word-break: normal;\n opacity: 0.75;\n }\n `,\n };\n});\n\nexport const extraVariants = cva(styles.extra, {\n defaultVariants: {\n variant: 'filled',\n },\n\n variants: {\n variant: {\n filled: styles.filled,\n outlined: styles.outlined,\n borderless: styles.borderless,\n },\n banner: {\n false: null,\n true: styles.banner,\n },\n },\n});\n\nexport const rootVariants = cva(styles.rootBase, {\n compoundVariants: [\n {\n class: styles.rootNoTitleNoIconNoClosable,\n closable: false,\n hasTitle: false,\n showIcon: false,\n },\n {\n class: styles.rootNoTitleNoIconWithClosable,\n closable: true,\n hasTitle: false,\n showIcon: false,\n },\n {\n class: styles.rootNoTitleWithIconNoClosable,\n closable: false,\n hasTitle: false,\n showIcon: true,\n },\n {\n class: styles.rootNoTitleWithIconWithClosable,\n closable: true,\n hasTitle: false,\n showIcon: true,\n },\n {\n class: styles.rootWithTitleNoIconNoClosable,\n closable: false,\n hasTitle: true,\n showIcon: false,\n },\n {\n class: styles.rootWithTitleNoIconWithClosable,\n closable: true,\n hasTitle: true,\n showIcon: false,\n },\n {\n class: styles.rootWithTitleWithIconNoClosable,\n closable: false,\n hasTitle: true,\n showIcon: true,\n },\n {\n class: styles.rootWithTitleWithIconWithClosable,\n closable: true,\n hasTitle: true,\n showIcon: true,\n },\n ],\n defaultVariants: {\n closable: false,\n colorfulText: true,\n glass: false,\n hasTitle: false,\n showIcon: false,\n variant: 'filled',\n },\n\n variants: {\n closable: {\n false: null,\n true: null,\n },\n colorfulText: {\n false: null,\n true: styles.colorfulText,\n },\n glass: {\n false: null,\n true: styles.glass,\n },\n hasTitle: {\n false: styles.rootSingleLine,\n true: null,\n },\n showIcon: {\n false: null,\n true: null,\n },\n variant: {\n borderless: styles.borderless,\n filled: styles.filled,\n outlined: styles.outlined,\n },\n hasExtra: {\n false: null,\n true: styles.hasExtra,\n },\n },\n});\n\nexport const extraHeaderVariants = cva(styles.extraHeader, {\n compoundVariants: [\n {\n class: styles.borderlessExtraHeaderNoTitle,\n hasTitle: false,\n variant: 'borderless',\n },\n {\n class: styles.borderlessExtraHeaderWithTitle,\n hasTitle: true,\n variant: 'borderless',\n },\n ],\n defaultVariants: {\n hasTitle: false,\n variant: 'filled',\n },\n\n variants: {\n hasTitle: {\n false: null,\n true: null,\n },\n variant: {\n borderless: null,\n filled: null,\n outlined: null,\n },\n },\n});\n"],"mappings":";;;;AAKA,MAAM,YAAY;AAElB,MAAa,SAAS,oBAAoB,EAAE,KAAK,aAAa;CAC5D,OAAO;EACL,QAAQ,GAAG;;;;EAIX,YAAY,GAAG;;;;;EAKf,8BAA8B,GAAG;;;;EAIjC,gCAAgC,GAAG;;;;EAInC,cAAc,GAAG;SACZ,UAAU,kBAAkB,UAAU;;;;EAI3C,YAAY,GAAG;;;;;;;EAOf,OAAO,GAAG;;;;;;;;iCAQmB,OAAO,eAAe;+BACxB,OAAO,eAAe;;EAEjD,aAAa,GAAG;;;;;EAKhB,QAAQ,GAAG;EACX,OAAOA,cAAkB;EACzB,UAAU,GAAG;;;;;EAKb,UAAU,GAAG;;;EAIb,UAAU,GAAG;;;;;;;;;SASR,UAAU;;;;;;SAMV,UAAU;;;;;;;EAOf,gBAAgB,GAAG;;;EAGnB,6BAA6B,GAAG;;;;;SAK3B,UAAU;;;;;;;EAOf,+BAA+B,GAAG;;;;;SAK7B,UAAU;;;;;;;EAOf,+BAA+B,GAAG;;;;;SAK7B,UAAU;;;;;;;EAOf,iCAAiC,GAAG;;;;;SAK/B,UAAU;;;;;;;EAOf,+BAA+B,GAAG;;;;;SAK7B,UAAU;;;;;;SAMV,UAAU;;;;;;EAMf,iCAAiC,GAAG;;;;;SAK/B,UAAU;;;;;;SAMV,UAAU;;;;;;EAMf,iCAAiC,GAAG;;;;;SAK/B,UAAU;;;;;;SAMV,UAAU;;;;;;EAMf,mCAAmC,GAAG;;;;;SAKjC,UAAU;;;;;;SAMV,UAAU;;;;;;CAMjB;AACF,CAAC;AAED,MAAa,gBAAgB,IAAI,OAAO,OAAO;CAC7C,iBAAiB,EACf,SAAS,SACX;CAEA,UAAU;EACR,SAAS;GACP,QAAQ,OAAO;GACf,UAAU,OAAO;GACjB,YAAY,OAAO;EACrB;E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EACR,UAAU;GACR,OAAO;GACP,MAAM;EACR;EACA,SAAS;GACP,YAAY;GACZ,QAAQ;GACR,UAAU;EACZ;CACF;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"style.mjs","names":["lobeStaticStylish"],"sources":["../../src/Alert/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\nimport { cva } from 'class-variance-authority';\n\nimport { lobeStaticStylish } from '@/styles';\n\nconst prefixCls = 'ant';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => {\n return {\n banner: css`\n border: none !important;\n border-radius: 0 !important;\n `,\n borderless: css`\n padding: 0 !important;\n border: none !important;\n background: transparent !important;\n `,\n borderlessExtraHeaderNoTitle: css`\n margin-block-start: 8px;\n padding-inline: 0;\n `,\n borderlessExtraHeaderWithTitle: css`\n margin-block-start: 16px;\n padding-inline: 0;\n `,\n colorfulText: css`\n .${prefixCls}-alert-message,.${prefixCls}-alert-description {\n color: inherit;\n }\n `,\n expandText: css`\n padding-inline-end: 12px;\n\n &:hover {\n cursor: pointer;\n }\n `,\n extra: css`\n position: relative;\n\n overflow: hidden;\n\n max-width: 100%;\n border: 1px solid;\n border-block-start: none;\n border-end-start-radius: ${cssVar.borderRadiusLG};\n border-end-end-radius: ${cssVar.borderRadiusLG};\n `,\n extraHeader: css`\n border-block-start: 1px dashed;\n border-radius: 0;\n background: transparent !important;\n `,\n filled: css``,\n glass: lobeStaticStylish.blur,\n hasExtra: css`\n border-block-end: none;\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n `,\n outlined: css`\n background: transparent !important;\n `,\n // Root variants based on closable, hasTitle, showIcon combinations\n rootBase: css`\n position: relative;\n\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n\n max-width: 100%;\n\n /* Every control anchors itself to the title's FIRST 24px line box via\n align-self. Root-level align-items cannot be relied on: antd v6's own\n base style centers the row, and whether it or these static styles win\n depends on stylesheet injection order, which differs between\n environments. Centering the row is also wrong for message-only alerts\n whose content wraps - the icon drifts to the middle of the block. */\n .${prefixCls}-alert-icon {\n display: flex;\n align-items: center;\n align-self: flex-start;\n\n height: 24px;\n margin: 0;\n }\n .${prefixCls}-alert-close-icon {\n display: flex;\n align-items: center;\n align-self: flex-start;\n\n height: 24px;\n margin: 0;\n }\n .${prefixCls}-alert-actions {\n display: flex;\n align-items: center;\n align-self: flex-start;\n height: 24px;\n }\n `,\n rootNoTitleNoIconNoClosable: css`\n gap: 8px;\n padding-block: 8px;\n padding-inline: 12px;\n\n .${prefixCls}-alert-title {\n font-weight: 400;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n `,\n rootNoTitleNoIconWithClosable: css`\n gap: 8px;\n padding-block: 8px;\n padding-inline: 12px 9px;\n\n .${prefixCls}-alert-title {\n font-weight: 400;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n `,\n rootNoTitleWithIconNoClosable: css`\n gap: 8px;\n padding-block: 8px;\n padding-inline: 9px 12px;\n\n .${prefixCls}-alert-title {\n font-weight: 400;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n `,\n rootNoTitleWithIconWithClosable: css`\n gap: 8px;\n padding-block: 8px;\n padding-inline: 9px;\n\n .${prefixCls}-alert-title {\n font-weight: 400;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n `,\n rootWithTitleNoIconNoClosable: css`\n gap: 12px;\n padding-block: 16px;\n padding-inline: 16px;\n\n .${prefixCls}-alert-title {\n font-weight: 500;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n .${prefixCls}-alert-description {\n line-height: 1.5;\n word-break: normal;\n opacity: 0.75;\n }\n `,\n rootWithTitleNoIconWithClosable: css`\n gap: 12px;\n padding-block: 16px;\n padding-inline: 16px 12px;\n\n .${prefixCls}-alert-title {\n font-weight: 500;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n .${prefixCls}-alert-description {\n line-height: 1.5;\n word-break: normal;\n opacity: 0.75;\n }\n `,\n rootWithTitleWithIconNoClosable: css`\n gap: 12px;\n padding-block: 16px;\n padding-inline: 12px 16px;\n\n .${prefixCls}-alert-title {\n font-weight: 500;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n .${prefixCls}-alert-description {\n line-height: 1.5;\n word-break: normal;\n opacity: 0.75;\n }\n `,\n rootWithTitleWithIconWithClosable: css`\n gap: 12px;\n padding-block: 16px;\n padding-inline: 12px;\n\n .${prefixCls}-alert-title {\n font-weight: 500;\n line-height: 24px;\n color: inherit;\n word-break: normal;\n }\n .${prefixCls}-alert-description {\n line-height: 1.5;\n word-break: normal;\n opacity: 0.75;\n }\n `,\n };\n});\n\nexport const extraVariants = cva(styles.extra, {\n defaultVariants: {\n variant: 'filled',\n },\n\n variants: {\n variant: {\n filled: styles.filled,\n outlined: styles.outlined,\n borderless: styles.borderless,\n },\n banner: {\n false: null,\n true: styles.banner,\n },\n },\n});\n\nexport const rootVariants = cva(styles.rootBase, {\n compoundVariants: [\n {\n class: styles.rootNoTitleNoIconNoClosable,\n closable: false,\n hasTitle: false,\n showIcon: false,\n },\n {\n class: styles.rootNoTitleNoIconWithClosable,\n closable: true,\n hasTitle: false,\n showIcon: false,\n },\n {\n class: styles.rootNoTitleWithIconNoClosable,\n closable: false,\n hasTitle: false,\n showIcon: true,\n },\n {\n class: styles.rootNoTitleWithIconWithClosable,\n closable: true,\n hasTitle: false,\n showIcon: true,\n },\n {\n class: styles.rootWithTitleNoIconNoClosable,\n closable: false,\n hasTitle: true,\n showIcon: false,\n },\n {\n class: styles.rootWithTitleNoIconWithClosable,\n closable: true,\n hasTitle: true,\n showIcon: false,\n },\n {\n class: styles.rootWithTitleWithIconNoClosable,\n closable: false,\n hasTitle: true,\n showIcon: true,\n },\n {\n class: styles.rootWithTitleWithIconWithClosable,\n closable: true,\n hasTitle: true,\n showIcon: true,\n },\n ],\n defaultVariants: {\n closable: false,\n colorfulText: true,\n glass: false,\n hasTitle: false,\n showIcon: false,\n variant: 'filled',\n },\n\n variants: {\n closable: {\n false: null,\n true: null,\n },\n colorfulText: {\n false: null,\n true: styles.colorfulText,\n },\n glass: {\n false: null,\n true: styles.glass,\n },\n hasTitle: {\n false: null,\n true: null,\n },\n showIcon: {\n false: null,\n true: null,\n },\n variant: {\n borderless: styles.borderless,\n filled: styles.filled,\n outlined: styles.outlined,\n },\n hasExtra: {\n false: null,\n true: styles.hasExtra,\n },\n },\n});\n\nexport const extraHeaderVariants = cva(styles.extraHeader, {\n compoundVariants: [\n {\n class: styles.borderlessExtraHeaderNoTitle,\n hasTitle: false,\n variant: 'borderless',\n },\n {\n class: styles.borderlessExtraHeaderWithTitle,\n hasTitle: true,\n variant: 'borderless',\n },\n ],\n defaultVariants: {\n hasTitle: false,\n variant: 'filled',\n },\n\n variants: {\n hasTitle: {\n false: null,\n true: null,\n },\n variant: {\n borderless: null,\n filled: null,\n outlined: null,\n },\n },\n});\n"],"mappings":";;;;AAKA,MAAM,YAAY;AAElB,MAAa,SAAS,oBAAoB,EAAE,KAAK,aAAa;CAC5D,OAAO;EACL,QAAQ,GAAG;;;;EAIX,YAAY,GAAG;;;;;EAKf,8BAA8B,GAAG;;;;EAIjC,gCAAgC,GAAG;;;;EAInC,cAAc,GAAG;SACZ,UAAU,kBAAkB,UAAU;;;;EAI3C,YAAY,GAAG;;;;;;;EAOf,OAAO,GAAG;;;;;;;;iCAQmB,OAAO,eAAe;+BACxB,OAAO,eAAe;;EAEjD,aAAa,GAAG;;;;;EAKhB,QAAQ,GAAG;EACX,OAAOA,cAAkB;EACzB,UAAU,GAAG;;;;;EAKb,UAAU,GAAG;;;EAIb,UAAU,GAAG;;;;;;;;;;;;;;;SAeR,UAAU;;;;;;;;SAQV,UAAU;;;;;;;;SAQV,UAAU;;;;;;;EAOf,6BAA6B,GAAG;;;;;SAK3B,UAAU;;;;;;;EAOf,+BAA+B,GAAG;;;;;SAK7B,UAAU;;;;;;;EAOf,+BAA+B,GAAG;;;;;SAK7B,UAAU;;;;;;;EAOf,iCAAiC,GAAG;;;;;SAK/B,UAAU;;;;;;;E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ACf;EACA,UAAU;GACR,OAAO;GACP,MAAM;EACR;EACA,UAAU;GACR,OAAO;GACP,MAAM;EACR;EACA,SAAS;GACP,YAAY,OAAO;GACnB,QAAQ,OAAO;GACf,UAAU,OAAO;EACnB;EACA,UAAU;GACR,OAAO;GACP,MAAM,OAAO;EACf;CACF;AACF,CAAC;AAED,MAAa,sBAAsB,IAAI,OAAO,aAAa;CACzD,kBAAkB,CAChB;EACE,OAAO,OAAO;EACd,UAAU;EACV,SAAS;CACX,GACA;EACE,OAAO,OAAO;EACd,UAAU;EACV,SAAS;CACX,CACF;CACA,iBAAiB;EACf,UAAU;EACV,SAAS;CACX;CAEA,UAAU;EACR,UAAU;GACR,OAAO;GACP,MAAM;EACR;EACA,SAAS;GACP,YAAY;GACZ,QAAQ;GACR,UAAU;EACZ;CACF;AACF,CAAC"}
|
|
@@ -3,7 +3,7 @@ import FlexBasic_default from "../Flex/FlexBasic.mjs";
|
|
|
3
3
|
import Center from "../Flex/Center.mjs";
|
|
4
4
|
import { safeReadableColor } from "../utils/safeReadableColor.mjs";
|
|
5
5
|
import Icon from "../Icon/Icon.mjs";
|
|
6
|
-
import { Tooltip } from "../base-ui/Tooltip/Tooltip.mjs";
|
|
6
|
+
import { Tooltip as Tooltip$1 } from "../base-ui/Tooltip/Tooltip.mjs";
|
|
7
7
|
import { styles } from "./style.mjs";
|
|
8
8
|
import { useMemo } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -43,7 +43,7 @@ const ColorSwatches = ({ enableColorPicker, enableColorSwatches = true, defaultV
|
|
|
43
43
|
}
|
|
44
44
|
})();
|
|
45
45
|
const actualColorForReadable = c.color?.startsWith("var(") ? cssVar.colorPrimary : color;
|
|
46
|
-
return /* @__PURE__ */ jsx(Tooltip, {
|
|
46
|
+
return /* @__PURE__ */ jsx(Tooltip$1, {
|
|
47
47
|
title: c.title,
|
|
48
48
|
children: /* @__PURE__ */ jsx(Center, {
|
|
49
49
|
className: cx(styles.container, isTransparent && styles.transparent, isActive && styles.active),
|
|
@@ -63,7 +63,7 @@ const ColorSwatches = ({ enableColorPicker, enableColorSwatches = true, defaultV
|
|
|
63
63
|
})
|
|
64
64
|
})
|
|
65
65
|
}, c?.key || i);
|
|
66
|
-
}), enableColorPicker && /* @__PURE__ */ jsx(Tooltip, {
|
|
66
|
+
}), enableColorPicker && /* @__PURE__ */ jsx(Tooltip$1, {
|
|
67
67
|
title: texts?.custom || "Custom",
|
|
68
68
|
children: /* @__PURE__ */ jsx(ColorPicker, {
|
|
69
69
|
disabledAlpha: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSwatches.mjs","names":["Flexbox"],"sources":["../../src/ColorSwatches/ColorSwatches.tsx"],"sourcesContent":["'use client';\n\nimport { ColorPicker } from 'antd';\nimport { cssVar, cx } from 'antd-style';\nimport chroma from 'chroma-js';\nimport { CheckIcon } from 'lucide-react';\nimport { rgba } from 'polished';\nimport { type FC, useMemo } from 'react';\nimport useMergeState from 'use-merge-value';\n\nimport { Center, Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\nimport Tooltip from '@/Tooltip';\nimport { safeReadableColor } from '@/utils/safeReadableColor';\n\nimport { styles } from './style';\nimport type { ColorSwatchesProps } from './type';\n\nconst ColorSwatches: FC<ColorSwatchesProps> = ({\n enableColorPicker,\n enableColorSwatches = true,\n defaultValue,\n value,\n style,\n colors,\n onChange,\n size = 24,\n shape = 'circle',\n texts,\n ref,\n ...rest\n}) => {\n const [active, setActive] = useMergeState(defaultValue, {\n defaultValue,\n onChange,\n value,\n });\n\n // Convert size prop to CSS variable\n const cssVariables = useMemo<Record<string, string>>(\n () => ({\n '--color-swatches-size': `${size}px`,\n }),\n [size],\n );\n\n const isCustomActive = useMemo(\n () => active && active !== cssVar.colorPrimary && !colors.some((c) => c.color === active),\n [active, colors],\n );\n\n return (\n <Flexbox\n horizontal\n gap={6}\n ref={ref}\n style={{\n ...cssVariables,\n flexWrap: 'wrap',\n ...style,\n }}\n {...rest}\n >\n {enableColorSwatches &&\n colors.map((c, i) => {\n const color = c.color || cssVar.colorPrimary;\n const isActive = (!active && !c.color) || color === active;\n // Check if color is transparent or CSS variable (which chroma can't parse)\n const isTransparent =\n c.color === 'transparent' ||\n (c.color &&\n !c.color.startsWith('var(') &&\n (() => {\n try {\n return chroma(c.color).alpha() === 0;\n } catch {\n return false;\n }\n })());\n // Get actual color value for readableColor (CSS variables can't be parsed)\n const actualColorForReadable = c.color?.startsWith('var(') ? cssVar.colorPrimary : color;\n return (\n <Tooltip key={c?.key || i} title={c.title}>\n <Center\n className={cx(\n styles.container,\n isTransparent && styles.transparent,\n isActive && styles.active,\n )}\n style={{\n background: isTransparent ? undefined : color,\n borderRadius: shape === 'circle' ? '50%' : cssVar.borderRadius,\n }}\n onClick={() => setActive(c.color || undefined)}\n >\n {isActive && (\n <Icon\n color={rgba(safeReadableColor(actualColorForReadable), 0.33)}\n icon={CheckIcon}\n size={{ size: 14, strokeWidth: 4 }}\n style={{\n pointerEvents: 'none',\n }}\n />\n )}\n </Center>\n </Tooltip>\n );\n })}\n {enableColorPicker && (\n <Tooltip title={texts?.custom || 'Custom'}>\n <ColorPicker\n disabledAlpha\n arrow={false}\n defaultValue={cssVar.colorPrimary}\n format={'hex'}\n value={enableColorSwatches ? undefined : active}\n className={cx(\n styles.picker,\n enableColorSwatches && styles.conic,\n isCustomActive && styles.active,\n )}\n presets={\n enableColorSwatches\n ? undefined\n : [\n {\n colors: colors.map((c) => c.color),\n label: texts?.presets || 'Presets',\n },\n ]\n }\n style={{\n borderRadius: shape === 'circle' ? '50%' : cssVar.borderRadius,\n }}\n onChangeComplete={(c) => {\n if (c.toHexString() === cssVar.colorPrimary) {\n setActive('');\n } else {\n setActive(c.toHexString());\n }\n }}\n />\n </Tooltip>\n )}\n </Flexbox>\n );\n};\n\nColorSwatches.displayName = 'ColorSwatches';\n\nexport default ColorSwatches;\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAM,iBAAyC,EAC7C,mBACA,sBAAsB,MACtB,cACA,OACA,OACA,QACA,UACA,OAAO,IACP,QAAQ,UACR,OACA,KACA,GAAG,WACC;CACJ,MAAM,CAAC,QAAQ,aAAa,cAAc,cAAc;EACtD;EACA;EACA;CACF,CAAC;CAGD,MAAM,eAAe,eACZ,EACL,yBAAyB,GAAG,KAAK,IACnC,IACA,CAAC,IAAI,CACP;CAEA,MAAM,iBAAiB,cACf,UAAU,WAAW,OAAO,gBAAgB,CAAC,OAAO,MAAM,MAAM,EAAE,UAAU,MAAM,GACxF,CAAC,QAAQ,MAAM,CACjB;CAEA,OACE,qBAACA,mBAAD;EACE,YAAA;EACA,KAAK;EACA;EACL,OAAO;GACL,GAAG;GACH,UAAU;GACV,GAAG;EACL;EACA,GAAI;EATN,UAAA,CAWG,uBACC,OAAO,KAAK,GAAG,MAAM;GACnB,MAAM,QAAQ,EAAE,SAAS,OAAO;GAChC,MAAM,WAAY,CAAC,UAAU,CAAC,EAAE,SAAU,UAAU;GAEpD,MAAM,gBACJ,EAAE,UAAU,iBACX,EAAE,SACD,CAAC,EAAE,MAAM,WAAW,MAAM,YACnB;IACL,IAAI;KACF,OAAO,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,MAAM;IACrC,QAAQ;KACN,OAAO;IACT;GACF,EAAA,CAAG;GAEP,MAAM,yBAAyB,EAAE,OAAO,WAAW,MAAM,IAAI,OAAO,eAAe;GACnF,OACE,
|
|
1
|
+
{"version":3,"file":"ColorSwatches.mjs","names":["Flexbox","Tooltip"],"sources":["../../src/ColorSwatches/ColorSwatches.tsx"],"sourcesContent":["'use client';\n\nimport { ColorPicker } from 'antd';\nimport { cssVar, cx } from 'antd-style';\nimport chroma from 'chroma-js';\nimport { CheckIcon } from 'lucide-react';\nimport { rgba } from 'polished';\nimport { type FC, useMemo } from 'react';\nimport useMergeState from 'use-merge-value';\n\nimport { Center, Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\nimport Tooltip from '@/Tooltip';\nimport { safeReadableColor } from '@/utils/safeReadableColor';\n\nimport { styles } from './style';\nimport type { ColorSwatchesProps } from './type';\n\nconst ColorSwatches: FC<ColorSwatchesProps> = ({\n enableColorPicker,\n enableColorSwatches = true,\n defaultValue,\n value,\n style,\n colors,\n onChange,\n size = 24,\n shape = 'circle',\n texts,\n ref,\n ...rest\n}) => {\n const [active, setActive] = useMergeState(defaultValue, {\n defaultValue,\n onChange,\n value,\n });\n\n // Convert size prop to CSS variable\n const cssVariables = useMemo<Record<string, string>>(\n () => ({\n '--color-swatches-size': `${size}px`,\n }),\n [size],\n );\n\n const isCustomActive = useMemo(\n () => active && active !== cssVar.colorPrimary && !colors.some((c) => c.color === active),\n [active, colors],\n );\n\n return (\n <Flexbox\n horizontal\n gap={6}\n ref={ref}\n style={{\n ...cssVariables,\n flexWrap: 'wrap',\n ...style,\n }}\n {...rest}\n >\n {enableColorSwatches &&\n colors.map((c, i) => {\n const color = c.color || cssVar.colorPrimary;\n const isActive = (!active && !c.color) || color === active;\n // Check if color is transparent or CSS variable (which chroma can't parse)\n const isTransparent =\n c.color === 'transparent' ||\n (c.color &&\n !c.color.startsWith('var(') &&\n (() => {\n try {\n return chroma(c.color).alpha() === 0;\n } catch {\n return false;\n }\n })());\n // Get actual color value for readableColor (CSS variables can't be parsed)\n const actualColorForReadable = c.color?.startsWith('var(') ? cssVar.colorPrimary : color;\n return (\n <Tooltip key={c?.key || i} title={c.title}>\n <Center\n className={cx(\n styles.container,\n isTransparent && styles.transparent,\n isActive && styles.active,\n )}\n style={{\n background: isTransparent ? undefined : color,\n borderRadius: shape === 'circle' ? '50%' : cssVar.borderRadius,\n }}\n onClick={() => setActive(c.color || undefined)}\n >\n {isActive && (\n <Icon\n color={rgba(safeReadableColor(actualColorForReadable), 0.33)}\n icon={CheckIcon}\n size={{ size: 14, strokeWidth: 4 }}\n style={{\n pointerEvents: 'none',\n }}\n />\n )}\n </Center>\n </Tooltip>\n );\n })}\n {enableColorPicker && (\n <Tooltip title={texts?.custom || 'Custom'}>\n <ColorPicker\n disabledAlpha\n arrow={false}\n defaultValue={cssVar.colorPrimary}\n format={'hex'}\n value={enableColorSwatches ? undefined : active}\n className={cx(\n styles.picker,\n enableColorSwatches && styles.conic,\n isCustomActive && styles.active,\n )}\n presets={\n enableColorSwatches\n ? undefined\n : [\n {\n colors: colors.map((c) => c.color),\n label: texts?.presets || 'Presets',\n },\n ]\n }\n style={{\n borderRadius: shape === 'circle' ? '50%' : cssVar.borderRadius,\n }}\n onChangeComplete={(c) => {\n if (c.toHexString() === cssVar.colorPrimary) {\n setActive('');\n } else {\n setActive(c.toHexString());\n }\n }}\n />\n </Tooltip>\n )}\n </Flexbox>\n );\n};\n\nColorSwatches.displayName = 'ColorSwatches';\n\nexport default ColorSwatches;\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAM,iBAAyC,EAC7C,mBACA,sBAAsB,MACtB,cACA,OACA,OACA,QACA,UACA,OAAO,IACP,QAAQ,UACR,OACA,KACA,GAAG,WACC;CACJ,MAAM,CAAC,QAAQ,aAAa,cAAc,cAAc;EACtD;EACA;EACA;CACF,CAAC;CAGD,MAAM,eAAe,eACZ,EACL,yBAAyB,GAAG,KAAK,IACnC,IACA,CAAC,IAAI,CACP;CAEA,MAAM,iBAAiB,cACf,UAAU,WAAW,OAAO,gBAAgB,CAAC,OAAO,MAAM,MAAM,EAAE,UAAU,MAAM,GACxF,CAAC,QAAQ,MAAM,CACjB;CAEA,OACE,qBAACA,mBAAD;EACE,YAAA;EACA,KAAK;EACA;EACL,OAAO;GACL,GAAG;GACH,UAAU;GACV,GAAG;EACL;EACA,GAAI;EATN,UAAA,CAWG,uBACC,OAAO,KAAK,GAAG,MAAM;GACnB,MAAM,QAAQ,EAAE,SAAS,OAAO;GAChC,MAAM,WAAY,CAAC,UAAU,CAAC,EAAE,SAAU,UAAU;GAEpD,MAAM,gBACJ,EAAE,UAAU,iBACX,EAAE,SACD,CAAC,EAAE,MAAM,WAAW,MAAM,YAC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-23,8 +23,8 @@ declare const styles: {
|
|
|
23
23
|
};
|
|
24
24
|
declare const rootVariants: (props?: ({
|
|
25
25
|
shadow?: boolean | null | undefined;
|
|
26
|
-
size?: "
|
|
27
|
-
variant?: "filled" | "
|
|
26
|
+
size?: "small" | "middle" | "large" | null | undefined;
|
|
27
|
+
variant?: "filled" | "outlined" | "borderless" | null | undefined;
|
|
28
28
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { rootVariants, styles };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//#region src/static-css/baseline.ts
|
|
2
|
+
const lobeUiAntdBaseline = [
|
|
3
|
+
"alert",
|
|
4
|
+
"anchor",
|
|
5
|
+
"app",
|
|
6
|
+
"auto-complete",
|
|
7
|
+
"avatar",
|
|
8
|
+
"button",
|
|
9
|
+
"collapse",
|
|
10
|
+
"color-picker",
|
|
11
|
+
"date-picker",
|
|
12
|
+
"divider",
|
|
13
|
+
"drawer",
|
|
14
|
+
"dropdown",
|
|
15
|
+
"empty",
|
|
16
|
+
"form",
|
|
17
|
+
"image",
|
|
18
|
+
"input",
|
|
19
|
+
"input-number",
|
|
20
|
+
"input-textarea",
|
|
21
|
+
"menu",
|
|
22
|
+
"modal",
|
|
23
|
+
"popover",
|
|
24
|
+
"progress",
|
|
25
|
+
"segmented",
|
|
26
|
+
"select",
|
|
27
|
+
"skeleton",
|
|
28
|
+
"slider",
|
|
29
|
+
"space",
|
|
30
|
+
"tabs",
|
|
31
|
+
"tag",
|
|
32
|
+
"tag-preset",
|
|
33
|
+
"tag-status",
|
|
34
|
+
"upload"
|
|
35
|
+
];
|
|
36
|
+
//#endregion
|
|
37
|
+
export { lobeUiAntdBaseline };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=baseline.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseline.mjs","names":[],"sources":["../../src/static-css/baseline.ts"],"sourcesContent":["import type { AntdProbeName } from './registry';\n\n// The antd components @lobehub/ui internals can render. Kept in sync with the\n// source tree by baseline.test.ts — a failure there means this list must change.\nexport const lobeUiAntdBaseline: AntdProbeName[] = [\n 'alert',\n 'anchor',\n 'app',\n 'auto-complete',\n 'avatar',\n 'button',\n 'collapse',\n 'color-picker',\n 'date-picker',\n 'divider',\n 'drawer',\n 'dropdown',\n 'empty',\n 'form',\n 'image',\n 'input',\n 'input-number',\n 'input-textarea',\n 'menu',\n 'modal',\n 'popover',\n 'progress',\n 'segmented',\n 'select',\n 'skeleton',\n 'slider',\n 'space',\n 'tabs',\n 'tag',\n 'tag-preset',\n 'tag-status',\n 'upload',\n];\n"],"mappings":";AAIA,MAAa,qBAAsC;CACjD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AntdProbeName } from "./registry.mjs";
|
|
2
|
+
import { ScanAntdUsageOptions } from "./scan.mjs";
|
|
3
|
+
import { ReactElement } from "react";
|
|
4
|
+
import { ThemeConfig } from "antd";
|
|
5
|
+
//#region src/static-css/buildAntdStaticCss.d.ts
|
|
6
|
+
interface AntdStaticCssOptions {
|
|
7
|
+
/** escape hatch for render paths the registry has no probe for */
|
|
8
|
+
customProbes?: [name: string, render: () => ReactElement][];
|
|
9
|
+
/** extra probes on top of 'auto' scan results */
|
|
10
|
+
extraIncluded?: AntdProbeName[];
|
|
11
|
+
hrefTemplate?: (hash: string) => string;
|
|
12
|
+
included?: 'auto' | AntdProbeName[];
|
|
13
|
+
scan?: ScanAntdUsageOptions;
|
|
14
|
+
/** must equal the ConfigProvider theme used at SSR — token hash decides styleKeys matching */
|
|
15
|
+
theme?: ThemeConfig;
|
|
16
|
+
}
|
|
17
|
+
interface AntdStaticCssPayload {
|
|
18
|
+
css: string;
|
|
19
|
+
failedProbes: string[];
|
|
20
|
+
hash: string;
|
|
21
|
+
href: string;
|
|
22
|
+
probes: string[];
|
|
23
|
+
styleKeys: string[];
|
|
24
|
+
/** antd exports found by 'auto' scan that no registry probe covers */
|
|
25
|
+
unmatchedComponents: string[];
|
|
26
|
+
}
|
|
27
|
+
declare const createProbeAntdTheme: () => ThemeConfig;
|
|
28
|
+
declare const buildAntdStaticCss: (options?: AntdStaticCssOptions) => AntdStaticCssPayload;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { AntdStaticCssOptions, AntdStaticCssPayload, buildAntdStaticCss, createProbeAntdTheme };
|
|
31
|
+
//# sourceMappingURL=buildAntdStaticCss.d.mts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createLobeAntdTheme } from "../styles/theme/antdTheme.mjs";
|
|
2
|
+
import { lobeUiAntdBaseline } from "./baseline.mjs";
|
|
3
|
+
import { hashCss } from "./hash.mjs";
|
|
4
|
+
import { antdProbeNames, antdProbeRegistry, expandComponentsToProbes } from "./registry.mjs";
|
|
5
|
+
import { scanAntdUsage } from "./scan.mjs";
|
|
6
|
+
import { styleKeysOf } from "./shared.mjs";
|
|
7
|
+
import { createElement } from "react";
|
|
8
|
+
import { ConfigProvider, theme } from "antd";
|
|
9
|
+
import { StyleProvider } from "antd-style";
|
|
10
|
+
import { createCache, extractStyle } from "@ant-design/cssinjs";
|
|
11
|
+
import { renderToString } from "react-dom/server";
|
|
12
|
+
//#region src/static-css/buildAntdStaticCss.ts
|
|
13
|
+
const createProbeAntdTheme = () => {
|
|
14
|
+
const config = createLobeAntdTheme({ appearance: "light" });
|
|
15
|
+
return {
|
|
16
|
+
...config,
|
|
17
|
+
algorithm: [theme.defaultAlgorithm, config.algorithm ?? []].flat()
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
const resolveProbes = (options) => {
|
|
21
|
+
const { included = "auto", extraIncluded = [], customProbes = [], scan } = options;
|
|
22
|
+
const names = /* @__PURE__ */ new Set();
|
|
23
|
+
const unmatchedComponents = [];
|
|
24
|
+
if (included === "auto") {
|
|
25
|
+
const usage = scanAntdUsage(scan);
|
|
26
|
+
if (usage.wildcard) for (const name of antdProbeNames) names.add(name);
|
|
27
|
+
else {
|
|
28
|
+
const expanded = expandComponentsToProbes(usage.components);
|
|
29
|
+
for (const name of expanded.probes) names.add(name);
|
|
30
|
+
unmatchedComponents.push(...expanded.unmatched);
|
|
31
|
+
}
|
|
32
|
+
if (usage.importsLobeUi) for (const name of lobeUiAntdBaseline) names.add(name);
|
|
33
|
+
} else for (const name of included) names.add(name);
|
|
34
|
+
for (const name of extraIncluded) names.add(name);
|
|
35
|
+
return {
|
|
36
|
+
probes: [...[...names].sort().map((name) => [name, antdProbeRegistry[name].render]), ...customProbes],
|
|
37
|
+
unmatchedComponents
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
const buildAntdStaticCss = (options = {}) => {
|
|
41
|
+
const { theme = createProbeAntdTheme(), hrefTemplate = (hash) => `/antd.css?v=${hash}` } = options;
|
|
42
|
+
const { probes, unmatchedComponents } = resolveProbes(options);
|
|
43
|
+
const cache = createCache();
|
|
44
|
+
const failedProbes = [];
|
|
45
|
+
for (const [name, probe] of probes) try {
|
|
46
|
+
renderToString(createElement(StyleProvider, {
|
|
47
|
+
cache,
|
|
48
|
+
children: createElement(ConfigProvider, { theme }, probe())
|
|
49
|
+
}));
|
|
50
|
+
} catch {
|
|
51
|
+
failedProbes.push(name);
|
|
52
|
+
}
|
|
53
|
+
const css = extractStyle(cache, {
|
|
54
|
+
plain: true,
|
|
55
|
+
types: ["style"]
|
|
56
|
+
});
|
|
57
|
+
const hash = hashCss(css);
|
|
58
|
+
return {
|
|
59
|
+
css,
|
|
60
|
+
failedProbes,
|
|
61
|
+
hash,
|
|
62
|
+
href: hrefTemplate(hash),
|
|
63
|
+
probes: probes.map(([name]) => name),
|
|
64
|
+
styleKeys: styleKeysOf(cache).sort(),
|
|
65
|
+
unmatchedComponents
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { buildAntdStaticCss, createProbeAntdTheme };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=buildAntdStaticCss.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildAntdStaticCss.mjs","names":["antdTheme","extractCssinjsStyle"],"sources":["../../src/static-css/buildAntdStaticCss.ts"],"sourcesContent":["import { createCache, extractStyle as extractCssinjsStyle } from '@ant-design/cssinjs';\nimport type { ThemeConfig } from 'antd';\nimport { ConfigProvider, theme as antdTheme } from 'antd';\nimport { StyleProvider } from 'antd-style';\nimport type { ReactElement } from 'react';\nimport { createElement } from 'react';\nimport { renderToString } from 'react-dom/server';\n\nimport { createLobeAntdTheme } from '@/styles/theme/antdTheme';\n\nimport { lobeUiAntdBaseline } from './baseline';\nimport { hashCss } from './hash';\nimport type { AntdProbeName } from './registry';\nimport { antdProbeNames, antdProbeRegistry, expandComponentsToProbes } from './registry';\nimport type { ScanAntdUsageOptions } from './scan';\nimport { scanAntdUsage } from './scan';\nimport { styleKeysOf } from './shared';\n\nexport interface AntdStaticCssOptions {\n /** escape hatch for render paths the registry has no probe for */\n customProbes?: [name: string, render: () => ReactElement][];\n /** extra probes on top of 'auto' scan results */\n extraIncluded?: AntdProbeName[];\n hrefTemplate?: (hash: string) => string;\n included?: 'auto' | AntdProbeName[];\n scan?: ScanAntdUsageOptions;\n /** must equal the ConfigProvider theme used at SSR — token hash decides styleKeys matching */\n theme?: ThemeConfig;\n}\n\nexport interface AntdStaticCssPayload {\n css: string;\n failedProbes: string[];\n hash: string;\n href: string;\n probes: string[];\n styleKeys: string[];\n /** antd exports found by 'auto' scan that no registry probe covers */\n unmatchedComponents: string[];\n}\n\nexport const createProbeAntdTheme = (): ThemeConfig => {\n const config = createLobeAntdTheme({ appearance: 'light' });\n return {\n ...config,\n algorithm: [antdTheme.defaultAlgorithm, config.algorithm ?? []].flat(),\n };\n};\n\nconst resolveProbes = (options: AntdStaticCssOptions) => {\n const { included = 'auto', extraIncluded = [], customProbes = [], scan } = options;\n\n const names = new Set<AntdProbeName>();\n const unmatchedComponents: string[] = [];\n\n if (included === 'auto') {\n const usage = scanAntdUsage(scan);\n if (usage.wildcard) {\n for (const name of antdProbeNames) names.add(name);\n } else {\n const expanded = expandComponentsToProbes(usage.components);\n for (const name of expanded.probes) names.add(name);\n unmatchedComponents.push(...expanded.unmatched);\n }\n if (usage.importsLobeUi) for (const name of lobeUiAntdBaseline) names.add(name);\n } else {\n for (const name of included) names.add(name);\n }\n\n for (const name of extraIncluded) names.add(name);\n\n const probes: [string, () => ReactElement][] = [...names]\n .sort()\n .map((name) => [name, antdProbeRegistry[name].render]);\n\n return { probes: [...probes, ...customProbes], unmatchedComponents };\n};\n\nexport const buildAntdStaticCss = (options: AntdStaticCssOptions = {}): AntdStaticCssPayload => {\n const { theme = createProbeAntdTheme(), hrefTemplate = (hash) => `/antd.css?v=${hash}` } =\n options;\n\n const { probes, unmatchedComponents } = resolveProbes(options);\n\n const cache = createCache();\n const failedProbes: string[] = [];\n\n for (const [name, probe] of probes) {\n try {\n renderToString(\n createElement(StyleProvider, {\n cache,\n children: createElement(ConfigProvider, { theme }, probe()),\n }),\n );\n } catch {\n failedProbes.push(name);\n }\n }\n\n const css = extractCssinjsStyle(cache, { plain: true, types: ['style'] });\n const hash = hashCss(css);\n\n return {\n css,\n failedProbes,\n hash,\n href: hrefTemplate(hash),\n probes: probes.map(([name]) => name),\n styleKeys: styleKeysOf(cache as unknown as { cache: Map<string, unknown> }).sort(),\n unmatchedComponents,\n };\n};\n"],"mappings":";;;;;;;;;;;;AAyCA,MAAa,6BAA0C;CACrD,MAAM,SAAS,oBAAoB,EAAE,YAAY,QAAQ,CAAC;CAC1D,OAAO;EACL,GAAG;EACH,WAAW,CAACA,MAAU,kBAAkB,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK;CACvE;AACF;AAEA,MAAM,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M,OAAO,CAAC,OAAO;CAAE,CAAC;CACxE,MAAM,OAAO,QAAQ,GAAG;CAExB,OAAO;EACL;EACA;EACA;EACA,MAAM,aAAa,IAAI;EACvB,QAAQ,OAAO,KAAK,CAAC,UAAU,IAAI;EACnC,WAAW,YAAY,KAAmD,CAAC,CAAC,KAAK;EACjF;CACF;AACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AntdStaticCssOptions, AntdStaticCssPayload } from "../buildAntdStaticCss.mjs";
|
|
2
|
+
import { ThemeVarsCssOptions, ThemeVarsCssPayload } from "../themeVars.mjs";
|
|
3
|
+
//#region src/static-css/emit/index.d.ts
|
|
4
|
+
interface EmitStaticCssOptions {
|
|
5
|
+
antd?: AntdStaticCssOptions | false;
|
|
6
|
+
manifestPath?: string;
|
|
7
|
+
outDir: string;
|
|
8
|
+
themeVars?: ThemeVarsCssOptions | false;
|
|
9
|
+
}
|
|
10
|
+
interface EmitStaticCssResult {
|
|
11
|
+
antd?: AntdStaticCssPayload;
|
|
12
|
+
files: string[];
|
|
13
|
+
themeVars?: ThemeVarsCssPayload;
|
|
14
|
+
}
|
|
15
|
+
declare const emitStaticCssAssets: (options: EmitStaticCssOptions) => Promise<EmitStaticCssResult>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { EmitStaticCssOptions, EmitStaticCssResult, emitStaticCssAssets };
|
|
18
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
3
|
+
//#region src/static-css/emit/index.ts
|
|
4
|
+
process.env.NODE_ENV = "production";
|
|
5
|
+
const emitStaticCssAssets = async (options) => {
|
|
6
|
+
const { outDir, manifestPath = path.join(outDir, "static-css.manifest.json") } = options;
|
|
7
|
+
await mkdir(outDir, { recursive: true });
|
|
8
|
+
const result = { files: [] };
|
|
9
|
+
const manifest = {};
|
|
10
|
+
if (options.antd !== false) {
|
|
11
|
+
const { buildAntdStaticCss } = await import("../buildAntdStaticCss.mjs");
|
|
12
|
+
const payload = buildAntdStaticCss(options.antd);
|
|
13
|
+
const file = path.join(outDir, "antd.css");
|
|
14
|
+
await writeFile(file, payload.css, "utf8");
|
|
15
|
+
result.antd = payload;
|
|
16
|
+
result.files.push(file);
|
|
17
|
+
manifest.antd = {
|
|
18
|
+
hash: payload.hash,
|
|
19
|
+
href: payload.href,
|
|
20
|
+
styleKeys: payload.styleKeys
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
if (options.themeVars !== false) {
|
|
24
|
+
const { buildThemeVarsCss } = await import("../themeVars.mjs");
|
|
25
|
+
const payload = buildThemeVarsCss(options.themeVars);
|
|
26
|
+
const file = path.join(outDir, "theme-vars.css");
|
|
27
|
+
await writeFile(file, payload.css, "utf8");
|
|
28
|
+
result.themeVars = payload;
|
|
29
|
+
result.files.push(file);
|
|
30
|
+
manifest.themeVars = {
|
|
31
|
+
hash: payload.hash,
|
|
32
|
+
href: payload.href
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
await writeFile(manifestPath, JSON.stringify(manifest, null, 2), "utf8");
|
|
36
|
+
result.files.push(manifestPath);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { emitStaticCssAssets };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/static-css/emit/index.ts"],"sourcesContent":["// react-dom/server, @ant-design/cssinjs and antd-style pick their dev/prod flavor\n// at import time and the dev flavor emits different CSS, so production must be\n// forced before any React/antd module loads — hence this entry has no static\n// imports of them and must be imported before anything that does.\nimport { mkdir, writeFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nimport type { AntdStaticCssOptions, AntdStaticCssPayload } from '../buildAntdStaticCss';\nimport type { ThemeVarsCssOptions, ThemeVarsCssPayload } from '../themeVars';\n\nprocess.env.NODE_ENV = 'production';\n\nexport interface EmitStaticCssOptions {\n antd?: AntdStaticCssOptions | false;\n manifestPath?: string;\n outDir: string;\n themeVars?: ThemeVarsCssOptions | false;\n}\n\nexport interface EmitStaticCssResult {\n antd?: AntdStaticCssPayload;\n files: string[];\n themeVars?: ThemeVarsCssPayload;\n}\n\nexport const emitStaticCssAssets = async (\n options: EmitStaticCssOptions,\n): Promise<EmitStaticCssResult> => {\n const { outDir, manifestPath = path.join(outDir, 'static-css.manifest.json') } = options;\n\n await mkdir(outDir, { recursive: true });\n\n const result: EmitStaticCssResult = { files: [] };\n const manifest: Record<string, unknown> = {};\n\n if (options.antd !== false) {\n const { buildAntdStaticCss } = await import('../buildAntdStaticCss');\n const payload = buildAntdStaticCss(options.antd);\n const file = path.join(outDir, 'antd.css');\n await writeFile(file, payload.css, 'utf8');\n result.antd = payload;\n result.files.push(file);\n manifest.antd = { hash: payload.hash, href: payload.href, styleKeys: payload.styleKeys };\n }\n\n if (options.themeVars !== false) {\n const { buildThemeVarsCss } = await import('../themeVars');\n const payload = buildThemeVarsCss(options.themeVars);\n const file = path.join(outDir, 'theme-vars.css');\n await writeFile(file, payload.css, 'utf8');\n result.themeVars = payload;\n result.files.push(file);\n manifest.themeVars = { hash: payload.hash, href: payload.href };\n }\n\n await writeFile(manifestPath, JSON.stringify(manifest, null, 2), 'utf8');\n result.files.push(manifestPath);\n\n return result;\n};\n"],"mappings":";;;AAUA,QAAQ,IAAI,WAAW;AAevB,MAAa,sBAAsB,OACjC,YACiC;CACjC,MAAM,EAAE,QAAQ,eAAe,KAAK,KAAK,QAAQ,0BAA0B,MAAM;CAEjF,MAAM,MAAM,QAAQ,EAAE,WAAW,KAAK,CAAC;CAEvC,MAAM,SAA8B,EAAE,OAAO,CAAC,EAAE;CAChD,MAAM,WAAoC,CAAC;CAE3C,IAAI,QAAQ,SAAS,OAAO;EAC1B,MAAM,EAAE,uBAAuB,MAAM,OAAO;EAC5C,MAAM,UAAU,mBAAmB,QAAQ,IAAI;EAC/C,MAAM,OAAO,KAAK,KAAK,QAAQ,UAAU;EACzC,MAAM,UAAU,MAAM,QAAQ,KAAK,MAAM;EACzC,OAAO,OAAO;EACd,OAAO,MAAM,KAAK,IAAI;EACtB,SAAS,OAAO;GAAE,MAAM,QAAQ;GAAM,MAAM,QAAQ;GAAM,WAAW,QAAQ;EAAU;CACzF;CAEA,IAAI,QAAQ,cAAc,OAAO;EAC/B,MAAM,EAAE,sBAAsB,MAAM,OAAO;EAC3C,MAAM,UAAU,kBAAkB,QAAQ,SAAS;EACnD,MAAM,OAAO,KAAK,KAAK,QAAQ,gBAAgB;EAC/C,MAAM,UAAU,MAAM,QAAQ,KAAK,MAAM;EACzC,OAAO,YAAY;EACnB,OAAO,MAAM,KAAK,IAAI;EACtB,SAAS,YAAY;GAAE,MAAM,QAAQ;GAAM,MAAM,QAAQ;EAAK;CAChE;CAEA,MAAM,UAAU,cAAc,KAAK,UAAU,UAAU,MAAM,CAAC,GAAG,MAAM;CACvE,OAAO,MAAM,KAAK,YAAY;CAE9B,OAAO;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.mjs","names":[],"sources":["../../src/static-css/hash.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\n\nexport const hashCss = (css: string): string =>\n createHash('sha256').update(css).digest('hex').slice(0, 8);\n"],"mappings":";;AAEA,MAAa,WAAW,QACtB,WAAW,QAAQ,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AntdProbeDef, AntdProbeName, ExpandedProbes, antdProbeNames, antdProbeRegistry, expandComponentsToProbes, nonProbeAntdExports } from "./registry.mjs";
|
|
2
|
+
import { AntdUsageScanResult, ScanAntdUsageOptions, scanAntdUsage } from "./scan.mjs";
|
|
3
|
+
import { AntdStaticCssOptions, AntdStaticCssPayload, buildAntdStaticCss, createProbeAntdTheme } from "./buildAntdStaticCss.mjs";
|
|
4
|
+
import { ThemeVarsCssOptions, ThemeVarsCssPayload, buildThemeVarsCss } from "./themeVars.mjs";
|
|
5
|
+
import { lobeUiAntdBaseline } from "./baseline.mjs";
|
|
6
|
+
export { type AntdProbeDef, type AntdProbeName, type AntdStaticCssOptions, type AntdStaticCssPayload, type AntdUsageScanResult, type ExpandedProbes, type ScanAntdUsageOptions, type ThemeVarsCssOptions, type ThemeVarsCssPayload, antdProbeNames, antdProbeRegistry, buildAntdStaticCss, buildThemeVarsCss, createProbeAntdTheme, expandComponentsToProbes, lobeUiAntdBaseline, nonProbeAntdExports, scanAntdUsage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index.d.mts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index.mjs';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { lobeUiAntdBaseline } from "./baseline.mjs";
|
|
2
|
+
import { antdProbeNames, antdProbeRegistry, expandComponentsToProbes, nonProbeAntdExports } from "./registry.mjs";
|
|
3
|
+
import { scanAntdUsage } from "./scan.mjs";
|
|
4
|
+
import { buildAntdStaticCss, createProbeAntdTheme } from "./buildAntdStaticCss.mjs";
|
|
5
|
+
import { buildThemeVarsCss } from "./themeVars.mjs";
|
|
6
|
+
export { antdProbeNames, antdProbeRegistry, buildAntdStaticCss, buildThemeVarsCss, createProbeAntdTheme, expandComponentsToProbes, lobeUiAntdBaseline, nonProbeAntdExports, scanAntdUsage };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
//#region src/static-css/registry.d.ts
|
|
3
|
+
interface AntdProbeDef {
|
|
4
|
+
/** antd export name whose usage activates this probe during auto scan */
|
|
5
|
+
detect: string;
|
|
6
|
+
render: () => ReactElement;
|
|
7
|
+
}
|
|
8
|
+
declare const PROBE_NAMES: readonly ["alert", "anchor", "app", "auto-complete", "avatar", "badge", "breadcrumb", "button", "card", "checkbox", "collapse", "color-picker", "date-picker", "divider", "drawer", "dropdown", "empty", "flex", "float-button", "form", "grid-col", "grid-row", "image", "input", "input-number", "input-textarea", "mentions", "menu", "modal", "pagination", "popover", "progress", "qrcode", "radio", "rate", "segmented", "select", "skeleton", "slider", "space", "spin", "steps", "switch", "table", "tabs", "tag", "tag-preset", "tag-status", "tooltip", "tree", "typography", "upload"];
|
|
9
|
+
type AntdProbeName = (typeof PROBE_NAMES)[number];
|
|
10
|
+
declare const antdProbeNames: AntdProbeName[];
|
|
11
|
+
declare const antdProbeRegistry: Record<AntdProbeName, AntdProbeDef>;
|
|
12
|
+
declare const nonProbeAntdExports: Set<string>;
|
|
13
|
+
interface ExpandedProbes {
|
|
14
|
+
probes: AntdProbeName[];
|
|
15
|
+
unmatched: string[];
|
|
16
|
+
}
|
|
17
|
+
declare const expandComponentsToProbes: (components: Iterable<string>) => ExpandedProbes;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { AntdProbeDef, AntdProbeName, ExpandedProbes, antdProbeNames, antdProbeRegistry, expandComponentsToProbes, nonProbeAntdExports };
|
|
20
|
+
//# sourceMappingURL=registry.d.mts.map
|