@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,8 @@
1
+ import { cssVars } from '@iress-oss/ids-tokens';
2
+ import { defineGlobalStyles } from '@pandacss/dev';
3
+
4
+ export const globalCss = defineGlobalStyles({
5
+ body: {
6
+ background: cssVars.colour.neutral[10],
7
+ },
8
+ });
@@ -0,0 +1,55 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { SPACING_ALIAS_MAP } from './spacingAliasMap';
3
+ import { codegenPrepareHook } from './codegenPrepareHook';
4
+ import type { Artifact } from '@pandacss/types';
5
+
6
+ const makeArtifacts = (code: string): Artifact[] => [
7
+ {
8
+ id: 'css-fn',
9
+ files: [{ file: 'css.mjs', code }],
10
+ } as Artifact,
11
+ ];
12
+
13
+ describe('codegenPrepareHook', () => {
14
+ it('injects alias resolution around withoutSpace(value)', () => {
15
+ const artifacts = makeArtifacts(
16
+ 'return { className: `${propKey}_${withoutSpace(value)}` }',
17
+ );
18
+ const result = codegenPrepareHook(artifacts) as Artifact[];
19
+
20
+ const code = result[0].files[0].code!;
21
+ expect(code).toContain('__spacingAliases__');
22
+ expect(code).toContain('__negSpacingAliases__');
23
+ expect(code).toContain('__spacingProps__');
24
+ expect(code).toContain('withoutSpace(__resolveAlias__(key, value))');
25
+ expect(code).not.toContain('withoutSpace(value)');
26
+ });
27
+
28
+ it('includes all aliases and their negatives in the injected map', () => {
29
+ const artifacts = makeArtifacts('withoutSpace(value)');
30
+ const result = codegenPrepareHook(artifacts) as Artifact[];
31
+ const code = result[0].files[0].code!;
32
+
33
+ // Positive aliases
34
+ for (const [alias, canonical] of Object.entries(SPACING_ALIAS_MAP)) {
35
+ expect(code).toContain(`"${alias}":"${canonical}"`);
36
+ }
37
+ // Negative aliases
38
+ for (const [alias, canonical] of Object.entries(SPACING_ALIAS_MAP)) {
39
+ expect(code).toContain(`"-${alias}":"-${canonical}"`);
40
+ }
41
+ });
42
+
43
+ it('returns void when css-fn artifact is missing', () => {
44
+ const result = codegenPrepareHook([
45
+ { id: 'other', files: [] } as unknown as Artifact,
46
+ ]);
47
+ expect(result).toBeUndefined();
48
+ });
49
+
50
+ it('returns void when withoutSpace(value) is not found', () => {
51
+ const artifacts = makeArtifacts('someOtherCode()');
52
+ const result = codegenPrepareHook(artifacts);
53
+ expect(result).toBeUndefined();
54
+ });
55
+ });
@@ -0,0 +1,57 @@
1
+ import type { Artifact } from '@pandacss/types';
2
+ import { SPACING_ALIAS_MAP } from './spacingAliasMap';
3
+
4
+ /**
5
+ * Injects alias resolution into the generated css runtime so that
6
+ * gap="sm" produces class `gap_spacing.2` (reusing the canonical class)
7
+ * instead of generating a duplicate `gap_sm` class.
8
+ */
9
+ export function codegenPrepareHook(artifacts: Artifact[]): Artifact[] | void {
10
+ const cssFnArtifact = artifacts.find((a) => a.id === 'css-fn');
11
+ if (!cssFnArtifact?.files) return;
12
+
13
+ const cssFile = cssFnArtifact.files.find((f) =>
14
+ f.code?.includes('withoutSpace(value)'),
15
+ );
16
+ if (!cssFile) return;
17
+
18
+ const negAliases = Object.fromEntries(
19
+ Object.entries(SPACING_ALIAS_MAP).map(([k, v]) => [`-${k}`, `-${v}`]),
20
+ );
21
+
22
+ const spacingProps = [
23
+ 'gap',
24
+ 'columnGap',
25
+ 'rowGap',
26
+ 'gutter',
27
+ 'margin',
28
+ 'marginTop',
29
+ 'marginBottom',
30
+ 'marginLeft',
31
+ 'marginRight',
32
+ 'marginBlock',
33
+ 'marginInline',
34
+ 'padding',
35
+ 'paddingTop',
36
+ 'paddingBottom',
37
+ 'paddingLeft',
38
+ 'paddingRight',
39
+ 'paddingBlock',
40
+ 'paddingInline',
41
+ ];
42
+
43
+ const injection = `const __spacingAliases__ = ${JSON.stringify(SPACING_ALIAS_MAP)};
44
+ const __negSpacingAliases__ = ${JSON.stringify(negAliases)};
45
+ const __spacingProps__ = new Set(${JSON.stringify(spacingProps)});
46
+ const __resolveAlias__ = (prop, v) => __spacingProps__.has(prop) ? (__spacingAliases__[v] || __negSpacingAliases__[v] || v) : v;
47
+ `;
48
+
49
+ cssFile.code =
50
+ injection +
51
+ cssFile.code!.replace(
52
+ /withoutSpace\(value\)/,
53
+ 'withoutSpace(__resolveAlias__(key, value))',
54
+ );
55
+
56
+ return artifacts;
57
+ }
@@ -0,0 +1,57 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { cssgenDoneHook } from './cssgenDoneHook';
3
+
4
+ describe('cssgenDoneHook', () => {
5
+ it('ignores non-styles.css artifacts', () => {
6
+ const result = cssgenDoneHook('tokens', '.gap_sm{gap:var(--spacing-sm)}');
7
+ expect(result).toBeUndefined();
8
+ });
9
+
10
+ it('removes alias utility classes that reference alias vars', () => {
11
+ const css =
12
+ '.gap_spacing\\.2{gap:var(--spacing-spacing\\.2)}' +
13
+ '.gap_sm{gap:var(--spacing-sm)}' +
14
+ '.p_xs{padding:var(--spacing-xs)}';
15
+
16
+ const result = cssgenDoneHook('styles.css', css);
17
+ expect(result).toContain(
18
+ '.gap_spacing\\.2{gap:var(--spacing-spacing\\.2)}',
19
+ );
20
+ expect(result).not.toContain('.gap_sm{');
21
+ expect(result).not.toContain('.p_xs{');
22
+ });
23
+
24
+ it('removes negative alias utility classes', () => {
25
+ const css = '.mt_-sm{margin-top:calc(var(--spacing-sm) * -1)}';
26
+ const result = cssgenDoneHook('styles.css', css);
27
+ expect(result).not.toContain('.mt_-sm{');
28
+ });
29
+
30
+ it('removes alias :root variable definitions', () => {
31
+ const css =
32
+ ':root{--spacing-sm:var(--spacing-spacing\\.2);--spacing-spacing\\.2:0.5rem}';
33
+ const result = cssgenDoneHook('styles.css', css);
34
+ expect(result).not.toContain('--spacing-sm:');
35
+ expect(result).toContain('--spacing-spacing\\.2:0.5rem');
36
+ });
37
+
38
+ it('preserves canonical classes untouched', () => {
39
+ const css =
40
+ '.gap_spacing\\.2{gap:var(--spacing-spacing\\.2)}' +
41
+ '.mt_spacing\\.0{margin-top:var(--spacing-spacing\\.0)}';
42
+ const result = cssgenDoneHook('styles.css', css);
43
+ expect(result).toBe(css);
44
+ });
45
+
46
+ it('handles all six aliases', () => {
47
+ const aliases = ['none', 'xs', 'sm', 'md', 'lg', 'xl'];
48
+ const css = aliases
49
+ .map((a) => `.gap_${a}{gap:var(--spacing-${a})}`)
50
+ .join('');
51
+
52
+ const result = cssgenDoneHook('styles.css', css);
53
+ for (const alias of aliases) {
54
+ expect(result).not.toContain(`.gap_${alias}{`);
55
+ }
56
+ });
57
+ });
@@ -0,0 +1,31 @@
1
+ import { SPACING_ALIAS_MAP } from './spacingAliasMap';
2
+
3
+ /**
4
+ * Strips leftover alias utility classes and :root variable definitions
5
+ * from the final CSS. These are extracted from source files by Panda but
6
+ * are unused since the runtime now maps aliases to canonical tokens.
7
+ */
8
+ export function cssgenDoneHook(
9
+ artifact: string,
10
+ content: string,
11
+ ): string | void {
12
+ if (artifact !== 'styles.css') return;
13
+
14
+ const aliases = Object.keys(SPACING_ALIAS_MAP);
15
+ let css = content;
16
+
17
+ for (const alias of aliases) {
18
+ // Remove alias utility classes that reference var(--spacing-ALIAS)
19
+ css = css.replace(
20
+ new RegExp(
21
+ `\\.[^\\s,{}]+_-?${alias}\\{[^}]*var\\(--spacing-${alias}\\)[^}]*\\}`,
22
+ 'g',
23
+ ),
24
+ '',
25
+ );
26
+ // Remove alias :root variable definitions
27
+ css = css.replace(new RegExp(`--spacing-${alias}:[^;]+;`, 'g'), '');
28
+ }
29
+
30
+ return css;
31
+ }
@@ -0,0 +1,3 @@
1
+ export { codegenPrepareHook } from './codegenPrepareHook';
2
+ export { cssgenDoneHook } from './cssgenDoneHook';
3
+ export { SPACING_ALIAS_MAP } from './spacingAliasMap';
@@ -0,0 +1,15 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { SPACING_ALIAS_MAP } from './spacingAliasMap';
3
+
4
+ describe('spacingAliasMap', () => {
5
+ it('derives all aliases from ids-tokens schema', () => {
6
+ expect(SPACING_ALIAS_MAP).toEqual({
7
+ none: 'spacing.0',
8
+ xs: 'spacing.1',
9
+ sm: 'spacing.2',
10
+ md: 'spacing.4',
11
+ lg: 'spacing.6',
12
+ xl: 'spacing.10',
13
+ });
14
+ });
15
+ });
@@ -0,0 +1,13 @@
1
+ import { spacing } from '@iress-oss/ids-tokens';
2
+
3
+ /**
4
+ * Derives the alias-to-canonical spacing map from the ids-tokens schema.
5
+ * e.g. { none: 'spacing.0', xs: 'spacing.1', sm: 'spacing.2', ... }
6
+ */
7
+ export const SPACING_ALIAS_MAP: Record<string, string> = Object.fromEntries(
8
+ Object.entries(spacing).flatMap(([key, token]) => {
9
+ const aliases = (token as { $extensions?: { 'iress.aliases'?: string[] } })
10
+ .$extensions?.['iress.aliases'];
11
+ return aliases ? aliases.map((alias) => [alias, `spacing.${key}`]) : [];
12
+ }),
13
+ );
package/src/index.ts ADDED
@@ -0,0 +1,133 @@
1
+ import { definePreset } from '@pandacss/dev';
2
+
3
+ import { globalCss } from './globalCss';
4
+
5
+ import { staticCss } from './staticCss';
6
+
7
+ import { textRecipe } from './config-recipes/text';
8
+ import { tableRecipe } from './config-recipes/table';
9
+
10
+ import { borders } from './tokens/borders';
11
+ import { colors } from './tokens/colors';
12
+ import { radii } from './tokens/radii';
13
+ import { sizes } from './tokens/sizes';
14
+ import { spacing } from './tokens/spacing';
15
+ import { zIndex } from './tokens/zIndex';
16
+ import { breakpoints } from './tokens/breakpoints';
17
+ import { layerStyles } from './tokens/layerStyles';
18
+ import { textStyles } from './tokens/textStyles';
19
+ import { keyframes } from './tokens/keyframes';
20
+ import { animationStyles } from './tokens/animationStyles';
21
+
22
+ import { span } from './utilities/span';
23
+ import { offset } from './utilities/offset';
24
+ import { gutter } from './utilities/gutter';
25
+ import { selectChevron } from './utilities/chevron';
26
+ import { buttonRecipe } from './config-recipes/button';
27
+ import { sliderThumb } from './utilities/sliderThumb';
28
+ import { noGutter } from './utilities/noGutter';
29
+ import { stretch } from './utilities/stretch';
30
+ import { focusable } from './utilities/focusable';
31
+ import { scrollable } from './utilities/scrollable';
32
+ import { materialSymbols } from './utilities/materialSymbols';
33
+ import { flexHorizontalAlign } from './utilities/horizontalAlign';
34
+ import { flexVerticalAlign } from './utilities/verticalAlign';
35
+
36
+ const idsThemePreset = definePreset({
37
+ name: 'theme-preset',
38
+
39
+ globalCss,
40
+
41
+ staticCss,
42
+
43
+ conditions: {
44
+ extend: {
45
+ nestedFormElements: [
46
+ '& .iress-form-element:not(& .iress-form-element .iress-form-element)',
47
+ '& .iress-form-element__inner:not(& .iress-form-element .iress-form-element)',
48
+ ].join(', '),
49
+ nestedFormLabels: '& .iress-form-label:not(.sr_true)',
50
+ directNestedFormElements: '& > .iress-form-element',
51
+ directNestedSizedElements: [
52
+ '& > :has([class*="w_input"])',
53
+ '& > :has([class*="sizes.chevron.select"])',
54
+ '& > .iress-form-element',
55
+ ].join(', '),
56
+ nestedFieldsExceptFirst: [
57
+ '& > .iress-form-element:not(:first-child)',
58
+ '& > .iress-form-element:not(:first-child) .iress-form-element__inner',
59
+ '& .ids-field:not(:first-child) .iress-form-element',
60
+ '& .ids-field:not(:first-child) .iress-form-element__inner',
61
+ ].join(', '),
62
+ nestedFieldsExceptLast: [
63
+ '& > .iress-form-element:not(:last-child)',
64
+ '& > .iress-form-element:not(:last-child) .iress-form-element__inner',
65
+ '& .ids-field:not(:last-child) .iress-form-element',
66
+ '& .ids-field:not(:last-child) .iress-form-element__inner',
67
+ ].join(', '),
68
+ progressBar: ['&::-webkit-progress-bar', '&::-webkit-meter-bar'].join(
69
+ ', ',
70
+ ),
71
+ progressValue: [
72
+ '&::-webkit-progress-value',
73
+ '&::-webkit-meter-optimum-value',
74
+ '&::-webkit-meter-suboptimum-value',
75
+ ].join(', '),
76
+ mozProgressValue: ['&::-moz-progress-bar', '&::-moz-meter-bar'].join(
77
+ ', ',
78
+ ),
79
+ webkitSliderThumb: '&::-webkit-slider-thumb',
80
+ mozRangeThumb: '&::-moz-range-thumb',
81
+ webkitSliderRunnableTrack: '&::-webkit-slider-runnable-track',
82
+ mozRangeTrack: '&::-moz-range-track',
83
+ directNestedHeadings: '& > h1, & > h2, & > h3, & > h4, & > h5, & > h6',
84
+ siblingHeadings:
85
+ '& + h1:not(.ids-text), & + h2:not(.ids-text), & + h3:not(.ids-text), & + h4:not(.ids-text), & + h5:not(.ids-text), & + h6:not(.ids-text)',
86
+ nestedHeadings:
87
+ '& h1:not(.ids-text), & h2:not(.ids-text), & h3:not(.ids-text), & h4:not(.ids-text), & h5:not(.ids-text), & h6:not(.ids-text)',
88
+ },
89
+ },
90
+
91
+ theme: {
92
+ tokens: {
93
+ borders,
94
+ colors,
95
+ radii,
96
+ sizes,
97
+ spacing,
98
+ zIndex,
99
+ },
100
+ extend: {
101
+ breakpoints,
102
+ keyframes,
103
+ layerStyles,
104
+ textStyles,
105
+ animationStyles,
106
+ recipes: {
107
+ button: buttonRecipe,
108
+ table: tableRecipe,
109
+ text: textRecipe,
110
+ },
111
+ },
112
+ },
113
+
114
+ utilities: {
115
+ extend: {
116
+ focusable,
117
+ gutter,
118
+ flexHorizontalAlign,
119
+ flexVerticalAlign,
120
+ selectChevron,
121
+ materialSymbols,
122
+ offset,
123
+ span,
124
+ sliderThumb,
125
+ noGutter,
126
+ scrollable,
127
+ stretch,
128
+ },
129
+ },
130
+ });
131
+
132
+ export default idsThemePreset;
133
+ export { idsThemePreset };
@@ -0,0 +1,103 @@
1
+ import { type ExtendableOptions } from '@pandacss/types';
2
+ import { colors } from './tokens/colors';
3
+ import { radii } from './tokens/radii';
4
+ import { textCompositions } from './tokens/textStyles';
5
+ import { spanCompositions } from './utilities/span';
6
+ import { offsetCompositions } from './utilities/offset';
7
+ import { MARGIN_TOKENS, SPACING_TOKENS } from './tokens/spacing';
8
+ import { breakpoints } from './tokens/breakpoints';
9
+ import { HORIZONTAL_ALIGNS, TEXT_ALIGNS, VERTICAL_ALIGNS } from './constants';
10
+
11
+ /**
12
+ * Allowed CSS properties for all components.
13
+ * This a subset of the full list of Panda props that are allowed to be customised.
14
+ * If its not here, its not customisable for IDS consumers.
15
+ *
16
+ * Note: If you update this list, you should also update the `IressCSSProps` interface in `packages/components/src/interfaces.ts`
17
+ */
18
+
19
+ /**
20
+ * Properties that need responsive variants (used at different breakpoints).
21
+ * These generate classes for base + each breakpoint (7× per value).
22
+ */
23
+ const responsiveProps = {
24
+ columnGap: SPACING_TOKENS,
25
+ gap: SPACING_TOKENS,
26
+
27
+ // We can't use margin shorthand because it won't generate the correct CSS
28
+ margin: MARGIN_TOKENS,
29
+ marginBlock: MARGIN_TOKENS,
30
+ marginInline: MARGIN_TOKENS,
31
+ marginTop: MARGIN_TOKENS,
32
+ marginBottom: MARGIN_TOKENS,
33
+ marginLeft: MARGIN_TOKENS,
34
+ marginRight: MARGIN_TOKENS,
35
+
36
+ // We can't use padding shorthand because it won't generate the correct CSS
37
+ padding: SPACING_TOKENS,
38
+ paddingBlock: SPACING_TOKENS,
39
+ paddingInline: SPACING_TOKENS,
40
+ paddingTop: SPACING_TOKENS,
41
+ paddingBottom: SPACING_TOKENS,
42
+ paddingLeft: SPACING_TOKENS,
43
+ paddingRight: SPACING_TOKENS,
44
+ rowGap: SPACING_TOKENS,
45
+ srOnly: ['true', 'false'],
46
+ width: ['*'],
47
+
48
+ // Only available in IressCol
49
+ offset: Object.keys(offsetCompositions),
50
+ span: Object.keys(spanCompositions),
51
+
52
+ // Only available in IressRow
53
+ gutter: SPACING_TOKENS,
54
+ };
55
+
56
+ /**
57
+ * Properties that don't need responsive variants (rarely change per breakpoint).
58
+ * These generate only base classes (1× per value).
59
+ */
60
+ const staticProps = {
61
+ alignSelf: ['start', 'end', 'center', 'stretch'],
62
+ bg: Object.keys(colors),
63
+ borderRadius: Object.keys(radii),
64
+ color: Object.keys(colors),
65
+ flex: ['1'],
66
+ focusable: [
67
+ 'true',
68
+ 'within',
69
+ 'within:inset',
70
+ 'inset',
71
+ 'has-button',
72
+ 'has-input',
73
+ 'has-switch',
74
+ 'label-after',
75
+ 'expander-activator',
76
+ 'select-activator',
77
+ 'slider',
78
+ 'group',
79
+ ],
80
+ hideBelow: Object.keys(breakpoints),
81
+ hideFrom: Object.keys(breakpoints),
82
+ flexHorizontalAlign: [...HORIZONTAL_ALIGNS],
83
+ maxWidth: ['*'],
84
+ noGutter: ['true'],
85
+ scrollable: ['x', 'y', 'true'],
86
+ stretch: ['true'],
87
+ textAlign: [...TEXT_ALIGNS],
88
+ textStyle: Object.keys(textCompositions),
89
+ flexVerticalAlign: [...VERTICAL_ALIGNS],
90
+ };
91
+
92
+ export const staticCss: ExtendableOptions['staticCss'] = {
93
+ css: [
94
+ {
95
+ properties: responsiveProps,
96
+ responsive: true,
97
+ },
98
+ {
99
+ properties: staticProps,
100
+ responsive: false,
101
+ },
102
+ ],
103
+ };
@@ -0,0 +1,79 @@
1
+ import { defineAnimationStyles } from '@pandacss/dev';
2
+ import { type keyframes } from './keyframes';
3
+
4
+ type AnimationName = keyof typeof keyframes;
5
+
6
+ export const animationStyles = defineAnimationStyles({
7
+ 'field-footer': {
8
+ value: {
9
+ animationName: 'fieldFooter' as AnimationName,
10
+ animationDuration: '0.5s',
11
+ animationTimingFunction: 'ease-in-out',
12
+ animationFillMode: 'forwards',
13
+ },
14
+ },
15
+ 'icon-spin-half': {
16
+ value: {
17
+ animationName: 'iconRotation' as AnimationName,
18
+ animationDuration: '0.5s',
19
+ animationTimingFunction: 'linear',
20
+ animationIterationCount: 'infinite',
21
+ },
22
+ },
23
+ 'icon-spin-1': {
24
+ value: {
25
+ animationName: 'iconRotation' as AnimationName,
26
+ animationDuration: '1s',
27
+ animationTimingFunction: 'linear',
28
+ animationIterationCount: 'infinite',
29
+ },
30
+ },
31
+ 'icon-spin-2': {
32
+ value: {
33
+ animationName: 'iconRotation' as AnimationName,
34
+ animationDuration: '2s',
35
+ animationTimingFunction: 'linear',
36
+ animationIterationCount: 'infinite',
37
+ },
38
+ },
39
+ 'icon-spin-3': {
40
+ value: {
41
+ animationName: 'iconRotation' as AnimationName,
42
+ animationDuration: '3s',
43
+ animationTimingFunction: 'linear',
44
+ animationIterationCount: 'infinite',
45
+ },
46
+ },
47
+ 'loading-fade-next': {
48
+ value: {
49
+ animationName: 'loadingFadeNext' as AnimationName,
50
+ animationDuration: '0.6s',
51
+ animationTimingFunction: 'linear',
52
+ animationFillMode: 'forwards',
53
+ },
54
+ },
55
+ 'loading-slide-next': {
56
+ value: {
57
+ animationName: 'loadingSlideNext' as AnimationName,
58
+ animationDuration: '0.5s',
59
+ animationTimingFunction: 'ease-in-out',
60
+ animationFillMode: 'forwards',
61
+ },
62
+ },
63
+ 'skeleton-loading': {
64
+ value: {
65
+ animationName: 'skeletonLoading' as AnimationName,
66
+ animationDuration: '2s',
67
+ animationTimingFunction: 'ease-in-out',
68
+ animationIterationCount: 'infinite',
69
+ },
70
+ },
71
+ 'toggle-active': {
72
+ value: {
73
+ animationName: 'toggleActive' as AnimationName,
74
+ animationDuration: '0.3s',
75
+ animationTimingFunction: 'ease-in-out',
76
+ animationFillMode: 'forwards',
77
+ },
78
+ },
79
+ });
@@ -0,0 +1,54 @@
1
+ import { cssVars } from '@iress-oss/ids-tokens';
2
+ import { type Tokens } from '@pandacss/dev';
3
+
4
+ export const borders = {
5
+ alert: {
6
+ description: 'Used for alert borders',
7
+ value: {
8
+ width: '1px',
9
+ style: 'solid',
10
+ color: 'currentColor',
11
+ },
12
+ },
13
+ divider: {
14
+ description: 'Used to divide content',
15
+ value: {
16
+ width: '1px',
17
+ style: 'solid',
18
+ color: cssVars.colour.neutral['50'],
19
+ },
20
+ },
21
+ input: {
22
+ description: 'Border for input fields',
23
+ value: {
24
+ width: '1px',
25
+ style: 'solid',
26
+ color: cssVars.colour.neutral['70'],
27
+ },
28
+ },
29
+ hover: {
30
+ description: 'Used when hovering over elements such as expanders',
31
+ value: {
32
+ width: '1px',
33
+ style: 'solid',
34
+ color: cssVars.colour.primary.fill,
35
+ },
36
+ },
37
+ table: {
38
+ description: 'Used for tables, search bar and cards',
39
+ value: {
40
+ width: '1px',
41
+ style: 'solid',
42
+ color: cssVars.colour.neutral['40'],
43
+ },
44
+ },
45
+ transparent: {
46
+ description:
47
+ 'Used to make a border transparent (e.g. for specific variants)',
48
+ value: {
49
+ width: '1px',
50
+ style: 'solid',
51
+ color: 'transparent',
52
+ },
53
+ },
54
+ } satisfies Tokens['borders'];
@@ -0,0 +1,9 @@
1
+ import { BREAKPOINT_DETAILS } from '../constants';
2
+
3
+ // Panda uses a mobile-first breakpoint system and leverages min-width media queries @media(min-width) when you write responsive styles.
4
+ export const breakpoints = Object.fromEntries(
5
+ Object.entries(BREAKPOINT_DETAILS).map(([breakpoint, detail]) => [
6
+ breakpoint,
7
+ detail.minScreenWidth,
8
+ ]),
9
+ );