@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.
Files changed (54) hide show
  1. package/README.md +102 -0
  2. package/dist/chunk-6T7NHIQQ.js +2994 -0
  3. package/dist/chunk-OGLE65KO.js +149 -0
  4. package/dist/chunk-V3SF6JCX.js +75 -0
  5. package/dist/config.d.ts +13 -0
  6. package/dist/config.js +25 -0
  7. package/dist/constants.d.ts +150 -0
  8. package/dist/constants.js +22 -0
  9. package/dist/hooks/index.d.ts +23 -0
  10. package/dist/hooks/index.js +10 -0
  11. package/dist/index.d.ts +5 -0
  12. package/dist/index.js +9 -0
  13. package/dist/vite.d.ts +13 -0
  14. package/dist/vite.js +38 -0
  15. package/package.json +74 -0
  16. package/src/config-recipes/button.ts +739 -0
  17. package/src/config-recipes/table.ts +258 -0
  18. package/src/config-recipes/text.ts +237 -0
  19. package/src/constants.ts +193 -0
  20. package/src/createMinimalConfig.ts +29 -0
  21. package/src/globalCss.ts +8 -0
  22. package/src/hooks/codegenPrepareHook.test.ts +55 -0
  23. package/src/hooks/codegenPrepareHook.ts +57 -0
  24. package/src/hooks/cssgenDoneHook.test.ts +57 -0
  25. package/src/hooks/cssgenDoneHook.ts +31 -0
  26. package/src/hooks/index.ts +3 -0
  27. package/src/hooks/spacingAliasMap.test.ts +15 -0
  28. package/src/hooks/spacingAliasMap.ts +13 -0
  29. package/src/index.ts +133 -0
  30. package/src/staticCss.ts +103 -0
  31. package/src/tokens/animationStyles.ts +79 -0
  32. package/src/tokens/borders.ts +54 -0
  33. package/src/tokens/breakpoints.ts +9 -0
  34. package/src/tokens/colors.ts +286 -0
  35. package/src/tokens/keyframes.ts +74 -0
  36. package/src/tokens/layerStyles.ts +99 -0
  37. package/src/tokens/radii.ts +52 -0
  38. package/src/tokens/sizes.ts +184 -0
  39. package/src/tokens/spacing.ts +82 -0
  40. package/src/tokens/textStyles.ts +130 -0
  41. package/src/tokens/zIndex.ts +25 -0
  42. package/src/utilities/chevron.ts +33 -0
  43. package/src/utilities/focusable.ts +202 -0
  44. package/src/utilities/gutter.ts +20 -0
  45. package/src/utilities/horizontalAlign.ts +27 -0
  46. package/src/utilities/materialSymbols.ts +28 -0
  47. package/src/utilities/noGutter.ts +15 -0
  48. package/src/utilities/offset.ts +90 -0
  49. package/src/utilities/scrollable.ts +53 -0
  50. package/src/utilities/sliderThumb.ts +29 -0
  51. package/src/utilities/span.ts +136 -0
  52. package/src/utilities/stretch.ts +15 -0
  53. package/src/utilities/verticalAlign.ts +27 -0
  54. package/src/vite.ts +47 -0
@@ -0,0 +1,286 @@
1
+ import { colour, cssVars } from '@iress-oss/ids-tokens';
2
+
3
+ export const colors = {
4
+ 'colour.neutral.10': {
5
+ description: colour.neutral['10'].$description,
6
+ value: cssVars.colour.neutral['10'],
7
+ },
8
+ 'colour.neutral.20': {
9
+ description: colour.neutral['20'].$description,
10
+ value: cssVars.colour.neutral['20'],
11
+ },
12
+ 'colour.neutral.30': {
13
+ description: colour.neutral['30'].$description,
14
+ value: cssVars.colour.neutral['30'],
15
+ },
16
+ 'colour.neutral.40': {
17
+ description: colour.neutral['40'].$description,
18
+ value: cssVars.colour.neutral['40'],
19
+ },
20
+ 'colour.neutral.50': {
21
+ description: colour.neutral['50'].$description,
22
+ value: cssVars.colour.neutral['50'],
23
+ },
24
+ 'colour.neutral.60': {
25
+ description: colour.neutral['60'].$description,
26
+ value: cssVars.colour.neutral['60'],
27
+ },
28
+ 'colour.neutral.70': {
29
+ description: colour.neutral['70'].$description,
30
+ value: cssVars.colour.neutral['70'],
31
+ },
32
+ 'colour.neutral.80': {
33
+ description: colour.neutral['80'].$description,
34
+ value: cssVars.colour.neutral['80'],
35
+ },
36
+ 'colour.neutral.90': {
37
+ description: colour.neutral['90'].$description,
38
+ value: cssVars.colour.neutral['90'],
39
+ },
40
+ 'colour.primary.fill': {
41
+ description: colour.primary.fill.$description,
42
+ value: cssVars.colour.primary.fill,
43
+ },
44
+ 'colour.primary.fillHover': {
45
+ description: colour.primary.fillHover.$description,
46
+ value: cssVars.colour.primary.fillHover,
47
+ },
48
+ 'colour.primary.onFill': {
49
+ description: colour.primary.onFill.$description,
50
+ value: cssVars.colour.primary.onFill,
51
+ },
52
+ 'colour.primary.surface': {
53
+ description: colour.primary.surface.$description,
54
+ value: cssVars.colour.primary.surface,
55
+ },
56
+ 'colour.primary.surfaceHover': {
57
+ description: colour.primary.surfaceHover.$description,
58
+ value: cssVars.colour.primary.surfaceHover,
59
+ },
60
+ 'colour.primary.text': {
61
+ description: colour.primary.text.$description,
62
+ value: cssVars.colour.primary.text,
63
+ },
64
+ 'colour.accent.fill': {
65
+ description: colour.accent.fill.$description,
66
+ value: cssVars.colour.accent.fill,
67
+ },
68
+ 'colour.accent.fillHover': {
69
+ description: colour.accent.fillHover.$description,
70
+ value: cssVars.colour.accent.fillHover,
71
+ },
72
+ 'colour.accent.onFill': {
73
+ description: colour.accent.onFill.$description,
74
+ value: cssVars.colour.accent.onFill,
75
+ },
76
+ 'colour.accent.surface': {
77
+ description: colour.accent.surface.$description,
78
+ value: cssVars.colour.accent.surface,
79
+ },
80
+ 'colour.accent.surfaceHover': {
81
+ description: colour.accent.surfaceHover.$description,
82
+ value: cssVars.colour.accent.surfaceHover,
83
+ },
84
+ 'colour.accent.text': {
85
+ description: colour.accent.text.$description,
86
+ value: cssVars.colour.accent.text,
87
+ },
88
+ 'colour.system.success.fill': {
89
+ description: colour.system.success.fill.$description,
90
+ value: cssVars.colour.system.success.fill,
91
+ },
92
+ 'colour.system.success.fillHover': {
93
+ description: colour.system.success.fillHover.$description,
94
+ value: cssVars.colour.system.success.fillHover,
95
+ },
96
+ 'colour.system.success.onFill': {
97
+ description: colour.system.success.onFill.$description,
98
+ value: cssVars.colour.system.success.onFill,
99
+ },
100
+ 'colour.system.success.surface': {
101
+ description: colour.system.success.surface.$description,
102
+ value: cssVars.colour.system.success.surface,
103
+ },
104
+ 'colour.system.success.surfaceHover': {
105
+ description: colour.system.success.surfaceHover.$description,
106
+ value: cssVars.colour.system.success.surfaceHover,
107
+ },
108
+ 'colour.system.success.text': {
109
+ description: colour.system.success.text.$description,
110
+ value: cssVars.colour.system.success.text,
111
+ },
112
+ 'colour.system.danger.fill': {
113
+ description: colour.system.danger.fill.$description,
114
+ value: cssVars.colour.system.danger.fill,
115
+ },
116
+ 'colour.system.danger.fillHover': {
117
+ description: colour.system.danger.fillHover.$description,
118
+ value: cssVars.colour.system.danger.fillHover,
119
+ },
120
+ 'colour.system.danger.onFill': {
121
+ description: colour.system.danger.onFill.$description,
122
+ value: cssVars.colour.system.danger.onFill,
123
+ },
124
+ 'colour.system.danger.surface': {
125
+ description: colour.system.danger.surface.$description,
126
+ value: cssVars.colour.system.danger.surface,
127
+ },
128
+ 'colour.system.danger.surfaceHover': {
129
+ description: colour.system.danger.surfaceHover.$description,
130
+ value: cssVars.colour.system.danger.surfaceHover,
131
+ },
132
+ 'colour.system.danger.text': {
133
+ description: colour.system.danger.text.$description,
134
+ value: cssVars.colour.system.danger.text,
135
+ },
136
+ 'colour.system.warning.fill': {
137
+ description: colour.system.warning.fill.$description,
138
+ value: cssVars.colour.system.warning.fill,
139
+ },
140
+ 'colour.system.warning.onFill': {
141
+ description: colour.system.warning.onFill.$description,
142
+ value: cssVars.colour.system.warning.onFill,
143
+ },
144
+ 'colour.system.warning.fillHover': {
145
+ description: colour.system.warning.fillHover.$description,
146
+ value: cssVars.colour.system.warning.fillHover,
147
+ },
148
+ 'colour.system.warning.surface': {
149
+ description: colour.system.warning.surface.$description,
150
+ value: cssVars.colour.system.warning.surface,
151
+ },
152
+ 'colour.system.warning.text': {
153
+ description: colour.system.warning.text.$description,
154
+ value: cssVars.colour.system.warning.text,
155
+ },
156
+ 'colour.system.warning.surfaceHover': {
157
+ description: colour.system.warning.surfaceHover.$description,
158
+ value: cssVars.colour.system.warning.surfaceHover,
159
+ },
160
+ 'colour.system.info.fill': {
161
+ description: colour.system.info.fill.$description,
162
+ value: cssVars.colour.system.info.fill,
163
+ },
164
+ 'colour.system.info.onFill': {
165
+ description: colour.system.info.onFill.$description,
166
+ value: cssVars.colour.system.info.onFill,
167
+ },
168
+ 'colour.system.info.fillHover': {
169
+ description: colour.system.info.fillHover.$description,
170
+ value: cssVars.colour.system.info.fillHover,
171
+ },
172
+ 'colour.system.info.surface': {
173
+ description: colour.system.info.surface.$description,
174
+ value: cssVars.colour.system.info.surface,
175
+ },
176
+ 'colour.system.info.text': {
177
+ description: colour.system.info.text.$description,
178
+ value: cssVars.colour.system.info.text,
179
+ },
180
+ 'colour.system.info.surfaceHover': {
181
+ description: colour.system.info.surfaceHover.$description,
182
+ value: cssVars.colour.system.info.surfaceHover,
183
+ },
184
+ 'colour.data.subtle.10': {
185
+ description: colour.data.subtle['10'].$description,
186
+ value: cssVars.colour.data.subtle['10'],
187
+ },
188
+ 'colour.data.subtle.20': {
189
+ description: colour.data.subtle['20'].$description,
190
+ value: cssVars.colour.data.subtle['20'],
191
+ },
192
+ 'colour.data.subtle.30': {
193
+ description: colour.data.subtle['30'].$description,
194
+ value: cssVars.colour.data.subtle['30'],
195
+ },
196
+ 'colour.data.subtle.40': {
197
+ description: colour.data.subtle['40'].$description,
198
+ value: cssVars.colour.data.subtle['40'],
199
+ },
200
+ 'colour.data.subtle.50': {
201
+ description: colour.data.subtle['50'].$description,
202
+ value: cssVars.colour.data.subtle['50'],
203
+ },
204
+ 'colour.data.subtle.60': {
205
+ description: colour.data.subtle['60'].$description,
206
+ value: cssVars.colour.data.subtle['60'],
207
+ },
208
+ 'colour.data.subtle.70': {
209
+ description: colour.data.subtle['70'].$description,
210
+ value: cssVars.colour.data.subtle['70'],
211
+ },
212
+ 'colour.data.subtle.80': {
213
+ description: colour.data.subtle['80'].$description,
214
+ value: cssVars.colour.data.subtle['80'],
215
+ },
216
+ 'colour.data.subtle.90': {
217
+ description: colour.data.subtle['90'].$description,
218
+ value: cssVars.colour.data.subtle['90'],
219
+ },
220
+ 'colour.data.bold.10': {
221
+ description: colour.data.bold['10'].$description,
222
+ value: cssVars.colour.data.bold['10'],
223
+ },
224
+ 'colour.data.bold.20': {
225
+ description: colour.data.bold['20'].$description,
226
+ value: cssVars.colour.data.bold['20'],
227
+ },
228
+ 'colour.data.bold.30': {
229
+ description: colour.data.bold['30'].$description,
230
+ value: cssVars.colour.data.bold['30'],
231
+ },
232
+ 'colour.data.bold.40': {
233
+ description: colour.data.bold['40'].$description,
234
+ value: cssVars.colour.data.bold['40'],
235
+ },
236
+ 'colour.data.bold.50': {
237
+ description: colour.data.bold['50'].$description,
238
+ value: cssVars.colour.data.bold['50'],
239
+ },
240
+ 'colour.data.bold.60': {
241
+ description: colour.data.bold['60'].$description,
242
+ value: cssVars.colour.data.bold['60'],
243
+ },
244
+ 'colour.data.bold.70': {
245
+ description: colour.data.bold['70'].$description,
246
+ value: cssVars.colour.data.bold['70'],
247
+ },
248
+ 'colour.data.bold.80': {
249
+ description: colour.data.bold['80'].$description,
250
+ value: cssVars.colour.data.bold['80'],
251
+ },
252
+ 'colour.data.bold.90': {
253
+ description: colour.data.bold['90'].$description,
254
+ value: cssVars.colour.data.bold['90'],
255
+ },
256
+ 'colour.globalInteractions.backdrop': {
257
+ description: colour.globalInteractions.backdrop.$description,
258
+ value: cssVars.colour.globalInteractions.backdrop,
259
+ },
260
+ 'colour.globalInteractions.focusRing': {
261
+ description: colour.globalInteractions.focusRing.$description,
262
+ value: cssVars.colour.globalInteractions.focusRing,
263
+ },
264
+ transparent: {
265
+ description: 'Transparent colour, used to create a transparent background.',
266
+ value: 'rgba(0, 0, 0, 0)',
267
+ },
268
+ page: {
269
+ description: 'Page colour, used for backgrounds.',
270
+ value: cssVars.colour.neutral['10'],
271
+ },
272
+ alt: {
273
+ description: 'Alternative colour, used for alternative backgrounds.',
274
+ value: cssVars.colour.neutral['20'],
275
+ },
276
+ muted: {
277
+ description: 'Muted colour, used for less prominent text.',
278
+ value: cssVars.colour.neutral['70'],
279
+ },
280
+ text: {
281
+ description: 'Text colour, used for primary text content.',
282
+ value: cssVars.colour.neutral['80'],
283
+ },
284
+ };
285
+
286
+ export const COLOR_TOKENS = Object.keys(colors) as (keyof typeof colors)[];
@@ -0,0 +1,74 @@
1
+ import { cssVars } from '@iress-oss/ids-tokens';
2
+ import { defineKeyframes } from '@pandacss/dev';
3
+
4
+ export const keyframes = defineKeyframes({
5
+ chatty: {
6
+ '0%, 60%, 100%': { transform: 'translateY(0)', opacity: '0.7' },
7
+ '30%': { transform: 'translateY(50%)', opacity: '1' },
8
+ },
9
+ fieldFooter: {
10
+ '0%': {
11
+ display: 'none',
12
+ opacity: 0,
13
+ transform: `translateY(calc(${cssVars.spacing[2]} * -1))`,
14
+ },
15
+ '100%': { display: 'block', opacity: 1, transform: 'translateY(0)' },
16
+ },
17
+ iconRotation: {
18
+ from: { transform: 'rotate(0deg)' },
19
+ to: { transform: 'rotate(359deg)' },
20
+ },
21
+ loadingDots: {
22
+ to: { clipPath: 'inset(0 -34% 0 0)' },
23
+ },
24
+ loadingFadeNext: {
25
+ from: { opacity: 0, gridTemplateRows: '0fr' },
26
+ to: { opacity: 1, gridTemplateRows: '1fr' },
27
+ },
28
+ loadingSlideNext: {
29
+ from: { opacity: 0, transform: 'translateX(2.5em)' },
30
+ to: { opacity: 1, transform: 'translateX(0)' },
31
+ },
32
+ loadingItemFill: {
33
+ '0%': { boxShadow: 'inset 0px 0px 0px currentColor' },
34
+ '100%': { boxShadow: 'inset 0px 0px 0px 30px currentColor' },
35
+ },
36
+ loadingItemScale: {
37
+ '0%, 100%': { transform: 'none' },
38
+ '50%': { transform: 'scale3d(1.1, 1.1, 1)' },
39
+ },
40
+ loadingItemStroke: {
41
+ '100%': { strokeDashoffset: 0 },
42
+ },
43
+ skeletonLoading: {
44
+ '0%': { backgroundPositionX: '0' },
45
+ '40%': { backgroundPositionX: '-200%' },
46
+ '100%': { backgroundPositionX: '-200%' },
47
+ },
48
+ modalStatusIcon: {
49
+ '0%': {
50
+ boxShadow:
51
+ '0 0 0 0 color-mix(in srgb, var(--alert-fill) 0%, transparent)',
52
+ },
53
+ '50%': {
54
+ boxShadow:
55
+ '0 0 0 6px color-mix(in srgb, var(--alert-fill) 25%, transparent)',
56
+ },
57
+ '100%': {
58
+ boxShadow:
59
+ '0 0 0 12px color-mix(in srgb, var(--alert-fill) 0%, transparent)',
60
+ },
61
+ },
62
+ filterIndicatorBounceIn: {
63
+ '0%': { opacity: 0, transform: 'scale(0)' },
64
+ '50%': { opacity: 1, transform: 'scale(1.4)' },
65
+ '70%': { transform: 'scale(0.85)' },
66
+ '100%': { transform: 'scale(1)' },
67
+ },
68
+ toggleActive: {
69
+ '0%': { opacity: 0, transform: 'scale(1)' },
70
+ '40%': { opacity: 1, transform: 'scaleX(1.25) scaleY(1.5)' },
71
+ '99%': { opacity: 0, transform: 'scaleX(1.5) scaleY(1.75)' },
72
+ '100%': { opacity: 0, transform: 'scale(1)' },
73
+ },
74
+ });
@@ -0,0 +1,99 @@
1
+ import { type CompositionStyles, defineLayerStyles } from '@pandacss/dev';
2
+ import { cssVars } from '@iress-oss/ids-tokens';
3
+
4
+ const internalLayerStyles: CompositionStyles['layerStyles'] = {
5
+ dropdown: {
6
+ description:
7
+ 'Used for dropdown elements (eg. DropdownMenu, Select and Popover)',
8
+ value: {
9
+ boxShadow: '0 4px 8px #141F4D0A',
10
+ border: `1px solid ${cssVars.colour.neutral[40]}`,
11
+ },
12
+ },
13
+ dots: {
14
+ description: 'Used to represent a loading state with dots',
15
+ value: {
16
+ background: `radial-gradient(circle closest-side, currentcolor 90%, transparent) 0 / calc(100% / 3) 100% space`,
17
+ },
18
+ },
19
+ floating: {
20
+ description: 'Used to represent a floating element (eg. Slideout)',
21
+ value: {
22
+ boxShadow: '0 10px 18px #091E4215',
23
+ border: '0.5px solid #091E4215',
24
+ },
25
+ },
26
+ overflow: {
27
+ description:
28
+ 'Used to indicate an element is scrollable when its content overflows (eg. TabSet and Table)',
29
+ value: {
30
+ boxShadow: 'inset -13px 0px 18.8px #091E420D',
31
+ },
32
+ },
33
+ skeleton: {
34
+ description: 'Used to represent a skeleton background',
35
+ value: {
36
+ background: `linear-gradient(110deg, ${cssVars.colour.neutral[30]} 63%, ${cssVars.colour.neutral[20]} 74%, ${cssVars.colour.neutral[20]} 78%, ${cssVars.colour.neutral[30]} 84%, ${cssVars.colour.neutral[30]} 100%)`,
37
+ backgroundSize: '200% 100%',
38
+ backgroundPosition: '0 center',
39
+ },
40
+ },
41
+ 'focusRing.primary.sm': {
42
+ description: 'Focus ring for primary interactive elements (2px)',
43
+ value: {
44
+ boxShadow: `color-mix(in srgb, ${cssVars.colour.primary.fill}, transparent 80%) 0px 0px 0px 2px`,
45
+ },
46
+ },
47
+ 'focusRing.primary.md': {
48
+ description: 'Focus ring for primary interactive elements (3px)',
49
+ value: {
50
+ boxShadow: `color-mix(in srgb, ${cssVars.colour.primary.fill}, transparent 80%) 0px 0px 0px 3px`,
51
+ },
52
+ },
53
+ 'focusRing.primary.subtle': {
54
+ description: 'Subtle focus ring for secondary/quaternary primary elements',
55
+ value: {
56
+ boxShadow: `color-mix(in srgb, ${cssVars.colour.primary.fill}, transparent 90%) 0px 0px 0px 2px`,
57
+ },
58
+ },
59
+ 'focusRing.danger.md': {
60
+ description: 'Focus ring for danger interactive elements (3px)',
61
+ value: {
62
+ boxShadow: `color-mix(in srgb, ${cssVars.colour.system.danger.fill}, transparent 80%) 0px 0px 0px 3px`,
63
+ },
64
+ },
65
+ 'focusRing.danger.surface': {
66
+ description: 'Focus ring using danger surface colour',
67
+ value: {
68
+ boxShadow: `color-mix(in srgb, ${cssVars.colour.system.danger.surface}, transparent 40%) 0px 0px 0px 3px`,
69
+ },
70
+ },
71
+ 'focusRing.success.md': {
72
+ description: 'Focus ring for success interactive elements (3px)',
73
+ value: {
74
+ boxShadow: `color-mix(in srgb, ${cssVars.colour.system.success.fill}, transparent 80%) 0px 0px 0px 3px`,
75
+ },
76
+ },
77
+ 'focusRing.success.surface': {
78
+ description: 'Focus ring using success surface colour',
79
+ value: {
80
+ boxShadow: `color-mix(in srgb, ${cssVars.colour.system.success.surface}, transparent 40%) 0px 0px 0px 3px`,
81
+ },
82
+ },
83
+ 'focusRing.info.surface': {
84
+ description: 'Focus ring using info surface colour',
85
+ value: {
86
+ boxShadow: `color-mix(in srgb, ${cssVars.colour.system.info.surface}, transparent 40%) 0px 0px 0px 3px`,
87
+ },
88
+ },
89
+ 'focusRing.warning.surface': {
90
+ description: 'Focus ring using warning surface colour',
91
+ value: {
92
+ boxShadow: `color-mix(in srgb, ${cssVars.colour.system.warning.surface}, transparent 40%) 0px 0px 0px 3px`,
93
+ },
94
+ },
95
+ };
96
+
97
+ export const layerStyles = defineLayerStyles({
98
+ ...internalLayerStyles,
99
+ });
@@ -0,0 +1,52 @@
1
+ import { radius, cssVars } from '@iress-oss/ids-tokens';
2
+
3
+ export const radii = {
4
+ 'radius.0': {
5
+ description: radius[0].$description,
6
+ value: cssVars.radius['0'],
7
+ },
8
+ 'radius.1': {
9
+ description: radius[1].$description,
10
+ value: cssVars.radius['1'],
11
+ },
12
+ 'radius.2': {
13
+ description: radius[2].$description,
14
+ value: cssVars.radius['2'],
15
+ },
16
+ 'radius.3': {
17
+ description: radius[3].$description,
18
+ value: cssVars.radius['3'],
19
+ },
20
+ 'radius.4': {
21
+ description: radius[4].$description,
22
+ value: cssVars.radius['4'],
23
+ },
24
+ 'radius.system.button': {
25
+ description: radius.system.button.$description,
26
+ value: cssVars.radius.system.button,
27
+ },
28
+ 'radius.system.form': {
29
+ description: radius.system.form.$description,
30
+ value: cssVars.radius.system.form,
31
+ },
32
+ 'radius.system.layout': {
33
+ description: radius.system.layout.$description,
34
+ value: cssVars.radius.system.layout,
35
+ },
36
+ 'radius.system.pill': {
37
+ description: radius.system.pill.$description,
38
+ value: cssVars.radius.system.pill,
39
+ },
40
+ 'radius.system.tag': {
41
+ description: radius.system.tag.$description,
42
+ value: cssVars.radius.system.tag,
43
+ },
44
+ none: {
45
+ description: 'No border radius',
46
+ value: cssVars.radius['0'],
47
+ },
48
+ '50%': {
49
+ description: 'Circle radius',
50
+ value: '50%',
51
+ },
52
+ };
@@ -0,0 +1,184 @@
1
+ // https://panda-css.com/docs/theming/tokens#sizes
2
+ import {
3
+ BREAKPOINT_DETAILS,
4
+ FORM_ELEMENT_WIDTHS,
5
+ GRID_SIZE,
6
+ } from '../constants';
7
+ import { cssVars } from '@iress-oss/ids-tokens';
8
+
9
+ const containerSizes = Object.fromEntries(
10
+ Object.entries(BREAKPOINT_DETAILS).map(([breakpoint, detail]) => [
11
+ `container.${breakpoint}`,
12
+ {
13
+ description: `Width of the container at the ${breakpoint} breakpoint`,
14
+ value: detail.containerMaxWidth,
15
+ },
16
+ ]),
17
+ );
18
+
19
+ const inputSizes = {
20
+ ...Object.fromEntries(
21
+ FORM_ELEMENT_WIDTHS.filter((value) => !value.includes('%')).map((width) => {
22
+ const description = `1rem * ${width}`;
23
+
24
+ let value;
25
+ if (width === '2') {
26
+ value = `calc(${cssVars.typography.base.size} * ${width} + ${cssVars.typography.base.size})`;
27
+ } else {
28
+ value = `calc(${cssVars.typography.base.size} * ${width})`;
29
+ }
30
+
31
+ return [
32
+ `input.${width}`,
33
+ {
34
+ description,
35
+ value,
36
+ },
37
+ ];
38
+ }),
39
+ ),
40
+ 'input.height': {
41
+ description: 'input height based on typography size',
42
+ value: `calc(${cssVars.typography.base.size} * (34 / 14))`,
43
+ },
44
+ 'input.height.sm': {
45
+ description: 'input height based on typography size (sm)',
46
+ value: `calc(${cssVars.typography.base.size} * (30 / 14))`,
47
+ },
48
+ };
49
+
50
+ const gridSizes = Object.fromEntries(
51
+ Array.from({ length: GRID_SIZE }, (_, i) => i + 1).map((size) => [
52
+ `${size}/${GRID_SIZE}`,
53
+ {
54
+ description: `Grid size ${size}`,
55
+ value: `${(size / GRID_SIZE) * 100}%`,
56
+ },
57
+ ]),
58
+ );
59
+
60
+ const overlaySizes = {
61
+ 'overlay.sm': {
62
+ description:
63
+ 'Used for small modals and slideouts. Small overlays communicate the outcome of an irreversible action. They should be concise and straightforward, containing a single action and, in some cases, a single input field.',
64
+ value: '368px',
65
+ },
66
+ 'overlay.md': {
67
+ description:
68
+ 'Used for medium modals and slideouts. Medium overlays provide optional supporting information to help users understand the context of a word or screen. They may contain a single action and, in some cases, a larger input such as a textarea.',
69
+ value: '628px',
70
+ },
71
+ 'overlay.lg': {
72
+ description:
73
+ 'Large modals facilitate sub-flows within a primary flow, allowing users to focus on tasks that will impact the underlying screen once the modal is closed (e.g., adding an item to a table or bulk uploading items). They should be used sparingly and only when there is a direct relationship to the underlying screen, where the action would not warrant a separate dedicated screen.',
74
+ value: '800px',
75
+ },
76
+ };
77
+
78
+ const chevronSizes = {
79
+ 'chevron.select': {
80
+ description:
81
+ 'Used for the chevron when selecting an option in a dropdown or select component.',
82
+ value: `calc(${cssVars.typography.base.size} * 0.7)`,
83
+ },
84
+ };
85
+
86
+ const progressSizes = {
87
+ 'progress.height': {
88
+ description: 'Height of the progress bar',
89
+ value: cssVars.spacing['2'],
90
+ },
91
+ };
92
+
93
+ const sliderSizes = {
94
+ 'slider.track': {
95
+ description: 'Height of the slider track',
96
+ value: `calc(${cssVars.typography.base.size} * (10 / 14))`,
97
+ },
98
+ 'slider.thumb': {
99
+ description: 'Size of the slider thumb',
100
+ value: `calc(${cssVars.typography.base.size} * 2)`,
101
+ },
102
+ 'slider.tick': {
103
+ description: 'Size of the slider tick',
104
+ value: `calc(${cssVars.typography.base.size} * (5 / 14))`,
105
+ },
106
+ };
107
+
108
+ const toggleSizes = {
109
+ 'toggle.width': {
110
+ description: 'Total width of the toggle',
111
+ value: `calc(${cssVars.typography.base.size} * (48 / 14))`,
112
+ },
113
+ 'toggle.thumb': {
114
+ description: 'Size of the toggle thumb',
115
+ value: `calc(${cssVars.typography.base.size} * (24 / 14))`,
116
+ },
117
+ };
118
+
119
+ const typographySizes = {
120
+ 'typography.base': {
121
+ description: 'Base typography size',
122
+ value: cssVars.typography.base.size,
123
+ },
124
+ };
125
+
126
+ const componentSizes = {
127
+ 'input.innerHeight': {
128
+ description: 'Inner height of input (accounting for border)',
129
+ value: `calc(${cssVars.typography.base.size} * (34 / 14) - 2px)`,
130
+ },
131
+ 'mark.size': {
132
+ description: 'Size of checkbox/radio marks',
133
+ value: '1.4em',
134
+ },
135
+ 'icon.sm': {
136
+ description: 'Small icon size',
137
+ value: '1em',
138
+ },
139
+ 'icon.md': {
140
+ description: 'Medium icon size',
141
+ value: '1.5em',
142
+ },
143
+ 'spinner.dot': {
144
+ description: 'Size of spinner dots',
145
+ value: '0.5em',
146
+ },
147
+ 'pill.minHeight': {
148
+ description: 'Minimum height of pill',
149
+ value: '1.35em',
150
+ },
151
+ 'pill.minWidth': {
152
+ description: 'Minimum width of pill',
153
+ value: '1.5em',
154
+ },
155
+ 'tab.indicator': {
156
+ description: 'Height of tab active indicator',
157
+ value: '2px',
158
+ },
159
+ 'menu.indicator': {
160
+ description: 'Width of menu group indicator',
161
+ value: '4px',
162
+ },
163
+ };
164
+
165
+ export const sizes = {
166
+ ...containerSizes,
167
+ ...inputSizes,
168
+ ...gridSizes,
169
+ ...overlaySizes,
170
+ ...chevronSizes,
171
+ ...progressSizes,
172
+ ...sliderSizes,
173
+ ...toggleSizes,
174
+ ...typographySizes,
175
+ ...componentSizes,
176
+ };
177
+
178
+ export const SIZE_TOKENS = Object.keys({
179
+ ...containerSizes,
180
+ ...inputSizes,
181
+ ...gridSizes,
182
+ ...overlaySizes,
183
+ ...typographySizes,
184
+ });