@vialiq/flux-ui 0.7.0 → 0.8.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/components/_chip.scss +71 -0
- package/components/_index.scss +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@use '../styles/variables' as tokens;
|
|
2
|
+
|
|
3
|
+
@layer components {
|
|
4
|
+
.chip {
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
user-select: none;
|
|
10
|
+
vertical-align: middle;
|
|
11
|
+
outline: none; // Handled by focus-visible below
|
|
12
|
+
border-style: solid;
|
|
13
|
+
|
|
14
|
+
// Tokens mapped directly from docs
|
|
15
|
+
height: var(--vi-chip-height, var(--vi-chip-height-md, 32px));
|
|
16
|
+
padding: var(--vi-chip-padding, 0 10px);
|
|
17
|
+
border-radius: var(--vi-chip-border-radius, 999px);
|
|
18
|
+
border-width: var(--vi-chip-border-width, 1px);
|
|
19
|
+
gap: var(--vi-chip-gap, 6px);
|
|
20
|
+
font-size: var(--vi-chip-font-size, var(--vi-font-size-sm));
|
|
21
|
+
font-weight: var(--vi-chip-font-weight, var(--vi-font-weight-medium));
|
|
22
|
+
transition: all var(--vi-chip-transition, 100ms ease);
|
|
23
|
+
|
|
24
|
+
// Color tokens to be overridden by vi-chip variant
|
|
25
|
+
background-color: var(--vi-chip-bg-color, #{tokens.$layer-02});
|
|
26
|
+
border-color: var(--vi-chip-border-color, #{tokens.$border-03});
|
|
27
|
+
color: var(--vi-chip-text-color, #{tokens.$color-foreground});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Focus ring
|
|
31
|
+
.chip:focus-visible {
|
|
32
|
+
outline: #{tokens.$border-width-base} solid var(--vi-chip-focus-ring-color, #{tokens.$focus});
|
|
33
|
+
outline-offset: 0;
|
|
34
|
+
box-shadow: 0 0 0 3px var(--vi-chip-focus-ring-glow, #{tokens.$color-blue-200});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Disabled state structure
|
|
38
|
+
.chip[aria-disabled="true"] {
|
|
39
|
+
cursor: not-allowed;
|
|
40
|
+
// Colors handled by variant mapped tokens
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.chip-avatar {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
border-radius: 50%;
|
|
49
|
+
// Scale slightly down to fit in chip
|
|
50
|
+
width: calc(100% - 8px);
|
|
51
|
+
height: calc(100% - 8px);
|
|
52
|
+
margin-inline-start: -4px; // Pull avatar slightly out as per common pill patterns
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.chip-icon {
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.chip-label {
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
text-overflow: ellipsis;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.chip-group {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
// Defaults to gap 8px and wrap as per requirements
|
|
70
|
+
}
|
|
71
|
+
}
|
package/components/_index.scss
CHANGED