@fibery/ui-kit 3.0.0 → 4.0.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/CHANGELOG.md +6 -0
- package/package.json +14 -8
- package/src/actions-menu/actions-menu-item.tsx +1 -0
- package/src/actions-menu/actions-menu.tsx +1 -3
- package/src/antd/ant-modal.tsx +156 -7
- package/src/antd/ant-upload.tsx +285 -27
- package/src/antd/auto-complete.tsx +145 -0
- package/src/antd/auto-width-transparent-textarea.tsx +9 -2
- package/src/antd/global-overrides.ts +352 -0
- package/src/antd/index.tsx +3 -2
- package/src/antd/input-number.tsx +97 -11
- package/src/antd/input.tsx +127 -8
- package/src/antd/styles.ts +90 -32
- package/src/antd/tabs.tsx +139 -27
- package/src/avatar.tsx +2 -56
- package/src/color-adjuster.ts +24 -1
- package/src/count-badge.tsx +10 -1
- package/src/date-picker/date-range-picker.tsx +6 -6
- package/src/date-picker/single-date-picker.tsx +2 -3
- package/src/date-picker/types.ts +1 -1
- package/src/date-picker/with-popup-control.tsx +3 -9
- package/src/design-system/colors-callout.warm-dark.test.ts +22 -22
- package/src/design-system/colors-callout.warm-light.test.ts +19 -19
- package/src/design-system/colors-css.ts +1 -1
- package/src/design-system/colors-enum.dark.warm.test.ts +63 -63
- package/src/design-system/colors-enum.light.warm.test.ts +54 -54
- package/src/design-system/colors-highlight.warm-dark.test.ts +21 -21
- package/src/design-system/colors-highlight.warm-light.test.ts +21 -21
- package/src/design-system/colors.ts +1 -1
- package/src/design-system/fns.badge.dark.warm.test.ts +34 -34
- package/src/design-system/fns.badge.light.warm.test.ts +31 -31
- package/src/design-system/fns.deneutralize.test.ts +44 -0
- package/src/design-system/fns.icon.dark.warm.test.ts +21 -21
- package/src/design-system/fns.icon.light.warm.test.ts +17 -17
- package/src/design-system/fns.icon.ts +21 -13
- package/src/design-system/fns.ts +27 -3
- package/src/design-system/typography.ts +1 -1
- package/src/design-system.ts +1 -1
- package/src/fibermoji-placeholder.tsx +2 -3
- package/src/icons/icon.tsx +11 -1
- package/src/icons/types.ts +1 -1
- package/src/layout-styles.ts +5 -1
- package/src/link-input/components/ant-text-area-with-custom-read-state.tsx +2 -1
- package/src/media-query-utils.ts +4 -13
- package/src/palettes/inspect.defs.colors.warm-arch.test.ts +137 -137
- package/src/palettes/inspect.defs.colors.warm-user.test.ts +137 -137
- package/src/palettes/warm.ts +2 -0
- package/src/root-theme-provider.test.tsx +1 -1
- package/src/select/index.tsx +3 -3
- package/src/select/select-in-popover.tsx +34 -51
- package/src/select/select.tsx +2 -2
- package/src/theme-provider.test.tsx +1 -1
- package/src/theme-provider.tsx +3 -9
- package/src/theme-snapshots.test.ts +9 -13
- package/src/{theming/build.ts → theming.build.ts} +6 -9
- package/src/{theming/theming-fibery.snapshot.css → theming.generated.css} +52 -52
- package/src/{theming/theming-fibery.snapshot.ts → theming.generated.ts} +52 -52
- package/src/{themed-ink.tsx → type-label.tsx} +2 -5
- package/src/antd/auto-complete.d.ts +0 -2
- package/src/antd/auto-complete.ts +0 -37
- package/src/antd/tabs.d.ts +0 -5
- package/src/theming/index.ts +0 -20
- package/src/theming/theming-vzdbery.snapshot.css +0 -2001
- package/src/theming/theming-vzdbery.snapshot.ts +0 -2519
|
@@ -8,7 +8,7 @@ describe("badge.bg", () => {
|
|
|
8
8
|
expect(userColorChoices((c) => theme.fns.badge(c).bg)).toMatchInlineSnapshot(`
|
|
9
9
|
{
|
|
10
10
|
"CMYK Black ": "#000000 | hsl(none 0% 0%) | oklch(0 0 none)",
|
|
11
|
-
"CMYK Cyan ": "#
|
|
11
|
+
"CMYK Cyan ": "#00D6CF | hsl( 178 100% 42%) | oklch(0.79 0.14 191 )",
|
|
12
12
|
"CMYK Magenta": "#DB7FD8 | hsl( 302 56% 68%) | oklch(0.73 0.16 328 )",
|
|
13
13
|
"CMYK Yellow ": "#C5C632 | hsl( 60 60% 49%) | oklch(0.8 0.16 110 )",
|
|
14
14
|
"Noti green ": "#C0C0C0 | hsl(none 0% 75%) | oklch(0.81 0 none)",
|
|
@@ -24,17 +24,17 @@ describe("badge.bg", () => {
|
|
|
24
24
|
"swatches[ 3] aka Swatch.Red ": "#B63B35 | hsl( 3 55% 46%) | oklch(0.53 0.16 27 )",
|
|
25
25
|
"swatches[ 4] aka Swatch.Magenta ": "#C74B71 | hsl( 342 53% 54%) | oklch(0.59 0.16 4 )",
|
|
26
26
|
"swatches[ 5] aka Swatch.Purple ": "#9949A6 | hsl( 292 39% 47%) | oklch(0.54 0.16 322 )",
|
|
27
|
-
"swatches[ 6] aka Swatch.Violet ": "#
|
|
28
|
-
"swatches[ 7] aka Swatch.BlueDark ": "#
|
|
27
|
+
"swatches[ 6] aka Swatch.Violet ": "#6542A5 | hsl( 261 43% 45%) | oklch(0.47 0.15 296 )",
|
|
28
|
+
"swatches[ 7] aka Swatch.BlueDark ": "#4356B0 | hsl( 230 45% 48%) | oklch(0.49 0.14 271 )",
|
|
29
29
|
"swatches[ 8] aka Swatch.Blue ": "#4F81E1 | hsl( 219 71% 60%) | oklch(0.62 0.16 262 )",
|
|
30
|
-
"swatches[ 9] aka Swatch.BlueSky ": "#
|
|
31
|
-
"swatches[10] aka Swatch.Turquoise ": "#
|
|
32
|
-
"swatches[11] aka Swatch.GreenDark ": "#
|
|
33
|
-
"swatches[12] aka Swatch.Green ": "#
|
|
34
|
-
"swatches[13] aka Swatch.GreenLight": "#
|
|
35
|
-
"swatches[14] aka Swatch.Yellow ": "#
|
|
30
|
+
"swatches[ 9] aka Swatch.BlueSky ": "#52A2E2 | hsl( 207 71% 60%) | oklch(0.69 0.12 245 )",
|
|
31
|
+
"swatches[10] aka Swatch.Turquoise ": "#48BEC3 | hsl( 182 51% 52%) | oklch(0.74 0.1 199 )",
|
|
32
|
+
"swatches[11] aka Swatch.GreenDark ": "#33907D | hsl( 168 48% 38%) | oklch(0.59 0.09 177 )",
|
|
33
|
+
"swatches[12] aka Swatch.Green ": "#64AA5D | hsl( 115 31% 52%) | oklch(0.67 0.13 142 )",
|
|
34
|
+
"swatches[13] aka Swatch.GreenLight": "#93BC5F | hsl( 86 41% 55%) | oklch(0.74 0.13 129 )",
|
|
35
|
+
"swatches[14] aka Swatch.Yellow ": "#EBA944 | hsl( 36 81% 59%) | oklch(0.78 0.14 74 )",
|
|
36
36
|
"swatches[15] aka Swatch.Orange ": "#DD663D | hsl( 15 70% 55%) | oklch(0.65 0.16 39 )",
|
|
37
|
-
"swatches[16] aka Swatch.Brown ": "#
|
|
37
|
+
"swatches[16] aka Swatch.Brown ": "#9F543B | hsl( 15 46% 43%) | oklch(0.53 0.11 39 )",
|
|
38
38
|
}
|
|
39
39
|
`);
|
|
40
40
|
});
|
|
@@ -82,7 +82,7 @@ describe("badge.border", () => {
|
|
|
82
82
|
expect(userColorChoices((c) => theme.fns.badge(c).border)).toMatchInlineSnapshot(`
|
|
83
83
|
{
|
|
84
84
|
"CMYK Black ": "#000000 | hsl(none 0% 0%) | oklch(0 0 none)",
|
|
85
|
-
"CMYK Cyan ": "#
|
|
85
|
+
"CMYK Cyan ": "#00D6CF | hsl( 178 100% 42%) | oklch(0.79 0.14 191 )",
|
|
86
86
|
"CMYK Magenta": "#DB7FD8 | hsl( 302 56% 68%) | oklch(0.73 0.16 328 )",
|
|
87
87
|
"CMYK Yellow ": "#C5C632 | hsl( 60 60% 49%) | oklch(0.8 0.16 110 )",
|
|
88
88
|
"Noti green ": "#C0C0C0 | hsl(none 0% 75%) | oklch(0.81 0 none)",
|
|
@@ -98,17 +98,17 @@ describe("badge.border", () => {
|
|
|
98
98
|
"swatches[ 3] aka Swatch.Red ": "#B63B35 | hsl( 3 55% 46%) | oklch(0.53 0.16 27 )",
|
|
99
99
|
"swatches[ 4] aka Swatch.Magenta ": "#C74B71 | hsl( 342 53% 54%) | oklch(0.59 0.16 4 )",
|
|
100
100
|
"swatches[ 5] aka Swatch.Purple ": "#9949A6 | hsl( 292 39% 47%) | oklch(0.54 0.16 322 )",
|
|
101
|
-
"swatches[ 6] aka Swatch.Violet ": "#
|
|
102
|
-
"swatches[ 7] aka Swatch.BlueDark ": "#
|
|
101
|
+
"swatches[ 6] aka Swatch.Violet ": "#6542A5 | hsl( 261 43% 45%) | oklch(0.47 0.15 296 )",
|
|
102
|
+
"swatches[ 7] aka Swatch.BlueDark ": "#4356B0 | hsl( 230 45% 48%) | oklch(0.49 0.14 271 )",
|
|
103
103
|
"swatches[ 8] aka Swatch.Blue ": "#4F81E1 | hsl( 219 71% 60%) | oklch(0.62 0.16 262 )",
|
|
104
|
-
"swatches[ 9] aka Swatch.BlueSky ": "#
|
|
105
|
-
"swatches[10] aka Swatch.Turquoise ": "#
|
|
106
|
-
"swatches[11] aka Swatch.GreenDark ": "#
|
|
107
|
-
"swatches[12] aka Swatch.Green ": "#
|
|
108
|
-
"swatches[13] aka Swatch.GreenLight": "#
|
|
109
|
-
"swatches[14] aka Swatch.Yellow ": "#
|
|
104
|
+
"swatches[ 9] aka Swatch.BlueSky ": "#52A2E2 | hsl( 207 71% 60%) | oklch(0.69 0.12 245 )",
|
|
105
|
+
"swatches[10] aka Swatch.Turquoise ": "#48BEC3 | hsl( 182 51% 52%) | oklch(0.74 0.1 199 )",
|
|
106
|
+
"swatches[11] aka Swatch.GreenDark ": "#33907D | hsl( 168 48% 38%) | oklch(0.59 0.09 177 )",
|
|
107
|
+
"swatches[12] aka Swatch.Green ": "#64AA5D | hsl( 115 31% 52%) | oklch(0.67 0.13 142 )",
|
|
108
|
+
"swatches[13] aka Swatch.GreenLight": "#93BC5F | hsl( 86 41% 55%) | oklch(0.74 0.13 129 )",
|
|
109
|
+
"swatches[14] aka Swatch.Yellow ": "#EBA944 | hsl( 36 81% 59%) | oklch(0.78 0.14 74 )",
|
|
110
110
|
"swatches[15] aka Swatch.Orange ": "#DD663D | hsl( 15 70% 55%) | oklch(0.65 0.16 39 )",
|
|
111
|
-
"swatches[16] aka Swatch.Brown ": "#
|
|
111
|
+
"swatches[16] aka Swatch.Brown ": "#9F543B | hsl( 15 46% 43%) | oklch(0.53 0.11 39 )",
|
|
112
112
|
}
|
|
113
113
|
`);
|
|
114
114
|
});
|
|
@@ -119,12 +119,12 @@ describe("badge.borderSelected", () => {
|
|
|
119
119
|
expect(userColorChoices((c) => theme.fns.badge(c).borderSelected)).toMatchInlineSnapshot(`
|
|
120
120
|
{
|
|
121
121
|
"CMYK Black ": "#000000 | hsl(none 0% 0%) | oklch(0 0 none)",
|
|
122
|
-
"CMYK Cyan ": "#
|
|
122
|
+
"CMYK Cyan ": "#62D6D0 | hsl( 177 59% 61%) | oklch(0.81 0.11 191 )",
|
|
123
123
|
"CMYK Magenta": "#D044D0 | hsl( 300 60% 54%) | oklch(0.64 0.23 328 )",
|
|
124
124
|
"CMYK Yellow ": "#DEE042 | hsl( 61 72% 57%) | oklch(0.88 0.17 110 )",
|
|
125
125
|
"Noti green ": "#C3C3C3 | hsl(none 0% 76%) | oklch(0.82 0 none)",
|
|
126
126
|
"Noti red ": "#BEBEBE | hsl(none 0% 75%) | oklch(0.8 0 none)",
|
|
127
|
-
"Noti yellow ": "#
|
|
127
|
+
"Noti yellow ": "#C7C6C0 | hsl( 51 6% 77%) | oklch(0.83 0.01 99 )",
|
|
128
128
|
"RGB Blue ": "#0D1AB6 | hsl( 235 87% 38%) | oklch(0.37 0.23 266 )",
|
|
129
129
|
"RGB Green ": "#55D536 | hsl( 108 65% 52%) | oklch(0.77 0.22 140 )",
|
|
130
130
|
"RGB Red ": "#B43227 | hsl( 5 64% 43%) | oklch(0.51 0.17 29 )",
|
|
@@ -135,17 +135,17 @@ describe("badge.borderSelected", () => {
|
|
|
135
135
|
"swatches[ 3] aka Swatch.Red ": "#8E2A26 | hsl( 2 58% 35%) | oklch(0.44 0.14 27 )",
|
|
136
136
|
"swatches[ 4] aka Swatch.Magenta ": "#A03959 | hsl( 341 47% 43%) | oklch(0.5 0.14 4 )",
|
|
137
137
|
"swatches[ 5] aka Swatch.Purple ": "#763980 | hsl( 292 38% 36%) | oklch(0.45 0.13 322 )",
|
|
138
|
-
"swatches[ 6] aka Swatch.Violet ": "#
|
|
139
|
-
"swatches[ 7] aka Swatch.BlueDark ": "#
|
|
138
|
+
"swatches[ 6] aka Swatch.Violet ": "#493277 | hsl( 260 41% 33%) | oklch(0.38 0.11 296 )",
|
|
139
|
+
"swatches[ 7] aka Swatch.BlueDark ": "#33417F | hsl( 229 43% 35%) | oklch(0.4 0.11 271 )",
|
|
140
140
|
"swatches[ 8] aka Swatch.Blue ": "#4468AD | hsl( 219 44% 47%) | oklch(0.52 0.12 262 )",
|
|
141
|
-
"swatches[ 9] aka Swatch.BlueSky ": "#
|
|
142
|
-
"swatches[10] aka Swatch.Turquoise ": "#
|
|
143
|
-
"swatches[11] aka Swatch.GreenDark ": "#
|
|
144
|
-
"swatches[12] aka Swatch.Green ": "#
|
|
145
|
-
"swatches[13] aka Swatch.GreenLight": "#
|
|
146
|
-
"swatches[14] aka Swatch.Yellow ": "#
|
|
141
|
+
"swatches[ 9] aka Swatch.BlueSky ": "#5385AF | hsl( 207 37% 51%) | oklch(0.6 0.08 245 )",
|
|
142
|
+
"swatches[10] aka Swatch.Turquoise ": "#5B9B9E | hsl( 183 27% 49%) | oklch(0.65 0.07 200 )",
|
|
143
|
+
"swatches[11] aka Swatch.GreenDark ": "#416E63 | hsl( 165 26% 34%) | oklch(0.5 0.05 177 )",
|
|
144
|
+
"swatches[12] aka Swatch.Green ": "#5A8955 | hsl( 114 23% 44%) | oklch(0.58 0.09 142 )",
|
|
145
|
+
"swatches[13] aka Swatch.GreenLight": "#7F9C5E | hsl( 88 25% 49%) | oklch(0.66 0.09 129 )",
|
|
146
|
+
"swatches[14] aka Swatch.Yellow ": "#C09251 | hsl( 35 47% 54%) | oklch(0.69 0.1 74 )",
|
|
147
147
|
"swatches[15] aka Swatch.Orange ": "#AF573A | hsl( 15 50% 46%) | oklch(0.56 0.12 39 )",
|
|
148
|
-
"swatches[16] aka Swatch.Brown ": "#
|
|
148
|
+
"swatches[16] aka Swatch.Brown ": "#734536 | hsl( 15 36% 33%) | oklch(0.44 0.07 39 )",
|
|
149
149
|
}
|
|
150
150
|
`);
|
|
151
151
|
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {userColorChoices} from "../palettes/testkit";
|
|
2
|
+
import {locateThemeBundle} from "../theme-styles";
|
|
3
|
+
|
|
4
|
+
const theme = locateThemeBundle(true).themes[0];
|
|
5
|
+
|
|
6
|
+
describe("deneutralize", () => {
|
|
7
|
+
test("snapshot", () => {
|
|
8
|
+
// FIXME: black and white are identity
|
|
9
|
+
// you may notice this in vizydrop, as it's the only UI that leaves user-defined colors non-trimmed
|
|
10
|
+
// revisit after P3/oklch transition maybe
|
|
11
|
+
expect(userColorChoices(theme.fns.deneutralize)).toMatchInlineSnapshot(`
|
|
12
|
+
{
|
|
13
|
+
"CMYK Black ": "#000000 | hsl(none 0% 0%) | oklch(0 0 none)",
|
|
14
|
+
"CMYK Cyan ": "#3EFBF3 | hsl( 177 96% 61%) | oklch(0.9 0.14 191 )",
|
|
15
|
+
"CMYK Magenta": "#FA50F9 | hsl( 300 94% 65%) | oklch(0.73 0.27 328 )",
|
|
16
|
+
"CMYK Yellow ": "#FEFF14 | hsl( 60 100% 54%) | oklch(0.97 0.21 110 )",
|
|
17
|
+
"Noti green ": "#DBE3DD | hsl( 135 13% 87%) | oklch(0.91 0.01 154 )",
|
|
18
|
+
"Noti red ": "#E6D7D4 | hsl( 10 26% 87%) | oklch(0.89 0.02 31 )",
|
|
19
|
+
"Noti yellow ": "#EDE3C1 | hsl( 46 55% 84%) | oklch(0.92 0.05 94 )",
|
|
20
|
+
"RGB Blue ": "#1631EA | hsl( 232 83% 50%) | oklch(0.46 0.27 266 )",
|
|
21
|
+
"RGB Green ": "#5AF830 | hsl( 107 93% 58%) | oklch(0.86 0.26 140 )",
|
|
22
|
+
"RGB Red ": "#E33A2E | hsl( 4 76% 54%) | oklch(0.6 0.21 29 )",
|
|
23
|
+
"White ": "#FFFFFF | hsl(none 0% 100%) | oklch(1 0 none)",
|
|
24
|
+
"swatches[ 0] aka Swatch.GreyDark ": "#4D4747 | hsl( 0 4% 29%) | oklch(0.4 0.01 17 )",
|
|
25
|
+
"swatches[ 1] aka Swatch.Grey ": "#818589 | hsl( 210 3% 52%) | oklch(0.61 0.01 248 )",
|
|
26
|
+
"swatches[ 2] aka Swatch.GreyLight ": "#A0A3A7 | hsl( 214 4% 64%) | oklch(0.71 0.01 255 )",
|
|
27
|
+
"swatches[ 3] aka Swatch.Red ": "#BB332F | hsl( 2 60% 46%) | oklch(0.53 0.17 27 )",
|
|
28
|
+
"swatches[ 4] aka Swatch.Magenta ": "#CD4370 | hsl( 340 58% 53%) | oklch(0.59 0.18 4 )",
|
|
29
|
+
"swatches[ 5] aka Swatch.Purple ": "#9A47A8 | hsl( 291 41% 47%) | oklch(0.54 0.17 322 )",
|
|
30
|
+
"swatches[ 6] aka Swatch.Violet ": "#6542A5 | hsl( 261 43% 45%) | oklch(0.47 0.15 296 )",
|
|
31
|
+
"swatches[ 7] aka Swatch.BlueDark ": "#4356B0 | hsl( 230 45% 48%) | oklch(0.49 0.14 271 )",
|
|
32
|
+
"swatches[ 8] aka Swatch.Blue ": "#4F81E1 | hsl( 219 71% 60%) | oklch(0.62 0.16 262 )",
|
|
33
|
+
"swatches[ 9] aka Swatch.BlueSky ": "#52A2E2 | hsl( 207 71% 60%) | oklch(0.69 0.12 245 )",
|
|
34
|
+
"swatches[10] aka Swatch.Turquoise ": "#48BEC3 | hsl( 182 51% 52%) | oklch(0.74 0.1 199 )",
|
|
35
|
+
"swatches[11] aka Swatch.GreenDark ": "#33907D | hsl( 168 48% 38%) | oklch(0.59 0.09 177 )",
|
|
36
|
+
"swatches[12] aka Swatch.Green ": "#64AA5D | hsl( 115 31% 52%) | oklch(0.67 0.13 142 )",
|
|
37
|
+
"swatches[13] aka Swatch.GreenLight": "#93BC5F | hsl( 86 41% 55%) | oklch(0.74 0.13 129 )",
|
|
38
|
+
"swatches[14] aka Swatch.Yellow ": "#EBA944 | hsl( 36 81% 59%) | oklch(0.78 0.14 74 )",
|
|
39
|
+
"swatches[15] aka Swatch.Orange ": "#DE653C | hsl( 15 71% 55%) | oklch(0.65 0.16 39 )",
|
|
40
|
+
"swatches[16] aka Swatch.Brown ": "#9F543B | hsl( 15 46% 43%) | oklch(0.53 0.11 39 )",
|
|
41
|
+
}
|
|
42
|
+
`);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -12,8 +12,8 @@ test("snapshot", () => {
|
|
|
12
12
|
"fg": "#747474 | hsl(none 0% 45%) | oklch(0.56 0 none)",
|
|
13
13
|
},
|
|
14
14
|
"CMYK Cyan ": {
|
|
15
|
-
"bg": "#
|
|
16
|
-
"fg": "#
|
|
15
|
+
"bg": "#003F3C | hsl( 177 100% 12%) | oklch(0.33 0.06 189 )",
|
|
16
|
+
"fg": "#5EF8F1 | hsl( 177 92% 67%) | oklch(0.9 0.13 191 )",
|
|
17
17
|
},
|
|
18
18
|
"CMYK Magenta": {
|
|
19
19
|
"bg": "#502A4F | hsl( 302 31% 24%) | oklch(0.35 0.08 328 )",
|
|
@@ -33,7 +33,7 @@ test("snapshot", () => {
|
|
|
33
33
|
},
|
|
34
34
|
"Noti yellow ": {
|
|
35
35
|
"bg": "#3F3820 | hsl( 46 33% 19%) | oklch(0.34 0.04 94 )",
|
|
36
|
-
"fg": "#
|
|
36
|
+
"fg": "#F2E3AE | hsl( 47 72% 82%) | oklch(0.92 0.07 94 )",
|
|
37
37
|
},
|
|
38
38
|
"RGB Blue ": {
|
|
39
39
|
"bg": "#253662 | hsl( 223 45% 26%) | oklch(0.34 0.08 266 )",
|
|
@@ -76,48 +76,48 @@ test("snapshot", () => {
|
|
|
76
76
|
"fg": "#A056AC | hsl( 292 34% 51%) | oklch(0.57 0.15 322 )",
|
|
77
77
|
},
|
|
78
78
|
"swatches[ 6] aka Swatch.Violet ": {
|
|
79
|
-
"bg": "#
|
|
80
|
-
"fg": "#
|
|
79
|
+
"bg": "#3D3356 | hsl( 257 26% 27%) | oklch(0.35 0.06 296 )",
|
|
80
|
+
"fg": "#8063BE | hsl( 259 41% 57%) | oklch(0.57 0.14 296 )",
|
|
81
81
|
},
|
|
82
82
|
"swatches[ 7] aka Swatch.BlueDark ": {
|
|
83
|
-
"bg": "#
|
|
84
|
-
"fg": "#
|
|
83
|
+
"bg": "#2E3757 | hsl( 227 31% 26%) | oklch(0.34 0.06 271 )",
|
|
84
|
+
"fg": "#5A6EC1 | hsl( 228 45% 55%) | oklch(0.56 0.13 271 )",
|
|
85
85
|
},
|
|
86
86
|
"swatches[ 8] aka Swatch.Blue ": {
|
|
87
87
|
"bg": "#263859 | hsl( 219 40% 25%) | oklch(0.34 0.06 262 )",
|
|
88
88
|
"fg": "#5582D8 | hsl( 219 63% 59%) | oklch(0.61 0.14 262 )",
|
|
89
89
|
},
|
|
90
90
|
"swatches[ 9] aka Swatch.BlueSky ": {
|
|
91
|
-
"bg": "#
|
|
92
|
-
"fg": "#
|
|
91
|
+
"bg": "#213A50 | hsl( 208 42% 22%) | oklch(0.34 0.05 246 )",
|
|
92
|
+
"fg": "#5CA2DB | hsl( 207 64% 61%) | oklch(0.69 0.11 245 )",
|
|
93
93
|
},
|
|
94
94
|
"swatches[10] aka Swatch.Turquoise ": {
|
|
95
|
-
"bg": "#
|
|
96
|
-
"fg": "#
|
|
95
|
+
"bg": "#193D3F | hsl( 183 43% 17%) | oklch(0.33 0.04 200 )",
|
|
96
|
+
"fg": "#58BCC1 | hsl( 183 46% 55%) | oklch(0.74 0.09 200 )",
|
|
97
97
|
},
|
|
98
98
|
"swatches[11] aka Swatch.GreenDark ": {
|
|
99
|
-
"bg": "#
|
|
100
|
-
"fg": "#
|
|
99
|
+
"bg": "#213D37 | hsl( 167 30% 18%) | oklch(0.34 0.04 179 )",
|
|
100
|
+
"fg": "#3F8E7D | hsl( 167 39% 40%) | oklch(0.59 0.08 177 )",
|
|
101
101
|
},
|
|
102
102
|
"swatches[12] aka Swatch.Green ": {
|
|
103
|
-
"bg": "#
|
|
104
|
-
"fg": "#
|
|
103
|
+
"bg": "#273E24 | hsl( 113 27% 19%) | oklch(0.34 0.05 142 )",
|
|
104
|
+
"fg": "#6AA864 | hsl( 115 28% 53%) | oklch(0.67 0.12 142 )",
|
|
105
105
|
},
|
|
106
106
|
"swatches[13] aka Swatch.GreenLight": {
|
|
107
|
-
"bg": "#
|
|
108
|
-
"fg": "#
|
|
107
|
+
"bg": "#2F3D1F | hsl( 88 33% 18%) | oklch(0.34 0.05 129 )",
|
|
108
|
+
"fg": "#96BB68 | hsl( 87 38% 57%) | oklch(0.75 0.12 129 )",
|
|
109
109
|
},
|
|
110
110
|
"swatches[14] aka Swatch.Yellow ": {
|
|
111
|
-
"bg": "#
|
|
112
|
-
"fg": "#
|
|
111
|
+
"bg": "#4A3415 | hsl( 35 56% 19%) | oklch(0.34 0.06 73 )",
|
|
112
|
+
"fg": "#E6AB55 | hsl( 36 74% 62%) | oklch(0.78 0.12 74 )",
|
|
113
113
|
},
|
|
114
114
|
"swatches[15] aka Swatch.Orange ": {
|
|
115
115
|
"bg": "#562D1F | hsl( 15 47% 23%) | oklch(0.35 0.06 39 )",
|
|
116
116
|
"fg": "#D76B47 | hsl( 15 64% 56%) | oklch(0.65 0.15 39 )",
|
|
117
117
|
},
|
|
118
118
|
"swatches[16] aka Swatch.Brown ": {
|
|
119
|
-
"bg": "#
|
|
120
|
-
"fg": "#
|
|
119
|
+
"bg": "#4D3229 | hsl( 15 31% 23%) | oklch(0.35 0.04 39 )",
|
|
120
|
+
"fg": "#A6614A | hsl( 15 38% 47%) | oklch(0.57 0.1 39 )",
|
|
121
121
|
},
|
|
122
122
|
}
|
|
123
123
|
`);
|
|
@@ -12,8 +12,8 @@ test("snapshot", () => {
|
|
|
12
12
|
"fg": "#000000 | hsl(none 0% 0%) | oklch(0 0 none)",
|
|
13
13
|
},
|
|
14
14
|
"CMYK Cyan ": {
|
|
15
|
-
"bg": "#
|
|
16
|
-
"fg": "#
|
|
15
|
+
"bg": "#DBF0EE | hsl( 174 41% 90%) | oklch(0.94 0.02 190 )",
|
|
16
|
+
"fg": "#00D6CF | hsl( 178 100% 42%) | oklch(0.79 0.14 191 )",
|
|
17
17
|
},
|
|
18
18
|
"CMYK Magenta": {
|
|
19
19
|
"bg": "#FDE4FB | hsl( 305 86% 94%) | oklch(0.95 0.04 328 )",
|
|
@@ -77,47 +77,47 @@ test("snapshot", () => {
|
|
|
77
77
|
},
|
|
78
78
|
"swatches[ 6] aka Swatch.Violet ": {
|
|
79
79
|
"bg": "#EDE9FA | hsl( 254 63% 95%) | oklch(0.94 0.02 297 )",
|
|
80
|
-
"fg": "#
|
|
80
|
+
"fg": "#6542A5 | hsl( 261 43% 45%) | oklch(0.47 0.15 296 )",
|
|
81
81
|
},
|
|
82
82
|
"swatches[ 7] aka Swatch.BlueDark ": {
|
|
83
83
|
"bg": "#E6EBFB | hsl( 226 72% 94%) | oklch(0.94 0.02 272 )",
|
|
84
|
-
"fg": "#
|
|
84
|
+
"fg": "#4356B0 | hsl( 230 45% 48%) | oklch(0.49 0.14 271 )",
|
|
85
85
|
},
|
|
86
86
|
"swatches[ 8] aka Swatch.Blue ": {
|
|
87
87
|
"bg": "#E3ECFC | hsl( 218 81% 94%) | oklch(0.94 0.02 262 )",
|
|
88
88
|
"fg": "#4F81E1 | hsl( 219 71% 60%) | oklch(0.62 0.16 262 )",
|
|
89
89
|
},
|
|
90
90
|
"swatches[ 9] aka Swatch.BlueSky ": {
|
|
91
|
-
"bg": "#
|
|
92
|
-
"fg": "#
|
|
91
|
+
"bg": "#E2EDF7 | hsl( 209 57% 93%) | oklch(0.94 0.02 245 )",
|
|
92
|
+
"fg": "#52A2E2 | hsl( 207 71% 60%) | oklch(0.69 0.12 245 )",
|
|
93
93
|
},
|
|
94
94
|
"swatches[10] aka Swatch.Turquoise ": {
|
|
95
|
-
"bg": "#
|
|
96
|
-
"fg": "#
|
|
95
|
+
"bg": "#E0EFEF | hsl( 180 32% 91%) | oklch(0.94 0.02 197 )",
|
|
96
|
+
"fg": "#48BEC3 | hsl( 182 51% 52%) | oklch(0.74 0.1 199 )",
|
|
97
97
|
},
|
|
98
98
|
"swatches[11] aka Swatch.GreenDark ": {
|
|
99
|
-
"bg": "#
|
|
100
|
-
"fg": "#
|
|
99
|
+
"bg": "#E2EEEB | hsl( 165 26% 91%) | oklch(0.94 0.01 179 )",
|
|
100
|
+
"fg": "#33907D | hsl( 168 48% 38%) | oklch(0.59 0.09 177 )",
|
|
101
101
|
},
|
|
102
102
|
"swatches[12] aka Swatch.Green ": {
|
|
103
|
-
"bg": "#
|
|
104
|
-
"fg": "#
|
|
103
|
+
"bg": "#E4EFE3 | hsl( 115 27% 91%) | oklch(0.94 0.02 143 )",
|
|
104
|
+
"fg": "#64AA5D | hsl( 115 31% 52%) | oklch(0.67 0.13 142 )",
|
|
105
105
|
},
|
|
106
106
|
"swatches[13] aka Swatch.GreenLight": {
|
|
107
|
-
"bg": "#
|
|
108
|
-
"fg": "#
|
|
107
|
+
"bg": "#E7EEE0 | hsl( 90 29% 91%) | oklch(0.94 0.02 129 )",
|
|
108
|
+
"fg": "#93BC5F | hsl( 86 41% 55%) | oklch(0.74 0.13 129 )",
|
|
109
109
|
},
|
|
110
110
|
"swatches[14] aka Swatch.Yellow ": {
|
|
111
111
|
"bg": "#F4EADD | hsl( 34 51% 91%) | oklch(0.94 0.02 75 )",
|
|
112
|
-
"fg": "#
|
|
112
|
+
"fg": "#EBA944 | hsl( 36 81% 59%) | oklch(0.78 0.14 74 )",
|
|
113
113
|
},
|
|
114
114
|
"swatches[15] aka Swatch.Orange ": {
|
|
115
115
|
"bg": "#FCE7E1 | hsl( 13 82% 94%) | oklch(0.94 0.02 37 )",
|
|
116
116
|
"fg": "#DD663D | hsl( 15 70% 55%) | oklch(0.65 0.16 39 )",
|
|
117
117
|
},
|
|
118
118
|
"swatches[16] aka Swatch.Brown ": {
|
|
119
|
-
"bg": "#
|
|
120
|
-
"fg": "#
|
|
119
|
+
"bg": "#F6E9E4 | hsl( 17 50% 93%) | oklch(0.94 0.02 42 )",
|
|
120
|
+
"fg": "#9F543B | hsl( 15 46% 43%) | oklch(0.53 0.11 39 )",
|
|
121
121
|
},
|
|
122
122
|
}
|
|
123
123
|
`);
|
|
@@ -35,7 +35,7 @@ const PASTEL_C_CEILING = 0.06;
|
|
|
35
35
|
const PASTEL_L_HIGH = 0.8;
|
|
36
36
|
const PASTEL_L_LOW = 0.25;
|
|
37
37
|
|
|
38
|
-
function makeIconSide(
|
|
38
|
+
export function makeIconSide(
|
|
39
39
|
surface: string,
|
|
40
40
|
{
|
|
41
41
|
bgLc,
|
|
@@ -98,27 +98,35 @@ function makeIconSide(
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
export const lightIconParams = {
|
|
102
|
+
bgChromaScale: 0.15,
|
|
103
|
+
fgChromaScale: 1.0,
|
|
104
|
+
bgPastelFloor: 0.02,
|
|
105
|
+
fgPastelFloor: 0.08,
|
|
106
|
+
bgSaturationCap: 0.05,
|
|
107
|
+
fgSaturationCap: 0.16,
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const darkIconParams = {
|
|
111
|
+
bgChromaScale: 0.4,
|
|
112
|
+
fgChromaScale: 0.9,
|
|
113
|
+
bgPastelFloor: 0.04,
|
|
114
|
+
fgPastelFloor: 0.07,
|
|
115
|
+
bgSaturationCap: 0.08,
|
|
116
|
+
fgSaturationCap: 0.15,
|
|
117
|
+
};
|
|
118
|
+
|
|
101
119
|
const makeIconAdapt = (surface: Def) =>
|
|
102
120
|
[
|
|
103
121
|
makeIconSide(surface[0], {
|
|
104
122
|
bgLc: 8,
|
|
105
123
|
fgLc: 33,
|
|
106
|
-
|
|
107
|
-
fgChromaScale: 1.0,
|
|
108
|
-
bgPastelFloor: 0.02,
|
|
109
|
-
fgPastelFloor: 0.08,
|
|
110
|
-
bgSaturationCap: 0.05,
|
|
111
|
-
fgSaturationCap: 0.16,
|
|
124
|
+
...lightIconParams,
|
|
112
125
|
}),
|
|
113
126
|
makeIconSide(surface[1], {
|
|
114
127
|
bgLc: 5,
|
|
115
128
|
fgLc: 28,
|
|
116
|
-
|
|
117
|
-
fgChromaScale: 0.9,
|
|
118
|
-
bgPastelFloor: 0.04,
|
|
119
|
-
fgPastelFloor: 0.07,
|
|
120
|
-
bgSaturationCap: 0.08,
|
|
121
|
-
fgSaturationCap: 0.15,
|
|
129
|
+
...darkIconParams,
|
|
122
130
|
}),
|
|
123
131
|
] satisfies ModeDef<ReturnType<typeof makeIconSide>>;
|
|
124
132
|
|
package/src/design-system/fns.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {a11yColor} from "../a11y-color";
|
|
2
2
|
import {colorFromLcCompensated, lightnessFromLc} from "../apca";
|
|
3
|
-
import {
|
|
3
|
+
import {colorFromUnsafe, oklchFrom, produceColor} from "../color-utils";
|
|
4
4
|
import {memoizeColor} from "../memoize";
|
|
5
5
|
import {alpha, type AlphaValue} from "./alpha";
|
|
6
6
|
import {getDarkenColor} from "./colors-js";
|
|
7
7
|
import {mapDef} from "./def";
|
|
8
8
|
import {makeEnumFn} from "./fns.enum";
|
|
9
|
-
import {makeIconFn} from "./fns.icon";
|
|
9
|
+
import {darkIconParams, lightIconParams, makeIconFn, makeIconSide} from "./fns.icon";
|
|
10
10
|
import type {Def, EnumDefs, ModeDef} from "./types";
|
|
11
11
|
|
|
12
12
|
function makeAdaptiveSide(
|
|
@@ -31,17 +31,34 @@ export const makeAdapt = (surface: Def, fgContrasts: [light: number, dark: numbe
|
|
|
31
31
|
|
|
32
32
|
export function createColorFns(
|
|
33
33
|
deneutralizeFilterDef: ModeDef<(color: string) => string>,
|
|
34
|
-
defs: {icon: Def; adapt: Def; callout: Def; highlight: Def; enum: EnumDefs
|
|
34
|
+
defs: {icon: Def; adapt: Def; callout: Def; highlight: Def; enum: EnumDefs}
|
|
35
35
|
) {
|
|
36
36
|
const adapt = makeAdapt(defs.adapt);
|
|
37
37
|
|
|
38
38
|
const icon = makeIconFn(deneutralizeFilterDef, defs.adapt);
|
|
39
39
|
|
|
40
|
+
const typeLabelFgAdapt = [
|
|
41
|
+
makeIconSide(defs.adapt[0], {
|
|
42
|
+
bgLc: 8,
|
|
43
|
+
fgLc: 65,
|
|
44
|
+
...lightIconParams,
|
|
45
|
+
}),
|
|
46
|
+
makeIconSide(defs.adapt[1], {
|
|
47
|
+
bgLc: 5,
|
|
48
|
+
fgLc: 60,
|
|
49
|
+
...darkIconParams,
|
|
50
|
+
}),
|
|
51
|
+
] as const;
|
|
52
|
+
|
|
40
53
|
return {
|
|
41
54
|
deneutralize: deneutralizeFilterDef,
|
|
42
55
|
|
|
43
56
|
adapt,
|
|
44
57
|
|
|
58
|
+
typeLabelFg: mapDef(deneutralizeFilterDef, (deneutralize, side) =>
|
|
59
|
+
memoizeColor((neutralColor: string) => typeLabelFgAdapt[side].fg(deneutralize(neutralColor)))
|
|
60
|
+
),
|
|
61
|
+
|
|
45
62
|
badge: mapDef(deneutralizeFilterDef, (deneutralize, side) =>
|
|
46
63
|
memoizeColor(
|
|
47
64
|
(neutralColor: string | null) => {
|
|
@@ -64,8 +81,15 @@ export function createColorFns(
|
|
|
64
81
|
|
|
65
82
|
enum: makeEnumFn(deneutralizeFilterDef, defs.adapt, defs.enum),
|
|
66
83
|
|
|
84
|
+
// TODO pick better name:
|
|
85
|
+
// appIcon
|
|
86
|
+
// typeIcon
|
|
87
|
+
// relationIcon
|
|
88
|
+
// userColorChoiceIcon
|
|
67
89
|
icon,
|
|
68
90
|
|
|
91
|
+
buttonBg: mapDef(icon, (icon) => (color: string) => icon(color).fg),
|
|
92
|
+
|
|
69
93
|
callout: mapDef(deneutralizeFilterDef, (deneutralize, side) => {
|
|
70
94
|
const surface = defs.callout[side];
|
|
71
95
|
return memoizeColor((neutralColor: string) => {
|
package/src/design-system.ts
CHANGED
|
@@ -130,11 +130,10 @@ export const FibermojiPlaceholder: FC<FibermojiPlaceholderProps> = ({
|
|
|
130
130
|
position: absolute;
|
|
131
131
|
line-height: 0;
|
|
132
132
|
inset: 0;
|
|
133
|
-
|
|
134
|
-
opacity: 0.4;
|
|
133
|
+
opacity: 0.6;
|
|
135
134
|
`}
|
|
136
135
|
>
|
|
137
|
-
<Lock iconSize={size * 0.6} containerSize={size} />
|
|
136
|
+
<Lock iconSize={size * 0.6} containerSize={size} color={null} />
|
|
138
137
|
</div>
|
|
139
138
|
</div>
|
|
140
139
|
);
|
package/src/icons/icon.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import {forwardRef} from "react";
|
|
|
3
3
|
|
|
4
4
|
import {border, iconSize as defaultIconSize, themeVars, viewBoxSize} from "../design-system";
|
|
5
5
|
import {useTheme} from "../theme-provider";
|
|
6
|
+
import DatabaseSvg from "./ast/database";
|
|
6
7
|
import {generateIconFromAst} from "./generate-icon-from-ast";
|
|
7
8
|
import type {IconProps} from "./types";
|
|
8
9
|
|
|
@@ -42,7 +43,16 @@ export const Icon = forwardRef<SVGSVGElement, IconProps>(function Icon(
|
|
|
42
43
|
ref
|
|
43
44
|
) {
|
|
44
45
|
const theme = useTheme();
|
|
45
|
-
|
|
46
|
+
let resolvedColor: string | null | undefined;
|
|
47
|
+
if (typeof color === "string" && !colorProcessed && !color.startsWith("var(")) {
|
|
48
|
+
if (icon === DatabaseSvg) {
|
|
49
|
+
resolvedColor = theme.fns.badge(color).bg;
|
|
50
|
+
} else {
|
|
51
|
+
resolvedColor = theme.fns.icon(color).fg;
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
resolvedColor = color;
|
|
55
|
+
}
|
|
46
56
|
const iconStyle = {
|
|
47
57
|
[iconColorVar]: resolvedColor,
|
|
48
58
|
[iconContainerSizeVar]: containerSize ? containerSize + "px" : undefined,
|
package/src/icons/types.ts
CHANGED
|
@@ -26,7 +26,7 @@ export type IconBaseProps = Omit<SVGProps<SVGSVGElement>, "ref" | "color"> & {
|
|
|
26
26
|
iconSize?: number;
|
|
27
27
|
/** Pass null to inherit parent's color */
|
|
28
28
|
color?: string | null | undefined;
|
|
29
|
-
/** Skip
|
|
29
|
+
/** Skip deneutralize&normalize when the color is already processed for display (e.g. a11y-adjusted) */
|
|
30
30
|
colorProcessed?: boolean;
|
|
31
31
|
};
|
|
32
32
|
|
package/src/layout-styles.ts
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
sidebarMenuItemHeightVar,
|
|
17
17
|
sidebarMenuIconSizeVar,
|
|
18
18
|
menuItemHeightVar,
|
|
19
|
-
} from "./theming";
|
|
19
|
+
} from "./theming.generated";
|
|
20
20
|
|
|
21
21
|
export const layoutStyles = css`
|
|
22
22
|
:global() {
|
|
@@ -40,5 +40,9 @@ export const layoutStyles = css`
|
|
|
40
40
|
${listRowSurfaceFontSizeVar}: ${fontSize.md}px;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
:focus:not(:focus-visible) {
|
|
45
|
+
outline: none;
|
|
46
|
+
}
|
|
43
47
|
}
|
|
44
48
|
`;
|
|
@@ -2,6 +2,7 @@ import {css} from "@linaria/core";
|
|
|
2
2
|
import {useCallback, useRef, useState} from "react";
|
|
3
3
|
|
|
4
4
|
import {AntTextArea} from "../../antd";
|
|
5
|
+
import type {TextAreaRef} from "../../antd/input";
|
|
5
6
|
|
|
6
7
|
const wrapperStyle = css`
|
|
7
8
|
${{
|
|
@@ -33,7 +34,7 @@ export const AntTextAreaWithCustomReadState = ({
|
|
|
33
34
|
...rest
|
|
34
35
|
}: AntTextAreaWithCustomReadStateProps) => {
|
|
35
36
|
const [focus, setFocus] = useState(false);
|
|
36
|
-
const input = useRef<
|
|
37
|
+
const input = useRef<TextAreaRef>(null);
|
|
37
38
|
|
|
38
39
|
const handleFocus = useCallback(
|
|
39
40
|
(e: React.FocusEvent<HTMLTextAreaElement>) => {
|
package/src/media-query-utils.ts
CHANGED
|
@@ -7,17 +7,8 @@ export function getMediaQueryList(query: string) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function subscribeOnChange(mediaQueryList: MediaQueryList, cb: (evt: MediaQueryListEvent) => void): () => void {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
mediaQueryList.
|
|
13
|
-
|
|
14
|
-
mediaQueryList.removeEventListener("change", cb);
|
|
15
|
-
};
|
|
16
|
-
} else if (mediaQueryList.addListener) {
|
|
17
|
-
mediaQueryList.addListener(cb);
|
|
18
|
-
return () => {
|
|
19
|
-
mediaQueryList.removeListener(cb);
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
return noop;
|
|
10
|
+
mediaQueryList.addEventListener("change", cb);
|
|
11
|
+
return () => {
|
|
12
|
+
mediaQueryList.removeEventListener("change", cb);
|
|
13
|
+
};
|
|
23
14
|
}
|