@q1travel/design-system 0.7.0 → 0.7.2

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.
@@ -1111,6 +1111,17 @@
1111
1111
  background: var(--q1-color-bg-panel);
1112
1112
  box-shadow: var(--q1-shadow-popover);
1113
1113
  }
1114
+ .menu__popup[data-state] {
1115
+ --menu-motion-duration-enter: 180ms;
1116
+ --menu-motion-duration-exit: 140ms;
1117
+ --menu-motion-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
1118
+
1119
+ opacity: 1;
1120
+ transform: translateY(0) scale(1);
1121
+ transition:
1122
+ opacity var(--menu-motion-duration-enter) var(--menu-motion-ease-out),
1123
+ transform var(--menu-motion-duration-enter) var(--menu-motion-ease-out);
1124
+ }
1114
1125
  .menu__popup--start {
1115
1126
  left: 0;
1116
1127
  }
@@ -1124,6 +1135,46 @@
1124
1135
  .menu__popup--top {
1125
1136
  bottom: calc(100% + var(--q1-space-2));
1126
1137
  }
1138
+ .menu__popup[data-state].menu__popup--start.menu__popup--bottom {
1139
+ transform-origin: left top;
1140
+ }
1141
+ .menu__popup[data-state].menu__popup--end.menu__popup--bottom {
1142
+ transform-origin: right top;
1143
+ }
1144
+ .menu__popup[data-state].menu__popup--start.menu__popup--top {
1145
+ transform-origin: left bottom;
1146
+ }
1147
+ .menu__popup[data-state].menu__popup--end.menu__popup--top {
1148
+ transform-origin: right bottom;
1149
+ }
1150
+ .menu__popup[data-state='closed'] {
1151
+ opacity: 0;
1152
+ pointer-events: none;
1153
+ transition-duration: var(--menu-motion-duration-exit);
1154
+ }
1155
+ .menu__popup--bottom[data-state='closed'] {
1156
+ transform: translateY(calc(0px - var(--q1-space-1))) scale(0.98);
1157
+ }
1158
+ .menu__popup--top[data-state='closed'] {
1159
+ transform: translateY(var(--q1-space-1)) scale(0.98);
1160
+ }
1161
+ @starting-style {
1162
+ .menu__popup[data-state='open'] {
1163
+ opacity: 0;
1164
+ }
1165
+ .menu__popup--bottom[data-state='open'] {
1166
+ transform: translateY(calc(0px - var(--q1-space-1))) scale(0.98);
1167
+ }
1168
+ .menu__popup--top[data-state='open'] {
1169
+ transform: translateY(var(--q1-space-1)) scale(0.98);
1170
+ }
1171
+ }
1172
+ @media (prefers-reduced-motion: reduce) {
1173
+ .menu__popup[data-state] {
1174
+ transform: none;
1175
+ transition: none;
1176
+ }
1177
+ }
1127
1178
  .menu__item {
1128
1179
  display: flex;
1129
1180
  align-items: center;
@@ -7655,14 +7706,14 @@ a.q1-navigation__item[aria-disabled='true'] {
7655
7706
  border: 1px solid var(--q1-color-border);
7656
7707
  border-radius: var(--q1-radius-3);
7657
7708
  background: var(--q1-color-bg-panel);
7658
- padding: var(--q1-space-2) var(--q1-space-3);
7709
+ padding: var(--q1-space-1) var(--q1-space-2);
7659
7710
  color: var(--q1-color-text-primary);
7660
7711
  font: inherit;
7661
7712
  text-align: start;
7662
7713
  cursor: pointer;
7714
+ transition: transform 100ms cubic-bezier(.23, 1, .32, 1);
7663
7715
  }
7664
7716
 
7665
- .q1-context-switcher__trigger:hover,
7666
7717
  .q1-context-switcher__trigger[aria-expanded='true'] {
7667
7718
  background: var(--q1-color-bg-subtle);
7668
7719
  border-color: var(--q1-color-border-strong);
@@ -7671,11 +7722,16 @@ a.q1-navigation__item[aria-disabled='true'] {
7671
7722
  .q1-context-switcher__trigger:focus-visible,
7672
7723
  .q1-context-switcher__popup:focus-visible,
7673
7724
  .q1-context-switcher__item:focus-visible,
7674
- .q1-context-switcher__action:focus-visible {
7725
+ .q1-context-switcher__action:focus-visible,
7726
+ .q1-context-switcher__popup[role='dialog'] input[type='search']:focus-visible {
7675
7727
  outline: none;
7676
7728
  box-shadow: var(--q1-shadow-focus);
7677
7729
  }
7678
7730
 
7731
+ .q1-context-switcher__popup[role='dialog']:has(> .q1-sr-only:focus) {
7732
+ box-shadow: var(--q1-shadow-focus);
7733
+ }
7734
+
7679
7735
  .q1-context-switcher__current,
7680
7736
  .q1-context-switcher__item-content {
7681
7737
  display: grid;
@@ -7694,16 +7750,16 @@ a.q1-navigation__item[aria-disabled='true'] {
7694
7750
  .q1-context-switcher__current-label,
7695
7751
  .q1-context-switcher__item-label {
7696
7752
  color: var(--q1-color-text-primary);
7697
- font-size: var(--q1-font-size-label-14);
7753
+ font-size: var(--q1-font-size-label-13);
7698
7754
  font-weight: var(--q1-font-weight-medium);
7699
- line-height: var(--q1-line-height-label-14);
7755
+ line-height: var(--q1-line-height-label-13);
7700
7756
  }
7701
7757
 
7702
7758
  .q1-context-switcher__description {
7703
7759
  color: var(--q1-color-text-secondary);
7704
- font-size: var(--q1-font-size-label-13);
7760
+ font-size: 11px;
7705
7761
  font-weight: var(--q1-font-weight-regular);
7706
- line-height: var(--q1-line-height-label-13);
7762
+ line-height: 14px;
7707
7763
  }
7708
7764
 
7709
7765
  .q1-context-switcher__avatar,
@@ -7717,9 +7773,24 @@ a.q1-navigation__item[aria-disabled='true'] {
7717
7773
  justify-content: center;
7718
7774
  }
7719
7775
 
7776
+ .q1-context-switcher__avatar {
7777
+ width: 24px;
7778
+ height: 24px;
7779
+ overflow: hidden;
7780
+ border-radius: var(--q1-radius-2);
7781
+ background: var(--q1-color-bg-subtle);
7782
+ color: var(--q1-color-text-secondary);
7783
+ font-size: var(--q1-font-size-label-13);
7784
+ font-weight: var(--q1-font-weight-semibold);
7785
+ }
7786
+
7787
+ .q1-context-switcher__trigger .q1-context-switcher__avatar {
7788
+ width: 28px;
7789
+ height: 28px;
7790
+ }
7791
+
7720
7792
  .q1-context-switcher__chevron {
7721
7793
  color: var(--q1-color-text-muted);
7722
- transition: transform 160ms ease;
7723
7794
  }
7724
7795
 
7725
7796
  .q1-context-switcher__trigger[aria-expanded='true'] .q1-context-switcher__chevron {
@@ -7740,11 +7811,143 @@ a.q1-navigation__item[aria-disabled='true'] {
7740
7811
  box-shadow: var(--q1-shadow-popover);
7741
7812
  }
7742
7813
 
7814
+ .q1-context-switcher__popup[role='dialog'] {
7815
+ width: min(17.5rem, calc(100vw - var(--q1-space-4)));
7816
+ opacity: 1;
7817
+ transform: translateY(0) scale(1);
7818
+ }
7819
+
7820
+ .q1-context-switcher__popup[role='dialog'][data-open-modality='pointer'] {
7821
+ transition-property: opacity, transform;
7822
+ transition-duration: 140ms;
7823
+ transition-timing-function: cubic-bezier(.23, 1, .32, 1);
7824
+ }
7825
+
7826
+ .q1-context-switcher__popup[role='dialog'][data-open-modality='keyboard'] {
7827
+ transition: none;
7828
+ }
7829
+
7830
+ .q1-context-switcher__popup[role='dialog'][data-side='bottom'][dir='ltr'][data-align='start'],
7831
+ .q1-context-switcher__popup[role='dialog'][data-side='bottom'][dir='rtl'][data-align='end'] {
7832
+ transform-origin: top left;
7833
+ }
7834
+
7835
+ .q1-context-switcher__popup[role='dialog'][data-side='bottom'][dir='ltr'][data-align='end'],
7836
+ .q1-context-switcher__popup[role='dialog'][data-side='bottom'][dir='rtl'][data-align='start'] {
7837
+ transform-origin: top right;
7838
+ }
7839
+
7840
+ .q1-context-switcher__popup[role='dialog'][data-side='top'][dir='ltr'][data-align='start'],
7841
+ .q1-context-switcher__popup[role='dialog'][data-side='top'][dir='rtl'][data-align='end'] {
7842
+ transform-origin: bottom left;
7843
+ }
7844
+
7845
+ .q1-context-switcher__popup[role='dialog'][data-side='top'][dir='ltr'][data-align='end'],
7846
+ .q1-context-switcher__popup[role='dialog'][data-side='top'][dir='rtl'][data-align='start'] {
7847
+ transform-origin: bottom right;
7848
+ }
7849
+
7850
+ @starting-style {
7851
+ .q1-context-switcher__popup[role='dialog'][data-open-modality='pointer'][data-side='bottom'] {
7852
+ opacity: 0;
7853
+ transform: translateY(-2px) scale(.98);
7854
+ }
7855
+
7856
+ .q1-context-switcher__popup[role='dialog'][data-open-modality='pointer'][data-side='top'] {
7857
+ opacity: 0;
7858
+ transform: translateY(2px) scale(.98);
7859
+ }
7860
+ }
7861
+
7743
7862
  .q1-context-switcher__groups {
7744
7863
  min-height: 0;
7745
7864
  overflow-y: auto;
7746
7865
  overscroll-behavior: contain;
7866
+ padding: var(--q1-space-1);
7867
+ }
7868
+
7869
+ .q1-context-switcher__popup[role='dialog'] .q1-context-switcher__groups {
7870
+ display: grid;
7871
+ overflow-y: hidden;
7872
+ }
7873
+
7874
+ .q1-context-switcher__search {
7875
+ position: relative;
7876
+ display: flex;
7877
+ align-items: center;
7878
+ margin-block: var(--q1-space-1);
7879
+ }
7880
+
7881
+ .q1-context-switcher__scope-summary {
7882
+ display: flex;
7883
+ min-width: 0;
7884
+ min-height: 40px;
7885
+ align-items: center;
7886
+ gap: var(--q1-space-2);
7887
+ padding: var(--q1-space-1) var(--q1-space-2);
7888
+ }
7889
+
7890
+ .q1-context-switcher__search-icon {
7891
+ position: absolute;
7892
+ inset-inline-start: var(--q1-space-2);
7893
+ z-index: 1;
7894
+ display: inline-flex;
7895
+ color: var(--q1-color-text-muted);
7896
+ pointer-events: none;
7897
+ }
7898
+
7899
+ .q1-context-switcher__popup[role='dialog'] input[type='search'] {
7900
+ width: 100%;
7901
+ min-width: 0;
7902
+ min-height: 32px;
7903
+ border: 1px solid transparent;
7904
+ border-radius: var(--q1-radius-2);
7905
+ background: transparent;
7906
+ padding-block: var(--q1-space-1);
7907
+ padding-inline: calc(var(--q1-space-2) * 4);
7908
+ color: var(--q1-color-text-primary);
7909
+ font-size: var(--q1-font-size-label-13);
7910
+ font-weight: var(--q1-font-weight-regular);
7911
+ line-height: var(--q1-line-height-label-13);
7912
+ }
7913
+
7914
+ .q1-context-switcher__search-shortcut {
7915
+ position: absolute;
7916
+ inset-inline-end: var(--q1-space-2);
7917
+ color: var(--q1-color-text-muted);
7918
+ font-size: var(--q1-font-size-label-13);
7919
+ font-weight: var(--q1-font-weight-medium);
7920
+ line-height: var(--q1-line-height-label-13);
7921
+ pointer-events: none;
7922
+ }
7923
+
7924
+ .q1-context-switcher__search:focus-within .q1-context-switcher__search-shortcut {
7925
+ visibility: hidden;
7926
+ }
7927
+
7928
+ .q1-context-switcher__popup[role='dialog'] input[type='search']::placeholder {
7929
+ color: var(--q1-color-text-muted);
7930
+ }
7931
+
7932
+ .q1-context-switcher__popup[role='dialog'] [role='listbox'] {
7933
+ min-height: 0;
7934
+ max-block-size: calc(var(--q1-space-24) + var(--q1-space-24) + var(--q1-space-16));
7935
+ overflow-x: hidden;
7936
+ overflow-y: auto;
7937
+ overscroll-behavior: contain;
7938
+ }
7939
+
7940
+ .q1-context-switcher__popup[role='dialog'] [role='status'] {
7941
+ min-width: 0;
7747
7942
  padding: var(--q1-space-2);
7943
+ color: var(--q1-color-text-secondary);
7944
+ }
7945
+
7946
+ .q1-context-switcher__empty-description {
7947
+ color: var(--q1-color-text-secondary);
7948
+ font-size: var(--q1-font-size-label-13);
7949
+ font-weight: var(--q1-font-weight-regular);
7950
+ line-height: var(--q1-line-height-label-13);
7748
7951
  }
7749
7952
 
7750
7953
  .q1-context-switcher__group + .q1-context-switcher__group {
@@ -7754,45 +7957,79 @@ a.q1-navigation__item[aria-disabled='true'] {
7754
7957
  }
7755
7958
 
7756
7959
  .q1-context-switcher__group-label {
7960
+ display: flex;
7961
+ justify-content: space-between;
7962
+ gap: var(--q1-space-2);
7757
7963
  padding: var(--q1-space-1) var(--q1-space-2);
7758
7964
  color: var(--q1-color-text-muted);
7759
- font-size: var(--q1-font-size-label-13);
7760
- font-weight: var(--q1-font-weight-semibold);
7761
- line-height: var(--q1-line-height-label-13);
7965
+ font-size: 11px;
7966
+ font-weight: var(--q1-font-weight-medium);
7967
+ line-height: 14px;
7762
7968
  overflow: hidden;
7763
7969
  text-overflow: ellipsis;
7764
7970
  white-space: nowrap;
7765
7971
  }
7766
7972
 
7973
+ .q1-context-switcher__popup[role='dialog'] .q1-context-switcher__group-label {
7974
+ color: var(--q1-color-text-secondary);
7975
+ }
7976
+
7767
7977
  .q1-context-switcher__item,
7768
7978
  .q1-context-switcher__action {
7769
7979
  display: flex;
7770
7980
  width: 100%;
7771
7981
  min-width: 0;
7772
- min-height: 44px;
7982
+ min-height: 36px;
7773
7983
  align-items: center;
7774
7984
  gap: var(--q1-space-2);
7775
7985
  border: 0;
7776
7986
  border-radius: var(--q1-radius-2);
7777
7987
  background: transparent;
7778
- padding: var(--q1-space-2);
7988
+ padding: var(--q1-space-1) var(--q1-space-2);
7779
7989
  color: var(--q1-color-text-primary);
7780
7990
  font: inherit;
7781
7991
  text-align: start;
7782
7992
  }
7783
7993
 
7994
+ .q1-context-switcher__item:has(.q1-context-switcher__description) {
7995
+ min-height: 40px;
7996
+ }
7997
+
7784
7998
  .q1-context-switcher__item:not([aria-disabled='true']),
7785
7999
  .q1-context-switcher__action:not(:disabled) {
7786
8000
  cursor: pointer;
7787
8001
  }
7788
8002
 
7789
- .q1-context-switcher__item:hover:not([aria-disabled='true']),
7790
- .q1-context-switcher__action:hover:not(:disabled),
7791
8003
  .q1-context-switcher__item:focus-visible,
7792
8004
  .q1-context-switcher__action:focus-visible {
7793
8005
  background: var(--q1-color-bg-subtle);
7794
8006
  }
7795
8007
 
8008
+ .q1-context-switcher__item[role='option'][aria-selected='true'] {
8009
+ background: color-mix(in srgb, var(--q1-color-action-primary) 8%, var(--q1-color-bg-panel));
8010
+ }
8011
+
8012
+ .q1-context-switcher__item[role='option'][aria-selected='true']:focus-visible {
8013
+ background: color-mix(in srgb, var(--q1-color-action-primary) 12%, var(--q1-color-bg-panel));
8014
+ }
8015
+
8016
+ @media (hover: hover) and (pointer: fine) {
8017
+ .q1-context-switcher__trigger:hover {
8018
+ background: var(--q1-color-bg-subtle);
8019
+ border-color: var(--q1-color-border-strong);
8020
+ }
8021
+
8022
+ .q1-context-switcher__search:hover input[type='search'],
8023
+ .q1-context-switcher__item:hover:not([aria-disabled='true']),
8024
+ .q1-context-switcher__action:hover:not(:disabled) {
8025
+ background: var(--q1-color-bg-subtle);
8026
+ }
8027
+
8028
+ .q1-context-switcher__item[role='option'][aria-selected='true']:hover {
8029
+ background: color-mix(in srgb, var(--q1-color-action-primary) 12%, var(--q1-color-bg-panel));
8030
+ }
8031
+ }
8032
+
7796
8033
  .q1-context-switcher__item[aria-disabled='true'],
7797
8034
  .q1-context-switcher__action:disabled {
7798
8035
  color: var(--q1-color-text-muted);
@@ -7801,6 +8038,11 @@ a.q1-navigation__item[aria-disabled='true'] {
7801
8038
  }
7802
8039
 
7803
8040
  .q1-context-switcher__item[aria-checked='true'] .q1-context-switcher__item-label,
8041
+ .q1-context-switcher__item[aria-selected='true'] .q1-context-switcher__item-label {
8042
+ color: var(--q1-color-text-primary);
8043
+ font-weight: var(--q1-font-weight-semibold);
8044
+ }
8045
+
7804
8046
  .q1-context-switcher__check {
7805
8047
  color: var(--q1-color-action-primary);
7806
8048
  }
@@ -7822,7 +8064,7 @@ a.q1-navigation__item[aria-disabled='true'] {
7822
8064
 
7823
8065
  .q1-context-switcher__footer {
7824
8066
  border-top: 1px solid var(--q1-color-border);
7825
- padding: var(--q1-space-2);
8067
+ padding: var(--q1-space-1);
7826
8068
  }
7827
8069
 
7828
8070
  @keyframes q1-context-switcher-spin {
@@ -7830,6 +8072,15 @@ a.q1-navigation__item[aria-disabled='true'] {
7830
8072
  }
7831
8073
 
7832
8074
  @media (prefers-reduced-motion: reduce) {
8075
+ .q1-context-switcher__trigger,
8076
+ .q1-context-switcher__popup[role='dialog'][data-open-modality] {
8077
+ transition: none;
8078
+ }
8079
+
8080
+ .q1-context-switcher__trigger:active {
8081
+ transform: none;
8082
+ }
8083
+
7833
8084
  .q1-context-switcher__chevron {
7834
8085
  transition: none;
7835
8086
  }
@@ -7838,3 +8089,28 @@ a.q1-navigation__item[aria-disabled='true'] {
7838
8089
  animation: none;
7839
8090
  }
7840
8091
  }
8092
+
8093
+ @media (pointer: fine) and (prefers-reduced-motion: no-preference) {
8094
+ .q1-context-switcher__trigger:active {
8095
+ transform: scale(.985);
8096
+ }
8097
+ }
8098
+
8099
+ @media (max-width: 48rem), (pointer: coarse), (any-pointer: coarse) {
8100
+ .q1-context-switcher__popup[role='dialog'] input[type='search'],
8101
+ .q1-context-switcher__item,
8102
+ .q1-context-switcher__scope-summary,
8103
+ .q1-context-switcher__action {
8104
+ min-height: 44px;
8105
+ }
8106
+
8107
+ .q1-context-switcher__popup[role='dialog'] input[type='search'] {
8108
+ font-size: var(--q1-font-size-copy-16);
8109
+ line-height: var(--q1-line-height-copy-16);
8110
+ }
8111
+
8112
+ .q1-context-switcher__scope-summary,
8113
+ .q1-context-switcher__item:has(.q1-context-switcher__description) {
8114
+ min-height: 48px;
8115
+ }
8116
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q1travel/design-system",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist-pkg/design-system.js",
@@ -56,6 +56,7 @@
56
56
  "@types/react": "^19.2.17",
57
57
  "@types/react-dom": "^19.2.3",
58
58
  "@vitejs/plugin-react": "^5.0.0",
59
+ "axe-core": "4.10.2",
59
60
  "typescript": "^5.8.0",
60
61
  "vite": "^7.0.0",
61
62
  "vite-plugin-dts": "^4.5.0"