@cambly/syntax-core 21.16.0 → 22.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Badge/Badge.d.ts +1 -1
- package/dist/Badge/Badge.js +1 -1
- package/dist/Chip/Chip.css +13 -1639
- package/dist/Chip/Chip.css.map +1 -1
- package/dist/Chip/Chip.d.ts +9 -3
- package/dist/Chip/Chip.js +1 -5
- package/dist/RichSelect/RichSelectBox.css +13 -12
- package/dist/RichSelect/RichSelectBox.css.map +1 -1
- package/dist/RichSelect/RichSelectBox.js +3 -3
- package/dist/RichSelect/RichSelectChip.css +13 -1639
- package/dist/RichSelect/RichSelectChip.css.map +1 -1
- package/dist/RichSelect/RichSelectChip.js +2 -6
- package/dist/RichSelect/RichSelectList.css +13 -12
- package/dist/RichSelect/RichSelectList.css.map +1 -1
- package/dist/RichSelect/RichSelectList.js +5 -5
- package/dist/SelectList/SelectList.js +2 -2
- package/dist/TextField/TextField.js +2 -2
- package/dist/__chunks/{KGT647C4.js → 6MC2JC5D.js} +2 -2
- package/dist/__chunks/{EBR6W2V2.js → B5PWI2NT.js} +15 -9
- package/dist/__chunks/B5PWI2NT.js.map +1 -0
- package/dist/__chunks/{YKFF7HLY.js → LEHKWTCB.js} +1 -1
- package/dist/__chunks/{YKFF7HLY.js.map → LEHKWTCB.js.map} +1 -1
- package/dist/__chunks/{XTV66LZO.js → LUK43ZOB.js} +2 -2
- package/dist/__chunks/{3YNFOT4M.js → NAKEUWBD.js} +4 -4
- package/dist/__chunks/{X42H56XS.js → R6OBV53M.js} +2 -2
- package/dist/__chunks/{IRAGZBOB.js → SW7VXIHS.js} +27 -4
- package/dist/__chunks/SW7VXIHS.js.map +1 -0
- package/dist/__chunks/{I4QZMNNL.js → UUEKFWQM.js} +2 -2
- package/dist/index.css +13 -12
- package/dist/index.css.map +1 -1
- package/dist/index.js +8 -8
- package/package.json +3 -3
- package/dist/__chunks/EBR6W2V2.js.map +0 -1
- package/dist/__chunks/IRAGZBOB.js.map +0 -1
- /package/dist/__chunks/{KGT647C4.js.map → 6MC2JC5D.js.map} +0 -0
- /package/dist/__chunks/{XTV66LZO.js.map → LUK43ZOB.js.map} +0 -0
- /package/dist/__chunks/{3YNFOT4M.js.map → NAKEUWBD.js.map} +0 -0
- /package/dist/__chunks/{X42H56XS.js.map → R6OBV53M.js.map} +0 -0
- /package/dist/__chunks/{I4QZMNNL.js.map → UUEKFWQM.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
Chip_default
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./B5PWI2NT.js";
|
|
5
5
|
import {
|
|
6
6
|
RichSelectItem_default
|
|
7
7
|
} from "./ODMJANSX.js";
|
|
@@ -31,4 +31,4 @@ var RichSelectChip_default = forwardRef(
|
|
|
31
31
|
export {
|
|
32
32
|
RichSelectChip_default
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=
|
|
34
|
+
//# sourceMappingURL=LUK43ZOB.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
RichSelectBoxContext,
|
|
4
4
|
RichSelectBox_default,
|
|
5
5
|
convertSelection
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./R6OBV53M.js";
|
|
7
7
|
import {
|
|
8
8
|
Popover_default
|
|
9
9
|
} from "./STXMQR3I.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
ColorBaseDestructive700,
|
|
15
15
|
ColorBaseGray700,
|
|
16
16
|
ColorCambioWhite100
|
|
17
|
-
} from "./
|
|
17
|
+
} from "./LEHKWTCB.js";
|
|
18
18
|
import {
|
|
19
19
|
RichSelectSection_default
|
|
20
20
|
} from "./Y53Z25OG.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./N7G37EKF.js";
|
|
24
24
|
import {
|
|
25
25
|
RichSelectChip_default
|
|
26
|
-
} from "./
|
|
26
|
+
} from "./LUK43ZOB.js";
|
|
27
27
|
import {
|
|
28
28
|
TapArea_default
|
|
29
29
|
} from "./OXEXFQAN.js";
|
|
@@ -289,4 +289,4 @@ var RichSelectList_default = Object.assign(RichSelectList, {
|
|
|
289
289
|
export {
|
|
290
290
|
RichSelectList_default
|
|
291
291
|
};
|
|
292
|
-
//# sourceMappingURL=
|
|
292
|
+
//# sourceMappingURL=NAKEUWBD.js.map
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./N7G37EKF.js";
|
|
17
17
|
import {
|
|
18
18
|
RichSelectChip_default
|
|
19
|
-
} from "./
|
|
19
|
+
} from "./LUK43ZOB.js";
|
|
20
20
|
import {
|
|
21
21
|
RichSelectItemContext,
|
|
22
22
|
RichSelect_module_default
|
|
@@ -208,4 +208,4 @@ export {
|
|
|
208
208
|
RichSelectBoxContext,
|
|
209
209
|
RichSelectBox_default
|
|
210
210
|
};
|
|
211
|
-
//# sourceMappingURL=
|
|
211
|
+
//# sourceMappingURL=R6OBV53M.js.map
|
|
@@ -23,12 +23,32 @@ var textColorForBackgroundColor = (color) => {
|
|
|
23
23
|
case "pink":
|
|
24
24
|
case "lilac":
|
|
25
25
|
case "cream":
|
|
26
|
+
case "silver":
|
|
26
27
|
case "yellow700":
|
|
27
28
|
return "gray900";
|
|
28
29
|
default:
|
|
29
30
|
return "white";
|
|
30
31
|
}
|
|
31
32
|
};
|
|
33
|
+
var backgroundColorForColor = (color) => {
|
|
34
|
+
switch (color) {
|
|
35
|
+
case "silver":
|
|
36
|
+
return void 0;
|
|
37
|
+
default:
|
|
38
|
+
return color;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var inlineStylesForColor = (color) => {
|
|
42
|
+
switch (color) {
|
|
43
|
+
case "silver":
|
|
44
|
+
return {
|
|
45
|
+
background: "linear-gradient(85deg, #CECECE -8.89%, #EEECEC 38.35%, #FFF 49.64%, #E9E8E8 66.22%) padding-box, linear-gradient(83.45deg, #A9A9A9 2.57%, #E5E2E2 61.77%, #6E6E6E 100.3%) border-box",
|
|
46
|
+
border: "1px solid transparent"
|
|
47
|
+
};
|
|
48
|
+
default:
|
|
49
|
+
return {};
|
|
50
|
+
}
|
|
51
|
+
};
|
|
32
52
|
var Badge = ({
|
|
33
53
|
icon: Icon,
|
|
34
54
|
text,
|
|
@@ -41,14 +61,17 @@ var Badge = ({
|
|
|
41
61
|
paddingX: 2,
|
|
42
62
|
paddingY: 1,
|
|
43
63
|
rounding: "sm",
|
|
44
|
-
backgroundColor: color,
|
|
64
|
+
backgroundColor: backgroundColorForColor(color),
|
|
45
65
|
alignItems: "center",
|
|
46
66
|
justifyContent: "center",
|
|
47
67
|
minHeight: 24,
|
|
68
|
+
dangerouslySetInlineStyle: {
|
|
69
|
+
__style: inlineStylesForColor(color)
|
|
70
|
+
},
|
|
48
71
|
children: /* @__PURE__ */ jsx(
|
|
49
72
|
Typography_default,
|
|
50
73
|
{
|
|
51
|
-
size:
|
|
74
|
+
size: 0,
|
|
52
75
|
weight: "medium",
|
|
53
76
|
color: textColorForBackgroundColor(color),
|
|
54
77
|
children: /* @__PURE__ */ jsxs(Box_default, { display: "flex", gap: 1, alignItems: "center", justifyContent: "start", children: [
|
|
@@ -57,7 +80,7 @@ var Badge = ({
|
|
|
57
80
|
Typography_default,
|
|
58
81
|
{
|
|
59
82
|
color: textColorForBackgroundColor(color),
|
|
60
|
-
size:
|
|
83
|
+
size: 0,
|
|
61
84
|
weight: "medium",
|
|
62
85
|
transform: "uppercase",
|
|
63
86
|
children: text
|
|
@@ -74,4 +97,4 @@ var Badge_default = Badge;
|
|
|
74
97
|
export {
|
|
75
98
|
Badge_default
|
|
76
99
|
};
|
|
77
|
-
//# sourceMappingURL=
|
|
100
|
+
//# sourceMappingURL=SW7VXIHS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["css-module:./Badge.module.css#css-module","../../src/Badge/Badge.tsx"],"sourcesContent":["import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Badge/Badge.module.css\"; export default {\"icon\":\"_icon_1g9xb_1\"}","import { type ComponentProps } from \"react\";\nimport Typography from \"../Typography/Typography\";\nimport Box from \"../Box/Box\";\nimport styles from \"./Badge.module.css\";\nimport type InternalIcon from \"../Icon/Icon\";\n\nconst badgeColor = [\n \"sky\",\n \"success300\",\n \"destructive300\",\n \"orange\",\n \"tan\",\n \"gray370\",\n \"gray870\",\n \"lilac\",\n \"thistle\",\n \"pink\",\n \"cream\",\n \"yellow700\",\n \"silver\",\n] as const;\n\ntype BadgeColor = (typeof badgeColor)[number];\n\nconst textColorForBackgroundColor = (\n color: BadgeColor,\n): \"gray900\" | \"white\" => {\n switch (color) {\n case \"gray370\":\n case \"destructive300\":\n case \"orange\":\n case \"tan\":\n case \"success300\":\n case \"sky\":\n case \"thistle\":\n case \"pink\":\n case \"lilac\":\n case \"cream\":\n case \"silver\":\n case \"yellow700\":\n return \"gray900\";\n default:\n return \"white\";\n }\n};\n\nconst backgroundColorForColor = (\n color: BadgeColor,\n): Exclude<BadgeColor, \"silver\"> | undefined => {\n switch (color) {\n case \"silver\":\n return undefined;\n default:\n return color;\n }\n};\n\nconst inlineStylesForColor = (\n color: BadgeColor,\n): Record<string, string | number | null> => {\n switch (color) {\n case \"silver\":\n return {\n background:\n \"linear-gradient(85deg, #CECECE -8.89%, #EEECEC 38.35%, #FFF 49.64%, #E9E8E8 66.22%) padding-box, \\\n linear-gradient(83.45deg, #A9A9A9 2.57%, #E5E2E2 61.77%, #6E6E6E 100.3%) border-box\",\n border: \"1px solid transparent\",\n };\n default:\n return {};\n }\n};\n\n/**\n * [Badge](https://cambly-syntax.vercel.app/?path=/docs/components-badge--docs) is a component to display short text and give additional context to features and other components.\n */\nconst Badge = ({\n icon: Icon,\n text,\n color = \"sky\",\n}: {\n /**\n * The icon to be displayed. Please use a [Material Icon](https://material.io/resources/icons/)\n */\n icon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * The text to display inside the badge\n */\n text: string;\n /**\n * The color of the badge\n *\n * @defaultValue \"sky\"\n */\n color?: (typeof badgeColor)[number];\n}): JSX.Element => {\n return (\n <Box\n display=\"inlineFlex\"\n paddingX={2}\n paddingY={1}\n rounding={\"sm\"}\n backgroundColor={backgroundColorForColor(color)}\n alignItems=\"center\"\n justifyContent=\"center\"\n minHeight={24}\n dangerouslySetInlineStyle={{\n __style: inlineStylesForColor(color),\n }}\n >\n <Typography\n size={0}\n weight=\"medium\"\n color={textColorForBackgroundColor(color)}\n >\n <Box display=\"flex\" gap={1} alignItems=\"center\" justifyContent=\"start\">\n {Icon && <Icon className={styles.icon} size={100} />}\n <Typography\n color={textColorForBackgroundColor(color)}\n size={0}\n weight=\"medium\"\n transform=\"uppercase\"\n >\n {text}\n </Typography>\n </Box>\n </Typography>\n </Box>\n );\n};\n\nexport default Badge;\n"],"mappings":";;;;;;;;;AAA0F,IAAO,uBAAQ,EAAC,QAAO,gBAAe;;;ACqHxH,SACW,KADX;AA7FR,IAAM,8BAA8B,CAClC,UACwB;AACxB,UAAQ,OAAO;AAAA,IACb,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAEA,IAAM,0BAA0B,CAC9B,UAC8C;AAC9C,UAAQ,OAAO;AAAA,IACb,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAEA,IAAM,uBAAuB,CAC3B,UAC2C;AAC3C,UAAQ,OAAO;AAAA,IACb,KAAK;AACH,aAAO;AAAA,QACL,YACE;AAAA,QAEF,QAAQ;AAAA,MACV;AAAA,IACF;AACE,aAAO,CAAC;AAAA,EACZ;AACF;AAKA,IAAM,QAAQ,CAAC;AAAA,EACb,MAAM;AAAA,EACN;AAAA,EACA,QAAQ;AACV,MAiBmB;AACjB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,UAAU;AAAA,MACV,UAAU;AAAA,MACV,UAAU;AAAA,MACV,iBAAiB,wBAAwB,KAAK;AAAA,MAC9C,YAAW;AAAA,MACX,gBAAe;AAAA,MACf,WAAW;AAAA,MACX,2BAA2B;AAAA,QACzB,SAAS,qBAAqB,KAAK;AAAA,MACrC;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,QAAO;AAAA,UACP,OAAO,4BAA4B,KAAK;AAAA,UAExC,+BAAC,eAAI,SAAQ,QAAO,KAAK,GAAG,YAAW,UAAS,gBAAe,SAC5D;AAAA,oBAAQ,oBAAC,QAAK,WAAW,qBAAO,MAAM,MAAM,KAAK;AAAA,YAClD;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO,4BAA4B,KAAK;AAAA,gBACxC,MAAM;AAAA,gBACN,QAAO;AAAA,gBACP,WAAU;AAAA,gBAET;AAAA;AAAA,YACH;AAAA,aACF;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,gBAAQ;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
Badge_default
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./SW7VXIHS.js";
|
|
5
5
|
import {
|
|
6
6
|
Box_default
|
|
7
7
|
} from "./X552U42S.js";
|
|
@@ -118,4 +118,4 @@ function TextField({
|
|
|
118
118
|
export {
|
|
119
119
|
TextField
|
|
120
120
|
};
|
|
121
|
-
//# sourceMappingURL=
|
|
121
|
+
//# sourceMappingURL=UUEKFWQM.js.map
|
package/dist/index.css
CHANGED
|
@@ -2660,51 +2660,52 @@
|
|
|
2660
2660
|
}
|
|
2661
2661
|
|
|
2662
2662
|
/* css-module:/home/runner/work/syntax/syntax/packages/syntax-core/src/Chip/Chip.module.css/#css-module-data */
|
|
2663
|
-
.
|
|
2663
|
+
._chip_ime1m_1 {
|
|
2664
2664
|
border: none;
|
|
2665
2665
|
border-radius: 8px;
|
|
2666
2666
|
display: flex;
|
|
2667
|
+
gap: 4px;
|
|
2667
2668
|
align-items: center;
|
|
2668
2669
|
justify-content: center;
|
|
2669
2670
|
text-align: center;
|
|
2670
2671
|
cursor: pointer;
|
|
2671
2672
|
box-sizing: border-box;
|
|
2672
2673
|
}
|
|
2673
|
-
.
|
|
2674
|
+
._disabled_ime1m_13 {
|
|
2674
2675
|
filter: opacity(50%);
|
|
2675
2676
|
cursor: auto;
|
|
2676
2677
|
}
|
|
2677
|
-
.
|
|
2678
|
+
._deselectedChip_ime1m_18 {
|
|
2678
2679
|
background-color: var(--color-cambio-gray-370);
|
|
2679
2680
|
}
|
|
2680
|
-
.
|
|
2681
|
+
._deselectedChipOnDarkBackground_ime1m_22 {
|
|
2681
2682
|
background-color: var(--color-cambio-gray-870);
|
|
2682
2683
|
}
|
|
2683
|
-
.
|
|
2684
|
+
._selectedChip_ime1m_26 {
|
|
2684
2685
|
background-color: var(--color-cambio-gray-800);
|
|
2685
2686
|
}
|
|
2686
|
-
.
|
|
2687
|
+
._selectedChipOnDarkBackground_ime1m_30 {
|
|
2687
2688
|
background-color: var(--color-cambio-gray-200);
|
|
2688
2689
|
}
|
|
2689
|
-
.
|
|
2690
|
+
._icon_ime1m_34 {
|
|
2690
2691
|
height: 24px !important;
|
|
2691
2692
|
width: 24px !important;
|
|
2692
2693
|
}
|
|
2693
|
-
.
|
|
2694
|
+
._selectedIcon_ime1m_41 {
|
|
2694
2695
|
color: #fff;
|
|
2695
2696
|
}
|
|
2696
|
-
.
|
|
2697
|
+
._sm_ime1m_45 {
|
|
2697
2698
|
height: 32px;
|
|
2698
2699
|
min-width: 40px;
|
|
2699
2700
|
padding: 8px 12px;
|
|
2700
2701
|
}
|
|
2701
|
-
.
|
|
2702
|
+
._md_ime1m_51 {
|
|
2702
2703
|
height: 48px;
|
|
2703
2704
|
min-width: 56px;
|
|
2704
2705
|
padding: 8px 16px;
|
|
2705
2706
|
}
|
|
2706
|
-
.
|
|
2707
|
-
.
|
|
2707
|
+
._chip_ime1m_1:focus-visible,
|
|
2708
|
+
._forceFocus_ime1m_58 {
|
|
2708
2709
|
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.2) 100%);
|
|
2709
2710
|
box-shadow: 0 0 0 4px #000;
|
|
2710
2711
|
outline: solid 2px #fff;
|