@vadimcomanescu/nadicode-design-system 4.0.7 → 4.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/tokens.css +70 -91
- package/dist/catalog/components.js +117 -117
- package/dist/{chunk-XKKFSFYO.js → chunk-2325VORX.js} +4 -4
- package/dist/{chunk-BRICSLHJ.js → chunk-2HETVNKL.js} +1 -1
- package/dist/{chunk-Q5IYBNA7.js → chunk-2IMMY3XX.js} +2 -2
- package/dist/{chunk-YZWC4EY4.js → chunk-2KTT2AYB.js} +2 -2
- package/dist/{chunk-TCQIJ3DO.js → chunk-2S4727W3.js} +2 -2
- package/dist/{chunk-25BOZMXA.js → chunk-2WV6RLAC.js} +2 -2
- package/dist/{chunk-RNCX4JIE.js → chunk-2YZZJUJ6.js} +2 -2
- package/dist/{chunk-AH6YSYYT.js → chunk-3HHLJH72.js} +1 -1
- package/dist/{chunk-C33GUEDY.js → chunk-3QKI6RJX.js} +8 -8
- package/dist/{chunk-LCMAB2BX.js → chunk-3RCDKGEU.js} +9 -9
- package/dist/{chunk-DNJOBML6.js → chunk-3TZLHB2L.js} +1 -1
- package/dist/{chunk-KQ7ZC6EM.js → chunk-4CUKPNS5.js} +2 -2
- package/dist/{chunk-BRXNGF5W.js → chunk-4GSIGQXI.js} +2 -2
- package/dist/{chunk-SWRJWMGG.js → chunk-4QMIT6UE.js} +1 -1
- package/dist/{chunk-ZM2NODUK.js → chunk-4QOH76MI.js} +1 -1
- package/dist/{chunk-55HD4L6G.js → chunk-4TF4QFIM.js} +1 -1
- package/dist/{chunk-3ZPNIY2Z.js → chunk-557WPFT4.js} +8 -8
- package/dist/{chunk-PV62D7H6.js → chunk-5CXWLUM5.js} +2 -2
- package/dist/{chunk-IC3BMFHV.js → chunk-5NOH3QLY.js} +4 -4
- package/dist/{chunk-6NCLYJAI.js → chunk-67IG5FCH.js} +6 -6
- package/dist/{chunk-GJUR6HT3.js → chunk-6CLSVCWP.js} +1 -1
- package/dist/{chunk-RKQPU75I.js → chunk-6QNV75XU.js} +4 -4
- package/dist/{chunk-HWHJ6IRQ.js → chunk-73T44TBV.js} +3 -3
- package/dist/{chunk-LP6ZZYOQ.js → chunk-7ANMFY6R.js} +1 -1
- package/dist/{chunk-JC5W5UPI.js → chunk-7LIF2WZX.js} +1 -1
- package/dist/{chunk-W7FXDRQJ.js → chunk-7TGOAMCR.js} +2 -2
- package/dist/{chunk-ZXVDDZZL.js → chunk-7XRKBROR.js} +1 -1
- package/dist/{chunk-3JJBJ4VR.js → chunk-A4UWREN6.js} +3 -3
- package/dist/{chunk-GJ557DGH.js → chunk-ABV4BQF6.js} +5 -5
- package/dist/{chunk-HJ3A2YNO.js → chunk-B5HTI43H.js} +2 -2
- package/dist/{chunk-5PZ4VR2D.js → chunk-B66BU2S5.js} +1 -1
- package/dist/{chunk-WSU2PCA2.js → chunk-B7ELF2FN.js} +1 -0
- package/dist/{chunk-VBZQ4DBE.js → chunk-BI3TXPMR.js} +1 -1
- package/dist/{chunk-VNNAL4A6.js → chunk-BKWURLHQ.js} +3 -3
- package/dist/{chunk-OJ7OO3QB.js → chunk-BPULUURW.js} +5 -5
- package/dist/{chunk-S5OY2B63.js → chunk-BXH7TNB3.js} +2 -2
- package/dist/{chunk-N3YFYMNZ.js → chunk-C4PVGV2F.js} +3 -3
- package/dist/{chunk-W73JAOHW.js → chunk-C6MJQDPC.js} +1 -1
- package/dist/{chunk-E4L6LR6P.js → chunk-CCUXLYZX.js} +1 -1
- package/dist/{chunk-7IADIXDV.js → chunk-CI2O2OSW.js} +2 -2
- package/dist/{chunk-7NS3VFD7.js → chunk-CIDN3ULD.js} +5 -5
- package/dist/{chunk-7ALMTY6W.js → chunk-CN3DMZOJ.js} +8 -8
- package/dist/{chunk-VCCI3NRD.js → chunk-CPSTGXWC.js} +1 -1
- package/dist/{chunk-MB6TIORE.js → chunk-D3PKI34R.js} +2 -2
- package/dist/{chunk-HFBJ6L6O.js → chunk-D4BKRPO4.js} +1 -1
- package/dist/{chunk-LV4P7WVM.js → chunk-DVU2EABM.js} +2 -2
- package/dist/{chunk-XCZIF75R.js → chunk-ENZ2HF3I.js} +2 -2
- package/dist/{chunk-VRGPG2YN.js → chunk-ERYYZSJU.js} +4 -4
- package/dist/{chunk-IXQGKJU4.js → chunk-FAPU77SV.js} +2 -2
- package/dist/{chunk-J2DCQDXO.js → chunk-FF3XUIZO.js} +3 -3
- package/dist/{chunk-QIHA7S3A.js → chunk-FODQX5Q5.js} +2 -2
- package/dist/{chunk-SP7NIZFP.js → chunk-FRAGRQOH.js} +1 -1
- package/dist/{chunk-32OLQ7FC.js → chunk-G2YPDV3F.js} +4 -4
- package/dist/{chunk-ALA6OM7K.js → chunk-G4FB7QSY.js} +3 -3
- package/dist/{chunk-DEZXWNYF.js → chunk-G6EQO6QD.js} +2 -2
- package/dist/{chunk-BYEHHZZN.js → chunk-GUSLJ3AL.js} +4 -4
- package/dist/{chunk-BRCBJ3S4.js → chunk-GZ6VDBQG.js} +1 -1
- package/dist/{chunk-LCKLZ4XK.js → chunk-HWOGLSB6.js} +1 -1
- package/dist/{chunk-HZERHGBT.js → chunk-IJ46YEUQ.js} +3 -3
- package/dist/{chunk-Z2WION42.js → chunk-ILFUTPHO.js} +1 -1
- package/dist/{chunk-YDYDGG5K.js → chunk-J7F42IR3.js} +1 -1
- package/dist/{chunk-TPJ6JJ2F.js → chunk-JGEE66UI.js} +2 -2
- package/dist/{chunk-UWHKZX4Y.js → chunk-JICACDAV.js} +1 -1
- package/dist/{chunk-HPTHS7SX.js → chunk-JQFECS4H.js} +3 -3
- package/dist/{chunk-SIQNG72C.js → chunk-JXZ4HYXA.js} +2 -2
- package/dist/{chunk-KWILREVQ.js → chunk-K5JBAA4S.js} +4 -4
- package/dist/{chunk-4MWKE6F5.js → chunk-KCOMDSQ4.js} +3 -3
- package/dist/{chunk-2HDB6MDK.js → chunk-KFL4YCMI.js} +1 -1
- package/dist/{chunk-C7WHMSF3.js → chunk-KQ672GKM.js} +2 -2
- package/dist/{chunk-FTGFOK6T.js → chunk-L3WRHSHM.js} +3 -3
- package/dist/{chunk-K5AFXZDL.js → chunk-L7XRBXDR.js} +1 -1
- package/dist/{chunk-GJPTPLCQ.js → chunk-LPED36AD.js} +1 -1
- package/dist/{chunk-CZ7NGW7N.js → chunk-MLLNRFNW.js} +1 -1
- package/dist/{chunk-HMFIUUYC.js → chunk-MO4BC6JT.js} +4 -4
- package/dist/{chunk-FX23F33E.js → chunk-N2J3XFR6.js} +2 -2
- package/dist/{chunk-4TUJJ3UI.js → chunk-N3S6KCXN.js} +2 -2
- package/dist/{chunk-HJZRSPWB.js → chunk-N5QVBOYM.js} +2 -2
- package/dist/{chunk-CUDMDYKE.js → chunk-NOQKH3IZ.js} +6 -6
- package/dist/{chunk-NEHCPO53.js → chunk-NTN5DWXV.js} +2 -2
- package/dist/{chunk-U7V6TREO.js → chunk-O4QTL2EQ.js} +1 -1
- package/dist/{chunk-X6VXWEDO.js → chunk-OMEWVRBK.js} +1 -1
- package/dist/{chunk-3U56FXYC.js → chunk-OXEVIO5Z.js} +1 -1
- package/dist/{chunk-224KPIOG.js → chunk-P3IWXUMH.js} +1 -1
- package/dist/{chunk-N53OMWW2.js → chunk-PC6VMNDY.js} +4 -4
- package/dist/{chunk-VZCB4APK.js → chunk-QLL3Z6U6.js} +2 -2
- package/dist/{chunk-QVAV4MA2.js → chunk-QLOLLRTD.js} +2 -2
- package/dist/{chunk-CVTMWSNS.js → chunk-QOHUG6UP.js} +3 -3
- package/dist/{chunk-4S326Z3D.js → chunk-R3LESSOE.js} +1 -1
- package/dist/{chunk-DNJEVMDY.js → chunk-R3OWXU5R.js} +1 -1
- package/dist/{chunk-FRGZSR2P.js → chunk-R4CRWXEQ.js} +1 -1
- package/dist/{chunk-WAP7DBSW.js → chunk-RAVRFGA5.js} +1 -1
- package/dist/{chunk-MGSGCARB.js → chunk-SBC32M5H.js} +3 -3
- package/dist/{chunk-TEWCCMRH.js → chunk-SNSFT4EZ.js} +7 -7
- package/dist/{chunk-FV2G6SAF.js → chunk-TBD4VKXH.js} +2 -2
- package/dist/{chunk-RPVG37RB.js → chunk-TBJPLMUE.js} +1 -1
- package/dist/{chunk-AYWL4IYM.js → chunk-TBXW5MDR.js} +3 -3
- package/dist/{chunk-LDW4LHUM.js → chunk-UFZH45UL.js} +1 -1
- package/dist/{chunk-QJCE7NZF.js → chunk-UIZTZCAU.js} +1 -1
- package/dist/{chunk-ZFKSVEYW.js → chunk-UO5DYAP7.js} +1 -1
- package/dist/{chunk-KNR3WB5C.js → chunk-UWLSJLKT.js} +3 -3
- package/dist/{chunk-WI547C47.js → chunk-UXX6HHPS.js} +4 -4
- package/dist/{chunk-VEO56RH4.js → chunk-V3FMLBOA.js} +1 -1
- package/dist/{chunk-U4GYSYGN.js → chunk-X4HXVLER.js} +2 -2
- package/dist/{chunk-POFFOUQW.js → chunk-X5AEOQAL.js} +2 -2
- package/dist/{chunk-RWCL5OPX.js → chunk-XA7VQWCT.js} +2 -2
- package/dist/{chunk-YMJOUYMT.js → chunk-XFQLYQCV.js} +8 -8
- package/dist/{chunk-UR43ANYS.js → chunk-YCSEV2GM.js} +4 -4
- package/dist/{chunk-YQCDWJBT.js → chunk-YNRO42PX.js} +3 -3
- package/dist/{chunk-XO7TBM47.js → chunk-YVS2TJ7I.js} +3 -3
- package/dist/{chunk-RGE5OQMZ.js → chunk-YZXCW44Y.js} +3 -3
- package/dist/{chunk-HRIEX66J.js → chunk-Z2NBLCSD.js} +1 -1
- package/dist/{chunk-ZKLB5N3Q.js → chunk-ZBQLUB3B.js} +1 -1
- package/dist/{chunk-K7NQ6ZAW.js → chunk-ZI22L4DD.js} +2 -2
- package/dist/{chunk-VDONTZZX.js → chunk-ZR7PL5XQ.js} +2 -2
- package/dist/{chunk-IPXL7WX7.js → chunk-ZTNHUABC.js} +1 -1
- package/dist/{chunk-4KZLCCIR.js → chunk-ZTYKDD4V.js} +1 -1
- package/dist/{chunk-WVKJNHQM.js → chunk-ZYWO77BI.js} +2 -2
- package/dist/components/blocks/AccountLockedBlock.js +3 -3
- package/dist/components/blocks/ActivityFeedBlock.js +2 -2
- package/dist/components/blocks/AgentProfileGridBlock.js +3 -3
- package/dist/components/blocks/AgentRunOverviewBlock.js +4 -4
- package/dist/components/blocks/AgentWorkbenchBlock.js +3 -3
- package/dist/components/blocks/ApiKeysBlock.js +4 -4
- package/dist/components/blocks/AuthLayout.js +5 -5
- package/dist/components/blocks/AuthSuccessBlock.js +2 -2
- package/dist/components/blocks/BannerBlock.js +2 -2
- package/dist/components/blocks/BarChartBlock.js +5 -5
- package/dist/components/blocks/BenchmarksBlock.js +3 -3
- package/dist/components/blocks/CallToActionBlock.js +2 -2
- package/dist/components/blocks/ChangelogBlock.js +2 -2
- package/dist/components/blocks/ChartBlock.js +4 -4
- package/dist/components/blocks/ChartCollectionBlock.js +11 -11
- package/dist/components/blocks/CheckEmailBlock.js +2 -2
- package/dist/components/blocks/CommandPaletteBlock.js +2 -2
- package/dist/components/blocks/ComparisonBlock.js +3 -3
- package/dist/components/blocks/ContactBlock.js +3 -3
- package/dist/components/blocks/CreateBlock.js +2 -2
- package/dist/components/blocks/DataGridBlock.js +2 -2
- package/dist/components/blocks/DirectoryBlock.js +3 -3
- package/dist/components/blocks/EmailVerifiedBlock.js +2 -2
- package/dist/components/blocks/FAQBlock.js +3 -3
- package/dist/components/blocks/FeatureBlock.js +3 -3
- package/dist/components/blocks/FeatureGridBlock.js +3 -3
- package/dist/components/blocks/FooterBlock.js +2 -2
- package/dist/components/blocks/ForgotPasswordBlock.js +2 -2
- package/dist/components/blocks/GalleryBlock.js +4 -4
- package/dist/components/blocks/HeatmapChartBlock.js +4 -4
- package/dist/components/blocks/HeroBlock.js +4 -4
- package/dist/components/blocks/HeroSectionBlock.js +2 -2
- package/dist/components/blocks/IntegrationsBlock.js +3 -3
- package/dist/components/blocks/InteractiveAreaChartBlock.js +4 -4
- package/dist/components/blocks/KanbanDemoBlock.js +4 -4
- package/dist/components/blocks/LoginBlock.js +4 -4
- package/dist/components/blocks/LogoCloud.js +2 -2
- package/dist/components/blocks/MagicLinkBlock.js +3 -3
- package/dist/components/blocks/NavUser.js +2 -2
- package/dist/components/blocks/NewsletterBlock.js +3 -3
- package/dist/components/blocks/NotFoundBlock.js +3 -3
- package/dist/components/blocks/OTPBlock.js +2 -2
- package/dist/components/blocks/OnboardingBlock.js +3 -3
- package/dist/components/blocks/PasswordChangedBlock.js +2 -2
- package/dist/components/blocks/PasswordRecoveryBlock.js +2 -2
- package/dist/components/blocks/PricingBlock.js +3 -3
- package/dist/components/blocks/PricingTableBlock.js +3 -3
- package/dist/components/blocks/ProcessFlowBlock.js +3 -3
- package/dist/components/blocks/ResetPasswordBlock.js +2 -2
- package/dist/components/blocks/SavingsCalculatorBlock.js +3 -3
- package/dist/components/blocks/SettingsLayout.js +3 -3
- package/dist/components/blocks/SignUpBlock.js +3 -3
- package/dist/components/blocks/SocialProofBlock.js +3 -3
- package/dist/components/blocks/SolutionShowcaseBlock.js +3 -3
- package/dist/components/blocks/StatsBlock.js +3 -3
- package/dist/components/blocks/StatsMarketingBlock.js +2 -2
- package/dist/components/blocks/TeamBlock.js +2 -2
- package/dist/components/blocks/TestimonialsBlock.js +3 -3
- package/dist/components/blocks/TimezonePickerBlock.js +3 -3
- package/dist/components/blocks/TwoFactorChallengeBlock.js +3 -3
- package/dist/components/blocks/TwoFactorSetupBlock.js +3 -3
- package/dist/components/blocks/UsageDonutBlock.js +5 -5
- package/dist/components/blocks/VoiceAgentCard.js +4 -4
- package/dist/components/blocks/WizardBlock.js +3 -3
- package/dist/components/blocks/WorkspaceSwitcherBlock.js +2 -2
- package/dist/components/blocks/user/InviteUserModal.js +2 -2
- package/dist/components/page-kits/AccountLockedPageKit.js +4 -4
- package/dist/components/page-kits/AgentsChatPageKit.js +6 -6
- package/dist/components/page-kits/AnalyticsPageKit.js +8 -8
- package/dist/components/page-kits/BlogContentPageKit.js +8 -8
- package/dist/components/page-kits/CheckoutPageKit.js +7 -7
- package/dist/components/page-kits/CompanySuitePageKit.js +10 -10
- package/dist/components/page-kits/CrudFormPageKit.js +6 -6
- package/dist/components/page-kits/CrudListDetailPageKit.js +7 -7
- package/dist/components/page-kits/DashboardPageKit.js +10 -10
- package/dist/components/page-kits/ErrorPageKit.js +3 -3
- package/dist/components/page-kits/KanbanBoardPageKit.js +8 -8
- package/dist/components/page-kits/LandingPageKit.js +15 -15
- package/dist/components/page-kits/LoginPageKit.js +5 -5
- package/dist/components/page-kits/MarketingShellPageKit.js +3 -3
- package/dist/components/page-kits/NavigationShellPageKit.js +2 -2
- package/dist/components/page-kits/OnboardingPageKit.js +7 -7
- package/dist/components/page-kits/PricingPageKit.js +10 -10
- package/dist/components/page-kits/ProfileSettingsPageKit.js +6 -6
- package/dist/components/page-kits/RecoveryPageKit.js +3 -3
- package/dist/components/page-kits/ResetPageKit.js +3 -3
- package/dist/components/page-kits/ServiceSuitePageKit.js +14 -14
- package/dist/components/page-kits/SettingsPageKit.js +5 -5
- package/dist/components/page-kits/SignupPageKit.js +5 -5
- package/dist/components/page-kits/SuccessPageKit.js +3 -3
- package/dist/components/page-kits/TeamSettingsPageKit.js +8 -8
- package/dist/components/page-kits/TwoFactorPageKit.js +6 -6
- package/dist/components/page-kits/VerifyEmailPageKit.js +3 -3
- package/dist/components/page-kits/VoiceAgentsPageKit.js +6 -6
- package/dist/components/ui/Alert.js +1 -1
- package/dist/components/ui/AmbientGrid.js +2 -2
- package/dist/components/ui/AnimatedDialog.js +1 -1
- package/dist/components/ui/Avatar3D.js +1 -1
- package/dist/components/ui/AvatarUpload.js +2 -2
- package/dist/components/ui/BrandIcons.js +1 -1
- package/dist/components/ui/Card.js +1 -1
- package/dist/components/ui/Chart.d.ts +7 -0
- package/dist/components/ui/Chart.js +1 -1
- package/dist/components/ui/ChartCard.js +3 -3
- package/dist/components/ui/CheckoutForm.js +3 -3
- package/dist/components/ui/CheckoutFormDemo.js +6 -6
- package/dist/components/ui/Combobox.js +2 -2
- package/dist/components/ui/Command.js +2 -2
- package/dist/components/ui/Dialog.js +1 -1
- package/dist/components/ui/Drawer.js +1 -1
- package/dist/components/ui/Empty.js +1 -1
- package/dist/components/ui/Heading.js +1 -1
- package/dist/components/ui/MetricCard.js +2 -2
- package/dist/components/ui/MouseEffect.js +1 -1
- package/dist/components/ui/NotificationCenter.js +1 -1
- package/dist/components/ui/PromoCard.js +2 -2
- package/dist/components/ui/SettingsModal.js +1 -1
- package/dist/components/ui/Sidebar.js +1 -1
- package/dist/components/ui/Typography.js +1 -1
- package/dist/components/ui/WorkflowGraph.js +1 -1
- package/dist/components/ui/charts/AreaChart.js +2 -2
- package/dist/components/ui/charts/BarChart.js +2 -2
- package/dist/components/ui/charts/HeatmapChart.js +2 -2
- package/dist/components/ui/charts/LineChart.js +2 -2
- package/dist/components/ui/charts/PieChart.js +2 -2
- package/dist/components/ui/charts/RadarChart.js +2 -2
- package/dist/components/ui/charts/RadialBarChart.js +2 -2
- package/dist/components/ui/charts/index.js +8 -8
- package/dist/index.js +3 -3
- package/dist/lib/patterns.js +7 -8
- package/dist/lib/tokens.config.d.ts +50 -0
- package/dist/tokens.d.ts +7 -0
- package/eslint-rules/nadicode/config.js +3 -0
- package/eslint-rules/nadicode/index.js +6 -0
- package/eslint-rules/nadicode/rules/__tests__/no-arbitrary-tracking.test.js +53 -0
- package/eslint-rules/nadicode/rules/__tests__/no-glass-on-navigation.test.js +62 -0
- package/eslint-rules/nadicode/rules/__tests__/restrict-font-weight.test.js +75 -0
- package/eslint-rules/nadicode/rules/no-arbitrary-tracking.js +72 -0
- package/eslint-rules/nadicode/rules/no-glass-on-navigation.js +115 -0
- package/eslint-rules/nadicode/rules/restrict-font-weight.js +95 -0
- package/package.json +1 -1
- package/src/lib/tokens.config.js +104 -88
- package/tailwind.config.js +3 -0
- /package/dist/{chunk-DJTF3XFB.js → chunk-EL4XPFOD.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { RadialBarChart } from '../../../chunk-
|
|
2
|
-
export { AreaChart } from '../../../chunk-
|
|
3
|
-
export { BarChart } from '../../../chunk-
|
|
4
|
-
export { HeatmapChart } from '../../../chunk-
|
|
5
|
-
export { LineChart } from '../../../chunk-
|
|
6
|
-
export { PieChart } from '../../../chunk-
|
|
7
|
-
export { RadarChart } from '../../../chunk-
|
|
8
|
-
import '../../../chunk-
|
|
1
|
+
export { RadialBarChart } from '../../../chunk-RAVRFGA5.js';
|
|
2
|
+
export { AreaChart } from '../../../chunk-ZTNHUABC.js';
|
|
3
|
+
export { BarChart } from '../../../chunk-JICACDAV.js';
|
|
4
|
+
export { HeatmapChart } from '../../../chunk-ENZ2HF3I.js';
|
|
5
|
+
export { LineChart } from '../../../chunk-Z2NBLCSD.js';
|
|
6
|
+
export { PieChart } from '../../../chunk-O4QTL2EQ.js';
|
|
7
|
+
export { RadarChart } from '../../../chunk-UFZH45UL.js';
|
|
8
|
+
import '../../../chunk-B7ELF2FN.js';
|
|
9
9
|
import '../../../chunk-QYZT24TS.js';
|
package/dist/index.js
CHANGED
|
@@ -6,9 +6,9 @@ export { Slider } from './chunk-EV2V5RWT.js';
|
|
|
6
6
|
export { ScrollArea, ScrollBar } from './chunk-GLU236NN.js';
|
|
7
7
|
export { Progress } from './chunk-JWQXBRE7.js';
|
|
8
8
|
export { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './chunk-WH62BE24.js';
|
|
9
|
-
export { Heading, headingVariants } from './chunk-
|
|
9
|
+
export { Heading, headingVariants } from './chunk-UXX6HHPS.js';
|
|
10
10
|
export { Popover, PopoverContent, PopoverTrigger } from './chunk-UYT33NG6.js';
|
|
11
|
-
export { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from './chunk-
|
|
11
|
+
export { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from './chunk-C6MJQDPC.js';
|
|
12
12
|
export { Checkbox } from './chunk-756Q7AC5.js';
|
|
13
13
|
export { Separator } from './chunk-CUZJIDU7.js';
|
|
14
14
|
export { Input } from './chunk-AP3XXYAY.js';
|
|
@@ -16,7 +16,7 @@ export { Label } from './chunk-LIBXYD5Q.js';
|
|
|
16
16
|
export { Skeleton } from './chunk-RASEB2XI.js';
|
|
17
17
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './chunk-MJ4CB6ZL.js';
|
|
18
18
|
import './chunk-KRBLVZII.js';
|
|
19
|
-
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './chunk-
|
|
19
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './chunk-3HHLJH72.js';
|
|
20
20
|
export { Avatar, AvatarFallback, AvatarImage } from './chunk-NAAU5IWU.js';
|
|
21
21
|
export { Button, buttonVariants } from './chunk-7KIDDF3I.js';
|
|
22
22
|
import './chunk-6FOHUNXR.js';
|
package/dist/lib/patterns.js
CHANGED
|
@@ -116,14 +116,13 @@ var gridPatterns = [
|
|
|
116
116
|
radial-gradient(at 0% 100%, rgb(var(--color-border) / 0.5) 0px, transparent 50%)
|
|
117
117
|
`
|
|
118
118
|
},
|
|
119
|
-
code: `<div className="w-full min-h-dvh
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
</div>`
|
|
119
|
+
code: `<div className="w-full min-h-dvh" style={{
|
|
120
|
+
backgroundColor: "rgb(var(--color-surface))",
|
|
121
|
+
backgroundImage: \`
|
|
122
|
+
radial-gradient(at 100% 0%, rgb(var(--color-secondary) / 0.5) 0px, transparent 50%),
|
|
123
|
+
radial-gradient(at 0% 100%, rgb(var(--color-border) / 0.5) 0px, transparent 50%)
|
|
124
|
+
\`
|
|
125
|
+
}} />`
|
|
127
126
|
},
|
|
128
127
|
{
|
|
129
128
|
id: "galactic-night",
|
|
@@ -336,6 +336,56 @@ export namespace bloomScales {
|
|
|
336
336
|
12: string;
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
|
+
export const scaleSemantics: {
|
|
340
|
+
1: {
|
|
341
|
+
name: string;
|
|
342
|
+
role: string;
|
|
343
|
+
};
|
|
344
|
+
2: {
|
|
345
|
+
name: string;
|
|
346
|
+
role: string;
|
|
347
|
+
};
|
|
348
|
+
3: {
|
|
349
|
+
name: string;
|
|
350
|
+
role: string;
|
|
351
|
+
};
|
|
352
|
+
4: {
|
|
353
|
+
name: string;
|
|
354
|
+
role: string;
|
|
355
|
+
};
|
|
356
|
+
5: {
|
|
357
|
+
name: string;
|
|
358
|
+
role: string;
|
|
359
|
+
};
|
|
360
|
+
6: {
|
|
361
|
+
name: string;
|
|
362
|
+
role: string;
|
|
363
|
+
};
|
|
364
|
+
7: {
|
|
365
|
+
name: string;
|
|
366
|
+
role: string;
|
|
367
|
+
};
|
|
368
|
+
8: {
|
|
369
|
+
name: string;
|
|
370
|
+
role: string;
|
|
371
|
+
};
|
|
372
|
+
9: {
|
|
373
|
+
name: string;
|
|
374
|
+
role: string;
|
|
375
|
+
};
|
|
376
|
+
10: {
|
|
377
|
+
name: string;
|
|
378
|
+
role: string;
|
|
379
|
+
};
|
|
380
|
+
11: {
|
|
381
|
+
name: string;
|
|
382
|
+
role: string;
|
|
383
|
+
};
|
|
384
|
+
12: {
|
|
385
|
+
name: string;
|
|
386
|
+
role: string;
|
|
387
|
+
};
|
|
388
|
+
};
|
|
339
389
|
export namespace colorTokens {
|
|
340
390
|
export namespace dark_1 {
|
|
341
391
|
let background: string;
|
package/dist/tokens.d.ts
CHANGED
|
@@ -181,8 +181,15 @@ export interface StyleTokens {
|
|
|
181
181
|
arctic: StyleTokenSet;
|
|
182
182
|
bloom: StyleTokenSet;
|
|
183
183
|
}
|
|
184
|
+
/** Semantic role for each step in a 12-step color scale */
|
|
185
|
+
export interface ScaleSemantic {
|
|
186
|
+
name: string;
|
|
187
|
+
role: string;
|
|
188
|
+
}
|
|
189
|
+
export type ScaleSemantics = Record<number, ScaleSemantic>;
|
|
184
190
|
export declare const tokens: DesignTokens;
|
|
185
191
|
export declare const colorTokens: ColorTokens;
|
|
186
192
|
export declare const colorScales: ColorScales;
|
|
187
193
|
export declare const bloomScales: BloomScales;
|
|
188
194
|
export declare const styleTokens: StyleTokens;
|
|
195
|
+
export declare const scaleSemantics: ScaleSemantics;
|
|
@@ -83,6 +83,9 @@ export const nadicodeRules = {
|
|
|
83
83
|
"nadicode/no-handcoded-field": "error",
|
|
84
84
|
"nadicode/require-catalog-component": "error",
|
|
85
85
|
"nadicode/require-catalog-import": "error",
|
|
86
|
+
"nadicode/restrict-font-weight": "error",
|
|
87
|
+
"nadicode/no-glass-on-navigation": "error",
|
|
88
|
+
"nadicode/no-arbitrary-tracking": "error",
|
|
86
89
|
};
|
|
87
90
|
|
|
88
91
|
function normalizePattern(pattern) {
|
|
@@ -70,6 +70,9 @@ import noHandcodedEmptyState from "./rules/no-handcoded-empty-state.js";
|
|
|
70
70
|
import noHandcodedField from "./rules/no-handcoded-field.js";
|
|
71
71
|
import requireCatalogComponent from "./rules/require-catalog-component.js";
|
|
72
72
|
import requireCatalogImport from "./rules/require-catalog-import.js";
|
|
73
|
+
import restrictFontWeight from "./rules/restrict-font-weight.js";
|
|
74
|
+
import noGlassOnNavigation from "./rules/no-glass-on-navigation.js";
|
|
75
|
+
import noArbitraryTracking from "./rules/no-arbitrary-tracking.js";
|
|
73
76
|
|
|
74
77
|
export { nadicodeRules, createAllowlistOverrides } from "./config.js";
|
|
75
78
|
|
|
@@ -147,5 +150,8 @@ export const nadicodePlugin = {
|
|
|
147
150
|
"no-handcoded-field": noHandcodedField,
|
|
148
151
|
"require-catalog-component": requireCatalogComponent,
|
|
149
152
|
"require-catalog-import": requireCatalogImport,
|
|
153
|
+
"restrict-font-weight": restrictFontWeight,
|
|
154
|
+
"no-glass-on-navigation": noGlassOnNavigation,
|
|
155
|
+
"no-arbitrary-tracking": noArbitraryTracking,
|
|
150
156
|
},
|
|
151
157
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { RuleTester } from "eslint";
|
|
2
|
+
import { describe } from "vitest";
|
|
3
|
+
import rule from "../no-arbitrary-tracking.js";
|
|
4
|
+
|
|
5
|
+
const tester = new RuleTester({
|
|
6
|
+
languageOptions: {
|
|
7
|
+
ecmaVersion: "latest",
|
|
8
|
+
sourceType: "module",
|
|
9
|
+
parserOptions: {
|
|
10
|
+
ecmaFeatures: { jsx: true },
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe("no-arbitrary-tracking", () => {
|
|
16
|
+
tester.run("no-arbitrary-tracking", rule, {
|
|
17
|
+
valid: [
|
|
18
|
+
{ code: '<h1 className="tracking-tight text-4xl" />' },
|
|
19
|
+
{ code: '<h2 className="tracking-display" />' },
|
|
20
|
+
{ code: '<span className="tracking-widest uppercase" />' },
|
|
21
|
+
{ code: '<div className={cn("tracking-section", "text-3xl")} />' },
|
|
22
|
+
],
|
|
23
|
+
invalid: [
|
|
24
|
+
{
|
|
25
|
+
code: '<h1 className="tracking-[0.18em] text-4xl" />',
|
|
26
|
+
errors: [
|
|
27
|
+
{
|
|
28
|
+
message:
|
|
29
|
+
"Arbitrary tracking value 'tracking-[0.18em]' is not allowed. Use a design token: tracking-display (-0.04em), tracking-section (-0.03em), tracking-sub (-0.02em), tracking-tight (-0.025em), tracking-normal (0), tracking-wide (0.025em), tracking-wider (0.05em), tracking-widest (0.1em).",
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
code: '<span className="tracking-[-0.05em]" />',
|
|
35
|
+
errors: [
|
|
36
|
+
{
|
|
37
|
+
message:
|
|
38
|
+
"Arbitrary tracking value 'tracking-[-0.05em]' is not allowed. Use a design token: tracking-display (-0.04em), tracking-section (-0.03em), tracking-sub (-0.02em), tracking-tight (-0.025em), tracking-normal (0), tracking-wide (0.025em), tracking-wider (0.05em), tracking-widest (0.1em).",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
code: '<div className={cn("tracking-[0.2em]", "text-sm")} />',
|
|
44
|
+
errors: [
|
|
45
|
+
{
|
|
46
|
+
message:
|
|
47
|
+
"Arbitrary tracking value 'tracking-[0.2em]' is not allowed. Use a design token: tracking-display (-0.04em), tracking-section (-0.03em), tracking-sub (-0.02em), tracking-tight (-0.025em), tracking-normal (0), tracking-wide (0.025em), tracking-wider (0.05em), tracking-widest (0.1em).",
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { RuleTester } from "eslint";
|
|
2
|
+
import { describe } from "vitest";
|
|
3
|
+
import rule from "../no-glass-on-navigation.js";
|
|
4
|
+
|
|
5
|
+
const tester = new RuleTester({
|
|
6
|
+
languageOptions: {
|
|
7
|
+
ecmaVersion: "latest",
|
|
8
|
+
sourceType: "module",
|
|
9
|
+
parserOptions: {
|
|
10
|
+
ecmaFeatures: { jsx: true },
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe("no-glass-on-navigation", () => {
|
|
16
|
+
tester.run("no-glass-on-navigation", rule, {
|
|
17
|
+
valid: [
|
|
18
|
+
{ code: '<Sidebar className="bg-sidebar border-r" />' },
|
|
19
|
+
{ code: '<div className="glass-panel" />' },
|
|
20
|
+
{ code: '<SidebarMenu className="bg-transparent" />' },
|
|
21
|
+
{ code: '<nav className="bg-surface" />' },
|
|
22
|
+
],
|
|
23
|
+
invalid: [
|
|
24
|
+
{
|
|
25
|
+
code: '<Sidebar className="glass-sidebar bg-sidebar" />',
|
|
26
|
+
errors: [
|
|
27
|
+
{
|
|
28
|
+
message:
|
|
29
|
+
"Glass class 'glass-sidebar' is not allowed on navigation element <Sidebar>. Use flat bg-sidebar or bg-surface instead.",
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
code: '<nav className="glass-panel" />',
|
|
35
|
+
errors: [
|
|
36
|
+
{
|
|
37
|
+
message:
|
|
38
|
+
"Glass class 'glass-panel' is not allowed on navigation element <nav>. Use flat bg-sidebar or bg-surface instead.",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
code: '<SidebarMenu className="glass-floating" />',
|
|
44
|
+
errors: [
|
|
45
|
+
{
|
|
46
|
+
message:
|
|
47
|
+
"Glass class 'glass-floating' is not allowed on navigation element <SidebarMenu>. Use flat bg-sidebar or bg-surface instead.",
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
code: '<NavigationShell className={cn("glass-panel", "p-4")} />',
|
|
53
|
+
errors: [
|
|
54
|
+
{
|
|
55
|
+
message:
|
|
56
|
+
"Glass class 'glass-panel' is not allowed on navigation element <NavigationShell>. Use flat bg-sidebar or bg-surface instead.",
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { RuleTester } from "eslint";
|
|
2
|
+
import { describe } from "vitest";
|
|
3
|
+
import rule from "../restrict-font-weight.js";
|
|
4
|
+
|
|
5
|
+
const tester = new RuleTester({
|
|
6
|
+
languageOptions: {
|
|
7
|
+
ecmaVersion: "latest",
|
|
8
|
+
sourceType: "module",
|
|
9
|
+
parserOptions: {
|
|
10
|
+
ecmaFeatures: { jsx: true },
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe("restrict-font-weight", () => {
|
|
16
|
+
tester.run("restrict-font-weight", rule, {
|
|
17
|
+
valid: [
|
|
18
|
+
{ code: '<div className="font-normal text-lg" />' },
|
|
19
|
+
{ code: '<div className="font-medium" />' },
|
|
20
|
+
{ code: '<div className="font-semibold tracking-tight" />' },
|
|
21
|
+
{ code: '<div className={cn("font-medium", "text-sm")} />' },
|
|
22
|
+
{ code: '<div style={{ fontWeight: 400 }} />' },
|
|
23
|
+
{ code: '<div style={{ fontWeight: 500 }} />' },
|
|
24
|
+
{ code: '<div style={{ fontWeight: 600 }} />' },
|
|
25
|
+
{ code: '<div style={{ fontWeight: "normal" }} />' },
|
|
26
|
+
],
|
|
27
|
+
invalid: [
|
|
28
|
+
{
|
|
29
|
+
code: '<div className="font-bold text-lg" />',
|
|
30
|
+
errors: [
|
|
31
|
+
{
|
|
32
|
+
message:
|
|
33
|
+
"Forbidden font weight 'font-bold'. Use font-normal (400), font-medium (500), or font-semibold (600).",
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
code: '<div className="font-extrabold" />',
|
|
39
|
+
errors: [
|
|
40
|
+
{
|
|
41
|
+
message:
|
|
42
|
+
"Forbidden font weight 'font-extrabold'. Use font-normal (400), font-medium (500), or font-semibold (600).",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
code: '<div className="font-light" />',
|
|
48
|
+
errors: [
|
|
49
|
+
{
|
|
50
|
+
message:
|
|
51
|
+
"Forbidden font weight 'font-light'. Use font-normal (400), font-medium (500), or font-semibold (600).",
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
code: '<div className={cn("font-bold", "text-sm")} />',
|
|
57
|
+
errors: [
|
|
58
|
+
{
|
|
59
|
+
message:
|
|
60
|
+
"Forbidden font weight 'font-bold'. Use font-normal (400), font-medium (500), or font-semibold (600).",
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
code: '<div style={{ fontWeight: 700 }} />',
|
|
66
|
+
errors: [
|
|
67
|
+
{
|
|
68
|
+
message:
|
|
69
|
+
"Forbidden font weight '700'. Use font-normal (400), font-medium (500), or font-semibold (600).",
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
});
|
|
75
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFilename,
|
|
3
|
+
isTestFile,
|
|
4
|
+
getClassTokensFromAttribute,
|
|
5
|
+
getClassTokensFromHelperCall,
|
|
6
|
+
isClassHelperCall,
|
|
7
|
+
} from "../utils.js";
|
|
8
|
+
|
|
9
|
+
const ARBITRARY_TRACKING_RE = /\btracking-\[[^\]]*\]/;
|
|
10
|
+
|
|
11
|
+
function findArbitraryTracking(tokens) {
|
|
12
|
+
for (const t of tokens) {
|
|
13
|
+
const match = t.match(ARBITRARY_TRACKING_RE);
|
|
14
|
+
if (match) return match[0];
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const rule = {
|
|
20
|
+
meta: {
|
|
21
|
+
type: "problem",
|
|
22
|
+
docs: {
|
|
23
|
+
description:
|
|
24
|
+
"Disallow arbitrary letter-spacing values. Use design token tracking classes instead.",
|
|
25
|
+
},
|
|
26
|
+
schema: [],
|
|
27
|
+
},
|
|
28
|
+
create(context) {
|
|
29
|
+
const filename = getFilename(context);
|
|
30
|
+
if (isTestFile(filename)) return {};
|
|
31
|
+
|
|
32
|
+
function report(node, value) {
|
|
33
|
+
context.report({
|
|
34
|
+
node,
|
|
35
|
+
message:
|
|
36
|
+
"Arbitrary tracking value '{{value}}' is not allowed. Use a design token: tracking-display (-0.04em), tracking-section (-0.03em), tracking-sub (-0.02em), tracking-tight (-0.025em), tracking-normal (0), tracking-wide (0.025em), tracking-wider (0.05em), tracking-widest (0.1em).",
|
|
37
|
+
data: { value },
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
JSXAttribute(node) {
|
|
43
|
+
if (
|
|
44
|
+
node.name?.name !== "className" &&
|
|
45
|
+
node.name?.name !== "class"
|
|
46
|
+
) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (
|
|
51
|
+
node.value?.type === "JSXExpressionContainer" &&
|
|
52
|
+
isClassHelperCall(node.value.expression)
|
|
53
|
+
) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const tokens = getClassTokensFromAttribute(node);
|
|
58
|
+
const match = findArbitraryTracking(tokens);
|
|
59
|
+
if (match) report(node, match);
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
CallExpression(node) {
|
|
63
|
+
if (!isClassHelperCall(node)) return;
|
|
64
|
+
const tokens = getClassTokensFromHelperCall(node);
|
|
65
|
+
const match = findArbitraryTracking(tokens);
|
|
66
|
+
if (match) report(node, match);
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default rule;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFilename,
|
|
3
|
+
isTestFile,
|
|
4
|
+
getClassTokensFromAttribute,
|
|
5
|
+
getClassTokensFromHelperCall,
|
|
6
|
+
isClassHelperCall,
|
|
7
|
+
} from "../utils.js";
|
|
8
|
+
|
|
9
|
+
const GLASS_RE = /\bglass-(panel|floating|overlay|sidebar|tab-bar|tab-active)\b/;
|
|
10
|
+
const NAV_ELEMENT_RE =
|
|
11
|
+
/^(Sidebar|SidebarMenu|SidebarGroup|Nav|NavBar|TabBar|NavigationMenu|NavigationShell)$/i;
|
|
12
|
+
|
|
13
|
+
function findGlassClass(tokens) {
|
|
14
|
+
for (const t of tokens) {
|
|
15
|
+
const match = t.match(GLASS_RE);
|
|
16
|
+
if (match) return match[0];
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function getJSXElementName(node) {
|
|
22
|
+
if (!node || node.type !== "JSXOpeningElement") return null;
|
|
23
|
+
const { name } = node;
|
|
24
|
+
if (name.type === "JSXIdentifier") return name.name;
|
|
25
|
+
if (name.type === "JSXMemberExpression" && name.property.type === "JSXIdentifier") {
|
|
26
|
+
return name.property.name;
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const rule = {
|
|
32
|
+
meta: {
|
|
33
|
+
type: "problem",
|
|
34
|
+
docs: {
|
|
35
|
+
description:
|
|
36
|
+
"Disallow glass classes on structural/navigation elements. Use flat bg-sidebar or bg-surface instead.",
|
|
37
|
+
},
|
|
38
|
+
schema: [],
|
|
39
|
+
},
|
|
40
|
+
create(context) {
|
|
41
|
+
const filename = getFilename(context);
|
|
42
|
+
if (isTestFile(filename)) return {};
|
|
43
|
+
|
|
44
|
+
function isNavigationElement(elementName) {
|
|
45
|
+
if (!elementName) return false;
|
|
46
|
+
if (elementName === "nav") return true;
|
|
47
|
+
return NAV_ELEMENT_RE.test(elementName);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function report(node, glassClass, element) {
|
|
51
|
+
context.report({
|
|
52
|
+
node,
|
|
53
|
+
message:
|
|
54
|
+
"Glass class '{{glassClass}}' is not allowed on navigation element <{{element}}>. Use flat bg-sidebar or bg-surface instead.",
|
|
55
|
+
data: { glassClass, element },
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
JSXAttribute(node) {
|
|
61
|
+
if (
|
|
62
|
+
node.name?.name !== "className" &&
|
|
63
|
+
node.name?.name !== "class"
|
|
64
|
+
) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const openingElement = node.parent;
|
|
69
|
+
const elementName = getJSXElementName(openingElement);
|
|
70
|
+
if (!isNavigationElement(elementName)) return;
|
|
71
|
+
|
|
72
|
+
// Skip if value is a class helper call — handled by CallExpression
|
|
73
|
+
if (
|
|
74
|
+
node.value?.type === "JSXExpressionContainer" &&
|
|
75
|
+
isClassHelperCall(node.value.expression)
|
|
76
|
+
) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const tokens = getClassTokensFromAttribute(node);
|
|
81
|
+
const match = findGlassClass(tokens);
|
|
82
|
+
if (match) report(node, match, elementName);
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
CallExpression(node) {
|
|
86
|
+
if (!isClassHelperCall(node)) return;
|
|
87
|
+
|
|
88
|
+
// Walk up to find enclosing JSX element
|
|
89
|
+
let current = node.parent;
|
|
90
|
+
while (current) {
|
|
91
|
+
if (current.type === "JSXOpeningElement") {
|
|
92
|
+
const elementName = getJSXElementName(current);
|
|
93
|
+
if (isNavigationElement(elementName)) {
|
|
94
|
+
const tokens = getClassTokensFromHelperCall(node);
|
|
95
|
+
const match = findGlassClass(tokens);
|
|
96
|
+
if (match) report(node, match, elementName);
|
|
97
|
+
}
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Stop at component/function boundaries
|
|
101
|
+
if (
|
|
102
|
+
current.type === "FunctionDeclaration" ||
|
|
103
|
+
current.type === "FunctionExpression" ||
|
|
104
|
+
current.type === "ArrowFunctionExpression"
|
|
105
|
+
) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
current = current.parent;
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export default rule;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFilename,
|
|
3
|
+
isTestFile,
|
|
4
|
+
getClassTokensFromAttribute,
|
|
5
|
+
getClassTokensFromHelperCall,
|
|
6
|
+
isClassHelperCall,
|
|
7
|
+
getStyleObjectProperties,
|
|
8
|
+
getStaticStyleValue,
|
|
9
|
+
} from "../utils.js";
|
|
10
|
+
|
|
11
|
+
const FORBIDDEN_WEIGHT_RE =
|
|
12
|
+
/\bfont-(bold|extrabold|black|light|thin|extralight)\b/;
|
|
13
|
+
|
|
14
|
+
const ALLOWED_STYLE_VALUES = new Set([
|
|
15
|
+
"400",
|
|
16
|
+
"500",
|
|
17
|
+
"600",
|
|
18
|
+
"normal",
|
|
19
|
+
"medium",
|
|
20
|
+
"semibold",
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
function findForbiddenWeight(tokens) {
|
|
24
|
+
for (const t of tokens) {
|
|
25
|
+
const match = t.match(FORBIDDEN_WEIGHT_RE);
|
|
26
|
+
if (match) return match[0];
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const rule = {
|
|
32
|
+
meta: {
|
|
33
|
+
type: "problem",
|
|
34
|
+
docs: {
|
|
35
|
+
description:
|
|
36
|
+
"Prevent unauthorized font weights. Only font-normal (400), font-medium (500), and font-semibold (600) are allowed.",
|
|
37
|
+
},
|
|
38
|
+
schema: [],
|
|
39
|
+
},
|
|
40
|
+
create(context) {
|
|
41
|
+
const filename = getFilename(context);
|
|
42
|
+
if (isTestFile(filename)) return {};
|
|
43
|
+
|
|
44
|
+
function reportWeight(node, weight) {
|
|
45
|
+
context.report({
|
|
46
|
+
node,
|
|
47
|
+
message:
|
|
48
|
+
"Forbidden font weight '{{weight}}'. Use font-normal (400), font-medium (500), or font-semibold (600).",
|
|
49
|
+
data: { weight },
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
JSXAttribute(node) {
|
|
55
|
+
// className attribute — skip if value is a class helper call
|
|
56
|
+
if (
|
|
57
|
+
node.name?.name === "className" ||
|
|
58
|
+
node.name?.name === "class"
|
|
59
|
+
) {
|
|
60
|
+
if (
|
|
61
|
+
node.value?.type === "JSXExpressionContainer" &&
|
|
62
|
+
isClassHelperCall(node.value.expression)
|
|
63
|
+
) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const tokens = getClassTokensFromAttribute(node);
|
|
67
|
+
const match = findForbiddenWeight(tokens);
|
|
68
|
+
if (match) reportWeight(node, match);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// style attribute — check fontWeight
|
|
73
|
+
if (node.name?.name === "style") {
|
|
74
|
+
const props = getStyleObjectProperties(node);
|
|
75
|
+
for (const { propertyName, valueNode, reportNode } of props) {
|
|
76
|
+
if (propertyName !== "fontWeight") continue;
|
|
77
|
+
const value = getStaticStyleValue(valueNode);
|
|
78
|
+
if (value !== null && !ALLOWED_STYLE_VALUES.has(String(value))) {
|
|
79
|
+
reportWeight(reportNode, value);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
CallExpression(node) {
|
|
86
|
+
if (!isClassHelperCall(node)) return;
|
|
87
|
+
const tokens = getClassTokensFromHelperCall(node);
|
|
88
|
+
const match = findForbiddenWeight(tokens);
|
|
89
|
+
if (match) reportWeight(node, match);
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export default rule;
|