@lutra-ui-system/react 0.1.0 → 0.1.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.
- package/dist/components/link/link.d.ts +2 -2
- package/dist/styles.css +28 -11
- package/dist/tokens.json +7 -1
- package/package.json +1 -1
|
@@ -3,8 +3,8 @@ import type { AnchorHTMLAttributes } from 'react';
|
|
|
3
3
|
* How the link is drawn. Maps to the `type` axis of the Figma component set, renamed here because
|
|
4
4
|
* `type` is already a native `<a>` attribute and shadowing it would remove something real.
|
|
5
5
|
*
|
|
6
|
-
* `'inline'` is for links inside prose
|
|
7
|
-
*
|
|
6
|
+
* `'inline'` is for links inside prose. `'standalone'` is for links that sit on their own and need a
|
|
7
|
+
* larger target without changing semantics.
|
|
8
8
|
*
|
|
9
9
|
* **Styling only.** Neither value changes the element, and neither exists to make a link behave like
|
|
10
10
|
* a button.
|
package/dist/styles.css
CHANGED
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
--lutra-color-focus-ring: #3f7cff;
|
|
70
70
|
--lutra-color-icon-default: var(--lutra-color-text-primary);
|
|
71
71
|
--lutra-color-link-text: var(--lutra-color-brand-primary);
|
|
72
|
+
--lutra-color-link-text-visited: #5b21b6;
|
|
72
73
|
--lutra-color-text-disabled: #9ca3af;
|
|
73
74
|
--lutra-color-text-inverse: #ffffff;
|
|
74
75
|
--lutra-color-text-muted: #6b7280;
|
|
@@ -128,7 +129,7 @@
|
|
|
128
129
|
--lutra-component-link-text-default: var(--lutra-color-link-text);
|
|
129
130
|
--lutra-component-link-text-focus: var(--lutra-color-link-text);
|
|
130
131
|
--lutra-component-link-text-hover: var(--lutra-color-link-text);
|
|
131
|
-
--lutra-component-link-text-visited: var(--lutra-color-text-
|
|
132
|
+
--lutra-component-link-text-visited: var(--lutra-color-link-text-visited);
|
|
132
133
|
--lutra-component-menu-border: var(--lutra-component-input-border-default);
|
|
133
134
|
--lutra-component-menu-divider: var(--lutra-component-input-border-default);
|
|
134
135
|
--lutra-component-menu-item-danger: var(--lutra-component-field-error-text);
|
|
@@ -268,6 +269,7 @@
|
|
|
268
269
|
--lutra-color-feedback-danger-text: #ff8fab;
|
|
269
270
|
--lutra-color-icon-default: var(--lutra-color-text-primary);
|
|
270
271
|
--lutra-color-link-text: #7aa2ff;
|
|
272
|
+
--lutra-color-link-text-visited: #c4b5fd;
|
|
271
273
|
--lutra-color-text-disabled: #6b7280;
|
|
272
274
|
--lutra-color-text-inverse: #111827;
|
|
273
275
|
--lutra-color-text-muted: #9ca3af;
|
|
@@ -317,7 +319,7 @@
|
|
|
317
319
|
--lutra-component-link-text-default: var(--lutra-color-link-text);
|
|
318
320
|
--lutra-component-link-text-focus: var(--lutra-color-link-text);
|
|
319
321
|
--lutra-component-link-text-hover: var(--lutra-color-link-text);
|
|
320
|
-
--lutra-component-link-text-visited: var(--lutra-color-text-
|
|
322
|
+
--lutra-component-link-text-visited: var(--lutra-color-link-text-visited);
|
|
321
323
|
--lutra-component-menu-border: var(--lutra-component-input-border-default);
|
|
322
324
|
--lutra-component-menu-divider: var(--lutra-component-input-border-default);
|
|
323
325
|
--lutra-component-menu-item-danger: var(--lutra-component-field-error-text);
|
|
@@ -390,6 +392,7 @@
|
|
|
390
392
|
--lutra-color-feedback-danger-text: #c73f3f;
|
|
391
393
|
--lutra-color-icon-default: var(--lutra-color-text-primary);
|
|
392
394
|
--lutra-color-link-text: var(--lutra-color-brand-primary);
|
|
395
|
+
--lutra-color-link-text-visited: #5b21b6;
|
|
393
396
|
--lutra-color-text-disabled: #9ca3af;
|
|
394
397
|
--lutra-color-text-inverse: #ffffff;
|
|
395
398
|
--lutra-color-text-muted: #6b7280;
|
|
@@ -439,7 +442,7 @@
|
|
|
439
442
|
--lutra-component-link-text-default: var(--lutra-color-link-text);
|
|
440
443
|
--lutra-component-link-text-focus: var(--lutra-color-link-text);
|
|
441
444
|
--lutra-component-link-text-hover: var(--lutra-color-link-text);
|
|
442
|
-
--lutra-component-link-text-visited: var(--lutra-color-text-
|
|
445
|
+
--lutra-component-link-text-visited: var(--lutra-color-link-text-visited);
|
|
443
446
|
--lutra-component-menu-border: var(--lutra-component-input-border-default);
|
|
444
447
|
--lutra-component-menu-divider: var(--lutra-component-input-border-default);
|
|
445
448
|
--lutra-component-menu-item-danger: var(--lutra-component-field-error-text);
|
|
@@ -876,8 +879,8 @@
|
|
|
876
879
|
* and visited are selected from the platform — `:hover`, `:focus-visible`, `:active`, `:visited` —
|
|
877
880
|
* never from a prop.
|
|
878
881
|
*
|
|
879
|
-
* Colour is never the only thing separating
|
|
880
|
-
*
|
|
882
|
+
* Colour is never the only thing separating a link from surrounding text: both variants keep their
|
|
883
|
+
* underline at rest, and the variant axis changes layout rather than basic link recognition.
|
|
881
884
|
*/
|
|
882
885
|
|
|
883
886
|
.lutra-link {
|
|
@@ -908,27 +911,37 @@
|
|
|
908
911
|
overflow-wrap: break-word;
|
|
909
912
|
}
|
|
910
913
|
|
|
911
|
-
/*
|
|
912
|
-
*
|
|
914
|
+
/* Both link variants keep their underline at rest so unvisited and visited links remain recognisable
|
|
915
|
+
* without depending on colour alone. */
|
|
913
916
|
|
|
914
917
|
.lutra-link[data-variant='inline'] {
|
|
915
918
|
text-decoration-line: underline;
|
|
916
919
|
}
|
|
917
920
|
|
|
918
|
-
/* Standalone links
|
|
919
|
-
*
|
|
920
|
-
*
|
|
921
|
+
/* Standalone links keep the same persistent underline affordance as inline links. The variant exists
|
|
922
|
+
* for layout and target size: an inline-flex box with a minimum block size grows the hit area, not
|
|
923
|
+
* the type. */
|
|
921
924
|
|
|
922
925
|
.lutra-link[data-variant='standalone'] {
|
|
923
926
|
display: inline-flex;
|
|
924
927
|
align-items: center;
|
|
925
928
|
min-block-size: var(--lutra-link-standalone-min-target);
|
|
926
|
-
text-decoration-line:
|
|
929
|
+
text-decoration-line: underline;
|
|
927
930
|
}
|
|
928
931
|
|
|
929
932
|
.lutra-link:hover {
|
|
930
933
|
color: var(--lutra-link-text-hover);
|
|
931
934
|
text-decoration-line: underline;
|
|
935
|
+
text-decoration-thickness: max(2px, 0.12em);
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
/* Active keeps the persistent underline and strengthens it again so a press stays legible as a link
|
|
939
|
+
* rather than dropping back toward plain text. */
|
|
940
|
+
|
|
941
|
+
.lutra-link:active {
|
|
942
|
+
color: var(--lutra-link-text-hover);
|
|
943
|
+
text-decoration-line: underline;
|
|
944
|
+
text-decoration-thickness: max(3px, 0.16em);
|
|
932
945
|
}
|
|
933
946
|
|
|
934
947
|
/* `:visited` is deliberately after `:hover` for the colour, and the browser restricts what may be
|
|
@@ -943,6 +956,10 @@
|
|
|
943
956
|
color: var(--lutra-link-text-hover);
|
|
944
957
|
}
|
|
945
958
|
|
|
959
|
+
.lutra-link:visited:active {
|
|
960
|
+
color: var(--lutra-link-text-hover);
|
|
961
|
+
}
|
|
962
|
+
|
|
946
963
|
.lutra-link:focus-visible {
|
|
947
964
|
color: var(--lutra-link-text-focus);
|
|
948
965
|
outline: var(--lutra-link-focus-ring-width) solid var(--lutra-link-focus-ring-color);
|
package/dist/tokens.json
CHANGED
|
@@ -138,6 +138,12 @@
|
|
|
138
138
|
"dark": "#7aa2ff",
|
|
139
139
|
"themed": true
|
|
140
140
|
},
|
|
141
|
+
"--lutra-color-link-text-visited": {
|
|
142
|
+
"figmaName": "color/link/text/visited",
|
|
143
|
+
"light": "#5b21b6",
|
|
144
|
+
"dark": "#c4b5fd",
|
|
145
|
+
"themed": true
|
|
146
|
+
},
|
|
141
147
|
"--lutra-color-text-disabled": {
|
|
142
148
|
"figmaName": "color/text/disabled",
|
|
143
149
|
"light": "#9ca3af",
|
|
@@ -441,7 +447,7 @@
|
|
|
441
447
|
},
|
|
442
448
|
"--lutra-component-link-text-visited": {
|
|
443
449
|
"figmaName": "component/link/text/visited",
|
|
444
|
-
"value": "var(--lutra-color-text-
|
|
450
|
+
"value": "var(--lutra-color-link-text-visited)",
|
|
445
451
|
"themed": false
|
|
446
452
|
},
|
|
447
453
|
"--lutra-component-menu-border": {
|