@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,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
spacing as spacingSchema,
|
|
3
|
+
cssVars,
|
|
4
|
+
type IressDesignToken,
|
|
5
|
+
} from '@iress-oss/ids-tokens';
|
|
6
|
+
import { sizes } from './sizes';
|
|
7
|
+
|
|
8
|
+
type SpacingKey = keyof typeof cssVars.spacing;
|
|
9
|
+
|
|
10
|
+
const canonicalSpacing = Object.fromEntries(
|
|
11
|
+
Object.entries(spacingSchema)
|
|
12
|
+
.filter(([key]) => key in cssVars.spacing)
|
|
13
|
+
.map(([key, token]) => [
|
|
14
|
+
`spacing.${key}`,
|
|
15
|
+
{
|
|
16
|
+
description: (token as IressDesignToken).$description,
|
|
17
|
+
value: cssVars.spacing[key as SpacingKey],
|
|
18
|
+
},
|
|
19
|
+
]),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const aliasSpacing = Object.fromEntries(
|
|
23
|
+
Object.entries(spacingSchema).flatMap(([key, token]) => {
|
|
24
|
+
const aliases = (token as { $extensions?: { 'iress.aliases'?: string[] } })
|
|
25
|
+
.$extensions?.['iress.aliases'];
|
|
26
|
+
if (!aliases || !(key in cssVars.spacing)) return [];
|
|
27
|
+
return aliases.map((alias) => [
|
|
28
|
+
alias,
|
|
29
|
+
{
|
|
30
|
+
description: (token as IressDesignToken).$description,
|
|
31
|
+
value: cssVars.spacing[key as SpacingKey],
|
|
32
|
+
},
|
|
33
|
+
]);
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const componentSpacing = {
|
|
38
|
+
'button.inline': {
|
|
39
|
+
description: 'Spacing on the left and right of inline button content',
|
|
40
|
+
value: `calc((${cssVars.radius.system._button.topLeft} * 0.25) + ${cssVars.spacing['3']})`,
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
'button.iconInline': {
|
|
44
|
+
description: 'Spacing on the left and right of inline button content',
|
|
45
|
+
value: `calc((${cssVars.radius.system._button.topLeft} * 0.25) + ${cssVars.spacing['2']})`,
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
'button.block': {
|
|
49
|
+
description: 'Spacing on the top and bottom of block button content',
|
|
50
|
+
value: `calc(${cssVars.radius.system._button.topLeft} * 0.25)`,
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
'field.footer': {
|
|
54
|
+
description:
|
|
55
|
+
'Spacing below the field to account for the height of the footer content',
|
|
56
|
+
value: `calc(${cssVars.typography.base.size} * 2)`,
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
'slider.tick': {
|
|
60
|
+
description:
|
|
61
|
+
'Spacing between top and bottom of the slider tick marks from the track',
|
|
62
|
+
value: `calc((${sizes['slider.track'].value} - ${sizes['slider.tick'].value}) / 2)`,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const spacing = {
|
|
67
|
+
...canonicalSpacing,
|
|
68
|
+
...aliasSpacing,
|
|
69
|
+
...componentSpacing,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const SPACING_TOKENS = Object.keys(canonicalSpacing);
|
|
73
|
+
export const SPACING_AND_ALIAS_TOKENS = Object.keys({
|
|
74
|
+
...canonicalSpacing,
|
|
75
|
+
...aliasSpacing,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export const MARGIN_TOKENS = [
|
|
79
|
+
...SPACING_TOKENS,
|
|
80
|
+
...SPACING_TOKENS.map((token) => `-${token}`),
|
|
81
|
+
'auto',
|
|
82
|
+
];
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { type CompositionStyles, defineTextStyles } from '@pandacss/dev';
|
|
2
|
+
import { typography, cssVars } from '@iress-oss/ids-tokens';
|
|
3
|
+
|
|
4
|
+
export const textCompositions = {
|
|
5
|
+
'typography.heading.1': {
|
|
6
|
+
description: typography.heading['1'].$description,
|
|
7
|
+
value: {
|
|
8
|
+
font: cssVars.typography.heading['1'],
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
'typography.heading.2': {
|
|
12
|
+
description: typography.heading['2'].$description,
|
|
13
|
+
value: {
|
|
14
|
+
font: cssVars.typography.heading['2'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
'typography.heading.3': {
|
|
18
|
+
description: typography.heading['3'].$description,
|
|
19
|
+
value: {
|
|
20
|
+
font: cssVars.typography.heading['3'],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
'typography.heading.4': {
|
|
24
|
+
description: typography.heading['4'].$description,
|
|
25
|
+
value: {
|
|
26
|
+
font: cssVars.typography.heading['4'],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
'typography.heading.5': {
|
|
30
|
+
description: typography.heading['5'].$description,
|
|
31
|
+
value: {
|
|
32
|
+
font: cssVars.typography.heading['5'],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
'typography.body.sm': {
|
|
36
|
+
description: typography.body.sm.$description,
|
|
37
|
+
value: {
|
|
38
|
+
font: cssVars.typography.body.sm.regular,
|
|
39
|
+
'& strong:not([class]), &:is(strong)': {
|
|
40
|
+
font: cssVars.typography.body.sm.strong,
|
|
41
|
+
},
|
|
42
|
+
'& em:not([class]), &:is(em)': {
|
|
43
|
+
font: cssVars.typography.body.sm.em,
|
|
44
|
+
},
|
|
45
|
+
'& code:not([class])': {
|
|
46
|
+
fontSize: '0.9em !important',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
'typography.body.sm.regular': {
|
|
51
|
+
description: typography.body.sm.regular.$description,
|
|
52
|
+
value: {
|
|
53
|
+
font: cssVars.typography.body.sm.regular,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
'typography.body.sm.medium': {
|
|
57
|
+
description: typography.body.sm.medium.$description,
|
|
58
|
+
value: {
|
|
59
|
+
font: cssVars.typography.body.sm.medium,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
'typography.body.sm.strong': {
|
|
63
|
+
description: typography.body.sm.strong.$description,
|
|
64
|
+
value: {
|
|
65
|
+
font: cssVars.typography.body.sm.strong,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
'typography.body.sm.em': {
|
|
69
|
+
description: typography.body.sm.em.$description,
|
|
70
|
+
value: {
|
|
71
|
+
font: cssVars.typography.body.sm.em,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
'typography.body.md.regular': {
|
|
75
|
+
description: typography.body.md.regular.$description,
|
|
76
|
+
value: {
|
|
77
|
+
font: cssVars.typography.body.md.regular,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
'typography.body.md': {
|
|
81
|
+
description: typography.body.md.$description,
|
|
82
|
+
value: {
|
|
83
|
+
font: cssVars.typography.body.md.regular,
|
|
84
|
+
'& strong:not([class]), &:is(strong)': {
|
|
85
|
+
font: cssVars.typography.body.md.strong,
|
|
86
|
+
},
|
|
87
|
+
'& em:not([class]), &:is(em)': {
|
|
88
|
+
font: cssVars.typography.body.md.em,
|
|
89
|
+
},
|
|
90
|
+
'& code:not([class])': {
|
|
91
|
+
fontSize: '0.9em !important',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
'typography.body.md.medium': {
|
|
96
|
+
description: typography.body.md.medium.$description,
|
|
97
|
+
value: {
|
|
98
|
+
font: cssVars.typography.body.md.medium,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
'typography.body.md.strong': {
|
|
102
|
+
description: typography.body.md.strong.$description,
|
|
103
|
+
value: {
|
|
104
|
+
font: cssVars.typography.body.md.strong,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
'typography.body.md.em': {
|
|
108
|
+
description: typography.body.md.em.$description,
|
|
109
|
+
value: {
|
|
110
|
+
font: cssVars.typography.body.md.em,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
'typography.code': {
|
|
114
|
+
description: typography.code.$description,
|
|
115
|
+
value: {
|
|
116
|
+
font: cssVars.typography.code,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
inherit: {
|
|
120
|
+
description: 'Inherit text styles from parent',
|
|
121
|
+
value: {
|
|
122
|
+
font: 'inherit',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
} satisfies CompositionStyles['textStyles'];
|
|
126
|
+
|
|
127
|
+
export const textStyles = defineTextStyles(textCompositions);
|
|
128
|
+
export const TEXT_STYLES = Object.keys(
|
|
129
|
+
textCompositions,
|
|
130
|
+
) as (keyof typeof textCompositions)[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Z_INDEX } from '../constants';
|
|
2
|
+
|
|
3
|
+
export const zIndex = {
|
|
4
|
+
'000': {
|
|
5
|
+
value: Z_INDEX.DEFAULT,
|
|
6
|
+
},
|
|
7
|
+
'100': {
|
|
8
|
+
value: Z_INDEX.NAVBAR,
|
|
9
|
+
},
|
|
10
|
+
'200': {
|
|
11
|
+
value: Z_INDEX.POPOVER,
|
|
12
|
+
},
|
|
13
|
+
'300': {
|
|
14
|
+
value: Z_INDEX.SLIDEOUT,
|
|
15
|
+
},
|
|
16
|
+
'400': {
|
|
17
|
+
value: Z_INDEX.MODAL,
|
|
18
|
+
},
|
|
19
|
+
'500': {
|
|
20
|
+
value: Z_INDEX.TOAST,
|
|
21
|
+
},
|
|
22
|
+
'600': {
|
|
23
|
+
value: Z_INDEX.TOOLTIP,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineUtility } from '@pandacss/dev';
|
|
2
|
+
import { sizes } from '../tokens/sizes';
|
|
3
|
+
import { cssVars } from '@iress-oss/ids-tokens';
|
|
4
|
+
|
|
5
|
+
export const selectChevron = defineUtility({
|
|
6
|
+
className: 'selectChevron',
|
|
7
|
+
values: { type: 'boolean' },
|
|
8
|
+
transform: (value) => {
|
|
9
|
+
return {
|
|
10
|
+
'&:after': {
|
|
11
|
+
content: `''` as never,
|
|
12
|
+
width: sizes['chevron.select'].value,
|
|
13
|
+
height: sizes['chevron.select'].value,
|
|
14
|
+
top: '50%',
|
|
15
|
+
insetInlineEnd: `calc(${cssVars.spacing[2]} + calc(0.25 * ${cssVars.spacing[2]}))`,
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
mask: `no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")`,
|
|
18
|
+
transform:
|
|
19
|
+
value === true
|
|
20
|
+
? 'translateY(-50%)'
|
|
21
|
+
: 'translateY(-50%) rotate(180deg)',
|
|
22
|
+
backgroundColor: `var(--iress-chevron-color, ${cssVars.colour.neutral[90]})`,
|
|
23
|
+
pointerEvents: 'none',
|
|
24
|
+
},
|
|
25
|
+
'&[aria-expanded="true"]:after, [aria-expanded="true"] > &:after': {
|
|
26
|
+
transform:
|
|
27
|
+
value === true
|
|
28
|
+
? 'translateY(-50%) rotate(180deg)'
|
|
29
|
+
: 'translateY(-50%)',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
});
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { cssVars } from '@iress-oss/ids-tokens';
|
|
2
|
+
import { defineUtility } from '@pandacss/dev';
|
|
3
|
+
|
|
4
|
+
export const focusable = defineUtility({
|
|
5
|
+
className: 'focusable',
|
|
6
|
+
values: [
|
|
7
|
+
'true',
|
|
8
|
+
'within',
|
|
9
|
+
'has-button',
|
|
10
|
+
'has-input',
|
|
11
|
+
'has-switch',
|
|
12
|
+
'label-after',
|
|
13
|
+
'expander-activator',
|
|
14
|
+
'select-activator',
|
|
15
|
+
'slider',
|
|
16
|
+
'group',
|
|
17
|
+
'inset',
|
|
18
|
+
'within:inset',
|
|
19
|
+
'colour.primary.onFill',
|
|
20
|
+
],
|
|
21
|
+
transform: (value) => {
|
|
22
|
+
if (value === 'has-input') {
|
|
23
|
+
return {
|
|
24
|
+
background: cssVars.colour.neutral[10],
|
|
25
|
+
borderColor: `var(--iress-border-color--default, var(--iress-border-color, ${cssVars.colour.neutral[70]}))`,
|
|
26
|
+
|
|
27
|
+
'&:has(input:disabled, textarea:disabled, select:disabled, [contenteditable][aria-disabled="true"])':
|
|
28
|
+
{
|
|
29
|
+
background: `var(--iress-background--disabled, ${cssVars.colour.neutral[20]})`,
|
|
30
|
+
'--iress-chevron-color': cssVars.colour.neutral[60],
|
|
31
|
+
cursor: 'not-allowed',
|
|
32
|
+
},
|
|
33
|
+
'&:hover:not(:has(input:disabled, textarea:disabled, select:disabled, [contenteditable][aria-disabled="true"]))':
|
|
34
|
+
{
|
|
35
|
+
background: `var(--iress-background-hover, ${cssVars.colour.neutral[20]})`,
|
|
36
|
+
borderColor: `var(--iress-border-color--hover, ${cssVars.colour.neutral[70]})`,
|
|
37
|
+
},
|
|
38
|
+
'input:focus, textarea:focus, select:focus, [contenteditable="true"]:focus':
|
|
39
|
+
{
|
|
40
|
+
outline: 'none',
|
|
41
|
+
},
|
|
42
|
+
'&:has(input:focus:not(:disabled), textarea:focus:not(:disabled), select:focus:not(:disabled), [contenteditable="true"]:focus:not([aria-disabled="true"]))':
|
|
43
|
+
{
|
|
44
|
+
borderColor: `var(--iress-border-color, ${cssVars.colour.neutral[90]})`,
|
|
45
|
+
boxShadow: `var(--iress-shadow-focus, 0 0 0 1px var(--iress-border-color, ${cssVars.colour.neutral[90]}))`,
|
|
46
|
+
|
|
47
|
+
'&:hover': {
|
|
48
|
+
background: cssVars.colour.neutral[10],
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
'& .ids-input__addon': {
|
|
52
|
+
color: cssVars.colour.neutral[90],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (value === 'expander-activator') {
|
|
59
|
+
return {
|
|
60
|
+
'&:focus-visible': {
|
|
61
|
+
boxShadow: `0 0 0 2px ${cssVars.colour.globalInteractions.focusRing}`,
|
|
62
|
+
},
|
|
63
|
+
'&[aria-expanded="true"]:focus-visible': {
|
|
64
|
+
borderRadius: cssVars.radius.system.layout,
|
|
65
|
+
bg: cssVars.colour.neutral[10],
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (value === 'has-switch') {
|
|
71
|
+
return {
|
|
72
|
+
'&:focus-visible': {
|
|
73
|
+
outline: 'none',
|
|
74
|
+
},
|
|
75
|
+
'&:has([role="switch"]:focus-visible)': {
|
|
76
|
+
boxShadow: `0 0 0 1.5px ${cssVars.colour.neutral[10]}, 0 0 0 3.5px ${cssVars.colour.globalInteractions.focusRing}`,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (value === 'has-button') {
|
|
82
|
+
return {
|
|
83
|
+
'&:focus-visible': {
|
|
84
|
+
outline: 'none',
|
|
85
|
+
},
|
|
86
|
+
'&:has(:focus-visible)': {
|
|
87
|
+
boxShadow: `0 0 0 1.5px ${cssVars.colour.neutral[10]}, 0 0 0 3.5px ${cssVars.colour.globalInteractions.focusRing}`,
|
|
88
|
+
|
|
89
|
+
'& :focus-visible': {
|
|
90
|
+
outline: 'none',
|
|
91
|
+
boxShadow: 'none',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (value === 'group') {
|
|
98
|
+
return {
|
|
99
|
+
'.group:has(:focus-visible) &': {
|
|
100
|
+
boxShadow: `0 0 0 1.5px ${cssVars.colour.neutral[10]}, 0 0 0 3.5px ${cssVars.colour.globalInteractions.focusRing}`,
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (value === 'label-after') {
|
|
106
|
+
return {
|
|
107
|
+
'&:focus-visible': {
|
|
108
|
+
outline: 'none',
|
|
109
|
+
},
|
|
110
|
+
'&:focus-visible + label': {
|
|
111
|
+
boxShadow: `0 0 0 1.5px ${cssVars.colour.neutral[10]}, 0 0 0 3.5px ${cssVars.colour.globalInteractions.focusRing}`,
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (value === 'within') {
|
|
117
|
+
return {
|
|
118
|
+
'&:focus-visible, & :focus': {
|
|
119
|
+
outline: 'none',
|
|
120
|
+
},
|
|
121
|
+
'&:focus-within': {
|
|
122
|
+
boxShadow: `0 0 0 1.5px ${cssVars.colour.neutral[10]}, 0 0 0 3.5px ${cssVars.colour.globalInteractions.focusRing}`,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (value === 'within:inset') {
|
|
128
|
+
return {
|
|
129
|
+
'&:focus-visible, & :focus': {
|
|
130
|
+
outline: 'none',
|
|
131
|
+
},
|
|
132
|
+
'&:focus-within': {
|
|
133
|
+
boxShadow: `inset 0 0 0 2px ${cssVars.colour.globalInteractions.focusRing}`,
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (value === 'select-activator') {
|
|
139
|
+
return {
|
|
140
|
+
'&:hover': {
|
|
141
|
+
backgroundColor: cssVars.colour.neutral[20],
|
|
142
|
+
},
|
|
143
|
+
'&:focus-within, &:active, &[aria-expanded="true"]': {
|
|
144
|
+
backgroundColor: cssVars.colour.neutral[10],
|
|
145
|
+
outline: 'none',
|
|
146
|
+
borderColor: `var(--iress-border-color, ${cssVars.colour.neutral[90]})`,
|
|
147
|
+
boxShadow: `0 0 0 1px var(--iress-border-color, ${cssVars.colour.neutral[90]})`,
|
|
148
|
+
},
|
|
149
|
+
'&:disabled, &[aria-disabled="true"]': {
|
|
150
|
+
backgroundColor: cssVars.colour.neutral[30],
|
|
151
|
+
color: cssVars.colour.neutral[60],
|
|
152
|
+
'--iress-chevron-color': cssVars.colour.neutral[60],
|
|
153
|
+
cursor: 'not-allowed',
|
|
154
|
+
|
|
155
|
+
'&:focus-within, &:active, &[aria-expanded="true"]': {
|
|
156
|
+
borderColor: 'unset',
|
|
157
|
+
boxShadow: 'none',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (value === 'inset') {
|
|
164
|
+
return {
|
|
165
|
+
'&:focus-visible': {
|
|
166
|
+
outline: 'none',
|
|
167
|
+
boxShadow: `inset 0 0 0 2px ${cssVars.colour.globalInteractions.focusRing}`,
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (value === 'slider') {
|
|
173
|
+
return {
|
|
174
|
+
'&:focus': {
|
|
175
|
+
outline: 'none',
|
|
176
|
+
},
|
|
177
|
+
'&:focus-visible::-webkit-slider-thumb': {
|
|
178
|
+
boxShadow: `0 0 0 1.5px ${cssVars.colour.neutral[10]}, 0 0 0 3.5px ${cssVars.colour.globalInteractions.focusRing}`,
|
|
179
|
+
},
|
|
180
|
+
'&:focus-visible::-moz-range-thumb': {
|
|
181
|
+
boxShadow: `0 0 0 1.5px ${cssVars.colour.neutral[10]}, 0 0 0 3.5px ${cssVars.colour.globalInteractions.focusRing}`,
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (value === 'colour.primary.onFill') {
|
|
187
|
+
return {
|
|
188
|
+
'&:focus-visible': {
|
|
189
|
+
outline: 'none',
|
|
190
|
+
boxShadow: `0 0 0 1.5px ${cssVars.colour.primary.fill}, 0 0 0 3.5px ${cssVars.colour.primary.onFill}`,
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return {
|
|
196
|
+
'&:focus-visible': {
|
|
197
|
+
outline: 'none',
|
|
198
|
+
boxShadow: `0 0 0 1.5px ${cssVars.colour.neutral[10]}, 0 0 0 3.5px ${cssVars.colour.globalInteractions.focusRing}`,
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineUtility } from '@pandacss/dev';
|
|
2
|
+
import { spacing, SPACING_TOKENS } from '../tokens/spacing';
|
|
3
|
+
import { cssVars } from '@iress-oss/ids-tokens';
|
|
4
|
+
|
|
5
|
+
export const gutter = defineUtility({
|
|
6
|
+
className: 'gutter',
|
|
7
|
+
values: SPACING_TOKENS,
|
|
8
|
+
transform: (value: keyof typeof spacing) => {
|
|
9
|
+
if (!value || !(value in spacing)) {
|
|
10
|
+
return {};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
'--col-gap': spacing[value].value,
|
|
15
|
+
marginInline: `calc(-1 * var(--col-gap) / 2)`,
|
|
16
|
+
columnGap: cssVars.spacing[0],
|
|
17
|
+
rowGap: `var(--col-gap)`,
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineUtility } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
const ALIGN_MAP: Record<string, string> = {
|
|
4
|
+
left: 'flex-start',
|
|
5
|
+
center: 'center',
|
|
6
|
+
right: 'flex-end',
|
|
7
|
+
around: 'space-around',
|
|
8
|
+
between: 'space-between',
|
|
9
|
+
evenly: 'space-evenly',
|
|
10
|
+
stretch: 'stretch',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const flexHorizontalAlign = defineUtility({
|
|
14
|
+
className: 'fha',
|
|
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
|
+
...(cssValue === 'stretch' ? {} : { justifyContent: cssValue }),
|
|
21
|
+
},
|
|
22
|
+
'&:where([data-flex-dir="column"])': {
|
|
23
|
+
alignItems: cssValue,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MATERIAL_SYMBOLS } from '../constants';
|
|
2
|
+
import { defineUtility } from '@pandacss/dev';
|
|
3
|
+
|
|
4
|
+
const baseStyles = {
|
|
5
|
+
fontFamily: MATERIAL_SYMBOLS.family,
|
|
6
|
+
fontWeight: String(MATERIAL_SYMBOLS.weight),
|
|
7
|
+
verticalAlign: 'middle',
|
|
8
|
+
fontFeatureSettings: "'liga'",
|
|
9
|
+
display: 'inline-block',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const materialSymbols = defineUtility({
|
|
13
|
+
className: 'ids_ms',
|
|
14
|
+
values: ['true', 'filled'],
|
|
15
|
+
transform: (value) => {
|
|
16
|
+
if (value === 'filled') {
|
|
17
|
+
return {
|
|
18
|
+
...baseStyles,
|
|
19
|
+
fontVariationSettings: `'FILL' 1, 'wght' ${MATERIAL_SYMBOLS.weight}, 'GRAD' ${MATERIAL_SYMBOLS.grade}, 'opsz' ${MATERIAL_SYMBOLS.opticalSize}`,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
...baseStyles,
|
|
25
|
+
fontVariationSettings: `'FILL' 0, 'wght' ${MATERIAL_SYMBOLS.weight}, 'GRAD' ${MATERIAL_SYMBOLS.grade}, 'opsz' ${MATERIAL_SYMBOLS.opticalSize}`,
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineUtility } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
export const noGutter = defineUtility({
|
|
4
|
+
className: 'noGutter',
|
|
5
|
+
values: { type: 'boolean' },
|
|
6
|
+
transform: (value) => {
|
|
7
|
+
if (!value) return {};
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
'& > :last-child': {
|
|
11
|
+
marginBlockEnd: '0px',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { defineUtility } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
export const offsetCompositions = {
|
|
4
|
+
'0': {
|
|
5
|
+
description: '0 grid column to offset',
|
|
6
|
+
value: {
|
|
7
|
+
marginLeft: '0px',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
'1': {
|
|
11
|
+
description: '1 grid column to offset',
|
|
12
|
+
value: {
|
|
13
|
+
marginLeft: 'calc(1 / 12 * 100%)',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
'2': {
|
|
17
|
+
description: '2 grid columns to offset',
|
|
18
|
+
value: {
|
|
19
|
+
marginLeft: 'calc(2 / 12 * 100%)',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
'3': {
|
|
23
|
+
description: '3 grid columns to offset',
|
|
24
|
+
value: {
|
|
25
|
+
marginLeft: 'calc(3 / 12 * 100%)',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
'4': {
|
|
29
|
+
description: '4 grid columns to offset',
|
|
30
|
+
value: {
|
|
31
|
+
marginLeft: 'calc(4 / 12 * 100%)',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
'5': {
|
|
35
|
+
description: '5 grid columns to offset',
|
|
36
|
+
value: {
|
|
37
|
+
marginLeft: 'calc(5 / 12 * 100%)',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
'6': {
|
|
41
|
+
description: '6 grid columns to offset',
|
|
42
|
+
value: {
|
|
43
|
+
marginLeft: 'calc(6 / 12 * 100%)',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
'7': {
|
|
47
|
+
description: '7 grid columns to offset',
|
|
48
|
+
value: {
|
|
49
|
+
marginLeft: 'calc(7 / 12 * 100%)',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
'8': {
|
|
53
|
+
description: '8 grid columns to offset',
|
|
54
|
+
value: {
|
|
55
|
+
marginLeft: 'calc(8 / 12 * 100%)',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
'9': {
|
|
59
|
+
description: '9 grid columns to offset',
|
|
60
|
+
value: {
|
|
61
|
+
marginLeft: 'calc(9 / 12 * 100%)',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
'10': {
|
|
65
|
+
description: '10 grid columns to offset',
|
|
66
|
+
value: {
|
|
67
|
+
marginLeft: 'calc(10 / 12 * 100%)',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
'11': {
|
|
71
|
+
description: '11 grid columns to offset',
|
|
72
|
+
value: {
|
|
73
|
+
marginLeft: 'calc(11 / 12 * 100%)',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
type OffsetValue = keyof typeof offsetCompositions;
|
|
79
|
+
|
|
80
|
+
export const offset = defineUtility({
|
|
81
|
+
className: 'offset',
|
|
82
|
+
values: Object.keys(offsetCompositions),
|
|
83
|
+
transform: (value?: OffsetValue) => {
|
|
84
|
+
if (!value) {
|
|
85
|
+
return {};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return offsetCompositions[value].value;
|
|
89
|
+
},
|
|
90
|
+
});
|