@inglorious/ui 0.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 (83) hide show
  1. package/LICENSE +9 -0
  2. package/package.json +142 -0
  3. package/src/controls/button/button.stories.js +139 -0
  4. package/src/controls/button/index.js +5 -0
  5. package/src/controls/button/style.css +148 -0
  6. package/src/controls/button/template.js +74 -0
  7. package/src/controls/button-group/button-group.stories.js +108 -0
  8. package/src/controls/button-group/index.js +4 -0
  9. package/src/controls/button-group/style.css +58 -0
  10. package/src/controls/button-group/template.js +117 -0
  11. package/src/controls/checkbox/checkbox.stories.js +47 -0
  12. package/src/controls/checkbox/index.js +4 -0
  13. package/src/controls/checkbox/style.css +33 -0
  14. package/src/controls/checkbox/template.js +54 -0
  15. package/src/controls/fab/fab.stories.js +52 -0
  16. package/src/controls/fab/index.js +4 -0
  17. package/src/controls/fab/style.css +76 -0
  18. package/src/controls/fab/template.js +33 -0
  19. package/src/controls/icon-button/icon-button.stories.js +70 -0
  20. package/src/controls/icon-button/index.js +4 -0
  21. package/src/controls/icon-button/style.css +14 -0
  22. package/src/controls/icon-button/template.js +47 -0
  23. package/src/controls/input/index.js +4 -0
  24. package/src/controls/input/input.stories.js +180 -0
  25. package/src/controls/input/style.css +121 -0
  26. package/src/controls/input/template.js +111 -0
  27. package/src/controls/radio-group/index.js +4 -0
  28. package/src/controls/radio-group/radio-group.stories.js +51 -0
  29. package/src/controls/radio-group/style.css +41 -0
  30. package/src/controls/radio-group/template.js +71 -0
  31. package/src/controls/rating/index.js +4 -0
  32. package/src/controls/rating/rating.stories.js +47 -0
  33. package/src/controls/rating/style.css +29 -0
  34. package/src/controls/rating/template.js +53 -0
  35. package/src/controls/select/handlers.js +133 -0
  36. package/src/controls/select/helpers.js +91 -0
  37. package/src/controls/select/index.js +15 -0
  38. package/src/controls/select/select.stories.js +90 -0
  39. package/src/controls/select/style.css +211 -0
  40. package/src/controls/select/template.js +423 -0
  41. package/src/controls/slider/index.js +4 -0
  42. package/src/controls/slider/slider.stories.js +43 -0
  43. package/src/controls/slider/style.css +28 -0
  44. package/src/controls/slider/template.js +66 -0
  45. package/src/controls/switch/index.js +4 -0
  46. package/src/controls/switch/style.css +82 -0
  47. package/src/controls/switch/switch.stories.js +45 -0
  48. package/src/controls/switch/template.js +55 -0
  49. package/src/index.js +14 -0
  50. package/src/layout/flex/flex.stories.js +103 -0
  51. package/src/layout/flex/index.js +4 -0
  52. package/src/layout/flex/style.css +103 -0
  53. package/src/layout/flex/template.js +41 -0
  54. package/src/layout/grid/grid.stories.js +82 -0
  55. package/src/layout/grid/index.js +4 -0
  56. package/src/layout/grid/style.css +51 -0
  57. package/src/layout/grid/template.js +47 -0
  58. package/src/shared/applyElementProps.js +79 -0
  59. package/src/shared/withRenderValidation.js +19 -0
  60. package/src/stories/notifyStory.js +43 -0
  61. package/src/themes/bootstrap.css +118 -0
  62. package/src/themes/inglorious.css +106 -0
  63. package/src/themes/material.css +124 -0
  64. package/src/tokens/index.css +133 -0
  65. package/src/widgets/card/card.stories.js +135 -0
  66. package/src/widgets/card/index.js +4 -0
  67. package/src/widgets/card/style.css +53 -0
  68. package/src/widgets/card/template.js +97 -0
  69. package/types/controls/button-group.d.ts +35 -0
  70. package/types/controls/button.d.ts +23 -0
  71. package/types/controls/checkbox.d.ts +18 -0
  72. package/types/controls/fab.d.ts +19 -0
  73. package/types/controls/icon-button.d.ts +23 -0
  74. package/types/controls/input.d.ts +29 -0
  75. package/types/controls/radio-group.d.ts +25 -0
  76. package/types/controls/rating.d.ts +18 -0
  77. package/types/controls/select.d.ts +56 -0
  78. package/types/controls/slider.d.ts +21 -0
  79. package/types/controls/switch.d.ts +17 -0
  80. package/types/index.d.ts +14 -0
  81. package/types/layout/flex.d.ts +20 -0
  82. package/types/layout/grid.d.ts +19 -0
  83. package/types/widgets/card.d.ts +21 -0
@@ -0,0 +1,118 @@
1
+ .iw-theme-bootstrap {
2
+ /* ========================================
3
+ BOOTSTRAP THEME - Bootstrap Inspired
4
+ ======================================== */
5
+
6
+ /* Semantic Colors */
7
+ --iw-color-bg: var(--iw-color-white);
8
+ --iw-color-bg-secondary: var(--iw-color-gray-100);
9
+ --iw-color-bg-tertiary: var(--iw-color-gray-200);
10
+ --iw-color-surface: var(--iw-color-white);
11
+ --iw-color-surface-hover: var(--iw-color-gray-100);
12
+ --iw-color-surface-active: var(--iw-color-gray-200);
13
+
14
+ --iw-color-text: #212529;
15
+ --iw-color-text-secondary: #495057;
16
+ --iw-color-text-muted: #6c757d;
17
+
18
+ --iw-color-border: #dee2e6;
19
+ --iw-color-border-focus: #86b7fe;
20
+
21
+ --iw-color-primary: #0d6efd;
22
+ --iw-color-primary-hover: #0b5ed7;
23
+ --iw-color-primary-active: #0a58ca;
24
+ --iw-color-primary-text: var(--iw-color-white);
25
+
26
+ --iw-color-accent: #6f42c1;
27
+ --iw-color-accent-hover: #5a32a3;
28
+ --iw-color-accent-active: #4328a4;
29
+
30
+ /* ========================================
31
+ COMPONENT TOKENS
32
+ ======================================== */
33
+
34
+ /* Button */
35
+ --iw-button-bg: var(--iw-color-primary);
36
+ --iw-button-bg-hover: var(--iw-color-primary-hover);
37
+ --iw-button-bg-active: var(--iw-color-primary-active);
38
+ --iw-button-text: var(--iw-color-primary-text);
39
+ --iw-button-border: var(--iw-color-primary);
40
+ --iw-button-radius: var(--iw-radius-md);
41
+ --iw-button-shadow: none;
42
+ --iw-button-shadow-hover: none;
43
+ --iw-button-shadow-active: none;
44
+
45
+ --iw-button-outline-bg: transparent;
46
+ --iw-button-outline-bg-hover: var(--iw-color-primary);
47
+ --iw-button-outline-text: var(--iw-color-primary);
48
+ --iw-button-outline-text-hover: var(--iw-color-white);
49
+ --iw-button-outline-border: var(--iw-color-primary);
50
+
51
+ --iw-button-ghost-bg: transparent;
52
+ --iw-button-ghost-bg-hover: var(--iw-color-gray-100);
53
+ --iw-button-ghost-text: var(--iw-color-text);
54
+ --iw-button-ghost-border: transparent;
55
+
56
+ /* Input */
57
+ --iw-input-bg: var(--iw-color-white);
58
+ --iw-input-bg-hover: var(--iw-color-white);
59
+ --iw-input-bg-focus: var(--iw-color-white);
60
+ --iw-input-text: var(--iw-color-text);
61
+ --iw-input-text-placeholder: var(--iw-color-text-muted);
62
+ --iw-input-border: #ced4da;
63
+ --iw-input-border-hover: #ced4da;
64
+ --iw-input-border-focus: var(--iw-color-border-focus);
65
+ --iw-input-radius: var(--iw-radius-md);
66
+ --iw-input-shadow-focus: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
67
+
68
+ /* Card */
69
+ --iw-card-bg: var(--iw-color-surface);
70
+ --iw-card-border: var(--iw-color-border);
71
+ --iw-card-radius: var(--iw-radius-lg);
72
+ --iw-card-shadow: none;
73
+ --iw-card-shadow-hover: none;
74
+
75
+ /* Badge */
76
+ --iw-badge-radius: var(--iw-radius-md);
77
+
78
+ /* Alert */
79
+ --iw-alert-radius: var(--iw-radius-md);
80
+ --iw-alert-shadow: none;
81
+ color-scheme: light;
82
+ }
83
+
84
+ /* Dark variant */
85
+ .iw-theme-bootstrap.iw-theme-dark {
86
+ color-scheme: dark;
87
+
88
+ --iw-color-bg: #212529;
89
+ --iw-color-bg-secondary: #2c3036;
90
+ --iw-color-bg-tertiary: #343a40;
91
+ --iw-color-surface: #2c3036;
92
+ --iw-color-surface-hover: #343a40;
93
+ --iw-color-surface-active: #3d4450;
94
+ --iw-color-text: #f8f9fa;
95
+ --iw-color-text-secondary: #dee2e6;
96
+ --iw-color-text-muted: #adb5bd;
97
+ --iw-color-border: #495057;
98
+
99
+ --iw-color-primary: #5897fb;
100
+ --iw-color-primary-hover: #4a8bf7;
101
+ --iw-color-primary-active: #3c7ff3;
102
+ --iw-color-primary-text: var(--iw-color-black);
103
+
104
+ --iw-color-border-focus: #5897fb;
105
+
106
+ --iw-input-bg: #2c3036;
107
+ --iw-input-bg-hover: #2c3036;
108
+ --iw-input-bg-focus: #2c3036;
109
+ --iw-input-border: #495057;
110
+ --iw-input-border-hover: #5a6268;
111
+ --iw-input-border-focus: var(--iw-color-primary);
112
+ --iw-input-shadow-focus: 0 0 0 0.25rem rgba(88, 151, 251, 0.25);
113
+
114
+ --iw-button-outline-text: var(--iw-color-primary);
115
+ --iw-button-outline-border: var(--iw-color-primary);
116
+ --iw-button-ghost-bg-hover: #343a40;
117
+ --iw-button-ghost-text: var(--iw-color-text);
118
+ }
@@ -0,0 +1,106 @@
1
+ .iw-theme-inglorious {
2
+ /* ========================================
3
+ INGLORIOUS THEME - Neon Videogame Aesthetic
4
+ ======================================== */
5
+
6
+ /* Semantic Colors */
7
+ --iw-color-bg: var(--iw-color-gray-900);
8
+ --iw-color-bg-secondary: var(--iw-color-gray-800);
9
+ --iw-color-bg-tertiary: var(--iw-color-black);
10
+ --iw-color-surface: var(--iw-color-gray-800);
11
+ --iw-color-surface-hover: var(--iw-color-gray-700);
12
+ --iw-color-surface-active: var(--iw-color-gray-600);
13
+
14
+ --iw-color-text: var(--iw-color-gray-100);
15
+ --iw-color-text-secondary: var(--iw-color-gray-400);
16
+ --iw-color-text-muted: var(--iw-color-gray-500);
17
+
18
+ --iw-color-border: var(--iw-color-gray-700);
19
+ --iw-color-border-focus: var(--iw-color-primary-500);
20
+
21
+ --iw-color-primary: var(--iw-color-primary-500);
22
+ --iw-color-primary-hover: var(--iw-color-primary-400);
23
+ --iw-color-primary-active: var(--iw-color-primary-300);
24
+ --iw-color-primary-text: var(--iw-color-black);
25
+
26
+ --iw-color-accent: #ff00ff;
27
+ --iw-color-accent-hover: #ff33ff;
28
+ --iw-color-accent-active: #ff66ff;
29
+
30
+ /* ========================================
31
+ COMPONENT TOKENS
32
+ ======================================== */
33
+
34
+ /* Button */
35
+ --iw-button-bg: var(--iw-color-primary);
36
+ --iw-button-bg-hover: var(--iw-color-primary-hover);
37
+ --iw-button-bg-active: var(--iw-color-primary-active);
38
+ --iw-button-text: var(--iw-color-primary-text);
39
+ --iw-button-border: var(--iw-color-primary);
40
+ --iw-button-radius: var(--iw-radius-none);
41
+ --iw-button-shadow: none;
42
+ --iw-button-shadow-hover:
43
+ 0 0 10px var(--iw-color-primary), 0 0 20px var(--iw-color-primary);
44
+ --iw-button-shadow-active: 0 0 5px var(--iw-color-primary);
45
+
46
+ --iw-button-outline-bg: transparent;
47
+ --iw-button-outline-bg-hover: var(--iw-color-primary);
48
+ --iw-button-outline-text: var(--iw-color-primary);
49
+ --iw-button-outline-text-hover: var(--iw-color-black);
50
+ --iw-button-outline-border: var(--iw-color-primary);
51
+
52
+ --iw-button-ghost-bg: transparent;
53
+ --iw-button-ghost-bg-hover: rgba(0, 255, 136, 0.1);
54
+ --iw-button-ghost-text: var(--iw-color-primary);
55
+ --iw-button-ghost-border: transparent;
56
+
57
+ /* Input */
58
+ --iw-input-bg: var(--iw-color-bg-tertiary);
59
+ --iw-input-bg-hover: var(--iw-color-bg-secondary);
60
+ --iw-input-bg-focus: var(--iw-color-bg-tertiary);
61
+ --iw-input-text: var(--iw-color-text);
62
+ --iw-input-text-placeholder: var(--iw-color-text-muted);
63
+ --iw-input-border: var(--iw-color-border);
64
+ --iw-input-border-hover: var(--iw-color-gray-600);
65
+ --iw-input-border-focus: var(--iw-color-primary);
66
+ --iw-input-radius: var(--iw-radius-none);
67
+ --iw-input-shadow-focus:
68
+ 0 0 0 1px var(--iw-color-primary), 0 0 10px rgba(0, 255, 136, 0.3);
69
+
70
+ /* Card */
71
+ --iw-card-bg: var(--iw-color-surface);
72
+ --iw-card-border: var(--iw-color-border);
73
+ --iw-card-radius: var(--iw-radius-none);
74
+ --iw-card-shadow: var(--iw-shadow-lg);
75
+ --iw-card-shadow-hover: var(--iw-shadow-xl), 0 0 15px rgba(0, 255, 136, 0.1);
76
+
77
+ /* Badge */
78
+ --iw-badge-radius: var(--iw-radius-none);
79
+
80
+ /* Alert */
81
+ --iw-alert-radius: var(--iw-radius-none);
82
+ --iw-alert-shadow: 0 0 10px currentColor;
83
+ color-scheme: dark;
84
+ }
85
+
86
+ /* Light variant */
87
+ .iw-theme-inglorious.iw-theme-light {
88
+ --iw-color-bg: var(--iw-color-white);
89
+ --iw-color-bg-secondary: var(--iw-color-gray-50);
90
+ --iw-color-bg-tertiary: var(--iw-color-gray-100);
91
+ --iw-color-surface: var(--iw-color-white);
92
+ --iw-color-surface-hover: var(--iw-color-gray-50);
93
+ --iw-color-surface-active: var(--iw-color-gray-100);
94
+ --iw-color-text: var(--iw-color-gray-900);
95
+ --iw-color-text-secondary: var(--iw-color-gray-600);
96
+ --iw-color-text-muted: var(--iw-color-gray-500);
97
+ --iw-color-border: var(--iw-color-gray-300);
98
+ --iw-color-primary-text: var(--iw-color-black);
99
+
100
+ --iw-input-bg: var(--iw-color-white);
101
+ --iw-input-bg-hover: var(--iw-color-gray-50);
102
+ --iw-input-bg-focus: var(--iw-color-white);
103
+
104
+ --iw-button-shadow-hover: 0 0 10px var(--iw-color-primary);
105
+ --iw-card-shadow-hover: var(--iw-shadow-xl), 0 0 15px rgba(0, 255, 136, 0.2);
106
+ }
@@ -0,0 +1,124 @@
1
+ .iw-theme-material {
2
+ /* ========================================
3
+ MATERIAL THEME - Material Design Inspired
4
+ ======================================== */
5
+
6
+ /* Semantic Colors */
7
+ --iw-color-bg: var(--iw-color-gray-50);
8
+ --iw-color-bg-secondary: var(--iw-color-white);
9
+ --iw-color-bg-tertiary: var(--iw-color-gray-100);
10
+ --iw-color-surface: var(--iw-color-white);
11
+ --iw-color-surface-hover: var(--iw-color-gray-50);
12
+ --iw-color-surface-active: var(--iw-color-gray-100);
13
+
14
+ --iw-color-text: var(--iw-color-gray-900);
15
+ --iw-color-text-secondary: var(--iw-color-gray-700);
16
+ --iw-color-text-muted: var(--iw-color-gray-500);
17
+
18
+ --iw-color-border: var(--iw-color-gray-300);
19
+ --iw-color-border-focus: #1a73e8;
20
+
21
+ --iw-color-primary: #1a73e8;
22
+ --iw-color-primary-hover: #1557b0;
23
+ --iw-color-primary-active: #0d47a1;
24
+ --iw-color-primary-text: var(--iw-color-white);
25
+
26
+ --iw-color-accent: #e91e63;
27
+ --iw-color-accent-hover: #c2185b;
28
+ --iw-color-accent-active: #ad1457;
29
+
30
+ /* ========================================
31
+ COMPONENT TOKENS
32
+ ======================================== */
33
+
34
+ /* Button */
35
+ --iw-button-bg: var(--iw-color-primary);
36
+ --iw-button-bg-hover: var(--iw-color-primary-hover);
37
+ --iw-button-bg-active: var(--iw-color-primary-active);
38
+ --iw-button-text: var(--iw-color-primary-text);
39
+ --iw-button-border: var(--iw-color-primary);
40
+ --iw-button-radius: var(--iw-radius-full);
41
+ --iw-button-shadow:
42
+ 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
43
+ --iw-button-shadow-hover:
44
+ 0 1px 2px rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
45
+ --iw-button-shadow-active: 0 1px 3px rgba(60, 64, 67, 0.4);
46
+
47
+ --iw-button-outline-bg: transparent;
48
+ --iw-button-outline-bg-hover: rgba(26, 115, 232, 0.08);
49
+ --iw-button-outline-text: var(--iw-color-primary);
50
+ --iw-button-outline-text-hover: var(--iw-color-primary);
51
+ --iw-button-outline-border: transparent;
52
+
53
+ --iw-button-ghost-bg: transparent;
54
+ --iw-button-ghost-bg-hover: rgba(0, 0, 0, 0.04);
55
+ --iw-button-ghost-text: var(--iw-color-primary);
56
+ --iw-button-ghost-border: transparent;
57
+
58
+ /* Input */
59
+ --iw-input-bg: var(--iw-color-bg-secondary);
60
+ --iw-input-bg-hover: var(--iw-color-bg-secondary);
61
+ --iw-input-bg-focus: var(--iw-color-bg-secondary);
62
+ --iw-input-text: var(--iw-color-text);
63
+ --iw-input-text-placeholder: var(--iw-color-text-muted);
64
+ --iw-input-border: var(--iw-color-border);
65
+ --iw-input-border-hover: var(--iw-color-border);
66
+ --iw-input-border-focus: var(--iw-color-primary);
67
+ --iw-input-radius: var(--iw-radius-xs);
68
+ --iw-input-shadow-focus: none;
69
+
70
+ /* Card */
71
+ --iw-card-bg: var(--iw-color-surface);
72
+ --iw-card-border: transparent;
73
+ --iw-card-radius: var(--iw-radius-lg);
74
+ --iw-card-shadow:
75
+ 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
76
+ --iw-card-shadow-hover:
77
+ 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
78
+
79
+ /* Badge */
80
+ --iw-badge-radius: var(--iw-radius-sm);
81
+
82
+ /* Alert */
83
+ --iw-alert-radius: var(--iw-radius-md);
84
+ --iw-alert-shadow: none;
85
+ color-scheme: light;
86
+ }
87
+
88
+ /* Dark variant */
89
+ .iw-theme-material.iw-theme-dark {
90
+ color-scheme: dark;
91
+
92
+ --iw-color-bg: #121212;
93
+ --iw-color-bg-secondary: #1e1e1e;
94
+ --iw-color-bg-tertiary: #2d2d2d;
95
+ --iw-color-surface: #1e1e1e;
96
+ --iw-color-surface-hover: #2d2d2d;
97
+ --iw-color-surface-active: #3d3d3d;
98
+ --iw-color-text: var(--iw-color-gray-100);
99
+ --iw-color-text-secondary: var(--iw-color-gray-300);
100
+ --iw-color-text-muted: var(--iw-color-gray-400);
101
+ --iw-color-border: var(--iw-color-gray-700);
102
+
103
+ --iw-color-primary: #8ab4f8;
104
+ --iw-color-primary-hover: #aecbfa;
105
+ --iw-color-primary-active: #669df6;
106
+ --iw-color-primary-text: var(--iw-color-black);
107
+
108
+ --iw-color-border-focus: #8ab4f8;
109
+
110
+ --iw-input-bg: var(--iw-color-bg-secondary);
111
+ --iw-input-bg-hover: var(--iw-color-bg-secondary);
112
+ --iw-input-bg-focus: var(--iw-color-bg-secondary);
113
+ --iw-input-border: var(--iw-color-gray-600);
114
+ --iw-input-border-hover: var(--iw-color-gray-500);
115
+ --iw-input-border-focus: var(--iw-color-primary);
116
+
117
+ --iw-button-shadow:
118
+ 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
119
+ --iw-button-shadow-hover:
120
+ 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 6px 2px rgba(0, 0, 0, 0.15);
121
+
122
+ --iw-card-shadow:
123
+ 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
124
+ }
@@ -0,0 +1,133 @@
1
+ :root {
2
+ /* ========================================
3
+ COLOR PALETTE - Primitive Colors
4
+ ======================================== */
5
+ --iw-color-white: #ffffff;
6
+ --iw-color-black: #000000;
7
+
8
+ /* Brand Colors */
9
+ --iw-color-primary-50: #e6fff0;
10
+ --iw-color-primary-100: #b3ffd6;
11
+ --iw-color-primary-200: #80ffbd;
12
+ --iw-color-primary-300: #4dffa3;
13
+ --iw-color-primary-400: #1aff8a;
14
+ --iw-color-primary-500: #00ff88;
15
+ --iw-color-primary-600: #00cc6d;
16
+ --iw-color-primary-700: #009952;
17
+ --iw-color-primary-800: #006637;
18
+ --iw-color-primary-900: #00331c;
19
+
20
+ /* Neutral Colors */
21
+ --iw-color-gray-50: #fafafa;
22
+ --iw-color-gray-100: #f4f4f5;
23
+ --iw-color-gray-200: #e4e4e7;
24
+ --iw-color-gray-300: #d4d4d8;
25
+ --iw-color-gray-400: #a1a1aa;
26
+ --iw-color-gray-500: #71717a;
27
+ --iw-color-gray-600: #52525b;
28
+ --iw-color-gray-700: #3f3f46;
29
+ --iw-color-gray-800: #27272a;
30
+ --iw-color-gray-900: #18181b;
31
+
32
+ /* Semantic Colors */
33
+ --iw-color-success-light: #d1fae5;
34
+ --iw-color-success: #10b981;
35
+ --iw-color-success-dark: #065f46;
36
+
37
+ --iw-color-warning-light: #fef3c7;
38
+ --iw-color-warning: #f59e0b;
39
+ --iw-color-warning-dark: #92400e;
40
+
41
+ --iw-color-error-light: #fee2e2;
42
+ --iw-color-error: #ef4444;
43
+ --iw-color-error-dark: #991b1b;
44
+
45
+ --iw-color-info-light: #dbeafe;
46
+ --iw-color-info: #3b82f6;
47
+ --iw-color-info-dark: #1e40af;
48
+
49
+ /* ========================================
50
+ SPACING SCALE
51
+ ======================================== */
52
+ --iw-space-0: 0;
53
+ --iw-space-1: 0.25rem;
54
+ --iw-space-2: 0.5rem;
55
+ --iw-space-3: 0.75rem;
56
+ --iw-space-4: 1rem;
57
+ --iw-space-5: 1.25rem;
58
+ --iw-space-6: 1.5rem;
59
+ --iw-space-8: 2rem;
60
+ --iw-space-10: 2.5rem;
61
+ --iw-space-12: 3rem;
62
+ --iw-space-16: 4rem;
63
+ --iw-space-20: 5rem;
64
+ --iw-space-24: 6rem;
65
+
66
+ /* ========================================
67
+ BORDER RADIUS
68
+ ======================================== */
69
+ --iw-radius-none: 0;
70
+ --iw-radius-sm: 2px;
71
+ --iw-radius-md: 4px;
72
+ --iw-radius-lg: 8px;
73
+ --iw-radius-xl: 12px;
74
+ --iw-radius-2xl: 16px;
75
+ --iw-radius-full: 9999px;
76
+
77
+ /* ========================================
78
+ TYPOGRAPHY
79
+ ======================================== */
80
+ --iw-font-family-sans:
81
+ system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
82
+ "Helvetica Neue", Arial, sans-serif;
83
+ --iw-font-family-mono:
84
+ ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
85
+ monospace;
86
+
87
+ --iw-font-size-xs: 0.75rem;
88
+ --iw-font-size-sm: 0.875rem;
89
+ --iw-font-size-base: 1rem;
90
+ --iw-font-size-lg: 1.125rem;
91
+ --iw-font-size-xl: 1.25rem;
92
+ --iw-font-size-2xl: 1.5rem;
93
+ --iw-font-size-3xl: 1.875rem;
94
+ --iw-font-size-4xl: 2.25rem;
95
+
96
+ --iw-font-weight-normal: 400;
97
+ --iw-font-weight-medium: 500;
98
+ --iw-font-weight-semibold: 600;
99
+ --iw-font-weight-bold: 700;
100
+
101
+ --iw-line-height-tight: 1.25;
102
+ --iw-line-height-normal: 1.5;
103
+ --iw-line-height-relaxed: 1.75;
104
+
105
+ /* ========================================
106
+ SHADOWS
107
+ ======================================== */
108
+ --iw-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
109
+ --iw-shadow-md:
110
+ 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
111
+ --iw-shadow-lg:
112
+ 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
113
+ --iw-shadow-xl:
114
+ 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
115
+
116
+ /* ========================================
117
+ TRANSITIONS
118
+ ======================================== */
119
+ --iw-transition-fast: 150ms ease;
120
+ --iw-transition-normal: 200ms ease;
121
+ --iw-transition-slow: 300ms ease;
122
+
123
+ /* ========================================
124
+ Z-INDEX SCALE
125
+ ======================================== */
126
+ --iw-z-dropdown: 1000;
127
+ --iw-z-sticky: 1020;
128
+ --iw-z-fixed: 1030;
129
+ --iw-z-modal-backdrop: 1040;
130
+ --iw-z-modal: 1050;
131
+ --iw-z-popover: 1060;
132
+ --iw-z-tooltip: 1070;
133
+ }
@@ -0,0 +1,135 @@
1
+ import { html } from "@inglorious/web"
2
+
3
+ import {
4
+ makeStoryRender,
5
+ notifyActionArgType,
6
+ } from "../../stories/notifyStory.js"
7
+ import { card } from "."
8
+
9
+ export default {
10
+ title: "Widgets/Card",
11
+ tags: ["autodocs"],
12
+ render: makeStoryRender(card, "story-card"),
13
+ argTypes: {
14
+ ...notifyActionArgType,
15
+ title: {
16
+ control: "text",
17
+ description: "Primary header text.",
18
+ },
19
+ subtitle: {
20
+ control: "text",
21
+ description: "Secondary header text.",
22
+ },
23
+ hoverable: {
24
+ control: "boolean",
25
+ description: "Enables hover visual feedback.",
26
+ },
27
+ clickable: {
28
+ control: "boolean",
29
+ description: "Marks the card as interactive and emits click events.",
30
+ },
31
+ fullWidth: {
32
+ control: "boolean",
33
+ description: "Expands card width to 100% of its container.",
34
+ },
35
+ },
36
+ parameters: {
37
+ docs: {
38
+ description: {
39
+ component:
40
+ "Container widget with overridable header/body/footer sub-renderers.",
41
+ },
42
+ },
43
+ actions: {
44
+ handles: ["click"],
45
+ },
46
+ },
47
+ }
48
+ export const Default = {}
49
+ Default.args = {
50
+ title: "Card Title",
51
+ subtitle: "This is a card subtitle",
52
+ hoverable: false,
53
+ clickable: false,
54
+ fullWidth: false,
55
+ }
56
+
57
+ export const Hoverable = {}
58
+ Hoverable.args = {
59
+ ...Default.args,
60
+ hoverable: true,
61
+ }
62
+
63
+ export const Clickable = {}
64
+ Clickable.args = {
65
+ ...Default.args,
66
+ hoverable: true,
67
+ clickable: true,
68
+ }
69
+
70
+ const cardWithFooter = [
71
+ ...card,
72
+ {
73
+ renderFooter(entity, api) {
74
+ return html`<div
75
+ class="iw-card-footer"
76
+ style="display: flex; gap: 0.5rem;"
77
+ >
78
+ ${entity.footerActions?.map(
79
+ (action) =>
80
+ html`<button
81
+ class="iw-button iw-button-sm ${action.variant === "ghost"
82
+ ? "iw-button-ghost"
83
+ : ""}"
84
+ @click=${() => api.notify(`#${entity.id}:${action.event}`)}
85
+ >
86
+ ${action.label}
87
+ </button>`,
88
+ )}
89
+ </div>`
90
+ },
91
+ },
92
+ ]
93
+
94
+ export const WithFooter = {}
95
+ WithFooter.render = makeStoryRender(cardWithFooter, "card-footer", {
96
+ resolveByEntityType: true,
97
+ })
98
+ WithFooter.args = {
99
+ type: "cardWithFooter",
100
+ title: "Card with Footer",
101
+ subtitle: "This card has a footer section",
102
+ footerActions: [
103
+ { label: "Cancel", event: "cancel", variant: "ghost" },
104
+ { label: "Save", event: "save" },
105
+ ],
106
+ }
107
+
108
+ export const NoHeader = {}
109
+ NoHeader.args = {
110
+ title: null,
111
+ subtitle: null,
112
+ }
113
+
114
+ export const FullWidth = {}
115
+ FullWidth.args = {
116
+ ...Default.args,
117
+ fullWidth: true,
118
+ }
119
+
120
+ export const Interactive = {}
121
+ Interactive.render = makeStoryRender(cardWithFooter, "card-interactive", {
122
+ resolveByEntityType: true,
123
+ })
124
+ Interactive.args = {
125
+ type: "cardWithFooter",
126
+ title: "Interactive Card",
127
+ subtitle: "Hover, click, and trigger footer actions",
128
+ hoverable: true,
129
+ clickable: true,
130
+ fullWidth: false,
131
+ footerActions: [
132
+ { label: "Details", event: "details", variant: "ghost" },
133
+ { label: "Open", event: "open" },
134
+ ],
135
+ }
@@ -0,0 +1,4 @@
1
+ import { withRenderValidation } from "../../shared/withRenderValidation.js"
2
+ import * as renderers from "./template.js"
3
+
4
+ export const card = [{ ...renderers }, withRenderValidation]
@@ -0,0 +1,53 @@
1
+ .iw-card {
2
+ display: flex;
3
+ flex-direction: column;
4
+ background-color: var(--iw-card-bg);
5
+ border: 1px solid var(--iw-card-border);
6
+ border-radius: var(--iw-card-radius);
7
+ box-shadow: var(--iw-card-shadow);
8
+ overflow: hidden;
9
+ transition: all var(--iw-transition-normal);
10
+
11
+ &.iw-card-hoverable:hover {
12
+ box-shadow: var(--iw-card-shadow-hover);
13
+ }
14
+
15
+ &.iw-card-clickable {
16
+ cursor: pointer;
17
+ }
18
+
19
+ &.iw-card-full-width {
20
+ width: 100%;
21
+ }
22
+
23
+ .iw-card-header {
24
+ padding: var(--iw-space-4);
25
+ border-bottom: 1px solid var(--iw-color-border);
26
+ }
27
+
28
+ .iw-card-title {
29
+ margin: 0;
30
+ font-size: var(--iw-font-size-lg);
31
+ font-weight: var(--iw-font-weight-semibold);
32
+ color: var(--iw-color-text);
33
+ line-height: var(--iw-line-height-tight);
34
+ }
35
+
36
+ .iw-card-subtitle {
37
+ margin: var(--iw-space-1) 0 0;
38
+ font-size: var(--iw-font-size-sm);
39
+ color: var(--iw-color-text-secondary);
40
+ line-height: var(--iw-line-height-normal);
41
+ }
42
+
43
+ .iw-card-body {
44
+ padding: var(--iw-space-4);
45
+ flex: 1;
46
+ }
47
+
48
+ .iw-card-footer {
49
+ padding: var(--iw-space-4);
50
+ border-top: 1px solid var(--iw-color-border);
51
+ background-color: var(--iw-color-bg-secondary);
52
+ }
53
+ }