@asante-org/atlascopco-vt-litesitegenerator 1.2.0

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 (75) hide show
  1. package/README.md +160 -0
  2. package/dist/.storybook/AtlasCopcoTheme.d.ts +2 -0
  3. package/dist/.storybook/main.d.ts +3 -0
  4. package/dist/.storybook/manager.d.ts +1 -0
  5. package/dist/.storybook/preview.d.ts +4 -0
  6. package/dist/assets/.gitkeep +0 -0
  7. package/dist/index.esm.js +696 -0
  8. package/dist/index.esm.js.map +1 -0
  9. package/dist/index.esm.scss +2050 -0
  10. package/dist/index.js +752 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/index.scss +2050 -0
  13. package/dist/src/components/lsg/LsgBanner/LsgBanner.d.ts +17 -0
  14. package/dist/src/components/lsg/LsgBanner/LsgBanner.stories.d.ts +7 -0
  15. package/dist/src/components/lsg/LsgBanner/index.d.ts +2 -0
  16. package/dist/src/components/lsg/LsgButton/LsgButton.d.ts +16 -0
  17. package/dist/src/components/lsg/LsgButton/LsgButton.stories.d.ts +10 -0
  18. package/dist/src/components/lsg/LsgButton/index.d.ts +2 -0
  19. package/dist/src/components/lsg/LsgCard/LsgCard.d.ts +22 -0
  20. package/dist/src/components/lsg/LsgCard/LsgCard.stories.d.ts +9 -0
  21. package/dist/src/components/lsg/LsgCard/index.d.ts +2 -0
  22. package/dist/src/components/lsg/LsgFooter/LsgFooter.d.ts +14 -0
  23. package/dist/src/components/lsg/LsgFooter/LsgFooter.stories.d.ts +6 -0
  24. package/dist/src/components/lsg/LsgFooter/index.d.ts +2 -0
  25. package/dist/src/components/lsg/LsgHeader/LsgHeader.d.ts +14 -0
  26. package/dist/src/components/lsg/LsgHeader/LsgHeader.stories.d.ts +6 -0
  27. package/dist/src/components/lsg/LsgHeader/index.d.ts +2 -0
  28. package/dist/src/components/lsg/LsgLanguageSwitcher/LsgLanguageSwitcher.d.ts +20 -0
  29. package/dist/src/components/lsg/LsgLanguageSwitcher/LsgLanguageSwitcher.stories.d.ts +6 -0
  30. package/dist/src/components/lsg/LsgLanguageSwitcher/index.d.ts +2 -0
  31. package/dist/src/components/lsg/LsgLogo/LsgLogo.d.ts +13 -0
  32. package/dist/src/components/lsg/LsgLogo/LsgLogo.stories.d.ts +7 -0
  33. package/dist/src/components/lsg/LsgLogo/index.d.ts +2 -0
  34. package/dist/src/components/lsg/LsgNavigation/LsgNavigation.d.ts +13 -0
  35. package/dist/src/components/lsg/LsgNavigation/LsgNavigation.stories.d.ts +6 -0
  36. package/dist/src/components/lsg/LsgNavigation/index.d.ts +2 -0
  37. package/dist/src/components/lsg/LsgQuickLinks/LsgQuickLinks.d.ts +11 -0
  38. package/dist/src/components/lsg/LsgQuickLinks/LsgQuickLinks.stories.d.ts +6 -0
  39. package/dist/src/components/lsg/LsgQuickLinks/index.d.ts +2 -0
  40. package/dist/src/components/lsg/LsgSearchOverlay/LsgSearchOverlay.d.ts +19 -0
  41. package/dist/src/components/lsg/LsgSearchOverlay/LsgSearchOverlay.stories.d.ts +6 -0
  42. package/dist/src/components/lsg/LsgSearchOverlay/index.d.ts +2 -0
  43. package/dist/src/components/lsg/LsgSearchTrigger/LsgSearchTrigger.d.ts +10 -0
  44. package/dist/src/components/lsg/LsgSearchTrigger/LsgSearchTrigger.stories.d.ts +6 -0
  45. package/dist/src/components/lsg/LsgSearchTrigger/index.d.ts +2 -0
  46. package/dist/src/components/lsg/LsgSocialMediaIcons/LsgSocialMediaIcons.d.ts +13 -0
  47. package/dist/src/components/lsg/LsgSocialMediaIcons/LsgSocialMediaIcons.stories.d.ts +6 -0
  48. package/dist/src/components/lsg/LsgSocialMediaIcons/index.d.ts +2 -0
  49. package/dist/src/components/lsg/_LsgOverviewComponents.d.ts +35 -0
  50. package/dist/src/components/lsg/index.d.ts +24 -0
  51. package/dist/src/components/lsg/lsg-clientlib-runtime.d.ts +1 -0
  52. package/dist/src/components/lsg/lsg-clientlib.d.ts +14 -0
  53. package/dist/src/index.d.ts +6 -0
  54. package/dist/src/stories/foundation/_components/StoryLayout.d.ts +11 -0
  55. package/dist/src/themes/createThemeComponents.d.ts +19 -0
  56. package/dist/src/themes/theme-1/components.d.ts +16 -0
  57. package/dist/src/themes/theme-1/theme-clientlib.d.ts +1 -0
  58. package/dist/src/themes/theme-2/components.d.ts +16 -0
  59. package/dist/src/themes/theme-2/theme-clientlib.d.ts +1 -0
  60. package/dist/src/themes/theme-3/components.d.ts +16 -0
  61. package/dist/src/themes/theme-3/theme-clientlib.d.ts +1 -0
  62. package/dist/themes/theme-1.css +754 -0
  63. package/dist/themes/theme-1.css.map +1 -0
  64. package/dist/themes/theme-1.js +99 -0
  65. package/dist/themes/theme-1.js.map +1 -0
  66. package/dist/themes/theme-2.css +754 -0
  67. package/dist/themes/theme-2.css.map +1 -0
  68. package/dist/themes/theme-2.js +99 -0
  69. package/dist/themes/theme-2.js.map +1 -0
  70. package/dist/themes/theme-3.css +762 -0
  71. package/dist/themes/theme-3.css.map +1 -0
  72. package/dist/themes/theme-3.js +99 -0
  73. package/dist/themes/theme-3.js.map +1 -0
  74. package/dist/tsconfig.tsbuildinfo +1 -0
  75. package/package.json +115 -0
package/README.md ADDED
@@ -0,0 +1,160 @@
1
+ # Atlas Copco VT Lite Site Generator
2
+
3
+ Standalone Lite Site Generator package for Atlas Copco VT. This package contains the LSG component set, Storybook documentation, and themed AEM-ready CSS/JS outputs.
4
+
5
+ ## Tech stack
6
+
7
+ - **React 18** + **TypeScript**
8
+ - **Storybook 7** with `@storybook/nextjs`
9
+ - **SCSS** + **Tailwind CSS** + **PostCSS**
10
+ - **Next.js 13** to preserve the existing Storybook/runtime foundation
11
+
12
+ ## Getting started
13
+
14
+ ```bash
15
+ # Install dependencies
16
+ npm install
17
+
18
+ # Run Storybook (default: http://localhost:6006)
19
+ npm run storybook
20
+
21
+ # Build static Storybook
22
+ npm run build-storybook
23
+ ```
24
+
25
+ ## Scripts
26
+
27
+ | Script | Description |
28
+ |---------------------|--------------------------------|
29
+ | `npm run storybook` | Start Storybook dev server |
30
+ | `npm run build-storybook` | Build static Storybook |
31
+ | `npm run build:npm` | Build the component library plus all themed assets |
32
+ | `npm run build:themes:css` | Emit `theme-1.css`, `theme-2.css`, `theme-3.css` |
33
+ | `npm run build:themes:js` | Emit `theme-1.js`, `theme-2.js`, `theme-3.js` |
34
+ | `npm run dev` | Start Next.js dev server |
35
+ | `npm run build` | Build Next.js app |
36
+ | `npm run lint` | Run ESLint |
37
+
38
+ ## Project structure
39
+
40
+ ```
41
+ .storybook/ # Storybook config, theme, preview
42
+ src/
43
+ components/lsg/ # Shared base LSG React components, docs, and clientlib runtime
44
+ themes/ # Theme component wrappers plus Theme 1 / 2 / 3 CSS and JS entry points
45
+ stories/foundation/_components/ # Minimal Storybook layout helpers used by LSG docs
46
+ utils/styles/ # Shared spacing/style primitives still used by LSG SCSS
47
+ public/ # Static assets
48
+ ```
49
+
50
+ ## Architecture layers
51
+
52
+ 1. Base layer: `src/components/lsg/` contains the shared structural components and the common SCSS each theme builds from.
53
+ 2. Theme layer: each folder under `src/themes/` exposes its own themed component set that wraps the base components and can add extra theme-specific styling on top.
54
+ 3. Brand layer: the `--lsg-*` CSS custom properties define the brand contract for colours, fonts, radii, and sizes. Each brand/theme supplies its own values for that contract.
55
+
56
+ ## How themes work
57
+
58
+ Themes are built as an extension model, not as separate rewrites of the component library.
59
+
60
+ ### 1. Base components
61
+
62
+ The shared implementation lives under `src/components/lsg/`.
63
+
64
+ - This layer contains the React structure and the common SCSS for `LsgButton`, `LsgHeader`, `LsgFooter`, and the rest of the LSG set.
65
+ - Base components should own the shared markup, accessibility, interaction logic, and stable AEM-facing class names.
66
+ - Base SCSS should use the `--lsg-*` token contract instead of hardcoding a brand style.
67
+
68
+ This is the layer every theme builds on top of.
69
+
70
+ ### 2. Theme components
71
+
72
+ Each theme has its own component entrypoint under `src/themes/<theme>/components.tsx`.
73
+
74
+ - Theme components are wrappers around the base components.
75
+ - The wrapper generation happens in `src/themes/createThemeComponents.tsx`.
76
+ - Each wrapper adds theme-specific classes such as `lsg-themed-component--theme-1` so a theme can target the base component with extra styling.
77
+
78
+ That means the theme can keep the shared functionality from the base component while still changing the presentation or adding a branded treatment.
79
+
80
+ Example flow:
81
+
82
+ 1. `Theme1LsgButton` renders the shared `LsgButton`.
83
+ 2. The wrapper adds the `lsg-themed-component--theme-1` class.
84
+ 3. `src/themes/theme-1/components.scss` applies extra styles to the shared `.lsg-button` markup inside that theme wrapper.
85
+
86
+ ### 3. Brand variables
87
+
88
+ The brand layer is the CSS variable contract.
89
+
90
+ - Tokens such as `--lsg-color-primary`, `--lsg-font-family-primary`, and `--lsg-radius-rounded` define the brand values.
91
+ - The default contract lives in `src/components/lsg/lsg-tokens.scss`.
92
+ - Each theme entry file overrides those same variables in its own `:root` block.
93
+
94
+ This keeps the API stable. Components always read the same variables, while each brand provides different values for them.
95
+
96
+ ## Storybook theme behavior
97
+
98
+ Storybook switches themes at runtime.
99
+
100
+ - The toolbar is configured in `.storybook/preview.tsx` through `globalTypes.lsgTheme`.
101
+ - The `LSG_THEMES` object maps a theme name to a set of `--lsg-*` values.
102
+ - The `withLsgTheme` decorator turns the selected theme into a `:root` CSS block and injects it into the preview document.
103
+ - The decorator also sets `document.documentElement.dataset.lsgTheme = themeKey`.
104
+
105
+ That `data-lsg-theme` attribute is important because the theme SCSS can target either:
106
+
107
+ - the whole Storybook canvas through `:root[data-lsg-theme="theme-x"]`
108
+ - a specific themed wrapper through `.lsg-themed-component--theme-x`
109
+
110
+ So in Storybook you get both:
111
+
112
+ - brand token swapping for colours, typography, spacing, and radii
113
+ - theme-specific component styling layered on top of the shared components
114
+
115
+ ## Production theme outputs
116
+
117
+ Each theme has its own CSS and JS bundle.
118
+
119
+ - `src/themes/theme-1/theme.scss`, `src/themes/theme-2/theme.scss`, and `src/themes/theme-3/theme.scss` import the shared LSG styles and their own theme component styles.
120
+ - Those files also override the `:root` token contract for that theme.
121
+ - `build:themes:css` emits one CSS file per theme.
122
+ - `build:themes:js` emits one JS file per theme for clientlib runtime behavior.
123
+
124
+ This is the AEM delivery model:
125
+
126
+ 1. Shared component structure comes from the base implementation.
127
+ 2. Theme CSS adds component-level extensions.
128
+ 3. Theme variables apply the brand colours, fonts, and sizes.
129
+ 4. Theme JS boots the runtime behavior for that theme.
130
+
131
+ ## When to use each layer
132
+
133
+ - Use the base component layer when the change should apply to every theme.
134
+ - Use the theme component layer when a theme needs a distinct visual treatment on top of the shared component behavior.
135
+ - Use the token layer when the change is a brand value such as colour, typeface, size, or border radius.
136
+
137
+ As a rule, put structure and behavior in the base component first. Only move into `src/themes/` when the theme genuinely needs its own component styling on top of that shared core.
138
+
139
+ ## Adding a new themed component
140
+
141
+ 1. Add or update the shared component in `src/components/lsg/`.
142
+ 2. Keep the base SCSS driven by `var(--lsg-*)` tokens.
143
+ 3. Add theme-specific styling in `src/themes/<theme>/components.scss` if that theme needs more than token changes.
144
+ 4. Export the theme wrapper from `src/themes/<theme>/components.tsx`.
145
+ 5. If needed in Storybook, add or update the theme values in `.storybook/preview.tsx`.
146
+
147
+ ## Adding components
148
+
149
+ 1. Add a component under `src/components/lsg/<Name>/` and keep its styles as plain `.scss` so AEM-facing class names stay stable.
150
+ 2. Add `*.stories.tsx` or MDX docs alongside that component in `src/components/lsg/`.
151
+ 3. If a theme needs more than brand variables, add its component-level extensions under `src/themes/<theme>/components.scss` and expose a themed wrapper from `src/themes/<theme>/components.tsx`.
152
+ 4. Use the root token contract from `src/components/lsg/lsg-tokens.scss` and prefer `var(--lsg-*)` values over hardcoded theme colours.
153
+
154
+ ## Design tokens
155
+
156
+ - **Core colours:** `--lsg-color-primary`, `--lsg-color-secondary`, `--lsg-color-tertiary`, `--lsg-color-light`, `--lsg-color-dark`, `--lsg-color-black`, `--lsg-color-white`
157
+ - **Typography:** `--lsg-font-family-primary`, `--lsg-font-family-secondary`, plus `--lsg-size-*` scale tokens
158
+ - **Shape:** `--lsg-radius-square`, `--lsg-radius-rounded`, `--lsg-radius-pill`
159
+
160
+ Theme-specific overrides live under `src/themes/`, but they extend the shared base components instead of replacing the root `--lsg-*` contract.
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@storybook/theming/dist/create-77ee2cf0").c;
2
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import type { StorybookConfig } from "@storybook/nextjs";
2
+ declare const config: StorybookConfig;
3
+ export default config;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { Preview } from "@storybook/react";
2
+ import "./global.scss";
3
+ declare const preview: Preview;
4
+ export default preview;
File without changes