@cambly/syntax-core 18.5.0 → 18.6.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/RichSelect/RichSelectList.cjs +3 -3
- package/dist/RichSelect/RichSelectList.d.ts +5 -0
- package/dist/RichSelect/RichSelectList.js +2 -2
- package/dist/SelectList/SelectList.cjs +3 -3
- package/dist/SelectList/SelectList.js +2 -2
- package/dist/__chunks/{HTCVFULF.js → 4LS53X3H.js} +1 -3
- package/dist/__chunks/{HTCVFULF.js.map → 4LS53X3H.js.map} +1 -1
- package/dist/__chunks/{RUHTSUF3.js → GVDYEBNZ.js} +2 -2
- package/dist/__chunks/GVDYEBNZ.js.map +1 -0
- package/dist/__chunks/{IUSNCMKA.cjs → H3QQNW5X.cjs} +5 -5
- package/dist/__chunks/H3QQNW5X.cjs.map +1 -0
- package/dist/__chunks/{L67MBZZR.cjs → OXSHUPNO.cjs} +2 -4
- package/dist/__chunks/OXSHUPNO.cjs.map +1 -0
- package/dist/__chunks/{UYQTZSTJ.js → PW6JTQVM.js} +28 -9
- package/dist/__chunks/PW6JTQVM.js.map +1 -0
- package/dist/__chunks/{O2K6UM3Z.cjs → XVYUFV22.cjs} +27 -8
- package/dist/__chunks/XVYUFV22.cjs.map +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/__chunks/IUSNCMKA.cjs.map +0 -1
- package/dist/__chunks/L67MBZZR.cjs.map +0 -1
- package/dist/__chunks/O2K6UM3Z.cjs.map +0 -1
- package/dist/__chunks/RUHTSUF3.js.map +0 -1
- package/dist/__chunks/UYQTZSTJ.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _XVYUFV22cjs = require('../__chunks/XVYUFV22.cjs');
|
|
5
5
|
require('../__chunks/C4GAUB4Y.cjs');
|
|
6
6
|
require('../__chunks/RCCK2EW4.cjs');
|
|
7
7
|
require('../__chunks/J27AGJQB.cjs');
|
|
8
8
|
require('../__chunks/YJAKY2I2.cjs');
|
|
9
|
-
require('../__chunks/
|
|
9
|
+
require('../__chunks/OXSHUPNO.cjs');
|
|
10
10
|
require('../__chunks/LIUV3J2M.cjs');
|
|
11
11
|
require('../__chunks/TSMYMWWE.cjs');
|
|
12
12
|
require('../__chunks/42SRFCQL.cjs');
|
|
@@ -46,5 +46,5 @@ require('../__chunks/E5P6WRJD.cjs');
|
|
|
46
46
|
require('../__chunks/X2SDR4SD.cjs');
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
exports.default =
|
|
49
|
+
exports.default = _XVYUFV22cjs.RichSelectList_default;
|
|
50
50
|
//# sourceMappingURL=RichSelectList.cjs.map
|
|
@@ -34,6 +34,11 @@ type RichSelectListProps = RichSelectBoxProps & {
|
|
|
34
34
|
placeholderText?: string;
|
|
35
35
|
/** Use to render (override) text shown in the select box */
|
|
36
36
|
selectTextValue?: (selectedValues?: "all" | string[]) => string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Color of the select box
|
|
39
|
+
* @defaultValue white
|
|
40
|
+
*/
|
|
41
|
+
color?: "white" | "clear";
|
|
37
42
|
};
|
|
38
43
|
/**
|
|
39
44
|
* [RichSelectList](https://cambly-syntax.vercel.app/?path=/docs/components-richselectlist--docs) is a dropdown menu that allows users to select one or multiple options from a list.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
RichSelectList_default
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/PW6JTQVM.js";
|
|
5
5
|
import "../__chunks/SNLD3DG6.js";
|
|
6
6
|
import "../__chunks/BLW57GRR.js";
|
|
7
7
|
import "../__chunks/5HEC7ASW.js";
|
|
8
8
|
import "../__chunks/MZOGVH4K.js";
|
|
9
|
-
import "../__chunks/
|
|
9
|
+
import "../__chunks/4LS53X3H.js";
|
|
10
10
|
import "../__chunks/TU2BVOKD.js";
|
|
11
11
|
import "../__chunks/BTBAAACD.js";
|
|
12
12
|
import "../__chunks/YAZOHZLW.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
4
|
+
var _H3QQNW5Xcjs = require('../__chunks/H3QQNW5X.cjs');
|
|
5
|
+
require('../__chunks/OXSHUPNO.cjs');
|
|
6
6
|
require('../__chunks/XLUVINJW.cjs');
|
|
7
7
|
require('../__chunks/KJLBDAZH.cjs');
|
|
8
8
|
require('../__chunks/JVGX637E.cjs');
|
|
@@ -18,5 +18,5 @@ require('../__chunks/NOELZTQX.cjs');
|
|
|
18
18
|
require('../__chunks/X2SDR4SD.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
exports.default =
|
|
21
|
+
exports.default = _H3QQNW5Xcjs.SelectList;
|
|
22
22
|
//# sourceMappingURL=SelectList.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
SelectList
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/GVDYEBNZ.js";
|
|
5
|
+
import "../__chunks/4LS53X3H.js";
|
|
6
6
|
import "../__chunks/KKADUD65.js";
|
|
7
7
|
import "../__chunks/65PMWIHY.js";
|
|
8
8
|
import "../__chunks/SPQ7DQHG.js";
|
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
// ../syntax-design-tokens/dist/js/index.js
|
|
4
4
|
var ColorBaseDestructive700 = "#d32a4b";
|
|
5
5
|
var ColorBaseGray700 = "#767676";
|
|
6
|
-
var ColorBaseGray800 = "#353535";
|
|
7
6
|
var ColorCambioWhite100 = "#ffffff";
|
|
8
7
|
|
|
9
8
|
export {
|
|
10
9
|
ColorBaseDestructive700,
|
|
11
10
|
ColorBaseGray700,
|
|
12
|
-
ColorBaseGray800,
|
|
13
11
|
ColorCambioWhite100
|
|
14
12
|
};
|
|
15
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=4LS53X3H.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on
|
|
1
|
+
{"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Mon, 22 Jul 2024 18:10:39 GMT\n */\n\nexport const ColorBaseBlack = \"#000000\";\nexport const ColorBaseDestructive100 = \"#fef3f5\";\nexport const ColorBaseDestructive200 = \"#fad6de\";\nexport const ColorBaseDestructive300 = \"#f2a2b2\";\nexport const ColorBaseDestructive700 = \"#d32a4b\";\nexport const ColorBaseDestructive800 = \"#81162c\";\nexport const ColorBaseDestructive900 = \"#55101d\";\nexport const ColorBaseGray10 = \"#cbcbcb\"; // Used as the default color for dividers and inner strokes\nexport const ColorBaseGray30 = \"#000000\"; // For IconButton background when on top of an image\nexport const ColorBaseGray60 = \"#000000\"; // Used for icon background in classroom video grid\nexport const ColorBaseGray80 = \"#000000\"; // Used as the background for modals\nexport const ColorBaseGray100 = \"#f7f7f7\";\nexport const ColorBaseGray200 = \"#f0f0f0\"; // Used for light mode backgrounds when showing card content on top\nexport const ColorBaseGray300 = \"#d0d0d0\"; // Used for component outlines, eg: select and textfield\nexport const ColorBaseGray700 = \"#767676\"; // For secondary text in light mode\nexport const ColorBaseGray800 = \"#353535\";\nexport const ColorBaseGray900 = \"#191919\"; // Default text color, Classroom background\nexport const ColorBaseOrange100 = \"#fdf2f0\";\nexport const ColorBaseOrange200 = \"#f6cdc4\";\nexport const ColorBaseOrange300 = \"#ec9987\";\nexport const ColorBaseOrange700 = \"#c34124\";\nexport const ColorBaseOrange800 = \"#732818\";\nexport const ColorBaseOrange900 = \"#4d1a10\";\nexport const ColorBasePrimary100 = \"#eff6fa\";\nexport const ColorBasePrimary200 = \"#c1dbe7\";\nexport const ColorBasePrimary300 = \"#84b7d0\";\nexport const ColorBasePrimary700 = \"#236482\";\nexport const ColorBasePrimary800 = \"#274858\";\nexport const ColorBasePrimary900 = \"#1b303b\";\nexport const ColorBaseSuccess100 = \"#eff7f1\";\nexport const ColorBaseSuccess200 = \"#bddcc6\";\nexport const ColorBaseSuccess300 = \"#81ba92\";\nexport const ColorBaseSuccess700 = \"#397b4d\";\nexport const ColorBaseSuccess800 = \"#2d4936\";\nexport const ColorBaseSuccess900 = \"#1e3124\";\nexport const ColorBasePurple100 = \"#f9f5fa\";\nexport const ColorBasePurple200 = \"#e8dceb\";\nexport const ColorBasePurple300 = \"#cdb4d3\";\nexport const ColorBasePurple700 = \"#8b5f95\";\nexport const ColorBasePurple800 = \"#523b58\";\nexport const ColorBasePurple900 = \"#37273b\";\nexport const ColorBaseYellow100 = \"#fdf5d9\";\nexport const ColorBaseYellow200 = \"#fbe8a3\";\nexport const ColorBaseYellow300 = \"#f8d663\";\nexport const ColorBaseYellow700 = \"#ffc929\";\nexport const ColorBaseYellow800 = \"#765f1c\";\nexport const ColorBaseYellow900 = \"#3b3009\";\nexport const ColorBaseWhite = \"#ffffff\";\nexport const ColorCambioBlack = \"#050500\";\nexport const ColorCambioWhite40 = \"#ffffff\";\nexport const ColorCambioWhite70 = \"#ffffff\";\nexport const ColorCambioWhite100 = \"#ffffff\";\nexport const ColorCambioGray100 = \"#faf4eb\";\nexport const ColorCambioGray200 = \"#e4dbd3\";\nexport const ColorCambioGray270 = \"#e4dbd3\";\nexport const ColorCambioGray300 = \"#beb4ab\";\nexport const ColorCambioGray370 = \"#beb4ab\";\nexport const ColorCambioGray700 = \"#5e5952\";\nexport const ColorCambioGray800 = \"#363432\";\nexport const ColorCambioGray870 = \"#5e5952\";\nexport const ColorCambioGray900 = \"#262625\";\nexport const ColorCambioDestructive100 = \"#ffdeda\";\nexport const ColorCambioDestructive300 = \"#ff8071\";\nexport const ColorCambioDestructive370 = \"#ff8071\";\nexport const ColorCambioDestructive700 = \"#c93f32\";\nexport const ColorCambioDestructive770 = \"#c93f32\";\nexport const ColorCambioDestructive900 = \"#6d0002\";\nexport const ColorCambioSuccess100 = \"#daf2c8\";\nexport const ColorCambioSuccess300 = \"#84ce64\";\nexport const ColorCambioSuccess370 = \"#84ce64\";\nexport const ColorCambioSuccess700 = \"#3c7f20\";\nexport const ColorCambioSuccess770 = \"#3c7f20\";\nexport const ColorCambioSuccess900 = \"#103e00\";\nexport const ColorCambioRed = \"#f56e56\";\nexport const ColorCambioOrange = \"#ff8f57\";\nexport const ColorCambioTan = \"#ffb47d\";\nexport const ColorCambioCream = \"#fffad1\";\nexport const ColorCambioPurple = \"#6840a8\";\nexport const ColorCambioLilac = \"#b59ef0\";\nexport const ColorCambioThistle = \"#d69ca4\";\nexport const ColorCambioPink = \"#ffccea\";\nexport const ColorCambioNavy = \"#191142\";\nexport const ColorCambioTeal = \"#44a6cf\";\nexport const ColorCambioSlate = \"#7c9fc6\";\nexport const ColorCambioSky = \"#b1e8fc\";\nexport const ColorCambioYellow700 = \"#ffe733\";\nexport const ColorCambioTransparentFull = \"#000000\";\nexport const Elevation400 = \"0px 16px 32px 0px #00000040\";\nexport const SyntaxFontSansSerif = \"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif\";\nexport const ShadowInteractive = \"0px 3px 16px 0px rgba(144, 134, 130, 0.05), 0px 2px 30px 0px rgba(144, 134, 130, 0.02)\";\n"],"mappings":";;;AASO,IAAM,0BAA0B;AAUhC,IAAM,mBAAmB;AAqCzB,IAAM,sBAAsB;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ColorBaseDestructive700,
|
|
4
4
|
ColorBaseGray700,
|
|
5
5
|
ColorCambioWhite100
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./4LS53X3H.js";
|
|
7
7
|
import {
|
|
8
8
|
Focus_module_default
|
|
9
9
|
} from "./KKADUD65.js";
|
|
@@ -148,4 +148,4 @@ SelectList.Option = SelectOption_default;
|
|
|
148
148
|
export {
|
|
149
149
|
SelectList
|
|
150
150
|
};
|
|
151
|
-
//# sourceMappingURL=
|
|
151
|
+
//# sourceMappingURL=GVDYEBNZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/SelectList/SelectList.tsx","css-module:./SelectList.module.css#css-module"],"sourcesContent":["import React, {\n type ReactElement,\n type ReactNode,\n useId,\n useState,\n} from \"react\";\nimport Box from \"../Box/Box\";\nimport classNames from \"classnames\";\nimport {\n ColorBaseDestructive700,\n ColorBaseGray700,\n ColorCambioWhite100,\n} from \"@cambly/syntax-design-tokens\";\nimport Typography from \"../Typography/Typography\";\nimport styles from \"./SelectList.module.css\";\nimport focusStyles from \"../Focus.module.css\";\nimport SelectOption from \"./SelectOption\";\nimport useFocusVisible from \"../useFocusVisible\";\nimport useIsHydrated from \"../useIsHydrated\";\n\n/**\n * [SelectList](https://cambly-syntax.vercel.app/?path=/docs/components-selectlist--docs) is a dropdown menu that allows users to select one option from a list.\n */\nexport default function SelectList({\n children,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n errorText,\n helperText,\n id,\n label,\n onChange,\n onClick,\n placeholderText,\n selectedValue = \"\",\n color = \"white\",\n}: {\n /**\n * One or more SelectList.Option components.\n */\n children: ReactNode;\n /**\n * Test id for the select element\n */\n \"data-testid\"?: string;\n /**\n * true if the select dropdown is disabled\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Callback to be called when select is clicked\n */\n onClick?: (event: React.SyntheticEvent<HTMLSelectElement>) => void;\n /**\n * Text shown below select box if there is an input error.\n */\n errorText?: string;\n /**\n * Text shown below select box\n */\n helperText?: string;\n /**\n * Id of the select element\n */\n id?: string;\n /**\n * Text shown above select box\n */\n label: string;\n /**\n * The callback to be called when an option is selected\n */\n onChange: React.ChangeEventHandler<HTMLSelectElement>;\n /**\n * Text showing in select box if no option has been chosen.\n * We should always have a placeholder unless there is a default option selected\n */\n placeholderText?: string;\n /**\n * Value of the currently selected option\n */\n selectedValue?: string;\n /**\n * Color of the select box\n * @defaultValue white\n */\n color?: \"white\" | \"clear\";\n}): ReactElement {\n const reactId = useId();\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n const selectId = id ?? reactId;\n const { isFocusVisible } = useFocusVisible();\n const [isFocused, setIsFocused] = useState(false);\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLSelectElement> = (\n event,\n ) => {\n if (disabled || onClick == null) return;\n if (event.key === \"Enter\" || event.key === \" \" || event.key === \"Space\") {\n onClick(event);\n }\n };\n\n const textColor = {\n white: \"gray700\",\n clear: \"white\",\n } as const;\n\n const getArrowIconColor = () => {\n if (errorText) {\n return ColorBaseDestructive700;\n } else {\n if (color === \"clear\") {\n return ColorCambioWhite100;\n } else {\n return ColorBaseGray700;\n }\n }\n };\n\n return (\n <div\n className={classNames(styles.selectContainer, {\n [styles.opacityOverlay]: disabled,\n })}\n >\n {label && (\n <label htmlFor={selectId}>\n <Box paddingX={1}>\n <Typography size={100} color={textColor[color]}>\n {label}\n </Typography>\n </Box>\n </label>\n )}\n <div className={styles.selectWrapper}>\n <select\n id={selectId}\n data-testid={dataTestId}\n disabled={disabled}\n className={classNames(styles.selectBox, styles.selectBoxCambio, {\n [styles.unselected]: !selectedValue && !errorText,\n [styles.selected]: selectedValue && !errorText,\n [styles.selectErrorCambio]: errorText,\n [focusStyles.accessibilityOutlineFocus]:\n isFocused && isFocusVisible, // for focus keyboard\n [styles.selectMouseFocusStyling]: isFocused && !isFocusVisible, // for focus mouse\n [styles[`selectColor${color}`]]: color,\n })}\n onChange={onChange}\n onClick={onClick}\n onKeyDown={handleKeyDown}\n value={\n placeholderText && !selectedValue ? placeholderText : selectedValue\n }\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n >\n {placeholderText && (\n <option disabled value={placeholderText}>\n {placeholderText}\n </option>\n )}\n {children}\n </select>\n <div className={styles.arrowIcon}>\n <svg\n focusable=\"false\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width={24}\n >\n <path\n fill={getArrowIconColor()}\n d=\"M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z\"\n />\n </svg>\n </div>\n </div>\n {(helperText || errorText) && (\n <Box paddingX={1}>\n <Typography\n size={100}\n color={errorText ? \"destructive-primary\" : textColor[color]}\n >\n {errorText ? errorText : helperText}\n </Typography>\n </Box>\n )}\n </div>\n );\n}\n\nSelectList.Option = SelectOption;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/SelectList/SelectList.module.css\"; export default {\"selectContainer\":\"_selectContainer_1g9ap_1\",\"opacityOverlay\":\"_opacityOverlay_1g9ap_7\",\"selectWrapper\":\"_selectWrapper_1g9ap_11\",\"selectBox\":\"_selectBox_1g9ap_16\",\"selectBoxCambio\":\"_selectBoxCambio_1g9ap_30\",\"selectMouseFocusStyling\":\"_selectMouseFocusStyling_1g9ap_38\",\"unselected\":\"_unselected_1g9ap_43\",\"selected\":\"_selected_1g9ap_47\",\"arrowIcon\":\"_arrowIcon_1g9ap_51\",\"selectErrorCambio\":\"_selectErrorCambio_1g9ap_65\",\"selectColorwhite\":\"_selectColorwhite_1g9ap_71\",\"selectColorclear\":\"_selectColorclear_1g9ap_77\"}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AAEP,OAAO,gBAAgB;;;ACP6E,IAAO,4BAAQ,EAAC,mBAAkB,4BAA2B,kBAAiB,2BAA0B,iBAAgB,2BAA0B,aAAY,uBAAsB,mB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[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _OXSHUPNOcjs = require('./OXSHUPNO.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _XLUVINJWcjs = require('./XLUVINJW.cjs');
|
|
@@ -68,12 +68,12 @@ function SelectList({
|
|
|
68
68
|
};
|
|
69
69
|
const getArrowIconColor = () => {
|
|
70
70
|
if (errorText) {
|
|
71
|
-
return
|
|
71
|
+
return _OXSHUPNOcjs.ColorBaseDestructive700;
|
|
72
72
|
} else {
|
|
73
73
|
if (color === "clear") {
|
|
74
|
-
return
|
|
74
|
+
return _OXSHUPNOcjs.ColorCambioWhite100;
|
|
75
75
|
} else {
|
|
76
|
-
return
|
|
76
|
+
return _OXSHUPNOcjs.ColorBaseGray700;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
};
|
|
@@ -148,4 +148,4 @@ SelectList.Option = _JVGX637Ecjs.SelectOption_default;
|
|
|
148
148
|
|
|
149
149
|
|
|
150
150
|
exports.SelectList = SelectList;
|
|
151
|
-
//# sourceMappingURL=
|
|
151
|
+
//# sourceMappingURL=H3QQNW5X.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/SelectList/SelectList.tsx","css-module:./SelectList.module.css#css-module"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AAEP,OAAO,gBAAgB;;;ACP6E,IAAO,4BAAQ,EAAC,mBAAkB,4BAA2B,kBAAiB,2BAA0B,iBAAgB,2BAA0B,aAAY,uBAAsB,mBAAkB,6BAA4B,2BAA0B,qCAAoC,cAAa,wBAAuB,YAAW,sBAAqB,aAAY,uBAAsB,qBAAoB,+BAA8B,oBAAmB,8BAA6B,oBAAmB,6BAA4B;;;ADmI/mB,cAOJ,YAPI;AA5GG,SAAR,WAA4B;AAAA,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,GAAG,CAAC,iBAAiB,CAAC;AAAA,gBACxC,CAAC,0BAAO,QAAQ,GAAG,iBAAiB,CAAC;AAAA,gBACrC,CAAC,0BAAO,iBAAiB,GAAG;AAAA,gBAC5B,CAAC,qBAAY,yBAAyB,GACpC,aAAa;AAAA;AAAA,gBACf,CAAC,0BAAO,uBAAuB,GAAG,aAAa,CAAC;AAAA;AAAA,gBAChD,CAAC,0BAAO,cAAc,OAAO,CAAC,GAAG;AAAA,cACnC,CAAC;AAAA,cACD;AAAA,cACA;AAAA,cACA,WAAW;AAAA,cACX,OACE,mBAAmB,CAAC,gBAAgB,kBAAkB;AAAA,cAExD,SAAS,MAAM,aAAa,IAAI;AAAA,cAChC,QAAQ,MAAM,aAAa,KAAK;AAAA,cAE/B;AAAA,mCACC,oBAAC,YAAO,UAAQ,MAAC,OAAO,iBACrB,2BACH;AAAA,gBAED;AAAA;AAAA;AAAA,UACH;AAAA,UACA,oBAAC,SAAI,WAAW,0BAAO,WACrB;AAAA,YAAC;AAAA;AAAA,cACC,WAAU;AAAA,cACV,eAAY;AAAA,cACZ,SAAQ;AAAA,cACR,OAAO;AAAA,cAEP;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAM,kBAAkB;AAAA,kBACxB,GAAE;AAAA;AAAA,cACJ;AAAA;AAAA,UACF,GACF;AAAA,WACF;AAAA,SACE,cAAc,cACd,oBAAC,eAAI,UAAU,GACb;AAAA,UAAC;AAAA;AAAA,YACC,MAAM;AAAA,YACN,OAAO,YAAY,wBAAwB,UAAU,KAAK;AAAA,YAEzD,sBAAY,YAAY;AAAA;AAAA,QAC3B,GACF;AAAA;AAAA;AAAA,EAEJ;AAEJ;AAEA,WAAW,SAAS","sourcesContent":["import React, {\n type ReactElement,\n type ReactNode,\n useId,\n useState,\n} from \"react\";\nimport Box from \"../Box/Box\";\nimport classNames from \"classnames\";\nimport {\n ColorBaseDestructive700,\n ColorBaseGray700,\n ColorCambioWhite100,\n} from \"@cambly/syntax-design-tokens\";\nimport Typography from \"../Typography/Typography\";\nimport styles from \"./SelectList.module.css\";\nimport focusStyles from \"../Focus.module.css\";\nimport SelectOption from \"./SelectOption\";\nimport useFocusVisible from \"../useFocusVisible\";\nimport useIsHydrated from \"../useIsHydrated\";\n\n/**\n * [SelectList](https://cambly-syntax.vercel.app/?path=/docs/components-selectlist--docs) is a dropdown menu that allows users to select one option from a list.\n */\nexport default function SelectList({\n children,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n errorText,\n helperText,\n id,\n label,\n onChange,\n onClick,\n placeholderText,\n selectedValue = \"\",\n color = \"white\",\n}: {\n /**\n * One or more SelectList.Option components.\n */\n children: ReactNode;\n /**\n * Test id for the select element\n */\n \"data-testid\"?: string;\n /**\n * true if the select dropdown is disabled\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Callback to be called when select is clicked\n */\n onClick?: (event: React.SyntheticEvent<HTMLSelectElement>) => void;\n /**\n * Text shown below select box if there is an input error.\n */\n errorText?: string;\n /**\n * Text shown below select box\n */\n helperText?: string;\n /**\n * Id of the select element\n */\n id?: string;\n /**\n * Text shown above select box\n */\n label: string;\n /**\n * The callback to be called when an option is selected\n */\n onChange: React.ChangeEventHandler<HTMLSelectElement>;\n /**\n * Text showing in select box if no option has been chosen.\n * We should always have a placeholder unless there is a default option selected\n */\n placeholderText?: string;\n /**\n * Value of the currently selected option\n */\n selectedValue?: string;\n /**\n * Color of the select box\n * @defaultValue white\n */\n color?: \"white\" | \"clear\";\n}): ReactElement {\n const reactId = useId();\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n const selectId = id ?? reactId;\n const { isFocusVisible } = useFocusVisible();\n const [isFocused, setIsFocused] = useState(false);\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLSelectElement> = (\n event,\n ) => {\n if (disabled || onClick == null) return;\n if (event.key === \"Enter\" || event.key === \" \" || event.key === \"Space\") {\n onClick(event);\n }\n };\n\n const textColor = {\n white: \"gray700\",\n clear: \"white\",\n } as const;\n\n const getArrowIconColor = () => {\n if (errorText) {\n return ColorBaseDestructive700;\n } else {\n if (color === \"clear\") {\n return ColorCambioWhite100;\n } else {\n return ColorBaseGray700;\n }\n }\n };\n\n return (\n <div\n className={classNames(styles.selectContainer, {\n [styles.opacityOverlay]: disabled,\n })}\n >\n {label && (\n <label htmlFor={selectId}>\n <Box paddingX={1}>\n <Typography size={100} color={textColor[color]}>\n {label}\n </Typography>\n </Box>\n </label>\n )}\n <div className={styles.selectWrapper}>\n <select\n id={selectId}\n data-testid={dataTestId}\n disabled={disabled}\n className={classNames(styles.selectBox, styles.selectBoxCambio, {\n [styles.unselected]: !selectedValue && !errorText,\n [styles.selected]: selectedValue && !errorText,\n [styles.selectErrorCambio]: errorText,\n [focusStyles.accessibilityOutlineFocus]:\n isFocused && isFocusVisible, // for focus keyboard\n [styles.selectMouseFocusStyling]: isFocused && !isFocusVisible, // for focus mouse\n [styles[`selectColor${color}`]]: color,\n })}\n onChange={onChange}\n onClick={onClick}\n onKeyDown={handleKeyDown}\n value={\n placeholderText && !selectedValue ? placeholderText : selectedValue\n }\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n >\n {placeholderText && (\n <option disabled value={placeholderText}>\n {placeholderText}\n </option>\n )}\n {children}\n </select>\n <div className={styles.arrowIcon}>\n <svg\n focusable=\"false\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width={24}\n >\n <path\n fill={getArrowIconColor()}\n d=\"M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z\"\n />\n </svg>\n </div>\n </div>\n {(helperText || errorText) && (\n <Box paddingX={1}>\n <Typography\n size={100}\n color={errorText ? \"destructive-primary\" : textColor[color]}\n >\n {errorText ? errorText : helperText}\n </Typography>\n </Box>\n )}\n </div>\n );\n}\n\nSelectList.Option = SelectOption;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/SelectList/SelectList.module.css\"; export default {\"selectContainer\":\"_selectContainer_1g9ap_1\",\"opacityOverlay\":\"_opacityOverlay_1g9ap_7\",\"selectWrapper\":\"_selectWrapper_1g9ap_11\",\"selectBox\":\"_selectBox_1g9ap_16\",\"selectBoxCambio\":\"_selectBoxCambio_1g9ap_30\",\"selectMouseFocusStyling\":\"_selectMouseFocusStyling_1g9ap_38\",\"unselected\":\"_unselected_1g9ap_43\",\"selected\":\"_selected_1g9ap_47\",\"arrowIcon\":\"_arrowIcon_1g9ap_51\",\"selectErrorCambio\":\"_selectErrorCambio_1g9ap_65\",\"selectColorwhite\":\"_selectColorwhite_1g9ap_71\",\"selectColorclear\":\"_selectColorclear_1g9ap_77\"}"]}
|
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
// ../syntax-design-tokens/dist/js/index.js
|
|
4
4
|
var ColorBaseDestructive700 = "#d32a4b";
|
|
5
5
|
var ColorBaseGray700 = "#767676";
|
|
6
|
-
var ColorBaseGray800 = "#353535";
|
|
7
6
|
var ColorCambioWhite100 = "#ffffff";
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=L67MBZZR.cjs.map
|
|
12
|
+
exports.ColorBaseDestructive700 = ColorBaseDestructive700; exports.ColorBaseGray700 = ColorBaseGray700; exports.ColorCambioWhite100 = ColorCambioWhite100;
|
|
13
|
+
//# sourceMappingURL=OXSHUPNO.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"names":[],"mappings":";;;AASO,IAAM,0BAA0B;AAUhC,IAAM,mBAAmB;AAqCzB,IAAM,sBAAsB","sourcesContent":["/**\n * Do not edit directly\n * Generated on Mon, 22 Jul 2024 18:10:39 GMT\n */\n\nexport const ColorBaseBlack = \"#000000\";\nexport const ColorBaseDestructive100 = \"#fef3f5\";\nexport const ColorBaseDestructive200 = \"#fad6de\";\nexport const ColorBaseDestructive300 = \"#f2a2b2\";\nexport const ColorBaseDestructive700 = \"#d32a4b\";\nexport const ColorBaseDestructive800 = \"#81162c\";\nexport const ColorBaseDestructive900 = \"#55101d\";\nexport const ColorBaseGray10 = \"#cbcbcb\"; // Used as the default color for dividers and inner strokes\nexport const ColorBaseGray30 = \"#000000\"; // For IconButton background when on top of an image\nexport const ColorBaseGray60 = \"#000000\"; // Used for icon background in classroom video grid\nexport const ColorBaseGray80 = \"#000000\"; // Used as the background for modals\nexport const ColorBaseGray100 = \"#f7f7f7\";\nexport const ColorBaseGray200 = \"#f0f0f0\"; // Used for light mode backgrounds when showing card content on top\nexport const ColorBaseGray300 = \"#d0d0d0\"; // Used for component outlines, eg: select and textfield\nexport const ColorBaseGray700 = \"#767676\"; // For secondary text in light mode\nexport const ColorBaseGray800 = \"#353535\";\nexport const ColorBaseGray900 = \"#191919\"; // Default text color, Classroom background\nexport const ColorBaseOrange100 = \"#fdf2f0\";\nexport const ColorBaseOrange200 = \"#f6cdc4\";\nexport const ColorBaseOrange300 = \"#ec9987\";\nexport const ColorBaseOrange700 = \"#c34124\";\nexport const ColorBaseOrange800 = \"#732818\";\nexport const ColorBaseOrange900 = \"#4d1a10\";\nexport const ColorBasePrimary100 = \"#eff6fa\";\nexport const ColorBasePrimary200 = \"#c1dbe7\";\nexport const ColorBasePrimary300 = \"#84b7d0\";\nexport const ColorBasePrimary700 = \"#236482\";\nexport const ColorBasePrimary800 = \"#274858\";\nexport const ColorBasePrimary900 = \"#1b303b\";\nexport const ColorBaseSuccess100 = \"#eff7f1\";\nexport const ColorBaseSuccess200 = \"#bddcc6\";\nexport const ColorBaseSuccess300 = \"#81ba92\";\nexport const ColorBaseSuccess700 = \"#397b4d\";\nexport const ColorBaseSuccess800 = \"#2d4936\";\nexport const ColorBaseSuccess900 = \"#1e3124\";\nexport const ColorBasePurple100 = \"#f9f5fa\";\nexport const ColorBasePurple200 = \"#e8dceb\";\nexport const ColorBasePurple300 = \"#cdb4d3\";\nexport const ColorBasePurple700 = \"#8b5f95\";\nexport const ColorBasePurple800 = \"#523b58\";\nexport const ColorBasePurple900 = \"#37273b\";\nexport const ColorBaseYellow100 = \"#fdf5d9\";\nexport const ColorBaseYellow200 = \"#fbe8a3\";\nexport const ColorBaseYellow300 = \"#f8d663\";\nexport const ColorBaseYellow700 = \"#ffc929\";\nexport const ColorBaseYellow800 = \"#765f1c\";\nexport const ColorBaseYellow900 = \"#3b3009\";\nexport const ColorBaseWhite = \"#ffffff\";\nexport const ColorCambioBlack = \"#050500\";\nexport const ColorCambioWhite40 = \"#ffffff\";\nexport const ColorCambioWhite70 = \"#ffffff\";\nexport const ColorCambioWhite100 = \"#ffffff\";\nexport const ColorCambioGray100 = \"#faf4eb\";\nexport const ColorCambioGray200 = \"#e4dbd3\";\nexport const ColorCambioGray270 = \"#e4dbd3\";\nexport const ColorCambioGray300 = \"#beb4ab\";\nexport const ColorCambioGray370 = \"#beb4ab\";\nexport const ColorCambioGray700 = \"#5e5952\";\nexport const ColorCambioGray800 = \"#363432\";\nexport const ColorCambioGray870 = \"#5e5952\";\nexport const ColorCambioGray900 = \"#262625\";\nexport const ColorCambioDestructive100 = \"#ffdeda\";\nexport const ColorCambioDestructive300 = \"#ff8071\";\nexport const ColorCambioDestructive370 = \"#ff8071\";\nexport const ColorCambioDestructive700 = \"#c93f32\";\nexport const ColorCambioDestructive770 = \"#c93f32\";\nexport const ColorCambioDestructive900 = \"#6d0002\";\nexport const ColorCambioSuccess100 = \"#daf2c8\";\nexport const ColorCambioSuccess300 = \"#84ce64\";\nexport const ColorCambioSuccess370 = \"#84ce64\";\nexport const ColorCambioSuccess700 = \"#3c7f20\";\nexport const ColorCambioSuccess770 = \"#3c7f20\";\nexport const ColorCambioSuccess900 = \"#103e00\";\nexport const ColorCambioRed = \"#f56e56\";\nexport const ColorCambioOrange = \"#ff8f57\";\nexport const ColorCambioTan = \"#ffb47d\";\nexport const ColorCambioCream = \"#fffad1\";\nexport const ColorCambioPurple = \"#6840a8\";\nexport const ColorCambioLilac = \"#b59ef0\";\nexport const ColorCambioThistle = \"#d69ca4\";\nexport const ColorCambioPink = \"#ffccea\";\nexport const ColorCambioNavy = \"#191142\";\nexport const ColorCambioTeal = \"#44a6cf\";\nexport const ColorCambioSlate = \"#7c9fc6\";\nexport const ColorCambioSky = \"#b1e8fc\";\nexport const ColorCambioYellow700 = \"#ffe733\";\nexport const ColorCambioTransparentFull = \"#000000\";\nexport const Elevation400 = \"0px 16px 32px 0px #00000040\";\nexport const SyntaxFontSansSerif = \"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif\";\nexport const ShadowInteractive = \"0px 3px 16px 0px rgba(144, 134, 130, 0.05), 0px 2px 30px 0px rgba(144, 134, 130, 0.02)\";\n"]}
|
|
@@ -7,8 +7,9 @@ import {
|
|
|
7
7
|
} from "./5HEC7ASW.js";
|
|
8
8
|
import {
|
|
9
9
|
ColorBaseDestructive700,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
ColorBaseGray700,
|
|
11
|
+
ColorCambioWhite100
|
|
12
|
+
} from "./4LS53X3H.js";
|
|
12
13
|
import {
|
|
13
14
|
RichSelectBoxContext,
|
|
14
15
|
RichSelectBox_default,
|
|
@@ -77,7 +78,8 @@ function RichSelectList(props) {
|
|
|
77
78
|
placeholderText,
|
|
78
79
|
selectTextValue,
|
|
79
80
|
selectedValues: selectedValuesProp,
|
|
80
|
-
defaultSelectedValues: defaultSelectedValuesProp
|
|
81
|
+
defaultSelectedValues: defaultSelectedValuesProp,
|
|
82
|
+
color = "white"
|
|
81
83
|
} = _a, richSelectBoxProps = __objRest(_a, [
|
|
82
84
|
"autosave",
|
|
83
85
|
"children",
|
|
@@ -92,7 +94,8 @@ function RichSelectList(props) {
|
|
|
92
94
|
"placeholderText",
|
|
93
95
|
"selectTextValue",
|
|
94
96
|
"selectedValues",
|
|
95
|
-
"defaultSelectedValues"
|
|
97
|
+
"defaultSelectedValues",
|
|
98
|
+
"color"
|
|
96
99
|
]);
|
|
97
100
|
const reactId = useId();
|
|
98
101
|
const inputId = id != null ? id : reactId;
|
|
@@ -138,6 +141,21 @@ function RichSelectList(props) {
|
|
|
138
141
|
description: helperText,
|
|
139
142
|
errorMessage: errorText
|
|
140
143
|
});
|
|
144
|
+
const textColor = {
|
|
145
|
+
white: "gray700",
|
|
146
|
+
clear: "white"
|
|
147
|
+
};
|
|
148
|
+
const getArrowIconColor = () => {
|
|
149
|
+
if (errorText) {
|
|
150
|
+
return ColorBaseDestructive700;
|
|
151
|
+
} else {
|
|
152
|
+
if (color === "clear") {
|
|
153
|
+
return ColorCambioWhite100;
|
|
154
|
+
} else {
|
|
155
|
+
return ColorBaseGray700;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
141
159
|
return /* @__PURE__ */ jsx(
|
|
142
160
|
ReactAriaProvider,
|
|
143
161
|
{
|
|
@@ -166,7 +184,7 @@ function RichSelectList(props) {
|
|
|
166
184
|
(_a2 = fieldRef.current) == null ? void 0 : _a2.focus();
|
|
167
185
|
setInteractionModality("keyboard");
|
|
168
186
|
},
|
|
169
|
-
children: /* @__PURE__ */ jsx(Box_default, { paddingX: 1, children: /* @__PURE__ */ jsx(Typography_default, { size: 100, color:
|
|
187
|
+
children: /* @__PURE__ */ jsx(Box_default, { paddingX: 1, children: /* @__PURE__ */ jsx(Typography_default, { size: 100, color: textColor[color], children: label }) })
|
|
170
188
|
})
|
|
171
189
|
) }),
|
|
172
190
|
/* @__PURE__ */ jsx(
|
|
@@ -216,7 +234,8 @@ function RichSelectList(props) {
|
|
|
216
234
|
{
|
|
217
235
|
[SelectList_module_default.unselected]: !errorText && selectedKeys !== "all" && !selectedKeys.size,
|
|
218
236
|
[SelectList_module_default.selected]: !errorText && (selectedKeys === "all" || selectedKeys.size),
|
|
219
|
-
[SelectList_module_default.selectErrorCambio]: errorText
|
|
237
|
+
[SelectList_module_default.selectErrorCambio]: errorText,
|
|
238
|
+
[SelectList_module_default[`selectColor${color}`]]: color
|
|
220
239
|
}
|
|
221
240
|
),
|
|
222
241
|
children: selectedTextValue
|
|
@@ -232,7 +251,7 @@ function RichSelectList(props) {
|
|
|
232
251
|
children: /* @__PURE__ */ jsx(
|
|
233
252
|
"path",
|
|
234
253
|
{
|
|
235
|
-
fill:
|
|
254
|
+
fill: getArrowIconColor(),
|
|
236
255
|
d: "M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z"
|
|
237
256
|
}
|
|
238
257
|
)
|
|
@@ -247,7 +266,7 @@ function RichSelectList(props) {
|
|
|
247
266
|
Typography_default,
|
|
248
267
|
__spreadProps(__spreadValues({
|
|
249
268
|
size: 100,
|
|
250
|
-
color: errorText ? "destructive-primary" :
|
|
269
|
+
color: errorText ? "destructive-primary" : textColor[color]
|
|
251
270
|
}, errorText ? errorMessageProps : descriptionProps), {
|
|
252
271
|
children: errorText ? errorText : helperText
|
|
253
272
|
})
|
|
@@ -267,4 +286,4 @@ var RichSelectList_default = Object.assign(RichSelectList, {
|
|
|
267
286
|
export {
|
|
268
287
|
RichSelectList_default
|
|
269
288
|
};
|
|
270
|
-
//# sourceMappingURL=
|
|
289
|
+
//# sourceMappingURL=PW6JTQVM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/RichSelect/RichSelectList.tsx","css-module:../SelectList/SelectList.module.css#css-module"],"sourcesContent":["import React, {\n type ReactElement,\n useMemo,\n type SyntheticEvent,\n useRef,\n useId,\n} from \"react\";\nimport classNames from \"classnames\";\nimport {\n ColorBaseDestructive700,\n ColorBaseGray700,\n ColorCambioWhite100,\n} from \"@cambly/syntax-design-tokens\";\nimport Typography from \"../Typography/Typography\";\nimport useIsHydrated from \"../useIsHydrated\";\nimport Popover from \"../Popover/Popover\";\nimport {\n Label as ReactAriaLabel,\n Provider as ReactAriaProvider,\n} from \"react-aria-components\";\nimport { useControlledState } from \"@react-stately/utils\";\nimport { setInteractionModality } from \"@react-aria/interactions\";\nimport { DialogContext } from \"../Dialog/Dialog\";\nimport styles from \"../SelectList/SelectList.module.css\";\nimport RichSelectBox, {\n RichSelectBoxContext,\n convertSelection,\n type RichSelectBoxProps,\n} from \"./RichSelectBox\";\nimport TapArea from \"../TapArea/TapArea\";\nimport { type OverlayHandlerRef } from \"../react-aria-utils/Triggerable\";\nimport Box from \"../Box/Box\";\nimport RichSelectSection from \"./RichSelectSection\";\nimport RichSelectChip from \"./RichSelectChip\";\nimport RichSelectRadioButton from \"./RichSelectRadioButton\";\nimport { useField } from \"react-aria\";\n\nconst NOOP = () => undefined;\n\nexport type RichSelectListProps = RichSelectBoxProps & {\n /** Test id for the select element */\n \"data-testid\"?: string;\n /**\n * Disables the select dropdown entirely\n * @defaultValue false\n */\n disabled?: boolean;\n /** Callback to be called when select is clicked */\n onClick?: (event: SyntheticEvent<HTMLDivElement>) => void;\n /** Text shown below select box if there is an input error. */\n errorText?: string;\n /** Text shown below select box */\n helperText?: string;\n /**\n * RichSelectList id, if not provided, a unique id will be generated\n */\n id?: string;\n /** Text shown above select box */\n label: string;\n /**\n * Text showing in select box if no option has been chosen.\n * There should always have a placeholder unless there is a default option selected\n */\n placeholderText?: string;\n /** Use to render (override) text shown in the select box */\n selectTextValue?: (selectedValues?: \"all\" | string[]) => string | undefined;\n /**\n * Color of the select box\n * @defaultValue white\n */\n color?: \"white\" | \"clear\";\n};\n\n/**\n * [RichSelectList](https://cambly-syntax.vercel.app/?path=/docs/components-richselectlist--docs) is a dropdown menu that allows users to select one or multiple options from a list.\n *\n * Example Usage:\n ```\n <RichSelectList\n label=\"My Label\"\n multiple\n onChange={() => { ... }}\n primaryButtonText=\"Save\"\n primaryButtonAccessibilityLabel=\"Save\"\n secondaryButtonText=\"Clear\"\n secondaryButtonAccessibilityLabel=\"Clear\"\n >\n <RichSelectList.Section label=\"Cities\">\n <RichSelectList.Chip label=\"San Francisco\" value=\"sf\" />\n <RichSelectList.Chip label=\"New York\" value=\"ny\" disabled />\n <RichSelectList.Chip label=\"Tulsa\" value=\"tulsa\" />\n <RichSelectList.Chip label=\"Chicago\" value=\"chicago\" disabled />\n </RichSelectList.Section>\n </RichSelectList>\n ```\n */\nfunction RichSelectList(props: RichSelectListProps): ReactElement {\n const {\n autosave,\n children,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n errorText,\n helperText,\n label,\n id,\n onChange,\n onClick = NOOP,\n placeholderText,\n selectTextValue,\n selectedValues: selectedValuesProp,\n defaultSelectedValues: defaultSelectedValuesProp,\n color = \"white\",\n ...richSelectBoxProps\n } = props;\n\n const reactId = useId();\n const inputId = id ?? reactId;\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n\n // passed to popover, which attached open/close methods\n const overlayHandlerRef = useRef<OverlayHandlerRef>({});\n\n const selectedKeysProp = useMemo(\n () => convertSelection(selectedValuesProp),\n [selectedValuesProp],\n );\n const defaultSelectedKeys = useMemo(\n () => convertSelection(defaultSelectedValuesProp, new Set()),\n [defaultSelectedValuesProp],\n );\n const [selectedKeys, setSelectedKeys] = useControlledState(\n selectedKeysProp!, // eslint-disable-line @typescript-eslint/no-non-null-assertion -- there is a bug in the typedef for useControlledState from react-stately. Internally they rely on value (first arg) able to be undefined\n defaultSelectedKeys,\n (value) => {\n const _value = value === \"all\" ? \"all\" : [...value].map(String);\n onChange(_value);\n if (!autosave) overlayHandlerRef.current.close?.();\n },\n );\n\n const selectedTextValue = useMemo(() => {\n if (selectTextValue)\n return (\n selectTextValue(\n selectedKeys === \"all\" ? \"all\" : [...selectedKeys].map(String),\n ) ?? placeholderText\n );\n if (selectedKeys === \"all\") return \"All selected\";\n if (selectedKeys.size) return `${selectedKeys.size} selected`;\n return placeholderText;\n }, [selectTextValue, selectedKeys, placeholderText]);\n\n const fieldRef = useRef<HTMLDivElement>(null);\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } =\n useField({\n label, // this is the label for the select box\n description: helperText,\n errorMessage: errorText,\n });\n\n const textColor = {\n white: \"gray700\",\n clear: \"white\",\n } as const;\n\n const getArrowIconColor = () => {\n if (errorText) {\n return ColorBaseDestructive700;\n } else {\n if (color === \"clear\") {\n return ColorCambioWhite100;\n } else {\n return ColorBaseGray700;\n }\n }\n };\n\n return (\n <ReactAriaProvider\n values={[\n [RichSelectBoxContext, { autoFocus: true }],\n [DialogContext, { padding: autosave ? undefined : 0 }], // this is altering Popover's internal dialog padding to show the sticky save/close buttons. Ideally this could be avoided\n ]}\n >\n <div\n className={classNames(styles.selectContainer, {\n [styles.opacityOverlay]: disabled,\n })}\n onClick={onClick}\n >\n {label && (\n <>\n <ReactAriaLabel\n data-testid={[dataTestId, \"label\"].filter(Boolean).join(\"-\")}\n {...labelProps}\n onClick={() => {\n if (disabled) return;\n fieldRef.current?.focus();\n setInteractionModality(\"keyboard\"); // Show the focus ring so the user knows where focus went\n }}\n >\n <Box paddingX={1}>\n <Typography size={100} color={textColor[color]}>\n {label}\n </Typography>\n </Box>\n </ReactAriaLabel>\n </>\n )}\n <Popover\n ref={overlayHandlerRef}\n disabled={disabled}\n content={\n // this Box wrapper is to reapply the padding that was stripped from popover's dialog to show the sticky save/close buttons. Ideally this could be avoided\n <Box\n padding={autosave ? undefined : 5}\n dangerouslySetInlineStyle={\n autosave ? undefined : { __style: { paddingBottom: 0 } }\n }\n role=\"menu\"\n >\n <RichSelectBox\n autosave={autosave}\n selectedValues={selectedKeys}\n defaultSelectedValues={defaultSelectedKeys}\n onChange={(selected) => setSelectedKeys(new Set(selected))}\n {...richSelectBoxProps}\n accessibilityLabel={inputId}\n >\n {children}\n </RichSelectBox>\n </Box>\n }\n >\n <TapArea\n data-testid={dataTestId}\n disabled={disabled}\n onClick={onClick}\n rounding=\"md\"\n {...fieldProps}\n ref={fieldRef}\n >\n <div className={styles.selectWrapper}>\n <div\n className={classNames(\n styles.selectBox,\n styles.selectBoxCambio,\n {\n [styles.unselected]:\n !errorText &&\n selectedKeys !== \"all\" &&\n !selectedKeys.size,\n [styles.selected]:\n !errorText &&\n (selectedKeys === \"all\" || selectedKeys.size),\n [styles.selectErrorCambio]: errorText,\n [styles[`selectColor${color}`]]: color,\n },\n )}\n >\n {selectedTextValue}\n </div>\n <div className={styles.arrowIcon}>\n <svg\n focusable=\"false\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width={24}\n >\n <path\n fill={getArrowIconColor()}\n d=\"M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z\"\n />\n </svg>\n </div>\n </div>\n </TapArea>\n </Popover>\n {(helperText || errorText) && (\n <Box paddingX={1}>\n <Typography\n size={100}\n color={errorText ? \"destructive-primary\" : textColor[color]}\n {...(errorText ? errorMessageProps : descriptionProps)}\n >\n {errorText ? errorText : helperText}\n </Typography>\n </Box>\n )}\n </div>\n </ReactAriaProvider>\n );\n}\n\nexport default Object.assign(RichSelectList, {\n Section: RichSelectSection,\n Chip: RichSelectChip,\n RadioButton: RichSelectRadioButton,\n});\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/SelectList/SelectList.module.css\"; export default {\"selectContainer\":\"_selectContainer_1g9ap_1\",\"opacityOverlay\":\"_opacityOverlay_1g9ap_7\",\"selectWrapper\":\"_selectWrapper_1g9ap_11\",\"selectBox\":\"_selectBox_1g9ap_16\",\"selectBoxCambio\":\"_selectBoxCambio_1g9ap_30\",\"selectMouseFocusStyling\":\"_selectMouseFocusStyling_1g9ap_38\",\"unselected\":\"_unselected_1g9ap_43\",\"selected\":\"_selected_1g9ap_47\",\"arrowIcon\":\"_arrowIcon_1g9ap_51\",\"selectErrorCambio\":\"_selectErrorCambio_1g9ap_65\",\"selectColorwhite\":\"_selectColorwhite_1g9ap_71\",\"selectColorclear\":\"_selectColorclear_1g9ap_77\"}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,OAAO,gBAAgB;AASvB;AAAA,EACE,SAAS;AAAA,EACT,YAAY;AAAA,OACP;AACP,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;;;ACrB6D,IAAO,4BAAQ,EAAC,mBAAkB,4BAA2B,kBAAiB,2BAA0B,iBAAgB,2BAA0B,aAAY,uBAAsB,mBAAkB,6BAA4B,2BAA0B,qCAAoC,cAAa,wBAAuB,YAAW,sBAAqB,aAAY,uBAAsB,qBAAoB,+BAA8B,oBAAmB,8BAA6B,oBAAmB,6BAA4B;;;ADmC3nB,SAAS,gBAAgB;AA8Jf,mBAWM,KAwCJ,YAnDF;AA5JV,IAAM,OAAO,MAAM;AA2DnB,SAAS,eAAe,OAA0C;AAChE,QAiBI,YAhBF;AAAA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf,UAAU,eAAe;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,uBAAuB;AAAA,IACvB,QAAQ;AAAA,EAhHZ,IAkHM,IADC,+BACD,IADC;AAAA,IAfH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAIF,QAAM,UAAU,MAAM;AACtB,QAAM,UAAU,kBAAM;AACtB,QAAM,aAAa,cAAc;AACjC,QAA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f,CAAC;","names":["_a"]}
|
|
@@ -8,7 +8,8 @@ var _J27AGJQBcjs = require('./J27AGJQB.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
var _OXSHUPNOcjs = require('./OXSHUPNO.cjs');
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
@@ -77,7 +78,8 @@ function RichSelectList(props) {
|
|
|
77
78
|
placeholderText,
|
|
78
79
|
selectTextValue,
|
|
79
80
|
selectedValues: selectedValuesProp,
|
|
80
|
-
defaultSelectedValues: defaultSelectedValuesProp
|
|
81
|
+
defaultSelectedValues: defaultSelectedValuesProp,
|
|
82
|
+
color = "white"
|
|
81
83
|
} = _a, richSelectBoxProps = _X2SDR4SDcjs.__objRest.call(void 0, _a, [
|
|
82
84
|
"autosave",
|
|
83
85
|
"children",
|
|
@@ -92,7 +94,8 @@ function RichSelectList(props) {
|
|
|
92
94
|
"placeholderText",
|
|
93
95
|
"selectTextValue",
|
|
94
96
|
"selectedValues",
|
|
95
|
-
"defaultSelectedValues"
|
|
97
|
+
"defaultSelectedValues",
|
|
98
|
+
"color"
|
|
96
99
|
]);
|
|
97
100
|
const reactId = _react.useId.call(void 0, );
|
|
98
101
|
const inputId = id != null ? id : reactId;
|
|
@@ -138,6 +141,21 @@ function RichSelectList(props) {
|
|
|
138
141
|
description: helperText,
|
|
139
142
|
errorMessage: errorText
|
|
140
143
|
});
|
|
144
|
+
const textColor = {
|
|
145
|
+
white: "gray700",
|
|
146
|
+
clear: "white"
|
|
147
|
+
};
|
|
148
|
+
const getArrowIconColor = () => {
|
|
149
|
+
if (errorText) {
|
|
150
|
+
return _OXSHUPNOcjs.ColorBaseDestructive700;
|
|
151
|
+
} else {
|
|
152
|
+
if (color === "clear") {
|
|
153
|
+
return _OXSHUPNOcjs.ColorCambioWhite100;
|
|
154
|
+
} else {
|
|
155
|
+
return _OXSHUPNOcjs.ColorBaseGray700;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
141
159
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
142
160
|
_reactariacomponents.Provider,
|
|
143
161
|
{
|
|
@@ -166,7 +184,7 @@ function RichSelectList(props) {
|
|
|
166
184
|
(_a2 = fieldRef.current) == null ? void 0 : _a2.focus();
|
|
167
185
|
_interactions.setInteractionModality.call(void 0, "keyboard");
|
|
168
186
|
},
|
|
169
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _KJLBDAZHcjs.Box_default, { paddingX: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FEFAG4KTcjs.Typography_default, { size: 100, color:
|
|
187
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _KJLBDAZHcjs.Box_default, { paddingX: 1, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FEFAG4KTcjs.Typography_default, { size: 100, color: textColor[color], children: label }) })
|
|
170
188
|
})
|
|
171
189
|
) }),
|
|
172
190
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -216,7 +234,8 @@ function RichSelectList(props) {
|
|
|
216
234
|
{
|
|
217
235
|
[SelectList_module_default.unselected]: !errorText && selectedKeys !== "all" && !selectedKeys.size,
|
|
218
236
|
[SelectList_module_default.selected]: !errorText && (selectedKeys === "all" || selectedKeys.size),
|
|
219
|
-
[SelectList_module_default.selectErrorCambio]: errorText
|
|
237
|
+
[SelectList_module_default.selectErrorCambio]: errorText,
|
|
238
|
+
[SelectList_module_default[`selectColor${color}`]]: color
|
|
220
239
|
}
|
|
221
240
|
),
|
|
222
241
|
children: selectedTextValue
|
|
@@ -232,7 +251,7 @@ function RichSelectList(props) {
|
|
|
232
251
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
233
252
|
"path",
|
|
234
253
|
{
|
|
235
|
-
fill:
|
|
254
|
+
fill: getArrowIconColor(),
|
|
236
255
|
d: "M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z"
|
|
237
256
|
}
|
|
238
257
|
)
|
|
@@ -247,7 +266,7 @@ function RichSelectList(props) {
|
|
|
247
266
|
_FEFAG4KTcjs.Typography_default,
|
|
248
267
|
_X2SDR4SDcjs.__spreadProps.call(void 0, _X2SDR4SDcjs.__spreadValues.call(void 0, {
|
|
249
268
|
size: 100,
|
|
250
|
-
color: errorText ? "destructive-primary" :
|
|
269
|
+
color: errorText ? "destructive-primary" : textColor[color]
|
|
251
270
|
}, errorText ? errorMessageProps : descriptionProps), {
|
|
252
271
|
children: errorText ? errorText : helperText
|
|
253
272
|
})
|
|
@@ -267,4 +286,4 @@ var RichSelectList_default = Object.assign(RichSelectList, {
|
|
|
267
286
|
|
|
268
287
|
|
|
269
288
|
exports.RichSelectList_default = RichSelectList_default;
|
|
270
|
-
//# sourceMappingURL=
|
|
289
|
+
//# sourceMappingURL=XVYUFV22.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/RichSelect/RichSelectList.tsx","css-module:../SelectList/SelectList.module.css#css-module"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,OAAO,gBAAgB;AASvB;AAAA,EACE,SAAS;AAAA,EACT,YAAY;AAAA,OACP;AACP,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;;;ACrB6D,IAAO,4BAAQ,EAAC,mBAAkB,4BAA2B,kBAAiB,2BAA0B,iBAAgB,2BAA0B,aAAY,uBAAsB,mBAAkB,6BAA4B,2BAA0B,qCAAoC,cAAa,wBAAuB,YAAW,sBAAqB,aAAY,uBAAsB,qBAAoB,+BAA8B,oBAAmB,8BAA6B,oBAA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AI,WAAW,0BAAO,WACrB;AAAA,wBAAC;AAAA;AAAA,0BACC,WAAU;AAAA,0BACV,eAAY;AAAA,0BACZ,SAAQ;AAAA,0BACR,OAAO;AAAA,0BAEP;AAAA,4BAAC;AAAA;AAAA,8BACC,MAAM,kBAAkB;AAAA,8BACxB,GAAE;AAAA;AAAA,0BACJ;AAAA;AAAA,sBACF,GACF;AAAA,uBACF;AAAA;AAAA,gBACF;AAAA;AAAA,YACF;AAAA,aACE,cAAc,cACd,oBAAC,eAAI,UAAU,GACb;AAAA,cAAC;AAAA;AAAA,gBACC,MAAM;AAAA,gBACN,OAAO,YAAY,wBAAwB,UAAU,KAAK;AAAA,iBACrD,YAAY,oBAAoB,mBAHtC;AAAA,gBAKE,sBAAY,YAAY;AAAA;AAAA,YAC3B,GACF;AAAA;AAAA;AAAA,MAEJ;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,yBAAQ,OAAO,OAAO,gBAAgB;AAAA,EAC3C,SAAS;AAAA,EACT,MAAM;AAAA,EACN,aAAa;AACf,CAAC","sourcesContent":["import React, {\n type ReactElement,\n useMemo,\n type SyntheticEvent,\n useRef,\n useId,\n} from \"react\";\nimport classNames from \"classnames\";\nimport {\n ColorBaseDestructive700,\n ColorBaseGray700,\n ColorCambioWhite100,\n} from \"@cambly/syntax-design-tokens\";\nimport Typography from \"../Typography/Typography\";\nimport useIsHydrated from \"../useIsHydrated\";\nimport Popover from \"../Popover/Popover\";\nimport {\n Label as ReactAriaLabel,\n Provider as ReactAriaProvider,\n} from \"react-aria-components\";\nimport { useControlledState } from \"@react-stately/utils\";\nimport { setInteractionModality } from \"@react-aria/interactions\";\nimport { DialogContext } from \"../Dialog/Dialog\";\nimport styles from \"../SelectList/SelectList.module.css\";\nimport RichSelectBox, {\n RichSelectBoxContext,\n convertSelection,\n type RichSelectBoxProps,\n} from \"./RichSelectBox\";\nimport TapArea from \"../TapArea/TapArea\";\nimport { type OverlayHandlerRef } from \"../react-aria-utils/Triggerable\";\nimport Box from \"../Box/Box\";\nimport RichSelectSection from \"./RichSelectSection\";\nimport RichSelectChip from \"./RichSelectChip\";\nimport RichSelectRadioButton from \"./RichSelectRadioButton\";\nimport { useField } from \"react-aria\";\n\nconst NOOP = () => undefined;\n\nexport type RichSelectListProps = RichSelectBoxProps & {\n /** Test id for the select element */\n \"data-testid\"?: string;\n /**\n * Disables the select dropdown entirely\n * @defaultValue false\n */\n disabled?: boolean;\n /** Callback to be called when select is clicked */\n onClick?: (event: SyntheticEvent<HTMLDivElement>) => void;\n /** Text shown below select box if there is an input error. */\n errorText?: string;\n /** Text shown below select box */\n helperText?: string;\n /**\n * RichSelectList id, if not provided, a unique id will be generated\n */\n id?: string;\n /** Text shown above select box */\n label: string;\n /**\n * Text showing in select box if no option has been chosen.\n * There should always have a placeholder unless there is a default option selected\n */\n placeholderText?: string;\n /** Use to render (override) text shown in the select box */\n selectTextValue?: (selectedValues?: \"all\" | string[]) => string | undefined;\n /**\n * Color of the select box\n * @defaultValue white\n */\n color?: \"white\" | \"clear\";\n};\n\n/**\n * [RichSelectList](https://cambly-syntax.vercel.app/?path=/docs/components-richselectlist--docs) is a dropdown menu that allows users to select one or multiple options from a list.\n *\n * Example Usage:\n ```\n <RichSelectList\n label=\"My Label\"\n multiple\n onChange={() => { ... }}\n primaryButtonText=\"Save\"\n primaryButtonAccessibilityLabel=\"Save\"\n secondaryButtonText=\"Clear\"\n secondaryButtonAccessibilityLabel=\"Clear\"\n >\n <RichSelectList.Section label=\"Cities\">\n <RichSelectList.Chip label=\"San Francisco\" value=\"sf\" />\n <RichSelectList.Chip label=\"New York\" value=\"ny\" disabled />\n <RichSelectList.Chip label=\"Tulsa\" value=\"tulsa\" />\n <RichSelectList.Chip label=\"Chicago\" value=\"chicago\" disabled />\n </RichSelectList.Section>\n </RichSelectList>\n ```\n */\nfunction RichSelectList(props: RichSelectListProps): ReactElement {\n const {\n autosave,\n children,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n errorText,\n helperText,\n label,\n id,\n onChange,\n onClick = NOOP,\n placeholderText,\n selectTextValue,\n selectedValues: selectedValuesProp,\n defaultSelectedValues: defaultSelectedValuesProp,\n color = \"white\",\n ...richSelectBoxProps\n } = props;\n\n const reactId = useId();\n const inputId = id ?? reactId;\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n\n // passed to popover, which attached open/close methods\n const overlayHandlerRef = useRef<OverlayHandlerRef>({});\n\n const selectedKeysProp = useMemo(\n () => convertSelection(selectedValuesProp),\n [selectedValuesProp],\n );\n const defaultSelectedKeys = useMemo(\n () => convertSelection(defaultSelectedValuesProp, new Set()),\n [defaultSelectedValuesProp],\n );\n const [selectedKeys, setSelectedKeys] = useControlledState(\n selectedKeysProp!, // eslint-disable-line @typescript-eslint/no-non-null-assertion -- there is a bug in the typedef for useControlledState from react-stately. Internally they rely on value (first arg) able to be undefined\n defaultSelectedKeys,\n (value) => {\n const _value = value === \"all\" ? \"all\" : [...value].map(String);\n onChange(_value);\n if (!autosave) overlayHandlerRef.current.close?.();\n },\n );\n\n const selectedTextValue = useMemo(() => {\n if (selectTextValue)\n return (\n selectTextValue(\n selectedKeys === \"all\" ? \"all\" : [...selectedKeys].map(String),\n ) ?? placeholderText\n );\n if (selectedKeys === \"all\") return \"All selected\";\n if (selectedKeys.size) return `${selectedKeys.size} selected`;\n return placeholderText;\n }, [selectTextValue, selectedKeys, placeholderText]);\n\n const fieldRef = useRef<HTMLDivElement>(null);\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } =\n useField({\n label, // this is the label for the select box\n description: helperText,\n errorMessage: errorText,\n });\n\n const textColor = {\n white: \"gray700\",\n clear: \"white\",\n } as const;\n\n const getArrowIconColor = () => {\n if (errorText) {\n return ColorBaseDestructive700;\n } else {\n if (color === \"clear\") {\n return ColorCambioWhite100;\n } else {\n return ColorBaseGray700;\n }\n }\n };\n\n return (\n <ReactAriaProvider\n values={[\n [RichSelectBoxContext, { autoFocus: true }],\n [DialogContext, { padding: autosave ? undefined : 0 }], // this is altering Popover's internal dialog padding to show the sticky save/close buttons. Ideally this could be avoided\n ]}\n >\n <div\n className={classNames(styles.selectContainer, {\n [styles.opacityOverlay]: disabled,\n })}\n onClick={onClick}\n >\n {label && (\n <>\n <ReactAriaLabel\n data-testid={[dataTestId, \"label\"].filter(Boolean).join(\"-\")}\n {...labelProps}\n onClick={() => {\n if (disabled) return;\n fieldRef.current?.focus();\n setInteractionModality(\"keyboard\"); // Show the focus ring so the user knows where focus went\n }}\n >\n <Box paddingX={1}>\n <Typography size={100} color={textColor[color]}>\n {label}\n </Typography>\n </Box>\n </ReactAriaLabel>\n </>\n )}\n <Popover\n ref={overlayHandlerRef}\n disabled={disabled}\n content={\n // this Box wrapper is to reapply the padding that was stripped from popover's dialog to show the sticky save/close buttons. Ideally this could be avoided\n <Box\n padding={autosave ? undefined : 5}\n dangerouslySetInlineStyle={\n autosave ? undefined : { __style: { paddingBottom: 0 } }\n }\n role=\"menu\"\n >\n <RichSelectBox\n autosave={autosave}\n selectedValues={selectedKeys}\n defaultSelectedValues={defaultSelectedKeys}\n onChange={(selected) => setSelectedKeys(new Set(selected))}\n {...richSelectBoxProps}\n accessibilityLabel={inputId}\n >\n {children}\n </RichSelectBox>\n </Box>\n }\n >\n <TapArea\n data-testid={dataTestId}\n disabled={disabled}\n onClick={onClick}\n rounding=\"md\"\n {...fieldProps}\n ref={fieldRef}\n >\n <div className={styles.selectWrapper}>\n <div\n className={classNames(\n styles.selectBox,\n styles.selectBoxCambio,\n {\n [styles.unselected]:\n !errorText &&\n selectedKeys !== \"all\" &&\n !selectedKeys.size,\n [styles.selected]:\n !errorText &&\n (selectedKeys === \"all\" || selectedKeys.size),\n [styles.selectErrorCambio]: errorText,\n [styles[`selectColor${color}`]]: color,\n },\n )}\n >\n {selectedTextValue}\n </div>\n <div className={styles.arrowIcon}>\n <svg\n focusable=\"false\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width={24}\n >\n <path\n fill={getArrowIconColor()}\n d=\"M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z\"\n />\n </svg>\n </div>\n </div>\n </TapArea>\n </Popover>\n {(helperText || errorText) && (\n <Box paddingX={1}>\n <Typography\n size={100}\n color={errorText ? \"destructive-primary\" : textColor[color]}\n {...(errorText ? errorMessageProps : descriptionProps)}\n >\n {errorText ? errorText : helperText}\n </Typography>\n </Box>\n )}\n </div>\n </ReactAriaProvider>\n );\n}\n\nexport default Object.assign(RichSelectList, {\n Section: RichSelectSection,\n Chip: RichSelectChip,\n RadioButton: RichSelectRadioButton,\n});\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/SelectList/SelectList.module.css\"; export default {\"selectContainer\":\"_selectContainer_1g9ap_1\",\"opacityOverlay\":\"_opacityOverlay_1g9ap_7\",\"selectWrapper\":\"_selectWrapper_1g9ap_11\",\"selectBox\":\"_selectBox_1g9ap_16\",\"selectBoxCambio\":\"_selectBoxCambio_1g9ap_30\",\"selectMouseFocusStyling\":\"_selectMouseFocusStyling_1g9ap_38\",\"unselected\":\"_unselected_1g9ap_43\",\"selected\":\"_selected_1g9ap_47\",\"arrowIcon\":\"_arrowIcon_1g9ap_51\",\"selectErrorCambio\":\"_selectErrorCambio_1g9ap_65\",\"selectColorwhite\":\"_selectColorwhite_1g9ap_71\",\"selectColorclear\":\"_selectColorclear_1g9ap_77\"}"]}
|
package/dist/index.cjs
CHANGED
|
@@ -31,10 +31,10 @@ var _BZ546NNEcjs = require('./__chunks/BZ546NNE.cjs');
|
|
|
31
31
|
var _L5RBAKANcjs = require('./__chunks/L5RBAKAN.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _H3QQNW5Xcjs = require('./__chunks/H3QQNW5X.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _XVYUFV22cjs = require('./__chunks/XVYUFV22.cjs');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
var _C4GAUB4Ycjs = require('./__chunks/C4GAUB4Y.cjs');
|
|
@@ -43,7 +43,7 @@ require('./__chunks/J27AGJQB.cjs');
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
var _YJAKY2I2cjs = require('./__chunks/YJAKY2I2.cjs');
|
|
46
|
-
require('./__chunks/
|
|
46
|
+
require('./__chunks/OXSHUPNO.cjs');
|
|
47
47
|
require('./__chunks/LIUV3J2M.cjs');
|
|
48
48
|
|
|
49
49
|
|
|
@@ -145,5 +145,5 @@ require('./__chunks/X2SDR4SD.cjs');
|
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
|
|
148
|
-
exports.Avatar = _RC7EMZ6Ncjs.Avatar_default; exports.AvatarGroup = _5COVOOB3cjs.AvatarGroup; exports.Badge = _XG7O4UGWcjs.Badge_default; exports.Box = _KJLBDAZHcjs.Box_default; exports.Button = _TSMYMWWEcjs.Button_default; exports.ButtonGroup = _C5XPZTFOcjs.ButtonGroup_default; exports.Card = _L32D5WEGcjs.Card_default; exports.Checkbox = _C3FW5QDGcjs.Checkbox_default; exports.Chip = _SKFX2MXKcjs.Chip_default; exports.Divider = _42SRFCQLcjs.Divider; exports.Heading = _Q4P2W7UUcjs.Heading_default; exports.Icon = _L5RBAKANcjs.Icon_default; exports.IconButton = _YJAKY2I2cjs.IconButton_default; exports.LinkButton = _BZ546NNEcjs.LinkButton_default; exports.Modal = _IYYTLOO3cjs.Modal; exports.Popover = _C4GAUB4Ycjs.Popover_default; exports.RadioButton = _EF6R3LRBcjs.RadioButton_default; exports.RichSelectList =
|
|
148
|
+
exports.Avatar = _RC7EMZ6Ncjs.Avatar_default; exports.AvatarGroup = _5COVOOB3cjs.AvatarGroup; exports.Badge = _XG7O4UGWcjs.Badge_default; exports.Box = _KJLBDAZHcjs.Box_default; exports.Button = _TSMYMWWEcjs.Button_default; exports.ButtonGroup = _C5XPZTFOcjs.ButtonGroup_default; exports.Card = _L32D5WEGcjs.Card_default; exports.Checkbox = _C3FW5QDGcjs.Checkbox_default; exports.Chip = _SKFX2MXKcjs.Chip_default; exports.Divider = _42SRFCQLcjs.Divider; exports.Heading = _Q4P2W7UUcjs.Heading_default; exports.Icon = _L5RBAKANcjs.Icon_default; exports.IconButton = _YJAKY2I2cjs.IconButton_default; exports.LinkButton = _BZ546NNEcjs.LinkButton_default; exports.Modal = _IYYTLOO3cjs.Modal; exports.Popover = _C4GAUB4Ycjs.Popover_default; exports.RadioButton = _EF6R3LRBcjs.RadioButton_default; exports.RichSelectList = _XVYUFV22cjs.RichSelectList_default; exports.SelectList = _H3QQNW5Xcjs.SelectList; exports.Tabs = _HBIGKRZ2cjs.Tabs; exports.TapArea = _3UEOKPM2cjs.TapArea_default; exports.TextArea = _HBHOLWEMcjs.TextArea_default; exports.TextField = _CW24HTITcjs.TextField; exports.ThemeProvider = _36JMUQOLcjs.ThemeProvider; exports.Tooltip = _QI5Q2WJGcjs.Tooltip_default; exports.Typography = _FEFAG4KTcjs.Typography_default;
|
|
149
149
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -31,10 +31,10 @@ import {
|
|
|
31
31
|
} from "./__chunks/523DPUCJ.js";
|
|
32
32
|
import {
|
|
33
33
|
SelectList
|
|
34
|
-
} from "./__chunks/
|
|
34
|
+
} from "./__chunks/GVDYEBNZ.js";
|
|
35
35
|
import {
|
|
36
36
|
RichSelectList_default
|
|
37
|
-
} from "./__chunks/
|
|
37
|
+
} from "./__chunks/PW6JTQVM.js";
|
|
38
38
|
import {
|
|
39
39
|
Popover_default
|
|
40
40
|
} from "./__chunks/SNLD3DG6.js";
|
|
@@ -43,7 +43,7 @@ import "./__chunks/5HEC7ASW.js";
|
|
|
43
43
|
import {
|
|
44
44
|
IconButton_default
|
|
45
45
|
} from "./__chunks/MZOGVH4K.js";
|
|
46
|
-
import "./__chunks/
|
|
46
|
+
import "./__chunks/4LS53X3H.js";
|
|
47
47
|
import "./__chunks/TU2BVOKD.js";
|
|
48
48
|
import {
|
|
49
49
|
Button_default
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/SelectList/SelectList.tsx","css-module:./SelectList.module.css#css-module"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EAGE;AAAA,EACA;AAAA,OAEK;AAEP,OAAO,gBAAgB;;;ACR6E,IAAO,4BAAQ,EAAC,mBAAkB,4BAA2B,kBAAiB,2BAA0B,iBAAgB,2BAA0B,aAAY,uBAAsB,mBAAkB,6BAA4B,2BAA0B,qCAAoC,cAAa,wBAAuB,YAAW,sBAAqB,aAAY,uBAAsB,qBAAoB,+BAA8B,oBAAmB,8BAA6B,oBAAmB,6BAA4B;;;ADuI/mB,cAOJ,YAPI;AA/GG,SAAR,WAA4B;AAAA,EACjC;AAAA,EACA,eAAe;AAAA,EACf,UAAU,eAAe;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB,QAAQ;AACV,GAoDiB;AACf,QAAM,UAAU,MAAM;AACtB,QAAM,aAAa,cAAc;AACjC,QAAM,WAAW,CAAC,cAAc;AAChC,QAAM,WAAW,kBAAM;AACvB,QAAM,EAAE,eAAe,IAAI,gBAAgB;AAC3C,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAEhD,QAAM,gBAA+D,CACnE,UACG;AACH,QAAI,YAAY,WAAW;AAAM;AACjC,QAAI,MAAM,QAAQ,WAAW,MAAM,QAAQ,OAAO,MAAM,QAAQ,SAAS;AACvE,cAAQ,KAAK;AAAA,IACf;AAAA,EACF;AAEA,QAAM,YAGF;AAAA,IACF,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAEA,QAAM,oBAAoB,MAAM;AA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AAAA,cACC,WAAU;AAAA,cACV,eAAY;AAAA,cACZ,SAAQ;AAAA,cACR,OAAO;AAAA,cAEP;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAM,kBAAkB;AAAA,kBACxB,GAAE;AAAA;AAAA,cACJ;AAAA;AAAA,UACF,GACF;AAAA,WACF;AAAA,SACE,cAAc,cACd,oBAAC,eAAI,UAAU,GACb;AAAA,UAAC;AAAA;AAAA,YACC,MAAM;AAAA,YACN,OAAO,YAAY,wBAAwB,UAAU,KAAK;AAAA,YAEzD,sBAAY,YAAY;AAAA;AAAA,QAC3B,GACF;AAAA;AAAA;AAAA,EAEJ;AAEJ;AAEA,WAAW,SAAS","sourcesContent":["import React, {\n type ReactElement,\n type ReactNode,\n useId,\n useState,\n type ComponentProps,\n} from \"react\";\nimport Box from \"../Box/Box\";\nimport classNames from \"classnames\";\nimport {\n ColorBaseDestructive700,\n ColorBaseGray700,\n ColorCambioWhite100,\n} from \"@cambly/syntax-design-tokens\";\nimport Typography from \"../Typography/Typography\";\nimport styles from \"./SelectList.module.css\";\nimport focusStyles from \"../Focus.module.css\";\nimport SelectOption from \"./SelectOption\";\nimport useFocusVisible from \"../useFocusVisible\";\nimport useIsHydrated from \"../useIsHydrated\";\n\n/**\n * [SelectList](https://cambly-syntax.vercel.app/?path=/docs/components-selectlist--docs) is a dropdown menu that allows users to select one option from a list.\n */\nexport default function SelectList({\n children,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n errorText,\n helperText,\n id,\n label,\n onChange,\n onClick,\n placeholderText,\n selectedValue = \"\",\n color = \"white\",\n}: {\n /**\n * One or more SelectList.Option components.\n */\n children: ReactNode;\n /**\n * Test id for the select element\n */\n \"data-testid\"?: string;\n /**\n * true if the select dropdown is disabled\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Callback to be called when select is clicked\n */\n onClick?: (event: React.SyntheticEvent<HTMLSelectElement>) => void;\n /**\n * Text shown below select box if there is an input error.\n */\n errorText?: string;\n /**\n * Text shown below select box\n */\n helperText?: string;\n /**\n * Id of the select element\n */\n id?: string;\n /**\n * Text shown above select box\n */\n label: string;\n /**\n * The callback to be called when an option is selected\n */\n onChange: React.ChangeEventHandler<HTMLSelectElement>;\n /**\n * Text showing in select box if no option has been chosen.\n * We should always have a placeholder unless there is a default option selected\n */\n placeholderText?: string;\n /**\n * Value of the currently selected option\n */\n selectedValue?: string;\n /**\n * Color of the select box\n * @defaultValue white\n */\n color?: \"white\" | \"clear\";\n}): ReactElement {\n const reactId = useId();\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n const selectId = id ?? reactId;\n const { isFocusVisible } = useFocusVisible();\n const [isFocused, setIsFocused] = useState(false);\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLSelectElement> = (\n event,\n ) => {\n if (disabled || onClick == null) return;\n if (event.key === \"Enter\" || event.key === \" \" || event.key === \"Space\") {\n onClick(event);\n }\n };\n\n const textColor: Record<\n NonNullable<ComponentProps<typeof SelectList>[\"color\"]>,\n ComponentProps<typeof Typography>[\"color\"]\n > = {\n white: \"gray700\",\n clear: \"white\",\n };\n\n const getArrowIconColor = () => {\n if (errorText) {\n return ColorBaseDestructive700;\n } else {\n if (color === \"clear\") {\n return ColorCambioWhite100;\n } else {\n return ColorBaseGray700;\n }\n }\n };\n\n return (\n <div\n className={classNames(styles.selectContainer, {\n [styles.opacityOverlay]: disabled,\n })}\n >\n {label && (\n <label htmlFor={selectId}>\n <Box paddingX={1}>\n <Typography size={100} color={textColor[color]}>\n {label}\n </Typography>\n </Box>\n </label>\n )}\n <div className={styles.selectWrapper}>\n <select\n id={selectId}\n data-testid={dataTestId}\n disabled={disabled}\n className={classNames(styles.selectBox, styles.selectBoxCambio, {\n [styles.unselected]: !selectedValue && !errorText,\n [styles.selected]: selectedValue && !errorText,\n [styles.selectErrorCambio]: errorText,\n [focusStyles.accessibilityOutlineFocus]:\n isFocused && isFocusVisible, // for focus keyboard\n [styles.selectMouseFocusStyling]: isFocused && !isFocusVisible, // for focus mouse\n [styles[`selectColor${color}`]]: color,\n })}\n onChange={onChange}\n onClick={onClick}\n onKeyDown={handleKeyDown}\n value={\n placeholderText && !selectedValue ? placeholderText : selectedValue\n }\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n >\n {placeholderText && (\n <option disabled value={placeholderText}>\n {placeholderText}\n </option>\n )}\n {children}\n </select>\n <div className={styles.arrowIcon}>\n <svg\n focusable=\"false\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width={24}\n >\n <path\n fill={getArrowIconColor()}\n d=\"M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z\"\n />\n </svg>\n </div>\n </div>\n {(helperText || errorText) && (\n <Box paddingX={1}>\n <Typography\n size={100}\n color={errorText ? \"destructive-primary\" : textColor[color]}\n >\n {errorText ? errorText : helperText}\n </Typography>\n </Box>\n )}\n </div>\n );\n}\n\nSelectList.Option = SelectOption;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/SelectList/SelectList.module.css\"; export default {\"selectContainer\":\"_selectContainer_1g9ap_1\",\"opacityOverlay\":\"_opacityOverlay_1g9ap_7\",\"selectWrapper\":\"_selectWrapper_1g9ap_11\",\"selectBox\":\"_selectBox_1g9ap_16\",\"selectBoxCambio\":\"_selectBoxCambio_1g9ap_30\",\"selectMouseFocusStyling\":\"_selectMouseFocusStyling_1g9ap_38\",\"unselected\":\"_unselected_1g9ap_43\",\"selected\":\"_selected_1g9ap_47\",\"arrowIcon\":\"_arrowIcon_1g9ap_51\",\"selectErrorCambio\":\"_selectErrorCambio_1g9ap_65\",\"selectColorwhite\":\"_selectColorwhite_1g9ap_71\",\"selectColorclear\":\"_selectColorclear_1g9ap_77\"}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"names":[],"mappings":";;;AASO,IAAM,0BAA0B;AAUhC,IAAM,mBAAmB;AACzB,IAAM,mBAAmB;AAoCzB,IAAM,sBAAsB","sourcesContent":["/**\n * Do not edit directly\n * Generated on Thu, 18 Jul 2024 17:46:31 GMT\n */\n\nexport const ColorBaseBlack = \"#000000\";\nexport const ColorBaseDestructive100 = \"#fef3f5\";\nexport const ColorBaseDestructive200 = \"#fad6de\";\nexport const ColorBaseDestructive300 = \"#f2a2b2\";\nexport const ColorBaseDestructive700 = \"#d32a4b\";\nexport const ColorBaseDestructive800 = \"#81162c\";\nexport const ColorBaseDestructive900 = \"#55101d\";\nexport const ColorBaseGray10 = \"#cbcbcb\"; // Used as the default color for dividers and inner strokes\nexport const ColorBaseGray30 = \"#000000\"; // For IconButton background when on top of an image\nexport const ColorBaseGray60 = \"#000000\"; // Used for icon background in classroom video grid\nexport const ColorBaseGray80 = \"#000000\"; // Used as the background for modals\nexport const ColorBaseGray100 = \"#f7f7f7\";\nexport const ColorBaseGray200 = \"#f0f0f0\"; // Used for light mode backgrounds when showing card content on top\nexport const ColorBaseGray300 = \"#d0d0d0\"; // Used for component outlines, eg: select and textfield\nexport const ColorBaseGray700 = \"#767676\"; // For secondary text in light mode\nexport const ColorBaseGray800 = \"#353535\";\nexport const ColorBaseGray900 = \"#191919\"; // Default text color, Classroom background\nexport const ColorBaseOrange100 = \"#fdf2f0\";\nexport const ColorBaseOrange200 = \"#f6cdc4\";\nexport const ColorBaseOrange300 = \"#ec9987\";\nexport const ColorBaseOrange700 = \"#c34124\";\nexport const ColorBaseOrange800 = \"#732818\";\nexport const ColorBaseOrange900 = \"#4d1a10\";\nexport const ColorBasePrimary100 = \"#eff6fa\";\nexport const ColorBasePrimary200 = \"#c1dbe7\";\nexport const ColorBasePrimary300 = \"#84b7d0\";\nexport const ColorBasePrimary700 = \"#236482\";\nexport const ColorBasePrimary800 = \"#274858\";\nexport const ColorBasePrimary900 = \"#1b303b\";\nexport const ColorBaseSuccess100 = \"#eff7f1\";\nexport const ColorBaseSuccess200 = \"#bddcc6\";\nexport const ColorBaseSuccess300 = \"#81ba92\";\nexport const ColorBaseSuccess700 = \"#397b4d\";\nexport const ColorBaseSuccess800 = \"#2d4936\";\nexport const ColorBaseSuccess900 = \"#1e3124\";\nexport const ColorBasePurple100 = \"#f9f5fa\";\nexport const ColorBasePurple200 = \"#e8dceb\";\nexport const ColorBasePurple300 = \"#cdb4d3\";\nexport const ColorBasePurple700 = \"#8b5f95\";\nexport const ColorBasePurple800 = \"#523b58\";\nexport const ColorBasePurple900 = \"#37273b\";\nexport const ColorBaseYellow100 = \"#fdf5d9\";\nexport const ColorBaseYellow200 = \"#fbe8a3\";\nexport const ColorBaseYellow300 = \"#f8d663\";\nexport const ColorBaseYellow700 = \"#ffc929\";\nexport const ColorBaseYellow800 = \"#765f1c\";\nexport const ColorBaseYellow900 = \"#3b3009\";\nexport const ColorBaseWhite = \"#ffffff\";\nexport const ColorCambioBlack = \"#050500\";\nexport const ColorCambioWhite40 = \"#ffffff\";\nexport const ColorCambioWhite70 = \"#ffffff\";\nexport const ColorCambioWhite100 = \"#ffffff\";\nexport const ColorCambioGray100 = \"#faf4eb\";\nexport const ColorCambioGray200 = \"#e4dbd3\";\nexport const ColorCambioGray270 = \"#e4dbd3\";\nexport const ColorCambioGray300 = \"#beb4ab\";\nexport const ColorCambioGray370 = \"#beb4ab\";\nexport const ColorCambioGray700 = \"#5e5952\";\nexport const ColorCambioGray800 = \"#363432\";\nexport const ColorCambioGray870 = \"#5e5952\";\nexport const ColorCambioGray900 = \"#262625\";\nexport const ColorCambioDestructive100 = \"#ffdeda\";\nexport const ColorCambioDestructive300 = \"#ff8071\";\nexport const ColorCambioDestructive370 = \"#ff8071\";\nexport const ColorCambioDestructive700 = \"#c93f32\";\nexport const ColorCambioDestructive770 = \"#c93f32\";\nexport const ColorCambioDestructive900 = \"#6d0002\";\nexport const ColorCambioSuccess100 = \"#daf2c8\";\nexport const ColorCambioSuccess300 = \"#84ce64\";\nexport const ColorCambioSuccess370 = \"#84ce64\";\nexport const ColorCambioSuccess700 = \"#3c7f20\";\nexport const ColorCambioSuccess770 = \"#3c7f20\";\nexport const ColorCambioSuccess900 = \"#103e00\";\nexport const ColorCambioRed = \"#f56e56\";\nexport const ColorCambioOrange = \"#ff8f57\";\nexport const ColorCambioTan = \"#ffb47d\";\nexport const ColorCambioCream = \"#fffad1\";\nexport const ColorCambioPurple = \"#6840a8\";\nexport const ColorCambioLilac = \"#b59ef0\";\nexport const ColorCambioThistle = \"#d69ca4\";\nexport const ColorCambioPink = \"#ffccea\";\nexport const ColorCambioNavy = \"#191142\";\nexport const ColorCambioTeal = \"#44a6cf\";\nexport const ColorCambioSlate = \"#7c9fc6\";\nexport const ColorCambioSky = \"#b1e8fc\";\nexport const ColorCambioYellow700 = \"#ffe733\";\nexport const ColorCambioTransparentFull = \"#000000\";\nexport const Elevation400 = \"0px 16px 32px 0px #00000040\";\nexport const SyntaxFontSansSerif = \"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif\";\nexport const ShadowInteractive = \"0px 3px 16px 0px rgba(144, 134, 130, 0.05), 0px 2px 30px 0px rgba(144, 134, 130, 0.02)\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/RichSelect/RichSelectList.tsx","css-module:../SelectList/SelectList.module.css#css-module"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,OAAO,gBAAgB;AAQvB;AAAA,EACE,SAAS;AAAA,EACT,YAAY;AAAA,OACP;AACP,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;;;ACpB6D,IAAO,4BAAQ,EAAC,mBAAkB,4BAA2B,kBAAiB,2BAA0B,iBAAgB,2BAA0B,aAAY,uBA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AAA,0BACJ;AAAA;AAAA,sBACF,GACF;AAAA,uBACF;AAAA;AAAA,gBACF;AAAA;AAAA,YACF;AAAA,aACE,cAAc,cACd,oBAAC,eAAI,UAAU,GACb;AAAA,cAAC;AAAA;AAAA,gBACC,MAAM;AAAA,gBACN,OAAO,YAAY,wBAAwB;AAAA,iBACtC,YAAY,oBAAoB,mBAHtC;AAAA,gBAKE,sBAAY,YAAY;AAAA;AAAA,YAC3B,GACF;AAAA;AAAA;AAAA,MAEJ;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,yBAAQ,OAAO,OAAO,gBAAgB;AAAA,EAC3C,SAAS;AAAA,EACT,MAAM;AAAA,EACN,aAAa;AACf,CAAC","sourcesContent":["import React, {\n type ReactElement,\n useMemo,\n type SyntheticEvent,\n useRef,\n useId,\n} from \"react\";\nimport classNames from \"classnames\";\nimport {\n ColorBaseDestructive700,\n ColorBaseGray800,\n} from \"@cambly/syntax-design-tokens\";\nimport Typography from \"../Typography/Typography\";\nimport useIsHydrated from \"../useIsHydrated\";\nimport Popover from \"../Popover/Popover\";\nimport {\n Label as ReactAriaLabel,\n Provider as ReactAriaProvider,\n} from \"react-aria-components\";\nimport { useControlledState } from \"@react-stately/utils\";\nimport { setInteractionModality } from \"@react-aria/interactions\";\nimport { DialogContext } from \"../Dialog/Dialog\";\nimport styles from \"../SelectList/SelectList.module.css\";\nimport RichSelectBox, {\n RichSelectBoxContext,\n convertSelection,\n type RichSelectBoxProps,\n} from \"./RichSelectBox\";\nimport TapArea from \"../TapArea/TapArea\";\nimport { type OverlayHandlerRef } from \"../react-aria-utils/Triggerable\";\nimport Box from \"../Box/Box\";\nimport RichSelectSection from \"./RichSelectSection\";\nimport RichSelectChip from \"./RichSelectChip\";\nimport RichSelectRadioButton from \"./RichSelectRadioButton\";\nimport { useField } from \"react-aria\";\n\nconst NOOP = () => undefined;\n\nexport type RichSelectListProps = RichSelectBoxProps & {\n /** Test id for the select element */\n \"data-testid\"?: string;\n /**\n * Disables the select dropdown entirely\n * @defaultValue false\n */\n disabled?: boolean;\n /** Callback to be called when select is clicked */\n onClick?: (event: SyntheticEvent<HTMLDivElement>) => void;\n /** Text shown below select box if there is an input error. */\n errorText?: string;\n /** Text shown below select box */\n helperText?: string;\n /**\n * RichSelectList id, if not provided, a unique id will be generated\n */\n id?: string;\n /** Text shown above select box */\n label: string;\n /**\n * Text showing in select box if no option has been chosen.\n * There should always have a placeholder unless there is a default option selected\n */\n placeholderText?: string;\n /** Use to render (override) text shown in the select box */\n selectTextValue?: (selectedValues?: \"all\" | string[]) => string | undefined;\n};\n\n/**\n * [RichSelectList](https://cambly-syntax.vercel.app/?path=/docs/components-richselectlist--docs) is a dropdown menu that allows users to select one or multiple options from a list.\n *\n * Example Usage:\n ```\n <RichSelectList\n label=\"My Label\"\n multiple\n onChange={() => { ... }}\n primaryButtonText=\"Save\"\n primaryButtonAccessibilityLabel=\"Save\"\n secondaryButtonText=\"Clear\"\n secondaryButtonAccessibilityLabel=\"Clear\"\n >\n <RichSelectList.Section label=\"Cities\">\n <RichSelectList.Chip label=\"San Francisco\" value=\"sf\" />\n <RichSelectList.Chip label=\"New York\" value=\"ny\" disabled />\n <RichSelectList.Chip label=\"Tulsa\" value=\"tulsa\" />\n <RichSelectList.Chip label=\"Chicago\" value=\"chicago\" disabled />\n </RichSelectList.Section>\n </RichSelectList>\n ```\n */\nfunction RichSelectList(props: RichSelectListProps): ReactElement {\n const {\n autosave,\n children,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n errorText,\n helperText,\n label,\n id,\n onChange,\n onClick = NOOP,\n placeholderText,\n selectTextValue,\n selectedValues: selectedValuesProp,\n defaultSelectedValues: defaultSelectedValuesProp,\n ...richSelectBoxProps\n } = props;\n\n const reactId = useId();\n const inputId = id ?? reactId;\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n\n // passed to popover, which attached open/close methods\n const overlayHandlerRef = useRef<OverlayHandlerRef>({});\n\n const selectedKeysProp = useMemo(\n () => convertSelection(selectedValuesProp),\n [selectedValuesProp],\n );\n const defaultSelectedKeys = useMemo(\n () => convertSelection(defaultSelectedValuesProp, new Set()),\n [defaultSelectedValuesProp],\n );\n const [selectedKeys, setSelectedKeys] = useControlledState(\n selectedKeysProp!, // eslint-disable-line @typescript-eslint/no-non-null-assertion -- there is a bug in the typedef for useControlledState from react-stately. Internally they rely on value (first arg) able to be undefined\n defaultSelectedKeys,\n (value) => {\n const _value = value === \"all\" ? \"all\" : [...value].map(String);\n onChange(_value);\n if (!autosave) overlayHandlerRef.current.close?.();\n },\n );\n\n const selectedTextValue = useMemo(() => {\n if (selectTextValue)\n return (\n selectTextValue(\n selectedKeys === \"all\" ? \"all\" : [...selectedKeys].map(String),\n ) ?? placeholderText\n );\n if (selectedKeys === \"all\") return \"All selected\";\n if (selectedKeys.size) return `${selectedKeys.size} selected`;\n return placeholderText;\n }, [selectTextValue, selectedKeys, placeholderText]);\n\n const fieldRef = useRef<HTMLDivElement>(null);\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } =\n useField({\n label, // this is the label for the select box\n description: helperText,\n errorMessage: errorText,\n });\n\n return (\n <ReactAriaProvider\n values={[\n [RichSelectBoxContext, { autoFocus: true }],\n [DialogContext, { padding: autosave ? undefined : 0 }], // this is altering Popover's internal dialog padding to show the sticky save/close buttons. Ideally this could be avoided\n ]}\n >\n <div\n className={classNames(styles.selectContainer, {\n [styles.opacityOverlay]: disabled,\n })}\n onClick={onClick}\n >\n {label && (\n <>\n <ReactAriaLabel\n data-testid={[dataTestId, \"label\"].filter(Boolean).join(\"-\")}\n {...labelProps}\n onClick={() => {\n if (disabled) return;\n fieldRef.current?.focus();\n setInteractionModality(\"keyboard\"); // Show the focus ring so the user knows where focus went\n }}\n >\n <Box paddingX={1}>\n <Typography size={100} color=\"gray700\">\n {label}\n </Typography>\n </Box>\n </ReactAriaLabel>\n </>\n )}\n <Popover\n ref={overlayHandlerRef}\n disabled={disabled}\n content={\n // this Box wrapper is to reapply the padding that was stripped from popover's dialog to show the sticky save/close buttons. Ideally this could be avoided\n <Box\n padding={autosave ? undefined : 5}\n dangerouslySetInlineStyle={\n autosave ? undefined : { __style: { paddingBottom: 0 } }\n }\n role=\"menu\"\n >\n <RichSelectBox\n autosave={autosave}\n selectedValues={selectedKeys}\n defaultSelectedValues={defaultSelectedKeys}\n onChange={(selected) => setSelectedKeys(new Set(selected))}\n {...richSelectBoxProps}\n accessibilityLabel={inputId}\n >\n {children}\n </RichSelectBox>\n </Box>\n }\n >\n <TapArea\n data-testid={dataTestId}\n disabled={disabled}\n onClick={onClick}\n rounding=\"md\"\n {...fieldProps}\n ref={fieldRef}\n >\n <div className={styles.selectWrapper}>\n <div\n className={classNames(\n styles.selectBox,\n styles.selectBoxCambio,\n {\n [styles.unselected]:\n !errorText &&\n selectedKeys !== \"all\" &&\n !selectedKeys.size,\n [styles.selected]:\n !errorText &&\n (selectedKeys === \"all\" || selectedKeys.size),\n [styles.selectErrorCambio]: errorText,\n },\n )}\n >\n {selectedTextValue}\n </div>\n <div className={styles.arrowIcon}>\n <svg\n focusable=\"false\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width={24}\n >\n <path\n fill={\n errorText ? ColorBaseDestructive700 : ColorBaseGray800\n }\n d=\"M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z\"\n />\n </svg>\n </div>\n </div>\n </TapArea>\n </Popover>\n {(helperText || errorText) && (\n <Box paddingX={1}>\n <Typography\n size={100}\n color={errorText ? \"destructive-primary\" : \"gray700\"}\n {...(errorText ? errorMessageProps : descriptionProps)}\n >\n {errorText ? errorText : helperText}\n </Typography>\n </Box>\n )}\n </div>\n </ReactAriaProvider>\n );\n}\n\nexport default Object.assign(RichSelectList, {\n Section: RichSelectSection,\n Chip: RichSelectChip,\n RadioButton: RichSelectRadioButton,\n});\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/SelectList/SelectList.module.css\"; export default {\"selectContainer\":\"_selectContainer_1g9ap_1\",\"opacityOverlay\":\"_opacityOverlay_1g9ap_7\",\"selectWrapper\":\"_selectWrapper_1g9ap_11\",\"selectBox\":\"_selectBox_1g9ap_16\",\"selectBoxCambio\":\"_selectBoxCambio_1g9ap_30\",\"selectMouseFocusStyling\":\"_selectMouseFocusStyling_1g9ap_38\",\"unselected\":\"_unselected_1g9ap_43\",\"selected\":\"_selected_1g9ap_47\",\"arrowIcon\":\"_arrowIcon_1g9ap_51\",\"selectErrorCambio\":\"_selectErrorCambio_1g9ap_65\",\"selectColorwhite\":\"_selectColorwhite_1g9ap_71\",\"selectColorclear\":\"_selectColorclear_1g9ap_77\"}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/SelectList/SelectList.tsx","css-module:./SelectList.module.css#css-module"],"sourcesContent":["import React, {\n type ReactElement,\n type ReactNode,\n useId,\n useState,\n type ComponentProps,\n} from \"react\";\nimport Box from \"../Box/Box\";\nimport classNames from \"classnames\";\nimport {\n ColorBaseDestructive700,\n ColorBaseGray700,\n ColorCambioWhite100,\n} from \"@cambly/syntax-design-tokens\";\nimport Typography from \"../Typography/Typography\";\nimport styles from \"./SelectList.module.css\";\nimport focusStyles from \"../Focus.module.css\";\nimport SelectOption from \"./SelectOption\";\nimport useFocusVisible from \"../useFocusVisible\";\nimport useIsHydrated from \"../useIsHydrated\";\n\n/**\n * [SelectList](https://cambly-syntax.vercel.app/?path=/docs/components-selectlist--docs) is a dropdown menu that allows users to select one option from a list.\n */\nexport default function SelectList({\n children,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n errorText,\n helperText,\n id,\n label,\n onChange,\n onClick,\n placeholderText,\n selectedValue = \"\",\n color = \"white\",\n}: {\n /**\n * One or more SelectList.Option components.\n */\n children: ReactNode;\n /**\n * Test id for the select element\n */\n \"data-testid\"?: string;\n /**\n * true if the select dropdown is disabled\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Callback to be called when select is clicked\n */\n onClick?: (event: React.SyntheticEvent<HTMLSelectElement>) => void;\n /**\n * Text shown below select box if there is an input error.\n */\n errorText?: string;\n /**\n * Text shown below select box\n */\n helperText?: string;\n /**\n * Id of the select element\n */\n id?: string;\n /**\n * Text shown above select box\n */\n label: string;\n /**\n * The callback to be called when an option is selected\n */\n onChange: React.ChangeEventHandler<HTMLSelectElement>;\n /**\n * Text showing in select box if no option has been chosen.\n * We should always have a placeholder unless there is a default option selected\n */\n placeholderText?: string;\n /**\n * Value of the currently selected option\n */\n selectedValue?: string;\n /**\n * Color of the select box\n * @defaultValue white\n */\n color?: \"white\" | \"clear\";\n}): ReactElement {\n const reactId = useId();\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n const selectId = id ?? reactId;\n const { isFocusVisible } = useFocusVisible();\n const [isFocused, setIsFocused] = useState(false);\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLSelectElement> = (\n event,\n ) => {\n if (disabled || onClick == null) return;\n if (event.key === \"Enter\" || event.key === \" \" || event.key === \"Space\") {\n onClick(event);\n }\n };\n\n const textColor: Record<\n NonNullable<ComponentProps<typeof SelectList>[\"color\"]>,\n ComponentProps<typeof Typography>[\"color\"]\n > = {\n white: \"gray700\",\n clear: \"white\",\n };\n\n const getArrowIconColor = () => {\n if (errorText) {\n return ColorBaseDestructive700;\n } else {\n if (color === \"clear\") {\n return ColorCambioWhite100;\n } else {\n return ColorBaseGray700;\n }\n }\n };\n\n return (\n <div\n className={classNames(styles.selectContainer, {\n [styles.opacityOverlay]: disabled,\n })}\n >\n {label && (\n <label htmlFor={selectId}>\n <Box paddingX={1}>\n <Typography size={100} color={textColor[color]}>\n {label}\n </Typography>\n </Box>\n </label>\n )}\n <div className={styles.selectWrapper}>\n <select\n id={selectId}\n data-testid={dataTestId}\n disabled={disabled}\n className={classNames(styles.selectBox, styles.selectBoxCambio, {\n [styles.unselected]: !selectedValue && !errorText,\n [styles.selected]: selectedValue && !errorText,\n [styles.selectErrorCambio]: errorText,\n [focusStyles.accessibilityOutlineFocus]:\n isFocused && isFocusVisible, // for focus keyboard\n [styles.selectMouseFocusStyling]: isFocused && !isFocusVisible, // for focus mouse\n [styles[`selectColor${color}`]]: color,\n })}\n onChange={onChange}\n onClick={onClick}\n onKeyDown={handleKeyDown}\n value={\n placeholderText && !selectedValue ? placeholderText : selectedValue\n }\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n >\n {placeholderText && (\n <option disabled value={placeholderText}>\n {placeholderText}\n </option>\n )}\n {children}\n </select>\n <div className={styles.arrowIcon}>\n <svg\n focusable=\"false\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width={24}\n >\n <path\n fill={getArrowIconColor()}\n d=\"M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z\"\n />\n </svg>\n </div>\n </div>\n {(helperText || errorText) && (\n <Box paddingX={1}>\n <Typography\n size={100}\n color={errorText ? \"destructive-primary\" : textColor[color]}\n >\n {errorText ? errorText : helperText}\n </Typography>\n </Box>\n )}\n </div>\n );\n}\n\nSelectList.Option = SelectOption;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/SelectList/SelectList.module.css\"; export default {\"selectContainer\":\"_selectContainer_1g9ap_1\",\"opacityOverlay\":\"_opacityOverlay_1g9ap_7\",\"selectWrapper\":\"_selectWrapper_1g9ap_11\",\"selectBox\":\"_selectBox_1g9ap_16\",\"selectBoxCambio\":\"_selectBoxCambio_1g9ap_30\",\"selectMouseFocusStyling\":\"_selectMouseFocusStyling_1g9ap_38\",\"unselected\":\"_unselected_1g9ap_43\",\"selected\":\"_selected_1g9ap_47\",\"arrowIcon\":\"_arrowIcon_1g9ap_51\",\"selectErrorCambio\":\"_selectErrorCambio_1g9ap_65\",\"selectColorwhite\":\"_selectColorwhite_1g9ap_71\",\"selectColorclear\":\"_selectColorclear_1g9ap_77\"}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EAGE;AAAA,EACA;AAAA,OAEK;AAEP,OAAO,gBAAgB;;;ACR6E,IAAO,4BAAQ,EAAC,mBAAkB,4BAA2B,kBAAiB,2BAA0B,iBAAgB,2BAA0B,aAAY,uBAAsB,mBAAkB,6BAA4B,2BAA0B,qCAAoC,cAAa,wBAAuB,YAAW,sBAAqB,aAAY,uBAAsB,qBAAoB,+BAA8B,oBAAmB,8BAA6B,oBAAmB,6BAA4B;;;ADuI/mB,cAOJ,YAPI;AA/GG,SAAR,WAA4B;AAAA,EACjC;AAAA,EACA,eAAe;AAAA,EACf,UAAU,eAAe;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB,QAAQ;AACV,GAoDiB;AACf,QAAM,UAAU,MAAM;AACtB,QAAM,aAAa,cAAc;AACjC,QAAM,WAAW,CAAC,cAAc;AAChC,QAAM,WAAW,kBAAM;AACvB,QAAM,EAAE,eAAe,IAAI,gBAAgB;AAC3C,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAEhD,QAAM,gBAA+D,CACnE,UACG;AACH,QAAI,YAAY,WAAW;AAAM;AACjC,QAAI,MAAM,QAAQ,WAAW,MAAM,QAAQ,OAAO,MAAM,QAAQ,SAAS;AACvE,cAAQ,KAAK;AAAA,IACf;AAAA,EACF;AAEA,QAAM,YAGF;AAAA,IACF,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAEA,QAAM,oBAAoB,MAAM;AAC9B,QAAI,WAAW;AACb,aAAO;AAAA,IACT,OAAO;AACL,UAAI,UAAU,SAAS;AACrB,eAAO;AAAA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AA,gBAAC;AAAA;AAAA,kBACC,MAAM,kBAAkB;AAAA,kBACxB,GAAE;AAAA;AAAA,cACJ;AAAA;AAAA,UACF,GACF;AAAA,WACF;AAAA,SACE,cAAc,cACd,oBAAC,eAAI,UAAU,GACb;AAAA,UAAC;AAAA;AAAA,YACC,MAAM;AAAA,YACN,OAAO,YAAY,wBAAwB,UAAU,KAAK;AAAA,YAEzD,sBAAY,YAAY;AAAA;AAAA,QAC3B,GACF;AAAA;AAAA;AAAA,EAEJ;AAEJ;AAEA,WAAW,SAAS;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/RichSelect/RichSelectList.tsx","css-module:../SelectList/SelectList.module.css#css-module"],"sourcesContent":["import React, {\n type ReactElement,\n useMemo,\n type SyntheticEvent,\n useRef,\n useId,\n} from \"react\";\nimport classNames from \"classnames\";\nimport {\n ColorBaseDestructive700,\n ColorBaseGray800,\n} from \"@cambly/syntax-design-tokens\";\nimport Typography from \"../Typography/Typography\";\nimport useIsHydrated from \"../useIsHydrated\";\nimport Popover from \"../Popover/Popover\";\nimport {\n Label as ReactAriaLabel,\n Provider as ReactAriaProvider,\n} from \"react-aria-components\";\nimport { useControlledState } from \"@react-stately/utils\";\nimport { setInteractionModality } from \"@react-aria/interactions\";\nimport { DialogContext } from \"../Dialog/Dialog\";\nimport styles from \"../SelectList/SelectList.module.css\";\nimport RichSelectBox, {\n RichSelectBoxContext,\n convertSelection,\n type RichSelectBoxProps,\n} from \"./RichSelectBox\";\nimport TapArea from \"../TapArea/TapArea\";\nimport { type OverlayHandlerRef } from \"../react-aria-utils/Triggerable\";\nimport Box from \"../Box/Box\";\nimport RichSelectSection from \"./RichSelectSection\";\nimport RichSelectChip from \"./RichSelectChip\";\nimport RichSelectRadioButton from \"./RichSelectRadioButton\";\nimport { useField } from \"react-aria\";\n\nconst NOOP = () => undefined;\n\nexport type RichSelectListProps = RichSelectBoxProps & {\n /** Test id for the select element */\n \"data-testid\"?: string;\n /**\n * Disables the select dropdown entirely\n * @defaultValue false\n */\n disabled?: boolean;\n /** Callback to be called when select is clicked */\n onClick?: (event: SyntheticEvent<HTMLDivElement>) => void;\n /** Text shown below select box if there is an input error. */\n errorText?: string;\n /** Text shown below select box */\n helperText?: string;\n /**\n * RichSelectList id, if not provided, a unique id will be generated\n */\n id?: string;\n /** Text shown above select box */\n label: string;\n /**\n * Text showing in select box if no option has been chosen.\n * There should always have a placeholder unless there is a default option selected\n */\n placeholderText?: string;\n /** Use to render (override) text shown in the select box */\n selectTextValue?: (selectedValues?: \"all\" | string[]) => string | undefined;\n};\n\n/**\n * [RichSelectList](https://cambly-syntax.vercel.app/?path=/docs/components-richselectlist--docs) is a dropdown menu that allows users to select one or multiple options from a list.\n *\n * Example Usage:\n ```\n <RichSelectList\n label=\"My Label\"\n multiple\n onChange={() => { ... }}\n primaryButtonText=\"Save\"\n primaryButtonAccessibilityLabel=\"Save\"\n secondaryButtonText=\"Clear\"\n secondaryButtonAccessibilityLabel=\"Clear\"\n >\n <RichSelectList.Section label=\"Cities\">\n <RichSelectList.Chip label=\"San Francisco\" value=\"sf\" />\n <RichSelectList.Chip label=\"New York\" value=\"ny\" disabled />\n <RichSelectList.Chip label=\"Tulsa\" value=\"tulsa\" />\n <RichSelectList.Chip label=\"Chicago\" value=\"chicago\" disabled />\n </RichSelectList.Section>\n </RichSelectList>\n ```\n */\nfunction RichSelectList(props: RichSelectListProps): ReactElement {\n const {\n autosave,\n children,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n errorText,\n helperText,\n label,\n id,\n onChange,\n onClick = NOOP,\n placeholderText,\n selectTextValue,\n selectedValues: selectedValuesProp,\n defaultSelectedValues: defaultSelectedValuesProp,\n ...richSelectBoxProps\n } = props;\n\n const reactId = useId();\n const inputId = id ?? reactId;\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n\n // passed to popover, which attached open/close methods\n const overlayHandlerRef = useRef<OverlayHandlerRef>({});\n\n const selectedKeysProp = useMemo(\n () => convertSelection(selectedValuesProp),\n [selectedValuesProp],\n );\n const defaultSelectedKeys = useMemo(\n () => convertSelection(defaultSelectedValuesProp, new Set()),\n [defaultSelectedValuesProp],\n );\n const [selectedKeys, setSelectedKeys] = useControlledState(\n selectedKeysProp!, // eslint-disable-line @typescript-eslint/no-non-null-assertion -- there is a bug in the typedef for useControlledState from react-stately. Internally they rely on value (first arg) able to be undefined\n defaultSelectedKeys,\n (value) => {\n const _value = value === \"all\" ? \"all\" : [...value].map(String);\n onChange(_value);\n if (!autosave) overlayHandlerRef.current.close?.();\n },\n );\n\n const selectedTextValue = useMemo(() => {\n if (selectTextValue)\n return (\n selectTextValue(\n selectedKeys === \"all\" ? \"all\" : [...selectedKeys].map(String),\n ) ?? placeholderText\n );\n if (selectedKeys === \"all\") return \"All selected\";\n if (selectedKeys.size) return `${selectedKeys.size} selected`;\n return placeholderText;\n }, [selectTextValue, selectedKeys, placeholderText]);\n\n const fieldRef = useRef<HTMLDivElement>(null);\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } =\n useField({\n label, // this is the label for the select box\n description: helperText,\n errorMessage: errorText,\n });\n\n return (\n <ReactAriaProvider\n values={[\n [RichSelectBoxContext, { autoFocus: true }],\n [DialogContext, { padding: autosave ? undefined : 0 }], // this is altering Popover's internal dialog padding to show the sticky save/close buttons. Ideally this could be avoided\n ]}\n >\n <div\n className={classNames(styles.selectContainer, {\n [styles.opacityOverlay]: disabled,\n })}\n onClick={onClick}\n >\n {label && (\n <>\n <ReactAriaLabel\n data-testid={[dataTestId, \"label\"].filter(Boolean).join(\"-\")}\n {...labelProps}\n onClick={() => {\n if (disabled) return;\n fieldRef.current?.focus();\n setInteractionModality(\"keyboard\"); // Show the focus ring so the user knows where focus went\n }}\n >\n <Box paddingX={1}>\n <Typography size={100} color=\"gray700\">\n {label}\n </Typography>\n </Box>\n </ReactAriaLabel>\n </>\n )}\n <Popover\n ref={overlayHandlerRef}\n disabled={disabled}\n content={\n // this Box wrapper is to reapply the padding that was stripped from popover's dialog to show the sticky save/close buttons. Ideally this could be avoided\n <Box\n padding={autosave ? undefined : 5}\n dangerouslySetInlineStyle={\n autosave ? undefined : { __style: { paddingBottom: 0 } }\n }\n role=\"menu\"\n >\n <RichSelectBox\n autosave={autosave}\n selectedValues={selectedKeys}\n defaultSelectedValues={defaultSelectedKeys}\n onChange={(selected) => setSelectedKeys(new Set(selected))}\n {...richSelectBoxProps}\n accessibilityLabel={inputId}\n >\n {children}\n </RichSelectBox>\n </Box>\n }\n >\n <TapArea\n data-testid={dataTestId}\n disabled={disabled}\n onClick={onClick}\n rounding=\"md\"\n {...fieldProps}\n ref={fieldRef}\n >\n <div className={styles.selectWrapper}>\n <div\n className={classNames(\n styles.selectBox,\n styles.selectBoxCambio,\n {\n [styles.unselected]:\n !errorText &&\n selectedKeys !== \"all\" &&\n !selectedKeys.size,\n [styles.selected]:\n !errorText &&\n (selectedKeys === \"all\" || selectedKeys.size),\n [styles.selectErrorCambio]: errorText,\n },\n )}\n >\n {selectedTextValue}\n </div>\n <div className={styles.arrowIcon}>\n <svg\n focusable=\"false\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width={24}\n >\n <path\n fill={\n errorText ? ColorBaseDestructive700 : ColorBaseGray800\n }\n d=\"M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z\"\n />\n </svg>\n </div>\n </div>\n </TapArea>\n </Popover>\n {(helperText || errorText) && (\n <Box paddingX={1}>\n <Typography\n size={100}\n color={errorText ? \"destructive-primary\" : \"gray700\"}\n {...(errorText ? errorMessageProps : descriptionProps)}\n >\n {errorText ? errorText : helperText}\n </Typography>\n </Box>\n )}\n </div>\n </ReactAriaProvider>\n );\n}\n\nexport default Object.assign(RichSelectList, {\n Section: RichSelectSection,\n Chip: RichSelectChip,\n RadioButton: RichSelectRadioButton,\n});\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/SelectList/SelectList.module.css\"; export default {\"selectContainer\":\"_selectContainer_1g9ap_1\",\"opacityOverlay\":\"_opacityOverlay_1g9ap_7\",\"selectWrapper\":\"_selectWrapper_1g9ap_11\",\"selectBox\":\"_selectBox_1g9ap_16\",\"selectBoxCambio\":\"_selectBoxCambio_1g9ap_30\",\"selectMouseFocusStyling\":\"_selectMouseFocusStyling_1g9ap_38\",\"unselected\":\"_unselected_1g9ap_43\",\"selected\":\"_selected_1g9ap_47\",\"arrowIcon\":\"_arrowIcon_1g9ap_51\",\"selectErrorCambio\":\"_selectErrorCambio_1g9ap_65\",\"selectColorwhite\":\"_selectColorwhite_1g9ap_71\",\"selectColorclear\":\"_selectColorclear_1g9ap_77\"}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,OAAO,gBAAgB;AAQvB;AAAA,EACE,SAAS;AAAA,EACT,YAAY;AAAA,OACP;AACP,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;;;ACpB6D,IAAO,4BAAQ,EAAC,mBAAkB,4BAA2B,kBAAiB,2BAA0B,iBAAgB,2BAA0B,aAAY,uBAAsB,mBAAkB,6BAA4B,2BAA0B,qCAAoC,cAAa,wBAAuB,YAAW,sBAAqB,aAAY,uBAAsB,qBAAoB,+BAA8B,oBAAmB,8BAA6B,oBAAmB,6BAA4B;;;ADkC3nB,SAAS,gBAAgB;AAuIf,mBAWM,KAwCJ,YAnDF;AArIV,IAAM,OAAO,MAAM;AAsDnB,SAAS,eAAe,OAA0C;AAChE,QAgBI,YAfF;AAAA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf,UAAU,eAAe;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAA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