@atom-learning/components 3.0.2 → 3.1.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.
Files changed (26) hide show
  1. package/CHANGELOG.md +228 -0
  2. package/dist/components/action-icon/ActionIcon.js +1 -1
  3. package/dist/components/action-icon/ActionIcon.js.map +1 -1
  4. package/dist/components/alert-dialog/alert-context/AlertDialog.js +1 -1
  5. package/dist/components/alert-dialog/alert-context/AlertDialog.js.map +1 -1
  6. package/dist/components/alert-dialog/alert-context/AlertDialogIcon.d.ts +5 -0
  7. package/dist/components/alert-dialog/alert-context/AlertDialogIcon.js +2 -0
  8. package/dist/components/alert-dialog/alert-context/AlertDialogIcon.js.map +1 -0
  9. package/dist/components/alert-dialog/alert-context/types.d.ts +19 -2
  10. package/dist/components/button/Button.js +1 -1
  11. package/dist/components/button/Button.js.map +1 -1
  12. package/dist/components/dropdown-menu/DropdownMenuLinkItem.js +1 -1
  13. package/dist/components/dropdown-menu/DropdownMenuLinkItem.js.map +1 -1
  14. package/dist/components/link/Link.js +1 -1
  15. package/dist/components/link/Link.js.map +1 -1
  16. package/dist/components/navigation/NavigationMenuLink.js +1 -1
  17. package/dist/components/navigation/NavigationMenuLink.js.map +1 -1
  18. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.js +1 -1
  19. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.js.map +1 -1
  20. package/dist/docgen.json +1 -1
  21. package/dist/index.cjs.js +1 -1
  22. package/dist/index.cjs.js.map +1 -1
  23. package/dist/utilities/uri/index.d.ts +8 -1
  24. package/dist/utilities/uri/index.js +1 -1
  25. package/dist/utilities/uri/index.js.map +1 -1
  26. package/package.json +1 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,228 @@
1
+ # [3.1.0](https://github.com/Atom-Learning/components/compare/v3.0.2...v3.1.0) (2023-10-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * ensure action buttons wrap ([94f804a](https://github.com/Atom-Learning/components/commit/94f804a260f8bacbcef0742caa373a29dbb05c9a))
7
+ * trigger release 3.0.3 ([fc3ed11](https://github.com/Atom-Learning/components/commit/fc3ed11dd4c70507844aaaa361ba8cf3cf41c43d))
8
+
9
+
10
+ ### Features
11
+
12
+ * add alert dialog doc description for recommended approach ([5cf334b](https://github.com/Atom-Learning/components/commit/5cf334b9a07cc58a55714e962c6da552f30d7f3e))
13
+ * add close button to show alert dialog ([ab0d2df](https://github.com/Atom-Learning/components/commit/ab0d2dfb0a9d20ccda7f09c9e57918016f8d7c3a))
14
+ * add onClick example to alert dialog docs ([d2411b4](https://github.com/Atom-Learning/components/commit/d2411b4a74ad25687c1fed41a855d005cfe0bb12))
15
+ * add showalert button theme and appearance options ([d08a11c](https://github.com/Atom-Learning/components/commit/d08a11c65945febbf622ef8598c979e44d944eae))
16
+ * add size prop to alert dialog context ([fb88ef3](https://github.com/Atom-Learning/components/commit/fb88ef3b933f02eff11b30325404b1a100bd2dcd))
17
+ * add themed icon to showalert dialog ([174bd28](https://github.com/Atom-Learning/components/commit/174bd28b4c2d889da834049e78c196ec05195c9c))
18
+ * allow rendering functional components with codeblocks ([894bf44](https://github.com/Atom-Learning/components/commit/894bf442811a61d0926a76af1c5a2ccafc7552c9))
19
+ * make showAlert onAction optional ([0471656](https://github.com/Atom-Learning/components/commit/0471656f25fd1297f61d6b5756bb5dd0d40be6c7))
20
+ * remove alert close button option ([c98b5ec](https://github.com/Atom-Learning/components/commit/c98b5ecec2789c3c06ff072c398969288ca052a0))
21
+ * remove awaits ([283d282](https://github.com/Atom-Learning/components/commit/283d28254e692cf6fac55210705d3f8c335990f9))
22
+ * remove redundant colour ([211fe0a](https://github.com/Atom-Learning/components/commit/211fe0a8979386718ac0aa8e0cf0e215e79c179d))
23
+ * replace props with action elements ([54862d5](https://github.com/Atom-Learning/components/commit/54862d54817c404e5b69e33e98b19996ad60bf0b))
24
+ * replace stack with flex ([302cbef](https://github.com/Atom-Learning/components/commit/302cbef6000a8e9f8ed4523e2deb2bb33ca5cc9c))
25
+ * scroll overflow showAlert content ([4ca33b8](https://github.com/Atom-Learning/components/commit/4ca33b80bff019571abe49dbd4949aed9a0fb5dd))
26
+ * update alertdialog documentation and example ([7efbb46](https://github.com/Atom-Learning/components/commit/7efbb46e3fe14caf6a783ea29e1c2657c6cfd13d))
27
+ * use gap instead of margin ([02e8754](https://github.com/Atom-Learning/components/commit/02e87549b7b95a2d16b3f8dab9b207bb3bd83bc5))
28
+
29
+ # [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
30
+
31
+
32
+ ### Features
33
+
34
+ * **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))
35
+
36
+ # [1.3.0](https://github.com/Atom-Learning/components/compare/v1.2.1...v1.3.0) (2022-04-07)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * add compound variant for outline secondary buttons ([09bb100](https://github.com/Atom-Learning/components/commit/09bb10071d10f421eec37bc505860120396e2232))
42
+ * add typings to package.json to explicitly refer index.d.ts ([033c9b6](https://github.com/Atom-Learning/components/commit/033c9b6330d1b75a862a0a0c4d525a53e3707571))
43
+ * added type=search back and used css to hide browser icon ([13cf732](https://github.com/Atom-Learning/components/commit/13cf7320eda155eed7b6b340602cfeee02021745))
44
+ * adding custom plurals ([ad13522](https://github.com/Atom-Learning/components/commit/ad1352277fac5b6b6e4f4b41c7a7b0092c62d4ae))
45
+ * adding label translation, input size, and fixing popover tweaks ([08c47e6](https://github.com/Atom-Learning/components/commit/08c47e6b18537e73150d9010311d8d59d31fdc09))
46
+ * adding test for min max values ([5026b4d](https://github.com/Atom-Learning/components/commit/5026b4d95f9ac7a7c9fdc7baf06f153d8c00a8f5))
47
+ * adding test for slidersteps ([7254b0f](https://github.com/Atom-Learning/components/commit/7254b0f85d9cb81e2ebeab5946ab91caa46804fb))
48
+ * allow external change handler on date input ([d265761](https://github.com/Atom-Learning/components/commit/d26576148c94740899f87cfd6708dc5a982f8fb4))
49
+ * attempting to fix merge issue ([531590e](https://github.com/Atom-Learning/components/commit/531590e2ae068be69303f63e83e612e974cb8a90))
50
+ * avoid initial render, screenWidth can be left undefined ([35766bf](https://github.com/Atom-Learning/components/commit/35766bfeb28a66bee20e735aaf27b34862815495))
51
+ * change accordion type ([8caeed7](https://github.com/Atom-Learning/components/commit/8caeed70b8425090e15ae0451bbc4b8b7601d72c))
52
+ * changing composition so value is a separate component ([7cefeed](https://github.com/Atom-Learning/components/commit/7cefeed2d6097152ea484c329d3bce02c45cfc6d))
53
+ * changing prop name to appearance ([429cab2](https://github.com/Atom-Learning/components/commit/429cab230f959de10fbbd8af51bebb5942b9193e))
54
+ * changing unintuitive variant name ([d6993b0](https://github.com/Atom-Learning/components/commit/d6993b08346dffb6a2033a25f1c05bcbd84bd1c4))
55
+ * css as per designs ([9f3a964](https://github.com/Atom-Learning/components/commit/9f3a96483c6acc2482ba7114d45ea11b2cffa529))
56
+ * css typing ([324e323](https://github.com/Atom-Learning/components/commit/324e323a0e5aae0bddc76170f7833abf26832809))
57
+ * dateinput type error ([ee5e109](https://github.com/Atom-Learning/components/commit/ee5e1094dfc46ec449fc5c1d207c62614dd2e1ea))
58
+ * disabled state should not have any interaction whatsoever ([7e458ee](https://github.com/Atom-Learning/components/commit/7e458ee5311be59b552f99eb21aeaa0888168544))
59
+ * documentation ([82e8ac4](https://github.com/Atom-Learning/components/commit/82e8ac45bca1d97d34bcb9ac3d36158af5c7edc0))
60
+ * drop mount check inside useEffect hook ([8771774](https://github.com/Atom-Learning/components/commit/8771774de3a479d102e804eeec933685f22f1e64))
61
+ * ensure dayjs plugin is treated as external dep ([a2525ea](https://github.com/Atom-Learning/components/commit/a2525eaf3d64dbcfd22351ae31d98b3d2d42fef5))
62
+ * extend type to allow passing CSS ([261cda6](https://github.com/Atom-Learning/components/commit/261cda629c8435a8615e8b01d51fb55dd0a46d4b))
63
+ * fixing tests, changing div to box ([1f57a3a](https://github.com/Atom-Learning/components/commit/1f57a3a874b7049b4accb3d498dfde1563aad4cd))
64
+ * focus issue with next/prev buttons ([67d3de3](https://github.com/Atom-Learning/components/commit/67d3de3f5c65ed11f12588757a849bbe4601fa7d))
65
+ * forcing boolean to clean up logic ([eeaec16](https://github.com/Atom-Learning/components/commit/eeaec164e7ff5ad35a0f61e38dcfeadff4922a3a))
66
+ * introduce enum for icon ([2ce7486](https://github.com/Atom-Learning/components/commit/2ce7486b6410406e1cb67ecc3c5d7f72c4fe1949))
67
+ * making position more responsive, updating tests ([01d2e77](https://github.com/Atom-Learning/components/commit/01d2e77a42f78fbe8b6e8ab7d7c3702327e163c9))
68
+ * minor test and docs fixes ([a128057](https://github.com/Atom-Learning/components/commit/a1280573e8334c27ae58d5d63169840f1473b755))
69
+ * minor tweak to tests ([cfb37a0](https://github.com/Atom-Learning/components/commit/cfb37a073dbb9015e98212525385d50eda1b245f))
70
+ * minor update to docs ([c7a1673](https://github.com/Atom-Learning/components/commit/c7a1673f1e655177fcbe93838f84949e645e80dd))
71
+ * minor update to docs ([35dbedd](https://github.com/Atom-Learning/components/commit/35dbedd6a0d26001025cf28007e8c9ace8396e73))
72
+ * more responsive styling, mdx changes ([e18585a](https://github.com/Atom-Learning/components/commit/e18585accc31e5c62637ad4e9f922a43b10b1e9c))
73
+ * positioning of icon ([5f630f0](https://github.com/Atom-Learning/components/commit/5f630f0b351c21a705dcb6f042332ab130f138f3))
74
+ * prop name and docs example ([2e6a91e](https://github.com/Atom-Learning/components/commit/2e6a91e882402204507d24391d688f9e608f136b))
75
+ * proper types for validationMode ([7f6cb30](https://github.com/Atom-Learning/components/commit/7f6cb300a769a7c43670f937517528519bb4ff13))
76
+ * reducing height of track ([43f1f33](https://github.com/Atom-Learning/components/commit/43f1f335b8c1bb9ae06050b7ff913771b1fc5ce8))
77
+ * remove unnecessary box wrapper ([cd6203f](https://github.com/Atom-Learning/components/commit/cd6203fab71597d243b25b13be987e0508b462a8))
78
+ * remove unnecessary calendar docs, update datefield docs ([2a3ecb0](https://github.com/Atom-Learning/components/commit/2a3ecb0204b29e13f1542f65e11893eaeffad65a))
79
+ * remove unused babel file ([8df5e19](https://github.com/Atom-Learning/components/commit/8df5e195eb78c5462e5610cf9d8c3cf1f53c4172))
80
+ * remove unused code ([8019865](https://github.com/Atom-Learning/components/commit/8019865df92a86fee4f23480ec09d4dba4c18986))
81
+ * remove unwanted padding from container ([2d3fd00](https://github.com/Atom-Learning/components/commit/2d3fd00ccdbdc293d923b96d4a348d508b22c874))
82
+ * removing unneeded default value ([4db40c6](https://github.com/Atom-Learning/components/commit/4db40c656bf73b2a459dd69fcee5c0de8d705baf))
83
+ * rename Icon component ([ce20992](https://github.com/Atom-Learning/components/commit/ce20992e40e29a6940ef57749184871be539b0b5))
84
+ * rename prop and move callback into useEffect hook ([14cd086](https://github.com/Atom-Learning/components/commit/14cd086a536a937087a1088beefedd36170865fd))
85
+ * rename test description ([3137897](https://github.com/Atom-Learning/components/commit/313789734a3d06ac0d1e2d5e7ec159335106224b))
86
+ * render buttons with display: none to include them in snapshot ([9844223](https://github.com/Atom-Learning/components/commit/9844223fc29a4505620111f8427ba4c3073fe7b0))
87
+ * replace babel-jest ([8c1c0d4](https://github.com/Atom-Learning/components/commit/8c1c0d4dcfffe162b0effe415ef96998fb421484))
88
+ * replace iconwrapper for accordion ([52d93ad](https://github.com/Atom-Learning/components/commit/52d93ade51e91e9c71e21ab5d078e5ad0668705e))
89
+ * revalidate on date select ([a688ed8](https://github.com/Atom-Learning/components/commit/a688ed81950e751e53c686c84331226a03aa397b))
90
+ * revert jest to last version to stop node engine errors ([6351b74](https://github.com/Atom-Learning/components/commit/6351b74f7a29363511ed61816b29b09821000ba4))
91
+ * review feedback ([9237067](https://github.com/Atom-Learning/components/commit/9237067445a947e3aacde6645a03961de2708703))
92
+ * review feedback ([d74a333](https://github.com/Atom-Learning/components/commit/d74a3337de79f373eca066050c0f98116bd9e7e1))
93
+ * rotation applied to all icons and not just the arrow ([595a246](https://github.com/Atom-Learning/components/commit/595a246216ffc2bfb84c6c29806d17dcfeb8e817))
94
+ * search input onChange ([f13bd23](https://github.com/Atom-Learning/components/commit/f13bd23c8fd12eb32b7c41a62122206891dc9d6f))
95
+ * separating slidersteps component ([5d1b0af](https://github.com/Atom-Learning/components/commit/5d1b0afac6268218fd75893365fa0e8ff28095f2))
96
+ * separator colours and skipping behaviour ([8e85863](https://github.com/Atom-Learning/components/commit/8e85863fa36f31503cdfc67f74427ff128a77e03))
97
+ * slider min max bug ([2a5405f](https://github.com/Atom-Learning/components/commit/2a5405fd7ce0ef7fa13219eb4775b4fa8fc00938))
98
+ * snapshot test ([b364cf6](https://github.com/Atom-Learning/components/commit/b364cf66c865a875ae978393c533a1e662bec1b8))
99
+ * stepper being able to navigate outside bullet range when no OnComplete handler is passed ([c620481](https://github.com/Atom-Learning/components/commit/c620481fa5d41583779590c63e183f9c0532aba9))
100
+ * stepper types ([f7e1c20](https://github.com/Atom-Learning/components/commit/f7e1c208dbb911ccaade2bebb6cdbf49fe82f39b))
101
+ * stop render on empty value ([005c14c](https://github.com/Atom-Learning/components/commit/005c14c9fc819f7106ef6768ac1a1ac110af662a))
102
+ * tabs jump on font weight change ([219b01b](https://github.com/Atom-Learning/components/commit/219b01bbf86cc81881893b5efd925aea27c1ba93))
103
+ * throttle was being called in a wrong way ([bce0d0d](https://github.com/Atom-Learning/components/commit/bce0d0db6d2fc5569bec0e1eec96399fdf573d64))
104
+ * TS issues ([fad5121](https://github.com/Atom-Learning/components/commit/fad5121e853f6fa56368c8ec479b260e955c886b))
105
+ * tweaking null return logic ([528afda](https://github.com/Atom-Learning/components/commit/528afda648c8c6275414c7856ff145facd4884c2))
106
+ * typo on slider mdx ([45c2218](https://github.com/Atom-Learning/components/commit/45c2218bb9e21f41aea864b6ca387794bfcf06b8))
107
+ * unifying disabled theme styles ([14538e4](https://github.com/Atom-Learning/components/commit/14538e43f66fb1cf4d1665898c985318aaaada28))
108
+ * update snaps ([af59ab1](https://github.com/Atom-Learning/components/commit/af59ab1e77377fac7c71f7e785f44a81b3e24650))
109
+ * update theme package ([1059b45](https://github.com/Atom-Learning/components/commit/1059b45256c79fc84bc6f8659b1d32f832b93114))
110
+ * updating key to not be index ([26de60e](https://github.com/Atom-Learning/components/commit/26de60e4995a8cd5488a63cec03555ceb9d8d01c))
111
+ * updating mdx ([ce15564](https://github.com/Atom-Learning/components/commit/ce155646da9fb5dd4230b9135eaad9cd6d1824e8))
112
+ * updating mdx ([60604ee](https://github.com/Atom-Learning/components/commit/60604ee02f959767fdc06d15b8aceb16078918bb))
113
+ * updating mdx ([c433934](https://github.com/Atom-Learning/components/commit/c433934f3bc0e3377b2067d61c4a3d0b208b4bdd))
114
+ * updating mdx files ([f55277b](https://github.com/Atom-Learning/components/commit/f55277b47476a5614a632b09b39118d0fa3c85c0))
115
+ * updating readme ([959ec26](https://github.com/Atom-Learning/components/commit/959ec2629e01bbeb6781e9bcf236fb544153be86))
116
+ * updating readme ([4032986](https://github.com/Atom-Learning/components/commit/40329868600b456eff3e7456028e1f747817462b))
117
+ * updating style changes to be opt in and better typed ([3b94b09](https://github.com/Atom-Learning/components/commit/3b94b09d7ce7ac359b58149eb2cc86f49a47c740))
118
+ * use stitches to style the icon ([5fb3fb2](https://github.com/Atom-Learning/components/commit/5fb3fb2e5a066cc1967ca0093158a363de161ac0))
119
+ * yarn.lock ([a81c04a](https://github.com/Atom-Learning/components/commit/a81c04a9f8b67fc222d971c808bc9babfb708b34))
120
+
121
+
122
+ ### Features
123
+
124
+ * add date field, finalise date input changes ([58edcfc](https://github.com/Atom-Learning/components/commit/58edcfc365ca7a5f902cdffb6f9de9c9f5c2009d))
125
+ * add tab scrollers which allows easy navigation if tabs length is more than available space ([cec5b04](https://github.com/Atom-Learning/components/commit/cec5b04235f2c24915050dfd71975608ddee7c86))
126
+ * add test:ci option to improve logs on ci ([3452dbb](https://github.com/Atom-Learning/components/commit/3452dbbf141d659a2044148712dd243729fb8916))
127
+ * added translation, firstDayOfWeek, test, and documentation ([ca785b4](https://github.com/Atom-Learning/components/commit/ca785b4509ee581f5ba7d916c041f8291235ad24))
128
+ * adding neutral outline variant ([53a793a](https://github.com/Atom-Learning/components/commit/53a793a02836a74a8e2dac481cedec2e1707fef2))
129
+ * adding new table variants ([8a1fcc8](https://github.com/Atom-Learning/components/commit/8a1fcc8d68f48c78fc3dfc5a9a2e9a758c9eaaf6))
130
+ * adding optional uppercase to tabs ([708c6f2](https://github.com/Atom-Learning/components/commit/708c6f2d5ca33988b69f2aa868fdb8543aa56d6b))
131
+ * additional icon variant ([7e471bc](https://github.com/Atom-Learning/components/commit/7e471bc558543f84a732bc3180bd79dde76b58aa))
132
+ * button neutral theme ([8bbcf1a](https://github.com/Atom-Learning/components/commit/8bbcf1a4301cb07579de485fb6789576f7fa82c1))
133
+ * changed new variants colors for different states ([d29b374](https://github.com/Atom-Learning/components/commit/d29b374319bf133d2525681036e9ca3cda326a86))
134
+ * grid max item size ([573c17e](https://github.com/Atom-Learning/components/commit/573c17e0aec90b68e636de8238f3a98922113593))
135
+ * initial work on calendar component ([ebc8948](https://github.com/Atom-Learning/components/commit/ebc8948b66573efcc782e29b78537d89968d43d8))
136
+ * initial work on date input ([4fc6827](https://github.com/Atom-Learning/components/commit/4fc682733639ce69a60e2d869cdeaaeb88f3a4c3))
137
+ * initial work on slider ([f5a6ea1](https://github.com/Atom-Learning/components/commit/f5a6ea11349b903ed1b05ab27dc2da0004a2a595))
138
+ * make it possible to show / hide close button in modal ([1c44907](https://github.com/Atom-Learning/components/commit/1c44907ad94a5ccf5c07d2b329d292ccb05a9368))
139
+ * no light bg for tabs ([b57cdff](https://github.com/Atom-Learning/components/commit/b57cdff08f0c5594d909bcaf2f23414b2087a06a))
140
+ * notification badge component ([3f93049](https://github.com/Atom-Learning/components/commit/3f930490be322df4f58e3f643d197e1d7db6d142))
141
+ * option to hide the chevron icon in trigger ([6cc28bf](https://github.com/Atom-Learning/components/commit/6cc28bff3dd5a25f734e860cdcbddc17e4725432))
142
+ * pass ref onto the ReactPlayer component so that we have access to the ReactPlayer instance ([fb2b09c](https://github.com/Atom-Learning/components/commit/fb2b09ca81e62581dcf3b5e55a8ec5722c3621dc))
143
+ * progress-indicator ([b2ebe20](https://github.com/Atom-Learning/components/commit/b2ebe208e0af05245c3738403bb0b6c05250f2d6))
144
+ * remove :before and :after for nested Text components ([55e7a9b](https://github.com/Atom-Learning/components/commit/55e7a9be37fac435a85b21c21df505be26b26e89))
145
+ * replace babel & terser with esbuild ([bb11c3c](https://github.com/Atom-Learning/components/commit/bb11c3cbb6d226750eaae75372e49d9afaa05606))
146
+ * **SearchInput:** added clear functionality ([8c0fc32](https://github.com/Atom-Learning/components/commit/8c0fc3240cfaeb50df231da383a448eabd509d75))
147
+ * show / hide scroller buttons based on scroll position ([a6c7e49](https://github.com/Atom-Learning/components/commit/a6c7e49b0851415fc90e4c8d401b6926bacdd719))
148
+ * simplifying output label to callback ([fcf0eb2](https://github.com/Atom-Learning/components/commit/fcf0eb2c0d88dfbc6c8b17c8831ba022de537539))
149
+ * slider step functionality ([ec0d308](https://github.com/Atom-Learning/components/commit/ec0d308c6f106aed3ba6f130bb163990c923adf9))
150
+ * slider value label ([9645dc9](https://github.com/Atom-Learning/components/commit/9645dc9abb3c7dc2fd96212b6c4b395cdc206b89))
151
+ * slider.steps component, composition change ([5be643f](https://github.com/Atom-Learning/components/commit/5be643f7caa9db1dcc91bb3c6537dc87458512ed))
152
+ * sliderfield component added ([3536925](https://github.com/Atom-Learning/components/commit/35369251f41ddd74bfe491ea5022bd60ab7a2c42))
153
+ * support multiple values, updating mdx ([a01bfab](https://github.com/Atom-Learning/components/commit/a01bfab5635b6a0710cb997bc4794fd69299f025))
154
+ * tab scroll percentage ([06240fb](https://github.com/Atom-Learning/components/commit/06240fb093d760121ab18ed053f826e37d42cb94))
155
+ * update slider api ([d752c75](https://github.com/Atom-Learning/components/commit/d752c751395313cd6fa499c26f5ed342d6b4bbe3))
156
+ * update to preset-small-lib to improve performance ([431da9c](https://github.com/Atom-Learning/components/commit/431da9ced8916e0ebc90dc064d200adcb1c25384))
157
+ * WIP update packages and improve keyboard accessibility ([e0f5f9d](https://github.com/Atom-Learning/components/commit/e0f5f9dfa989e74c3ada486b16785ebb7f0d7c8e))
158
+
159
+
160
+ ### Reverts
161
+
162
+ * remove showChevron option ([e9b928c](https://github.com/Atom-Learning/components/commit/e9b928c53e23431563719624cb77b244a79e73b9))
163
+
164
+ # [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.1...v1.4.0) (2021-12-03)
165
+
166
+ # [1.3.1](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.3.1) (2021-11-25)
167
+
168
+ # [1.3.0](https://github.com/Atom-Learning/components/compare/v1.2.3...v1.3.0) (2021-11-23)
169
+
170
+ # [1.2.3](https://github.com/Atom-Learning/components/compare/v1.2.2...v1.2.3) (2021-11-16)
171
+
172
+ # [1.2.2](https://github.com/Atom-Learning/components/compare/v1.2.1...v1.2.2) (2021-11-12)
173
+
174
+ # [1.2.1](https://github.com/Atom-Learning/components/compare/v1.2.0...v1.2.1) (2021-11-11)
175
+
176
+ # [1.2.0](https://github.com/Atom-Learning/components/compare/v1.1.1...v1.2.0) (2021-11-10)
177
+
178
+
179
+ ### Bug Fixes
180
+
181
+ * adding TODO on type ([e928651](https://github.com/Atom-Learning/components/commit/e928651928291f8a9b639c8fa6c348b1bafe6513))
182
+ * few changes from PR ([e0f75a1](https://github.com/Atom-Learning/components/commit/e0f75a1788af1e23ec6efdfdd24f2788d73d33b0))
183
+ * fixing small error on documentation ([3be573a](https://github.com/Atom-Learning/components/commit/3be573a7584cbe8470a0db0186302e3e39e8734b))
184
+
185
+
186
+ ### Features
187
+
188
+ * adding accordion component ([60eac3c](https://github.com/Atom-Learning/components/commit/60eac3c47e3ce48371af624ff1ec0b6477b86823))
189
+
190
+ ## [1.1.1](https://github.com/Atom-Learning/components/compare/v1.1.0...v1.1.1) (2021-11-10)
191
+
192
+
193
+ ### Bug Fixes
194
+
195
+ * update snapshot ([e71c8a4](https://github.com/Atom-Learning/components/commit/e71c8a4f03227a29eeefca9d2afd7b6355a3ed46))
196
+
197
+ # [1.1.0](https://github.com/Atom-Learning/components/compare/v1.0.2...v1.1.0) (2021-11-05)
198
+
199
+
200
+ ### Features
201
+
202
+ * update dropdown item styles ([6bf229f](https://github.com/Atom-Learning/components/commit/6bf229fbfa9cffaaa74fda5d3629636a926a3404))
203
+
204
+ ## [1.0.2](https://github.com/Atom-Learning/components/compare/v1.0.1...v1.0.2) (2021-11-02)
205
+
206
+
207
+ ### Bug Fixes
208
+
209
+ * reinstate as type on heading and text ([1ec5ca7](https://github.com/Atom-Learning/components/commit/1ec5ca7d7ae09664bbd662cc21fee7784cf1bb3c))
210
+ * remove redundant flex styles for block Label ([54715ff](https://github.com/Atom-Learning/components/commit/54715ffc938231b4569a3ce4813c2e25d5404988))
211
+ * remove unnecessary overridden as & size types ([985231a](https://github.com/Atom-Learning/components/commit/985231a9259005a6b44cdfe20ba786f942dba81c))
212
+
213
+ ## [1.0.1](https://github.com/Atom-Learning/components/compare/v1.0.0...v1.0.1) (2021-11-02)
214
+
215
+
216
+ ### Bug Fixes
217
+
218
+ * remove cursor pointer from disabled tab ([34c283f](https://github.com/Atom-Learning/components/commit/34c283f70ce73d0ca2b2886e495bcece5475097c))
219
+
220
+ # 1.0.0 (2021-10-22)
221
+
222
+ - Initial release 🎉
223
+
224
+ # Changelog
225
+
226
+ All notable changes to this project will be documented in this file.
227
+
228
+ _NOTE: THIS FILE IS AUTOMATICALLY UPDATED_
@@ -1,2 +1,2 @@
1
- import{darken as o}from"color2k";import h from"invariant";import*as i from"react";import{styled as f,theme as n}from"../../stitches.js";import{Icon as m}from"../icon/Icon.js";import{ActionIconSizeMap as v}from"./ActionIcon.constants.js";import{OptionalTooltipWrapper as M}from"../../utilities/optional-tooltip-wrapper/OptionalTooltipWrapper.js";const l=(e,r,a)=>({bg:"transparent",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:r},"&:not(:disabled):active":{color:a},"&[disabled]":{color:"$tonal400",cursor:"not-allowed"}}),p=(e,r,a)=>({bg:e,color:"white","&:not(:disabled):hover, &:not(:disabled):focus":{bg:r,color:"white"},"&:not(:disabled):active":{bg:a},"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"}}),t=(e,r,a)=>({border:"1px solid",borderColor:"currentColor",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:r},"&:not(:disabled):active":{color:a},"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"}}),z=f("button",{alignItems:"center",appearance:"none",bg:"white",border:"unset",borderRadius:"$0",boxSizing:"border-box",cursor:"pointer",display:"flex",justifyContent:"center",p:"unset",transition:"all 100ms ease-out",variants:{theme:{neutral:{},primary:{},success:{},warning:{},danger:{}},appearance:{simple:{},outline:{},solid:{}},size:{xs:{size:"$2"},sm:{size:"$3"},md:{size:"$4"},lg:{size:"$5"}},isRounded:{true:{borderRadius:"$round"}}},compoundVariants:[{theme:"neutral",appearance:"simple",css:l("$tonal300","$primaryMid","$primaryDark")},{theme:"primary",appearance:"simple",css:l("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"simple",css:l("$primaryDark",o(n.colors.primaryDark.value,.1),o(n.colors.primaryDark.value,.15))},{theme:"success",appearance:"simple",css:l("$success","$successMid","$successDark")},{theme:"warning",appearance:"simple",css:l("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"simple",css:l("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"solid",css:p("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"solid",css:p("$primaryDark",o(n.colors.primaryDark.value,.1),o(n.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:p("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:p("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"solid",css:p("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"outline",css:t("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"outline",css:t("$primaryDark",o(n.colors.primaryDark.value,.1),o(n.colors.primaryDark.value,.15))},{theme:"success",appearance:"outline",css:t("$success","$successMid","$successDark")},{theme:"warning",appearance:"outline",css:t("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"outline",css:t("$danger","$dangerMid","$dangerDark")}]}),c=i.forwardRef(({children:e,theme:r="primary",appearance:a="simple",size:u="sm",label:$,href:y,disabled:d,hasTooltip:b=!0,tooltipSide:k,...D},w)=>{const g=`A single ${m.displayName} component is permitted as a child of ${c.displayName}`;return h(i.Children.count(e)===1,g),i.createElement(M,{hasTooltip:b,label:$,tooltipSide:k},i.createElement(z,{...y?{as:"a",href:d?null:y,onClick:void 0,"aria-disabled":!!d}:{type:"button"},...D,"aria-label":$,theme:r,appearance:a,size:u,ref:w,disabled:d},i.Children.map(e,s=>{if(!i.isValidElement(s))throw new Error(g);return h(s.type===m,`Children of type ${s==null?void 0:s.type} aren't permitted. Only an ${m.displayName} component is allowed in ${c.displayName}`),i.cloneElement(s,{size:v[u],css:{...s.props.css?s.props.css:{}}})})))});c.displayName="ActionIcon";export{c as ActionIcon};
1
+ import{darken as o}from"color2k";import h from"invariant";import*as i from"react";import{styled as f,theme as n}from"../../stitches.js";import{getExternalAnchorProps as v}from"../../utilities/uri/index.js";import{Icon as u}from"../icon/Icon.js";import{ActionIconSizeMap as M}from"./ActionIcon.constants.js";import{OptionalTooltipWrapper as z}from"../../utilities/optional-tooltip-wrapper/OptionalTooltipWrapper.js";const t=(e,r,a)=>({bg:"transparent",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:r},"&:not(:disabled):active":{color:a},"&[disabled]":{color:"$tonal400",cursor:"not-allowed"}}),p=(e,r,a)=>({bg:e,color:"white","&:not(:disabled):hover, &:not(:disabled):focus":{bg:r,color:"white"},"&:not(:disabled):active":{bg:a},"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"}}),l=(e,r,a)=>({border:"1px solid",borderColor:"currentColor",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:r},"&:not(:disabled):active":{color:a},"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"}}),C=f("button",{alignItems:"center",appearance:"none",bg:"white",border:"unset",borderRadius:"$0",boxSizing:"border-box",cursor:"pointer",display:"flex",justifyContent:"center",p:"unset",transition:"all 100ms ease-out",variants:{theme:{neutral:{},primary:{},success:{},warning:{},danger:{}},appearance:{simple:{},outline:{},solid:{}},size:{xs:{size:"$2"},sm:{size:"$3"},md:{size:"$4"},lg:{size:"$5"}},isRounded:{true:{borderRadius:"$round"}}},compoundVariants:[{theme:"neutral",appearance:"simple",css:t("$tonal300","$primaryMid","$primaryDark")},{theme:"primary",appearance:"simple",css:t("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"simple",css:t("$primaryDark",o(n.colors.primaryDark.value,.1),o(n.colors.primaryDark.value,.15))},{theme:"success",appearance:"simple",css:t("$success","$successMid","$successDark")},{theme:"warning",appearance:"simple",css:t("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"simple",css:t("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"solid",css:p("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"solid",css:p("$primaryDark",o(n.colors.primaryDark.value,.1),o(n.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:p("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:p("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"solid",css:p("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"outline",css:l("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"outline",css:l("$primaryDark",o(n.colors.primaryDark.value,.1),o(n.colors.primaryDark.value,.15))},{theme:"success",appearance:"outline",css:l("$success","$successMid","$successDark")},{theme:"warning",appearance:"outline",css:l("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"outline",css:l("$danger","$dangerMid","$dangerDark")}]}),c=i.forwardRef(({children:e,theme:r="primary",appearance:a="simple",size:$="sm",label:y,href:d,disabled:m,hasTooltip:b=!0,tooltipSide:k,...D},w)=>{const g=`A single ${u.displayName} component is permitted as a child of ${c.displayName}`;return h(i.Children.count(e)===1,g),i.createElement(z,{hasTooltip:b,label:y,tooltipSide:k},i.createElement(C,{...d?{as:"a",href:m?null:d,onClick:void 0,"aria-disabled":!!m}:{type:"button"},...v(d),...D,"aria-label":y,theme:r,appearance:a,size:$,ref:w,disabled:m},i.Children.map(e,s=>{if(!i.isValidElement(s))throw new Error(g);return h(s.type===u,`Children of type ${s==null?void 0:s.type} aren't permitted. Only an ${u.displayName} component is allowed in ${c.displayName}`),i.cloneElement(s,{size:M[$],css:{...s.props.css?s.props.css:{}}})})))});c.displayName="ActionIcon";export{c as ActionIcon};
2
2
  //# sourceMappingURL=ActionIcon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActionIcon.js","sources":["../../../src/components/action-icon/ActionIcon.tsx"],"sourcesContent":["import type { VariantProps } from '@stitches/react'\nimport { darken } from 'color2k'\nimport invariant from 'invariant'\nimport * as React from 'react'\n\nimport { styled, theme } from '~/stitches'\nimport { NavigatorActions } from '~/types'\nimport { Override } from '~/utilities'\nimport type { TOptionalTooltipWrapperProps } from '~/utilities/optional-tooltip-wrapper'\nimport { OptionalTooltipWrapper } from '~/utilities/optional-tooltip-wrapper'\n\nimport { Icon } from '../icon/Icon'\nimport { ActionIconSizeMap } from './ActionIcon.constants'\n\nconst getSimpleVariant = (base: string, interact: string, active: string) => ({\n bg: 'transparent',\n color: base,\n '&:not(:disabled):hover, &:not(:disabled):focus': {\n color: interact\n },\n '&:not(:disabled):active': {\n color: active\n },\n '&[disabled]': {\n color: '$tonal400',\n cursor: 'not-allowed'\n }\n})\n\nconst getSolidVariant = (base: string, interact: string, active: string) => ({\n bg: base,\n color: 'white',\n '&:not(:disabled):hover, &:not(:disabled):focus': {\n bg: interact,\n color: 'white'\n },\n '&:not(:disabled):active': {\n bg: active\n },\n '&[disabled]': {\n bg: '$tonal100',\n color: '$tonal400',\n cursor: 'not-allowed'\n }\n})\n\nconst getOutlineVariant = (base: string, interact: string, active: string) => ({\n border: '1px solid',\n borderColor: 'currentColor',\n color: base,\n '&:not(:disabled):hover, &:not(:disabled):focus': {\n color: interact\n },\n '&:not(:disabled):active': {\n color: active\n },\n '&[disabled]': {\n borderColor: '$tonal400',\n color: '$tonal400',\n cursor: 'not-allowed'\n }\n})\n\nconst StyledButton = styled('button', {\n alignItems: 'center',\n appearance: 'none',\n bg: 'white',\n border: 'unset',\n borderRadius: '$0',\n boxSizing: 'border-box',\n cursor: 'pointer',\n display: 'flex',\n justifyContent: 'center',\n p: 'unset',\n transition: 'all 100ms ease-out',\n variants: {\n theme: {\n neutral: {},\n primary: {},\n success: {},\n warning: {},\n danger: {}\n },\n appearance: {\n simple: {},\n outline: {},\n solid: {}\n },\n size: {\n xs: { size: '$2' },\n sm: { size: '$3' },\n md: { size: '$4' },\n lg: { size: '$5' }\n },\n isRounded: {\n true: {\n borderRadius: '$round'\n }\n }\n },\n compoundVariants: [\n // Appearance Simple\n {\n theme: 'neutral',\n appearance: 'simple',\n css: getSimpleVariant('$tonal300', '$primaryMid', '$primaryDark')\n },\n {\n theme: 'primary',\n appearance: 'simple',\n css: getSimpleVariant('$primary', '$primaryMid', '$primaryDark')\n },\n {\n theme: 'primaryDark',\n appearance: 'simple',\n css: getSimpleVariant(\n '$primaryDark',\n darken(theme.colors.primaryDark.value, 0.1),\n darken(theme.colors.primaryDark.value, 0.15)\n )\n },\n {\n theme: 'success',\n appearance: 'simple',\n css: getSimpleVariant('$success', '$successMid', '$successDark')\n },\n {\n theme: 'warning',\n appearance: 'simple',\n css: getSimpleVariant('$warning', '$warningMid', '$warningDark')\n },\n {\n theme: 'danger',\n appearance: 'simple',\n css: getSimpleVariant('$danger', '$dangerMid', '$dangerDark')\n },\n\n // Appearance Solid\n {\n theme: 'primary',\n appearance: 'solid',\n css: getSolidVariant('$primary', '$primaryMid', '$primaryDark')\n },\n {\n theme: 'primaryDark',\n appearance: 'solid',\n css: getSolidVariant(\n '$primaryDark',\n darken(theme.colors.primaryDark.value, 0.1),\n darken(theme.colors.primaryDark.value, 0.15)\n )\n },\n {\n theme: 'success',\n appearance: 'solid',\n css: getSolidVariant('$success', '$successMid', '$successDark')\n },\n {\n theme: 'warning',\n appearance: 'solid',\n css: getSolidVariant('$warning', '$warningMid', '$warningDark')\n },\n {\n theme: 'danger',\n appearance: 'solid',\n css: getSolidVariant('$danger', '$dangerMid', '$dangerDark')\n },\n\n // Appearance Outline\n {\n theme: 'primary',\n appearance: 'outline',\n css: getOutlineVariant('$primary', '$primaryMid', '$primaryDark')\n },\n {\n theme: 'primaryDark',\n appearance: 'outline',\n css: getOutlineVariant(\n '$primaryDark',\n darken(theme.colors.primaryDark.value, 0.1),\n darken(theme.colors.primaryDark.value, 0.15)\n )\n },\n {\n theme: 'success',\n appearance: 'outline',\n css: getOutlineVariant('$success', '$successMid', '$successDark')\n },\n {\n theme: 'warning',\n appearance: 'outline',\n css: getOutlineVariant('$warning', '$warningMid', '$warningDark')\n },\n {\n theme: 'danger',\n appearance: 'outline',\n css: getOutlineVariant('$danger', '$dangerMid', '$dangerDark')\n }\n ]\n})\n\ntype ActionIconProps = Override<\n React.ComponentProps<typeof StyledButton>,\n VariantProps<typeof StyledButton> & {\n as?: string | React.ReactNode\n children: React.ReactNode\n label: string\n } & Omit<TOptionalTooltipWrapperProps, 'label'> &\n NavigatorActions\n>\n\nexport const ActionIcon = React.forwardRef<HTMLButtonElement, ActionIconProps>(\n (\n {\n children,\n theme = 'primary',\n appearance = 'simple',\n size = 'sm',\n label,\n href,\n disabled,\n hasTooltip = true,\n tooltipSide,\n ...remainingProps\n },\n ref\n ) => {\n const INVALID_CHILDREN_MESSAGE = `A single ${Icon.displayName} component is permitted as a child of ${ActionIcon.displayName}`\n\n invariant(React.Children.count(children) === 1, INVALID_CHILDREN_MESSAGE)\n\n const optionalLinkProps = href\n ? ({\n as: 'a',\n href: disabled ? null : href,\n onClick: undefined,\n 'aria-disabled': !!disabled\n } as const)\n : ({ type: 'button' } as const)\n\n return (\n <OptionalTooltipWrapper\n hasTooltip={hasTooltip}\n label={label}\n tooltipSide={tooltipSide}\n >\n <StyledButton\n {...optionalLinkProps}\n {...remainingProps}\n aria-label={label}\n theme={theme}\n appearance={appearance}\n size={size}\n ref={ref}\n disabled={disabled}\n >\n {React.Children.map(children, (child) => {\n // TS needs this check for any following code to access child.type\n // even with optional chaining\n if (!React.isValidElement(child)) {\n throw new Error(INVALID_CHILDREN_MESSAGE)\n }\n\n invariant(\n child.type === Icon,\n `Children of type ${child?.type} aren't permitted. Only an ${Icon.displayName} component is allowed in ${ActionIcon.displayName}`\n )\n\n return React.cloneElement(child, {\n size: ActionIconSizeMap[size as string],\n css: { ...(child.props.css ? child.props.css : {}) }\n })\n })}\n </StyledButton>\n </OptionalTooltipWrapper>\n )\n }\n)\n\nActionIcon.displayName = 'ActionIcon'\n"],"names":["getSimpleVariant","base","interact","active","getSolidVariant","getOutlineVariant","StyledButton","styled","darken","theme","ActionIcon","React","children","appearance","size","label","href","disabled","hasTooltip","tooltipSide","remainingProps","ref","INVALID_CHILDREN_MESSAGE","Icon","invariant","OptionalTooltipWrapper","child","ActionIconSizeMap"],"mappings":"yVAcA,MAAMA,EAAmB,CAACC,EAAcC,EAAkBC,KAAoB,CAC5E,GAAI,cACJ,MAAOF,EACP,iDAAkD,CAChD,MAAOC,CACT,EACA,0BAA2B,CACzB,MAAOC,CACT,EACA,cAAe,CACb,MAAO,YACP,OAAQ,aACV,CACF,GAEMC,EAAkB,CAACH,EAAcC,EAAkBC,KAAoB,CAC3E,GAAIF,EACJ,MAAO,QACP,iDAAkD,CAChD,GAAIC,EACJ,MAAO,OACT,EACA,0BAA2B,CACzB,GA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AQ,IAAM,EAAGU,CAAwB,EAYtEX,EAAA,cAACc,EAAA,CACC,WAAYP,EACZ,MAAOH,EACP,YAAaI,CAAAA,EAEbR,EAAA,cAACL,EAAA,CACE,GAhBmBU,EACrB,CACC,GAAI,IACJ,KAAMC,EAAW,KAAOD,EACxB,QAAS,OACT,gBAAiB,CAAC,CAACC,CACrB,EACC,CAAE,KAAM,QAAS,EAUf,GAAGG,EACJ,aAAYL,EACZ,MAAON,EACP,WAAYI,EACZ,KAAMC,EACN,IAAKO,EACL,SAAUJ,CAAAA,EAETN,EAAM,SAAS,IAAIC,EAAWc,GAAU,CAGvC,GAAI,CAACf,EAAM,eAAee,CAAK,EAC7B,MAAM,IAAI,MAAMJ,CAAwB,EAG1C,OAAAE,EACEE,EAAM,OAASH,EACf,oBAAoBG,GAAA,KAAAA,OAAAA,EAAO,kCAAkCH,EAAK,uCAAuCb,EAAW,aACtH,EAEOC,EAAM,aAAae,EAAO,CAC/B,KAAMC,EAAkBb,GACxB,IAAK,CAAE,GAAIY,EAAM,MAAM,IAAMA,EAAM,MAAM,IAAM,CAAI,CAAA,CACrD,CAAC,CACH,CAAC,CACH,CACF,CAEJ,CACF,EAEAhB,EAAW,YAAc"}
1
+ {"version":3,"file":"ActionIcon.js","sources":["../../../src/components/action-icon/ActionIcon.tsx"],"sourcesContent":["import type { VariantProps } from '@stitches/react'\nimport { darken } from 'color2k'\nimport invariant from 'invariant'\nimport * as React from 'react'\n\nimport { styled, theme } from '~/stitches'\nimport { NavigatorActions } from '~/types'\nimport { Override } from '~/utilities'\nimport type { TOptionalTooltipWrapperProps } from '~/utilities/optional-tooltip-wrapper'\nimport { OptionalTooltipWrapper } from '~/utilities/optional-tooltip-wrapper'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport { Icon } from '../icon/Icon'\nimport { ActionIconSizeMap } from './ActionIcon.constants'\n\nconst getSimpleVariant = (base: string, interact: string, active: string) => ({\n bg: 'transparent',\n color: base,\n '&:not(:disabled):hover, &:not(:disabled):focus': {\n color: interact\n },\n '&:not(:disabled):active': {\n color: active\n },\n '&[disabled]': {\n color: '$tonal400',\n cursor: 'not-allowed'\n }\n})\n\nconst getSolidVariant = (base: string, interact: string, active: string) => ({\n bg: base,\n color: 'white',\n '&:not(:disabled):hover, &:not(:disabled):focus': {\n bg: interact,\n color: 'white'\n },\n '&:not(:disabled):active': {\n bg: active\n },\n '&[disabled]': {\n bg: '$tonal100',\n color: '$tonal400',\n cursor: 'not-allowed'\n }\n})\n\nconst getOutlineVariant = (base: string, interact: string, active: string) => ({\n border: '1px solid',\n borderColor: 'currentColor',\n color: base,\n '&:not(:disabled):hover, &:not(:disabled):focus': {\n color: interact\n },\n '&:not(:disabled):active': {\n color: active\n },\n '&[disabled]': {\n borderColor: '$tonal400',\n color: '$tonal400',\n cursor: 'not-allowed'\n }\n})\n\nconst StyledButton = styled('button', {\n alignItems: 'center',\n appearance: 'none',\n bg: 'white',\n border: 'unset',\n borderRadius: '$0',\n boxSizing: 'border-box',\n cursor: 'pointer',\n display: 'flex',\n justifyContent: 'center',\n p: 'unset',\n transition: 'all 100ms ease-out',\n variants: {\n theme: {\n neutral: {},\n primary: {},\n success: {},\n warning: {},\n danger: {}\n },\n appearance: {\n simple: {},\n outline: {},\n solid: {}\n },\n size: {\n xs: { size: '$2' },\n sm: { size: '$3' },\n md: { size: '$4' },\n lg: { size: '$5' }\n },\n isRounded: {\n true: {\n borderRadius: '$round'\n }\n }\n },\n compoundVariants: [\n // Appearance Simple\n {\n theme: 'neutral',\n appearance: 'simple',\n css: getSimpleVariant('$tonal300', '$primaryMid', '$primaryDark')\n },\n {\n theme: 'primary',\n appearance: 'simple',\n css: getSimpleVariant('$primary', '$primaryMid', '$primaryDark')\n },\n {\n theme: 'primaryDark',\n appearance: 'simple',\n css: getSimpleVariant(\n '$primaryDark',\n darken(theme.colors.primaryDark.value, 0.1),\n darken(theme.colors.primaryDark.value, 0.15)\n )\n },\n {\n theme: 'success',\n appearance: 'simple',\n css: getSimpleVariant('$success', '$successMid', '$successDark')\n },\n {\n theme: 'warning',\n appearance: 'simple',\n css: getSimpleVariant('$warning', '$warningMid', '$warningDark')\n },\n {\n theme: 'danger',\n appearance: 'simple',\n css: getSimpleVariant('$danger', '$dangerMid', '$dangerDark')\n },\n\n // Appearance Solid\n {\n theme: 'primary',\n appearance: 'solid',\n css: getSolidVariant('$primary', '$primaryMid', '$primaryDark')\n },\n {\n theme: 'primaryDark',\n appearance: 'solid',\n css: getSolidVariant(\n '$primaryDark',\n darken(theme.colors.primaryDark.value, 0.1),\n darken(theme.colors.primaryDark.value, 0.15)\n )\n },\n {\n theme: 'success',\n appearance: 'solid',\n css: getSolidVariant('$success', '$successMid', '$successDark')\n },\n {\n theme: 'warning',\n appearance: 'solid',\n css: getSolidVariant('$warning', '$warningMid', '$warningDark')\n },\n {\n theme: 'danger',\n appearance: 'solid',\n css: getSolidVariant('$danger', '$dangerMid', '$dangerDark')\n },\n\n // Appearance Outline\n {\n theme: 'primary',\n appearance: 'outline',\n css: getOutlineVariant('$primary', '$primaryMid', '$primaryDark')\n },\n {\n theme: 'primaryDark',\n appearance: 'outline',\n css: getOutlineVariant(\n '$primaryDark',\n darken(theme.colors.primaryDark.value, 0.1),\n darken(theme.colors.primaryDark.value, 0.15)\n )\n },\n {\n theme: 'success',\n appearance: 'outline',\n css: getOutlineVariant('$success', '$successMid', '$successDark')\n },\n {\n theme: 'warning',\n appearance: 'outline',\n css: getOutlineVariant('$warning', '$warningMid', '$warningDark')\n },\n {\n theme: 'danger',\n appearance: 'outline',\n css: getOutlineVariant('$danger', '$dangerMid', '$dangerDark')\n }\n ]\n})\n\ntype ActionIconProps = Override<\n React.ComponentProps<typeof StyledButton>,\n VariantProps<typeof StyledButton> & {\n as?: string | React.ReactNode\n children: React.ReactNode\n label: string\n } & Omit<TOptionalTooltipWrapperProps, 'label'> &\n NavigatorActions\n>\n\nexport const ActionIcon = React.forwardRef<HTMLButtonElement, ActionIconProps>(\n (\n {\n children,\n theme = 'primary',\n appearance = 'simple',\n size = 'sm',\n label,\n href,\n disabled,\n hasTooltip = true,\n tooltipSide,\n ...remainingProps\n },\n ref\n ) => {\n const INVALID_CHILDREN_MESSAGE = `A single ${Icon.displayName} component is permitted as a child of ${ActionIcon.displayName}`\n\n invariant(React.Children.count(children) === 1, INVALID_CHILDREN_MESSAGE)\n\n const optionalLinkProps = href\n ? ({\n as: 'a',\n href: disabled ? null : href,\n onClick: undefined,\n 'aria-disabled': !!disabled\n } as const)\n : ({ type: 'button' } as const)\n\n return (\n <OptionalTooltipWrapper\n hasTooltip={hasTooltip}\n label={label}\n tooltipSide={tooltipSide}\n >\n <StyledButton\n {...optionalLinkProps}\n {...getExternalAnchorProps(href)}\n {...remainingProps}\n aria-label={label}\n theme={theme}\n appearance={appearance}\n size={size}\n ref={ref}\n disabled={disabled}\n >\n {React.Children.map(children, (child) => {\n // TS needs this check for any following code to access child.type\n // even with optional chaining\n if (!React.isValidElement(child)) {\n throw new Error(INVALID_CHILDREN_MESSAGE)\n }\n\n invariant(\n child.type === Icon,\n `Children of type ${child?.type} aren't permitted. Only an ${Icon.displayName} component is allowed in ${ActionIcon.displayName}`\n )\n\n return React.cloneElement(child, {\n size: ActionIconSizeMap[size as string],\n css: { ...(child.props.css ? child.props.css : {}) }\n })\n })}\n </StyledButton>\n </OptionalTooltipWrapper>\n )\n }\n)\n\nActionIcon.displayName = 'ActionIcon'\n"],"names":["getSimpleVariant","base","interact","active","getSolidVariant","getOutlineVariant","StyledButton","styled","darken","theme","ActionIcon","React","children","appearance","size","label","href","disabled","hasTooltip","tooltipSide","remainingProps","ref","INVALID_CHILDREN_MESSAGE","Icon","invariant","OptionalTooltipWrapper","getExternalAnchorProps","child","ActionIconSizeMap"],"mappings":"+ZAeA,MAAMA,EAAmB,CAACC,EAAcC,EAAkBC,KAAoB,CAC5E,GAAI,cACJ,MAAOF,EACP,iDAAkD,CAChD,MAAOC,CACT,EACA,0BAA2B,CACzB,MAAOC,CACT,EAC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,KAAAC,EACA,SAAAC,EACA,WAAAC,EAAa,GACb,YAAAC,KACGC,CACL,EACAC,IACG,CACH,MAAMC,EAA2B,YAAYC,EAAK,oDAAoDb,EAAW,cAEjH,OAAAc,EAAUb,EAAM,SAAS,MAAMC,CAAQ,IAAM,EAAGU,CAAwB,EAYtEX,EAAA,cAACc,EAAA,CACC,WAAYP,EACZ,MAAOH,EACP,YAAaI,CAAAA,EAEbR,EAAA,cAACL,EAAA,CACE,GAhBmBU,EACrB,CACC,GAAI,IACJ,KAAMC,EAAW,KAAOD,EACxB,QAAS,OACT,gBAAiB,CAAC,CAACC,CACrB,EACC,CAAE,KAAM,QAAS,EAUf,GAAGS,EAAuBV,CAAI,EAC9B,GAAGI,EACJ,aAAYL,EACZ,MAAON,EACP,WAAYI,EACZ,KAAMC,EACN,IAAKO,EACL,SAAUJ,CAETN,EAAAA,EAAM,SAAS,IAAIC,EAAWe,GAAU,CAGvC,GAAI,CAAChB,EAAM,eAAegB,CAAK,EAC7B,MAAM,IAAI,MAAML,CAAwB,EAG1C,OAAAE,EACEG,EAAM,OAASJ,EACf,oBAAoBI,GAAA,KAAA,OAAAA,EAAO,kCAAkCJ,EAAK,uCAAuCb,EAAW,aACtH,EAEOC,EAAM,aAAagB,EAAO,CAC/B,KAAMC,EAAkBd,GACxB,IAAK,CAAE,GAAIa,EAAM,MAAM,IAAMA,EAAM,MAAM,IAAM,CAAI,CAAA,CACrD,CAAC,CACH,CAAC,CACH,CACF,CAEJ,CACF,EAEAjB,EAAW,YAAc"}
@@ -1,2 +1,2 @@
1
- import*as e from"react";import{Button as i}from"../../button/Button.js";import{Heading as p}from"../../heading/Heading.js";import{Stack as f}from"../../stack/Stack.js";import{Text as E}from"../../text/Text.js";import{AlertDialog as t}from"../AlertDialog.js";const u=({title:r,description:o,onAction:n,cancelActionText:c,confirmActionText:m,onClose:a,...s})=>e.createElement(t,{defaultOpen:!0},e.createElement(t.Content,{onEscapeKeyDown:l=>l.preventDefault(),onCloseAutoFocus:a,...s},e.createElement(p,{as:t.Title,size:"sm",css:{mb:"$5"}},r),o&&e.createElement(E,{as:t.Description,css:{mb:"$5"}},o),e.createElement(f,{gap:"2",justify:"end"},c&&e.createElement(i,{appearance:"outline",as:t.Cancel,onClick:()=>n(!1),size:"sm"},c),e.createElement(i,{as:t.Action,onClick:()=>n(!0),size:"sm"},m))));export{u as Alert};
1
+ import*as e from"react";import{Button as i}from"../../button/Button.js";import{Heading as x}from"../../heading/Heading.js";import{Flex as c}from"../../flex/Flex.js";import{Text as g}from"../../text/Text.js";import{AlertDialog as t}from"../AlertDialog.js";import{AlertDialogIcon as A}from"./AlertDialogIcon.js";const C=({title:m,size:a,theme:o,description:l,onAction:n,cancelActionText:r,confirmActionText:s,onClose:p,confirmElement:f,cancelElement:E,...d})=>e.createElement(t,{defaultOpen:!0},e.createElement(t.Content,{size:a,onEscapeKeyDown:u=>u.preventDefault(),onCloseAutoFocus:p,css:{display:"flex",flexDirection:"column",maxHeight:"90vh",gap:"$5"},...d},e.createElement(c,{css:{alignItems:"center",gap:"$2"}},o&&e.createElement(A,{theme:o}),e.createElement(x,{as:t.Title,size:"sm",css:{mr:"$4"}},m)),l&&e.createElement(g,{as:t.Description,css:{display:"flex",overflowY:"scroll"}},l),e.createElement(c,{gap:"2",justify:"end",wrap:"wrap"},e.createElement(t.Cancel,{asChild:!0},E||r&&e.createElement(i,{size:"sm",appearance:"outline",onClick:()=>n==null?void 0:n(!1)},r)),e.createElement(t.Action,{asChild:!0},f||e.createElement(i,{size:"sm",onClick:()=>n==null?void 0:n(!0)},s)))));export{C as Alert};
2
2
  //# sourceMappingURL=AlertDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AlertDialog.js","sources":["../../../../src/components/alert-dialog/alert-context/AlertDialog.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { CSS } from '~/stitches'\n\nimport { Button } from '../../button'\nimport { Heading } from '../../heading'\nimport { Stack } from '../../stack'\nimport { Text } from '../../text'\nimport { AlertDialog } from '../AlertDialog'\nimport type { alert } from './types'\n\ntype AlertDialogContentProps = React.ComponentProps<typeof AlertDialog> & {\n css?: CSS\n onClose: () => void\n} & alert\n\nexport const Alert: React.FC<AlertDialogContentProps> = ({\n title,\n description,\n onAction,\n cancelActionText,\n confirmActionText,\n onClose,\n ...remainingProps\n}) => (\n <AlertDialog defaultOpen>\n <AlertDialog.Content\n onEscapeKeyDown={(e) => e.preventDefault()}\n onCloseAutoFocus={onClose}\n {...remainingProps}\n >\n <Heading as={AlertDialog.Title} size=\"sm\" css={{ mb: '$5' }}>\n {title}\n </Heading>\n {description && (\n <Text as={AlertDialog.Description} css={{ mb: '$5' }}>\n {description}\n </Text>\n )}\n <Stack gap=\"2\" justify=\"end\">\n {cancelActionText && (\n <Button\n appearance=\"outline\"\n as={AlertDialog.Cancel}\n onClick={() => onAction(false)}\n size=\"sm\"\n >\n {cancelActionText}\n </Button>\n )}\n <Button\n as={AlertDialog.Action}\n onClick={() => onAction(true)}\n size=\"sm\"\n >\n {confirmActionText}\n </Button>\n </Stack>\n </AlertDialog.Content>\n </AlertDialog>\n)\n"],"names":["Alert","title","description","onAction","cancelActionText","confirmActionText","onClose","remainingProps","React","AlertDialog","e","Heading","Text","Stack","Button"],"mappings":"kQAgBO,MAAMA,EAA2C,CAAC,CACvD,MAAAC,EACA,YAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,kBAAAC,EACA,QAAAC,KACGC,CACL,IACEC,EAAA,cAACC,EAAA,CAAY,YAAW,EAAA,EACtBD,EAAA,cAACC,EAAY,QAAZ,CACC,gBAAkBC,GAAMA,EAAE,eAAA,EAC1B,iBAAkBJ,EACjB,GAAGC,CAAAA,EAEJC,EAAA,cAACG,EAAA,CAAQ,GAAIF,EAAY,MAAO,KAAK,KAAK,IAAK,CAAE,GAAI,IAAK,CACvDR,EAAAA,CACH,EACCC,GACCM,EAAA,cAACI,EAAA,CAAK,GAAIH,EAAY,YAAa,IAAK,CAAE,GAAI,IAAK,CAChDP,EAAAA,CACH,EAEFM,EAAA,cAACK,EAAA,CAAM,IAAI,IAAI,QAAQ,KAAA,EACpBT,GACCI,EAAA,cAACM,EAAA,CACC,WAAW,UACX,GAAIL,EAAY,OAChB,QAAS,IAAMN,EAAS,EAAK,EAC7B,KAAK,IAAA,EAEJC,CACH,EAEFI,EAAA,cAACM,EAAA,CACC,GAAIL,EAAY,OAChB,QAAS,IAAMN,EAAS,EAAI,EAC5B,KAAK,IAAA,EAEJE,CACH,CACF,CACF,CACF"}
1
+ {"version":3,"file":"AlertDialog.js","sources":["../../../../src/components/alert-dialog/alert-context/AlertDialog.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { CSS } from '~/stitches'\n\nimport { Button } from '../../button'\nimport { Heading } from '../../heading'\nimport { Flex } from '../../flex'\nimport { Text } from '../../text'\nimport { AlertDialog } from '../AlertDialog'\nimport { AlertDialogIcon } from './AlertDialogIcon'\nimport type { alert } from './types'\n\ntype AlertDialogContentProps = React.ComponentProps<typeof AlertDialog> & {\n css?: CSS\n onClose: () => void\n} & alert\n\nexport const Alert: React.FC<AlertDialogContentProps> = ({\n title,\n size,\n theme,\n description,\n onAction,\n cancelActionText,\n confirmActionText,\n onClose,\n confirmElement,\n cancelElement,\n ...remainingProps\n}) => (\n <AlertDialog defaultOpen>\n <AlertDialog.Content\n size={size}\n onEscapeKeyDown={(e) => e.preventDefault()}\n onCloseAutoFocus={onClose}\n css={{\n display: 'flex',\n flexDirection: 'column',\n maxHeight: '90vh',\n gap: '$5'\n }}\n {...remainingProps}\n >\n <Flex css={{ alignItems: 'center', gap: '$2' }}>\n {theme && <AlertDialogIcon theme={theme} />}\n <Heading as={AlertDialog.Title} size=\"sm\" css={{ mr: '$4' }}>\n {title}\n </Heading>\n </Flex>\n {description && (\n <Text\n as={AlertDialog.Description}\n css={{ display: 'flex', overflowY: 'scroll' }}\n >\n {description}\n </Text>\n )}\n <Flex gap=\"2\" justify=\"end\" wrap=\"wrap\">\n <AlertDialog.Cancel asChild>\n {cancelElement ||\n (cancelActionText && (\n <Button\n size=\"sm\"\n appearance=\"outline\"\n onClick={() => onAction?.(false)}\n >\n {cancelActionText}\n </Button>\n ))}\n </AlertDialog.Cancel>\n <AlertDialog.Action asChild>\n {confirmElement || (\n <Button size=\"sm\" onClick={() => onAction?.(true)}>\n {confirmActionText}\n </Button>\n )}\n </AlertDialog.Action>\n </Flex>\n </AlertDialog.Content>\n </AlertDialog>\n)\n"],"names":["Alert","title","size","theme","description","onAction","cancelActionText","confirmActionText","onClose","confirmElement","cancelElement","remainingProps","React","AlertDialog","e","Flex","AlertDialogIcon","Heading","Text","Button"],"mappings":"4TAiBaA,EAA2C,CAAC,CACvD,MAAAC,EACA,KAAAC,EACA,MAAAC,EACA,YAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,kBAAAC,EACA,QAAAC,EACA,eAAAC,EACA,cAAAC,KACGC,CACL,IACEC,EAAA,cAACC,EAAA,CAAY,YAAW,IACtBD,EAAA,cAACC,EAAY,QAAZ,CACC,KAAMX,EACN,gBAAkBY,GAAMA,EAAE,eAC1B,EAAA,iBAAkBN,EAClB,IAAK,CACH,QAAS,OACT,cAAe,SACf,UAAW,OACX,IAAK,IACP,EACC,GAAGG,CAEJC,EAAAA,EAAA,cAACG,EAAA,CAAK,IAAK,CAAE,WAAY,SAAU,IAAK,IAAK,CAC1CZ,EAAAA,GAASS,EAAA,cAACI,EAAA,CAAgB,MAAOb,EAAO,EACzCS,EAAA,cAACK,EAAA,CAAQ,GAAIJ,EAAY,MAAO,KAAK,KAAK,IAAK,CAAE,GAAI,IAAK,GACvDZ,CACH,CACF,EACCG,GACCQ,EAAA,cAACM,EAAA,CACC,GAAIL,EAAY,YAChB,IAAK,CAAE,QAAS,OAAQ,UAAW,QAAS,CAAA,EAE3CT,CACH,EAEFQ,EAAA,cAACG,EAAA,CAAK,IAAI,IAAI,QAAQ,MAAM,KAAK,MAC/BH,EAAAA,EAAA,cAACC,EAAY,OAAZ,CAAmB,QAAO,EAAA,EACxBH,GACEJ,GACCM,EAAA,cAACO,EAAA,CACC,KAAK,KACL,WAAW,UACX,QAAS,IAAMd,GAAA,KAAAA,OAAAA,EAAW,EAEzBC,CAAAA,EAAAA,CACH,CAEN,EACAM,EAAA,cAACC,EAAY,OAAZ,CAAmB,QAAO,IACxBJ,GACCG,EAAA,cAACO,EAAA,CAAO,KAAK,KAAK,QAAS,IAAMd,GAAA,KAAAA,OAAAA,EAAW,KACzCE,CACH,CAEJ,CACF,CACF,CACF"}
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare type AlertDialogTheme = 'info' | 'warning' | 'danger' | 'success';
3
+ export declare const AlertDialogIcon: ({ theme }: {
4
+ theme: AlertDialogTheme;
5
+ }) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import*as o from"react";import{Info as e,Danger as n,OkCircle as t}from"@atom-learning/icons";import{styled as s}from"../../../stitches.js";import{Icon as i}from"../../icon/Icon.js";const a=s(i,{flexShrink:0,alignSelf:"flex-start",variants:{theme:{info:{color:"$blue800"},warning:{color:"$warningMid"},danger:{color:"$danger",transform:"rotate(180deg)"},success:{color:"$success"}}}}),c={info:e,warning:n,danger:e,success:t},l=({theme:r})=>o.createElement(a,{theme:r,is:c[r]});export{l as AlertDialogIcon};
2
+ //# sourceMappingURL=AlertDialogIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlertDialogIcon.js","sources":["../../../../src/components/alert-dialog/alert-context/AlertDialogIcon.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Info, Danger, OkCircle } from '@atom-learning/icons'\nimport { styled } from '~/stitches'\n\nimport { Icon } from '../../icon'\n\nexport type AlertDialogTheme = 'info' | 'warning' | 'danger' | 'success'\n\nconst StyledIcon = styled(Icon, {\n flexShrink: 0,\n alignSelf: 'flex-start',\n variants: {\n theme: {\n info: { color: '$blue800' },\n warning: { color: '$warningMid' },\n danger: { color: '$danger', transform: 'rotate(180deg)' },\n success: { color: '$success' }\n }\n }\n})\n\nconst iconMap: Record<\n AlertDialogTheme,\n React.FC<React.SVGProps<SVGSVGElement>>\n> = {\n info: Info,\n warning: Danger,\n danger: Info,\n success: OkCircle\n}\n\nexport const AlertDialogIcon = ({ theme }: { theme: AlertDialogTheme }) => (\n <StyledIcon theme={theme} is={iconMap[theme]} />\n)\n"],"names":["StyledIcon","styled","Icon","iconMap","Info","Danger","OkCircle","AlertDialogIcon","theme","React"],"mappings":"sLAQA,MAAMA,EAAaC,EAAOC,EAAM,CAC9B,WAAY,EACZ,UAAW,aACX,SAAU,CACR,MAAO,CACL,KAAM,CAAE,MAAO,UAAW,EAC1B,QAAS,CAAE,MAAO,aAAc,EAChC,OAAQ,CAAE,MAAO,UAAW,UAAW,gBAAiB,EACxD,QAAS,CAAE,MAAO,UAAW,CAC/B,CACF,CACF,CAAC,EAEKC,EAGF,CACF,KAAMC,EACN,QAASC,EACT,OAAQD,EACR,QAASE,CACX,EAEaC,EAAkB,CAAC,CAAE,MAAAC,CAAM,IACtCC,EAAA,cAACT,EAAA,CAAW,MAAOQ,EAAO,GAAIL,EAAQK,EAAQ,CAAA"}
@@ -1,9 +1,26 @@
1
+ import * as React from 'react';
1
2
  import { uid } from 'uid';
2
- export declare type alert = {
3
+ import { AlertDialogContent } from '../AlertDialogContent';
4
+ import { AlertDialogTheme } from './AlertDialogIcon';
5
+ declare type AlertCommonProps = {
3
6
  id: ReturnType<typeof uid>;
4
7
  title: string;
8
+ size?: React.ComponentProps<typeof AlertDialogContent>['size'];
9
+ theme?: AlertDialogTheme;
5
10
  description?: string;
6
- onAction: (result: boolean) => void;
11
+ };
12
+ declare type AlertActions = {
13
+ onAction?: (result: boolean) => void;
7
14
  confirmActionText: string;
8
15
  cancelActionText?: string;
16
+ confirmElement?: never;
17
+ cancelElement?: never;
18
+ } | {
19
+ onAction?: never;
20
+ confirmActionText?: never;
21
+ cancelActionText?: never;
22
+ confirmElement: React.ReactNode;
23
+ cancelElement?: React.ReactNode;
9
24
  };
25
+ export declare type alert = AlertCommonProps & AlertActions;
26
+ export {};
@@ -1,2 +1,2 @@
1
- import{darken as n,opacify as s}from"color2k";import*as t from"react";import{StyledIcon as c}from"../icon/Icon.js";import{Loader as f}from"../loader/Loader.js";import{styled as m,theme as l}from"../../stitches.js";import{isExternalLink as b}from"../../utilities/uri/index.js";const d=(e,a,r)=>({border:"1px solid",borderColor:"currentColor",color:e,"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{textDecoration:"none",color:a},"&:not([disabled]):active":{color:r}}),i=(e,a,r,o="white")=>({bg:e,color:o,"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{bg:a,color:o},"&:not([disabled]):active":{bg:r}}),u=m("button",{alignItems:"center",bg:"unset",border:"unset",borderRadius:"$0",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:600,justifyContent:"center",p:"unset",textDecoration:"none",transition:"all 100ms ease-out",whiteSpace:"nowrap",width:"max-content",variants:{theme:{primary:{},secondary:{},success:{},warning:{},danger:{},neutral:{}},appearance:{solid:{},outline:{}},size:{sm:{fontSize:"$sm",lineHeight:1.53,height:"$3",px:"$4",gap:"$2",[`& ${c}`]:{size:16}},md:{fontSize:"$md",lineHeight:1.5,height:"$4",px:"$5",gap:"$3",[`& ${c}`]:{size:20}},lg:{fontSize:"$lg",lineHeight:1.5,height:"$5",px:"$5",gap:"$3",[`& ${c}`]:{size:22}}},isLoading:{true:{cursor:"not-allowed",opacity:.6,pointerEvents:"none"}},fullWidth:{false:{width:"max-content"},true:{width:"100%"}}},compoundVariants:[{theme:"primary",appearance:"solid",css:i("$primary","$primaryMid","$primaryDark")},{theme:"secondary",appearance:"solid",css:i("$primaryDark",n(l.colors.primaryDark.value,.1),n(l.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:i("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:i("$warning","$warningMid","$warningDark","$tonal500")},{theme:"danger",appearance:"solid",css:i("$danger","$dangerMid","$dangerDark")},{theme:"neutral",appearance:"solid",css:i("white",s("white",-.1),s("white",-.25),"$primary")},{theme:"primary",appearance:"outline",css:d("$primary","$primaryMid","$primaryDark")},{theme:"neutral",appearance:"outline",css:d("white",s("white",-.2),s("white",-.35))},{theme:"secondary",appearance:"outline",css:d("$primaryDark",n(l.colors.primaryDark.value,.1),n(l.colors.primaryDark.value,.15))}],defaultVariants:{appearance:"solid",size:"md",theme:"primary"}}),w=m("span",{alignItems:"center",display:"flex",justifyContent:"center",visibility:"hidden",variants:{size:{sm:{gap:"$2"},md:{gap:"$3"},lg:{gap:"$3"}}},defaultVariants:{size:"md"}}),k=({size:e,children:a})=>t.createElement(t.Fragment,null,t.createElement(f,{css:{position:"absolute"}}),t.createElement(w,{size:e},a)),$=t.forwardRef(({children:e,as:a,href:r,isLoading:o=!1,onClick:h,...p},g)=>{const y=b(r)?{target:"_blank",rel:"noopener noreferrer"}:{};return t.createElement(u,{as:a||(r?"a":void 0),href:r,isLoading:o,onClick:o?void 0:h,type:r?void 0:"button",...p,...y,ref:g},o?t.createElement(k,{size:p.size},e):e)});$.displayName="Button";export{$ as Button,u as StyledButton};
1
+ import{darken as n,opacify as s}from"color2k";import*as t from"react";import{StyledIcon as c}from"../icon/Icon.js";import{Loader as y}from"../loader/Loader.js";import{styled as m,theme as l}from"../../stitches.js";import{getExternalAnchorProps as f}from"../../utilities/uri/index.js";const d=(e,a,r)=>({border:"1px solid",borderColor:"currentColor",color:e,"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{textDecoration:"none",color:a},"&:not([disabled]):active":{color:r}}),i=(e,a,r,o="white")=>({bg:e,color:o,"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{bg:a,color:o},"&:not([disabled]):active":{bg:r}}),h=m("button",{alignItems:"center",bg:"unset",border:"unset",borderRadius:"$0",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:600,justifyContent:"center",p:"unset",textDecoration:"none",transition:"all 100ms ease-out",whiteSpace:"nowrap",width:"max-content",variants:{theme:{primary:{},secondary:{},success:{},warning:{},danger:{},neutral:{}},appearance:{solid:{},outline:{}},size:{sm:{fontSize:"$sm",lineHeight:1.53,height:"$3",px:"$4",gap:"$2",[`& ${c}`]:{size:16}},md:{fontSize:"$md",lineHeight:1.5,height:"$4",px:"$5",gap:"$3",[`& ${c}`]:{size:20}},lg:{fontSize:"$lg",lineHeight:1.5,height:"$5",px:"$5",gap:"$3",[`& ${c}`]:{size:22}}},isLoading:{true:{cursor:"not-allowed",opacity:.6,pointerEvents:"none"}},fullWidth:{false:{width:"max-content"},true:{width:"100%"}}},compoundVariants:[{theme:"primary",appearance:"solid",css:i("$primary","$primaryMid","$primaryDark")},{theme:"secondary",appearance:"solid",css:i("$primaryDark",n(l.colors.primaryDark.value,.1),n(l.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:i("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:i("$warning","$warningMid","$warningDark","$tonal500")},{theme:"danger",appearance:"solid",css:i("$danger","$dangerMid","$dangerDark")},{theme:"neutral",appearance:"solid",css:i("white",s("white",-.1),s("white",-.25),"$primary")},{theme:"primary",appearance:"outline",css:d("$primary","$primaryMid","$primaryDark")},{theme:"neutral",appearance:"outline",css:d("white",s("white",-.2),s("white",-.35))},{theme:"secondary",appearance:"outline",css:d("$primaryDark",n(l.colors.primaryDark.value,.1),n(l.colors.primaryDark.value,.15))}],defaultVariants:{appearance:"solid",size:"md",theme:"primary"}}),b=m("span",{alignItems:"center",display:"flex",justifyContent:"center",visibility:"hidden",variants:{size:{sm:{gap:"$2"},md:{gap:"$3"},lg:{gap:"$3"}}},defaultVariants:{size:"md"}}),w=({size:e,children:a})=>t.createElement(t.Fragment,null,t.createElement(y,{css:{position:"absolute"}}),t.createElement(b,{size:e},a)),u=t.forwardRef(({children:e,as:a,href:r,isLoading:o=!1,onClick:$,...p},g)=>t.createElement(h,{as:a||(r?"a":void 0),href:r,isLoading:o,onClick:o?void 0:$,type:r?void 0:"button",...p,...f(r),ref:g},o?t.createElement(w,{size:p.size},e):e));u.displayName="Button";export{u as Button,h as StyledButton};
2
2
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import type { VariantProps } from '@stitches/react'\nimport { darken, opacify } from 'color2k'\nimport * as React from 'react'\n\nimport { Box } from '~/components/box'\nimport { StyledIcon } from '~/components/icon'\nimport { Loader } from '~/components/loader'\nimport { styled, theme } from '~/stitches'\nimport { NavigatorActions } from '~/types'\nimport { Override } from '~/utilities'\nimport { isExternalLink } from '~/utilities/uri'\n\nconst getButtonOutlineVariant = (\n base: string,\n interact: string,\n active: string\n) => ({\n border: '1px solid',\n borderColor: 'currentColor',\n color: base,\n '&[disabled]': {\n borderColor: '$tonal400',\n color: '$tonal400',\n cursor: 'not-allowed'\n },\n '&:not([disabled]):hover, &:not([disabled]):focus': {\n textDecoration: 'none',\n color: interact\n },\n '&:not([disabled]):active': {\n color: active\n }\n})\n\nconst getButtonSolidVariant = (\n base: string,\n interact: string,\n active: string,\n text = 'white'\n) => ({\n bg: base,\n color: text,\n '&[disabled]': {\n bg: '$tonal100',\n color: '$tonal400',\n cursor: 'not-allowed'\n },\n '&:not([disabled]):hover, &:not([disabled]):focus': {\n bg: interact,\n color: text\n },\n '&:not([disabled]):active': {\n bg: active\n }\n})\n\nexport const StyledButton = styled('button', {\n alignItems: 'center',\n bg: 'unset',\n border: 'unset',\n borderRadius: '$0',\n cursor: 'pointer',\n display: 'flex',\n fontFamily: '$body',\n fontWeight: 600,\n justifyContent: 'center',\n p: 'unset',\n textDecoration: 'none',\n transition: 'all 100ms ease-out',\n whiteSpace: 'nowrap',\n width: 'max-content',\n variants: {\n theme: {\n primary: {},\n secondary: {},\n success: {},\n warning: {},\n danger: {},\n neutral: {}\n },\n appearance: {\n solid: {},\n outline: {}\n },\n size: {\n sm: {\n fontSize: '$sm',\n lineHeight: 1.53,\n height: '$3',\n px: '$4',\n gap: '$2',\n [`& ${StyledIcon}`]: { size: 16 }\n },\n md: {\n fontSize: '$md',\n lineHeight: 1.5,\n height: '$4',\n px: '$5',\n gap: '$3',\n [`& ${StyledIcon}`]: { size: 20 }\n },\n lg: {\n fontSize: '$lg',\n lineHeight: 1.5,\n height: '$5',\n px: '$5',\n gap: '$3',\n [`& ${StyledIcon}`]: { size: 22 }\n }\n },\n isLoading: {\n true: {\n cursor: 'not-allowed',\n opacity: 0.6,\n pointerEvents: 'none'\n }\n },\n fullWidth: {\n false: {\n width: 'max-content'\n },\n true: {\n width: '100%'\n }\n }\n },\n\n compoundVariants: [\n {\n theme: 'primary',\n appearance: 'solid',\n css: getButtonSolidVariant('$primary', '$primaryMid', '$primaryDark')\n },\n {\n theme: 'secondary',\n appearance: 'solid',\n css: getButtonSolidVariant(\n '$primaryDark',\n darken(theme.colors.primaryDark.value, 0.1),\n darken(theme.colors.primaryDark.value, 0.15)\n )\n },\n {\n theme: 'success',\n appearance: 'solid',\n css: getButtonSolidVariant('$success', '$successMid', '$successDark')\n },\n {\n theme: 'warning',\n appearance: 'solid',\n css: getButtonSolidVariant(\n '$warning',\n '$warningMid',\n '$warningDark',\n '$tonal500'\n )\n },\n {\n theme: 'danger',\n appearance: 'solid',\n css: getButtonSolidVariant('$danger', '$dangerMid', '$dangerDark')\n },\n {\n theme: 'neutral',\n appearance: 'solid',\n css: getButtonSolidVariant(\n 'white',\n opacify('white', -0.1),\n opacify('white', -0.25),\n '$primary'\n )\n },\n {\n theme: 'primary',\n appearance: 'outline',\n css: getButtonOutlineVariant('$primary', '$primaryMid', '$primaryDark')\n },\n {\n theme: 'neutral',\n appearance: 'outline',\n css: getButtonOutlineVariant(\n 'white',\n opacify('white', -0.2),\n opacify('white', -0.35)\n )\n },\n {\n theme: 'secondary',\n appearance: 'outline',\n css: getButtonOutlineVariant(\n '$primaryDark',\n darken(theme.colors.primaryDark.value, 0.1),\n darken(theme.colors.primaryDark.value, 0.15)\n )\n }\n ],\n\n defaultVariants: {\n appearance: 'solid',\n size: 'md',\n theme: 'primary'\n }\n})\n\nconst LoaderContentsWrapper = styled('span', {\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n visibility: 'hidden',\n variants: {\n size: {\n sm: { gap: '$2' },\n md: { gap: '$3' },\n lg: { gap: '$3' }\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst WithLoader = ({\n size,\n children\n}: React.ComponentProps<typeof LoaderContentsWrapper>) => (\n <>\n <Loader css={{ position: 'absolute' }} />\n <LoaderContentsWrapper size={size}>{children}</LoaderContentsWrapper>\n </>\n)\n\ntype ButtonProps = Override<\n React.ComponentProps<typeof StyledButton>,\n VariantProps<typeof StyledButton> & {\n as?: React.ComponentType | React.ElementType\n children: React.ReactNode\n href?: string\n isLoading?: boolean\n } & NavigatorActions\n>\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ children, as, href, isLoading = false, onClick, ...rest }, ref) => {\n const externalLinkProps = isExternalLink(href)\n ? { target: '_blank', rel: 'noopener noreferrer' }\n : {}\n\n return (\n <StyledButton\n as={as || (href ? 'a' : undefined)}\n href={href}\n isLoading={isLoading}\n onClick={!isLoading ? onClick : undefined}\n type={!href ? 'button' : undefined}\n {...rest}\n {...externalLinkProps}\n ref={ref}\n >\n {isLoading ? (\n <WithLoader size={rest.size}>{children}</WithLoader>\n ) : (\n children\n )}\n </StyledButton>\n )\n }\n) as React.FC<ButtonProps>\n\nButton.displayName = 'Button'\n"],"names":["getButtonOutlineVariant","base","interact","active","getButtonSolidVariant","text","StyledButton","styled","StyledIcon","darken","theme","opacify","LoaderContentsWrapper","WithLoader","size","children","React","Loader","Button","as","href","isLoading","onClick","rest","ref","externalLinkProps","isExternalLink"],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ACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CAAC,EAEKM,EAAa,CAAC,CAClB,KAAAC,EACA,SAAAC,CACF,IACEC,EAAA,cAAAA,EAAA,SACEA,KAAAA,EAAA,cAACC,EAAA,CAAO,IAAK,CAAE,SAAU,UAAW,CAAG,CAAA,EACvCD,EAAA,cAACJ,EAAA,CAAsB,KAAME,CAAOC,EAAAA,CAAS,CAC/C,EAaWG,EAASF,EAAM,WAC1B,CAAC,CAAE,SAAAD,EAAU,GAAAI,EAAI,KAAAC,EAAM,UAAAC,EAAY,GAAO,QAAAC,KAAYC,CAAK,EAAGC,IAAQ,CACpE,MAAMC,EAAoBC,EAAeN,CAAI,EACzC,CAAE,OAAQ,SAAU,IAAK,qBAAsB,EAC/C,CAEJ,EAAA,OACEJ,EAAA,cAACV,EACC,CAAA,GAAIa,IAAOC,EAAO,IAAM,QACxB,KAAMA,EACN,UAAWC,EACX,QAAUA,EAAsB,OAAVC,EACtB,KAAOF,EAAkB,OAAX,SACb,GAAGG,EACH,GAAGE,EACJ,IAAKD,CAEJH,EAAAA,EACCL,EAAA,cAACH,EAAA,CAAW,KAAMU,EAAK,IAAA,EAAOR,CAAS,EAEvCA,CAEJ,CAEJ,CACF,EAEAG,EAAO,YAAc"}
1
+ {"version":3,"file":"Button.js","sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import type { VariantProps } from '@stitches/react'\nimport { darken, opacify } from 'color2k'\nimport * as React from 'react'\n\nimport { Box } from '~/components/box'\nimport { StyledIcon } from '~/components/icon'\nimport { Loader } from '~/components/loader'\nimport { styled, theme } from '~/stitches'\nimport { NavigatorActions } from '~/types'\nimport { Override } from '~/utilities'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nconst getButtonOutlineVariant = (\n base: string,\n interact: string,\n active: string\n) => ({\n border: '1px solid',\n borderColor: 'currentColor',\n color: base,\n '&[disabled]': {\n borderColor: '$tonal400',\n color: '$tonal400',\n cursor: 'not-allowed'\n },\n '&:not([disabled]):hover, &:not([disabled]):focus': {\n textDecoration: 'none',\n color: interact\n },\n '&:not([disabled]):active': {\n color: active\n }\n})\n\nconst getButtonSolidVariant = (\n base: string,\n interact: string,\n active: string,\n text = 'white'\n) => ({\n bg: base,\n color: text,\n '&[disabled]': {\n bg: '$tonal100',\n color: '$tonal400',\n cursor: 'not-allowed'\n },\n '&:not([disabled]):hover, &:not([disabled]):focus': {\n bg: interact,\n color: text\n },\n '&:not([disabled]):active': {\n bg: active\n }\n})\n\nexport const StyledButton = styled('button', {\n alignItems: 'center',\n bg: 'unset',\n border: 'unset',\n borderRadius: '$0',\n cursor: 'pointer',\n display: 'flex',\n fontFamily: '$body',\n fontWeight: 600,\n justifyContent: 'center',\n p: 'unset',\n textDecoration: 'none',\n transition: 'all 100ms ease-out',\n whiteSpace: 'nowrap',\n width: 'max-content',\n variants: {\n theme: {\n primary: {},\n secondary: {},\n success: {},\n warning: {},\n danger: {},\n neutral: {}\n },\n appearance: {\n solid: {},\n outline: {}\n },\n size: {\n sm: {\n fontSize: '$sm',\n lineHeight: 1.53,\n height: '$3',\n px: '$4',\n gap: '$2',\n [`& ${StyledIcon}`]: { size: 16 }\n },\n md: {\n fontSize: '$md',\n lineHeight: 1.5,\n height: '$4',\n px: '$5',\n gap: '$3',\n [`& ${StyledIcon}`]: { size: 20 }\n },\n lg: {\n fontSize: '$lg',\n lineHeight: 1.5,\n height: '$5',\n px: '$5',\n gap: '$3',\n [`& ${StyledIcon}`]: { size: 22 }\n }\n },\n isLoading: {\n true: {\n cursor: 'not-allowed',\n opacity: 0.6,\n pointerEvents: 'none'\n }\n },\n fullWidth: {\n false: {\n width: 'max-content'\n },\n true: {\n width: '100%'\n }\n }\n },\n\n compoundVariants: [\n {\n theme: 'primary',\n appearance: 'solid',\n css: getButtonSolidVariant('$primary', '$primaryMid', '$primaryDark')\n },\n {\n theme: 'secondary',\n appearance: 'solid',\n css: getButtonSolidVariant(\n '$primaryDark',\n darken(theme.colors.primaryDark.value, 0.1),\n darken(theme.colors.primaryDark.value, 0.15)\n )\n },\n {\n theme: 'success',\n appearance: 'solid',\n css: getButtonSolidVariant('$success', '$successMid', '$successDark')\n },\n {\n theme: 'warning',\n appearance: 'solid',\n css: getButtonSolidVariant(\n '$warning',\n '$warningMid',\n '$warningDark',\n '$tonal500'\n )\n },\n {\n theme: 'danger',\n appearance: 'solid',\n css: getButtonSolidVariant('$danger', '$dangerMid', '$dangerDark')\n },\n {\n theme: 'neutral',\n appearance: 'solid',\n css: getButtonSolidVariant(\n 'white',\n opacify('white', -0.1),\n opacify('white', -0.25),\n '$primary'\n )\n },\n {\n theme: 'primary',\n appearance: 'outline',\n css: getButtonOutlineVariant('$primary', '$primaryMid', '$primaryDark')\n },\n {\n theme: 'neutral',\n appearance: 'outline',\n css: getButtonOutlineVariant(\n 'white',\n opacify('white', -0.2),\n opacify('white', -0.35)\n )\n },\n {\n theme: 'secondary',\n appearance: 'outline',\n css: getButtonOutlineVariant(\n '$primaryDark',\n darken(theme.colors.primaryDark.value, 0.1),\n darken(theme.colors.primaryDark.value, 0.15)\n )\n }\n ],\n\n defaultVariants: {\n appearance: 'solid',\n size: 'md',\n theme: 'primary'\n }\n})\n\nconst LoaderContentsWrapper = styled('span', {\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n visibility: 'hidden',\n variants: {\n size: {\n sm: { gap: '$2' },\n md: { gap: '$3' },\n lg: { gap: '$3' }\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst WithLoader = ({\n size,\n children\n}: React.ComponentProps<typeof LoaderContentsWrapper>) => (\n <>\n <Loader css={{ position: 'absolute' }} />\n <LoaderContentsWrapper size={size}>{children}</LoaderContentsWrapper>\n </>\n)\n\ntype ButtonProps = Override<\n React.ComponentProps<typeof StyledButton>,\n VariantProps<typeof StyledButton> & {\n as?: React.ComponentType | React.ElementType\n children: React.ReactNode\n href?: string\n isLoading?: boolean\n } & NavigatorActions\n>\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ children, as, href, isLoading = false, onClick, ...rest }, ref) => (\n <StyledButton\n as={as || (href ? 'a' : undefined)}\n href={href}\n isLoading={isLoading}\n onClick={!isLoading ? onClick : undefined}\n type={!href ? 'button' : undefined}\n {...rest}\n {...getExternalAnchorProps(href)}\n ref={ref}\n >\n {isLoading ? (\n <WithLoader size={rest.size}>{children}</WithLoader>\n ) : (\n children\n )}\n </StyledButton>\n )\n) as React.FC<ButtonProps>\n\nButton.displayName = 'Button'\n"],"names":["getButtonOutlineVariant","base","interact","active","getButtonSolidVariant","text","StyledButton","styled","StyledIcon","darken","theme","opacify","LoaderContentsWrapper","WithLoader","size","children","React","Loader","Button","as","href","isLoading","onClick","rest","ref","getExternalAnchorProps"],"mappings":"4RAYA,MAAMA,EAA0B,CAC9BC,EACAC,EACAC,KACI,CACJ,OAAQ,YACR,YAAa,eACb,MAAOF,EACP,cAAe,CACb,YAAa,YACb,MAAO,YACP,OAAQ,aACV,EACA,mDAAoD,CAClD,eAAgB,OAChB,MAAOC,CACT,EACA,2BAA4B,CAC1B,MAAOC,CACT,CACF,GAEMC,EAAwB,CAC5BH,EACAC,EACAC,EACAE,EAAO,WACH,CACJ,GAAIJ,EACJ,MAAOI,EACP,cAAe,CACb,GAAI,YACJ,MAAO,YACP,OAAQ,aACV,EACA,mDAAoD,CAClD,GAAIH,EACJ,MAAOG,CACT,EACA,2BAA4B,CAC1B,GAAIF,CACN,CACF,GAEaG,EAAeC,EAAO,SAAU,CAC3C,WAAY,SACZ,GAAI,QACJ,OAAQ,QACR,aAAc,KACd,OAAQ,UACR,QAAS,OACT,WAAY,QACZ,WAAY,IACZ,eAAgB,SAChB,EAAG,QACH,eAAgB,OAChB,WAAY,qBACZ,WAAY,SACZ,MAAO,cACP,SAAU,CACR,MAAO,CACL,QAAS,CACT,EAAA,UAAW,CAAC,EACZ,QAAS,CAAA,EACT,QAAS,CAAA,EACT,OAAQ,CACR,EAAA,QAAS,EACX,EACA,WAAY,CACV,MAAO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I,EACrBA,EAAQ,QAAS,IAAK,CACxB,CACF,EACA,CACE,MAAO,YACP,WAAY,UACZ,IAAKX,EACH,eACAS,EAAOC,EAAM,OAAO,YAAY,MAAO,EAAG,EAC1CD,EAAOC,EAAM,OAAO,YAAY,MAAO,GAAI,CAC7C,CACF,CACF,EAEA,gBAAiB,CACf,WAAY,QACZ,KAAM,KACN,MAAO,SACT,CACF,CAAC,EAEKE,EAAwBL,EAAO,OAAQ,CAC3C,WAAY,SACZ,QAAS,OACT,eAAgB,SAChB,WAAY,SACZ,SAAU,CACR,KAAM,CACJ,GAAI,CAAE,IAAK,IAAK,EAChB,GAAI,CAAE,IAAK,IAAK,EAChB,GAAI,CAAE,IAAK,IAAK,CAClB,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CAAC,EAEKM,EAAa,CAAC,CAClB,KAAAC,EACA,SAAAC,CACF,IACEC,EAAA,cAAAA,EAAA,SACEA,KAAAA,EAAA,cAACC,EAAA,CAAO,IAAK,CAAE,SAAU,UAAW,CAAA,CAAG,EACvCD,EAAA,cAACJ,EAAA,CAAsB,KAAME,CAAAA,EAAOC,CAAS,CAC/C,EAaWG,EAASF,EAAM,WAC1B,CAAC,CAAE,SAAAD,EAAU,GAAAI,EAAI,KAAAC,EAAM,UAAAC,EAAY,GAAO,QAAAC,KAAYC,CAAK,EAAGC,IAC5DR,EAAA,cAACV,EACC,CAAA,GAAIa,IAAOC,EAAO,IAAM,QACxB,KAAMA,EACN,UAAWC,EACX,QAAUA,EAAsB,OAAVC,EACtB,KAAOF,EAAkB,OAAX,SACb,GAAGG,EACH,GAAGE,EAAuBL,CAAI,EAC/B,IAAKI,CAAAA,EAEJH,EACCL,EAAA,cAACH,EAAA,CAAW,KAAMU,EAAK,IAAOR,EAAAA,CAAS,EAEvCA,CAEJ,CAEJ,EAEAG,EAAO,YAAc"}
@@ -1,2 +1,2 @@
1
- import e from"react";import{styled as n}from"../../stitches.js";import{DropdownMenuItem as m}from"./DropdownMenuItem.js";const i=n("a",{textDecoration:"none"}),l=({children:t,href:o,...r})=>e.createElement(m,{...r,asChild:!0},e.createElement(i,{href:o,role:"menuitem"},t));export{l as DropdownMenuLinkItem};
1
+ import r from"react";import{styled as n}from"../../stitches.js";import{getExternalAnchorProps as m}from"../../utilities/uri/index.js";import{DropdownMenuItem as i}from"./DropdownMenuItem.js";const l=n("a",{textDecoration:"none"}),p=({children:t,href:e,...o})=>r.createElement(i,{...o,asChild:!0},r.createElement(l,{href:e,role:"menuitem",...m(e)},t));export{p as DropdownMenuLinkItem};
2
2
  //# sourceMappingURL=DropdownMenuLinkItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenuLinkItem.js","sources":["../../../src/components/dropdown-menu/DropdownMenuLinkItem.tsx"],"sourcesContent":["import React from 'react'\n\nimport { styled } from '~/stitches'\n\nimport { DropdownMenuItem } from './DropdownMenuItem'\n\nconst StyledLink = styled('a', {\n textDecoration: 'none'\n})\n\nexport const DropdownMenuLinkItem: React.FC<\n React.ComponentProps<typeof DropdownMenuItem> & { href: string }\n> = ({ children, href, ...props }) => (\n <DropdownMenuItem {...props} asChild>\n <StyledLink href={href} role=\"menuitem\">\n {children}\n </StyledLink>\n </DropdownMenuItem>\n)\n"],"names":["StyledLink","styled","DropdownMenuLinkItem","children","href","props","React","DropdownMenuItem"],"mappings":"yHAMA,MAAMA,EAAaC,EAAO,IAAK,CAC7B,eAAgB,MAClB,CAAC,EAEYC,EAET,CAAC,CAAE,SAAAC,EAAU,KAAAC,KAASC,CAAM,IAC9BC,EAAA,cAACC,EAAA,CAAkB,GAAGF,EAAO,QAAO,EAClCC,EAAAA,EAAA,cAACN,EAAA,CAAW,KAAMI,EAAM,KAAK,UAC1BD,EAAAA,CACH,CACF"}
1
+ {"version":3,"file":"DropdownMenuLinkItem.js","sources":["../../../src/components/dropdown-menu/DropdownMenuLinkItem.tsx"],"sourcesContent":["import React from 'react'\n\nimport { styled } from '~/stitches'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport { DropdownMenuItem } from './DropdownMenuItem'\n\nconst StyledLink = styled('a', {\n textDecoration: 'none'\n})\n\nexport const DropdownMenuLinkItem: React.FC<\n React.ComponentProps<typeof DropdownMenuItem> & { href: string }\n> = ({ children, href, ...props }) => (\n <DropdownMenuItem {...props} asChild>\n <StyledLink href={href} role=\"menuitem\" {...getExternalAnchorProps(href)}>\n {children}\n </StyledLink>\n </DropdownMenuItem>\n)\n"],"names":["StyledLink","styled","DropdownMenuLinkItem","children","href","props","React","DropdownMenuItem","getExternalAnchorProps"],"mappings":"+LAOA,MAAMA,EAAaC,EAAO,IAAK,CAC7B,eAAgB,MAClB,CAAC,EAEYC,EAET,CAAC,CAAE,SAAAC,EAAU,KAAAC,KAASC,CAAM,IAC9BC,EAAA,cAACC,EAAA,CAAkB,GAAGF,EAAO,QAAO,EAAA,EAClCC,EAAA,cAACN,EAAA,CAAW,KAAMI,EAAM,KAAK,WAAY,GAAGI,EAAuBJ,CAAI,CACpED,EAAAA,CACH,CACF"}
@@ -1,2 +1,2 @@
1
- import*as o from"react";import{styled as p}from"../../stitches.js";import{isExternalLink as s}from"../../utilities/uri/index.js";import{StyledHeading as f}from"../heading/Heading.js";import{StyledLi as d}from"../list/List.js";import"../markdown-content/components/MarkdownCode.js";import{StyledMarkdownEmphasis as l}from"../markdown-content/components/MarkdownEmphasis.js";import"../markdown-content/components/MarkdownInlineCode.js";import"../image/Image.js";import{StyledText as c,textVariants as y}from"../text/Text.js";import"../markdown-content/components/MarkdownStrong.js";import"../divider/Divider.js";const t=p("a",{bg:"unset",border:"unset",p:"unset",color:"$primary",cursor:"pointer",fontFamily:"$body",textDecoration:"none","&:focus, &:hover":{color:"$primaryMid",textDecoration:"underline"},"&:active":{color:"$primaryDark"},[`${c} > &, ${f} > &, ${d} > &, ${l} > &`]:{fontSize:"100%",lineHeight:1,"&::before, &::after":{content:"none"}},variants:y,defaultVariants:{size:"md"}}),e=o.forwardRef(({as:i,href:r,...n},a)=>{const m=s(r)?{target:"_blank",rel:"noopener noreferrer"}:{};return o.createElement(t,{as:i||(r?void 0:"button"),noCapsize:r?void 0:!0,href:r,...n,...m,ref:a})});e.displayName="Link";export{e as Link,t as StyledLink};
1
+ import*as t from"react";import{styled as m}from"../../stitches.js";import{getExternalAnchorProps as p}from"../../utilities/uri/index.js";import{StyledHeading as s}from"../heading/Heading.js";import{StyledLi as d}from"../list/List.js";import"../markdown-content/components/MarkdownCode.js";import{StyledMarkdownEmphasis as f}from"../markdown-content/components/MarkdownEmphasis.js";import"../markdown-content/components/MarkdownInlineCode.js";import"../image/Image.js";import{StyledText as l,textVariants as c}from"../text/Text.js";import"../markdown-content/components/MarkdownStrong.js";import"../divider/Divider.js";const o=m("a",{bg:"unset",border:"unset",p:"unset",color:"$primary",cursor:"pointer",fontFamily:"$body",textDecoration:"none","&:focus, &:hover":{color:"$primaryMid",textDecoration:"underline"},"&:active":{color:"$primaryDark"},[`${l} > &, ${s} > &, ${d} > &, ${f} > &`]:{fontSize:"100%",lineHeight:1,"&::before, &::after":{content:"none"}},variants:c,defaultVariants:{size:"md"}}),e=t.forwardRef(({as:i,href:r,...n},a)=>t.createElement(o,{as:i||(r?void 0:"button"),noCapsize:r?void 0:!0,href:r,...n,...p(r),ref:a}));e.displayName="Link";export{e as Link,o as StyledLink};
2
2
  //# sourceMappingURL=Link.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","sources":["../../../src/components/link/Link.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\nimport { NavigatorActions } from '~/types'\nimport { Override } from '~/utilities'\nimport { isExternalLink } from '~/utilities/uri'\n\nimport { StyledHeading } from '../heading/Heading'\nimport { StyledLi } from '../list/List'\nimport { StyledMarkdownEmphasis } from '../markdown-content/components'\nimport { StyledText, textVariants } from '../text/Text'\n\nexport const StyledLink = styled('a', {\n bg: 'unset',\n border: 'unset',\n p: 'unset',\n color: '$primary',\n cursor: 'pointer',\n fontFamily: '$body',\n textDecoration: 'none',\n '&:focus, &:hover': {\n color: '$primaryMid',\n textDecoration: 'underline'\n },\n '&:active': {\n color: '$primaryDark'\n },\n [`${StyledText} > &, ${StyledHeading} > &, ${StyledLi} > &, ${StyledMarkdownEmphasis} > &`]:\n {\n fontSize: '100%',\n lineHeight: 1,\n '&::before, &::after': {\n content: 'none'\n }\n },\n variants: textVariants,\n defaultVariants: {\n size: 'md'\n }\n})\n\ntype LinkProps = Override<\n React.ComponentProps<typeof StyledLink>,\n {\n as?: React.ComponentType | React.ElementType\n } & NavigatorActions\n>\n\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(\n ({ as, href, ...rest }, ref) => {\n const externalLinkProps = isExternalLink(href)\n ? { target: '_blank', rel: 'noopener noreferrer' }\n : {}\n\n return (\n <StyledLink\n as={as || (!href ? 'button' : undefined)}\n noCapsize={!href ? true : undefined}\n href={href}\n {...rest}\n {...externalLinkProps}\n ref={ref}\n />\n )\n }\n) as React.FC<LinkProps>\n\nLink.displayName = 'Link'\n"],"names":["StyledLink","styled","StyledText","StyledHeading","StyledLi","StyledMarkdownEmphasis","textVariants","Link","React","as","href","rest","ref","externalLinkProps","isExternalLink"],"mappings":"kmBAYa,MAAAA,EAAaC,EAAO,IAAK,CACpC,GAAI,QACJ,OAAQ,QACR,EAAG,QACH,MAAO,WACP,OAAQ,UACR,WAAY,QACZ,eAAgB,OAChB,mBAAoB,CAClB,MAAO,cACP,eAAgB,WAClB,EACA,WAAY,CACV,MAAO,cACT,EACA,CAAC,GAAGC,UAAmBC,UAAsBC,UAAiBC,SAC5D,CACE,SAAU,OACV,WAAY,EACZ,sBAAuB,CACrB,QAAS,MACX,CACF,EACF,SAAUC,EACV,gBAAiB,CACf,KAAM,IACR,CACF,CAAC,EASYC,EAAOC,EAAM,WACxB,CAAC,CAAE,GAAAC,EAAI,KAAAC,KAASC,CAAK,EAAGC,IAAQ,CAC9B,MAAMC,EAAoBC,EAAeJ,CAAI,EACzC,CAAE,OAAQ,SAAU,IAAK,qBAAsB,EAC/C,CAAA,EAEJ,OACEF,EAAA,cAACR,EAAA,CACC,GAAIS,IAAQC,EAAkB,OAAX,UACnB,UAAYA,EAAc,OAAP,GACnB,KAAMA,EACL,GAAGC,EACH,GAAGE,EACJ,IAAKD,CACP,CAAA,CAEJ,CACF,EAEAL,EAAK,YAAc"}
1
+ {"version":3,"file":"Link.js","sources":["../../../src/components/link/Link.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\nimport { NavigatorActions } from '~/types'\nimport { Override } from '~/utilities'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport { StyledHeading } from '../heading/Heading'\nimport { StyledLi } from '../list/List'\nimport { StyledMarkdownEmphasis } from '../markdown-content/components'\nimport { StyledText, textVariants } from '../text/Text'\n\nexport const StyledLink = styled('a', {\n bg: 'unset',\n border: 'unset',\n p: 'unset',\n color: '$primary',\n cursor: 'pointer',\n fontFamily: '$body',\n textDecoration: 'none',\n '&:focus, &:hover': {\n color: '$primaryMid',\n textDecoration: 'underline'\n },\n '&:active': {\n color: '$primaryDark'\n },\n [`${StyledText} > &, ${StyledHeading} > &, ${StyledLi} > &, ${StyledMarkdownEmphasis} > &`]:\n {\n fontSize: '100%',\n lineHeight: 1,\n '&::before, &::after': {\n content: 'none'\n }\n },\n variants: textVariants,\n defaultVariants: {\n size: 'md'\n }\n})\n\ntype LinkProps = Override<\n React.ComponentProps<typeof StyledLink>,\n {\n as?: React.ComponentType | React.ElementType\n } & NavigatorActions\n>\n\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(\n ({ as, href, ...rest }, ref) => (\n <StyledLink\n as={as || (!href ? 'button' : undefined)}\n noCapsize={!href ? true : undefined}\n href={href}\n {...rest}\n {...getExternalAnchorProps(href)}\n ref={ref}\n />\n )\n) as React.FC<LinkProps>\n\nLink.displayName = 'Link'\n"],"names":["StyledLink","styled","StyledText","StyledHeading","StyledLi","StyledMarkdownEmphasis","textVariants","Link","React","as","href","rest","ref","getExternalAnchorProps"],"mappings":"0mBAYO,MAAMA,EAAaC,EAAO,IAAK,CACpC,GAAI,QACJ,OAAQ,QACR,EAAG,QACH,MAAO,WACP,OAAQ,UACR,WAAY,QACZ,eAAgB,OAChB,mBAAoB,CAClB,MAAO,cACP,eAAgB,WAClB,EACA,WAAY,CACV,MAAO,cACT,EACA,CAAC,GAAGC,UAAmBC,UAAsBC,UAAiBC,SAC5D,CACE,SAAU,OACV,WAAY,EACZ,sBAAuB,CACrB,QAAS,MACX,CACF,EACF,SAAUC,EACV,gBAAiB,CACf,KAAM,IACR,CACF,CAAC,EASYC,EAAOC,EAAM,WACxB,CAAC,CAAE,GAAAC,EAAI,KAAAC,KAASC,CAAK,EAAGC,IACtBJ,EAAA,cAACR,EAAA,CACC,GAAIS,IAAQC,EAAkB,OAAX,UACnB,UAAYA,EAAc,OAAP,GACnB,KAAMA,EACL,GAAGC,EACH,GAAGE,EAAuBH,CAAI,EAC/B,IAAKE,CACP,CAAA,CAEJ,EAEAL,EAAK,YAAc"}
@@ -1,2 +1,2 @@
1
- import*as n from"@radix-ui/react-navigation-menu";import e from"react";import{styled as t}from"../../stitches.js";import{navigationMenuBaseItemStyles as o,navigationMenuDisabledItemStyles as p,navigationMenuActiveItemStyles as v}from"./NavigationMenu.styles.js";const u=t("button",{...o,...p}),y=t(n.Item),f=t(n.Link,o,{display:"block",textDecoration:"none",lineHeight:1,variants:{elementType:{dropdownItem:{"&[data-active]":{background:"$primaryLight",color:"$primary","*":{color:"$primary"},"&:hover":{background:"$tonal50"},"&:active":{background:"$tonal100"},"&:focus-visible":{boxShadow:"0 0 0 2px $colors$primary"}}},link:{"&[data-active]":{...v}}}}}),r=e.forwardRef(({children:a,href:l,disabled:m,css:s,variant:c="link",...i},d)=>e.createElement(y,null,m?e.createElement(u,{disabled:!0,...i},a):e.createElement(f,{href:l,ref:d,elementType:c,css:s,...i},a)));r.displayName="NavigationMenuLink";export{r as NavigationMenuLink};
1
+ import*as r from"@radix-ui/react-navigation-menu";import e from"react";import{styled as t}from"../../stitches.js";import{getExternalAnchorProps as p}from"../../utilities/uri/index.js";import{navigationMenuBaseItemStyles as n,navigationMenuDisabledItemStyles as u,navigationMenuActiveItemStyles as v}from"./NavigationMenu.styles.js";const y=t("button",{...n,...u}),f=t(r.Item),g=t(r.Link,n,{display:"block",textDecoration:"none",lineHeight:1,variants:{elementType:{dropdownItem:{"&[data-active]":{background:"$primaryLight",color:"$primary","*":{color:"$primary"},"&:hover":{background:"$tonal50"},"&:active":{background:"$tonal100"},"&:focus-visible":{boxShadow:"0 0 0 2px $colors$primary"}}},link:{"&[data-active]":{...v}}}}}),l=e.forwardRef(({children:a,href:i,disabled:m,css:s,variant:c="link",...o},d)=>e.createElement(f,null,m?e.createElement(y,{disabled:!0,...o},a):e.createElement(g,{href:i,ref:d,elementType:c,css:s,...p(i),...o},a)));l.displayName="NavigationMenuLink";export{l as NavigationMenuLink};
2
2
  //# sourceMappingURL=NavigationMenuLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationMenuLink.js","sources":["../../../src/components/navigation/NavigationMenuLink.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { CSS, styled } from '~/stitches'\n\nimport {\n navigationMenuActiveItemStyles,\n navigationMenuBaseItemStyles,\n navigationMenuDisabledItemStyles\n} from './NavigationMenu.styles'\n\nconst DisabledButton = styled('button', {\n ...navigationMenuBaseItemStyles,\n ...navigationMenuDisabledItemStyles\n})\n\nconst ListItem = styled(NavigationMenuPrimitive.Item)\n\nconst StyledLink = styled(\n NavigationMenuPrimitive.Link,\n navigationMenuBaseItemStyles,\n {\n display: 'block',\n textDecoration: 'none',\n lineHeight: 1,\n variants: {\n elementType: {\n dropdownItem: {\n '&[data-active]': {\n background: '$primaryLight',\n color: '$primary',\n '*': { color: '$primary' },\n '&:hover': { background: '$tonal50' },\n '&:active': { background: '$tonal100' },\n '&:focus-visible': {\n boxShadow: '0 0 0 2px $colors$primary'\n }\n }\n },\n link: {\n '&[data-active]': { ...navigationMenuActiveItemStyles }\n }\n }\n }\n }\n)\n\ntype NavigationMenuLinkProps = {\n href: string\n active?: boolean\n disabled?: boolean\n variant?: 'link' | 'dropdownItem'\n css?: CSS\n}\n\nexport const NavigationMenuLink = React.forwardRef<\n HTMLAnchorElement,\n React.PropsWithChildren<NavigationMenuLinkProps>\n>(\n (\n { children, href, disabled, css, variant = 'link', ...props },\n forwardedRef\n ) => (\n <ListItem>\n {disabled ? (\n <DisabledButton disabled {...props}>\n {children}\n </DisabledButton>\n ) : (\n <StyledLink\n href={href}\n ref={forwardedRef}\n elementType={variant}\n css={css}\n {...props}\n >\n {children}\n </StyledLink>\n )}\n </ListItem>\n )\n)\n\nNavigationMenuLink.displayName = 'NavigationMenuLink'\n"],"names":["DisabledButton","styled","navigationMenuBaseItemStyles","navigationMenuDisabledItemStyles","ListItem","NavigationMenuPrimitive","StyledLink","navigationMenuActiveItemStyles","NavigationMenuLink","React","children","href","disabled","css","variant","props","forwardedRef"],"mappings":"sQAWA,MAAMA,EAAiBC,EAAO,SAAU,CACtC,GAAGC,EACH,GAAGC,CACL,CAAC,EAEKC,EAAWH,EAAOI,EAAwB,IAAI,EAE9CC,EAAaL,EACjBI,EAAwB,KACxBH,EACA,CACE,QAAS,QACT,eAAgB,OAChB,WAAY,EACZ,SAAU,CACR,YAAa,CACX,aAAc,CACZ,iBAAkB,CAChB,WAAY,gBACZ,MAAO,WACP,IAAK,CAAE,MAAO,UAAW,EACzB,UAAW,CAAE,WAAY,UAAW,EACpC,WAAY,CAAE,WAAY,WAAY,EACtC,kBAAmB,CACjB,UAAW,2BACb,CACF,CACF,EACA,KAAM,CACJ,iBAAkB,CAAE,GAAGK,CAA+B,CACxD,CACF,CACF,CACF,CACF,EAUaC,EAAqBC,EAAM,WAItC,CACE,CAAE,SAAAC,EAAU,KAAAC,EAAM,SAAAC,EAAU,IAAAC,EAAK,QAAAC,EAAU,UAAWC,CAAM,EAC5DC,IAEAP,EAAA,cAACL,EAAA,KACEQ,EACCH,EAAA,cAACT,EAAA,CAAe,SAAQ,GAAE,GAAGe,CAC1BL,EAAAA,CACH,EAEAD,EAAA,cAACH,EAAA,CACC,KAAMK,EACN,IAAKK,EACL,YAAaF,EACb,IAAKD,EACJ,GAAGE,GAEHL,CACH,CAEJ,CAEJ,EAEAF,EAAmB,YAAc"}
1
+ {"version":3,"file":"NavigationMenuLink.js","sources":["../../../src/components/navigation/NavigationMenuLink.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { CSS, styled } from '~/stitches'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport {\n navigationMenuActiveItemStyles,\n navigationMenuBaseItemStyles,\n navigationMenuDisabledItemStyles\n} from './NavigationMenu.styles'\n\nconst DisabledButton = styled('button', {\n ...navigationMenuBaseItemStyles,\n ...navigationMenuDisabledItemStyles\n})\n\nconst ListItem = styled(NavigationMenuPrimitive.Item)\n\nconst StyledLink = styled(\n NavigationMenuPrimitive.Link,\n navigationMenuBaseItemStyles,\n {\n display: 'block',\n textDecoration: 'none',\n lineHeight: 1,\n variants: {\n elementType: {\n dropdownItem: {\n '&[data-active]': {\n background: '$primaryLight',\n color: '$primary',\n '*': { color: '$primary' },\n '&:hover': { background: '$tonal50' },\n '&:active': { background: '$tonal100' },\n '&:focus-visible': {\n boxShadow: '0 0 0 2px $colors$primary'\n }\n }\n },\n link: {\n '&[data-active]': { ...navigationMenuActiveItemStyles }\n }\n }\n }\n }\n)\n\ntype NavigationMenuLinkProps = {\n href: string\n active?: boolean\n disabled?: boolean\n variant?: 'link' | 'dropdownItem'\n css?: CSS\n}\n\nexport const NavigationMenuLink = React.forwardRef<\n HTMLAnchorElement,\n React.PropsWithChildren<NavigationMenuLinkProps>\n>(\n (\n { children, href, disabled, css, variant = 'link', ...props },\n forwardedRef\n ) => (\n <ListItem>\n {disabled ? (\n <DisabledButton disabled {...props}>\n {children}\n </DisabledButton>\n ) : (\n <StyledLink\n href={href}\n ref={forwardedRef}\n elementType={variant}\n css={css}\n {...getExternalAnchorProps(href)}\n {...props}\n >\n {children}\n </StyledLink>\n )}\n </ListItem>\n )\n)\n\nNavigationMenuLink.displayName = 'NavigationMenuLink'\n"],"names":["DisabledButton","styled","navigationMenuBaseItemStyles","navigationMenuDisabledItemStyles","ListItem","NavigationMenuPrimitive","StyledLink","navigationMenuActiveItemStyles","NavigationMenuLink","React","children","href","disabled","css","variant","props","forwardedRef","getExternalAnchorProps"],"mappings":"4UAYA,MAAMA,EAAiBC,EAAO,SAAU,CACtC,GAAGC,EACH,GAAGC,CACL,CAAC,EAEKC,EAAWH,EAAOI,EAAwB,IAAI,EAE9CC,EAAaL,EACjBI,EAAwB,KACxBH,EACA,CACE,QAAS,QACT,eAAgB,OAChB,WAAY,EACZ,SAAU,CACR,YAAa,CACX,aAAc,CACZ,iBAAkB,CAChB,WAAY,gBACZ,MAAO,WACP,IAAK,CAAE,MAAO,UAAW,EACzB,UAAW,CAAE,WAAY,UAAW,EACpC,WAAY,CAAE,WAAY,WAAY,EACtC,kBAAmB,CACjB,UAAW,2BACb,CACF,CACF,EACA,KAAM,CACJ,iBAAkB,CAAE,GAAGK,CAA+B,CACxD,CACF,CACF,CACF,CACF,EAUaC,EAAqBC,EAAM,WAItC,CACE,CAAE,SAAAC,EAAU,KAAAC,EAAM,SAAAC,EAAU,IAAAC,EAAK,QAAAC,EAAU,UAAWC,CAAM,EAC5DC,IAEAP,EAAA,cAACL,EAAA,KACEQ,EACCH,EAAA,cAACT,EAAA,CAAe,SAAQ,GAAE,GAAGe,GAC1BL,CACH,EAEAD,EAAA,cAACH,EAAA,CACC,KAAMK,EACN,IAAKK,EACL,YAAaF,EACb,IAAKD,EACJ,GAAGI,EAAuBN,CAAI,EAC9B,GAAGI,GAEHL,CACH,CAEJ,CAEJ,EAEAF,EAAmB,YAAc"}
@@ -1,2 +1,2 @@
1
- import{Link as m}from"@radix-ui/react-navigation-menu";import t from"react";import{styled as c}from"../../stitches.js";import{isExternalLink as f}from"../../utilities/uri/index.js";import{navigationMenuVerticalItemStyles as p}from"./NavigationMenuVertical.styles.js";import{NavigationMenuVerticalItem as u}from"./NavigationMenuVerticalItem.js";import{NavigationMenuVerticalItemContent as s}from"./NavigationMenuVerticalItemContent.js";import{preventEvent as g}from"../../utilities/event/preventEvent.js";const v=c(m,p),E=({as:r,href:e,children:n,...o})=>{const i=f(e)?{target:"_blank",rel:"noopener noreferrer"}:{},a={type:"button"},l=r||(e?"a":"button");return t.createElement(u,null,t.createElement(v,{size:"lg",href:e,...o,...r?{}:e?i:a,onSelect:g,asChild:!0},t.createElement(l,null,t.createElement(s,null,n))))};export{E as NavigationMenuVerticalLink};
1
+ import{Link as a}from"@radix-ui/react-navigation-menu";import t from"react";import{styled as l}from"../../stitches.js";import{getExternalAnchorProps as c}from"../../utilities/uri/index.js";import{navigationMenuVerticalItemStyles as p}from"./NavigationMenuVertical.styles.js";import{NavigationMenuVerticalItem as f}from"./NavigationMenuVerticalItem.js";import{NavigationMenuVerticalItemContent as u}from"./NavigationMenuVerticalItemContent.js";import{preventEvent as s}from"../../utilities/event/preventEvent.js";const v=l(a,p),g=({as:r,href:e,children:n,...o})=>{const i=r||(e?"a":"button"),m=r?{}:e?c(e):{type:"button"};return t.createElement(f,null,t.createElement(v,{size:"lg",href:e,...o,...m,onSelect:s,asChild:!0},t.createElement(i,null,t.createElement(u,null,n))))};export{g as NavigationMenuVerticalLink};
2
2
  //# sourceMappingURL=NavigationMenuVerticalLink.js.map