shopify-nuxt 0.0.1 → 0.0.3

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 (126) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +293 -29
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +25 -6
  5. package/dist/runtime/components/polaris/ShAvatar.vue +4 -2
  6. package/dist/runtime/components/polaris/ShBadge.vue +4 -2
  7. package/dist/runtime/components/polaris/ShBanner.vue +4 -2
  8. package/dist/runtime/components/polaris/ShBox.vue +4 -2
  9. package/dist/runtime/components/polaris/ShButton.d.vue.ts +11 -3
  10. package/dist/runtime/components/polaris/ShButton.vue +10 -2
  11. package/dist/runtime/components/polaris/ShButton.vue.d.ts +11 -3
  12. package/dist/runtime/components/polaris/ShButtonGroup.vue +4 -2
  13. package/dist/runtime/components/polaris/ShCheckbox.d.vue.ts +12 -5
  14. package/dist/runtime/components/polaris/ShCheckbox.vue +22 -5
  15. package/dist/runtime/components/polaris/ShCheckbox.vue.d.ts +12 -5
  16. package/dist/runtime/components/polaris/ShChip.vue +4 -2
  17. package/dist/runtime/components/polaris/ShChoice.vue +4 -2
  18. package/dist/runtime/components/polaris/ShChoiceList.d.vue.ts +12 -4
  19. package/dist/runtime/components/polaris/ShChoiceList.vue +21 -3
  20. package/dist/runtime/components/polaris/ShChoiceList.vue.d.ts +12 -4
  21. package/dist/runtime/components/polaris/ShClickable.vue +4 -2
  22. package/dist/runtime/components/polaris/ShClickableChip.vue +4 -2
  23. package/dist/runtime/components/polaris/ShColorField.d.vue.ts +16 -4
  24. package/dist/runtime/components/polaris/ShColorField.vue +24 -4
  25. package/dist/runtime/components/polaris/ShColorField.vue.d.ts +16 -4
  26. package/dist/runtime/components/polaris/ShColorPicker.d.vue.ts +12 -4
  27. package/dist/runtime/components/polaris/ShColorPicker.vue +21 -3
  28. package/dist/runtime/components/polaris/ShColorPicker.vue.d.ts +12 -4
  29. package/dist/runtime/components/polaris/ShDateField.d.vue.ts +20 -4
  30. package/dist/runtime/components/polaris/ShDateField.vue +25 -3
  31. package/dist/runtime/components/polaris/ShDateField.vue.d.ts +20 -4
  32. package/dist/runtime/components/polaris/ShDatePicker.d.vue.ts +18 -4
  33. package/dist/runtime/components/polaris/ShDatePicker.vue +24 -3
  34. package/dist/runtime/components/polaris/ShDatePicker.vue.d.ts +18 -4
  35. package/dist/runtime/components/polaris/ShDivider.vue +4 -2
  36. package/dist/runtime/components/polaris/ShDropZone.d.vue.ts +14 -4
  37. package/dist/runtime/components/polaris/ShDropZone.vue +22 -3
  38. package/dist/runtime/components/polaris/ShDropZone.vue.d.ts +14 -4
  39. package/dist/runtime/components/polaris/ShEmailField.d.vue.ts +16 -4
  40. package/dist/runtime/components/polaris/ShEmailField.vue +24 -4
  41. package/dist/runtime/components/polaris/ShEmailField.vue.d.ts +16 -4
  42. package/dist/runtime/components/polaris/ShGrid.vue +4 -2
  43. package/dist/runtime/components/polaris/ShGridItem.vue +4 -2
  44. package/dist/runtime/components/polaris/ShHeading.vue +4 -2
  45. package/dist/runtime/components/polaris/ShIcon.vue +4 -2
  46. package/dist/runtime/components/polaris/ShImage.vue +4 -2
  47. package/dist/runtime/components/polaris/ShLink.vue +4 -2
  48. package/dist/runtime/components/polaris/ShMenu.vue +4 -2
  49. package/dist/runtime/components/polaris/ShModal.vue +4 -2
  50. package/dist/runtime/components/polaris/ShMoneyField.d.vue.ts +16 -4
  51. package/dist/runtime/components/polaris/ShMoneyField.vue +24 -4
  52. package/dist/runtime/components/polaris/ShMoneyField.vue.d.ts +16 -4
  53. package/dist/runtime/components/polaris/ShNumberField.d.vue.ts +16 -4
  54. package/dist/runtime/components/polaris/ShNumberField.vue +24 -4
  55. package/dist/runtime/components/polaris/ShNumberField.vue.d.ts +16 -4
  56. package/dist/runtime/components/polaris/ShOption.vue +4 -2
  57. package/dist/runtime/components/polaris/ShOptionGroup.vue +4 -2
  58. package/dist/runtime/components/polaris/ShPage.vue +4 -2
  59. package/dist/runtime/components/polaris/ShParagraph.vue +4 -2
  60. package/dist/runtime/components/polaris/ShPasswordField.d.vue.ts +16 -4
  61. package/dist/runtime/components/polaris/ShPasswordField.vue +24 -4
  62. package/dist/runtime/components/polaris/ShPasswordField.vue.d.ts +16 -4
  63. package/dist/runtime/components/polaris/ShPopover.d.vue.ts +1 -0
  64. package/dist/runtime/components/polaris/ShPopover.vue +5 -2
  65. package/dist/runtime/components/polaris/ShPopover.vue.d.ts +1 -0
  66. package/dist/runtime/components/polaris/ShQueryContainer.vue +4 -2
  67. package/dist/runtime/components/polaris/ShSearchField.d.vue.ts +16 -4
  68. package/dist/runtime/components/polaris/ShSearchField.vue +24 -4
  69. package/dist/runtime/components/polaris/ShSearchField.vue.d.ts +16 -4
  70. package/dist/runtime/components/polaris/ShSection.vue +4 -2
  71. package/dist/runtime/components/polaris/ShSelect.d.vue.ts +12 -4
  72. package/dist/runtime/components/polaris/ShSelect.vue +22 -4
  73. package/dist/runtime/components/polaris/ShSelect.vue.d.ts +12 -4
  74. package/dist/runtime/components/polaris/ShSpinner.vue +4 -2
  75. package/dist/runtime/components/polaris/ShStack.vue +4 -2
  76. package/dist/runtime/components/polaris/ShSwitch.d.vue.ts +12 -5
  77. package/dist/runtime/components/polaris/ShSwitch.vue +22 -5
  78. package/dist/runtime/components/polaris/ShSwitch.vue.d.ts +12 -5
  79. package/dist/runtime/components/polaris/ShTable.vue +4 -2
  80. package/dist/runtime/components/polaris/ShTableHeader.vue +4 -2
  81. package/dist/runtime/components/polaris/ShTableRow.vue +4 -2
  82. package/dist/runtime/components/polaris/ShText.vue +4 -2
  83. package/dist/runtime/components/polaris/ShTextArea.d.vue.ts +16 -4
  84. package/dist/runtime/components/polaris/ShTextArea.vue +24 -4
  85. package/dist/runtime/components/polaris/ShTextArea.vue.d.ts +16 -4
  86. package/dist/runtime/components/polaris/ShTextField.d.vue.ts +16 -4
  87. package/dist/runtime/components/polaris/ShTextField.vue +24 -4
  88. package/dist/runtime/components/polaris/ShTextField.vue.d.ts +16 -4
  89. package/dist/runtime/components/polaris/ShThumbnail.vue +4 -2
  90. package/dist/runtime/components/polaris/ShTooltip.d.vue.ts +4 -1
  91. package/dist/runtime/components/polaris/ShTooltip.vue +6 -1
  92. package/dist/runtime/components/polaris/ShTooltip.vue.d.ts +4 -1
  93. package/dist/runtime/components/polaris/ShUrlField.d.vue.ts +16 -4
  94. package/dist/runtime/components/polaris/ShUrlField.vue +24 -4
  95. package/dist/runtime/components/polaris/ShUrlField.vue.d.ts +16 -4
  96. package/dist/runtime/components/polaris/utils.d.ts +7 -0
  97. package/dist/runtime/components/polaris/utils.js +13 -0
  98. package/dist/runtime/composables/useAppBridge.d.ts +4 -1
  99. package/dist/runtime/composables/useAppBridge.js +24 -13
  100. package/dist/runtime/composables/useShopifyFetch.js +3 -1
  101. package/dist/runtime/middleware/shopify-auth.js +10 -4
  102. package/dist/runtime/pages/auth-login.d.vue.ts +3 -0
  103. package/dist/runtime/pages/auth-login.vue +90 -0
  104. package/dist/runtime/pages/auth-login.vue.d.ts +3 -0
  105. package/dist/runtime/server/index.d.ts +2 -0
  106. package/dist/runtime/server/index.js +4 -0
  107. package/dist/runtime/server/plugins/shopify-defaults.d.ts +8 -0
  108. package/dist/runtime/server/plugins/shopify-defaults.js +12 -0
  109. package/dist/runtime/server/routes/auth-callback.d.ts +1 -1
  110. package/dist/runtime/server/routes/auth-exit-iframe.d.ts +1 -1
  111. package/dist/runtime/server/routes/auth-session-token.d.ts +1 -1
  112. package/dist/runtime/server/routes/auth.d.ts +1 -1
  113. package/dist/runtime/server/services/shopify.js +3 -3
  114. package/dist/runtime/server/utils/authenticate-admin.js +21 -6
  115. package/dist/runtime/server/utils/clients.d.ts +24 -5
  116. package/dist/runtime/server/utils/clients.js +21 -2
  117. package/dist/runtime/server/utils/helpers.js +13 -11
  118. package/dist/runtime/server/utils/unauthenticated-storefront.d.ts +1 -5
  119. package/dist/runtime/server/utils/unauthenticated-storefront.js +2 -8
  120. package/dist/runtime/types.d.ts +33 -2
  121. package/package.json +10 -5
  122. package/dist/runtime/components/ShopifyAppProvider.d.vue.ts +0 -13
  123. package/dist/runtime/components/ShopifyAppProvider.vue +0 -11
  124. package/dist/runtime/components/ShopifyAppProvider.vue.d.ts +0 -13
  125. package/dist/runtime/plugins/polaris.d.ts +0 -1
  126. package/dist/runtime/plugins/polaris.js +0 -0
@@ -17,13 +17,29 @@ type __VLS_Props = {
17
17
  disabled?: boolean;
18
18
  id?: string;
19
19
  name?: string;
20
- value?: string;
20
+ modelValue?: string;
21
21
  };
22
- declare var __VLS_8: {};
22
+ declare var __VLS_15: {};
23
23
  type __VLS_Slots = {} & {
24
- default?: (props: typeof __VLS_8) => any;
24
+ default?: (props: typeof __VLS_15) => any;
25
25
  };
26
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ "update:modelValue": (v: string) => void;
28
+ blur: (event: Event) => void;
29
+ focus: (event: Event) => void;
30
+ input: (event: Event) => void;
31
+ change: (event: Event) => void;
32
+ invalid: (event: Event) => void;
33
+ viewchange: (event: Event) => void;
34
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
35
+ onBlur?: ((event: Event) => any) | undefined;
36
+ onFocus?: ((event: Event) => any) | undefined;
37
+ onInput?: ((event: Event) => any) | undefined;
38
+ onChange?: ((event: Event) => any) | undefined;
39
+ onInvalid?: ((event: Event) => any) | undefined;
40
+ "onUpdate:modelValue"?: ((v: string) => any) | undefined;
41
+ onViewchange?: ((event: Event) => any) | undefined;
42
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
43
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
44
  declare const _default: typeof __VLS_export;
29
45
  export default _default;
@@ -8,13 +8,27 @@ type __VLS_Props = {
8
8
  type?: 'single' | 'range';
9
9
  defaultValue?: string;
10
10
  name?: string;
11
- value?: string;
11
+ modelValue?: string;
12
12
  };
13
- declare var __VLS_8: {};
13
+ declare var __VLS_14: {};
14
14
  type __VLS_Slots = {} & {
15
- default?: (props: typeof __VLS_8) => any;
15
+ default?: (props: typeof __VLS_14) => any;
16
16
  };
17
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ "update:modelValue": (v: string) => void;
19
+ blur: (event: Event) => void;
20
+ focus: (event: Event) => void;
21
+ input: (event: Event) => void;
22
+ change: (event: Event) => void;
23
+ viewchange: (event: Event) => void;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
+ onBlur?: ((event: Event) => any) | undefined;
26
+ onFocus?: ((event: Event) => any) | undefined;
27
+ onInput?: ((event: Event) => any) | undefined;
28
+ onChange?: ((event: Event) => any) | undefined;
29
+ "onUpdate:modelValue"?: ((v: string) => any) | undefined;
30
+ onViewchange?: ((event: Event) => any) | undefined;
31
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
32
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
33
  declare const _default: typeof __VLS_export;
20
34
  export default _default;
@@ -1,12 +1,27 @@
1
1
  <template>
2
- <s-date-picker v-bind="$attrs">
2
+ <s-date-picker
3
+ v-bind="polarisAttrs"
4
+ :value="modelValue"
5
+ @blur="emit('blur', $event)"
6
+ @change="
7
+ (evt) => {
8
+ emit('change', evt);
9
+ value = evt.currentTarget?.value || '';
10
+ }
11
+ "
12
+ @focus="emit('focus', $event)"
13
+ @input="emit('input', $event)"
14
+ @viewchange="emit('viewchange', $event)"
15
+ >
3
16
  <slot />
4
17
  </s-date-picker>
5
18
  </template>
6
19
 
7
20
  <script setup>
21
+ import { computed } from "vue";
22
+ import { usePolarisAttrs } from "./utils";
8
23
  defineOptions({ name: "ShDatePicker", inheritAttrs: false });
9
- defineProps({
24
+ const props = defineProps({
10
25
  defaultView: { type: String, required: false },
11
26
  view: { type: String, required: false },
12
27
  allow: { type: String, required: false },
@@ -16,6 +31,12 @@ defineProps({
16
31
  type: { type: String, required: false },
17
32
  defaultValue: { type: String, required: false },
18
33
  name: { type: String, required: false },
19
- value: { type: String, required: false }
34
+ modelValue: { type: String, required: false }
20
35
  });
36
+ const emit = defineEmits(["update:modelValue", "blur", "change", "focus", "input", "viewchange"]);
37
+ const value = computed({
38
+ get: () => props.modelValue,
39
+ set: (v) => emit("update:modelValue", v)
40
+ });
41
+ const polarisAttrs = usePolarisAttrs(props, ["modelValue"]);
21
42
  </script>
@@ -8,13 +8,27 @@ type __VLS_Props = {
8
8
  type?: 'single' | 'range';
9
9
  defaultValue?: string;
10
10
  name?: string;
11
- value?: string;
11
+ modelValue?: string;
12
12
  };
13
- declare var __VLS_8: {};
13
+ declare var __VLS_14: {};
14
14
  type __VLS_Slots = {} & {
15
- default?: (props: typeof __VLS_8) => any;
15
+ default?: (props: typeof __VLS_14) => any;
16
16
  };
17
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ "update:modelValue": (v: string) => void;
19
+ blur: (event: Event) => void;
20
+ focus: (event: Event) => void;
21
+ input: (event: Event) => void;
22
+ change: (event: Event) => void;
23
+ viewchange: (event: Event) => void;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
+ onBlur?: ((event: Event) => any) | undefined;
26
+ onFocus?: ((event: Event) => any) | undefined;
27
+ onInput?: ((event: Event) => any) | undefined;
28
+ onChange?: ((event: Event) => any) | undefined;
29
+ "onUpdate:modelValue"?: ((v: string) => any) | undefined;
30
+ onViewchange?: ((event: Event) => any) | undefined;
31
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
32
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
33
  declare const _default: typeof __VLS_export;
20
34
  export default _default;
@@ -1,13 +1,15 @@
1
1
  <template>
2
- <s-divider v-bind="$attrs">
2
+ <s-divider v-bind="polarisAttrs">
3
3
  <slot />
4
4
  </s-divider>
5
5
  </template>
6
6
 
7
7
  <script setup>
8
+ import { usePolarisAttrs } from "./utils";
8
9
  defineOptions({ name: "ShDivider", inheritAttrs: false });
9
- defineProps({
10
+ const props = defineProps({
10
11
  direction: { type: String, required: false },
11
12
  color: { type: String, required: false }
12
13
  });
14
+ const polarisAttrs = usePolarisAttrs(props);
13
15
  </script>
@@ -8,13 +8,23 @@ type __VLS_Props = {
8
8
  multiple?: boolean;
9
9
  name?: string;
10
10
  required?: boolean;
11
- value?: string;
11
+ modelValue?: string;
12
12
  };
13
- declare var __VLS_8: {};
13
+ declare var __VLS_12: {};
14
14
  type __VLS_Slots = {} & {
15
- default?: (props: typeof __VLS_8) => any;
15
+ default?: (props: typeof __VLS_12) => any;
16
16
  };
17
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ "update:modelValue": (v: string) => void;
19
+ input: (event: Event) => void;
20
+ change: (event: Event) => void;
21
+ droprejected: (event: Event) => void;
22
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
23
+ onInput?: ((event: Event) => any) | undefined;
24
+ onChange?: ((event: Event) => any) | undefined;
25
+ "onUpdate:modelValue"?: ((v: string) => any) | undefined;
26
+ onDroprejected?: ((event: Event) => any) | undefined;
27
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
28
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
29
  declare const _default: typeof __VLS_export;
20
30
  export default _default;
@@ -1,12 +1,25 @@
1
1
  <template>
2
- <s-drop-zone v-bind="$attrs">
2
+ <s-drop-zone
3
+ v-bind="polarisAttrs"
4
+ :value="modelValue"
5
+ @change="
6
+ (evt) => {
7
+ emit('change', evt);
8
+ value = evt.currentTarget?.value || '';
9
+ }
10
+ "
11
+ @droprejected="emit('droprejected', $event)"
12
+ @input="emit('input', $event)"
13
+ >
3
14
  <slot />
4
15
  </s-drop-zone>
5
16
  </template>
6
17
 
7
18
  <script setup>
19
+ import { computed } from "vue";
20
+ import { usePolarisAttrs } from "./utils";
8
21
  defineOptions({ name: "ShDropZone", inheritAttrs: false });
9
- defineProps({
22
+ const props = defineProps({
10
23
  accept: { type: String, required: false },
11
24
  accessibilityLabel: { type: String, required: false },
12
25
  disabled: { type: Boolean, required: false },
@@ -16,6 +29,12 @@ defineProps({
16
29
  multiple: { type: Boolean, required: false },
17
30
  name: { type: String, required: false },
18
31
  required: { type: Boolean, required: false },
19
- value: { type: String, required: false }
32
+ modelValue: { type: String, required: false }
20
33
  });
34
+ const emit = defineEmits(["update:modelValue", "change", "droprejected", "input"]);
35
+ const value = computed({
36
+ get: () => props.modelValue,
37
+ set: (v) => emit("update:modelValue", v)
38
+ });
39
+ const polarisAttrs = usePolarisAttrs(props, ["modelValue"]);
21
40
  </script>
@@ -8,13 +8,23 @@ type __VLS_Props = {
8
8
  multiple?: boolean;
9
9
  name?: string;
10
10
  required?: boolean;
11
- value?: string;
11
+ modelValue?: string;
12
12
  };
13
- declare var __VLS_8: {};
13
+ declare var __VLS_12: {};
14
14
  type __VLS_Slots = {} & {
15
- default?: (props: typeof __VLS_8) => any;
15
+ default?: (props: typeof __VLS_12) => any;
16
16
  };
17
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ "update:modelValue": (v: string) => void;
19
+ input: (event: Event) => void;
20
+ change: (event: Event) => void;
21
+ droprejected: (event: Event) => void;
22
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
23
+ onInput?: ((event: Event) => any) | undefined;
24
+ onChange?: ((event: Event) => any) | undefined;
25
+ "onUpdate:modelValue"?: ((v: string) => any) | undefined;
26
+ onDroprejected?: ((event: Event) => any) | undefined;
27
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
28
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
29
  declare const _default: typeof __VLS_export;
20
30
  export default _default;
@@ -2,7 +2,6 @@ type __VLS_Props = {
2
2
  autocomplete?: string;
3
3
  maxLength?: number;
4
4
  minLength?: number;
5
- value?: string;
6
5
  defaultValue?: string;
7
6
  details?: string;
8
7
  error?: string;
@@ -14,12 +13,25 @@ type __VLS_Props = {
14
13
  disabled?: boolean;
15
14
  id?: string;
16
15
  name?: string;
16
+ modelValue?: string;
17
17
  };
18
- declare var __VLS_8: {};
18
+ declare var __VLS_13: {};
19
19
  type __VLS_Slots = {} & {
20
- default?: (props: typeof __VLS_8) => any;
20
+ default?: (props: typeof __VLS_13) => any;
21
21
  };
22
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
+ "update:modelValue": (v: string) => void;
24
+ blur: (event: InputEvent) => void;
25
+ focus: (event: InputEvent) => void;
26
+ input: (event: InputEvent) => void;
27
+ change: (event: InputEvent) => void;
28
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
29
+ onBlur?: ((event: InputEvent) => any) | undefined;
30
+ onFocus?: ((event: InputEvent) => any) | undefined;
31
+ onInput?: ((event: InputEvent) => any) | undefined;
32
+ onChange?: ((event: InputEvent) => any) | undefined;
33
+ "onUpdate:modelValue"?: ((v: string) => any) | undefined;
34
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
35
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
24
36
  declare const _default: typeof __VLS_export;
25
37
  export default _default;
@@ -1,16 +1,29 @@
1
1
  <template>
2
- <s-email-field v-bind="$attrs">
2
+ <s-email-field
3
+ v-bind="polarisAttrs"
4
+ :value="modelValue"
5
+ @blur="emit('blur', $event)"
6
+ @change="emit('change', $event)"
7
+ @focus="emit('focus', $event)"
8
+ @input="
9
+ (evt) => {
10
+ emit('input', evt);
11
+ value = evt.currentTarget?.value || '';
12
+ }
13
+ "
14
+ >
3
15
  <slot />
4
16
  </s-email-field>
5
17
  </template>
6
18
 
7
19
  <script setup>
20
+ import { computed } from "vue";
21
+ import { usePolarisAttrs } from "./utils";
8
22
  defineOptions({ name: "ShEmailField", inheritAttrs: false });
9
- defineProps({
23
+ const props = defineProps({
10
24
  autocomplete: { type: String, required: false },
11
25
  maxLength: { type: Number, required: false },
12
26
  minLength: { type: Number, required: false },
13
- value: { type: String, required: false },
14
27
  defaultValue: { type: String, required: false },
15
28
  details: { type: String, required: false },
16
29
  error: { type: String, required: false },
@@ -21,6 +34,13 @@ defineProps({
21
34
  required: { type: Boolean, required: false },
22
35
  disabled: { type: Boolean, required: false },
23
36
  id: { type: String, required: false },
24
- name: { type: String, required: false }
37
+ name: { type: String, required: false },
38
+ modelValue: { type: String, required: false }
25
39
  });
40
+ const emit = defineEmits(["update:modelValue", "blur", "change", "focus", "input"]);
41
+ const value = computed({
42
+ get: () => props.modelValue,
43
+ set: (v) => emit("update:modelValue", v)
44
+ });
45
+ const polarisAttrs = usePolarisAttrs(props, ["modelValue"]);
26
46
  </script>
@@ -2,7 +2,6 @@ type __VLS_Props = {
2
2
  autocomplete?: string;
3
3
  maxLength?: number;
4
4
  minLength?: number;
5
- value?: string;
6
5
  defaultValue?: string;
7
6
  details?: string;
8
7
  error?: string;
@@ -14,12 +13,25 @@ type __VLS_Props = {
14
13
  disabled?: boolean;
15
14
  id?: string;
16
15
  name?: string;
16
+ modelValue?: string;
17
17
  };
18
- declare var __VLS_8: {};
18
+ declare var __VLS_13: {};
19
19
  type __VLS_Slots = {} & {
20
- default?: (props: typeof __VLS_8) => any;
20
+ default?: (props: typeof __VLS_13) => any;
21
21
  };
22
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
+ "update:modelValue": (v: string) => void;
24
+ blur: (event: InputEvent) => void;
25
+ focus: (event: InputEvent) => void;
26
+ input: (event: InputEvent) => void;
27
+ change: (event: InputEvent) => void;
28
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
29
+ onBlur?: ((event: InputEvent) => any) | undefined;
30
+ onFocus?: ((event: InputEvent) => any) | undefined;
31
+ onInput?: ((event: InputEvent) => any) | undefined;
32
+ onChange?: ((event: InputEvent) => any) | undefined;
33
+ "onUpdate:modelValue"?: ((v: string) => any) | undefined;
34
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
35
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
24
36
  declare const _default: typeof __VLS_export;
25
37
  export default _default;
@@ -1,12 +1,13 @@
1
1
  <template>
2
- <s-grid v-bind="$attrs">
2
+ <s-grid v-bind="polarisAttrs">
3
3
  <slot />
4
4
  </s-grid>
5
5
  </template>
6
6
 
7
7
  <script setup>
8
+ import { usePolarisAttrs } from "./utils";
8
9
  defineOptions({ name: "ShGrid", inheritAttrs: false });
9
- defineProps({
10
+ const props = defineProps({
10
11
  gridTemplateColumns: { type: String, required: false },
11
12
  gridTemplateRows: { type: String, required: false },
12
13
  justifyItems: { type: String, required: false },
@@ -43,4 +44,5 @@ defineProps({
43
44
  accessibilityVisibility: { type: String, required: false },
44
45
  display: { type: String, required: false }
45
46
  });
47
+ const polarisAttrs = usePolarisAttrs(props);
46
48
  </script>
@@ -1,12 +1,13 @@
1
1
  <template>
2
- <s-grid-item v-bind="$attrs">
2
+ <s-grid-item v-bind="polarisAttrs">
3
3
  <slot />
4
4
  </s-grid-item>
5
5
  </template>
6
6
 
7
7
  <script setup>
8
+ import { usePolarisAttrs } from "./utils";
8
9
  defineOptions({ name: "ShGridItem", inheritAttrs: false });
9
- defineProps({
10
+ const props = defineProps({
10
11
  gridColumn: { type: String, required: false },
11
12
  gridRow: { type: String, required: false },
12
13
  accessibilityRole: { type: String, required: false },
@@ -34,4 +35,5 @@ defineProps({
34
35
  accessibilityVisibility: { type: String, required: false },
35
36
  display: { type: String, required: false }
36
37
  });
38
+ const polarisAttrs = usePolarisAttrs(props);
37
39
  </script>
@@ -1,14 +1,16 @@
1
1
  <template>
2
- <s-heading v-bind="$attrs">
2
+ <s-heading v-bind="polarisAttrs">
3
3
  <slot />
4
4
  </s-heading>
5
5
  </template>
6
6
 
7
7
  <script setup>
8
+ import { usePolarisAttrs } from "./utils";
8
9
  defineOptions({ name: "ShHeading", inheritAttrs: false });
9
- defineProps({
10
+ const props = defineProps({
10
11
  accessibilityRole: { type: String, required: false },
11
12
  lineClamp: { type: Number, required: false },
12
13
  accessibilityVisibility: { type: String, required: false }
13
14
  });
15
+ const polarisAttrs = usePolarisAttrs(props);
14
16
  </script>
@@ -1,16 +1,18 @@
1
1
  <template>
2
- <s-icon v-bind="$attrs">
2
+ <s-icon v-bind="polarisAttrs">
3
3
  <slot />
4
4
  </s-icon>
5
5
  </template>
6
6
 
7
7
  <script setup>
8
+ import { usePolarisAttrs } from "./utils";
8
9
  defineOptions({ name: "ShIcon", inheritAttrs: false });
9
- defineProps({
10
+ const props = defineProps({
10
11
  color: { type: String, required: false },
11
12
  tone: { type: String, required: false },
12
13
  type: { type: String, required: false },
13
14
  size: { type: String, required: false },
14
15
  interestFor: { type: String, required: false }
15
16
  });
17
+ const polarisAttrs = usePolarisAttrs(props);
16
18
  </script>
@@ -1,14 +1,16 @@
1
1
  <template>
2
- <s-image v-bind="$attrs">
2
+ <s-image v-bind="polarisAttrs">
3
3
  <slot />
4
4
  </s-image>
5
5
  </template>
6
6
 
7
7
  <script setup>
8
+ import { usePolarisAttrs } from "./utils";
8
9
  defineOptions({ name: "ShImage", inheritAttrs: false });
9
- defineProps({
10
+ const props = defineProps({
10
11
  id: { type: String, required: false },
11
12
  originalSrc: { type: String, required: false },
12
13
  altText: { type: String, required: false }
13
14
  });
15
+ const polarisAttrs = usePolarisAttrs(props);
14
16
  </script>
@@ -1,12 +1,13 @@
1
1
  <template>
2
- <s-link v-bind="$attrs">
2
+ <s-link v-bind="polarisAttrs">
3
3
  <slot />
4
4
  </s-link>
5
5
  </template>
6
6
 
7
7
  <script setup>
8
+ import { usePolarisAttrs } from "./utils";
8
9
  defineOptions({ name: "ShLink", inheritAttrs: false });
9
- defineProps({
10
+ const props = defineProps({
10
11
  tone: { type: String, required: false },
11
12
  accessibilityLabel: { type: String, required: false },
12
13
  href: { type: String, required: false },
@@ -17,4 +18,5 @@ defineProps({
17
18
  commandFor: { type: String, required: false },
18
19
  interestFor: { type: String, required: false }
19
20
  });
21
+ const polarisAttrs = usePolarisAttrs(props);
20
22
  </script>
@@ -1,12 +1,14 @@
1
1
  <template>
2
- <s-menu v-bind="$attrs">
2
+ <s-menu v-bind="polarisAttrs">
3
3
  <slot />
4
4
  </s-menu>
5
5
  </template>
6
6
 
7
7
  <script setup>
8
+ import { usePolarisAttrs } from "./utils";
8
9
  defineOptions({ name: "ShMenu", inheritAttrs: false });
9
- defineProps({
10
+ const props = defineProps({
10
11
  accessibilityLabel: { type: String, required: false }
11
12
  });
13
+ const polarisAttrs = usePolarisAttrs(props);
12
14
  </script>
@@ -1,15 +1,17 @@
1
1
  <template>
2
- <s-modal v-bind="$attrs">
2
+ <s-modal v-bind="polarisAttrs">
3
3
  <slot />
4
4
  </s-modal>
5
5
  </template>
6
6
 
7
7
  <script setup>
8
+ import { usePolarisAttrs } from "./utils";
8
9
  defineOptions({ name: "ShModal", inheritAttrs: false });
9
- defineProps({
10
+ const props = defineProps({
10
11
  accessibilityLabel: { type: String, required: false },
11
12
  heading: { type: String, required: false },
12
13
  padding: { type: String, required: false },
13
14
  size: { type: String, required: false }
14
15
  });
16
+ const polarisAttrs = usePolarisAttrs(props);
15
17
  </script>
@@ -1,7 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  max?: number;
3
3
  min?: number;
4
- value?: string;
5
4
  autocomplete?: string;
6
5
  defaultValue?: string;
7
6
  details?: string;
@@ -14,12 +13,25 @@ type __VLS_Props = {
14
13
  disabled?: boolean;
15
14
  id?: string;
16
15
  name?: string;
16
+ modelValue?: string;
17
17
  };
18
- declare var __VLS_8: {};
18
+ declare var __VLS_13: {};
19
19
  type __VLS_Slots = {} & {
20
- default?: (props: typeof __VLS_8) => any;
20
+ default?: (props: typeof __VLS_13) => any;
21
21
  };
22
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
+ "update:modelValue": (v: string) => void;
24
+ blur: (event: InputEvent) => void;
25
+ focus: (event: InputEvent) => void;
26
+ input: (event: InputEvent) => void;
27
+ change: (event: InputEvent) => void;
28
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
29
+ onBlur?: ((event: InputEvent) => any) | undefined;
30
+ onFocus?: ((event: InputEvent) => any) | undefined;
31
+ onInput?: ((event: InputEvent) => any) | undefined;
32
+ onChange?: ((event: InputEvent) => any) | undefined;
33
+ "onUpdate:modelValue"?: ((v: string) => any) | undefined;
34
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
35
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
24
36
  declare const _default: typeof __VLS_export;
25
37
  export default _default;
@@ -1,15 +1,28 @@
1
1
  <template>
2
- <s-money-field v-bind="$attrs">
2
+ <s-money-field
3
+ v-bind="polarisAttrs"
4
+ :value="modelValue"
5
+ @blur="emit('blur', $event)"
6
+ @change="emit('change', $event)"
7
+ @focus="emit('focus', $event)"
8
+ @input="
9
+ (evt) => {
10
+ emit('input', evt);
11
+ value = evt.currentTarget?.value || '';
12
+ }
13
+ "
14
+ >
3
15
  <slot />
4
16
  </s-money-field>
5
17
  </template>
6
18
 
7
19
  <script setup>
20
+ import { computed } from "vue";
21
+ import { usePolarisAttrs } from "./utils";
8
22
  defineOptions({ name: "ShMoneyField", inheritAttrs: false });
9
- defineProps({
23
+ const props = defineProps({
10
24
  max: { type: Number, required: false },
11
25
  min: { type: Number, required: false },
12
- value: { type: String, required: false },
13
26
  autocomplete: { type: String, required: false },
14
27
  defaultValue: { type: String, required: false },
15
28
  details: { type: String, required: false },
@@ -21,6 +34,13 @@ defineProps({
21
34
  required: { type: Boolean, required: false },
22
35
  disabled: { type: Boolean, required: false },
23
36
  id: { type: String, required: false },
24
- name: { type: String, required: false }
37
+ name: { type: String, required: false },
38
+ modelValue: { type: String, required: false }
25
39
  });
40
+ const emit = defineEmits(["update:modelValue", "blur", "change", "focus", "input"]);
41
+ const value = computed({
42
+ get: () => props.modelValue,
43
+ set: (v) => emit("update:modelValue", v)
44
+ });
45
+ const polarisAttrs = usePolarisAttrs(props, ["modelValue"]);
26
46
  </script>