commons-shared-web-ui 0.0.43 → 0.0.45

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 (29) hide show
  1. package/fesm2022/commons-shared-web-ui.mjs +1459 -1347
  2. package/fesm2022/commons-shared-web-ui.mjs.map +1 -1
  3. package/index.d.ts +49 -0
  4. package/package.json +1 -1
  5. package/src/lib/modules/alert/alert.theme.scss +84 -84
  6. package/src/lib/modules/button/button.theme.scss +120 -120
  7. package/src/lib/modules/configurable-form/configurable-form.theme.scss +77 -77
  8. package/src/lib/modules/confirmation-modal/confirmation-modal.theme.scss +86 -86
  9. package/src/lib/modules/filter/filter.theme.scss +91 -91
  10. package/src/lib/modules/filter-sidebar/filter-sidebar.theme.scss +37 -37
  11. package/src/lib/modules/filter-table-selector/filter-table-selector.theme.scss +36 -36
  12. package/src/lib/modules/form-builder/form-builder.theme.scss +212 -212
  13. package/src/lib/modules/form-components/components/checkbox/_theme.scss +62 -62
  14. package/src/lib/modules/form-components/components/datepicker/_theme.scss +81 -81
  15. package/src/lib/modules/form-components/components/dropdown/_theme.scss +90 -90
  16. package/src/lib/modules/form-components/components/input/_theme.scss +76 -76
  17. package/src/lib/modules/form-components/components/radio/_theme.scss +60 -60
  18. package/src/lib/modules/form-components/components/search/_theme.scss +72 -72
  19. package/src/lib/modules/form-components/components/toggle/_theme.scss +44 -44
  20. package/src/lib/modules/form-components/form-components.theme.scss +24 -24
  21. package/src/lib/modules/nav/nav.theme.scss +86 -86
  22. package/src/lib/modules/pagination/pagination.theme.scss +66 -66
  23. package/src/lib/modules/side-nav/side-nav.theme.scss +111 -111
  24. package/src/lib/modules/smart-form/smart-form.theme.scss +889 -889
  25. package/src/lib/modules/smart-table/smart-table.theme.scss +335 -335
  26. package/src/lib/modules/snackbar/snackbar.theme.scss +93 -93
  27. package/src/lib/modules/summary-card/summary-card.theme.scss +175 -175
  28. package/src/lib/styles/global.scss +151 -151
  29. package/src/lib/styles/utilities.scss +250 -250
package/index.d.ts CHANGED
@@ -300,6 +300,7 @@ interface FieldConfig {
300
300
  phoneConfig?: PhoneConfig;
301
301
  numberConfig?: NumberConfig;
302
302
  dateConfig?: DateConfig;
303
+ timeConfig?: TimeConfig;
303
304
  optionConfig?: OptionConfig$1;
304
305
  autocompleteConfig?: AutocompleteConfig;
305
306
  generatedConfig?: GeneratedConfig;
@@ -336,6 +337,8 @@ interface NumberConfig {
336
337
  }
337
338
  interface DateConfig {
338
339
  allowFuture?: boolean;
340
+ /** When false, dates before today are disabled (today is the minimum). When true (default), all past dates are allowed. */
341
+ allowPast?: boolean;
339
342
  minDate?: string;
340
343
  maxDate?: string;
341
344
  /** When true, the text input is readonly (picker-only, no keyboard entry). */
@@ -343,6 +346,20 @@ interface DateConfig {
343
346
  /** Name of a sibling field whose value is used as the dynamic minimum date. */
344
347
  minDateField?: string;
345
348
  }
349
+ interface TimeConfig {
350
+ /** Explicit minimum time in "HH:mm" 24-hour format (e.g. "09:00"). */
351
+ minTime?: string;
352
+ /** Explicit maximum time in "HH:mm" 24-hour format (e.g. "18:00"). */
353
+ maxTime?: string;
354
+ /** When true, the input is readonly. */
355
+ inputReadonly?: boolean;
356
+ /**
357
+ * Name of a sibling TIME field whose value is used as the dynamic minimum time.
358
+ * When the sibling changes, this field's minimum updates and any now-invalid
359
+ * value (earlier than the new minimum) is cleared. Mirrors DateConfig.minDateField.
360
+ */
361
+ minTimeField?: string;
362
+ }
346
363
  interface OptionConfig$1 {
347
364
  optionClass?: string;
348
365
  optionUrl?: string;
@@ -1461,6 +1478,21 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
1461
1478
  isVisible: boolean;
1462
1479
  showPassword: boolean;
1463
1480
  dynamicMinDate: string | null;
1481
+ dynamicMinTime: string | null;
1482
+ /**
1483
+ * Effective minimum date for the datepicker.
1484
+ * Priority: dynamic (sibling field) → explicit minDate → today (when allowPast is false).
1485
+ * When allowPast is not false, past dates stay allowed unless an explicit min is set.
1486
+ */
1487
+ get effectiveMinDate(): string | null;
1488
+ /**
1489
+ * Effective minimum time for the time input.
1490
+ * Priority: dynamic (sibling field) → explicit minTime.
1491
+ * Mirrors {@link effectiveMinDate} for TIME fields.
1492
+ */
1493
+ get effectiveMinTime(): string | null;
1494
+ /** Effective maximum time for the time input (explicit maxTime only). */
1495
+ get effectiveMaxTime(): string | null;
1464
1496
  isMultiDropdownOpen: boolean;
1465
1497
  isDragOver: boolean;
1466
1498
  fileUploadError: string;
@@ -1589,6 +1621,13 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
1589
1621
  setupMatchValidation(): void;
1590
1622
  setupVisibility(): void;
1591
1623
  setupMinDateField(): void;
1624
+ /**
1625
+ * Wires up a dynamic minimum for a TIME field from a sibling TIME field
1626
+ * (config.timeConfig.minTimeField). When the source changes, this field's
1627
+ * minimum updates and any now-invalid value (earlier than the new minimum)
1628
+ * is cleared. Mirrors {@link setupMinDateField} for TIME fields.
1629
+ */
1630
+ setupMinTimeField(): void;
1592
1631
  setupGeneratedField(): void;
1593
1632
  evaluateFormula(context: {
1594
1633
  [key: string]: any;
@@ -1599,6 +1638,16 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
1599
1638
  [key: string]: any;
1600
1639
  }): void;
1601
1640
  private getValueByPath;
1641
+ /**
1642
+ * Replaces `{placeholder}` tokens in a URL with values resolved from the
1643
+ * current form data (supports dot / array-index paths via getValueByPath).
1644
+ * Returns the interpolated URL plus whether EVERY token was resolved.
1645
+ *
1646
+ * Used by the delete flows: when a required id (e.g. `{entityId}`) is missing
1647
+ * — as in CREATE mode before the entity exists — `resolved` is false and the
1648
+ * caller skips the server delete and just removes the item from the form.
1649
+ */
1650
+ private resolveUrlPlaceholders;
1602
1651
  /** Builds HttpHeaders using the token stored in the SmartFormController (sourced from configJSON)
1603
1652
  * merged with any custom headers declared in optionConfig.headers.
1604
1653
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commons-shared-web-ui",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "20.3.15",
6
6
  "@angular/cdk": "20.2.14",
@@ -1,85 +1,85 @@
1
- @use 'sass:map';
2
-
3
- $default-alert-config: (
4
- font-family: ('Roboto', sans-serif),
5
-
6
- // Structure (Default values in rem, assuming 16px root)
7
- padding: 1rem 2rem,
8
- // 16px 32px
9
- radius: 0.75rem,
10
- // 12px
11
- gap: 1rem,
12
- // 16px
13
-
14
- // Icon
15
- icon-size: 1.25rem,
16
- // 20px
17
- icon-margin-top: 0.125rem,
18
- // 2px
19
-
20
- // Text
21
- title-size: 1rem,
22
- // 16px
23
- title-line-height: 1.5rem,
24
- // 24px
25
- message-size: 0.875rem,
26
- // 14px
27
-
28
- // Info
29
- info-bg: #F1F3F4,
30
- info-color: #3C4043,
31
-
32
- // Warning
33
- warning-bg: #F9C80E1F,
34
- warning-color: #3C4043,
35
- // Default text color for warning usually dark
36
- warning-title-color: #3C4043,
37
- // Making title dark for better contrast with light yellow bg
38
- warning-shadow: none,
39
- // Removing shadow as per clean flat design, or keeping if specified. User said "warning-shadow" variant exists.
40
-
41
- // Success
42
- success-bg: #E6F4EA,
43
- // Light green similar to Info/Error pattern
44
- success-color: #16A34A,
45
-
46
- // Error
47
- error-bg: #FCE8E6,
48
- // Light red
49
- error-color: #D93025
50
- );
51
-
52
- @mixin alert-theme($user-config: ()) {
53
- $config: map.merge($default-alert-config, $user-config);
54
-
55
- --cc-alert-font-family: #{map.get($config, font-family)};
56
-
57
- // Structure
58
- --cc-alert-padding: #{map.get($config, padding)};
59
- --cc-alert-radius: #{map.get($config, radius)};
60
- --cc-alert-gap: #{map.get($config, gap)};
61
-
62
- // Icon
63
- --cc-alert-icon-size: #{map.get($config, icon-size)};
64
- --cc-alert-icon-margin-top: #{map.get($config, icon-margin-top)};
65
-
66
- // Text
67
- --cc-alert-title-size: #{map.get($config, title-size)};
68
- --cc-alert-title-line-height: #{map.get($config, title-line-height)};
69
- --cc-alert-message-size: #{map.get($config, message-size)};
70
-
71
- // Colors
72
- --cc-alert-info-bg: #{map.get($config, info-bg)};
73
- --cc-alert-info-color: #{map.get($config, info-color)};
74
-
75
- --cc-alert-warning-bg: #{map.get($config, warning-bg)};
76
- --cc-alert-warning-color: #{map.get($config, warning-color)};
77
- --cc-alert-warning-title-color: #{map.get($config, warning-title-color)};
78
- --cc-alert-warning-shadow: #{map.get($config, warning-shadow)};
79
- --cc-alert-success-bg: #{map.get($config, success-bg)};
80
- --cc-alert-success-color: #{map.get($config, success-color)};
81
-
82
- --cc-alert-error-bg: #{map.get($config, error-bg)};
83
- --cc-alert-error-color: #{map.get($config, error-color)};
84
- --cc-alert-warning-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.25); // 0px 4px 4px
1
+ @use 'sass:map';
2
+
3
+ $default-alert-config: (
4
+ font-family: ('Roboto', sans-serif),
5
+
6
+ // Structure (Default values in rem, assuming 16px root)
7
+ padding: 1rem 2rem,
8
+ // 16px 32px
9
+ radius: 0.75rem,
10
+ // 12px
11
+ gap: 1rem,
12
+ // 16px
13
+
14
+ // Icon
15
+ icon-size: 1.25rem,
16
+ // 20px
17
+ icon-margin-top: 0.125rem,
18
+ // 2px
19
+
20
+ // Text
21
+ title-size: 1rem,
22
+ // 16px
23
+ title-line-height: 1.5rem,
24
+ // 24px
25
+ message-size: 0.875rem,
26
+ // 14px
27
+
28
+ // Info
29
+ info-bg: #F1F3F4,
30
+ info-color: #3C4043,
31
+
32
+ // Warning
33
+ warning-bg: #F9C80E1F,
34
+ warning-color: #3C4043,
35
+ // Default text color for warning usually dark
36
+ warning-title-color: #3C4043,
37
+ // Making title dark for better contrast with light yellow bg
38
+ warning-shadow: none,
39
+ // Removing shadow as per clean flat design, or keeping if specified. User said "warning-shadow" variant exists.
40
+
41
+ // Success
42
+ success-bg: #E6F4EA,
43
+ // Light green similar to Info/Error pattern
44
+ success-color: #16A34A,
45
+
46
+ // Error
47
+ error-bg: #FCE8E6,
48
+ // Light red
49
+ error-color: #D93025
50
+ );
51
+
52
+ @mixin alert-theme($user-config: ()) {
53
+ $config: map.merge($default-alert-config, $user-config);
54
+
55
+ --cc-alert-font-family: #{map.get($config, font-family)};
56
+
57
+ // Structure
58
+ --cc-alert-padding: #{map.get($config, padding)};
59
+ --cc-alert-radius: #{map.get($config, radius)};
60
+ --cc-alert-gap: #{map.get($config, gap)};
61
+
62
+ // Icon
63
+ --cc-alert-icon-size: #{map.get($config, icon-size)};
64
+ --cc-alert-icon-margin-top: #{map.get($config, icon-margin-top)};
65
+
66
+ // Text
67
+ --cc-alert-title-size: #{map.get($config, title-size)};
68
+ --cc-alert-title-line-height: #{map.get($config, title-line-height)};
69
+ --cc-alert-message-size: #{map.get($config, message-size)};
70
+
71
+ // Colors
72
+ --cc-alert-info-bg: #{map.get($config, info-bg)};
73
+ --cc-alert-info-color: #{map.get($config, info-color)};
74
+
75
+ --cc-alert-warning-bg: #{map.get($config, warning-bg)};
76
+ --cc-alert-warning-color: #{map.get($config, warning-color)};
77
+ --cc-alert-warning-title-color: #{map.get($config, warning-title-color)};
78
+ --cc-alert-warning-shadow: #{map.get($config, warning-shadow)};
79
+ --cc-alert-success-bg: #{map.get($config, success-bg)};
80
+ --cc-alert-success-color: #{map.get($config, success-color)};
81
+
82
+ --cc-alert-error-bg: #{map.get($config, error-bg)};
83
+ --cc-alert-error-color: #{map.get($config, error-color)};
84
+ --cc-alert-warning-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.25); // 0px 4px 4px
85
85
  }
@@ -1,121 +1,121 @@
1
- @use 'sass:map';
2
-
3
- // Default Button Configuration
4
- $default-button-config: (
5
- // Common
6
- font-family: ('Roboto', sans-serif),
7
- font-weight: 500,
8
- font-size: 1rem,
9
- // 16px
10
- padding: 0.5rem 1rem,
11
- // 8px 16px
12
-
13
- // Primary (Dark)
14
- primary-bg: #262125,
15
- primary-color: #FFFFFF,
16
- primary-radius: 0.5rem,
17
- // 8px
18
- primary-border: none,
19
-
20
- // Warning (Yellow)
21
- warning-bg: #F9C80E,
22
- warning-color: #000000,
23
- warning-radius: 0.25rem,
24
- // 4px
25
- warning-border: none,
26
-
27
- // Outline (Grey Outline)
28
- outline-bg: transparent,
29
- outline-color: #000000,
30
- outline-radius: 0.25rem,
31
- // 4px
32
- outline-border: 0.0625rem solid #BDC1C6,
33
- // 1px solid
34
-
35
- // Secondary (Light Grey)
36
- secondary-bg: #E8EAED,
37
- secondary-color: #000000,
38
- secondary-radius: 0.25rem,
39
- // 4px
40
- secondary-border: none,
41
-
42
- // Success (Green)
43
- success-bg: #16A34A,
44
- success-color: #FFFFFF,
45
- success-radius: 0.5rem,
46
- // 8px
47
- success-border: none,
48
-
49
- // Danger (Red)
50
- danger-bg: #E63E30,
51
- danger-color: #FFFFFF,
52
- danger-radius: 0.25rem,
53
- // 4px
54
- danger-border: none,
55
-
56
- // Danger Outline (Red Outline)
57
- danger-outline-bg: transparent,
58
- danger-outline-color: #E63E30,
59
- danger-outline-radius: 0.5rem,
60
- // 8px
61
- danger-outline-border: 0.0625rem solid #E63E30,
62
- // 1px solid
63
-
64
- // Disabled State
65
- disabled-opacity: 0.6,
66
- disabled-cursor: not-allowed
67
- );
68
-
69
- @mixin button-theme($user-config: ()) {
70
- $config: map.merge($default-button-config, $user-config);
71
-
72
- // Common
73
- --cc-btn-font-family: #{map.get($config, font-family)};
74
- --cc-btn-font-weight: #{map.get($config, font-weight)};
75
- --cc-btn-font-size: #{map.get($config, font-size)};
76
- --cc-btn-padding: #{map.get($config, padding)};
77
- --cc-btn-disabled-opacity: #{map.get($config, disabled-opacity)};
78
- --cc-btn-disabled-cursor: #{map.get($config, disabled-cursor)};
79
-
80
- // Primary
81
- --cc-btn-primary-bg: #{map.get($config, primary-bg)};
82
- --cc-btn-primary-color: #{map.get($config, primary-color)};
83
- --cc-btn-primary-radius: #{map.get($config, primary-radius)};
84
- --cc-btn-primary-border: #{map.get($config, primary-border)};
85
-
86
- // Warning
87
- --cc-btn-warning-bg: #{map.get($config, warning-bg)};
88
- --cc-btn-warning-color: #{map.get($config, warning-color)};
89
- --cc-btn-warning-radius: #{map.get($config, warning-radius)};
90
- --cc-btn-warning-border: #{map.get($config, warning-border)};
91
-
92
- // Outline
93
- --cc-btn-outline-bg: #{map.get($config, outline-bg)};
94
- --cc-btn-outline-color: #{map.get($config, outline-color)};
95
- --cc-btn-outline-radius: #{map.get($config, outline-radius)};
96
- --cc-btn-outline-border: #{map.get($config, outline-border)};
97
-
98
- // Secondary
99
- --cc-btn-secondary-bg: #{map.get($config, secondary-bg)};
100
- --cc-btn-secondary-color: #{map.get($config, secondary-color)};
101
- --cc-btn-secondary-radius: #{map.get($config, secondary-radius)};
102
- --cc-btn-secondary-border: #{map.get($config, secondary-border)};
103
-
104
- // Success
105
- --cc-btn-success-bg: #{map.get($config, success-bg)};
106
- --cc-btn-success-color: #{map.get($config, success-color)};
107
- --cc-btn-success-radius: #{map.get($config, success-radius)};
108
- --cc-btn-success-border: #{map.get($config, success-border)};
109
-
110
- // Danger
111
- --cc-btn-danger-bg: #{map.get($config, danger-bg)};
112
- --cc-btn-danger-color: #{map.get($config, danger-color)};
113
- --cc-btn-danger-radius: #{map.get($config, danger-radius)};
114
- --cc-btn-danger-border: #{map.get($config, danger-border)};
115
-
116
- // Danger Outline
117
- --cc-btn-danger-outline-bg: #{map.get($config, danger-outline-bg)};
118
- --cc-btn-danger-outline-color: #{map.get($config, danger-outline-color)};
119
- --cc-btn-danger-outline-radius: #{map.get($config, danger-outline-radius)};
120
- --cc-btn-danger-outline-border: #{map.get($config, danger-outline-border)};
1
+ @use 'sass:map';
2
+
3
+ // Default Button Configuration
4
+ $default-button-config: (
5
+ // Common
6
+ font-family: ('Roboto', sans-serif),
7
+ font-weight: 500,
8
+ font-size: 1rem,
9
+ // 16px
10
+ padding: 0.5rem 1rem,
11
+ // 8px 16px
12
+
13
+ // Primary (Dark)
14
+ primary-bg: #262125,
15
+ primary-color: #FFFFFF,
16
+ primary-radius: 0.5rem,
17
+ // 8px
18
+ primary-border: none,
19
+
20
+ // Warning (Yellow)
21
+ warning-bg: #F9C80E,
22
+ warning-color: #000000,
23
+ warning-radius: 0.25rem,
24
+ // 4px
25
+ warning-border: none,
26
+
27
+ // Outline (Grey Outline)
28
+ outline-bg: transparent,
29
+ outline-color: #000000,
30
+ outline-radius: 0.25rem,
31
+ // 4px
32
+ outline-border: 0.0625rem solid #BDC1C6,
33
+ // 1px solid
34
+
35
+ // Secondary (Light Grey)
36
+ secondary-bg: #E8EAED,
37
+ secondary-color: #000000,
38
+ secondary-radius: 0.25rem,
39
+ // 4px
40
+ secondary-border: none,
41
+
42
+ // Success (Green)
43
+ success-bg: #16A34A,
44
+ success-color: #FFFFFF,
45
+ success-radius: 0.5rem,
46
+ // 8px
47
+ success-border: none,
48
+
49
+ // Danger (Red)
50
+ danger-bg: #E63E30,
51
+ danger-color: #FFFFFF,
52
+ danger-radius: 0.25rem,
53
+ // 4px
54
+ danger-border: none,
55
+
56
+ // Danger Outline (Red Outline)
57
+ danger-outline-bg: transparent,
58
+ danger-outline-color: #E63E30,
59
+ danger-outline-radius: 0.5rem,
60
+ // 8px
61
+ danger-outline-border: 0.0625rem solid #E63E30,
62
+ // 1px solid
63
+
64
+ // Disabled State
65
+ disabled-opacity: 0.6,
66
+ disabled-cursor: not-allowed
67
+ );
68
+
69
+ @mixin button-theme($user-config: ()) {
70
+ $config: map.merge($default-button-config, $user-config);
71
+
72
+ // Common
73
+ --cc-btn-font-family: #{map.get($config, font-family)};
74
+ --cc-btn-font-weight: #{map.get($config, font-weight)};
75
+ --cc-btn-font-size: #{map.get($config, font-size)};
76
+ --cc-btn-padding: #{map.get($config, padding)};
77
+ --cc-btn-disabled-opacity: #{map.get($config, disabled-opacity)};
78
+ --cc-btn-disabled-cursor: #{map.get($config, disabled-cursor)};
79
+
80
+ // Primary
81
+ --cc-btn-primary-bg: #{map.get($config, primary-bg)};
82
+ --cc-btn-primary-color: #{map.get($config, primary-color)};
83
+ --cc-btn-primary-radius: #{map.get($config, primary-radius)};
84
+ --cc-btn-primary-border: #{map.get($config, primary-border)};
85
+
86
+ // Warning
87
+ --cc-btn-warning-bg: #{map.get($config, warning-bg)};
88
+ --cc-btn-warning-color: #{map.get($config, warning-color)};
89
+ --cc-btn-warning-radius: #{map.get($config, warning-radius)};
90
+ --cc-btn-warning-border: #{map.get($config, warning-border)};
91
+
92
+ // Outline
93
+ --cc-btn-outline-bg: #{map.get($config, outline-bg)};
94
+ --cc-btn-outline-color: #{map.get($config, outline-color)};
95
+ --cc-btn-outline-radius: #{map.get($config, outline-radius)};
96
+ --cc-btn-outline-border: #{map.get($config, outline-border)};
97
+
98
+ // Secondary
99
+ --cc-btn-secondary-bg: #{map.get($config, secondary-bg)};
100
+ --cc-btn-secondary-color: #{map.get($config, secondary-color)};
101
+ --cc-btn-secondary-radius: #{map.get($config, secondary-radius)};
102
+ --cc-btn-secondary-border: #{map.get($config, secondary-border)};
103
+
104
+ // Success
105
+ --cc-btn-success-bg: #{map.get($config, success-bg)};
106
+ --cc-btn-success-color: #{map.get($config, success-color)};
107
+ --cc-btn-success-radius: #{map.get($config, success-radius)};
108
+ --cc-btn-success-border: #{map.get($config, success-border)};
109
+
110
+ // Danger
111
+ --cc-btn-danger-bg: #{map.get($config, danger-bg)};
112
+ --cc-btn-danger-color: #{map.get($config, danger-color)};
113
+ --cc-btn-danger-radius: #{map.get($config, danger-radius)};
114
+ --cc-btn-danger-border: #{map.get($config, danger-border)};
115
+
116
+ // Danger Outline
117
+ --cc-btn-danger-outline-bg: #{map.get($config, danger-outline-bg)};
118
+ --cc-btn-danger-outline-color: #{map.get($config, danger-outline-color)};
119
+ --cc-btn-danger-outline-radius: #{map.get($config, danger-outline-radius)};
120
+ --cc-btn-danger-outline-border: #{map.get($config, danger-outline-border)};
121
121
  }
@@ -1,78 +1,78 @@
1
- @use 'sass:map';
2
-
3
- // Default configuration for the configurable form theme
4
- $default-configurable-form-config: (
5
- // Colors
6
- primary-color: #3B82F6,
7
- surface-background: #ffffff,
8
- border-color: #D1D5DB,
9
- text-primary: #111827,
10
- text-secondary: #6B7280,
11
- error-color: #DC2626,
12
- disabled-background: #F3F4F6,
13
- hover-background: #F9FAFB,
14
-
15
- // Inputs specific
16
- input-border-color: #D1D5DB,
17
- input-focus-border-color: #3B82F6,
18
- input-hover-border-color: #9CA3AF,
19
- input-bg: #ffffff,
20
-
21
- // Dimensions
22
- section-radius: 12px,
23
- section-padding: 2rem,
24
- section-spacing: 1.5rem,
25
- input-radius: 8px,
26
- input-padding-y: 0.625rem,
27
- input-padding-x: 0.875rem,
28
-
29
- // Typography
30
- font-family: (-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif),
31
- section-title-size: 1.25rem,
32
- section-title-weight: 600,
33
- label-size: 0.875rem,
34
- label-weight: 600,
35
- input-font-size: 0.875rem,
36
- hint-size: 0.75rem,
37
-
38
- // Shadows
39
- section-shadow: (0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)),
40
- );
41
-
42
- // Mixin to generate CSS variables for the configurable form component
43
- @mixin configurable-form-theme($user-config: ()) {
44
- // Merge user config with defaults
45
- $config: map.merge($default-configurable-form-config, $user-config);
46
-
47
- // Generate CSS Variables
48
- --cf-primary-color: #{map.get($config, primary-color)};
49
- --cf-surface-background: #{map.get($config, surface-background)};
50
- --cf-border-color: #{map.get($config, border-color)};
51
- --cf-text-primary: #{map.get($config, text-primary)};
52
- --cf-text-secondary: #{map.get($config, text-secondary)};
53
- --cf-error-color: #{map.get($config, error-color)};
54
- --cf-disabled-background: #{map.get($config, disabled-background)};
55
- --cf-hover-background: #{map.get($config, hover-background)};
56
-
57
- --cf-input-border-color: #{map.get($config, input-border-color)};
58
- --cf-input-focus-border-color: #{map.get($config, input-focus-border-color)};
59
- --cf-input-hover-border-color: #{map.get($config, input-hover-border-color)};
60
- --cf-input-bg: #{map.get($config, input-bg)};
61
-
62
- --cf-section-radius: #{map.get($config, section-radius)};
63
- --cf-section-padding: #{map.get($config, section-padding)};
64
- --cf-section-spacing: #{map.get($config, section-spacing)};
65
- --cf-input-radius: #{map.get($config, input-radius)};
66
- --cf-input-padding-y: #{map.get($config, input-padding-y)};
67
- --cf-input-padding-x: #{map.get($config, input-padding-x)};
68
-
69
- --cf-font-family: #{map.get($config, font-family)};
70
- --cf-section-title-size: #{map.get($config, section-title-size)};
71
- --cf-section-title-weight: #{map.get($config, section-title-weight)};
72
- --cf-label-size: #{map.get($config, label-size)};
73
- --cf-label-weight: #{map.get($config, label-weight)};
74
- --cf-input-font-size: #{map.get($config, input-font-size)};
75
- --cf-hint-size: #{map.get($config, hint-size)};
76
-
77
- --cf-section-shadow: #{map.get($config, section-shadow)};
1
+ @use 'sass:map';
2
+
3
+ // Default configuration for the configurable form theme
4
+ $default-configurable-form-config: (
5
+ // Colors
6
+ primary-color: #3B82F6,
7
+ surface-background: #ffffff,
8
+ border-color: #D1D5DB,
9
+ text-primary: #111827,
10
+ text-secondary: #6B7280,
11
+ error-color: #DC2626,
12
+ disabled-background: #F3F4F6,
13
+ hover-background: #F9FAFB,
14
+
15
+ // Inputs specific
16
+ input-border-color: #D1D5DB,
17
+ input-focus-border-color: #3B82F6,
18
+ input-hover-border-color: #9CA3AF,
19
+ input-bg: #ffffff,
20
+
21
+ // Dimensions
22
+ section-radius: 12px,
23
+ section-padding: 2rem,
24
+ section-spacing: 1.5rem,
25
+ input-radius: 8px,
26
+ input-padding-y: 0.625rem,
27
+ input-padding-x: 0.875rem,
28
+
29
+ // Typography
30
+ font-family: (-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif),
31
+ section-title-size: 1.25rem,
32
+ section-title-weight: 600,
33
+ label-size: 0.875rem,
34
+ label-weight: 600,
35
+ input-font-size: 0.875rem,
36
+ hint-size: 0.75rem,
37
+
38
+ // Shadows
39
+ section-shadow: (0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)),
40
+ );
41
+
42
+ // Mixin to generate CSS variables for the configurable form component
43
+ @mixin configurable-form-theme($user-config: ()) {
44
+ // Merge user config with defaults
45
+ $config: map.merge($default-configurable-form-config, $user-config);
46
+
47
+ // Generate CSS Variables
48
+ --cf-primary-color: #{map.get($config, primary-color)};
49
+ --cf-surface-background: #{map.get($config, surface-background)};
50
+ --cf-border-color: #{map.get($config, border-color)};
51
+ --cf-text-primary: #{map.get($config, text-primary)};
52
+ --cf-text-secondary: #{map.get($config, text-secondary)};
53
+ --cf-error-color: #{map.get($config, error-color)};
54
+ --cf-disabled-background: #{map.get($config, disabled-background)};
55
+ --cf-hover-background: #{map.get($config, hover-background)};
56
+
57
+ --cf-input-border-color: #{map.get($config, input-border-color)};
58
+ --cf-input-focus-border-color: #{map.get($config, input-focus-border-color)};
59
+ --cf-input-hover-border-color: #{map.get($config, input-hover-border-color)};
60
+ --cf-input-bg: #{map.get($config, input-bg)};
61
+
62
+ --cf-section-radius: #{map.get($config, section-radius)};
63
+ --cf-section-padding: #{map.get($config, section-padding)};
64
+ --cf-section-spacing: #{map.get($config, section-spacing)};
65
+ --cf-input-radius: #{map.get($config, input-radius)};
66
+ --cf-input-padding-y: #{map.get($config, input-padding-y)};
67
+ --cf-input-padding-x: #{map.get($config, input-padding-x)};
68
+
69
+ --cf-font-family: #{map.get($config, font-family)};
70
+ --cf-section-title-size: #{map.get($config, section-title-size)};
71
+ --cf-section-title-weight: #{map.get($config, section-title-weight)};
72
+ --cf-label-size: #{map.get($config, label-size)};
73
+ --cf-label-weight: #{map.get($config, label-weight)};
74
+ --cf-input-font-size: #{map.get($config, input-font-size)};
75
+ --cf-hint-size: #{map.get($config, hint-size)};
76
+
77
+ --cf-section-shadow: #{map.get($config, section-shadow)};
78
78
  }