liquent 0.1.0 → 0.2.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/dist/styles.css CHANGED
@@ -12,7 +12,9 @@
12
12
  --lq-tab-selection: var(--lq-selection);
13
13
  --lq-tab-well: transparent;
14
14
  --lq-tab-vivid: #000 8%;
15
+ --lq-tab-lit: #fff 8%;
15
16
  --lq-lens: rgb(0 0 0 / 0.03);
17
+ --lq-lens-outline: rgb(0 0 0 / 0.16);
16
18
  --lq-lens-drop: rgb(0 0 0 / 0.11);
17
19
  --lq-segment-track: rgb(118 118 128 / 0.12);
18
20
  --lq-segment-thumb: rgb(255 255 255);
@@ -94,7 +96,9 @@
94
96
  --lq-tab-selection: transparent;
95
97
  --lq-tab-well: rgb(0 0 0 / 0.25);
96
98
  --lq-tab-vivid: #fff 18%;
99
+ --lq-tab-lit: #fff 12%;
97
100
  --lq-lens: rgb(255 255 255 / 0.055);
101
+ --lq-lens-outline: rgb(0 0 0 / 0.72);
98
102
  --lq-lens-drop: transparent;
99
103
  --lq-segment-track: transparent;
100
104
  --lq-segment-thumb: rgb(235 235 245 / 0.3);
@@ -148,7 +152,9 @@
148
152
  --lq-tab-selection: transparent;
149
153
  --lq-tab-well: rgb(0 0 0 / 0.25);
150
154
  --lq-tab-vivid: #fff 18%;
155
+ --lq-tab-lit: #fff 12%;
151
156
  --lq-lens: rgb(255 255 255 / 0.055);
157
+ --lq-lens-outline: rgb(0 0 0 / 0.72);
152
158
  --lq-lens-drop: transparent;
153
159
  --lq-segment-track: transparent;
154
160
  --lq-segment-thumb: rgb(235 235 245 / 0.3);
@@ -206,6 +212,20 @@
206
212
  0 1px 3px var(--lq-drop);
207
213
  }
208
214
 
215
+ /* How see-through all glass is, as iOS 26 and 27's Liquid Glass setting
216
+ (Settings › Display & Brightness › Liquid Glass) sets it: --lq-glass-tint
217
+ from 0, clear, through 0.5, iOS's default and what Liquent is measured
218
+ against, to 1, tinted. Measured over the same photo in iOS 27.2, the glass
219
+ lays 37 %, 52 % and 70 % of its colour over what's behind it at those
220
+ three, so its fill's alpha is scaled by 0.68 to 1.32. A browser without
221
+ relative colours keeps the default. */
222
+ @supports (color: rgb(from red r g b / alpha)) {
223
+ .lq-glass {
224
+ --lq-veil: calc(1 + (var(--lq-glass-tint, 0.5) - 0.5) * 0.64);
225
+ background-color: rgb(from var(--lq-glass) r g b / min(1, calc(alpha * var(--lq-veil))));
226
+ }
227
+ }
228
+
209
229
  /* Glass that paints its rim (see refraction.ts) draws its edge line there,
210
230
  under the light, which an inset shadow would cover. */
211
231
  .lq-glass[data-rim] {
@@ -281,6 +301,12 @@
281
301
  background-color: var(--lq-glass-clear);
282
302
  }
283
303
 
304
+ @supports (color: rgb(from red r g b / alpha)) {
305
+ .lq-glass[data-variant="clear"] {
306
+ background-color: rgb(from var(--lq-glass-clear) r g b / min(1, calc(alpha * var(--lq-veil))));
307
+ }
308
+ }
309
+
284
310
  /* Tinted, the glass takes the colour and still shows what's behind it. */
285
311
  /* As SwiftUI's tinted glass: nearly the colour itself on regular glass, and
286
312
  a little more of what's behind it on clear. */
@@ -516,6 +542,11 @@
516
542
  --lq-thumb-inset: 0px;
517
543
  --lq-lens-grow-x: 27px;
518
544
  --lq-lens-grow-y: 20px;
545
+ /* Held, iOS 27's tab bar grows about 4 % (350 to 362 pt across), and
546
+ draws what's under its lens 1.2 times larger (measured in Music, iOS
547
+ 27.2). */
548
+ --lq-press-grow: 1.04;
549
+ --lq-lens-magnify: 1.2;
519
550
  position: relative;
520
551
  display: inline-flex;
521
552
  padding: var(--lq-tab-inset);
@@ -560,8 +591,8 @@
560
591
  border-radius: inherit;
561
592
  background: radial-gradient(
562
593
  circle 260px at var(--lq-x, 20%) 50%,
563
- rgb(255 255 255 / 0.09),
564
- rgb(255 255 255 / 0.045) 60%,
594
+ rgb(255 255 255 / 0.04),
595
+ rgb(255 255 255 / 0.02) 60%,
565
596
  transparent
566
597
  );
567
598
  opacity: 0;
@@ -662,8 +693,8 @@
662
693
  others in full colour and the selected one in --lq-tab-selected. */
663
694
  .lq-tab-bar[data-icons] {
664
695
  --lq-tab-width: 72px;
665
- --lq-tab-height: 52px;
666
- --lq-lens-grow-x: 24px;
696
+ --lq-tab-height: 54px;
697
+ --lq-lens-grow-x: 26px;
667
698
  --lq-lens-grow-y: 16px;
668
699
  --lq-tab-selected: color-mix(in srgb, var(--lq-fill), var(--lq-tab-vivid));
669
700
  }
@@ -672,7 +703,7 @@
672
703
  flex-direction: column;
673
704
  gap: 1px;
674
705
  font-size: 10px;
675
- font-weight: 500;
706
+ font-weight: 600;
676
707
  }
677
708
 
678
709
  .lq-tab-bar[data-icons] .lq-tab {
@@ -835,9 +866,14 @@
835
866
  visibility: hidden;
836
867
  }
837
868
 
838
- /* The lens's copy of the labels lies over the well as it comes and goes. */
869
+ /* The lens's copy of the labels lies over the well as it comes and goes,
870
+ lit: on a dark bar iOS draws what's under the lens in a lighter accent
871
+ (--lq-tab-lit). Off a layer of its own, so a browser draws it afresh at
872
+ the size the lens magnifies it to, not blurred up from its own. */
839
873
  .lq-tab-bar .lq-tab-lensed {
840
874
  z-index: 2;
875
+ color: color-mix(in srgb, var(--lq-tab-selected, var(--lq-foreground)), var(--lq-tab-lit));
876
+ will-change: auto;
841
877
  }
842
878
 
843
879
  .lq-tab-lens[data-pressed]::after {
@@ -863,6 +899,28 @@
863
899
  background: var(--lq-rim, none) 0 0 / 100% 100%;
864
900
  }
865
901
 
902
+ /* Lifted, iOS 27's tab bar lens is edged by a hairline, dark on a dark page
903
+ and grey on a light one, kept a hairline against its stretch, as its
904
+ shadow is. On a dark page its light, a halo, lies along its top and
905
+ bottom only, and none up its round ends, where the hairline alone edges
906
+ it (measured in Music, iOS 27.2; see haloRimMap). --lq-tab-rim-shine
907
+ brightens or dims it. */
908
+ .lq-tab-bar .lq-tab-lens {
909
+ --lq-rim-lit: along;
910
+ }
911
+
912
+ .lq-tab-bar .lq-tab-lens.lq-glass {
913
+ box-shadow:
914
+ 0 0 0 calc(0.66px / var(--lq-lift-y, 1))
915
+ color-mix(in srgb, var(--lq-lens-outline) calc(var(--lq-lift, 0) * 100%), transparent),
916
+ 0 calc(7px / var(--lq-lift-y, 1)) calc(11px / var(--lq-lift-y, 1))
917
+ color-mix(in srgb, var(--lq-lens-drop) calc(var(--lq-lift, 0) * 100%), transparent);
918
+ }
919
+
920
+ .lq-tab-bar:not([data-light]) .lq-tab-rim {
921
+ opacity: calc(var(--lq-lift, 0) * var(--lq-tab-rim-shine, 1));
922
+ }
923
+
866
924
  /* On a light page (data-light), where a faint lens is lost against light
867
925
  glass, the lifted lens stands out as iOS 26.1's does: it drops under the
868
926
  labels and bends the bar's glass and the page behind it, where the browser
@@ -872,16 +930,25 @@
872
930
  background-image: var(--lq-rim-bright, var(--lq-rim, none));
873
931
  }
874
932
 
875
- .lq-segmented[data-refracting][data-light] .lq-tab-lens.lq-glass,
876
- .lq-tab-bar[data-under][data-light] .lq-tab-lens.lq-glass {
933
+ .lq-segmented[data-refracting][data-light] .lq-tab-lens.lq-glass {
877
934
  z-index: 0;
878
935
  }
879
936
 
880
- .lq-tab-bar[data-under][data-light] .lq-tab-lens.lq-glass {
937
+ /* A tab bar's lens bends what's behind it on any page, as iOS 27's does,
938
+ once it has dropped under the labels. Through it the bar looks thinner
939
+ and the page shows above and below it (see BACKDROP in segments.tsx).
940
+ It needs no fill then: what it shows is the bar itself. */
941
+ .lq-tab-bar[data-under] .lq-tab-lens.lq-glass {
942
+ z-index: 0;
881
943
  -webkit-backdrop-filter: var(--lq-filter, none);
882
944
  backdrop-filter: var(--lq-filter, none);
883
945
  }
884
946
 
947
+ .lq-tab-bar[data-bends] .lq-tab-lens.lq-glass,
948
+ .lq-tab-bar[data-bends][data-lifted] .lq-tab-lens.lq-glass {
949
+ background-color: transparent;
950
+ }
951
+
885
952
  /* A segmented control's bend is one strength, so it's the rim that holds it:
886
953
  it lifts and settles with the rim's light. */
887
954
  .lq-segmented[data-refracting][data-light] .lq-tab-rim {
@@ -924,6 +991,10 @@
924
991
  --lq-thumb-inset: 2px;
925
992
  --lq-lens-grow-x: 24px;
926
993
  --lq-lens-grow-y: 16px;
994
+ /* Held, the whole control grows (8 to 9 % in iOS 27.2's Photos); its lens
995
+ draws the labels at their own size. */
996
+ --lq-press-grow: 1.08;
997
+ --lq-lens-magnify: 1;
927
998
  --lq-tab-selected: var(--lq-segment-label);
928
999
  position: relative;
929
1000
  display: inline-flex;
package/package.json CHANGED
@@ -1,18 +1,27 @@
1
1
  {
2
2
  "name": "liquent",
3
- "version": "0.1.0",
4
- "description": "Liquid Glass components for React, with first-class right-to-left and Persian support.",
3
+ "version": "0.2.0",
4
+ "description": "Liquid Glass for the web: Apple-style iOS 26 and iOS 27 glass UI components for React, with right-to-left and Persian support.",
5
5
  "keywords": [
6
- "react",
7
6
  "liquid glass",
8
- "glass",
7
+ "liquid-glass",
8
+ "liquidglass",
9
+ "react",
10
+ "react components",
9
11
  "ui",
10
- "components",
12
+ "ui library",
13
+ "glass",
14
+ "glassmorphism",
15
+ "ios 26",
16
+ "ios 27",
17
+ "apple",
18
+ "refraction",
11
19
  "tab bar",
12
20
  "segmented control",
13
21
  "switch",
14
22
  "slider",
15
23
  "menu",
24
+ "sheet",
16
25
  "rtl",
17
26
  "persian",
18
27
  "farsi"