tharaday 0.4.0 → 0.5.1

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 (69) hide show
  1. package/dist/components/Badge/Badge.types.d.ts +1 -0
  2. package/dist/components/Box/Box.d.ts +1 -1
  3. package/dist/components/Box/Box.stories.d.ts +11 -1
  4. package/dist/components/Box/Box.types.d.ts +1 -0
  5. package/dist/components/Card/Card.types.d.ts +1 -0
  6. package/dist/components/Checkbox/Checkbox.types.d.ts +1 -0
  7. package/dist/components/Header/Header.d.ts +1 -1
  8. package/dist/components/Header/Header.stories.d.ts +1 -1
  9. package/dist/components/Header/Header.types.d.ts +2 -0
  10. package/dist/components/Input/Input.types.d.ts +1 -0
  11. package/dist/components/NavBar/NavBar.d.ts +1 -1
  12. package/dist/components/NavBar/NavBar.types.d.ts +4 -0
  13. package/dist/components/Notification/Notification.types.d.ts +1 -0
  14. package/dist/components/RadioButton/RadioButton.types.d.ts +1 -0
  15. package/dist/components/Select/Select.types.d.ts +1 -0
  16. package/dist/components/Skeleton/Skeleton.types.d.ts +1 -0
  17. package/dist/components/Stepper/Step.d.ts +1 -1
  18. package/dist/components/Stepper/Step.types.d.ts +1 -0
  19. package/dist/components/Stepper/Stepper.types.d.ts +1 -0
  20. package/dist/components/Switch/Switch.types.d.ts +1 -0
  21. package/dist/components/Table/Table.types.d.ts +1 -0
  22. package/dist/components/Text/Text.types.d.ts +2 -0
  23. package/dist/components/Textarea/Textarea.types.d.ts +1 -0
  24. package/dist/ds.js +872 -853
  25. package/dist/ds.umd.cjs +1 -1
  26. package/dist/layouts/AppLayout/AppLayout.d.ts +1 -1
  27. package/dist/layouts/AppLayout/AppLayout.stories.d.ts +4 -1
  28. package/dist/layouts/AppLayout/AppLayout.types.d.ts +8 -0
  29. package/dist/layouts/AuthLayout/AuthLayout.d.ts +1 -1
  30. package/dist/layouts/AuthLayout/AuthLayout.stories.d.ts +1 -1
  31. package/dist/layouts/AuthLayout/AuthLayout.types.d.ts +1 -0
  32. package/dist/layouts/DashboardLayout/DashboardLayout.d.ts +1 -1
  33. package/dist/layouts/DashboardLayout/DashboardLayout.stories.d.ts +1 -1
  34. package/dist/layouts/DashboardLayout/DashboardLayout.types.d.ts +2 -0
  35. package/dist/layouts/SettingsLayout/SettingsLayout.d.ts +1 -1
  36. package/dist/layouts/SettingsLayout/SettingsLayout.stories.d.ts +1 -1
  37. package/dist/layouts/SettingsLayout/SettingsLayout.types.d.ts +2 -0
  38. package/package.json +1 -1
  39. package/src/components/Badge/Badge.types.ts +1 -0
  40. package/src/components/Box/Box.stories.tsx +20 -0
  41. package/src/components/Box/Box.tsx +2 -0
  42. package/src/components/Box/Box.types.ts +1 -0
  43. package/src/components/Card/Card.types.ts +1 -0
  44. package/src/components/Checkbox/Checkbox.types.ts +1 -0
  45. package/src/components/Header/Header.tsx +6 -2
  46. package/src/components/Header/Header.types.ts +2 -0
  47. package/src/components/Input/Input.types.ts +1 -0
  48. package/src/components/NavBar/NavBar.tsx +2 -1
  49. package/src/components/NavBar/NavBar.types.ts +4 -0
  50. package/src/components/Notification/Notification.types.ts +1 -0
  51. package/src/components/RadioButton/RadioButton.types.ts +1 -0
  52. package/src/components/Select/Select.types.ts +1 -0
  53. package/src/components/Skeleton/Skeleton.types.ts +1 -0
  54. package/src/components/Stepper/Step.tsx +2 -1
  55. package/src/components/Stepper/Step.types.ts +1 -0
  56. package/src/components/Stepper/Stepper.types.ts +1 -0
  57. package/src/components/Switch/Switch.types.ts +1 -0
  58. package/src/components/Table/Table.types.ts +1 -0
  59. package/src/components/Text/Text.types.ts +2 -0
  60. package/src/components/Textarea/Textarea.types.ts +1 -0
  61. package/src/layouts/AppLayout/AppLayout.stories.tsx +53 -0
  62. package/src/layouts/AppLayout/AppLayout.tsx +36 -16
  63. package/src/layouts/AppLayout/AppLayout.types.ts +8 -0
  64. package/src/layouts/AuthLayout/AuthLayout.tsx +4 -2
  65. package/src/layouts/AuthLayout/AuthLayout.types.tsx +1 -0
  66. package/src/layouts/DashboardLayout/DashboardLayout.tsx +7 -2
  67. package/src/layouts/DashboardLayout/DashboardLayout.types.tsx +2 -0
  68. package/src/layouts/SettingsLayout/SettingsLayout.tsx +7 -2
  69. package/src/layouts/SettingsLayout/SettingsLayout.types.tsx +2 -0
@@ -1,6 +1,7 @@
1
1
  import type { InputHTMLAttributes } from 'react';
2
2
 
3
3
  export interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
4
+ className?: string;
4
5
  label?: string;
5
6
  helperText?: string;
6
7
  }
@@ -6,6 +6,7 @@ import type {
6
6
  } from 'react';
7
7
 
8
8
  export interface TableProps extends TableHTMLAttributes<HTMLTableElement> {
9
+ className?: string;
9
10
  striped?: boolean;
10
11
  hoverable?: boolean;
11
12
  dense?: boolean;
@@ -26,6 +26,8 @@ export type TextColor =
26
26
  | 'info';
27
27
 
28
28
  export interface TextProps extends HTMLAttributes<HTMLElement> {
29
+ /** Additional class name */
30
+ className?: string;
29
31
  /** The content to display */
30
32
  children: ReactNode;
31
33
  /** The typographic style to apply */
@@ -3,6 +3,7 @@ import type { TextareaHTMLAttributes } from 'react';
3
3
  export type TextareaSize = 'sm' | 'md' | 'lg';
4
4
 
5
5
  export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
6
+ className?: string;
6
7
  size?: TextareaSize;
7
8
  error?: boolean;
8
9
  label?: string;
@@ -122,3 +122,56 @@ export const LoggedOut: Story = {
122
122
  activeNavId: 'home',
123
123
  },
124
124
  };
125
+
126
+ export const HeaderOnly: Story = {
127
+ args: {
128
+ headerTitle: 'Header Only',
129
+ headerLogo: logo,
130
+ user: { name: 'John Doe' },
131
+ navItems: [],
132
+ children: (
133
+ <Box padding={8} textAlign="center">
134
+ <Text variant="h2">Layout with Header only</Text>
135
+ <Text variant="body-md">NavBar is hidden because navItems is empty.</Text>
136
+ </Box>
137
+ ),
138
+ },
139
+ };
140
+
141
+ export const NavBarOnly: Story = {
142
+ args: {
143
+ headerTitle: '',
144
+ headerLogo: undefined,
145
+ user: undefined,
146
+ onLogin: undefined,
147
+ onLogout: undefined,
148
+ onCreateAccount: undefined,
149
+ navItems,
150
+ children: (
151
+ <Box padding={8} textAlign="center">
152
+ <Text variant="h2">Layout with NavBar only</Text>
153
+ <Text variant="body-md">
154
+ Header is hidden because no branding or user props are provided.
155
+ </Text>
156
+ </Box>
157
+ ),
158
+ },
159
+ };
160
+
161
+ export const ContentOnly: Story = {
162
+ args: {
163
+ headerTitle: '',
164
+ headerLogo: undefined,
165
+ user: undefined,
166
+ onLogin: undefined,
167
+ onLogout: undefined,
168
+ onCreateAccount: undefined,
169
+ navItems: [],
170
+ children: (
171
+ <Box padding={8} textAlign="center" border backgroundColor="subtle">
172
+ <Text variant="h2">Layout with Content only</Text>
173
+ <Text variant="body-md">Both Header and NavBar are hidden.</Text>
174
+ </Box>
175
+ ),
176
+ },
177
+ };
@@ -1,3 +1,5 @@
1
+ import clsx from 'clsx';
2
+
1
3
  import styles from './AppLayout.module.css';
2
4
  import type { AppLayoutProps } from './AppLayout.types.ts';
3
5
  import { Header } from '../../components/Header/Header.tsx';
@@ -11,7 +13,7 @@ import { NavBar } from '../../components/NavBar/NavBar.tsx';
11
13
  */
12
14
  export const AppLayout = ({
13
15
  headerLogo,
14
- headerTitle = 'Tharaday',
16
+ headerTitle,
15
17
  user,
16
18
  navItems,
17
19
  activeNavId,
@@ -21,23 +23,41 @@ export const AppLayout = ({
21
23
  onLogout,
22
24
  onCreateAccount,
23
25
  onNavItemClick,
26
+ className,
27
+ maxWidth,
24
28
  }: AppLayoutProps) => {
29
+ const showHeader = !!(
30
+ headerLogo ||
31
+ headerTitle ||
32
+ user ||
33
+ onLogin ||
34
+ onLogout ||
35
+ onCreateAccount
36
+ );
37
+ const showNavBar = !!(navItems?.length || navActions);
38
+
25
39
  return (
26
- <div className={styles.root}>
27
- <Header
28
- logo={headerLogo}
29
- title={headerTitle}
30
- user={user}
31
- onLogin={onLogin}
32
- onLogout={onLogout}
33
- onCreateAccount={onCreateAccount}
34
- />
35
- <NavBar
36
- items={navItems}
37
- activeId={activeNavId}
38
- actions={navActions}
39
- onItemClick={onNavItemClick}
40
- />
40
+ <div className={clsx(styles.root, className)}>
41
+ {showHeader && (
42
+ <Header
43
+ logo={headerLogo}
44
+ title={headerTitle}
45
+ user={user}
46
+ onLogin={onLogin}
47
+ onLogout={onLogout}
48
+ onCreateAccount={onCreateAccount}
49
+ maxWidth={maxWidth}
50
+ />
51
+ )}
52
+ {showNavBar && (
53
+ <NavBar
54
+ items={navItems}
55
+ activeId={activeNavId}
56
+ actions={navActions}
57
+ onItemClick={onNavItemClick}
58
+ maxWidth={maxWidth}
59
+ />
60
+ )}
41
61
  <main className={styles.main}>
42
62
  <div className={styles.container}>{children}</div>
43
63
  </main>
@@ -3,6 +3,14 @@ import type { ReactNode } from 'react';
3
3
  import type { NavBarItem } from '../../components/NavBar/NavBar.types.ts';
4
4
 
5
5
  export interface AppLayoutProps {
6
+ /**
7
+ * Additional class name for the layout root
8
+ */
9
+ className?: string;
10
+ /**
11
+ * Max width for header and navbar containers
12
+ */
13
+ maxWidth?: string | number;
6
14
  /**
7
15
  * Header logo element
8
16
  */
@@ -1,11 +1,13 @@
1
+ import clsx from 'clsx';
2
+
1
3
  import styles from './AuthLayout.module.css';
2
4
  import type { AuthLayoutProps } from './AuthLayout.types.tsx';
3
5
  import { Box } from '../../components/Box/Box.tsx';
4
6
  import { Text } from '../../components/Text/Text.tsx';
5
7
 
6
- export const AuthLayout = ({ logo, title, description, children }: AuthLayoutProps) => {
8
+ export const AuthLayout = ({ logo, title, description, children, className }: AuthLayoutProps) => {
7
9
  return (
8
- <Box className={styles.root}>
10
+ <Box className={clsx(styles.root, className)}>
9
11
  <Box className={styles.card}>
10
12
  <Box className={styles.header}>
11
13
  {logo && <Box className={styles.logo}>{logo}</Box>}
@@ -1,6 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
 
3
3
  export interface AuthLayoutProps {
4
+ className?: string;
4
5
  logo?: ReactNode;
5
6
  title?: string;
6
7
  description?: string;
@@ -1,10 +1,12 @@
1
+ import clsx from 'clsx';
2
+
1
3
  import styles from './DashboardLayout.module.css';
2
4
  import type { DashboardLayoutProps } from './DashboardLayout.types.tsx';
3
5
  import { Header } from '../../components/Header/Header.tsx';
4
6
 
5
7
  export const DashboardLayout = ({
6
8
  headerLogo,
7
- headerTitle = 'Tharaday',
9
+ headerTitle,
8
10
  breadcrumbs,
9
11
  actions,
10
12
  stats,
@@ -13,9 +15,11 @@ export const DashboardLayout = ({
13
15
  onLogin,
14
16
  onLogout,
15
17
  onCreateAccount,
18
+ className,
19
+ maxWidth,
16
20
  }: DashboardLayoutProps) => {
17
21
  return (
18
- <div className={styles.root}>
22
+ <div className={clsx(styles.root, className)}>
19
23
  <Header
20
24
  logo={headerLogo}
21
25
  title={headerTitle}
@@ -23,6 +27,7 @@ export const DashboardLayout = ({
23
27
  onLogin={onLogin}
24
28
  onLogout={onLogout}
25
29
  onCreateAccount={onCreateAccount}
30
+ maxWidth={maxWidth}
26
31
  />
27
32
  <main className={styles.main}>
28
33
  <div className={styles.container}>
@@ -1,6 +1,8 @@
1
1
  import type { ReactNode } from 'react';
2
2
 
3
3
  export interface DashboardLayoutProps {
4
+ className?: string;
5
+ maxWidth?: string | number;
4
6
  headerLogo?: ReactNode;
5
7
  headerTitle?: string;
6
8
  breadcrumbs?: ReactNode;
@@ -1,10 +1,12 @@
1
+ import clsx from 'clsx';
2
+
1
3
  import styles from './SettingsLayout.module.css';
2
4
  import type { SettingsLayoutProps } from './SettingsLayout.types.tsx';
3
5
  import { Header } from '../../components/Header/Header.tsx';
4
6
 
5
7
  export const SettingsLayout = ({
6
8
  headerLogo,
7
- headerTitle = 'Tharaday',
9
+ headerTitle,
8
10
  breadcrumbs,
9
11
  sidebar,
10
12
  children,
@@ -12,9 +14,11 @@ export const SettingsLayout = ({
12
14
  onLogin,
13
15
  onLogout,
14
16
  onCreateAccount,
17
+ className,
18
+ maxWidth,
15
19
  }: SettingsLayoutProps) => {
16
20
  return (
17
- <div className={styles.root}>
21
+ <div className={clsx(styles.root, className)}>
18
22
  <Header
19
23
  logo={headerLogo}
20
24
  title={headerTitle}
@@ -22,6 +26,7 @@ export const SettingsLayout = ({
22
26
  onLogin={onLogin}
23
27
  onLogout={onLogout}
24
28
  onCreateAccount={onCreateAccount}
29
+ maxWidth={maxWidth}
25
30
  />
26
31
  <main className={styles.main}>
27
32
  <div className={styles.container}>
@@ -1,6 +1,8 @@
1
1
  import type { ReactNode } from 'react';
2
2
 
3
3
  export interface SettingsLayoutProps {
4
+ className?: string;
5
+ maxWidth?: string | number;
4
6
  headerLogo?: ReactNode;
5
7
  headerTitle?: string;
6
8
  breadcrumbs?: ReactNode;