@cfx-dev/ui-components 4.3.2 → 4.3.3
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/{Combination-CSgOhzm-.js → Combination-BGYCZNoJ.js} +375 -367
- package/dist/Rail-CHFAf3wJ.js +81 -0
- package/dist/Table.module-DffST69u.js +17 -0
- package/dist/assets/css/Accordion.css +1 -1
- package/dist/assets/css/Box.css +1 -1
- package/dist/assets/css/Button.css +1 -1
- package/dist/assets/css/DropdownSelect.css +1 -1
- package/dist/assets/css/Flex.css +1 -1
- package/dist/assets/css/Flyout.css +1 -1
- package/dist/assets/css/Indicator.css +1 -1
- package/dist/assets/css/InfoPanel.css +1 -1
- package/dist/assets/css/Input.css +1 -1
- package/dist/assets/css/InputDropzone.css +1 -1
- package/dist/assets/css/Island.css +1 -1
- package/dist/assets/css/Link.css +1 -1
- package/dist/assets/css/Modal.css +1 -1
- package/dist/assets/css/Overlay.css +1 -1
- package/dist/assets/css/Pad.css +1 -1
- package/dist/assets/css/Popover.css +1 -1
- package/dist/assets/css/Radio.css +1 -1
- package/dist/assets/css/Rail.css +1 -1
- package/dist/assets/css/RichInput.css +1 -1
- package/dist/assets/css/Select.css +1 -1
- package/dist/assets/css/Separator.css +1 -1
- package/dist/assets/css/Switch.css +1 -1
- package/dist/assets/css/Table.css +1 -1
- package/dist/assets/css/Tabular.css +1 -1
- package/dist/assets/css/Text.css +1 -1
- package/dist/assets/css/Textarea.css +1 -1
- package/dist/assets/css/Title.css +1 -1
- package/dist/assets/css/ToggleGroup.css +1 -1
- package/dist/assets/general/global.css +1 -1
- package/dist/assets/general/themes.css +1 -1
- package/dist/components/Accordion/Accordion.js +5 -5
- package/dist/components/Accordion/AccordionShowcase.js +1 -1
- package/dist/components/Avatar/AvatarShowcase.js +1 -1
- package/dist/components/Badge/BadgeShowcase.js +1 -1
- package/dist/components/Box/Box.d.ts +6 -0
- package/dist/components/Box/Box.js +23 -0
- package/dist/components/Box/index.d.ts +3 -0
- package/dist/components/Box/index.js +6 -0
- package/dist/components/BurgerMenu/BurgerMenu.js +7 -7
- package/dist/components/BurgerMenu/BurgerMenuButton.js +2 -2
- package/dist/components/BurgerMenu/BurgerMenuShowcase.js +1 -1
- package/dist/components/Button/ButtonShowcase.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +252 -157
- package/dist/components/DataTable/DataTable.js +2 -2
- package/dist/components/DataTable/DataTableShowcase.js +2 -2
- package/dist/components/DropdownSelect/DropdownSelect.js +13 -13
- package/dist/components/DropdownSelect/DropdownSelectShowcase.js +1 -1
- package/dist/components/Flex/Flex.d.ts +7 -0
- package/dist/components/Flex/Flex.js +23 -0
- package/dist/components/Flex/index.d.ts +6 -0
- package/dist/components/{Layout/Flex → Flex}/index.js +2 -2
- package/dist/components/Flyout/Flyout.js +6 -6
- package/dist/components/InfoPanel/InfoPanel.js +3 -3
- package/dist/components/InfoPanel/InfoPanelShowcase.js +1 -1
- package/dist/components/Input/Input.js +87 -87
- package/dist/components/Input/InputShowcase.js +1 -1
- package/dist/components/Input/RichInput.js +42 -42
- package/dist/components/Island/Island.js +27 -27
- package/dist/components/Layout/Pad/Pad.js +20 -20
- package/dist/components/Link/LinkShowcase.js +1 -1
- package/dist/components/Logos/LogosShowcase.js +1 -1
- package/dist/components/Modal/ModalShowcase.js +4 -4
- package/dist/components/OnScreenSensor.js +13 -13
- package/dist/components/Popover/Popover.js +5 -5
- package/dist/components/Popover/PopoverShowcase.js +1 -1
- package/dist/components/{Layout → RSC}/Box/Box.d.ts +3 -2
- package/dist/components/RSC/Box/Box.js +101 -0
- package/dist/components/RSC/Box/index.d.ts +2 -0
- package/dist/components/RSC/Box/index.js +7 -0
- package/dist/components/{Layout → RSC}/Flex/Flex.d.ts +4 -2
- package/dist/components/RSC/Flex/Flex.js +119 -0
- package/dist/components/{Layout → RSC}/Flex/index.d.ts +1 -1
- package/dist/components/RSC/Flex/index.js +15 -0
- package/dist/components/Scrollable/Rail.js +9 -0
- package/dist/components/Scrollable/Scrollable.js +88 -0
- package/dist/components/{Layout/Scrollable → Scrollable}/ScrollableShowcase.js +3 -3
- package/dist/components/{Layout/Scrollable → Scrollable}/VirtualScrollable.js +3 -3
- package/dist/components/{Layout/Scrollable → Scrollable}/index.js +1 -1
- package/dist/components/Select/Select.js +3 -3
- package/dist/components/Select/SelectShowcase.js +1 -1
- package/dist/components/Separator/Separator.js +3 -3
- package/dist/components/Shroud/Shroud.js +7 -7
- package/dist/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.js +5 -5
- package/dist/components/Skeleton/SkeletonShowcase.js +1 -1
- package/dist/components/Slider/Slider.js +2 -2
- package/dist/components/Slider/SliderShowcase.js +1 -1
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/TableBody.js +1 -1
- package/dist/components/Table/TableCell.d.ts +1 -1
- package/dist/components/Table/TableCell.js +13 -12
- package/dist/components/Table/TableCellCheckbox.js +1 -1
- package/dist/components/Table/TableHeader.js +1 -1
- package/dist/components/Table/TableIconButton.js +1 -1
- package/dist/components/Table/TableRoot.js +1 -1
- package/dist/components/Table/TableRow.js +1 -1
- package/dist/components/Tabular/TabularShowcase.js +1 -1
- package/dist/components/Text/TextShowcase.js +2 -2
- package/dist/components/Textarea/Textarea.js +32 -34
- package/dist/components/Title/Title.js +62 -62
- package/dist/components/Title/TitleShowcase.js +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.js +7 -7
- package/dist/components/ToggleGroup/ToggleGroupShowcase.js +1 -1
- package/dist/index-ByKwkZKY.js +239 -0
- package/dist/{index-HDl8nGsm.js → index-CriGVLlo.js} +1 -1
- package/dist/{index-DZEAOJqB.js → index-DlJ4qUbZ.js} +1 -1
- package/dist/main.d.ts +6 -6
- package/dist/main.js +94 -93
- package/dist/rsc.d.ts +4 -0
- package/dist/rsc.js +16 -0
- package/dist/styles-scss/_colors.scss +41 -32
- package/dist/styles-scss/_typography.scss +5 -5
- package/dist/styles-scss/_ui.scss +36 -20
- package/dist/styles-scss/global.scss +24 -13
- package/dist/styles-scss/themes/theme_cfx.scss +3 -5
- package/dist/styles-scss/themes/theme_fivem.scss +5 -7
- package/dist/styles-scss/themes/theme_redm.scss +4 -6
- package/dist/styles-scss/themes/theme_wireframe.scss +5 -7
- package/dist/styles-scss/themes.scss +4 -4
- package/dist/styles-scss/tokens.scss +2 -56
- package/dist/utils/hooks/useGlobalKeyboardEvent.js +3 -3
- package/dist/utils/hooks/useWindowResize.js +5 -5
- package/dist/utils/string.d.ts +1 -0
- package/dist/utils/string.js +23 -19
- package/package.json +10 -5
- package/dist/Rail-DcVowhML.js +0 -81
- package/dist/Table.module-DHI1mXN2.js +0 -17
- package/dist/components/Layout/Box/Box.js +0 -72
- package/dist/components/Layout/Box/index.d.ts +0 -2
- package/dist/components/Layout/Box/index.js +0 -5
- package/dist/components/Layout/Flex/Flex.js +0 -84
- package/dist/components/Layout/Scrollable/Rail.js +0 -9
- package/dist/components/Layout/Scrollable/Scrollable.js +0 -91
- package/dist/index-BHuChyf5.js +0 -238
- /package/dist/components/{Layout/Flex → Flex}/FlexShowcase.d.ts +0 -0
- /package/dist/components/{Layout/Flex → Flex}/FlexShowcase.js +0 -0
- /package/dist/components/{Layout → RSC}/Box/Box.types.d.ts +0 -0
- /package/dist/components/{Layout → RSC}/Box/Box.types.js +0 -0
- /package/dist/components/{Layout → RSC}/Flex/Flex.types.d.ts +0 -0
- /package/dist/components/{Layout → RSC}/Flex/Flex.types.js +0 -0
- /package/dist/components/{Layout → RSC}/Flex/FlexRestricter.d.ts +0 -0
- /package/dist/components/{Layout → RSC}/Flex/FlexRestricter.js +0 -0
- /package/dist/components/{Layout/Scrollable → Scrollable}/Rail.d.ts +0 -0
- /package/dist/components/{Layout/Scrollable → Scrollable}/Scrollable.d.ts +0 -0
- /package/dist/components/{Layout/Scrollable → Scrollable}/ScrollableShowcase.d.ts +0 -0
- /package/dist/components/{Layout/Scrollable → Scrollable}/VirtualScrollable.d.ts +0 -0
- /package/dist/components/{Layout/Scrollable → Scrollable}/index.d.ts +0 -0
package/dist/main.js
CHANGED
|
@@ -48,45 +48,46 @@ import { default as Lr } from "./components/Input/Input.js";
|
|
|
48
48
|
import { default as yr } from "./components/Input/RichInput.js";
|
|
49
49
|
import { Interactive as kr } from "./components/Interactive/Interactive.js";
|
|
50
50
|
import { Island as Dr, IslandCorner as br } from "./components/Island/Island.js";
|
|
51
|
-
import { default as Pr
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import { default as
|
|
86
|
-
import { default as
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
51
|
+
import { default as Pr } from "./components/Box/Box.js";
|
|
52
|
+
import { stringPropFormater as _r } from "./components/RSC/Box/Box.js";
|
|
53
|
+
import { Center as hr } from "./components/Layout/Center/Center.js";
|
|
54
|
+
import { default as zr } from "./components/Flex/Flex.js";
|
|
55
|
+
import { FlexAlignItemsEnum as Mr, FlexDirectionEnum as Nr, FlexJustifyContentEnum as Gr, FlexWrapEnum as Vr } from "./components/RSC/Flex/Flex.types.js";
|
|
56
|
+
import { FlexRestricter as Yr } from "./components/RSC/Flex/FlexRestricter.js";
|
|
57
|
+
import { Pad as Wr } from "./components/Layout/Pad/Pad.js";
|
|
58
|
+
import { Page as Jr } from "./components/Layout/Page/Page.js";
|
|
59
|
+
import { R as Zr } from "./Rail-CHFAf3wJ.js";
|
|
60
|
+
import { Scrollable as qr } from "./components/Scrollable/Scrollable.js";
|
|
61
|
+
import { VirtualScrollable as oe } from "./components/Scrollable/VirtualScrollable.js";
|
|
62
|
+
import { Loaf as ee } from "./components/Loaf/Loaf.js";
|
|
63
|
+
import { Modal as ae } from "./components/Modal/Modal.js";
|
|
64
|
+
import { NavList as me } from "./components/NavList/NavList.js";
|
|
65
|
+
import { OVERLAY_OUTLET_ID as xe, Overlay as ne } from "./components/Overlay/Overlay.js";
|
|
66
|
+
import { Popover as ue } from "./components/Popover/Popover.js";
|
|
67
|
+
import { PremiumBadge as ie } from "./components/PremiumBadge/PremiumBadge.js";
|
|
68
|
+
import { Prose as ce } from "./components/Prose/Prose.js";
|
|
69
|
+
import { Radio as Ie } from "./components/Radio/Radio.js";
|
|
70
|
+
import { Select as ge } from "./components/Select/Select.js";
|
|
71
|
+
import { DropdownSelect as Ee } from "./components/DropdownSelect/DropdownSelect.js";
|
|
72
|
+
import { Separator as Se } from "./components/Separator/Separator.js";
|
|
73
|
+
import { Shroud as Re } from "./components/Shroud/Shroud.js";
|
|
74
|
+
import { Slider as Ae } from "./components/Slider/Slider.js";
|
|
75
|
+
import { Spacer as be } from "./components/Spacer/Spacer.js";
|
|
76
|
+
import { Style as Pe, useContextualStyle as Fe } from "./components/Style/Style.js";
|
|
77
|
+
import { default as ve } from "./components/Switch/Switch.js";
|
|
78
|
+
import { ToggleGroup as Ue } from "./components/ToggleGroup/ToggleGroup.js";
|
|
79
|
+
import { Tabular as we } from "./components/Tabular/Tabular.js";
|
|
80
|
+
import { DataTable as Ne, DataTableHeaderItem as Ge, DataTableRow as Ve } from "./components/DataTable/DataTable.js";
|
|
81
|
+
import { Table as Ye } from "./components/Table/index.js";
|
|
82
|
+
import { DEFAULT_TEXT_COLOR as We, TEXT_OPACITY_MAP as Xe, Text as Je, TextBlock as Qe, getTextOpacity as Ze, textSizeResponsiveValueFormatter as je } from "./components/Text/Text.js";
|
|
83
|
+
import { Textarea as $e } from "./components/Textarea/Textarea.js";
|
|
84
|
+
import { TITLE_OUTLET_ID as rt, Title as et, titleGetCoords as tt, titleGetCssStyle as at } from "./components/Title/Title.js";
|
|
85
|
+
import { default as mt } from "./components/InputDropzone/InputDropzone.js";
|
|
86
|
+
import { default as xt } from "./components/InputDropzone/ItemPreview.js";
|
|
87
|
+
import { default as lt } from "./components/Skeleton/Skeleton.js";
|
|
88
|
+
import { OnScreenSensor as st } from "./components/OnScreenSensor.js";
|
|
89
|
+
import { Symbols as dt } from "./components/Symbols.js";
|
|
90
|
+
import { default as Tt } from "./components/Table/TableIconButton.js";
|
|
90
91
|
export {
|
|
91
92
|
To as Accordion,
|
|
92
93
|
Io as AccordionContent,
|
|
@@ -106,27 +107,27 @@ export {
|
|
|
106
107
|
Ao as ButtonContent,
|
|
107
108
|
Vo as ButtonLink,
|
|
108
109
|
L as CLIPBOARD_TITLE_APPEARANCE,
|
|
109
|
-
|
|
110
|
+
hr as Center,
|
|
110
111
|
yo as Checkbox,
|
|
111
112
|
Lo as ClipboardButton,
|
|
112
113
|
fo as ColorEnum,
|
|
113
114
|
jo as ControlBox,
|
|
114
115
|
$o as CountryFlag,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
We as DEFAULT_TEXT_COLOR,
|
|
117
|
+
Ne as DataTable,
|
|
118
|
+
Ge as DataTableHeaderItem,
|
|
119
|
+
Ve as DataTableRow,
|
|
119
120
|
rr as Decorate,
|
|
120
121
|
tr as Dot,
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
Ee as DropdownSelect,
|
|
123
|
+
xt as DropzoneItemPreview,
|
|
123
124
|
fr as FLYOUT_OUTLET_ID,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
zr as Flex,
|
|
126
|
+
Mr as FlexAlignItemsEnum,
|
|
127
|
+
Nr as FlexDirectionEnum,
|
|
128
|
+
Gr as FlexJustifyContentEnum,
|
|
129
|
+
Yr as FlexRestricter,
|
|
130
|
+
Vr as FlexWrapEnum,
|
|
130
131
|
mr as Flyout,
|
|
131
132
|
dr as Icon,
|
|
132
133
|
Tr as IconBig,
|
|
@@ -136,52 +137,52 @@ export {
|
|
|
136
137
|
Cr as Indicator,
|
|
137
138
|
Br as InfoPanel,
|
|
138
139
|
Lr as Input,
|
|
139
|
-
|
|
140
|
+
mt as InputDropzone,
|
|
140
141
|
kr as Interactive,
|
|
141
142
|
Dr as Island,
|
|
142
143
|
br as IslandCorner,
|
|
143
144
|
wo as Link,
|
|
144
145
|
Fo as LinkButton,
|
|
145
146
|
P as Linkify,
|
|
146
|
-
|
|
147
|
+
ee as Loaf,
|
|
147
148
|
xr as Logos,
|
|
148
149
|
mo as MediaQueryEnum,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
ae as Modal,
|
|
151
|
+
me as NavList,
|
|
152
|
+
xe as OVERLAY_OUTLET_ID,
|
|
152
153
|
po as OffsetEnum,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
154
|
+
st as OnScreenSensor,
|
|
155
|
+
ne as Overlay,
|
|
156
|
+
Wr as Pad,
|
|
157
|
+
Jr as Page,
|
|
158
|
+
ue as Popover,
|
|
159
|
+
ie as PremiumBadge,
|
|
160
|
+
ce as Prose,
|
|
161
|
+
Ie as Radio,
|
|
162
|
+
Zr as Rail,
|
|
162
163
|
yr as RichInput,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
164
|
+
qr as Scrollable,
|
|
165
|
+
ge as Select,
|
|
166
|
+
Se as Separator,
|
|
167
|
+
Re as Shroud,
|
|
168
|
+
lt as Skeleton,
|
|
169
|
+
Ae as Slider,
|
|
170
|
+
be as Spacer,
|
|
171
|
+
Pe as Style,
|
|
172
|
+
ve as Switch,
|
|
173
|
+
dt as Symbols,
|
|
174
|
+
Xe as TEXT_OPACITY_MAP,
|
|
175
|
+
rt as TITLE_OUTLET_ID,
|
|
176
|
+
Ye as Table,
|
|
177
|
+
Tt as TableIconButton,
|
|
178
|
+
we as Tabular,
|
|
179
|
+
Je as Text,
|
|
180
|
+
Qe as TextBlock,
|
|
180
181
|
xo as TextSizeEnum,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
$e as Textarea,
|
|
183
|
+
et as Title,
|
|
184
|
+
Ue as ToggleGroup,
|
|
185
|
+
oe as VirtualScrollable,
|
|
185
186
|
no as ZIndexEnum,
|
|
186
187
|
N as clamp,
|
|
187
188
|
G as clamp01,
|
|
@@ -193,7 +194,7 @@ export {
|
|
|
193
194
|
oo as getColor,
|
|
194
195
|
Mo as getLinkClassName,
|
|
195
196
|
No as getLinkStyles,
|
|
196
|
-
|
|
197
|
+
Ze as getTextOpacity,
|
|
197
198
|
m as getValue,
|
|
198
199
|
R as identity,
|
|
199
200
|
k as invoke,
|
|
@@ -213,15 +214,15 @@ export {
|
|
|
213
214
|
D as returnFalse,
|
|
214
215
|
b as returnTrue,
|
|
215
216
|
J as splitByIndices,
|
|
216
|
-
|
|
217
|
-
|
|
217
|
+
_r as stringPropFormater,
|
|
218
|
+
je as textSizeResponsiveValueFormatter,
|
|
218
219
|
q as throttle,
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
tt as titleGetCoords,
|
|
221
|
+
at as titleGetCssStyle,
|
|
221
222
|
eo as ui,
|
|
222
223
|
Q as unicodeCharAt,
|
|
223
224
|
S as useClipboardComponent,
|
|
224
|
-
|
|
225
|
+
Fe as useContextualStyle,
|
|
225
226
|
s as useDynamicRef,
|
|
226
227
|
d as useGlobalKeyboardEvent,
|
|
227
228
|
l as useInstance,
|
package/dist/rsc.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Box, stringPropFormater, getBoxClassNames, getBoxStyles, } from './components/RSC/Box';
|
|
2
|
+
export type { BoxProps } from './components/RSC/Box';
|
|
3
|
+
export { Flex, FlexRestricter, FlexAlignItemsEnum, FlexDirectionEnum, FlexJustifyContentEnum, FlexWrapEnum, } from './components/RSC/Flex';
|
|
4
|
+
export type { FlexProps, FlexRestricterProps, FlexAlignItemsType, FlexDirectionType, FlexJustifyContentType, FlexWrapType, } from './components/RSC/Flex';
|
package/dist/rsc.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as r, getBoxClassNames as o, getBoxStyles as x, stringPropFormater as l } from "./components/RSC/Box/Box.js";
|
|
2
|
+
import { default as s } from "./components/RSC/Flex/Flex.js";
|
|
3
|
+
import { FlexAlignItemsEnum as a, FlexDirectionEnum as f, FlexJustifyContentEnum as u, FlexWrapEnum as F } from "./components/RSC/Flex/Flex.types.js";
|
|
4
|
+
import { FlexRestricter as p } from "./components/RSC/Flex/FlexRestricter.js";
|
|
5
|
+
export {
|
|
6
|
+
r as Box,
|
|
7
|
+
s as Flex,
|
|
8
|
+
a as FlexAlignItemsEnum,
|
|
9
|
+
f as FlexDirectionEnum,
|
|
10
|
+
u as FlexJustifyContentEnum,
|
|
11
|
+
p as FlexRestricter,
|
|
12
|
+
F as FlexWrapEnum,
|
|
13
|
+
o as getBoxClassNames,
|
|
14
|
+
x as getBoxStyles,
|
|
15
|
+
l as stringPropFormater
|
|
16
|
+
};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
@use "sass:math";
|
|
2
2
|
@use "sass:list";
|
|
3
|
+
@use "sass:map";
|
|
4
|
+
@use "sass:color";
|
|
5
|
+
|
|
6
|
+
@function get-channel($color, $channel) {
|
|
7
|
+
@return color.channel($color, $channel, $space: rgb);
|
|
8
|
+
}
|
|
3
9
|
|
|
4
10
|
@function get-luminance($color) {
|
|
5
11
|
$colors: (
|
|
6
|
-
'red':
|
|
7
|
-
'green':
|
|
8
|
-
'blue':
|
|
12
|
+
'red': get-channel($color, "red"),
|
|
13
|
+
'green': get-channel($color, "green"),
|
|
14
|
+
'blue': get-channel($color, "blue"),
|
|
9
15
|
);
|
|
10
16
|
|
|
11
17
|
@each $name, $value in $colors {
|
|
@@ -19,20 +25,19 @@
|
|
|
19
25
|
$value: math.pow($value, 2.4);
|
|
20
26
|
}
|
|
21
27
|
|
|
22
|
-
$colors: map
|
|
28
|
+
$colors: map.merge($colors, ($name: $value));
|
|
23
29
|
}
|
|
24
30
|
|
|
25
|
-
@return (map
|
|
31
|
+
@return (map.get($colors, 'red') * .2126) + (map.get($colors, 'green') * .7152) + (map.get($colors, 'blue') * .0722);
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
@function interpolate($c1, $c2, $f) {
|
|
29
|
-
$c1r:
|
|
30
|
-
$c1g:
|
|
31
|
-
$c1b:
|
|
32
|
-
|
|
33
|
-
$
|
|
34
|
-
$
|
|
35
|
-
$c2b: blue($c2);
|
|
35
|
+
$c1r: get-channel($c1, "red");
|
|
36
|
+
$c1g: get-channel($c1, "green");
|
|
37
|
+
$c1b: get-channel($c1, "blue");
|
|
38
|
+
$c2r: get-channel($c2, "red");
|
|
39
|
+
$c2g: get-channel($c2, "green");
|
|
40
|
+
$c2b: get-channel($c2, "blue");
|
|
36
41
|
|
|
37
42
|
@return rgb(
|
|
38
43
|
$c1r + $f * ($c2r - $c1r),
|
|
@@ -43,8 +48,8 @@
|
|
|
43
48
|
|
|
44
49
|
@function set-luminance($color, $lum) {
|
|
45
50
|
$itersLeft: 20;
|
|
46
|
-
$low: rgb(0
|
|
47
|
-
$high: rgb(255
|
|
51
|
+
$low: rgb(0 0 0);
|
|
52
|
+
$high: rgb(255 255 255);
|
|
48
53
|
|
|
49
54
|
@if get-luminance($color) > $lum {
|
|
50
55
|
$high: $color;
|
|
@@ -55,9 +60,8 @@
|
|
|
55
60
|
$mid: interpolate($low, $high, .5);
|
|
56
61
|
$lm: get-luminance($mid);
|
|
57
62
|
|
|
58
|
-
@while math.abs($lum - $lm) >= 1e-7 and $itersLeft > 0 {
|
|
63
|
+
@while math.abs($lum - $lm) >= 1e - 7 and $itersLeft > 0 {
|
|
59
64
|
$itersLeft: $itersLeft - 1;
|
|
60
|
-
|
|
61
65
|
$mid: interpolate($low, $high, .5);
|
|
62
66
|
$lm: get-luminance($mid);
|
|
63
67
|
|
|
@@ -72,7 +76,7 @@
|
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
@function color-triplet($color) {
|
|
75
|
-
@return #{
|
|
79
|
+
@return #{get-channel($color, "red")}, #{get-channel($color, "green")}, #{get-channel($color, "blue")};
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
|
|
@@ -82,20 +86,22 @@ $_16OVER116: math.div(16, 116);
|
|
|
82
86
|
$_1OVER2P4: math.div(1, 2.4);
|
|
83
87
|
|
|
84
88
|
@function rgb2lab($color) {
|
|
85
|
-
$r: math.div(
|
|
86
|
-
$g: math.div(
|
|
87
|
-
$b: math.div(
|
|
89
|
+
$r: math.div(get-channel($color, "red"), 255);
|
|
90
|
+
$g: math.div(get-channel($color, "green"), 255);
|
|
91
|
+
$b: math.div(get-channel($color, "blue"), 255);
|
|
88
92
|
|
|
89
93
|
@if $r > 0.04045 {
|
|
90
94
|
$r: math.pow(math.div($r + 0.055, 1.055), 2.4);
|
|
91
95
|
} @else {
|
|
92
96
|
$r: math.div($r, 12.92);
|
|
93
97
|
}
|
|
98
|
+
|
|
94
99
|
@if $g > 0.04045 {
|
|
95
100
|
$g: math.pow(math.div($g + 0.055, 1.055), 2.4);
|
|
96
101
|
} @else {
|
|
97
102
|
$g: math.div($g, 12.92);
|
|
98
103
|
}
|
|
104
|
+
|
|
99
105
|
@if $b > 0.04045 {
|
|
100
106
|
$b: math.pow(math.div($b + 0.055, 1.055), 2.4);
|
|
101
107
|
} @else {
|
|
@@ -111,11 +117,13 @@ $_1OVER2P4: math.div(1, 2.4);
|
|
|
111
117
|
} @else {
|
|
112
118
|
$x: (7.787 * $x) + $_16OVER116;
|
|
113
119
|
}
|
|
120
|
+
|
|
114
121
|
@if $y > 0.008856 {
|
|
115
122
|
$y: math.pow($y, $oneThird);
|
|
116
123
|
} @else {
|
|
117
124
|
$y: (7.787 * $y) + $_16OVER116;
|
|
118
125
|
}
|
|
126
|
+
|
|
119
127
|
@if $z > 0.008856 {
|
|
120
128
|
$z: math.pow($z, $oneThird);
|
|
121
129
|
} @else {
|
|
@@ -130,10 +138,9 @@ $_1OVER2P4: math.div(1, 2.4);
|
|
|
130
138
|
}
|
|
131
139
|
|
|
132
140
|
@function lab2rgb($lab) {
|
|
133
|
-
$y: math.div(map
|
|
134
|
-
$x: math.div(map
|
|
135
|
-
$z: $y - math.div(map
|
|
136
|
-
|
|
141
|
+
$y: math.div(map.get($lab, 'L') + 16, 116);
|
|
142
|
+
$x: math.div(map.get($lab, 'a'), 500) + $y;
|
|
143
|
+
$z: $y - math.div(map.get($lab, 'b'), 200);
|
|
137
144
|
$x3: math.pow($x, 3);
|
|
138
145
|
$y3: math.pow($y, 3);
|
|
139
146
|
$z3: math.pow($z, 3);
|
|
@@ -143,11 +150,13 @@ $_1OVER2P4: math.div(1, 2.4);
|
|
|
143
150
|
} @else {
|
|
144
151
|
$x: math.div($x - $_16OVER116 , 7.787);
|
|
145
152
|
}
|
|
153
|
+
|
|
146
154
|
@if $y3 > 0.008856 {
|
|
147
155
|
$y: $y3;
|
|
148
156
|
} @else {
|
|
149
157
|
$y: math.div($y - $_16OVER116 , 7.787);
|
|
150
158
|
}
|
|
159
|
+
|
|
151
160
|
@if $z3 > 0.008856 {
|
|
152
161
|
$z: $z3;
|
|
153
162
|
} @else {
|
|
@@ -157,21 +166,22 @@ $_1OVER2P4: math.div(1, 2.4);
|
|
|
157
166
|
$x: $x * 0.95047;
|
|
158
167
|
$y: $y * 1.00000;
|
|
159
168
|
$z: $z * 1.08883;
|
|
160
|
-
|
|
161
|
-
$
|
|
162
|
-
$
|
|
163
|
-
$b: $x * 0.0557 + $y * -0.2040 + $z * 1.0570;
|
|
169
|
+
$r: $x * 3.2406 + $y * -1.5372 + $z * -0.4986;
|
|
170
|
+
$g: $x * -0.9689 + $y * 1.8758 + $z * 0.0415;
|
|
171
|
+
$b: $x * 0.0557 + $y * -0.2040 + $z * 1.0570;
|
|
164
172
|
|
|
165
173
|
@if $r > 0.0031308 {
|
|
166
174
|
$r: 1.055 * math.pow($r, $_1OVER2P4) - 0.055;
|
|
167
175
|
} @else {
|
|
168
176
|
$r: 12.92 * $r;
|
|
169
177
|
}
|
|
178
|
+
|
|
170
179
|
@if $g > 0.0031308 {
|
|
171
180
|
$g: 1.055 * math.pow($g, $_1OVER2P4) - 0.055;
|
|
172
181
|
} @else {
|
|
173
182
|
$g: 12.92 * $g;
|
|
174
183
|
}
|
|
184
|
+
|
|
175
185
|
@if $b > 0.0031308 {
|
|
176
186
|
$b: 1.055 * math.pow($b, $_1OVER2P4) - 0.055;
|
|
177
187
|
} @else {
|
|
@@ -198,14 +208,13 @@ $_1OVER2P4: math.div(1, 2.4);
|
|
|
198
208
|
@function lab-gradient-step($s, $e, $i, $stop) {
|
|
199
209
|
$s: rgb2lab($s);
|
|
200
210
|
$e: rgb2lab($e);
|
|
201
|
-
|
|
202
211
|
$a: math.div($i, $stop - 1);
|
|
203
212
|
$ia: 1 - $a;
|
|
204
213
|
|
|
205
214
|
@return lab2rgb((
|
|
206
|
-
'L': $ia * map
|
|
207
|
-
'a': $ia * map
|
|
208
|
-
'b': $ia * map
|
|
215
|
+
'L': $ia * map.get($s, 'L') + $a * map.get($e, 'L'),
|
|
216
|
+
'a': $ia * map.get($s, 'a') + $a * map.get($e, 'a'),
|
|
217
|
+
'b': $ia * map.get($s, 'b') + $a * map.get($e, 'b'),
|
|
209
218
|
));
|
|
210
219
|
}
|
|
211
220
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
@font-face {
|
|
9
9
|
font-style: normal;
|
|
10
10
|
font-weight: 400;
|
|
11
|
-
font-family:
|
|
11
|
+
font-family: HelveticaNowDisplay;
|
|
12
12
|
src: url("assets/fonts/HelveticaNow/HelveticaNowDisplay.woff2") format("woff2"),
|
|
13
13
|
url("assets/fonts/HelveticaNow/HelveticaNowDisplay.woff") format("woff"),
|
|
14
14
|
url("assets/fonts/HelveticaNow/HelveticaNowDisplay.ttf") format("truetype");
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
@font-face {
|
|
18
18
|
font-style: normal;
|
|
19
19
|
font-weight: 700;
|
|
20
|
-
font-family:
|
|
20
|
+
font-family: HelveticaNowDisplay;
|
|
21
21
|
src: url("assets/fonts/HelveticaNow/HelveticaNowDisplayBold.woff2") format("woff2"),
|
|
22
22
|
url("assets/fonts/HelveticaNow/HelveticaNowDisplayBold.woff") format("woff"),
|
|
23
23
|
url("assets/fonts/HelveticaNow/HelveticaNowDisplayBold.ttf") format("truetype");
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
@font-face {
|
|
27
27
|
font-style: normal;
|
|
28
28
|
font-weight: 400;
|
|
29
|
-
font-family:
|
|
29
|
+
font-family: HelveticaNowText;
|
|
30
30
|
src: url("assets/fonts/HelveticaNow/HelveticaNowText.woff2") format("woff2"),
|
|
31
31
|
url("assets/fonts/HelveticaNow/HelveticaNowText.woff") format("woff"),
|
|
32
32
|
url("assets/fonts/HelveticaNow/HelveticaNowText.ttf") format("truetype");
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
@font-face {
|
|
36
36
|
font-style: normal;
|
|
37
37
|
font-weight: 700;
|
|
38
|
-
font-family:
|
|
38
|
+
font-family: HelveticaNowText;
|
|
39
39
|
src: url("assets/fonts/HelveticaNow/HelveticaNowTextBold.woff2") format("woff2"),
|
|
40
40
|
url("assets/fonts/HelveticaNow/HelveticaNowTextBold.woff") format("woff"),
|
|
41
41
|
url("assets/fonts/HelveticaNow/HelveticaNowTextBold.ttf") format("truetype");
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
@font-face {
|
|
45
45
|
font-style: italic;
|
|
46
46
|
font-weight: 400;
|
|
47
|
-
font-family:
|
|
47
|
+
font-family: HelveticaNowText;
|
|
48
48
|
src: url("assets/fonts/HelveticaNow/HelveticaNowTextIt.woff2") format("woff2"),
|
|
49
49
|
url("assets/fonts/HelveticaNow/HelveticaNowTextIt.woff") format("woff"),
|
|
50
50
|
url("assets/fonts/HelveticaNow/HelveticaNowTextIt.ttf") format("truetype");
|