@iress-oss/ids-theme-preset 6.0.0-alpha.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/README.md +102 -0
- package/dist/chunk-6T7NHIQQ.js +2994 -0
- package/dist/chunk-OGLE65KO.js +149 -0
- package/dist/chunk-V3SF6JCX.js +75 -0
- package/dist/config.d.ts +13 -0
- package/dist/config.js +25 -0
- package/dist/constants.d.ts +150 -0
- package/dist/constants.js +22 -0
- package/dist/hooks/index.d.ts +23 -0
- package/dist/hooks/index.js +10 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +9 -0
- package/dist/vite.d.ts +13 -0
- package/dist/vite.js +38 -0
- package/package.json +74 -0
- package/src/config-recipes/button.ts +739 -0
- package/src/config-recipes/table.ts +258 -0
- package/src/config-recipes/text.ts +237 -0
- package/src/constants.ts +193 -0
- package/src/createMinimalConfig.ts +29 -0
- package/src/globalCss.ts +8 -0
- package/src/hooks/codegenPrepareHook.test.ts +55 -0
- package/src/hooks/codegenPrepareHook.ts +57 -0
- package/src/hooks/cssgenDoneHook.test.ts +57 -0
- package/src/hooks/cssgenDoneHook.ts +31 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/spacingAliasMap.test.ts +15 -0
- package/src/hooks/spacingAliasMap.ts +13 -0
- package/src/index.ts +133 -0
- package/src/staticCss.ts +103 -0
- package/src/tokens/animationStyles.ts +79 -0
- package/src/tokens/borders.ts +54 -0
- package/src/tokens/breakpoints.ts +9 -0
- package/src/tokens/colors.ts +286 -0
- package/src/tokens/keyframes.ts +74 -0
- package/src/tokens/layerStyles.ts +99 -0
- package/src/tokens/radii.ts +52 -0
- package/src/tokens/sizes.ts +184 -0
- package/src/tokens/spacing.ts +82 -0
- package/src/tokens/textStyles.ts +130 -0
- package/src/tokens/zIndex.ts +25 -0
- package/src/utilities/chevron.ts +33 -0
- package/src/utilities/focusable.ts +202 -0
- package/src/utilities/gutter.ts +20 -0
- package/src/utilities/horizontalAlign.ts +27 -0
- package/src/utilities/materialSymbols.ts +28 -0
- package/src/utilities/noGutter.ts +15 -0
- package/src/utilities/offset.ts +90 -0
- package/src/utilities/scrollable.ts +53 -0
- package/src/utilities/sliderThumb.ts +29 -0
- package/src/utilities/span.ts +136 -0
- package/src/utilities/stretch.ts +15 -0
- package/src/utilities/verticalAlign.ts +27 -0
- package/src/vite.ts +47 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineUtility } from '@pandacss/dev';
|
|
2
|
+
import type { NestedCssProperties } from '@pandacss/types';
|
|
3
|
+
import { colors } from '../tokens/colors';
|
|
4
|
+
import { radii } from '../tokens/radii';
|
|
5
|
+
import { sizes } from '../tokens/sizes';
|
|
6
|
+
|
|
7
|
+
export const scrollable = defineUtility({
|
|
8
|
+
className: 'scrollable',
|
|
9
|
+
values: ['x', 'y', 'true'],
|
|
10
|
+
transform: (direction: 'x' | 'y' | 'true' | boolean = true) => {
|
|
11
|
+
if (direction === false) {
|
|
12
|
+
return {};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let overflowProp: keyof NestedCssProperties = 'overflow';
|
|
16
|
+
|
|
17
|
+
if (direction === 'x') {
|
|
18
|
+
overflowProp = 'overflowX';
|
|
19
|
+
} else if (direction === 'y') {
|
|
20
|
+
overflowProp = 'overflowY';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
[overflowProp]: 'auto',
|
|
25
|
+
|
|
26
|
+
'&::-webkit-scrollbar': {
|
|
27
|
+
width: sizes['typography.base'].value,
|
|
28
|
+
height: sizes['typography.base'].value,
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
'&::-webkit-scrollbar-track': {
|
|
32
|
+
background: colors.page.value,
|
|
33
|
+
borderRadius: radii['radius.system.layout'].value,
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
'&::-webkit-scrollbar-thumb': {
|
|
37
|
+
backgroundColor: colors['colour.neutral.50'].value,
|
|
38
|
+
borderRadius: radii['radius.system.form'].value,
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
'&::-webkit-scrollbar-thumb:hover': {
|
|
42
|
+
backgroundColor: colors['colour.primary.fill'].value,
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
'&::-webkit-scrollbar-corner': {
|
|
46
|
+
background: colors.transparent.value,
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
scrollbarWidth: 'thin',
|
|
50
|
+
scrollbarColor: `${colors['colour.neutral.50'].value} ${colors.page.value}`,
|
|
51
|
+
} as NestedCssProperties;
|
|
52
|
+
},
|
|
53
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineUtility } from '@pandacss/dev';
|
|
2
|
+
import { colors } from '../tokens/colors';
|
|
3
|
+
import { sizes } from '../tokens/sizes';
|
|
4
|
+
|
|
5
|
+
export const sliderThumb = defineUtility({
|
|
6
|
+
className: 'sliderThumb',
|
|
7
|
+
values: { type: 'boolean' },
|
|
8
|
+
transform: (value) => {
|
|
9
|
+
if (value !== true) {
|
|
10
|
+
return {
|
|
11
|
+
display: 'none',
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
aspectRatio: 1,
|
|
17
|
+
width: sizes['slider.thumb'].value,
|
|
18
|
+
height: sizes['slider.thumb'].value,
|
|
19
|
+
cursor: 'pointer',
|
|
20
|
+
borderColor: colors['colour.neutral.10'].value,
|
|
21
|
+
borderRadius: `calc(${sizes['slider.thumb'].value} / 2)`,
|
|
22
|
+
borderStyle: 'solid',
|
|
23
|
+
borderWidth: '1.5px',
|
|
24
|
+
backgroundColor: colors['colour.primary.fill'].value,
|
|
25
|
+
position: 'relative',
|
|
26
|
+
zIndex: '200',
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { defineUtility } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
export const spanCompositions = {
|
|
4
|
+
auto: {
|
|
5
|
+
description:
|
|
6
|
+
'column spans 12/12 or the remaining space of the container width',
|
|
7
|
+
value: {
|
|
8
|
+
flexGrow: 1,
|
|
9
|
+
flexShrink: 0,
|
|
10
|
+
flexBasis: 0,
|
|
11
|
+
paddingInline: 'calc(var(--col-gap) / 2)',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
'1': {
|
|
15
|
+
description: 'column spans 1/12 of the container width',
|
|
16
|
+
value: {
|
|
17
|
+
flexGrow: 0,
|
|
18
|
+
flexShrink: 0,
|
|
19
|
+
flexBasis: 'calc(1 / 12 * 100%)',
|
|
20
|
+
paddingInline: 'calc(var(--col-gap) / 2)',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
'2': {
|
|
24
|
+
description: 'column spans 2/12 of the container width',
|
|
25
|
+
value: {
|
|
26
|
+
flexGrow: 0,
|
|
27
|
+
flexShrink: 0,
|
|
28
|
+
flexBasis: 'calc(2 / 12 * 100%)',
|
|
29
|
+
paddingInline: 'calc(var(--col-gap) / 2)',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
'3': {
|
|
33
|
+
description: 'column spans 3/12 of the container width',
|
|
34
|
+
value: {
|
|
35
|
+
flexGrow: 0,
|
|
36
|
+
flexShrink: 0,
|
|
37
|
+
flexBasis: 'calc(3 / 12 * 100%)',
|
|
38
|
+
paddingInline: 'calc(var(--col-gap) / 2)',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
'4': {
|
|
42
|
+
description: 'column spans 1/12 of the container width',
|
|
43
|
+
value: {
|
|
44
|
+
flexGrow: 0,
|
|
45
|
+
flexShrink: 0,
|
|
46
|
+
flexBasis: 'calc(4 / 12 * 100%)',
|
|
47
|
+
paddingInline: 'calc(var(--col-gap) / 2)',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
'5': {
|
|
51
|
+
description: 'column spans 2/12 of the container width',
|
|
52
|
+
value: {
|
|
53
|
+
flexGrow: 0,
|
|
54
|
+
flexShrink: 0,
|
|
55
|
+
flexBasis: 'calc(5 / 12 * 100%)',
|
|
56
|
+
paddingInline: 'calc(var(--col-gap) / 2)',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
'6': {
|
|
60
|
+
description: 'column spans 3/12 of the container width',
|
|
61
|
+
value: {
|
|
62
|
+
flexGrow: 0,
|
|
63
|
+
flexShrink: 0,
|
|
64
|
+
flexBasis: 'calc(6 / 12 * 100%)',
|
|
65
|
+
paddingInline: 'calc(var(--col-gap) / 2)',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
'7': {
|
|
69
|
+
description: 'column spans 1/12 of the container width',
|
|
70
|
+
value: {
|
|
71
|
+
flexGrow: 0,
|
|
72
|
+
flexShrink: 0,
|
|
73
|
+
flexBasis: 'calc(7 / 12 * 100%)',
|
|
74
|
+
paddingInline: 'calc(var(--col-gap) / 2)',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
'8': {
|
|
78
|
+
description: 'column spans 2/12 of the container width',
|
|
79
|
+
value: {
|
|
80
|
+
flexGrow: 0,
|
|
81
|
+
flexShrink: 0,
|
|
82
|
+
flexBasis: 'calc(8 / 12 * 100%)',
|
|
83
|
+
paddingInline: 'calc(var(--col-gap) / 2)',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
'9': {
|
|
87
|
+
description: 'column spans 3/12 of the container width',
|
|
88
|
+
value: {
|
|
89
|
+
flexGrow: 0,
|
|
90
|
+
flexShrink: 0,
|
|
91
|
+
flexBasis: 'calc(9 / 12 * 100%)',
|
|
92
|
+
paddingInline: 'calc(var(--col-gap) / 2)',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
'10': {
|
|
96
|
+
description: 'column spans 1/12 of the container width',
|
|
97
|
+
value: {
|
|
98
|
+
flexGrow: 0,
|
|
99
|
+
flexShrink: 0,
|
|
100
|
+
flexBasis: 'calc(10 / 12 * 100%)',
|
|
101
|
+
paddingInline: 'calc(var(--col-gap) / 2)',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
'11': {
|
|
105
|
+
description: 'column spans 2/12 of the container width',
|
|
106
|
+
value: {
|
|
107
|
+
flexGrow: 0,
|
|
108
|
+
flexShrink: 0,
|
|
109
|
+
flexBasis: 'calc(11 / 12 * 100%)',
|
|
110
|
+
paddingInline: 'calc(var(--col-gap) / 2)',
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
'12': {
|
|
114
|
+
description: 'column spans 3/12 of the container width',
|
|
115
|
+
value: {
|
|
116
|
+
flexGrow: 0,
|
|
117
|
+
flexShrink: 0,
|
|
118
|
+
flexBasis: '100%',
|
|
119
|
+
paddingInline: 'calc(var(--col-gap) / 2)',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
type SpanValue = keyof typeof spanCompositions | undefined;
|
|
125
|
+
|
|
126
|
+
export const span = defineUtility({
|
|
127
|
+
className: 'span',
|
|
128
|
+
values: Object.keys(spanCompositions),
|
|
129
|
+
transform: (value?: SpanValue) => {
|
|
130
|
+
if (!value) {
|
|
131
|
+
return {};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return spanCompositions[value].value;
|
|
135
|
+
},
|
|
136
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineUtility } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
export const stretch = defineUtility({
|
|
4
|
+
className: 'stretch',
|
|
5
|
+
values: { type: 'boolean' },
|
|
6
|
+
transform: (value: boolean) => {
|
|
7
|
+
if (!value) return {};
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
alignSelf: 'stretch',
|
|
11
|
+
flex: 1,
|
|
12
|
+
height: '100%',
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineUtility } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
const ALIGN_MAP: Record<string, string> = {
|
|
4
|
+
top: 'flex-start',
|
|
5
|
+
middle: 'center',
|
|
6
|
+
bottom: 'flex-end',
|
|
7
|
+
between: 'space-between',
|
|
8
|
+
around: 'space-around',
|
|
9
|
+
evenly: 'space-evenly',
|
|
10
|
+
stretch: 'stretch',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const flexVerticalAlign = defineUtility({
|
|
14
|
+
className: 'fva',
|
|
15
|
+
values: Object.keys(ALIGN_MAP),
|
|
16
|
+
transform: (value: string) => {
|
|
17
|
+
const cssValue = ALIGN_MAP[value];
|
|
18
|
+
return {
|
|
19
|
+
'&:where([data-flex-dir="row"], :not([data-flex-dir]))': {
|
|
20
|
+
alignItems: cssValue,
|
|
21
|
+
},
|
|
22
|
+
'&:where([data-flex-dir="column"])': {
|
|
23
|
+
...(cssValue === 'stretch' ? {} : { justifyContent: cssValue }),
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
});
|
package/src/vite.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import type { Plugin } from 'vite';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Vite plugin that preserves Panda CSS @layer declarations which get
|
|
7
|
+
* stripped during the build process. Reads the layer declaration from
|
|
8
|
+
* the source styles.css and prepends it to all built CSS files.
|
|
9
|
+
*
|
|
10
|
+
* @param stylesPath - Path to the Panda-generated styles.css
|
|
11
|
+
* (e.g. `'./src/styled-system/styles.css'`). Resolved relative to Vite root.
|
|
12
|
+
*/
|
|
13
|
+
export function preservePandaLayerDeclaration(stylesPath: string): Plugin {
|
|
14
|
+
let layerDeclaration = '';
|
|
15
|
+
let root = process.cwd();
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
name: 'ids-preserve-panda-layer',
|
|
19
|
+
apply: 'build',
|
|
20
|
+
configResolved(config) {
|
|
21
|
+
root = config.root;
|
|
22
|
+
},
|
|
23
|
+
buildStart() {
|
|
24
|
+
const resolved = path.isAbsolute(stylesPath)
|
|
25
|
+
? stylesPath
|
|
26
|
+
: path.resolve(root, stylesPath);
|
|
27
|
+
const content = fs.readFileSync(resolved, 'utf-8');
|
|
28
|
+
const match = /^@layer\s{1,10}[^;\n]{1,200};/m.exec(content);
|
|
29
|
+
layerDeclaration = match ? match[0] : '';
|
|
30
|
+
},
|
|
31
|
+
writeBundle({ dir = './dist' }, bundle) {
|
|
32
|
+
for (const fileName of Object.keys(bundle)) {
|
|
33
|
+
if (fileName.endsWith('.css')) {
|
|
34
|
+
const asset = bundle[fileName];
|
|
35
|
+
if ('source' in asset) {
|
|
36
|
+
asset.source = `${layerDeclaration} ${String(asset.source)}`;
|
|
37
|
+
fs.writeFileSync(
|
|
38
|
+
`${dir}/${fileName}`,
|
|
39
|
+
String(asset.source),
|
|
40
|
+
'utf-8',
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|