@cypress-design/vue-alert 0.3.0 → 0.5.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.
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@cypress-design/vue-alert",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "files": [
5
5
  "*"
6
6
  ],
7
- "typings": "./dist/vue/index.d.ts",
7
+ "typings": "./dist/index.d.ts",
8
8
  "main": "./dist/index.umd.js",
9
9
  "module": "./dist/index.es.mjs",
10
10
  "exports": {
11
11
  ".": {
12
12
  "import": "./dist/index.es.mjs",
13
- "require": "./dist/index.umd.js"
13
+ "require": "./dist/index.umd.js",
14
+ "types": "./dist/index.d.ts"
14
15
  },
15
16
  "./style": {
16
17
  "import": "./dist/style.css",
@@ -26,5 +27,9 @@
26
27
  "@cypress-design/details-animation": "*",
27
28
  "@cypress-design/vue-icon": "*"
28
29
  },
30
+ "devDependencies": {
31
+ "@cypress-design/constants-alert": "*",
32
+ "@cypress-design/css": "*"
33
+ },
29
34
  "license": "MIT"
30
35
  }
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "extends": "../../../tsconfig.vue.json",
3
- "include": ["./*.vue", "./index.ts", "../constants.ts"],
3
+ "include": ["./*.vue", "./index.ts"],
4
4
  "compilerOptions": {
5
5
  "outDir": "dist",
6
- "rootDir": "../"
6
+ "rootDir": "./",
7
+ "composite": false
7
8
  }
8
9
  }
package/tsconfig.json CHANGED
@@ -1,10 +1,7 @@
1
1
  {
2
2
  "extends": "../../../tsconfig.vue.json",
3
- "include": [
4
- "*.vue",
5
- "*.ts",
6
- "*.tsx",
7
- "../constants.ts",
8
- "../../../cypress/support/*.ts"
9
- ]
3
+ "compilerOptions": {
4
+ "rootDir": "../"
5
+ },
6
+ "include": ["*.vue", "*.ts", "*.tsx", "../../../cypress/support/*.ts"]
10
7
  }
package/Alert.stories.mdx DELETED
@@ -1,76 +0,0 @@
1
- import { ArgsTable, Canvas, Meta, Story, Description } from '@storybook/addon-docs'
2
- import { version } from "./package.json"
3
- import changelog from "./CHANGELOG.md?raw"
4
-
5
- import Alert from './Alert.vue'
6
-
7
- import AlertStory from './Alert.rootstory'
8
-
9
- <h1>Alert<span className="text-lg font-normal"> - v{version}</span></h1>
10
-
11
- <Meta title="Alert" component={Alert} parameters={{
12
- design: {
13
- type: "figma",
14
- url: "https://www.figma.com/file/1WJ3GVQyMV5e7xVxPg3yID/Design-System?node-id=1035%3A9923",
15
- }
16
- }} />
17
-
18
- <Canvas withSource="none">
19
- <Story name="Alert">
20
- {AlertStory()}
21
- </Story>
22
- </Canvas>
23
-
24
- <ArgsTable />
25
-
26
- ## Usage
27
-
28
- The simplest is to use with plain text. By default, type is `info`.
29
-
30
- ```vue
31
- <script setup>
32
- import Alert from '@cypress-design/vue-alert'
33
- </script>
34
- <template>
35
- <Alert type="error">Great Scott!!</Alert>
36
- </template>
37
- ```
38
-
39
- One can also have rich text in both the title and the body.
40
-
41
- ```vue
42
- <template>
43
- <Alert>
44
- This is an <code>info</code> message
45
- <template #body>
46
- <p>This is the body of the alert.</p>
47
- </template>
48
- </Alert>
49
- </template>
50
- ```
51
-
52
- If you want the alert to be dismissible, you can add the `dismissible` prop. Don't forget to add the `@dismiss` prop to handle the dismiss event.
53
-
54
- ```vue
55
- <template>
56
- <Alert
57
- title="This is an info message"
58
- dismissible
59
- @dismiss="() => setDismissed(true)"
60
- />
61
- </template>
62
- ```
63
-
64
- You can also remove the rounded corners and the icon of the alert by adding the `notRounded` and the `noIcon` props.
65
-
66
- ```vue
67
- <template>
68
- <Alert type="warning" title="This is an info message" notRounded noIcon />
69
- </template>
70
- ```
71
-
72
-
73
- <Description>
74
- {changelog.replace(/^# .+/, '## Changelog')}
75
- </Description>
76
-
@@ -1,23 +0,0 @@
1
- import type { WindiColor } from '@cypress-design/icon-registry';
2
- export declare type AlertType = 'info' | 'success' | 'error' | 'warning' | 'neutral';
3
- export declare const alertSizesClasses: {
4
- readonly xs: "py-[4px] px-[8px] leading-[22px] text-[14px]";
5
- readonly sm: "py-[8px] px-[12px] leading-[22px] text-[14px]";
6
- readonly md: "py-[12px] px-[16px] leading-[24px] text-[16px]";
7
- readonly lg: "p-[16px] leading-[24px] text-[16px]";
8
- };
9
- export declare type AlertSize = keyof typeof alertSizesClasses;
10
- export declare const defaultAlertSize: AlertSize;
11
- export declare type AlertClasses = {
12
- headerClass: string;
13
- bodyClass: string;
14
- borderClass: string;
15
- detailsHeaderClass: string;
16
- iconCloseColor: WindiColor;
17
- iconColor?: WindiColor;
18
- iconChevronColor: WindiColor;
19
- };
20
- export declare const alertClasses: Record<AlertType, AlertClasses>;
21
- export declare const defaultAlertType: AlertType;
22
- export declare const defaultAlertTitle = "Additional details";
23
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAE/D,oBAAY,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAA;AAC5E,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAA;AAEV,oBAAY,SAAS,GAAG,MAAM,OAAO,iBAAiB,CAAA;AACtD,eAAO,MAAM,gBAAgB,EAAE,SAAgB,CAAA;AAE/C,oBAAY,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,cAAc,EAAE,UAAU,CAAA;IAC1B,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,gBAAgB,EAAE,UAAU,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE,YAAY,CA6DxD,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,SAAkB,CAAA;AAEjD,eAAO,MAAM,iBAAiB,uBAAuB,CAAA"}
@@ -1,226 +0,0 @@
1
- import { AlertSize, AlertType } from '../constants';
2
- declare const _default: {
3
- new (...args: any[]): {
4
- $: import("vue").ComponentInternalInstance;
5
- $data: {};
6
- $props: Partial<{
7
- type: AlertType;
8
- detailsTitle: string;
9
- size: AlertSize;
10
- }> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
11
- /**
12
- * Color scheme
13
- */
14
- type?: AlertType | undefined;
15
- /**
16
- * If details are provided,text used in the toggle button
17
- */
18
- detailsTitle?: string | undefined;
19
- /**
20
- * Show the dismiss button
21
- */
22
- dismissible?: boolean | undefined;
23
- /**
24
- * When an icon is displayed by default, use this to remove it
25
- */
26
- noIcon?: boolean | undefined;
27
- /**
28
- * If you need square corners
29
- */
30
- notRounded?: boolean | undefined;
31
- /**
32
- * Dismiss the alert after a delay (in ms)
33
- */
34
- duration?: number | undefined;
35
- /**
36
- * Size of the alert
37
- */
38
- size?: "xs" | "sm" | "md" | "lg" | undefined;
39
- }>, {
40
- type: AlertType;
41
- detailsTitle: string;
42
- size: "xs" | "sm" | "md" | "lg";
43
- }>>> & {
44
- onDismiss?: (() => any) | undefined;
45
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "type" | "detailsTitle" | "size">;
46
- $attrs: {
47
- [x: string]: unknown;
48
- };
49
- $refs: {
50
- [x: string]: unknown;
51
- };
52
- $slots: Readonly<{
53
- [name: string]: import("vue").Slot | undefined;
54
- }>;
55
- $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
56
- $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
57
- $emit: (event: "dismiss") => void;
58
- $el: any;
59
- $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
60
- /**
61
- * Color scheme
62
- */
63
- type?: AlertType | undefined;
64
- /**
65
- * If details are provided,text used in the toggle button
66
- */
67
- detailsTitle?: string | undefined;
68
- /**
69
- * Show the dismiss button
70
- */
71
- dismissible?: boolean | undefined;
72
- /**
73
- * When an icon is displayed by default, use this to remove it
74
- */
75
- noIcon?: boolean | undefined;
76
- /**
77
- * If you need square corners
78
- */
79
- notRounded?: boolean | undefined;
80
- /**
81
- * Dismiss the alert after a delay (in ms)
82
- */
83
- duration?: number | undefined;
84
- /**
85
- * Size of the alert
86
- */
87
- size?: "xs" | "sm" | "md" | "lg" | undefined;
88
- }>, {
89
- type: AlertType;
90
- detailsTitle: string;
91
- size: "xs" | "sm" | "md" | "lg";
92
- }>>> & {
93
- onDismiss?: (() => any) | undefined;
94
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
95
- dismiss: () => void;
96
- }, string, {
97
- type: AlertType;
98
- detailsTitle: string;
99
- size: AlertSize;
100
- }> & {
101
- beforeCreate?: ((() => void) | (() => void)[]) | undefined;
102
- created?: ((() => void) | (() => void)[]) | undefined;
103
- beforeMount?: ((() => void) | (() => void)[]) | undefined;
104
- mounted?: ((() => void) | (() => void)[]) | undefined;
105
- beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
106
- updated?: ((() => void) | (() => void)[]) | undefined;
107
- activated?: ((() => void) | (() => void)[]) | undefined;
108
- deactivated?: ((() => void) | (() => void)[]) | undefined;
109
- beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
110
- beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
111
- destroyed?: ((() => void) | (() => void)[]) | undefined;
112
- unmounted?: ((() => void) | (() => void)[]) | undefined;
113
- renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
114
- renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
115
- errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
116
- };
117
- $forceUpdate: () => void;
118
- $nextTick: typeof import("vue").nextTick;
119
- $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
120
- } & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
121
- /**
122
- * Color scheme
123
- */
124
- type?: AlertType | undefined;
125
- /**
126
- * If details are provided,text used in the toggle button
127
- */
128
- detailsTitle?: string | undefined;
129
- /**
130
- * Show the dismiss button
131
- */
132
- dismissible?: boolean | undefined;
133
- /**
134
- * When an icon is displayed by default, use this to remove it
135
- */
136
- noIcon?: boolean | undefined;
137
- /**
138
- * If you need square corners
139
- */
140
- notRounded?: boolean | undefined;
141
- /**
142
- * Dismiss the alert after a delay (in ms)
143
- */
144
- duration?: number | undefined;
145
- /**
146
- * Size of the alert
147
- */
148
- size?: "xs" | "sm" | "md" | "lg" | undefined;
149
- }>, {
150
- type: AlertType;
151
- detailsTitle: string;
152
- size: "xs" | "sm" | "md" | "lg";
153
- }>>> & {
154
- onDismiss?: (() => any) | undefined;
155
- } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
156
- __isFragment?: undefined;
157
- __isTeleport?: undefined;
158
- __isSuspense?: undefined;
159
- } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
160
- /**
161
- * Color scheme
162
- */
163
- type?: AlertType | undefined;
164
- /**
165
- * If details are provided,text used in the toggle button
166
- */
167
- detailsTitle?: string | undefined;
168
- /**
169
- * Show the dismiss button
170
- */
171
- dismissible?: boolean | undefined;
172
- /**
173
- * When an icon is displayed by default, use this to remove it
174
- */
175
- noIcon?: boolean | undefined;
176
- /**
177
- * If you need square corners
178
- */
179
- notRounded?: boolean | undefined;
180
- /**
181
- * Dismiss the alert after a delay (in ms)
182
- */
183
- duration?: number | undefined;
184
- /**
185
- * Size of the alert
186
- */
187
- size?: "xs" | "sm" | "md" | "lg" | undefined;
188
- }>, {
189
- type: AlertType;
190
- detailsTitle: string;
191
- size: "xs" | "sm" | "md" | "lg";
192
- }>>> & {
193
- onDismiss?: (() => any) | undefined;
194
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
195
- dismiss: () => void;
196
- }, string, {
197
- type: AlertType;
198
- detailsTitle: string;
199
- size: AlertSize;
200
- }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
201
- $slots: {
202
- icon: (_: {
203
- strokeColor: import("@cypress-design/vue-icon").WindiColor | undefined;
204
- class: string;
205
- }) => any;
206
- default: (_: {}) => any;
207
- body: (_: {}) => any;
208
- details: (_: {}) => any;
209
- };
210
- });
211
- export default _default;
212
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
213
- declare type __VLS_TypePropsToRuntimeProps<T> = {
214
- [K in keyof T]-?: {} extends Pick<T, K> ? {
215
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
216
- } : {
217
- type: import('vue').PropType<T[K]>;
218
- required: true;
219
- };
220
- };
221
- declare type __VLS_WithDefaults<P, D> = {
222
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
223
- default: D[K];
224
- } : P[K];
225
- };
226
- //# sourceMappingURL=Alert.vue.d.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