Skip to content

Commit 2b3ad4a

Browse files
authored
chore: remove custom useId implementation (#3333)
1 parent 023abe7 commit 2b3ad4a

21 files changed

Lines changed: 39 additions & 41 deletions

File tree

.changeset/great-geckos-dance.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@storefront-ui/vue': major
3+
---
4+
5+
- **[CHANGED][BREAKING]** Use `useId` method coming from `vue` package instead of custom implementation. To migrate:
6+
1. Update your `vue` dependency version to at least 3.5.0.
7+
2. Update every `useId` usage as follows:
8+
```diff
9+
-import { useId } from '@storefront-ui/vue';
10+
+import { useId } from 'vue';
11+
```

apps/preview/nuxt/pages/showcases/Combobox/ComboboxBasic.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
</template>
108108

109109
<script lang="ts" setup>
110-
import { ref, watch } from 'vue';
110+
import { ref, watch, useId } from 'vue';
111111
import { offset } from '@floating-ui/vue';
112112
import { unrefElement } from '@vueuse/core';
113113
import {
@@ -118,7 +118,6 @@ import {
118118
useDisclosure,
119119
useDropdown,
120120
useTrapFocus,
121-
useId,
122121
} from '@storefront-ui/vue';
123122
124123
const inputModel = ref('');

apps/preview/nuxt/pages/showcases/FormFields/FormFieldsRequired.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@
284284
</template>
285285

286286
<script lang="ts" setup>
287-
import { ref, type Ref, watch } from 'vue';
287+
import { ref, type Ref, watch, useId } from 'vue';
288288
import {
289289
SfSwitch,
290290
SfInput,
@@ -298,7 +298,6 @@ import {
298298
SfIconExpandMore,
299299
SfListItem,
300300
SfIconCheck,
301-
useId,
302301
useTrapFocus,
303302
} from '@storefront-ui/vue';
304303
import { unrefElement } from '@vueuse/core';

apps/preview/nuxt/pages/showcases/ProductCard/Details.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
</template>
113113

114114
<script lang="ts" setup>
115-
import { ref } from 'vue';
115+
import { ref, useId } from 'vue';
116116
import {
117117
SfButton,
118118
SfCounter,
@@ -127,7 +127,6 @@ import {
127127
SfIconShoppingCart,
128128
SfIconAdd,
129129
SfIconRemove,
130-
useId,
131130
SfIconShoppingCartCheckout,
132131
} from '@storefront-ui/vue';
133132
import { clamp } from '@storefront-ui/shared';

apps/preview/nuxt/pages/showcases/ProductCard/ProductCardHorizontal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
</template>
8585

8686
<script lang="ts" setup>
87-
import { ref } from 'vue';
88-
import { SfLink, SfButton, SfIconSell, SfIconAdd, SfIconRemove, SfIconDelete, useId } from '@storefront-ui/vue';
87+
import { ref, useId } from 'vue';
88+
import { SfLink, SfButton, SfIconSell, SfIconAdd, SfIconRemove, SfIconDelete } from '@storefront-ui/vue';
8989
import { clamp } from '@storefront-ui/shared';
9090
import { useCounter } from '@vueuse/core';
9191

apps/preview/nuxt/pages/showcases/QuantitySelector/OutOfStock.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
</template>
2424

2525
<script lang="ts" setup>
26-
import { ref } from 'vue';
27-
import { SfButton, SfIconAdd, SfIconRemove, useId } from '@storefront-ui/vue';
26+
import { ref, useId } from 'vue';
27+
import { SfButton, SfIconAdd, SfIconRemove } from '@storefront-ui/vue';
2828
2929
const min = ref(1);
3030
const max = ref(10);

apps/preview/nuxt/pages/showcases/QuantitySelector/QuantitySelector.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
</template>
4141

4242
<script lang="ts" setup>
43-
import { ref } from 'vue';
43+
import { ref, useId } from 'vue';
4444
import { clamp } from '@storefront-ui/shared';
4545
import { useCounter } from '@vueuse/core';
46-
import { SfButton, SfIconAdd, SfIconRemove, useId } from '@storefront-ui/vue';
46+
import { SfButton, SfIconAdd, SfIconRemove } from '@storefront-ui/vue';
4747
4848
const min = ref(1);
4949
const max = ref(10);

apps/preview/nuxt/pages/showcases/QuantitySelector/Rounded.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
</template>
3535

3636
<script lang="ts" setup>
37-
import { ref } from 'vue';
37+
import { ref, useId } from 'vue';
3838
import { useCounter } from '@vueuse/core';
39-
import { SfButton, SfIconAdd, SfIconRemove, useId } from '@storefront-ui/vue';
39+
import { SfButton, SfIconAdd, SfIconRemove } from '@storefront-ui/vue';
4040
import { clamp } from '@storefront-ui/shared';
4141
4242
const min = ref(1);

apps/preview/nuxt/pages/showcases/RatingButton/Basic.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</template>
77

88
<script lang="ts" setup>
9-
import { ref } from 'vue';
10-
import { SfRatingButton, useId } from '@storefront-ui/vue';
9+
import { ref, useId } from 'vue';
10+
import { SfRatingButton } from '@storefront-ui/vue';
1111
const labelId = useId();
1212
const modelValue = ref();
1313
</script>

apps/preview/nuxt/pages/showcases/RatingButton/CustomIcon.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
</template>
2222

2323
<script lang="ts" setup>
24-
import { ref } from 'vue';
25-
import { SfRatingButton, SfIconFavorite, SfIconFavoriteFilled, useId } from '@storefront-ui/vue';
24+
import { ref, useId } from 'vue';
25+
import { SfRatingButton, SfIconFavorite, SfIconFavoriteFilled } from '@storefront-ui/vue';
2626
const labelId = useId();
2727
const modelValue = ref(2);
2828
</script>

0 commit comments

Comments
 (0)