@cfx-dev/ui-components 4.3.1 → 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.
Files changed (151) hide show
  1. package/dist/{Combination-CSgOhzm-.js → Combination-BGYCZNoJ.js} +375 -367
  2. package/dist/Rail-CHFAf3wJ.js +81 -0
  3. package/dist/Table.module-DffST69u.js +17 -0
  4. package/dist/assets/css/Accordion.css +1 -1
  5. package/dist/assets/css/Box.css +1 -1
  6. package/dist/assets/css/Button.css +1 -1
  7. package/dist/assets/css/DataTable.css +1 -1
  8. package/dist/assets/css/DropdownSelect.css +1 -1
  9. package/dist/assets/css/Flex.css +1 -1
  10. package/dist/assets/css/Flyout.css +1 -1
  11. package/dist/assets/css/Indicator.css +1 -1
  12. package/dist/assets/css/InfoPanel.css +1 -1
  13. package/dist/assets/css/Input.css +1 -1
  14. package/dist/assets/css/InputDropzone.css +1 -1
  15. package/dist/assets/css/Island.css +1 -1
  16. package/dist/assets/css/Link.css +1 -1
  17. package/dist/assets/css/Modal.css +1 -1
  18. package/dist/assets/css/Overlay.css +1 -1
  19. package/dist/assets/css/Pad.css +1 -1
  20. package/dist/assets/css/Popover.css +1 -1
  21. package/dist/assets/css/Radio.css +1 -1
  22. package/dist/assets/css/Rail.css +1 -1
  23. package/dist/assets/css/RichInput.css +1 -1
  24. package/dist/assets/css/Select.css +1 -1
  25. package/dist/assets/css/Separator.css +1 -1
  26. package/dist/assets/css/Switch.css +1 -1
  27. package/dist/assets/css/Table.css +1 -1
  28. package/dist/assets/css/Tabular.css +1 -1
  29. package/dist/assets/css/Text.css +1 -1
  30. package/dist/assets/css/Textarea.css +1 -1
  31. package/dist/assets/css/Title.css +1 -1
  32. package/dist/assets/css/ToggleGroup.css +1 -1
  33. package/dist/assets/general/global.css +1 -1
  34. package/dist/assets/general/themes.css +1 -1
  35. package/dist/components/Accordion/Accordion.js +5 -5
  36. package/dist/components/Accordion/AccordionShowcase.js +1 -1
  37. package/dist/components/Avatar/AvatarShowcase.js +1 -1
  38. package/dist/components/Badge/BadgeShowcase.js +1 -1
  39. package/dist/components/Box/Box.d.ts +6 -0
  40. package/dist/components/Box/Box.js +23 -0
  41. package/dist/components/Box/index.d.ts +3 -0
  42. package/dist/components/Box/index.js +6 -0
  43. package/dist/components/BurgerMenu/BurgerMenu.js +7 -7
  44. package/dist/components/BurgerMenu/BurgerMenuButton.js +2 -2
  45. package/dist/components/BurgerMenu/BurgerMenuShowcase.js +1 -1
  46. package/dist/components/Button/ButtonShowcase.js +1 -1
  47. package/dist/components/Checkbox/Checkbox.js +252 -157
  48. package/dist/components/DataTable/DataTable.js +2 -2
  49. package/dist/components/DataTable/DataTableShowcase.js +2 -2
  50. package/dist/components/DropdownSelect/DropdownSelect.js +13 -13
  51. package/dist/components/DropdownSelect/DropdownSelectShowcase.js +1 -1
  52. package/dist/components/Flex/Flex.d.ts +7 -0
  53. package/dist/components/Flex/Flex.js +23 -0
  54. package/dist/components/Flex/index.d.ts +6 -0
  55. package/dist/components/{Layout/Flex → Flex}/index.js +2 -2
  56. package/dist/components/Flyout/Flyout.js +6 -6
  57. package/dist/components/InfoPanel/InfoPanel.js +3 -3
  58. package/dist/components/InfoPanel/InfoPanelShowcase.js +1 -1
  59. package/dist/components/Input/Input.js +87 -87
  60. package/dist/components/Input/InputShowcase.js +1 -1
  61. package/dist/components/Input/RichInput.js +42 -42
  62. package/dist/components/Island/Island.js +27 -27
  63. package/dist/components/Layout/Pad/Pad.js +20 -20
  64. package/dist/components/Link/LinkShowcase.js +1 -1
  65. package/dist/components/Logos/LogosShowcase.js +1 -1
  66. package/dist/components/Modal/ModalShowcase.js +4 -4
  67. package/dist/components/OnScreenSensor.js +13 -13
  68. package/dist/components/Popover/Popover.js +5 -5
  69. package/dist/components/Popover/PopoverShowcase.js +1 -1
  70. package/dist/components/{Layout → RSC}/Box/Box.d.ts +3 -2
  71. package/dist/components/RSC/Box/Box.js +101 -0
  72. package/dist/components/RSC/Box/index.d.ts +2 -0
  73. package/dist/components/RSC/Box/index.js +7 -0
  74. package/dist/components/{Layout → RSC}/Flex/Flex.d.ts +4 -2
  75. package/dist/components/RSC/Flex/Flex.js +119 -0
  76. package/dist/components/{Layout → RSC}/Flex/index.d.ts +1 -1
  77. package/dist/components/RSC/Flex/index.js +15 -0
  78. package/dist/components/Scrollable/Rail.js +9 -0
  79. package/dist/components/Scrollable/Scrollable.js +88 -0
  80. package/dist/components/{Layout/Scrollable → Scrollable}/ScrollableShowcase.js +3 -3
  81. package/dist/components/{Layout/Scrollable → Scrollable}/VirtualScrollable.js +3 -3
  82. package/dist/components/{Layout/Scrollable → Scrollable}/index.js +1 -1
  83. package/dist/components/Select/Select.js +3 -3
  84. package/dist/components/Select/SelectShowcase.js +1 -1
  85. package/dist/components/Separator/Separator.js +3 -3
  86. package/dist/components/Shroud/Shroud.js +7 -7
  87. package/dist/components/Skeleton/Skeleton.d.ts +1 -1
  88. package/dist/components/Skeleton/Skeleton.js +5 -5
  89. package/dist/components/Skeleton/SkeletonShowcase.js +1 -1
  90. package/dist/components/Slider/Slider.js +2 -2
  91. package/dist/components/Slider/SliderShowcase.js +1 -1
  92. package/dist/components/Switch/Switch.js +1 -1
  93. package/dist/components/Table/TableBody.js +1 -1
  94. package/dist/components/Table/TableCell.d.ts +1 -1
  95. package/dist/components/Table/TableCell.js +13 -12
  96. package/dist/components/Table/TableCellCheckbox.js +1 -1
  97. package/dist/components/Table/TableHeader.js +1 -1
  98. package/dist/components/Table/TableIconButton.js +1 -1
  99. package/dist/components/Table/TableRoot.js +1 -1
  100. package/dist/components/Table/TableRow.js +1 -1
  101. package/dist/components/Tabular/TabularShowcase.js +1 -1
  102. package/dist/components/Text/TextShowcase.js +2 -2
  103. package/dist/components/Textarea/Textarea.js +32 -34
  104. package/dist/components/Title/Title.js +62 -62
  105. package/dist/components/Title/TitleShowcase.js +1 -1
  106. package/dist/components/ToggleGroup/ToggleGroup.js +7 -7
  107. package/dist/components/ToggleGroup/ToggleGroupShowcase.js +1 -1
  108. package/dist/index-ByKwkZKY.js +239 -0
  109. package/dist/{index-HDl8nGsm.js → index-CriGVLlo.js} +1 -1
  110. package/dist/{index-DZEAOJqB.js → index-DlJ4qUbZ.js} +1 -1
  111. package/dist/main.d.ts +6 -6
  112. package/dist/main.js +94 -93
  113. package/dist/rsc.d.ts +4 -0
  114. package/dist/rsc.js +16 -0
  115. package/dist/styles-scss/_colors.scss +41 -32
  116. package/dist/styles-scss/_typography.scss +5 -5
  117. package/dist/styles-scss/_ui.scss +36 -20
  118. package/dist/styles-scss/global.scss +24 -13
  119. package/dist/styles-scss/themes/theme_cfx.scss +3 -5
  120. package/dist/styles-scss/themes/theme_fivem.scss +5 -7
  121. package/dist/styles-scss/themes/theme_redm.scss +4 -6
  122. package/dist/styles-scss/themes/theme_wireframe.scss +5 -7
  123. package/dist/styles-scss/themes.scss +4 -4
  124. package/dist/styles-scss/tokens.scss +2 -56
  125. package/dist/utils/hooks/useGlobalKeyboardEvent.js +3 -3
  126. package/dist/utils/hooks/useWindowResize.js +5 -5
  127. package/dist/utils/string.d.ts +1 -0
  128. package/dist/utils/string.js +23 -19
  129. package/package.json +10 -5
  130. package/dist/Rail-DcVowhML.js +0 -81
  131. package/dist/Table.module-DHI1mXN2.js +0 -17
  132. package/dist/components/Layout/Box/Box.js +0 -72
  133. package/dist/components/Layout/Box/index.d.ts +0 -2
  134. package/dist/components/Layout/Box/index.js +0 -5
  135. package/dist/components/Layout/Flex/Flex.js +0 -84
  136. package/dist/components/Layout/Scrollable/Rail.js +0 -9
  137. package/dist/components/Layout/Scrollable/Scrollable.js +0 -91
  138. package/dist/index-BHuChyf5.js +0 -238
  139. /package/dist/components/{Layout/Flex → Flex}/FlexShowcase.d.ts +0 -0
  140. /package/dist/components/{Layout/Flex → Flex}/FlexShowcase.js +0 -0
  141. /package/dist/components/{Layout → RSC}/Box/Box.types.d.ts +0 -0
  142. /package/dist/components/{Layout → RSC}/Box/Box.types.js +0 -0
  143. /package/dist/components/{Layout → RSC}/Flex/Flex.types.d.ts +0 -0
  144. /package/dist/components/{Layout → RSC}/Flex/Flex.types.js +0 -0
  145. /package/dist/components/{Layout → RSC}/Flex/FlexRestricter.d.ts +0 -0
  146. /package/dist/components/{Layout → RSC}/Flex/FlexRestricter.js +0 -0
  147. /package/dist/components/{Layout/Scrollable → Scrollable}/Rail.d.ts +0 -0
  148. /package/dist/components/{Layout/Scrollable → Scrollable}/Scrollable.d.ts +0 -0
  149. /package/dist/components/{Layout/Scrollable → Scrollable}/ScrollableShowcase.d.ts +0 -0
  150. /package/dist/components/{Layout/Scrollable → Scrollable}/VirtualScrollable.d.ts +0 -0
  151. /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, stringPropFormater as Fr } from "./components/Layout/Box/Box.js";
52
- import { Center as vr } from "./components/Layout/Center/Center.js";
53
- import { default as Ur } from "./components/Layout/Flex/Flex.js";
54
- import { FlexAlignItemsEnum as wr, FlexDirectionEnum as Mr, FlexJustifyContentEnum as Nr, FlexWrapEnum as Gr } from "./components/Layout/Flex/Flex.types.js";
55
- import { FlexRestricter as Kr } from "./components/Layout/Flex/FlexRestricter.js";
56
- import { Pad as Hr } from "./components/Layout/Pad/Pad.js";
57
- import { Page as Xr } from "./components/Layout/Page/Page.js";
58
- import { R as Qr } from "./Rail-DcVowhML.js";
59
- import { Scrollable as jr } from "./components/Layout/Scrollable/Scrollable.js";
60
- import { VirtualScrollable as $r } from "./components/Layout/Scrollable/VirtualScrollable.js";
61
- import { Loaf as re } from "./components/Loaf/Loaf.js";
62
- import { Modal as te } from "./components/Modal/Modal.js";
63
- import { NavList as fe } from "./components/NavList/NavList.js";
64
- import { OVERLAY_OUTLET_ID as pe, Overlay as xe } from "./components/Overlay/Overlay.js";
65
- import { Popover as le } from "./components/Popover/Popover.js";
66
- import { PremiumBadge as se } from "./components/PremiumBadge/PremiumBadge.js";
67
- import { Prose as de } from "./components/Prose/Prose.js";
68
- import { Radio as Te } from "./components/Radio/Radio.js";
69
- import { Select as Ce } from "./components/Select/Select.js";
70
- import { DropdownSelect as Be } from "./components/DropdownSelect/DropdownSelect.js";
71
- import { Separator as Le } from "./components/Separator/Separator.js";
72
- import { Shroud as ye } from "./components/Shroud/Shroud.js";
73
- import { Slider as ke } from "./components/Slider/Slider.js";
74
- import { Spacer as De } from "./components/Spacer/Spacer.js";
75
- import { Style as Oe, useContextualStyle as Pe } from "./components/Style/Style.js";
76
- import { default as _e } from "./components/Switch/Switch.js";
77
- import { ToggleGroup as he } from "./components/ToggleGroup/ToggleGroup.js";
78
- import { Tabular as ze } from "./components/Tabular/Tabular.js";
79
- import { DataTable as Me, DataTableHeaderItem as Ne, DataTableRow as Ge } from "./components/DataTable/DataTable.js";
80
- import { Table as Ke } from "./components/Table/index.js";
81
- import { DEFAULT_TEXT_COLOR as He, TEXT_OPACITY_MAP as We, Text as Xe, TextBlock as Je, getTextOpacity as Qe, textSizeResponsiveValueFormatter as Ze } from "./components/Text/Text.js";
82
- import { Textarea as qe } from "./components/Textarea/Textarea.js";
83
- import { TITLE_OUTLET_ID as ot, Title as rt, titleGetCoords as et, titleGetCssStyle as tt } from "./components/Title/Title.js";
84
- import { default as ft } from "./components/InputDropzone/InputDropzone.js";
85
- import { default as pt } from "./components/InputDropzone/ItemPreview.js";
86
- import { default as nt } from "./components/Skeleton/Skeleton.js";
87
- import { OnScreenSensor as ut } from "./components/OnScreenSensor.js";
88
- import { Symbols as it } from "./components/Symbols.js";
89
- import { default as ct } from "./components/Table/TableIconButton.js";
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
- vr as Center,
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
- He as DEFAULT_TEXT_COLOR,
116
- Me as DataTable,
117
- Ne as DataTableHeaderItem,
118
- Ge as DataTableRow,
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
- Be as DropdownSelect,
122
- pt as DropzoneItemPreview,
122
+ Ee as DropdownSelect,
123
+ xt as DropzoneItemPreview,
123
124
  fr as FLYOUT_OUTLET_ID,
124
- Ur as Flex,
125
- wr as FlexAlignItemsEnum,
126
- Mr as FlexDirectionEnum,
127
- Nr as FlexJustifyContentEnum,
128
- Kr as FlexRestricter,
129
- Gr as FlexWrapEnum,
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
- ft as InputDropzone,
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
- re as Loaf,
147
+ ee as Loaf,
147
148
  xr as Logos,
148
149
  mo as MediaQueryEnum,
149
- te as Modal,
150
- fe as NavList,
151
- pe as OVERLAY_OUTLET_ID,
150
+ ae as Modal,
151
+ me as NavList,
152
+ xe as OVERLAY_OUTLET_ID,
152
153
  po as OffsetEnum,
153
- ut as OnScreenSensor,
154
- xe as Overlay,
155
- Hr as Pad,
156
- Xr as Page,
157
- le as Popover,
158
- se as PremiumBadge,
159
- de as Prose,
160
- Te as Radio,
161
- Qr as Rail,
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
- jr as Scrollable,
164
- Ce as Select,
165
- Le as Separator,
166
- ye as Shroud,
167
- nt as Skeleton,
168
- ke as Slider,
169
- De as Spacer,
170
- Oe as Style,
171
- _e as Switch,
172
- it as Symbols,
173
- We as TEXT_OPACITY_MAP,
174
- ot as TITLE_OUTLET_ID,
175
- Ke as Table,
176
- ct as TableIconButton,
177
- ze as Tabular,
178
- Xe as Text,
179
- Je as TextBlock,
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
- qe as Textarea,
182
- rt as Title,
183
- he as ToggleGroup,
184
- $r as VirtualScrollable,
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
- Qe as getTextOpacity,
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
- Fr as stringPropFormater,
217
- Ze as textSizeResponsiveValueFormatter,
217
+ _r as stringPropFormater,
218
+ je as textSizeResponsiveValueFormatter,
218
219
  q as throttle,
219
- et as titleGetCoords,
220
- tt as titleGetCssStyle,
220
+ tt as titleGetCoords,
221
+ at as titleGetCssStyle,
221
222
  eo as ui,
222
223
  Q as unicodeCharAt,
223
224
  S as useClipboardComponent,
224
- Pe as useContextualStyle,
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': red($color),
7
- 'green': green($color),
8
- 'blue': blue($color)
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-merge($colors, ($name: $value));
28
+ $colors: map.merge($colors, ($name: $value));
23
29
  }
24
30
 
25
- @return (map-get($colors, 'red') * .2126) + (map-get($colors, 'green') * .7152) + (map-get($colors, 'blue') * .0722);
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: red($c1);
30
- $c1g: green($c1);
31
- $c1b: blue($c1);
32
-
33
- $c2r: red($c2);
34
- $c2g: green($c2);
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, 0, 0);
47
- $high: rgb(255, 255, 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 #{red($color)}, #{green($color)}, #{blue($color)};
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(red($color), 255);
86
- $g: math.div(green($color), 255);
87
- $b: math.div(blue($color), 255);
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-get($lab, 'L') + 16, 116);
134
- $x: math.div(map-get($lab, 'a'), 500) + $y;
135
- $z: $y - math.div(map-get($lab, 'b'), 200);
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
- $r: $x * 3.2406 + $y * -1.5372 + $z * -0.4986;
162
- $g: $x * -0.9689 + $y * 1.8758 + $z * 0.0415;
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-get($s, 'L') + $a * map-get($e, 'L'),
207
- 'a': $ia * map-get($s, 'a') + $a * map-get($e, 'a'),
208
- 'b': $ia * map-get($s, 'b') + $a * map-get($e, 'b'),
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: "HelveticaNowDisplay";
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: "HelveticaNowDisplay";
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: "HelveticaNowText";
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: "HelveticaNowText";
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: "HelveticaNowText";
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");