@vin.samdy.dev/passappui 1.0.2 → 1.1.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.
Files changed (55) hide show
  1. package/dist/components/Xbutton/Xbutton.d.ts +8 -0
  2. package/dist/components/Xbutton/Xbutton.d.ts.map +1 -0
  3. package/dist/components/Xbutton/Xbutton.js +12 -0
  4. package/dist/components/Xbutton/Xbutton.js.map +1 -0
  5. package/dist/components/Xbutton/Xbutton.stories.d.ts +7 -0
  6. package/dist/components/Xbutton/Xbutton.stories.d.ts.map +1 -0
  7. package/dist/components/Xbutton/Xbutton.stories.js +17 -0
  8. package/dist/components/Xbutton/Xbutton.stories.js.map +1 -0
  9. package/dist/components/Xbutton/index.d.ts +2 -0
  10. package/dist/components/Xbutton/index.d.ts.map +1 -0
  11. package/dist/components/Xbutton/index.js +2 -0
  12. package/dist/components/Xbutton/index.js.map +1 -0
  13. package/dist/components/index.d.ts +1 -0
  14. package/dist/components/index.d.ts.map +1 -1
  15. package/dist/components/index.js +1 -0
  16. package/dist/components/index.js.map +1 -1
  17. package/dist/hooks/index.d.ts +1 -0
  18. package/dist/hooks/index.d.ts.map +1 -1
  19. package/dist/hooks/index.js +1 -0
  20. package/dist/hooks/index.js.map +1 -1
  21. package/dist/hooks/usePersistStorage.d.ts +2 -0
  22. package/dist/hooks/usePersistStorage.d.ts.map +1 -0
  23. package/dist/hooks/usePersistStorage.js +6 -0
  24. package/dist/hooks/usePersistStorage.js.map +1 -0
  25. package/dist/stories/Button.d.ts +16 -0
  26. package/dist/stories/Button.d.ts.map +1 -0
  27. package/dist/stories/Button.js +12 -0
  28. package/dist/stories/Button.js.map +1 -0
  29. package/dist/stories/Button.stories.d.ts +24 -0
  30. package/dist/stories/Button.stories.d.ts.map +1 -0
  31. package/dist/stories/Button.stories.js +45 -0
  32. package/dist/stories/Button.stories.js.map +1 -0
  33. package/dist/stories/Header.d.ts +13 -0
  34. package/dist/stories/Header.d.ts.map +1 -0
  35. package/dist/stories/Header.js +5 -0
  36. package/dist/stories/Header.js.map +1 -0
  37. package/dist/stories/Header.stories.d.ts +19 -0
  38. package/dist/stories/Header.stories.d.ts.map +1 -0
  39. package/dist/stories/Header.stories.js +27 -0
  40. package/dist/stories/Header.stories.js.map +1 -0
  41. package/dist/stories/Page.d.ts +4 -0
  42. package/dist/stories/Page.d.ts.map +1 -0
  43. package/dist/stories/Page.js +9 -0
  44. package/dist/stories/Page.js.map +1 -0
  45. package/dist/stories/Page.stories.d.ts +13 -0
  46. package/dist/stories/Page.stories.d.ts.map +1 -0
  47. package/dist/stories/Page.stories.js +25 -0
  48. package/dist/stories/Page.stories.js.map +1 -0
  49. package/package.json +3 -2
  50. package/src/components/Xbutton/Xbutton.stories.tsx +24 -0
  51. package/src/components/Xbutton/Xbutton.tsx +22 -0
  52. package/src/components/Xbutton/index.ts +1 -0
  53. package/src/components/index.ts +2 -1
  54. package/src/hooks/index.ts +2 -1
  55. package/src/hooks/usePersistStorage.ts +6 -0
@@ -0,0 +1,8 @@
1
+ type XButtonProps = Readonly<{
2
+ label: string;
3
+ backgroundColor: string;
4
+ color: string;
5
+ }>;
6
+ export declare function XButton({ label, backgroundColor, color }: XButtonProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=Xbutton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Xbutton.d.ts","sourceRoot":"","sources":["../../../src/components/Xbutton/Xbutton.tsx"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG,QAAQ,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,YAAY,2CAetE"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function XButton({ label, backgroundColor, color }) {
3
+ return (_jsx("button", { style: {
4
+ backgroundColor,
5
+ color,
6
+ padding: "0.5rem 1rem",
7
+ border: "none",
8
+ borderRadius: "4px",
9
+ cursor: "pointer",
10
+ }, children: label }));
11
+ }
12
+ //# sourceMappingURL=Xbutton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Xbutton.js","sourceRoot":"","sources":["../../../src/components/Xbutton/Xbutton.tsx"],"names":[],"mappings":";AAMA,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAgB;IACrE,OAAO,CACL,iBACE,KAAK,EAAE;YACL,eAAe;YACf,KAAK;YACL,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,MAAM;YACd,YAAY,EAAE,KAAK;YACnB,MAAM,EAAE,SAAS;SAClB,YAEA,KAAK,GACC,CACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { XButton } from "./Xbutton";
3
+ declare const meta: Meta<typeof XButton>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof XButton>;
6
+ export declare const Default: Story;
7
+ //# sourceMappingURL=Xbutton.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Xbutton.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Xbutton/Xbutton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAS9B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC;AAEtC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { XButton } from "./Xbutton";
3
+ const meta = {
4
+ component: XButton,
5
+ decorators: [
6
+ (Story) => (_jsx("div", { style: { padding: '1rem' }, children: _jsx(Story, {}) })),
7
+ ],
8
+ };
9
+ export default meta;
10
+ export const Default = {
11
+ args: {
12
+ label: 'Click Me',
13
+ backgroundColor: '#007BFF',
14
+ color: '#FFFFFF',
15
+ },
16
+ };
17
+ //# sourceMappingURL=Xbutton.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Xbutton.stories.js","sourceRoot":"","sources":["../../../src/components/Xbutton/Xbutton.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,IAAI,GAAyB;IAC/B,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE;QACR,CAAC,KAAK,EAAE,EAAE,CAAC,CACP,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,YAC3B,KAAC,KAAK,KAAG,GACP,CACT;KACJ;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC1B,IAAI,EAAE;QACF,KAAK,EAAE,UAAU;QACjB,eAAe,EAAE,SAAS;QAC1B,KAAK,EAAE,SAAS;KACnB;CACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./Xbutton";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Xbutton/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./Xbutton";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Xbutton/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './footer';
2
2
  export * from './header';
3
3
  export * from './sidebar';
4
+ export * from './Xbutton';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './footer';
2
2
  export * from './header';
3
3
  export * from './sidebar';
4
+ export * from './Xbutton';
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './useLocalStorage';
2
+ export * from './usePersistStorage';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './useLocalStorage';
2
+ export * from './usePersistStorage';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const usePersistStorage: () => Storage | null;
2
+ //# sourceMappingURL=usePersistStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePersistStorage.d.ts","sourceRoot":"","sources":["../../src/hooks/usePersistStorage.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,sBAK7B,CAAA"}
@@ -0,0 +1,6 @@
1
+ export const usePersistStorage = () => {
2
+ const isClient = typeof window !== 'undefined';
3
+ const storage = isClient ? window.localStorage : null;
4
+ return storage;
5
+ };
6
+ //# sourceMappingURL=usePersistStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePersistStorage.js","sourceRoot":"","sources":["../../src/hooks/usePersistStorage.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,MAAM,QAAQ,GAAG,OAAO,MAAM,KAAK,WAAW,CAAA;IAC9C,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAA;IAErD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
@@ -0,0 +1,16 @@
1
+ import './button.css';
2
+ export interface ButtonProps {
3
+ /** Is this the principal call to action on the page? */
4
+ primary?: boolean;
5
+ /** What background color to use */
6
+ backgroundColor?: string;
7
+ /** How large should the button be? */
8
+ size?: 'small' | 'medium' | 'large';
9
+ /** Button contents */
10
+ label: string;
11
+ /** Optional click handler */
12
+ onClick?: () => void;
13
+ }
14
+ /** Primary UI component for user interaction */
15
+ export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
16
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/stories/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mCAAmC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sCAAsC;IACtC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,gDAAgD;AAChD,eAAO,MAAM,MAAM,GAAI,qDAMpB,WAAW,4CAgBb,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import './button.css';
3
+ /** Primary UI component for user interaction */
4
+ export const Button = ({ primary = false, size = 'medium', backgroundColor, label, ...props }) => {
5
+ const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
6
+ return (_jsxs("button", { type: "button", className: ['storybook-button', `storybook-button--${size}`, mode].join(' '), ...props, children: [label, _jsx("style", { jsx: true, children: `
7
+ button {
8
+ background-color: ${backgroundColor};
9
+ }
10
+ ` })] }));
11
+ };
12
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/stories/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,cAAc,CAAC;AAetB,gDAAgD;AAChD,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EACrB,OAAO,GAAG,KAAK,EACf,IAAI,GAAG,QAAQ,EACf,eAAe,EACf,KAAK,EACL,GAAG,KAAK,EACI,EAAE,EAAE;IAChB,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,6BAA6B,CAAC;IACnF,OAAO,CACL,kBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,CAAC,kBAAkB,EAAE,qBAAqB,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACxE,KAAK,aAER,KAAK,EACN,gBAAO,GAAG,kBAAE;;8BAEY,eAAe;;OAEtC,GAAS,IACH,CACV,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { StoryObj } from '@storybook/nextjs-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ primary, size, backgroundColor, label, ...props }: import("./Button").ButtonProps) => import("react/jsx-runtime").JSX.Element;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ tags: string[];
9
+ argTypes: {
10
+ backgroundColor: {
11
+ control: "color";
12
+ };
13
+ };
14
+ args: {
15
+ onClick: import("@vitest/spy").Mock<(...args: any[]) => any>;
16
+ };
17
+ };
18
+ export default meta;
19
+ type Story = StoryObj<typeof meta>;
20
+ export declare const Primary: Story;
21
+ export declare const Secondary: Story;
22
+ export declare const Large: Story;
23
+ export declare const Small: Story;
24
+ //# sourceMappingURL=Button.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../src/stories/Button.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAO7D,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;CAeqB,CAAC;AAEhC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { fn } from 'storybook/test';
2
+ import { Button } from './Button';
3
+ // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
4
+ const meta = {
5
+ title: 'Example/Button',
6
+ component: Button,
7
+ parameters: {
8
+ // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
9
+ layout: 'centered',
10
+ },
11
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
12
+ tags: ['autodocs'],
13
+ // More on argTypes: https://storybook.js.org/docs/api/argtypes
14
+ argTypes: {
15
+ backgroundColor: { control: 'color' },
16
+ },
17
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args
18
+ args: { onClick: fn() },
19
+ };
20
+ export default meta;
21
+ // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
22
+ export const Primary = {
23
+ args: {
24
+ primary: true,
25
+ label: 'Button',
26
+ },
27
+ };
28
+ export const Secondary = {
29
+ args: {
30
+ label: 'Button',
31
+ },
32
+ };
33
+ export const Large = {
34
+ args: {
35
+ size: 'large',
36
+ label: 'Button',
37
+ },
38
+ };
39
+ export const Small = {
40
+ args: {
41
+ size: 'small',
42
+ label: 'Button',
43
+ },
44
+ };
45
+ //# sourceMappingURL=Button.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../src/stories/Button.stories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,iGAAiG;AACjG,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE;QACV,4HAA4H;QAC5H,MAAM,EAAE,UAAU;KACnB;IACD,0HAA0H;IAC1H,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,+DAA+D;IAC/D,QAAQ,EAAE;QACR,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;KACtC;IACD,uJAAuJ;IACvJ,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE;CACM,CAAC;AAEhC,eAAe,IAAI,CAAC;AAGpB,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,QAAQ;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,KAAK,EAAE,QAAQ;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAU;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,QAAQ;KAChB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAU;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,QAAQ;KAChB;CACF,CAAC"}
@@ -0,0 +1,13 @@
1
+ import './header.css';
2
+ type User = {
3
+ name: string;
4
+ };
5
+ export interface HeaderProps {
6
+ user?: User;
7
+ onLogin?: () => void;
8
+ onLogout?: () => void;
9
+ onCreateAccount?: () => void;
10
+ }
11
+ export declare const Header: ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=Header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/stories/Header.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,MAAM,GAAI,8CAA8C,WAAW,4CAuC/E,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Button } from './Button';
3
+ import './header.css';
4
+ export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => (_jsx("header", { children: _jsxs("div", { className: "storybook-header", children: [_jsxs("div", { children: [_jsx("svg", { width: "32", height: "32", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", children: _jsxs("g", { fill: "none", fillRule: "evenodd", children: [_jsx("path", { d: "M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z", fill: "#FFF" }), _jsx("path", { d: "M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z", fill: "#555AB9" }), _jsx("path", { d: "M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z", fill: "#91BAF8" })] }) }), _jsx("h1", { children: "Acme" })] }), _jsx("div", { children: user ? (_jsxs(_Fragment, { children: [_jsxs("span", { className: "welcome", children: ["Welcome, ", _jsx("b", { children: user.name }), "!"] }), _jsx(Button, { size: "small", onClick: onLogout, label: "Log out" })] })) : (_jsxs(_Fragment, { children: [_jsx(Button, { size: "small", onClick: onLogin, label: "Log in" }), _jsx(Button, { primary: true, size: "small", onClick: onCreateAccount, label: "Sign up" })] })) })] }) }));
5
+ //# sourceMappingURL=Header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/stories/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,cAAc,CAAC;AAatB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAe,EAAE,EAAE,CAAC,CACnF,2BACE,eAAK,SAAS,EAAC,kBAAkB,aAC/B,0BACE,cAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B,YAChF,aAAG,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,SAAS,aAC/B,eACE,CAAC,EAAC,mFAAmF,EACrF,IAAI,EAAC,MAAM,GACX,EACF,eACE,CAAC,EAAC,kEAAkE,EACpE,IAAI,EAAC,SAAS,GACd,EACF,eACE,CAAC,EAAC,gEAAgE,EAClE,IAAI,EAAC,SAAS,GACd,IACA,GACA,EACN,gCAAa,IACT,EACN,wBACG,IAAI,CAAC,CAAC,CAAC,CACN,8BACE,gBAAM,SAAS,EAAC,SAAS,0BACd,sBAAI,IAAI,CAAC,IAAI,GAAK,SACtB,EACP,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAC,SAAS,GAAG,IACzD,CACJ,CAAC,CAAC,CAAC,CACF,8BACE,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,QAAQ,GAAG,EACxD,KAAC,MAAM,IAAC,OAAO,QAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAC,SAAS,GAAG,IACxE,CACJ,GACG,IACF,GACC,CACV,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { StoryObj } from '@storybook/nextjs-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ user, onLogin, onLogout, onCreateAccount }: import("./Header").HeaderProps) => import("react/jsx-runtime").JSX.Element;
5
+ tags: string[];
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ args: {
10
+ onLogin: import("@vitest/spy").Mock<(...args: any[]) => any>;
11
+ onLogout: import("@vitest/spy").Mock<(...args: any[]) => any>;
12
+ onCreateAccount: import("@vitest/spy").Mock<(...args: any[]) => any>;
13
+ };
14
+ };
15
+ export default meta;
16
+ type Story = StoryObj<typeof meta>;
17
+ export declare const LoggedIn: Story;
18
+ export declare const LoggedOut: Story;
19
+ //# sourceMappingURL=Header.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Header.stories.d.ts","sourceRoot":"","sources":["../../src/stories/Header.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAM7D,QAAA,MAAM,IAAI;;;;;;;;;;;;CAcqB,CAAC;AAEhC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAAU,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { fn } from 'storybook/test';
2
+ import { Header } from './Header';
3
+ const meta = {
4
+ title: 'Example/Header',
5
+ component: Header,
6
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
7
+ tags: ['autodocs'],
8
+ parameters: {
9
+ // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
10
+ layout: 'fullscreen',
11
+ },
12
+ args: {
13
+ onLogin: fn(),
14
+ onLogout: fn(),
15
+ onCreateAccount: fn(),
16
+ },
17
+ };
18
+ export default meta;
19
+ export const LoggedIn = {
20
+ args: {
21
+ user: {
22
+ name: 'Jane Doe',
23
+ },
24
+ },
25
+ };
26
+ export const LoggedOut = {};
27
+ //# sourceMappingURL=Header.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Header.stories.js","sourceRoot":"","sources":["../../src/stories/Header.stories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,MAAM;IACjB,0HAA0H;IAC1H,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,2FAA2F;QAC3F,MAAM,EAAE,YAAY;KACrB;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,EAAE,EAAE;QACb,QAAQ,EAAE,EAAE,EAAE;QACd,eAAe,EAAE,EAAE,EAAE;KACtB;CAC4B,CAAC;AAEhC,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;SACjB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './page.css';
3
+ export declare const Page: React.FC;
4
+ //# sourceMappingURL=Page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../src/stories/Page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,YAAY,CAAC;AAMpB,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EA+DxB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { Header } from './Header';
4
+ import './page.css';
5
+ export const Page = () => {
6
+ const [user, setUser] = React.useState();
7
+ return (_jsxs("article", { children: [_jsx(Header, { user: user, onLogin: () => setUser({ name: 'Jane Doe' }), onLogout: () => setUser(undefined), onCreateAccount: () => setUser({ name: 'Jane Doe' }) }), _jsxs("section", { className: "storybook-page", children: [_jsx("h2", { children: "Pages in Storybook" }), _jsxs("p", { children: ["We recommend building UIs with a", ' ', _jsx("a", { href: "https://componentdriven.org", target: "_blank", rel: "noopener noreferrer", children: _jsx("strong", { children: "component-driven" }) }), ' ', "process starting with atomic components and ending with pages."] }), _jsx("p", { children: "Render pages with mock data. This makes it easy to build and review page states without needing to navigate to them in your app. Here are some handy patterns for managing page data in Storybook:" }), _jsxs("ul", { children: [_jsx("li", { children: "Use a higher-level connected component. Storybook helps you compose such data from the \"args\" of child component stories" }), _jsx("li", { children: "Assemble data in the page component from your services. You can mock these services out using Storybook." })] }), _jsxs("p", { children: ["Get a guided tutorial on component-driven development at", ' ', _jsx("a", { href: "https://storybook.js.org/tutorials/", target: "_blank", rel: "noopener noreferrer", children: "Storybook tutorials" }), ". Read more in the", ' ', _jsx("a", { href: "https://storybook.js.org/docs", target: "_blank", rel: "noopener noreferrer", children: "docs" }), "."] }), _jsxs("div", { className: "tip-wrapper", children: [_jsx("span", { className: "tip", children: "Tip" }), " Adjust the width of the canvas with the", ' ', _jsx("svg", { width: "10", height: "10", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg", children: _jsx("g", { fill: "none", fillRule: "evenodd", children: _jsx("path", { d: "M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z", id: "a", fill: "#999" }) }) }), "Viewports addon in the toolbar"] })] })] }));
8
+ };
9
+ //# sourceMappingURL=Page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../src/stories/Page.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,YAAY,CAAC;AAMpB,MAAM,CAAC,MAAM,IAAI,GAAa,GAAG,EAAE;IACjC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAQ,CAAC;IAE/C,OAAO,CACL,8BACE,KAAC,MAAM,IACL,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAC5C,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,EAClC,eAAe,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,GACpD,EAEF,mBAAS,SAAS,EAAC,gBAAgB,aACjC,8CAA2B,EAC3B,4DACmC,GAAG,EACpC,YAAG,IAAI,EAAC,6BAA6B,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,YAC7E,gDAAiC,GAC/B,EAAC,GAAG,sEAEN,EACJ,6NAII,EACJ,yBACE,sJAGK,EACL,oIAGK,IACF,EACL,oFAC2D,GAAG,EAC5D,YAAG,IAAI,EAAC,qCAAqC,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,oCAEnF,wBACe,GAAG,EACtB,YAAG,IAAI,EAAC,+BAA+B,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,qBAE7E,SAEF,EACJ,eAAK,SAAS,EAAC,aAAa,aAC1B,eAAM,SAAS,EAAC,KAAK,oBAAW,8CAAyC,GAAG,EAC5E,cAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B,YAChF,YAAG,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAC,SAAS,YAC/B,eACE,CAAC,EAAC,sOAAsO,EACxO,EAAE,EAAC,GAAG,EACN,IAAI,EAAC,MAAM,GACX,GACA,GACA,sCAEF,IACE,IACF,CACX,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { StoryObj } from '@storybook/nextjs-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: import("react").FC<{}>;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ };
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ export declare const LoggedOut: Story;
12
+ export declare const LoggedIn: Story;
13
+ //# sourceMappingURL=Page.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Page.stories.d.ts","sourceRoot":"","sources":["../../src/stories/Page.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAM7D,QAAA,MAAM,IAAI;;;;;;CAOmB,CAAC;AAE9B,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,SAAS,EAAE,KAAU,CAAC;AAGnC,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { expect, userEvent, within } from 'storybook/test';
2
+ import { Page } from './Page';
3
+ const meta = {
4
+ title: 'Example/Page',
5
+ component: Page,
6
+ parameters: {
7
+ // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
8
+ layout: 'fullscreen',
9
+ },
10
+ };
11
+ export default meta;
12
+ export const LoggedOut = {};
13
+ // More on component testing: https://storybook.js.org/docs/writing-tests/interaction-testing
14
+ export const LoggedIn = {
15
+ play: async ({ canvasElement }) => {
16
+ const canvas = within(canvasElement);
17
+ const loginButton = canvas.getByRole('button', { name: /Log in/i });
18
+ await expect(loginButton).toBeInTheDocument();
19
+ await userEvent.click(loginButton);
20
+ await expect(loginButton).not.toBeInTheDocument();
21
+ const logoutButton = canvas.getByRole('button', { name: /Log out/i });
22
+ await expect(logoutButton).toBeInTheDocument();
23
+ },
24
+ };
25
+ //# sourceMappingURL=Page.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Page.stories.js","sourceRoot":"","sources":["../../src/stories/Page.stories.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV,2FAA2F;QAC3F,MAAM,EAAE,YAAY;KACrB;CAC0B,CAAC;AAE9B,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,SAAS,GAAU,EAAE,CAAC;AAEnC,6FAA6F;AAC7F,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE;QAChC,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;QACrC,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;QACpE,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAC9C,MAAM,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACnC,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;QAElD,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QACtE,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACjD,CAAC;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vin.samdy.dev/passappui",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Shared UI components library",
5
5
  "private": false,
6
6
  "type": "module",
@@ -44,7 +44,8 @@
44
44
  "@types/react": "^19.0.0",
45
45
  "@types/react-dom": "^19.0.0",
46
46
  "storybook": "^10.2.9",
47
- "typescript": "^5.3.0"
47
+ "typescript": "^5.3.0",
48
+ "vite": "^7.3.1"
48
49
  },
49
50
  "publishConfig": {
50
51
  "access": "public"
@@ -0,0 +1,24 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { XButton } from "./Xbutton";
3
+
4
+ const meta: Meta<typeof XButton> = {
5
+ component: XButton,
6
+ decorators: [
7
+ (Story) => (
8
+ <div style={{ padding: '1rem' }}>
9
+ <Story />
10
+ </div>
11
+ ),
12
+ ],
13
+ };
14
+
15
+ export default meta;
16
+ type Story = StoryObj<typeof XButton>;
17
+
18
+ export const Default: Story = {
19
+ args: {
20
+ label: 'Click Me',
21
+ backgroundColor: '#007BFF',
22
+ color: '#FFFFFF',
23
+ },
24
+ };
@@ -0,0 +1,22 @@
1
+ type XButtonProps = Readonly<{
2
+ label: string;
3
+ backgroundColor: string;
4
+ color: string;
5
+ }>;
6
+
7
+ export function XButton({ label, backgroundColor, color }: XButtonProps) {
8
+ return (
9
+ <button
10
+ style={{
11
+ backgroundColor,
12
+ color,
13
+ padding: "0.5rem 1rem",
14
+ border: "none",
15
+ borderRadius: "4px",
16
+ cursor: "pointer",
17
+ }}
18
+ >
19
+ {label}
20
+ </button>
21
+ );
22
+ }
@@ -0,0 +1 @@
1
+ export * from "./Xbutton";
@@ -1,3 +1,4 @@
1
1
  export * from './footer';
2
2
  export * from './header';
3
- export * from './sidebar';
3
+ export * from './sidebar';
4
+ export * from './Xbutton';
@@ -1 +1,2 @@
1
- export * from './useLocalStorage';
1
+ export * from './useLocalStorage';
2
+ export * from './usePersistStorage';
@@ -0,0 +1,6 @@
1
+ export const usePersistStorage = () => {
2
+ const isClient = typeof window !== 'undefined'
3
+ const storage = isClient ? window.localStorage : null
4
+
5
+ return storage
6
+ }