@designcrowd/fe-shared-lib 1.5.0 → 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.
- package/.claude/settings.local.json +17 -0
- package/.claude/skills/publishing-test-versions.md +285 -0
- package/.eslintrc.js +1 -0
- package/.storybook/image-1.png +0 -0
- package/.storybook/image-2.png +0 -0
- package/.storybook/image.png +0 -0
- package/.storybook/test.md +3 -0
- package/APasking.md +9 -0
- package/CLAUDE.md +227 -65
- package/GT-8753.md +127 -0
- package/docs/plans/2025-11-03-typescript-declarations-design.md +222 -0
- package/package.json +1 -1
- package/public/css/tailwind-brandCrowd.css +3 -6
- package/public/css/tailwind-brandPage.css +3 -6
- package/public/css/tailwind-crazyDomains.css +3 -6
- package/public/css/tailwind-designCom.css +3 -6
- package/public/css/tailwind-designCrowd.css +3 -6
- package/src/atoms/components/SparkleIcon/SparkleIcon.stories.js +207 -3
- package/src/atoms/components/SparkleIcon/SparkleIcon.vue +46 -7
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-01.svg +5 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-02.svg +14 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-03.svg +14 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-04.svg +14 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-05.svg +14 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-06.svg +14 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-07.svg +14 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-08.svg +14 -0
- package/src/atoms/components/SparkleIcon/sparkle-paths.ts +1 -0
- package/src/atoms/components/SparkleIcon/sparkle-with-spinner-paths.ts +61 -0
- package/src/atoms/components/design-com/Icon/Icon.stories.js +62 -0
- package/src/atoms/components/design-com/Icon/Icon.vue +7 -2
- package/dist/css/tailwind-brandCrowd.css +0 -2496
- package/dist/css/tailwind-brandPage.css +0 -2180
- package/dist/css/tailwind-crazyDomains.css +0 -2496
- package/dist/css/tailwind-designCom.css +0 -2496
- package/dist/css/tailwind-designCrowd.css +0 -2496
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-01.svg → sparkle/state-01.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-02.svg → sparkle/state-02.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-03.svg → sparkle/state-03.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-04.svg → sparkle/state-04.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-05.svg → sparkle/state-05.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-06.svg → sparkle/state-06.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-07.svg → sparkle/state-07.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-08.svg → sparkle/state-08.svg} +0 -0
|
@@ -80,3 +80,65 @@ export const IconSample = () => {
|
|
|
80
80
|
IconSample.story = {
|
|
81
81
|
name: 'Dcom Icon Library',
|
|
82
82
|
};
|
|
83
|
+
|
|
84
|
+
export const IconInternationalization = () => {
|
|
85
|
+
return {
|
|
86
|
+
components: {
|
|
87
|
+
Icon,
|
|
88
|
+
},
|
|
89
|
+
data() {
|
|
90
|
+
return {
|
|
91
|
+
languages: [
|
|
92
|
+
{ code: 'en', name: 'English' },
|
|
93
|
+
{ code: 'fr', name: 'French' },
|
|
94
|
+
{ code: 'es', name: 'Spanish' },
|
|
95
|
+
{ code: 'pt', name: 'Portuguese' },
|
|
96
|
+
{ code: 'de', name: 'German' },
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
template: `
|
|
101
|
+
<div>
|
|
102
|
+
<h3 class="tw-font-sans tw-mb-4 tw-text-lg tw-font-bold">Internationalization (i18n) Support</h3>
|
|
103
|
+
<p class="tw-font-sans tw-mb-4">The <code>lang</code> prop allows you to specify the language code for screen readers. This is crucial for proper accessibility in internationalized applications.</p>
|
|
104
|
+
|
|
105
|
+
<table class="tw-w-full tw-mb-6">
|
|
106
|
+
<thead>
|
|
107
|
+
<tr>
|
|
108
|
+
<th class="tw-text-left tw-p-4 tw-bg-grayscale-400 tw-font-sans">Language</th>
|
|
109
|
+
<th class="tw-text-left tw-p-4 tw-bg-grayscale-400 tw-font-sans">Icon</th>
|
|
110
|
+
<th class="tw-text-left tw-p-4 tw-bg-grayscale-400 tw-font-sans">Code</th>
|
|
111
|
+
</tr>
|
|
112
|
+
</thead>
|
|
113
|
+
<tr v-for="(language, i) in languages" :key="i" :class="{'tw-bg-grayscale-200': i % 2 !== 0}">
|
|
114
|
+
<td class="tw-p-4 tw-font-sans">{{ language.name }} ({{ language.code }})</td>
|
|
115
|
+
<td class="tw-p-4">
|
|
116
|
+
<Icon name="heart" size="md" :lang="language.code" />
|
|
117
|
+
</td>
|
|
118
|
+
<td class="tw-p-4">
|
|
119
|
+
<code class="tw-bg-info-100 tw-p-2 tw-rounded tw-bg-gray-400 tw-border tw-border-solid tw-border-info-300 tw-text-info-900">
|
|
120
|
+
<Icon name="heart" size="md" lang="{{ language.code }}" />
|
|
121
|
+
</code>
|
|
122
|
+
</td>
|
|
123
|
+
</tr>
|
|
124
|
+
</table>
|
|
125
|
+
|
|
126
|
+
<div class="tw-font-sans tw-bg-blue-50 tw-p-4 tw-rounded tw-border tw-border-blue-200">
|
|
127
|
+
<h4 class="tw-font-bold tw-mb-2">Usage in i18n Applications:</h4>
|
|
128
|
+
<p class="tw-mb-2">In Vue applications with i18n, you can dynamically pass the current locale:</p>
|
|
129
|
+
<pre class="tw-bg-gray-100 tw-p-3 tw-rounded tw-text-sm tw-overflow-x-auto"><code><Icon
|
|
130
|
+
name="feature.iconName"
|
|
131
|
+
size="md"
|
|
132
|
+
:lang="$i18n.locale.split('-')[0]"
|
|
133
|
+
:alt-text="$t('icons.heart.title')"
|
|
134
|
+
/></code></pre>
|
|
135
|
+
<p class="tw-mt-2 tw-text-sm tw-text-gray-600">Note: The lang prop defaults to 'en' for backward compatibility.</p>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
`,
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
IconInternationalization.story = {
|
|
143
|
+
name: 'Internationalization (lang prop)',
|
|
144
|
+
};
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
aria-labelledby="title"
|
|
19
19
|
aria-describedby="desc"
|
|
20
20
|
>
|
|
21
|
-
<title :id="`${name}-${id}-title`" lang="
|
|
22
|
-
<desc :id="`${name}-${id}-desc`" lang="
|
|
21
|
+
<title :id="`${name}-${id}-title`" :lang="lang">{{ title }}</title>
|
|
22
|
+
<desc :id="`${name}-${id}-desc`" :lang="lang">{{ description }}</desc>
|
|
23
23
|
<component :is="`icon-${iconName}`"></component>
|
|
24
24
|
</svg>
|
|
25
25
|
</div>
|
|
@@ -118,6 +118,11 @@ export default {
|
|
|
118
118
|
required: false,
|
|
119
119
|
default: '',
|
|
120
120
|
},
|
|
121
|
+
lang: {
|
|
122
|
+
type: String,
|
|
123
|
+
required: false,
|
|
124
|
+
default: 'en',
|
|
125
|
+
},
|
|
121
126
|
},
|
|
122
127
|
data() {
|
|
123
128
|
return {
|