@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
package/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # @iress-oss/ids-theme-preset
2
+
3
+ Panda CSS preset for the Iress Design System (IDS). Defines the complete IDS design token system — tokens, utilities, recipes, conditions, global CSS, and static CSS.
4
+
5
+ > **Note:** If you are already using `@iress-oss/ids-components`, you probably don't need this package directly. IDS components ship with all the styling you need out of the box. This preset is intended for writing custom CSS that can't be achieved with IDS component styling props, while still using the Panda CSS methodology and the type-safety of the IDS token system — think of it as a tool for building IDS extensions.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @iress-oss/ids-theme-preset @pandacss/dev
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ### Minimal config (recommended for packages that already include IDS)
16
+
17
+ If your application already imports `@iress-oss/ids-components` and its `style.css`, use `createMinimalConfig` to avoid duplicating CSS that IDS already ships. This disables preflight, global CSS, and static CSS from the preset while keeping all tokens, types, utilities, and recipes available. Panda will still generate CSS for utilities your code actually uses.
18
+
19
+ ```ts
20
+ import { defineConfig } from '@pandacss/dev';
21
+ import { createMinimalConfig } from '@iress-oss/ids-theme-preset/config';
22
+
23
+ export default defineConfig({
24
+ include: ['./src/**/*.{ts,tsx}'],
25
+ outdir: './styled-system',
26
+ ...createMinimalConfig(),
27
+ });
28
+ ```
29
+
30
+ ### Full config (for IDS components development)
31
+
32
+ Use the preset directly when you need the full CSS output, including preflight, global CSS, and all static utility classes. This is how `@iress-oss/ids-components` itself is configured.
33
+
34
+ ```ts
35
+ import { defineConfig } from '@pandacss/dev';
36
+ import idsPreset from '@iress-oss/ids-theme-preset';
37
+
38
+ export default defineConfig({
39
+ presets: [idsPreset],
40
+ include: ['./src/**/*.{ts,tsx}'],
41
+ outdir: './styled-system',
42
+ });
43
+ ```
44
+
45
+ ### Vite plugin
46
+
47
+ Panda CSS `@layer` declarations can get stripped during Vite builds. The `preservePandaLayerDeclaration` plugin reads the layer declaration from your generated `styles.css` and prepends it to all built CSS files.
48
+
49
+ ```ts
50
+ import { defineConfig } from 'vite';
51
+ import { preservePandaLayerDeclaration } from '@iress-oss/ids-theme-preset/vite';
52
+
53
+ export default defineConfig({
54
+ plugins: [
55
+ preservePandaLayerDeclaration('./src/styled-system/styles.css'),
56
+ ],
57
+ });
58
+ ```
59
+
60
+ ### Using hooks
61
+
62
+ > **Note:** You probably don't need the hooks directly if you are using `createMinimalConfig`, which wires them up for you. These are useful when you need more control over the build pipeline.
63
+
64
+ The package exports build hooks for spacing alias resolution and CSS cleanup:
65
+
66
+ ```ts
67
+ import { defineConfig } from '@pandacss/dev';
68
+ import idsPreset from '@iress-oss/ids-theme-preset';
69
+ import {
70
+ codegenPrepareHook,
71
+ cssgenDoneHook,
72
+ } from '@iress-oss/ids-theme-preset/hooks';
73
+
74
+ export default defineConfig({
75
+ presets: [idsPreset],
76
+ include: ['./src/**/*.{ts,tsx}'],
77
+ outdir: './styled-system',
78
+ hooks: {
79
+ 'codegen:prepare': ({ artifacts }) => codegenPrepareHook(artifacts),
80
+ 'cssgen:done': ({ artifact, content }) => cssgenDoneHook(artifact, content),
81
+ },
82
+ });
83
+ ```
84
+
85
+ ## Exports
86
+
87
+ | Export path | Description |
88
+ |---|---|
89
+ | `@iress-oss/ids-theme-preset` | The full Panda CSS preset |
90
+ | `@iress-oss/ids-theme-preset/config` | `createMinimalConfig()` — config overrides for packages that already include IDS |
91
+ | `@iress-oss/ids-theme-preset/hooks` | Build hooks for spacing alias resolution and CSS cleanup |
92
+ | `@iress-oss/ids-theme-preset/vite` | Vite plugin to preserve Panda CSS `@layer` declarations |
93
+ | `@iress-oss/ids-theme-preset/constants` | Shared constants (breakpoints, material symbols, etc.) |
94
+
95
+ ## Peer Dependencies
96
+
97
+ - `@pandacss/dev` >= 1.8.0
98
+ - `vite` >= 5.0.0 (optional — only needed if using the Vite plugin)
99
+
100
+ ## License
101
+
102
+ Apache-2.0