@oardi/css-utils 0.133.0 → 0.135.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@oardi/css-utils",
3
- "version": "0.133.0",
3
+ "version": "0.135.0",
4
4
  "breakpoints": { "sm": "576px", "md": "768px", "lg": "992px", "xl": "1200px", "xxl": "1400px" },
5
5
  "lifecycle": {
6
6
  "deprecated": [
@@ -726,6 +726,10 @@
726
726
  "btn",
727
727
  "card",
728
728
  "chip",
729
+ "combobox",
730
+ "combobox-empty",
731
+ "combobox-option",
732
+ "combobox-panel",
729
733
  "disabled",
730
734
  "drawer",
731
735
  "drawer-body",
@@ -766,6 +770,10 @@
766
770
  "range-slider",
767
771
  "required",
768
772
  "right",
773
+ "segmented-control",
774
+ "segmented-control-equal",
775
+ "segmented-control-input",
776
+ "segmented-control-option",
769
777
  "skeleton",
770
778
  "skeleton-aspect-square",
771
779
  "skeleton-aspect-video",
@@ -3,7 +3,7 @@
3
3
  > Generated automatically. Do not edit manually.
4
4
 
5
5
  - Package: `@oardi/css-utils`
6
- - Version: `0.133.0`
6
+ - Version: `0.135.0`
7
7
  - Source: public SCSS entry point and utility configuration
8
8
 
9
9
  ## Usage guidance
@@ -500,6 +500,10 @@ Classes:
500
500
  - `btn`
501
501
  - `card`
502
502
  - `chip`
503
+ - `combobox`
504
+ - `combobox-empty`
505
+ - `combobox-option`
506
+ - `combobox-panel`
503
507
  - `disabled`
504
508
  - `drawer`
505
509
  - `drawer-body`
@@ -540,6 +544,10 @@ Classes:
540
544
  - `range-slider`
541
545
  - `required`
542
546
  - `right`
547
+ - `segmented-control`
548
+ - `segmented-control-equal`
549
+ - `segmented-control-input`
550
+ - `segmented-control-option`
543
551
  - `skeleton`
544
552
  - `skeleton-aspect-square`
545
553
  - `skeleton-aspect-video`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oardi/css-utils",
3
- "version": "0.133.0",
3
+ "version": "0.135.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,84 @@
1
+ @use '../layers.scss';
2
+
3
+ @layer components {
4
+ .combobox {
5
+ --combobox-max-height: 16rem;
6
+ --combobox-available-height: calc(100vh - 1rem);
7
+ --combobox-padding: var(--spacer-1);
8
+ --combobox-bg-color: var(--bg-surface);
9
+ --combobox-color: var(--text-color);
10
+ --combobox-border-color: var(--border-color);
11
+ --combobox-border-radius: var(--border-radius);
12
+ --combobox-box-shadow: var(--shadow-lg);
13
+ --combobox-active-bg-color: var(--bg-surface-hover);
14
+ --combobox-selected-color: var(--action-color);
15
+ --combobox-z-index: var(--z-index-tooltip);
16
+ }
17
+
18
+ .combobox-panel {
19
+ position: fixed;
20
+ z-index: var(--combobox-z-index);
21
+ inset: auto;
22
+ box-sizing: border-box;
23
+ max-block-size: min(var(--combobox-max-height), var(--combobox-available-height));
24
+ margin: 0;
25
+ padding: var(--combobox-padding);
26
+ border: var(--border-width) solid var(--combobox-border-color);
27
+ border-radius: var(--combobox-border-radius);
28
+ background: var(--combobox-bg-color);
29
+ color: var(--combobox-color);
30
+ box-shadow: var(--combobox-box-shadow);
31
+ overflow: auto;
32
+ overscroll-behavior: contain;
33
+
34
+ &[hidden] {
35
+ display: none;
36
+ }
37
+ }
38
+
39
+ .combobox-option,
40
+ .combobox-empty {
41
+ padding: var(--spacer-2) var(--spacer-3);
42
+ overflow-wrap: anywhere;
43
+ }
44
+
45
+ .combobox-option {
46
+ border-radius: var(--border-radius-sm);
47
+ cursor: pointer;
48
+
49
+ &[data-combobox-active],
50
+ &:hover {
51
+ background: var(--combobox-active-bg-color);
52
+ }
53
+
54
+ &[aria-selected='true'] {
55
+ color: var(--combobox-selected-color);
56
+ font-weight: 600;
57
+ }
58
+ &[aria-disabled='true'] {
59
+ color: var(--disabled-text-color);
60
+ background: transparent;
61
+ cursor: not-allowed;
62
+ }
63
+ }
64
+
65
+ .combobox-empty {
66
+ color: var(--text-muted);
67
+ }
68
+
69
+ @media (forced-colors: active) {
70
+ .combobox-panel {
71
+ border-color: CanvasText;
72
+ }
73
+ .combobox-option[data-combobox-active] {
74
+ outline: 2px solid Highlight;
75
+ outline-offset: -2px;
76
+ }
77
+ .combobox-option[aria-selected='true'] {
78
+ color: LinkText;
79
+ }
80
+ .combobox-option[aria-disabled='true'] {
81
+ color: GrayText;
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,90 @@
1
+ @use '../layers.scss';
2
+ @use './button.scss';
3
+
4
+ @layer components {
5
+ .segmented-control {
6
+ --segmented-control-gap: var(--spacer-1);
7
+
8
+ display: inline-flex;
9
+ flex-wrap: wrap;
10
+ gap: var(--segmented-control-gap);
11
+ max-inline-size: 100%;
12
+ }
13
+
14
+ .segmented-control-option {
15
+ position: relative;
16
+ display: flex;
17
+ min-inline-size: 0;
18
+
19
+ > .btn {
20
+ flex: 1;
21
+ min-inline-size: 0;
22
+ overflow-wrap: anywhere;
23
+ }
24
+ }
25
+
26
+ .segmented-control-input {
27
+ // Keep the native radio focusable and available to forms and assistive technology.
28
+ position: absolute;
29
+ inset-block-start: 0;
30
+ inset-inline-start: 0;
31
+ inline-size: 1px;
32
+ block-size: 1px;
33
+ padding: 0;
34
+ margin: 0;
35
+ overflow: hidden;
36
+ clip-path: inset(50%);
37
+ white-space: nowrap;
38
+ border: 0;
39
+
40
+ &:checked + .btn {
41
+ color: var(--button-on-color);
42
+ background-color: var(--button-surface-color);
43
+ border-color: var(--button-surface-color);
44
+ text-decoration: underline;
45
+ text-underline-offset: 0.2em;
46
+ }
47
+
48
+ &:focus-visible + .btn {
49
+ outline: var(--button-focus-outline-width) var(--button-focus-outline-style)
50
+ var(--button-focus-outline-color);
51
+ outline-offset: var(--button-focus-outline-offset);
52
+ }
53
+
54
+ &:disabled + .btn {
55
+ color: var(--button-disabled-text-color);
56
+ background-color: var(--button-disabled-bg-color);
57
+ border-color: var(--button-disabled-border-color);
58
+ cursor: not-allowed;
59
+ }
60
+ }
61
+
62
+ .segmented-control-equal {
63
+ display: flex;
64
+
65
+ > .segmented-control-option {
66
+ flex: 1 1 0;
67
+ }
68
+ }
69
+
70
+ @media (forced-colors: active) {
71
+ .segmented-control-input {
72
+ &:checked + .btn {
73
+ forced-color-adjust: none;
74
+ color: HighlightText;
75
+ background-color: Highlight;
76
+ border-color: Highlight;
77
+ }
78
+
79
+ &:focus-visible + .btn {
80
+ outline-color: Highlight;
81
+ }
82
+
83
+ &:disabled + .btn {
84
+ color: GrayText;
85
+ background-color: Canvas;
86
+ border-color: GrayText;
87
+ }
88
+ }
89
+ }
90
+ }
package/scss/index.scss CHANGED
@@ -46,8 +46,10 @@
46
46
  @forward './components/overlay.scss';
47
47
  @forward './components/pagination.scss';
48
48
  @forward './components/popover.scss';
49
+ @forward './components/combobox.scss';
49
50
  @forward './components/progress.scss';
50
51
  @forward './components/range-slider.scss';
52
+ @forward './components/segmented-control.scss';
51
53
  @forward './components/skeleton.scss';
52
54
  @forward './components/stepper.scss';
53
55
  @forward './components/table.scss';