@oardi/css-utils 0.109.0 → 0.111.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oardi/css-utils",
3
- "version": "0.109.0",
3
+ "version": "0.111.0",
4
4
  "author": "Ardian Shala",
5
5
  "homepage": "https://css-utils.oardi.com",
6
6
  "description": "Powerful set of semantic css classes with support for breakpoints, directions and spacings",
@@ -0,0 +1,194 @@
1
+ @use '../layers.scss';
2
+
3
+ @layer components {
4
+ .input-group {
5
+ --input-group-bg-color: var(--bg-surface);
6
+ --input-group-border-width: var(--border-width);
7
+ --input-group-border-color: var(--control-border-color);
8
+ --input-group-border-radius: var(--border-radius-lg);
9
+ --input-group-box-shadow: var(--shadow-sm);
10
+ --input-group-color: var(--text-color);
11
+ --input-group-addon-bg-color: var(--bg-highlight);
12
+ --input-group-addon-color: var(--text-muted);
13
+ --input-group-inset: var(--spacer-1);
14
+ --input-group-gap: var(--spacer-1);
15
+ --input-group-item-border-radius: calc(
16
+ var(--input-group-border-radius) - var(--input-group-inset)
17
+ );
18
+ --input-group-padding-y: var(--spacer-1);
19
+ --input-group-padding-x: var(--spacer-3);
20
+ --input-group-font-size: var(--font-size);
21
+ --input-group-control-min-size: 8rem;
22
+ --input-group-focus-border-color: var(--primary-hover);
23
+ --input-group-focus-outline-width: var(--focus-outline-width);
24
+ --input-group-focus-outline-style: var(--focus-outline-style);
25
+ --input-group-focus-outline-color: var(--focus-outline-color);
26
+ --input-group-focus-outline-offset: var(--focus-offset);
27
+ --input-group-invalid-color: var(--error);
28
+ --input-group-disabled-text-color: var(--disabled-text-color);
29
+ --input-group-disabled-bg-color: var(--disabled-bg-color);
30
+ --input-group-disabled-border-color: var(--disabled-border-color);
31
+ --input-group-transition-duration: var(--transition-duration);
32
+ --input-group-transition-easing: var(--transition-easing);
33
+
34
+ display: flex;
35
+ flex-wrap: wrap;
36
+ align-items: stretch;
37
+ gap: var(--input-group-gap);
38
+ max-inline-size: 100%;
39
+ padding: var(--input-group-inset);
40
+ color: var(--input-group-color);
41
+ background-color: var(--input-group-bg-color);
42
+ border: var(--input-group-border-width) solid var(--input-group-border-color);
43
+ border-radius: var(--input-group-border-radius);
44
+ box-shadow: var(--input-group-box-shadow);
45
+ overflow: clip;
46
+
47
+ transition:
48
+ background-color var(--input-group-transition-duration)
49
+ var(--input-group-transition-easing),
50
+ border-color var(--input-group-transition-duration) var(--input-group-transition-easing),
51
+ box-shadow var(--input-group-transition-duration) var(--input-group-transition-easing),
52
+ outline-offset var(--input-group-transition-duration)
53
+ var(--input-group-transition-easing);
54
+
55
+ > :where(.form-control, .form-select, .input-group-text, .btn, .icon-btn) {
56
+ margin: 0;
57
+ border: 0;
58
+ border-radius: var(--input-group-item-border-radius);
59
+ }
60
+
61
+ > :where(.form-control, .form-select) {
62
+ flex: 1 1 var(--input-group-control-min-size);
63
+ inline-size: 1%;
64
+ min-inline-size: min(100%, var(--input-group-control-min-size));
65
+ --form-control-bg-color: transparent;
66
+ --form-control-padding-y: var(--input-group-padding-y);
67
+ --form-control-padding-x: var(--input-group-padding-x);
68
+ --form-control-font-size: var(--input-group-font-size);
69
+ --form-select-bg-color: transparent;
70
+ --form-select-padding-y: var(--input-group-padding-y);
71
+ --form-select-padding-x: var(--input-group-padding-x);
72
+ --form-select-font-size: var(--input-group-font-size);
73
+ }
74
+
75
+ > :is(.form-control, .form-select):is(:focus, :focus-visible, .is-focus-visible) {
76
+ outline: 0;
77
+ outline-offset: 0;
78
+ }
79
+
80
+ > .input-group-text {
81
+ display: inline-flex;
82
+ align-items: center;
83
+ justify-content: center;
84
+ flex: 0 0 auto;
85
+ min-inline-size: 0;
86
+ padding: var(--input-group-padding-y) var(--input-group-padding-x);
87
+ color: var(--input-group-addon-color);
88
+ background-color: var(--input-group-addon-bg-color);
89
+ font-size: var(--input-group-font-size);
90
+ line-height: var(--line-height);
91
+ white-space: nowrap;
92
+
93
+ > svg {
94
+ inline-size: 1em;
95
+ block-size: 1em;
96
+ fill: currentColor;
97
+ }
98
+ }
99
+
100
+ > :where(.btn, .icon-btn) {
101
+ flex: 0 0 auto;
102
+ --button-border-radius: var(--input-group-item-border-radius);
103
+ --button-padding-y: var(--input-group-padding-y);
104
+ --button-padding-x: var(--input-group-padding-x);
105
+ --button-font-size: var(--input-group-font-size);
106
+ --icon-button-border-radius: var(--input-group-item-border-radius);
107
+ --icon-button-size: auto;
108
+ --icon-button-padding: var(--input-group-padding-y);
109
+ }
110
+
111
+ &:focus-within,
112
+ &:has(> .is-focus-visible) {
113
+ border-color: var(--input-group-focus-border-color);
114
+ outline: var(--input-group-focus-outline-width) var(--input-group-focus-outline-style)
115
+ var(--input-group-focus-outline-color);
116
+ outline-offset: var(--input-group-focus-outline-offset);
117
+ }
118
+
119
+ &:has(> :is(.form-control, .form-select).is-invalid),
120
+ &:has(> :is(.form-control, .form-select)[aria-invalid='true']) {
121
+ border-color: var(--input-group-invalid-color);
122
+
123
+ &:focus-within,
124
+ &:has(> .is-focus-visible) {
125
+ outline-color: var(--input-group-invalid-color);
126
+ }
127
+ }
128
+
129
+ &:has(> .form-control:disabled),
130
+ &:has(> .form-select:disabled) {
131
+ color: var(--input-group-disabled-text-color);
132
+ background-color: var(--input-group-disabled-bg-color);
133
+ border-color: var(--input-group-disabled-border-color);
134
+ box-shadow: none;
135
+
136
+ > .input-group-text {
137
+ color: var(--input-group-disabled-text-color);
138
+ background-color: var(--input-group-disabled-bg-color);
139
+ }
140
+ }
141
+ }
142
+
143
+ .was-validated .input-group:has(> :is(.form-control, .form-select):invalid) {
144
+ border-color: var(--input-group-invalid-color);
145
+
146
+ &:focus-within {
147
+ outline-color: var(--input-group-invalid-color);
148
+ }
149
+ }
150
+
151
+ .input-group:has(> :is(.form-control, .form-select).is-invalid) + .invalid-feedback,
152
+ .input-group:has(> :is(.form-control, .form-select)[aria-invalid='true']) + .invalid-feedback,
153
+ .was-validated
154
+ .input-group:has(> :is(.form-control, .form-select):invalid)
155
+ + .invalid-feedback {
156
+ display: block;
157
+ }
158
+
159
+ .input-group-sm {
160
+ --input-group-padding-y: var(--spacer-0);
161
+ --input-group-padding-x: var(--spacer-2);
162
+ --input-group-font-size: var(--font-size-sm);
163
+ --input-group-control-min-size: 7rem;
164
+ }
165
+
166
+ .input-group-lg {
167
+ --input-group-padding-y: var(--spacer-2);
168
+ --input-group-padding-x: var(--spacer-4);
169
+ --input-group-font-size: var(--font-size-lg);
170
+ --input-group-control-min-size: 10rem;
171
+ }
172
+
173
+ @media (forced-colors: active) {
174
+ .input-group {
175
+ border-color: CanvasText;
176
+
177
+ &:focus-within,
178
+ &:has(> .is-focus-visible) {
179
+ border-color: Highlight;
180
+ outline-color: Highlight;
181
+ }
182
+
183
+ &:has(> :is(.form-control, .form-select).is-invalid),
184
+ &:has(> :is(.form-control, .form-select)[aria-invalid='true']) {
185
+ border-color: LinkText;
186
+ }
187
+
188
+ &:has(> .form-control:disabled),
189
+ &:has(> .form-select:disabled) {
190
+ border-color: GrayText;
191
+ }
192
+ }
193
+ }
194
+ }
package/scss/index.scss CHANGED
@@ -36,6 +36,7 @@
36
36
  @forward './components/expansion-panel.scss';
37
37
  @forward './components/form.scss';
38
38
  @forward './components/icon-button.scss';
39
+ @forward './components/input-group.scss';
39
40
  @forward './components/list.scss';
40
41
  @forward './components/menu.scss';
41
42
  @forward './components/modal.scss';
package/scss/theme.scss CHANGED
@@ -1,159 +1,169 @@
1
1
  @use 'sass:map';
2
2
 
3
- $spacer: 1rem;
3
+ $-spacer: 1rem;
4
4
 
5
- $default-theme: (
6
- colors: (
7
- 'primary': (
8
- base: #8151dd,
9
- hover: #7c4cd9,
10
- active: #6f3bd2,
11
- on: #ffffff,
12
- ),
13
- 'secondary': (
14
- base: #526070,
15
- hover: #465362,
16
- active: #394551,
17
- on: #ffffff,
18
- ),
19
- 'success': (
20
- base: #087f5b,
21
- hover: #06704f,
22
- active: #055f43,
23
- on: #ffffff,
24
- ),
25
- 'warning': (
26
- base: #b45309,
27
- hover: #994407,
28
- active: #7c3605,
29
- on: #ffffff,
30
- ),
31
- 'error': (
32
- base: #d13a4b,
33
- hover: #bb2f40,
34
- active: #a22636,
35
- on: #ffffff,
36
- ),
5
+ $-colors: (
6
+ 'primary': (
7
+ base: #8151dd,
8
+ hover: #7c4cd9,
9
+ active: #6f3bd2,
10
+ on: #ffffff,
37
11
  ),
38
- dark-colors: (
39
- 'primary': (
40
- base: #ccb4f7,
41
- hover: #d6c1f8,
42
- active: #e2d3fb,
43
- on: #1a1a1a,
44
- ),
45
- 'secondary': (
46
- base: #aeb9c7,
47
- hover: #c0c9d4,
48
- active: #d1d8e0,
49
- on: #1a1a1a,
50
- ),
51
- 'success': (
52
- base: #58d3a1,
53
- hover: #72ddb2,
54
- active: #8ce6c3,
55
- on: #1a1a1a,
56
- ),
57
- 'warning': (
58
- base: #f4bf4f,
59
- hover: #f7cd70,
60
- active: #f9da91,
61
- on: #000000,
62
- ),
63
- 'error': (
64
- base: #fa8793,
65
- hover: #fba0aa,
66
- active: #fcb8bf,
67
- on: #1a1a1a,
68
- ),
12
+ 'secondary': (
13
+ base: #526070,
14
+ hover: #465362,
15
+ active: #394551,
16
+ on: #ffffff,
69
17
  ),
70
- grays: (
71
- 50: hsl(0, 0%, 95%),
72
- 100: hsl(0, 0%, 90%),
73
- 150: hsl(0, 0%, 85%),
74
- 200: hsl(0, 0%, 80%),
75
- 250: hsl(0, 0%, 75%),
76
- 300: hsl(0, 0%, 70%),
77
- 350: hsl(0, 0%, 65%),
78
- 400: hsl(0, 0%, 60%),
79
- 450: hsl(0, 0%, 55%),
80
- 500: hsl(0, 0%, 50%),
81
- 550: hsl(0, 0%, 45%),
82
- 600: hsl(0, 0%, 40%),
83
- 650: hsl(0, 0%, 35%),
84
- 700: hsl(0, 0%, 30%),
85
- 750: hsl(0, 0%, 25%),
86
- 800: hsl(0, 0%, 20%),
87
- 850: hsl(0, 0%, 15%),
88
- 900: hsl(0, 0%, 10%),
89
- 950: hsl(0, 0%, 5%),
18
+ 'success': (
19
+ base: #087f5b,
20
+ hover: #06704f,
21
+ active: #055f43,
22
+ on: #ffffff,
90
23
  ),
91
- directions: (
92
- t: top,
93
- e: inline-end,
94
- b: bottom,
95
- s: inline-start,
96
- // add x for left and right
97
- // add y for top and bottom
24
+ 'warning': (
25
+ base: #b45309,
26
+ hover: #994407,
27
+ active: #7c3605,
28
+ on: #ffffff,
98
29
  ),
99
- spacings: (
100
- 0: 0,
101
- 1: $spacer * 0.25,
102
- 2: $spacer * 0.5,
103
- 3: $spacer,
104
- 4: $spacer * 1.5,
105
- 5: $spacer * 3,
106
- // add auto
30
+ 'error': (
31
+ base: #d13a4b,
32
+ hover: #bb2f40,
33
+ active: #a22636,
34
+ on: #ffffff,
107
35
  ),
108
- positions: (
109
- relative,
110
- absolute,
111
- fixed,
112
- static,
113
- sticky,
114
- inherit,
115
- initial,
116
- unset,
36
+ );
37
+
38
+ $-dark-colors: (
39
+ 'primary': (
40
+ base: #ccb4f7,
41
+ hover: #d6c1f8,
42
+ active: #e2d3fb,
43
+ on: #1a1a1a,
117
44
  ),
118
- zIndexLevels: (
119
- n1: -1,
120
- 0: 0,
121
- 1: 1,
122
- 2: 2,
123
- 3: 3,
124
- header: 1000,
125
- tooltip: 1010,
126
- overlay: 1040,
127
- drawer: 1050,
128
- toast: 1060,
45
+ 'secondary': (
46
+ base: #aeb9c7,
47
+ hover: #c0c9d4,
48
+ active: #d1d8e0,
49
+ on: #1a1a1a,
129
50
  ),
130
- breakpoints: (
131
- sm: 576px,
132
- md: 768px,
133
- lg: 992px,
134
- xl: 1200px,
135
- xxl: 1400px,
51
+ 'success': (
52
+ base: #58d3a1,
53
+ hover: #72ddb2,
54
+ active: #8ce6c3,
55
+ on: #1a1a1a,
136
56
  ),
137
- lineHeights: (
138
- xs: 1,
139
- sm: 1.125,
140
- md: 1.25,
141
- lg: 1.5,
142
- xl: 1.75,
143
- xxl: 2,
144
- xxxl: 2.5,
57
+ 'warning': (
58
+ base: #f4bf4f,
59
+ hover: #f7cd70,
60
+ active: #f9da91,
61
+ on: #000000,
145
62
  ),
146
- fontSizes: (
147
- xs: 0.75rem,
148
- sm: 0.875rem,
149
- md: 1rem,
150
- lg: 1.125rem,
151
- xl: 1.25rem,
152
- xxl: 1.5rem,
153
- xxxl: 2rem,
63
+ 'error': (
64
+ base: #fa8793,
65
+ hover: #fba0aa,
66
+ active: #fcb8bf,
67
+ on: #1a1a1a,
154
68
  ),
155
69
  );
156
70
 
71
+ $-grays: (
72
+ 50: hsl(0, 0%, 95%),
73
+ 100: hsl(0, 0%, 90%),
74
+ 150: hsl(0, 0%, 85%),
75
+ 200: hsl(0, 0%, 80%),
76
+ 250: hsl(0, 0%, 75%),
77
+ 300: hsl(0, 0%, 70%),
78
+ 350: hsl(0, 0%, 65%),
79
+ 400: hsl(0, 0%, 60%),
80
+ 450: hsl(0, 0%, 55%),
81
+ 500: hsl(0, 0%, 50%),
82
+ 550: hsl(0, 0%, 45%),
83
+ 600: hsl(0, 0%, 40%),
84
+ 650: hsl(0, 0%, 35%),
85
+ 700: hsl(0, 0%, 30%),
86
+ 750: hsl(0, 0%, 25%),
87
+ 800: hsl(0, 0%, 20%),
88
+ 850: hsl(0, 0%, 15%),
89
+ 900: hsl(0, 0%, 10%),
90
+ 950: hsl(0, 0%, 5%),
91
+ );
92
+
93
+ $-directions: (
94
+ t: top,
95
+ e: inline-end,
96
+ b: bottom,
97
+ s: inline-start,
98
+ // add x for left and right
99
+ // add y for top and bottom
100
+ );
101
+
102
+ $-spacings: (
103
+ 0: 0,
104
+ 1: $-spacer * 0.25,
105
+ 2: $-spacer * 0.5,
106
+ 3: $-spacer,
107
+ 4: $-spacer * 1.5,
108
+ 5: $-spacer * 3, // add auto
109
+ );
110
+
111
+ $-positions: (relative, absolute, fixed, static, sticky, inherit, initial, unset);
112
+
113
+ $-z-index-levels: (
114
+ n1: -1,
115
+ 0: 0,
116
+ 1: 1,
117
+ 2: 2,
118
+ 3: 3,
119
+ header: 1000,
120
+ tooltip: 1010,
121
+ overlay: 1040,
122
+ drawer: 1050,
123
+ toast: 1060,
124
+ );
125
+
126
+ $-breakpoints: (
127
+ sm: 576px,
128
+ md: 768px,
129
+ lg: 992px,
130
+ xl: 1200px,
131
+ xxl: 1400px,
132
+ );
133
+
134
+ $-line-heights: (
135
+ xs: 1,
136
+ sm: 1.125,
137
+ md: 1.25,
138
+ lg: 1.5,
139
+ xl: 1.75,
140
+ xxl: 2,
141
+ xxxl: 2.5,
142
+ );
143
+
144
+ $-font-sizes: (
145
+ xs: 0.75rem,
146
+ sm: 0.875rem,
147
+ md: 1rem,
148
+ lg: 1.125rem,
149
+ xl: 1.25rem,
150
+ xxl: 1.5rem,
151
+ xxxl: 2rem,
152
+ );
153
+
154
+ $default-theme: (
155
+ colors: $-colors,
156
+ dark-colors: $-dark-colors,
157
+ grays: $-grays,
158
+ directions: $-directions,
159
+ spacings: $-spacings,
160
+ positions: $-positions,
161
+ zIndexLevels: $-z-index-levels,
162
+ breakpoints: $-breakpoints,
163
+ lineHeights: $-line-heights,
164
+ fontSizes: $-font-sizes,
165
+ );
166
+
157
167
  $theme: () !default; // user overrides via with()
158
168
 
159
169
  $theme: map.deep-merge($default-theme, $theme);