Skip to content

The Open Standard for Generative UI

Refactor crayon map variables (#42)

subham30f770db040b
diff --git a/js/packages/react-core/package.json b/js/packages/react-core/package.json
index 3a0d71a36..3bcb582e0 100644
--- a/js/packages/react-core/package.json
+++ b/js/packages/react-core/package.json
@@ -1,6 +1,6 @@
{
"name": "@crayonai/react-core",
- "version": "0.5.0",
+ "version": "0.5.1",
"description": "Generative UI SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
diff --git a/js/packages/react-ui/package.json b/js/packages/react-ui/package.json
index 3957f1ff3..b9e5ae7f8 100644
--- a/js/packages/react-ui/package.json
+++ b/js/packages/react-ui/package.json
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "@crayonai/react-ui",
- "version": "0.5.0",
+ "version": "0.5.1",
"description": "Component library for Generative UI SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
diff --git a/js/packages/react-ui/src/components/Accordion/accordion.scss b/js/packages/react-ui/src/components/Accordion/accordion.scss
index b050e85e2..e586c9be1 100644
--- a/js/packages/react-ui/src/components/Accordion/accordion.scss
+++ b/js/packages/react-ui/src/components/Accordion/accordion.scss
@@ -1,37 +1,36 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-accordion {
box-sizing: border-box;
border-radius: 6px;
- box-shadow: map.get(cssUtils.$shadow, "m");
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
+ box-shadow: cssUtils.$shadow-m;
+ border: 1px solid cssUtils.$stroke-default;
&-item {
box-sizing: border-box;
overflow: hidden;
- border-bottom: 1px solid map.get(cssUtils.$colors, "strokes", "default");
+ border-bottom: 1px solid cssUtils.$stroke-default;
&-card {
.crayon-accordion-content {
&-wrapper {
- padding: map.get(cssUtils.$spacing, "l");
- gap: map.get(cssUtils.$spacing, "l");
+ padding: cssUtils.$spacing-l;
+ gap: cssUtils.$spacing-l;
}
}
}
&-sunk {
.crayon-accordion-trigger {
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
+ background-color: cssUtils.$bg-sunk;
}
.crayon-accordion-content {
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
+ background-color: cssUtils.$bg-sunk;
&-wrapper {
- padding: map.get(cssUtils.$spacing, "l");
- gap: map.get(cssUtils.$spacing, "l");
+ padding: cssUtils.$spacing-l;
+ gap: cssUtils.$spacing-l;
}
}
}
@@ -62,20 +61,20 @@
box-sizing: border-box;
@include cssUtils.typography("body", "default");
background-color: transparent;
- padding: map.get(cssUtils.$spacing, "s");
+ padding: cssUtils.$spacing-s;
width: 100%;
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
- color: map.get(cssUtils.$colors, "text", "primary");
- box-shadow: map.get(cssUtils.$shadow, "m");
+ color: cssUtils.$primary-text;
+ box-shadow: cssUtils.$shadow-m;
&-content {
display: flex;
align-items: center;
- color: map.get(cssUtils.$colors, "text", "primary");
- gap: map.get(cssUtils.$spacing, "xs");
+ color: cssUtils.$primary-text;
+ gap: cssUtils.$spacing-xs;
&-icon {
display: flex;
align-items: center;
@@ -86,7 +85,7 @@
}
&-icon {
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
@include cssUtils.typography("primary", "default");
height: 14px;
width: 14px;
@@ -100,7 +99,7 @@
}
&-content {
overflow: hidden;
- color: map.get(cssUtils.$colors, "fills", "text");
+ color: cssUtils.$primary-text;
@include cssUtils.typography("body", "default");
&[data-state="open"] {
@@ -113,8 +112,8 @@
box-sizing: border-box;
display: flex;
flex-direction: column;
- padding: map.get(cssUtils.$spacing, "l");
- gap: map.get(cssUtils.$spacing, "l");
+ padding: cssUtils.$spacing-l;
+ gap: cssUtils.$spacing-l;
}
}
}
diff --git a/js/packages/react-ui/src/components/Button/button.scss b/js/packages/react-ui/src/components/Button/button.scss
index cd0a4a86d..d305ffc97 100644
--- a/js/packages/react-ui/src/components/Button/button.scss
+++ b/js/packages/react-ui/src/components/Button/button.scss
@@ -1,16 +1,15 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-button-base {
box-sizing: border-box;
@include cssUtils.typography(body, default);
- padding: map.get(cssUtils.$spacing, "m");
- border-radius: map.get(cssUtils.$radius, "m");
+ padding: cssUtils.$spacing-m;
+ border-radius: cssUtils.$rounded-m;
border: 1px solid transparent;
cursor: pointer;
transition: all 0.2s ease;
display: flex;
- gap: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
align-items: center;
& svg {
height: 1rem;
@@ -19,10 +18,10 @@
// Primary variant
&-primary {
- background-color: map.get(cssUtils.$colors, "fills", "brand-el");
- color: map.get(cssUtils.$colors, "text", "brand");
+ background-color: cssUtils.$bg-brand-el;
+ color: cssUtils.$brand-text;
&:hover {
- background-color: map.get(cssUtils.$colors, "fills", "brand-el-hover");
+ background-color: cssUtils.$bg-brand-el-hover;
}
&:disabled {
opacity: 0.5;
@@ -31,41 +30,41 @@
}
// Secondary variant
&-secondary {
- background-color: map.get(cssUtils.$colors, "fills", "container");
- color: map.get(cssUtils.$colors, "text", "primary");
- border-color: map.get(cssUtils.$colors, "strokes", "default");
+ background-color: cssUtils.$bg-container;
+ color: cssUtils.$primary-text;
+ border-color: cssUtils.$stroke-default;
&:hover {
- background-color: map.get(cssUtils.$colors, "fills", "container-hover");
+ background-color: cssUtils.$bg-container-hover;
}
&:disabled {
- color: map.get(cssUtils.$colors, "text", "disabled");
- border-color: map.get(cssUtils.$colors, "text", "disabled");
+ color: cssUtils.$disabled-text;
+ border-color: cssUtils.$stroke-default;
cursor: not-allowed;
}
}
// Tertiary variant
&-tertiary {
background-color: transparent;
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
&:hover {
- background-color: map.get(cssUtils.$colors, "fills", "container-hover");
+ background-color: cssUtils.$bg-container-hover;
}
&:disabled {
- color: map.get(cssUtils.$colors, "text", "disabled");
+ color: cssUtils.$disabled-text;
cursor: not-allowed;
}
}
// Sizes
&-small {
- padding: map.get(cssUtils.$spacing, "2xs") map.get(cssUtils.$spacing, "xs");
+ padding: cssUtils.$spacing-2xs cssUtils.$spacing-xs;
}
&-medium {
- padding: map.get(cssUtils.$spacing, "xs") map.get(cssUtils.$spacing, "m");
+ padding: cssUtils.$spacing-xs cssUtils.$spacing-m;
}
&-large {
- padding: map.get(cssUtils.$spacing, "s") map.get(cssUtils.$spacing, "m");
+ padding: cssUtils.$spacing-s cssUtils.$spacing-m;
}
}
diff --git a/js/packages/react-ui/src/components/Buttons/buttons.scss b/js/packages/react-ui/src/components/Buttons/buttons.scss
index 43154a0ac..79495a1e9 100644
--- a/js/packages/react-ui/src/components/Buttons/buttons.scss
+++ b/js/packages/react-ui/src/components/Buttons/buttons.scss
@@ -1,10 +1,9 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-buttons {
display: flex;
width: 100%;
- gap: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-m;
box-sizing: border-box;
&-horizontal {
diff --git a/js/packages/react-ui/src/components/Calendar/components/calendarHelperComponents.scss b/js/packages/react-ui/src/components/Calendar/components/calendarHelperComponents.scss
index cdcb0b195..306c913db 100644
--- a/js/packages/react-ui/src/components/Calendar/components/calendarHelperComponents.scss
+++ b/js/packages/react-ui/src/components/Calendar/components/calendarHelperComponents.scss
@@ -1,17 +1,16 @@
-@use "sass:map";
@use "../../../cssUtils" as cssUtils;
.crayon-calendar-select-content-months {
- padding: map.get(cssUtils.$spacing, "2xs") 0;
- background-color: map.get(cssUtils.$colors, "fills", "container");
+ padding: cssUtils.$spacing-2xs 0;
+ background-color: cssUtils.$bg-container;
box-shadow: none;
}
.crayon-calendar-select-content-years {
max-height: 295px;
min-width: 362px;
- padding: map.get(cssUtils.$spacing, "2xs") 0;
- background-color: map.get(cssUtils.$colors, "fills", "container");
+ padding: cssUtils.$spacing-2xs 0;
+ background-color: cssUtils.$bg-container;
box-shadow: none;
.crayon-calendar-select-viewport {
display: grid;
@@ -29,11 +28,11 @@
justify-content: center;
align-self: center;
justify-self: center;
- border-radius: map.get(cssUtils.$radius, "s");
- padding: map.get(cssUtils.$spacing, "s");
+ border-radius: cssUtils.$rounded-s;
+ padding: cssUtils.$spacing-s;
&:hover {
- background-color: map.get(cssUtils.$colors, "fills", "container-hover");
+ background-color: cssUtils.$bg-container-hover;
}
}
}
diff --git a/js/packages/react-ui/src/components/Calendar/utils/calendarBaseStyle.scss b/js/packages/react-ui/src/components/Calendar/utils/calendarBaseStyle.scss
index f27fcd904..f58f72e33 100644
--- a/js/packages/react-ui/src/components/Calendar/utils/calendarBaseStyle.scss
+++ b/js/packages/react-ui/src/components/Calendar/utils/calendarBaseStyle.scss
@@ -1,4 +1,3 @@
-@use "sass:map";
@use "../../../cssUtils" as cssUtils;
/* Base styles for all calendar components range or single */
@@ -6,47 +5,47 @@
.crayon-calendar-root {
@include cssUtils.typography(primary, default);
- background-color: map.get(cssUtils.$colors, "fills", "container");
- padding: map.get(cssUtils.$spacing, "l");
+ background-color: cssUtils.$bg-container;
+ padding: cssUtils.$spacing-l;
width: fit-content;
height: fit-content;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
- border-radius: map.get(cssUtils.$radius, "xl");
+ border-radius: cssUtils.$rounded-xl;
}
.crayon-calendar-nav {
&-mobile {
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
}
&-fullscreen {
- gap: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-m;
}
&-tray {
- gap: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-m;
}
&-copilot {
- gap: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-m;
}
}
.crayon-calendar-dropdowns {
&-mobile {
- gap: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
}
&-fullscreen {
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
}
&-tray {
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
}
&-copilot {
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
}
&-copilot {
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
}
}
@@ -67,26 +66,26 @@
.crayon-calendar-today {
&[data-today]:not([aria-selected]) {
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
- border-radius: map.get(cssUtils.$radius, "m");
+ background-color: cssUtils.$bg-sunk;
+ border-radius: cssUtils.$rounded-m;
}
}
.crayon-calendar-disabled {
cursor: not-allowed;
- color: map.get(cssUtils.$colors, "text", "disabled");
+ color: cssUtils.$disabled-text;
}
.crayon-calendar-weekdays {
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
}
.crayon-calendar-chevron {
- fill: map.get(cssUtils.$colors, "fills", "brand-el");
+ fill: cssUtils.$bg-brand-el;
}
.crayon-calendar-month {
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
}
.crayon-calendar-month-dropdown {
@@ -98,7 +97,7 @@
}
.crayon-calendar-footer {
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
@include cssUtils.typography(primary, default);
}
@@ -128,30 +127,30 @@
}
.crayon-calendar-single-day-selected {
- background: map.get(cssUtils.$colors, "fills", "brand-el");
- color: map.get(cssUtils.$colors, "text", "brand");
- border-radius: map.get(cssUtils.$radius, "m");
+ background: cssUtils.$bg-brand-el;
+ color: cssUtils.$brand-text;
+ border-radius: cssUtils.$rounded-m;
}
/* Base styles for all calendar components range */
/* ------------------------------------------------------------ */
.crayon-calendar-range-start {
- color: map.get(cssUtils.$colors, "text", "brand");
- background: map.get(cssUtils.$colors, "fills", "brand-el");
- border-top-left-radius: map.get(cssUtils.$radius, "m");
- border-bottom-left-radius: map.get(cssUtils.$radius, "m");
+ color: cssUtils.$brand-text;
+ background: cssUtils.$bg-brand-el;
+ border-top-left-radius: cssUtils.$rounded-m;
+ border-bottom-left-radius: cssUtils.$rounded-m;
}
.crayon-calendar-range-middle {
- background: map.get(cssUtils.$colors, "fills", "sunk");
+ background: cssUtils.$bg-sunk;
}
.crayon-calendar-range-end {
- color: map.get(cssUtils.$colors, "text", "brand");
- background: map.get(cssUtils.$colors, "fills", "brand-el");
- border-top-right-radius: map.get(cssUtils.$radius, "m");
- border-bottom-right-radius: map.get(cssUtils.$radius, "m");
+ color: cssUtils.$brand-text;
+ background: cssUtils.$bg-brand-el;
+ border-top-right-radius: cssUtils.$rounded-m;
+ border-bottom-right-radius: cssUtils.$rounded-m;
}
.crayon-calendar-range-day-button {
diff --git a/js/packages/react-ui/src/components/Card/card.scss b/js/packages/react-ui/src/components/Card/card.scss
index e05dd541d..b4757b980 100644
--- a/js/packages/react-ui/src/components/Card/card.scss
+++ b/js/packages/react-ui/src/components/Card/card.scss
@@ -1,36 +1,35 @@
-@use "sass:map";
@use "../../cssUtils.scss" as cssUtils;
.crayon-card {
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "l");
+ gap: cssUtils.$spacing-l;
border: 1px solid transparent;
box-sizing: border-box;
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
@include cssUtils.typography(body, default);
&-card {
- padding: map.get(cssUtils.$spacing, "l");
- border-radius: map.get(cssUtils.$radius, "3xl");
- border-color: map.get(cssUtils.$colors, "strokes", "default");
- background-color: map.get(cssUtils.$colors, "fills", "container");
+ padding: cssUtils.$spacing-l;
+ border-radius: cssUtils.$rounded-3xl;
+ border-color: cssUtils.$stroke-default;
+ background-color: cssUtils.$bg-container;
box-shadow: none;
}
&-clear {
- padding: 0px map.get(cssUtils.$spacing, "l");
- border-radius: map.get(cssUtils.$radius, "3xl");
+ padding: 0px cssUtils.$spacing-l;
+ border-radius: cssUtils.$rounded-3xl;
background-color: transparent;
box-shadow: none;
}
&-sunk {
- padding: map.get(cssUtils.$spacing, "l");
- border-radius: map.get(cssUtils.$radius, "3xl");
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
- border-color: map.get(cssUtils.$colors, "strokes", "default");
- box-shadow: map.get(cssUtils.$shadow, "m");
+ padding: cssUtils.$spacing-l;
+ border-radius: cssUtils.$rounded-3xl;
+ background-color: cssUtils.$bg-sunk;
+ border-color: cssUtils.$stroke-default;
+ box-shadow: cssUtils.$shadow-m;
}
&-standard {
diff --git a/js/packages/react-ui/src/components/CardHeader/cardHeader.scss b/js/packages/react-ui/src/components/CardHeader/cardHeader.scss
index 70a7d7ce9..d0ef795b7 100644
--- a/js/packages/react-ui/src/components/CardHeader/cardHeader.scss
+++ b/js/packages/react-ui/src/components/CardHeader/cardHeader.scss
@@ -1,10 +1,9 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-header {
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
overflow-wrap: break-word;
&-top {
@@ -17,8 +16,8 @@
display: flex;
flex-direction: row;
align-items: center;
- gap: map.get(cssUtils.$spacing, "2xs");
- color: map.get(cssUtils.$colors, "text", "primary");
+ gap: cssUtils.$spacing-2xs;
+ color: cssUtils.$primary-text;
@include cssUtils.typography(title, default);
&-icon {
@@ -34,12 +33,12 @@
display: flex;
flex-direction: row;
align-items: center;
- gap: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
}
}
&-bottom {
- color: map.get(cssUtils.$colors, "text", "secondary");
+ color: cssUtils.$secondary-text;
@include cssUtils.typography(body, default);
}
}
diff --git a/js/packages/react-ui/src/components/Carousel/carousel.scss b/js/packages/react-ui/src/components/Carousel/carousel.scss
index de9726774..2deecda6f 100644
--- a/js/packages/react-ui/src/components/Carousel/carousel.scss
+++ b/js/packages/react-ui/src/components/Carousel/carousel.scss
@@ -1,4 +1,3 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-carousel {
@@ -9,7 +8,7 @@
position: relative;
display: flex;
flex-direction: row;
- gap: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-m;
overflow-x: auto;
scroll-snap-type: x mandatory;
-ms-overflow-x: hidden;
@@ -17,7 +16,7 @@
&-wrapper {
display: flex;
- gap: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-m;
}
&::-webkit-scrollbar {
@@ -34,13 +33,13 @@
@include cssUtils.typography(body, default);
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
min-width: 200px;
max-width: 200px;
- border-radius: map.get(cssUtils.$radius, "m");
- background-color: map.get(cssUtils.$colors, "fills", "primary");
- padding: map.get(cssUtils.$spacing, "m");
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
+ border-radius: cssUtils.$rounded-m;
+ background-color: cssUtils.$bg-container;
+ padding: cssUtils.$spacing-m;
+ border: 1px solid cssUtils.$stroke-default;
}
&-button {
diff --git a/js/packages/react-ui/src/components/Charts/charts.scss b/js/packages/react-ui/src/components/Charts/charts.scss
index d99cfec6a..e4b13fb0f 100644
--- a/js/packages/react-ui/src/components/Charts/charts.scss
+++ b/js/packages/react-ui/src/components/Charts/charts.scss
@@ -1,4 +1,3 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-chart {
@@ -12,15 +11,15 @@
// Text and fills
.recharts-cartesian-axis-tick text {
- fill: map.get(cssUtils.$colors, "text", "primary");
+ fill: cssUtils.$primary-text;
}
.recharts-radial-bar-background-sector {
- fill: map.get(cssUtils.$colors, "fills", "background");
+ fill: cssUtils.$bg-fill;
}
.recharts-rectangle.recharts-tooltip-cursor {
- fill: map.get(cssUtils.$colors, "fills", "background");
+ fill: cssUtils.$bg-fill;
}
// Strokes and borders
@@ -28,7 +27,7 @@
.recharts-curve.recharts-tooltip-cursor,
.recharts-polar-grid[stroke="#ccc"],
.recharts-reference-line[stroke="#ccc"] {
- stroke: map.get(cssUtils.$colors, "strokes", "default");
+ stroke: cssUtils.$stroke-default;
}
// Transparency settings
@@ -50,14 +49,14 @@
display: grid;
align-items: start;
min-width: 128px;
- gap: map.get(cssUtils.$spacing, "xs");
- padding: map.get(cssUtils.$spacing, "xs");
- color: map.get(cssUtils.$colors, "text", "primary");
+ gap: cssUtils.$spacing-xs;
+ padding: cssUtils.$spacing-xs;
+ color: cssUtils.$primary-text;
@include cssUtils.typography(label, default);
- border-radius: map.get(cssUtils.$radius, "s");
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- background-color: map.get(cssUtils.$colors, "fills", "container");
- box-shadow: map.get(cssUtils.$shadow, "small");
+ border-radius: cssUtils.$rounded-s;
+ border: 1px solid cssUtils.$stroke-default;
+ background-color: cssUtils.$bg-container;
+ box-shadow: cssUtils.$shadow-s;
text-transform: capitalize;
&-label {
@@ -72,21 +71,21 @@
display: grid;
align-items: start;
min-width: 128px;
- gap: map.get(cssUtils.$spacing, "xs");
- padding: map.get(cssUtils.$spacing, "xs");
- color: map.get(cssUtils.$colors, "text", "primary");
+ gap: cssUtils.$spacing-xs;
+ padding: cssUtils.$spacing-xs;
+ color: cssUtils.$primary-text;
@include cssUtils.typography(label, default);
- border-radius: map.get(cssUtils.$radius, "s");
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- background-color: map.get(cssUtils.$colors, "fills", "container");
- box-shadow: map.get(cssUtils.$shadow, "small");
+ border-radius: cssUtils.$rounded-s;
+ border: 1px solid cssUtils.$stroke-default;
+ background-color: cssUtils.$bg-container;
+ box-shadow: cssUtils.$shadow-s;
text-transform: capitalize;
&-item {
display: flex;
width: 100%;
flex-wrap: wrap;
- gap: map.get(cssUtils.$spacing, "xs");
+ gap: cssUtils.$spacing-xs;
align-items: stretch;
&--dot {
align-items: center;
@@ -95,12 +94,12 @@
svg {
height: 10px;
width: 10px;
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
}
}
& &-indicator {
flex-shrink: 0;
- border-radius: map.get(cssUtils.$radius, "3xs");
+ border-radius: cssUtils.$rounded-3xs;
&--dot {
height: 10px;
@@ -123,7 +122,7 @@
}
&--nested-dashed {
- margin: map.get(cssUtils.$spacing, "3xs") 0;
+ margin: cssUtils.$spacing-3xs 0;
}
}
@@ -144,18 +143,18 @@
&-label {
display: grid;
- gap: map.get(cssUtils.$spacing, "xs");
- color: map.get(cssUtils.$colors, "text", "primary");
+ gap: cssUtils.$spacing-xs;
+ color: cssUtils.$primary-text;
@include cssUtils.typography(label, default);
}
&-value {
font-variant-numeric: tabular-nums;
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
@include cssUtils.typography(label, default);
&--percentage {
- padding-left: map.get(cssUtils.$spacing, "s");
+ padding-left: cssUtils.$spacing-s;
}
}
}
@@ -171,29 +170,29 @@
flex-wrap: wrap;
&--top {
- padding-bottom: map.get(cssUtils.$spacing, "s");
+ padding-bottom: cssUtils.$spacing-s;
}
&--bottom {
- padding-top: map.get(cssUtils.$spacing, "m");
+ padding-top: cssUtils.$spacing-m;
}
&-item {
display: flex;
align-items: center;
- gap: map.get(cssUtils.$spacing, "xs");
+ gap: cssUtils.$spacing-xs;
svg {
- height: map.get(cssUtils.$spacing, "m");
- width: map.get(cssUtils.$spacing, "m");
- color: map.get(cssUtils.$colors, "text", "primary");
+ height: 12px;
+ width: 12px;
+ color: cssUtils.$primary-text;
}
&-indicator {
- height: map.get(cssUtils.$spacing, "s");
- width: map.get(cssUtils.$spacing, "s");
+ height: 8px;
+ width: 8px;
flex-shrink: 0;
- border-radius: map.get(cssUtils.$radius, "3xs");
+ border-radius: cssUtils.$rounded-3xs;
background-color: var(--color-bg);
}
@@ -203,22 +202,22 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
}
}
}
}
.crayon-chart-cartesian-grid {
- stroke: map.get(cssUtils.$colors, "strokes", "default");
+ stroke: cssUtils.$stroke-default;
}
.crayon-chart-polar-grid {
- stroke: map.get(cssUtils.$colors, "strokes", "default");
+ stroke: cssUtils.$stroke-default;
}
.crayon-chart-label-list {
- fill: map.get(cssUtils.$colors, "fills", "secondary");
+ fill: cssUtils.$secondary-text;
}
//Pie Chart styles
@@ -251,12 +250,12 @@
}
.crayon-pie-chart-label {
- fill: map.get(cssUtils.$colors, "text", "secondary");
+ fill: cssUtils.$secondary-text;
padding: 0;
}
.crayon-chart-axis-label {
- fill: map.get(cssUtils.$colors, "text", "primary");
+ fill: cssUtils.$primary-text;
@include cssUtils.typography(label, default);
text-anchor: middle;
}
diff --git a/js/packages/react-ui/src/components/CheckBoxGroup/checkBoxGroup.scss b/js/packages/react-ui/src/components/CheckBoxGroup/checkBoxGroup.scss
index de6be6b5f..118baca16 100644
--- a/js/packages/react-ui/src/components/CheckBoxGroup/checkBoxGroup.scss
+++ b/js/packages/react-ui/src/components/CheckBoxGroup/checkBoxGroup.scss
@@ -1,28 +1,27 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-checkbox-group {
box-sizing: border-box;
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
border: 1px solid;
- border-radius: map.get(cssUtils.$radius, "m");
+ border-radius: cssUtils.$rounded-m;
&-clear {
border-color: transparent;
background-color: transparent;
- padding: map.get(cssUtils.$spacing, "0");
+ padding: cssUtils.$spacing-0;
}
&-card {
- border-color: map.get(cssUtils.$colors, "strokes", "default");
- padding: map.get(cssUtils.$spacing, "l");
+ border-color: cssUtils.$stroke-default;
+ padding: cssUtils.$spacing-l;
}
&-sunk {
- border-color: map.get(cssUtils.$colors, "strokes", "default");
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
- padding: map.get(cssUtils.$spacing, "l");
+ border-color: cssUtils.$stroke-default;
+ background-color: cssUtils.$bg-sunk;
+ padding: cssUtils.$spacing-l;
}
}
diff --git a/js/packages/react-ui/src/components/CheckBoxItem/checkBoxItem.scss b/js/packages/react-ui/src/components/CheckBoxItem/checkBoxItem.scss
index 87a379106..5a58ccea4 100644
--- a/js/packages/react-ui/src/components/CheckBoxItem/checkBoxItem.scss
+++ b/js/packages/react-ui/src/components/CheckBoxItem/checkBoxItem.scss
@@ -1,17 +1,16 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-checkbox-item-container {
display: flex;
align-items: center;
- gap: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
width: 100%;
max-width: 100%;
overflow: hidden;
- padding-top: map.get(cssUtils.$spacing, "3xs");
- padding-bottom: map.get(cssUtils.$spacing, "3xs");
- padding-left: map.get(cssUtils.$spacing, "0");
- padding-right: map.get(cssUtils.$spacing, "2xs");
+ padding-top: cssUtils.$spacing-3xs;
+ padding-bottom: cssUtils.$spacing-3xs;
+ padding-left: cssUtils.$spacing-0;
+ padding-right: cssUtils.$spacing-2xs;
}
.crayon-checkbox-item-root {
@@ -21,17 +20,17 @@
width: 14px;
height: 14px;
border-radius: 2px;
- border: 1px solid map.get(cssUtils.$colors, "strokes", "interactive-el");
- background-color: map.get(cssUtils.$colors, "fills", "container");
+ border: 1px solid cssUtils.$stroke-interactive-el;
+ background-color: cssUtils.$bg-container;
cursor: pointer;
&:not(:disabled):hover {
- border-color: map.get(cssUtils.$colors, "strokes", "interactive-el-hover");
+ border-color: cssUtils.$stroke-interactive-el-hover;
}
&:disabled {
cursor: not-allowed;
- color: map.get(cssUtils.$colors, "text", "disabled");
+ color: cssUtils.$disabled-text;
}
}
@@ -39,12 +38,12 @@
display: flex;
align-items: center;
justify-content: center;
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
}
.crayon-checkbox-item-label {
flex: 1;
&:disabled {
- color: map.get(cssUtils.$colors, "text", "disabled");
+ color: cssUtils.$disabled-text;
}
}
diff --git a/js/packages/react-ui/src/components/DatePicker/helpers/components/floatingDatePickerRenderer.scss b/js/packages/react-ui/src/components/DatePicker/helpers/components/floatingDatePickerRenderer.scss
index 9e1bc187d..d11918b62 100644
--- a/js/packages/react-ui/src/components/DatePicker/helpers/components/floatingDatePickerRenderer.scss
+++ b/js/packages/react-ui/src/components/DatePicker/helpers/components/floatingDatePickerRenderer.scss
@@ -1,4 +1,3 @@
-@use "sass:map";
@use "../../../../cssUtils" as cssUtils;
/*
@@ -20,35 +19,35 @@
display: flex;
align-items: center;
justify-content: space-between;
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- border-radius: map.get(cssUtils.$radius, "xs");
- background: map.get(cssUtils.$colors, "fills", "container");
- padding: map.get(cssUtils.$spacing, "xs") map.get(cssUtils.$spacing, "s");
+ border: 1px solid cssUtils.$stroke-default;
+ border-radius: cssUtils.$rounded-xs;
+ background: cssUtils.$bg-container;
+ padding: cssUtils.$spacing-xs cssUtils.$spacing-s;
@include cssUtils.typography(primary, default);
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
cursor: pointer;
- box-shadow: map.get(cssUtils.$shadow, "s");
+ box-shadow: cssUtils.$shadow-s;
width: 100%;
&:disabled {
- color: map.get(cssUtils.$colors, "text", "disabled");
+ color: cssUtils.$disabled-text;
cursor: not-allowed;
}
&-open {
- border-color: map.get(cssUtils.$colors, "strokes", "interactive-el-selected");
- background-color: map.get(cssUtils.$colors, "fills", "container-hover");
+ border-color: cssUtils.$stroke-interactive-el-selected;
+ background-color: cssUtils.$bg-container-hover;
}
&-not-open {
&:hover {
- border-color: map.get(cssUtils.$colors, "strokes", "default");
- background-color: map.get(cssUtils.$colors, "fills", "container-hover");
+ border-color: cssUtils.$stroke-default;
+ background-color: cssUtils.$bg-container-hover;
}
}
&-has-no-selected-date {
- color: map.get(cssUtils.$colors, "text", "secondary");
+ color: cssUtils.$secondary-text;
}
}
@@ -81,7 +80,7 @@
}
.crayon-date-picker-renderer-floating-menu {
- background: map.get(cssUtils.$colors, "fills", "container");
- border-radius: map.get(cssUtils.$radius, "m");
- box-shadow: map.get(cssUtils.$shadow, "s");
+ background: cssUtils.$bg-container;
+ border-radius: cssUtils.$rounded-m;
+ box-shadow: cssUtils.$shadow-s;
}
diff --git a/js/packages/react-ui/src/components/DatePicker/helpers/components/helperComponents.scss b/js/packages/react-ui/src/components/DatePicker/helpers/components/helperComponents.scss
index 6dd423c58..ee65d4219 100644
--- a/js/packages/react-ui/src/components/DatePicker/helpers/components/helperComponents.scss
+++ b/js/packages/react-ui/src/components/DatePicker/helpers/components/helperComponents.scss
@@ -1,17 +1,16 @@
-@use "sass:map";
@use "../../../../cssUtils" as cssUtils;
.crayon-date-picker-select-content-months {
- padding: map.get(cssUtils.$spacing, "2xs") 0;
- background-color: map.get(cssUtils.$colors, "fills", "container");
+ padding: cssUtils.$spacing-2xs 0;
+ background-color: cssUtils.$bg-container;
box-shadow: none;
}
.crayon-date-picker-select-content-years {
max-height: 295px;
min-width: 362px;
- padding: map.get(cssUtils.$spacing, "2xs") 0;
- background-color: map.get(cssUtils.$colors, "fills", "container");
+ padding: cssUtils.$spacing-2xs 0;
+ background-color: cssUtils.$bg-container;
box-shadow: none;
.crayon-date-picker-select-viewport {
display: grid;
@@ -29,11 +28,11 @@
justify-content: center;
align-self: center;
justify-self: center;
- border-radius: map.get(cssUtils.$radius, "s");
- padding: map.get(cssUtils.$spacing, "s");
+ border-radius: cssUtils.$rounded-s;
+ padding: cssUtils.$spacing-s;
&:hover {
- background-color: map.get(cssUtils.$colors, "fills", "container-hover");
+ background-color: cssUtils.$bg-container-hover;
}
}
}
diff --git a/js/packages/react-ui/src/components/DatePicker/helpers/utils/datePickerBaseStyle.scss b/js/packages/react-ui/src/components/DatePicker/helpers/utils/datePickerBaseStyle.scss
index dc40842f3..e02fca816 100644
--- a/js/packages/react-ui/src/components/DatePicker/helpers/utils/datePickerBaseStyle.scss
+++ b/js/packages/react-ui/src/components/DatePicker/helpers/utils/datePickerBaseStyle.scss
@@ -1,51 +1,50 @@
-@use "sass:map";
@use "../../../../cssUtils" as cssUtils;
/* Base styles for all date picker components range or single */
/* ------------------------------------------------------------ */
.crayon-date-picker-root {
@include cssUtils.typography(primary, default);
- background-color: map.get(cssUtils.$colors, "fills", "container");
- padding: map.get(cssUtils.$spacing, "l");
+ background-color: cssUtils.$bg-container;
+ padding: cssUtils.$spacing-l;
width: fit-content;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
- border-radius: map.get(cssUtils.$radius, "xl");
+ border-radius: cssUtils.$rounded-xl;
}
.crayon-date-picker-nav {
&-mobile {
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
}
&-fullscreen {
- gap: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-m;
}
&-tray {
- gap: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-m;
}
&-copilot {
- gap: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-m;
}
}
.crayon-date-picker-dropdowns {
&-mobile {
- gap: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
}
&-fullscreen {
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
}
&-tray {
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
}
&-copilot {
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
}
&-copilot {
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
}
}
@@ -66,26 +65,26 @@
.crayon-date-picker-today {
&[data-today]:not([aria-selected]) {
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
- border-radius: map.get(cssUtils.$radius, "m");
+ background-color: cssUtils.$bg-sunk;
+ border-radius: cssUtils.$rounded-m;
}
}
.crayon-date-picker-disabled {
cursor: not-allowed;
- color: map.get(cssUtils.$colors, "text", "disabled");
+ color: cssUtils.$disabled-text;
}
.crayon-date-picker-weekdays {
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
}
.crayon-date-picker-chevron {
- fill: map.get(cssUtils.$colors, "fills", "brand-el");
+ fill: cssUtils.$bg-brand-el;
}
.crayon-date-picker-month {
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
}
.crayon-date-picker-month-dropdown {
@@ -122,30 +121,30 @@
}
.crayon-date-picker-single-day-selected {
- background: map.get(cssUtils.$colors, "fills", "brand-el");
- color: map.get(cssUtils.$colors, "text", "brand");
- border-radius: map.get(cssUtils.$radius, "m");
+ background: cssUtils.$bg-brand-el;
+ color: cssUtils.$brand-text;
+ border-radius: cssUtils.$rounded-m;
}
/* Base styles for all date picker components range */
/* ------------------------------------------------------------ */
.crayon-date-picker-range-start {
- color: map.get(cssUtils.$colors, "text", "brand");
- background: map.get(cssUtils.$colors, "fills", "brand-el");
- border-top-left-radius: map.get(cssUtils.$radius, "m");
- border-bottom-left-radius: map.get(cssUtils.$radius, "m");
+ color: cssUtils.$brand-text;
+ background: cssUtils.$bg-brand-el;
+ border-top-left-radius: cssUtils.$rounded-m;
+ border-bottom-left-radius: cssUtils.$rounded-m;
}
.crayon-date-picker-range-middle {
- background: map.get(cssUtils.$colors, "fills", "sunk");
+ background: cssUtils.$bg-sunk;
}
.crayon-date-picker-range-end {
- color: map.get(cssUtils.$colors, "text", "brand");
- background: map.get(cssUtils.$colors, "fills", "brand-el");
- border-top-right-radius: map.get(cssUtils.$radius, "m");
- border-bottom-right-radius: map.get(cssUtils.$radius, "m");
+ color: cssUtils.$brand-text;
+ background: cssUtils.$bg-brand-el;
+ border-top-right-radius: cssUtils.$rounded-m;
+ border-bottom-right-radius: cssUtils.$rounded-m;
}
.crayon-date-picker-range-day-button {
diff --git a/js/packages/react-ui/src/components/FollowUpBlock/followUpBlock.scss b/js/packages/react-ui/src/components/FollowUpBlock/followUpBlock.scss
index b5768edb3..ac6064542 100644
--- a/js/packages/react-ui/src/components/FollowUpBlock/followUpBlock.scss
+++ b/js/packages/react-ui/src/components/FollowUpBlock/followUpBlock.scss
@@ -1,9 +1,8 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-follow-up-block {
box-sizing: border-box;
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "3xs");
+ gap: cssUtils.$spacing-3xs;
}
diff --git a/js/packages/react-ui/src/components/FollowUpItem/followUpItem.scss b/js/packages/react-ui/src/components/FollowUpItem/followUpItem.scss
index 5168415c5..df57f9cf4 100644
--- a/js/packages/react-ui/src/components/FollowUpItem/followUpItem.scss
+++ b/js/packages/react-ui/src/components/FollowUpItem/followUpItem.scss
@@ -1,18 +1,17 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-follow-up-item {
@include cssUtils.button-reset;
@include cssUtils.typography(primary, default);
box-sizing: border-box;
- padding: map.get(cssUtils.$spacing, "xs") map.get(cssUtils.$spacing, "0");
- border-bottom: 1px solid map.get(cssUtils.$colors, "strokes", "default");
+ padding: cssUtils.$spacing-xs cssUtils.$spacing-0;
+ border-bottom: 1px solid cssUtils.$stroke-default;
background-color: transparent;
- gap: map.get(cssUtils.$spacing, "xs");
+ gap: cssUtils.$spacing-xs;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
cursor: pointer;
}
diff --git a/js/packages/react-ui/src/components/FormControl/Hint/hint.scss b/js/packages/react-ui/src/components/FormControl/Hint/hint.scss
index 369b41409..a550c6ef1 100644
--- a/js/packages/react-ui/src/components/FormControl/Hint/hint.scss
+++ b/js/packages/react-ui/src/components/FormControl/Hint/hint.scss
@@ -1,11 +1,10 @@
@use "../../../cssUtils.scss" as cssUtils;
-@use "sass:map";
.crayon-hint {
box-sizing: border-box;
@include cssUtils.typography(label, default);
- color: map.get(cssUtils.$colors, "text", "secondary");
+ color: cssUtils.$secondary-text;
display: flex;
align-items: center;
- gap: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
}
diff --git a/js/packages/react-ui/src/components/FormControl/formControl.scss b/js/packages/react-ui/src/components/FormControl/formControl.scss
index 68ce6abfc..70f375fb1 100644
--- a/js/packages/react-ui/src/components/FormControl/formControl.scss
+++ b/js/packages/react-ui/src/components/FormControl/formControl.scss
@@ -1,10 +1,9 @@
@forward "./Hint/hint";
-@use "sass:map";
@use "../../cssUtils.scss" as cssUtils;
.crayon-form-control {
box-sizing: border-box;
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "xs");
+ gap: cssUtils.$spacing-xs;
}
diff --git a/js/packages/react-ui/src/components/IconButton/iconButton.scss b/js/packages/react-ui/src/components/IconButton/iconButton.scss
index f78496ad3..45092fde1 100644
--- a/js/packages/react-ui/src/components/IconButton/iconButton.scss
+++ b/js/packages/react-ui/src/components/IconButton/iconButton.scss
@@ -1,4 +1,3 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-icon-button {
@@ -7,7 +6,7 @@
align-items: center;
justify-content: center;
border: 1px solid transparent;
- gap: map.get(cssUtils.$spacing, "xs");
+ gap: cssUtils.$spacing-xs;
cursor: pointer;
transition: all 0.2s ease;
padding: 0;
@@ -26,28 +25,28 @@
// variants
&-primary {
- background-color: map.get(cssUtils.$colors, "fills", "brand-el");
- border-color: map.get(cssUtils.$colors, "strokes", "default");
- color: map.get(cssUtils.$colors, "text", "brand");
+ background-color: cssUtils.$bg-brand-el;
+ border-color: cssUtils.$stroke-default;
+ color: cssUtils.$brand-text;
}
&-secondary {
- background-color: map.get(cssUtils.$colors, "fills", "container");
- border-color: map.get(cssUtils.$colors, "strokes", "default");
- color: map.get(cssUtils.$colors, "text", "primary");
+ background-color: cssUtils.$bg-container;
+ border-color: cssUtils.$stroke-default;
+ color: cssUtils.$primary-text;
}
&-tertiary {
background-color: transparent;
border-color: transparent;
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
}
// sizes
&-extra-small {
width: 20px;
height: 20px;
- box-shadow: map.get(cssUtils.$shadow, "s");
+ box-shadow: cssUtils.$shadow-s;
& .crayon-icon-button-icon {
height: 14px;
width: 14px;
@@ -57,7 +56,7 @@
&-small {
width: 28px;
height: 28px;
- box-shadow: map.get(cssUtils.$shadow, "s");
+ box-shadow: cssUtils.$shadow-s;
& .crayon-icon-button-icon {
height: 14px;
width: 14px;
@@ -67,7 +66,7 @@
&-medium {
width: 32px;
height: 32px;
- box-shadow: map.get(cssUtils.$shadow, "m");
+ box-shadow: cssUtils.$shadow-m;
& .crayon-icon-button-icon {
height: 16px;
width: 16px;
@@ -80,7 +79,7 @@
min-width: 36px;
min-height: 36px;
font-size: 16px;
- box-shadow: map.get(cssUtils.$shadow, "l");
+ box-shadow: cssUtils.$shadow-l;
& .crayon-icon-button-icon {
height: 16px;
width: 16px;
@@ -89,10 +88,10 @@
// shapes
&-square {
- border-radius: map.get(cssUtils.$radius, "s");
+ border-radius: cssUtils.$rounded-s;
}
&-circle {
- border-radius: map.get(cssUtils.$radius, "full");
+ border-radius: cssUtils.$rounded-full;
}
}
diff --git a/js/packages/react-ui/src/components/IconButton/stories/iconButton.stories.tsx b/js/packages/react-ui/src/components/IconButton/stories/iconButton.stories.tsx
index 138666a3d..9febdc5a8 100644
--- a/js/packages/react-ui/src/components/IconButton/stories/iconButton.stories.tsx
+++ b/js/packages/react-ui/src/components/IconButton/stories/iconButton.stories.tsx
@@ -81,6 +81,9 @@ export const PrimaryButton: Story = {
args: {
icon: <Download />,
disabled: false,
+ variant: "primary",
+ shape: "square",
+ size: "medium",
},
render: (args) => <IconButton {...args} />,
};
diff --git a/js/packages/react-ui/src/components/Image/image.scss b/js/packages/react-ui/src/components/Image/image.scss
index 95ec90c8f..e0e61cc12 100644
--- a/js/packages/react-ui/src/components/Image/image.scss
+++ b/js/packages/react-ui/src/components/Image/image.scss
@@ -1,4 +1,3 @@
-@use "sass:map";
@use "../../cssUtils.scss" as cssUtils;
.crayon-image {
@@ -7,9 +6,9 @@
max-width: 100%;
height: auto;
overflow: clip;
- border-radius: map.get(cssUtils.$radius, "m");
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- background-color: map.get(cssUtils.$colors, "fills", "container");
+ border-radius: cssUtils.$rounded-m;
+ border: 1px solid cssUtils.$stroke-default;
+ background-color: cssUtils.$bg-container;
&-fit {
object-fit: contain;
diff --git a/js/packages/react-ui/src/components/Input/input.scss b/js/packages/react-ui/src/components/Input/input.scss
index fa4c4b5c5..e383b460d 100644
--- a/js/packages/react-ui/src/components/Input/input.scss
+++ b/js/packages/react-ui/src/components/Input/input.scss
@@ -1,38 +1,37 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-input {
@include cssUtils.typography(body, default);
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- border-radius: map.get(cssUtils.$radius, "xs");
+ border: 1px solid cssUtils.$stroke-default;
+ border-radius: cssUtils.$rounded-xs;
box-sizing: border-box;
width: 100%;
- gap: map.get(cssUtils.$spacing, "xs");
- background-color: map.get(cssUtils.$colors, "fills", "container");
- color: map.get(cssUtils.$colors, "text", "primary");
+ gap: cssUtils.$spacing-xs;
+ background-color: cssUtils.$bg-container;
+ color: cssUtils.$primary-text;
&-small {
- padding: map.get(cssUtils.$spacing, "2xs") map.get(cssUtils.$spacing, "s");
+ padding: cssUtils.$spacing-2xs cssUtils.$spacing-s;
}
&-medium {
- padding: map.get(cssUtils.$spacing, "xs") map.get(cssUtils.$spacing, "s");
+ padding: cssUtils.$spacing-xs cssUtils.$spacing-s;
}
&-large {
- padding: map.get(cssUtils.$spacing, "s");
+ padding: cssUtils.$spacing-s;
}
&::placeholder {
- color: map.get(cssUtils.$colors, "text", "disabled");
+ color: cssUtils.$disabled-text;
}
&:focus {
outline: none;
- border-color: map.get(cssUtils.$colors, "strokes", "interactive-el-hover");
+ border-color: cssUtils.$stroke-interactive-el-hover;
}
&:disabled {
- background-color: map.get(cssUtils.$colors, "fills", "container");
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
+ background-color: cssUtils.$bg-container;
+ border: 1px solid cssUtils.$stroke-default;
cursor: not-allowed;
}
}
diff --git a/js/packages/react-ui/src/components/Label/label.scss b/js/packages/react-ui/src/components/Label/label.scss
index 7cf5cb035..5252b8724 100644
--- a/js/packages/react-ui/src/components/Label/label.scss
+++ b/js/packages/react-ui/src/components/Label/label.scss
@@ -1,13 +1,12 @@
-@use "sass:map";
@use "../../cssUtils.scss" as cssUtils;
.crayon-label {
box-sizing: border-box;
@include cssUtils.typography(primary, default);
- color: map.get(cssUtils.$colors, "text", "secondary");
+ color: cssUtils.$secondary-text;
&-disabled {
- color: map.get(cssUtils.$colors, "text", "disabled");
+ color: cssUtils.$disabled-text;
cursor: not-allowed;
}
}
diff --git a/js/packages/react-ui/src/components/ListBlock/listBlock.scss b/js/packages/react-ui/src/components/ListBlock/listBlock.scss
index b20727b68..28318d36c 100644
--- a/js/packages/react-ui/src/components/ListBlock/listBlock.scss
+++ b/js/packages/react-ui/src/components/ListBlock/listBlock.scss
@@ -1,4 +1,3 @@
-@use "sass:map";
@use "../../cssUtils.scss" as cssUtils;
.crayon-list-block {
@@ -6,6 +5,6 @@
display: flex;
flex-direction: column;
width: 100%;
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- border-radius: map.get(cssUtils.$radius, "m");
+ border: 1px solid cssUtils.$stroke-default;
+ border-radius: cssUtils.$rounded-m;
}
diff --git a/js/packages/react-ui/src/components/ListItem/listItem.scss b/js/packages/react-ui/src/components/ListItem/listItem.scss
index fd10e1d49..62f7202ad 100644
--- a/js/packages/react-ui/src/components/ListItem/listItem.scss
+++ b/js/packages/react-ui/src/components/ListItem/listItem.scss
@@ -1,4 +1,3 @@
-@use "sass:map";
@use "../../cssUtils.scss" as cssUtils;
.crayon-list-item {
@@ -6,8 +5,8 @@
display: flex;
align-items: center;
justify-content: space-between;
- border-bottom: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- padding: map.get(cssUtils.$spacing, "s");
+ border-bottom: 1px solid cssUtils.$stroke-default;
+ padding: cssUtils.$spacing-s;
cursor: pointer;
&:last-child {
@@ -15,7 +14,7 @@
}
svg {
- color: map.get(cssUtils.$colors, "text", "secondary");
+ color: cssUtils.$secondary-text;
}
.crayon-list-item-content {
@@ -25,23 +24,23 @@
flex-direction: column;
align-items: flex-start;
width: 100%;
- gap: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
&-action-icon {
display: flex;
align-items: center;
justify-content: center;
- padding: map.get(cssUtils.$spacing, "3xs");
+ padding: cssUtils.$spacing-3xs;
}
}
.crayon-list-item-title {
@include cssUtils.typography("primary", "default");
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
}
.crayon-list-item-subtitle {
@include cssUtils.typography("primary", "default");
- color: map.get(cssUtils.$colors, "text", "secondary");
+ color: cssUtils.$secondary-text;
}
}
diff --git a/js/packages/react-ui/src/components/RadioGroup/radioGroup.scss b/js/packages/react-ui/src/components/RadioGroup/radioGroup.scss
index 28e27b03c..495a5dcb2 100644
--- a/js/packages/react-ui/src/components/RadioGroup/radioGroup.scss
+++ b/js/packages/react-ui/src/components/RadioGroup/radioGroup.scss
@@ -1,28 +1,27 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-radio-group {
box-sizing: border-box;
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
border: 1px solid;
- border-radius: map.get(cssUtils.$radius, "m");
+ border-radius: cssUtils.$rounded-m;
&-clear {
border-color: transparent;
background-color: transparent;
- padding: map.get(cssUtils.$spacing, "0");
+ padding: cssUtils.$spacing-0;
}
&-card {
- border-color: map.get(cssUtils.$colors, "strokes", "default");
- padding: map.get(cssUtils.$spacing, "l");
+ border-color: cssUtils.$stroke-default;
+ padding: cssUtils.$spacing-l;
}
&-sunk {
- border-color: map.get(cssUtils.$colors, "strokes", "default");
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
- padding: map.get(cssUtils.$spacing, "l");
+ border-color: cssUtils.$stroke-default;
+ background-color: cssUtils.$bg-sunk;
+ padding: cssUtils.$spacing-l;
}
}
diff --git a/js/packages/react-ui/src/components/RadioItem/radioItem.scss b/js/packages/react-ui/src/components/RadioItem/radioItem.scss
index 41771e7d5..7cbc47a8b 100644
--- a/js/packages/react-ui/src/components/RadioItem/radioItem.scss
+++ b/js/packages/react-ui/src/components/RadioItem/radioItem.scss
@@ -1,14 +1,13 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-radio-item-container {
display: flex;
align-items: center;
- gap: map.get(cssUtils.$spacing, "2xs");
- padding-top: map.get(cssUtils.$spacing, "3xs");
- padding-bottom: map.get(cssUtils.$spacing, "3xs");
- padding-left: map.get(cssUtils.$spacing, "0");
- padding-right: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
+ padding-top: cssUtils.$spacing-3xs;
+ padding-bottom: cssUtils.$spacing-3xs;
+ padding-left: cssUtils.$spacing-0;
+ padding-right: cssUtils.$spacing-2xs;
width: 100%;
max-width: 100%;
overflow: hidden;
@@ -16,7 +15,7 @@
.crayon-radio-item-root {
box-sizing: border-box;
- border-radius: map.get(cssUtils.$radius, "full");
+ border-radius: cssUtils.$rounded-full;
border: none;
height: 14px;
width: 14px;
@@ -45,40 +44,40 @@
// First path - circle between border and center
.crayon-radio-item-svg-path {
.crayon-radio-item-root[data-state="unchecked"] & {
- fill: map.get(cssUtils.$colors, "fills", "container");
+ fill: cssUtils.$bg-container;
.crayon-radio-item-root:hover:not(:disabled) & {
- fill: map.get(cssUtils.$colors, "fills", "container");
+ fill: cssUtils.$bg-container;
}
}
.crayon-radio-item-root[data-state="checked"] & {
- fill: map.get(cssUtils.$colors, "fills", "container");
+ fill: cssUtils.$bg-container;
}
}
// Border path
.crayon-radio-item-svg-border {
.crayon-radio-item-root[data-state="unchecked"] & {
- stroke: map.get(cssUtils.$colors, "strokes", "interactive-el");
+ stroke: cssUtils.$stroke-interactive-el;
}
.crayon-radio-item-root[data-state="checked"] & {
- stroke: map.get(cssUtils.$colors, "strokes", "interactive-el-hover");
+ stroke: cssUtils.$stroke-interactive-el-hover;
}
}
// Inner circle path
.crayon-radio-item-svg-inner {
.crayon-radio-item-root[data-state="checked"] & {
- fill: map.get(cssUtils.$colors, "fills", "brand-el");
+ fill: cssUtils.$bg-brand-el;
}
.crayon-radio-item-root[data-state="unchecked"] & {
- fill: map.get(cssUtils.$colors, "fills", "container");
+ fill: cssUtils.$bg-container;
}
.crayon-radio-item-root[data-state="unchecked"]:hover:not(:disabled) & {
- fill: map.get(cssUtils.$colors, "strokes", "default");
+ fill: cssUtils.$stroke-default;
}
}
diff --git a/js/packages/react-ui/src/components/Select/select.scss b/js/packages/react-ui/src/components/Select/select.scss
index 6a31d47c0..42b32240f 100644
--- a/js/packages/react-ui/src/components/Select/select.scss
+++ b/js/packages/react-ui/src/components/Select/select.scss
@@ -1,49 +1,48 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-select-trigger {
box-sizing: border-box;
- background-color: map.get(cssUtils.$colors, "fills", "container");
- color: map.get(cssUtils.$colors, "text", "primary");
+ background-color: cssUtils.$bg-container;
+ color: cssUtils.$primary-text;
@include cssUtils.typography(label, default);
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
+ border: 1px solid cssUtils.$stroke-default;
outline: none;
display: inline-flex;
align-items: center;
justify-content: space-between;
&:hover {
- background: map.get(cssUtils.$colors, "fills", "container-hover");
- border-color: map.get(cssUtils.$colors, "strokes", "interactive-el");
- color: map.get(cssUtils.$colors, "text", "secondary");
+ background: cssUtils.$bg-container-hover;
+ border-color: cssUtils.$stroke-interactive-el;
+ color: cssUtils.$secondary-text;
}
&:disabled {
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
- color: map.get(cssUtils.$colors, "text", "disabled");
- border-color: map.get(cssUtils.$colors, "text", "disabled");
+ background-color: cssUtils.$bg-sunk;
+ color: cssUtils.$disabled-text;
+ border-color: cssUtils.$disabled-text;
cursor: not-allowed;
}
&[data-state="open"] {
- border-color: map.get(cssUtils.$colors, "strokes", "interactive-el");
- background-color: map.get(cssUtils.$colors, "fills", "background");
+ border-color: cssUtils.$stroke-interactive-el;
+ background-color: cssUtils.$bg-fill;
}
&[data-placeholder] {
- color: map.get(cssUtils.$colors, "text", "disabled");
+ color: cssUtils.$disabled-text;
}
&-sm {
- padding: map.get(cssUtils.$spacing, "2xs") map.get(cssUtils.$spacing, "s");
- border-radius: map.get(cssUtils.$radius, "xs");
+ padding: cssUtils.$spacing-2xs cssUtils.$spacing-s;
+ border-radius: cssUtils.$rounded-xs;
}
&-md {
- padding: map.get(cssUtils.$spacing, "xs") map.get(cssUtils.$spacing, "s");
- border-radius: map.get(cssUtils.$radius, "xs");
+ padding: cssUtils.$spacing-xs cssUtils.$spacing-s;
+ border-radius: cssUtils.$rounded-xs;
}
&-lg {
- padding: map.get(cssUtils.$spacing, "s");
- border-radius: map.get(cssUtils.$radius, "xs");
+ padding: cssUtils.$spacing-s;
+ border-radius: cssUtils.$rounded-xs;
}
&-icon {
height: 16px;
@@ -58,11 +57,11 @@
max-height: 380px;
min-width: var(--radix-select-trigger-width);
overflow: hidden;
- border-radius: map.get(cssUtils.$radius, "m");
- background-color: map.get(cssUtils.$colors, "fills", "container");
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- box-shadow: map.get(cssUtils.$shadow, "m");
- color: map.get(cssUtils.$colors, "text", "primary");
+ border-radius: cssUtils.$rounded-m;
+ background-color: cssUtils.$bg-container;
+ border: 1px solid cssUtils.$stroke-default;
+ box-shadow: cssUtils.$shadow-m;
+ color: cssUtils.$primary-text;
}
.crayon-select-viewport {
@@ -76,7 +75,7 @@
.crayon-select-label {
box-sizing: border-box;
- padding: map.get(cssUtils.$spacing, "xs") map.get(cssUtils.$spacing, "s");
+ padding: cssUtils.$spacing-xs cssUtils.$spacing-s;
@include cssUtils.typography(primary, default);
}
@@ -88,22 +87,22 @@
user-select: none;
align-items: center;
justify-content: space-between;
- border-radius: map.get(cssUtils.$radius, "s");
+ border-radius: cssUtils.$rounded-s;
padding-top: 6px;
padding-bottom: 6px;
@include cssUtils.typography(primary, default);
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
outline: 0;
// Variants based on showTick
&--with-tick {
- padding-left: map.get(cssUtils.$spacing, "xs");
- padding-right: map.get(cssUtils.$spacing, "xl");
+ padding-left: cssUtils.$spacing-xs;
+ padding-right: cssUtils.$spacing-xl;
}
&--without-tick {
- padding-left: map.get(cssUtils.$spacing, "xs");
- padding-right: map.get(cssUtils.$spacing, "xl");
+ padding-left: cssUtils.$spacing-xs;
+ padding-right: cssUtils.$spacing-xl;
}
// States
@@ -113,19 +112,19 @@
}
&[data-highlighted] {
- color: map.get(cssUtils.$colors, "text", "highlight");
+ color: cssUtils.$primary-text;
}
&:focus {
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
- color: map.get(cssUtils.$colors, "text", "accent-foreground");
- outline: 1px solid map.get(cssUtils.$colors, "strokes", "interactive-el");
+ background-color: cssUtils.$bg-sunk;
+ color: cssUtils.$primary-text;
+ outline: 1px solid cssUtils.$stroke-interactive-el;
outline-offset: -1px;
}
&[data-state="checked"] {
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
- outline: 1px solid map.get(cssUtils.$colors, "strokes", "interactive-el");
+ background-color: cssUtils.$bg-sunk;
+ outline: 1px solid cssUtils.$stroke-interactive-el;
outline-offset: -1px;
}
@@ -146,11 +145,11 @@
&-text {
flex: 1;
@include cssUtils.typography(primary, default);
- color: map.get(cssUtils.$colors, "text", "disabled");
+ color: cssUtils.$disabled-text;
}
&-value {
- color: map.get(cssUtils.$colors, "text", "secondary");
+ color: cssUtils.$secondary-text;
}
}
@@ -158,5 +157,5 @@
box-sizing: border-box;
margin: 4px -4px;
height: 1px;
- border-top: 1px solid map.get(cssUtils.$colors, "strokes", "default");
+ border-top: 1px solid cssUtils.$stroke-default;
}
diff --git a/js/packages/react-ui/src/components/Shell/mobileHeader.scss b/js/packages/react-ui/src/components/Shell/mobileHeader.scss
index b401af0ae..471bf2166 100644
--- a/js/packages/react-ui/src/components/Shell/mobileHeader.scss
+++ b/js/packages/react-ui/src/components/Shell/mobileHeader.scss
@@ -1,4 +1,3 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-shell-mobile-header {
@@ -8,20 +7,20 @@
display: flex;
align-items: center;
justify-content: space-between;
- padding: map.get(cssUtils.$spacing, "m") map.get(cssUtils.$spacing, "l");
- background-color: map.get(cssUtils.$colors, fills, container);
+ padding: cssUtils.$spacing-m cssUtils.$spacing-l;
+ background-color: cssUtils.$bg-container;
}
}
.crayon-shell-mobile-header-logo-container {
display: flex;
align-items: center;
- gap: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-m;
@include cssUtils.typography(title, medium);
}
.crayon-shell-mobile-header-logo {
width: 32px;
height: 32px;
- border-radius: map.get(cssUtils.$radius, "m");
+ border-radius: cssUtils.$rounded-m;
}
diff --git a/js/packages/react-ui/src/components/Shell/shell.scss b/js/packages/react-ui/src/components/Shell/shell.scss
index 50ffa2964..5a63110b8 100644
--- a/js/packages/react-ui/src/components/Shell/shell.scss
+++ b/js/packages/react-ui/src/components/Shell/shell.scss
@@ -1,5 +1,4 @@
@use "../../cssUtils" as cssUtils;
-@use "sass:map";
@use "./sidebar.scss";
@use "./threadlist.scss";
@use "./thread.scss";
@@ -10,10 +9,10 @@
position: relative;
height: 100vh;
width: 100vw;
- padding: map.get(cssUtils.$spacing, "m");
+ padding: cssUtils.$spacing-m;
overflow: hidden;
- background: map.get(cssUtils.$colors, fills, "background");
+ background: cssUtils.$bg-fill;
box-sizing: border-box;
& * {
box-sizing: border-box;
diff --git a/js/packages/react-ui/src/components/Shell/sidebar.scss b/js/packages/react-ui/src/components/Shell/sidebar.scss
index 6d92de0a7..ba3dc1cef 100644
--- a/js/packages/react-ui/src/components/Shell/sidebar.scss
+++ b/js/packages/react-ui/src/components/Shell/sidebar.scss
@@ -1,21 +1,20 @@
@use "../../cssUtils" as cssUtils;
-@use "sass:map";
$sidebar-width: 272px;
-$sidebar-padding: map.get(cssUtils.$spacing, "m");
+$sidebar-padding: cssUtils.$spacing-m;
$sidebar-mobile-width: 294px;
-$sidebar-mobile-padding: map.get(cssUtils.$spacing, "l");
+$sidebar-mobile-padding: cssUtils.$spacing-l;
.crayon-shell-sidebar-container {
- background: map.get(cssUtils.$colors, fills, "background");
- border: 1px solid map.get(cssUtils.$colors, strokes, "default");
+ background: cssUtils.$bg-fill;
+ border: 1px solid cssUtils.$stroke-default;
height: 100%;
width: $sidebar-width;
- border-radius: 12px;
+ border-radius: cssUtils.$rounded-m;
padding: $sidebar-padding;
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-m;
.crayon-shell-container--mobile & {
width: $sidebar-mobile-width;
@@ -24,7 +23,7 @@ $sidebar-mobile-padding: map.get(cssUtils.$spacing, "l");
left: 0;
top: 0;
z-index: 1000;
- background-color: map.get(cssUtils.$colors, fills, container);
+ background-color: cssUtils.$bg-container;
border-radius: 0;
transition: left 0.3s ease-in-out;
}
@@ -44,18 +43,18 @@ $sidebar-mobile-padding: map.get(cssUtils.$spacing, "l");
.crayon-shell-sidebar-header {
display: flex;
align-items: center;
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
&__logo {
width: 36px;
height: 36px;
- border-radius: map.get(cssUtils.$radius, "s");
+ border-radius: cssUtils.$rounded-s;
}
&__agent-name {
@include cssUtils.typography(primary, default);
flex-grow: 1;
- color: map.get(cssUtils.$colors, text, "primary");
+ color: cssUtils.$primary-text;
.crayon-shell-sidebar-container--collapsed & {
display: none;
@@ -72,14 +71,14 @@ $sidebar-mobile-padding: map.get(cssUtils.$spacing, "l");
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-m;
overflow: hidden;
}
.crayon-shell-sidebar-separator {
height: 1px;
width: 100%;
- background-color: map.get(cssUtils.$colors, strokes, default);
+ background-color: cssUtils.$stroke-default;
}
.crayon-shell-sidebar-header__toggle-button {
@@ -94,7 +93,7 @@ $sidebar-mobile-padding: map.get(cssUtils.$spacing, "l");
top: 0;
width: 100%;
height: 100%;
- background-color: map.get(cssUtils.$colors, fills, overlay);
+ background-color: cssUtils.$bg-overlay;
transition: opacity 0.3s ease-in-out;
&--collapsed {
diff --git a/js/packages/react-ui/src/components/Shell/thread.scss b/js/packages/react-ui/src/components/Shell/thread.scss
index 4d1b3db28..60e359f3f 100644
--- a/js/packages/react-ui/src/components/Shell/thread.scss
+++ b/js/packages/react-ui/src/components/Shell/thread.scss
@@ -1,5 +1,4 @@
@use "../../cssUtils" as cssUtils;
-@use "sass:map";
.crayon-shell-thread-container {
flex: 1;
@@ -8,16 +7,16 @@
flex-direction: column;
}
-$center-align-spacing: calc(32px + map.get(cssUtils.$spacing, "s"));
+$center-align-spacing: calc(32px + cssUtils.$spacing-s);
.crayon-shell-thread-scroll-area {
width: 100%;
flex: 1;
overflow: auto;
- padding: map.get(cssUtils.$spacing, "m") $center-align-spacing map.get(cssUtils.$spacing, "xl");
+ padding: cssUtils.$spacing-m $center-align-spacing cssUtils.$spacing-xl;
.crayon-shell-container--mobile & {
- padding: map.get(cssUtils.$spacing, "l");
+ padding: cssUtils.$spacing-l;
}
}
@@ -26,13 +25,13 @@ $center-align-spacing: calc(32px + map.get(cssUtils.$spacing, "s"));
margin: 0 auto;
display: flex;
flex-direction: column;
- gap: calc(2 * map.get(cssUtils.$spacing, "l"));
+ gap: calc(2 * cssUtils.$spacing-l);
}
.crayon-shell-thread-message-assistant {
width: 100%;
display: flex;
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
padding-right: $center-align-spacing;
overflow: hidden;
@@ -43,7 +42,7 @@ $center-align-spacing: calc(32px + map.get(cssUtils.$spacing, "s"));
&__content {
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
overflow: hidden;
overflow-wrap: break-word;
flex-grow: 1;
@@ -52,14 +51,14 @@ $center-align-spacing: calc(32px + map.get(cssUtils.$spacing, "s"));
&__text {
@include cssUtils.typography(primary, default);
&:first-child {
- margin-top: map.get(cssUtils.$spacing, "xs");
+ margin-top: cssUtils.$spacing-xs;
}
}
&__logo {
width: 32px;
height: 32px;
- border-radius: map.get(cssUtils.$radius, "m");
+ border-radius: cssUtils.$rounded-m;
}
}
@@ -74,10 +73,10 @@ $center-align-spacing: calc(32px + map.get(cssUtils.$spacing, "s"));
&__content {
@include cssUtils.typography(primary, default);
- padding: map.get(cssUtils.$spacing, "m") map.get(cssUtils.$spacing, "l");
- background-color: map.get(cssUtils.$colors, "fills", "brand-el");
- color: map.get(cssUtils.$colors, "text", "primary");
- border-radius: map.get(cssUtils.$radius, "2xl");
+ padding: cssUtils.$spacing-m cssUtils.$spacing-l;
+ background-color: cssUtils.$bg-brand-el;
+ color: cssUtils.$primary-text;
+ border-radius: cssUtils.$rounded-2xl;
overflow-wrap: break-word;
max-width: 100%;
}
@@ -86,22 +85,22 @@ $center-align-spacing: calc(32px + map.get(cssUtils.$spacing, "s"));
.crayon-shell-thread-composer {
max-width: 776px;
width: 100%;
- margin: 0 auto map.get(cssUtils.$spacing, "m");
+ margin: 0 auto cssUtils.$spacing-m;
padding: 0 $center-align-spacing;
.crayon-shell-container--mobile & {
margin: 0;
- padding: map.get(cssUtils.$spacing, "m") 14px;
- background-color: map.get(cssUtils.$colors, fills, container);
+ padding: cssUtils.$spacing-m 14px;
+ background-color: cssUtils.$bg-container;
}
&__input-wrapper {
- border: 1.256px solid map.get(cssUtils.$colors, strokes, default);
- border-radius: map.get(cssUtils.$radius, "xl");
+ border: 1.256px solid cssUtils.$stroke-default;
+ border-radius: cssUtils.$rounded-xl;
display: flex;
align-items: flex-end;
- gap: map.get(cssUtils.$spacing, "s");
- padding: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-s;
+ padding: cssUtils.$spacing-m;
}
&__input {
@@ -115,9 +114,9 @@ $center-align-spacing: calc(32px + map.get(cssUtils.$spacing, "s"));
background: transparent;
overflow: hidden;
@include cssUtils.typography(primary, default);
- color: map.get(cssUtils.$colors, text, "primary");
+ color: cssUtils.$primary-text;
&::placeholder {
- color: map.get(cssUtils.$colors, text, "disabled");
+ color: cssUtils.$disabled-text;
}
}
}
diff --git a/js/packages/react-ui/src/components/Shell/threadlist.scss b/js/packages/react-ui/src/components/Shell/threadlist.scss
index 20310a0cb..de1343183 100644
--- a/js/packages/react-ui/src/components/Shell/threadlist.scss
+++ b/js/packages/react-ui/src/components/Shell/threadlist.scss
@@ -1,17 +1,16 @@
@use "../../cssUtils" as cssUtils;
-@use "sass:map";
.crayon-shell-thread-list {
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "s");
+ gap: cssUtils.$spacing-s;
overflow: auto;
}
.crayon-shell-thread-list-group {
display: flex;
- padding-left: map.get(cssUtils.$spacing, "xs");
- color: map.get(cssUtils.$colors, "text", "secondary");
+ padding-left: cssUtils.$spacing-xs;
+ color: cssUtils.$secondary-text;
@include cssUtils.typography(label, default);
}
@@ -20,9 +19,9 @@
flex-shrink: 0;
@include cssUtils.button-reset;
@include cssUtils.typography(primary, default);
- color: map.get(cssUtils.$colors, text, "primary");
- padding: map.get(cssUtils.$spacing, "2xs") map.get(cssUtils.$spacing, "xs");
- border-radius: map.get(cssUtils.$radius, "s");
+ color: cssUtils.$primary-text;
+ padding: cssUtils.$spacing-2xs cssUtils.$spacing-xs;
+ border-radius: cssUtils.$rounded-s;
border: 1px solid transparent;
text-align: left;
cursor: pointer;
@@ -31,7 +30,7 @@
overflow: hidden;
&--selected {
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
- border-color: map.get(cssUtils.$colors, "stokes", "default");
+ background-color: cssUtils.$bg-sunk;
+ border-color: cssUtils.$stroke-default;
}
}
diff --git a/js/packages/react-ui/src/components/Slider/slider.scss b/js/packages/react-ui/src/components/Slider/slider.scss
index 9fd9ac974..94972aa1c 100644
--- a/js/packages/react-ui/src/components/Slider/slider.scss
+++ b/js/packages/react-ui/src/components/Slider/slider.scss
@@ -1,4 +1,3 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.slider {
@@ -18,15 +17,15 @@
position: relative;
height: 6px;
flex-grow: 1;
- border-radius: map.get(cssUtils.$radius, "full");
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
+ border-radius: cssUtils.$rounded-full;
+ background-color: cssUtils.$bg-sunk;
}
&-range {
position: absolute;
height: 100%;
- border-radius: map.get(cssUtils.$radius, "full");
- background-color: map.get(cssUtils.$colors, "fills", "brand-el");
+ border-radius: cssUtils.$rounded-full;
+ background-color: cssUtils.$bg-brand-el;
}
&-thumb {
@@ -36,11 +35,11 @@
display: block;
width: 16px;
height: 16px;
- border-radius: map.get(cssUtils.$radius, "3xs");
- outline: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- background-color: map.get(cssUtils.$colors, "fills", "container");
+ border-radius: cssUtils.$rounded-3xs;
+ outline: 1px solid cssUtils.$stroke-default;
+ background-color: cssUtils.$bg-container;
overflow: hidden;
- box-shadow: map.get(cssUtils.$shadow, "s");
+ box-shadow: cssUtils.$shadow-s;
&-inner {
display: flex;
@@ -48,18 +47,18 @@
height: 100%;
align-items: center;
justify-content: center;
- background-color: map.get(cssUtils.$colors, "fills", "container");
+ background-color: cssUtils.$bg-container;
transition: background-color 0.2s;
&:hover {
- background-color: map.get(cssUtils.$colors, "fills", "container-hover");
+ background-color: cssUtils.$bg-container-hover;
}
&-dot {
width: 4px;
height: 4px;
- border-radius: map.get(cssUtils.$radius, "full");
- background-color: map.get(cssUtils.$colors, "fills", "brand-el");
+ border-radius: cssUtils.$rounded-full;
+ background-color: cssUtils.$bg-brand-el;
}
}
}
@@ -69,13 +68,13 @@
position: absolute;
top: -30px;
left: 50%;
- border-radius: map.get(cssUtils.$radius, "2xs");
+ border-radius: cssUtils.$rounded-2xs;
transform: translateX(-50%);
- background-color: map.get(cssUtils.$colors, "fills", "container");
- color: map.get(cssUtils.$colors, "text", "primary");
- padding: map.get(cssUtils.$spacing, "2xs") map.get(cssUtils.$spacing, "3xs");
- border-radius: map.get(cssUtils.$radius, "sm");
- box-shadow: map.get(cssUtils.$shadow, "m");
+ background-color: cssUtils.$bg-container;
+ color: cssUtils.$primary-text;
+ padding: cssUtils.$spacing-2xs cssUtils.$spacing-3xs;
+ border-radius: cssUtils.$rounded-s;
+ box-shadow: cssUtils.$shadow-m;
opacity: 0;
transition: opacity 0.2s;
@@ -92,8 +91,8 @@
top: 1px;
width: 4px;
height: 4px;
- border-radius: map.get(cssUtils.$radius, "full");
- background-color: map.get(cssUtils.$colors, "fills", "container");
+ border-radius: cssUtils.$rounded-full;
+ background-color: cssUtils.$bg-container;
transform: translateX(-50%);
}
}
diff --git a/js/packages/react-ui/src/components/SwitchGroup/switchGroup.scss b/js/packages/react-ui/src/components/SwitchGroup/switchGroup.scss
index 5e0e8b5a5..6df85f27b 100644
--- a/js/packages/react-ui/src/components/SwitchGroup/switchGroup.scss
+++ b/js/packages/react-ui/src/components/SwitchGroup/switchGroup.scss
@@ -1,28 +1,27 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-switch-group {
box-sizing: border-box;
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
border: 1px solid;
- border-radius: map.get(cssUtils.$radius, "m");
+ border-radius: cssUtils.$rounded-m;
&-clear {
border-color: transparent;
background-color: transparent;
- padding: map.get(cssUtils.$spacing, "0");
+ padding: cssUtils.$spacing-0;
}
&-card {
- border-color: map.get(cssUtils.$colors, "strokes", "default");
- padding: map.get(cssUtils.$spacing, "l");
+ border-color: cssUtils.$stroke-default;
+ padding: cssUtils.$spacing-l;
}
&-sunk {
- border-color: map.get(cssUtils.$colors, "strokes", "default");
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
- padding: map.get(cssUtils.$spacing, "l");
+ border-color: cssUtils.$stroke-default;
+ background-color: cssUtils.$bg-sunk;
+ padding: cssUtils.$spacing-l;
}
}
diff --git a/js/packages/react-ui/src/components/SwitchItem/switchItem.scss b/js/packages/react-ui/src/components/SwitchItem/switchItem.scss
index e06e85cf3..ab5d7b7c7 100644
--- a/js/packages/react-ui/src/components/SwitchItem/switchItem.scss
+++ b/js/packages/react-ui/src/components/SwitchItem/switchItem.scss
@@ -1,18 +1,17 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-switch-item-container {
box-sizing: border-box;
display: flex;
align-items: center;
- gap: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
max-width: 100%;
width: 100%;
overflow: hidden;
- padding-top: map.get(cssUtils.$spacing, "3xs");
- padding-bottom: map.get(cssUtils.$spacing, "3xs");
- padding-left: map.get(cssUtils.$spacing, "0");
- padding-right: map.get(cssUtils.$spacing, "xs");
+ padding-top: cssUtils.$spacing-3xs;
+ padding-bottom: cssUtils.$spacing-3xs;
+ padding-left: cssUtils.$spacing-0;
+ padding-right: cssUtils.$spacing-xs;
}
.crayon-switch-item-root {
@@ -21,20 +20,20 @@
height: 15px;
width: 24px;
cursor: pointer;
- border-radius: map.get(cssUtils.$radius, "full");
- padding: map.get(cssUtils.$spacing, "3xs");
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- background-color: map.get(cssUtils.$colors, "fills", "background");
+ border-radius: cssUtils.$rounded-full;
+ padding: cssUtils.$spacing-3xs;
+ border: 1px solid cssUtils.$stroke-default;
+ background-color: cssUtils.$bg-fill;
transition-property: background-color;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
&:not([data-disabled], [data-state="checked"]):hover {
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
+ background-color: cssUtils.$bg-sunk;
}
&[data-state="checked"] {
- background-color: map.get(cssUtils.$colors, "fills", "brand-el");
+ background-color: cssUtils.$bg-brand-el;
}
&[data-disabled] {
@@ -48,17 +47,17 @@
display: block;
height: 10px;
width: 10px;
- border-radius: map.get(cssUtils.$radius, "full");
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- background-color: map.get(cssUtils.$colors, "fills", "container");
+ border-radius: cssUtils.$rounded-full;
+ border: 1px solid cssUtils.$stroke-default;
+ background-color: cssUtils.$bg-container;
transform: translateY(-50%) translateX(-1px);
transition-property: transform;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
- box-shadow: map.get(cssUtils.$shadow, "s");
+ box-shadow: cssUtils.$shadow-s;
&[data-state="checked"] {
transform: translateY(-50%) translateX(7.5px);
- border-color: map.get(cssUtils.$colors, "strokes", "interactive-el");
+ border-color: cssUtils.$stroke-interactive-el;
}
}
diff --git a/js/packages/react-ui/src/components/Table/table.scss b/js/packages/react-ui/src/components/Table/table.scss
index ea9eae4cb..db34ce164 100644
--- a/js/packages/react-ui/src/components/Table/table.scss
+++ b/js/packages/react-ui/src/components/Table/table.scss
@@ -1,4 +1,3 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-table-container {
@@ -17,13 +16,13 @@
.crayon-table-body {
& tr {
&:hover {
- background-color: map.get(cssUtils.$colors, "fills", "hover");
+ background-color: cssUtils.$bg-container-hover;
}
}
}
.crayon-table-footer {
- border-top: 1px solid map.get(cssUtils.$colors, "strokes", "default");
+ border-top: 1px solid cssUtils.$stroke-default;
& > tr:last-child {
border-bottom: 0;
@@ -32,15 +31,15 @@
.crayon-table-cell,
.crayon-table-head {
- padding: map.get(cssUtils.$spacing, "m");
- color: map.get(cssUtils.$colors, "text", "primary");
+ padding: cssUtils.$spacing-m;
+ color: cssUtils.$primary-text;
}
.crayon-table-head {
- border-bottom: 1px solid map.get(cssUtils.$colors, "strokes", "default");
+ border-bottom: 1px solid cssUtils.$stroke-default;
& .crayon-table-head-label {
@include cssUtils.typography(label, heavy);
- color: map.get(cssUtils.$colors, "text", "secondary");
+ color: cssUtils.$secondary-text;
display: inline-flex;
flex-grow: 1;
justify-content: left;
@@ -49,25 +48,25 @@
& .crayon-table-head-content {
display: flex;
align-items: center;
- gap: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
}
& .crayon-table-head-icon {
display: flex;
align-items: center;
justify-content: center;
- color: map.get(cssUtils.$colors, "text", "secondary");
+ color: cssUtils.$secondary-text;
}
}
.crayon-table-caption {
@include cssUtils.typography(label, heavy);
- color: map.get(cssUtils.$colors, "text", "primary");
- margin-top: map.get(cssUtils.$spacing, "m");
+ color: cssUtils.$primary-text;
+ margin-top: cssUtils.$spacing-m;
}
.crayon-table-row {
- border-bottom: 1px solid map.get(cssUtils.$colors, "strokes", "default");
+ border-bottom: 1px solid cssUtils.$stroke-default;
&:last-child {
border-bottom: 0;
diff --git a/js/packages/react-ui/src/components/Tabs/tabs.scss b/js/packages/react-ui/src/components/Tabs/tabs.scss
index 98c8a79ca..6da9d2edc 100644
--- a/js/packages/react-ui/src/components/Tabs/tabs.scss
+++ b/js/packages/react-ui/src/components/Tabs/tabs.scss
@@ -1,31 +1,30 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-tabs {
box-sizing: border-box;
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "m");
+ gap: cssUtils.$spacing-m;
&-clear {
.crayon-tabs-content {
- padding: map.get(cssUtils.$spacing, "3xs") map.get(cssUtils.$spacing, "xs");
+ padding: cssUtils.$spacing-3xs cssUtils.$spacing-xs;
border: transparent;
}
}
&-card {
.crayon-tabs-content {
- padding: map.get(cssUtils.$spacing, "l");
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
+ padding: cssUtils.$spacing-l;
+ border: 1px solid cssUtils.$stroke-default;
}
}
&-sunk {
.crayon-tabs-content {
- padding: map.get(cssUtils.$spacing, "l");
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- background-color: map.get(cssUtils.$colors, "fills", "sunk");
+ padding: cssUtils.$spacing-l;
+ border: 1px solid cssUtils.$stroke-default;
+ background-color: cssUtils.$bg-sunk;
}
}
}
@@ -34,10 +33,10 @@
box-sizing: border-box;
display: flex;
flex-direction: row;
- gap: map.get(cssUtils.$spacing, "s");
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- padding: map.get(cssUtils.$spacing, "2xs");
- border-radius: map.get(cssUtils.$radius, "s");
+ gap: cssUtils.$spacing-s;
+ border: 1px solid cssUtils.$stroke-default;
+ padding: cssUtils.$spacing-2xs;
+ border-radius: cssUtils.$rounded-s;
background-color: transparent;
overflow-x: auto;
scrollbar-width: none;
@@ -52,19 +51,19 @@
flex-direction: row;
align-items: center;
justify-content: center;
- gap: map.get(cssUtils.$spacing, "2xs");
+ gap: cssUtils.$spacing-2xs;
box-sizing: border-box;
- padding: map.get(cssUtils.$spacing, "2xs") map.get(cssUtils.$spacing, "3xs");
+ padding: cssUtils.$spacing-2xs cssUtils.$spacing-3xs;
border: 1px solid transparent;
- border-radius: map.get(cssUtils.$radius, "xs");
+ border-radius: cssUtils.$rounded-xs;
min-width: 7.3rem;
width: 100%;
- background-color: map.get(cssUtils.$colors, "fills", "container");
- color: map.get(cssUtils.$colors, "text", "primary");
+ background-color: cssUtils.$bg-container;
+ color: cssUtils.$primary-text;
@include cssUtils.typography(label, default);
&[data-state="active"] {
- background-color: map.get(cssUtils.$colors, "fills", "background");
- border-color: map.get(cssUtils.$colors, "strokes", "default");
+ background-color: cssUtils.$bg-fill;
+ border-color: cssUtils.$stroke-default;
}
&-text {
text-align: center;
@@ -86,14 +85,14 @@
.crayon-tabs-content {
box-sizing: border-box;
- padding: map.get(cssUtils.$spacing, "l");
+ padding: cssUtils.$spacing-l;
border: 1px solid transparent;
- border-radius: map.get(cssUtils.$radius, "m");
+ border-radius: cssUtils.$rounded-m;
@include cssUtils.typography(body, default);
&-inner {
display: flex;
flex-direction: column;
- gap: map.get(cssUtils.$spacing, "l");
+ gap: cssUtils.$spacing-l;
}
}
diff --git a/js/packages/react-ui/src/components/Tag/stories/Tag.stories.tsx b/js/packages/react-ui/src/components/Tag/stories/Tag.stories.tsx
index dcc9b633a..80b0e62ca 100644
--- a/js/packages/react-ui/src/components/Tag/stories/Tag.stories.tsx
+++ b/js/packages/react-ui/src/components/Tag/stories/Tag.stories.tsx
@@ -47,7 +47,7 @@ const meta: Meta<typeof Tag> = {
},
},
},
- tags: ["!dev", "autodocs"],
+ tags: ["!dev", "!autodocs"],
};
export default meta;
diff --git a/js/packages/react-ui/src/components/Tag/tag.scss b/js/packages/react-ui/src/components/Tag/tag.scss
index 3f9653b4b..9f0d9d9a6 100644
--- a/js/packages/react-ui/src/components/Tag/tag.scss
+++ b/js/packages/react-ui/src/components/Tag/tag.scss
@@ -1,4 +1,3 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-tag {
@@ -8,17 +7,17 @@
overflow: hidden;
max-width: 100%;
height: auto;
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- border-radius: map.get(cssUtils.$radius, "s");
- padding: map.get(cssUtils.$spacing, "2xs") map.get(cssUtils.$spacing, "xs");
- background: map.get(cssUtils.$colors, "fills", "sunk");
- color: map.get(cssUtils.$colors, "text", "primary");
+ border: 1px solid cssUtils.$stroke-default;
+ border-radius: cssUtils.$rounded-s;
+ padding: cssUtils.$spacing-2xs cssUtils.$spacing-xs;
+ background: cssUtils.$bg-sunk;
+ color: cssUtils.$primary-text;
@include cssUtils.typography(body, default);
&-icon {
display: flex;
align-items: center;
- margin-right: map.get(cssUtils.$spacing, "3xs");
+ margin-right: cssUtils.$spacing-3xs;
}
&-text {
diff --git a/js/packages/react-ui/src/components/TagBlock/tagBlock.scss b/js/packages/react-ui/src/components/TagBlock/tagBlock.scss
index 7c453be03..b81e5dea4 100644
--- a/js/packages/react-ui/src/components/TagBlock/tagBlock.scss
+++ b/js/packages/react-ui/src/components/TagBlock/tagBlock.scss
@@ -1,10 +1,9 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-tag-block {
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
- gap: map.get(cssUtils.$spacing, "xs");
+ gap: cssUtils.$spacing-xs;
max-width: 100%;
}
diff --git a/js/packages/react-ui/src/components/TextArea/textArea.scss b/js/packages/react-ui/src/components/TextArea/textArea.scss
index c5c51b93d..b9f01d3a4 100644
--- a/js/packages/react-ui/src/components/TextArea/textArea.scss
+++ b/js/packages/react-ui/src/components/TextArea/textArea.scss
@@ -1,21 +1,20 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
.crayon-textarea {
box-sizing: border-box;
width: 100%;
- border: 1px solid map.get(cssUtils.$colors, "strokes", "default");
- border-radius: map.get(cssUtils.$radius, "s");
- padding: map.get(cssUtils.$spacing, "xs") map.get(cssUtils.$spacing, "s");
- gap: map.get(cssUtils.$spacing, "xs");
- background-color: map.get(cssUtils.$colors, "fills", "container");
- color: map.get(cssUtils.$colors, "text", "primary");
+ border: 1px solid cssUtils.$stroke-default;
+ border-radius: cssUtils.$rounded-s;
+ padding: cssUtils.$spacing-xs cssUtils.$spacing-s;
+ gap: cssUtils.$spacing-xs;
+ background-color: cssUtils.$bg-container;
+ color: cssUtils.$primary-text;
outline: none;
resize: none;
@include cssUtils.typography(primary, default);
&::placeholder {
- color: map.get(cssUtils.$colors, "text", "disabled");
+ color: cssUtils.$disabled-text;
}
&:disabled {
diff --git a/js/packages/react-ui/src/components/TextContent/textContent.scss b/js/packages/react-ui/src/components/TextContent/textContent.scss
index 7669eacd0..2f2cee582 100644
--- a/js/packages/react-ui/src/components/TextContent/textContent.scss
+++ b/js/packages/react-ui/src/components/TextContent/textContent.scss
@@ -1,16 +1,15 @@
-@use "sass:map";
@use "../../cssUtils" as cssUtils;
@mixin text-content-variants($variant) {
@if $variant == "sunk" {
- padding: map.get(cssUtils.$spacing, "m");
- background: map.get(cssUtils.$colors, "fills", "sunk");
- border-radius: map.get(cssUtils.$radius, "m");
- border-color: map.get(cssUtils.$colors, "strokes", "default");
+ padding: cssUtils.$spacing-m;
+ background: cssUtils.$bg-sunk;
+ border-radius: cssUtils.$rounded-m;
+ border-color: cssUtils.$stroke-default;
} @else if $variant == "card" {
- padding: map.get(cssUtils.$spacing, "m");
- border-radius: map.get(cssUtils.$radius, "m");
- border-color: map.get(cssUtils.$colors, "strokes", "default");
+ padding: cssUtils.$spacing-m;
+ border-radius: cssUtils.$rounded-m;
+ border-color: cssUtils.$stroke-default;
} @else if $variant == "clear" {
border-color: transparent;
}
@@ -18,7 +17,7 @@
.text-content {
box-sizing: border-box;
- color: map.get(cssUtils.$colors, "text", "primary");
+ color: cssUtils.$primary-text;
@include cssUtils.typography(primary, default);
border: 1px solid;
diff --git a/js/packages/react-ui/src/components/ThemeProvider/ThemeProvider.tsx b/js/packages/react-ui/src/components/ThemeProvider/ThemeProvider.tsx
index 7d9c2f816..8c34b69b0 100644
--- a/js/packages/react-ui/src/components/ThemeProvider/ThemeProvider.tsx
+++ b/js/packages/react-ui/src/components/ThemeProvider/ThemeProvider.tsx
@@ -208,107 +208,107 @@ export const ThemeProvider = ({
<>
<style>{`
body {
- --background-fills: ${theme.backgroundFills};
- --brand-el-fills: ${theme.brandElFills};
- --brand-el-hover-fills: ${theme.brandElHoverFills};
- --container-fills: ${theme.containerFills};
- --overlay-fills: ${theme.overlayFills};
- --sunk-fills: ${theme.sunkFills};
- --container-hover-fills: ${theme.containerHoverFills};
- --danger-fills: ${theme.dangerFills};
- --success-fills: ${theme.successFills};
-
- --strokes-default: ${theme.strokesDefault};
- --stocks-interactive-el: ${theme.stocksInteractiveEl};
- --stocks-interactive-el-hover: ${theme.stocksInteractiveElHover};
- --strokes-interactive-el-selected: ${theme.strokesInteractiveElSelected};
-
- --brand-text: ${theme.brandText};
- --brand-secondary-text: ${theme.brandSecondaryText};
- --primary-text: ${theme.primaryText};
- --secondary-text: ${theme.secondaryText};
- --disabled-text: ${theme.disabledText};
- --danger-text: ${theme.dangerText};
- --success-text: ${theme.successText};
- --link-text: ${theme.linkText};
- --info-text: ${theme.infoText};
-
- --spacing-0: ${theme.spacing0};
- --spacing-3xs: ${theme.spacing3xs};
- --spacing-2xs: ${theme.spacing2xs};
- --spacing-xs: ${theme.spacingXs};
- --spacing-s: ${theme.spacingS};
- --spacing-m: ${theme.spacingM};
- --spacing-l: ${theme.spacingL};
- --spacing-xl: ${theme.spacingXl};
- --spacing-2xl: ${theme.spacing2xl};
- --spacing-3xl: ${theme.spacing3xl};
-
- --rounded-0: ${theme.rounded0};
- --rounded-3xs: ${theme.rounded3xs};
- --rounded-2xs: ${theme.rounded2xs};
- --rounded-xs: ${theme.roundedXs};
- --rounded-s: ${theme.roundedS};
- --rounded-m: ${theme.roundedM};
- --rounded-l: ${theme.roundedL};
- --rounded-xl: ${theme.roundedXl};
- --rounded-2xl: ${theme.rounded2xl};
- --rounded-3xl: ${theme.rounded3xl};
- --rounded-full: ${theme.roundedFull};
-
- --font-primary: ${theme.fontPrimary};
- --font-primary-letter-spacing: ${theme.fontPrimaryLetterSpacing};
- --font-title: ${theme.fontTitle};
- --font-title-letter-spacing: ${theme.fontTitleLetterSpacing};
- --font-title-medium: ${theme.fontTitleMedium};
- --font-title-medium-letter-spacing: ${theme.fontTitleMediumLetterSpacing};
- --font-title-small: ${theme.fontTitleSmall};
- --font-title-small-letter-spacing: ${theme.fontTitleSmallLetterSpacing};
- --font-body: ${theme.fontBody};
- --font-body-letter-spacing: ${theme.fontBodyLetterSpacing};
- --font-body-link: ${theme.fontBodyLink};
- --font-body-link-letter-spacing: ${theme.fontBodyLinkLetterSpacing};
- --font-body-heavy: ${theme.fontBodyHeavy};
- --font-body-heavy-letter-spacing: ${theme.fontBodyHeavyLetterSpacing};
- --font-body-medium: ${theme.fontBodyMedium};
- --font-body-medium-letter-spacing: ${theme.fontBodyMediumLetterSpacing};
- --font-body-small-heavy: ${theme.fontBodySmallHeavy};
- --font-body-small-heavy-letter-spacing: ${theme.fontBodySmallHeavyLetterSpacing};
- --font-body-small: ${theme.fontBodySmall};
- --font-body-small-letter-spacing: ${theme.fontBodySmallLetterSpacing};
- --font-label: ${theme.fontLabel};
- --font-label-letter-spacing: ${theme.fontLabelLetterSpacing};
- --font-label-heavy: ${theme.fontLabelHeavy};
- --font-label-heavy-letter-spacing: ${theme.fontLabelHeavyLetterSpacing};
- --font-label-small: ${theme.fontLabelSmall};
- --font-label-small-letter-spacing: ${theme.fontLabelSmallLetterSpacing};
- --font-label-small-heavy: ${theme.fontLabelSmallHeavy};
- --font-label-small-heavy-letter-spacing: ${theme.fontLabelSmallHeavyLetterSpacing};
- --font-label-extra-small: ${theme.fontLabelExtraSmall};
- --font-label-extra-small-letter-spacing: ${theme.fontLabelExtraSmallLetterSpacing};
- --font-label-extra-small-heavy: ${theme.fontLabelExtraSmallHeavy};
- --font-label-extra-small-heavy-letter-spacing: ${theme.fontLabelExtraSmallHeavyLetterSpacing};
- --font-label-large-heavy: ${theme.fontLabelLargeHeavy};
- --font-label-large-heavy-letter-spacing: ${theme.fontLabelLargeHeavyLetterSpacing};
- --font-label-large: ${theme.fontLabelLarge};
- --font-label-large-letter-spacing: ${theme.fontLabelLargeLetterSpacing};
- --font-label-medium-heavy: ${theme.fontLabelMediumHeavy};
- --font-label-medium-heavy-letter-spacing: ${theme.fontLabelMediumHeavyLetterSpacing};
- --font-label-medium: ${theme.fontLabelMedium};
- --font-label-medium-letter-spacing: ${theme.fontLabelMediumLetterSpacing};
- --font-heading-large: ${theme.fontHeadingLarge};
- --font-heading-large-letter-spacing: ${theme.fontHeadingLargeLetterSpacing};
- --font-heading-medium: ${theme.fontHeadingMedium};
- --font-heading-medium-letter-spacing: ${theme.fontHeadingMediumLetterSpacing};
- --font-heading-small: ${theme.fontHeadingSmall};
- --font-heading-small-letter-spacing: ${theme.fontHeadingSmallLetterSpacing};
-
- --shadow-s: ${theme.shadowS};
- --shadow-m: ${theme.shadowM};
- --shadow-l: ${theme.shadowL};
- --shadow-xl: ${theme.shadowXl};
- --shadow-2xl: ${theme.shadow2xl};
- --shadow-3xl: ${theme.shadow3xl};
+ --crayon-background-fills: ${theme.backgroundFills};
+ --crayon-brand-el-fills: ${theme.brandElFills};
+ --crayon-brand-el-hover-fills: ${theme.brandElHoverFills};
+ --crayon-container-fills: ${theme.containerFills};
+ --crayon-overlay-fills: ${theme.overlayFills};
+ --crayon-sunk-fills: ${theme.sunkFills};
+ --crayon-container-hover-fills: ${theme.containerHoverFills};
+ --crayon-danger-fills: ${theme.dangerFills};
+ --crayon-success-fills: ${theme.successFills};
+
+ --crayon-strokes-default: ${theme.strokesDefault};
+ --crayon-stocks-interactive-el: ${theme.stocksInteractiveEl};
+ --crayon-stocks-interactive-el-hover: ${theme.stocksInteractiveElHover};
+ --crayon-strokes-interactive-el-selected: ${theme.strokesInteractiveElSelected};
+
+ --crayon-brand-text: ${theme.brandText};
+ --crayon-brand-secondary-text: ${theme.brandSecondaryText};
+ --crayon-primary-text: ${theme.primaryText};
+ --crayon-secondary-text: ${theme.secondaryText};
+ --crayon-disabled-text: ${theme.disabledText};
+ --crayon-danger-text: ${theme.dangerText};
+ --crayon-success-text: ${theme.successText};
+ --crayon-link-text: ${theme.linkText};
+ --crayon-info-text: ${theme.infoText};
+
+ --crayon-spacing-0: ${theme.spacing0};
+ --crayon-spacing-3xs: ${theme.spacing3xs};
+ --crayon-spacing-2xs: ${theme.spacing2xs};
+ --crayon-spacing-xs: ${theme.spacingXs};
+ --crayon-spacing-s: ${theme.spacingS};
+ --crayon-spacing-m: ${theme.spacingM};
+ --crayon-spacing-l: ${theme.spacingL};
+ --crayon-spacing-xl: ${theme.spacingXl};
+ --crayon-spacing-2xl: ${theme.spacing2xl};
+ --crayon-spacing-3xl: ${theme.spacing3xl};
+
+ --crayon-rounded-0: ${theme.rounded0};
+ --crayon-rounded-3xs: ${theme.rounded3xs};
+ --crayon-rounded-2xs: ${theme.rounded2xs};
+ --crayon-rounded-xs: ${theme.roundedXs};
+ --crayon-rounded-s: ${theme.roundedS};
+ --crayon-rounded-m: ${theme.roundedM};
+ --crayon-rounded-l: ${theme.roundedL};
+ --crayon-rounded-xl: ${theme.roundedXl};
+ --crayon-rounded-2xl: ${theme.rounded2xl};
+ --crayon-rounded-3xl: ${theme.rounded3xl};
+ --crayon-rounded-full: ${theme.roundedFull};
+
+ --crayon-font-primary: ${theme.fontPrimary};
+ --crayon-font-primary-letter-spacing: ${theme.fontPrimaryLetterSpacing};
+ --crayon-font-title: ${theme.fontTitle};
+ --crayon-font-title-letter-spacing: ${theme.fontTitleLetterSpacing};
+ --crayon-font-title-medium: ${theme.fontTitleMedium};
+ --crayon-font-title-medium-letter-spacing: ${theme.fontTitleMediumLetterSpacing};
+ --crayon-font-title-small: ${theme.fontTitleSmall};
+ --crayon-font-title-small-letter-spacing: ${theme.fontTitleSmallLetterSpacing};
+ --crayon-font-body: ${theme.fontBody};
+ --crayon-font-body-letter-spacing: ${theme.fontBodyLetterSpacing};
+ --crayon-font-body-link: ${theme.fontBodyLink};
+ --crayon-font-body-link-letter-spacing: ${theme.fontBodyLinkLetterSpacing};
+ --crayon-font-body-heavy: ${theme.fontBodyHeavy};
+ --crayon-font-body-heavy-letter-spacing: ${theme.fontBodyHeavyLetterSpacing};
+ --crayon-font-body-medium: ${theme.fontBodyMedium};
+ --crayon-font-body-medium-letter-spacing: ${theme.fontBodyMediumLetterSpacing};
+ --crayon-font-body-small-heavy: ${theme.fontBodySmallHeavy};
+ --crayon-font-body-small-heavy-letter-spacing: ${theme.fontBodySmallHeavyLetterSpacing};
+ --crayon-font-body-small: ${theme.fontBodySmall};
+ --crayon-font-body-small-letter-spacing: ${theme.fontBodySmallLetterSpacing};
+ --crayon-font-label: ${theme.fontLabel};
+ --crayon-font-label-letter-spacing: ${theme.fontLabelLetterSpacing};
+ --crayon-font-label-heavy: ${theme.fontLabelHeavy};
+ --crayon-font-label-heavy-letter-spacing: ${theme.fontLabelHeavyLetterSpacing};
+ --crayon-font-label-small: ${theme.fontLabelSmall};
+ --crayon-font-label-small-letter-spacing: ${theme.fontLabelSmallLetterSpacing};
+ --crayon-font-label-small-heavy: ${theme.fontLabelSmallHeavy};
+ --crayon-font-label-small-heavy-letter-spacing: ${theme.fontLabelSmallHeavyLetterSpacing};
+ --crayon-font-label-extra-small: ${theme.fontLabelExtraSmall};
+ --crayon-font-label-extra-small-letter-spacing: ${theme.fontLabelExtraSmallLetterSpacing};
+ --crayon-font-label-extra-small-heavy: ${theme.fontLabelExtraSmallHeavy};
+ --crayon-font-label-extra-small-heavy-letter-spacing: ${theme.fontLabelExtraSmallHeavyLetterSpacing};
+ --crayon-font-label-large-heavy: ${theme.fontLabelLargeHeavy};
+ --crayon-font-label-large-heavy-letter-spacing: ${theme.fontLabelLargeHeavyLetterSpacing};
+ --crayon-font-label-large: ${theme.fontLabelLarge};
+ --crayon-font-label-large-letter-spacing: ${theme.fontLabelLargeLetterSpacing};
+ --crayon-font-label-medium-heavy: ${theme.fontLabelMediumHeavy};
+ --crayon-font-label-medium-heavy-letter-spacing: ${theme.fontLabelMediumHeavyLetterSpacing};
+ --crayon-font-label-medium: ${theme.fontLabelMedium};
+ --crayon-font-label-medium-letter-spacing: ${theme.fontLabelMediumLetterSpacing};
+ --crayon-font-heading-large: ${theme.fontHeadingLarge};
+ --crayon-font-heading-large-letter-spacing: ${theme.fontHeadingLargeLetterSpacing};
+ --crayon-font-heading-medium: ${theme.fontHeadingMedium};
+ --crayon-font-heading-medium-letter-spacing: ${theme.fontHeadingMediumLetterSpacing};
+ --crayon-font-heading-small: ${theme.fontHeadingSmall};
+ --crayon-font-heading-small-letter-spacing: ${theme.fontHeadingSmallLetterSpacing};
+
+ --crayon-shadow-s: ${theme.shadowS};
+ --crayon-shadow-m: ${theme.shadowM};
+ --crayon-shadow-l: ${theme.shadowL};
+ --crayon-shadow-xl: ${theme.shadowXl};
+ --crayon-shadow-2xl: ${theme.shadow2xl};
+ --crayon-shadow-3xl: ${theme.shadow3xl};
}
`}</style>
{children}
diff --git a/js/packages/react-ui/src/cssUtils.scss b/js/packages/react-ui/src/cssUtils.scss
index 5dc5b3aaa..3fa75354c 100644
--- a/js/packages/react-ui/src/cssUtils.scss
+++ b/js/packages/react-ui/src/cssUtils.scss
@@ -1,71 +1,71 @@
@use "sass:map";
-$colors: (
- fills: (
- background: var(--background-fills),
- brand-el: var(--brand-el-fills),
- brand-el-hover: var(--brand-el-hover-fills),
- container: var(--container-fills),
- overlay: var(--overlay-fills),
- sunk: var(--sunk-fills),
- container-hover: var(--container-hover-fills),
- danger: var(--danger-fills),
- success: var(--success-fills),
- ),
- strokes: (
- default: var(--strokes-default),
- interactive-el: var(--stocks-interactive-el),
- interactive-el-hover: var(--stocks-interactive-el-hover),
- interactive-el-selected: var(--strokes-interactive-el-selected),
- ),
- text: (
- brand: var(--brand-text),
- brand-secondary: var(--brand-secondary-text),
- primary: var(--primary-text),
- secondary: var(--secondary-text),
- disabled: var(--disabled-text),
- danger: var(--danger-text),
- success: var(--success-text),
- link: var(--link-text),
- info: var(--info-text),
- ),
-);
+// Crayon Background Colors
-$spacing: (
- "0": var(--spacing-0),
- "3xs": var(--spacing-3xs),
- "2xs": var(--spacing-2xs),
- "xs": var(--spacing-xs),
- "s": var(--spacing-s),
- "m": var(--spacing-m),
- "l": var(--spacing-l),
- "xl": var(--spacing-xl),
- "2xl": var(--spacing-2xl),
- "3xl": var(--spacing-3xl),
-);
+$bg-fill: var(--crayon-background-fills);
+$bg-brand-el: var(--crayon-brand-el-fills);
+$bg-brand-el-hover: var(--crayon-brand-el-hover-fills);
+$bg-container: var(--crayon-container-fills);
+$bg-container-hover: var(--crayon-container-hover-fills);
+$bg-overlay: var(--crayon-overlay-fills);
+$bg-sunk: var(--crayon-sunk-fills);
+$bg-danger: var(--crayon-danger-fills);
+$bg-success: var(--crayon-success-fills);
-$radius: (
- "0": var(--rounded-0),
- "3xs": var(--rounded-3xs),
- "2xs": var(--rounded-2xs),
- "xs": var(--rounded-xs),
- "s": var(--rounded-s),
- "m": var(--rounded-m),
- "l": var(--rounded-l),
- "xl": var(--rounded-xl),
- "2xl": var(--rounded-2xl),
- "3xl": var(--rounded-3xl),
- "full": var(--rounded-full),
-);
+// Crayon Strokes Colors
-$shadow: (
- "s": var(--shadow-s),
- "m": var(--shadow-m),
- "l": var(--shadow-l),
- "xl": var(--shadow-xl),
- "2xl": var(--shadow-2xl),
- "3xl": var(--shadow-3xl),
-);
+$stroke-default: var(--crayon-strokes-default);
+$stroke-interactive-el: var(--crayon-stocks-interactive-el);
+$stroke-interactive-el-hover: var(--crayon-stocks-interactive-el-hover);
+$stroke-interactive-el-selected: var(--crayon-strokes-interactive-el-selected);
+
+// Crayon Text Colors
+
+$brand-text: var(--crayon-brand-text);
+$brand-secondary-text: var(--crayon-brand-secondary-text);
+$primary-text: var(--crayon-primary-text);
+$secondary-text: var(--crayon-secondary-text);
+$disabled-text: var(--crayon-disabled-text);
+$danger-text: var(--crayon-danger-text);
+$success-text: var(--crayon-success-text);
+$link-text: var(--crayon-link-text);
+$info-text: var(--crayon-info-text);
+
+// Crayon Spacing
+
+$spacing-0: var(--crayon-spacing-0);
+$spacing-3xs: var(--crayon-spacing-3xs);
+$spacing-2xs: var(--crayon-spacing-2xs);
+$spacing-xs: var(--crayon-spacing-xs);
+$spacing-s: var(--crayon-spacing-s);
+$spacing-m: var(--crayon-spacing-m);
+$spacing-l: var(--crayon-spacing-l);
+$spacing-xl: var(--crayon-spacing-xl);
+$spacing-2xl: var(--crayon-spacing-2xl);
+$spacing-3xl: var(--crayon-spacing-3xl);
+
+// Crayon Radius
+
+$rounded-0: var(--crayon-rounded-0);
+$rounded-3xs: var(--crayon-rounded-3xs);
+$rounded-2xs: var(--crayon-rounded-2xs);
+$rounded-xs: var(--crayon-rounded-xs);
+$rounded-s: var(--crayon-rounded-s);
+$rounded-m: var(--crayon-rounded-m);
+$rounded-l: var(--crayon-rounded-l);
+$rounded-xl: var(--crayon-rounded-xl);
+$rounded-2xl: var(--crayon-rounded-2xl);
+$rounded-3xl: var(--crayon-rounded-3xl);
+$rounded-full: var(--crayon-rounded-full);
+
+// Crayon Shadows
+
+$shadow-s: var(--crayon-shadow-s);
+$shadow-m: var(--crayon-shadow-m);
+$shadow-l: var(--crayon-shadow-l);
+$shadow-xl: var(--crayon-shadow-xl);
+$shadow-2xl: var(--crayon-shadow-2xl);
+$shadow-3xl: var(--crayon-shadow-3xl);
@function typography($font-name) {
@return (font: var(--#{$font-name}), letter-spacing: var(--#{$font-name}-letter-spacing));
@@ -73,37 +73,37 @@ $shadow: (
$typography: (
body: (
- default: typography(font-body),
- link: typography(font-body-link),
- heavy: typography(font-body-heavy),
- medium: typography(font-body-medium),
- small: typography(font-body-small),
- small-heavy: typography(font-body-small-heavy),
+ default: typography(crayon-font-body),
+ link: typography(crayon-font-body-link),
+ heavy: typography(crayon-font-body-heavy),
+ medium: typography(crayon-font-body-medium),
+ small: typography(crayon-font-body-small),
+ small-heavy: typography(crayon-font-body-small-heavy),
),
label: (
- default: typography(font-label),
- heavy: typography(font-label-heavy),
- small: typography(font-label-small),
- small-heavy: typography(font-label-small-heavy),
- extra-small: typography(font-label-extra-small),
- extra-small-heavy: typography(font-label-extra-small-heavy),
- large: typography(font-label-large),
- large-heavy: typography(font-label-large-heavy),
- medium: typography(font-label-medium),
- medium-heavy: typography(font-label-medium-heavy),
+ default: typography(crayon-font-label),
+ heavy: typography(crayon-font-label-heavy),
+ small: typography(crayon-font-label-small),
+ small-heavy: typography(crayon-font-label-small-heavy),
+ extra-small: typography(crayon-font-label-extra-small),
+ extra-small-heavy: typography(crayon-font-label-extra-small-heavy),
+ large: typography(crayon-font-label-large),
+ large-heavy: typography(crayon-font-label-large-heavy),
+ medium: typography(crayon-font-label-medium),
+ medium-heavy: typography(crayon-font-label-medium-heavy),
),
heading: (
- large: typography(font-heading-large),
- medium: typography(font-heading-medium),
- small: typography(font-heading-small),
+ large: typography(crayon-font-heading-large),
+ medium: typography(crayon-font-heading-medium),
+ small: typography(crayon-font-heading-small),
),
primary: (
- default: typography(font-primary),
+ default: typography(crayon-font-primary),
),
title: (
- default: typography(font-title),
- medium: typography(font-title-medium),
- small: typography(font-title-small),
+ default: typography(crayon-font-title),
+ medium: typography(crayon-font-title-medium),
+ small: typography(crayon-font-title-small),
),
);