tharaday 0.3.2 → 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.
Files changed (78) hide show
  1. package/dist/components/Badge/Badge.types.d.ts +1 -0
  2. package/dist/components/Card/Card.types.d.ts +1 -0
  3. package/dist/components/Checkbox/Checkbox.types.d.ts +1 -0
  4. package/dist/components/Header/Header.d.ts +1 -1
  5. package/dist/components/Header/Header.stories.d.ts +1 -1
  6. package/dist/components/Header/Header.types.d.ts +2 -0
  7. package/dist/components/Input/Input.d.ts +1 -1
  8. package/dist/components/Input/Input.stories.d.ts +4 -1
  9. package/dist/components/Input/Input.types.d.ts +2 -0
  10. package/dist/components/NavBar/NavBar.d.ts +1 -1
  11. package/dist/components/NavBar/NavBar.types.d.ts +4 -0
  12. package/dist/components/Notification/Notification.types.d.ts +1 -0
  13. package/dist/components/RadioButton/RadioButton.types.d.ts +1 -0
  14. package/dist/components/Select/Select.d.ts +1 -1
  15. package/dist/components/Select/Select.stories.d.ts +4 -1
  16. package/dist/components/Select/Select.types.d.ts +2 -0
  17. package/dist/components/Skeleton/Skeleton.types.d.ts +1 -0
  18. package/dist/components/Stepper/Step.d.ts +1 -1
  19. package/dist/components/Stepper/Step.types.d.ts +1 -0
  20. package/dist/components/Stepper/Stepper.types.d.ts +1 -0
  21. package/dist/components/Switch/Switch.types.d.ts +1 -0
  22. package/dist/components/Table/Table.types.d.ts +1 -0
  23. package/dist/components/Text/Text.types.d.ts +2 -0
  24. package/dist/components/Textarea/Textarea.d.ts +1 -1
  25. package/dist/components/Textarea/Textarea.stories.d.ts +4 -1
  26. package/dist/components/Textarea/Textarea.types.d.ts +2 -0
  27. package/dist/ds.css +1 -1
  28. package/dist/ds.js +797 -777
  29. package/dist/ds.umd.cjs +1 -1
  30. package/dist/layouts/AppLayout/AppLayout.d.ts +1 -1
  31. package/dist/layouts/AppLayout/AppLayout.stories.d.ts +1 -1
  32. package/dist/layouts/AppLayout/AppLayout.types.d.ts +8 -0
  33. package/dist/layouts/AuthLayout/AuthLayout.d.ts +1 -1
  34. package/dist/layouts/AuthLayout/AuthLayout.stories.d.ts +1 -1
  35. package/dist/layouts/AuthLayout/AuthLayout.types.d.ts +1 -0
  36. package/dist/layouts/DashboardLayout/DashboardLayout.d.ts +1 -1
  37. package/dist/layouts/DashboardLayout/DashboardLayout.stories.d.ts +1 -1
  38. package/dist/layouts/DashboardLayout/DashboardLayout.types.d.ts +2 -0
  39. package/dist/layouts/SettingsLayout/SettingsLayout.d.ts +1 -1
  40. package/dist/layouts/SettingsLayout/SettingsLayout.stories.d.ts +1 -1
  41. package/dist/layouts/SettingsLayout/SettingsLayout.types.d.ts +2 -0
  42. package/package.json +1 -1
  43. package/src/components/Badge/Badge.types.ts +1 -0
  44. package/src/components/Card/Card.types.ts +1 -0
  45. package/src/components/Checkbox/Checkbox.types.ts +1 -0
  46. package/src/components/Header/Header.tsx +6 -2
  47. package/src/components/Header/Header.types.ts +2 -0
  48. package/src/components/Input/Input.module.css +11 -2
  49. package/src/components/Input/Input.stories.tsx +3 -0
  50. package/src/components/Input/Input.tsx +2 -1
  51. package/src/components/Input/Input.types.ts +2 -0
  52. package/src/components/NavBar/NavBar.tsx +2 -1
  53. package/src/components/NavBar/NavBar.types.ts +4 -0
  54. package/src/components/Notification/Notification.types.ts +1 -0
  55. package/src/components/RadioButton/RadioButton.types.ts +1 -0
  56. package/src/components/Select/Select.module.css +11 -2
  57. package/src/components/Select/Select.stories.tsx +3 -0
  58. package/src/components/Select/Select.tsx +2 -1
  59. package/src/components/Select/Select.types.ts +2 -0
  60. package/src/components/Skeleton/Skeleton.types.ts +1 -0
  61. package/src/components/Stepper/Step.tsx +2 -1
  62. package/src/components/Stepper/Step.types.ts +1 -0
  63. package/src/components/Stepper/Stepper.types.ts +1 -0
  64. package/src/components/Switch/Switch.types.ts +1 -0
  65. package/src/components/Table/Table.types.ts +1 -0
  66. package/src/components/Text/Text.types.ts +2 -0
  67. package/src/components/Textarea/Textarea.module.css +11 -2
  68. package/src/components/Textarea/Textarea.stories.tsx +3 -0
  69. package/src/components/Textarea/Textarea.tsx +2 -1
  70. package/src/components/Textarea/Textarea.types.ts +2 -0
  71. package/src/layouts/AppLayout/AppLayout.tsx +8 -2
  72. package/src/layouts/AppLayout/AppLayout.types.ts +8 -0
  73. package/src/layouts/AuthLayout/AuthLayout.tsx +4 -2
  74. package/src/layouts/AuthLayout/AuthLayout.types.tsx +1 -0
  75. package/src/layouts/DashboardLayout/DashboardLayout.tsx +7 -2
  76. package/src/layouts/DashboardLayout/DashboardLayout.types.tsx +2 -0
  77. package/src/layouts/SettingsLayout/SettingsLayout.tsx +7 -2
  78. package/src/layouts/SettingsLayout/SettingsLayout.types.tsx +2 -0
@@ -9,10 +9,12 @@ export interface SelectOption {
9
9
  }
10
10
 
11
11
  export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
12
+ className?: string;
12
13
  size?: SelectSize;
13
14
  error?: boolean;
14
15
  label?: string;
15
16
  helperText?: string;
16
17
  options?: SelectOption[];
17
18
  children?: ReactNode;
19
+ fullWidth?: boolean;
18
20
  }
@@ -3,6 +3,7 @@ import type { HTMLAttributes } from 'react';
3
3
  export type SkeletonVariant = 'text' | 'circular' | 'rectangular' | 'rounded';
4
4
 
5
5
  export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
6
+ className?: string;
6
7
  variant?: SkeletonVariant;
7
8
  width?: string | number;
8
9
  height?: string | number;
@@ -12,6 +12,7 @@ export const Step = ({
12
12
  onStepClick,
13
13
  isLast,
14
14
  id,
15
+ className,
15
16
  }: StepProps) => {
16
17
  const isDisabled = Boolean(step.disabled);
17
18
  const StepContent: ElementType = isInteractive ? 'button' : 'div';
@@ -31,7 +32,7 @@ export const Step = ({
31
32
  };
32
33
 
33
34
  return (
34
- <li className={clsx(styles.step, styles[status], isDisabled && styles.disabled)}>
35
+ <li className={clsx(styles.step, styles[status], isDisabled && styles.disabled, className)}>
35
36
  <StepContent
36
37
  id={id}
37
38
  type={isInteractive ? 'button' : undefined}
@@ -9,6 +9,7 @@ export interface StepOptions {
9
9
  }
10
10
 
11
11
  export interface StepProps {
12
+ className?: string;
12
13
  step: StepOptions;
13
14
  index: number;
14
15
  status: StepperStatus;
@@ -6,6 +6,7 @@ export type StepperOrientation = 'horizontal' | 'vertical';
6
6
  export type StepperSize = 'sm' | 'md' | 'lg';
7
7
 
8
8
  export interface StepperProps extends HTMLAttributes<HTMLOListElement> {
9
+ className?: string;
9
10
  steps: StepOptions[];
10
11
  currentStep?: number | string;
11
12
  orientation?: StepperOrientation;
@@ -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 */
@@ -1,8 +1,13 @@
1
1
  .wrapper {
2
- display: flex;
2
+ display: inline-flex;
3
3
  flex-direction: column;
4
4
  gap: var(--ds-space-1);
5
+ width: fit-content;
6
+ }
7
+
8
+ .fullWidth {
5
9
  width: 100%;
10
+ display: flex;
6
11
  }
7
12
 
8
13
  .label {
@@ -14,7 +19,7 @@
14
19
 
15
20
  .textareaRoot {
16
21
  box-sizing: border-box;
17
- width: 100%;
22
+ width: auto;
18
23
  font-family: var(--ds-font-family-base);
19
24
  border: 1px solid var(--ds-border-1);
20
25
  border-radius: var(--ds-radius-md);
@@ -27,6 +32,10 @@
27
32
  resize: vertical;
28
33
  }
29
34
 
35
+ .fullWidth .textareaRoot {
36
+ width: 100%;
37
+ }
38
+
30
39
  .textareaRoot:focus {
31
40
  outline: none;
32
41
  border-color: var(--ds-ring);
@@ -21,6 +21,9 @@ const meta = {
21
21
  disabled: {
22
22
  control: 'boolean',
23
23
  },
24
+ fullWidth: {
25
+ control: 'boolean',
26
+ },
24
27
  },
25
28
  } satisfies Meta<typeof Textarea>;
26
29
 
@@ -9,6 +9,7 @@ export const Textarea = ({
9
9
  error,
10
10
  label,
11
11
  helperText,
12
+ fullWidth = false,
12
13
  className,
13
14
  id,
14
15
  rows = 4,
@@ -19,7 +20,7 @@ export const Textarea = ({
19
20
  const helperId = helperText ? `${componentId}-help` : undefined;
20
21
 
21
22
  return (
22
- <div className={clsx(styles.wrapper, className)}>
23
+ <div className={clsx(styles.wrapper, fullWidth && styles.fullWidth, className)}>
23
24
  {label && (
24
25
  <label htmlFor={componentId} className={styles.label}>
25
26
  {label}
@@ -3,9 +3,11 @@ 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;
9
10
  helperText?: string;
10
11
  rows?: number;
12
+ fullWidth?: boolean;
11
13
  }
@@ -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,9 +23,11 @@ export const AppLayout = ({
21
23
  onLogout,
22
24
  onCreateAccount,
23
25
  onNavItemClick,
26
+ className,
27
+ maxWidth,
24
28
  }: AppLayoutProps) => {
25
29
  return (
26
- <div className={styles.root}>
30
+ <div className={clsx(styles.root, className)}>
27
31
  <Header
28
32
  logo={headerLogo}
29
33
  title={headerTitle}
@@ -31,12 +35,14 @@ export const AppLayout = ({
31
35
  onLogin={onLogin}
32
36
  onLogout={onLogout}
33
37
  onCreateAccount={onCreateAccount}
38
+ maxWidth={maxWidth}
34
39
  />
35
40
  <NavBar
36
41
  items={navItems}
37
42
  activeId={activeNavId}
38
43
  actions={navActions}
39
44
  onItemClick={onNavItemClick}
45
+ maxWidth={maxWidth}
40
46
  />
41
47
  <main className={styles.main}>
42
48
  <div className={styles.container}>{children}</div>
@@ -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;