@atom-learning/components 5.3.1 → 5.4.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,207 @@
1
+ ## [5.4.1](https://github.com/Atom-Learning/components/compare/v5.4.0...v5.4.1) (2025-07-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * removed invariant from badge ([eaccfa1](https://github.com/Atom-Learning/components/commit/eaccfa1771de7f1742b6eab8fd890ea9921c8d03))
7
+
8
+ # [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
9
+
10
+
11
+ ### Features
12
+
13
+ * **stepper:** adding ability to override default forward behaviour ([#318](https://github.com/Atom-Learning/components/issues/318)) ([c9cc080](https://github.com/Atom-Learning/components/commit/c9cc080ce9c77afda0ba9df48eb74276ce2c4505))
14
+
15
+ # [1.3.0](https://github.com/Atom-Learning/components/compare/v1.2.1...v1.3.0) (2022-04-07)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * add compound variant for outline secondary buttons ([09bb100](https://github.com/Atom-Learning/components/commit/09bb10071d10f421eec37bc505860120396e2232))
21
+ * add typings to package.json to explicitly refer index.d.ts ([033c9b6](https://github.com/Atom-Learning/components/commit/033c9b6330d1b75a862a0a0c4d525a53e3707571))
22
+ * added type=search back and used css to hide browser icon ([13cf732](https://github.com/Atom-Learning/components/commit/13cf7320eda155eed7b6b340602cfeee02021745))
23
+ * adding custom plurals ([ad13522](https://github.com/Atom-Learning/components/commit/ad1352277fac5b6b6e4f4b41c7a7b0092c62d4ae))
24
+ * adding label translation, input size, and fixing popover tweaks ([08c47e6](https://github.com/Atom-Learning/components/commit/08c47e6b18537e73150d9010311d8d59d31fdc09))
25
+ * adding test for min max values ([5026b4d](https://github.com/Atom-Learning/components/commit/5026b4d95f9ac7a7c9fdc7baf06f153d8c00a8f5))
26
+ * adding test for slidersteps ([7254b0f](https://github.com/Atom-Learning/components/commit/7254b0f85d9cb81e2ebeab5946ab91caa46804fb))
27
+ * allow external change handler on date input ([d265761](https://github.com/Atom-Learning/components/commit/d26576148c94740899f87cfd6708dc5a982f8fb4))
28
+ * attempting to fix merge issue ([531590e](https://github.com/Atom-Learning/components/commit/531590e2ae068be69303f63e83e612e974cb8a90))
29
+ * avoid initial render, screenWidth can be left undefined ([35766bf](https://github.com/Atom-Learning/components/commit/35766bfeb28a66bee20e735aaf27b34862815495))
30
+ * change accordion type ([8caeed7](https://github.com/Atom-Learning/components/commit/8caeed70b8425090e15ae0451bbc4b8b7601d72c))
31
+ * changing composition so value is a separate component ([7cefeed](https://github.com/Atom-Learning/components/commit/7cefeed2d6097152ea484c329d3bce02c45cfc6d))
32
+ * changing prop name to appearance ([429cab2](https://github.com/Atom-Learning/components/commit/429cab230f959de10fbbd8af51bebb5942b9193e))
33
+ * changing unintuitive variant name ([d6993b0](https://github.com/Atom-Learning/components/commit/d6993b08346dffb6a2033a25f1c05bcbd84bd1c4))
34
+ * css as per designs ([9f3a964](https://github.com/Atom-Learning/components/commit/9f3a96483c6acc2482ba7114d45ea11b2cffa529))
35
+ * css typing ([324e323](https://github.com/Atom-Learning/components/commit/324e323a0e5aae0bddc76170f7833abf26832809))
36
+ * dateinput type error ([ee5e109](https://github.com/Atom-Learning/components/commit/ee5e1094dfc46ec449fc5c1d207c62614dd2e1ea))
37
+ * disabled state should not have any interaction whatsoever ([7e458ee](https://github.com/Atom-Learning/components/commit/7e458ee5311be59b552f99eb21aeaa0888168544))
38
+ * documentation ([82e8ac4](https://github.com/Atom-Learning/components/commit/82e8ac45bca1d97d34bcb9ac3d36158af5c7edc0))
39
+ * drop mount check inside useEffect hook ([8771774](https://github.com/Atom-Learning/components/commit/8771774de3a479d102e804eeec933685f22f1e64))
40
+ * ensure dayjs plugin is treated as external dep ([a2525ea](https://github.com/Atom-Learning/components/commit/a2525eaf3d64dbcfd22351ae31d98b3d2d42fef5))
41
+ * extend type to allow passing CSS ([261cda6](https://github.com/Atom-Learning/components/commit/261cda629c8435a8615e8b01d51fb55dd0a46d4b))
42
+ * fixing tests, changing div to box ([1f57a3a](https://github.com/Atom-Learning/components/commit/1f57a3a874b7049b4accb3d498dfde1563aad4cd))
43
+ * focus issue with next/prev buttons ([67d3de3](https://github.com/Atom-Learning/components/commit/67d3de3f5c65ed11f12588757a849bbe4601fa7d))
44
+ * forcing boolean to clean up logic ([eeaec16](https://github.com/Atom-Learning/components/commit/eeaec164e7ff5ad35a0f61e38dcfeadff4922a3a))
45
+ * introduce enum for icon ([2ce7486](https://github.com/Atom-Learning/components/commit/2ce7486b6410406e1cb67ecc3c5d7f72c4fe1949))
46
+ * making position more responsive, updating tests ([01d2e77](https://github.com/Atom-Learning/components/commit/01d2e77a42f78fbe8b6e8ab7d7c3702327e163c9))
47
+ * minor test and docs fixes ([a128057](https://github.com/Atom-Learning/components/commit/a1280573e8334c27ae58d5d63169840f1473b755))
48
+ * minor tweak to tests ([cfb37a0](https://github.com/Atom-Learning/components/commit/cfb37a073dbb9015e98212525385d50eda1b245f))
49
+ * minor update to docs ([c7a1673](https://github.com/Atom-Learning/components/commit/c7a1673f1e655177fcbe93838f84949e645e80dd))
50
+ * minor update to docs ([35dbedd](https://github.com/Atom-Learning/components/commit/35dbedd6a0d26001025cf28007e8c9ace8396e73))
51
+ * more responsive styling, mdx changes ([e18585a](https://github.com/Atom-Learning/components/commit/e18585accc31e5c62637ad4e9f922a43b10b1e9c))
52
+ * positioning of icon ([5f630f0](https://github.com/Atom-Learning/components/commit/5f630f0b351c21a705dcb6f042332ab130f138f3))
53
+ * prop name and docs example ([2e6a91e](https://github.com/Atom-Learning/components/commit/2e6a91e882402204507d24391d688f9e608f136b))
54
+ * proper types for validationMode ([7f6cb30](https://github.com/Atom-Learning/components/commit/7f6cb300a769a7c43670f937517528519bb4ff13))
55
+ * reducing height of track ([43f1f33](https://github.com/Atom-Learning/components/commit/43f1f335b8c1bb9ae06050b7ff913771b1fc5ce8))
56
+ * remove unnecessary box wrapper ([cd6203f](https://github.com/Atom-Learning/components/commit/cd6203fab71597d243b25b13be987e0508b462a8))
57
+ * remove unnecessary calendar docs, update datefield docs ([2a3ecb0](https://github.com/Atom-Learning/components/commit/2a3ecb0204b29e13f1542f65e11893eaeffad65a))
58
+ * remove unused babel file ([8df5e19](https://github.com/Atom-Learning/components/commit/8df5e195eb78c5462e5610cf9d8c3cf1f53c4172))
59
+ * remove unused code ([8019865](https://github.com/Atom-Learning/components/commit/8019865df92a86fee4f23480ec09d4dba4c18986))
60
+ * remove unwanted padding from container ([2d3fd00](https://github.com/Atom-Learning/components/commit/2d3fd00ccdbdc293d923b96d4a348d508b22c874))
61
+ * removing unneeded default value ([4db40c6](https://github.com/Atom-Learning/components/commit/4db40c656bf73b2a459dd69fcee5c0de8d705baf))
62
+ * rename Icon component ([ce20992](https://github.com/Atom-Learning/components/commit/ce20992e40e29a6940ef57749184871be539b0b5))
63
+ * rename prop and move callback into useEffect hook ([14cd086](https://github.com/Atom-Learning/components/commit/14cd086a536a937087a1088beefedd36170865fd))
64
+ * rename test description ([3137897](https://github.com/Atom-Learning/components/commit/313789734a3d06ac0d1e2d5e7ec159335106224b))
65
+ * render buttons with display: none to include them in snapshot ([9844223](https://github.com/Atom-Learning/components/commit/9844223fc29a4505620111f8427ba4c3073fe7b0))
66
+ * replace babel-jest ([8c1c0d4](https://github.com/Atom-Learning/components/commit/8c1c0d4dcfffe162b0effe415ef96998fb421484))
67
+ * replace iconwrapper for accordion ([52d93ad](https://github.com/Atom-Learning/components/commit/52d93ade51e91e9c71e21ab5d078e5ad0668705e))
68
+ * revalidate on date select ([a688ed8](https://github.com/Atom-Learning/components/commit/a688ed81950e751e53c686c84331226a03aa397b))
69
+ * revert jest to last version to stop node engine errors ([6351b74](https://github.com/Atom-Learning/components/commit/6351b74f7a29363511ed61816b29b09821000ba4))
70
+ * review feedback ([9237067](https://github.com/Atom-Learning/components/commit/9237067445a947e3aacde6645a03961de2708703))
71
+ * review feedback ([d74a333](https://github.com/Atom-Learning/components/commit/d74a3337de79f373eca066050c0f98116bd9e7e1))
72
+ * rotation applied to all icons and not just the arrow ([595a246](https://github.com/Atom-Learning/components/commit/595a246216ffc2bfb84c6c29806d17dcfeb8e817))
73
+ * search input onChange ([f13bd23](https://github.com/Atom-Learning/components/commit/f13bd23c8fd12eb32b7c41a62122206891dc9d6f))
74
+ * separating slidersteps component ([5d1b0af](https://github.com/Atom-Learning/components/commit/5d1b0afac6268218fd75893365fa0e8ff28095f2))
75
+ * separator colours and skipping behaviour ([8e85863](https://github.com/Atom-Learning/components/commit/8e85863fa36f31503cdfc67f74427ff128a77e03))
76
+ * slider min max bug ([2a5405f](https://github.com/Atom-Learning/components/commit/2a5405fd7ce0ef7fa13219eb4775b4fa8fc00938))
77
+ * snapshot test ([b364cf6](https://github.com/Atom-Learning/components/commit/b364cf66c865a875ae978393c533a1e662bec1b8))
78
+ * stepper being able to navigate outside bullet range when no OnComplete handler is passed ([c620481](https://github.com/Atom-Learning/components/commit/c620481fa5d41583779590c63e183f9c0532aba9))
79
+ * stepper types ([f7e1c20](https://github.com/Atom-Learning/components/commit/f7e1c208dbb911ccaade2bebb6cdbf49fe82f39b))
80
+ * stop render on empty value ([005c14c](https://github.com/Atom-Learning/components/commit/005c14c9fc819f7106ef6768ac1a1ac110af662a))
81
+ * tabs jump on font weight change ([219b01b](https://github.com/Atom-Learning/components/commit/219b01bbf86cc81881893b5efd925aea27c1ba93))
82
+ * throttle was being called in a wrong way ([bce0d0d](https://github.com/Atom-Learning/components/commit/bce0d0db6d2fc5569bec0e1eec96399fdf573d64))
83
+ * TS issues ([fad5121](https://github.com/Atom-Learning/components/commit/fad5121e853f6fa56368c8ec479b260e955c886b))
84
+ * tweaking null return logic ([528afda](https://github.com/Atom-Learning/components/commit/528afda648c8c6275414c7856ff145facd4884c2))
85
+ * typo on slider mdx ([45c2218](https://github.com/Atom-Learning/components/commit/45c2218bb9e21f41aea864b6ca387794bfcf06b8))
86
+ * unifying disabled theme styles ([14538e4](https://github.com/Atom-Learning/components/commit/14538e43f66fb1cf4d1665898c985318aaaada28))
87
+ * update snaps ([af59ab1](https://github.com/Atom-Learning/components/commit/af59ab1e77377fac7c71f7e785f44a81b3e24650))
88
+ * update theme package ([1059b45](https://github.com/Atom-Learning/components/commit/1059b45256c79fc84bc6f8659b1d32f832b93114))
89
+ * updating key to not be index ([26de60e](https://github.com/Atom-Learning/components/commit/26de60e4995a8cd5488a63cec03555ceb9d8d01c))
90
+ * updating mdx ([ce15564](https://github.com/Atom-Learning/components/commit/ce155646da9fb5dd4230b9135eaad9cd6d1824e8))
91
+ * updating mdx ([60604ee](https://github.com/Atom-Learning/components/commit/60604ee02f959767fdc06d15b8aceb16078918bb))
92
+ * updating mdx ([c433934](https://github.com/Atom-Learning/components/commit/c433934f3bc0e3377b2067d61c4a3d0b208b4bdd))
93
+ * updating mdx files ([f55277b](https://github.com/Atom-Learning/components/commit/f55277b47476a5614a632b09b39118d0fa3c85c0))
94
+ * updating readme ([959ec26](https://github.com/Atom-Learning/components/commit/959ec2629e01bbeb6781e9bcf236fb544153be86))
95
+ * updating readme ([4032986](https://github.com/Atom-Learning/components/commit/40329868600b456eff3e7456028e1f747817462b))
96
+ * updating style changes to be opt in and better typed ([3b94b09](https://github.com/Atom-Learning/components/commit/3b94b09d7ce7ac359b58149eb2cc86f49a47c740))
97
+ * use stitches to style the icon ([5fb3fb2](https://github.com/Atom-Learning/components/commit/5fb3fb2e5a066cc1967ca0093158a363de161ac0))
98
+ * yarn.lock ([a81c04a](https://github.com/Atom-Learning/components/commit/a81c04a9f8b67fc222d971c808bc9babfb708b34))
99
+
100
+
101
+ ### Features
102
+
103
+ * add date field, finalise date input changes ([58edcfc](https://github.com/Atom-Learning/components/commit/58edcfc365ca7a5f902cdffb6f9de9c9f5c2009d))
104
+ * add tab scrollers which allows easy navigation if tabs length is more than available space ([cec5b04](https://github.com/Atom-Learning/components/commit/cec5b04235f2c24915050dfd71975608ddee7c86))
105
+ * add test:ci option to improve logs on ci ([3452dbb](https://github.com/Atom-Learning/components/commit/3452dbbf141d659a2044148712dd243729fb8916))
106
+ * added translation, firstDayOfWeek, test, and documentation ([ca785b4](https://github.com/Atom-Learning/components/commit/ca785b4509ee581f5ba7d916c041f8291235ad24))
107
+ * adding neutral outline variant ([53a793a](https://github.com/Atom-Learning/components/commit/53a793a02836a74a8e2dac481cedec2e1707fef2))
108
+ * adding new table variants ([8a1fcc8](https://github.com/Atom-Learning/components/commit/8a1fcc8d68f48c78fc3dfc5a9a2e9a758c9eaaf6))
109
+ * adding optional uppercase to tabs ([708c6f2](https://github.com/Atom-Learning/components/commit/708c6f2d5ca33988b69f2aa868fdb8543aa56d6b))
110
+ * additional icon variant ([7e471bc](https://github.com/Atom-Learning/components/commit/7e471bc558543f84a732bc3180bd79dde76b58aa))
111
+ * button neutral theme ([8bbcf1a](https://github.com/Atom-Learning/components/commit/8bbcf1a4301cb07579de485fb6789576f7fa82c1))
112
+ * changed new variants colors for different states ([d29b374](https://github.com/Atom-Learning/components/commit/d29b374319bf133d2525681036e9ca3cda326a86))
113
+ * grid max item size ([573c17e](https://github.com/Atom-Learning/components/commit/573c17e0aec90b68e636de8238f3a98922113593))
114
+ * initial work on calendar component ([ebc8948](https://github.com/Atom-Learning/components/commit/ebc8948b66573efcc782e29b78537d89968d43d8))
115
+ * initial work on date input ([4fc6827](https://github.com/Atom-Learning/components/commit/4fc682733639ce69a60e2d869cdeaaeb88f3a4c3))
116
+ * initial work on slider ([f5a6ea1](https://github.com/Atom-Learning/components/commit/f5a6ea11349b903ed1b05ab27dc2da0004a2a595))
117
+ * make it possible to show / hide close button in modal ([1c44907](https://github.com/Atom-Learning/components/commit/1c44907ad94a5ccf5c07d2b329d292ccb05a9368))
118
+ * no light bg for tabs ([b57cdff](https://github.com/Atom-Learning/components/commit/b57cdff08f0c5594d909bcaf2f23414b2087a06a))
119
+ * notification badge component ([3f93049](https://github.com/Atom-Learning/components/commit/3f930490be322df4f58e3f643d197e1d7db6d142))
120
+ * option to hide the chevron icon in trigger ([6cc28bf](https://github.com/Atom-Learning/components/commit/6cc28bff3dd5a25f734e860cdcbddc17e4725432))
121
+ * pass ref onto the ReactPlayer component so that we have access to the ReactPlayer instance ([fb2b09c](https://github.com/Atom-Learning/components/commit/fb2b09ca81e62581dcf3b5e55a8ec5722c3621dc))
122
+ * progress-indicator ([b2ebe20](https://github.com/Atom-Learning/components/commit/b2ebe208e0af05245c3738403bb0b6c05250f2d6))
123
+ * remove :before and :after for nested Text components ([55e7a9b](https://github.com/Atom-Learning/components/commit/55e7a9be37fac435a85b21c21df505be26b26e89))
124
+ * replace babel & terser with esbuild ([bb11c3c](https://github.com/Atom-Learning/components/commit/bb11c3cbb6d226750eaae75372e49d9afaa05606))
125
+ * **SearchInput:** added clear functionality ([8c0fc32](https://github.com/Atom-Learning/components/commit/8c0fc3240cfaeb50df231da383a448eabd509d75))
126
+ * show / hide scroller buttons based on scroll position ([a6c7e49](https://github.com/Atom-Learning/components/commit/a6c7e49b0851415fc90e4c8d401b6926bacdd719))
127
+ * simplifying output label to callback ([fcf0eb2](https://github.com/Atom-Learning/components/commit/fcf0eb2c0d88dfbc6c8b17c8831ba022de537539))
128
+ * slider step functionality ([ec0d308](https://github.com/Atom-Learning/components/commit/ec0d308c6f106aed3ba6f130bb163990c923adf9))
129
+ * slider value label ([9645dc9](https://github.com/Atom-Learning/components/commit/9645dc9abb3c7dc2fd96212b6c4b395cdc206b89))
130
+ * slider.steps component, composition change ([5be643f](https://github.com/Atom-Learning/components/commit/5be643f7caa9db1dcc91bb3c6537dc87458512ed))
131
+ * sliderfield component added ([3536925](https://github.com/Atom-Learning/components/commit/35369251f41ddd74bfe491ea5022bd60ab7a2c42))
132
+ * support multiple values, updating mdx ([a01bfab](https://github.com/Atom-Learning/components/commit/a01bfab5635b6a0710cb997bc4794fd69299f025))
133
+ * tab scroll percentage ([06240fb](https://github.com/Atom-Learning/components/commit/06240fb093d760121ab18ed053f826e37d42cb94))
134
+ * update slider api ([d752c75](https://github.com/Atom-Learning/components/commit/d752c751395313cd6fa499c26f5ed342d6b4bbe3))
135
+ * update to preset-small-lib to improve performance ([431da9c](https://github.com/Atom-Learning/components/commit/431da9ced8916e0ebc90dc064d200adcb1c25384))
136
+ * WIP update packages and improve keyboard accessibility ([e0f5f9d](https://github.com/Atom-Learning/components/commit/e0f5f9dfa989e74c3ada486b16785ebb7f0d7c8e))
137
+
138
+
139
+ ### Reverts
140
+
141
+ * remove showChevron option ([e9b928c](https://github.com/Atom-Learning/components/commit/e9b928c53e23431563719624cb77b244a79e73b9))
142
+
143
+ # [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.1...v1.4.0) (2021-12-03)
144
+
145
+ # [1.3.1](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.3.1) (2021-11-25)
146
+
147
+ # [1.3.0](https://github.com/Atom-Learning/components/compare/v1.2.3...v1.3.0) (2021-11-23)
148
+
149
+ # [1.2.3](https://github.com/Atom-Learning/components/compare/v1.2.2...v1.2.3) (2021-11-16)
150
+
151
+ # [1.2.2](https://github.com/Atom-Learning/components/compare/v1.2.1...v1.2.2) (2021-11-12)
152
+
153
+ # [1.2.1](https://github.com/Atom-Learning/components/compare/v1.2.0...v1.2.1) (2021-11-11)
154
+
155
+ # [1.2.0](https://github.com/Atom-Learning/components/compare/v1.1.1...v1.2.0) (2021-11-10)
156
+
157
+
158
+ ### Bug Fixes
159
+
160
+ * adding TODO on type ([e928651](https://github.com/Atom-Learning/components/commit/e928651928291f8a9b639c8fa6c348b1bafe6513))
161
+ * few changes from PR ([e0f75a1](https://github.com/Atom-Learning/components/commit/e0f75a1788af1e23ec6efdfdd24f2788d73d33b0))
162
+ * fixing small error on documentation ([3be573a](https://github.com/Atom-Learning/components/commit/3be573a7584cbe8470a0db0186302e3e39e8734b))
163
+
164
+
165
+ ### Features
166
+
167
+ * adding accordion component ([60eac3c](https://github.com/Atom-Learning/components/commit/60eac3c47e3ce48371af624ff1ec0b6477b86823))
168
+
169
+ ## [1.1.1](https://github.com/Atom-Learning/components/compare/v1.1.0...v1.1.1) (2021-11-10)
170
+
171
+
172
+ ### Bug Fixes
173
+
174
+ * update snapshot ([e71c8a4](https://github.com/Atom-Learning/components/commit/e71c8a4f03227a29eeefca9d2afd7b6355a3ed46))
175
+
176
+ # [1.1.0](https://github.com/Atom-Learning/components/compare/v1.0.2...v1.1.0) (2021-11-05)
177
+
178
+
179
+ ### Features
180
+
181
+ * update dropdown item styles ([6bf229f](https://github.com/Atom-Learning/components/commit/6bf229fbfa9cffaaa74fda5d3629636a926a3404))
182
+
183
+ ## [1.0.2](https://github.com/Atom-Learning/components/compare/v1.0.1...v1.0.2) (2021-11-02)
184
+
185
+
186
+ ### Bug Fixes
187
+
188
+ * reinstate as type on heading and text ([1ec5ca7](https://github.com/Atom-Learning/components/commit/1ec5ca7d7ae09664bbd662cc21fee7784cf1bb3c))
189
+ * remove redundant flex styles for block Label ([54715ff](https://github.com/Atom-Learning/components/commit/54715ffc938231b4569a3ce4813c2e25d5404988))
190
+ * remove unnecessary overridden as & size types ([985231a](https://github.com/Atom-Learning/components/commit/985231a9259005a6b44cdfe20ba786f942dba81c))
191
+
192
+ ## [1.0.1](https://github.com/Atom-Learning/components/compare/v1.0.0...v1.0.1) (2021-11-02)
193
+
194
+
195
+ ### Bug Fixes
196
+
197
+ * remove cursor pointer from disabled tab ([34c283f](https://github.com/Atom-Learning/components/commit/34c283f70ce73d0ca2b2886e495bcece5475097c))
198
+
199
+ # 1.0.0 (2021-10-22)
200
+
201
+ - Initial release 🎉
202
+
203
+ # Changelog
204
+
205
+ All notable changes to this project will be documented in this file.
206
+
207
+ _NOTE: THIS FILE IS AUTOMATICALLY UPDATED_
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { TcolorScheme } from '../../experiments/color-scheme';
3
- declare const StyledTrigger: import("@atom-learning/stitches-react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-accordion").AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>, {}, {
3
+ declare const StyledTrigger: import("@atom-learning/stitches-react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-accordion").AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>, {
4
+ arrowPosition?: "left" | "right" | undefined;
5
+ }, {
4
6
  sm: string;
5
7
  md: string;
6
8
  lg: string;
@@ -364,7 +366,7 @@ declare const StyledTrigger: import("@atom-learning/stitches-react/types/styled-
364
366
  marginBottom: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
365
367
  };
366
368
  }>>;
367
- export declare const AccordionTrigger: ({ children, colorScheme, asChild, ...remainingProps }: React.ComponentProps<typeof StyledTrigger> & {
369
+ export declare const AccordionTrigger: ({ children, colorScheme, asChild, arrowPosition, ...remainingProps }: React.ComponentProps<typeof StyledTrigger> & {
368
370
  colorScheme?: TcolorScheme;
369
371
  }) => React.JSX.Element;
370
372
  export {};
@@ -1,2 +1,2 @@
1
- import{ChevronDown as n}from"@atom-learning/icons";import{Trigger as s}from"@radix-ui/react-accordion";import e from"react";import{ColorScheme as c}from"../../experiments/color-scheme/ColorScheme.js";import{styled as r}from"../../stitches.js";import"../../utilities/css-wrapper/CSSWrapper.js";import"../../utilities/no-overflow-wrapper/NoOverflowWrapper.js";import"color2k";import{focusVisibleStyleBlock as d}from"../../utilities/style/focus-visible-style-block.js";import"../../utilities/style/keyframe-animations.js";import{Icon as m}from"../icon/Icon.js";const l=r(m,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"},'[data-state="closed"] > &':{transform:"rotate(0deg)"}}),p=r(s,{border:0,py:"$3",px:"$4",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",bg:"$interactive2",color:"$interactiveForeground","&[disabled]":{opacity:.3,cursor:"not-allowed"},"&:not([disabled])":{"&:active, &:hover, &:focus-visible":{bg:"$interactive3"},"&:focus-visible":{...d()}},'&[data-state="open"]':{borderRadius:"$0 $0 0 0"},'&[data-state="closed"]':{borderRadius:"$0"}}),f=({children:t,colorScheme:i={},asChild:o,...a})=>e.createElement(c,{asChild:!0,accent:"grey1",interactive:"loContrast",...i},e.createElement(p,{asChild:o,...a},o?t:e.createElement(e.Fragment,null,t,e.createElement(l,{is:n,"data-testid":"accordion-chevron"}))));export{f as AccordionTrigger};
1
+ import{ChevronDown as s}from"@atom-learning/icons";import{Trigger as c}from"@radix-ui/react-accordion";import e from"react";import{ColorScheme as l}from"../../experiments/color-scheme/ColorScheme.js";import{styled as o}from"../../stitches.js";import"../../utilities/css-wrapper/CSSWrapper.js";import"../../utilities/no-overflow-wrapper/NoOverflowWrapper.js";import"color2k";import{focusVisibleStyleBlock as d}from"../../utilities/style/focus-visible-style-block.js";import"../../utilities/style/keyframe-animations.js";import{Icon as m}from"../icon/Icon.js";const f=o(m,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"},'[data-state="closed"] > &':{transform:"rotate(0deg)"}}),p=o(c,{border:0,py:"$3",px:"$4",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",bg:"$interactive2",color:"$interactiveForeground","&[disabled]":{opacity:.3,cursor:"not-allowed"},"&:not([disabled])":{"&:active, &:hover, &:focus-visible":{bg:"$interactive3"},"&:focus-visible":{...d()}},'&[data-state="open"]':{borderRadius:"$0 $0 0 0"},'&[data-state="closed"]':{borderRadius:"$0"},variants:{arrowPosition:{left:{flexDirection:"row-reverse",gap:"$2",justifyContent:"flex-end"},right:{}}}}),g=({children:t,colorScheme:i={},asChild:r,arrowPosition:a="right",...n})=>e.createElement(l,{asChild:!0,accent:"grey1",interactive:"loContrast",...i},e.createElement(p,{asChild:r,arrowPosition:a,...n},r?t:e.createElement(e.Fragment,null,t,e.createElement(f,{is:s,"data-testid":"accordion-chevron"}))));export{g as AccordionTrigger};
2
2
  //# sourceMappingURL=AccordionTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionTrigger.js","sources":["../../../src/components/accordion/AccordionTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@atom-learning/icons'\nimport { Trigger } from '@radix-ui/react-accordion'\nimport React from 'react'\n\nimport { ColorScheme, TcolorScheme } from '~/experiments/color-scheme'\nimport { styled } from '~/stitches'\nimport { focusVisibleStyleBlock } from '~/utilities'\n\nimport { Icon } from '../icon'\n\nconst RotatingIcon = styled(Icon, {\n transition: 'transform 300ms',\n '[data-state=\"open\"] > &': {\n transform: 'rotate(180deg)'\n },\n '[data-state=\"closed\"] > &': {\n transform: 'rotate(0deg)'\n }\n})\n\nconst StyledTrigger = styled(Trigger, {\n border: 0,\n py: '$3',\n px: '$4',\n width: '100%',\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n cursor: 'pointer',\n bg: '$interactive2',\n color: '$interactiveForeground',\n '&[disabled]': {\n opacity: 0.3,\n cursor: 'not-allowed'\n },\n '&:not([disabled])': {\n '&:active, &:hover, &:focus-visible': {\n bg: '$interactive3'\n },\n '&:focus-visible': {\n ...focusVisibleStyleBlock()\n }\n },\n '&[data-state=\"open\"]': {\n borderRadius: '$0 $0 0 0'\n },\n '&[data-state=\"closed\"]': {\n borderRadius: '$0'\n }\n})\n\nexport const AccordionTrigger = ({\n children,\n colorScheme = {},\n asChild,\n ...remainingProps\n}: React.ComponentProps<typeof StyledTrigger> & {\n colorScheme?: TcolorScheme\n}) => (\n <ColorScheme asChild accent=\"grey1\" interactive=\"loContrast\" {...colorScheme}>\n <StyledTrigger asChild={asChild} {...remainingProps}>\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <RotatingIcon is={ChevronDown} data-testid=\"accordion-chevron\" />\n </>\n )}\n </StyledTrigger>\n </ColorScheme>\n)\n"],"names":["RotatingIcon","styled","Icon","StyledTrigger","Trigger","focusVisibleStyleBlock","AccordionTrigger","children","colorScheme","asChild","remainingProps","React","ColorScheme","ChevronDown"],"mappings":"8iBAUA,MAAMA,EAAeC,EAAOC,EAAM,CAChC,WAAY,kBACZ,0BAA2B,CACzB,UAAW,gBACb,EACA,4BAA6B,CAC3B,UAAW,cACb,CACF,CAAC,EAEKC,EAAgBF,EAAOG,EAAS,CACpC,OAAQ,EACR,GAAI,KACJ,GAAI,KACJ,MAAO,OACP,QAAS,OACT,eAAgB,gBAChB,WAAY,SACZ,OAAQ,UACR,GAAI,gBACJ,MAAO,yBACP,cAAe,CACb,QAAS,GACT,OAAQ,aACV,EACA,oBAAqB,CACnB,qCAAsC,CACpC,GAAI,eACN,EACA,kBAAmB,CACjB,GAAGC,EACL,CAAA,CACF,EACA,uBAAwB,CACtB,aAAc,WAChB,EACA,yBAA0B,CACxB,aAAc,IAChB,CACF,CAAC,EAEYC,EAAmB,CAAC,CAC/B,SAAAC,EACA,YAAAC,EAAc,CAAC,EACf,QAAAC,KACGC,CACL,IAGEC,EAAA,cAACC,EAAA,CAAY,QAAO,GAAC,OAAO,QAAQ,YAAY,aAAc,GAAGJ,GAC/DG,EAAA,cAACR,EAAA,CAAc,QAASM,EAAU,GAAGC,CAClCD,EAAAA,EACCF,EAEAI,EAAA,cAAAA,EAAA,SAAA,KACGJ,EACDI,EAAA,cAACX,EAAA,CAAa,GAAIa,EAAa,cAAY,mBAAoB,CAAA,CACjE,CAEJ,CACF"}
1
+ {"version":3,"file":"AccordionTrigger.js","sources":["../../../src/components/accordion/AccordionTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@atom-learning/icons'\nimport { Trigger } from '@radix-ui/react-accordion'\nimport React from 'react'\n\nimport { ColorScheme, TcolorScheme } from '~/experiments/color-scheme'\nimport { styled } from '~/stitches'\nimport { focusVisibleStyleBlock } from '~/utilities'\n\nimport { Icon } from '../icon'\n\nconst RotatingIcon = styled(Icon, {\n transition: 'transform 300ms',\n '[data-state=\"open\"] > &': {\n transform: 'rotate(180deg)'\n },\n '[data-state=\"closed\"] > &': {\n transform: 'rotate(0deg)'\n }\n})\n\nconst StyledTrigger = styled(Trigger, {\n border: 0,\n py: '$3',\n px: '$4',\n width: '100%',\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n cursor: 'pointer',\n bg: '$interactive2',\n color: '$interactiveForeground',\n '&[disabled]': {\n opacity: 0.3,\n cursor: 'not-allowed'\n },\n '&:not([disabled])': {\n '&:active, &:hover, &:focus-visible': {\n bg: '$interactive3'\n },\n '&:focus-visible': {\n ...focusVisibleStyleBlock()\n }\n },\n '&[data-state=\"open\"]': {\n borderRadius: '$0 $0 0 0'\n },\n '&[data-state=\"closed\"]': {\n borderRadius: '$0'\n },\n variants: {\n arrowPosition: {\n left: {\n flexDirection: 'row-reverse',\n gap: '$2',\n justifyContent: 'flex-end'\n },\n right: {}\n }\n }\n})\n\nexport const AccordionTrigger = ({\n children,\n colorScheme = {},\n asChild,\n arrowPosition = 'right',\n ...remainingProps\n}: React.ComponentProps<typeof StyledTrigger> & {\n colorScheme?: TcolorScheme\n}) => (\n <ColorScheme asChild accent=\"grey1\" interactive=\"loContrast\" {...colorScheme}>\n <StyledTrigger\n asChild={asChild}\n arrowPosition={arrowPosition}\n {...remainingProps}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <RotatingIcon is={ChevronDown} data-testid=\"accordion-chevron\" />\n </>\n )}\n </StyledTrigger>\n </ColorScheme>\n)\n"],"names":["RotatingIcon","styled","Icon","StyledTrigger","Trigger","focusVisibleStyleBlock","AccordionTrigger","children","colorScheme","asChild","arrowPosition","remainingProps","React","ColorScheme","ChevronDown"],"mappings":"8iBAUA,MAAMA,EAAeC,EAAOC,EAAM,CAChC,WAAY,kBACZ,0BAA2B,CACzB,UAAW,gBACb,EACA,4BAA6B,CAC3B,UAAW,cACb,CACF,CAAC,EAEKC,EAAgBF,EAAOG,EAAS,CACpC,OAAQ,EACR,GAAI,KACJ,GAAI,KACJ,MAAO,OACP,QAAS,OACT,eAAgB,gBAChB,WAAY,SACZ,OAAQ,UACR,GAAI,gBACJ,MAAO,yBACP,cAAe,CACb,QAAS,GACT,OAAQ,aACV,EACA,oBAAqB,CACnB,qCAAsC,CACpC,GAAI,eACN,EACA,kBAAmB,CACjB,GAAGC,EACL,CAAA,CACF,EACA,uBAAwB,CACtB,aAAc,WAChB,EACA,yBAA0B,CACxB,aAAc,IAChB,EACA,SAAU,CACR,cAAe,CACb,KAAM,CACJ,cAAe,cACf,IAAK,KACL,eAAgB,UAClB,EACA,MAAO,CAAA,CACT,CACF,CACF,CAAC,EAEYC,EAAmB,CAAC,CAC/B,SAAAC,EACA,YAAAC,EAAc,CAAA,EACd,QAAAC,EACA,cAAAC,EAAgB,WACbC,CACL,IAGEC,EAAA,cAACC,EAAA,CAAY,QAAO,GAAC,OAAO,QAAQ,YAAY,aAAc,GAAGL,CAAAA,EAC/DI,EAAA,cAACT,EAAA,CACC,QAASM,EACT,cAAeC,EACd,GAAGC,CAEHF,EAAAA,EACCF,EAEAK,EAAA,cAAAA,EAAA,SACGL,KAAAA,EACDK,EAAA,cAACZ,EAAA,CAAa,GAAIc,EAAa,cAAY,mBAAoB,CAAA,CACjE,CAEJ,CACF"}
@@ -1,2 +1,2 @@
1
- import $ from"invariant";import*as e from"react";import{Flex as x}from"../flex/Flex.js";import{Icon as k}from"../icon/Icon.js";import{styled as v}from"../../stitches.js";import{useCallbackRefState as y}from"../../utilities/hooks/useCallbackRef.js";import{BadgeContext as B,BadgeProvider as C}from"./Badge.context.js";import{BadgeIcon as c}from"./BadgeIcon.js";import{BadgeText as d}from"./BadgeText.js";import{colorSchemes as w,badgeSemanticNames as O}from"./stitches.badge.colorscheme.config.js";import{OptionalTooltipWrapper as S}from"../../utilities/optional-tooltip-wrapper/OptionalTooltipWrapper.js";const F=v(x,{justifyContent:"center",alignItems:"center",borderRadius:"$0",minWidth:0,border:"1px solid #FFFFFF",fontFamily:"$body","& > *:not(:last-child)":{mr:"$1"},variants:{emphasis:{white:{color:"$textOnWhite",background:"white"},subtle:{color:"$textSubtle",background:"$backgroundSubtle"},bold:{color:"$textBold",background:"$backgroundBold"}},size:{xs:{px:"$1"},sm:{px:"$1",py:"$0"},md:{px:"$2",py:"$1"}},isClickable:{true:{cursor:"pointer"}},highlighted:{true:{}}},compoundVariants:[{isClickable:!0,emphasis:"white",css:{"&:hover":{color:"$textOnWhite",background:"color-mix(in srgb, $textOnWhite, transparent 92%)"}}},{isClickable:!0,emphasis:"subtle",css:{"&:hover":{color:"$textSubtleHover",background:"$backgroundSubtleHover"}}},{isClickable:!0,emphasis:"bold",css:{"&:hover":{color:"$textBold",background:"$backgroundBoldHover"}}},{emphasis:"white",highlighted:!0,css:{color:"$textOnWhite",background:"color-mix(in srgb, $textOnWhite, transparent 92%)"}},{emphasis:"subtle",highlighted:!0,css:{color:"$textSubtleHover",background:"$backgroundSubtleHover"}},{emphasis:"bold",highlighted:!0,css:{color:"$textBold",background:"$backgroundBoldHover"}}]}),E=e.forwardRef(({theme:r="info",emphasis:i="subtle",children:s,...o},b)=>{const{size:p,overflow:u,isOverflowing:h}=e.useContext(B),[l,g]=y();e.useImperativeHandle(b,()=>l);const f=l==null?void 0:l.textContent,a=O.includes(r),n=Object.keys(o).includes("onClick")||Object.keys(o).includes("href");return $(!(n&&a),"Semantic badges are for information only and should not be interactive"),e.createElement(S,{hasTooltip:u==="ellipsis"&&h,label:f},e.createElement(F,{role:"status",emphasis:i,size:p,...o,className:w[r],ref:g,isClickable:n&&!a},e.Children.map(s,t=>typeof t=="string"||typeof t=="number"?e.createElement(d,null,t):e.isValidElement(t)&&t.type===k?e.createElement(c,{...t.props}):t)))}),m=e.forwardRef(({size:r="sm",overflow:i="wrap",...s},o)=>e.createElement(C,{size:r,overflow:i},e.createElement(E,{...s,ref:o}))),H=Object.assign(m,{Icon:c,Text:d});m.displayName="Badge";export{H as Badge};
1
+ import*as e from"react";import{Flex as x}from"../flex/Flex.js";import{Icon as $}from"../icon/Icon.js";import{styled as k}from"../../stitches.js";import{useCallbackRefState as v}from"../../utilities/hooks/useCallbackRef.js";import{BadgeContext as y,BadgeProvider as B}from"./Badge.context.js";import{BadgeIcon as a}from"./BadgeIcon.js";import{BadgeText as n}from"./BadgeText.js";import{colorSchemes as C,badgeSemanticNames as w}from"./stitches.badge.colorscheme.config.js";import{OptionalTooltipWrapper as O}from"../../utilities/optional-tooltip-wrapper/OptionalTooltipWrapper.js";const S=k(x,{justifyContent:"center",alignItems:"center",borderRadius:"$0",minWidth:0,border:"1px solid #FFFFFF",fontFamily:"$body","& > *:not(:last-child)":{mr:"$1"},variants:{emphasis:{white:{color:"$textOnWhite",background:"white"},subtle:{color:"$textSubtle",background:"$backgroundSubtle"},bold:{color:"$textBold",background:"$backgroundBold"}},size:{xs:{px:"$1"},sm:{px:"$1",py:"$0"},md:{px:"$2",py:"$1"}},isClickable:{true:{cursor:"pointer"}},highlighted:{true:{}}},compoundVariants:[{isClickable:!0,emphasis:"white",css:{"&:hover":{color:"$textOnWhite",background:"color-mix(in srgb, $textOnWhite, transparent 92%)"}}},{isClickable:!0,emphasis:"subtle",css:{"&:hover":{color:"$textSubtleHover",background:"$backgroundSubtleHover"}}},{isClickable:!0,emphasis:"bold",css:{"&:hover":{color:"$textBold",background:"$backgroundBoldHover"}}},{emphasis:"white",highlighted:!0,css:{color:"$textOnWhite",background:"color-mix(in srgb, $textOnWhite, transparent 92%)"}},{emphasis:"subtle",highlighted:!0,css:{color:"$textSubtleHover",background:"$backgroundSubtleHover"}},{emphasis:"bold",highlighted:!0,css:{color:"$textBold",background:"$backgroundBoldHover"}}]}),F=e.forwardRef(({theme:r="info",emphasis:s="subtle",children:i,...o},d)=>{const{size:m,overflow:b,isOverflowing:p}=e.useContext(y),[l,u]=v();e.useImperativeHandle(d,()=>l);const h=l==null?void 0:l.textContent,g=w.includes(r),f=Object.keys(o).includes("onClick")||Object.keys(o).includes("href");return e.createElement(O,{hasTooltip:b==="ellipsis"&&p,label:h},e.createElement(S,{role:"status",emphasis:s,size:m,...o,className:C[r],ref:u,isClickable:f&&!g},e.Children.map(i,t=>typeof t=="string"||typeof t=="number"?e.createElement(n,null,t):e.isValidElement(t)&&t.type===$?e.createElement(a,{...t.props}):t)))}),c=e.forwardRef(({size:r="sm",overflow:s="wrap",...i},o)=>e.createElement(B,{size:r,overflow:s},e.createElement(F,{...i,ref:o}))),E=Object.assign(c,{Icon:a,Text:n});c.displayName="Badge";export{E as Badge};
2
2
  //# sourceMappingURL=Badge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sources":["../../../src/components/badge/Badge.tsx"],"sourcesContent":["import invariant from 'invariant'\nimport * as React from 'react'\n\nimport { Flex } from '~/components/flex'\nimport { Icon } from '~/components/icon'\nimport { styled } from '~/stitches'\nimport { useCallbackRefState } from '~/utilities/hooks/useCallbackRef'\nimport { OptionalTooltipWrapper } from '~/utilities/optional-tooltip-wrapper'\n\nimport { BadgeContext, BadgeProvider } from './Badge.context'\nimport { BadgeIcon } from './BadgeIcon'\nimport { BadgeText } from './BadgeText'\nimport {\n badgeSemanticNames,\n colorSchemes as badgeColorSchemes\n} from './stitches.badge.colorscheme.config'\n\nconst StyledBadge = styled(Flex, {\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: '$0',\n minWidth: 0,\n border: '1px solid #FFFFFF',\n fontFamily: '$body',\n '& > *:not(:last-child)': {\n mr: '$1'\n },\n variants: {\n emphasis: {\n white: {\n color: '$textOnWhite',\n background: 'white'\n },\n subtle: {\n color: '$textSubtle',\n background: '$backgroundSubtle'\n },\n bold: {\n color: '$textBold',\n background: '$backgroundBold'\n }\n },\n size: {\n xs: {\n px: '$1'\n },\n sm: {\n px: '$1',\n py: '$0'\n },\n md: {\n px: '$2',\n py: '$1'\n }\n },\n\n isClickable: {\n true: {\n cursor: 'pointer'\n }\n },\n highlighted: {\n true: {}\n }\n },\n compoundVariants: [\n {\n isClickable: true,\n emphasis: 'white',\n css: {\n '&:hover': {\n color: '$textOnWhite',\n background: 'color-mix(in srgb, $textOnWhite, transparent 92%)'\n }\n }\n },\n {\n isClickable: true,\n emphasis: 'subtle',\n css: {\n '&:hover': {\n color: '$textSubtleHover',\n background: '$backgroundSubtleHover'\n }\n }\n },\n {\n isClickable: true,\n emphasis: 'bold',\n css: {\n '&:hover': {\n color: '$textBold',\n background: '$backgroundBoldHover'\n }\n }\n },\n {\n emphasis: 'white',\n highlighted: true,\n css: {\n color: '$textOnWhite',\n background: 'color-mix(in srgb, $textOnWhite, transparent 92%)'\n }\n },\n {\n emphasis: 'subtle',\n highlighted: true,\n css: {\n color: '$textSubtleHover',\n background: '$backgroundSubtleHover'\n }\n },\n {\n emphasis: 'bold',\n highlighted: true,\n css: {\n color: '$textBold',\n background: '$backgroundBoldHover'\n }\n }\n ]\n})\n\nexport type TBadgeProps = React.ComponentProps<typeof StyledBadge> & {\n theme?: keyof typeof badgeColorSchemes\n overflow?: React.ComponentProps<typeof BadgeText>['overflow']\n}\n\ntype TBadgeInnerProps = Omit<TBadgeProps, 'size' | 'overflow'>\n\nconst BadgeInner: React.ForwardRefExoticComponent<TBadgeInnerProps> =\n React.forwardRef(\n ({ theme = 'info', emphasis = 'subtle', children, ...rest }, ref) => {\n const { size, overflow, isOverflowing } = React.useContext(BadgeContext)\n const [badgeElRef, setBadgeElRef] = useCallbackRefState()\n React.useImperativeHandle(ref, () => badgeElRef as HTMLDivElement)\n\n const label = badgeElRef?.textContent\n\n const isInfoOnly = badgeSemanticNames.includes(theme)\n\n const isClickable =\n Object.keys(rest).includes('onClick') ||\n Object.keys(rest).includes('href')\n\n invariant(\n !(isClickable && isInfoOnly),\n 'Semantic badges are for information only and should not be interactive'\n )\n\n return (\n <OptionalTooltipWrapper\n hasTooltip={overflow === 'ellipsis' && isOverflowing}\n label={label}\n >\n <StyledBadge\n role=\"status\"\n emphasis={emphasis}\n size={size}\n {...rest}\n className={badgeColorSchemes[theme]}\n ref={setBadgeElRef}\n isClickable={isClickable && !isInfoOnly}\n >\n {React.Children.map(children, (child) => {\n if (typeof child === 'string' || typeof child === 'number') {\n return <BadgeText>{child}</BadgeText>\n }\n if (React.isValidElement(child) && child.type === Icon) {\n return <BadgeIcon {...child.props} />\n }\n return child\n })}\n </StyledBadge>\n </OptionalTooltipWrapper>\n )\n }\n )\n\nconst BadgeComponent: React.ForwardRefExoticComponent<TBadgeProps> =\n React.forwardRef(({ size = 'sm', overflow = 'wrap', ...rest }, ref) => {\n return (\n <BadgeProvider size={size} overflow={overflow}>\n <BadgeInner {...rest} ref={ref} />\n </BadgeProvider>\n )\n })\n\nexport const Badge = Object.assign(BadgeComponent, {\n Icon: BadgeIcon,\n Text: BadgeText\n})\n\nBadgeComponent.displayName = 'Badge'\n"],"names":["StyledBadge","styled","Flex","BadgeInner","React","theme","emphasis","children","rest","ref","size","overflow","isOverflowing","BadgeContext","badgeElRef","setBadgeElRef","useCallbackRefState","label","isInfoOnly","badgeSemanticNames","isClickable","invariant","OptionalTooltipWrapper","badgeColorSchemes","child","BadgeText","Icon","BadgeIcon","BadgeComponent","BadgeProvider","Badge"],"mappings":"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"}
1
+ {"version":3,"file":"Badge.js","sources":["../../../src/components/badge/Badge.tsx"],"sourcesContent":["import invariant from 'invariant'\nimport * as React from 'react'\n\nimport { Flex } from '~/components/flex'\nimport { Icon } from '~/components/icon'\nimport { styled } from '~/stitches'\nimport { useCallbackRefState } from '~/utilities/hooks/useCallbackRef'\nimport { OptionalTooltipWrapper } from '~/utilities/optional-tooltip-wrapper'\n\nimport { BadgeContext, BadgeProvider } from './Badge.context'\nimport { BadgeIcon } from './BadgeIcon'\nimport { BadgeText } from './BadgeText'\nimport {\n badgeSemanticNames,\n colorSchemes as badgeColorSchemes\n} from './stitches.badge.colorscheme.config'\n\nconst StyledBadge = styled(Flex, {\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: '$0',\n minWidth: 0,\n border: '1px solid #FFFFFF',\n fontFamily: '$body',\n '& > *:not(:last-child)': {\n mr: '$1'\n },\n variants: {\n emphasis: {\n white: {\n color: '$textOnWhite',\n background: 'white'\n },\n subtle: {\n color: '$textSubtle',\n background: '$backgroundSubtle'\n },\n bold: {\n color: '$textBold',\n background: '$backgroundBold'\n }\n },\n size: {\n xs: {\n px: '$1'\n },\n sm: {\n px: '$1',\n py: '$0'\n },\n md: {\n px: '$2',\n py: '$1'\n }\n },\n\n isClickable: {\n true: {\n cursor: 'pointer'\n }\n },\n highlighted: {\n true: {}\n }\n },\n compoundVariants: [\n {\n isClickable: true,\n emphasis: 'white',\n css: {\n '&:hover': {\n color: '$textOnWhite',\n background: 'color-mix(in srgb, $textOnWhite, transparent 92%)'\n }\n }\n },\n {\n isClickable: true,\n emphasis: 'subtle',\n css: {\n '&:hover': {\n color: '$textSubtleHover',\n background: '$backgroundSubtleHover'\n }\n }\n },\n {\n isClickable: true,\n emphasis: 'bold',\n css: {\n '&:hover': {\n color: '$textBold',\n background: '$backgroundBoldHover'\n }\n }\n },\n {\n emphasis: 'white',\n highlighted: true,\n css: {\n color: '$textOnWhite',\n background: 'color-mix(in srgb, $textOnWhite, transparent 92%)'\n }\n },\n {\n emphasis: 'subtle',\n highlighted: true,\n css: {\n color: '$textSubtleHover',\n background: '$backgroundSubtleHover'\n }\n },\n {\n emphasis: 'bold',\n highlighted: true,\n css: {\n color: '$textBold',\n background: '$backgroundBoldHover'\n }\n }\n ]\n})\n\nexport type TBadgeProps = React.ComponentProps<typeof StyledBadge> & {\n theme?: keyof typeof badgeColorSchemes\n overflow?: React.ComponentProps<typeof BadgeText>['overflow']\n}\n\ntype TBadgeInnerProps = Omit<TBadgeProps, 'size' | 'overflow'>\n\nconst BadgeInner: React.ForwardRefExoticComponent<TBadgeInnerProps> =\n React.forwardRef(\n ({ theme = 'info', emphasis = 'subtle', children, ...rest }, ref) => {\n const { size, overflow, isOverflowing } = React.useContext(BadgeContext)\n const [badgeElRef, setBadgeElRef] = useCallbackRefState()\n React.useImperativeHandle(ref, () => badgeElRef as HTMLDivElement)\n\n const label = badgeElRef?.textContent\n\n const isInfoOnly = badgeSemanticNames.includes(theme)\n\n const isClickable =\n Object.keys(rest).includes('onClick') ||\n Object.keys(rest).includes('href')\n\n return (\n <OptionalTooltipWrapper\n hasTooltip={overflow === 'ellipsis' && isOverflowing}\n label={label}\n >\n <StyledBadge\n role=\"status\"\n emphasis={emphasis}\n size={size}\n {...rest}\n className={badgeColorSchemes[theme]}\n ref={setBadgeElRef}\n isClickable={isClickable && !isInfoOnly}\n >\n {React.Children.map(children, (child) => {\n if (typeof child === 'string' || typeof child === 'number') {\n return <BadgeText>{child}</BadgeText>\n }\n if (React.isValidElement(child) && child.type === Icon) {\n return <BadgeIcon {...child.props} />\n }\n return child\n })}\n </StyledBadge>\n </OptionalTooltipWrapper>\n )\n }\n )\n\nconst BadgeComponent: React.ForwardRefExoticComponent<TBadgeProps> =\n React.forwardRef(({ size = 'sm', overflow = 'wrap', ...rest }, ref) => {\n return (\n <BadgeProvider size={size} overflow={overflow}>\n <BadgeInner {...rest} ref={ref} />\n </BadgeProvider>\n )\n })\n\nexport const Badge = Object.assign(BadgeComponent, {\n Icon: BadgeIcon,\n Text: BadgeText\n})\n\nBadgeComponent.displayName = 'Badge'\n"],"names":["StyledBadge","styled","Flex","BadgeInner","React","theme","emphasis","children","rest","ref","size","overflow","isOverflowing","BadgeContext","badgeElRef","setBadgeElRef","useCallbackRefState","label","isInfoOnly","badgeSemanticNames","isClickable","OptionalTooltipWrapper","badgeColorSchemes","child","BadgeText","Icon","BadgeIcon","BadgeComponent","BadgeProvider","Badge"],"mappings":"okBAiBA,MAAMA,EAAcC,EAAOC,EAAM,CAC/B,eAAgB,SAChB,WAAY,SACZ,aAAc,KACd,SAAU,EACV,OAAQ,oBACR,WAAY,QACZ,yBAA0B,CACxB,GAAI,IACN,EACA,SAAU,CACR,SAAU,CACR,MAAO,CACL,MAAO,eACP,WAAY,OACd,EACA,OAAQ,CACN,MAAO,cACP,WAAY,mBACd,EACA,KAAM,CACJ,MAAO,YACP,WAAY,iBACd,CACF,EACA,KAAM,CACJ,GAAI,CACF,GAAI,IACN,EACA,GAAI,CACF,GAAI,KACJ,GAAI,IACN,EACA,GAAI,CACF,GAAI,KACJ,GAAI,IACN,CACF,EAEA,YAAa,CACX,KAAM,CACJ,OAAQ,SACV,CACF,EACA,YAAa,CACX,KAAM,CACR,CAAA,CACF,EACA,iBAAkB,CAChB,CACE,YAAa,GACb,SAAU,QACV,IAAK,CACH,UAAW,CACT,MAAO,eACP,WAAY,mDACd,CACF,CACF,EACA,CACE,YAAa,GACb,SAAU,SACV,IAAK,CACH,UAAW,CACT,MAAO,mBACP,WAAY,wBACd,CACF,CACF,EACA,CACE,YAAa,GACb,SAAU,OACV,IAAK,CACH,UAAW,CACT,MAAO,YACP,WAAY,sBACd,CACF,CACF,EACA,CACE,SAAU,QACV,YAAa,GACb,IAAK,CACH,MAAO,eACP,WAAY,mDACd,CACF,EACA,CACE,SAAU,SACV,YAAa,GACb,IAAK,CACH,MAAO,mBACP,WAAY,wBACd,CACF,EACA,CACE,SAAU,OACV,YAAa,GACb,IAAK,CACH,MAAO,YACP,WAAY,sBACd,CACF,CACF,CACF,CAAC,EASKC,EACJC,EAAM,WACJ,CAAC,CAAE,MAAAC,EAAQ,OAAQ,SAAAC,EAAW,SAAU,SAAAC,KAAaC,CAAK,EAAGC,IAAQ,CACnE,KAAM,CAAE,KAAAC,EAAM,SAAAC,EAAU,cAAAC,CAAc,EAAIR,EAAM,WAAWS,CAAY,EACjE,CAACC,EAAYC,CAAa,EAAIC,EAAoB,EACxDZ,EAAM,oBAAoBK,EAAK,IAAMK,CAA4B,EAEjE,MAAMG,EAAQH,GAAA,YAAAA,EAAY,YAEpBI,EAAaC,EAAmB,SAASd,CAAK,EAE9Ce,EACJ,OAAO,KAAKZ,CAAI,EAAE,SAAS,SAAS,GACpC,OAAO,KAAKA,CAAI,EAAE,SAAS,MAAM,EAEnC,OACEJ,EAAA,cAACiB,EAAA,CACC,WAAYV,IAAa,YAAcC,EACvC,MAAOK,CAEPb,EAAAA,EAAA,cAACJ,EAAA,CACC,KAAK,SACL,SAAUM,EACV,KAAMI,EACL,GAAGF,EACJ,UAAWc,EAAkBjB,GAC7B,IAAKU,EACL,YAAaK,GAAe,CAACF,GAE5Bd,EAAM,SAAS,IAAIG,EAAWgB,GACzB,OAAOA,GAAU,UAAY,OAAOA,GAAU,SACzCnB,EAAA,cAACoB,EAAA,KAAWD,CAAM,EAEvBnB,EAAM,eAAemB,CAAK,GAAKA,EAAM,OAASE,EACzCrB,EAAA,cAACsB,EAAA,CAAW,GAAGH,EAAM,KAAA,CAAO,EAE9BA,CACR,CACH,CACF,CAEJ,CACF,EAEII,EACJvB,EAAM,WAAW,CAAC,CAAE,KAAAM,EAAO,KAAM,SAAAC,EAAW,UAAWH,CAAK,EAAGC,IAE3DL,EAAA,cAACwB,EAAA,CAAc,KAAMlB,EAAM,SAAUC,CAAAA,EACnCP,EAAA,cAACD,EAAA,CAAY,GAAGK,EAAM,IAAKC,CAAK,CAAA,CAClC,CAEH,EAEUoB,EAAQ,OAAO,OAAOF,EAAgB,CACjD,KAAMD,EACN,KAAMF,CACR,CAAC,EAEDG,EAAe,YAAc"}