@vrobots/storybook 0.1.47 → 0.1.49

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/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vrobots/storybook",
3
3
  "private": false,
4
- "version": "0.1.47",
4
+ "version": "0.1.49",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -10,7 +10,7 @@ const Login = ({ title, description, onLogin, ...props }) => {
10
10
  value: /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
11
11
  message: "Invalid email address"
12
12
  }
13
- }) }), _jsx(Field.ErrorText, { children: errors.emailAddress?.message })] }), _jsxs(Field.Root, { invalid: !!errors.password, children: [_jsx(Field.Label, { children: "Password" }), _jsx(PasswordInput, { ...register("password", {
13
+ }), autoFocus: true }), _jsx(Field.ErrorText, { children: errors.emailAddress?.message })] }), _jsxs(Field.Root, { invalid: !!errors.password, children: [_jsx(Field.Label, { children: "Password" }), _jsx(PasswordInput, { ...register("password", {
14
14
  required: "Please enter your password",
15
15
  }) }), _jsx(Field.ErrorText, { children: errors.password?.message })] })] }), _jsx(Button, { type: "submit", colorScheme: "teal", width: "full", mt: 6, children: "Login" })] })] }) }));
16
16
  };
@@ -1,4 +1,5 @@
1
1
  export * from './ui/color-mode';
2
+ export * from './ui/toaster';
2
3
  export * from './Accordion';
3
4
  export * from './AvatarIconMenu';
4
5
  export * from './Breadcrumbs';
@@ -11,4 +12,5 @@ export * from './Page';
11
12
  export * from './Section';
12
13
  export * from './Sidebar';
13
14
  export * from './Timeline';
15
+ export * from './form/Login';
14
16
  export { default as Form } from './form';
@@ -1,4 +1,5 @@
1
1
  export * from './ui/color-mode';
2
+ export * from './ui/toaster';
2
3
  export * from './Accordion';
3
4
  export * from './AvatarIconMenu';
4
5
  export * from './Breadcrumbs';
@@ -11,4 +12,5 @@ export * from './Page';
11
12
  export * from './Section';
12
13
  export * from './Sidebar';
13
14
  export * from './Timeline';
15
+ export * from './form/Login';
14
16
  export { default as Form } from './form';
@@ -0,0 +1,2 @@
1
+ export declare const toaster: import("@zag-js/toast").Store<any>;
2
+ export declare const Toaster: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Toaster as ChakraToaster, Portal, Spinner, Stack, Toast, createToaster, } from "@chakra-ui/react";
4
+ export const toaster = createToaster({
5
+ placement: "top-end",
6
+ pauseOnPageIdle: true,
7
+ });
8
+ export const Toaster = () => {
9
+ return (_jsx(Portal, { children: _jsx(ChakraToaster, { toaster: toaster, insetInline: { mdDown: "4" }, children: (toast) => (_jsxs(Toast.Root, { width: { md: "sm" }, children: [toast.type === "loading" ? (_jsx(Spinner, { size: "sm", color: "blue.solid" })) : (_jsx(Toast.Indicator, {})), _jsxs(Stack, { gap: "1", flex: "1", maxWidth: "100%", children: [toast.title && _jsx(Toast.Title, { children: toast.title }), toast.description && (_jsx(Toast.Description, { children: toast.description }))] }), toast.action && (_jsx(Toast.ActionTrigger, { children: toast.action.label })), toast.closable && _jsx(Toast.CloseTrigger, {})] })) }) }));
10
+ };
@@ -1,7 +1,7 @@
1
1
  import type { StoryObj } from '@storybook/react-vite';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ title, description, onLogin, ...props }: import("../components/form").ILoginProps) => import("react/jsx-runtime").JSX.Element;
4
+ component: ({ title, description, onLogin, ...props }: import("../components").ILoginProps) => import("react/jsx-runtime").JSX.Element;
5
5
  tags: string[];
6
6
  parameters: {
7
7
  layout: string;
@@ -0,0 +1,15 @@
1
+ import type { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: () => import("react/jsx-runtime").JSX.Element;
5
+ tags: string[];
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ args: {
10
+ title: string;
11
+ };
12
+ };
13
+ export default meta;
14
+ type Story = StoryObj<typeof meta>;
15
+ export declare const Component: Story;
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { toaster, Toaster } from '../components';
3
+ import React from 'react';
4
+ import { Button } from '@chakra-ui/react';
5
+ const meta = {
6
+ title: 'Feedback/Toaster',
7
+ component: Toaster,
8
+ tags: ['autodocs'],
9
+ parameters: {
10
+ layout: 'fullscreen',
11
+ },
12
+ args: {
13
+ title: "Toaster",
14
+ }
15
+ };
16
+ export default meta;
17
+ export const Component = {
18
+ args: {
19
+ title: "Toaster",
20
+ description: "Please enter your credentials to continue",
21
+ onToaster: (data) => console.log(data)
22
+ },
23
+ decorators: [
24
+ (Story) => {
25
+ return (_jsxs(React.Fragment, { children: [_jsx(Story, {}), _jsx(Button, { variant: "outline", size: "sm", onClick: () => toaster.create({
26
+ description: "File saved successfully",
27
+ type: "info",
28
+ closable: true,
29
+ }), children: "Show Toast" })] }));
30
+ },
31
+ ],
32
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vrobots/storybook",
3
3
  "private": false,
4
- "version": "0.1.47",
4
+ "version": "0.1.49",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",