@cambly/syntax-core 22.1.0 → 22.2.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.
@@ -25,7 +25,7 @@ declare const Avatar: ({ accessibilityLabel, icon, size, src, }: {
25
25
  *
26
26
  * @defaultValue `md`
27
27
  */
28
- size?: "md" | "sm" | "xs" | "lg" | "xl" | undefined;
28
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
29
29
  /**
30
30
  * URL of the image to display as the avatar.
31
31
  */
@@ -11,7 +11,7 @@ declare const Badge: ({ icon: Icon, text, color, }: {
11
11
  className?: string | undefined;
12
12
  }> | React.ComponentType<{
13
13
  color?: "inherit" | "black" | "destructive100" | "destructive200" | "destructive300" | "destructive700" | "destructive800" | "destructive900" | "gray10" | "gray100" | "gray200" | "gray30" | "gray60" | "gray300" | "gray700" | "gray80" | "gray800" | "gray900" | "orange100" | "orange200" | "orange300" | "orange700" | "orange800" | "orange900" | "primary100" | "primary200" | "primary300" | "primary700" | "primary800" | "primary900" | "purple100" | "purple200" | "purple300" | "purple700" | "purple800" | "purple900" | "success100" | "success200" | "success300" | "success700" | "success800" | "success900" | "white" | "yellow100" | "yellow200" | "yellow300" | "yellow700" | "yellow800" | "yellow900" | "white40" | "white70" | "gray270" | "gray370" | "gray870" | "cream" | "lilac" | "navy" | "orange" | "pink" | "purple" | "red" | "sky" | "slate" | "tan" | "teal" | "thistle" | undefined;
14
- size?: 100 | 200 | 300 | 400 | 500 | 700 | 800 | 900 | 600 | 1000 | undefined;
14
+ size?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 1000 | undefined;
15
15
  path?: string | undefined;
16
16
  } & React.RefAttributes<SVGSVGElement>> | undefined;
17
17
  /**
@@ -23,7 +23,7 @@ declare const ButtonGroup: ({ orientation, size, children, smOrientation, lgOrie
23
23
  *
24
24
  * @defaultValue "md"
25
25
  */
26
- size?: "md" | "sm" | "lg" | undefined;
26
+ size?: "sm" | "md" | "lg" | undefined;
27
27
  /**
28
28
  * Buttons to be rendered inside the button group
29
29
  */
@@ -32,7 +32,7 @@ declare const Checkbox: ({ checked, "data-testid": dataTestId, disabled: disable
32
32
  *
33
33
  * @defaultValue "md"
34
34
  */
35
- size?: "md" | "sm" | undefined;
35
+ size?: "sm" | "md" | undefined;
36
36
  /**
37
37
  * The text accompanying the checkbox
38
38
  */
@@ -11,7 +11,7 @@ declare const Heading: ({ align, as, children, color, "data-testid": dataTestId,
11
11
  *
12
12
  * @defaultValue "start"
13
13
  */
14
- align?: "center" | "end" | "start" | "forceLeft" | "forceRight" | undefined;
14
+ align?: "center" | "start" | "end" | "forceLeft" | "forceRight" | undefined;
15
15
  /**
16
16
  * DOM element to render as.
17
17
  *
@@ -58,7 +58,7 @@ declare const LinkTapArea: React__default.ForwardRefExoticComponent<React__defau
58
58
  *
59
59
  * @defaultValue "none"
60
60
  */
61
- rounding?: "none" | "md" | "sm" | "full" | undefined;
61
+ rounding?: "sm" | "md" | "full" | "none" | undefined;
62
62
  /**
63
63
  * The tab index of the tap area
64
64
  */
@@ -50,7 +50,7 @@ declare const RadioButton: ({ checked, "data-testid": dataTestId, dangerouslyFor
50
50
  *
51
51
  * @defaultValue "md"
52
52
  */
53
- size?: "md" | "sm" | undefined;
53
+ size?: "sm" | "md" | undefined;
54
54
  /**
55
55
  * Value of the selected radio option
56
56
  */
@@ -49,7 +49,7 @@ declare const _default: React__default.ForwardRefExoticComponent<RichSelectBoxPr
49
49
  Chip: React__default.ForwardRefExoticComponent<RichSelectItemProps & React__default.RefAttributes<HTMLDivElement>>;
50
50
  RadioButton: React__default.ForwardRefExoticComponent<RichSelectItemProps & {
51
51
  name: string;
52
- size?: "md" | "sm" | undefined;
52
+ size?: "sm" | "md" | undefined;
53
53
  } & React__default.RefAttributes<HTMLDivElement>>;
54
54
  };
55
55
 
@@ -1,7 +1,7 @@
1
+ import * as react_aria_components from 'react-aria-components';
1
2
  import { RichSelectItemProps } from './RichSelectItem.js';
2
3
  import React__default, { SyntheticEvent, ReactElement } from 'react';
3
4
  import { RichSelectBoxProps } from './RichSelectBox.js';
4
- import 'react-aria-components';
5
5
  import 'react-aria';
6
6
  import './RichSelectSection.js';
7
7
  import './RichSelectChip.js';
@@ -78,7 +78,10 @@ declare const _default: typeof RichSelectList & {
78
78
  Chip: React__default.ForwardRefExoticComponent<RichSelectItemProps & React__default.RefAttributes<HTMLDivElement>>;
79
79
  RadioButton: React__default.ForwardRefExoticComponent<RichSelectItemProps & {
80
80
  name: string;
81
- size?: "md" | "sm" | undefined;
81
+ size?: "sm" | "md" | undefined;
82
+ } & React__default.RefAttributes<HTMLDivElement>>;
83
+ Item: React__default.ForwardRefExoticComponent<RichSelectItemProps & {
84
+ children?: string | React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | ((values: react_aria_components.ListBoxItemRenderProps) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>>) | undefined;
82
85
  } & React__default.RefAttributes<HTMLDivElement>>;
83
86
  };
84
87
 
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  RichSelectList_default
4
- } from "../__chunks/5MOBRFQE.js";
4
+ } from "../__chunks/ZC7RS5V7.js";
5
5
  import "../__chunks/R6OBV53M.js";
6
6
  import "../__chunks/36DG472B.js";
7
7
  import "../__chunks/WJ4QY73I.js";
@@ -12,7 +12,7 @@ import "../__chunks/576PJXFR.js";
12
12
  import "../__chunks/3WKVZ2UU.js";
13
13
  import "../__chunks/KEJPRZJ5.js";
14
14
  import "../__chunks/4U4UW4AK.js";
15
- import "../__chunks/BNIBTPIA.js";
15
+ import "../__chunks/X3XMN7RS.js";
16
16
  import "../__chunks/Y53Z25OG.js";
17
17
  import "../__chunks/DDUJFFG7.js";
18
18
  import "../__chunks/N7G37EKF.js";
@@ -5,7 +5,7 @@ import 'react-aria';
5
5
 
6
6
  declare const _default: React__default.ForwardRefExoticComponent<RichSelectItemProps & {
7
7
  name: string;
8
- size?: "md" | "sm" | undefined;
8
+ size?: "sm" | "md" | undefined;
9
9
  } & React__default.RefAttributes<HTMLDivElement>>;
10
10
 
11
11
  export { _default as default };
@@ -1,9 +1,9 @@
1
1
  "use client"
2
2
  import {
3
3
  SelectList
4
- } from "../__chunks/V3A22FFS.js";
4
+ } from "../__chunks/W6IQWQ6Z.js";
5
5
  import "../__chunks/SPQ7DQHG.js";
6
- import "../__chunks/BNIBTPIA.js";
6
+ import "../__chunks/X3XMN7RS.js";
7
7
  import "../__chunks/KKADUD65.js";
8
8
  import "../__chunks/X552U42S.js";
9
9
  import "../__chunks/4U4UW4AK.js";
@@ -52,7 +52,7 @@ declare const TapArea: React__default.ForwardRefExoticComponent<React__default.A
52
52
  *
53
53
  * @defaultValue "none"
54
54
  */
55
- rounding?: "none" | "md" | "sm" | "full" | undefined;
55
+ rounding?: "sm" | "md" | "full" | "none" | undefined;
56
56
  /**
57
57
  * The tab index of the tap area
58
58
  */
@@ -12,7 +12,7 @@ declare const Typography: React.ForwardRefExoticComponent<{
12
12
  *
13
13
  * @defaultValue "start"
14
14
  */
15
- align?: "center" | "end" | "start" | "forceLeft" | "forceRight" | undefined;
15
+ align?: "center" | "start" | "end" | "forceLeft" | "forceRight" | undefined;
16
16
  /**
17
17
  * DOM element to render as.
18
18
  *
@@ -28,7 +28,7 @@ declare const Typography: React.ForwardRefExoticComponent<{
28
28
  *
29
29
  * @defaultValue "gray900"
30
30
  */
31
- color?: "inherit" | "gray700" | "gray900" | "white" | "primary" | "destructive-primary" | "destructive-lightBackground" | "destructive-darkBackground" | "success" | "success-darkBackground" | "white-secondary" | undefined;
31
+ color?: "inherit" | "gray700" | "gray900" | "white" | "primary" | "destructive-primary" | "success" | "destructive-darkBackground" | "destructive-lightBackground" | "success-darkBackground" | "white-secondary" | undefined;
32
32
  /**
33
33
  * Test id for the text
34
34
  */
@@ -111,7 +111,7 @@ declare const Typography: React.ForwardRefExoticComponent<{
111
111
  *
112
112
  * @defaultValue "regular"
113
113
  */
114
- weight?: "bold" | "regular" | "medium" | "semiBold" | undefined;
114
+ weight?: "regular" | "medium" | "semiBold" | "bold" | undefined;
115
115
  /**
116
116
  * Controls how whitespace within the element is handled.
117
117
  *
@@ -119,7 +119,7 @@ declare const Typography: React.ForwardRefExoticComponent<{
119
119
  *
120
120
  * @defaultValue "inherit"
121
121
  */
122
- whiteSpace?: "inherit" | "nowrap" | "normal" | "preLine" | undefined;
122
+ whiteSpace?: "inherit" | "normal" | "nowrap" | "preLine" | undefined;
123
123
  } & React.RefAttributes<HTMLDivElement>>;
124
124
 
125
125
  export { Typography as default };
@@ -6,7 +6,7 @@ import {
6
6
  ColorBaseDestructive700,
7
7
  ColorBaseGray700,
8
8
  ColorCambioWhite100
9
- } from "./BNIBTPIA.js";
9
+ } from "./X3XMN7RS.js";
10
10
  import {
11
11
  Focus_module_default
12
12
  } from "./KKADUD65.js";
@@ -140,4 +140,4 @@ SelectList.Option = SelectOption_default;
140
140
  export {
141
141
  SelectList
142
142
  };
143
- //# sourceMappingURL=V3A22FFS.js.map
143
+ //# sourceMappingURL=W6IQWQ6Z.js.map
@@ -10,4 +10,4 @@ export {
10
10
  ColorBaseGray700,
11
11
  ColorCambioWhite100
12
12
  };
13
- //# sourceMappingURL=BNIBTPIA.js.map
13
+ //# sourceMappingURL=X3XMN7RS.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Wed, 05 Mar 2025 19:53: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":[]}
1
+ {"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Mon, 10 Mar 2025 18:53:04 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":[]}
@@ -14,7 +14,7 @@ import {
14
14
  ColorBaseDestructive700,
15
15
  ColorBaseGray700,
16
16
  ColorCambioWhite100
17
- } from "./BNIBTPIA.js";
17
+ } from "./X3XMN7RS.js";
18
18
  import {
19
19
  RichSelectSection_default
20
20
  } from "./Y53Z25OG.js";
@@ -24,6 +24,9 @@ import {
24
24
  import {
25
25
  RichSelectChip_default
26
26
  } from "./LUK43ZOB.js";
27
+ import {
28
+ RichSelectItem_default
29
+ } from "./ODMJANSX.js";
27
30
  import {
28
31
  TapArea_default
29
32
  } from "./OXEXFQAN.js";
@@ -283,10 +286,11 @@ function RichSelectList(props) {
283
286
  var RichSelectList_default = Object.assign(RichSelectList, {
284
287
  Section: RichSelectSection_default,
285
288
  Chip: RichSelectChip_default,
286
- RadioButton: RichSelectRadioButton_default
289
+ RadioButton: RichSelectRadioButton_default,
290
+ Item: RichSelectItem_default
287
291
  });
288
292
 
289
293
  export {
290
294
  RichSelectList_default
291
295
  };
292
- //# sourceMappingURL=5MOBRFQE.js.map
296
+ //# sourceMappingURL=ZC7RS5V7.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 RichSelectItem from \"./RichSelectItem\";\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 * Z-index of the popover\n */\n zIndex?: number;\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 zIndex,\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 zIndex={zIndex}\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 Item: RichSelectItem,\n});\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/SelectList/SelectList.module.css\"; export default {\"selectContainer\":\"_selectContainer_p5tv4_1\",\"opacityOverlay\":\"_opacityOverlay_p5tv4_7\",\"selectWrapper\":\"_selectWrapper_p5tv4_11\",\"selectBox\":\"_selectBox_p5tv4_16\",\"selectBoxCambio\":\"_selectBoxCambio_p5tv4_30\",\"selectMouseFocusStyling\":\"_selectMouseFocusStyling_p5tv4_38\",\"unselected\":\"_unselected_p5tv4_43\",\"selected\":\"_selected_p5tv4_47\",\"darkBackground\":\"_darkBackground_p5tv4_51\",\"arrowIcon\":\"_arrowIcon_p5tv4_63\",\"selectErrorCambio\":\"_selectErrorCambio_p5tv4_77\",\"selectColorwhite\":\"_selectColorwhite_p5tv4_83\",\"transparentInputError\":\"_transparentInputError_p5tv4_89\",\"transparenInputError\":\"_transparenInputError_p5tv4_94\"}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
41
- } from "./__chunks/V3A22FFS.js";
41
+ } from "./__chunks/W6IQWQ6Z.js";
42
42
  import "./__chunks/SPQ7DQHG.js";
43
43
  import {
44
44
  RichSelectList_default
45
- } from "./__chunks/5MOBRFQE.js";
45
+ } from "./__chunks/ZC7RS5V7.js";
46
46
  import "./__chunks/R6OBV53M.js";
47
47
  import {
48
48
  ButtonGroup_default
@@ -63,7 +63,7 @@ import {
63
63
  IconButton_default
64
64
  } from "./__chunks/KEJPRZJ5.js";
65
65
  import "./__chunks/4U4UW4AK.js";
66
- import "./__chunks/BNIBTPIA.js";
66
+ import "./__chunks/X3XMN7RS.js";
67
67
  import "./__chunks/Y53Z25OG.js";
68
68
  import "./__chunks/DDUJFFG7.js";
69
69
  import "./__chunks/N7G37EKF.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cambly/syntax-core",
3
3
  "description": "Cambly design system core components",
4
- "version": "22.1.0",
4
+ "version": "22.2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -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 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 * Z-index of the popover\n */\n zIndex?: number;\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 zIndex,\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 zIndex={zIndex}\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_p5tv4_1\",\"opacityOverlay\":\"_opacityOverlay_p5tv4_7\",\"selectWrapper\":\"_selectWrapper_p5tv4_11\",\"selectBox\":\"_selectBox_p5tv4_16\",\"selectBoxCambio\":\"_selectBoxCambio_p5tv4_30\",\"selectMouseFocusStyling\":\"_selectMouseFocusStyling_p5tv4_38\",\"unselected\":\"_unselected_p5tv4_43\",\"selected\":\"_selected_p5tv4_47\",\"darkBackground\":\"_darkBackground_p5tv4_51\",\"arrowIcon\":\"_arrowIcon_p5tv4_63\",\"selectErrorCambio\":\"_selectErrorCambio_p5tv4_77\",\"selectColorwhite\":\"_selectColorwhite_p5tv4_83\",\"transparentInputError\":\"_transparentInputError_p5tv4_89\",\"transparenInputError\":\"_transparenInputError_p5tv4_94\"}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;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