@designcrowd/fe-shared-lib 1.5.0-jj-4 → 1.5.1-icontranslation

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 (180) hide show
  1. package/.claude/settings.local.json +17 -0
  2. package/.claude/skills/publishing-test-versions.md +285 -0
  3. package/.eslintrc.js +1 -0
  4. package/.storybook/image-1.png +0 -0
  5. package/.storybook/image-2.png +0 -0
  6. package/.storybook/image.png +0 -0
  7. package/.storybook/test.md +3 -0
  8. package/APasking.md +9 -0
  9. package/CLAUDE.md +227 -65
  10. package/GT-8753.md +127 -0
  11. package/docs/plans/2025-11-03-typescript-declarations-design.md +222 -0
  12. package/package.json +1 -1
  13. package/public/css/tailwind-brandCrowd.css +3 -6
  14. package/public/css/tailwind-brandPage.css +3 -6
  15. package/public/css/tailwind-crazyDomains.css +3 -6
  16. package/public/css/tailwind-designCom.css +3 -6
  17. package/public/css/tailwind-designCrowd.css +3 -6
  18. package/src/atoms/components/SparkleIcon/SparkleIcon.stories.js +207 -3
  19. package/src/atoms/components/SparkleIcon/SparkleIcon.vue +46 -7
  20. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-01.svg +5 -0
  21. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-02.svg +14 -0
  22. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-03.svg +14 -0
  23. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-04.svg +14 -0
  24. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-05.svg +14 -0
  25. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-06.svg +14 -0
  26. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-07.svg +14 -0
  27. package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-08.svg +14 -0
  28. package/src/atoms/components/SparkleIcon/sparkle-paths.ts +1 -0
  29. package/src/atoms/components/SparkleIcon/sparkle-with-spinner-paths.ts +61 -0
  30. package/src/atoms/components/design-com/Icon/Icon.stories.js +62 -0
  31. package/src/atoms/components/design-com/Icon/Icon.vue +7 -2
  32. package/src/experiences/components/PublishBrandPageModal/PublishBrandPageModal.stories.js +0 -36
  33. package/src/experiences/components/PublishBrandPageModal/PublishBrandPageModal.vue +297 -100
  34. package/.storybook-static/assets/Auth-CV5AmoX8.css +0 -1
  35. package/.storybook-static/assets/Auth.stories-CX3sjxh5.js +0 -490
  36. package/.storybook-static/assets/AuthCrazyDomains.stories-Didj_VFa.js +0 -73
  37. package/.storybook-static/assets/Button-5UzSGUF6.css +0 -1
  38. package/.storybook-static/assets/Button-DtVlr_q3.js +0 -1
  39. package/.storybook-static/assets/ButtonGroup-Dfr7bNL2.css +0 -1
  40. package/.storybook-static/assets/ButtonGroup.stories-4EQk-ktb.js +0 -503
  41. package/.storybook-static/assets/ButtonPrimary-Bu6bXb_c.css +0 -1
  42. package/.storybook-static/assets/ButtonPrimary-DG9wNod9.js +0 -1
  43. package/.storybook-static/assets/Buttons.stories-B_KpeCzt.js +0 -761
  44. package/.storybook-static/assets/ButtonsCrazyDomains.stories-oZtahAmR.js +0 -199
  45. package/.storybook-static/assets/Checkbox.mixin-DkHpdvGa.js +0 -1
  46. package/.storybook-static/assets/Checkbox.stories-C67RL0ut.js +0 -203
  47. package/.storybook-static/assets/Checktile.stories-DN2wfzd6.js +0 -88
  48. package/.storybook-static/assets/CollapsiblePanel.stories-BkzrqfVG.js +0 -39
  49. package/.storybook-static/assets/ColorPicker.stories-85BQwpyF.js +0 -73
  50. package/.storybook-static/assets/CopyToClipboardText.stories-Csh5nVRs.js +0 -32
  51. package/.storybook-static/assets/Dropdown.stories-NNlxNopk.js +0 -159
  52. package/.storybook-static/assets/DropdownItem-CDX_V6Mi.js +0 -1
  53. package/.storybook-static/assets/DropdownItem-CLNmWtKh.css +0 -1
  54. package/.storybook-static/assets/FormControl.mixin-_gXRExB7.js +0 -1
  55. package/.storybook-static/assets/HashRouteModal.stories-Dy1_nLTJ.js +0 -64
  56. package/.storybook-static/assets/HelloBar-z54fob0q.js +0 -1
  57. package/.storybook-static/assets/HelloBar.stories-ClJ9_KRK.js +0 -342
  58. package/.storybook-static/assets/Icon-8mZGP41G.js +0 -144
  59. package/.storybook-static/assets/Icon.stories-BcXMvpuh.js +0 -126
  60. package/.storybook-static/assets/Icon.stories-D6ECVMta.js +0 -751
  61. package/.storybook-static/assets/Loader-D61Ki9P1.js +0 -1
  62. package/.storybook-static/assets/LogoBusinessBrandColours-B1_8hw0H.js +0 -1
  63. package/.storybook-static/assets/LogoBusinessBrandColours-DEFhAyxR.css +0 -1
  64. package/.storybook-static/assets/LogoBusinessBrandColours.stories-CIWe9ndn.js +0 -36
  65. package/.storybook-static/assets/Masonry-C2MNiGg0.css +0 -1
  66. package/.storybook-static/assets/Masonry.stories-CDT8kZCv.js +0 -71
  67. package/.storybook-static/assets/Modal-BQrpXSGA.js +0 -1
  68. package/.storybook-static/assets/Modal-BvVMN71n.css +0 -1
  69. package/.storybook-static/assets/Modal.stories-BycF7YL6.js +0 -345
  70. package/.storybook-static/assets/Notice.stories-BufkrC1b.js +0 -222
  71. package/.storybook-static/assets/NumberStepper-Blffv09R.css +0 -1
  72. package/.storybook-static/assets/NumberStepper.stories-6_y_lEgC.js +0 -64
  73. package/.storybook-static/assets/PaymentConfigList-wI1eTv5x.css +0 -1
  74. package/.storybook-static/assets/PaymentConfigList.stories-BlzzKrzz.js +0 -126
  75. package/.storybook-static/assets/Picture-Cq76CaoK.js +0 -1
  76. package/.storybook-static/assets/Picture.stories-BDqRm9_g.js +0 -119
  77. package/.storybook-static/assets/Pill-BsMeJhV9.js +0 -1
  78. package/.storybook-static/assets/Pill.stories-DUvzbtnS.js +0 -18
  79. package/.storybook-static/assets/PillBar-os4mJV3M.css +0 -1
  80. package/.storybook-static/assets/PillBar.stories-BUMLXBij.js +0 -41
  81. package/.storybook-static/assets/Price-DKOwLeD0.js +0 -1
  82. package/.storybook-static/assets/Price.stories-DlqrNUWI.js +0 -221
  83. package/.storybook-static/assets/PublishBrandPageModal-CLU8-If3.css +0 -1
  84. package/.storybook-static/assets/PublishBrandPageModal.stories-Dqobvq-n.js +0 -273
  85. package/.storybook-static/assets/SearchBar.stories-_wPX3-Rl.js +0 -12
  86. package/.storybook-static/assets/Select-Dw-zvSUg.css +0 -1
  87. package/.storybook-static/assets/Select.stories-BWINGxdY.js +0 -108
  88. package/.storybook-static/assets/SellDomainNameList.fixtures-LC6fjr_b.js +0 -1
  89. package/.storybook-static/assets/SellDomainNameListModal-ByK_ak0A.js +0 -1
  90. package/.storybook-static/assets/SellDomainNameListModal-CdfyEX1a.css +0 -1
  91. package/.storybook-static/assets/SellDomainNameListModal.stories-DrL8w2AY.js +0 -71
  92. package/.storybook-static/assets/SellDomainNameListSearchResult-1WuAKfzI.css +0 -1
  93. package/.storybook-static/assets/SellDomainNameListSearchResult-By0IpIM_.js +0 -1
  94. package/.storybook-static/assets/SellDomainNameSearchWithResults-BttjI4PH.js +0 -1
  95. package/.storybook-static/assets/SellDomainNameSearchWithResults.stories-Dm1Q8Cza.js +0 -37
  96. package/.storybook-static/assets/SellDomainNameWidget.stories-CKoz3WnZ.js +0 -36
  97. package/.storybook-static/assets/SignIn-DNYeJu86.css +0 -1
  98. package/.storybook-static/assets/SignIn-Dt8OJr0J.js +0 -1
  99. package/.storybook-static/assets/Slider-Cog2FFdj.css +0 -1
  100. package/.storybook-static/assets/Slider.stories-08DN2SFB.js +0 -141
  101. package/.storybook-static/assets/StarRating-BtKh7pzm.css +0 -1
  102. package/.storybook-static/assets/StarRating.stories-BEIj9ufA.js +0 -45
  103. package/.storybook-static/assets/TabMenu.stories-D9f0pyZI.js +0 -47
  104. package/.storybook-static/assets/TextCopyField-B04vTGbG.js +0 -1
  105. package/.storybook-static/assets/TextCopyField.stories-KD0WUWzA.js +0 -47
  106. package/.storybook-static/assets/TextInput-JK1M0hv6.js +0 -1
  107. package/.storybook-static/assets/TextInput.stories-BO0eQqBY.js +0 -233
  108. package/.storybook-static/assets/Textarea.stories-Bcn4sCkV.js +0 -207
  109. package/.storybook-static/assets/Toggle.stories-CuTFLoNh.js +0 -161
  110. package/.storybook-static/assets/Tooltip-DcSbUh5f.js +0 -1
  111. package/.storybook-static/assets/Tooltip-DyXIgFQH.css +0 -1
  112. package/.storybook-static/assets/Tooltip.stories-B0I_PBGG.js +0 -953
  113. package/.storybook-static/assets/UploadYourLogoApplication-EyTEQx-x.css +0 -9
  114. package/.storybook-static/assets/UploadYourLogoApplication.stories-Dixp1ynI.js +0 -194
  115. package/.storybook-static/assets/UploadYourLogoDropzone-DQqACf-e.css +0 -1
  116. package/.storybook-static/assets/UploadYourLogoDropzone-DouZtNvi.js +0 -24
  117. package/.storybook-static/assets/UploadYourLogoDropzone.stories-BHYeu4gz.js +0 -55
  118. package/.storybook-static/assets/UploadedLogoSearchResultCard.stories-D1KR63O4.js +0 -79
  119. package/.storybook-static/assets/_commonjsHelpers-D6-XlEtG.js +0 -1
  120. package/.storybook-static/assets/_plugin-vue_export-helper-DlAUqK2U.js +0 -1
  121. package/.storybook-static/assets/api-lSJGRrF2.js +0 -1
  122. package/.storybook-static/assets/axe-nGVJxRof.js +0 -30
  123. package/.storybook-static/assets/brand-crowd-api.client-DiPM1Wo-.js +0 -1
  124. package/.storybook-static/assets/bundled-translations-BZ57czTo.js +0 -1
  125. package/.storybook-static/assets/bundled-translations.de-DE-DXggTXB2.js +0 -1
  126. package/.storybook-static/assets/bundled-translations.es-ES-DtMmvicd.js +0 -1
  127. package/.storybook-static/assets/bundled-translations.fr-FR-BrQqbieG.js +0 -1
  128. package/.storybook-static/assets/bundled-translations.pt-PT-CpiWEAtr.js +0 -1
  129. package/.storybook-static/assets/carousel-CMMZ5MZ-.css +0 -1
  130. package/.storybook-static/assets/carousel.stories-o3eu2Qyc.js +0 -374
  131. package/.storybook-static/assets/event-constants-CMO9VQVu.js +0 -1
  132. package/.storybook-static/assets/iframe-C86bI_2U.js +0 -1126
  133. package/.storybook-static/assets/index-Bw-gCGc_.js +0 -6
  134. package/.storybook-static/assets/index-DhkYCT1V.js +0 -29
  135. package/.storybook-static/assets/matchers-7Z3WT2CE-T3xScrR7.js +0 -14
  136. package/.storybook-static/assets/tracking-ATsLLehC.js +0 -1
  137. package/.storybook-static/css/tailwind-brandCrowd.css +0 -2404
  138. package/.storybook-static/css/tailwind-brandPage.css +0 -2088
  139. package/.storybook-static/css/tailwind-crazyDomains.css +0 -2404
  140. package/.storybook-static/css/tailwind-designCom.css +0 -2404
  141. package/.storybook-static/css/tailwind-designCrowd.css +0 -2404
  142. package/.storybook-static/favicon.svg +0 -1
  143. package/.storybook-static/iframe.html +0 -694
  144. package/.storybook-static/index.html +0 -156
  145. package/.storybook-static/index.json +0 -1
  146. package/.storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  147. package/.storybook-static/nunito-sans-bold.woff2 +0 -0
  148. package/.storybook-static/nunito-sans-italic.woff2 +0 -0
  149. package/.storybook-static/nunito-sans-regular.woff2 +0 -0
  150. package/.storybook-static/project.json +0 -1
  151. package/.storybook-static/sb-addons/a11y-1/manager-bundle.js +0 -5
  152. package/.storybook-static/sb-addons/links-2/manager-bundle.js +0 -3
  153. package/.storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -188
  154. package/.storybook-static/sb-addons/themes-3/manager-bundle.js +0 -3
  155. package/.storybook-static/sb-common-assets/favicon.svg +0 -1
  156. package/.storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  157. package/.storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  158. package/.storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  159. package/.storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  160. package/.storybook-static/sb-manager/globals-module-info.js +0 -797
  161. package/.storybook-static/sb-manager/globals-runtime.js +0 -72062
  162. package/.storybook-static/sb-manager/globals.js +0 -34
  163. package/.storybook-static/sb-manager/runtime.js +0 -13002
  164. package/dist/css/tailwind-brandCrowd.css +0 -2419
  165. package/dist/css/tailwind-brandPage.css +0 -2107
  166. package/dist/css/tailwind-crazyDomains.css +0 -2419
  167. package/dist/css/tailwind-designCom.css +0 -2419
  168. package/dist/css/tailwind-designCrowd.css +0 -2419
  169. package/src/experiences/components/PublishBrandPageModal/views/PublishWhenHasDomainsView.vue +0 -271
  170. package/src/experiences/components/PublishBrandPageModal/views/PublishWhenNoDomainsView.vue +0 -168
  171. package/src/experiences/components/PublishBrandPageModal/views/PublishedView.vue +0 -149
  172. package/src/experiences/components/PublishBrandPageModal/views/SetUrlView.vue +0 -155
  173. /package/src/atoms/components/SparkleIcon/assets/animations/{state-01.svg → sparkle/state-01.svg} +0 -0
  174. /package/src/atoms/components/SparkleIcon/assets/animations/{state-02.svg → sparkle/state-02.svg} +0 -0
  175. /package/src/atoms/components/SparkleIcon/assets/animations/{state-03.svg → sparkle/state-03.svg} +0 -0
  176. /package/src/atoms/components/SparkleIcon/assets/animations/{state-04.svg → sparkle/state-04.svg} +0 -0
  177. /package/src/atoms/components/SparkleIcon/assets/animations/{state-05.svg → sparkle/state-05.svg} +0 -0
  178. /package/src/atoms/components/SparkleIcon/assets/animations/{state-06.svg → sparkle/state-06.svg} +0 -0
  179. /package/src/atoms/components/SparkleIcon/assets/animations/{state-07.svg → sparkle/state-07.svg} +0 -0
  180. /package/src/atoms/components/SparkleIcon/assets/animations/{state-08.svg → sparkle/state-08.svg} +0 -0
package/GT-8753.md ADDED
@@ -0,0 +1,127 @@
1
+ # GT-8753: SVG Icon Translation Issue - Problem & Solution
2
+
3
+ ## Problem Description
4
+
5
+ The `DcomIcon` component in `@designcrowd/fe-shared-lib` (v1.4.9) has hardcoded `lang="en"` attributes in its SVG `<title>` and `<desc>` accessibility elements, preventing proper internationalization.
6
+
7
+ **Current Code** (`Icon.vue` lines 21-22):
8
+ ```vue
9
+ <title :id="`${name}-${id}-title`" lang="en">{{ title }}</title>
10
+ <desc :id="`${name}-${id}-desc`" lang="en">{{ description }}</desc>
11
+ ```
12
+
13
+ **Impact**: All Design.com pages using DcomIcon display English accessibility text regardless of the user's locale (fr-FR, es-ES, pt-PT, etc.), creating a poor experience for non-English users and failing accessibility standards for internationalized content.
14
+
15
+ **Affected Pages in BrandCrowd.Net**:
16
+ - `/maker/free-logos`
17
+ - `/business-name-generator`
18
+ - `/maker/contact`
19
+ - `/logo-maker`
20
+ - Multi-Asset homemaker pages (e.g., `/facebook-covers`)
21
+
22
+ **Used in 6 components** across BrandCrowd.Net's Nuxt application.
23
+
24
+ ---
25
+
26
+ ## Proposed Solution
27
+
28
+ ### 1. Add a `lang` Prop to DcomIcon Component
29
+
30
+ **File**: `src/atoms/components/design-com/Icon/Icon.vue`
31
+
32
+ Add a new optional prop to accept the language code:
33
+
34
+ ```vue
35
+ <script>
36
+ export default {
37
+ props: {
38
+ // ... existing props ...
39
+ lang: {
40
+ type: String,
41
+ required: false,
42
+ default: 'en', // fallback to English
43
+ },
44
+ },
45
+ // ... rest of component ...
46
+ }
47
+ </script>
48
+ ```
49
+
50
+ ### 2. Update Template to Use Dynamic Lang Attribute
51
+
52
+ **Change lines 21-22** from:
53
+ ```vue
54
+ <title :id="`${name}-${id}-title`" lang="en">{{ title }}</title>
55
+ <desc :id="`${name}-${id}-desc`" lang="en">{{ description }}</desc>
56
+ ```
57
+
58
+ To:
59
+ ```vue
60
+ <title :id="`${name}-${id}-title`" :lang="lang">{{ title }}</title>
61
+ <desc :id="`${name}-${id}-desc`" :lang="lang">{{ description }}</desc>
62
+ ```
63
+
64
+ ### 3. Consumer Usage Pattern
65
+
66
+ Consumers (like BrandCrowd.Net) can then pass the current locale:
67
+
68
+ ```vue
69
+ <template>
70
+ <DcomIcon
71
+ :name="feature.iconName"
72
+ size="md"
73
+ :lang="currentLang"
74
+ :alt-text="$t(`icons.${feature.iconName}.title`)"
75
+ />
76
+ </template>
77
+
78
+ <script setup>
79
+ const { locale } = useI18n();
80
+ // Convert 'fr-FR' to 'fr' for HTML lang attribute
81
+ const currentLang = computed(() => locale.value.split('-')[0]);
82
+ </script>
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Benefits
88
+
89
+ ✅ **Backward Compatible**: Default value of `'en'` preserves existing behavior
90
+ ✅ **Minimal Change**: Only 3 lines modified in the component
91
+ ✅ **Flexible**: Consumers control the language based on their i18n setup
92
+ ✅ **Standards Compliant**: Proper `lang` attributes improve accessibility
93
+ ✅ **Simple**: No complex translation logic needed in the shared library
94
+
95
+ ---
96
+
97
+ ## Testing Checklist
98
+
99
+ - [ ] Verify `lang` prop defaults to `'en'` when not provided
100
+ - [ ] Test passing different language codes ('fr', 'es', 'pt', 'de')
101
+ - [ ] Confirm rendered HTML shows correct `lang` attribute in title/desc
102
+ - [ ] Update Storybook story to demonstrate lang prop usage
103
+ - [ ] Verify no breaking changes to existing consumers
104
+
105
+ ---
106
+
107
+ ## Implementation Notes
108
+
109
+ **Why this approach works well:**
110
+
111
+ 1. **Separation of Concerns**: The shared library handles rendering with the correct lang attribute, while consumers handle translation logic specific to their i18n setup
112
+ 2. **Accessibility Best Practice**: The `lang` attribute tells screen readers which language pronunciation rules to use, critical for international users
113
+ 3. **Minimal Surface Area**: Adding a single prop is safer than building complex translation logic into a shared component library
114
+
115
+ ---
116
+
117
+ ## File Location in fe-shared-lib
118
+
119
+ **Primary file to modify:**
120
+ - `src/atoms/components/design-com/Icon/Icon.vue`
121
+
122
+ **Lines to change:**
123
+ - Line 21-22 (template)
124
+ - Props definition (add `lang` prop)
125
+
126
+ **Current component location in BrandCrowd.Net node_modules:**
127
+ - `/home/zknowles/BrandCrowd.Net/BrandCrowd.Nuxt/node_modules/@designcrowd/fe-shared-lib/src/atoms/components/design-com/Icon/Icon.vue`
@@ -0,0 +1,222 @@
1
+ # TypeScript Declaration Files Design
2
+
3
+ **Date:** 2025-11-03
4
+ **Goal:** Add TypeScript declaration files (.d.ts) to the published npm package to support TypeScript consumers while enabling gradual migration to TypeScript.
5
+
6
+ ## Overview
7
+
8
+ This design adds basic TypeScript support to `@designcrowd/fe-shared-lib` by auto-generating declaration files during the publish process. The approach allows:
9
+ - Immediate TypeScript support for library consumers
10
+ - Gradual migration from JavaScript to TypeScript over time
11
+ - No breaking changes for existing JavaScript consumers
12
+ - Clean git history (declarations not committed)
13
+
14
+ ## Architecture
15
+
16
+ ### Tooling Choice
17
+
18
+ Use `vue-tsc` (Vue's TypeScript compiler) to generate declarations from existing `.vue` and `.js` files. This tool:
19
+ - Understands Vue 3 component structure
20
+ - Extracts type information from JavaScript code
21
+ - Generates `.d.ts` files for both `.vue` and `.js` files
22
+ - Supports gradual TypeScript adoption
23
+
24
+ ### File Structure
25
+
26
+ Generated declarations will be placed in `dist/types/`:
27
+
28
+ ```
29
+ /dist/
30
+ ├── types/
31
+ │ ├── index.d.ts # Main entry point
32
+ │ ├── atoms/
33
+ │ │ └── components/
34
+ │ │ ├── Button/
35
+ │ │ │ └── Button.vue.d.ts
36
+ │ │ ├── Icon/
37
+ │ │ └── ...
38
+ │ ├── experiences/
39
+ │ └── useSharedLibTranslate.d.ts
40
+ ```
41
+
42
+ ### Package.json Configuration
43
+
44
+ **New Fields:**
45
+ - `"types": "./dist/types/index.d.ts"` - Points TypeScript to declarations
46
+
47
+ **Updated Scripts:**
48
+ - `build:types` - Generate declaration files
49
+ - `docker:publish` - Run `build:types` before building Docker image
50
+
51
+ ### Type Generation Level
52
+
53
+ **Basic Component Exports:** Each component is typed as a generic Vue component. TypeScript consumers get:
54
+ - Import/export type checking
55
+ - Basic component type (can use in templates)
56
+ - IDE autocomplete for component names
57
+
58
+ **What's NOT included (can be added later):**
59
+ - Detailed prop types with specific values
60
+ - Event emission types
61
+ - Slot definitions
62
+ - Exposed method signatures
63
+
64
+ ## Implementation Details
65
+
66
+ ### 1. TypeScript Configuration
67
+
68
+ Create `tsconfig.declarations.json`:
69
+ ```json
70
+ {
71
+ "extends": "./tsconfig.json",
72
+ "compilerOptions": {
73
+ "declaration": true,
74
+ "emitDeclarationOnly": true,
75
+ "outDir": "./dist/types",
76
+ "rootDir": "./",
77
+ "skipLibCheck": true
78
+ },
79
+ "include": [
80
+ "src/**/*",
81
+ "index.js",
82
+ "*.d.ts"
83
+ ],
84
+ "exclude": [
85
+ "node_modules",
86
+ "dist",
87
+ ".storybook",
88
+ "**/*.stories.js"
89
+ ]
90
+ }
91
+ ```
92
+
93
+ Create base `tsconfig.json` (if doesn't exist):
94
+ ```json
95
+ {
96
+ "compilerOptions": {
97
+ "target": "ESNext",
98
+ "module": "ESNext",
99
+ "moduleResolution": "node",
100
+ "lib": ["ESNext", "DOM"],
101
+ "jsx": "preserve",
102
+ "strict": false,
103
+ "allowJs": true,
104
+ "checkJs": false,
105
+ "esModuleInterop": true,
106
+ "skipLibCheck": true,
107
+ "resolveJsonModule": true
108
+ }
109
+ }
110
+ ```
111
+
112
+ ### 2. Package.json Updates
113
+
114
+ ```json
115
+ {
116
+ "types": "./dist/types/index.d.ts",
117
+ "scripts": {
118
+ "build:types": "vue-tsc --project tsconfig.declarations.json",
119
+ "docker:publish": "npm run build:types && docker build . --build-arg NPM_TOKEN=$NPM_TOKEN"
120
+ }
121
+ }
122
+ ```
123
+
124
+ ### 3. Dockerfile Updates
125
+
126
+ Ensure `dist/types` is copied in the Dockerfile:
127
+ ```dockerfile
128
+ COPY dist/types ./dist/types
129
+ ```
130
+
131
+ ### 4. Git Configuration
132
+
133
+ Add to `.gitignore`:
134
+ ```
135
+ dist/types/
136
+ ```
137
+
138
+ ### 5. Manual Type Definitions
139
+
140
+ Create `src/useSharedLibTranslate.d.ts` for translation utilities:
141
+ ```typescript
142
+ export function setSharedLibLocaleAsync(locale: string): Promise<void>;
143
+ export function tr(key: string, params?: Record<string, any>): string;
144
+ ```
145
+
146
+ ## Gradual Migration Path
147
+
148
+ ### Writing New Code
149
+ - New components: Use `<script setup lang="ts">` in `.vue` files
150
+ - New utilities: Write as `.ts` files
151
+ - `vue-tsc` automatically generates declarations
152
+
153
+ ### Converting Existing Code
154
+ - Convert one component at a time
155
+ - Change `<script>` to `<script setup lang="ts">`
156
+ - Add type annotations incrementally
157
+ - No coordination needed across components
158
+
159
+ ### Priority for Migration
160
+ 1. Utility functions and helpers (highest value)
161
+ 2. Complex components with many props
162
+ 3. Simple presentational components (lowest priority)
163
+
164
+ ## Edge Cases & Considerations
165
+
166
+ ### Multi-Theme Components
167
+ Theme-specific exports (e.g., `DcomIcon`) are in `index.js`, so they'll automatically get declarations. No special handling needed.
168
+
169
+ ### Translation Bundles
170
+ Translation JSON files don't need type definitions. The `tr()` function signature is sufficient.
171
+
172
+ ### API Clients
173
+ Exported clients (`brandPageApiClient`, `brandCrowdApiClient`) will get basic type definitions. Can be enhanced later with Axios response types.
174
+
175
+ ### Storybook Files
176
+ Excluded from type generation (`.exclude` in tsconfig). Stories are dev-only and don't need declarations.
177
+
178
+ ## Validation Steps
179
+
180
+ Before publishing:
181
+ 1. Run `npm run build:types` locally
182
+ 2. Verify `dist/types/index.d.ts` exists
183
+ 3. Check all exports are present in `index.d.ts`
184
+ 4. Create test TypeScript project:
185
+ ```typescript
186
+ import { Button, Icon } from '@designcrowd/fe-shared-lib';
187
+ ```
188
+ 5. Verify IDE autocomplete works
189
+ 6. Test `npm run docker:publish` includes types
190
+
191
+ ## Breaking Changes
192
+
193
+ **None.** This is purely additive:
194
+ - JavaScript consumers continue working unchanged
195
+ - TypeScript consumers gain type support
196
+ - No runtime behavior changes
197
+ - No API changes
198
+
199
+ ## Dependencies
200
+
201
+ Already installed:
202
+ - `typescript: 5.3.3` (devDependency)
203
+ - `@vue/eslint-config-typescript: 12.0.0` (devDependency)
204
+
205
+ Need to verify `vue-tsc` is available (should be included with `@vitejs/plugin-vue` or add as devDependency).
206
+
207
+ ## Future Enhancements
208
+
209
+ Once this is working, can incrementally add:
210
+ 1. Detailed prop types with specific values (e.g., `theme: 'brandCrowd' | 'designCom'`)
211
+ 2. Event emission types (e.g., `@click`, `@change`)
212
+ 3. Slot definitions with scoped slot props
213
+ 4. Generic type parameters for complex components
214
+ 5. Full JSDoc comments for better IDE hints
215
+
216
+ ## Success Criteria
217
+
218
+ - ✅ TypeScript consumers can import components without type errors
219
+ - ✅ IDE provides autocomplete for component names
220
+ - ✅ `dist/types/index.d.ts` published to npm
221
+ - ✅ No breaking changes for JavaScript consumers
222
+ - ✅ New TypeScript files can be added without build changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcrowd/fe-shared-lib",
3
- "version": "1.5.0-jj-4",
3
+ "version": "1.5.1-icontranslation",
4
4
  "scripts": {
5
5
  "start": "run-p storybook watch:translation",
6
6
  "build": "npm run build:css --production",
@@ -738,6 +738,9 @@ video {
738
738
  .theme-brandCrowd .tw-mt-0 {
739
739
  margin-top: 0px;
740
740
  }
741
+ .theme-brandCrowd .tw-mt-0\.5 {
742
+ margin-top: 0.125rem;
743
+ }
741
744
  .theme-brandCrowd .tw-mt-1 {
742
745
  margin-top: 0.25rem;
743
746
  }
@@ -750,9 +753,6 @@ video {
750
753
  .theme-brandCrowd .tw-mt-4 {
751
754
  margin-top: 1rem;
752
755
  }
753
- .theme-brandCrowd .tw-mt-6 {
754
- margin-top: 1.5rem;
755
- }
756
756
  .theme-brandCrowd .tw-mt-8 {
757
757
  margin-top: 2rem;
758
758
  }
@@ -926,9 +926,6 @@ video {
926
926
  .theme-brandCrowd .tw-flex-none {
927
927
  flex: none;
928
928
  }
929
- .theme-brandCrowd .tw-flex-shrink-0 {
930
- flex-shrink: 0;
931
- }
932
929
  .theme-brandCrowd .tw-grow {
933
930
  flex-grow: 1;
934
931
  }
@@ -738,6 +738,9 @@ video {
738
738
  .theme-brandPage .tw-mt-0 {
739
739
  margin-top: 0px;
740
740
  }
741
+ .theme-brandPage .tw-mt-0\.5 {
742
+ margin-top: 0.125rem;
743
+ }
741
744
  .theme-brandPage .tw-mt-1 {
742
745
  margin-top: 0.25rem;
743
746
  }
@@ -750,9 +753,6 @@ video {
750
753
  .theme-brandPage .tw-mt-4 {
751
754
  margin-top: 1rem;
752
755
  }
753
- .theme-brandPage .tw-mt-6 {
754
- margin-top: 1.5rem;
755
- }
756
756
  .theme-brandPage .tw-mt-8 {
757
757
  margin-top: 2rem;
758
758
  }
@@ -926,9 +926,6 @@ video {
926
926
  .theme-brandPage .tw-flex-none {
927
927
  flex: none;
928
928
  }
929
- .theme-brandPage .tw-flex-shrink-0 {
930
- flex-shrink: 0;
931
- }
932
929
  .theme-brandPage .tw-grow {
933
930
  flex-grow: 1;
934
931
  }
@@ -738,6 +738,9 @@ video {
738
738
  .theme-crazyDomains .tw-mt-0 {
739
739
  margin-top: 0px;
740
740
  }
741
+ .theme-crazyDomains .tw-mt-0\.5 {
742
+ margin-top: 0.125rem;
743
+ }
741
744
  .theme-crazyDomains .tw-mt-1 {
742
745
  margin-top: 0.25rem;
743
746
  }
@@ -750,9 +753,6 @@ video {
750
753
  .theme-crazyDomains .tw-mt-4 {
751
754
  margin-top: 1rem;
752
755
  }
753
- .theme-crazyDomains .tw-mt-6 {
754
- margin-top: 1.5rem;
755
- }
756
756
  .theme-crazyDomains .tw-mt-8 {
757
757
  margin-top: 2rem;
758
758
  }
@@ -926,9 +926,6 @@ video {
926
926
  .theme-crazyDomains .tw-flex-none {
927
927
  flex: none;
928
928
  }
929
- .theme-crazyDomains .tw-flex-shrink-0 {
930
- flex-shrink: 0;
931
- }
932
929
  .theme-crazyDomains .tw-grow {
933
930
  flex-grow: 1;
934
931
  }
@@ -738,6 +738,9 @@ video {
738
738
  .theme-designCom .tw-mt-0 {
739
739
  margin-top: 0px;
740
740
  }
741
+ .theme-designCom .tw-mt-0\.5 {
742
+ margin-top: 0.125rem;
743
+ }
741
744
  .theme-designCom .tw-mt-1 {
742
745
  margin-top: 0.25rem;
743
746
  }
@@ -750,9 +753,6 @@ video {
750
753
  .theme-designCom .tw-mt-4 {
751
754
  margin-top: 1rem;
752
755
  }
753
- .theme-designCom .tw-mt-6 {
754
- margin-top: 1.5rem;
755
- }
756
756
  .theme-designCom .tw-mt-8 {
757
757
  margin-top: 2rem;
758
758
  }
@@ -926,9 +926,6 @@ video {
926
926
  .theme-designCom .tw-flex-none {
927
927
  flex: none;
928
928
  }
929
- .theme-designCom .tw-flex-shrink-0 {
930
- flex-shrink: 0;
931
- }
932
929
  .theme-designCom .tw-grow {
933
930
  flex-grow: 1;
934
931
  }
@@ -738,6 +738,9 @@ video {
738
738
  .theme-designCrowd .tw-mt-0 {
739
739
  margin-top: 0px;
740
740
  }
741
+ .theme-designCrowd .tw-mt-0\.5 {
742
+ margin-top: 0.125rem;
743
+ }
741
744
  .theme-designCrowd .tw-mt-1 {
742
745
  margin-top: 0.25rem;
743
746
  }
@@ -750,9 +753,6 @@ video {
750
753
  .theme-designCrowd .tw-mt-4 {
751
754
  margin-top: 1rem;
752
755
  }
753
- .theme-designCrowd .tw-mt-6 {
754
- margin-top: 1.5rem;
755
- }
756
756
  .theme-designCrowd .tw-mt-8 {
757
757
  margin-top: 2rem;
758
758
  }
@@ -926,9 +926,6 @@ video {
926
926
  .theme-designCrowd .tw-flex-none {
927
927
  flex: none;
928
928
  }
929
- .theme-designCrowd .tw-flex-shrink-0 {
930
- flex-shrink: 0;
931
- }
932
929
  .theme-designCrowd .tw-grow {
933
930
  flex-grow: 1;
934
931
  }