@rakeyshgidwani/roger-ui-bank-theme-harvey 0.2.52 → 0.3.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 (125) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/components/ui/button.d.ts +3 -1
  3. package/dist/components/ui/button.d.ts.map +1 -1
  4. package/dist/components/ui/button.esm.js +3 -2
  5. package/dist/components/ui/button.js +3 -2
  6. package/dist/components/ui/layout/container.d.ts +57 -0
  7. package/dist/components/ui/layout/container.d.ts.map +1 -0
  8. package/dist/components/ui/layout/container.esm.js +173 -0
  9. package/dist/components/ui/layout/container.js +173 -0
  10. package/dist/components/ui/layout/index.d.ts +9 -0
  11. package/dist/components/ui/layout/index.d.ts.map +1 -0
  12. package/dist/components/ui/layout/index.esm.js +6 -0
  13. package/dist/components/ui/layout/index.js +6 -0
  14. package/dist/components/ui/layout/responsive-grid.d.ts +93 -0
  15. package/dist/components/ui/layout/responsive-grid.d.ts.map +1 -0
  16. package/dist/components/ui/layout/responsive-grid.esm.js +124 -0
  17. package/dist/components/ui/layout/responsive-grid.js +124 -0
  18. package/dist/components/ui/navigation/index.d.ts +2 -1
  19. package/dist/components/ui/navigation/index.d.ts.map +1 -1
  20. package/dist/components/ui/navigation/index.esm.js +1 -0
  21. package/dist/components/ui/navigation/index.js +1 -0
  22. package/dist/components/ui/navigation/progressive-navigation.d.ts +37 -0
  23. package/dist/components/ui/navigation/progressive-navigation.d.ts.map +1 -0
  24. package/dist/components/ui/navigation/progressive-navigation.esm.js +145 -0
  25. package/dist/components/ui/navigation/progressive-navigation.js +145 -0
  26. package/dist/components/ui/navigation/types.d.ts +21 -0
  27. package/dist/components/ui/navigation/types.d.ts.map +1 -1
  28. package/dist/hooks/use-adaptive-layout.d.ts +2 -1
  29. package/dist/hooks/use-adaptive-layout.d.ts.map +1 -1
  30. package/dist/hooks/use-adaptive-layout.esm.js +13 -8
  31. package/dist/hooks/use-adaptive-layout.js +13 -8
  32. package/dist/hooks/use-device.d.ts +3 -1
  33. package/dist/hooks/use-device.d.ts.map +1 -1
  34. package/dist/hooks/use-device.esm.js +14 -7
  35. package/dist/hooks/use-device.js +14 -7
  36. package/dist/index.d.ts +19 -4
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.esm.js +9 -4
  39. package/dist/index.js +9 -4
  40. package/dist/plugins/css-purge-optimizer.d.ts +25 -0
  41. package/dist/plugins/css-purge-optimizer.d.ts.map +1 -0
  42. package/dist/plugins/css-purge-optimizer.esm.js +414 -0
  43. package/dist/plugins/css-purge-optimizer.js +414 -0
  44. package/dist/plugins/performance-monitor.d.ts +29 -0
  45. package/dist/plugins/performance-monitor.d.ts.map +1 -0
  46. package/dist/plugins/performance-monitor.esm.js +221 -0
  47. package/dist/plugins/performance-monitor.js +221 -0
  48. package/dist/plugins/progressive-css-loader.d.ts +21 -0
  49. package/dist/plugins/progressive-css-loader.d.ts.map +1 -0
  50. package/dist/plugins/progressive-css-loader.esm.js +227 -0
  51. package/dist/plugins/progressive-css-loader.js +227 -0
  52. package/dist/plugins/theme-css-generator.d.ts.map +1 -1
  53. package/dist/plugins/theme-css-generator.esm.js +19 -6
  54. package/dist/plugins/theme-css-generator.js +19 -6
  55. package/dist/styles.css +1025 -110
  56. package/dist/theme.d.ts.map +1 -1
  57. package/dist/theme.esm.js +4 -1
  58. package/dist/theme.js +4 -1
  59. package/dist/themes/phase1-constants.d.ts +23 -0
  60. package/dist/themes/phase1-constants.d.ts.map +1 -0
  61. package/dist/themes/phase1-constants.esm.js +180 -0
  62. package/dist/themes/phase1-constants.js +180 -0
  63. package/dist/themes/themes/default.d.ts.map +1 -1
  64. package/dist/themes/themes/default.esm.js +4 -1
  65. package/dist/themes/themes/default.js +4 -1
  66. package/dist/themes/themes/harvey.d.ts.map +1 -1
  67. package/dist/themes/themes/harvey.esm.js +4 -1
  68. package/dist/themes/themes/harvey.js +4 -1
  69. package/dist/themes/types.d.ts +62 -0
  70. package/dist/themes/types.d.ts.map +1 -1
  71. package/dist/themes/validation.d.ts +17 -0
  72. package/dist/themes/validation.d.ts.map +1 -1
  73. package/dist/themes/validation.esm.js +218 -0
  74. package/dist/themes/validation.js +218 -0
  75. package/dist/types.d.ts +62 -0
  76. package/dist/types.d.ts.map +1 -1
  77. package/dist/utils/progressive-css-injector.d.ts +80 -0
  78. package/dist/utils/progressive-css-injector.d.ts.map +1 -0
  79. package/dist/utils/progressive-css-injector.esm.js +217 -0
  80. package/dist/utils/progressive-css-injector.js +217 -0
  81. package/package.json +1 -1
  82. package/src/components/ui/button.tsx +9 -6
  83. package/src/components/ui/layout/container.tsx +312 -0
  84. package/src/components/ui/layout/index.ts +10 -0
  85. package/src/components/ui/layout/responsive-grid.tsx +286 -0
  86. package/src/components/ui/navigation/index.ts +2 -0
  87. package/src/components/ui/navigation/progressive-navigation.tsx +453 -0
  88. package/src/components/ui/navigation/types.ts +41 -0
  89. package/src/hooks/use-adaptive-layout.ts +13 -9
  90. package/src/hooks/use-device.tsx +17 -10
  91. package/src/index.ts +19 -4
  92. package/src/plugins/css-purge-optimizer.ts +491 -0
  93. package/src/plugins/performance-monitor.ts +292 -0
  94. package/src/plugins/progressive-css-loader.ts +269 -0
  95. package/src/plugins/theme-css-generator.ts +22 -6
  96. package/src/styles/components/base/badge.css +2 -2
  97. package/src/styles/components/base/button.css +238 -35
  98. package/src/styles/components/base/card.css +2 -2
  99. package/src/styles/components/base/checkbox.css +3 -3
  100. package/src/styles/components/base/label.css +3 -3
  101. package/src/styles/components/feedback/skeleton.css +1 -1
  102. package/src/styles/components/feedback/toast.css +1 -1
  103. package/src/styles/components/index.css +3 -0
  104. package/src/styles/components/layout/container.css +466 -0
  105. package/src/styles/components/layout/index.css +5 -0
  106. package/src/styles/components/layout/responsive-grid.css +422 -0
  107. package/src/styles/components/navigation/breadcrumb.css +1 -1
  108. package/src/styles/components/navigation/index.css +1 -0
  109. package/src/styles/components/navigation/menu.css +2 -2
  110. package/src/styles/components/navigation/pagination.css +4 -4
  111. package/src/styles/components/navigation/progressive-navigation.css +633 -0
  112. package/src/styles/components/navigation/sidebar.css +4 -4
  113. package/src/styles/components/navigation/stepper.css +2 -2
  114. package/src/styles/components/navigation/tabs.css +1 -1
  115. package/src/styles/progressive.css +17 -0
  116. package/src/styles/themes/harvey.css +103 -19
  117. package/src/styles/utilities/semantic-input-system.css +7 -13
  118. package/src/theme.ts +5 -1
  119. package/src/themes/phase1-constants.ts +189 -0
  120. package/src/themes/themes/default.ts +5 -1
  121. package/src/themes/themes/harvey.ts +5 -1
  122. package/src/themes/types.ts +77 -1
  123. package/src/themes/validation.ts +249 -0
  124. package/src/types.ts +77 -1
  125. package/src/utils/progressive-css-injector.ts +254 -0
package/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  All notable changes to the harvey theme package will be documented in this file.
4
4
 
5
- ## [0.2.52] - 2025-10-08
5
+ ## [0.3.0] - 2025-10-10
6
6
 
7
7
  ### Added
8
8
  - Initial release of harvey theme package
@@ -1,7 +1,9 @@
1
1
  import * as React from "react";
2
2
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
3
  variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
4
- size?: 'default' | 'sm' | 'lg' | 'icon' | 'mobile';
4
+ size?: 'xs' | 'sm' | 'default' | 'lg' | 'xl' | 'icon' | 'mobile';
5
+ /** Phase 2 Enhancement: Content density support for responsive design */
6
+ density?: 'compact' | 'comfortable' | 'spacious';
5
7
  asChild?: boolean;
6
8
  }
7
9
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAA;IAChF,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAA;IAClD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,MAAM,uFAsBX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAA;IAChF,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAA;IAChE,yEAAyE;IACzE,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,CAAA;IAChD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,MAAM,uFAuBX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -2,14 +2,15 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { Slot } from "@radix-ui/react-slot";
5
- const Button = React.forwardRef(({ className, variant = 'default', size = 'default', asChild = false, ...props }, ref) => {
5
+ const Button = React.forwardRef(({ className, variant = 'default', size = 'default', density, asChild = false, ...props }, ref) => {
6
6
  const Comp = asChild ? Slot : "button";
7
7
  // Build semantic CSS classes using BEM methodology
8
8
  const baseClass = 'button';
9
9
  const variantClass = `button--variant-${variant}`;
10
10
  const sizeClass = `button--size-${size}`;
11
+ const densityClass = density ? `button--density-${density}` : null;
11
12
  // Combine classes
12
- const buttonClasses = [baseClass, variantClass, sizeClass, className]
13
+ const buttonClasses = [baseClass, variantClass, sizeClass, densityClass, className]
13
14
  .filter(Boolean)
14
15
  .join(' ');
15
16
  return (_jsx(Comp, { className: buttonClasses, ref: ref, ...props }));
@@ -2,14 +2,15 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { Slot } from "@radix-ui/react-slot";
5
- const Button = React.forwardRef(({ className, variant = 'default', size = 'default', asChild = false, ...props }, ref) => {
5
+ const Button = React.forwardRef(({ className, variant = 'default', size = 'default', density, asChild = false, ...props }, ref) => {
6
6
  const Comp = asChild ? Slot : "button";
7
7
  // Build semantic CSS classes using BEM methodology
8
8
  const baseClass = 'button';
9
9
  const variantClass = `button--variant-${variant}`;
10
10
  const sizeClass = `button--size-${size}`;
11
+ const densityClass = density ? `button--density-${density}` : null;
11
12
  // Combine classes
12
- const buttonClasses = [baseClass, variantClass, sizeClass, className]
13
+ const buttonClasses = [baseClass, variantClass, sizeClass, densityClass, className]
13
14
  .filter(Boolean)
14
15
  .join(' ');
15
16
  return (_jsx(Comp, { className: buttonClasses, ref: ref, ...props }));
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Container Component
3
+ * Implements Phase 2 container max-widths and content width system
4
+ *
5
+ * Container Max-Widths:
6
+ * - xs: 100%, sm: 640px, md: 768px, lg: 1024px, xl: 1280px, 2xl: 1536px, 3xl: 1792px
7
+ *
8
+ * Content Width Patterns:
9
+ * - narrow: Optimal for reading content (65ch-75ch)
10
+ * - standard: General content (80%-90% width)
11
+ * - wide: Data/dashboards (90%-100% width)
12
+ */
13
+ import * as React from 'react';
14
+ export interface ContainerProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
15
+ children: React.ReactNode;
16
+ type?: 'container' | 'content' | 'fluid';
17
+ width?: 'narrow' | 'standard' | 'wide' | 'full';
18
+ maxWidths?: {
19
+ xs?: string;
20
+ sm?: string;
21
+ md?: string;
22
+ lg?: string;
23
+ xl?: string;
24
+ '2xl'?: string;
25
+ '3xl'?: string;
26
+ };
27
+ padding?: {
28
+ xs?: string;
29
+ sm?: string;
30
+ md?: string;
31
+ lg?: string;
32
+ xl?: string;
33
+ '2xl'?: string;
34
+ '3xl'?: string;
35
+ };
36
+ centered?: boolean;
37
+ breakout?: boolean;
38
+ characterWidth?: {
39
+ min?: string;
40
+ max?: string;
41
+ optimal?: string;
42
+ };
43
+ as?: keyof JSX.IntrinsicElements;
44
+ }
45
+ export declare const Container: React.FC<ContainerProps>;
46
+ export interface ContentContainerProps extends Omit<ContainerProps, 'type' | 'width'> {
47
+ lineLength?: 'short' | 'optimal' | 'long';
48
+ textAlign?: 'left' | 'center' | 'justify';
49
+ }
50
+ export declare const ContentContainer: React.FC<ContentContainerProps>;
51
+ export interface SectionContainerProps extends ContainerProps {
52
+ fullWidthBackground?: boolean;
53
+ backgroundVariant?: 'default' | 'muted' | 'accent' | 'inverse';
54
+ }
55
+ export declare const SectionContainer: React.FC<SectionContainerProps>;
56
+ export default Container;
57
+ //# sourceMappingURL=container.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/layout/container.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IACzF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAG1B,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;IAGzC,KAAK,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;IAGhD,SAAS,CAAC,EAAE;QACV,EAAE,CAAC,EAAE,M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EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;CAChE;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA0B5D,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Container Component
3
+ * Implements Phase 2 container max-widths and content width system
4
+ *
5
+ * Container Max-Widths:
6
+ * - xs: 100%, sm: 640px, md: 768px, lg: 1024px, xl: 1280px, 2xl: 1536px, 3xl: 1792px
7
+ *
8
+ * Content Width Patterns:
9
+ * - narrow: Optimal for reading content (65ch-75ch)
10
+ * - standard: General content (80%-90% width)
11
+ * - wide: Data/dashboards (90%-100% width)
12
+ */
13
+ 'use client';
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ import * as React from 'react';
16
+ // Default container max-widths (from implementation plan)
17
+ const DEFAULT_CONTAINER_MAX_WIDTHS = {
18
+ xs: '100%',
19
+ sm: '640px',
20
+ md: '768px',
21
+ lg: '1024px',
22
+ xl: '1280px',
23
+ '2xl': '1536px',
24
+ '3xl': '1792px'
25
+ };
26
+ // Default content width patterns (from implementation plan)
27
+ const CONTENT_WIDTH_PATTERNS = {
28
+ narrow: {
29
+ xs: '100%',
30
+ sm: '100%',
31
+ md: '65ch',
32
+ lg: '70ch',
33
+ xl: '75ch',
34
+ '2xl': '75ch',
35
+ '3xl': '75ch'
36
+ },
37
+ standard: {
38
+ xs: '100%',
39
+ sm: '100%',
40
+ md: '90%',
41
+ lg: '85%',
42
+ xl: '80%',
43
+ '2xl': '80%',
44
+ '3xl': '80%'
45
+ },
46
+ wide: {
47
+ xs: '100%',
48
+ sm: '100%',
49
+ md: '100%',
50
+ lg: '95%',
51
+ xl: '90%',
52
+ '2xl': '90%',
53
+ '3xl': '90%'
54
+ },
55
+ full: {
56
+ xs: '100%',
57
+ sm: '100%',
58
+ md: '100%',
59
+ lg: '100%',
60
+ xl: '100%',
61
+ '2xl': '100%',
62
+ '3xl': '100%'
63
+ }
64
+ };
65
+ // Default padding configuration
66
+ const DEFAULT_PADDING = {
67
+ xs: 'var(--cs-spacing-scale-md)',
68
+ sm: 'var(--cs-spacing-scale-lg)',
69
+ md: 'var(--cs-spacing-scale-xl)',
70
+ lg: 'var(--cs-spacing-scale-2xl)',
71
+ xl: 'var(--cs-spacing-scale-2xl)',
72
+ '2xl': 'var(--cs-spacing-scale-3xl)',
73
+ '3xl': 'var(--cs-spacing-scale-3xl)'
74
+ };
75
+ export const Container = ({ children, type = 'container', width = 'standard', maxWidths: customMaxWidths, padding: customPadding, centered = true, breakout = false, characterWidth, className = '', style: userStyle, as: Component = 'div', ...restProps }) => {
76
+ const testId = restProps['data-testid'] || 'container';
77
+ // Determine max-widths based on type and width
78
+ const maxWidths = React.useMemo(() => {
79
+ if (customMaxWidths) {
80
+ return customMaxWidths;
81
+ }
82
+ switch (type) {
83
+ case 'container':
84
+ return DEFAULT_CONTAINER_MAX_WIDTHS;
85
+ case 'content':
86
+ return CONTENT_WIDTH_PATTERNS[width];
87
+ case 'fluid':
88
+ return CONTENT_WIDTH_PATTERNS.full;
89
+ default:
90
+ return DEFAULT_CONTAINER_MAX_WIDTHS;
91
+ }
92
+ }, [type, width, customMaxWidths]);
93
+ // Determine padding
94
+ const padding = customPadding || DEFAULT_PADDING;
95
+ // Build CSS custom properties
96
+ const containerStyle = React.useMemo(() => {
97
+ const style = {};
98
+ // Set max-width configurations
99
+ Object.entries(maxWidths).forEach(([breakpoint, maxWidth]) => {
100
+ style[`--container-max-width-${breakpoint}`] = maxWidth;
101
+ });
102
+ // Set padding configurations
103
+ Object.entries(padding).forEach(([breakpoint, paddingValue]) => {
104
+ style[`--container-padding-${breakpoint}`] = paddingValue;
105
+ });
106
+ // Set character width constraints
107
+ if (characterWidth) {
108
+ if (characterWidth.min) {
109
+ style['--container-character-width-min'] = characterWidth.min;
110
+ }
111
+ if (characterWidth.max) {
112
+ style['--container-character-width-max'] = characterWidth.max;
113
+ }
114
+ if (characterWidth.optimal) {
115
+ style['--container-character-width-optimal'] = characterWidth.optimal;
116
+ }
117
+ }
118
+ return style;
119
+ }, [maxWidths, padding, characterWidth]);
120
+ // Build CSS classes
121
+ const containerClasses = React.useMemo(() => {
122
+ const baseClass = 'container';
123
+ const typeClass = `container--${type}`;
124
+ const widthClass = width !== 'standard' ? `container--width-${width}` : '';
125
+ const centeredClass = centered ? 'container--centered' : '';
126
+ const breakoutClass = breakout ? 'container--breakout' : '';
127
+ const characterWidthClass = characterWidth ? 'container--character-width' : '';
128
+ return [baseClass, typeClass, widthClass, centeredClass, breakoutClass, characterWidthClass, className]
129
+ .filter(Boolean)
130
+ .join(' ');
131
+ }, [type, width, centered, breakout, characterWidth, className]);
132
+ // Merge user styles with container styles
133
+ const mergedStyle = React.useMemo(() => ({
134
+ ...containerStyle,
135
+ ...userStyle
136
+ }), [containerStyle, userStyle]);
137
+ return (_jsx(Component, { className: containerClasses, style: mergedStyle, "data-testid": testId, ...restProps, children: children }));
138
+ };
139
+ export const ContentContainer = ({ children, lineLength = 'optimal', textAlign = 'left', characterWidth: customCharacterWidth, style: userStyle, ...props }) => {
140
+ // Map line length to character widths
141
+ const characterWidth = React.useMemo(() => {
142
+ if (customCharacterWidth) {
143
+ return customCharacterWidth;
144
+ }
145
+ switch (lineLength) {
146
+ case 'short':
147
+ return { min: '45ch', max: '65ch', optimal: '55ch' };
148
+ case 'optimal':
149
+ return { min: '65ch', max: '75ch', optimal: '70ch' };
150
+ case 'long':
151
+ return { min: '75ch', max: '85ch', optimal: '80ch' };
152
+ default:
153
+ return { min: '65ch', max: '75ch', optimal: '70ch' };
154
+ }
155
+ }, [lineLength, customCharacterWidth]);
156
+ const mergedStyle = React.useMemo(() => ({
157
+ textAlign: textAlign,
158
+ ...userStyle
159
+ }), [textAlign, userStyle]);
160
+ return (_jsx(Container, { type: "content", width: "narrow", characterWidth: characterWidth, style: mergedStyle, ...props, children: children }));
161
+ };
162
+ export const SectionContainer = ({ children, fullWidthBackground = false, backgroundVariant = 'default', className = '', ...props }) => {
163
+ const sectionClasses = React.useMemo(() => {
164
+ const baseClass = 'section-container';
165
+ const backgroundClass = fullWidthBackground ? 'section-container--full-width-bg' : '';
166
+ const variantClass = backgroundVariant !== 'default' ? `section-container--${backgroundVariant}` : '';
167
+ return [baseClass, backgroundClass, variantClass, className]
168
+ .filter(Boolean)
169
+ .join(' ');
170
+ }, [fullWidthBackground, backgroundVariant, className]);
171
+ return (_jsx(Container, { className: sectionClasses, as: "section", ...props, children: children }));
172
+ };
173
+ export default Container;
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Container Component
3
+ * Implements Phase 2 container max-widths and content width system
4
+ *
5
+ * Container Max-Widths:
6
+ * - xs: 100%, sm: 640px, md: 768px, lg: 1024px, xl: 1280px, 2xl: 1536px, 3xl: 1792px
7
+ *
8
+ * Content Width Patterns:
9
+ * - narrow: Optimal for reading content (65ch-75ch)
10
+ * - standard: General content (80%-90% width)
11
+ * - wide: Data/dashboards (90%-100% width)
12
+ */
13
+ 'use client';
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ import * as React from 'react';
16
+ // Default container max-widths (from implementation plan)
17
+ const DEFAULT_CONTAINER_MAX_WIDTHS = {
18
+ xs: '100%',
19
+ sm: '640px',
20
+ md: '768px',
21
+ lg: '1024px',
22
+ xl: '1280px',
23
+ '2xl': '1536px',
24
+ '3xl': '1792px'
25
+ };
26
+ // Default content width patterns (from implementation plan)
27
+ const CONTENT_WIDTH_PATTERNS = {
28
+ narrow: {
29
+ xs: '100%',
30
+ sm: '100%',
31
+ md: '65ch',
32
+ lg: '70ch',
33
+ xl: '75ch',
34
+ '2xl': '75ch',
35
+ '3xl': '75ch'
36
+ },
37
+ standard: {
38
+ xs: '100%',
39
+ sm: '100%',
40
+ md: '90%',
41
+ lg: '85%',
42
+ xl: '80%',
43
+ '2xl': '80%',
44
+ '3xl': '80%'
45
+ },
46
+ wide: {
47
+ xs: '100%',
48
+ sm: '100%',
49
+ md: '100%',
50
+ lg: '95%',
51
+ xl: '90%',
52
+ '2xl': '90%',
53
+ '3xl': '90%'
54
+ },
55
+ full: {
56
+ xs: '100%',
57
+ sm: '100%',
58
+ md: '100%',
59
+ lg: '100%',
60
+ xl: '100%',
61
+ '2xl': '100%',
62
+ '3xl': '100%'
63
+ }
64
+ };
65
+ // Default padding configuration
66
+ const DEFAULT_PADDING = {
67
+ xs: 'var(--cs-spacing-scale-md)',
68
+ sm: 'var(--cs-spacing-scale-lg)',
69
+ md: 'var(--cs-spacing-scale-xl)',
70
+ lg: 'var(--cs-spacing-scale-2xl)',
71
+ xl: 'var(--cs-spacing-scale-2xl)',
72
+ '2xl': 'var(--cs-spacing-scale-3xl)',
73
+ '3xl': 'var(--cs-spacing-scale-3xl)'
74
+ };
75
+ export const Container = ({ children, type = 'container', width = 'standard', maxWidths: customMaxWidths, padding: customPadding, centered = true, breakout = false, characterWidth, className = '', style: userStyle, as: Component = 'div', ...restProps }) => {
76
+ const testId = restProps['data-testid'] || 'container';
77
+ // Determine max-widths based on type and width
78
+ const maxWidths = React.useMemo(() => {
79
+ if (customMaxWidths) {
80
+ return customMaxWidths;
81
+ }
82
+ switch (type) {
83
+ case 'container':
84
+ return DEFAULT_CONTAINER_MAX_WIDTHS;
85
+ case 'content':
86
+ return CONTENT_WIDTH_PATTERNS[width];
87
+ case 'fluid':
88
+ return CONTENT_WIDTH_PATTERNS.full;
89
+ default:
90
+ return DEFAULT_CONTAINER_MAX_WIDTHS;
91
+ }
92
+ }, [type, width, customMaxWidths]);
93
+ // Determine padding
94
+ const padding = customPadding || DEFAULT_PADDING;
95
+ // Build CSS custom properties
96
+ const containerStyle = React.useMemo(() => {
97
+ const style = {};
98
+ // Set max-width configurations
99
+ Object.entries(maxWidths).forEach(([breakpoint, maxWidth]) => {
100
+ style[`--container-max-width-${breakpoint}`] = maxWidth;
101
+ });
102
+ // Set padding configurations
103
+ Object.entries(padding).forEach(([breakpoint, paddingValue]) => {
104
+ style[`--container-padding-${breakpoint}`] = paddingValue;
105
+ });
106
+ // Set character width constraints
107
+ if (characterWidth) {
108
+ if (characterWidth.min) {
109
+ style['--container-character-width-min'] = characterWidth.min;
110
+ }
111
+ if (characterWidth.max) {
112
+ style['--container-character-width-max'] = characterWidth.max;
113
+ }
114
+ if (characterWidth.optimal) {
115
+ style['--container-character-width-optimal'] = characterWidth.optimal;
116
+ }
117
+ }
118
+ return style;
119
+ }, [maxWidths, padding, characterWidth]);
120
+ // Build CSS classes
121
+ const containerClasses = React.useMemo(() => {
122
+ const baseClass = 'container';
123
+ const typeClass = `container--${type}`;
124
+ const widthClass = width !== 'standard' ? `container--width-${width}` : '';
125
+ const centeredClass = centered ? 'container--centered' : '';
126
+ const breakoutClass = breakout ? 'container--breakout' : '';
127
+ const characterWidthClass = characterWidth ? 'container--character-width' : '';
128
+ return [baseClass, typeClass, widthClass, centeredClass, breakoutClass, characterWidthClass, className]
129
+ .filter(Boolean)
130
+ .join(' ');
131
+ }, [type, width, centered, breakout, characterWidth, className]);
132
+ // Merge user styles with container styles
133
+ const mergedStyle = React.useMemo(() => ({
134
+ ...containerStyle,
135
+ ...userStyle
136
+ }), [containerStyle, userStyle]);
137
+ return (_jsx(Component, { className: containerClasses, style: mergedStyle, "data-testid": testId, ...restProps, children: children }));
138
+ };
139
+ export const ContentContainer = ({ children, lineLength = 'optimal', textAlign = 'left', characterWidth: customCharacterWidth, style: userStyle, ...props }) => {
140
+ // Map line length to character widths
141
+ const characterWidth = React.useMemo(() => {
142
+ if (customCharacterWidth) {
143
+ return customCharacterWidth;
144
+ }
145
+ switch (lineLength) {
146
+ case 'short':
147
+ return { min: '45ch', max: '65ch', optimal: '55ch' };
148
+ case 'optimal':
149
+ return { min: '65ch', max: '75ch', optimal: '70ch' };
150
+ case 'long':
151
+ return { min: '75ch', max: '85ch', optimal: '80ch' };
152
+ default:
153
+ return { min: '65ch', max: '75ch', optimal: '70ch' };
154
+ }
155
+ }, [lineLength, customCharacterWidth]);
156
+ const mergedStyle = React.useMemo(() => ({
157
+ textAlign: textAlign,
158
+ ...userStyle
159
+ }), [textAlign, userStyle]);
160
+ return (_jsx(Container, { type: "content", width: "narrow", characterWidth: characterWidth, style: mergedStyle, ...props, children: children }));
161
+ };
162
+ export const SectionContainer = ({ children, fullWidthBackground = false, backgroundVariant = 'default', className = '', ...props }) => {
163
+ const sectionClasses = React.useMemo(() => {
164
+ const baseClass = 'section-container';
165
+ const backgroundClass = fullWidthBackground ? 'section-container--full-width-bg' : '';
166
+ const variantClass = backgroundVariant !== 'default' ? `section-container--${backgroundVariant}` : '';
167
+ return [baseClass, backgroundClass, variantClass, className]
168
+ .filter(Boolean)
169
+ .join(' ');
170
+ }, [fullWidthBackground, backgroundVariant, className]);
171
+ return (_jsx(Container, { className: sectionClasses, as: "section", ...props, children: children }));
172
+ };
173
+ export default Container;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Layout Components Index
3
+ * Exports all layout components for Phase 2 implementation
4
+ */
5
+ export { ResponsiveGrid, ResponsiveGridItem } from './responsive-grid';
6
+ export type { ResponsiveGridProps, ResponsiveGridItemProps } from './responsive-grid';
7
+ export { Container, ContentContainer, SectionContainer } from './container';
8
+ export type { ContainerProps, ContentContainerProps, SectionContainerProps } from './container';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/layout/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAEtF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5E,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Layout Components Index
3
+ * Exports all layout components for Phase 2 implementation
4
+ */
5
+ export { ResponsiveGrid, ResponsiveGridItem } from './responsive-grid';
6
+ export { Container, ContentContainer, SectionContainer } from './container';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Layout Components Index
3
+ * Exports all layout components for Phase 2 implementation
4
+ */
5
+ export { ResponsiveGrid, ResponsiveGridItem } from './responsive-grid';
6
+ export { Container, ContentContainer, SectionContainer } from './container';
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Responsive Grid Component
3
+ * Implements Phase 2 responsive grid system as defined in the implementation plan
4
+ *
5
+ * Grid Progression:
6
+ * - xs: 1 column (Single column mobile)
7
+ * - sm: 2 columns (2 columns small tablet)
8
+ * - md: 2 columns (2 columns tablet)
9
+ * - lg: 3 columns (3 columns desktop)
10
+ * - xl: 4 columns (4 columns large desktop)
11
+ * - 2xl: 4 columns (4 columns ultra-wide)
12
+ * - 3xl: 5 columns (5 columns large displays)
13
+ *
14
+ * Gap Progression:
15
+ * - xs: 16px, sm: 20px, md: 24px, lg: 28px, xl: 32px, 2xl: 36px, 3xl: 40px
16
+ */
17
+ import * as React from 'react';
18
+ export interface ResponsiveGridProps {
19
+ children: React.ReactNode;
20
+ columns?: {
21
+ xs?: number;
22
+ sm?: number;
23
+ md?: number;
24
+ lg?: number;
25
+ xl?: number;
26
+ '2xl'?: number;
27
+ '3xl'?: number;
28
+ };
29
+ gaps?: {
30
+ xs?: string;
31
+ sm?: string;
32
+ md?: string;
33
+ lg?: string;
34
+ xl?: string;
35
+ '2xl'?: string;
36
+ '3xl'?: string;
37
+ };
38
+ pattern?: 'default' | 'content' | 'dashboard' | 'gallery' | 'cards';
39
+ autoFit?: boolean;
40
+ minItemWidth?: string;
41
+ alignItems?: 'start' | 'center' | 'end' | 'stretch';
42
+ justifyItems?: 'start' | 'center' | 'end' | 'stretch';
43
+ 'aria-label'?: string;
44
+ 'data-testid'?: string;
45
+ className?: string;
46
+ }
47
+ export declare const ResponsiveGrid: React.FC<ResponsiveGridProps>;
48
+ export interface ResponsiveGridItemProps {
49
+ children: React.ReactNode;
50
+ colSpan?: {
51
+ xs?: number;
52
+ sm?: number;
53
+ md?: number;
54
+ lg?: number;
55
+ xl?: number;
56
+ '2xl'?: number;
57
+ '3xl'?: number;
58
+ };
59
+ rowSpan?: {
60
+ xs?: number;
61
+ sm?: number;
62
+ md?: number;
63
+ lg?: number;
64
+ xl?: number;
65
+ '2xl'?: number;
66
+ '3xl'?: number;
67
+ };
68
+ colStart?: {
69
+ xs?: number;
70
+ sm?: number;
71
+ md?: number;
72
+ lg?: number;
73
+ xl?: number;
74
+ '2xl'?: number;
75
+ '3xl'?: number;
76
+ };
77
+ rowStart?: {
78
+ xs?: number;
79
+ sm?: number;
80
+ md?: number;
81
+ lg?: number;
82
+ xl?: number;
83
+ '2xl'?: number;
84
+ '3xl'?: number;
85
+ };
86
+ alignSelf?: 'auto' | 'start' | 'center' | 'end' | 'stretch';
87
+ justifySelf?: 'auto' | 'start' | 'center' | 'end' | 'stretch';
88
+ className?: string;
89
+ 'data-testid'?: string;
90
+ }
91
+ export declare const ResponsiveGridItem: React.FC<ResponsiveGridItemProps>;
92
+ export default ResponsiveGrid;
93
+ //# sourceMappingURL=responsive-grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responsive-grid.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/layout/responsive-grid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAG1B,OAAO,CAAC,EAAE;QACR,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,EAAE,CAAC,EAAE,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