@synergy-design-system/vue 1.19.0 → 1.20.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.
@@ -0,0 +1,90 @@
1
+ import '@synergy-design-system/components/components/alert/alert.js';
2
+ import type { SynAfterHideEvent, SynAfterShowEvent, SynHideEvent, SynShowEvent } from '@synergy-design-system/components';
3
+ export type { SynShowEvent } from '@synergy-design-system/components';
4
+ export type { SynAfterShowEvent } from '@synergy-design-system/components';
5
+ export type { SynHideEvent } from '@synergy-design-system/components';
6
+ export type { SynAfterHideEvent } from '@synergy-design-system/components';
7
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToOption<{
8
+ /**
9
+ * Indicates whether or not the alert is open.
10
+ * You can toggle this attribute to show and hide the alert, or you can
11
+ use the `show()` and `hide()` methods and this attribute will reflect the alert's open state.
12
+ */
13
+ open?: boolean | undefined;
14
+ /**
15
+ * Enables a close button that allows the user to dismiss the alert.
16
+ */
17
+ closable?: boolean | undefined;
18
+ /**
19
+ * The alert's theme variant.
20
+ */
21
+ variant?: "primary" | "success" | "neutral" | "warning" | "danger" | undefined;
22
+ /**
23
+ * The length of time, in milliseconds, the alert will show before closing itself.
24
+ * If the user interacts with
25
+ the alert before it closes (e.g.
26
+ * moves the mouse over it), the timer will restart.
27
+ * Defaults to `Infinity`, meaning
28
+ the alert will not close on its own.
29
+ */
30
+ duration?: number | undefined;
31
+ }>, {
32
+ callHandleOpenChange: () => Promise<void> | undefined;
33
+ callHandleDurationChange: () => void | undefined;
34
+ callShow: () => Promise<void> | undefined;
35
+ callHide: () => Promise<void> | undefined;
36
+ callToast: () => Promise<void> | undefined;
37
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
38
+ "syn-show": (e: SynShowEvent) => void;
39
+ "syn-after-show": (e: SynAfterShowEvent) => void;
40
+ "syn-hide": (e: SynHideEvent) => void;
41
+ "syn-after-hide": (e: SynAfterHideEvent) => void;
42
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
43
+ /**
44
+ * Indicates whether or not the alert is open.
45
+ * You can toggle this attribute to show and hide the alert, or you can
46
+ use the `show()` and `hide()` methods and this attribute will reflect the alert's open state.
47
+ */
48
+ open?: boolean | undefined;
49
+ /**
50
+ * Enables a close button that allows the user to dismiss the alert.
51
+ */
52
+ closable?: boolean | undefined;
53
+ /**
54
+ * The alert's theme variant.
55
+ */
56
+ variant?: "primary" | "success" | "neutral" | "warning" | "danger" | undefined;
57
+ /**
58
+ * The length of time, in milliseconds, the alert will show before closing itself.
59
+ * If the user interacts with
60
+ the alert before it closes (e.g.
61
+ * moves the mouse over it), the timer will restart.
62
+ * Defaults to `Infinity`, meaning
63
+ the alert will not close on its own.
64
+ */
65
+ duration?: number | undefined;
66
+ }>>> & {
67
+ "onSyn-show"?: ((e: SynShowEvent) => any) | undefined;
68
+ "onSyn-after-show"?: ((e: SynAfterShowEvent) => any) | undefined;
69
+ "onSyn-hide"?: ((e: SynHideEvent) => any) | undefined;
70
+ "onSyn-after-hide"?: ((e: SynAfterHideEvent) => any) | undefined;
71
+ }, {}, {}>, {
72
+ default?(_: {}): any;
73
+ icon?(_: {}): any;
74
+ }>;
75
+ export default _default;
76
+
77
+ type __VLS_WithTemplateSlots<T, S> = T & {
78
+ new (): {
79
+ $slots: S;
80
+ };
81
+ };
82
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
83
+ type __VLS_TypePropsToOption<T> = {
84
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
85
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
86
+ } : {
87
+ type: import('vue').PropType<T[K]>;
88
+ required: true;
89
+ };
90
+ };
@@ -13,7 +13,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
13
13
  default?(_: {}): any;
14
14
  }>;
15
15
  export default _default;
16
-
17
16
  type __VLS_WithTemplateSlots<T, S> = T & {
18
17
  new (): {
19
18
  $slots: S;
@@ -43,10 +43,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
43
43
  callClick: () => void | undefined;
44
44
  callFocus: (options?: FocusOptions | undefined) => void | undefined;
45
45
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
46
- "syn-blur": (e: SynBlurEvent) => void;
47
- "syn-focus": (e: SynFocusEvent) => void;
48
46
  "syn-show": (e: SynShowEvent) => void;
49
47
  "syn-hide": (e: SynHideEvent) => void;
48
+ "syn-blur": (e: SynBlurEvent) => void;
49
+ "syn-focus": (e: SynFocusEvent) => void;
50
50
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
51
51
  /**
52
52
  * The navigation item's href target.
@@ -81,10 +81,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
81
81
  */
82
82
  divider?: boolean | undefined;
83
83
  }>>> & {
84
- "onSyn-blur"?: ((e: SynBlurEvent) => any) | undefined;
85
- "onSyn-focus"?: ((e: SynFocusEvent) => any) | undefined;
86
84
  "onSyn-show"?: ((e: SynShowEvent) => any) | undefined;
87
85
  "onSyn-hide"?: ((e: SynHideEvent) => any) | undefined;
86
+ "onSyn-blur"?: ((e: SynBlurEvent) => any) | undefined;
87
+ "onSyn-focus"?: ((e: SynFocusEvent) => any) | undefined;
88
88
  }, {}, {}>, {
89
89
  default?(_: {}): any;
90
90
  prefix?(_: {}): any;
@@ -115,16 +115,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
115
115
  callFocus: (options?: FocusOptions | undefined) => void | undefined;
116
116
  callBlur: () => void | undefined;
117
117
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
118
+ "syn-show": (e: SynShowEvent) => void;
119
+ "syn-after-show": (e: SynAfterShowEvent) => void;
120
+ "syn-hide": (e: SynHideEvent) => void;
121
+ "syn-after-hide": (e: SynAfterHideEvent) => void;
118
122
  "syn-blur": (e: SynBlurEvent) => void;
119
123
  "syn-focus": (e: SynFocusEvent) => void;
120
124
  "syn-invalid": (e: SynInvalidEvent) => void;
121
125
  "syn-change": (e: SynChangeEvent) => void;
122
126
  "syn-input": (e: SynInputEvent) => void;
123
127
  "update:modelValue": (newValue: string | string[]) => void;
124
- "syn-show": (e: SynShowEvent) => void;
125
- "syn-after-show": (e: SynAfterShowEvent) => void;
126
- "syn-hide": (e: SynHideEvent) => void;
127
- "syn-after-hide": (e: SynAfterHideEvent) => void;
128
128
  "syn-clear": (e: SynClearEvent) => void;
129
129
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
130
130
  /**
@@ -219,16 +219,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
219
219
  */
220
220
  modelValue?: string | string[] | undefined;
221
221
  }>>> & {
222
+ "onSyn-show"?: ((e: SynShowEvent) => any) | undefined;
223
+ "onSyn-after-show"?: ((e: SynAfterShowEvent) => any) | undefined;
224
+ "onSyn-hide"?: ((e: SynHideEvent) => any) | undefined;
225
+ "onSyn-after-hide"?: ((e: SynAfterHideEvent) => any) | undefined;
222
226
  "onSyn-blur"?: ((e: SynBlurEvent) => any) | undefined;
223
227
  "onSyn-focus"?: ((e: SynFocusEvent) => any) | undefined;
224
228
  "onSyn-invalid"?: ((e: SynInvalidEvent) => any) | undefined;
225
229
  "onSyn-change"?: ((e: SynChangeEvent) => any) | undefined;
226
230
  "onSyn-input"?: ((e: SynInputEvent) => any) | undefined;
227
231
  "onUpdate:modelValue"?: ((newValue: string | string[]) => any) | undefined;
228
- "onSyn-show"?: ((e: SynShowEvent) => any) | undefined;
229
- "onSyn-after-show"?: ((e: SynAfterShowEvent) => any) | undefined;
230
- "onSyn-hide"?: ((e: SynHideEvent) => any) | undefined;
231
- "onSyn-after-hide"?: ((e: SynAfterHideEvent) => any) | undefined;
232
232
  "onSyn-clear"?: ((e: SynClearEvent) => any) | undefined;
233
233
  }, {}, {}>, {
234
234
  default?(_: {}): any;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { default as SynVueAlert } from "./components/SynVueAlert.vue";
1
2
  export { default as SynVueBadge } from "./components/SynVueBadge.vue";
2
3
  export { default as SynVueButton } from "./components/SynVueButton.vue";
3
4
  export { default as SynVueButtonGroup } from "./components/SynVueButtonGroup.vue";
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://www.sick.com"
5
5
  },
6
6
  "dependencies": {
7
- "@synergy-design-system/components": "^1.19.0"
7
+ "@synergy-design-system/components": "^1.20.0"
8
8
  },
9
9
  "description": "Vue3 wrappers for the Synergy Design System",
10
10
  "exports": {
@@ -40,7 +40,7 @@
40
40
  "directory": "packages/vue"
41
41
  },
42
42
  "type": "module",
43
- "version": "1.19.0",
43
+ "version": "1.20.0",
44
44
  "devDependencies": {
45
45
  "@vue/tsconfig": "^0.5.1",
46
46
  "vue": "^3.4.24"
@@ -0,0 +1,156 @@
1
+ <script setup lang="ts">
2
+ // ---------------------------------------------------------------------
3
+ // 🔒 AUTOGENERATED @synergy-design-system/vue wrappers for @synergy-design-system/components
4
+ // Please do not edit this file directly!
5
+ // It will get recreated when running pnpm build.
6
+ // ---------------------------------------------------------------------
7
+
8
+ /**
9
+ * @summary Alerts are used to display important messages inline or as toast notifications.
10
+ * @documentation https://synergy.style/components/alert
11
+ * @status stable
12
+ * @since 2.0
13
+ *
14
+ * @dependency syn-icon-button
15
+ *
16
+ * @slot - The alert's main content.
17
+ * @slot icon - An icon to show in the alert. Works best with `<syn-icon>`.
18
+ *
19
+ * @event syn-show - Emitted when the alert opens.
20
+ * @event syn-after-show - Emitted after the alert opens and all animations are complete.
21
+ * @event syn-hide - Emitted when the alert closes.
22
+ * @event syn-after-hide - Emitted after the alert closes and all animations are complete.
23
+ *
24
+ * @csspart base - The component's base wrapper.
25
+ * @csspart icon - The container that wraps the optional icon.
26
+ * @csspart message - The container that wraps the alert's main content.
27
+ * @csspart close-button - The close button, an `<syn-icon-button>`.
28
+ * @csspart close-button__base - The close button's exported `base` part.
29
+ *
30
+ * @animation alert.show - The animation to use when showing the alert.
31
+ * @animation alert.hide - The animation to use when hiding the alert.
32
+ */
33
+ import { computed, ref } from 'vue';
34
+ import '@synergy-design-system/components/components/alert/alert.js';
35
+
36
+ import type {
37
+ SynAfterHideEvent, SynAfterShowEvent, SynAlert, SynHideEvent, SynShowEvent,
38
+ } from '@synergy-design-system/components';
39
+
40
+ // DOM Reference to the element
41
+ const element = ref<SynAlert>();
42
+
43
+ // Map methods
44
+ const callHandleOpenChange = (...args: Parameters<SynAlert['handleOpenChange']>) => element.value?.handleOpenChange(...args);
45
+ const callHandleDurationChange = (...args: Parameters<SynAlert['handleDurationChange']>) => element.value?.handleDurationChange(...args);
46
+ /**
47
+ * Shows the alert.
48
+ */
49
+ const callShow = (...args: Parameters<SynAlert['show']>) => element.value?.show(...args);
50
+ /**
51
+ * Hides the alert
52
+ */
53
+ const callHide = (...args: Parameters<SynAlert['hide']>) => element.value?.hide(...args);
54
+ /**
55
+ * Displays the alert as a toast notification.
56
+ * This will move the alert out of its position in the DOM and, when
57
+ dismissed, it will be removed from the DOM completely.
58
+ * By storing a reference to the alert, you can reuse it by
59
+ calling this method again.
60
+ * The returned promise will resolve after the alert is hidden.
61
+ */
62
+ const callToast = (...args: Parameters<SynAlert['toast']>) => element.value?.toast(...args);
63
+
64
+ defineExpose({
65
+ callHandleOpenChange,
66
+ callHandleDurationChange,
67
+ callShow,
68
+ callHide,
69
+ callToast,
70
+ });
71
+
72
+ // Map attributes
73
+ const props = defineProps<{
74
+ /**
75
+ * Indicates whether or not the alert is open.
76
+ * You can toggle this attribute to show and hide the alert, or you can
77
+ use the `show()` and `hide()` methods and this attribute will reflect the alert's open state.
78
+ */
79
+ 'open'?: SynAlert['open'];
80
+
81
+ /**
82
+ * Enables a close button that allows the user to dismiss the alert.
83
+ */
84
+ 'closable'?: SynAlert['closable'];
85
+
86
+ /**
87
+ * The alert's theme variant.
88
+ */
89
+ 'variant'?: SynAlert['variant'];
90
+
91
+ /**
92
+ * The length of time, in milliseconds, the alert will show before closing itself.
93
+ * If the user interacts with
94
+ the alert before it closes (e.g.
95
+ * moves the mouse over it), the timer will restart.
96
+ * Defaults to `Infinity`, meaning
97
+ the alert will not close on its own.
98
+ */
99
+ 'duration'?: SynAlert['duration'];
100
+ }>();
101
+
102
+ // Make sure prop binding only forwards the props that are actually there.
103
+ // This is needed because :param="param" also adds an empty attribute
104
+ // when using web-components, which breaks optional arguments like size in SynInput
105
+ // @see https://github.com/vuejs/core/issues/5190#issuecomment-1003112498
106
+ const visibleProps = computed(() => Object.fromEntries(
107
+ Object
108
+ .entries(props)
109
+ .filter(([, value]) => typeof value !== 'undefined'),
110
+ ));
111
+
112
+ // Map events
113
+ defineEmits<{
114
+ /**
115
+ * Emitted when the alert opens.
116
+ */
117
+ 'syn-show': [e: SynShowEvent];
118
+
119
+ /**
120
+ * Emitted after the alert opens and all animations are complete.
121
+ */
122
+ 'syn-after-show': [e: SynAfterShowEvent];
123
+
124
+ /**
125
+ * Emitted when the alert closes.
126
+ */
127
+ 'syn-hide': [e: SynHideEvent];
128
+
129
+ /**
130
+ * Emitted after the alert closes and all animations are complete.
131
+ */
132
+ 'syn-after-hide': [e: SynAfterHideEvent];
133
+ }>();
134
+ </script>
135
+
136
+ <script lang="ts">
137
+ export type { SynShowEvent } from '@synergy-design-system/components';
138
+ export type { SynAfterShowEvent } from '@synergy-design-system/components';
139
+ export type { SynHideEvent } from '@synergy-design-system/components';
140
+ export type { SynAfterHideEvent } from '@synergy-design-system/components';
141
+ </script>
142
+
143
+ <template>
144
+ <syn-alert
145
+ v-bind="visibleProps"
146
+ ref="element"
147
+ @syn-show="$emit('syn-show', $event)"
148
+ @syn-after-show="$emit('syn-after-show', $event)"
149
+
150
+ @syn-hide="$emit('syn-hide', $event)"
151
+ @syn-after-hide="$emit('syn-after-hide', $event)"
152
+ >
153
+ <slot />
154
+ <slot name="icon" />
155
+ </syn-alert>
156
+ </template>
package/src/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  // Please do not edit this file directly!
4
4
  // It will get recreated when running pnpm build.
5
5
  // ---------------------------------------------------------------------
6
+ export { default as SynVueAlert } from './components/SynVueAlert.vue';
6
7
  export { default as SynVueBadge } from './components/SynVueBadge.vue';
7
8
  export { default as SynVueButton } from './components/SynVueButton.vue';
8
9
  export { default as SynVueButtonGroup } from './components/SynVueButtonGroup.vue';